mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
add helper to translate return values from io setup to udma clock channels
this allows us to tease out the clock setting code from the pin setting code. probably will need to add more helpers for other peripherals as we continue through with this exercise.
This commit is contained in:
parent
45d9487c70
commit
81637f119b
1 changed files with 12 additions and 0 deletions
|
|
@ -52,6 +52,18 @@ pub enum PeriphId {
|
|||
impl Into<u32> for PeriphId {
|
||||
fn into(self) -> u32 { self as u32 }
|
||||
}
|
||||
|
||||
impl From<SpimChannel> for PeriphId {
|
||||
fn from(value: SpimChannel) -> Self {
|
||||
match value {
|
||||
SpimChannel::Channel0 => PeriphId::Spim0,
|
||||
SpimChannel::Channel1 => PeriphId::Spim1,
|
||||
SpimChannel::Channel2 => PeriphId::Spim2,
|
||||
SpimChannel::Channel3 => PeriphId::Spim3,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[repr(u32)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum PeriphEventId {
|
||||
|
|
|
|||
Loading…
Reference in a new issue