ILI9341 display driver

Driver for the ILI9341 display. More...

Detailed Description

Driver for the ILI9341 display.

Modules

 ILI9341 display driver compile configuration
 

Files

file  ili9341_disp_dev.h
 Definition of the driver for the disp_dev generic interface.
 
file  ili9341_internal.h
 Device driver implementation for the ili9341 display controller.
 
file  ili9341_params.h
 Default configuration for ili9341.
 
file  ili9341.h
 Driver for ili941 display.
 

Data Structures

struct  ili9341_params_t
 Device initialization parameters. More...
 
struct  ili9341_t
 Device descriptor for a ili9341. More...
 

Enumerations

enum  ili9341_rotation_t { ILI9341_ROTATION_VERT = ILI9341_MADCTL_VERT , ILI9341_ROTATION_VERT_FLIP = ILI9341_MADCTL_VERT_FLIP , ILI9341_ROTATION_HORZ = ILI9341_MADCTL_HORZ , ILI9341_ROTATION_HORZ_FLIP = ILI9341_MADCTL_HORZ_FLIP }
 Display rotation mode. More...
 

Functions

int ili9341_init (ili9341_t *dev, const ili9341_params_t *params)
 Setup an ili9341 display device. More...
 
void ili9341_fill (const ili9341_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 ili9341_pixmap (const ili9341_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 ili9341_write_cmd (const ili9341_t *dev, uint8_t cmd, const uint8_t *data, size_t len)
 Raw write command. More...
 
void ili9341_read_cmd (const ili9341_t *dev, uint8_t cmd, uint8_t *data, size_t len)
 Raw read command. More...
 
void ili9341_invert_on (const ili9341_t *dev)
 Invert the display colors. More...
 
void ili9341_invert_off (const ili9341_t *dev)
 Disable color inversion. More...
 

Memory access control bits

#define ILI9341_MADCTL_MY   0x80
 Row address order.
 
#define ILI9341_MADCTL_MX   0x40
 Column access order.
 
#define ILI9341_MADCTL_MV   0x20
 Row column exchange.
 
#define ILI9341_MADCTL_ML   0x10
 Vertical refresh order.
 
#define ILI9341_MADCTL_BGR   0x08
 Color selector switch control.
 
#define ILI9341_MADCTL_MH   0x04
 Horizontal refresh direction.
 

Display rotation modes

#define ILI9341_MADCTL_VERT   ILI9341_MADCTL_MX
 Vertical mode.
 
#define ILI9341_MADCTL_VERT_FLIP   ILI9341_MADCTL_MY
 Flipped vertical.
 
#define ILI9341_MADCTL_HORZ   ILI9341_MADCTL_MV
 Horizontal mode.
 
#define ILI9341_MADCTL_HORZ_FLIP
 Horizontal flipped. More...
 

Macro Definition Documentation

◆ ILI9341_MADCTL_HORZ_FLIP

#define ILI9341_MADCTL_HORZ_FLIP
Value:
ILI9341_MADCTL_MY | \
ILI9341_MADCTL_MX
#define ILI9341_MADCTL_MV
Row column exchange.
Definition: ili9341.h:102

Horizontal flipped.

Definition at line 117 of file ili9341.h.

Enumeration Type Documentation

◆ ili9341_rotation_t

Display rotation mode.

Enumerator
ILI9341_ROTATION_VERT 

Vertical mode.

ILI9341_ROTATION_VERT_FLIP 

Vertical flipped mode.

ILI9341_ROTATION_HORZ 

Horizontal mode.

ILI9341_ROTATION_HORZ_FLIP 

Horizontal flipped mode.

Definition at line 123 of file ili9341.h.

Function Documentation

◆ ili9341_fill()

void ili9341_fill ( const ili9341_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

◆ ili9341_init()

int ili9341_init ( ili9341_t dev,
const ili9341_params_t params 
)

Setup an ili9341 display device.

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

◆ ili9341_invert_off()

void ili9341_invert_off ( const ili9341_t dev)

Disable color inversion.

Parameters
[in]devdevice descriptor

◆ ili9341_invert_on()

void ili9341_invert_on ( const ili9341_t dev)

Invert the display colors.

Parameters
[in]devdevice descriptor

◆ ili9341_pixmap()

void ili9341_pixmap ( const ili9341_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

◆ ili9341_read_cmd()

void ili9341_read_cmd ( const ili9341_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

◆ ili9341_write_cmd()

void ili9341_write_cmd ( const ili9341_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