32 #include <mraa/i2c.hpp>
38 const uint8_t DISPLAY_CMD_SET_NORMAL_1306 = 0xA6;
39 const uint8_t SSD1306_SETCONTRAST = 0x81;
40 const uint8_t SSD1306_DISPLAYALLON_RESUME =0xA4;
41 const uint8_t SSD1306_DISPLAYALLON = 0xA5;
42 const uint8_t DISPLAY_CMD_SET_INVERT_1306 = 0xA7;
44 const uint8_t SSD1306_SETDISPLAYOFFSET =0xD3;
45 const uint8_t SSD1306_SETCOMPINS = 0xDA;
47 const uint8_t SSD1306_SETVCOMDETECT = 0xDB;
49 const uint8_t SSD1306_SETDISPLAYCLOCKDIV = 0xD5;
50 const uint8_t SSD1306_SETPRECHARGE = 0xD9;
52 const uint8_t SSD1306_SETMULTIPLEX = 0xA8;
54 const uint8_t SSD1306_SETLOWCOLUM = 0x00;
55 const uint8_t SSD1306_SETHIGHCOLUMN = 0x10;
57 const uint8_t SSD1306_SETSTARTLINE = 0x40;
59 const uint8_t SSD1306_MEMORYMODE = 0x20;
60 const uint8_t SSD1306_COLUMNADDR = 0x21;
61 const uint8_t SSD1306_PAGEADDR = 0x22;
63 const uint8_t SSD1306_COMSCANINC = 0xC0;
64 const uint8_t SSD1306_COMSCANDEC = 0xC8;
66 const uint8_t SSD1306_SEGREMAP = 0xA0;
68 const uint8_t SSD1306_CHARGEPUMP = 0x8D;
70 const uint8_t SSD1306_EXTERNALVCC = 0x1;
71 const uint8_t SSD1306_SWITCHCAPVCC = 0x2;
74 const uint8_t SSD1306_ACTIVATE_SCROLL = 0x2F;
75 const uint8_t SSD1306_DEACTIVATE_SCROLL = 0x2E;
76 const uint8_t SSD1306_SET_VERTICAL_SCROLL_AREA = 0xA3;
77 const uint8_t SSD1306_RIGHT_HORIZONTAL_SCROLL = 0x26;
78 const uint8_t SSD1306_LEFT_HORIZONTAL_SCROLL = 0x27;
79 const uint8_t SSD1306_VERTICAL_AND_RIGHT_HORIZONTAL_SCROLL = 0x29;
80 const uint8_t SSD1306_VERTICAL_AND_LEFT_HORIZONTAL_SCROLL = 0x2A;
82 const uint8_t SSD1306_BLACK = 0;
83 const uint8_t SSD1306_WHITE = 1;
84 const uint8_t SSD1306_LCDWIDTH = 128;
85 const uint8_t SSD1306_LCDHEIGHT = 64;
117 SSD1306(
int bus,
int address = 0x3C);
130 mraa::Result
draw(uint8_t* data,
int bytes);
138 mraa::Result
write(std::string msg);
146 mraa::Result
setCursor(
int row,
int column);
152 mraa::Result
clear();
165 mraa::Result
invert(
bool i);
221 mraa::Result writeChar(uint8_t value);
222 mraa::Result setNormalDisplay();
223 mraa::Result setAddressingMode(displayAddressingMode mode);
225 int m_lcd_control_address;
226 mraa::I2c m_i2c_lcd_control;
void dim(bool dim)
Definition: ssd1306.cxx:297
mraa::Result write(std::string msg)
Definition: ssd1306.cxx:135
mraa::Result invert(bool i)
Definition: ssd1306.cxx:229
void startscrollright(uint8_t start, uint8_t stop)
Definition: ssd1306.cxx:241
void startscrolldiagright(uint8_t start, uint8_t stop)
Definition: ssd1306.cxx:264
mraa::Result clear()
Definition: ssd1306.cxx:164
SSD1306(int bus, int address=0x3C)
Definition: ssd1306.cxx:37
~SSD1306()
Definition: ssd1306.cxx:112
mraa::Result draw(uint8_t *data, int bytes)
Definition: ssd1306.cxx:117
void stopscroll(void)
Definition: ssd1306.cxx:290
mraa::Result setCursor(int row, int column)
Definition: ssd1306.cxx:148
mraa::Result home()
Definition: ssd1306.cxx:185
void startscrolldiagleft(uint8_t start, uint8_t stop)
Definition: ssd1306.cxx:277
API for SSD1306 I2C-controlled OLED displays.
Definition: ssd1306.h:108
void startscrollleft(uint8_t start, uint8_t stop)
Definition: ssd1306.cxx:253