Commit Graph

952 Commits

Author SHA1 Message Date
Frank Plowman
07987aea4e
embassy-nrf: Fix various typos and make style more consistent 2024-02-16 20:45:58 +00:00
Frank Plowman
c5f39d5c89
embassy-nrf: Use fully-qualified core::mem::transmute 2024-02-16 20:42:14 +00:00
Frank Plowman
bcb0be21c1
embassy-nrf: Fix PDM gain register value derivation
Co-authored-by: Sol Harter <sol@glowinthedark.co.uk>
2024-02-16 17:24:58 +00:00
Priit Laes
50b8100fd3 nrf: Implement chunked DMA transfers for SPIM peripheral
On some chips (notably nrf52832), the maximum DMA transfer is 255
bytes, which has caused subtle issues while interfacing with various
devices over SPI bus.
2024-02-15 12:34:51 +02:00
Guilherme S. Salustiano
b4f0f57538 remove first person comments 2024-02-12 13:21:01 +01:00
Guilherme S. Salustiano
fdb15b2054 add comments about buffer unsound 2024-02-10 08:58:31 +01:00
Guilherme S. Salustiano
40282c2666 add buffer input on transmit/receive 2024-02-10 08:49:14 +01:00
Guilherme S. Salustiano
3773928425 apply clippy sugestions 2024-02-10 08:18:32 +01:00
Guilherme S. Salustiano
802bdd1af8 remove first person comments and assert disable state when it's necessary 2024-02-10 08:09:08 +01:00
Priit Laes
27411658d9 nrf: spim/spis: Add size checks for EasyDMA buffer
On most nRF chips, maximum buffer size for EasyDMA is 255, thus
we never got any data when attempting to use 256 bytes as RX/TX buffer.
2024-02-08 21:48:41 +02:00
Guilherme S. Salustiano
9527d1d934 remove radio implementation on chips not tested 2024-02-07 18:35:03 +01:00
Guilherme S. Salustiano
ea8bfb4f38 remove some supports 2024-02-07 18:25:06 +01:00
Guilherme S. Salustiano
3ad45655ec ci rerun 2024-02-07 18:22:47 +01:00
Guilherme S. Salustiano
add7894314 remove radio feature 2024-02-07 18:21:08 +01:00
Guilherme S. Salustiano
5f1b80d40b remove jewel dependency 2024-02-07 18:04:29 +01:00
Guilherme S. Salustiano
d408056a66 remove default on radio 2024-02-07 17:16:46 +01:00
Guilherme S. Salustiano
847b8be814 feat/implement ble radio on nrf 2024-02-07 15:38:39 +01:00
Dario Nieuwenhuis
ad7d4494fa
Merge pull request #2502 from jbeaurivage/nrf-uarte-errors
NRF: handle `uarte` RX errors
2024-02-05 23:36:42 +00:00
Justin Beaurivage
2575f597cc Address @Dirbaio's comments 2024-02-05 18:05:59 -05:00
Dario Nieuwenhuis
d5d86b866f nrf/gpiote: add support for nrf51. 2024-02-04 21:36:19 +01:00
Justin Beaurivage
cc12eb9680 Rustfmt 2024-01-31 14:20:06 -05:00
Justin Beaurivage
d364447a34 Add error handling to UarteRxWithIdle 2024-01-31 14:16:58 -05:00
Dario Nieuwenhuis
68be63c0e8
Merge pull request #2469 from embassy-rs/nrf51-basic-support
feat: add basic support for nRF51 chips to embassy-nrf
2024-01-31 00:20:40 +00:00
Justin Beaurivage
7ff21e8b8b Handle Uarte RX errors 2024-01-30 17:06:57 -05:00
Martin Marmsoler
319b0fe3d7 Do not wait when the pwm is disabled
Reason: because in this case no seqend event is raised and therefore an infinity loop occurs
2024-01-27 18:21:40 +01:00
Martin Marmsoler
b08a0955c3 implement retriving duty.
Description: When disabling the pwm and enabling again, it is required to restart the sequence. If the previous duty is not known, it is not possible to turn on the pwm again
2024-01-27 18:21:40 +01:00
Matthew Tran
6efb5fd284 nrf/spi: add bit order config 2024-01-26 22:38:03 -06:00
Martin Marmsoler
2809d3bd45 add is_enabled() function 2024-01-26 22:09:49 +01:00
Martin Marmsoler
c26e62e4f4 add documentation 2024-01-26 21:24:14 +01:00
Martin Marmsoler
dd2577fcf0 use constant for the pwm clock
Description: So it can be used outside of the crate to calculate max duty
2024-01-26 20:55:53 +01:00
Ulf Lilleengen
531645e5d4 docs: mention nrf51 2024-01-26 09:11:17 +01:00
Ulf Lilleengen
1263d28595 nightly fmt 2024-01-25 08:39:25 +01:00
Ulf Lilleengen
3739cc0699 fix warnings 2024-01-25 08:38:28 +01:00
Ulf Lilleengen
1989c229f9 fix: make inner state send as it's protected critical section 2024-01-25 08:38:01 +01:00
Ulf Lilleengen
db0f4a0b91 cleanup 2024-01-24 21:23:54 +01:00
Ulf Lilleengen
7d961a7f44 cargo fmt 2024-01-24 21:23:54 +01:00
Ulf Lilleengen
3ac52b2c48 remove portable-atomic dependency 2024-01-24 21:23:54 +01:00
Ulf Lilleengen
00d66cce1d modify time driver to not require portable-atomic 2024-01-24 21:23:54 +01:00
Ulf Lilleengen
6126183db8 fix: remove portable-atomic from rng 2024-01-24 21:23:54 +01:00
Ulf Lilleengen
53ea850d28 rustfmt again 2024-01-24 21:23:54 +01:00
Ulf Lilleengen
2a810a1a6a rustfmt 2024-01-24 21:23:54 +01:00
Ulf Lilleengen
4410aacafb feat: add basic support for nRF51 chips to embassy-nrf 2024-01-24 21:23:54 +01:00
Dario Nieuwenhuis
2bc5e9523d nrf/gpio: remove generics. 2024-01-22 21:32:10 +01:00
Dario Nieuwenhuis
4c23f197b3 Fix invalid "async" crates.io category. 2024-01-12 00:39:01 +01:00
Dario Nieuwenhuis
6a1c415a4c Complete cargo.tomls more. 2024-01-12 00:32:47 +01:00
Dario Nieuwenhuis
9f6517e408 stm32,nrf: add warning on docs.rs directing the user to docs.embassy.dev. 2024-01-11 23:43:17 +01:00
Dario Nieuwenhuis
5304994363 Add docs.rs metadata to all crates. 2024-01-11 23:17:02 +01:00
Dario Nieuwenhuis
22197320ff bump embassy-time 0.3, embassy-executor 0.5, embassy-net 0.4. 2024-01-11 23:01:24 +01:00
Dario Nieuwenhuis
e18d673721 More readme fixes. 2024-01-11 21:23:07 +01:00
Dario Nieuwenhuis
b0b1ef9181
Merge pull request #2436 from embassy-rs/embassy-nrf-docs-nrf91-example
Embassy nrf docs and nrf91 example
2024-01-11 19:52:18 +00:00
Ulf Lilleengen
4cc2648547 change title 2024-01-11 20:34:30 +01:00
Ulf Lilleengen
9a269803bd restructure 2024-01-11 20:32:07 +01:00
Ulf Lilleengen
46602903f5 note on timer 2024-01-11 19:26:49 +01:00
Ulf Lilleengen
f9e274e057 docs: more docs on nrf 2024-01-11 19:21:33 +01:00
Dario Nieuwenhuis
b452a6bcf6 Centralize license and MSRV boilerplate into the repo readme. 2024-01-11 18:18:35 +01:00
Dario Nieuwenhuis
15f94fb0fc time: split driver into a separate embassy-time-driver crate. 2024-01-11 16:56:08 +01:00
Dario Nieuwenhuis
495b8b739a Change GPIO inherent methods back to &self.
With the embedded-hal rc3 update I changed them to require `&mut self`, but
in retrospect I think `&self` is better, for extra flexibility.

