LibDriver ST7789
Loading...
Searching...
No Matches
driver_st7789.h File Reference

driver st7789 header file More...

#include <stdint.h>
#include <stdio.h>
#include <string.h>
Include dependency graph for driver_st7789.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  st7789_handle_s
 st7789 handle structure definition More...
struct  st7789_info_s
 st7789 information structure definition More...

Macros

#define ST7789_BUFFER_SIZE   (4096)
 st7789 buffer size definition
#define DRIVER_ST7789_LINK_INIT(HANDLE, STRUCTURE)
 initialize st7789_handle_t structure
#define DRIVER_ST7789_LINK_SPI_INIT(HANDLE, FUC)
 link spi_init function
#define DRIVER_ST7789_LINK_SPI_DEINIT(HANDLE, FUC)
 link spi_deinit function
#define DRIVER_ST7789_LINK_SPI_WRITE_COMMAND(HANDLE, FUC)
 link spi_write_cmd function
#define DRIVER_ST7789_LINK_COMMAND_DATA_GPIO_INIT(HANDLE, FUC)
 link cmd_data_gpio_init 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_RESET_GPIO_INIT(HANDLE, FUC)
 link reset_gpio_init function
#define DRIVER_ST7789_LINK_RESET_GPIO_DEINIT(HANDLE, FUC)
 link reset_gpio_deinit function
#define DRIVER_ST7789_LINK_RESET_GPIO_WRITE(HANDLE, FUC)
 link reset_gpio_write function
#define DRIVER_ST7789_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_ST7789_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function

Typedefs

typedef struct st7789_handle_s st7789_handle_t
 st7789 handle structure definition
typedef struct st7789_info_s st7789_info_t
 st7789 information structure definition

Enumerations

enum  st7789_bool_t { ST7789_BOOL_FALSE = 0x00 , ST7789_BOOL_TRUE = 0x01 }
 st7789 bool enumeration definition More...
enum  st7789_font_t { ST7789_FONT_12 = 0x0C , ST7789_FONT_16 = 0x10 , ST7789_FONT_24 = 0x18 }
 st7789 font size enumeration definition More...
enum  st7789_gamma_curve_t { ST7789_GAMMA_CURVE_1 = 0x1 , ST7789_GAMMA_CURVE_2 = 0x2 , ST7789_GAMMA_CURVE_3 = 0x4 , ST7789_GAMMA_CURVE_4 = 0x8 }
 st7789 gamma curve enumeration definition More...
enum  st7789_tearing_effect_t { ST7789_TEARING_EFFECT_V_BLANKING = 0x0 , ST7789_TEARING_EFFECT_V_BLANKING_AND_H_BLANKING = 0x1 }
 st7789 tearing effect enumeration definition More...
enum  st7789_order_t {
  ST7789_ORDER_PAGE_TOP_TO_BOTTOM = (0 << 7) , ST7789_ORDER_PAGE_BOTTOM_TO_TOP = (1 << 7) , ST7789_ORDER_COLUMN_LEFT_TO_RIGHT = (0 << 6) , ST7789_ORDER_COLUMN_RIGHT_TO_LEFT = (1 << 6) ,
  ST7789_ORDER_PAGE_COLUMN_NORMAL = (0 << 5) , ST7789_ORDER_PAGE_COLUMN_REVERSE = (1 << 5) , ST7789_ORDER_LINE_TOP_TO_BOTTOM = (0 << 4) , ST7789_ORDER_LINE_BOTTOM_TO_TOP = (1 << 4) ,
  ST7789_ORDER_COLOR_RGB = (0 << 3) , ST7789_ORDER_COLOR_BGR = (1 << 3) , ST7789_ORDER_REFRESH_LEFT_TO_RIGHT = (0 << 2) , ST7789_ORDER_REFRESH_RIGHT_TO_LEFT = (1 << 2)
}
 st7789 order enumeration definition More...
enum  st7789_rgb_interface_color_format_t { ST7789_RGB_INTERFACE_COLOR_FORMAT_65K = 0x5 , ST7789_RGB_INTERFACE_COLOR_FORMAT_262K = 0x6 }
 st7789 rgb interface color format enumeration definition More...
