36 return drv->
write(st7735, reg, data, &size, to);
47 return drv->
read(st7735, reg, buf, &size, to);
86 {0x02, 0x1C, 0x07, 0x12, 0x37, 0x32, 0x29, 0x2D,
87 0x29, 0x25, 0x2B, 0x39, 0x00, 0x01, 0x03, 0x10},
94 {0x03, 0x1d, 0x07, 0x06, 0x2E, 0x2C, 0x29, 0x2D,
95 0x2E, 0x2E, 0x37, 0x3F, 0x00, 0x00, 0x02, 0x10},
120 if (!((drv) && (drv->
write) && (drv->
read))) {
224 goto err_set_brightness;
267#if defined(XWCDCFG_ds_PM) && (1 == XWCDCFG_ds_PM)
292 goto err_st7735_grab;
314 goto err_st7735_grab;
336 goto err_st7735_grab;
358 goto err_st7735_grab;
604 buffer[0] = color >> 8;
605 buffer[1] = color & 0xFF;
627 colorl = color & 0xFF;
628 for (i = 0; i <
sizeof(fb); i = i + 2) {
638 while (wrsz < total) {
639 if (wrsz +
sizeof(fb) < total) {
#define xwds_cast(type, dev)
#define XWDS_VALIDATE(exp, errstr,...)
static xwer_t xwds_st7735_put(struct xwds_st7735 *st7735)
ST7735 API:减少对象的引用计数
static xwer_t xwds_st7735_grab(struct xwds_st7735 *st7735)
ST7735 API:增加对象的引用计数
@ XWDS_ST7735_INVERSION_OFF
@ XWDS_ST7735_INVERSION_ON
@ XWDS_ST7735_FORMAT_RBG565
@ XWDS_ST7735_ORIENTATION_LANDSCAPE_ROT180
@ XWDS_ST7735_ORIENTATION_LANDSCAPE
@ XWDS_ST7735_ORIENTATION_PORTRAIT_ROT180
@ XWDS_ST7735_ORIENTATION_PORTRAIT
#define EINVAL
Invalid argument
#define EFAULT
Bad address
#define ENOSYS
Function not implemented
#define ERANGE
Result too large
xws64_t xwtm_t
XWOS系统时间 (有符号)
#define XWTM_MAX
xwtm_t 的最大值
#define xw_array_size(ay)
获取结构体数组中结构体的个数
SPI LCD Controller ST7735 Device
xwer_t xwds_st7735_display_on(struct xwds_st7735 *st7735, xwtm_t to)
ST7735 API:开启显示
xwer_t xwds_st7735_drv_start(struct xwds_device *dev)
ST7735基本驱动:启动设备
xwer_t xwds_st7735_read_colmod(struct xwds_st7735 *st7735, xwu8_t colmod[2], xwtm_t to)
ST7735 API:读取RDDCOLMOD寄存器的值
void xwds_st7735_get_orientation(struct xwds_st7735 *st7735, xwu8_t *orientation)
ST7735 API:读取显示方向
xwer_t xwds_st7735_draw(struct xwds_st7735 *st7735, xwu8_t x, xwu8_t y, xwu8_t width, xwu8_t height, const xwu8_t img[], xwtm_t to)
ST7735 API:绘制位图
static xwer_t xwds_st7735_read(struct xwds_st7735 *st7735, xwu8_t reg, xwu8_t *buf, xwsz_t size, xwtm_t to)
const struct xwds_st7735_cmd_table xwds_st7735_init_table[]
xwer_t xwds_st7735_set_cursor(struct xwds_st7735 *st7735, xwu8_t x, xwu8_t y, xwtm_t to)
ST7735 API:设置光标坐标
xwer_t xwds_st7735_drv_suspend(struct xwds_device *dev)
ST7735基本驱动:继续设备
xwer_t xwds_st7735_drv_resume(struct xwds_device *dev)
ST7735基本驱动:暂停设备
xwer_t xwds_st7735_drv_stop(struct xwds_device *dev)
ST7735基本驱动:停止设备
xwer_t xwds_st7735_invert_color(struct xwds_st7735 *st7735, bool inv, xwtm_t to)
ST7735 API:设置是否翻转颜色
const struct xwds_st7735_cmd_table xwds_st7735_deinit_table[]
xwer_t xwds_st7735_set_window(struct xwds_st7735 *st7735, xwu8_t x, xwu8_t y, xwu8_t width, xwu8_t height, xwtm_t to)
ST7735 API:设置窗口
xwer_t xwds_st7735_fill_rect(struct xwds_st7735 *st7735, xwu8_t x, xwu8_t y, xwu8_t width, xwu8_t height, xwu16_t color, xwtm_t to)
ST7735 API:绘制矩形
void xwds_st7735_get_brightness(struct xwds_st7735 *st7735, xwu32_t *brightness)
ST7735 API:读取亮度
static xwer_t xwds_st7735_write(struct xwds_st7735 *st7735, xwu8_t reg, const xwu8_t *data, xwsz_t size, xwtm_t to)
xwer_t xwds_st7735_read_status(struct xwds_st7735 *st7735, xwu8_t st[5], xwtm_t to)
ST7735 API:读取状态
xwer_t xwds_st7735_display_off(struct xwds_st7735 *st7735, xwtm_t to)
ST7735 API:关闭显示
xwer_t xwds_st7735_read_id(struct xwds_st7735 *st7735, xwu32_t *id, xwtm_t to)
ST7735 API:读取ID
xwer_t xwds_st7735_set_brightness(struct xwds_st7735 *st7735, xwu32_t brightness)
ST7735 API:设置亮度
xwer_t xwds_st7735_read_madctl(struct xwds_st7735 *st7735, xwu8_t madctl[2], xwtm_t to)
ST7735 API:读取RDDMADCTL寄存器的值
xwer_t xwds_st7735_set_orientation(struct xwds_st7735 *st7735, xwu8_t orientation, xwtm_t to)
ST7735 API:设置显示方向
xwer_t xwds_st7735_set_pixel(struct xwds_st7735 *st7735, xwu8_t x, xwu8_t y, xwu16_t color, xwtm_t to)
ST7735 API:设置点的颜色
SPI LCD Controller ST7735 Driver
const struct xwds_driver * drv
xwer_t(* set_brightness)(struct xwds_st7735 *, xwu32_t)
xwer_t(* read)(struct xwds_st7735 *, xwu8_t, xwu8_t *, xwsz_t *, xwtm_t)
xwer_t(* write)(struct xwds_st7735 *, xwu8_t, const xwu8_t *, xwsz_t *, xwtm_t)
struct xwds_st7735_parameter parameter