mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-20 00:46:30 +08:00
io_expander: fix efc shuttler compilation error
This commit is contained in:
parent
77c50324ef
commit
dad62c1aec
@ -10,6 +10,23 @@ struct Registers {
|
|||||||
gpiob: u8, // Output Port 1
|
gpiob: u8, // Output Port 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub struct IoExpander {
|
||||||
|
busno: u8,
|
||||||
|
port: u8,
|
||||||
|
address: u8,
|
||||||
|
virtual_led_mapping: &'static [(u8, u8, u8)],
|
||||||
|
iodir: [u8; 2],
|
||||||
|
out_current: [u8; 2],
|
||||||
|
out_target: [u8; 2],
|
||||||
|
registers: Registers,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl IoExpander {
|
||||||
|
#[cfg(all(soc_platform = "kasli", hw_rev = "v2.0"))]
|
||||||
|
pub fn new(index: u8) -> Result<Self, &'static str> {
|
||||||
|
const VIRTUAL_LED_MAPPING0: [(u8, u8, u8); 2] = [(0, 0, 6), (1, 1, 6)];
|
||||||
|
const VIRTUAL_LED_MAPPING1: [(u8, u8, u8); 2] = [(2, 0, 6), (3, 1, 6)];
|
||||||
|
|
||||||
#[cfg(has_si549)]
|
#[cfg(has_si549)]
|
||||||
const IODIR_CLK_SEL: u8 = 0x80; // out
|
const IODIR_CLK_SEL: u8 = 0x80; // out
|
||||||
#[cfg(has_si5324)]
|
#[cfg(has_si5324)]
|
||||||
@ -29,22 +46,6 @@ const OUT_TAR0 : [u8; 2] = [
|
|||||||
0,
|
0,
|
||||||
CLK_SEL_OUT
|
CLK_SEL_OUT
|
||||||
];
|
];
|
||||||
pub struct IoExpander {
|
|
||||||
busno: u8,
|
|
||||||
port: u8,
|
|
||||||
address: u8,
|
|
||||||
virtual_led_mapping: &'static [(u8, u8, u8)],
|
|
||||||
iodir: [u8; 2],
|
|
||||||
out_current: [u8; 2],
|
|
||||||
out_target: [u8; 2],
|
|
||||||
registers: Registers,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl IoExpander {
|
|
||||||
#[cfg(all(soc_platform = "kasli", hw_rev = "v2.0"))]
|
|
||||||
pub fn new(index: u8) -> Result<Self, &'static str> {
|
|
||||||
const VIRTUAL_LED_MAPPING0: [(u8, u8, u8); 2] = [(0, 0, 6), (1, 1, 6)];
|
|
||||||
const VIRTUAL_LED_MAPPING1: [(u8, u8, u8); 2] = [(2, 0, 6), (3, 1, 6)];
|
|
||||||
|
|
||||||
// Both expanders on SHARED I2C bus
|
// Both expanders on SHARED I2C bus
|
||||||
let mut io_expander = match index {
|
let mut io_expander = match index {
|
||||||
|
Loading…
Reference in New Issue
Block a user