enum  st7789_control_interface_color_format_t { ST7789_CONTROL_INTERFACE_COLOR_FORMAT_12_BIT = 0x3 , ST7789_CONTROL_INTERFACE_COLOR_FORMAT_16_BIT = 0x5 , ST7789_CONTROL_INTERFACE_COLOR_FORMAT_18_BIT = 0x6 }
 st7789 control interface color format enumeration definition More...
enum  st7789_color_enhancement_mode_t { ST7789_COLOR_ENHANCEMENT_MODE_OFF = 0x0 , ST7789_COLOR_ENHANCEMENT_MODE_USER_INTERFACE = 0x1 , ST7789_COLOR_ENHANCEMENT_MODE_STILL_PICTURE = 0x2 , ST7789_COLOR_ENHANCEMENT_MODE_MOVING_IMAGE = 0x3 }
 st7789 color enhancement mode enumeration definition More...
enum  st7789_color_enhancement_level_t { ST7789_COLOR_ENHANCEMENT_LEVEL_LOW = 0x0 , ST7789_COLOR_ENHANCEMENT_LEVEL_MEDIUM = 0x1 , ST7789_COLOR_ENHANCEMENT_LEVEL_HIGH = 0x3 }
 st7789 color enhancement level enumeration definition More...
enum  st7789_ram_access_t { ST7789_RAM_ACCESS_MCU = 0x0 , ST7789_RAM_ACCESS_RGB = 0x1 }
 st7789 ram access enumeration definition More...
enum  st7789_display_mode_t { ST7789_DISPLAY_MODE_MCU = 0x0 , ST7789_DISPLAY_MODE_RGB = 0x1 , ST7789_DISPLAY_MODE_VSYNC = 0x2 }
 st7789 display mode enumeration definition More...
enum  st7789_data_mode_t { ST7789_DATA_MODE_MSB = 0x0 , ST7789_DATA_MODE_LSB = 0x1 }
 st7789 data mode enumeration definition More...
enum  st7789_rgb_bus_width_t { ST7789_RGB_BUS_WIDTH_18_BIT = 0x0 , ST7789_RGB_BUS_WIDTH_6_BIT = 0x1 }
 st7789 rgb bus width enumeration definition More...
enum  st7789_frame_type_t { ST7789_FRAME_TYPE_0 = 0x0 , ST7789_FRAME_TYPE_1 = 0x1 , ST7789_FRAME_TYPE_2 = 0x2 , ST7789_FRAME_TYPE_3 = 0x3 }
 st7789 frame type enumeration definition More...
enum  st7789_pixel_type_t { ST7789_PIXEL_TYPE_0 = 0x0 , ST7789_PIXEL_TYPE_1 = 0x0 , ST7789_PIXEL_TYPE_2 = 0x0 , ST7789_PIXEL_TYPE_3 = 0x0 }
 st7789 pixel type enumeration definition More...
enum  st7789_direct_rgb_mode_t { ST7789_DIRECT_RGB_MODE_MEM = 0x0 , ST7789_DIRECT_RGB_MODE_SHIFT = 0x1 }
 st7789 direct rgb mode enumeration definition More...
enum  st7789_rgb_if_enable_mode_t { ST7789_RGB_IF_ENABLE_MODE_MCU = 0x0 , ST7789_RGB_IF_ENABLE_MODE_DE = 0x2 , ST7789_RGB_IF_ENABLE_MODE_HV = 0x3 }
 st7789 rgb if enable mode enumeration definition More...
enum  st7789_pin_level_t { ST7789_PIN_LEVEL_LOW = 0x0 , ST7789_PIN_LEVEL_HIGH = 0x1 }
 st7789 pin level enumeration definition More...
enum  st7789_frame_rate_divided_control_t { ST7789_FRAME_RATE_DIVIDED_CONTROL_DIV_1 = 0x0 , ST7789_FRAME_RATE_DIVIDED_CONTROL_DIV_2 = 0x1 , ST7789_FRAME_RATE_DIVIDED_CONTROL_DIV_4 = 0x2 , ST7789_FRAME_RATE_DIVIDED_CONTROL_DIV_8 = 0x3 }
 st7789 frame rate divided control enumeration definition More...
enum  st7789_inversion_idle_mode_t { ST7789_INVERSION_IDLE_MODE_DOT = 0x0 , ST7789_INVERSION_IDLE_MODE_COLUMN = 0x7 }
 st7789 inversion idle mode enumeration definition More...
