hd44780_controller/controller/
config.rs1use crate::command::{
2 entry_mode_set::{CursorMoveDirection, Shift},
3 function_set::{CharacterFont, DataLength, NumberOfLines},
4};
5
6#[derive(Copy, Clone, Debug)]
7pub struct InitialConfig {
8 pub data_length: DataLength,
9 pub lines: NumberOfLines,
10 pub font: CharacterFont,
11}
12
13impl Default for InitialConfig {
14 fn default() -> Self {
15 Self {
16 data_length: DataLength::FourBit,
17 lines: NumberOfLines::Two,
18 font: CharacterFont::FiveByEight,
19 }
20 }
21}
22
23#[derive(Copy, Clone, Debug)]
24pub struct RuntimeConfig {
25 pub display: bool,
26 pub cursor: bool,
27 pub blink: bool,
28 pub backlight: bool,
29 pub cursor_direction: CursorMoveDirection,
30 pub shift: Shift,
31}
32
33impl Default for RuntimeConfig {
34 fn default() -> Self {
35 Self {
36 display: true,
37 cursor: false,
38 blink: false,
39 backlight: true,
40 cursor_direction: CursorMoveDirection::Increment,
41 shift: Shift::CursorOnly,
42 }
43 }
44}