Remove xfer_mode parameter from send_data

This commit is contained in:
C47D 2021-11-26 08:49:09 -06:00
parent 8a065b32b6
commit 016517b163
3 changed files with 7 additions and 20 deletions

View file

@ -95,23 +95,15 @@ void display_interface_send_cmd(lv_disp_drv_t *drv, uint32_t cmd, cmd_width_t cm
#endif
}
void display_interface_send_data(lv_disp_drv_t *drv, void *data, size_t len, data_xfer_mode_t mode)
void display_interface_send_data(lv_disp_drv_t *drv, void *data, size_t len)
{
(void) drv;
#if defined (CONFIG_LV_TFT_DISPLAY_PROTOCOL_SPI)
disp_wait_for_pending_transactions();
display_port_gpio_dc(drv, LV_DISPLAY_DC_DATA_MODE);
if (DATA_XFER_MODE_ASYNC == mode) {
disp_spi_send_colors(data, len);
}
else if (DATA_XFER_MODE_SYNC == mode) {
/* Send data in polling mode and call lv_disp_flush after that */
}
else {
}
/* lv_disp_flush is called in the SPI xfer done callback */
#elif defined (CONFIG_LV_TFT_DISPLAY_PROTOCOL_I2C)
lvgl_i2c_write(OLED_I2C_PORT, OLED_I2C_ADDRESS, OLED_CONTROL_BYTE_DATA_STREAM, data, len);
#endif

View file

@ -21,11 +21,6 @@ typedef enum {
CMD_WIDTH_INVALID,
} cmd_width_t;
typedef enum {
DATA_XFER_MODE_SYNC,
DATA_XFER_MODE_ASYNC,
} data_xfer_mode_t;
/**
* Busy wait delay port
*
@ -81,13 +76,13 @@ void display_interface_send_cmd(lv_disp_drv_t *drv, uint32_t cmd, cmd_width_t cm
/**
* Send (image) data to display
*
* User must call lv_disp_flush after the image is sent
*
* @param drv Pointer to driver
* @param data Pointer to data to be sent
* @param len Data length (in bytes) to be sent
* @param mode Data transfer mode, sync (polling) and async, lv_disp_flush must
* be called when finishing the data transfer
*/
void display_interface_send_data(lv_disp_drv_t *drv, void *data, size_t len, data_xfer_mode_t mode);
void display_interface_send_data(lv_disp_drv_t *drv, void *data, size_t len);
#ifdef __cplusplus
} /* extern "C" */

View file

@ -134,7 +134,7 @@ void ili9341_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * col
/* Memory write */
display_interface_send_cmd(drv, 0x2C, CMD_WIDTH_8BITS, NULL, 0);
display_interface_send_data(drv, color_map, size * 2, DATA_XFER_MODE_ASYNC);
display_interface_send_data(drv, color_map, size * 2);
}
void ili9341_sleep_in(lv_disp_drv_t * drv)