![]() |
LibDriver ST7789
|
driver st7789 header file More...
#include <stdint.h>#include <stdio.h>#include <string.h>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 | |
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 | |
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.
| Date | Version | Author | Description |
|---|---|---|---|
| 2023/04/15 | 1.0 | Shifeng Li | first upload |
Definition in file driver_st7789.h.