aip31068.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Freie Universität Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
20 #ifndef AIP31068_H
21 #define AIP31068_H
22 
23 #ifdef __cplusplus
24 extern "C"
25 {
26 #endif
27 
28 #include "stdbool.h"
29 #include "periph/i2c.h"
30 
31 #include "aip31068_regs.h"
32 
36 typedef enum {
46 
53 typedef enum {
57 
61 typedef enum {
65 
69 typedef enum {
73 
77 typedef struct {
79  uint16_t i2c_addr;
80  uint8_t row_count;
81  uint8_t col_count;
85 
89 typedef struct {
93 } aip31068_t;
94 
110 int aip31068_init(aip31068_t *dev, const aip31068_params_t *params);
111 
126 int aip31068_turn_on(aip31068_t *dev);
127 
142 int aip31068_turn_off(aip31068_t *dev);
143 
160 int aip31068_clear(aip31068_t *dev);
161 
177 
193 int aip31068_set_auto_scroll_enabled(aip31068_t *dev, bool enabled);
194 
210 int aip31068_set_cursor_blinking_enabled(aip31068_t *dev, bool enabled);
211 
227 int aip31068_set_cursor_visible(aip31068_t *dev, bool visible);
228 
245 int aip31068_set_cursor_position(aip31068_t *dev, uint8_t row, uint8_t col);
246 
264 
283 
305 
324 
340 
366  aip31068_custom_symbol_t customSymbol,
367  const uint8_t charmap[]);
368 
385  aip31068_custom_symbol_t customSymbol);
386 
402 int aip31068_print(aip31068_t *dev, const char *data);
403 
419 int aip31068_print_char(aip31068_t *dev, char c);
420 
421 #ifdef __cplusplus
422 }
423 #endif
424 
425 #endif /* AIP31068_H */
426 
aip31068_return_home
int aip31068_return_home(aip31068_t *dev)
Reset cursor position to (0, 0) and scroll display to original position.
CUSTOM_SYMBOL_3
@ CUSTOM_SYMBOL_3
3rd custom symbol
Definition: aip31068.h:39
aip31068_move_cursor_right
int aip31068_move_cursor_right(aip31068_t *dev)
Move the cursor one unit to the right.
CUSTOM_SYMBOL_7
@ CUSTOM_SYMBOL_7
7th custom symbol
Definition: aip31068.h:43
LEFT_TO_RIGHT
@ LEFT_TO_RIGHT
Insert text from left to right.
Definition: aip31068.h:54
aip31068_scroll_display_right
int aip31068_scroll_display_right(aip31068_t *dev)
Scroll the entire display content (all lines) one unit to the right.
aip31068_print
int aip31068_print(aip31068_t *dev, const char *data)
Print a string.
aip31068_params_t::bit_mode
aip31068_bit_mode_t bit_mode
Bit mode.
Definition: aip31068.h:83
CUSTOM_SYMBOL_4
@ CUSTOM_SYMBOL_4
4th custom symbol
Definition: aip31068.h:40
aip31068_move_cursor_left
int aip31068_move_cursor_left(aip31068_t *dev)
Move the cursor one unit to the left.
CUSTOM_SYMBOL_5
@ CUSTOM_SYMBOL_5
5th custom symbol
Definition: aip31068.h:41
aip31068_clear
int aip31068_clear(aip31068_t *dev)
Clear the display and set the cursor to position (0, 0).
aip31068_turn_off
int aip31068_turn_off(aip31068_t *dev)
Turn off the display.
i2c_t
unsigned int i2c_t
Default i2c_t type definition.
Definition: i2c.h:151
aip31068_set_auto_scroll_enabled
int aip31068_set_auto_scroll_enabled(aip31068_t *dev, bool enabled)
Enable or disable automated scrolling.
aip31068_set_cursor_position
int aip31068_set_cursor_position(aip31068_t *dev, uint8_t row, uint8_t col)
Move the cursor to a given position.
aip31068_set_text_insertion_mode
int aip31068_set_text_insertion_mode(aip31068_t *dev, aip31068_text_insertion_mode_t mode)
Set the direction from which the text is inserted, starting from the cursor.
aip31068_print_char
int aip31068_print_char(aip31068_t *dev, char c)
Print a single character.
aip31068_params_t::col_count
uint8_t col_count
Number of columns.
Definition: aip31068.h:81
aip31068_turn_on
int aip31068_turn_on(aip31068_t *dev)
Turn on the display.
aip31068_init
int aip31068_init(aip31068_t *dev, const aip31068_params_t *params)
Initialization.
CUSTOM_SYMBOL_8
@ CUSTOM_SYMBOL_8
8th custom symbol
Definition: aip31068.h:44
aip31068_t::_curr_entry_mode_set
uint8_t _curr_entry_mode_set
Current value of ENTRY_MODE_SET.
Definition: aip31068.h:92
FONT_SIZE_5x8
@ FONT_SIZE_5x8
Single character has 5x8 pixels.
Definition: aip31068.h:62
aip31068_params_t::font_size
aip31068_font_size_t font_size
Font size.
Definition: aip31068.h:82
aip31068_t
AIP31068 PWM device data structure type.
Definition: aip31068.h:89
aip31068_params_t::i2c_addr
uint16_t i2c_addr
I2C address of device.
Definition: aip31068.h:79
aip31068_scroll_display_left
int aip31068_scroll_display_left(aip31068_t *dev)
Scroll the entire display content (all lines) one unit to the left.
aip31068_custom_symbol_t
aip31068_custom_symbol_t
Keys for custom symbols.
Definition: aip31068.h:36
CUSTOM_SYMBOL_2
@ CUSTOM_SYMBOL_2
2nd custom symbol
Definition: aip31068.h:38
aip31068_bit_mode_t
aip31068_bit_mode_t
Bit mode for the display.
Definition: aip31068.h:69
aip31068_t::params
aip31068_params_t params
Device initialization parameters.
Definition: aip31068.h:90
aip31068_params_t::row_count
uint8_t row_count
Number of rows.
Definition: aip31068.h:80
aip31068_print_custom_symbol
int aip31068_print_custom_symbol(aip31068_t *dev, aip31068_custom_symbol_t customSymbol)
Print a custom symbol by key reference.
aip31068_set_cursor_blinking_enabled
int aip31068_set_cursor_blinking_enabled(aip31068_t *dev, bool enabled)
Enable or disable cursor blinking.
RIGHT_TO_LEFT
@ RIGHT_TO_LEFT
Insert text from right to left.
Definition: aip31068.h:55
aip31068_params_t::i2c_dev
i2c_t i2c_dev
I2C device.
Definition: aip31068.h:78
aip31068_text_insertion_mode_t
aip31068_text_insertion_mode_t
Defines the direction of the text insertion.
Definition: aip31068.h:53
aip31068_font_size_t
aip31068_font_size_t
Size of a character of the display in dots/pixels.
Definition: aip31068.h:61
BITMODE_8_BIT
@ BITMODE_8_BIT
Use 8 bit mode.
Definition: aip31068.h:71
aip31068_t::_curr_display_control
uint8_t _curr_display_control
Current value of DISPLAY_CONTROL.
Definition: aip31068.h:91
aip31068_set_custom_symbol
int aip31068_set_custom_symbol(aip31068_t *dev, aip31068_custom_symbol_t customSymbol, const uint8_t charmap[])
Create a custom symbol.
aip31068_regs.h
Register definitions for the AIP31068 I2C LCD controller.
BITMODE_4_BIT
@ BITMODE_4_BIT
Use 4 bit mode.
Definition: aip31068.h:70
CUSTOM_SYMBOL_6
@ CUSTOM_SYMBOL_6
6th custom symbol
Definition: aip31068.h:42
aip31068_set_cursor_visible
int aip31068_set_cursor_visible(aip31068_t *dev, bool visible)
Show or hide the cursor.
FONT_SIZE_5x10
@ FONT_SIZE_5x10
Single character has 5x10 pixels.
Definition: aip31068.h:63
i2c.h
Low-level I2C peripheral driver interface definition.
aip31068_params_t
AIP31068 device initialization parameters.
Definition: aip31068.h:77
CUSTOM_SYMBOL_1
@ CUSTOM_SYMBOL_1
1st custom symbol
Definition: aip31068.h:37