enum  st7789_inversion_partial_mode_t { ST7789_INVERSION_PARTIAL_MODE_DOT = 0x0 , ST7789_INVERSION_PARTIAL_MODE_COLUMN = 0x7 }
 st7789 inversion partial mode enumeration definition More...
enum  st7789_non_display_source_output_level_t { ST7789_NON_DISPLAY_SOURCE_OUTPUT_LEVEL_V63 = 0x0 , ST7789_NON_DISPLAY_SOURCE_OUTPUT_LEVEL_V0 = 0x1 }
 st7789 non display source output level enumeration definition More...
enum  st7789_non_display_area_scan_mode_t { ST7789_NON_DISPLAY_AREA_SCAN_MODE_NORMAL = 0x0 , ST7789_NON_DISPLAY_AREA_SCAN_MODE_INTERVAL = 0x1 }
 st7789 non display area scan mode enumeration definition More...
enum  st7789_non_display_frame_frequency_t {
  ST7789_NON_DISPLAY_FRAME_FREQUENCY_EVERY = 0x0 , ST7789_NON_DISPLAY_FRAME_FREQUENCY_1_DIV_3 = 0x1 , ST7789_NON_DISPLAY_FRAME_FREQUENCY_1_DIV_5 = 0x2 , ST7789_NON_DISPLAY_FRAME_FREQUENCY_1_DIV_7 = 0x3 ,
  ST7789_NON_DISPLAY_FRAME_FREQUENCY_1_DIV_9 = 0x4 , ST7789_NON_DISPLAY_FRAME_FREQUENCY_1_DIV_11 = 0x5 , ST7789_NON_DISPLAY_FRAME_FREQUENCY_1_DIV_13 = 0x6 , ST7789_NON_DISPLAY_FRAME_FREQUENCY_1_DIV_15 = 0x7 ,
  ST7789_NON_DISPLAY_FRAME_FREQUENCY_1_DIV_17 = 0x8 , ST7789_NON_DISPLAY_FRAME_FREQUENCY_1_DIV_19 = 0x9 , ST7789_NON_DISPLAY_FRAME_FREQUENCY_1_DIV_21 = 0xA , ST7789_NON_DISPLAY_FRAME_FREQUENCY_1_DIV_23 = 0xB ,
  ST7789_NON_DISPLAY_FRAME_FREQUENCY_1_DIV_25 = 0xC , ST7789_NON_DISPLAY_FRAME_FREQUENCY_1_DIV_27 = 0xD , ST7789_NON_DISPLAY_FRAME_FREQUENCY_1_DIV_29 = 0xE , ST7789_NON_DISPLAY_FRAME_FREQUENCY_1_DIV_31 = 0xF
}
 st7789 non display frame frequency enumeration definition More...
enum  st7789_vghs_t {
  ST7789_VGHS_12P20_V = 0x0 , ST7789_VGHS_12P54_V = 0x1 , ST7789_VGHS_12P89_V = 0x2 , ST7789_VGHS_13P26_V = 0x3 ,
  ST7789_VGHS_13P65_V = 0x4 , ST7789_VGHS_14P06_V = 0x5 , ST7789_VGHS_14P50_V = 0x6 , ST7789_VGHS_14P97_V = 0x7
}
 st7789 vghs enumeration definition More...
enum  st7789_vgls_t {
  ST7789_VGLS_NEGATIVE_7P16 = 0x0 , ST7789_VGLS_NEGATIVE_7P67 = 0x1 , ST7789_VGLS_NEGATIVE_8P23 = 0x2 , ST7789_VGLS_NEGATIVE_8P87 = 0x3 ,
  ST7789_VGLS_NEGATIVE_9P60 = 0x4 , ST7789_VGLS_NEGATIVE_10P43 = 0x5 , ST7789_VGLS_NEGATIVE_11P38 = 0x6 , ST7789_VGLS_NEGATIVE_12P50 = 0x7
}
 st7789 vgls enumeration definition More...
enum  st7789_vdv_vrh_from_t { ST7789_VDV_VRH_FROM_NVM = 0x0 , ST7789_VDV_VRH_FROM_CMD = 0x1 }
 st7789 vdv vrh from enumeration definition More...
