mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2025-01-10 04:21:32 +11:00
commit
fbba3755ff
|
@ -210,7 +210,7 @@ dyn_function!(Spi, Xip, Uart, I2C, Pwm, Pio0, Pio1, Clock, UsbAux);
|
|||
//==============================================================================
|
||||
|
||||
/// Value-level `enum` for pin groups
|
||||
#[derive(PartialEq, Clone, Copy)]
|
||||
#[derive(PartialEq, Eq, Clone, Copy)]
|
||||
pub enum DynGroup {
|
||||
/// .
|
||||
Bank0,
|
||||
|
@ -219,7 +219,7 @@ pub enum DynGroup {
|
|||
}
|
||||
|
||||
/// Value-level `struct` representing pin IDs
|
||||
#[derive(PartialEq, Clone, Copy)]
|
||||
#[derive(PartialEq, Eq, Clone, Copy)]
|
||||
pub struct DynPinId {
|
||||
/// .
|
||||
pub group: DynGroup,
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
//! Semi-internal enums mostly used in typelevel magic
|
||||
|
||||
/// Value-level `struct` representing slice IDs
|
||||
#[derive(PartialEq, Clone, Copy)]
|
||||
#[derive(PartialEq, Eq, Clone, Copy)]
|
||||
pub struct DynSliceId {
|
||||
/// Slice id
|
||||
pub num: u8,
|
||||
}
|
||||
|
||||
/// Slice modes
|
||||
#[derive(PartialEq, Clone, Copy)]
|
||||
#[derive(PartialEq, Eq, Clone, Copy)]
|
||||
pub enum DynSliceMode {
|
||||
/// Count continuously whenever the slice is enabled
|
||||
FreeRunning,
|
||||
|
@ -21,7 +21,7 @@ pub enum DynSliceMode {
|
|||
}
|
||||
|
||||
/// Channel ids
|
||||
#[derive(PartialEq, Clone, Copy)]
|
||||
#[derive(PartialEq, Eq, Clone, Copy)]
|
||||
pub enum DynChannelId {
|
||||
/// Channel A
|
||||
A,
|
||||
|
|
|
@ -383,7 +383,7 @@ where
|
|||
pub fn enable_interrupt(&mut self) {
|
||||
unsafe {
|
||||
let pwm = &(*pac::PWM::ptr());
|
||||
let reg = (&pwm.inte).as_ptr();
|
||||
let reg = pwm.inte.as_ptr();
|
||||
write_bitmask_set(reg, self.bitmask());
|
||||
}
|
||||
}
|
||||
|
@ -393,7 +393,7 @@ where
|
|||
pub fn disable_interrupt(&mut self) {
|
||||
unsafe {
|
||||
let pwm = &(*pac::PWM::ptr());
|
||||
let reg = (&pwm.inte).as_ptr();
|
||||
let reg = pwm.inte.as_ptr();
|
||||
write_bitmask_clear(reg, self.bitmask());
|
||||
};
|
||||
}
|
||||
|
@ -417,7 +417,7 @@ where
|
|||
pub fn force_interrupt(&mut self) {
|
||||
unsafe {
|
||||
let pwm = &(*pac::PWM::ptr());
|
||||
let reg = (&pwm.intf).as_ptr();
|
||||
let reg = pwm.intf.as_ptr();
|
||||
write_bitmask_set(reg, self.bitmask());
|
||||
}
|
||||
}
|
||||
|
@ -428,7 +428,7 @@ where
|
|||
pub fn clear_force_interrupt(&mut self) {
|
||||
unsafe {
|
||||
let pwm = &(*pac::PWM::ptr());
|
||||
let reg = (&pwm.intf).as_ptr();
|
||||
let reg = pwm.intf.as_ptr();
|
||||
write_bitmask_clear(reg, self.bitmask());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue