pico_engine_hardware/
lib.rs

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