Commit Graph

6303 Commits

Author SHA1 Message Date
1ca5475010 Merge branch 'embassy-rs:master' into qdec 2022-05-07 09:47:29 +02:00
a4bf190f2f Merge #752
752: Replace embassy::io with embedded_io. r=Dirbaio a=Dirbaio

TODO:

- [x] Release embedded-io on crates.io
- [x] Remove git dep

Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-05-06 23:54:07 +00:00
931a137f8c Replace embassy::io with embedded_io. 2022-05-07 01:45:54 +02:00
108a981360 Change example pins 2022-05-07 01:15:01 +02:00
840bb2952e Add qdec module 2022-05-07 00:46:36 +02:00
7e774ff830 Merge #755
755: Add support for flash and bootloader for F3, F7 and H7 r=matoushybl a=matoushybl



Co-authored-by: Matous Hybl <hyblmatous@gmail.com>
2022-05-06 20:18:26 +00:00
8a80ae5685 Update list of families with bootloader support 2022-05-06 21:57:15 +02:00
118532278c Add H7 flash and bootloader support 2022-05-06 21:57:15 +02:00
6d56f772e1 Add F7 flash and bootloader support 2022-05-06 21:57:15 +02:00
f3700b4e42 Refactor flash handling to different modules for different families 2022-05-06 21:57:15 +02:00
4f5088d79d Add support for F3 flash 2022-05-06 21:57:15 +02:00
f7af9a549f Merge #751
751: Use explicit return statement TaskStorage::spawn r=Dirbaio a=danbev

This commit removes the else branch in `TaskStorage::spawn`, and returns
explicitly from the if statement's branch, similar to what
[TaskPool::spawn](85c0525e01/embassy/src/executor/raw/mod.rs (L235-L243)) does.

Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com>
2022-05-04 15:56:30 +00:00
0ce29ca84c fixup! Use explicit return statement TaskStorage::spawn 2022-05-04 16:31:52 +02:00
34493c7ed6 Use explicit return statement TaskStorage::spawn
This commit removes the else branch in TaskStorage::spawn, and returns
explicitly from the if statement's branch, similar to what
TaskPool::spawn does.
2022-05-04 16:11:55 +02:00
fc32b3750c Remove embassy_hal_common::usb.
The replacement is `embassy-usb`. There's a WIP driver for stm32 USBD in #709,
there's no WIP driver for stm32 USB_OTG. This means we're left without
USB_OTG support for now.

Reason for removing is I'm going to soon remove `embassy::io`, and
USB uses it. I don't want to spend time maintaining "dead" code
that is going to be removed. Volunteers welcome, either to update
old USB to the new IO, or write a USB_OTG driver fo the new USB.
2022-05-04 01:41:37 +02:00
85c0525e01 Merge #749
749: Rename spawn_allocate to spawn_mark_used r=Dirbaio a=danbev

This commit contains a suggestion to rename `TaskStorage::spawn_allocate`.

The motivation for this is when reading through the code I was
expecting something else to happen in this method, due to `allocate` in
the method name.

I'm very new to this code base so I may be wrong in thinking this
is a good change, but I wanted to open this PR to get some feedback.

Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com>
2022-05-03 14:58:24 +00:00
c223fa3791 Rename spawn_allocate to spawn_mark_used
This commit contains a suggestion to rename TaskStorage::spawn_allocate.

The motivation for this is when reading through the code I was
expecting something else to happen in this method, due to 'allocate' in
the method name.
2022-05-03 16:52:16 +02:00
49ae26f384 Merge pull request #748 from embassy-rs/nrf-i2c-timeout
Misc HAL improvements.
2022-05-03 01:25:05 +02:00
a465615196 embassy/time: derives for TimeoutError. 2022-05-03 01:08:34 +02:00
71e46d7efd stm32/gpio: add EH1.0 trait impls. 2022-05-03 00:52:48 +02:00
0be6df168b nrf/twim: add blocking methods variants with timeout. 2022-05-03 00:52:48 +02:00
1a3f787932 nrf/twim: add option for high drive. 2022-05-03 00:52:48 +02:00
29402fa76b nrf/gpio: add input+output to Flex, for OpenDrain. 2022-05-03 00:52:48 +02:00
6e129cf34f Merge #747
747: stm32/adc/v4: Fix log statement r=Dirbaio a=GrantM11235



Co-authored-by: Grant Miller <GrantM11235@gmail.com>
2022-05-02 20:18:01 +00:00
4bccd77849 stm32/adc/v4: Fix log statement 2022-05-02 15:14:49 -05:00
b1afe54c5f Merge pull request #746 from embassy-rs/net-get-config
net: add functions to get current Eth and IP config
2022-05-02 22:10:46 +02:00
a5f5c3a844 net: add functions to get current Eth and IP config 2022-05-02 16:19:34 +02:00
e74af83681 Merge pull request #744 from danbev/waker_typo
Fix typo in waker.rs
2022-05-01 20:17:35 +02:00
7b04c78388 Fix typo in waker.rs 2022-05-01 19:25:45 +02:00
d600f39260 Merge #743
743: Add PLL config support for F2 r=Dirbaio a=Gekkio

