HX8357D LCD GPIO 8bit接続 ドライバ Kuman MAR3520(Kuman 3.5inch TFT LCD Shield)
[詳解]
#include "device.h"
#include "device/video_ioctl.h"
#include "device/vio_ioctl.h"
#include "timer.h"
#include "tkprintf.h"
#include "graphics.h"
#include "dkprintf.h"
[ソースコード]
|
#define | LCD_WIDTH 480 |
|
#define | LCD_HEIGHT 320 |
|
#define | FMEM_NOP 0 |
|
#define | FMEM_WRITE 1 |
|
#define | FMEM_READ 2 |
|
#define | HX8357_NOP 0x00 |
|
#define | HX8357_SWRESET 0x01 |
|
#define | HX8357_RDDID 0x04 |
|
#define | HX8357_RDDST 0x09 |
|
#define | HX8357B_RDPOWMODE 0x0A |
|
#define | HX8357B_RDMADCTL 0x0B |
|
#define | HX8357B_RDCOLMOD 0x0C |
|
#define | HX8357B_RDDIM 0x0D |
|
#define | HX8357B_RDDSDR 0x0F |
|
#define | HX8357_SLPIN 0x10 |
|
#define | HX8357_SLPOUT 0x11 |
|
#define | HX8357B_PTLON 0x12 |
|
#define | HX8357B_NORON 0x13 |
|
#define | HX8357_INVOFF 0x20 |
|
#define | HX8357_INVON 0x21 |
|
#define | HX8357_DISPOFF 0x28 |
|
#define | HX8357_DISPON 0x29 |
|
#define | HX8357_CASET 0x2A |
|
#define | HX8357_PASET 0x2B |
|
#define | HX8357_RAMWR 0x2C |
|
#define | HX8357_RAMRD 0x2E |
|
#define | HX8357B_PTLAR 0x30 |
|
#define | HX8357_TEON 0x35 |
|
#define | HX8357_TEARLINE 0x44 |
|
#define | HX8357_MADCTL 0x36 |
|
#define | HX8357_COLMOD 0x3A |
|
#define | HX8357_SETOSC 0xB0 |
|
#define | HX8357_SETPWR1 0xB1 |
|
#define | HX8357B_SETDISPLAY 0xB2 |
|
#define | HX8357_SETRGB 0xB3 |
|
#define | HX8357D_SETCOM 0xB6 |
|
#define | HX8357B_SETDISPMODE 0xB4 |
|
#define | HX8357D_SETCYC 0xB4 |
|
#define | HX8357B_SETOTP 0xB7 |
|
#define | HX8357D_SETC 0xB9 |
|
#define | HX8357B_SET_PANEL_DRIVING 0xC0 |
|
#define | HX8357D_SETSTBA 0xC0 |
|
#define | HX8357B_SETDGC 0xC1 |
|
#define | HX8357B_SETID 0xC3 |
|
#define | HX8357B_SETDDB 0xC4 |
|
#define | HX8357B_SETDISPLAYFRAME 0xC5 |
|
#define | HX8357B_GAMMASET 0xC8 |
|
#define | HX8357B_SETCABC 0xC9 |
|
#define | HX8357_SETPANEL 0xCC |
|
#define | HX8357B_SETPOWER 0xD0 |
|
#define | HX8357B_SETVCOM 0xD1 |
|
#define | HX8357B_SETPWRNORMAL 0xD2 |
|
#define | HX8357B_RDID1 0xDA |
|
#define | HX8357B_RDID2 0xDB |
|
#define | HX8357B_RDID3 0xDC |
|
#define | HX8357B_RDID4 0xDD |
|
#define | HX8357D_SETGAMMA 0xE0 |
|
#define | HX8357B_SETGAMMA 0xC8 |
|
#define | HX8357B_SETPANELRELATED 0xE9 |
|
#define | HX8357B_MADCTL_MY 0x80 |
|
#define | HX8357B_MADCTL_MX 0x40 |
|
#define | HX8357B_MADCTL_MV 0x20 |
|
#define | HX8357B_MADCTL_ML 0x10 |
|
#define | HX8357B_MADCTL_RGB 0x00 |
|
#define | HX8357B_MADCTL_BGR 0x08 |
|
#define | HX8357B_MADCTL_MH 0x04 |
|
|
static void | set_cs (unsigned int cs) |
|
static void | reset_hx8357d (void) |
|
static void | write_reg8 (unsigned char addr, unsigned char data) |
|
static void | write_reg16 (unsigned char addr, unsigned short data) |
|
static void | write_reg (unsigned char addr, int len, unsigned char *data) |
|
static void | write_reg32 (unsigned char addr, unsigned long data) |
|
static unsigned long | read_reg32 (unsigned char addr) |
|
static void | set_window (int x1, int y1, int x2, int y2) |
|
static void | init_hx8357d (void) |
|
static void | fill_screen (unsigned short color) |
|
static int | hx8357d_lcd_register (struct st_device *dev, char *param) |
|
static int | hx8357d_lcd_read (struct st_device *dev, void *data, unsigned int size) |
|
static int | hx8357d_lcd_write (struct st_device *dev, const void *data, unsigned int size) |
|
static int | hx8357d_lcd_ioctl (struct st_device *dev, unsigned int com, unsigned int arg, void *param) |
|
static int | hx8357d_lcd_suspend (struct st_device *dev) |
|
static int | hx8357d_lcd_resume (struct st_device *dev) |
|
|
static struct st_device * | gpio_dev |
|
static unsigned short | lcd_width = LCD_WIDTH |
|
static unsigned short | lcd_height = LCD_HEIGHT |
|
static unsigned short | fore_color = 0 |
|
static unsigned short | back_color = 0 |
|
static int | fmem_stat = FMEM_NOP |
|
static struct st_video_info | lcd_info |
|
const struct st_device | hx8357d_lcd_device |
|
HX8357D LCD GPIO 8bit接続 ドライバ Kuman MAR3520(Kuman 3.5inch TFT LCD Shield)
- 日付
- 2017.11.02
- 著者
- Takashi SHUDO
hx8357d_lcd.c に定義があります。
◆ hx8357d_lcd_device
初期値:= {
.explan = "HX8357D(MAR3520) LCD",
.info = (void *)&lcd_info,
.register_dev = hx8357d_lcd_register,
.read = hx8357d_lcd_read,
.write = hx8357d_lcd_write,
.ioctl = hx8357d_lcd_ioctl,
}
int suspend(void)
全デバイスを休止状態にする
int resume(void)
全デバイスを活性化する
#define DEF_DEV_NAME_VIDEO
標準ビデオデバイス名
hx8357d_lcd.c の 423 行目に定義があります。
◆ lcd_info
初期値:= {
.width = LCD_WIDTH,
.height = LCD_HEIGHT,
}
#define VIDEOTYPE_CMDDRAW
コマンドによる描画(フレームバッファなし)
#define VCOLORDEP_16
16ビットカラー
hx8357d_lcd.c の 416 行目に定義があります。