static const uint8_t Character_Set[] =
{
0b00000000, //
- 0b00000000, // !
+ 0b00000000, // ! (unused)
0b00100010, // "
0b01100011, // # (degree symbol, hash mark doesn't fit)
- 0b00000000, // $
- 0b00000000, // %
- 0b01000100, // &
+ 0b00000000, // $ (unused)
+ 0b00000000, // % (unused)
+ 0b01000100, // & ("lowercase 7" for positions 4 and 6)
0b00100000, // '
- 0b00000000, // (
- 0b00000000, // )
- 0b00000000, // *
- 0b11000000, // +
+ 0b00111001, // (
+ 0b00001111, // )
+ 0b00000000, // * (unused)
+ 0b11000000, // + (only works in position 0)
0b00000100, // ,
0b01000000, // -
- 0b01000000, // .
+ 0b01000000, // . (same as -, semantically most useful)
0b00010010, // /
0b00111111, // 0
0b00000110, // 1
0b00000111, // 7
0b01111111, // 8
0b01101111, // 9
- 0b00000000, // :
- 0b00000000, // ;
+ 0b00000000, // : (unused)
+ 0b00000000, // ; (unused)
0b01011000, // <
0b01001000, // =
0b01001100, // >
0b01010011, // ?
- 0b11111111, // @
+ 0b11111111, // @ (all segments on)
0b01110111, // A
0b01111111, // B
0b00111001, // C
0b01110110, // H
0b10001001, // I
0b00001110, // J
- 0b11101010, // K
+ 0b01110101, // K
0b00111000, // L
0b10110111, // M
0b00110111, // N
0b00111001, // [
0b00100100, // backslash
0b00001111, // ]
- 0b00100110, // ^
+ 0b00100011, // ^
0b00001000, // _
0b00000010, // `
0b01011111, // a
static const uint8_t Num_Chars = 10;
+static const uint32_t IndicatorSegments[6] = {
+ SLCD_SEGID(0, 17), // WATCH_INDICATOR_SENSING
+ SLCD_SEGID(0, 16), // WATCH_INDICATOR_BELL
+ SLCD_SEGID(2, 17), // WATCH_INDICATOR_PM
+ SLCD_SEGID(2, 16), // WATCH_INDICATOR_24H
+ SLCD_SEGID(1, 10), // WATCH_INDICATOR_LAP
+};
+
void watch_enable_display() {
SEGMENT_LCD_0_init();
slcd_sync_enable(&SEGMENT_LCD_0);
}
-void watch_set_pixel(uint8_t com, uint8_t seg) {
+inline void watch_set_pixel(uint8_t com, uint8_t seg) {
slcd_sync_seg_on(&SEGMENT_LCD_0, SLCD_SEGID(com, seg));
}
-void watch_clear_pixel(uint8_t com, uint8_t seg) {
+inline void watch_clear_pixel(uint8_t com, uint8_t seg) {
slcd_sync_seg_off(&SEGMENT_LCD_0, SLCD_SEGID(com, seg));
}
}
}
+inline void watch_set_colon() {
+ slcd_sync_seg_on(&SEGMENT_LCD_0, SLCD_SEGID(1, 16));
+}
+
+inline void watch_clear_colon() {
+ slcd_sync_seg_off(&SEGMENT_LCD_0, SLCD_SEGID(1, 16));
+}
+
+inline void watch_set_indicator(WatchIndicatorSegment indicator) {
+ slcd_sync_seg_on(&SEGMENT_LCD_0, IndicatorSegments[indicator]);
+}
+
+inline void watch_clear_indicator(WatchIndicatorSegment indicator) {
+ slcd_sync_seg_off(&SEGMENT_LCD_0, IndicatorSegments[indicator]);
+}
+
+void watch_clear_all_indicators() {
+ slcd_sync_seg_off(&SEGMENT_LCD_0, SLCD_SEGID(2, 17));
+ slcd_sync_seg_off(&SEGMENT_LCD_0, SLCD_SEGID(2, 16));
+ slcd_sync_seg_off(&SEGMENT_LCD_0, SLCD_SEGID(0, 17));
+ slcd_sync_seg_off(&SEGMENT_LCD_0, SLCD_SEGID(0, 16));
+ slcd_sync_seg_off(&SEGMENT_LCD_0, SLCD_SEGID(1, 10));
+}
+
+
//////////////////////////////////////////////////////////////////////////////////////////
// Buttons
* for displaying strings of characters and indicators on the main watch display.
*/
/// @{
+
+typedef enum WatchIndicatorSegment {
+ WATCH_INDICATOR_SENSING = 0,
+ WATCH_INDICATOR_BELL,
+ WATCH_INDICATOR_PM,
+ WATCH_INDICATOR_24H,
+ WATCH_INDICATOR_LAP
+} WatchIndicatorSegment;
+
/** @brief Enables the Segment LCD display.
* Call this before attempting to set pixels or display strings.
*/
/** @brief Clears a pixel. Use this to manually clear a pixel with a given common and segment number.
* @param com the common pin, numbered from 0-2.
* @param seg the segment pin, numbered from 0-23.
- * Use this to manually set a pixel with a common and a segment number.
*/
void watch_clear_pixel(uint8_t com, uint8_t seg);
position 0, positions 2-9 will retain whatever state they were previously displaying.
*/
void watch_display_string(char *string, uint8_t position);
+
+/** @brief Turns the colon segment on.
+ */
+void watch_set_colon();
+
+/** @brief Turns the colon segment off.
+ */
+void watch_clear_colon();
+
+/** @brief Sets an indicator on the LCD. Use this to turn on one of the indicator segments.
+ * @param indicator One of the indicator segments from the enum. @see WatchIndicatorSegment
+ */
+void watch_set_indicator(WatchIndicatorSegment indicator);
+
+/** @brief Clears an indicator on the LCD. Use this to turn off one of the indicator segments.
+ * @param indicator One of the indicator segments from the enum. @see WatchIndicatorSegment
+ */
+void watch_clear_indicator(WatchIndicatorSegment indicator);
+
+/** @brief Clears all indicator segments.
+ * @see WatchIndicatorSegment
+ */
+void watch_clear_all_indicators();
+
/// @}