mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-20 09:03:28 +00:00
fix dabao target for lib1x-hal
this is the "effective" traget for simulation: no external peripherals expected.
This commit is contained in:
parent
4f8169c3d9
commit
5151553028
4 changed files with 19 additions and 10 deletions
|
|
@ -51,6 +51,7 @@ board-baosec = [
|
||||||
"bmp180",
|
"bmp180",
|
||||||
"utralib/bao1x",
|
"utralib/bao1x",
|
||||||
"ux-api/board-baosec",
|
"ux-api/board-baosec",
|
||||||
|
"ux-api/std",
|
||||||
] # USB form factor token
|
] # USB form factor token
|
||||||
loader-baosec = [
|
loader-baosec = [
|
||||||
"utralib/bao1x",
|
"utralib/bao1x",
|
||||||
|
|
@ -66,9 +67,11 @@ kernel-dabao = ["utralib/bao1x"]
|
||||||
test-baosec = ["ux-api/loader-baosec", "camera-gc2145"]
|
test-baosec = ["ux-api/loader-baosec", "camera-gc2145"]
|
||||||
hosted-baosec = ["std"] # emulated hardware on x86 platform
|
hosted-baosec = ["std"] # emulated hardware on x86 platform
|
||||||
board-baosor = [
|
board-baosor = [
|
||||||
|
"std",
|
||||||
"camera-gc2145",
|
"camera-gc2145",
|
||||||
"axp2101",
|
"axp2101",
|
||||||
"utralib/bao1x",
|
"utralib/bao1x",
|
||||||
|
"ux-api/std",
|
||||||
] # Precursor form factor
|
] # Precursor form factor
|
||||||
loader-baosor = []
|
loader-baosor = []
|
||||||
board-dabao = ["utralib/bao1x"] # Dev board form factor
|
board-dabao = ["utralib/bao1x"] # Dev board form factor
|
||||||
|
|
@ -89,7 +92,6 @@ std = [
|
||||||
"xous-api-names",
|
"xous-api-names",
|
||||||
"usb-device",
|
"usb-device",
|
||||||
"xous-api-ticktimer",
|
"xous-api-ticktimer",
|
||||||
"ux-api/std",
|
|
||||||
"bao1x-api/std",
|
"bao1x-api/std",
|
||||||
]
|
]
|
||||||
derive-rkyv = ["rkyv"]
|
derive-rkyv = ["rkyv"]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// Constants that define pin locations, RAM offsets, etc. for the DaBao basic breakout board
|
// Constants that define pin locations, RAM offsets, etc. for the DaBao basic breakout board
|
||||||
use crate::iox::IoSetup;
|
|
||||||
use crate::iox::*;
|
use bao1x_api::*;
|
||||||
|
|
||||||
// console uart buffer
|
// console uart buffer
|
||||||
pub const UART_DMA_TX_BUF_PHYS: usize = utralib::HW_IFRAM0_MEM + utralib::HW_IFRAM0_MEM_LEN - 4096;
|
pub const UART_DMA_TX_BUF_PHYS: usize = utralib::HW_IFRAM0_MEM + utralib::HW_IFRAM0_MEM_LEN - 4096;
|
||||||
|
|
@ -42,7 +42,7 @@ pub fn setup_usb_pins<T: IoSetup + IoGpio>(iox: &T) -> (IoxPort, u8) {
|
||||||
(IoxPort::PB, SE0_PIN)
|
(IoxPort::PB, SE0_PIN)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn setup_i2c_pins(iox: &dyn IoSetup) -> crate::udma::I2cChannel {
|
pub fn setup_i2c_pins(iox: &dyn IoSetup) -> bao1x_api::I2cChannel {
|
||||||
// I2C_SCL_B[0]
|
// I2C_SCL_B[0]
|
||||||
iox.setup_pin(
|
iox.setup_pin(
|
||||||
IoxPort::PB,
|
IoxPort::PB,
|
||||||
|
|
@ -65,5 +65,12 @@ pub fn setup_i2c_pins(iox: &dyn IoSetup) -> crate::udma::I2cChannel {
|
||||||
Some(IoxEnable::Enable),
|
Some(IoxEnable::Enable),
|
||||||
Some(IoxDriveStrength::Drive2mA),
|
Some(IoxDriveStrength::Drive2mA),
|
||||||
);
|
);
|
||||||
crate::udma::I2cChannel::Channel0
|
bao1x_api::I2cChannel::Channel0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// these are a bodge to allow some UDMA imports to work - they need to be present even if
|
||||||
|
// there currently no SPINOR devices attached.
|
||||||
|
pub const SPINOR_PAGE_LEN: u32 = 0x100;
|
||||||
|
pub const SPINOR_ERASE_SIZE: u32 = 0x1000; // this is the smallest sector size.
|
||||||
|
pub const SPINOR_BULK_ERASE_SIZE: u32 = 0x1_0000; // this is the bulk erase size.
|
||||||
|
pub const SPINOR_LEN: u32 = 16384 * 1024;
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,9 @@ pub use baosec::*;
|
||||||
pub mod baosor;
|
pub mod baosor;
|
||||||
#[cfg(any(feature = "board-baosor", feature = "loader-baosor"))]
|
#[cfg(any(feature = "board-baosor", feature = "loader-baosor"))]
|
||||||
pub use baosor::*;
|
pub use baosor::*;
|
||||||
#[cfg(any(feature = "board-dabao", feature = "loader-dabao"))]
|
#[cfg(any(feature = "board-dabao", feature = "loader-dabao", feature = "kernel-dabao"))]
|
||||||
pub mod dabao;
|
pub mod dabao;
|
||||||
#[cfg(any(feature = "board-dabao", feature = "loader-dabao"))]
|
#[cfg(any(feature = "board-dabao", feature = "loader-dabao", feature = "kernel-dabao"))]
|
||||||
pub use dabao::*;
|
pub use dabao::*;
|
||||||
#[cfg(feature = "hosted-baosec")]
|
#[cfg(feature = "hosted-baosec")]
|
||||||
pub mod hosted;
|
pub mod hosted;
|
||||||
|
|
|
||||||
|
|
@ -66,13 +66,13 @@ impl Uart {
|
||||||
|
|
||||||
use core::fmt::{Error, Write};
|
use core::fmt::{Error, Write};
|
||||||
impl Write for Uart {
|
impl Write for Uart {
|
||||||
fn write_str(&mut self, s: &str) -> Result<(), Error> {
|
fn write_str(&mut self, _s: &str) -> Result<(), Error> {
|
||||||
#[cfg(not(all(feature = "std", not(feature = "debug-print-usb"))))]
|
#[cfg(not(all(feature = "std", not(feature = "debug-print-usb"))))]
|
||||||
for c in s.bytes() {
|
for c in _s.bytes() {
|
||||||
self.putc(c);
|
self.putc(c);
|
||||||
}
|
}
|
||||||
// #[cfg(all(feature = "std", not(feature = "debug-print-usb")))]
|
// #[cfg(all(feature = "std", not(feature = "debug-print-usb")))]
|
||||||
// log::info!("{}", s);
|
// log::info!("{}", _s);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue