mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-25 16:08:32 +00:00
fixup! feat(core/rust): expose touch processing functions to rust
This commit is contained in:
parent
440442ba8c
commit
1aab8a7c29
@ -310,7 +310,16 @@ fn generate_trezorhal_bindings() {
|
|||||||
.allowlist_function("buffers_get_line_buffer_4bpp")
|
.allowlist_function("buffers_get_line_buffer_4bpp")
|
||||||
.allowlist_function("buffers_get_text_buffer")
|
.allowlist_function("buffers_get_text_buffer")
|
||||||
.allowlist_var("text_buffer_height")
|
.allowlist_var("text_buffer_height")
|
||||||
.allowlist_var("buffer_width");
|
.allowlist_var("buffer_width")
|
||||||
|
// touch
|
||||||
|
.allowlist_function("touch_read")
|
||||||
|
// button
|
||||||
|
.allowlist_function("button_read")
|
||||||
|
.allowlist_var("BTN_EVT_DOWN")
|
||||||
|
.allowlist_var("BTN_EVT_UP")
|
||||||
|
.allowlist_var("BTN_RIGHT")
|
||||||
|
.allowlist_var("BTN_LEFT");
|
||||||
|
|
||||||
// Write the bindings to a file in the OUR_DIR.
|
// Write the bindings to a file in the OUR_DIR.
|
||||||
bindings
|
bindings
|
||||||
.generate()
|
.generate()
|
||||||
|
14
core/embed/rust/src/trezorhal/io.rs
Normal file
14
core/embed/rust/src/trezorhal/io.rs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
use super::ffi;
|
||||||
|
|
||||||
|
#[cfg(feature = "buttons")]
|
||||||
|
pub use super::ffi::{BTN_EVT_DOWN, BTN_EVT_UP, BTN_LEFT, BTN_RIGHT};
|
||||||
|
|
||||||
|
#[cfg(feature = "touch")]
|
||||||
|
pub fn io_touch_read() -> u32 {
|
||||||
|
unsafe { ffi::touch_read() }
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "buttons")]
|
||||||
|
pub fn io_button_read() -> u32 {
|
||||||
|
unsafe { ffi::button_read() }
|
||||||
|
}
|
@ -1,4 +1,5 @@
|
|||||||
#include "buffers.h"
|
#include "buffers.h"
|
||||||
|
#include "button.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
#include "display_interface.h"
|
#include "display_interface.h"
|
||||||
@ -8,6 +9,7 @@
|
|||||||
#include "rgb_led.h"
|
#include "rgb_led.h"
|
||||||
#include "secbool.h"
|
#include "secbool.h"
|
||||||
#include "storage.h"
|
#include "storage.h"
|
||||||
|
#include "touch.h"
|
||||||
|
|
||||||
#include "bip39.h"
|
#include "bip39.h"
|
||||||
#include "rand.h"
|
#include "rand.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user