Commit Graph

953 Commits

Author SHA1 Message Date
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
Dario Nieuwenhuis
f4736457f5 nrf/timer: use low power counter mode.
The regular one permanently requests HFCLK, while the low power one only does
so while counting, for 1 clock cycle. The regular mode is "deprecated" too.
2023-05-26 16:50:19 +02:00
Linus Harberg
f501a1ba2c Disable ppi group first to avoid BufferedUarte not getting dropped properly 2023-05-26 16:40:10 +02:00
Dario Nieuwenhuis
a1cbdd8d29 nrf/uarte: fix deref warning, fix errata not being applied on nrf53. 2023-05-19 18:25:34 +02:00
Dario Nieuwenhuis
9f7392474b Update Rust nightly. 2023-05-19 17:12:39 +02:00
Dario Nieuwenhuis
2d65373f63 Remove unused feature(type_alias_impl_trait). 2023-05-14 23:44:53 +02:00
Dirk Stolle
0584312ef0 Fix some typos 2023-05-08 23:25:01 +02:00
Ulf Lilleengen
42a8f1671d Bump versions preparing for -macros and -executor release 2023-04-27 11:54:22 +02:00
Emil Fresk
f8b359dc5a Add support for setting up the nRFs internal DCDCs 2023-04-26 21:24:50 +02:00
Dario Nieuwenhuis
f681b9d4e5 Remove the _todo_embedded_hal_serial impls. EH will probably not have these serial traits. 2023-04-15 00:58:58 +02:00
Dario Nieuwenhuis
577f060d24 Release embassy-sync v0.2.0 2023-04-13 23:40:49 +02:00
Dario Nieuwenhuis
8fd8ef9ca7 nrf/timer: make cc() borrows less strict. 2023-04-11 23:09:02 +02:00
Dario Nieuwenhuis
9a677ab618 common/peripheral: do not require mut in PeripheralRef clone_unchecked. 2023-04-11 23:09:02 +02:00
Dario Nieuwenhuis
be37eee13d Update embedded-hal crates. 2023-04-06 22:41:50 +02:00
bors[bot]
969e85150c
Merge #1262
1262: bump embedded-storage-async to 0.4 r=Dirbaio a=mehmetalianil

I just haven't found a way to revert the altered stm-metapac contents due to building. 