enum  st7789_inversion_selection_t { ST7789_INVERSION_SELECTION_DOT = 0x0 , ST7789_INVERSION_SELECTION_COLUMN = 0x7 }
 st7789 inversion selection enumeration definition More...
enum  st7789_frame_rate_t {
  ST7789_FRAME_RATE_119_HZ = 0x00 , ST7789_FRAME_RATE_111_HZ = 0x01 , ST7789_FRAME_RATE_105_HZ = 0x02 , ST7789_FRAME_RATE_99_HZ = 0x03 ,
  ST7789_FRAME_RATE_94_HZ = 0x04 , ST7789_FRAME_RATE_90_HZ = 0x05 , ST7789_FRAME_RATE_86_HZ = 0x06 , ST7789_FRAME_RATE_82_HZ = 0x07 ,
  ST7789_FRAME_RATE_78_HZ = 0x08 , ST7789_FRAME_RATE_75_HZ = 0x09 , ST7789_FRAME_RATE_72_HZ = 0x0A , ST7789_FRAME_RATE_69_HZ = 0x0B ,
  ST7789_FRAME_RATE_67_HZ = 0x0C , ST7789_FRAME_RATE_64_HZ = 0x0D , ST7789_FRAME_RATE_62_HZ = 0x0E , ST7789_FRAME_RATE_60_HZ = 0x0F ,
  ST7789_FRAME_RATE_58_HZ = 0x10 , ST7789_FRAME_RATE_57_HZ = 0x11 , ST7789_FRAME_RATE_55_HZ = 0x12 , ST7789_FRAME_RATE_53_HZ = 0x13 ,
  ST7789_FRAME_RATE_52_HZ = 0x14 , ST7789_FRAME_RATE_50_HZ = 0x15 , ST7789_FRAME_RATE_49_HZ = 0x16 , ST7789_FRAME_RATE_48_HZ = 0x17 ,
  ST7789_FRAME_RATE_46_HZ = 0x18 , ST7789_FRAME_RATE_45_HZ = 0x19 , ST7789_FRAME_RATE_44_HZ = 0x1A , ST7789_FRAME_RATE_43_HZ = 0x1B ,
  ST7789_FRAME_RATE_42_HZ = 0x1C , ST7789_FRAME_RATE_41_HZ = 0x1D , ST7789_FRAME_RATE_40_HZ = 0x1E , ST7789_FRAME_RATE_39_HZ = 0x1F
}
 st7789 frame rate enumeration definition More...
