59 char test_str1[] =
"Test";
60 char test_str2[] =
"st7789";
61 char test_str3[] =
"ABCabc";
62 char test_str4[] =
"123?!#$%";
568 for (i = 0; i < 64; i++)
894 for (i = 0; i < 240; i++)
896 for (j = 0; j < 320; j++)
898 if ((rand() % 2) != 0)
driver st7789 display image header file
driver st7789 display test header file
uint8_t st7789_vrhs_convert_to_register(st7789_handle_t *handle, float v, uint8_t *reg)
convert the vrhs to the register raw data
uint8_t st7789_set_gate_on_timing_adjustment(st7789_handle_t *handle, uint8_t gate_on_timing_adjustment, uint8_t gate_off_timing_adjustment_rgb, uint8_t gate_off_timing_adjustment)
set gate on timing adjustment
uint8_t st7789_vdv_convert_to_register(st7789_handle_t *handle, float v, uint8_t *reg)
convert the vdv to the register raw data
uint8_t st7789_set_vcoms_offset(st7789_handle_t *handle, uint8_t offset)
set vcoms offset
uint8_t st7789_set_rgb_interface_control(st7789_handle_t *handle, st7789_direct_rgb_mode_t rgb_mode, st7789_rgb_if_enable_mode_t rgb_if_mode, st7789_pin_level_t vspl, st7789_pin_level_t hspl, st7789_pin_level_t dpl, st7789_pin_level_t epl, uint8_t vbp, uint8_t hbp)
set rgb interface control
uint8_t st7789_set_program_mode_enable(st7789_handle_t *handle, st7789_bool_t enable)
enable or disable program mode
uint8_t st7789_set_command_2_enable(st7789_handle_t *handle, st7789_bool_t enable)
enable or disable command 2
uint8_t st7789_set_equalize_time_control(st7789_handle_t *handle, uint8_t source_equalize_time, uint8_t source_pre_drive_time, uint8_t gate_equalize_time)
set equalize time control
uint8_t st7789_set_positive_voltage_gamma_control(st7789_handle_t *handle, uint8_t param[14])
set positive voltage gamma control
uint8_t st7789_set_vdv_vrh_from(st7789_handle_t *handle, st7789_vdv_vrh_from_t from)
set vdv vrh from
uint8_t st7789_set_vcoms(st7789_handle_t *handle, uint8_t vcoms)
set vcoms
uint8_t st7789_set_digital_gamma(st7789_handle_t *handle, st7789_bool_t enable)
enable or disable digital gamma
uint8_t st7789_set_frame_rate(st7789_handle_t *handle, st7789_inversion_selection_t selection, st7789_frame_rate_t rate)
set frame rate
uint8_t st7789_set_negative_voltage_gamma_control(st7789_handle_t *handle, uint8_t param[14])
set negative voltage gamma control
uint8_t st7789_set_lcm_control(st7789_handle_t *handle, st7789_bool_t xmy, st7789_bool_t xbgr, st7789_bool_t xinv, st7789_bool_t xmx, st7789_bool_t xmh, st7789_bool_t xmv, st7789_bool_t xgs)
set lcm control
uint8_t st7789_set_power_control_1(st7789_handle_t *handle, st7789_avdd_t avdd, st7789_avcl_t avcl, st7789_vds_t vds)
set power control 1
uint8_t st7789_set_frame_rate_control(st7789_handle_t *handle, st7789_bool_t separate_fr_control, st7789_frame_rate_divided_control_t div_control, st7789_inversion_idle_mode_t idle_mode, uint8_t idle_frame_rate, st7789_inversion_partial_mode_t partial_mode, uint8_t partial_frame_rate)
set frame rate control
uint8_t st7789_set_ram_control(st7789_handle_t *handle, st7789_ram_access_t ram_mode, st7789_display_mode_t display_mode, st7789_frame_type_t frame_type, st7789_data_mode_t data_mode, st7789_rgb_bus_width_t bus_width, st7789_pixel_type_t pixel_type)
set ram control
uint8_t st7789_vcoms_offset_convert_to_register(st7789_handle_t *handle, float v, uint8_t *reg)
convert the vcoms offset to the register raw data
uint8_t st7789_set_gate(st7789_handle_t *handle, uint8_t gate_line_number, uint8_t first_scan_line_number, st7789_gate_scan_mode_t mode, st7789_gate_scan_direction_t direction)
set gate
uint8_t st7789_set_gate_control(st7789_handle_t *handle, st7789_vghs_t vghs, st7789_vgls_t vgls)
set gate control
uint8_t st7789_set_cabc_control(st7789_handle_t *handle, st7789_bool_t led_on, st7789_bool_t led_pwm_init, st7789_bool_t led_pwm_fix, st7789_bool_t led_pwm_polarity)
set cabc control
uint8_t st7789_set_partial_mode_control(st7789_handle_t *handle, st7789_non_display_source_output_level_t level, st7789_non_display_area_scan_mode_t mode, st7789_non_display_frame_frequency_t frequency)
set partial mode control
uint8_t st7789_set_pwm_frequency(st7789_handle_t *handle, st7789_pwm_frequency_t frequency)
set pwm frequency
uint8_t st7789_set_spi2_enable(st7789_handle_t *handle, st7789_bool_t date_lane, st7789_bool_t command_table_2)
set spi2 enable
uint8_t st7789_set_porch(st7789_handle_t *handle, uint8_t back_porch_normal, uint8_t front_porch_normal, st7789_bool_t separate_porch_enable, uint8_t back_porch_idle, uint8_t front_porch_idle, uint8_t back_porch_partial, uint8_t front_porch_partial)
set porch
uint8_t st7789_set_power_control_2(st7789_handle_t *handle, st7789_sbclk_div_t sbclk, st7789_stp14ck_div_t stp14ck)
set power control 2
uint8_t st7789_vcom_convert_to_register(st7789_handle_t *handle, float v, uint8_t *reg)
convert the vcom to the register raw data
uint8_t st7789_set_vdv(st7789_handle_t *handle, uint8_t vdv)
set vdv
uint8_t st7789_set_vrhs(st7789_handle_t *handle, uint8_t vrhs)
set vrhs
uint8_t st7789_set_digital_gamma_look_up_table_blue(st7789_handle_t *handle, uint8_t param[64])
set blue digital gamma look up table
uint8_t st7789_set_digital_gamma_look_up_table_red(st7789_handle_t *handle, uint8_t param[64])
set red digital gamma look up table
uint8_t st7789_gate_line_convert_to_register(st7789_handle_t *handle, uint16_t l, uint8_t *reg)
convert the gate line to the register raw data
@ ST7789_FRAME_RATE_60_HZ
@ ST7789_RGB_BUS_WIDTH_18_BIT
@ ST7789_VDV_VRH_FROM_CMD
@ ST7789_FRAME_RATE_DIVIDED_CONTROL_DIV_1
@ ST7789_INVERSION_SELECTION_DOT
@ ST7789_VGLS_NEGATIVE_8P23
@ ST7789_INVERSION_PARTIAL_MODE_DOT
@ ST7789_NON_DISPLAY_FRAME_FREQUENCY_EVERY
@ ST7789_AVCL_NEGTIVE_4P8_V
@ ST7789_PWM_FREQUENCY_9P8_KHZ
@ ST7789_NON_DISPLAY_SOURCE_OUTPUT_LEVEL_V63
@ ST7789_INVERSION_IDLE_MODE_DOT
@ ST7789_DIRECT_RGB_MODE_MEM
@ ST7789_NON_DISPLAY_AREA_SCAN_MODE_NORMAL
@ ST7789_RGB_IF_ENABLE_MODE_MCU
@ ST7789_GATE_SCAN_DIRECTION_0_319
@ ST7789_GATE_SCAN_MODE_INTERLACE
@ ST7789_DISPLAY_MODE_MCU
uint8_t st7789_display_on(st7789_handle_t *handle)
display on
uint8_t st7789_init(st7789_handle_t *handle)
initialize the chip
struct st7789_handle_s st7789_handle_t
st7789 handle structure definition
uint8_t st7789_set_row(st7789_handle_t *handle, uint16_t row)
set row
uint8_t st7789_normal_display_mode_on(st7789_handle_t *handle)
normal display mode on
uint8_t st7789_write_string(st7789_handle_t *handle, uint16_t x, uint16_t y, char *str, uint16_t len, uint32_t color, st7789_font_t font)
write a string in the display
uint8_t st7789_set_display_control(st7789_handle_t *handle, st7789_bool_t brightness_control_block, st7789_bool_t display_dimming, st7789_bool_t backlight_control)
set display control
uint8_t st7789_fill_rect(st7789_handle_t *handle, uint16_t left, uint16_t top, uint16_t right, uint16_t bottom, uint32_t color)
fill the rect
uint8_t st7789_set_cabc_minimum_brightness(st7789_handle_t *handle, uint8_t brightness)
set cabc minimum brightness
uint8_t st7789_set_interface_pixel_format(st7789_handle_t *handle, st7789_rgb_interface_color_format_t rgb, st7789_control_interface_color_format_t control)
set interface pixel format
uint8_t st7789_idle_mode_off(st7789_handle_t *handle)
idle mode off
uint8_t st7789_deinit(st7789_handle_t *handle)
close the chip
uint8_t st7789_set_brightness_control_and_color_enhancement(st7789_handle_t *handle, st7789_bool_t color_enhancement, st7789_color_enhancement_mode_t mode, st7789_color_enhancement_level_t level)
set brightness control and color enhancement
uint8_t st7789_info(st7789_info_t *info)
get chip's information
uint8_t st7789_draw_picture_16bits(st7789_handle_t *handle, uint16_t left, uint16_t top, uint16_t right, uint16_t bottom, uint16_t *image)
draw a picture
uint8_t st7789_clear(st7789_handle_t *handle)
clear the display
struct st7789_info_s st7789_info_t
st7789 information structure definition
uint8_t st7789_set_gamma(st7789_handle_t *handle, uint8_t gamma)
set gamma
uint8_t st7789_set_display_brightness(st7789_handle_t *handle, uint8_t brightness)
set display brightness
uint8_t st7789_set_column(st7789_handle_t *handle, uint16_t column)
set column
uint8_t st7789_display_inversion_on(st7789_handle_t *handle)
display inversion on
uint8_t st7789_draw_point(st7789_handle_t *handle, uint16_t x, uint16_t y, uint32_t color)
draw a point in the display
uint8_t st7789_sleep_out(st7789_handle_t *handle)
sleep out
uint8_t st7789_set_memory_data_access_control(st7789_handle_t *handle, uint8_t order)
set memory data access control
@ ST7789_COLOR_ENHANCEMENT_MODE_USER_INTERFACE
@ ST7789_RGB_INTERFACE_COLOR_FORMAT_262K
@ ST7789_COLOR_ENHANCEMENT_LEVEL_HIGH
@ ST7789_CONTROL_INTERFACE_COLOR_FORMAT_16_BIT
@ ST7789_ORDER_LINE_TOP_TO_BOTTOM
@ ST7789_ORDER_PAGE_TOP_TO_BOTTOM
@ ST7789_ORDER_REFRESH_LEFT_TO_RIGHT
@ ST7789_ORDER_PAGE_COLUMN_NORMAL
@ ST7789_ORDER_COLUMN_LEFT_TO_RIGHT
uint8_t st7789_interface_cmd_data_gpio_init(void)
interface command && data gpio init
void st7789_interface_debug_print(const char *const fmt,...)
interface print format data
uint8_t st7789_interface_reset_gpio_deinit(void)
interface reset gpio deinit
uint8_t st7789_interface_cmd_data_gpio_write(uint8_t value)
interface command && data gpio write
uint8_t st7789_interface_spi_init(void)
interface spi bus init
uint8_t st7789_interface_reset_gpio_init(void)
interface reset gpio init
void st7789_interface_delay_ms(uint32_t ms)
interface delay ms
uint8_t st7789_interface_spi_deinit(void)
interface spi bus deinit
uint8_t st7789_interface_reset_gpio_write(uint8_t value)
interface reset gpio write
uint8_t st7789_interface_spi_write_cmd(uint8_t *buf, uint16_t len)
interface spi bus write
uint8_t st7789_interface_cmd_data_gpio_deinit(void)
interface command && data gpio deinit
#define DRIVER_ST7789_LINK_RESET_GPIO_WRITE(HANDLE, FUC)
link reset_gpio_write function
#define DRIVER_ST7789_LINK_DEBUG_PRINT(HANDLE, FUC)
link debug_print function
#define DRIVER_ST7789_LINK_SPI_INIT(HANDLE, FUC)
link spi_init function
#define DRIVER_ST7789_LINK_DELAY_MS(HANDLE, FUC)
link delay_ms function
#define DRIVER_ST7789_LINK_RESET_GPIO_INIT(HANDLE, FUC)
link reset_gpio_init function
#define DRIVER_ST7789_LINK_SPI_WRITE_COMMAND(HANDLE, FUC)
link spi_write_cmd function
#define DRIVER_ST7789_LINK_RESET_GPIO_DEINIT(HANDLE, FUC)
link reset_gpio_deinit function
#define DRIVER_ST7789_LINK_COMMAND_DATA_GPIO_DEINIT(HANDLE, FUC)
link cmd_data_gpio_deinit function
#define DRIVER_ST7789_LINK_COMMAND_DATA_GPIO_WRITE(HANDLE, FUC)
link cmd_data_gpio_write function
#define DRIVER_ST7789_LINK_INIT(HANDLE, STRUCTURE)
initialize st7789_handle_t structure
#define DRIVER_ST7789_LINK_SPI_DEINIT(HANDLE, FUC)
link spi_deinit function
#define DRIVER_ST7789_LINK_COMMAND_DATA_GPIO_INIT(HANDLE, FUC)
link cmd_data_gpio_init function
uint8_t st7789_display_test(void)
display test
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v