imi415
69329efb44
Added LVGL source code, fixed 24bit image, added test image, added FatFs, disabled Unicode support for FatFs(bug).
61 lines
1.4 KiB
C
61 lines
1.4 KiB
C
#ifndef __OTM8009A_LCD_H
|
|
#define __OTM8009A_LCD_H
|
|
|
|
#include <stdint.h>
|
|
|
|
#ifndef OTM_BUS_WIDTH
|
|
#define OTM_BUS_WIDTH 16
|
|
#endif
|
|
|
|
#if OTM_BUS_WIDTH == 16
|
|
typedef uint16_t otm_data_t;
|
|
#elif OTM_BUS_WIDTH == 8
|
|
typedef uint8_t otm_data_t;
|
|
#elif
|
|
#error "OTM_BUS_WIDTH MUST be 16bit or 8bit."
|
|
#endif
|
|
|
|
#ifndef OTM_PANEL_SELECTION
|
|
#define OTM_PANEL_SELECTION otm8009a_800480_16b_init_sequence
|
|
#endif
|
|
|
|
typedef enum {
|
|
OTM_OK,
|
|
OTM_ERROR
|
|
} otm_ret_t;
|
|
|
|
typedef enum {
|
|
OTM_HORIZONTAL,
|
|
OTM_HORIZONTAL_INV,
|
|
OTM_VERTICAL,
|
|
OTM_VERTICAL_INV
|
|
} otm_direction_t;
|
|
|
|
typedef enum {
|
|
OTM_RGB888,
|
|
OTM_RGB565
|
|
} otm_color_format_t;
|
|
|
|
typedef struct {
|
|
otm_ret_t (*write_reg_cb)(void *handle, otm_data_t *reg, uint8_t len);
|
|
otm_ret_t (*write_data_cb)(void *handle, otm_data_t *data, uint32_t len);
|
|
otm_ret_t (*delay_cb)(void *handle, uint32_t usec);
|
|
otm_ret_t (*backlight_cb)(void *handle, uint8_t on);
|
|
} otm_cb_t;
|
|
|
|
typedef struct {
|
|
otm_direction_t direction;
|
|
otm_color_format_t color_format;
|
|
void *user_data;
|
|
otm_cb_t cb;
|
|
} otm_t;
|
|
|
|
#define OTM_ERROR_CHECK(x) if(x != OTM_OK) return OTM_ERROR
|
|
|
|
otm_ret_t otm_lcd_init(otm_t *lcd);
|
|
otm_ret_t otm_lcd_display(otm_t *lcd, uint8_t on);
|
|
otm_ret_t otm_lcd_upload(otm_t *lcd, uint16_t x1, uint16_t x2, uint16_t y1, uint16_t y2, uint16_t *data);
|
|
otm_ret_t otm_lcd_direction(otm_t *lcd, otm_direction_t direction);
|
|
otm_ret_t otm_lcd_color_format(otm_t *lcd, otm_color_format_t format);
|
|
|
|
#endif |