summaryrefslogtreecommitdiffstats
path: root/watch-library/watch/watch_buzzer.h
diff options
context:
space:
mode:
authorJoey Castillo <jose.castillo@gmail.com>2021-08-29 17:40:44 -0400
committerJoey Castillo <jose.castillo@gmail.com>2021-08-29 17:40:44 -0400
commit6353d25d46979efed36c50ec186c8006f266d78a (patch)
tree37725afdd72ffb87f6e2965aaff122457b1f0738 /watch-library/watch/watch_buzzer.h
parent7dc4b0fdc60b6240515d6c4143a5310b343dc8a5 (diff)
downloadSensor-Watch-6353d25d46979efed36c50ec186c8006f266d78a.tar.gz
Sensor-Watch-6353d25d46979efed36c50ec186c8006f266d78a.tar.bz2
Sensor-Watch-6353d25d46979efed36c50ec186c8006f266d78a.zip
big PWM refactor: drive both LEDs and buzzer from TCC
Diffstat (limited to 'watch-library/watch/watch_buzzer.h')
-rw-r--r--watch-library/watch/watch_buzzer.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/watch-library/watch/watch_buzzer.h b/watch-library/watch/watch_buzzer.h
index 38b40f6e..995e059a 100644
--- a/watch-library/watch/watch_buzzer.h
+++ b/watch-library/watch/watch_buzzer.h
@@ -32,11 +32,17 @@
void watch_enable_buzzer();
/** @brief Sets the period of the buzzer.
- * @param period The period of a single cycle for the PWM peripheral. You can use the following formula to
- * convert a desired frequency to a period for this function: period = 513751 * (freq^−1.0043)
+ * @param period The period of a single cycle for the TCC peripheral. You can determine the period for
+ * a desired frequency with the following formula: period = 1000000 / freq
*/
void watch_set_buzzer_period(uint32_t period);
+/** @brief Disables the TCC peripheral that drives the buzzer.
+ * @note If you are using PWM to set custom LED colors, this method will also disable the LED PWM driver,
+ * since the buzzer and LED both make use of the same peripheral to drive their PWM behavior.
+ */
+void watch_disable_buzzer();
+
/** @brief Turns the buzzer output on. It will emit a continuous sound at the given frequency.
* @note The TCC peripheral that drives the buzzer does not run in standby mode; if you wish for buzzer
* output to continue, you should prevent your app from going to sleep.