diff options
| author | ibuki2003 <[email protected]> | 2024-11-14 02:50:04 +0900 |
|---|---|---|
| committer | ibuki2003 <[email protected]> | 2024-11-14 02:50:04 +0900 |
| commit | 19a06d6b8a00e3758d60246dbfed3b867fee35cb (patch) | |
| tree | 6384a31172b43ef5552d6f9be19894aa0700f3f8 /embassy-rp/src/uart/mod.rs | |
| parent | 015e3aecb410c2d5afefb908b4d4171d5b478be3 (diff) | |
fix(rp): use uart dreq number defined in pac
Diffstat (limited to 'embassy-rp/src/uart/mod.rs')
| -rw-r--r-- | embassy-rp/src/uart/mod.rs | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/embassy-rp/src/uart/mod.rs b/embassy-rp/src/uart/mod.rs index 08f20924c..8d12aeef6 100644 --- a/embassy-rp/src/uart/mod.rs +++ b/embassy-rp/src/uart/mod.rs | |||
| @@ -1295,8 +1295,8 @@ impl<'d, T: Instance> embedded_io::Write for Uart<'d, T, Blocking> { | |||
| 1295 | trait SealedMode {} | 1295 | trait SealedMode {} |
| 1296 | 1296 | ||
| 1297 | trait SealedInstance { | 1297 | trait SealedInstance { |
| 1298 | const TX_DREQ: u8; | 1298 | const TX_DREQ: pac::dma::vals::TreqSel; |
| 1299 | const RX_DREQ: u8; | 1299 | const RX_DREQ: pac::dma::vals::TreqSel; |
| 1300 | 1300 | ||
| 1301 | fn regs() -> pac::uart::Uart; | 1301 | fn regs() -> pac::uart::Uart; |
| 1302 | 1302 | ||
| @@ -1334,8 +1334,8 @@ pub trait Instance: SealedInstance { | |||
| 1334 | macro_rules! impl_instance { | 1334 | macro_rules! impl_instance { |
| 1335 | ($inst:ident, $irq:ident, $tx_dreq:expr, $rx_dreq:expr) => { | 1335 | ($inst:ident, $irq:ident, $tx_dreq:expr, $rx_dreq:expr) => { |
| 1336 | impl SealedInstance for peripherals::$inst { | 1336 | impl SealedInstance for peripherals::$inst { |
| 1337 | const TX_DREQ: u8 = $tx_dreq; | 1337 | const TX_DREQ: pac::dma::vals::TreqSel = $tx_dreq; |
| 1338 | const RX_DREQ: u8 = $rx_dreq; | 1338 | const RX_DREQ: pac::dma::vals::TreqSel = $rx_dreq; |
| 1339 | 1339 | ||
| 1340 | fn regs() -> pac::uart::Uart { | 1340 | fn regs() -> pac::uart::Uart { |
| 1341 | pac::$inst | 1341 | pac::$inst |
| @@ -1360,8 +1360,18 @@ macro_rules! impl_instance { | |||
| 1360 | }; | 1360 | }; |
| 1361 | } | 1361 | } |
| 1362 | 1362 | ||
| 1363 | impl_instance!(UART0, UART0_IRQ, 20, 21); | 1363 | impl_instance!( |
| 1364 | impl_instance!(UART1, UART1_IRQ, 22, 23); | 1364 | UART0, |
| 1365 | UART0_IRQ, | ||
| 1366 | pac::dma::vals::TreqSel::UART0_TX, | ||
| 1367 | pac::dma::vals::TreqSel::UART0_RX | ||
| 1368 | ); | ||
| 1369 | impl_instance!( | ||
| 1370 | UART1, | ||
| 1371 | UART1_IRQ, | ||
| 1372 | pac::dma::vals::TreqSel::UART1_TX, | ||
| 1373 | pac::dma::vals::TreqSel::UART1_RX | ||
| 1374 | ); | ||
| 1365 | 1375 | ||
| 1366 | /// Trait for TX pins. | 1376 | /// Trait for TX pins. |
| 1367 | pub trait TxPin<T: Instance>: crate::gpio::Pin {} | 1377 | pub trait TxPin<T: Instance>: crate::gpio::Pin {} |
