1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//! common enums

/// basic command related enums
pub mod basic_command {
    #[derive(Clone, Copy, PartialEq, Default)]
    pub enum MoveDirection {
        RightToLeft,
        #[default]
        LeftToRight,
    }

    #[derive(Clone, Copy, Default)]
    pub enum ShiftType {
        #[default]
        CursorOnly,
        CursorAndDisplay,
    }

    #[derive(Clone, Copy, PartialEq, Default)]
    pub enum State {
        Off,
        #[default]
        On,
    }

    #[derive(Clone, Copy, Default)]
    pub enum DataWidth {
        #[default]
        Bit4,
        Bit8,
    }

    #[derive(Clone, Copy, Default, PartialEq)]
    pub enum LineMode {
        OneLine,
        #[default]
        TwoLine,
    }

    #[derive(Clone, Copy, Default, PartialEq)]
    pub enum Font {
        #[default]
        Font5x8,
        Font5x11,
    }

    /// The type of memory to access
    #[derive(Clone, Copy, PartialEq)]
    pub enum RAMType {
        /// Display Data RAM
        DDRAM,
        /// Character Generator RAM
        CGRAM,
    }
}

/// animation related enums
pub mod animation {
    /// The style of the offset display window
    pub enum MoveStyle {
        /// Always move to left
        ForceMoveLeft,
        /// Always move to right
        ForceMoveRight,
        /// Top left of display window won't cross display boundary
        NoCrossBoundary,
        /// Automatic find the shortest path
        Shortest,
    }

    /// The flip style of split flap display
    pub enum FlipStyle {
        /// Flip first character to target character, then flip next one
        Sequential,
        /// Flip all characters at once, automatically stop when the characters reach the target one
        Simultaneous,
    }
}