firmware for my Touchscreen E-Paper Input Module for Framework Laptop 16
0

Configure Feed

Select the types of activity you want to include in your feed.

1use crate::syscall; 2use crate::syscall::SyscallNumber; 3 4#[repr(usize)] 5#[derive(Copy, Clone, Debug, Eq, PartialEq)] 6#[cfg_attr(feature = "defmt", derive(defmt::Format))] 7pub enum MiscSyscall { 8 GetSerial = 0, 9} 10 11impl TryFrom<usize> for MiscSyscall { 12 type Error = (); 13 14 fn try_from(value: usize) -> Result<Self, Self::Error> { 15 match value { 16 x if x == MiscSyscall::GetSerial as usize => Ok(MiscSyscall::GetSerial), 17 _ => Err(()), 18 } 19 } 20} 21 22pub fn get_serial() -> &'static str { 23 let mut ptr: *const [u8; 16]; 24 unsafe { 25 syscall!( 26 SyscallNumber::Misc, 27 out ptr in MiscSyscall::GetSerial, 28 ); 29 core::str::from_utf8_unchecked(&*ptr) 30 } 31}