- minor changes to make the F2 RCC API a bit more flexible
- low-level PLL config with assertions based on datasheet specs. It shouldn't be very difficult to later add a "reverse API" where you pass the clocks you want to a function and it generates a `PLLConfig` struct for you
- PLL API tested on my custom board with 12 MHz HSE as source for PLL to generate max clocks for SYSCLK/AHB/APB/APB1/PLL48
- the example *should* work but is untested since I don't have the Nucleo board 😞 

Co-authored-by: Joonas Javanainen <joonas.javanainen@gmail.com>
2022-04-30 21:08:43 +00:00
e88559c5ca Use defmt-friendly error handling 2022-04-30 11:41:17 +03:00
c474682ea9 Merge #733
733: Add f107 ethernet support. r=Dirbaio a=davidlenfesty

The original driver works perfectly, the only required changes were only to clock and pin configuration.

Bits that are also present and deserve some scrutiny:
- Migrated LAN8742a driver to a generic SMI version (only *functional* difference is a couple extra status checks for the link poll, which IMO weren't great anyways (i.e. it would consider the link down if it negotiated to 10M)
- Migrated f1 RCC init to "new" style. As of creating this draft PR, it is pretty much only tested on the happy path for my specific configuration, and also needs a couple things done (calculated clock speeds are hardcoded and ADC clock isn't implemented)
- Support for v1b driver (f2 and f4) was added, but not tested.

(Made a draft PR until f4 support is verified and I finish the clock init - adding testing and at least feature parity with how it was before)

Co-authored-by: David Lenfesty <lenfesty@ualberta.ca>
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
2022-04-30 04:06:17 +00:00
804b20c5af stm32/eth: make "ethmac" vs "eth" consistent in RCC regs. 2022-04-30 04:49:57 +02:00
bb2db2b7be Update stm32-data for new generated data 2022-04-30 04:49:56 +02:00
5e6c4ae024 embassy-stm32/eth: consolidate v1a/v1c and add v1b
The only differences between v1a and v1c were clocks and GPIO, v1b will
likely work out of the box (or simply need minor tweaks)
2022-04-30 04:49:24 +02:00
2e7b42fc5b embassy-stm32/eth: convert LAN8742 driver to generic SMI driver
SMI Ethernet PHYs all share a common base set of registers that can do
90% of all tasks. The LAN8742 driver used some vendor-specific
registers to check link negotiation status, but the need for that was
debatable, so I migrated it to a generic driver instead, anybody who
wants extra functionality can copy it and impl their own on top of it.
2022-04-30 04:49:24 +02:00
905b40e212 embassy-stm32/eth/v1a: configure pins correctly for f107
v1a works correctly!
2022-04-30 04:49:24 +02:00
0d2ef1099b initial work porting eth to f107 2022-04-30 04:49:24 +02:00
f30e5d2d3f Initial import to v1a, does not compile 2022-04-30 04:49:24 +02:00
1d5f9b86fb Add PLL example for F2 2022-04-29 18:21:41 +03:00
07ad52162b Add PLL config support for F2 2022-04-29 18:21:40 +03:00
0cfe1dc9df Move HSE config out of main clock mux
This makes the configuration more flexible and closer to the underlying
configuration register structure. For example, we could use HSI for the
system clock, but use HSE to output a clock with MCO.
2022-04-29 17:51:18 +03:00
2f43969dd4 Merge #742
742: Only 1 argument in embassy::main when there is no HAL r=Dirbaio a=jbeaurivage

There is a slight mistake in an error message from `[embassy::main]` macro. When there is no HAL specified, `main` should take only one argument.

Co-authored-by: Justin Beaurivage <justin@wearableavionics.com>
2022-04-29 14:29:26 +00:00
c53b2fdc05 Require 1 argument in embassy::main without HAL 2022-04-29 09:32:31 -04:00
b7c510beb4 Merge #738
738: Add split method to UarteWithIdle in nrf hal r=lulf a=ZoeyR

I needed this method because I was writing a driver for the sim7000 modem. Its a line based protocol so the read until idle was very useful to me. Unfortunately unlike the primary `Uarte` struct the `UarteWithIdle` didn't have `split()`. So I added it 😄 

Co-authored-by: Zoey Riordan <zoey@dos.cafe>
2022-04-28 16:25:36 +00:00
0ed4d294de Merge #741
741: Fix linker script for nrf bootloader example r=lulf a=lulf



Co-authored-by: Ulf Lilleengen <lulf@redhat.com>
2022-04-28 12:38:03 +00:00
b7e7211a20 Fix linker script for nrf bootloader example 2022-04-28 14:11:01 +02:00
bd488ef0d5 Merge #740
740: Allow using separate page sizes for state and dfu r=lulf a=lulf

* Less generics on bootloader. Keep PAGE_SIZE as a common multiple of
DFU and ACTIVE page sizes.
* Document restriction
* Add unit tests for different page sizes

Co-authored-by: Ulf Lilleengen <lulf@redhat.com>
2022-04-28 11:31:35 +00:00
bd237a1f96 Allow using separate page sizes for state and dfu
* Less generics on bootloader. Keep PAGE_SIZE as a common multiple of
DFU and ACTIVE page sizes.
* Document restriction
* Add unit tests for different page sizes
2022-04-28 10:38:25 +02:00
ba46df6825 Merge #739
739: net: Add support for packet pools with size 64 and 128 r=Dirbaio a=matoushybl



Co-authored-by: Matous Hybl <hyblmatous@gmail.com>
2022-04-27 19:58:42 +00:00