Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion boards/wio_terminal/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[target.thumbv7em-none-eabihf]
runner = "arm-none-eabi-gdb"
runner = "/home/cooler1989/programs/cgdb/cgdb/cgdb -d gdb-multiarch -x openocd.gdb"
# -ex "mon reset halt" --ex "load" -ex "mon reset halt"
#runner = "arm-none-eabi-gdb"
#runner = 'probe-run --chip ATSAMD51P19A'

[build]
Expand Down
38 changes: 33 additions & 5 deletions boards/wio_terminal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ chip = "ATSAMD51P19A"

[dependencies]
bitfield = "0.13"
modular-bitfield = "0.12"
fugit = "0.3.7"
cortex-m-rt = { version = "0.7", optional = true }

embedded-hal-bus = "0.3.0"
Expand All @@ -44,29 +46,51 @@ nb = "1.0"
bbqueue = { version = "0.5", optional = true }
generic-array = { version = "0.14", optional = true }
seeed-erpc = { version = "0.1.3", optional = true }
defmt = "0.3"
defmt-rtt = "0.4"
embassy-sync = { version = "0.6" }
embassy-futures = { version = "0.1.0" }
embassy-executor = { version = "0.7.0", features = [
"arch-cortex-m",
"executor-thread",
"task-arena-size-12288",
] }
rtic-monotonics = { version = "2.0.1", features = ["cortex-m-systick"] }

# Opentherm project specific dependnecies:
opentherm_boiler_controller_lib = { version = "0.1.0", git = "ssh://[email protected]/learn-rust/boiler_controller_ot_lib.git", branch = "passing_around_slices_instead_of_iterators", features = [
], optional = true }

[dependencies.cortex-m]
features = ["critical-section-single-core"]
version = "0.7"

[dependencies.atsamd-hal]
version = "0.21.0"
path = "../../hal"
version = "0.22.0"
default-features = false

[dev-dependencies]
usbd-serial = "0.2"
embedded-graphics = "0.8.1"
panic-probe = "0.3"
panic-halt = "0.2"
panic-semihosting = "0.5"
cortex-m-semihosting = "0.3"
oorandom = "11.1.3"
nom = { version = "8.0", default-features = false }

[features]
default = ["atsamd-hal/samd51p", "rt", "usb", "wifi"]
default = ["atsamd-hal/samd51p", "rt", "usb", "wifi", "dma", "async", "use_opentherm"]
rt = ["atsamd-hal/samd51p-rt", "cortex-m-rt"]
usb = ["atsamd-hal/usb", "usb-device"]
# enable feature for RTL8720 firmware older than 2.1.2
wifi-fw-before-212 = []
wifi = ["bbqueue", "generic-array", "seeed-erpc"]
dma = ["atsamd-hal/dma"]
async = ["atsamd-hal/async"]
use_semihosting = []
use_opentherm = ["opentherm_boiler_controller_lib"]

[[example]]
name = "blinky"
Expand All @@ -78,9 +102,9 @@ name = "buttons"
name = "clock"
required-features = ["usb"]

[[example]]
name = "microphone"

# [[example]]
# name = "microphone"
[[example]]
name = "orientation"

Expand All @@ -91,6 +115,10 @@ required-features = ["usb"]
[[example]]
name = "sdcard"

[[example]]
name = "async_opentherm"
required-features = ["async"]

[[example]]
name = "qspi"

Expand Down
34 changes: 23 additions & 11 deletions boards/wio_terminal/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# `wio-terminal`

High Level TODOs:

- Implement capture timer driver, capable of timeouts of around 800ms, best to return after 10ms of idle activity but only if some activity has been detected.
- Add confugiration option to use second Grove port to realize Master version of the OpenTherm protocol

[![Crates.io](https://img.shields.io/crates/v/wio-terminal.svg)](https://crates.io/crates/wio-terminal)
[![Docs](https://docs.rs/wio-terminal/badge.svg)](https://docs.rs/wio-terminal/)
![License](https://img.shields.io/badge/License-MIT%20OR%20Apache--2.0-blue)
Expand All @@ -8,21 +13,21 @@

This project is made possible thanks to the following crates:

* [atsamd-hal](https://github.com/atsamd-rs/atsamd)
* [ili9341-rs](https://github.com/yuri91/ili9341-rs)
* [lis3dh-rs](https://github.com/BenBergman/lis3dh-rs)
* [embedded-sdmmc](https://github.com/rust-embedded-community/embedded-sdmmc-rs)
* [seeed-erpc-rs](https://github.com/twitchyliquid64/seeed-erpc-rs)
- [atsamd-hal](https://github.com/atsamd-rs/atsamd)
- [ili9341-rs](https://github.com/yuri91/ili9341-rs)
- [lis3dh-rs](https://github.com/BenBergman/lis3dh-rs)
- [embedded-sdmmc](https://github.com/rust-embedded-community/embedded-sdmmc-rs)
- [seeed-erpc-rs](https://github.com/twitchyliquid64/seeed-erpc-rs)

## [Documentation]

[Documentation]: https://docs.rs/wio-terminal/

## Resources

* [Wio Terminal product page](https://www.seeedstudio.com/Wio-Terminal-p-4509.html)
* [Wio Terminal wiki](https://wiki.seeedstudio.com/Wio-Terminal-Getting-Started/)
* [Wio Terminal user manual](https://files.seeedstudio.com/wiki/Wio-Terminal/res/Wio-Terminal-User-Manual.pdf)
- [Wio Terminal product page](https://www.seeedstudio.com/Wio-Terminal-p-4509.html)
- [Wio Terminal wiki](https://wiki.seeedstudio.com/Wio-Terminal-Getting-Started/)
- [Wio Terminal user manual](https://files.seeedstudio.com/wiki/Wio-Terminal/res/Wio-Terminal-User-Manual.pdf)

## Display

Expand All @@ -42,9 +47,9 @@ For information on building and flashing the examples to your device, as well as

Licensed under either of:

* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or
http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or
<http://www.apache.org/licenses/LICENSE-2.0>)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>)

at your option.

Expand All @@ -53,3 +58,10 @@ at your option.
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.

### Lessons learned

If you want to expand macro for hal drivers go to hal/ and use:

cargo install cargo-expand
CARGO_NET_GIT_FETCH_WITH_CLI=true cargo expand --features "samd51p, async, dma" peripherals::timer_capture_waveform > peripherals_timer_capture_waveform.rs
4 changes: 4 additions & 0 deletions boards/wio_terminal/build_async_opentherm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CARGO_NET_GIT_FETCH_WITH_CLI=true cargo build --example async_opentherm
objcopy -I elf32-little -O binary ../../target/thumbv7em-none-eabihf/debug/examples/async_opentherm async_opentherm.bin
export BINARY_FILE=async_opentherm.bin; gdb-multiarch --batch asyn_opentherm.bin --ex "target remote localhost:3333" --ex "mon reset halt" --ex "mon program $(readlink -f ${BINARY_FILE}) 0x00000 verify"
# export BINARY_FILE=async_opentherm.bin; /home/cooler1989/programs/cgdb/cgdb/cgdb -d gdb-multiarch ../../target/thumbv7em-none-eabihf/debug/examples/async_opentherm --ex "target remote localhost:3333" --ex "mon reset halt" -ex "mon arm semihosting enable" -ex "mon arm semihosting_redirect tcp 2999"
Loading
Loading