43#define CHIP_NAME "Solomon Systech SSD1309"
44#define MANUFACTURER_NAME "Solomon Systech"
45#define SUPPLY_VOLTAGE_MIN 1.65f
46#define SUPPLY_VOLTAGE_MAX 3.3f
47#define MAX_CURRENT 0.58f
48#define TEMPERATURE_MIN -40.0f
49#define TEMPERATURE_MAX 85.0f
50#define DRIVER_VERSION 1000
61#define SSD1309_CMD_LOWER_COLUMN_START_ADDRESS 0x00
62#define SSD1309_CMD_HIGHER_COLUMN_START_ADDRESS 0x10
63#define SSD1309_CMD_MEMORY_ADDRESSING_MODE 0x20
64#define SSD1309_CMD_SET_COLUMN_ADDRESS 0x21
65#define SSD1309_CMD_SET_PAGE_ADDRESS 0x22
66#define SSD1309_CMD_RIGHT_HORIZONTAL_SCROLL 0x26
67#define SSD1309_CMD_LEFT_HORIZONTAL_SCROLL 0x27
68#define SSD1309_CMD_VERTICAL_RIGHT_HORIZONTAL_SCROLL 0x29
69#define SSD1309_CMD_VERTICAL_LEFT_HORIZONTAL_SCROLL 0x2A
70#define SSD1309_CMD_RIGHT_HORIZONTAL_SCROLL_ONE_COL 0x2C
71#define SSD1309_CMD_LEFT_HORIZONTAL_SCROLL_ONE_COL 0x2D
72#define SSD1309_CMD_DEACTIVATE_SCROLL 0x2E
73#define SSD1309_CMD_ACTIVATE_SCROLL 0x2F
74#define SSD1309_CMD_DISPLAY_START_LINE 0x40
75#define SSD1309_CMD_CONTRAST_CONTROL 0x81
76#define SSD1309_CMD_COLUMN_0_MAPPED_TO_SEG0 0xA0
77#define SSD1309_CMD_COLUMN_127_MAPPED_TO_SEG0 0xA1
78#define SSD1309_CMD_VERTICAL_SCROLL_AREA 0xA3
79#define SSD1309_CMD_ENTIRE_DISPLAY_OFF 0xA4
80#define SSD1309_CMD_ENTIRE_DISPLAY_ON 0xA5
81#define SSD1309_CMD_NORMAL_DISPLAY 0xA6
82#define SSD1309_CMD_INVERSE_DISPLAY 0xA7
83#define SSD1309_CMD_MULTIPLEX_RATIO 0xA8
84#define SSD1309_CMD_DISPLAY_OFF 0xAE
85#define SSD1309_CMD_DISPLAY_ON 0xAF
86#define SSD1309_CMD_PAGE_ADDR 0xB0
87#define SSD1309_CMD_SCAN_DIRECTION_COM0_START 0xC0
88#define SSD1309_CMD_SCAN_DIRECTION_COMN_1_START 0xC8
89#define SSD1309_CMD_DISPLAY_OFFSET 0xD3
90#define SSD1309_CMD_DISPLAY_CLOCK_DIVIDE 0xD5
91#define SSD1309_CMD_PRE_CHARGE_PERIOD 0xD9
92#define SSD1309_CMD_COM_PINS_CONF 0xDA
93#define SSD1309_CMD_COMH_DESLECT_LEVEL 0xDB
94#define SSD1309_CMD_GPIO 0xDC
95#define SSD1309_CMD_LOCK 0xFD
107static uint8_t a_ssd1309_write_byte(
ssd1309_handle_t *handle, uint8_t data, uint8_t cmd)
170static uint8_t a_ssd1309_multiple_write_byte(
ssd1309_handle_t *handle, uint8_t *data, uint8_t len, uint8_t cmd)
233static uint8_t a_ssd1309_gram_draw_point(
ssd1309_handle_t *handle, uint8_t x, uint8_t y, uint8_t data)
244 handle->
gram[x][pos] |= temp;
248 handle->
gram[x][pos] &= ~temp;
267static uint8_t a_ssd1309_gram_show_char(
ssd1309_handle_t *handle, uint8_t x, uint8_t y, uint8_t chr, uint8_t size, uint8_t mode)
271 uint8_t csize = (size / 8 + ((size % 8) ? 1 : 0)) * (size / 2);
274 for (t = 0; t < csize; t++)
278 temp = gsc_ssd1309_ascii_1206[chr][t];
282 temp = gsc_ssd1309_ascii_1608[chr][t];
286 temp = gsc_ssd1309_ascii_2412[chr][t];
292 for (t1 = 0; t1 < 8; t1++)
294 if ((temp & 0x80) != 0)
296 if (a_ssd1309_gram_draw_point(handle, x, y, mode) != 0)
303 if (a_ssd1309_gram_draw_point(handle, x, y, !mode) != 0)
310 if ((y - y0) == size)
347 for (i = 0; i < 8; i++)
351 handle->
debug_print(
"ssd1309: write byte failed.\n");
357 handle->
debug_print(
"ssd1309: write byte failed.\n");
363 handle->
debug_print(
"ssd1309: write byte failed.\n");
367 for (n = 0; n < 128; n++)
369 handle->
gram[n][i] = 0x00;
372 handle->
debug_print(
"ssd1309: write byte failed.\n");
406 for (i = 0; i < 8; i++)
410 handle->
debug_print(
"ssd1309: write byte failed.\n");
416 handle->
debug_print(
"ssd1309: write byte failed.\n");
422 handle->
debug_print(
"ssd1309: write byte failed.\n");
426 for (n = 0; n < 128; n++)
430 handle->
debug_print(
"ssd1309: write byte failed.\n");
468 if ((x > 127) || (y > 63))
470 handle->
debug_print(
"ssd1309: x or y is invalid.\n");
480 handle->
gram[x][pos] |= temp;
484 handle->
gram[x][pos] &= ~temp;
488 handle->
debug_print(
"ssd1309: write byte failed.\n");
494 handle->
debug_print(
"ssd1309: write byte failed.\n");
500 handle->
debug_print(
"ssd1309: write byte failed.\n");
506 handle->
debug_print(
"ssd1309: write byte failed.\n");
544 if ((x > 127) || (y > 63))
546 handle->
debug_print(
"ssd1309: x or y is invalid.\n");
554 if ((handle->
gram[x][pos] & temp) != 0)
594 if ((x > 127) || (y > 63))
596 handle->
debug_print(
"ssd1309: x or y is invalid.\n");
606 handle->
gram[x][pos] |= temp;
610 handle->
gram[x][pos] &= ~temp;
644 if ((x > 127) || (y > 63))
646 handle->
debug_print(
"ssd1309: x or y is invalid.\n");
654 if ((handle->
gram[x][pos] & temp) != 0)
693 if((x > 127) || (y > 63))
695 handle->
debug_print(
"ssd1309: x or y is invalid.\n");
700 while ((len != 0) && (*str <=
'~') && (*str >=
' '))
702 if (x > (127 - (font / 2)))
711 if (a_ssd1309_gram_show_char(handle, x, y, *str, font, color) != 0)
715 x += (uint8_t)(font / 2);
753 if ((left > 127) || (top > 63))
755 handle->
debug_print(
"ssd1309: left or top is invalid.\n");
759 if ((right > 127) || (bottom > 63))
761 handle->
debug_print(
"ssd1309: right or bottom is invalid.\n");
765 if ((left > right) || (top > bottom))
767 handle->
debug_print(
"ssd1309: left > right or top > bottom.\n");
772 for (x = left; x <= right; x++)
774 for (y = top; y <= bottom; y++)
776 if (a_ssd1309_gram_draw_point(handle, x, y, color) != 0)
816 if ((left > 127) || (top > 63))
818 handle->
debug_print(
"ssd1309: left or top is invalid.\n");
822 if ((right > 127) || (bottom > 63))
824 handle->
debug_print(
"ssd1309: right or bottom is invalid.\n");
828 if ((left > right) || (top > bottom))
830 handle->
debug_print(
"ssd1309: left > right or top > bottom.\n");
835 for (x = left; x <= right; x++)
837 for (y = top; y <= bottom; y++)
839 if (a_ssd1309_gram_draw_point(handle, x, y, *img) != 0)
875 handle->
debug_print(
"ssd1309: iic_init is null.\n");
881 handle->
debug_print(
"ssd1309: iic_deinit is null.\n");
887 handle->
debug_print(
"ssd1309: iic_write is null.\n");
893 handle->
debug_print(
"ssd1309: spi_init is null.\n");
899 handle->
debug_print(
"ssd1309: spi_deinit is null.\n");
905 handle->
debug_print(
"ssd1309: spi_write_cmd is null.\n");
911 handle->
debug_print(
"ssd1309: delay_ms is null.\n");
917 handle->
debug_print(
"ssd1309: spi_cmd_data_gpio_init is null.\n");
923 handle->
debug_print(
"ssd1309: spi_cmd_data_gpio_deinit is null.\n");
929 handle->
debug_print(
"ssd1309: spi_cmd_data_gpio_write is null.\n");
935 handle->
debug_print(
"ssd1309: reset_gpio_init is null.\n");
941 handle->
debug_print(
"ssd1309: reset_gpio_deinit is null.\n");
947 handle->
debug_print(
"ssd1309: reset_gpio_write is null.\n");
954 handle->
debug_print(
"ssd1309: spi cmd data gpio init failed.\n");
960 handle->
debug_print(
"ssd1309: reset gpio init failed.\n");
967 handle->
debug_print(
"ssd1309: reset gpio write failed.\n");
976 handle->
debug_print(
"ssd1309: reset gpio write failed.\n");
986 handle->
debug_print(
"ssd1309: iic init failed.\n");
997 handle->
debug_print(
"ssd1309: spi init failed.\n");
1006 handle->
debug_print(
"ssd1309: interface is invalid.\n");
1044 handle->
debug_print(
"ssd1309: write command failed.\n");
1050 handle->
debug_print(
"ssd1309: reset gpio deinit failed.\n");
1056 handle->
debug_print(
"ssd1309: spi cmd data gpio deinit failed.\n");
1064 handle->
debug_print(
"ssd1309: iic deinit failed.\n");
1073 handle->
debug_print(
"ssd1309: spi deinit failed.\n");
1080 handle->
debug_print(
"ssd1309: interface is invalid.\n");
1105 handle->
iic_spi = (uint8_t)interface;
1147 handle->
iic_addr = (uint8_t)addr_pin;
1197 handle->
debug_print(
"ssd1309: addr is invalid.\n");
1229 handle->
debug_print(
"ssd1309: addr is invalid.\n");
1264 return a_ssd1309_multiple_write_byte(handle, (uint8_t *)buf, 2,
SSD1309_CMD);
1293 if (start_addr > 0x7F)
1295 handle->
debug_print(
"ssd1309: start addr is invalid.\n");
1299 if (end_addr > 0x7F)
1301 handle->
debug_print(
"ssd1309: end addr is invalid.\n");
1307 buf[1] = start_addr & 0x7F;
1308 buf[2] = end_addr & 0x7F;
1310 return a_ssd1309_multiple_write_byte(handle, (uint8_t *)buf, 3,
SSD1309_CMD);
1339 if (start_addr > 0x07)
1341 handle->
debug_print(
"ssd1309: start addr is invalid.\n");
1345 if (end_addr > 0x07)
1347 handle->
debug_print(
"ssd1309: end addr is invalid.\n");
1353 buf[1] = start_addr & 0x07;
1354 buf[2] = end_addr & 0x07;
1356 return a_ssd1309_multiple_write_byte(handle, (uint8_t *)buf, 3,
SSD1309_CMD);
1383 uint8_t start_column_addr, uint8_t end_column_addr)
1395 if (start_page_addr > 0x07)
1397 handle->
debug_print(
"ssd1309: start page addr is invalid.\n");
1401 if (end_page_addr > 0x07)
1403 handle->
debug_print(
"ssd1309: end page addr is invalid.\n");
1407 if (start_column_addr > 0x7F)
1409 handle->
debug_print(
"ssd1309: start column addr is invalid.\n");
1413 if (end_column_addr > 0x7F)
1415 handle->
debug_print(
"ssd1309: end column addr is invalid.\n");
1422 buf[2] = start_page_addr & 0x07;
1423 buf[3] = frames & 0x07;
1424 buf[4] = end_page_addr & 0x07;
1426 buf[6] = start_column_addr;
1427 buf[7] = end_column_addr;
1429 return a_ssd1309_multiple_write_byte(handle, (uint8_t *)buf, 8,
SSD1309_CMD);
1456 uint8_t start_column_addr, uint8_t end_column_addr)
1468 if (start_page_addr > 0x07)
1470 handle->
debug_print(
"ssd1309: start page addr is invalid.\n");
1474 if (end_page_addr > 0x07)
1476 handle->
debug_print(
"ssd1309: end page addr is invalid.\n");
1480 if (start_column_addr > 0x7F)
1482 handle->
debug_print(
"ssd1309: start column addr is invalid.\n");
1486 if (end_column_addr > 0x7F)
1488 handle->
debug_print(
"ssd1309: end column addr is invalid.\n");
1495 buf[2] = start_page_addr & 0x07;
1496 buf[3] = frames & 0x07;
1497 buf[4] = end_page_addr & 0x07;
1499 buf[6] = start_column_addr;
1500 buf[7] = end_column_addr;
1502 return a_ssd1309_multiple_write_byte(handle, (uint8_t *)buf, 8,
SSD1309_CMD);
1532 uint8_t start_page_addr, uint8_t end_page_addr,
1534 uint8_t start_column_addr, uint8_t end_column_addr)
1546 if (start_page_addr > 0x07)
1548 handle->
debug_print(
"ssd1309: start_page_addr is invalid.\n");
1552 if (end_page_addr > 0x07)
1554 handle->
debug_print(
"ssd1309: end_page_addr is invalid.\n");
1560 handle->
debug_print(
"ssd1309: rows is invalid.\n");
1564 if (start_column_addr > 0x7F)
1566 handle->
debug_print(
"ssd1309: start column addr is invalid.\n");
1570 if (end_column_addr > 0x7F)
1572 handle->
debug_print(
"ssd1309: end column addr is invalid.\n");
1578 buf[1] = horizontal_scroll & 0x01;
1579 buf[2] = start_page_addr & 0x07;
1580 buf[3] = frames & 0x07;
1581 buf[4] = end_page_addr & 0x07;
1582 buf[5] = rows & 0x3F;
1583 buf[6] = start_column_addr & 0x7F;
1584 buf[7] = end_column_addr & 0x7F;
1586 return a_ssd1309_multiple_write_byte(handle, (uint8_t *)buf, 8,
SSD1309_CMD);
1616 uint8_t start_page_addr, uint8_t end_page_addr,
1618 uint8_t start_column_addr, uint8_t end_column_addr)
1630 if (start_page_addr > 0x07)
1632 handle->
debug_print(
"ssd1309: start_page_addr is invalid.\n");
1636 if (end_page_addr > 0x07)
1638 handle->
debug_print(
"ssd1309: end_page_addr is invalid.\n");
1644 handle->
debug_print(
"ssd1309: rows is invalid.\n");
1648 if (start_column_addr > 0x7F)
1650 handle->
debug_print(
"ssd1309: start column addr is invalid.\n");
1654 if (end_column_addr > 0x7F)
1656 handle->
debug_print(
"ssd1309: end column addr is invalid.\n");
1662 buf[1] = horizontal_scroll & 0x01;
1663 buf[2] = start_page_addr & 0x07;
1664 buf[3] = frames & 0x07;
1665 buf[4] = end_page_addr & 0x07;
1666 buf[5] = rows & 0x3F;
1667 buf[6] = start_column_addr & 0x7F;
1668 buf[7] = end_column_addr & 0x7F;
1670 return a_ssd1309_multiple_write_byte(handle, (uint8_t *)buf, 8,
SSD1309_CMD);
1745 handle->
debug_print(
"ssd1309: line is invalid.\n");
1780 return a_ssd1309_multiple_write_byte(handle, (uint8_t *)buf, 2,
SSD1309_CMD);
1844 if (start_row > 0x3F)
1846 handle->
debug_print(
"ssd1309: start_row is invalid.\n");
1852 handle->
debug_print(
"ssd1309: end_row is invalid.\n");
1856 if (end_row > start_row)
1858 handle->
debug_print(
"ssd1309: end_row > start_row.\n");
1867 return a_ssd1309_multiple_write_byte(handle, (uint8_t *)buf, 3,
SSD1309_CMD);
1959 if (multiplex < 0x0F)
1961 handle->
debug_print(
"ssd1309: multiplex is too small.\n");
1965 if (multiplex > 0x3F)
1967 handle->
debug_print(
"ssd1309: multiplex is too large.\n");
1975 return a_ssd1309_multiple_write_byte(handle, (uint8_t *)buf, 2,
SSD1309_CMD);
2034 handle->
debug_print(
"ssd1309: addr is invalid.\n");
2100 handle->
debug_print(
"ssd1309: offset is invalid.\n");
2108 return a_ssd1309_multiple_write_byte(handle, (uint8_t *)buf, 2,
SSD1309_CMD);
2138 if (oscillator_frequency> 0x0F)
2140 handle->
debug_print(
"ssd1309: oscillator frequency is invalid.\n");
2144 if (clock_divide> 0x0F)
2146 handle->
debug_print(
"ssd1309: clock divide is invalid.\n");
2152 buf[1] = (oscillator_frequency << 4) | clock_divide;
2154 return a_ssd1309_multiple_write_byte(handle, (uint8_t *)buf, 2,
SSD1309_CMD);
2184 if (phase1_period> 0x0F)
2186 handle->
debug_print(
"ssd1309: phase1 period is invalid.\n");
2190 if (phase2_period> 0x0F)
2192 handle->
debug_print(
"ssd1309: phase2 period is invalid.\n");
2198 buf[1] = (phase2_period << 4) | phase1_period;
2200 return a_ssd1309_multiple_write_byte(handle, (uint8_t *)buf, 2,
SSD1309_CMD);
2229 buf[1] = (uint8_t)((conf << 4) | (remap << 5) | 0x02);
2231 return a_ssd1309_multiple_write_byte(handle, (uint8_t *)buf, 2,
SSD1309_CMD);
2259 buf[1] = (uint8_t)(level << 2);
2261 return a_ssd1309_multiple_write_byte(handle, (uint8_t *)buf, 2,
SSD1309_CMD);
2286 uint8_t end_page_addr, uint8_t start_column_addr,
2287 uint8_t end_column_addr)
2299 if (start_page_addr > 0x07)
2301 handle->
debug_print(
"ssd1309: start page addr is invalid.\n");
2305 if (end_page_addr > 0x07)
2307 handle->
debug_print(
"ssd1309: end page addr is invalid.\n");
2311 if (start_column_addr > 0x7F)
2313 handle->
debug_print(
"ssd1309: start column addr is invalid.\n");
2317 if (end_column_addr > 0x7F)
2319 handle->
debug_print(
"ssd1309: end column addr is invalid.\n");
2326 buf[2] = start_page_addr & 0x07;
2328 buf[4] = end_page_addr & 0x07;
2330 buf[6] = start_column_addr;
2331 buf[7] = end_column_addr;
2333 return a_ssd1309_multiple_write_byte(handle, (uint8_t *)buf, 8,
SSD1309_CMD);
2358 uint8_t end_page_addr, uint8_t start_column_addr,
2359 uint8_t end_column_addr)
2371 if (start_page_addr > 0x07)
2373 handle->
debug_print(
"ssd1309: start page addr is invalid.\n");
2377 if (end_page_addr > 0x07)
2379 handle->
debug_print(
"ssd1309: end page addr is invalid.\n");
2383 if (start_column_addr > 0x7F)
2385 handle->
debug_print(
"ssd1309: start column addr is invalid.\n");
2389 if (end_column_addr > 0x7F)
2391 handle->
debug_print(
"ssd1309: end column addr is invalid.\n");
2398 buf[2] = start_page_addr & 0x07;
2400 buf[4] = end_page_addr & 0x07;
2402 buf[6] = start_column_addr;
2403 buf[7] = end_column_addr;
2405 return a_ssd1309_multiple_write_byte(handle, (uint8_t *)buf, 8,
SSD1309_CMD);
2435 return a_ssd1309_multiple_write_byte(handle, (uint8_t *)buf, 2,
SSD1309_CMD);
2465 return a_ssd1309_multiple_write_byte(handle, (uint8_t *)buf, 2,
SSD1309_CMD);
2491 return a_ssd1309_multiple_write_byte(handle, (uint8_t *)buf, len,
SSD1309_CMD);
2517 return a_ssd1309_multiple_write_byte(handle, (uint8_t *)buf, len,
SSD1309_DATA);
#define SSD1309_CMD_SCAN_DIRECTION_COMN_1_START
#define SSD1309_CMD_VERTICAL_LEFT_HORIZONTAL_SCROLL
#define SSD1309_CMD_CONTRAST_CONTROL
#define SSD1309_CMD_HIGHER_COLUMN_START_ADDRESS
#define SSD1309_CMD_SET_COLUMN_ADDRESS
#define SSD1309_CMD_SET_PAGE_ADDRESS
#define SSD1309_CMD_ACTIVATE_SCROLL
#define SSD1309_CMD_LOWER_COLUMN_START_ADDRESS
chip command definition
#define SSD1309_CMD_LEFT_HORIZONTAL_SCROLL_ONE_COL
#define SSD1309_CMD_ENTIRE_DISPLAY_OFF
#define SSD1309_CMD_DISPLAY_OFFSET
#define SSD1309_CMD_MEMORY_ADDRESSING_MODE
#define SSD1309_CMD_LEFT_HORIZONTAL_SCROLL
#define SSD1309_CMD_DEACTIVATE_SCROLL
#define SSD1309_CMD_NORMAL_DISPLAY
#define SSD1309_CMD_PAGE_ADDR
#define SUPPLY_VOLTAGE_MAX
#define SSD1309_CMD_INVERSE_DISPLAY
#define SSD1309_CMD_COLUMN_0_MAPPED_TO_SEG0
#define SSD1309_CMD_COM_PINS_CONF
#define SSD1309_CMD_COMH_DESLECT_LEVEL
#define SSD1309_CMD_VERTICAL_RIGHT_HORIZONTAL_SCROLL
#define SSD1309_CMD_ENTIRE_DISPLAY_ON
#define SSD1309_CMD_RIGHT_HORIZONTAL_SCROLL
#define SSD1309_CMD_COLUMN_127_MAPPED_TO_SEG0
#define SSD1309_CMD_VERTICAL_SCROLL_AREA
#define MANUFACTURER_NAME
#define SUPPLY_VOLTAGE_MIN
#define SSD1309_CMD_PRE_CHARGE_PERIOD
#define CHIP_NAME
chip information definition
#define SSD1309_CMD_DISPLAY_START_LINE
#define SSD1309_CMD_MULTIPLEX_RATIO
#define SSD1309_CMD_DISPLAY_ON
#define SSD1309_CMD_SCAN_DIRECTION_COM0_START
#define SSD1309_CMD
chip command data definition
#define SSD1309_CMD_DISPLAY_OFF
#define SSD1309_CMD_DISPLAY_CLOCK_DIVIDE
#define SSD1309_CMD_RIGHT_HORIZONTAL_SCROLL_ONE_COL
driver ssd1309 header file
driver ssd1309 font header file
ssd1309_bool_t
ssd1309 bool enumeration definition
uint8_t ssd1309_set_page_address(ssd1309_handle_t *handle, uint8_t addr)
set the page address
uint8_t ssd1309_set_vertical_left_horizontal_scroll(ssd1309_handle_t *handle, ssd1309_bool_t horizontal_scroll, uint8_t start_page_addr, uint8_t end_page_addr, uint8_t rows, ssd1309_scroll_frame_t frames, uint8_t start_column_addr, uint8_t end_column_addr)
set the vertical left horizontal scroll
uint8_t ssd1309_set_right_horizontal_scroll(ssd1309_handle_t *handle, uint8_t start_page_addr, uint8_t end_page_addr, ssd1309_scroll_frame_t frames, uint8_t start_column_addr, uint8_t end_column_addr)
set the right horizontal scroll
uint8_t ssd1309_read_point(ssd1309_handle_t *handle, uint8_t x, uint8_t y, uint8_t *data)
read a point
uint8_t ssd1309_set_mcu_interface_lock(ssd1309_handle_t *handle, ssd1309_bool_t enable)
enable or disable mcu interface lock
uint8_t ssd1309_deactivate_scroll(ssd1309_handle_t *handle)
deactivate the scroll
uint8_t ssd1309_set_column_address_range(ssd1309_handle_t *handle, uint8_t start_addr, uint8_t end_addr)
set the column address range
ssd1309_interface_t
ssd1309 interface enumeration definition
uint8_t ssd1309_deinit(ssd1309_handle_t *handle)
close the chip
uint8_t ssd1309_get_addr_pin(ssd1309_handle_t *handle, ssd1309_address_t *addr_pin)
get the chip iic address
uint8_t ssd1309_gram_write_string(ssd1309_handle_t *handle, uint8_t x, uint8_t y, char *str, uint16_t len, uint8_t color, ssd1309_font_t font)
draw a string in the gram
uint8_t ssd1309_set_display_clock(ssd1309_handle_t *handle, uint8_t oscillator_frequency, uint8_t clock_divide)
set the display clock
uint8_t ssd1309_set_left_horizontal_scroll(ssd1309_handle_t *handle, uint8_t start_page_addr, uint8_t end_page_addr, ssd1309_scroll_frame_t frames, uint8_t start_column_addr, uint8_t end_column_addr)
set the left horizontal scroll
uint8_t ssd1309_info(ssd1309_info_t *info)
get chip's information
uint8_t ssd1309_set_high_column_start_address(ssd1309_handle_t *handle, uint8_t addr)
set the high column start address
uint8_t ssd1309_set_display(ssd1309_handle_t *handle, ssd1309_display_t on_off)
enable or disable the display
uint8_t ssd1309_set_addr_pin(ssd1309_handle_t *handle, ssd1309_address_t addr_pin)
set the chip iic address
uint8_t ssd1309_gram_write_point(ssd1309_handle_t *handle, uint8_t x, uint8_t y, uint8_t data)
write a point in the gram
uint8_t ssd1309_init(ssd1309_handle_t *handle)
initialize the chip
ssd1309_memory_addressing_mode_t
ssd1309 memory addressing mode enumeration definition
ssd1309_display_mode_t
ssd1309 display mode enumeration definition
struct ssd1309_info_s ssd1309_info_t
ssd1309 information structure definition
ssd1309_segment_column_remap_t
ssd1309 segment column remap enumeration definition
ssd1309_pin_conf_t
ssd1309 pin conf enumeration definition
uint8_t ssd1309_set_memory_addressing_mode(ssd1309_handle_t *handle, ssd1309_memory_addressing_mode_t mode)
set the memory addressing mode
struct ssd1309_handle_s ssd1309_handle_t
ssd1309 handle structure definition
uint8_t ssd1309_set_gpio(ssd1309_handle_t *handle, ssd1309_gpio_t gpio)
set gpio
uint8_t ssd1309_set_display_offset(ssd1309_handle_t *handle, uint8_t offset)
set the display offset
uint8_t ssd1309_set_right_horizontal_scroll_one_column(ssd1309_handle_t *handle, uint8_t start_page_addr, uint8_t end_page_addr, uint8_t start_column_addr, uint8_t end_column_addr)
set right horizontal scroll one column
uint8_t ssd1309_set_vertical_scroll_area(ssd1309_handle_t *handle, uint8_t start_row, uint8_t end_row)
set the vertical scroll area
uint8_t ssd1309_write_point(ssd1309_handle_t *handle, uint8_t x, uint8_t y, uint8_t data)
write a point
ssd1309_scan_direction_t
ssd1309 scan direction enumeration definition
uint8_t ssd1309_set_left_horizontal_scroll_one_column(ssd1309_handle_t *handle, uint8_t start_page_addr, uint8_t end_page_addr, uint8_t start_column_addr, uint8_t end_column_addr)
set left horizontal scroll one column
uint8_t ssd1309_set_interface(ssd1309_handle_t *handle, ssd1309_interface_t interface)
set the chip interface
uint8_t ssd1309_set_entire_display(ssd1309_handle_t *handle, ssd1309_entire_display_t enable)
enable or disable the entire display
ssd1309_display_t
ssd1309 display enumeration definition
uint8_t ssd1309_gram_draw_picture(ssd1309_handle_t *handle, uint8_t left, uint8_t top, uint8_t right, uint8_t bottom, uint8_t *img)
draw a picture in the gram
uint8_t ssd1309_activate_scroll(ssd1309_handle_t *handle)
activate the scroll
uint8_t ssd1309_set_scan_direction(ssd1309_handle_t *handle, ssd1309_scan_direction_t dir)
set the scan direction
uint8_t ssd1309_set_display_start_line(ssd1309_handle_t *handle, uint8_t l)
set the display start line
uint8_t ssd1309_set_deselect_level(ssd1309_handle_t *handle, ssd1309_deselect_level_t level)
set the deselect level
uint8_t ssd1309_set_low_column_start_address(ssd1309_handle_t *handle, uint8_t addr)
set the low column start address
ssd1309_address_t
ssd1309 address pin enumeration definition
uint8_t ssd1309_set_page_address_range(ssd1309_handle_t *handle, uint8_t start_addr, uint8_t end_addr)
set the page address range
uint8_t ssd1309_set_display_mode(ssd1309_handle_t *handle, ssd1309_display_mode_t mode)
set the display mode
uint8_t ssd1309_set_multiplex_ratio(ssd1309_handle_t *handle, uint8_t multiplex)
set the multiplex ratio
uint8_t ssd1309_gram_read_point(ssd1309_handle_t *handle, uint8_t x, uint8_t y, uint8_t *data)
read a point from the gram
uint8_t ssd1309_set_vertical_right_horizontal_scroll(ssd1309_handle_t *handle, ssd1309_bool_t horizontal_scroll, uint8_t start_page_addr, uint8_t end_page_addr, uint8_t rows, ssd1309_scroll_frame_t frames, uint8_t start_column_addr, uint8_t end_column_addr)
set the vertical right horizontal scroll
ssd1309_deselect_level_t
ssd1309 deselect level enumeration definition
ssd1309_entire_display_t
ssd1309 entire display enumeration definition
ssd1309_left_right_remap_t
ssd1309 left right remap enumeration definition
uint8_t ssd1309_set_contrast(ssd1309_handle_t *handle, uint8_t contrast)
set the display contrast
uint8_t ssd1309_set_com_pins_hardware_conf(ssd1309_handle_t *handle, ssd1309_pin_conf_t conf, ssd1309_left_right_remap_t remap)
set the hardware com pins
ssd1309_gpio_t
ssd1309 gpio enumeration definition
uint8_t ssd1309_gram_fill_rect(ssd1309_handle_t *handle, uint8_t left, uint8_t top, uint8_t right, uint8_t bottom, uint8_t color)
fill a rectangle in the gram
ssd1309_scroll_frame_t
ssd1309 scroll frame enumeration definition
uint8_t ssd1309_clear(ssd1309_handle_t *handle)
clear the screen
uint8_t ssd1309_get_interface(ssd1309_handle_t *handle, ssd1309_interface_t *interface)
get the chip interface
uint8_t ssd1309_set_precharge_period(ssd1309_handle_t *handle, uint8_t phase1_period, uint8_t phase2_period)
set the pre charge period
uint8_t ssd1309_gram_update(ssd1309_handle_t *handle)
update the gram data
uint8_t ssd1309_set_segment_remap(ssd1309_handle_t *handle, ssd1309_segment_column_remap_t remap)
set the segment remap
ssd1309_font_t
ssd1309 font enumeration definition
uint8_t ssd1309_write_cmd(ssd1309_handle_t *handle, uint8_t *buf, uint8_t len)
write the register command
uint8_t ssd1309_write_data(ssd1309_handle_t *handle, uint8_t *buf, uint8_t len)
write the register data
uint8_t(* spi_init)(void)
void(* delay_ms)(uint32_t ms)
uint8_t(* spi_cmd_data_gpio_deinit)(void)
uint8_t(* reset_gpio_deinit)(void)
void(* debug_print)(const char *const fmt,...)
uint8_t(* iic_init)(void)
uint8_t(* spi_deinit)(void)
uint8_t(* reset_gpio_init)(void)
uint8_t(* spi_cmd_data_gpio_init)(void)
uint8_t(* spi_write_cmd)(uint8_t *buf, uint16_t len)
uint8_t(* iic_write)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
uint8_t(* spi_cmd_data_gpio_write)(uint8_t value)
uint8_t(* reset_gpio_write)(uint8_t value)
uint8_t(* iic_deinit)(void)
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v