Commit Graph

3344 Commits

Author SHA1 Message Date
Jeremy Fitzhardinge
4fd831e4a8 rp async i2c: raise the tx_empty threshold
Assert "tx_empty" interrupt a little early so there's time to wake up
and start refilling the fifo before it drains. This avoids stalling the
i2c bus if the tx fifo completely drains.
2022-10-03 18:50:03 -07:00
Jeremy Fitzhardinge
cae8499179 rp i2c: clean up tx_abrt handling
Make sure we always wait for the stop bit if there's a reason to -
either because we sent one, or because there was a hardware tx abort.
2022-10-03 01:18:26 -07:00
Dario Nieuwenhuis
f075e62444 Use 1 thread in ci doc building. 2022-10-03 01:59:44 +02:00
Jeremy Fitzhardinge
e8bb8faa23 rp i2c: allow blocking ops on async contexts 2022-10-02 15:09:14 -07:00
Dario Nieuwenhuis
63f5602111
Merge pull request #994 from embassy-rs/ci-docs
Build docs in CI
2022-10-02 23:31:11 +02:00
Dario Nieuwenhuis
753781a263 Build docs in CI 2022-10-02 23:30:12 +02:00
bors[bot]
73208d5248
Merge #993
993: rp i2c: blocking example r=Dirbaio a=jsgf

i2c example talking to mcp23017 i2c gpio expander.

Co-authored-by: Jeremy Fitzhardinge <jeremy@goop.org>
2022-10-02 18:58:49 +00:00
Jeremy Fitzhardinge
09afece93d make I2c::write_async take an iterator
There's no other iterator async API right now.
2022-10-01 19:28:27 -07:00
Jeremy Fitzhardinge
1ee4bb22de embassy-rp i2c: async (non-blocking) example
Simple example exercising an mcp23017 GPIO expander, configured on
RP2040 GPIOs 14+15 (i2c1) with 8 inputs and 8 outputs. Input bit 0
controls whether to display a mcp23017 register dump.
2022-10-01 13:43:37 -07:00
Jeremy Fitzhardinge
5e2c52ee5b embassy-rp: async i2c implementation
This is an interrupt-driven async i2c master implementation. It makes as
best use of the RP2040's i2c block's fifos as possible to minimize
interrupts.

It implements embedded_hal_async::i2c for easy interop.
WIP async impl
2022-10-01 13:43:37 -07:00
Jeremy Fitzhardinge
72b645b0c9 rp i2c: make blocking only for Mode=Blocking 2022-10-01 13:26:13 -07:00
Jeremy Fitzhardinge
8d38eacae4 rp i2c: remove vestiges of DMA 2022-10-01 13:26:13 -07:00
Jeremy Fitzhardinge
90d392205f embassy-rp: inline I2c::regs
It just returns a literal constant, so there's no reason not to always inline it.
2022-10-01 13:26:13 -07:00
Jeremy Fitzhardinge
c96581879c update embedded-hal api
Also pin to alpha.9 since its a breaking change
2022-10-01 01:34:45 -07:00
Jeremy Fitzhardinge
d5abd32da2 rename to i2c_blocking 2022-10-01 01:29:10 -07:00
Jeremy Fitzhardinge
9f77dbf5ae rp i2c: blocking example
i2c example talking to mcp23017 i2c gpio expander.
2022-10-01 01:29:10 -07:00
bors[bot]
aabc02506b
Merge #992
992: (embassy-stm32): remove flash lock/unlock public API from stm32 flash r=lulf a=MathiasKoch

Instead, perform the unlocking and locking automatically on erase and write operations.

This makes the `embedded-storage` abstraction actually useable in libraries, while still keeping the flash peripheral locked the majority of the time.

Co-authored-by: Mathias <mk@blackbird.online>
2022-09-30 11:32:27 +00:00
bors[bot]
99284b8304
Merge #981
981: (embassy-stm32): add E-H1 uart blocking & nb implementation r=MathiasKoch a=MathiasKoch



Co-authored-by: Mathias <mk@blackbird.online>
2022-09-30 04:14:52 +00:00
Mathias
a283c47557 Implement embedded-hal-nb for uart 2022-09-30 06:04:19 +02:00
Mathias
a7fdeac560 Remove flash lock/unlock public API from stm32 flash, and perform the unlocking and locking automatically on erase and write operations 2022-09-30 06:00:46 +02:00
Mathias
88a3c360e8 Merge branch 'master' of https://github.com/embassy-rs/embassy into embassy-stm32/uart-eh1 2022-09-30 05:23:59 +02:00
bors[bot]
1d6f5493e7
Merge #991
991: usb: remove all "Direction as u8" casts. r=Dirbaio a=Dirbaio

Alternative fix for #989 , see comment there for rationale.

