Fixed typos
This commit is contained in:
@@ -65,8 +65,8 @@ fn main() -> ! {
|
|||||||
let mut led_pin = pins.gpio25.into_push_pull_output();
|
let mut led_pin = pins.gpio25.into_push_pull_output();
|
||||||
led_pin.set_high().unwrap();
|
led_pin.set_high().unwrap();
|
||||||
|
|
||||||
let ssh1106_dev = sh1106_pico_rs::ssh1106::SSH1106Dev::new(&mut delay, &mut i2c);
|
let sh1106_dev = sh1106_pico_rs::ssh1106::SH1106Dev::new(&mut delay, &mut i2c);
|
||||||
println!("SSH1106 initialized.");
|
println!("SH1106 initialized.");
|
||||||
|
|
||||||
let mut gfx_buf = sh1106_pico_rs::graphics::GraphicsBuf::new();
|
let mut gfx_buf = sh1106_pico_rs::graphics::GraphicsBuf::new();
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ fn main() -> ! {
|
|||||||
gfx_buf.clear();
|
gfx_buf.clear();
|
||||||
gfx_buf.redraw();
|
gfx_buf.redraw();
|
||||||
|
|
||||||
ssh1106_dev.blit_framebuffer(&mut i2c, &gfx_buf);
|
sh1106_dev.blit_framebuffer(&mut i2c, &gfx_buf);
|
||||||
|
|
||||||
delay.delay_ms(10);
|
delay.delay_ms(10);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,11 +21,11 @@ pub enum SH1106Cmd {
|
|||||||
|
|
||||||
pub const SH1106_I2C_ADDR: u8 = 0x78u8 >> 1;
|
pub const SH1106_I2C_ADDR: u8 = 0x78u8 >> 1;
|
||||||
|
|
||||||
pub struct SSH1106Dev {
|
pub struct SH1106Dev {
|
||||||
ready: bool,
|
ready: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SSH1106Dev {
|
impl SH1106Dev {
|
||||||
pub fn new(delay: &mut Delay, mut i2c: &mut dyn I2c<Error = Error>) -> Self {
|
pub fn new(delay: &mut Delay, mut i2c: &mut dyn I2c<Error = Error>) -> Self {
|
||||||
send_command(&mut i2c, &SH1106Cmd::DisplayOnOff, 0x00);
|
send_command(&mut i2c, &SH1106Cmd::DisplayOnOff, 0x00);
|
||||||
delay.delay_ms(100);
|
delay.delay_ms(100);
|
||||||
@@ -38,7 +38,7 @@ impl SSH1106Dev {
|
|||||||
delay.delay_ms(500);
|
delay.delay_ms(500);
|
||||||
send_command(&mut i2c, &SH1106Cmd::DisplayOnOff, 0x01);
|
send_command(&mut i2c, &SH1106Cmd::DisplayOnOff, 0x01);
|
||||||
|
|
||||||
SSH1106Dev { ready: true }
|
SH1106Dev { ready: true }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn blit_framebuffer(&self, i2c: &mut dyn I2c<Error = Error>, gfx_buf: &GraphicsBuf) {
|
pub fn blit_framebuffer(&self, i2c: &mut dyn I2c<Error = Error>, gfx_buf: &GraphicsBuf) {
|
||||||
|
|||||||
Reference in New Issue
Block a user