aboutsummaryrefslogtreecommitdiff
path: root/drivers/avr/ssd1306.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/avr/ssd1306.h')
-rw-r--r--drivers/avr/ssd1306.h84
1 files changed, 41 insertions, 43 deletions
diff --git a/drivers/avr/ssd1306.h b/drivers/avr/ssd1306.h
index df6a75359..825b0d7d5 100644
--- a/drivers/avr/ssd1306.h
+++ b/drivers/avr/ssd1306.h
@@ -7,49 +7,49 @@
7#include "config.h" 7#include "config.h"
8 8
9enum ssd1306_cmds { 9enum ssd1306_cmds {
10 DisplayOff = 0xAE, 10 DisplayOff = 0xAE,
11 DisplayOn = 0xAF, 11 DisplayOn = 0xAF,
12 12
13 SetContrast = 0x81, 13 SetContrast = 0x81,
14 DisplayAllOnResume = 0xA4, 14 DisplayAllOnResume = 0xA4,
15 15
16 DisplayAllOn = 0xA5, 16 DisplayAllOn = 0xA5,
17 NormalDisplay = 0xA6, 17 NormalDisplay = 0xA6,
18 InvertDisplay = 0xA7, 18 InvertDisplay = 0xA7,
19 SetDisplayOffset = 0xD3, 19 SetDisplayOffset = 0xD3,
20 SetComPins = 0xda, 20 SetComPins = 0xda,
21 SetVComDetect = 0xdb, 21 SetVComDetect = 0xdb,
22 SetDisplayClockDiv = 0xD5, 22 SetDisplayClockDiv = 0xD5,
23 SetPreCharge = 0xd9, 23 SetPreCharge = 0xd9,
24 SetMultiPlex = 0xa8, 24 SetMultiPlex = 0xa8,
25 SetLowColumn = 0x00, 25 SetLowColumn = 0x00,
26 SetHighColumn = 0x10, 26 SetHighColumn = 0x10,
27 SetStartLine = 0x40, 27 SetStartLine = 0x40,
28 28
29 SetMemoryMode = 0x20, 29 SetMemoryMode = 0x20,
30 ColumnAddr = 0x21, 30 ColumnAddr = 0x21,
31 PageAddr = 0x22, 31 PageAddr = 0x22,
32 32
33 ComScanInc = 0xc0, 33 ComScanInc = 0xc0,
34 ComScanDec = 0xc8, 34 ComScanDec = 0xc8,
35 SegRemap = 0xa0, 35 SegRemap = 0xa0,
36 SetChargePump = 0x8d, 36 SetChargePump = 0x8d,
37 ExternalVcc = 0x01, 37 ExternalVcc = 0x01,
38 SwitchCapVcc = 0x02, 38 SwitchCapVcc = 0x02,
39 39
40 ActivateScroll = 0x2f, 40 ActivateScroll = 0x2f,
41 DeActivateScroll = 0x2e, 41 DeActivateScroll = 0x2e,
42 SetVerticalScrollArea = 0xa3, 42 SetVerticalScrollArea = 0xa3,
43 RightHorizontalScroll = 0x26, 43 RightHorizontalScroll = 0x26,
44 LeftHorizontalScroll = 0x27, 44 LeftHorizontalScroll = 0x27,
45 VerticalAndRightHorizontalScroll = 0x29, 45 VerticalAndRightHorizontalScroll = 0x29,
46 VerticalAndLeftHorizontalScroll = 0x2a, 46 VerticalAndLeftHorizontalScroll = 0x2a,
47}; 47};
48 48
49// Controls the SSD1306 128x32 OLED display via i2c 49// Controls the SSD1306 128x32 OLED display via i2c
50 50
51#ifndef SSD1306_ADDRESS 51#ifndef SSD1306_ADDRESS
52#define SSD1306_ADDRESS 0x3C 52# define SSD1306_ADDRESS 0x3C
53#endif 53#endif
54 54
55#define DisplayHeight 32 55#define DisplayHeight 32
@@ -62,9 +62,9 @@ enum ssd1306_cmds {
62#define MatrixCols (DisplayWidth / FontWidth) 62#define MatrixCols (DisplayWidth / FontWidth)
63 63
64struct CharacterMatrix { 64struct CharacterMatrix {
65 uint8_t display[MatrixRows][MatrixCols]; 65 uint8_t display[MatrixRows][MatrixCols];
66 uint8_t *cursor; 66 uint8_t *cursor;
67 bool dirty; 67 bool dirty;
68}; 68};
69 69
70struct CharacterMatrix display; 70struct CharacterMatrix display;
@@ -88,6 +88,4 @@ void matrix_write(struct CharacterMatrix *matrix, const char *data);
88void matrix_write_P(struct CharacterMatrix *matrix, const char *data); 88void matrix_write_P(struct CharacterMatrix *matrix, const char *data);
89void matrix_render(struct CharacterMatrix *matrix); 89void matrix_render(struct CharacterMatrix *matrix);
90 90
91
92
93#endif 91#endif