diff options
author | Joey Castillo <jose.castillo@gmail.com> | 2021-10-01 17:09:05 -0400 |
---|---|---|
committer | Joey Castillo <jose.castillo@gmail.com> | 2021-10-01 20:53:32 -0400 |
commit | 84c0fbfa2a68dc3c29b989947567d111e70a037b (patch) | |
tree | fa68060b8a32b0450d58b50b571f0700c8280354 /watch-library/watch/watch_slcd.h | |
parent | 15ae7ab84b13953ec309a5823ade6ddb60f6a68c (diff) | |
download | Sensor-Watch-84c0fbfa2a68dc3c29b989947567d111e70a037b.tar.gz Sensor-Watch-84c0fbfa2a68dc3c29b989947567d111e70a037b.tar.bz2 Sensor-Watch-84c0fbfa2a68dc3c29b989947567d111e70a037b.zip |
slcd: add autonomous blinking and animation
Diffstat (limited to 'watch-library/watch/watch_slcd.h')
-rw-r--r-- | watch-library/watch/watch_slcd.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/watch-library/watch/watch_slcd.h b/watch-library/watch/watch_slcd.h index 4f5a617c..4e710936 100644 --- a/watch-library/watch/watch_slcd.h +++ b/watch-library/watch/watch_slcd.h @@ -103,5 +103,40 @@ void watch_clear_indicator(WatchIndicatorSegment indicator); */ void watch_clear_all_indicators(); +/** @brief Blinks a single character in position 7. Does not affect other positions. + * @details Six of the seven segments in position 7 (and only position 7) are capable of autonomous + * blinking. This blinking does not require any CPU resources, and will continue even in + * standby and shallow sleep mode (if the LCD remains on). + * @param character The character you wish to blink. + * @param duration The duration of the on/off cycle in milliseconds, from 50 to ~4250 ms. + * @note Segment B of position 7 cannot blink autonomously, so not all characters will work well. + * Supported characters for blinking: + * * Punctuation: underscore, apostrophe, comma, hyphen, equals sign, tilde (top segment only) + * * Numbers: 5, 6, ampersand (lowercase 7) + * * Letters: b, C, c, E, F, h, i, L, l, n, o, S, t + */ +void watch_start_character_blink(char character, uint32_t duration); + +/** @brief Stops and clears all blinking segments. + * @details This will stop all blinking in position 7, and clear all segments in that digit. + */ +void watch_stop_blink(); + +/** @brief Begins a two-segment "tick-tock" animation in position 8. + * @details Six of the seven segments in position 8 (and only position 8) are capable of autonomous + * animation. This animation is very basic, and consists of moving a bit pattern forward + * or backward in a shift register whose positions map to fixed segments on the LCD. Given + * this constraint, an animation across all six segments does not make sense; so the watch + * library offers only a simple "tick/tock" in segments D and E. This animation does not + * require any CPU resources, and will continue even in standby and shallow sleep mode + * (if the LCD remains on). + * @param duration The duration of each frame in ms. 500 milliseconds produces a classic tick/tock. + */ +void watch_start_tick_animation(uint32_t duration); + +/** @brief Stops the tick/tock animation and clears all animating segments. + * @details This will stop the animation and clear all segments in position 8. + */ +void watch_stop_tick_animation(); /// @} #endif |