diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/nrf52840/.cargo/config.toml (renamed from examples/nrf/.cargo/config.toml) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/Cargo.toml (renamed from examples/nrf/Cargo.toml) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/build.rs (renamed from examples/nrf/build.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/memory.x (renamed from examples/nrf/memory.x) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/awaitable_timer.rs (renamed from examples/nrf/src/bin/awaitable_timer.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/blinky.rs (renamed from examples/nrf/src/bin/blinky.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/buffered_uart.rs (renamed from examples/nrf/src/bin/buffered_uart.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/channel.rs (renamed from examples/nrf/src/bin/channel.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/channel_sender_receiver.rs (renamed from examples/nrf/src/bin/channel_sender_receiver.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/executor_fairness_test.rs (renamed from examples/nrf/src/bin/executor_fairness_test.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/gpiote_channel.rs (renamed from examples/nrf/src/bin/gpiote_channel.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/gpiote_port.rs (renamed from examples/nrf/src/bin/gpiote_port.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/i2s_effect.rs (renamed from examples/nrf/src/bin/i2s_effect.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/i2s_monitor.rs (renamed from examples/nrf/src/bin/i2s_monitor.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/i2s_waveform.rs (renamed from examples/nrf/src/bin/i2s_waveform.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/lora_p2p_report.rs (renamed from examples/nrf/src/bin/lora_p2p_report.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/lora_p2p_sense.rs (renamed from examples/nrf/src/bin/lora_p2p_sense.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/manually_create_executor.rs (renamed from examples/nrf/src/bin/manually_create_executor.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/multiprio.rs (renamed from examples/nrf/src/bin/multiprio.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/mutex.rs (renamed from examples/nrf/src/bin/mutex.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/nvmc.rs (renamed from examples/nrf/src/bin/nvmc.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/pdm.rs (renamed from examples/nrf/src/bin/pdm.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/ppi.rs (renamed from examples/nrf/src/bin/ppi.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/pubsub.rs (renamed from examples/nrf/src/bin/pubsub.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/pwm.rs (renamed from examples/nrf/src/bin/pwm.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/pwm_double_sequence.rs (renamed from examples/nrf/src/bin/pwm_double_sequence.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/pwm_sequence.rs (renamed from examples/nrf/src/bin/pwm_sequence.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/pwm_sequence_ppi.rs (renamed from examples/nrf/src/bin/pwm_sequence_ppi.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/pwm_sequence_ws2812b.rs (renamed from examples/nrf/src/bin/pwm_sequence_ws2812b.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/pwm_servo.rs (renamed from examples/nrf/src/bin/pwm_servo.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/qdec.rs (renamed from examples/nrf/src/bin/qdec.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/qspi.rs (renamed from examples/nrf/src/bin/qspi.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/qspi_lowpower.rs (renamed from examples/nrf/src/bin/qspi_lowpower.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/raw_spawn.rs (renamed from examples/nrf/src/bin/raw_spawn.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/rng.rs (renamed from examples/nrf/src/bin/rng.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/saadc.rs (renamed from examples/nrf/src/bin/saadc.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/saadc_continuous.rs (renamed from examples/nrf/src/bin/saadc_continuous.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/self_spawn.rs (renamed from examples/nrf/src/bin/self_spawn.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/self_spawn_current_executor.rs (renamed from examples/nrf/src/bin/self_spawn_current_executor.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/spim.rs (renamed from examples/nrf/src/bin/spim.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/spis.rs (renamed from examples/nrf/src/bin/spis.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/temp.rs (renamed from examples/nrf/src/bin/temp.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/timer.rs (renamed from examples/nrf/src/bin/timer.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/twim.rs (renamed from examples/nrf/src/bin/twim.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/twim_lowpower.rs (renamed from examples/nrf/src/bin/twim_lowpower.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/twis.rs (renamed from examples/nrf/src/bin/twis.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/uart.rs (renamed from examples/nrf/src/bin/uart.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/uart_idle.rs (renamed from examples/nrf/src/bin/uart_idle.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/uart_split.rs (renamed from examples/nrf/src/bin/uart_split.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/usb_ethernet.rs (renamed from examples/nrf/src/bin/usb_ethernet.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/usb_hid_keyboard.rs (renamed from examples/nrf/src/bin/usb_hid_keyboard.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/usb_hid_mouse.rs (renamed from examples/nrf/src/bin/usb_hid_mouse.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/usb_serial.rs (renamed from examples/nrf/src/bin/usb_serial.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/usb_serial_multitask.rs (renamed from examples/nrf/src/bin/usb_serial_multitask.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/wdt.rs (renamed from examples/nrf/src/bin/wdt.rs) | 0 | ||||
| -rw-r--r-- | examples/nrf5340/.cargo/config.toml | 9 | ||||
| -rw-r--r-- | examples/nrf5340/Cargo.toml | 64 | ||||
| -rw-r--r-- | examples/nrf5340/build.rs | 35 | ||||
| -rw-r--r-- | examples/nrf5340/memory.x | 7 | ||||
| -rw-r--r-- | examples/nrf5340/src/bin/blinky.rs | 21 | ||||
| -rw-r--r-- | examples/nrf5340/src/bin/gpiote_channel.rs | 66 | ||||
| -rw-r--r-- | examples/nrf5340/src/bin/uart.rs | 35 |
62 files changed, 237 insertions, 0 deletions
diff --git a/examples/nrf/.cargo/config.toml b/examples/nrf52840/.cargo/config.toml index 8ca28df39..8ca28df39 100644 --- a/examples/nrf/.cargo/config.toml +++ b/examples/nrf52840/.cargo/config.toml | |||
diff --git a/examples/nrf/Cargo.toml b/examples/nrf52840/Cargo.toml index 994823a9e..994823a9e 100644 --- a/examples/nrf/Cargo.toml +++ b/examples/nrf52840/Cargo.toml | |||
diff --git a/examples/nrf/build.rs b/examples/nrf52840/build.rs index 30691aa97..30691aa97 100644 --- a/examples/nrf/build.rs +++ b/examples/nrf52840/build.rs | |||
diff --git a/examples/nrf/memory.x b/examples/nrf52840/memory.x index 9b04edec0..9b04edec0 100644 --- a/examples/nrf/memory.x +++ b/examples/nrf52840/memory.x | |||
diff --git a/examples/nrf/src/bin/awaitable_timer.rs b/examples/nrf52840/src/bin/awaitable_timer.rs index b32af236c..b32af236c 100644 --- a/examples/nrf/src/bin/awaitable_timer.rs +++ b/examples/nrf52840/src/bin/awaitable_timer.rs | |||
diff --git a/examples/nrf/src/bin/blinky.rs b/examples/nrf52840/src/bin/blinky.rs index 513f6cd82..513f6cd82 100644 --- a/examples/nrf/src/bin/blinky.rs +++ b/examples/nrf52840/src/bin/blinky.rs | |||
diff --git a/examples/nrf/src/bin/buffered_uart.rs b/examples/nrf52840/src/bin/buffered_uart.rs index ea566f4b2..ea566f4b2 100644 --- a/examples/nrf/src/bin/buffered_uart.rs +++ b/examples/nrf52840/src/bin/buffered_uart.rs | |||
diff --git a/examples/nrf/src/bin/channel.rs b/examples/nrf52840/src/bin/channel.rs index d782a79e7..d782a79e7 100644 --- a/examples/nrf/src/bin/channel.rs +++ b/examples/nrf52840/src/bin/channel.rs | |||
diff --git a/examples/nrf/src/bin/channel_sender_receiver.rs b/examples/nrf52840/src/bin/channel_sender_receiver.rs index fcccdaed5..fcccdaed5 100644 --- a/examples/nrf/src/bin/channel_sender_receiver.rs +++ b/examples/nrf52840/src/bin/channel_sender_receiver.rs | |||
diff --git a/examples/nrf/src/bin/executor_fairness_test.rs b/examples/nrf52840/src/bin/executor_fairness_test.rs index 2a28f2763..2a28f2763 100644 --- a/examples/nrf/src/bin/executor_fairness_test.rs +++ b/examples/nrf52840/src/bin/executor_fairness_test.rs | |||
diff --git a/examples/nrf/src/bin/gpiote_channel.rs b/examples/nrf52840/src/bin/gpiote_channel.rs index 5bfd02465..5bfd02465 100644 --- a/examples/nrf/src/bin/gpiote_channel.rs +++ b/examples/nrf52840/src/bin/gpiote_channel.rs | |||
diff --git a/examples/nrf/src/bin/gpiote_port.rs b/examples/nrf52840/src/bin/gpiote_port.rs index 0155d539e..0155d539e 100644 --- a/examples/nrf/src/bin/gpiote_port.rs +++ b/examples/nrf52840/src/bin/gpiote_port.rs | |||
diff --git a/examples/nrf/src/bin/i2s_effect.rs b/examples/nrf52840/src/bin/i2s_effect.rs index 3cca005b1..3cca005b1 100644 --- a/examples/nrf/src/bin/i2s_effect.rs +++ b/examples/nrf52840/src/bin/i2s_effect.rs | |||
diff --git a/examples/nrf/src/bin/i2s_monitor.rs b/examples/nrf52840/src/bin/i2s_monitor.rs index 48eb7d581..48eb7d581 100644 --- a/examples/nrf/src/bin/i2s_monitor.rs +++ b/examples/nrf52840/src/bin/i2s_monitor.rs | |||
diff --git a/examples/nrf/src/bin/i2s_waveform.rs b/examples/nrf52840/src/bin/i2s_waveform.rs index 1b0e8ebc8..1b0e8ebc8 100644 --- a/examples/nrf/src/bin/i2s_waveform.rs +++ b/examples/nrf52840/src/bin/i2s_waveform.rs | |||
diff --git a/examples/nrf/src/bin/lora_p2p_report.rs b/examples/nrf52840/src/bin/lora_p2p_report.rs index d512b83f6..d512b83f6 100644 --- a/examples/nrf/src/bin/lora_p2p_report.rs +++ b/examples/nrf52840/src/bin/lora_p2p_report.rs | |||
diff --git a/examples/nrf/src/bin/lora_p2p_sense.rs b/examples/nrf52840/src/bin/lora_p2p_sense.rs index b9768874b..b9768874b 100644 --- a/examples/nrf/src/bin/lora_p2p_sense.rs +++ b/examples/nrf52840/src/bin/lora_p2p_sense.rs | |||
diff --git a/examples/nrf/src/bin/manually_create_executor.rs b/examples/nrf52840/src/bin/manually_create_executor.rs index 12ce660f9..12ce660f9 100644 --- a/examples/nrf/src/bin/manually_create_executor.rs +++ b/examples/nrf52840/src/bin/manually_create_executor.rs | |||
diff --git a/examples/nrf/src/bin/multiprio.rs b/examples/nrf52840/src/bin/multiprio.rs index 25806ae48..25806ae48 100644 --- a/examples/nrf/src/bin/multiprio.rs +++ b/examples/nrf52840/src/bin/multiprio.rs | |||
diff --git a/examples/nrf/src/bin/mutex.rs b/examples/nrf52840/src/bin/mutex.rs index c402c6ba1..c402c6ba1 100644 --- a/examples/nrf/src/bin/mutex.rs +++ b/examples/nrf52840/src/bin/mutex.rs | |||
diff --git a/examples/nrf/src/bin/nvmc.rs b/examples/nrf52840/src/bin/nvmc.rs index 75d090fbb..75d090fbb 100644 --- a/examples/nrf/src/bin/nvmc.rs +++ b/examples/nrf52840/src/bin/nvmc.rs | |||
diff --git a/examples/nrf/src/bin/pdm.rs b/examples/nrf52840/src/bin/pdm.rs index 7388580fb..7388580fb 100644 --- a/examples/nrf/src/bin/pdm.rs +++ b/examples/nrf52840/src/bin/pdm.rs | |||
diff --git a/examples/nrf/src/bin/ppi.rs b/examples/nrf52840/src/bin/ppi.rs index d74ce4064..d74ce4064 100644 --- a/examples/nrf/src/bin/ppi.rs +++ b/examples/nrf52840/src/bin/ppi.rs | |||
diff --git a/examples/nrf/src/bin/pubsub.rs b/examples/nrf52840/src/bin/pubsub.rs index 688e6d075..688e6d075 100644 --- a/examples/nrf/src/bin/pubsub.rs +++ b/examples/nrf52840/src/bin/pubsub.rs | |||
diff --git a/examples/nrf/src/bin/pwm.rs b/examples/nrf52840/src/bin/pwm.rs index 1698c0bc8..1698c0bc8 100644 --- a/examples/nrf/src/bin/pwm.rs +++ b/examples/nrf52840/src/bin/pwm.rs | |||
diff --git a/examples/nrf/src/bin/pwm_double_sequence.rs b/examples/nrf52840/src/bin/pwm_double_sequence.rs index 16e50e909..16e50e909 100644 --- a/examples/nrf/src/bin/pwm_double_sequence.rs +++ b/examples/nrf52840/src/bin/pwm_double_sequence.rs | |||
diff --git a/examples/nrf/src/bin/pwm_sequence.rs b/examples/nrf52840/src/bin/pwm_sequence.rs index b9aca9aaa..b9aca9aaa 100644 --- a/examples/nrf/src/bin/pwm_sequence.rs +++ b/examples/nrf52840/src/bin/pwm_sequence.rs | |||
diff --git a/examples/nrf/src/bin/pwm_sequence_ppi.rs b/examples/nrf52840/src/bin/pwm_sequence_ppi.rs index 6594fa348..6594fa348 100644 --- a/examples/nrf/src/bin/pwm_sequence_ppi.rs +++ b/examples/nrf52840/src/bin/pwm_sequence_ppi.rs | |||
diff --git a/examples/nrf/src/bin/pwm_sequence_ws2812b.rs b/examples/nrf52840/src/bin/pwm_sequence_ws2812b.rs index 711c8a17b..711c8a17b 100644 --- a/examples/nrf/src/bin/pwm_sequence_ws2812b.rs +++ b/examples/nrf52840/src/bin/pwm_sequence_ws2812b.rs | |||
diff --git a/examples/nrf/src/bin/pwm_servo.rs b/examples/nrf52840/src/bin/pwm_servo.rs index 19228f433..19228f433 100644 --- a/examples/nrf/src/bin/pwm_servo.rs +++ b/examples/nrf52840/src/bin/pwm_servo.rs | |||
diff --git a/examples/nrf/src/bin/qdec.rs b/examples/nrf52840/src/bin/qdec.rs index 600bba07a..600bba07a 100644 --- a/examples/nrf/src/bin/qdec.rs +++ b/examples/nrf52840/src/bin/qdec.rs | |||
diff --git a/examples/nrf/src/bin/qspi.rs b/examples/nrf52840/src/bin/qspi.rs index bdcf710b8..bdcf710b8 100644 --- a/examples/nrf/src/bin/qspi.rs +++ b/examples/nrf52840/src/bin/qspi.rs | |||
diff --git a/examples/nrf/src/bin/qspi_lowpower.rs b/examples/nrf52840/src/bin/qspi_lowpower.rs index 9341a2376..9341a2376 100644 --- a/examples/nrf/src/bin/qspi_lowpower.rs +++ b/examples/nrf52840/src/bin/qspi_lowpower.rs | |||
diff --git a/examples/nrf/src/bin/raw_spawn.rs b/examples/nrf52840/src/bin/raw_spawn.rs index 1b067f5e4..1b067f5e4 100644 --- a/examples/nrf/src/bin/raw_spawn.rs +++ b/examples/nrf52840/src/bin/raw_spawn.rs | |||
diff --git a/examples/nrf/src/bin/rng.rs b/examples/nrf52840/src/bin/rng.rs index 647073949..647073949 100644 --- a/examples/nrf/src/bin/rng.rs +++ b/examples/nrf52840/src/bin/rng.rs | |||
diff --git a/examples/nrf/src/bin/saadc.rs b/examples/nrf52840/src/bin/saadc.rs index 7cf588090..7cf588090 100644 --- a/examples/nrf/src/bin/saadc.rs +++ b/examples/nrf52840/src/bin/saadc.rs | |||
diff --git a/examples/nrf/src/bin/saadc_continuous.rs b/examples/nrf52840/src/bin/saadc_continuous.rs index bb50ac65e..bb50ac65e 100644 --- a/examples/nrf/src/bin/saadc_continuous.rs +++ b/examples/nrf52840/src/bin/saadc_continuous.rs | |||
diff --git a/examples/nrf/src/bin/self_spawn.rs b/examples/nrf52840/src/bin/self_spawn.rs index 196255a52..196255a52 100644 --- a/examples/nrf/src/bin/self_spawn.rs +++ b/examples/nrf52840/src/bin/self_spawn.rs | |||
diff --git a/examples/nrf/src/bin/self_spawn_current_executor.rs b/examples/nrf52840/src/bin/self_spawn_current_executor.rs index 8a179886c..8a179886c 100644 --- a/examples/nrf/src/bin/self_spawn_current_executor.rs +++ b/examples/nrf52840/src/bin/self_spawn_current_executor.rs | |||
diff --git a/examples/nrf/src/bin/spim.rs b/examples/nrf52840/src/bin/spim.rs index 132e01660..132e01660 100644 --- a/examples/nrf/src/bin/spim.rs +++ b/examples/nrf52840/src/bin/spim.rs | |||
diff --git a/examples/nrf/src/bin/spis.rs b/examples/nrf52840/src/bin/spis.rs index fe3b0c53d..fe3b0c53d 100644 --- a/examples/nrf/src/bin/spis.rs +++ b/examples/nrf52840/src/bin/spis.rs | |||
diff --git a/examples/nrf/src/bin/temp.rs b/examples/nrf52840/src/bin/temp.rs index b06ac709e..b06ac709e 100644 --- a/examples/nrf/src/bin/temp.rs +++ b/examples/nrf52840/src/bin/temp.rs | |||
diff --git a/examples/nrf/src/bin/timer.rs b/examples/nrf52840/src/bin/timer.rs index c22b5acd5..c22b5acd5 100644 --- a/examples/nrf/src/bin/timer.rs +++ b/examples/nrf52840/src/bin/timer.rs | |||
diff --git a/examples/nrf/src/bin/twim.rs b/examples/nrf52840/src/bin/twim.rs index a027cc1e7..a027cc1e7 100644 --- a/examples/nrf/src/bin/twim.rs +++ b/examples/nrf52840/src/bin/twim.rs | |||
diff --git a/examples/nrf/src/bin/twim_lowpower.rs b/examples/nrf52840/src/bin/twim_lowpower.rs index e30cc9688..e30cc9688 100644 --- a/examples/nrf/src/bin/twim_lowpower.rs +++ b/examples/nrf52840/src/bin/twim_lowpower.rs | |||
diff --git a/examples/nrf/src/bin/twis.rs b/examples/nrf52840/src/bin/twis.rs index 54cba9494..54cba9494 100644 --- a/examples/nrf/src/bin/twis.rs +++ b/examples/nrf52840/src/bin/twis.rs | |||
diff --git a/examples/nrf/src/bin/uart.rs b/examples/nrf52840/src/bin/uart.rs index 600f7a6ef..600f7a6ef 100644 --- a/examples/nrf/src/bin/uart.rs +++ b/examples/nrf52840/src/bin/uart.rs | |||
diff --git a/examples/nrf/src/bin/uart_idle.rs b/examples/nrf52840/src/bin/uart_idle.rs index 6af4f7097..6af4f7097 100644 --- a/examples/nrf/src/bin/uart_idle.rs +++ b/examples/nrf52840/src/bin/uart_idle.rs | |||
diff --git a/examples/nrf/src/bin/uart_split.rs b/examples/nrf52840/src/bin/uart_split.rs index 1adaf53fd..1adaf53fd 100644 --- a/examples/nrf/src/bin/uart_split.rs +++ b/examples/nrf52840/src/bin/uart_split.rs | |||
diff --git a/examples/nrf/src/bin/usb_ethernet.rs b/examples/nrf52840/src/bin/usb_ethernet.rs index e5f704524..e5f704524 100644 --- a/examples/nrf/src/bin/usb_ethernet.rs +++ b/examples/nrf52840/src/bin/usb_ethernet.rs | |||
diff --git a/examples/nrf/src/bin/usb_hid_keyboard.rs b/examples/nrf52840/src/bin/usb_hid_keyboard.rs index 76e198719..76e198719 100644 --- a/examples/nrf/src/bin/usb_hid_keyboard.rs +++ b/examples/nrf52840/src/bin/usb_hid_keyboard.rs | |||
diff --git a/examples/nrf/src/bin/usb_hid_mouse.rs b/examples/nrf52840/src/bin/usb_hid_mouse.rs index 4916a38d4..4916a38d4 100644 --- a/examples/nrf/src/bin/usb_hid_mouse.rs +++ b/examples/nrf52840/src/bin/usb_hid_mouse.rs | |||
diff --git a/examples/nrf/src/bin/usb_serial.rs b/examples/nrf52840/src/bin/usb_serial.rs index 7c9c4184b..7c9c4184b 100644 --- a/examples/nrf/src/bin/usb_serial.rs +++ b/examples/nrf52840/src/bin/usb_serial.rs | |||
diff --git a/examples/nrf/src/bin/usb_serial_multitask.rs b/examples/nrf52840/src/bin/usb_serial_multitask.rs index 93efc2fe6..93efc2fe6 100644 --- a/examples/nrf/src/bin/usb_serial_multitask.rs +++ b/examples/nrf52840/src/bin/usb_serial_multitask.rs | |||
diff --git a/examples/nrf/src/bin/wdt.rs b/examples/nrf52840/src/bin/wdt.rs index b0b9c3b81..b0b9c3b81 100644 --- a/examples/nrf/src/bin/wdt.rs +++ b/examples/nrf52840/src/bin/wdt.rs | |||
diff --git a/examples/nrf5340/.cargo/config.toml b/examples/nrf5340/.cargo/config.toml new file mode 100644 index 000000000..ff0879c8c --- /dev/null +++ b/examples/nrf5340/.cargo/config.toml | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | [target.'cfg(all(target_arch = "arm", target_os = "none"))'] | ||
| 2 | # replace nRF5340_xxAA with your chip as listed in `probe-run --list-chips` | ||
| 3 | runner = "probe-run --chip nRF5340_xxAA" | ||
| 4 | |||
| 5 | [build] | ||
| 6 | target = "thumbv8m.main-none-eabihf" | ||
| 7 | |||
| 8 | [env] | ||
| 9 | DEFMT_LOG = "trace" | ||
diff --git a/examples/nrf5340/Cargo.toml b/examples/nrf5340/Cargo.toml new file mode 100644 index 000000000..03485711e --- /dev/null +++ b/examples/nrf5340/Cargo.toml | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | [package] | ||
| 2 | edition = "2021" | ||
| 3 | name = "embassy-nrf-examples" | ||
| 4 | version = "0.1.0" | ||
| 5 | license = "MIT OR Apache-2.0" | ||
| 6 | |||
| 7 | [features] | ||
| 8 | default = ["nightly"] | ||
| 9 | nightly = [ | ||
| 10 | "embassy-executor/nightly", | ||
| 11 | "embassy-nrf/nightly", | ||
| 12 | "embassy-net/nightly", | ||
| 13 | "embassy-nrf/unstable-traits", | ||
| 14 | "embassy-usb", | ||
| 15 | "embedded-io/async", | ||
| 16 | "embassy-net", | ||
| 17 | ] | ||
| 18 | |||
| 19 | [dependencies] | ||
| 20 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | ||
| 21 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = [ | ||
| 22 | "defmt", | ||
| 23 | ] } | ||
| 24 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = [ | ||
| 25 | "defmt", | ||
| 26 | "integrated-timers", | ||
| 27 | ] } | ||
| 28 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = [ | ||
| 29 | "defmt", | ||
| 30 | "defmt-timestamp-uptime", | ||
| 31 | ] } | ||
| 32 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = [ | ||
| 33 | "defmt", | ||
| 34 | "nrf5340-app-s", | ||
| 35 | "time-driver-rtc1", | ||
| 36 | "gpiote", | ||
| 37 | "unstable-pac", | ||
| 38 | ] } | ||
| 39 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = [ | ||
| 40 | "defmt", | ||
| 41 | "tcp", | ||
| 42 | "dhcpv4", | ||
| 43 | "medium-ethernet", | ||
| 44 | ], optional = true } | ||
| 45 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = [ | ||
| 46 | "defmt", | ||
| 47 | ], optional = true } | ||
| 48 | embedded-io = "0.4.0" | ||
| 49 | |||
| 50 | |||
| 51 | defmt = "0.3" | ||
| 52 | defmt-rtt = "0.4" | ||
| 53 | |||
| 54 | static_cell = "1.0" | ||
| 55 | cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } | ||
| 56 | cortex-m-rt = "0.7.0" | ||
| 57 | panic-probe = { version = "0.3", features = ["print-defmt"] } | ||
| 58 | futures = { version = "0.3.17", default-features = false, features = [ | ||
| 59 | "async-await", | ||
| 60 | ] } | ||
| 61 | rand = { version = "0.8.4", default-features = false } | ||
| 62 | embedded-storage = "0.3.0" | ||
| 63 | usbd-hid = "0.6.0" | ||
| 64 | serde = { version = "1.0.136", default-features = false } | ||
diff --git a/examples/nrf5340/build.rs b/examples/nrf5340/build.rs new file mode 100644 index 000000000..30691aa97 --- /dev/null +++ b/examples/nrf5340/build.rs | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | //! This build script copies the `memory.x` file from the crate root into | ||
| 2 | //! a directory where the linker can always find it at build time. | ||
| 3 | //! For many projects this is optional, as the linker always searches the | ||
| 4 | //! project root directory -- wherever `Cargo.toml` is. However, if you | ||
| 5 | //! are using a workspace or have a more complicated build setup, this | ||
| 6 | //! build script becomes required. Additionally, by requesting that | ||
| 7 | //! Cargo re-run the build script whenever `memory.x` is changed, | ||
| 8 | //! updating `memory.x` ensures a rebuild of the application with the | ||
| 9 | //! new memory settings. | ||
| 10 | |||
| 11 | use std::env; | ||
| 12 | use std::fs::File; | ||
| 13 | use std::io::Write; | ||
| 14 | use std::path::PathBuf; | ||
| 15 | |||
| 16 | fn main() { | ||
| 17 | // Put `memory.x` in our output directory and ensure it's | ||
| 18 | // on the linker search path. | ||
| 19 | let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); | ||
| 20 | File::create(out.join("memory.x")) | ||
| 21 | .unwrap() | ||
| 22 | .write_all(include_bytes!("memory.x")) | ||
| 23 | .unwrap(); | ||
| 24 | println!("cargo:rustc-link-search={}", out.display()); | ||
| 25 | |||
| 26 | // By default, Cargo will re-run a build script whenever | ||
| 27 | // any file in the project changes. By specifying `memory.x` | ||
| 28 | // here, we ensure the build script is only re-run when | ||
| 29 | // `memory.x` is changed. | ||
| 30 | println!("cargo:rerun-if-changed=memory.x"); | ||
| 31 | |||
| 32 | println!("cargo:rustc-link-arg-bins=--nmagic"); | ||
| 33 | println!("cargo:rustc-link-arg-bins=-Tlink.x"); | ||
| 34 | println!("cargo:rustc-link-arg-bins=-Tdefmt.x"); | ||
| 35 | } | ||
diff --git a/examples/nrf5340/memory.x b/examples/nrf5340/memory.x new file mode 100644 index 000000000..a122dc24a --- /dev/null +++ b/examples/nrf5340/memory.x | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | MEMORY | ||
| 2 | { | ||
| 3 | /* NOTE 1 K = 1 KiBi = 1024 bytes */ | ||
| 4 | /* These values correspond to the NRF5340 */ | ||
| 5 | FLASH : ORIGIN = 0x00000000, LENGTH = 1024K | ||
| 6 | RAM : ORIGIN = 0x20000000, LENGTH = 256K | ||
| 7 | } | ||
diff --git a/examples/nrf5340/src/bin/blinky.rs b/examples/nrf5340/src/bin/blinky.rs new file mode 100644 index 000000000..3422cedf0 --- /dev/null +++ b/examples/nrf5340/src/bin/blinky.rs | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | #![no_std] | ||
| 2 | #![no_main] | ||
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | |||
| 5 | use embassy_executor::Spawner; | ||
| 6 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; | ||
| 7 | use embassy_time::{Duration, Timer}; | ||
| 8 | use {defmt_rtt as _, panic_probe as _}; | ||
| 9 | |||
| 10 | #[embassy_executor::main] | ||
| 11 | async fn main(_spawner: Spawner) { | ||
| 12 | let p = embassy_nrf::init(Default::default()); | ||
| 13 | let mut led = Output::new(p.P0_28, Level::Low, OutputDrive::Standard); | ||
| 14 | |||
| 15 | loop { | ||
| 16 | led.set_high(); | ||
| 17 | Timer::after(Duration::from_millis(300)).await; | ||
| 18 | led.set_low(); | ||
| 19 | Timer::after(Duration::from_millis(300)).await; | ||
| 20 | } | ||
| 21 | } | ||
diff --git a/examples/nrf5340/src/bin/gpiote_channel.rs b/examples/nrf5340/src/bin/gpiote_channel.rs new file mode 100644 index 000000000..ceab1194a --- /dev/null +++ b/examples/nrf5340/src/bin/gpiote_channel.rs | |||
| @@ -0,0 +1,66 @@ | |||
| 1 | #![no_std] | ||
| 2 | #![no_main] | ||
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | |||
| 5 | use defmt::info; | ||
| 6 | use embassy_executor::Spawner; | ||
| 7 | use embassy_nrf::gpio::{Input, Pull}; | ||
| 8 | use embassy_nrf::gpiote::{InputChannel, InputChannelPolarity}; | ||
| 9 | use {defmt_rtt as _, panic_probe as _}; | ||
| 10 | |||
| 11 | #[embassy_executor::main] | ||
| 12 | async fn main(_spawner: Spawner) { | ||
| 13 | let p = embassy_nrf::init(Default::default()); | ||
| 14 | info!("Starting!"); | ||
| 15 | |||
| 16 | let ch1 = InputChannel::new( | ||
| 17 | p.GPIOTE_CH0, | ||
| 18 | Input::new(p.P0_23, Pull::Up), | ||
| 19 | InputChannelPolarity::HiToLo, | ||
| 20 | ); | ||
| 21 | let ch2 = InputChannel::new( | ||
| 22 | p.GPIOTE_CH1, | ||
| 23 | Input::new(p.P0_24, Pull::Up), | ||
| 24 | InputChannelPolarity::LoToHi, | ||
| 25 | ); | ||
| 26 | let ch3 = InputChannel::new( | ||
| 27 | p.GPIOTE_CH2, | ||
| 28 | Input::new(p.P0_08, Pull::Up), | ||
| 29 | InputChannelPolarity::Toggle, | ||
| 30 | ); | ||
| 31 | let ch4 = InputChannel::new( | ||
| 32 | p.GPIOTE_CH3, | ||
| 33 | Input::new(p.P0_09, Pull::Up), | ||
| 34 | InputChannelPolarity::Toggle, | ||
| 35 | ); | ||
| 36 | |||
| 37 | let button1 = async { | ||
| 38 | loop { | ||
| 39 | ch1.wait().await; | ||
| 40 | info!("Button 1 pressed") | ||
| 41 | } | ||
| 42 | }; | ||
| 43 | |||
| 44 | let button2 = async { | ||
| 45 | loop { | ||
| 46 | ch2.wait().await; | ||
| 47 | info!("Button 2 released") | ||
| 48 | } | ||
| 49 | }; | ||
| 50 | |||
| 51 | let button3 = async { | ||
| 52 | loop { | ||
| 53 | ch3.wait().await; | ||
| 54 | info!("Button 3 toggled") | ||
| 55 | } | ||
| 56 | }; | ||
| 57 | |||
| 58 | let button4 = async { | ||
| 59 | loop { | ||
| 60 | ch4.wait().await; | ||
| 61 | info!("Button 4 toggled") | ||
| 62 | } | ||
| 63 | }; | ||
| 64 | |||
| 65 | futures::join!(button1, button2, button3, button4); | ||
| 66 | } | ||
diff --git a/examples/nrf5340/src/bin/uart.rs b/examples/nrf5340/src/bin/uart.rs new file mode 100644 index 000000000..0f2b7b1e3 --- /dev/null +++ b/examples/nrf5340/src/bin/uart.rs | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | #![no_std] | ||
| 2 | #![no_main] | ||
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | |||
| 5 | use defmt::*; | ||
| 6 | use embassy_executor::Spawner; | ||
| 7 | use embassy_nrf::{interrupt, uarte}; | ||
| 8 | use {defmt_rtt as _, panic_probe as _}; | ||
| 9 | |||
| 10 | #[embassy_executor::main] | ||
| 11 | async fn main(_spawner: Spawner) { | ||
| 12 | let p = embassy_nrf::init(Default::default()); | ||
| 13 | let mut config = uarte::Config::default(); | ||
| 14 | config.parity = uarte::Parity::EXCLUDED; | ||
| 15 | config.baudrate = uarte::Baudrate::BAUD115200; | ||
| 16 | |||
| 17 | let irq = interrupt::take!(SERIAL0); | ||
| 18 | let mut uart = uarte::Uarte::new(p.UARTETWISPI0, irq, p.P1_00, p.P1_01, config); | ||
| 19 | |||
| 20 | info!("uarte initialized!"); | ||
| 21 | |||
| 22 | // Message must be in SRAM | ||
| 23 | let mut buf = [0; 8]; | ||
| 24 | buf.copy_from_slice(b"Hello!\r\n"); | ||
| 25 | |||
| 26 | unwrap!(uart.write(&buf).await); | ||
| 27 | info!("wrote hello in uart!"); | ||
| 28 | |||
| 29 | loop { | ||
| 30 | info!("reading..."); | ||
| 31 | unwrap!(uart.read(&mut buf).await); | ||
| 32 | info!("writing..."); | ||
| 33 | unwrap!(uart.write(&buf).await); | ||
| 34 | } | ||
| 35 | } | ||
