mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
update apis to accommodate power savings mode
This commit is contained in:
parent
0a47620da2
commit
8269f9f759
3 changed files with 63 additions and 32 deletions
|
|
@ -320,27 +320,38 @@ pub fn usb_ep1_bulk_out_complete(
|
||||||
let mut sh1107 = unsafe {
|
let mut sh1107 = unsafe {
|
||||||
Oled128x128::from_raw_parts(
|
Oled128x128::from_raw_parts(
|
||||||
(
|
(
|
||||||
match channel {
|
(
|
||||||
SpimChannel::Channel0 => utra::udma_spim_0::HW_UDMA_SPIM_0_BASE,
|
match channel {
|
||||||
SpimChannel::Channel1 => utra::udma_spim_1::HW_UDMA_SPIM_1_BASE,
|
SpimChannel::Channel0 => {
|
||||||
SpimChannel::Channel2 => utra::udma_spim_2::HW_UDMA_SPIM_2_BASE,
|
utra::udma_spim_0::HW_UDMA_SPIM_0_BASE
|
||||||
SpimChannel::Channel3 => utra::udma_spim_3::HW_UDMA_SPIM_3_BASE,
|
}
|
||||||
},
|
SpimChannel::Channel1 => {
|
||||||
SpimCs::Cs0,
|
utra::udma_spim_1::HW_UDMA_SPIM_1_BASE
|
||||||
0,
|
}
|
||||||
0,
|
SpimChannel::Channel2 => {
|
||||||
None,
|
utra::udma_spim_2::HW_UDMA_SPIM_2_BASE
|
||||||
SpimMode::Standard,
|
}
|
||||||
SpimByteAlign::Disable,
|
SpimChannel::Channel3 => {
|
||||||
bao1x_hal::ifram::IframRange::from_raw_parts(
|
utra::udma_spim_3::HW_UDMA_SPIM_3_BASE
|
||||||
bao1x_hal::board::DISPLAY_IFRAM_ADDR,
|
}
|
||||||
bao1x_hal::board::DISPLAY_IFRAM_ADDR,
|
},
|
||||||
4096 * 2,
|
SpimCs::Cs0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
None,
|
||||||
|
SpimMode::Standard,
|
||||||
|
SpimByteAlign::Disable,
|
||||||
|
bao1x_hal::ifram::IframRange::from_raw_parts(
|
||||||
|
bao1x_hal::board::DISPLAY_IFRAM_ADDR,
|
||||||
|
bao1x_hal::board::DISPLAY_IFRAM_ADDR,
|
||||||
|
4096 * 2,
|
||||||
|
),
|
||||||
|
2048 + 256,
|
||||||
|
2048,
|
||||||
|
0,
|
||||||
|
None,
|
||||||
),
|
),
|
||||||
2048 + 256,
|
false,
|
||||||
2048,
|
|
||||||
0,
|
|
||||||
None,
|
|
||||||
),
|
),
|
||||||
&iox,
|
&iox,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -752,6 +752,23 @@ impl Gfx {
|
||||||
Ok(response)
|
Ok(response)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "board-baosec")]
|
||||||
|
pub fn set_power(&self, turn_on: bool) -> Result<(), xous::Error> {
|
||||||
|
if turn_on {
|
||||||
|
send_message(
|
||||||
|
self.conn,
|
||||||
|
Message::new_blocking_scalar(GfxOpcode::PowerUp.to_usize().unwrap(), 0, 0, 0, 0),
|
||||||
|
)
|
||||||
|
.map(|_| ())
|
||||||
|
} else {
|
||||||
|
send_message(
|
||||||
|
self.conn,
|
||||||
|
Message::new_blocking_scalar(GfxOpcode::PowerDown.to_usize().unwrap(), 0, 0, 0, 0),
|
||||||
|
)
|
||||||
|
.map(|_| ())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(feature = "hosted-baosec")]
|
#[cfg(feature = "hosted-baosec")]
|
||||||
pub fn acquire_qr(&self) -> Result<QrAcquisition, xous::Error> {
|
pub fn acquire_qr(&self) -> Result<QrAcquisition, xous::Error> {
|
||||||
let dummy = "otpauth://totp/ACME%20Co:john.doe@email.com?secret=HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ&issuer=ACME%20Co&algorithm=SHA1&digits=6&period=30".to_string();
|
let dummy = "otpauth://totp/ACME%20Co:john.doe@email.com?secret=HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ&issuer=ACME%20Co&algorithm=SHA1&digits=6&period=30".to_string();
|
||||||
|
|
|
||||||
|
|
@ -42,18 +42,21 @@ const TEXT_MARGIN: isize = 0;
|
||||||
pub(crate) fn panic_handler_thread(
|
pub(crate) fn panic_handler_thread(
|
||||||
is_panic: Arc<AtomicBool>,
|
is_panic: Arc<AtomicBool>,
|
||||||
display_parts: (
|
display_parts: (
|
||||||
usize,
|
(
|
||||||
udma::SpimCs,
|
usize,
|
||||||
u8,
|
udma::SpimCs,
|
||||||
u8,
|
u8,
|
||||||
Option<EventChannel>,
|
u8,
|
||||||
udma::SpimMode,
|
Option<EventChannel>,
|
||||||
udma::SpimByteAlign,
|
udma::SpimMode,
|
||||||
IframRange,
|
udma::SpimByteAlign,
|
||||||
usize,
|
IframRange,
|
||||||
usize,
|
usize,
|
||||||
u8,
|
usize,
|
||||||
Option<CommandSet>,
|
u8,
|
||||||
|
Option<CommandSet>,
|
||||||
|
),
|
||||||
|
bool,
|
||||||
),
|
),
|
||||||
) {
|
) {
|
||||||
thread::spawn({
|
thread::spawn({
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue