![]() |
LibDriver ST7789
|
driver st7789 source file More...
Go to the source code of this file.
Functions | |
| 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_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_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_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_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_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 | |
| uint8_t | st7789_info (st7789_info_t *info) |
| get chip's information | |
driver st7789 source 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.
| Date | Version | Author | Description |
|---|---|---|---|
| 2023/04/15 | 1.0 | Shifeng Li | first upload |
Definition in file driver_st7789.c.
| #define CHIP_NAME "Sitronix ST7789" |
| #define DRIVER_VERSION 1000 |
driver version
Definition at line 50 of file driver_st7789.c.
| #define MANUFACTURER_NAME "Sitronix" |
manufacturer name
Definition at line 44 of file driver_st7789.c.
| #define MAX_CURRENT 7.5f |
chip max current
Definition at line 47 of file driver_st7789.c.
| #define ST7789_CMD 0 |
| #define ST7789_CMD_CABCCTRL 0xC7 |
cabc control command
Definition at line 106 of file driver_st7789.c.
| #define ST7789_CMD_CASET 0x2A |
column address set command
Definition at line 72 of file driver_st7789.c.
| #define ST7789_CMD_CMD2EN 0xDF |
command 2 enable command
Definition at line 112 of file driver_st7789.c.
| #define ST7789_CMD_COLMOD 0x3A |
interface pixel format command
Definition at line 83 of file driver_st7789.c.
| #define ST7789_CMD_DGMEN 0xBA |
digital gamma enable command
Definition at line 97 of file driver_st7789.c.
| #define ST7789_CMD_DGMLUTB 0xE3 |
digital gamma look-up table for blue command
Definition at line 116 of file driver_st7789.c.
| #define ST7789_CMD_DGMLUTR 0xE2 |
digital gamma look-up table for red command
Definition at line 115 of file driver_st7789.c.
| #define ST7789_CMD_DISPOFF 0x28 |
display off command
Definition at line 70 of file driver_st7789.c.
| #define ST7789_CMD_DISPON 0x29 |
display on command
Definition at line 71 of file driver_st7789.c.
| #define ST7789_CMD_EQCTRL 0xE9 |
equalize time control command
Definition at line 120 of file driver_st7789.c.
| #define ST7789_CMD_FRCTR2 0xC6 |
fr control 2 command
Definition at line 105 of file driver_st7789.c.
| #define ST7789_CMD_FRCTRL1 0xB3 |
frame rate control 1 command
Definition at line 93 of file driver_st7789.c.
| #define ST7789_CMD_GAMSET 0x26 |
display inversion set command
Definition at line 69 of file driver_st7789.c.
| #define ST7789_CMD_GATECTRL 0xE4 |
gate control command
Definition at line 117 of file driver_st7789.c.
| #define ST7789_CMD_GCTRL 0xB7 |
gate control command
Definition at line 95 of file driver_st7789.c.
| #define ST7789_CMD_GTADJ 0xB8 |
gate on timing adjustment command
Definition at line 96 of file driver_st7789.c.
| #define ST7789_CMD_IDMOFF 0x38 |
idle mode off command
Definition at line 81 of file driver_st7789.c.
| #define ST7789_CMD_IDMON 0x39 |
idle mode on command
Definition at line 82 of file driver_st7789.c.
| #define ST7789_CMD_IDSET 0xC1 |
id setting command
Definition at line 100 of file driver_st7789.c.
| #define ST7789_CMD_INVOFF 0x20 |
display inversion off command
Definition at line 67 of file driver_st7789.c.
| #define ST7789_CMD_INVON 0x21 |
display inversion on command
Definition at line 68 of file driver_st7789.c.
| #define ST7789_CMD_LCMCTRL 0xC0 |
lcm control command
Definition at line 99 of file driver_st7789.c.
| #define ST7789_CMD_MADCTL 0x36 |
memory data access control command
Definition at line 79 of file driver_st7789.c.
| #define ST7789_CMD_NOP 0x00 |
| #define ST7789_CMD_NORON 0x13 |
normal display mode on command
Definition at line 66 of file driver_st7789.c.
| #define ST7789_CMD_NVGAMCTRL 0xE1 |
negative voltage gamma control command
Definition at line 114 of file driver_st7789.c.
| #define ST7789_CMD_NVMSET 0xFC |
nvm setting command
Definition at line 123 of file driver_st7789.c.
| #define ST7789_CMD_PARCTRL 0xB5 |
partial mode control command
Definition at line 94 of file driver_st7789.c.
| #define ST7789_CMD_PORCTRL 0xB2 |
porch control command
Definition at line 92 of file driver_st7789.c.
| #define ST7789_CMD_PROMACT 0xFE |
program action command
Definition at line 124 of file driver_st7789.c.
| #define ST7789_CMD_PROMCTRL 0xEC |
program control command
Definition at line 121 of file driver_st7789.c.
| #define ST7789_CMD_PROMEN 0xFA |
program mode enable command
Definition at line 122 of file driver_st7789.c.
| #define ST7789_CMD_PTLAR 0x30 |
partial start/end address set command
Definition at line 75 of file driver_st7789.c.
| #define ST7789_CMD_PTLON 0x12 |
partial mode on command
Definition at line 65 of file driver_st7789.c.
| #define ST7789_CMD_PVGAMCTRL 0xE0 |
positive voltage gamma control command
Definition at line 113 of file driver_st7789.c.
| #define ST7789_CMD_PWCTRL1 0xD0 |
power control 1 command
Definition at line 110 of file driver_st7789.c.
| #define ST7789_CMD_PWCTRL2 0xE8 |
power control 2 command
Definition at line 119 of file driver_st7789.c.
| #define ST7789_CMD_PWMFRSEL 0xCC |
pwm frequency selection command
Definition at line 109 of file driver_st7789.c.
| #define ST7789_CMD_RAMCTRL 0xB0 |
ram control command
Definition at line 90 of file driver_st7789.c.
| #define ST7789_CMD_RAMWR 0x2C |
memory write command
Definition at line 74 of file driver_st7789.c.
| #define ST7789_CMD_RAMWRC 0x3C |
memory write continue command
Definition at line 84 of file driver_st7789.c.
| #define ST7789_CMD_RASET 0x2B |
row address set command
Definition at line 73 of file driver_st7789.c.
| #define ST7789_CMD_REGSEL1 0xC8 |
register value selection1 command
Definition at line 107 of file driver_st7789.c.
| #define ST7789_CMD_REGSEL2 0xCA |
register value selection2 command
Definition at line 108 of file driver_st7789.c.
| #define ST7789_CMD_RGBCTRL 0xB1 |
rgb control command
Definition at line 91 of file driver_st7789.c.
| #define ST7789_CMD_SLPIN 0x10 |
sleep in command
Definition at line 63 of file driver_st7789.c.
| #define ST7789_CMD_SLPOUT 0x11 |
sleep out command
Definition at line 64 of file driver_st7789.c.
| #define ST7789_CMD_SPI2EN 0xE7 |
spi2 command
Definition at line 118 of file driver_st7789.c.
| #define ST7789_CMD_SWRESET 0x01 |
software reset command
Definition at line 62 of file driver_st7789.c.
| #define ST7789_CMD_TEOFF 0x34 |
tearing effect line off command
Definition at line 77 of file driver_st7789.c.
| #define ST7789_CMD_TEON 0x35 |
tearing effect line on command
Definition at line 78 of file driver_st7789.c.
| #define ST7789_CMD_TESCAN 0x44 |
set tear scanline command
Definition at line 85 of file driver_st7789.c.
| #define ST7789_CMD_VAPVANEN 0xD2 |
enable vap/van signal output command
Definition at line 111 of file driver_st7789.c.
| #define ST7789_CMD_VCMOFSET 0xC5 |
vcoms offset set command
Definition at line 104 of file driver_st7789.c.
| #define ST7789_CMD_VCOMS 0xBB |
vcoms setting command
Definition at line 98 of file driver_st7789.c.
| #define ST7789_CMD_VDVSET 0xC4 |
vdv setting command
Definition at line 103 of file driver_st7789.c.
| #define ST7789_CMD_VDVVRHEN 0xC2 |
vdv and vrh command enable command
Definition at line 101 of file driver_st7789.c.
| #define ST7789_CMD_VRHS 0xC3 |
vrh set command
Definition at line 102 of file driver_st7789.c.
| #define ST7789_CMD_VSCRDEF 0x33 |
vertical scrolling definition command
Definition at line 76 of file driver_st7789.c.
| #define ST7789_CMD_VSCRSADD 0x37 |
vertical scrolling start address command
Definition at line 80 of file driver_st7789.c.
| #define ST7789_CMD_WRCABCMB 0x5E |
write CABC minimum brightness command
Definition at line 89 of file driver_st7789.c.
| #define ST7789_CMD_WRCACE 0x55 |
write content adaptive brightness control and color enhancement command
Definition at line 88 of file driver_st7789.c.
| #define ST7789_CMD_WRCTRLD 0x53 |
write CTRL display command
Definition at line 87 of file driver_st7789.c.
| #define ST7789_CMD_WRDISBV 0x51 |
write display brightness command
Definition at line 86 of file driver_st7789.c.
| #define ST7789_DATA 1 |
data type
Definition at line 56 of file driver_st7789.c.
| #define SUPPLY_VOLTAGE_MAX 3.3f |
chip max supply voltage
Definition at line 46 of file driver_st7789.c.
| #define SUPPLY_VOLTAGE_MIN 2.4f |
chip min supply voltage
Definition at line 45 of file driver_st7789.c.
| #define TEMPERATURE_MAX 85.0f |
chip max operating temperature
Definition at line 49 of file driver_st7789.c.
| #define TEMPERATURE_MIN -30.0f |
chip min operating temperature
Definition at line 48 of file driver_st7789.c.