Merge pull request #67 from lvgl/st7789_expose_cmd_api

ST7789: Expose send_cmd and send_data to the user
This commit is contained in:
Carlos Diaz 2021-06-07 21:37:47 -05:00 committed by GitHub
commit 7aef1518fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View file

@ -35,8 +35,6 @@ typedef struct {
**********************/
static void st7789_set_orientation(uint8_t orientation);
static void st7789_send_cmd(uint8_t cmd);
static void st7789_send_data(void *data, uint16_t length);
static void st7789_send_color(void *data, uint16_t length);
/**********************
@ -201,14 +199,14 @@ void st7789_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * colo
/**********************
* STATIC FUNCTIONS
**********************/
static void st7789_send_cmd(uint8_t cmd)
void st7789_send_cmd(uint8_t cmd)
{
disp_wait_for_pending_transactions();
gpio_set_level(ST7789_DC, 0);
disp_spi_send_data(&cmd, 1);
}
static void st7789_send_data(void * data, uint16_t length)
void st7789_send_data(void * data, uint16_t length)
{
disp_wait_for_pending_transactions();
gpio_set_level(ST7789_DC, 1);

View file

@ -123,6 +123,9 @@ void st7789_init(void);
void st7789_flush(lv_disp_drv_t *drv, const lv_area_t *area, lv_color_t *color_map);
void st7789_enable_backlight(bool backlight);
void st7789_send_cmd(uint8_t cmd);
void st7789_send_data(void *data, uint16_t length);
#ifdef __cplusplus
} /* extern "C" */
#endif