Sensor Watch 0.0.2
A board replacement for the classic Casio F-91W wristwatch, powered by a Microchip SAM L22 microcontroller.
Loading...
Searching...
No Matches
Typedefs | Enumerations | Functions
Segment LCD Display

This section covers functions related to the Segment LCD display driver, which is responsible for displaying strings of characters and indicators on the main watch display. More...

Typedefs

typedef enum WatchIndicatorSegment WatchIndicatorSegment
 An enum listing the icons and indicators available on the watch.
 

Enumerations

enum  WatchIndicatorSegment {
  WATCH_INDICATOR_SIGNAL = 0 , WATCH_INDICATOR_BELL , WATCH_INDICATOR_PM , WATCH_INDICATOR_24H ,
  WATCH_INDICATOR_LAP
}
 An enum listing the icons and indicators available on the watch. More...
 

Functions

void watch_enable_display (void)
 Enables the Segment LCD display. Call this before attempting to set pixels or display strings.
 
void watch_set_pixel (uint8_t com, uint8_t seg)
 Sets a pixel. Use this to manually set a pixel with a given common and segment number. See segmap.html.
 
void watch_clear_pixel (uint8_t com, uint8_t seg)
 Clears a pixel. Use this to manually clear a pixel with a given common and segment number. See segmap.html.
 
void watch_clear_display (void)
 Clears all segments of the display, including incicators and the colon.
 
void watch_display_string (char *string, uint8_t position)
 Displays a string at the given position, starting from the top left. There are ten digits. A space in any position will clear that digit.
 
void watch_set_colon (void)
 Turns the colon segment on.
 
void watch_clear_colon (void)
 Turns the colon segment off.
 
void watch_set_indicator (WatchIndicatorSegment indicator)
 Sets an indicator on the LCD. Use this to turn on one of the indicator segments.
 
void watch_clear_indicator (WatchIndicatorSegment indicator)
 Clears an indicator on the LCD. Use this to turn off one of the indicator segments.
 
void watch_clear_all_indicators (void)
 Clears all indicator segments.
 
void watch_start_character_blink (char character, uint32_t duration)
 Blinks a single character in position 7. Does not affect other positions.
 
void watch_stop_blink (void)
 Stops and clears all blinking segments.
 
void watch_start_tick_animation (uint32_t duration)
 Begins a two-segment "tick-tock" animation in position 8.
 
bool watch_tick_animation_is_running (void)
 Checks if the tick animation is currently running.
 
void watch_stop_tick_animation (void)
 Stops the tick/tock animation and clears all animating segments.
 

Detailed Description

This section covers functions related to the Segment LCD display driver, which is responsible for displaying strings of characters and indicators on the main watch display.

The segment LCD controller consumes about 3 microamperes of power with no segments on, and about 4 microamperes with all segments on. There is also a slight power impact associated with updating the screen (about 1 microampere to update at 1 Hz). For the absolute lowest power operation, update the display only when its contents have changed, and disable the SLCD peripheral when the screen is not in use. For a map of all common and segment pins, see segmap.html. You can hover over any segment in that diagram to view the common and segment pins associated with each segment of the display.

Enumeration Type Documentation

◆ WatchIndicatorSegment

An enum listing the icons and indicators available on the watch.

Enumerator
WATCH_INDICATOR_SIGNAL 

The hourly signal indicator; also useful for indicating that sensors are on.

WATCH_INDICATOR_BELL 

The small bell indicating that an alarm is set.

WATCH_INDICATOR_PM 

The PM indicator, indicating that a time is in the afternoon.

WATCH_INDICATOR_24H 

The 24H indicator, indicating that the watch is in a 24-hour mode.

WATCH_INDICATOR_LAP 

The LAP indicator; the F-91W uses this in its stopwatch UI.

Function Documentation

◆ watch_clear_all_indicators()

void watch_clear_all_indicators ( void  )

Clears all indicator segments.

See also
WatchIndicatorSegment

◆ watch_clear_indicator()

void watch_clear_indicator ( WatchIndicatorSegment  indicator)

Clears an indicator on the LCD. Use this to turn off one of the indicator segments.

Parameters
indicatorOne of the indicator segments from the enum.
See also
WatchIndicatorSegment

◆ watch_clear_pixel()

void watch_clear_pixel ( uint8_t  com,
uint8_t  seg 
)

Clears a pixel. Use this to manually clear a pixel with a given common and segment number. See segmap.html.

Parameters
comthe common pin, numbered from 0-2.
segthe segment pin, numbered from 0-23.

◆ watch_display_string()

void watch_display_string ( char *  string,
uint8_t  position 
)

Displays a string at the given position, starting from the top left. There are ten digits. A space in any position will clear that digit.

Parameters
stringA null-terminated string.
positionThe position where you wish to start displaying the string. The day of week digits are positions 0 and 1; the day of month digits are positions 2 and 3, and the main clock line occupies positions 4-9.
Note
This method does not clear the display; if for example you display a two-character string at position 0, positions 2-9 will retain whatever state they were previously displaying.

◆ watch_set_indicator()

void watch_set_indicator ( WatchIndicatorSegment  indicator)

Sets an indicator on the LCD. Use this to turn on one of the indicator segments.

Parameters
indicatorOne of the indicator segments from the enum.
See also
WatchIndicatorSegment

◆ watch_set_pixel()

void watch_set_pixel ( uint8_t  com,
uint8_t  seg 
)

Sets a pixel. Use this to manually set a pixel with a given common and segment number. See segmap.html.

Parameters
comthe common pin, numbered from 0-2.
segthe segment pin, numbered from 0-23.

◆ watch_start_character_blink()

void watch_start_character_blink ( char  character,
uint32_t  duration 
)

Blinks a single character in position 7. Does not affect other positions.

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 Sleep mode (but not Deep Sleep mode, since that mode turns off the LCD).

Parameters
characterThe character you wish to blink.
durationThe 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

◆ watch_start_tick_animation()

void watch_start_tick_animation ( uint32_t  duration)

Begins a two-segment "tick-tock" animation in position 8.

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 Sleep mode (but not Deep Sleep mode, since that mode turns off the LCD).

Parameters
durationThe duration of each frame in ms. 500 milliseconds produces a classic tick/tock.

◆ watch_stop_blink()

void watch_stop_blink ( void  )

Stops and clears all blinking segments.

This will stop all blinking in position 7, and clear all segments in that digit.

◆ watch_stop_tick_animation()

void watch_stop_tick_animation ( void  )

Stops the tick/tock animation and clears all animating segments.

This will stop the animation and clear all segments in position 8.

◆ watch_tick_animation_is_running()

bool watch_tick_animation_is_running ( void  )

Checks if the tick animation is currently running.

Returns
true if the animation is running; false otherwise.