38 #ifndef DRIVER_SSD1351_H
39 #define DRIVER_SSD1351_H
64 #ifndef SSD1351_AUTO_COLOR_CONVERT
65 #define SSD1351_AUTO_COLOR_CONVERT 0
260 #define DRIVER_SSD1351_LINK_INIT(HANDLE, STRUCTURE) memset(HANDLE, 0, sizeof(STRUCTURE))
268 #define DRIVER_SSD1351_LINK_SPI_INIT(HANDLE, FUC) (HANDLE)->spi_init = FUC
276 #define DRIVER_SSD1351_LINK_SPI_DEINIT(HANDLE, FUC) (HANDLE)->spi_deinit = FUC
284 #define DRIVER_SSD1351_LINK_SPI_WRITE_COMMAND(HANDLE, FUC) (HANDLE)->spi_write_cmd = FUC
292 #define DRIVER_SSD1351_LINK_COMMAND_DATA_GPIO_INIT(HANDLE, FUC) (HANDLE)->cmd_data_gpio_init = FUC
300 #define DRIVER_SSD1351_LINK_COMMAND_DATA_GPIO_DEINIT(HANDLE, FUC) (HANDLE)->cmd_data_gpio_deinit = FUC
308 #define DRIVER_SSD1351_LINK_COMMAND_DATA_GPIO_WRITE(HANDLE, FUC) (HANDLE)->cmd_data_gpio_write = FUC
316 #define DRIVER_SSD1351_LINK_RESET_GPIO_INIT(HANDLE, FUC) (HANDLE)->reset_gpio_init = FUC
324 #define DRIVER_SSD1351_LINK_RESET_GPIO_DEINIT(HANDLE, FUC) (HANDLE)->reset_gpio_deinit = FUC
332 #define DRIVER_SSD1351_LINK_RESET_GPIO_WRITE(HANDLE, FUC) (HANDLE)->reset_gpio_write = FUC
340 #define DRIVER_SSD1351_LINK_DELAY_MS(HANDLE, FUC) (HANDLE)->delay_ms = FUC
348 #define DRIVER_SSD1351_LINK_DEBUG_PRINT(HANDLE, FUC) (HANDLE)->debug_print = FUC
uint8_t ssd1351_set_master_contrast_current(ssd1351_handle_t *handle, uint8_t current)
set the master contrast current
uint8_t ssd1351_set_scan_mode(ssd1351_handle_t *handle, ssd1351_scan_mode_t mode)
set the scan mode
uint8_t ssd1351_fill_rect(ssd1351_handle_t *handle, uint8_t left, uint8_t top, uint8_t right, uint8_t bottom, uint32_t color)
fill the rect
uint8_t ssd1351_set_color_sequence(ssd1351_handle_t *handle, ssd1351_color_sequence_t color_sequence)
set the color sequence
ssd1351_select_vdd_t
ssd1351 select vdd enumeration definition
ssd1351_seg0_mapped_t
ssd1351 seg0 mapped enumeration definition
uint8_t ssd1351_read_ram(ssd1351_handle_t *handle)
sent the read ram command
ssd1351_color_sequence_t
ssd1351 color sequence enumeration definition
uint8_t ssd1351_write_ram(ssd1351_handle_t *handle)
sent the write ram command
uint8_t ssd1351_set_contrast(ssd1351_handle_t *handle, uint8_t a, uint8_t b, uint8_t c)
set the display contrast
ssd1351_command_t
ssd1351 command enumeration definition
struct ssd1351_handle_s ssd1351_handle_t
ssd1351 handle structure definition
ssd1351_scroll_mode_t
ssd1351 scroll mode enumeration definition
ssd1351_gpio_pin_t
ssd1351 gpio pin enumeration definition
uint8_t ssd1351_clear(ssd1351_handle_t *handle)
clear the display
uint8_t ssd1351_set_display_offset(ssd1351_handle_t *handle, uint8_t offset)
set the display offset
uint8_t ssd1351_set_command(ssd1351_handle_t *handle, ssd1351_command_t command)
set the command
uint8_t ssd1351_set_color_depth(ssd1351_handle_t *handle, ssd1351_color_depth_t color_depth)
set the display color depth
ssd1351_segment_low_voltage_t
ssd1351 segment low voltage enumeration definition
uint8_t ssd1351_init(ssd1351_handle_t *handle)
initialize the chip
uint8_t ssd1351_set_use_built_in_linear_lut(ssd1351_handle_t *handle)
use built in linear lut
uint8_t ssd1351_set_parallel_bits(ssd1351_handle_t *handle, ssd1351_select_parallel_bits_t parallel_bits)
set the interface parallel bits
ssd1351_font_t
ssd1351 font size enumeration definition
uint8_t ssd1351_set_column_address(ssd1351_handle_t *handle, uint8_t start_address, uint8_t end_address)
set the display column address
uint8_t ssd1351_set_gpio(ssd1351_handle_t *handle, ssd1351_gpio_pin_t gpio0, ssd1351_gpio_pin_t gpio1)
set the gpio pin
uint8_t ssd1351_set_com_split_odd_even(ssd1351_handle_t *handle, ssd1351_bool_t enable)
set the com split odd or even
ssd1351_scan_mode_t
ssd1351 scan mode enumeration definition
uint8_t ssd1351_set_second_pre_charge_period(ssd1351_handle_t *handle, uint8_t period)
set the second pre charge period
uint8_t ssd1351_set_front_clock_oscillator_frequency(ssd1351_handle_t *handle, uint8_t d, uint8_t frequency)
set the front clock oscillator frequency
ssd1351_display_mode_t
ssd1351 display mode enumeration definition
uint8_t ssd1351_set_pre_charge_voltage(ssd1351_handle_t *handle, uint8_t voltage_level)
set the pre charge voltage
uint8_t ssd1351_set_vcomh_voltage(ssd1351_handle_t *handle, uint8_t voltage_level)
set the vcomh voltage
uint8_t ssd1351_set_phase_period(ssd1351_handle_t *handle, uint8_t phase1_period, uint8_t phase2_period)
set the phase period
uint8_t ssd1351_draw_picture_16bits(ssd1351_handle_t *handle, uint8_t left, uint8_t top, uint8_t right, uint8_t bottom, uint16_t *image)
draw a 16 bits picture
ssd1351_select_parallel_bits_t
ssd1351 select parallel enumeration definition
uint8_t ssd1351_set_display_start_line(ssd1351_handle_t *handle, uint8_t l)
set the display start line
uint8_t ssd1351_write_string(ssd1351_handle_t *handle, uint8_t x, uint8_t y, char *str, uint16_t len, uint32_t color, ssd1351_font_t font)
write a string in the display
uint8_t ssd1351_info(ssd1351_info_t *info)
get chip's information
struct ssd1351_info_s ssd1351_info_t
ssd1351 information structure definition
uint8_t ssd1351_set_display_mode(ssd1351_handle_t *handle, ssd1351_display_mode_t mode)
set the display mode
ssd1351_bool_t
ssd1351 bool enumeration definition
uint8_t ssd1351_set_row_address(ssd1351_handle_t *handle, uint8_t start_address, uint8_t end_address)
set the row address
ssd1351_address_increment_t
ssd1351 address increment enumeration definition
uint8_t ssd1351_set_select_vdd(ssd1351_handle_t *handle, ssd1351_select_vdd_t vdd)
set the select vdd
ssd1351_color_depth_t
ssd1351 color depth enumeration definition
uint8_t ssd1351_set_seg0_map(ssd1351_handle_t *handle, ssd1351_seg0_mapped_t seg0_map)
set the seg0 map
uint8_t ssd1351_set_sleep_mode(ssd1351_handle_t *handle, ssd1351_bool_t enable)
set the sleep mode
uint8_t ssd1351_set_scroll(ssd1351_handle_t *handle, int8_t scroll, uint8_t start_row, uint8_t row_len, ssd1351_scroll_mode_t mode)
set the scroll
uint8_t ssd1351_set_mux_ratio(ssd1351_handle_t *handle, uint8_t ratio)
set the mux ratio
uint8_t ssd1351_set_address_increment(ssd1351_handle_t *handle, ssd1351_address_increment_t increment)
set the address increment
uint8_t ssd1351_start_moving(ssd1351_handle_t *handle)
start the display moving
uint8_t ssd1351_draw_point(ssd1351_handle_t *handle, uint8_t x, uint8_t y, uint32_t color)
draw a point in the display
uint8_t ssd1351_draw_picture(ssd1351_handle_t *handle, uint8_t left, uint8_t top, uint8_t right, uint8_t bottom, uint32_t *image)
draw a picture
uint8_t ssd1351_stop_moving(ssd1351_handle_t *handle)
stop the display moving
uint8_t ssd1351_set_gray_scale_pulse_width(ssd1351_handle_t *handle, uint8_t gamma[63])
set the gray scale pulse width
uint8_t ssd1351_set_segment_low_voltage(ssd1351_handle_t *handle, ssd1351_segment_low_voltage_t segment)
set the segment low voltage
uint8_t ssd1351_deinit(ssd1351_handle_t *handle)
close the chip
@ SSD1351_SELECT_VDD_INTERNAL
@ SSD1351_SELECT_VDD_EXTERNAL
@ SSD1351_SEG0_ADDRESS_127
@ SSD1351_COLOR_SEQUENCE_A_B_C
@ SSD1351_COLOR_SEQUENCE_C_B_A
@ SSD1351_COMMAND_LOCK_OLED_DRIVER_IC
@ SSD1351_COMMAND_A2_B1_B3_BB_BE_ACCESSIBLE
@ SSD1351_COMMAND_UNLOCK_OLED_DRIVER_IC
@ SSD1351_COMMAND_A2_B1_B3_BB_BE_INACCESSIBLE
@ SSD1351_SCROLL_MODE_SLOWEST
@ SSD1351_SCROLL_MODE_NORMAL
@ SSD1351_SCROLL_MODE_TEST
@ SSD1351_SCROLL_MODE_SLOW
@ SSD1351_GPIO_PIN_INPUT_ENABLED
@ SSD1351_GPIO_PIN_INPUT_DISABLED
@ SSD1351_GPIO_PIN_OUTPUT_HIGH
@ SSD1351_GPIO_PIN_OUTPUT_LOW
@ SSD1351_SEGMENT_LOW_VOLTAGE_INTERNAL_VSL
@ SSD1351_SEGMENT_LOW_VOLTAGE_EXTERNAL_VSL
@ SSD1351_SCAN_MODE_COM_N_1_COM_0
@ SSD1351_SCAN_MODE_COM_0_COM_N_1
@ SSD1351_DISPLAY_MODE_NORMAL
@ SSD1351_DISPLAY_MODE_ALL_ON
@ SSD1351_DISPLAY_MODE_INVERSE
@ SSD1351_DISPLAY_MODE_ALL_OFF
@ SSD1351_SELECT_PARALLER_16_BIT
@ SSD1351_SELECT_PARALLEL_8_BIT
@ SSD1351_SELECT_PARALLER_18_BIT
@ SSD1351_ADDRESS_INCREMENT_VERTICAL
@ SSD1351_ADDRESS_INCREMENT_HORIZONTAL
@ SSD1351_COLOR_DEPTH_256
@ SSD1351_COLOR_DEPTH_262K_1ST
@ SSD1351_COLOR_DEPTH_262K_2ND
@ SSD1351_COLOR_DEPTH_65K
uint8_t ssd1351_write_data(ssd1351_handle_t *handle, uint8_t data)
write the data
uint8_t ssd1351_write_cmd(ssd1351_handle_t *handle, uint8_t cmd)
write the command
ssd1351 handle structure definition
uint8_t(* spi_init)(void)
uint8_t(* cmd_data_gpio_init)(void)
void(* delay_ms)(uint32_t ms)
uint8_t(* cmd_data_gpio_deinit)(void)
uint8_t(* reset_gpio_deinit)(void)
void(* debug_print)(const char *const fmt,...)
uint8_t(* spi_deinit)(void)
uint8_t(* reset_gpio_init)(void)
uint8_t(* cmd_data_gpio_write)(uint8_t value)
uint8_t(* spi_write_cmd)(uint8_t *buf, uint16_t len)
uint8_t(* reset_gpio_write)(uint8_t value)
ssd1351 information structure definition
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v