1
0
mirror of https://github.com/cclassic/hcs12ss59t synced 2024-11-21 18:05:05 +01:00

Add function to write to CGRAM

This commit is contained in:
Markus Koch 2018-01-13 11:51:07 +01:00
parent 1739d5b3ae
commit 75d2cc7955
2 changed files with 21 additions and 0 deletions

View File

@ -126,6 +126,26 @@ void hcs12ss59t_set_buffer(char *data)
HCS12SS59T_DESELECT;
}
/**
* @brief hcs12ss59t_set_character set user configurable characters
* @param addr character number (0 - 15)
* @param data data array, 2 bytes per character
* @param nchar Amount of characters to update (auto increment)
*/
void hcs12ss59t_set_character(int addr, char *data, int nchar)
{
char *ptr;
nchar = nchar * 2;
HCS12SS59T_SELECT;
hcs12ss59t_send_byte(HCS12SS59T_CGRAM_WR | (addr & 0x0f));
for (ptr = data; ptr < data + nchar; ++ptr) {
hcs12ss59t_send_byte(*ptr);
}
HCS12SS59T_DESELECT;
}
/**
* @brief hcs12ss59t_set_lights Set the display mode to on, off or test
* @param lights value, use constants HCS12SS59T_LI*

View File

@ -52,6 +52,7 @@ void hcs12ss59t_set_text(char *text);
void hcs12ss59t_set_buffer(char *data);
void hcs12ss59t_set_brightness(char brightness);
void hcs12ss59t_set_lights(char lights);
void hcs12ss59t_set_character(int addr, char *data, int nchar);
/* Low level functions */
void hcs12ss59t_send_byte(char c);