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
|
/// Value-level `enum` for pin groups
|
||||||
#[derive(PartialEq, Clone, Copy)]
|
#[derive(PartialEq, Eq, Clone, Copy)]
|
||||||
pub enum DynGroup {
|
pub enum DynGroup {
|
||||||
/// .
|
/// .
|
||||||
Bank0,
|
Bank0,
|
||||||
|
@ -219,7 +219,7 @@ pub enum DynGroup {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Value-level `struct` representing pin IDs
|
/// Value-level `struct` representing pin IDs
|
||||||
#[derive(PartialEq, Clone, Copy)]
|
#[derive(PartialEq, Eq, Clone, Copy)]
|
||||||
pub struct DynPinId {
|
pub struct DynPinId {
|
||||||
/// .
|
/// .
|
||||||
pub group: DynGroup,
|
pub group: DynGroup,
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
//! Semi-internal enums mostly used in typelevel magic
|
//! Semi-internal enums mostly used in typelevel magic
|
||||||
|
|
||||||
/// Value-level `struct` representing slice IDs
|
/// Value-level `struct` representing slice IDs
|
||||||
#[derive(PartialEq, Clone, Copy)]
|
#[derive(PartialEq, Eq, Clone, Copy)]
|
||||||
pub struct DynSliceId {
|
pub struct DynSliceId {
|
||||||
/// Slice id
|
/// Slice id
|
||||||
pub num: u8,
|
pub num: u8,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Slice modes
|
/// Slice modes
|
||||||
#[derive(PartialEq, Clone, Copy)]
|
#[derive(PartialEq, Eq, Clone, Copy)]
|
||||||
pub enum DynSliceMode {
|
pub enum DynSliceMode {
|
||||||
/// Count continuously whenever the slice is enabled
|
/// Count continuously whenever the slice is enabled
|
||||||
FreeRunning,
|
FreeRunning,
|
||||||
|
@ -21,7 +21,7 @@ pub enum DynSliceMode {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Channel ids
|
/// Channel ids
|
||||||
#[derive(PartialEq, Clone, Copy)]
|
#[derive(PartialEq, Eq, Clone, Copy)]
|
||||||
pub enum DynChannelId {
|
pub enum DynChannelId {
|
||||||
/// Channel A
|
/// Channel A
|
||||||
A,
|
A,
|
||||||
|
|
|
@ -383,7 +383,7 @@ where
|
||||||
pub fn enable_interrupt(&mut self) {
|
pub fn enable_interrupt(&mut self) {
|
||||||
unsafe {
|
unsafe {
|
||||||
let pwm = &(*pac::PWM::ptr());
|
let pwm = &(*pac::PWM::ptr());
|
||||||
let reg = (&pwm.inte).as_ptr();
|
let reg = pwm.inte.as_ptr();
|
||||||
write_bitmask_set(reg, self.bitmask());
|
write_bitmask_set(reg, self.bitmask());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -393,7 +393,7 @@ where
|
||||||
pub fn disable_interrupt(&mut self) {
|
pub fn disable_interrupt(&mut self) {
|
||||||
unsafe {
|
unsafe {
|
||||||
let pwm = &(*pac::PWM::ptr());
|
let pwm = &(*pac::PWM::ptr());
|
||||||
let reg = (&pwm.inte).as_ptr();
|
let reg = pwm.inte.as_ptr();
|
||||||
write_bitmask_clear(reg, self.bitmask());
|
write_bitmask_clear(reg, self.bitmask());
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -417,7 +417,7 @@ where
|
||||||
pub fn force_interrupt(&mut self) {
|
pub fn force_interrupt(&mut self) {
|
||||||
unsafe {
|
unsafe {
|
||||||
let pwm = &(*pac::PWM::ptr());
|
let pwm = &(*pac::PWM::ptr());
|
||||||
let reg = (&pwm.intf).as_ptr();
|
let reg = pwm.intf.as_ptr();
|
||||||
write_bitmask_set(reg, self.bitmask());
|
write_bitmask_set(reg, self.bitmask());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -428,7 +428,7 @@ where
|
||||||
pub fn clear_force_interrupt(&mut self) {
|
pub fn clear_force_interrupt(&mut self) {
|
||||||
unsafe {
|
unsafe {
|
||||||
let pwm = &(*pac::PWM::ptr());
|
let pwm = &(*pac::PWM::ptr());
|
||||||
let reg = (&pwm.intf).as_ptr();
|
let reg = pwm.intf.as_ptr();
|
||||||
write_bitmask_clear(reg, self.bitmask());
|
write_bitmask_clear(reg, self.bitmask());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue