65 lines
1.7 KiB
C
65 lines
1.7 KiB
C
#ifndef _TFT_H
|
||
#define _TFT_H
|
||
|
||
typedef void (*tft_init_func)(void);
|
||
typedef void (*tft_read_id_func)(unsigned char *buf);
|
||
typedef void (*tft_set_window_func)(unsigned short int x0, unsigned short int y0, unsigned short int x1, unsigned short int y1);
|
||
|
||
typedef struct
|
||
{
|
||
unsigned int id;
|
||
tft_init_func init;
|
||
tft_read_id_func read_id;
|
||
tft_set_window_func set_window;
|
||
} tft_driver_t;
|
||
|
||
extern void tft_set_temode(bool mode);
|
||
extern void tft_set_window(u16 x0, u16 y0, u16 x1, u16 y1);
|
||
|
||
extern void tft_init(void);
|
||
extern void tft_exit(void);
|
||
extern void tft_bglight_en(void);
|
||
extern void oled_set_brightness(u8 brightness);
|
||
|
||
extern void tft_hw_reset(void);
|
||
extern void tft_driver_init(void);
|
||
extern void tft_dummy_clock(void);
|
||
extern void tft_read_id_cmd(u8 cmd);
|
||
|
||
/**
|
||
* @brief 设置oled亮度
|
||
* @param[in] level 亮度等级,使用无极调节时,范围0 ~ 100,否则为1~5
|
||
* @param[in] stepless_en 是否使用无极调节
|
||
*
|
||
* @return 无
|
||
**/
|
||
void oled_brightness_set_level(uint8_t level, bool stepless_en);
|
||
|
||
/**
|
||
* @brief 设置背光亮度
|
||
* @param[in] level 亮度等级,使用无极调节时,范围0 ~ 100,否则为1~5
|
||
* @param[in] stepless_en 是否使用无极调节
|
||
*
|
||
* @return 无
|
||
**/
|
||
void tft_bglight_set_level(uint8_t level, bool stepless_en);
|
||
|
||
/**
|
||
* @brief 首次设置亮度检测
|
||
* @param 无
|
||
*
|
||
* @return 无
|
||
**/
|
||
void tft_bglight_frist_set_check(void);
|
||
|
||
void tft_spi_isr(void);
|
||
u8 tft_spi_getbyte(void);
|
||
void tft_spi_sendbyte(u8 val);
|
||
void tft_spi_send(void *buf, uint len);
|
||
|
||
void tft_frame_start(void);
|
||
void tft_frame_end(void);
|
||
void tft_write_data_start(void);
|
||
void tft_write_end();
|
||
#endif
|