slcd: add autonomous blinking and animation

This commit is contained in:
Joey Castillo
2021-10-01 17:09:05 -04:00
parent 15ae7ab84b
commit 84c0fbfa2a
3 changed files with 86 additions and 2 deletions

View File

@@ -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