i2c_slave_address: u8,
}
+pub enum Icon {
+ SatelliteBody,
+ SatelliteWave1,
+ SatelliteWave2,
+ Heart,
+ Alarm,
+}
+
fn delay(u: u32) {
let mut r = u;
}
}
+const ICON_COLUMN: usize = 8;
+
impl Display {
pub fn new(reset_gpio: u32, reset_gpio_pin: u32, i2c_slave_address: u8) -> Display {
Display {
}
}
+ fn icon_row(&self, icon: Icon) -> usize {
+ match icon {
+ Icon::SatelliteBody => 31,
+ Icon::SatelliteWave1 => 29,
+ Icon::SatelliteWave2 => 27,
+ Icon::Heart => 45,
+ Icon::Alarm => 61,
+ }
+ }
+
+ pub fn show_icon(&mut self, icon: Icon) {
+ let row = self.icon_row(icon);
+
+ self.seek(row, ICON_COLUMN);
+ self.write_data(0x80);
+ }
+
+ pub fn hide_icon(&mut self, icon: Icon) {
+ let row = self.icon_row(icon);
+
+ self.seek(row, ICON_COLUMN);
+ self.write_data(0x00);
+ }
+
pub fn clear(&mut self) {
self.seek(0, 0);