Commit Graph

3435 Commits

Author SHA1 Message Date
395b5fed64 added watchdog example 2022-12-21 11:55:09 +05:30
0db3837dcc added priority based example 2022-12-21 11:54:36 +05:30
c0f3610581 added interrupt example 2022-12-21 11:53:55 +05:30
63122f6d7e button controlled example 2022-12-21 11:52:40 +05:30
46fd82d184 Merge #1119
1119: add convert_to_celsius function in the adc module r=lulf a=overheat

    modify RP2040 adc example to get inside biased bipolar diode voltage,
    then convert this temperature sensor data into Celsius degree,
    according to chapter 4.9.5. Temperature Sensor in RP2040 datasheet.

Co-authored-by: Aaron Tsui <aaron.tsui@outlook.com>
2022-12-20 17:25:23 +00:00
5ae91ed3b6 cargo fmt 2022-12-20 14:59:49 +08:00
849a0e174f add convert_to_celsius function in the adc module
modify RP2040 adc example to get inside biased bipolar diode voltage,
    then convert this temperature sensor data into Celsius degree,
    according to chapter 4.9.5. Temperature Sensor in RP2040 datasheet.
2022-12-20 09:12:01 +08:00
e221d91330 Merge #1118
1118: Atomic ringbuf fixes r=Dirbaio a=Dirbaio

bors r+

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-12-19 00:23:46 +00:00
5b72410828 hal-common/atomic_ring_buffer: Add push_slice, pop_slice. 2022-12-19 01:22:41 +01:00
feaeb533fb hal-common/atomic_ring_buffer: fix crashes when len=0 2022-12-19 01:22:41 +01:00
ebc735008f Merge #1114
1114: nrf/uart: do not error on zero length transfers. r=Dirbaio a=Dirbaio

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.

bors r+

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-12-15 18:50:21 +00:00
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
5b65b0e843 Merge pull request #1096 from embassy-rs/net-refactor2
net: remove packet pool
2022-12-13 17:03:51 +01:00
790e4e1594 examples/std: update to new embassy-net trait. 2022-12-13 16:43:25 +01:00
5eae295c8a stm32: rename feature net to embassy-net.
The eth code is always built and available, but has no own API (other
than the embassy-net Device impl) to rx/tx packets. We could add this
API in the future, so the feature only means "embassy-net support".
2022-12-13 16:43:25 +01:00
3005ee0178 stm32/eth_v2: update to new embassy-net trait, remove PeripheralMutex. 2022-12-13 16:43:25 +01:00
8f30652109 stm32/eth_v1: update to new embassy-net trait, remove PeripheralMutex. 2022-12-13 16:43:25 +01:00
e9219405ca usb/cdc-ncm: add embassy-net Device implementation. 2022-12-13 16:43:25 +01:00
aaaf5f23a8 net: move stack into lib.rs 2022-12-13 16:18:39 +01:00
ac74613b5a net: remove packet pool.
The pool was prone to deadlocks, especially due to having a single pool
for rx+tx. If the pool got full with rx'd packets it would deadlock because
processing a rx packet requires doing another allocation on the pool, for
the possibly tx'd response, before deallocating the rx'd packet.

This also allows Device impls to allocate the packet memory in a particular
RAM kind, if needed for example to do DMA.

The `Device` trait is now token-based, like smoltcp's. In the end, this
is better because it allows callers to manage memory however they want (including
with a pool if they want to).
2022-12-13 16:18:39 +01:00
47747d3b73 Merge #1105
1105: embassy-rp: Add multicore support r=Dirbaio a=kalkyl

This PR adds multicore support + critical-section impl using hardware spinlocks.
Based on the rp2040-hal implementation.

