This commit is contained in:
@ -10,6 +10,7 @@ use va108xx::Uarta;
|
||||
|
||||
pub use crate::IrqCfg;
|
||||
use crate::{
|
||||
clock::enable_peripheral_clock,
|
||||
enable_interrupt,
|
||||
gpio::pin::{
|
||||
AltFunc1, AltFunc2, AltFunc3, Pin, PA16, PA17, PA18, PA19, PA2, PA26, PA27, PA3, PA30,
|
||||
@ -744,10 +745,11 @@ impl<Uart: Instance> Rx<Uart> {
|
||||
|
||||
pub fn into_rx_with_irq(
|
||||
self,
|
||||
irqsel: &pac::Irqsel,
|
||||
sysconfig: &mut pac::Sysconfig,
|
||||
irqsel: &mut pac::Irqsel,
|
||||
interrupt: pac::Interrupt,
|
||||
) -> RxWithIrq<Uart> {
|
||||
RxWithIrq::new(self, irqsel, interrupt)
|
||||
RxWithIrq::new(self, sysconfig, irqsel, interrupt)
|
||||
}
|
||||
|
||||
pub fn release(self) -> Uart {
|
||||
@ -934,7 +936,13 @@ pub struct RxWithIrq<Uart> {
|
||||
}
|
||||
|
||||
impl<Uart: Instance> RxWithIrq<Uart> {
|
||||
pub fn new(rx: Rx<Uart>, irqsel: &pac::Irqsel, interrupt: pac::Interrupt) -> Self {
|
||||
pub fn new(
|
||||
rx: Rx<Uart>,
|
||||
syscfg: &mut pac::Sysconfig,
|
||||
irqsel: &mut pac::Irqsel,
|
||||
interrupt: pac::Interrupt,
|
||||
) -> Self {
|
||||
enable_peripheral_clock(syscfg, PeripheralSelect::Irqsel);
|
||||
irqsel
|
||||
.uart0(Uart::IDX as usize)
|
||||
.write(|w| unsafe { w.bits(interrupt as u32) });
|
||||
|
Reference in New Issue
Block a user