upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Data Structures | Functions | Typedefs
Include dependency graph for lcm1602.h:

API Description

Go to the source code of this file.

Data Structures

struct  _lcm1602_context
 

Functions

lcm1602_context lcm1602_i2c_init (int bus, int address, bool is_expander, uint8_t num_columns, uint8_t num_rows)
 
lcm1602_context lcm1602_gpio_init (int rs, int enable, int d0, int d1, int d2, int d3, uint8_t num_columns, uint8_t num_rows)
 
void lcm1602_close (lcm1602_context dev)
 
upm_result_t lcm1602_write (const lcm1602_context dev, char *buffer, int len)
 
upm_result_t lcm1602_set_cursor (const lcm1602_context dev, unsigned int row, unsigned int column)
 
upm_result_t lcm1602_clear (const lcm1602_context dev)
 
upm_result_t lcm1602_home (const lcm1602_context dev)
 
upm_result_t lcm1602_create_char (const lcm1602_context dev, unsigned int slot, char *data)
 
upm_result_t lcm1602_display_on (const lcm1602_context dev, bool on)
 
upm_result_t lcm1602_cursor_on (const lcm1602_context dev, bool on)
 
upm_result_t lcm1602_cursor_blink_on (const lcm1602_context dev, bool on)
 
upm_result_t lcm1602_backlight_on (const lcm1602_context dev, bool on)
 
upm_result_t lcm1602_scroll_display_left (const lcm1602_context dev)
 
upm_result_t lcm1602_scroll_display_right (const lcm1602_context dev)
 
upm_result_t lcm1602_entry_left_to_right (const lcm1602_context dev, bool on)
 
upm_result_t lcm1602_autoscroll_on (const lcm1602_context dev, bool on)
 
upm_result_t lcm1602_command (const lcm1602_context dev, uint8_t cmd)
 
upm_result_t lcm1602_data (const lcm1602_context dev, uint8_t data)
 

Typedefs

typedef struct _lcm1602_contextlcm1602_context
 

Function Documentation

lcm1602_context lcm1602_i2c_init ( int  bus,
int  address,
bool  is_expander,
uint8_t  num_columns,
uint8_t  num_rows 
)

LCM1602 I2C initialization. This is used for those devices using an I2C expander, or other I2C interface. If you are using an expander, you must specify true for the is_expander argument. If not, then the caller of this function is responsible for any transfers to the I2C device. Internally, only direct access to an I2C expander is supported.

Parameters
busI2C bus to use.
addressI2C address the LCD is configured for.
is_expanderTrue if we are dealing with an I2C expander, false otherwise.
num_columnsNumber of columns the display has.
num_rowsNumber of rows the display has.
Returns
Device Ccontext, or NULL on error.

Here is the call graph for this function:

lcm1602_context lcm1602_gpio_init ( int  rs,
int  enable,
int  d0,
int  d1,
int  d2,
int  d3,
uint8_t  num_columns,
uint8_t  num_rows 
)

LCM1602 GPIO (parallel) initialization, used for GPIO based HD44780 controllers supporting RS, Enable, and 4 data pins in 4-bit mode.

Parameters
rsRegister select pin
enableEnable pin
d0Data 0 pin
d1Data 1 pin
d2Data 2 pin
d3Data 3 pin
num_columnsNumber of columns the display has. Default 16.
num_rowsNumber of rows the display has. Default 2.
Returns
Device Ccontext, or NULL on error.

Here is the call graph for this function:

Here is the caller graph for this function:

void lcm1602_close ( lcm1602_context  dev)

LCM1602 close.

Parameters
devThe device context.

Here is the caller graph for this function:

upm_result_t lcm1602_write ( const lcm1602_context  dev,
char *  buffer,
int  len 
)

Writes a string to the LCD.

Parameters
devThe device context.
bufferCharacter buffer containing characters to write to the display; note: only ASCII characters are supported
lenThe number of characters to write.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t lcm1602_set_cursor ( const lcm1602_context  dev,
unsigned int  row,
unsigned int  column 
)

Sets the cursor to specified coordinates

Parameters
devThe device context.
rowRow to set the cursor to.
columnColumn to set the cursor to.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t lcm1602_clear ( const lcm1602_context  dev)

Clears the display of all characters.

Parameters
devThe device context.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t lcm1602_home ( const lcm1602_context  dev)

Returns to the home coordinates (0,0).

Parameters
devThe device context.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t lcm1602_create_char ( const lcm1602_context  dev,
unsigned int  slot,
char *  data 
)

Create a custom character.

Parameters
devThe device context.
slotThe character slot to write, only 8 are available.
dataThe character data (8 bytes) making up the character.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t lcm1602_display_on ( const lcm1602_context  dev,
bool  on 
)

Turn the display on.

Parameters
devThe device context.
ontrue to turn display on, false otherwise.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t lcm1602_cursor_on ( const lcm1602_context  dev,
bool  on 
)

Turn the cursor on.

Parameters
devThe device context.
ontrue to turn cursor on, false otherwise.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t lcm1602_cursor_blink_on ( const lcm1602_context  dev,
bool  on 
)

Turn cursor blink on.

Parameters
devThe device context.
ontrue to turn cursor blink on, false otherwise.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t lcm1602_backlight_on ( const lcm1602_context  dev,
bool  on 
)

Turn backlight on.

Parameters
devThe device context.
ontrue to turn backlight on, false otherwise.
Returns
UPM result.

Here is the caller graph for this function:

upm_result_t lcm1602_scroll_display_left ( const lcm1602_context  dev)

Scroll the display left, without changing the character RAM.

Parameters
devThe device context.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t lcm1602_scroll_display_right ( const lcm1602_context  dev)

Scroll the display right, without changing the character RAM.

Parameters
devThe device context.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t lcm1602_entry_left_to_right ( const lcm1602_context  dev,
bool  on 
)

Set the entry mode so that characters are added left to right.

Parameters
devThe device context.
ontrue to add characters left to right, false for right to left.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t lcm1602_autoscroll_on ( const lcm1602_context  dev,
bool  on 
)

Right justify text entered from the cursor.

Parameters
devThe device context.
ontrue right justify text, false to left justify text.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t lcm1602_command ( const lcm1602_context  dev,
uint8_t  cmd 
)

Send a command byte to the controller. This is a low level command and should not be used unless you know what you are doing.

Parameters
devThe device context.
cmdThe command byte to send.
Returns
UPM result.

Here is the caller graph for this function:

upm_result_t lcm1602_data ( const lcm1602_context  dev,
uint8_t  data 
)

Send a data byte to the controller. This is a low level command and should not be used unless you know what you are doing.

Parameters
devThe device context.
dataThe data byte to send.
Returns
UPM result.

Here is the caller graph for this function:

Typedef Documentation

Device context