Skip to content

Commit

Permalink
Hotline Protocol: DDigital I/O control over RS485
Browse files Browse the repository at this point in the history
- Protocol: Docs and Implementation
- fire/: rs485 receiver using hotline for control of effect heads, pilots, etc.
- controller/: 13 input (with 1 broadcast) rs485 transmitter using Hotline
- added to ci
  • Loading branch information
twoshark committed Jul 14, 2024
1 parent 3890d00 commit 10ad627
Show file tree
Hide file tree
Showing 39 changed files with 2,014 additions and 71 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/rust_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
crate: ["relay", "wifi", "dc"]
crate: ["relay", "wifi", "dc", "controller", "fire", "hotline"]
action:
# - command: check
# args: --target=xtensa-esp32-espidf --release
Expand All @@ -37,7 +37,10 @@ jobs:
uses: Swatinem/rust-cache@v2
with:
workspaces: "relay/ -> target
wifi/ -> target"
wifi/ -> target
controller/ -> target
fire/ -> target"

- name: Xtensa rustup target
run: espup install
- name: Source espup script
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ target/

# jetbrains
.idea
**/.idea

/.embuild
8 changes: 8 additions & 0 deletions controller/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[build]
target = "avr-specs/avr-atmega2560.json"

[target.'cfg(target_arch = "avr")']
runner = "ravedude mega2560 -cb 57600"

[unstable]
build-std = ["core"]
1 change: 1 addition & 0 deletions controller/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
271 changes: 271 additions & 0 deletions controller/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions controller/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[package]
name = "controller"
version = "0.1.0"
authors = ["Tushar Shah <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"

[[bin]]
name = "controller"
test = false
bench = false

[dependencies]
panic-halt = "0.2.0"
ufmt = "0.2.0"
nb = "0.1.2"
embedded-hal = "0.2.3"
max485 = "0.2.0"
hotline = { path = "../hotline" }

[dependencies.arduino-hal]
git = "https://github.com/rahix/avr-hal"
rev = "3e362624547462928a219c40f9ea8e3a64f21e5f"
features = ["arduino-mega2560"]

# The latest releases of `proc-macro2` do not support the rust toolchain that
# we use. Thus, we must fix this dependency to an older version where our
# toolchain is still supported. See https://github.com/Rahix/avr-hal/issues/537
[build-dependencies.proc-macro2]
version = "=1.0.79"

# Configure the build for minimal size - AVRs have very little program memory
[profile.dev]
panic = "abort"
lto = true
opt-level = "s"

[profile.release]
panic = "abort"
codegen-units = 1
debug = true
lto = true
opt-level = "s"
29 changes: 29 additions & 0 deletions controller/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
controller
========

Rust project for the _Arduino Mega 2560_.

## Build Instructions
1. Install prerequisites as described in the [`avr-hal` README] (`avr-gcc`, `avr-libc`, `avrdude`, [`ravedude`]).

2. Run `cargo build` to build the firmware.

3. Run `cargo run` to flash the firmware to a connected board. If `ravedude`
fails to detect your board, check its documentation at
<https://crates.io/crates/ravedude>.

4. `ravedude` will open a console session after flashing where you can interact
with the UART console of your board.

[`avr-hal` README]: https://github.com/Rahix/avr-hal#readme
[`ravedude`]: https://crates.io/crates/ravedude

## License
Licensed under:
- MIT license
([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>)

## Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.
Loading

0 comments on commit 10ad627

Please sign in to comment.