diff options
| author | Timo Kröger <[email protected]> | 2024-03-01 14:59:21 +0100 |
|---|---|---|
| committer | Timo Kröger <[email protected]> | 2024-03-12 08:14:41 +0100 |
| commit | 8a255b375b7598c2825535cb0d0729311a7b882d (patch) | |
| tree | 44fc73227a747209e44235aa4047982c79b0a709 /embassy-stm32/src/ucpd.rs | |
| parent | 1ef02e538497d1876ec26f8acf0763d6c3263382 (diff) | |
[UCPD] Instance and Pin Traits
Skip FRSTX pin for now. Its available twice in the device JSON as
FRSTX1 and FRSTX2 both with the same pins as targets.
I don’t know enough about the FRS (fast role switch) feature to
understand if that is correct and how to handle the pins.
Diffstat (limited to 'embassy-stm32/src/ucpd.rs')
| -rw-r--r-- | embassy-stm32/src/ucpd.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/embassy-stm32/src/ucpd.rs b/embassy-stm32/src/ucpd.rs new file mode 100644 index 000000000..a2bac7611 --- /dev/null +++ b/embassy-stm32/src/ucpd.rs | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | //! USB Type-C/USB Power Delivery Interface (UCPD) | ||
| 2 | |||
| 3 | use crate::rcc::RccPeripheral; | ||
| 4 | |||
| 5 | /// UCPD instance trait. | ||
| 6 | pub trait Instance: sealed::Instance + RccPeripheral {} | ||
| 7 | |||
| 8 | pub(crate) mod sealed { | ||
| 9 | pub trait Instance { | ||
| 10 | const REGS: crate::pac::ucpd::Ucpd; | ||
| 11 | } | ||
| 12 | } | ||
| 13 | |||
| 14 | foreach_peripheral!( | ||
| 15 | (ucpd, $inst:ident) => { | ||
| 16 | impl sealed::Instance for crate::peripherals::$inst { | ||
| 17 | const REGS: crate::pac::ucpd::Ucpd = crate::pac::$inst; | ||
| 18 | } | ||
| 19 | |||
| 20 | impl Instance for crate::peripherals::$inst {} | ||
| 21 | }; | ||
| 22 | ); | ||
| 23 | |||
| 24 | pin_trait!(Cc1Pin, Instance); | ||
| 25 | pin_trait!(Cc2Pin, Instance); | ||
| 26 | |||
| 27 | dma_trait!(TxDma, Instance); | ||
| 28 | dma_trait!(RxDma, Instance); | ||
