Compare commits
7 Commits
aafa07df80
...
85da57980a
Author | SHA1 | Date |
---|---|---|
MorganTL | 85da57980a | |
MorganTL | bc1f445be7 | |
MorganTL | e1a2ab47e5 | |
MorganTL | 163a85f9d8 | |
MorganTL | 88d030aded | |
MorganTL | cdf4a56d97 | |
Sebastien Bourdeauducq | ca17cd419e |
|
@ -87,8 +87,6 @@ class GenericStandalone(SoCCore):
|
|||
self.acpki = acpki
|
||||
self.rustc_cfg = dict()
|
||||
|
||||
self.rustc_cfg["hw_rev"] = description["hw_rev"]
|
||||
|
||||
platform = kasli_soc.Platform()
|
||||
platform.toolchain.bitstream_commands.extend([
|
||||
"set_property BITSTREAM.GENERAL.COMPRESS True [current_design]",
|
||||
|
@ -181,8 +179,6 @@ class GenericMaster(SoCCore):
|
|||
self.acpki = acpki
|
||||
self.rustc_cfg = dict()
|
||||
|
||||
self.rustc_cfg["hw_rev"] = description["hw_rev"]
|
||||
|
||||
platform = kasli_soc.Platform()
|
||||
platform.toolchain.bitstream_commands.extend([
|
||||
"set_property BITSTREAM.GENERAL.COMPRESS True [current_design]",
|
||||
|
@ -325,8 +321,6 @@ class GenericSatellite(SoCCore):
|
|||
self.acpki = acpki
|
||||
self.rustc_cfg = dict()
|
||||
|
||||
self.rustc_cfg["hw_rev"] = description["hw_rev"]
|
||||
|
||||
platform = kasli_soc.Platform()
|
||||
platform.toolchain.bitstream_commands.extend([
|
||||
"set_property BITSTREAM.GENERAL.COMPRESS True [current_design]",
|
||||
|
|
|
@ -56,7 +56,9 @@ impl<'a> IoExpander<'a> {
|
|||
let mut io_expander = match index {
|
||||
0 => IoExpander {
|
||||
i2c,
|
||||
channel: 0,
|
||||
address: 0x40,
|
||||
virtual_led_mapping: &VIRTUAL_LED_MAPPING0,
|
||||
iodir: IO_DIR_MAPPING0,
|
||||
out_current: [0; 2],
|
||||
out_target: [0; 2],
|
||||
|
@ -66,12 +68,12 @@ impl<'a> IoExpander<'a> {
|
|||
gpioa: 0x12,
|
||||
gpiob: 0x13,
|
||||
},
|
||||
virtual_led_mapping: &VIRTUAL_LED_MAPPING0,
|
||||
channel: 0,
|
||||
},
|
||||
1 => IoExpander {
|
||||
i2c,
|
||||
channel: 1,
|
||||
address: 0x42,
|
||||
virtual_led_mapping: &VIRTUAL_LED_MAPPING1,
|
||||
iodir: IO_DIR_MAPPING1,
|
||||
out_current: [0; 2],
|
||||
out_target: [0; 2],
|
||||
|
@ -81,8 +83,6 @@ impl<'a> IoExpander<'a> {
|
|||
gpioa: 0x12,
|
||||
gpiob: 0x13,
|
||||
},
|
||||
virtual_led_mapping: &VIRTUAL_LED_MAPPING1,
|
||||
channel: 1,
|
||||
},
|
||||
_ => return Err("incorrect I/O expander index"),
|
||||
};
|
||||
|
|
|
@ -118,7 +118,7 @@ fn wait_for_virtual_leds_change() -> nb::Result<(), Void> {
|
|||
}
|
||||
}
|
||||
#[cfg(all(feature = "target_kasli_soc", has_drtio))]
|
||||
async fn async_rtio_led() {
|
||||
async fn async_io_expanders_service() {
|
||||
let mut io_expander0 = io_expander::IoExpander::new(unsafe { (&mut i2c::I2C_BUS).as_mut().unwrap() }, 0).unwrap();
|
||||
let mut io_expander1 = io_expander::IoExpander::new(unsafe { (&mut i2c::I2C_BUS).as_mut().unwrap() }, 1).unwrap();
|
||||
loop {
|
||||
|
@ -175,7 +175,7 @@ pub fn main_core0() {
|
|||
task::spawn(report_async_rtio_errors());
|
||||
|
||||
#[cfg(all(feature = "target_kasli_soc", has_drtio))]
|
||||
task::spawn(async_rtio_led());
|
||||
task::spawn(async_io_expanders_service());
|
||||
|
||||
comms::main(timer, cfg);
|
||||
}
|
||||
|
|
|
@ -610,6 +610,7 @@ pub extern "C" fn main_core0() -> i32 {
|
|||
ram::init_alloc_core0();
|
||||
|
||||
let mut i2c = I2c::i2c0();
|
||||
let i2c_ptr = &mut i2c as *mut I2c;
|
||||
i2c.init().expect("I2C initialization failed");
|
||||
#[cfg(feature = "target_kasli_soc")]
|
||||
{
|
||||
|
@ -655,11 +656,8 @@ pub extern "C" fn main_core0() -> i32 {
|
|||
|
||||
let mut hardware_tick_ts = 0;
|
||||
|
||||
let mut i2c0 = I2c::i2c0();
|
||||
let mut i2c1 = I2c::i2c0();
|
||||
i2c0.init().expect("I2C0 initialization failed");
|
||||
let mut io_expander0 = io_expander::IoExpander::new(&mut i2c0, 0).unwrap();
|
||||
let mut io_expander1 = io_expander::IoExpander::new(&mut i2c1, 1).unwrap();
|
||||
let mut io_expander0 = io_expander::IoExpander::new(unsafe { &mut *i2c_ptr }, 0).unwrap();
|
||||
let mut io_expander1 = io_expander::IoExpander::new(unsafe { &mut *i2c_ptr }, 1).unwrap();
|
||||
|
||||
loop {
|
||||
while !drtiosat_link_rx_up() {
|
||||
|
|
Loading…
Reference in New Issue