st7565/driver/
mode_raw.rs1use display_interface::{DataFormat::U8, DisplayError, WriteOnlyDataCommand};
2
3use crate::command::{Command, SendSt7565Command};
4use crate::ST7565;
5
6pub struct RawMode;
9
10impl<DI, SPECS, const WIDTH: usize, const HEIGHT: usize, const PAGES: usize>
15    ST7565<DI, SPECS, RawMode, WIDTH, HEIGHT, PAGES>
16where
17    DI: WriteOnlyDataCommand,
18{
19    pub fn set_page(&mut self, page: u8) -> Result<(), DisplayError> {
21        self.interface
22            .send_command(Command::PageAddressSet { address: page })
23    }
24
25    pub fn set_column(&mut self, address: u8) -> Result<(), DisplayError> {
27        self.interface
28            .send_command(Command::ColumnAddressSet { address })
29    }
30
31    pub fn write_pixel_data(&mut self, data: &[u8]) -> Result<(), DisplayError> {
36        self.interface.send_data(U8(data))
37    }
38
39    pub fn adc_select(&mut self, reverse: bool) -> Result<(), DisplayError> {
43        self.interface.send_command(Command::AdcSelect { reverse })
44    }
45
46    pub fn common_output_mode_select(&mut self, reverse: bool) -> Result<(), DisplayError> {
50        self.interface
51            .send_command(Command::CommonOutputModeSelect { reverse })
52    }
53}