Co-authored-by: kalkyl <henrik.alser@me.com>
Co-authored-by: Henrik Alsér <henrik.alser@me.com>
2022-12-13 14:55:34 +00:00
c4d8f3579e Update usage in docs 2022-12-13 14:15:04 +01:00
731eb3c6e3 fmt 2022-12-13 13:55:23 +01:00
3d68c0400b Merge branch 'master' into multicore 2022-12-13 13:51:48 +01:00
13d9d8fde1 Refactor after review 2022-12-13 13:49:51 +01:00
36639e5262 Merge #1043 #1103
1043: Rpi Pico PIO driver r=Dirbaio a=fluffware

This is a driver for the two PIOs in the Pico. I've tried using the type system to get as much compile time checks as possible. There is asynchronous support for FIFOs an Irqs. No DMA support yet. There's an example that shows how to use the driver asynchronously.

1103: embassy-stm32: add rs485 driver enable to uart r=Dirbaio a=FrozenDroid



Co-authored-by: Simon Berg <ksb@fluffware.se>
Co-authored-by: Vincent Stakenburg <v.stakenburg@sinewave.nl>
2022-12-13 11:47:27 +00:00
4fbd03a908 Merge pull request #1111 from overheat/embassy_net_readme
fix net README.md
2022-12-13 12:27:10 +01:00
aea28c8aa0 Add usage in to docs 2022-12-13 09:45:11 +01:00
95fdc7c552 fix net README.md 2022-12-13 14:06:37 +08:00
eb1d2e1295 Pause CORE1 execution during flash operations 2022-12-13 04:02:28 +01:00
96d6c7243b Cleanup 2022-12-10 13:43:29 +01:00
d8821cfd41 Feature gate critical-section-impl 2022-12-10 12:57:45 +01:00
cc0248d83a Select critical-section in tests 2022-12-10 12:42:08 +01:00
34eaade14f fmt 2022-12-10 08:33:09 +01:00
1ee58492fb embassy-rp: Add multicore support 2022-12-10 08:26:35 +01:00
5d4f09156a nrf: add manually_create_executor example. 2022-12-09 23:33:53 +01:00
488e322478 Clear unused pulls in set_pull. 2022-12-09 20:30:17 +01:00
cd59046e6c Added RelocateProgram class for adjusting PIO-programs for different origins. 2022-12-09 20:18:41 +01:00
35db6e639b PIO support for RPi Pico 2022-12-09 20:18:41 +01:00
e94ca0efd6 Merge #1051
1051: Adapted nvmc so it can be used for all nrf targets r=diondokter a=diondokter

Title says it all pretty much.
It's a bit annoying with the configs though.

I've made this a draft because I haven't really tested this yet.

Co-authored-by: Dion Dokter <dion@tweedegolf.com>
Co-authored-by: Dion Dokter <diondokter@gmail.com>
2022-12-09 16:45:55 +00:00
236d104844 embassy-stm32: add rs485 driver enable to uart 2022-12-09 14:26:09 +01:00
f22297e3d6 Merge branch 'master' into nrf91/53-nvmc 2022-12-09 11:04:55 +01:00
1d2f97b4e2 Fixed erase bug 2022-12-09 11:02:16 +01:00
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
5fdd521a76 Move the responsibility to manage buffers to the I2S stream 2022-12-08 20:22:50 +01:00
1b8c0733e6 Merge #1098
1098: Reset sdmmc clock on card init r=Dirbaio a=chemicstry

Set clock back to 400kHz in `init_card()`, which allows card reinitialization if it was removed

Co-authored-by: chemicstry <chemicstry@gmail.com>
2022-12-07 15:34:49 +00:00
94010d3362 Merge #1100
1100: net: remove unsafe, update smoltcp. r=Dirbaio a=Dirbaio

bors r+

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-12-06 23:29:15 +00:00
f7fe0c1441 net: update smoltcp 2022-12-07 00:28:38 +01:00
7bda01ec24 Fix comment 2022-12-06 23:31:58 +02:00
40f0272dd0 Merge #1099
1099: rp: implement input for OutputOpenDrain r=Dirbaio a=Dirbaio

Needed for onewire and similar protocols.

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-12-06 20:12:29 +00:00