mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
convert to using the new setup_pin trait
This commit is contained in:
parent
a66cd1c077
commit
482b815f44
1 changed files with 15 additions and 20 deletions
|
|
@ -1,12 +1,10 @@
|
||||||
use core::mem::size_of;
|
use core::mem::size_of;
|
||||||
|
|
||||||
use cramium_hal::ifram::IframRange;
|
use cramium_hal::ifram::IframRange;
|
||||||
use cramium_hal::iox::Iox;
|
use cramium_hal::iox::{IoSetup, Iox};
|
||||||
use cramium_hal::udma::{GlobalConfig, PeriphId};
|
use cramium_hal::udma::{GlobalConfig, PeriphId};
|
||||||
use cramium_hal::{iox, udma};
|
use cramium_hal::{iox, udma};
|
||||||
|
|
||||||
use crate::platform::cramium::setup_port;
|
|
||||||
|
|
||||||
pub const FB_WIDTH_WORDS: usize = 11;
|
pub const FB_WIDTH_WORDS: usize = 11;
|
||||||
pub const FB_LINES: usize = 536;
|
pub const FB_LINES: usize = 536;
|
||||||
|
|
||||||
|
|
@ -18,42 +16,39 @@ pub fn show_logo(pclk_freq: u32, udma_global: &mut GlobalConfig, iox: &mut Iox)
|
||||||
const SPI_PORT: iox::IoxPort = iox::IoxPort::PD;
|
const SPI_PORT: iox::IoxPort = iox::IoxPort::PD;
|
||||||
|
|
||||||
// SPIM_CLK_A[0]
|
// SPIM_CLK_A[0]
|
||||||
setup_port(
|
iox.setup_pin(
|
||||||
iox,
|
|
||||||
SPI_PORT,
|
SPI_PORT,
|
||||||
SPI_CLK_PIN,
|
SPI_CLK_PIN,
|
||||||
Some(iox::IoxFunction::AF1),
|
|
||||||
Some(iox::IoxDir::Output),
|
Some(iox::IoxDir::Output),
|
||||||
Some(iox::IoxDriveStrength::Drive2mA),
|
Some(iox::IoxFunction::AF1),
|
||||||
|
None,
|
||||||
|
None,
|
||||||
Some(iox::IoxEnable::Enable),
|
Some(iox::IoxEnable::Enable),
|
||||||
None,
|
Some(iox::IoxDriveStrength::Drive2mA),
|
||||||
None,
|
|
||||||
);
|
);
|
||||||
// SPIM_SD0_A[0]
|
// SPIM_SD0_A[0]
|
||||||
setup_port(
|
iox.setup_pin(
|
||||||
iox,
|
|
||||||
SPI_PORT,
|
SPI_PORT,
|
||||||
SPI_DAT_PIN,
|
SPI_DAT_PIN,
|
||||||
Some(iox::IoxFunction::AF1),
|
|
||||||
Some(iox::IoxDir::Output),
|
Some(iox::IoxDir::Output),
|
||||||
Some(iox::IoxDriveStrength::Drive2mA),
|
Some(iox::IoxFunction::AF1),
|
||||||
|
None,
|
||||||
|
None,
|
||||||
Some(iox::IoxEnable::Enable),
|
Some(iox::IoxEnable::Enable),
|
||||||
None,
|
Some(iox::IoxDriveStrength::Drive2mA),
|
||||||
None,
|
|
||||||
);
|
);
|
||||||
// SPIM_CSN0_A[0]
|
// SPIM_CSN0_A[0]
|
||||||
// chip select toggle by UDMA has ~6 cycles setup and 1 cycles hold time, which
|
// chip select toggle by UDMA has ~6 cycles setup and 1 cycles hold time, which
|
||||||
// meets the requirements for the display.
|
// meets the requirements for the display.
|
||||||
setup_port(
|
iox.setup_pin(
|
||||||
iox,
|
|
||||||
SPI_PORT,
|
SPI_PORT,
|
||||||
SPI_CS_PIN,
|
SPI_CS_PIN,
|
||||||
Some(iox::IoxFunction::AF1),
|
|
||||||
Some(iox::IoxDir::Output),
|
Some(iox::IoxDir::Output),
|
||||||
Some(iox::IoxDriveStrength::Drive2mA),
|
Some(iox::IoxFunction::AF1),
|
||||||
Some(iox::IoxEnable::Enable),
|
|
||||||
None,
|
None,
|
||||||
Some(iox::IoxEnable::Enable),
|
Some(iox::IoxEnable::Enable),
|
||||||
|
Some(iox::IoxEnable::Enable),
|
||||||
|
Some(iox::IoxDriveStrength::Drive2mA),
|
||||||
);
|
);
|
||||||
// using bank SPIM_B[1]
|
// using bank SPIM_B[1]
|
||||||
udma_global.clock_on(PeriphId::Spim0);
|
udma_global.clock_on(PeriphId::Spim0);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue