rp/pio: hide pio/sm numbers
nothing should care which number pio it is running on, and the state machine index could always be extracted from type information.
This commit is contained in:
parent
6ad58f428a
commit
79985f0036
@ -332,14 +332,6 @@ impl<'d, PIO: PioInstance, const SM: usize> sealed::PioStateMachine for PioState
|
|||||||
impl<'d, PIO: PioInstance, const SM: usize> PioStateMachine for PioStateMachineInstance<'d, PIO, SM> {}
|
impl<'d, PIO: PioInstance, const SM: usize> PioStateMachine for PioStateMachineInstance<'d, PIO, SM> {}
|
||||||
|
|
||||||
pub trait PioStateMachine: sealed::PioStateMachine + Sized + Unpin {
|
pub trait PioStateMachine: sealed::PioStateMachine + Sized + Unpin {
|
||||||
fn pio_no(&self) -> u8 {
|
|
||||||
Self::Pio::PIO_NO
|
|
||||||
}
|
|
||||||
|
|
||||||
fn sm_no(&self) -> u8 {
|
|
||||||
Self::SM as u8
|
|
||||||
}
|
|
||||||
|
|
||||||
fn restart(&mut self) {
|
fn restart(&mut self) {
|
||||||
let mask = 1u8 << Self::SM;
|
let mask = 1u8 << Self::SM;
|
||||||
unsafe {
|
unsafe {
|
||||||
@ -981,11 +973,7 @@ mod sealed {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait PioInstance: sealed::PioInstance + Sized + Unpin {
|
pub trait PioInstance: sealed::PioInstance + Sized + Unpin {}
|
||||||
fn pio(&self) -> u8 {
|
|
||||||
Self::PIO_NO
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
macro_rules! impl_pio {
|
macro_rules! impl_pio {
|
||||||
($name:ident, $pio:expr, $pac:ident, $funcsel:ident) => {
|
($name:ident, $pio:expr, $pac:ident, $funcsel:ident) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user