Driver for alphanumeric lcd, created as an example of EPPL usage.
Define if we have read access to LCD.
Macro that informs us if library have read access to LCD. This library uses it only to read busy flag.
#define ALCD_PIN_DEFINED |
( |
|
p | ) |
((p) != EPPL_NP) |
Check if pin is defined.
Internal macro for check if pin is defined. We assume that pin is defined if the mnemonic is defined and it not equals EPPL_NP
- Parameters
-
- Returns
- Value that indicates if pin is defined
Value:
LCD pin initialization data.
Use this constant for eppl_init function in your main code.
Example:
- Examples:
- base/main.c.
static void alcd_cls |
( |
void |
| ) |
|
|
inlinestatic |
Clear screen.
Function generates command that:
- moves cursor at position 0 in DDRAM
- resets any display shifts
- fills DDRAM with spaces (0x20 ASCII code)
- sets increment entry mode, (shift does not change)
void alcd_cmd |
( |
uint8_t |
cmd | ) |
|
Send single command byte.
Function that configures outputs and sends one command. Also supports busy waiting strategy depending of read accessability. Just "call and forget" function.
- Attention
- For future compatibility do not call this function directly. Use other higher-level configuration functions.
- Parameters
-
- See Also
- alcd_data
void alcd_data |
( |
uint8_t |
data | ) |
|
Send signle data byte.
Function sends signgle data byte.
- Attention
- For future compatibility do not use it to send character on LCD. Use alcd_putc instead.
- Parameters
-
- See Also
- alcd_cmd
void alcd_defineChar |
( |
char |
c, |
|
|
const char * |
ppat |
|
) |
| |
Define special character pattern.
Function writes special character pattern to LCD.
- Parameters
-
| c | Character do define (only 3 lowest bits are significant) |
[in] | ppat | 8 bajts of character pattern in RAM |
- Attention
- Function resets actual cursor positon
void alcd_defineChar_P |
( |
char |
c, |
|
|
const __flash char * |
ppat |
|
) |
| |
Define special character pattern from program memory.
Function writes special character pattern to LCD.
- Parameters
-
| c | Character do define (only 3 lowest bits are significant) |
[in] | ppat | 8 bajts of character pattern in FLASH |
- Attention
- Function resets actual cursor positon
static void alcd_entryMode |
( |
uint8_t |
inc_dec, |
|
|
uint8_t |
shift |
|
) |
| |
|
inlinestatic |
Entry mode set.
Function sets entry mode. It means what display have to do when data is send.
- Parameters
-
inc_dec | Increment (!0) or decrement (0) current addres (in CGRAM or in DDRAM) |
shift | Shifts display when writting |
static char alcd_getc |
( |
void |
| ) |
|
|
inlinestatic |
Get a character.
Function reads a character on current cursor position.
- Returns
- ASCII code of the readed character
static void alcd_goto |
( |
uint8_t |
y, |
|
|
uint8_t |
x |
|
) |
| |
|
inlinestatic |
Move cursor to position.
Function sets cursor on selected position.
- Parameters
-
y | Row number in range from 0 to (ALCD_SY-1) |
x | Column number in range from 0 to (ALCD_SX-1) |
- Examples:
- base/main.c.
static void alcd_home |
( |
void |
| ) |
|
|
inlinestatic |
Moves cursor home.
Function generates command that moves cursor home and also resets any display shifts.
Initialize LCD.
Initializes LCD to work. Call it more than 15ms after voltage reaches 4.5V or more than 40ms after voltage reaches 2.7V.
It just sets the interface and line count. It leaves LCD off.
static void alcd_putc |
( |
char |
c | ) |
|
|
inlinestatic |
Put a character.
Function puts a character on current cursor position
- Parameters
-
c | ASCII code of the character to put |
- Examples:
- base/main.c.
void alcd_puts |
( |
const char * |
pstr | ) |
|
Put string.
Function puts string to display
- Parameters
-
[in] | pstr | Pointer to string in RAM |
void alcd_puts_P |
( |
const __flash char * |
pstr | ) |
|
Put string from program memory.
Function puts string from FLASH to display
- Parameters
-
[in] | pstr | Pointer to string in FLASH |
Function to read one character from LCD.
Function reads one byte from LCD. If ALCD_CANREAD is false function returns 0x20 (' ' - space character) constant value.
- Attention
- It is accessable here for optymalization reason. For future compatibility do not use it to read character from LCD. Use alcd_getc
- Returns
- Value readed from LCD.
void alcd_read |
( |
char * |
pstr, |
|
|
uint8_t |
size |
|
) |
| |
Read data block.
Function reads data from character memory of the display Function does not write null character on the end of the readed data.
- Parameters
-
[out] | pstr | Pointer to data buffer |
| size | of the block to read |
void alcd_readDefinedChar |
( |
char |
c, |
|
|
char * |
ppat |
|
) |
| |
Read defined character pattern.
Function reads special character pattern from LCD.
- Parameters
-
| c | Character do read |
[out] | ppat | 8 bajts buffor for the pattern |
- Attention
- Function resets actual cursor positon
static void alcd_shift |
( |
uint8_t |
right_left, |
|
|
uint8_t |
display_cursor |
|
) |
| |
|
inlinestatic |
Shift display or cursor by one position.
Function generates command that moves cursor or shifts whole display.
- Parameters
-
right_left | Moves/Shifts right(!0) or left (0) |
display_cursor | Moves/Shifts display (!0) or cursor (0) |
static void alcd_turnOnOff |
( |
uint8_t |
display, |
|
|
uint8_t |
cursor, |
|
|
uint8_t |
blink |
|
) |
| |
|
inlinestatic |
Turn on or off.
Function generates command that turns on or off elements given in parameters
- Parameters
-
display | Turn on (!0) or of (0) display |
cursor | Turn on (!0) or of (0) cursor |
blink | Turn on (!0) or of (0) blinking cursor |
- Examples:
- base/main.c.