Add CRP support in libtock-rs
This commit is contained in:
19
third_party/libtock-drivers/src/crp.rs
vendored
Normal file
19
third_party/libtock-drivers/src/crp.rs
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
use crate::result::TockResult;
|
||||||
|
use libtock_core::syscalls;
|
||||||
|
|
||||||
|
const DRIVER_NUMBER: usize = 0x00008;
|
||||||
|
|
||||||
|
mod command_nr {
|
||||||
|
pub const AVAILABLE: usize = 0;
|
||||||
|
pub const PROTECT: usize = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn is_available() -> TockResult<()> {
|
||||||
|
syscalls::command(DRIVER_NUMBER, command_nr::AVAILABLE, 0, 0)?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn protect() -> TockResult<()> {
|
||||||
|
syscalls::command(DRIVER_NUMBER, command_nr::PROTECT, 0, 0)?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
1
third_party/libtock-drivers/src/lib.rs
vendored
1
third_party/libtock-drivers/src/lib.rs
vendored
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
pub mod buttons;
|
pub mod buttons;
|
||||||
pub mod console;
|
pub mod console;
|
||||||
|
pub mod crp;
|
||||||
pub mod led;
|
pub mod led;
|
||||||
#[cfg(feature = "with_nfc")]
|
#[cfg(feature = "with_nfc")]
|
||||||
pub mod nfc;
|
pub mod nfc;
|
||||||
|
|||||||
Reference in New Issue
Block a user