attempt chatgpt emulator for display
This commit is contained in:
@@ -13,7 +13,8 @@ pub enum MatrixEntryMode {
|
||||
pub struct DisplayMatrix {
|
||||
width: f32,
|
||||
height: f32,
|
||||
text_buffer: String,
|
||||
text_buffer: [u8; 80],
|
||||
cgram: [u8; 64],
|
||||
data_bus: DataBus,
|
||||
rs: bool,
|
||||
rw: bool,
|
||||
@@ -21,7 +22,7 @@ pub struct DisplayMatrix {
|
||||
busy: bool,
|
||||
entry_mode: MatrixEntryMode,
|
||||
cursor: bool,
|
||||
on: bool,
|
||||
display_on: bool,
|
||||
blink: bool,
|
||||
cursor_shift: bool,
|
||||
display_shift: bool,
|
||||
@@ -69,7 +70,7 @@ impl DisplayMatrix {
|
||||
cursor_position: 0x00,
|
||||
busy: false,
|
||||
entry_mode: MatrixEntryMode::InsertShift,
|
||||
on: false,
|
||||
display_on: false,
|
||||
cursor: false,
|
||||
blink: false,
|
||||
cursor_shift: false,
|
||||
@@ -122,7 +123,7 @@ impl DisplayMatrix {
|
||||
}
|
||||
0b0000_1000..=0b0000_1111 => {
|
||||
// display control
|
||||
self.on = self.data_bus.data & 0b100 == 0b100;
|
||||
self.display_on = self.data_bus.data & 0b100 == 0b100;
|
||||
self.cursor = self.data_bus.data & 0b10 == 0b10;
|
||||
self.blink = self.data_bus.data & 0b1 == 0b1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user