pounder: clippy

master
Robert Jördens 2021-05-31 20:41:18 +02:00
parent da7fc08c15
commit 4c01a8f929
2 changed files with 9 additions and 8 deletions

View File

@ -43,6 +43,7 @@ pub enum Mode {
/// The configuration registers within the AD9959 DDS device. The values of each register are
/// equivalent to the address.
#[allow(clippy::upper_case_acronyms)]
pub enum Register {
CSR = 0x00,
FR1 = 0x01,

View File

@ -24,7 +24,7 @@ pub enum GpioPin {
Led7Red = 3,
Led8Green = 4,
Led9Red = 5,
AttLe0 = 8 + 0,
AttLe0 = 8,
AttLe1 = 8 + 1,
AttLe2 = 8 + 2,
AttLe3 = 8 + 3,
@ -89,14 +89,14 @@ pub struct DdsClockConfig {
pub external_clock: bool,
}
impl Into<ad9959::Channel> for Channel {
impl From<Channel> for ad9959::Channel {
/// Translate pounder channels to DDS output channels.
fn into(self) -> ad9959::Channel {
match self {
Channel::In0 => ad9959::Channel::Two,
Channel::In1 => ad9959::Channel::Four,
Channel::Out0 => ad9959::Channel::One,
Channel::Out1 => ad9959::Channel::Three,
fn from(other: Channel) -> Self {
match other {
Channel::In0 => Self::Two,
Channel::In1 => Self::Four,
Channel::Out0 => Self::One,
Channel::Out1 => Self::Three,
}
}
}