Co-authored-by: Mehmet Ali Anil <mehmet@grusbv.com>
2023-03-08 01:26:45 +00:00
Mehmet Ali Anil
935633c90b Merge upstream 2023-03-07 23:16:54 +01:00
Dario Nieuwenhuis
27e989afa9 nrf/uicr: only check lowest bit.
This mirrors what nrfx does. Also it won't reboot/warn if NFCPINS is set to either
0xFFFF_FFFE or 0x0000_0000, which are all valid.
2023-03-07 15:28:27 +01:00
Mehmet Ali Anil
bc0cb43307 Bump embedded-storage-async to 0.4 2023-03-06 22:16:36 +01:00
Dario Nieuwenhuis
f5e09a8f4a nrf/interrupt: do not reexport take! macro. 2023-03-06 00:17:51 +01:00
Dario Nieuwenhuis
5249996d28 nrf/usb: switch to new interrupt binding, fix vbus detect on nrf53. 2023-03-06 00:17:51 +01:00
Dario Nieuwenhuis
5913553cb1 nrf/twis: switch to new interrupt binding. 2023-03-06 00:17:51 +01:00
Dario Nieuwenhuis
36319fc121 nrf/temp: switch to new interrupt binding. 2023-03-06 00:17:51 +01:00
Dario Nieuwenhuis
9e58d9274c nrf/twim: switch to new interrupt binding. 2023-03-06 00:17:51 +01:00
Dario Nieuwenhuis
9f5762d365 nrf/spis: switch to new interrupt binding. 2023-03-06 00:17:51 +01:00
Dario Nieuwenhuis
a32e82029a nrf/spim: switch to new interrupt binding. 2023-03-06 00:17:51 +01:00
Dario Nieuwenhuis
2dc5608203 nrf/saadc: switch to new interrupt binding. 2023-03-06 00:17:51 +01:00
Dario Nieuwenhuis
d113fcfe32 nrf/rng: make available on all chips, use Instance trait, switch to new interrupt binding. 2023-03-06 00:17:51 +01:00
Dario Nieuwenhuis
96788ac93a nrf/qspi: switch to new interrupt binding. 2023-03-06 00:17:51 +01:00
Dario Nieuwenhuis
c66b28e759 nrf/qdec: make available on all chips, use Instance trait, switch to new interrupt binding. 2023-03-06 00:17:51 +01:00
Dario Nieuwenhuis
f8f1d3bcf0 nrf/pdm: make available on all chips, use Instance trait, switch to new interrupt binding. 2023-03-06 00:17:51 +01:00
Dario Nieuwenhuis
34563b74aa nrf/i2s: switch to new interrupt binding. 2023-03-06 00:17:51 +01:00
Dario Nieuwenhuis
63b75eaf64 nrf/timer: remove awaitable. 2023-03-06 00:17:51 +01:00
Dario Nieuwenhuis
9cf000ef4e nrf/uart: switch to new interrupt binding. 2023-03-06 00:17:51 +01:00
Dario Nieuwenhuis
42c13c8c3d nrf: add new interrupt binding traits and macro. 2023-03-06 00:17:51 +01:00
Dario Nieuwenhuis
bf013be9ba
Merge pull request #1232 from embassy-rs/nrf-qspi-fixes
nrf/qspi: nrf53 support, u32 addrs, remove const generic, add raw read/write.
2023-03-05 03:19:11 +01:00
Dario Nieuwenhuis
f7dfc49c5c nrf/qspi: add _raw variants of methods that don't do bounds checks.
Useful for the nRF7002, which presents as a "fake" QSPI flash, and
the "capacity" concept doesn't really apply to it.
2023-03-05 02:55:00 +01:00
Dario Nieuwenhuis
8eb8ea6174 nrf/qspi: remove FLASH_SIZE const generic param. 2023-03-05 02:33:02 +01:00
Dario Nieuwenhuis
75f69803af nrf/qspi: always use u32 for addresses. 2023-03-05 02:30:53 +01:00
Dario Nieuwenhuis
1955a225e8 nrf/qspi: add nrf53 support. 2023-03-05 02:17:59 +01:00
Dario Nieuwenhuis
9eb65b11cb nrf/qspi: remove cfg_if hack 2023-03-05 02:08:29 +01:00
Dario Nieuwenhuis
7650fea5f2 nrf/buffered_uarte: add HIL tests. 2023-03-04 15:12:49 +01:00
Dario Nieuwenhuis
916f94b366 nrf/buffered_uarte: make available on stable. 2023-03-04 15:12:49 +01:00
Dario Nieuwenhuis
ccc224c81f nrf/buffered_uarte: remove PeripheralMutex, make it work without rts/cts.
> dirbaio: so I was checking how zephyr does UARTE RX on nRF
> dirbaio: because currently we have the ugly "restart DMA on line idle to flush it" hack
> dirbaio: because according to the docs "For each byte received over the RXD line, an RXDRDY event will be generated. This event is likely to occur before the corresponding data has been transferred to Data RAM."
> dirbaio: so as I understood it, the only way to guarantee the data is actually transferred to RAM is to stop+restart DMA
> dirbaio: well, guess what?
> dirbaio: they just count RXDRDY's, and process that amount of data without restarting DMA
> dirbaio: with a timer configured as counter https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/serial/uart_nrfx_uarte.c#L650-L692
> dirbaio: 🤔🤷⁉️
> dirbaio: someone saying you can do the "hook up rxdrdy to a counter" trick, someone else saying it's wrong 🤪 https://devzone.nordicsemi.com/f/nordic-q-a/28420/uarte-in-circular-mode

So we're going to do just that!

- BufferedUarte is lock-free now. No PeripheralMutex.
- The "restart DMA on line idle to flush it" hack is GONE. This means
  - It'll work correctly without RTS/CTS now.
  - It'll have better throughput when using RTS/CTS.
2023-03-04 15:12:49 +01:00
Dario Nieuwenhuis
51478caad8 nrf/timer: add support for counter mode. 2023-03-04 05:37:33 +01:00
Dario Nieuwenhuis
4314b823aa nrf: add PPI channel group driver. 2023-03-04 05:37:33 +01:00
Grant Miller
7be4337de9 Add #[must_use] to all futures 2023-02-24 13:01:41 -06:00
Dario Nieuwenhuis
ada3d5be7c nrf: rename UARTETWISPIn -> SERIALn
The UARTETWISPIn naming is quite horrible. With the nRF53, Nordic realized this
and renamed the interrupts to SERIALn. Let's copy that for our peripheral names, in nrf53 and nrf91.
2023-02-21 22:41:23 +01:00
Dario Nieuwenhuis
7fa478358a nrf: warn if uicr configuration could not be written.
If the user requests some configuration, but UICR is already programmed
to something else, detect this and warn the user.

We don't do it for the debug port settings, because if they are wrong
then the user will simply not be able to read debug logs.
2023-02-20 01:31:02 +01:00
Dario Nieuwenhuis
3f88bf6f9b nrf: add support for UICR configuration.
- APPROTECT enable/disable. Notably this fixes issues with nrf52-rev3 and nrf53 from locking itself at reset.
- Use NFC pins as GPIO.
- Use RESET pin as GPIO.

NFC and RESET pins singletons are made available only when usable as GPIO,
for compile-time checking.
2023-02-20 01:28:45 +01:00
Dario Nieuwenhuis
4c4e923e05 nrf/qspi: do not panic when canceling futures. 2023-02-10 23:03:16 +01:00
Dario Nieuwenhuis
cb88dd285d
nrf/twis: FIx doc typo 2023-02-01 20:54:32 +01:00
Dario Nieuwenhuis
b5cf332cc0 nrf: docs. 2023-02-01 01:17:41 +01:00
Dario Nieuwenhuis
ca10fe7135 usb: docs 2023-01-31 22:27:19 +01:00
Joakim Hulthe
64e610fef7
Replace Level: Into<bool> with From<Level>
This automatically implements Into<bool> for Level
2023-01-23 13:35:24 +01:00
huntc
6ab4ecaf83 Stop sampling when exiting the Saadc methods
Prior to this commit, the onDrop function was being dropped immediately and not on exiting the Saadc sampling methods.
2023-01-18 14:51:46 +11:00
chemicstry
ce842fe28c Refactor embassy-usb address handling to allow reordering of status resoponse 2023-01-11 17:47:12 +01:00
huntc
8497f98de2 Provides a means of obtaining the current WDT config
Obtaining the current WDT config is important so that we do not have to duplication configuration around the place. A constructor method has been introduced that returns WDT config in accordance with how the register is presently configured. The bootloader example has also been updated to show the watchdog can be obtained and used.
2023-01-04 12:13:44 +11:00
Kentaro Okuda
72bb4f8798 Fix a typo 2022-12-30 08:53:16 -05:00
Matthias Devlamynck
2c8080b0ae Add Clone & Copy on embassy_nrf::gpio::Level 2022-12-29 17:26:49 +01:00
Dario Nieuwenhuis
bffa5be2f4 nrf/uart: do not error on zero length transfers.
It's a perfectly fine thing to do, should be just a noop. Erroring is
really annoying when you're writing a payload to uart that might
be zero-length or not.
2022-12-15 19:47:36 +01:00
Dion Dokter
f22297e3d6 Merge branch 'master' into nrf91/53-nvmc 2022-12-09 11:04:55 +01:00
Dion Dokter
1d2f97b4e2 Fixed erase bug 2022-12-09 11:02:16 +01:00
bors[bot]
58ab829049
Merge #1049
1049: embassy-nrf: Add I2S module r=lulf a=chris-zen

