5 #include "pincontrol.h"
12 DisplayAllOnResume = 0xA4,
17 SetDisplayOffset = 0xD3,
20 SetDisplayClockDiv = 0xD5,
38 ActivateScroll = 0x2f,
39 DeActivateScroll = 0x2e,
40 SetVerticalScrollArea = 0xa3,
41 RightHorizontalScroll = 0x26,
42 LeftHorizontalScroll = 0x27,
43 VerticalAndRightHorizontalScroll = 0x29,
44 VerticalAndLeftHorizontalScroll = 0x2a,
47 // Controls the SSD1306 128x32 OLED display via i2c
49 #ifndef SSD1306_ADDRESS
50 #define SSD1306_ADDRESS 0x3C
53 #define DisplayHeight 32
54 #define DisplayWidth 128
59 #define MatrixRows (DisplayHeight / FontHeight)
60 #define MatrixCols (DisplayWidth / FontWidth)
62 struct CharacterMatrix {
63 uint8_t display[MatrixRows][MatrixCols];
68 struct CharacterMatrix display;
70 bool iota_gfx_init(bool rotate);
71 void iota_gfx_task(void);
72 bool iota_gfx_off(void);
73 bool iota_gfx_on(void);
74 void iota_gfx_flush(void);
75 void iota_gfx_write_char(uint8_t c);
76 void iota_gfx_write(const char *data);
77 void iota_gfx_write_P(const char *data);
78 void iota_gfx_clear_screen(void);
80 void iota_gfx_task_user(void);
82 void matrix_clear(struct CharacterMatrix *matrix);
83 void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c);
84 void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c);
85 void matrix_write(struct CharacterMatrix *matrix, const char *data);
86 void matrix_write_ln(struct CharacterMatrix *matrix, const char *data);
87 void matrix_write_P(struct CharacterMatrix *matrix, const char *data);
88 void matrix_render(struct CharacterMatrix *matrix);