Go to the source code of this file.
Macros | |
| #define | SSD1306_I2C_ADDR 0x78 |
| #define | SSD1306_WIDTH 128 |
| #define | SSD1306_HEIGHT 64 |
| #define | SSD1306_TIMEOUT 20000 |
| #define | SSD1306_COLOR_BLACK 0x00 |
| #define | SSD1306_COLOR_WHITE 0x01 |
Functions | |
| void | SSD1306_WriteCommand (uint8_t command) |
| Writes single byte command to slave. | |
| void | SSD1306_WriteData (uint8_t dat) |
| Writes single byte data to slave. | |
| void | SSD1306_Init (void) |
| void | SSD1306_UpdateScreen (void) |
| Updates buffer from internal RAM to LCD. | |
| void | SSD1306_ToggleInvert (void) |
| Toggles pixels invertion inside internal RAM. | |
| void | SSD1306_Fill (uint8_t Color) |
| Fills entire LCD with desired color. | |
| void | SSD1306_DrawPixel (uint16_t x, uint16_t y, uint8_t color) |
| Draws pixel at desired location. | |
| void | SSD1306_GotoXY (uint16_t x, uint16_t y) |
| Sets cursor pointer to desired location for strings. | |
| void | SSD1306_DrawLine (uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint8_t c) |
| Draws line on LCD. | |
| #define SSD1306_COLOR_BLACK 0x00 |
Draws line on LCD.
| x0 | Line X start point. Valid input is 0 to SSD1306_WIDTH - 1 |
| y0 | Line Y start point. Valid input is 0 to SSD1306_HEIGHT - 1 |
| x1 | Line X end point. Valid input is 0 to SSD1306_WIDTH - 1 |
| y1 | Line Y end point. Valid input is 0 to SSD1306_HEIGHT - 1 |
| c | Color to be used. This parameter can be a value of SSD1306_COLOR_t enumeration |
| None |
Definition at line 223 of file ssd1306.c.
Draws pixel at desired location.
| x | X location. This parameter can be a value between 0 and SSD1306_WIDTH - 1 |
| y | Y location. This parameter can be a value between 0 and SSD1306_HEIGHT - 1 |
| color | Color to be used for screen fill. This parameter can be a value of SSD1306_COLOR_t enumeration |
| None |
Definition at line 191 of file ssd1306.c.
| void SSD1306_Fill | ( | uint8_t | Color | ) |
Fills entire LCD with desired color.
| Color | Color to be used for screen fill. This parameter can be a value of SSD1306_COLOR_t enumeration |
Definition at line 181 of file ssd1306.c.
Sets cursor pointer to desired location for strings.
| x | X location. This parameter can be a value between 0 and SSD1306_WIDTH - 1 |
| y | Y location. This parameter can be a value between 0 and SSD1306_HEIGHT - 1 |
| None |
Definition at line 216 of file ssd1306.c.
| void SSD1306_Init | ( | void | ) |
Initializes SSD1306 LCD
Set the lower start column address of pointer by command 00h~0Fh. Set the upper start column address of pointer by command 10h~1Fh.
set contrast control register, 2 bytes, 0x00 - 0xFF
0xA4,Output follows RAM content 0xA5,Output ignores RAM content
0xA6, Normal display (RESET) 0xA7, Inverse display
Set the page start address of the target display location by command B0h to B7h For Page Addressing Mode only
Set Page Address, 3 bytes For Horizontal and Vertical Addressing Mode only
COM Output Scan Direction 0xC0: normal mode (RESET) Scan from COM0 to COM[N –1] 0xC8: remapped mode. Scan from COM[N-1] to COM0
Set display RAM display start line register from 0-63
Segment Re-map 0xA0: column address 0 is mapped to SEG0 (RESET), 0xA1: column address 127 is mapped to SEG0
Set MUX ratio to N+1 MUX N=A[5:0]: from 16MUX to 64MUX, RESET=111111b (i.e. 63d, 64MUX) A[5:0] from 0 to 14 are invalid entry.
Set Display Offset, Set vertical shift by COM from 0d~63d The value is reset to 00h after RESET
Set COM Pins Hardware Configuration A[4]=0b, Sequential COM pin configuration A[4]=1b(RESET), Alternative COM pin configuration A[5]=0b(RESET), Disable COM Left/Right remap A[5]=1b, Enable COM Left/Right remap
Set Display Divide Ratio/Oscillator Frequency
Set Pre-charge Period
Set V COMH Deselect Level 0x00: 0.65 * Vcc 0x10: 0.77 * Vcc (RESET) 0x11: 0.83 * Vcc
charge pump setting 0x10: Disable charge pump(RESET) 0x14: Enable charge pump during display on
0xAE, Display OFF (sleep mode), 0xAF, Display ON in normal mode
Definition at line 44 of file ssd1306.c.
| void SSD1306_ToggleInvert | ( | void | ) |
Toggles pixels invertion inside internal RAM.
Definition at line 167 of file ssd1306.c.
| void SSD1306_UpdateScreen | ( | void | ) |
Updates buffer from internal RAM to LCD.
Definition at line 162 of file ssd1306.c.
| void SSD1306_WriteCommand | ( | uint8_t | command | ) |
Writes single byte command to slave.
| command | command to be written |