mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
add power management pins to board description
This commit is contained in:
parent
bdd8b727a7
commit
49484bb93d
1 changed files with 34 additions and 2 deletions
|
|
@ -205,8 +205,6 @@ pub fn setup_i2c_pins(iox: &dyn IoSetup) -> I2cChannel {
|
||||||
|
|
||||||
/// returns the power-down port and pin number
|
/// returns the power-down port and pin number
|
||||||
pub fn setup_camera_pins<T: IoSetup + IoGpio>(iox: &T) -> (IoxPort, u8) {
|
pub fn setup_camera_pins<T: IoSetup + IoGpio>(iox: &T) -> (IoxPort, u8) {
|
||||||
// power-down pin - default to powered down
|
|
||||||
iox.set_gpio_pin_value(IoxPort::PC, 14, IoxValue::High);
|
|
||||||
iox.setup_pin(
|
iox.setup_pin(
|
||||||
IoxPort::PC,
|
IoxPort::PC,
|
||||||
14,
|
14,
|
||||||
|
|
@ -217,6 +215,8 @@ pub fn setup_camera_pins<T: IoSetup + IoGpio>(iox: &T) -> (IoxPort, u8) {
|
||||||
Some(IoxEnable::Enable),
|
Some(IoxEnable::Enable),
|
||||||
Some(IoxDriveStrength::Drive2mA),
|
Some(IoxDriveStrength::Drive2mA),
|
||||||
);
|
);
|
||||||
|
// power-down pin - default to powered down
|
||||||
|
iox.set_gpio_pin_value(IoxPort::PC, 14, IoxValue::High);
|
||||||
// camera interface proper
|
// camera interface proper
|
||||||
for pin in 2..11 {
|
for pin in 2..11 {
|
||||||
iox.setup_pin(
|
iox.setup_pin(
|
||||||
|
|
@ -291,6 +291,38 @@ pub fn setup_pmic_irq<T: IoIrq>(iox: &T, server: &str, opcode: usize) {
|
||||||
iox.set_irq_pin(IoxPort::PB, 13, IoxValue::Low, server, opcode);
|
iox.set_irq_pin(IoxPort::PB, 13, IoxValue::Low, server, opcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn setup_oled_power_pin<T: IoSetup + IoGpio>(iox: &T) -> (IoxPort, u8) {
|
||||||
|
let (port, pin) = (IoxPort::PC, 4);
|
||||||
|
iox.setup_pin(
|
||||||
|
port,
|
||||||
|
pin,
|
||||||
|
Some(IoxDir::Output),
|
||||||
|
Some(IoxFunction::Gpio),
|
||||||
|
None,
|
||||||
|
Some(IoxEnable::Disable),
|
||||||
|
None,
|
||||||
|
Some(IoxDriveStrength::Drive2mA),
|
||||||
|
);
|
||||||
|
iox.set_gpio_pin_value(port, pin, IoxValue::Low);
|
||||||
|
(port, pin)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn setup_trng_power_pin<T: IoSetup + IoGpio>(iox: &T) -> (IoxPort, u8) {
|
||||||
|
let (port, pin) = (IoxPort::PC, 5);
|
||||||
|
iox.setup_pin(
|
||||||
|
port,
|
||||||
|
pin,
|
||||||
|
Some(IoxDir::Output),
|
||||||
|
Some(IoxFunction::Gpio),
|
||||||
|
None,
|
||||||
|
Some(IoxEnable::Disable),
|
||||||
|
None,
|
||||||
|
Some(IoxDriveStrength::Drive2mA),
|
||||||
|
);
|
||||||
|
iox.set_gpio_pin_value(port, pin, IoxValue::Low);
|
||||||
|
(port, pin)
|
||||||
|
}
|
||||||
|
|
||||||
// sentinel used by test infrastructure to assist with parsing
|
// sentinel used by test infrastructure to assist with parsing
|
||||||
// The format of any test infrastructure output to recover is as follows:
|
// The format of any test infrastructure output to recover is as follows:
|
||||||
// _|TT|_<ident>,<data separated by commas>,_|TE|_
|
// _|TT|_<ident>,<data separated by commas>,_|TE|_
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue