Flexible character LCD library for AVR Microcontrollers
Collin J. Doering
b32954bdae
Adds ANSI escape parsing for DECTCEM escapes (hide/show cursor) as well as utility functions hideCursor and showCursor. To do this correctly, the state of the LCD needs to be remembered by sofware. Keep track of the state of the LCD using the 3 LSB of lcdState as follows: 0: Cursor blink 1: Cursor off/on 2: Display off/on In the future, the 5 MSB's may be used to store other data used for the remembering the state of the LCD. For example, the instruction INSTR_MOV_SHIFT and INSTR_ENTRY_SET; specifically: INSTR_MOV_SHIFT 3+1=4: Move cursor/shift display 3+2=5: Shift left/right INSTR_ENTRY_SET 3+3=6: decrement/increment cursor position 3+4=7: display shift off/on The LCD state information could then be read for the correct instruction using bit shifting. Note that this would require modifying the functions defined in this commit to do the appropriate bit shifting. Additionally, utility functions (that don't have associated ANSI escapes) have been defined: - blinkCursorOff - blinkCursorOn - displayOff - displayOn Note: care needs to be taken to check whether the display is actually on before sending data to it, as during testing the data will not show up after the display has been sent the display off instruction, and it will not write any incoming data to DDRAM. Whether it will accept other instructions besides writing to DDRAM is unknown but suspected to also not work. This issue still needs to be rectified after further testing. Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca> |
||
---|---|---|
.gitignore | ||
ansi_escapes.h | ||
doxygen.conf | ||
lcdLib.c | ||
lcdLib.h | ||
lcdLibConfig.h | ||
lcdOutput.c | ||
Makefile | ||
USART.c | ||
USART.h |