pub struct Common<'d, PIO: Instance> { /* private fields */ }
Expand description
PIO handle.
Implementations§
Source§impl<'d, PIO: Instance> Common<'d, PIO>
impl<'d, PIO: Instance> Common<'d, PIO>
Sourcepub fn load_program<const SIZE: usize>(
&mut self,
prog: &Program<SIZE>,
) -> LoadedProgram<'d, PIO>
pub fn load_program<const SIZE: usize>( &mut self, prog: &Program<SIZE>, ) -> LoadedProgram<'d, PIO>
Load a PIO program. This will automatically relocate the program to an available chunk of free instruction memory if the program origin was not explicitly specified, otherwise it will attempt to load the program only at its origin.
Sourcepub fn try_load_program<const SIZE: usize>(
&mut self,
prog: &Program<SIZE>,
) -> Result<LoadedProgram<'d, PIO>, LoadError>
pub fn try_load_program<const SIZE: usize>( &mut self, prog: &Program<SIZE>, ) -> Result<LoadedProgram<'d, PIO>, LoadError>
Load a PIO program. This will automatically relocate the program to an available chunk of free instruction memory if the program origin was not explicitly specified, otherwise it will attempt to load the program only at its origin.
Sourcepub unsafe fn free_instr(&mut self, instrs: InstanceMemory<'_, PIO>)
pub unsafe fn free_instr(&mut self, instrs: InstanceMemory<'_, PIO>)
Free instruction memory. This is always possible but unsafe if any state machine is still using this bit of memory.
Sourcepub fn set_input_sync_bypass<'a>(&'a mut self, bypass: u32, mask: u32)
pub fn set_input_sync_bypass<'a>(&'a mut self, bypass: u32, mask: u32)
Bypass flipflop synchronizer on GPIO inputs.
Sourcepub fn get_input_sync_bypass(&self) -> u32
pub fn get_input_sync_bypass(&self) -> u32
Get bypass configuration.
Sourcepub fn make_pio_pin(
&mut self,
pin: impl Peripheral<P = impl PioPin + 'd> + 'd,
) -> Pin<'d, PIO>
pub fn make_pio_pin( &mut self, pin: impl Peripheral<P = impl PioPin + 'd> + 'd, ) -> Pin<'d, PIO>
Register a pin for PIO usage. Pins will be released from the PIO block
(i.e., have their FUNCSEL
reset to NULL
) when the Common
and
all StateMachine
s for this block have been dropped. Other members
of Pio
do not keep pin registrations alive.
Sourcepub fn apply_sm_batch(&mut self, f: impl FnOnce(&mut PioBatch<'d, PIO>))
pub fn apply_sm_batch(&mut self, f: impl FnOnce(&mut PioBatch<'d, PIO>))
Apply changes to all state machines in a batch.