bors r+

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-09-29 13:53:22 +00:00
Dario Nieuwenhuis
dab1762709 usb: remove all "Direction as u8" casts. 2022-09-29 15:52:23 +02:00
bors[bot]
ebf5a92ab2
Merge #990
990: Small pubsub improvements r=Dirbaio a=diondokter

- Futures in pub & sub are now awaited instead of returned
- Added functions for reading how many messages are available

This helps people get better compiler diagnostics. For example, I forgot to call await on a future and the compiler didn't complain.
This also helps with making some decisions based on the state of the channels.

Co-authored-by: Dion Dokter <dion@tweedegolf.com>
2022-09-29 13:28:56 +00:00
Dion Dokter
874384826d Went back to named futures but now with must_use 2022-09-29 15:15:10 +02:00
Dion Dokter
f4ebc36b63 Futures in pub & sub are now awaited instead of returned for better user compiler diagnostics.
Added functions for reading how many messages are available
2022-09-29 14:24:42 +02:00
Mathias
38faae26e5 Merge branch 'master' of https://github.com/embassy-rs/embassy into embassy-stm32/uart-flowcontrol 2022-09-29 12:58:38 +02:00
Mathias
a77e2c3512 Merge branch 'master' of https://github.com/embassy-rs/embassy into embassy-stm32/uart-eh1 2022-09-29 12:58:01 +02:00
bors[bot]
8b9f4ad259
Merge #988
988: Update embedded-hal versions and explicitly pin r=lulf a=lulf

Pinning to ensure CI don't accidentally break.

Co-authored-by: Ulf Lilleengen <lulf@redhat.com>
2022-09-29 09:29:33 +00:00
Ulf Lilleengen
72c2e985bb Update embedded-hal versions and explicitly pin 2022-09-29 11:27:46 +02:00
Mathias
7152031229 Add flash ram helpers 2022-09-29 10:03:49 +02:00
Mathias
7ee7109508 Rebase on master 2022-09-29 10:00:13 +02:00
Mathias
f9c62d4f1d Add flowcontrol to UART 2022-09-29 09:12:17 +02:00
Mathias
dc90006982 Remove code duplication on nb_read 2022-09-29 07:58:11 +02:00
Chuck Davis
bb84d7a0ae
Merge branch 'embassy-rs:master' into master 2022-09-28 14:33:03 -05:00
ceekdee
526e90d3f3 Update some outstanding questions 2022-09-28 14:27:34 -05:00
bors[bot]
77ece3f903
Merge #983
983: Remove subghz static lifetime requirement r=lulf a=lulf



Co-authored-by: Ulf Lilleengen <lulf@redhat.com>
2022-09-28 09:33:50 +00:00
Ulf Lilleengen
d7f7614b22 Remove subghz static lifetime requirement 2022-09-28 11:32:11 +02:00
Mathias
823bd714fb Add E-H1 uart blocking & nb implementation 2022-09-28 05:19:43 +02:00
ceekdee
a89a0c2f12 Initial add for sx126x 2022-09-27 21:55:41 -05:00
bors[bot]
9bb43ffe9a
Merge #914
914: (embassy-rp): Add I2C master implementation r=Dirbaio a=MathiasKoch

This PR adds both blocking and DMA based async implementations of I2C master.

Both E-H 0.2 & E-H 1.0 abstractions are implemented as well.

### Questions & concerns:
- Do we need an I2C interrupt handler (for transfer done, abort & error handling?) (async only)
- Do we need to add some automatic attempt at unblocking an I2C bus in case of failures (see ref: 7ebfd553f3/src/i2c_dma.c (L116-L142))
- Should I add `vectored_{read, write}` implementations?

Co-authored-by: Mathias <mk@blackbird.online>
Co-authored-by: Mathias Koch <mk@blackbird.online>
2022-09-27 20:09:53 +00:00
Mathias
bf1da0497c Allow unused fields temporarily in i2c 2022-09-27 22:08:49 +02:00
Mathias
44c46e3c93 Move async i2c implementation to new PR, to merge working blocking implementation faster 2022-09-27 22:08:49 +02:00
Mathias Koch
b0d91e9f31 Apply suggestions from code review
Co-authored-by: Jacob Gonzalez <jacobgonzalez5252@gmail.com>
2022-09-27 22:08:49 +02:00
Mathias
53c34ccc39 Add async API for I2C 2022-09-27 22:08:49 +02:00
Mathias
be68d8ebb7 Add further i2c error types 2022-09-27 22:08:49 +02:00
Mathias
603513e76e Fix blocking I2C 2022-09-27 22:08:49 +02:00
Mathias
bcd3ab4ba1 Add blocking read & write for I2C 2022-09-27 22:08:49 +02:00
Mathias
820e6462b6 Add preliminary I2C implementation for RP2040 2022-09-27 22:08:49 +02:00
bors[bot]
5c882cf4fa
Merge #979
979: usb: make HALs depend only on embassy-usb-driver. r=Dirbaio a=Dirbaio

Follow up to #972 

bors r+

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-09-27 11:17:14 +00:00