pico_engine_hardware/
lib.rs1#![no_std]
2
3pub mod input;
4pub use input::InputState;
5
6pub trait Hardware {
7 type Display: Display;
8 type Timer: Timer;
9 type Input: Input;
10
11 fn display(&mut self) -> &mut Self::Display;
12 fn timer(&mut self) -> &mut Self::Timer;
13 fn input(&mut self) -> &mut Self::Input;
14}
15
16pub trait Display {
17 fn get_screen_width(&self) -> usize;
18 fn get_screen_height(&self) -> usize;
19 fn frame_buffer(&mut self) -> &mut [u16];
20 fn display_buffer(&mut self);
21}
22
23pub trait Timer {
24 fn get_counter(&self) -> u64;
25 fn delay_ms(&mut self, ms: u32);
26}
27
28pub trait Input {
29 fn update(&mut self);
30 fn current_state(&self) -> input::InputState;
31}
32pub use input::DPadState;