]> git.earman.xyz Git - sensor-watch.git/commitdiff
slcd: add function to blank entire screen
authorJoey Castillo <jose.castillo@gmail.com>
Sun, 3 Oct 2021 22:48:55 +0000 (18:48 -0400)
committerJoey Castillo <jose.castillo@gmail.com>
Sun, 3 Oct 2021 22:48:55 +0000 (18:48 -0400)
watch-library/watch/watch_slcd.c
watch-library/watch/watch_slcd.h

index ba9d12b25e6f04ffcacca6a89a771968c7b52fef..c1e24308eed9b9f788852613ec07821d94b745ff 100644 (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 = '&';
index 4f5a617c072a7806351c26e583210e2f8c7f2060..5a54b72e0501d4abafd8ed62c640fb512b9bd0e3 100644 (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.