Loading...
Searching...
No Matches

Detailed Description

#include "board.h"
#include "mutex.h"
#include "periph/spi.h"
#include "periph/gpio.h"
+ Include dependency graph for lcd.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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...
 
struct  lcd_ll_par_driver_t
 Low-level MCU 8080 8-/16-bit parallel interface driver. More...
 

Macros

#define CONFIG_LCD_LE_MODE
 Convert little endian colors to big endian.
 

Typedefs

typedef struct lcd_driver lcd_driver_t
 LCD driver interface.
 

Enumerations

enum  lcd_if_mode_t { LCD_IF_SPI , LCD_IF_PARALLEL_8BIT , LCD_IF_PARALLEL_16BIT }
 Display interface modi. 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.
 

Low-level MCU 8080 8-/16-bit parallel interface

The low-level MCU 8080 8-/16-bit parallel interface (low-level parallel interface for short) is used when the LCD device is connected via a parallel interface.

Either the GPIO-driven low-level parallel interface provided by this LCD driver or a low-level parallel interface implemented by the MCU, such as the STM32 FMC peripheral, can be used. If the MCU provides its own implementation of the low-level parallel interface, it can be used by implementing the following low-level parallel interface driver functions, enabling the lcd_parallel_ll_mcu module and defining the lcd_ll_par_driver variable of type lcd_ll_par_driver_t.

const lcd_ll_par_driver_t lcd_ll_par_driver
 Low-level parallel interface driver instance.
 

Low-level LCD API

Low-level functions are used to acquire a device, write commands with data to the device, or read data from the device and release it when it is no longer needed.

They are usually called by the high-level functions such as lcd_init, lcd_fill, lcd_pixmap, etc., but can also be used by the application to implement low-level operations if needed.

void lcd_ll_acquire (lcd_t *dev)
 Low-level function to acquire the device.
 
void lcd_ll_release (lcd_t *dev)
 Low-level function to release the device.
 
void lcd_ll_write_cmd (lcd_t *dev, uint8_t cmd, const uint8_t *data, size_t len)
 Low-level function to write a command.
 
void lcd_ll_read_cmd (lcd_t *dev, uint8_t cmd, uint8_t *data, size_t len)
 Low-level function for read command.
 
void lcd_ll_set_area (lcd_t *dev, uint16_t x1, uint16_t x2, uint16_t y1, uint16_t y2)
 Set the LCD work area.
 

High-level LCD API

The functions of the high-level LCD API are used by the application.

They use the low-level LCD API to implement more complex operations.

int lcd_init (lcd_t *dev, const lcd_params_t *params)
 Setup an LCD display device.
 
void lcd_fill (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.
 
void lcd_pixmap (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.
 
void lcd_write_cmd (lcd_t *dev, uint8_t cmd, const uint8_t *data, size_t len)
 Raw write command.
 
void lcd_read_cmd (lcd_t *dev, uint8_t cmd, uint8_t *data, size_t len)
 Raw read command.
 
void lcd_invert_on (lcd_t *dev)
 Invert the display colors.
 
void lcd_invert_off (lcd_t *dev)
 Disable color inversion.