enum  st7789_pwm_frequency_t {
  ST7789_PWM_FREQUENCY_39P2_KHZ = (0x0 << 3) | (0x0 << 0) , ST7789_PWM_FREQUENCY_78P7_KHZ = (0x1 << 3) | (0x0 << 0) , ST7789_PWM_FREQUENCY_158P7_KHZ = (0x2 << 3) | (0x0 << 0) , ST7789_PWM_FREQUENCY_322P6_KHZ = (0x3 << 3) | (0x0 << 0) ,
  ST7789_PWM_FREQUENCY_666P7_KHZ = (0x4 << 3) | (0x0 << 0) , ST7789_PWM_FREQUENCY_1428P6_KHZ = (0x5 << 3) | (0x0 << 0) , ST7789_PWM_FREQUENCY_19P6_KHZ = (0x0 << 3) | (0x1 << 0) , ST7789_PWM_FREQUENCY_39P4_KHZ = (0x1 << 3) | (0x1 << 0) ,
  ST7789_PWM_FREQUENCY_79P4_KHZ = (0x2 << 3) | (0x1 << 0) , ST7789_PWM_FREQUENCY_161P3_KHZ = (0x3 << 3) | (0x1 << 0) , ST7789_PWM_FREQUENCY_333P3_KHZ = (0x4 << 3) | (0x1 << 0) , ST7789_PWM_FREQUENCY_714P3_KHZ = (0x5 << 3) | (0x1 << 0) ,
  ST7789_PWM_FREQUENCY_9P8_KHZ = (0x0 << 3) | (0x2 << 0) , ST7789_PWM_FREQUENCY_19P7_KHZ = (0x1 << 3) | (0x2 << 0) , ST7789_PWM_FREQUENCY_39P7_KHZ = (0x2 << 3) | (0x2 << 0) , ST7789_PWM_FREQUENCY_80P6_KHZ = (0x3 << 3) | (0x2 << 0) ,
  ST7789_PWM_FREQUENCY_166P7_KHZ = (0x4 << 3) | (0x2 << 0) , ST7789_PWM_FREQUENCY_357P1_KHZ = (0x5 << 3) | (0x2 << 0) , ST7789_PWM_FREQUENCY_4P9_KHZ = (0x0 << 3) | (0x3 << 0) , ST7789_PWM_FREQUENCY_9P80_KHZ = (0x1 << 3) | (0x3 << 0) ,
  ST7789_PWM_FREQUENCY_19P8_KHZ = (0x2 << 3) | (0x3 << 0) , ST7789_PWM_FREQUENCY_40P3_KHZ = (0x3 << 3) | (0x3 << 0) , ST7789_PWM_FREQUENCY_83P3_KHZ = (0x4 << 3) | (0x3 << 0) , ST7789_PWM_FREQUENCY_178P6_KHZ = (0x5 << 3) | (0x3 << 0) ,
  ST7789_PWM_FREQUENCY_2P45_KHZ = (0x0 << 3) | (0x4 << 0) , ST7789_PWM_FREQUENCY_4P90_KHZ = (0x1 << 3) | (0x4 << 0) , ST7789_PWM_FREQUENCY_9P9_KHZ = (0x2 << 3) | (0x4 << 0) , ST7789_PWM_FREQUENCY_20P2_KHZ = (0x3 << 3) | (0x4 << 0) ,
  ST7789_PWM_FREQUENCY_41P7_KHZ = (0x4 << 3) | (0x4 << 0) , ST7789_PWM_FREQUENCY_89P3_KHZ = (0x5 << 3) | (0x4 << 0) , ST7789_PWM_FREQUENCY_1P23_KHZ = (0x0 << 3) | (0x5 << 0) , ST7789_PWM_FREQUENCY_2P5_KHZ = (0x1 << 3) | (0x5 << 0) ,
  ST7789_PWM_FREQUENCY_5P0_KHZ = (0x2 << 3) | (0x5 << 0) , ST7789_PWM_FREQUENCY_10P1_KHZ = (0x3 << 3) | (0x5 << 0) , ST7789_PWM_FREQUENCY_20P8_KHZ = (0x4 << 3) | (0x5 << 0) , ST7789_PWM_FREQUENCY_44P6_KHZ = (0x5 << 3) | (0x5 << 0) ,
  ST7789_PWM_FREQUENCY_0P61_KHZ = (0x0 << 3) | (0x6 << 0) , ST7789_PWM_FREQUENCY_1P230_KHZ = (0x1 << 3) | (0x6 << 0) , ST7789_PWM_FREQUENCY_2P48_KHZ = (0x2 << 3) | (0x6 << 0) , ST7789_PWM_FREQUENCY_5P00_KHZ = (0x3 << 3) | (0x6 << 0) ,
  ST7789_PWM_FREQUENCY_10P4_KHZ = (0x4 << 3) | (0x6 << 0) , ST7789_PWM_FREQUENCY_22P3_KHZ = (0x5 << 3) | (0x6 << 0) , ST7789_PWM_FREQUENCY_0P31_KHZ = (0x0 << 3) | (0x7 << 0) , ST7789_PWM_FREQUENCY_0P62_KHZ = (0x1 << 3) | (0x7 << 0) ,
  ST7789_PWM_FREQUENCY_1P24_KHZ = (0x2 << 3) | (0x7 << 0) , ST7789_PWM_FREQUENCY_2P25_KHZ = (0x3 << 3) | (0x7 << 0) , ST7789_PWM_FREQUENCY_5P2_KHZ = (0x4 << 3) | (0x7 << 0) , ST7789_PWM_FREQUENCY_11P2_KHZ = (0x5 << 3) | (0x7 << 0)
}
 st7789 pwm frequency enumeration definition More...
enum  st7789_avdd_t { ST7789_AVDD_6P4_V = 0x0 , ST7789_AVDD_6P6_V = 0x1 , ST7789_AVDD_6P8_V = 0x2 }
 st7789 avdd enumeration definition More...
