slcd: add function to blank entire screen

This commit is contained in:
Joey Castillo 2021-10-03 18:48:55 -04:00
parent 95ea714d61
commit 8d5280a34f
2 changed files with 10 additions and 0 deletions

View File

@ -162,6 +162,12 @@ inline void watch_clear_pixel(uint8_t com, uint8_t seg) {
slcd_sync_seg_off(&SEGMENT_LCD_0, SLCD_SEGID(com, seg));
}
void watch_clear_display() {
SLCD->SDATAL0.reg = 0;
SLCD->SDATAL1.reg = 0;
SLCD->SDATAL2.reg = 0;
}
void watch_display_character(uint8_t character, uint8_t position) {
// handle lowercase 7 if needed
if (character == '7' && (position == 4 || position == 6)) character = '&';

View File

@ -69,6 +69,10 @@ void watch_set_pixel(uint8_t com, uint8_t seg);
*/
void watch_clear_pixel(uint8_t com, uint8_t seg);
/** @brief Clears all segments of the display, including incicators and the colon.
*/
void watch_clear_display();
/** @brief Displays a string at the given position, starting from the top left. There are ten digits.
A space in any position will clear that digit.
* @param string A null-terminated string.