This PR adds I2S support for the nrf52 series (`nrf52832`, `nrf52833`, `nrf52840`).

We could only test it in a `nrf52840` in master mode for an output stream (see `i2s_waveform` example), using a clone of the [Adafruit I2S Stereo Decoder - UDA1334A](https://learn.adafruit.com/adafruit-i2s-stereo-decoder-uda1334a/overview).

We were wondering if this could be a welcome addition to embassy, as we are working on this very informally and don't have much free time for it.

<img src="https://user-images.githubusercontent.com/932644/202316127-a8cf90ef-1e1a-4e1d-b796-961b8ad6cef5.png" width="600">

https://user-images.githubusercontent.com/932644/202316609-e53cd912-e463-4e01-839e-0bbdf37020da.mp4


Co-authored-by: `@brainstorm` <brainstorm@nopcode.org>

Co-authored-by: Christian Perez Llamas <932644+chris-zen@users.noreply.github.com>
Co-authored-by: Roman Valls Guimera <brainstorm@users.noreply.github.com>
2022-12-09 07:49:40 +00:00
Christian Perez Llamas
5fdd521a76 Move the responsibility to manage buffers to the I2S stream 2022-12-08 20:22:50 +01:00
Christian Perez Llamas
199504be56 Optimization to be able to work with only 2 buffers 2022-11-29 01:09:47 +01:00
Christian Perez Llamas
6b8ab32536 Use &mut self for start methods 2022-11-26 15:22:31 +01:00
Dario Nieuwenhuis
1e2fb0459d Switch to async-fn-in-trait 2022-11-25 21:02:06 +01:00
bors[bot]
b76631bebe
Merge #1069
1069: GPIOTE InputChannel with mutable reference. r=Dirbaio a=Ardelean-Calin

Adding these changes enables us to define a channel using a mutable reference to `GPIOTE_CH(n)`, similar to how we can do with other drivers. So instead of using:
```rust
let p = embassy_nrf::init(config);
let freq_in = InputChannel::new(
    p.GPIOTE_CH0,
    Input::new(&mut p.P0_19, embassy_nrf::gpio::Pull::Up),
    embassy_nrf::gpiote::InputChannelPolarity::HiToLo,
);
```
we can use:
```rust
let p = embassy_nrf::init(config);
let freq_in = InputChannel::new(
    &mut p.GPIOTE_CH0,
    Input::new(&mut p.P0_19, embassy_nrf::gpio::Pull::Up),
    embassy_nrf::gpiote::InputChannelPolarity::HiToLo,
);
```
therefore not giving ownership to GPIOTE_CH0.

Co-authored-by: Ardelean Călin Petru <ardelean.calin@outlook.com>
Co-authored-by: Ardelean Calin <ardelean.calin@proton.me>
2022-11-23 12:17:02 +00:00
Ardelean Calin
eae67d0be8 Review comments. Corrected unused fields. 2022-11-23 14:16:18 +02:00
bors[bot]
83b199a874
Merge #1056
1056: embassy-nrf: Add TWIS module r=Dirbaio a=kalkyl

Verified to be working on nrf9160

Co-authored-by: kalkyl <henrik.alser@me.com>
Co-authored-by: Henrik Alsér <henrik.alser@me.com>
2022-11-22 21:50:42 +00:00
Henrik Alsér
cf900a8a3f Rename write to respond_to_read 2022-11-22 22:10:04 +01:00
Ardelean Calin
4f2f375777 Corrected order of use statements. 2022-11-22 17:45:05 +02:00
Ardelean Calin
e7c876d744 Changed pin to private as it is for OutputChannel 2022-11-22 17:36:22 +02:00
Ardelean Calin
64c2e1b9b6 Switched to PeripheralRef for channel. 2022-11-22 17:35:38 +02:00
Ardelean Călin Petru
a074cd0625
Update gpiote.rs
Adding these changes enables us to define a channel using a mutable reference to `GPIOTE_CH(n)`, similar to how we can do with other drivers.
So instead of using:
```rust
let freq_in = InputChannel::new(
    p.GPIOTE_CH0,
    Input::new(&mut p.P0_19, embassy_nrf::gpio::Pull::Up),
    embassy_nrf::gpiote::InputChannelPolarity::HiToLo,
);
```
we can use:
```rust
let freq_in = InputChannel::new(
    &mut p.GPIOTE_CH0,
    Input::new(&mut p.P0_19, embassy_nrf::gpio::Pull::Up),
    embassy_nrf::gpiote::InputChannelPolarity::HiToLo,
);
```
2022-11-22 16:56:04 +02:00
bors[bot]
97cb95bbf4
Merge #1042
1042: embassy-nrf: Add SPIS module r=Dirbaio a=kalkyl

Verified to be working on nrf9160

Co-authored-by: Henrik Alsér <henrik.alser@me.com>
Co-authored-by: Henrik Alsér <henrik.alser@ucsmindbite.se>
Co-authored-by: kalkyl <henrik.alser@me.com>
2022-11-22 11:20:14 +00:00
Henrik Alsér
f09745dfe1 embassy-nrf: Default disable UARTE (nrf9160) 2022-11-22 02:21:06 +01:00
Henrik Alsér
da9f82f507 Fix pin refs 2022-11-22 02:13:03 +01:00
Henrik Alsér
633ffe46ae config write, docs, add address_match_index 2022-11-22 01:57:00 +01:00
Henrik Alsér
e6b9722a31 Remove nrf9160 UARTE fix 2022-11-22 01:07:59 +01:00
Henrik Alsér
33ee48b9e8 Merge branch 'spis' of github.com:kalkyl/embassy into spis 2022-11-22 00:55:46 +01:00
Henrik Alsér
a6d941fac3 Fix txonly/rxonly data pin dir, _from_ram and doc 2022-11-22 00:55:05 +01:00
Christian Perez Llamas
15a93246d6 Buffer management in line with other peripherals. Constructor and config redesign 2022-11-19 19:18:20 +01:00
Christian Perez Llamas
f5391efe22 Fix fmt 2022-11-19 02:17:58 +01:00
Christian Perez Llamas
64e8cfef8e Fix build 2022-11-19 01:38:03 +01:00
Christian Perez Llamas
6b88057aef Add missing parts and Cleanup 2022-11-19 00:29:05 +01:00
Christian Perez Llamas
1ed260b105 Fix buffer overruns 2022-11-17 00:19:22 +01:00
kalkyl
0b066b22d1 Check events_acquired 2022-11-14 16:24:21 +01:00
kalkyl
3a1ddd66c6 Cleanup interrupts 2022-11-14 16:18:11 +01:00
kalkyl
8d2d5a30a5 Single waker 2022-11-14 11:39:55 +01:00
kalkyl
43c1afb6a6 Return number of bytes written, add address match getter 2022-11-14 11:22:14 +01:00
kalkyl
eba42cb5f4 embassy-nrf: Add TWIS module 2022-11-13 22:15:19 +01:00
Henrik Alsér
5cfad3f853 Feature gate UARTE disable 2022-11-13 02:37:23 +01:00
Christian Perez Llamas
17857bc18f Minor changes 2022-11-13 02:12:58 +01:00
Henrik Alsér
dca11095e2 Disable UARTE in embassy-nrf::init 2022-11-13 01:49:55 +01:00
Christian Perez Llamas
d2e8794f29 Investigating discontinuities in the signal 2022-11-13 01:41:32 +01:00
Christian Perez Llamas
122a31d208 Interrupts, async, sine oscillator 2022-11-12 18:48:57 +01:00
Roman Valls Guimera
10e3c3f2ec Cargo fmt 2022-11-11 23:49:20 +01:00
Christian Perez Llamas
4a2e810485 Restrict to pacs supporting i2s 2022-11-10 23:13:01 +01:00
Dion Dokter
dbe97b4098 Adapted nvmc so it can be used for all nrf targets 2022-11-10 14:37:42 +01:00