enum  st7789_avcl_t { ST7789_AVCL_NEGTIVE_4P4_V = 0x0 , ST7789_AVCL_NEGTIVE_4P6_V = 0x1 , ST7789_AVCL_NEGTIVE_4P8_V = 0x2 , ST7789_AVCL_NEGTIVE_5P0_V = 0x3 }
 st7789 avcl enumeration definition More...
enum  st7789_vds_t { ST7789_VDS_2P19_V = 0x0 , ST7789_VDS_2P3_V = 0x1 , ST7789_VDS_2P4_V = 0x2 , ST7789_VDS_2P51_V = 0x3 }
 st7789 vds enumeration definition More...
enum  st7789_gate_scan_mode_t { ST7789_GATE_SCAN_MODE_INTERLACE = 0x0 , ST7789_GATE_SCAN_MODE_NON_INTERLACE = 0x1 }
 st7789 gate scan mode enumeration definition More...
enum  st7789_gate_scan_direction_t { ST7789_GATE_SCAN_DIRECTION_0_319 = 0x0 , ST7789_GATE_SCAN_DIRECTION_319_0 = 0x1 }
 st7789 gate scan direction enumeration definition More...
enum  st7789_sbclk_div_t { ST7789_SBCLK_DIV_2 = 0x0 , ST7789_SBCLK_DIV_3 = 0x1 , ST7789_SBCLK_DIV_4 = 0x2 , ST7789_SBCLK_DIV_6 = 0x3 }
 st7789 sbclk div enumeration definition More...
enum  st7789_stp14ck_div_t { ST7789_STP14CK_DIV_2 = 0x0 , ST7789_STP14CK_DIV_3 = 0x1 , ST7789_STP14CK_DIV_4 = 0x2 , ST7789_STP14CK_DIV_6 = 0x3 }
 st7789 stp14ck div enumeration definition More...

Functions

uint8_t st7789_info (st7789_info_t *info)
 get chip's information
uint8_t st7789_init (st7789_handle_t *handle)
 initialize the chip
uint8_t st7789_deinit (st7789_handle_t *handle)
 close the chip
uint8_t st7789_set_column (st7789_handle_t *handle, uint16_t column)
 set column
uint8_t st7789_set_row (st7789_handle_t *handle, uint16_t row)
 set row
