Wrapper for HD44780 automatically taking care of custom CGRAM patterns and partial redraws to optimize response times
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hd44780-buf/src/main.c

29 lines
715 B

2 years ago
#include <stdio.h>
#include <stdint.h>
#include "lcdbuf.h"
int main()
{
struct LcdBuffer buf;
LcdBuffer_Init(&buf, CGROM_A00, CGRAM_CZ);
LcdBuffer_Write(&buf, 0, 0, "Ahoj");
LcdBuffer_Flush(&buf);
return 0;
}
/** Write character data at position */
void LcdBuffer_IO_WriteAt(uint8_t row, uint8_t col, const uint8_t *buf, uint8_t len)
{
printf("W@%d,%d: \"%.*s\" (len %d)\n", row, col, len, buf, len);
}
/** Write CGRAM data. Data is always 8 bytes long. */
void LcdBuffer_IO_WriteCGRAM(uint8_t position, const uint8_t *data)
{
printf("G@%d: %02x %02x %02x %02x %02x %02x %02x %02x\n",
position, data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]);
}