Commit Graph

121 Commits

Author SHA1 Message Date
JuliDi
b57ba84da5
add dac-dma example for h7, remove memory.x 2023-07-28 16:34:20 +02:00
Dario Nieuwenhuis
3690af9bea
stm32/timer: merge pwm module into timer. (#1703)
The traits there are applicable to timer use cases other than PWM.
It doesn't make sense to keep them separated.
2023-07-28 15:29:27 +02:00
Adam Greig
c83552eadc
stm32: fix DAC examples
The DAC driver defaults to enabling the channel trigger, but leaves it
at the default value of TIM6 TRGO, then performs a software trigger
after writing the new output value. We could change the trigger
selection to software trigger, but for this example it's simpler to just
disable the trigger.
2023-07-22 12:57:49 +01:00
xoviat
17d5e1c470 stm32/eth: add set_poll_interval 2023-07-15 12:02:08 -05:00
xoviat
975a780efe stm32/eth: impl. poll interval 2023-07-15 09:57:09 -05:00
Dario Nieuwenhuis
6eb46c419c
Merge pull request #1565 from JuliDi/main
Implement DMA for DAC on STM32
2023-06-29 08:54:28 +00:00
JuliDi
91c31d5e43
Update DAC examples, add DAC + DMA example 2023-06-28 11:58:25 +02:00
Dario Nieuwenhuis
219ef5b37a stm32/otg: add VBUS detection.
Fixes #1442.
2023-06-27 12:52:37 +02:00
Dario Nieuwenhuis
558918651e stm32: update stm32-metapac. 2023-06-19 03:22:12 +02:00
Ruben De Smet
352f0b6c38
net: Support dual stack IP 2023-06-07 13:18:19 +02:00
Ruben De Smet
54bab33c73
Rename StaticConfig to StaticConfigV4 2023-06-06 17:04:21 +02:00
Dario Nieuwenhuis
1d8321b821 Use make_static! from static-cell v1.1 2023-06-01 01:42:34 +02:00
Rasmus Melchior Jacobsen
8938d928f8 Fix examples 2023-05-25 22:36:56 +02:00
Rasmus Melchior Jacobsen
860b519f99 Let Flash<Async/Blocking> be a thing 2023-05-25 21:40:54 +02:00
Rasmus Melchior Jacobsen
7371eefa86 Align with new bind_interrupt 2023-05-25 20:07:42 +02:00
Rasmus Melchior Jacobsen
525e065474 Align examples 2023-05-25 20:07:42 +02:00
Rasmus Melchior Jacobsen
7477785bbb Align examples 2023-05-25 20:07:41 +02:00
xoviat
316be179af stm32: move to bind_interrupts
disable lora functionality for now
2023-05-24 17:29:56 -05:00
Dario Nieuwenhuis
26d7610554 net: do not use smoltcp Instant/Duration in public API. 2023-05-15 00:53:30 +02:00
Dirk Stolle
0584312ef0 Fix some typos 2023-05-08 23:25:01 +02:00
Rasmus Melchior Jacobsen
2a49e11cb0 Align flash examples 2023-04-05 10:55:31 +02:00
Dario Nieuwenhuis
b2c6dc45e3 Fix examples broken by the macro fix. 2023-03-08 09:17:01 +01:00
Dario Nieuwenhuis
3af991ab63 usb: unify ControlHandler+DeviceStateHandler, route all control requests to all handlers.
- Allows classes to handle vendor requests.
- Allows classes to use a single handler for multiple interfaces.
- Allows classes to access the other events (previously only `reset` was available).
2023-02-08 00:17:08 +01:00
Dario Nieuwenhuis
fe15a7beee net: allocate space for 2 sockets, needed for dhcp. 2023-01-19 14:44:01 +01:00
Paweł Jan Czochański
8f4fae9b36 Add smoltcp dhcp socket configuration 2023-01-19 14:44:01 +01:00
chemicstry
1af102a1aa stm32 otg: add examples. 2023-01-11 17:58:15 +01:00
Dario Nieuwenhuis
3005ee0178 stm32/eth_v2: update to new embassy-net trait, remove PeripheralMutex. 2022-12-13 16:43:25 +01:00
Matous Hybl
cbc97758e3 stm32: Fix watchdog division by zero for 256 prescaler, add watchdog example for H7 2022-11-10 15:56:28 +01:00
bors[bot]
01e23bf9dd
Merge #1025
1025: Implement I2C timeouts, second attempt r=Dirbaio a=chemicstry

This is an alterrnative to #1022 as discussed there.

Timeouts are implemented using suggested `check_timeout: impl Fn() -> Result<(), Error>` function, which does not depend on `embassy-time` by default and is a noop for regular I2C.

This also adds `time` feature like in `embassy-nrf` to enable `embassy-time` dependencies. While at it, I also gated some other peripherals that depend on `embassy-time`, notably `usb` and (partially) `subghz`.

`TimeoutI2c` is currently only implemented for i2cv1, because i2cv2 has additional complications:
- Async methods still use a lot of busy waiting code in between DMA transfers, so simple `with_timeout()` will not work and it will have to use both types of timeouts. It could probably be rewritten to replace busy waits with IRQs, but that's outside the scope of this PR.
- I2C definition `I2c<'d, T, TXDMA, RXDMA>` is different from i2cv1 `I2c<'d, T>` making it hard to share single `TimeoutI2c` wrapper. A couple of options here:
  - Duplicate `TimeoutI2c` code
  - Add dummy `TXDMA`, `RXDMA` types to i2cv1 considering that in the future it should also support DMA

Co-authored-by: chemicstry <chemicstry@gmail.com>
2022-10-26 19:34:43 +00:00
Guillaume MICHEL
9cac649fcf stm32: Add support for read_until_idle on UART 2022-10-26 19:06:18 +02:00
chemicstry
52c03cf0a4 Add more docs 2022-10-24 22:48:40 +03:00
chemicstry
1bed02296c i2cv2 timeouts 2022-10-24 12:33:17 +03: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
ivmarkov
c5ce02b30e Remove default, reorder generic params 2022-09-25 09:40:36 +03:00
Dario Nieuwenhuis
5677b13a86 sync: flatten module structure. 2022-08-22 22:18:13 +02:00
Dario Nieuwenhuis
21072bee48 split embassy-util into embassy-futures, embassy-sync. 2022-08-22 22:18:13 +02:00
Dario Nieuwenhuis
478f472784 Remove Forever, switch to static_cell. 2022-08-22 16:11:40 +02:00
Dario Nieuwenhuis
5daa173ce4 Split embassy-time from embassy-executor. 2022-08-18 01:22:30 +02:00
Dario Nieuwenhuis
2e85eaf7d5 examples Remove the fn config() idiom.
It was only useful for doing #[embassy_executor::main(config = "config()")]`. Now that
it's gone, it makes more sense to build the config in main directly.
2022-08-17 22:25:58 +02:00
Dario Nieuwenhuis
fc6e1e06b3 Remove HAL initialization from #[embassy::main] macro. 2022-08-17 22:16:46 +02:00
bors[bot]
0e524247fa
Merge #896
896: Implement I2C pullup configuration r=lulf a=chemicstry

I wasn't sure if I should put frequency into config struct, so left it separate as in SPI periph.

Also added Copy derives to gpio types, not sure why they weren't?

Co-authored-by: chemicstry <chemicstry@gmail.com>
2022-08-10 10:08:27 +00:00
chemicstry
6498324b58 Implement I2C pullup configuration 2022-08-09 22:13:35 +03:00
Ulf Lilleengen
2e76b13a4c Add example using embedded-nal-async traits 2022-08-09 14:44:18 +02:00
Dario Nieuwenhuis
a0f1b0ee01 Split embassy crate into embassy-executor, embassy-util. 2022-07-29 23:40:36 +02:00
chemicstry
046778fc53 Improve ADC configuration options 2022-07-27 01:17:26 +03:00
Dario Nieuwenhuis
b5ff7c5d60 rename PwmPin::new_chX, update examples. 2022-07-23 16:16:29 +02:00
Dario Nieuwenhuis
4901c34d9c Rename Unborrowed -> PeripheralRef, Unborrow -> Peripheral 2022-07-23 14:00:19 +02:00
Dario Nieuwenhuis
8a9d2f59af Update embassy-stm32 2022-07-23 02:40:13 +02:00
Grant Miller
5ecbe5c918 embassy-stm32: Simplify time
- Remove unused `MilliSeconds`, `MicroSeconds`, and `NanoSeconds` types
- Remove `Bps`, `KiloHertz`, and `MegaHertz` types that were only used
for converting to `Hertz`
- Replace all instances of `impl Into<Hertz>` with `Hertz`
- Add `hz`, `khz`, and `mhz` methods to `Hertz`, as well as
free function shortcuts
- Remove `U32Ext` extension trait
2022-07-10 21:46:45 -05:00
Dario Nieuwenhuis
a8703b7598 Run rustfmt. 2022-06-12 22:22:31 +02:00