uint8_t st7789_clear (st7789_handle_t *handle)
 clear the display
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_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_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_draw_picture_12bits (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_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_draw_picture_18bits (st7789_handle_t *handle, uint16_t left, uint16_t top, uint16_t right, uint16_t bottom, uint32_t *image)
 draw a picture
uint8_t st7789_nop (st7789_handle_t *handle)
 nop
uint8_t st7789_software_reset (st7789_handle_t *handle)
 software reset
uint8_t st7789_sleep_in (st7789_handle_t *handle)
 sleep in
uint8_t st7789_sleep_out (st7789_handle_t *handle)
 sleep out
uint8_t st7789_partial_display_mode_on (st7789_handle_t *handle)
 partial display mode on
uint8_t st7789_normal_display_mode_on (st7789_handle_t *handle)
 normal display mode on
uint8_t st7789_display_inversion_off (st7789_handle_t *handle)
 display inversion off
uint8_t st7789_display_inversion_on (st7789_handle_t *handle)
 display inversion on
uint8_t st7789_set_gamma (st7789_handle_t *handle, uint8_t gamma)
 set gamma
uint8_t st7789_display_off (st7789_handle_t *handle)
 display off
uint8_t st7789_display_on (st7789_handle_t *handle)
 display on
uint8_t st7789_set_column_address (st7789_handle_t *handle, uint16_t start_address, uint16_t end_address)
 set the column address
uint8_t st7789_set_row_address (st7789_handle_t *handle, uint16_t start_address, uint16_t end_address)
 set the row address
uint8_t st7789_memory_write (st7789_handle_t *handle, uint8_t *data, uint16_t len)
 memory write
uint8_t st7789_set_partial_areas (st7789_handle_t *handle, uint16_t start_row, uint16_t end_row)
 set partial areas
uint8_t st7789_set_vertical_scrolling (st7789_handle_t *handle, uint16_t top_fixed_area, uint16_t scrolling_area, uint16_t bottom_fixed_area)
 set vertical scrolling
uint8_t st7789_tearing_effect_line_off (st7789_handle_t *handle)
 tearing effect line off
uint8_t st7789_tearing_effect_line_on (st7789_handle_t *handle, st7789_tearing_effect_t effect)
 tearing effect line on
uint8_t st7789_set_memory_data_access_control (st7789_handle_t *handle, uint8_t order)
 set memory data access control
uint8_t st7789_set_vertical_scroll_start_address (st7789_handle_t *handle, uint16_t start_address)
 set the vertical scroll start address
uint8_t st7789_idle_mode_off (st7789_handle_t *handle)
 idle mode off
uint8_t st7789_idle_mode_on (st7789_handle_t *handle)
 idle mode on
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_memory_continue_write (st7789_handle_t *handle, uint8_t *data, uint16_t len)
 memory continue write
uint8_t st7789_set_tear_scanline (st7789_handle_t *handle, uint16_t l)
 set tear scanline
uint8_t st7789_set_display_brightness (st7789_handle_t *handle, uint8_t brightness)
 set display brightness
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_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_set_cabc_minimum_brightness (st7789_handle_t *handle, uint8_t brightness)
 set cabc minimum brightness
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_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_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_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_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_gate_control (st7789_handle_t *handle, st7789_vghs_t vghs, st7789_vgls_t vgls)
 set gate control
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_set_digital_gamma (st7789_handle_t *handle, st7789_bool_t enable)
 enable or disable digital gamma
uint8_t st7789_set_vcoms (st7789_handle_t *handle, uint8_t vcoms)
 set vcoms
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_vcom_convert_to_data (st7789_handle_t *handle, uint8_t reg, float *v)
 convert the register raw data to the vcom
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_id_code_setting (st7789_handle_t *handle, uint8_t id[3])
 set id code setting
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_vrhs (st7789_handle_t *handle, uint8_t vrhs)
 set vrhs
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_vrhs_convert_to_data (st7789_handle_t *handle, uint8_t reg, float *v)
 convert the register raw data to the vrhs
uint8_t st7789_set_vdv (st7789_handle_t *handle, uint8_t vdv)
 set vdv
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_vdv_convert_to_data (st7789_handle_t *handle, uint8_t reg, float *v)
 convert the register raw data to the vdv
uint8_t st7789_set_vcoms_offset (st7789_handle_t *handle, uint8_t offset)
 set vcoms offset
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_vcoms_offset_convert_to_data (st7789_handle_t *handle, uint8_t reg, float *v)
 convert the register raw data to the vcoms offset
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_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_pwm_frequency (st7789_handle_t *handle, st7789_pwm_frequency_t frequency)
 set pwm frequency
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_enable_vap_van_signal_output (st7789_handle_t *handle)
 enable vap van signal output
uint8_t st7789_set_command_2_enable (st7789_handle_t *handle, st7789_bool_t enable)
 enable or disable command 2
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_negative_voltage_gamma_control (st7789_handle_t *handle, uint8_t param[14])
 set negative voltage gamma control
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_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_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_gate_line_convert_to_register (st7789_handle_t *handle, uint16_t l, uint8_t *reg)
 convert the gate line to the register raw data
uint8_t st7789_gate_line_convert_to_data (st7789_handle_t *handle, uint8_t reg, uint16_t *l)
 convert the register raw data to the gate line
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_power_control_2 (st7789_handle_t *handle, st7789_sbclk_div_t sbclk, st7789_stp14ck_div_t stp14ck)
 set power control 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_program_mode_control (st7789_handle_t *handle)
 set program mode 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_nvm_setting (st7789_handle_t *handle, uint8_t addr, uint8_t data)
 set nvm setting
uint8_t st7789_set_program_action (st7789_handle_t *handle)
 set program action
uint8_t st7789_write_cmd (st7789_handle_t *handle, uint8_t cmd)
 write the command
uint8_t st7789_write_data (st7789_handle_t *handle, uint8_t data)
 write the data

Detailed Description

driver st7789 header file

Copyright (c) 2015 - present LibDriver All rights reserved

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version
1.0.0
Author
Shifeng Li
Date
2023-04-15

history

Date Version Author Description
2023/04/15 1.0 Shifeng Li first upload

Definition in file driver_st7789.h.