LCD display driver

Driver for the LCD display. More...

Detailed Description

Driver for the LCD display.

Files

file  lcd.h
 
file  lcd_disp_dev.h
 Definition of the driver for the disp_dev generic interface.
 
file  lcd_internal.h
 Device driver implementation for the lcd display controller.
 

Data Structures

struct  lcd_params_t
 Device initialization parameters. More...
 
struct  lcd_t
 Device descriptor for a lcd. More...
 
struct  lcd_driver
 LCD driver interface. More...
 

Macros

#define CONFIG_LCD_LE_MODE
 Convert little endian colors to big endian. More...
 

Typedefs

typedef struct lcd_driver lcd_driver_t
 LCD driver interface. More...
 

Functions

int lcd_init (lcd_t *dev, const lcd_params_t *params)
 Setup an lcd display device. More...
 
void lcd_fill (const lcd_t *dev, uint16_t x1, uint16_t x2, uint16_t y1, uint16_t y2, uint16_t color)
 Fill a rectangular area with a single pixel color. More...
 
void lcd_pixmap (const lcd_t *dev, uint16_t x1, uint16_t x2, uint16_t y1, uint16_t y2, const uint16_t *color)
 Fill a rectangular area with an array of pixels. More...
 
void lcd_write_cmd (const lcd_t *dev, uint8_t cmd, const uint8_t *data, size_t len)
 Raw write command. More...
 
void lcd_read_cmd (const lcd_t *dev, uint8_t cmd, uint8_t *data, size_t len)
 Raw read command. More...
 
void lcd_invert_on (const lcd_t *dev)
 Invert the display colors. More...
 
void lcd_invert_off (const lcd_t *dev)
 Disable color inversion. More...
 

Memory access control bits

#define LCD_MADCTL_MY   0x80
 Row address order.
 
#define LCD_MADCTL_MX   0x40
 Column access order.
 
#define LCD_MADCTL_MV   0x20
 Row column exchange.
 
#define LCD_MADCTL_ML   0x10
 Vertical refresh order.
 
#define LCD_MADCTL_BGR   0x08
 Color selector switch control.
 
#define LCD_MADCTL_MH   0x04
 Horizontal refresh direction.
 

Macro Definition Documentation

◆ CONFIG_LCD_LE_MODE

#define CONFIG_LCD_LE_MODE

Convert little endian colors to big endian.

Compile time switch to change the driver to convert little endian colors to big endian.

Definition at line 56 of file lcd.h.

Typedef Documentation

◆ lcd_driver_t

typedef struct lcd_driver lcd_driver_t

LCD driver interface.

This define the functions to access a LCD.

Definition at line 1 of file lcd.h.

Function Documentation

◆ lcd_fill()

void lcd_fill ( const lcd_t dev,
uint16_t  x1,
uint16_t  x2,
uint16_t  y1,
uint16_t  y2,
uint16_t  color 
)

Fill a rectangular area with a single pixel color.

the rectangular area is defined as x1 being the first column of pixels and x2 being the last column of pixels to fill. similar to that, y1 is the first row to fill and y2 is the last row to fill.

Parameters
[in]devdevice descriptor
[in]x1x coordinate of the first corner
[in]x2x coordinate of the opposite corner
[in]y1y coordinate of the first corner
[in]y2y coordinate of the opposite corner
[in]colorsingle color to fill the area with

◆ lcd_init()

int lcd_init ( lcd_t dev,
const lcd_params_t params 
)

Setup an lcd display device.

Parameters
[out]devdevice descriptor
[in]paramsparameters for device initialization

◆ lcd_invert_off()

void lcd_invert_off ( const lcd_t dev)

Disable color inversion.

Parameters
[in]devdevice descriptor

◆ lcd_invert_on()

void lcd_invert_on ( const lcd_t dev)

Invert the display colors.

Parameters
[in]devdevice descriptor

◆ lcd_pixmap()

void lcd_pixmap ( const lcd_t dev,
uint16_t  x1,
uint16_t  x2,
uint16_t  y1,
uint16_t  y2,
const uint16_t *  color 
)

Fill a rectangular area with an array of pixels.

the rectangular area is defined as x1 being the first column of pixels and x2 being the last column of pixels to fill. similar to that, y1 is the first row to fill and y2 is the last row to fill.

Note
color must have a length equal to (x2 - x1 + 1) * (y2 - y1 + 1)
Parameters
[in]devdevice descriptor
[in]x1x coordinate of the first corner
[in]x2x coordinate of the opposite corner
[in]y1y coordinate of the first corner
[in]y2y coordinate of the opposite corner
[in]colorarray of colors to fill the area with

◆ lcd_read_cmd()

void lcd_read_cmd ( const lcd_t dev,
uint8_t  cmd,
uint8_t *  data,
size_t  len 
)

Raw read command.

Precondition
len > 0
Parameters
[in]devdevice descriptor
[in]cmdcommand
[out]datadata from the device
[in]lenlength of the returned data

◆ lcd_write_cmd()

void lcd_write_cmd ( const lcd_t dev,
uint8_t  cmd,
const uint8_t *  data,
size_t  len 
)

Raw write command.

Parameters
[in]devdevice descriptor
[in]cmdcommand code
[in]datacommand data to the device
[in]lenlength of the command data