This PR reverts the changes from the rc3 update to inherent methods.
2024-01-10 00:00:10 +01:00
Dario Nieuwenhuis
c9ac39df94 Update embedded-hal to v1.0 2024-01-09 23:37:14 +01:00
ftilde
eb70d744a9 Expose rx_delay in nrf qspi config 2024-01-05 20:12:28 +01:00
swanandx
bdaf722cb8 fix: check if sck is some before setting high or low 2024-01-03 19:35:30 +05:30
swanandx
046af81a10 fix: info_ref! can't be called on Option 2024-01-03 19:33:43 +05:30
swanandx
8352d13cfd feat: new_txonly_nosck in spim 2024-01-03 19:25:39 +05:30
swanandx
face031245 feat: new_txonly_nosck in spis 2024-01-03 19:22:01 +05:30
Ulf Lilleengen
c924f89ead fix: add missing impl block for async qspi multiwrite 2024-01-03 13:08:53 +01:00
ftilde
3916b26b25 Reset rx_started state of nrf buffered_uarte on init
This was likely forgotten as part of c46418f12. Without this, when
creating a uarte instance, dropping it and then creating another
instance, this instance would never receive any bytes.
2023-12-29 12:27:52 +01:00
Dario Nieuwenhuis
7fa954c027 nrf/gpio: add toggle. 2023-12-26 17:35:49 +01:00
Dario Nieuwenhuis
c46b076d5b nrf: some doc fixes. 2023-12-23 15:48:47 +01:00
Barnaby Walters
05c8d410a2 [embassy-nrf] auto-documented features 2023-12-22 23:37:29 +01:00
Ulf Lilleengen
e45e3e76b5 docs: embassy-rp rustdoc and refactoring 2023-12-19 10:56:22 +01:00
Dario Nieuwenhuis
49534cd405 stm32: more docs. 2023-12-19 00:10:36 +01:00
Ulf Lilleengen
2a542bc143 feat: support multiwrite flash traits if configured 2023-12-18 13:58:12 +01:00
Dario Nieuwenhuis
80c9d04bbd stm32: add some docs. 2023-12-18 00:53:18 +01:00
Dario Nieuwenhuis
d81395fab3 Update embedded-hal to 1.0.0-rc.3 2023-12-14 16:19:32 +01:00
Dario Nieuwenhuis
6c746dcf39 Document how to bind multiple interrupts and handlers in bind_interrupts!. 2023-12-08 21:26:28 +01:00
Scott Mabin
334900752a update release version in examples and other crates 2023-12-04 13:15:10 +00:00
Dario Nieuwenhuis
03325ea81b update embedded-storage{,-async}, remove patch. 2023-12-04 13:48:36 +01:00
Peter Hansen
9fb2eb7470 nrf52/qspi: avoid infinite busy-wait on QSPI read/write with zero-len buffer, fixes #2115 2023-12-03 16:35:39 -05:00
Peter Hansen
dd62bb16e5 minimum build code for new APPROTECT is chip type-specific 2023-12-03 13:47:26 -05:00
Dario Nieuwenhuis
c6989dfbca Remove nightly and unstable-traits features in preparation for 1.75. 2023-11-29 17:26:33 +01:00
Dario Nieuwenhuis
4634316749 Update embedded-(hal,io,nal). 2023-11-29 17:01:36 +01:00
Dario Nieuwenhuis
c46418f123 nrf/buffered_uarte: fix hang when buffer full due to PPI missing the endrx event.
Fixes #2181
2023-11-14 00:22:17 +01:00
Dario Nieuwenhuis
19ff043acd nrf/buffered_uarte: fix missing hwfc enable. 2023-11-13 22:37:13 +01:00
Dario Nieuwenhuis
74683c706b
Merge pull request #2127 from bugadani/release
Prepare embassy-net 0.2.1 and embassy-sync 0.4.0
2023-10-31 15:57:51 +00:00
Dario Nieuwenhuis
2795e1350d
Merge pull request #2128 from bugadani/poll
Drop `futures` dependency in `embassy-nrf`
2023-10-31 15:53:54 +00:00
Dániel Buga
aed3e5674f Drop futures dependency in embassy-nrf 2023-10-31 10:13:27 +01:00
Dániel Buga
d941882066 Prepare embassy-net 0.2.1 and embassy-sync 0.4.0 2023-10-31 09:33:27 +01:00
Dániel Buga
ad07ea0290 Re-add impl_trait_projections 2023-10-30 19:10:45 +01:00
Dario Nieuwenhuis
213b4c9dca time: add links key, release v0.1.5. 2023-10-16 20:11:35 +02:00
Dario Nieuwenhuis
ea0e83a7f9 nrf/pac: reeport s and ns peripherals always independently of the current mode.
You sometimes need this, for example for using nrf91 modem from S mode
you need to acces IPC_NS.
2023-10-16 19:38:53 +02:00
Dániel Buga
02d2c06b23 Release embassy-time 0.1.4 2023-10-12 18:14:33 +02:00
Dario Nieuwenhuis
0324cee0ca update embedded-io, embedded-nal-async. 2023-10-04 00:10:55 +02:00
Dario Nieuwenhuis
eb12114345 Remove impl_trait_projections. 2023-10-02 14:00:49 +02:00
xoviat
d2a2734752 nrf, rp: update set_config 2023-10-01 09:37:42 -05:00
Dario Nieuwenhuis
bd9021ca1d Make irq token Copy+Clone 2023-09-25 22:35:31 +02:00
Priit Laes
6f83acc010 Add separate work-around specific flag for DMA errata on NRF52832 2023-09-22 17:02:21 +02:00
Nils Fitinghoff
2b7b7a917d spim: Fix SPIM with polling executors
Co-authored-by: Priit Laes <plaes@plaes.org>
2023-09-22 17:02:21 +02:00
Ulf Lilleengen
1b20ba27b1 feat: bump embassy-sync version to 0.3.0
Update changelog in preparation for release
2023-09-14 18:26:00 +02:00
Dion Dokter
e8b961232b Fix gpiote when waking up from systemoff 2023-09-14 17:24:28 +02:00
Priit Laes
521970535e nrf: twim: Use SetConfig trait to reduce code duplication 2023-09-10 23:17:30 +02:00
Priit Laes
93d4cfe7c1 nrf: spis: Use SetConfig trait internally to reduce duplication 2023-09-10 23:17:30 +02:00
Priit Laes
8413a89752 nrf: spim: Use SetConfig trait internally to reduce duplication 2023-09-10 23:17:30 +02:00
Priit Laes
db717d9c81 nrf: Remove unneeded include from Temp's example
Fixes doctest when `time` feature is not enabled.
2023-09-10 23:17:30 +02:00
Priit Laes
9de08d56a0 nrf: spim: Anomaly 109 workaround for SPIM peripheral (#460)
This implements SPIM TX workaround suggested from section 3.8.1
from Anomaly 109 addendum.

In workaround case we first keep track of original maxcnt values,
then initiate "fake" transfer with zero-length maxcnt values.
Once the "fake" transfer is triggered, we handle it, fill in the
original maxcnt values and restart the transmission.
2023-09-07 18:58:22 +03:00
Dario Nieuwenhuis
5e613d9abb Sync all fmt.rs files. 2023-08-30 01:37:18 +02:00
Jesse Braham
1f63bf4153 Release embassy-time v0.1.3 2023-08-28 08:00:18 -07:00
Dario Nieuwenhuis
bb275f7e25 nrf: enable defmt for embassy-hal-internal. 2023-08-16 23:37:40 +02:00
Dario Nieuwenhuis
f26dd54f63
Update embedded-hal to 1.0.0-rc.1 (#1783) 2023-08-16 00:40:56 +02:00
Ulf Lilleengen
7d8e3951ba fix: ensure spi irq is disabled when dropped 2023-08-10 22:26:56 +02:00
Dario Nieuwenhuis
5d5cd23715
Update to embedded-io 0.5 (#1752) 2023-08-07 13:43:09 +02:00
Dario Nieuwenhuis
036e6ae30c
Rename embassy-hal-common to embassy-hal-internal, document it's for internal use only. (#1700) 2023-07-28 13:23:22 +02:00
Quentin Smith
7555a1e302 cargo fmt 2023-07-18 18:32:19 -04:00
Quentin Smith
be7fbe50d7 Update pdm driver to build with all the PACs 2023-07-18 18:31:32 -04:00
Quentin Smith
2c01f277c2 cargo fmt 2023-07-18 17:17:04 -04:00
Quentin Smith
c333d855fc Remove merge error 2023-07-18 17:14:25 -04:00
Quentin Smith
6f02403184 Merge remote-tracking branch 'origin/main' into nrf-pdm 2023-07-17 21:31:43 -04:00
Dario Nieuwenhuis
d137286981 Release embassy-time v0.1.2 2023-07-06 01:29:44 +02:00
Dario Nieuwenhuis
8313b7315a
Merge pull request #1600 from ilikepi63/main
feature(1354): Added lifetimes to Event + Tasks
2023-07-05 17:13:26 +00:00
Cameron Harris
d7ecf6f593
Update embassy-nrf/src/ppi/mod.rs
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2023-07-05 19:10:43 +02:00
Cameron Harris
082147939d
Update embassy-nrf/src/ppi/ppi.rs
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2023-07-05 19:10:30 +02:00
Cameron Harris
67c4d165c7
Update embassy-nrf/src/ppi/ppi.rs
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2023-07-05 19:10:22 +02:00
Cameron Harris
fb3e6a2b40
Update embassy-nrf/src/ppi/mod.rs
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2023-07-05 19:10:16 +02:00
Cameron
8ee2f50b8c Removed unnecessary lifetime naming 2023-07-05 19:01:28 +02:00
Cameron
7d3eb6463a Removed unnecessary space 2023-07-05 11:34:33 +02:00
Cameron
ab7fcf1d5b Removed unnecessary changes 2023-07-05 09:23:39 +02:00
Cameron
2c5146f19f Fixed Lifetimes in Events & Tasks 2023-07-05 09:20:56 +02:00
Dario Nieuwenhuis
70c05c62e4 nrf: build docs with time feature. 2023-07-05 00:35:22 +02:00
Dario Nieuwenhuis
a101d9078d update embedded-hal crates. 2023-07-04 19:59:36 +02:00
Dion Dokter
582c721aec Add lifetimes to the functions 2023-07-04 11:48:59 +02:00
Cameron
93caf97a04 Formatting stuff 2023-06-30 11:54:37 +02:00
Cameron
bca2c54948 Adjusted build issue 2023-06-30 11:50:27 +02:00
Cameron
81cbb0fc32 Attempt to fix certain borrowing rule issues 2023-06-30 11:47:20 +02:00
Cameron
c69f2929c0 Build failures 2023-06-30 11:37:53 +02:00
Cameron
4d23ea554b Build failures 2023-06-30 11:34:13 +02:00
Cameron
d6fde756a8 Build failures 2023-06-30 11:32:11 +02:00
Cameron
2432cece38 Lifetimes in dppi 2023-06-29 18:36:12 +02:00
Cameron
fef338f5c2 Lifetime groups 2023-06-29 18:13:46 +02:00
Cameron
24e186e684 feature(1354): Added lifetimes to Event + 2023-06-29 18:09:26 +02:00
Cameron
3f19879f41 PR Fixes 2023-06-29 17:44:46 +02:00
Cameron
e90f47aba3 Fixed Pointer Updates 2023-06-29 17:37:51 +02:00
Cameron
2aa2b843ce feature(1355): Add trigger to task, triggered + clear to Event 2023-06-29 17:11:36 +02:00
Dario Nieuwenhuis
f7ec579c18 Update probe-rs-cli -> probe-rs 2023-06-29 02:39:28 +02:00
Timo Kröger
b55e618175 embassy-nrf: Idle detection for RX only uarte
Introduce `with_idle()` to upgrade an `UarteRx` instance to
`UarteRxWithIdle`. Use the method in the split constructor aswell.
2023-06-13 08:22:38 +02:00
Dario Nieuwenhuis
98c821ac39 Remove embassy-cortex-m crate, move stuff to embassy-hal-common. 2023-06-09 16:44:20 +02:00
Dario Nieuwenhuis
dc8e34420f Remove executor dep+reexports from HALs.
Closes #1547
2023-06-09 16:29:45 +02:00
Dario Nieuwenhuis
8c93805ab5 Add rt feature to HALs, cfg out interrupt handling when not set. 2023-06-08 18:57:03 +02:00
Dario Nieuwenhuis
5c2f02c735 Reexport NVIC_PRIO_BITS at HAL root.
This allows using RTIC with `#[rtic::app(device = embassy_nrf, ...)]`
2023-06-08 18:07:49 +02:00
Dario Nieuwenhuis
921780e6bf Make interrupt module more standard.
- Move typelevel interrupts to a special-purpose mod: `embassy_xx::interrupt::typelevel`.
- Reexport the PAC interrupt enum in `embassy_xx::interrupt`.

This has a few advantages:
- The `embassy_xx::interrupt` module is now more "standard".
  - It works with `cortex-m` functions for manipulating interrupts, for example.
  - It works with RTIC.
- the interrupt enum allows holding value that can be "any interrupt at runtime", this can't be done with typelevel irqs.
- When "const-generics on enums" is stable, we can remove the typelevel interrupts without disruptive changes to `embassy_xx::interrupt`.
2023-06-08 18:00:48 +02:00
Dario Nieuwenhuis
404aa29289 cortex-m: remove owned interrupts. 2023-06-01 03:25:19 +02:00
Dario Nieuwenhuis
1a31b03976 ci: fix nrf, rp tests. 2023-05-29 22:01:19 +02:00
Dario Nieuwenhuis
46961cfdf7 Fix tests. 2023-05-29 19:46:28 +02:00