]> git.earman.xyz Git - sensor-watch.git/commitdiff
add utility function to check if TCC is enabled
authorJoey Castillo <joeycastillo@utexas.edu>
Tue, 21 Dec 2021 16:01:33 +0000 (10:01 -0600)
committerJoey Castillo <joeycastillo@utexas.edu>
Tue, 21 Dec 2021 16:01:33 +0000 (10:01 -0600)
watch-library/watch/watch.c
watch-library/watch/watch.h

index 844ed3d9ffaf3ee2d4af9b6e42da25f677acfc8f..791fd974994abf46d9d52d99d881fef048d6d20d 100644 (file)
@@ -38,3 +38,7 @@ void SYSTEM_Handler(void) {
 bool watch_is_battery_low(void) {
     return battery_is_low;
 }
+
+bool watch_is_buzzer_or_led_enabled(void){
+    return hri_mclk_get_APBCMASK_TCC0_bit(MCLK);
+}
index 669a5ed176eddbf1772a2c3dc7eb8d80f7d6a424..064f90ecd13fc65c9be4fd7dd2e7c711f64d9dd5 100644 (file)
   */
 bool watch_is_battery_low(void);
 
+/** @brief Returns true if either the buzzer or the LED driver is enabled.
+  * @details Both the buzzer and the LED use the TCC peripheral to drive their behavior. This function returns true if that
+  *          peripheral is enabled. You can use this function to determine whether you need to call the watch_disable_leds or
+  *          or watch_enable_buzzer functions before using these peripherals.
+  */
+bool watch_is_buzzer_or_led_enabled(void);
+
 #endif /* WATCH_H_ */
\ No newline at end of file