Ultibo API
C/C++ API for Ultibo Core
Loading...
Searching...
No Matches
i2clcd.h File Reference
#include "ultibo/gpio.h"
#include "ultibo/i2c.h"
#include "ultibo/console.h"

Go to the source code of this file.

Data Structures

struct  _I2CLCD_DISPLAY

Macros

#define I2CLCD_CONSOLE_DESCRIPTION   "Generic I2C LCD"
 Description of I2CLCD device.
#define I2CLCD_SIGNATURE   0x00CF8574
#define I2CLCD_PIN_RS   GPIO_PIN_0
 GPIO pin for the LCD RS line.
#define I2CLCD_PIN_RW   GPIO_PIN_1
 GPIO pin for the LCD RW line.
#define I2CLCD_PIN_EN   GPIO_PIN_2
 GPIO pin for the LCD EN line.
#define I2CLCD_PIN_BACKLIGHT   GPIO_PIN_3
 GPIO pin for the LCD Backlight.
#define I2CLCD_PIN_D4   GPIO_PIN_4
 GPIO pin for the LCD D4 line.
#define I2CLCD_PIN_D5   GPIO_PIN_5
 GPIO pin for the LCD D5 line.
#define I2CLCD_PIN_D6   GPIO_PIN_6
 GPIO pin for the LCD D6 line.
#define I2CLCD_PIN_D7   GPIO_PIN_7
 GPIO pin for the LCD D7 line.

Typedefs

typedef struct _I2CLCD_DISPLAY I2CLCD_DISPLAY

Functions

HANDLE STDCALL i2clcd_start (char *device, uint16_t address, uint32_t width, uint32_t height)
 Start the I2CLCD driver and register the GPIO and Console devices associated with the display.
BOOL STDCALL i2clcd_stop (HANDLE handle)
 Stop the I2CLCD driver and deregister the GPIO and Console devices associated with the display.
BOOL STDCALL i2clcd_backlight_on (HANDLE handle)
 Turn on the backlight on the I2CLCD display.
BOOL STDCALL i2clcd_backlight_off (HANDLE handle)
 Turn off the backlight on the I2CLCD display.

Macro Definition Documentation

◆ I2CLCD_CONSOLE_DESCRIPTION

#define I2CLCD_CONSOLE_DESCRIPTION   "Generic I2C LCD"

Description of I2CLCD device.

I2CLCD specific constants

◆ I2CLCD_SIGNATURE

#define I2CLCD_SIGNATURE   0x00CF8574

◆ I2CLCD_PIN_RS

#define I2CLCD_PIN_RS   GPIO_PIN_0

GPIO pin for the LCD RS line.

I2CLCD GPIO constants

◆ I2CLCD_PIN_RW

#define I2CLCD_PIN_RW   GPIO_PIN_1

GPIO pin for the LCD RW line.

◆ I2CLCD_PIN_EN

#define I2CLCD_PIN_EN   GPIO_PIN_2

GPIO pin for the LCD EN line.

◆ I2CLCD_PIN_BACKLIGHT

#define I2CLCD_PIN_BACKLIGHT   GPIO_PIN_3

GPIO pin for the LCD Backlight.

◆ I2CLCD_PIN_D4

#define I2CLCD_PIN_D4   GPIO_PIN_4

GPIO pin for the LCD D4 line.

◆ I2CLCD_PIN_D5

#define I2CLCD_PIN_D5   GPIO_PIN_5

GPIO pin for the LCD D5 line.

◆ I2CLCD_PIN_D6

#define I2CLCD_PIN_D6   GPIO_PIN_6

GPIO pin for the LCD D6 line.

◆ I2CLCD_PIN_D7

#define I2CLCD_PIN_D7   GPIO_PIN_7

GPIO pin for the LCD D7 line.

Typedef Documentation

◆ I2CLCD_DISPLAY

I2CLCD specific types

Function Documentation

◆ i2clcd_start()

HANDLE STDCALL i2clcd_start ( char * device,
uint16_t address,
uint32_t width,
uint32_t height )

Start the I2CLCD driver and register the GPIO and Console devices associated with the display.

I2CLCD Functions

Parameters
DeviceThe I2C device that the PCF8574 I/O Expander on the display is connected to
AddressThe I2C address of the PCF8574 I/O Expander on the display
WidthThe width in columns of the HD44780 LCD on the display
HeightThe height in rows of the HD44780 LCD on the display
Returns
The handle of the I2CLCD on success or INVALID_HANDLE_VALUE on failure
Note
This function will be called during startup if the parameter I2CLCD_AUTOSTART is True Can be called multiple times to support more than one LCD display

◆ i2clcd_stop()

BOOL STDCALL i2clcd_stop ( HANDLE handle)

Stop the I2CLCD driver and deregister the GPIO and Console devices associated with the display.

Parameters
HandleThe handle of the I2CLCD or INVALID_HANDLE_VALUE for the default display
Returns
True if completed or False on failure

◆ i2clcd_backlight_on()

BOOL STDCALL i2clcd_backlight_on ( HANDLE handle)

Turn on the backlight on the I2CLCD display.

Parameters
HandleThe handle of the I2CLCD or INVALID_HANDLE_VALUE for the default display
Returns
True if completed or False on failure

◆ i2clcd_backlight_off()

BOOL STDCALL i2clcd_backlight_off ( HANDLE handle)

Turn off the backlight on the I2CLCD display.

Parameters
HandleThe handle of the I2CLCD or INVALID_HANDLE_VALUE for the default display
Returns
True if completed or False on failure