upm
1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
|
Go to the source code of this file.
Data Structures | |
struct | _lcdks_context |
Functions | |
lcdks_context | lcdks_init (int rs, int enable, int d0, int d1, int d2, int d3, int keypad, int backlight) |
void | lcdks_close (lcdks_context dev) |
upm_result_t | lcdks_write (const lcdks_context dev, char *buffer, int len) |
upm_result_t | lcdks_set_cursor (const lcdks_context dev, unsigned int row, unsigned int column) |
upm_result_t | lcdks_clear (const lcdks_context dev) |
upm_result_t | lcdks_home (const lcdks_context dev) |
upm_result_t | lcdks_create_char (const lcdks_context dev, unsigned int slot, char *data) |
upm_result_t | lcdks_display_on (const lcdks_context dev, bool on) |
upm_result_t | lcdks_cursor_on (const lcdks_context dev, bool on) |
upm_result_t | lcdks_cursor_blink_on (const lcdks_context dev, bool on) |
upm_result_t | lcdks_backlight_on (const lcdks_context dev, bool on) |
upm_result_t | lcdks_scroll_display_left (const lcdks_context dev) |
upm_result_t | lcdks_scroll_display_right (const lcdks_context dev) |
upm_result_t | lcdks_entry_left_to_right (const lcdks_context dev, bool on) |
upm_result_t | lcdks_autoscroll_on (const lcdks_context dev, bool on) |
float | lcdks_get_key_value (const lcdks_context dev) |
Typedefs | |
typedef struct _lcdks_context * | lcdks_context |
lcdks_context lcdks_init | ( | int | rs, |
int | enable, | ||
int | d0, | ||
int | d1, | ||
int | d2, | ||
int | d3, | ||
int | keypad, | ||
int | backlight | ||
) |
LCDKS initialization
As this is a shield, you will not likely have any choice over the pins that are used. For this reason, we provide defaults for all of them – of course they can be changed if your device is different.
rs | Register select pin. |
enable | Enable pin. |
d0 | Data 0 pin. |
d1 | Data 1 pin. |
d2 | Data 2 pin. |
d3 | Data 3 pin. |
keypad | Analog pin of the keypad. |
backlight | Optional GPIO backlight pin. Specify -1 if not in use or not supported on your device. |
void lcdks_close | ( | lcdks_context | dev | ) |
LCDKS close.
dev | The device context. |
upm_result_t lcdks_write | ( | const lcdks_context | dev, |
char * | buffer, | ||
int | len | ||
) |
Writes a string to the LCD.
dev | The device context. |
buffer | Character buffer containing characters to write to the display; note: only ASCII characters are supported |
len | The number of characters to write. |
upm_result_t lcdks_set_cursor | ( | const lcdks_context | dev, |
unsigned int | row, | ||
unsigned int | column | ||
) |
Sets the cursor to specified coordinates
dev | The device context. |
row | Row to set the cursor to. |
column | Column to set the cursor to. |
upm_result_t lcdks_clear | ( | const lcdks_context | dev | ) |
Clears the display of all characters.
dev | The device context. |
upm_result_t lcdks_home | ( | const lcdks_context | dev | ) |
Returns to the home coordinates (0,0).
dev | The device context. |
upm_result_t lcdks_create_char | ( | const lcdks_context | dev, |
unsigned int | slot, | ||
char * | data | ||
) |
Create a custom character.
dev | The device context. |
slot | The character slot to write, only 8 are available. |
data | The character data (8 bytes) making up the character. |
upm_result_t lcdks_display_on | ( | const lcdks_context | dev, |
bool | on | ||
) |
Turn the display on.
dev | The device context. |
on | true to turn display on, false otherwise. |
upm_result_t lcdks_cursor_on | ( | const lcdks_context | dev, |
bool | on | ||
) |
Turn the cursor on.
dev | The device context. |
on | true to turn cursor on, false otherwise. |
upm_result_t lcdks_cursor_blink_on | ( | const lcdks_context | dev, |
bool | on | ||
) |
Turn cursor blink on.
dev | The device context. |
on | true to turn cursor blink on, false otherwise. |
upm_result_t lcdks_backlight_on | ( | const lcdks_context | dev, |
bool | on | ||
) |
Turn backlight on.
dev | The device context. |
on | true to turn backlight on, false otherwise. |
upm_result_t lcdks_scroll_display_left | ( | const lcdks_context | dev | ) |
Scroll the display left, without changing the character RAM.
dev | The device context. |
upm_result_t lcdks_scroll_display_right | ( | const lcdks_context | dev | ) |
Scroll the display right, without changing the character RAM.
dev | The device context. |
upm_result_t lcdks_entry_left_to_right | ( | const lcdks_context | dev, |
bool | on | ||
) |
Set the entry mode so that characters are added left to right.
dev | The device context. |
on | true to add characters left to right, false for right to left. |
upm_result_t lcdks_autoscroll_on | ( | const lcdks_context | dev, |
bool | on | ||
) |
Right justify text entered from the cursor.
dev | The device context. |
on | true right justify text, false to left justify text. |
float lcdks_get_key_value | ( | const lcdks_context | dev | ) |
Returns the floating point representation of the key that is being pushed. Each key produces a different value between 0.0 and 1.0, and only one key can be read at a time.
dev | The device context. |
typedef struct _lcdks_context * lcdks_context |
Device context