Loading...
Searching...
No Matches
GC9A01 display driver

Device driver implementation for the GC9A01 display controller. More...

Detailed Description

Device driver implementation for the GC9A01 display controller.

About

The GC9A01 is a single chip display driver for 240x240 TFT LCD displays.

The driver communicates with the device either via an

Usage

The driver can be configured by redefining the default parameters from the gc9a01_params.h header. For new or custom boards, the best place for this configuration is the board definition header board.h. For example, to enable the global color inversion, you can add the following line:

#define GC9A01_PARAM_INVERTED 1

For applications using the display with e.g. a development board, you can also define the parameters through CFLAGS in your application's Makefile. For example, to set the Chip Select pin, you can add the following line:

CFLAGS += -DGC9A01_PARAM_CS="GPIO_PIN(1,1)"
Note
The SPI pins are defined by the selected SPI controller. The default is SPI_DEV(0). You can find the according pin definitions for the SPI controller in your board's periph_conf.h header.

After configuring the driver, it can be used with the generic LCD API (LCD display driver). See tests/drivers/gc9a01 for an example application.

Note
Depending on the manufacturer, some panels require inversion to be enabled in order to display the colors properly. If colors show up inverted, try enabling it via GC9A01_PARAM_INVERTED.

Files

file  gc9a01_internal.h
 Internal addresses, registers and constants.
 
file  gc9a01_params.h
 Default configuration.
 
file  gc9a01.h
 

Data Structures

struct  gc9a01_t
 Device descriptor for the driver. More...
 

Variables

const lcd_driver_t lcd_gc9a01_driver
 LCD device operations table.
 

GC9A01 reference voltage configuration

#define CONFIG_GC9A01_VREG1A   (5340)
 GC9A01 VREG1A level.
 
#define CONFIG_GC9A01_VREG2A   (-3980)
 GC9A01 VREG2A level.
 

GC9A01 display rotation modes

#define GC9A01_ROTATION_VERT   LCD_MADCTL_MX
 Vertical mode.
 
#define GC9A01_ROTATION_VERT_FLIP   LCD_MADCTL_MY
 Flipped vertical.
 
#define GC9A01_ROTATION_HORZ   LCD_MADCTL_MV
 Horizontal mode.
 
#define GC9A01_ROTATION_HORZ_FLIP
 Horizontal flipped.
 

Macro Definition Documentation

◆ CONFIG_GC9A01_VREG1A

#define CONFIG_GC9A01_VREG1A   (5340)

GC9A01 VREG1A level.

Default VREG1A voltage of 5.34V. VREG1A is the highest positive grayscale reference voltage. VREG1A should be between 4.8 V and 7.34 V .

Definition at line 77 of file gc9a01.h.

◆ CONFIG_GC9A01_VREG2A

#define CONFIG_GC9A01_VREG2A   (-3980)

GC9A01 VREG2A level.

Default VREG2A voltage of -3.98V. VREG1A is the lowest negative grayscale reference voltage. VREG2A should be between -4.2 V and -1.66 V .

Definition at line 87 of file gc9a01.h.

◆ GC9A01_ROTATION_HORZ

#define GC9A01_ROTATION_HORZ   LCD_MADCTL_MV

Horizontal mode.

Definition at line 97 of file gc9a01.h.

◆ GC9A01_ROTATION_HORZ_FLIP

#define GC9A01_ROTATION_HORZ_FLIP
Value:
#define LCD_MADCTL_MX
Column access order.
Definition lcd.h:74
#define LCD_MADCTL_MY
Row address order.
Definition lcd.h:73
#define LCD_MADCTL_MV
Row column exchange.
Definition lcd.h:75

Horizontal flipped.

Definition at line 98 of file gc9a01.h.

◆ GC9A01_ROTATION_VERT

#define GC9A01_ROTATION_VERT   LCD_MADCTL_MX

Vertical mode.

Definition at line 95 of file gc9a01.h.

◆ GC9A01_ROTATION_VERT_FLIP

#define GC9A01_ROTATION_VERT_FLIP   LCD_MADCTL_MY

Flipped vertical.

Definition at line 96 of file gc9a01.h.