From fabc6d28eaf6e0227c68673d3c564c31f4c01a17 Mon Sep 17 00:00:00 2001 From: joeycastillo Date: Tue, 25 Jan 2022 20:03:52 +0000 Subject: deploy: b8de35658ffd78ad8b22f91ccbbd3d63663afda9 --- annotated.html | 81 ----- classes.html | 82 ----- dir_9dad893af07e666757bee97778571595.html | 86 ----- dir_f1a087a6659d970f5756e21fc1ac4961.html | 84 ----- files.html | 97 ------ globals.html | 80 ----- globals_func.html | 80 ----- group__adc.html | 354 ------------------- group__app.html | 208 ----------- group__buttons.html | 178 ---------- group__buzzer.html | 559 ------------------------------ group__debug.html | 122 ------- group__deepsleep.html | 325 ----------------- group__gpio.html | 332 ------------------ group__i2c.html | 404 --------------------- group__led.html | 260 -------------- group__rtc.html | 431 ----------------------- group__slcd.html | 541 ----------------------------- group__utility.html | 396 --------------------- index.html | 20 +- menudata.js | 11 +- modules.html | 92 ----- search/all_0.html | 37 -- search/all_0.js | 5 - search/all_1.html | 37 -- search/all_1.js | 11 - search/all_2.html | 37 -- search/all_2.js | 94 ----- search/all_3.html | 37 -- search/all_3.js | 5 - search/all_4.html | 37 -- search/all_4.js | 4 - search/all_5.html | 37 -- search/all_5.js | 4 - search/all_6.html | 37 -- search/all_6.js | 4 - search/all_7.html | 37 -- search/all_7.js | 4 - search/all_8.html | 37 -- search/all_8.js | 6 - search/all_9.html | 37 -- search/all_9.js | 4 - search/all_a.html | 37 -- search/all_a.js | 93 ----- search/classes_0.html | 37 -- search/classes_0.js | 4 - search/enums_0.html | 37 -- search/enums_0.js | 4 - search/enums_1.html | 37 -- search/enums_1.js | 5 - search/enumvalues_0.html | 37 -- search/enumvalues_0.js | 91 ----- search/enumvalues_1.html | 37 -- search/enumvalues_1.js | 8 - search/files_0.html | 37 -- search/files_0.js | 4 - search/functions_0.html | 37 -- search/functions_0.js | 5 - search/functions_1.html | 37 -- search/functions_1.js | 9 - search/functions_2.html | 37 -- search/functions_2.js | 84 ----- search/groups_0.html | 37 -- search/groups_0.js | 5 - search/groups_1.html | 37 -- search/groups_1.js | 5 - search/groups_2.html | 37 -- search/groups_2.js | 5 - search/groups_3.html | 37 -- search/groups_3.js | 4 - search/groups_4.html | 37 -- search/groups_4.js | 4 - search/groups_5.html | 37 -- search/groups_5.js | 4 - search/groups_6.html | 37 -- search/groups_6.js | 5 - search/groups_7.html | 37 -- search/groups_7.js | 4 - search/pages_0.html | 37 -- search/pages_0.js | 4 - search/searchdata.js | 30 -- search/typedefs_0.html | 37 -- search/typedefs_0.js | 4 - search/typedefs_1.html | 37 -- search/typedefs_1.js | 5 - search/variables_0.html | 37 -- search/variables_0.js | 4 - tusb__config_8h_source.html | 171 --------- unionwatch__date__time.html | 110 ------ watch_8h.html | 152 -------- watch_8h_source.html | 131 ------- watch__adc_8h_source.html | 146 -------- watch__app_8h_source.html | 126 ------- watch__buzzer_8h_source.html | 312 ----------------- watch__deepsleep_8h_source.html | 142 -------- watch__extint_8h_source.html | 134 ------- watch__gpio_8h_source.html | 134 ------- watch__i2c_8h_source.html | 138 -------- watch__led_8h_source.html | 137 -------- watch__private_8h_source.html | 126 ------- watch__rtc_8h_source.html | 174 ---------- watch__slcd_8h_source.html | 169 --------- watch__uart_8h_source.html | 120 ------- watch__utility_8h_source.html | 131 ------- 104 files changed, 4 insertions(+), 9087 deletions(-) delete mode 100644 annotated.html delete mode 100644 classes.html delete mode 100644 dir_9dad893af07e666757bee97778571595.html delete mode 100644 dir_f1a087a6659d970f5756e21fc1ac4961.html delete mode 100644 files.html delete mode 100644 globals.html delete mode 100644 globals_func.html delete mode 100644 group__adc.html delete mode 100644 group__app.html delete mode 100644 group__buttons.html delete mode 100644 group__buzzer.html delete mode 100644 group__debug.html delete mode 100644 group__deepsleep.html delete mode 100644 group__gpio.html delete mode 100644 group__i2c.html delete mode 100644 group__led.html delete mode 100644 group__rtc.html delete mode 100644 group__slcd.html delete mode 100644 group__utility.html delete mode 100644 modules.html delete mode 100644 search/all_0.html delete mode 100644 search/all_0.js delete mode 100644 search/all_1.html delete mode 100644 search/all_1.js delete mode 100644 search/all_2.html delete mode 100644 search/all_2.js delete mode 100644 search/all_3.html delete mode 100644 search/all_3.js delete mode 100644 search/all_4.html delete mode 100644 search/all_4.js delete mode 100644 search/all_5.html delete mode 100644 search/all_5.js delete mode 100644 search/all_6.html delete mode 100644 search/all_6.js delete mode 100644 search/all_7.html delete mode 100644 search/all_7.js delete mode 100644 search/all_8.html delete mode 100644 search/all_8.js delete mode 100644 search/all_9.html delete mode 100644 search/all_9.js delete mode 100644 search/all_a.html delete mode 100644 search/all_a.js delete mode 100644 search/classes_0.html delete mode 100644 search/classes_0.js delete mode 100644 search/enums_0.html delete mode 100644 search/enums_0.js delete mode 100644 search/enums_1.html delete mode 100644 search/enums_1.js delete mode 100644 search/enumvalues_0.html delete mode 100644 search/enumvalues_0.js delete mode 100644 search/enumvalues_1.html delete mode 100644 search/enumvalues_1.js delete mode 100644 search/files_0.html delete mode 100644 search/files_0.js delete mode 100644 search/functions_0.html delete mode 100644 search/functions_0.js delete mode 100644 search/functions_1.html delete mode 100644 search/functions_1.js delete mode 100644 search/functions_2.html delete mode 100644 search/functions_2.js delete mode 100644 search/groups_0.html delete mode 100644 search/groups_0.js delete mode 100644 search/groups_1.html delete mode 100644 search/groups_1.js delete mode 100644 search/groups_2.html delete mode 100644 search/groups_2.js delete mode 100644 search/groups_3.html delete mode 100644 search/groups_3.js delete mode 100644 search/groups_4.html delete mode 100644 search/groups_4.js delete mode 100644 search/groups_5.html delete mode 100644 search/groups_5.js delete mode 100644 search/groups_6.html delete mode 100644 search/groups_6.js delete mode 100644 search/groups_7.html delete mode 100644 search/groups_7.js delete mode 100644 search/pages_0.html delete mode 100644 search/pages_0.js delete mode 100644 search/typedefs_0.html delete mode 100644 search/typedefs_0.js delete mode 100644 search/typedefs_1.html delete mode 100644 search/typedefs_1.js delete mode 100644 search/variables_0.html delete mode 100644 search/variables_0.js delete mode 100644 tusb__config_8h_source.html delete mode 100644 unionwatch__date__time.html delete mode 100644 watch_8h.html delete mode 100644 watch_8h_source.html delete mode 100644 watch__adc_8h_source.html delete mode 100644 watch__app_8h_source.html delete mode 100644 watch__buzzer_8h_source.html delete mode 100644 watch__deepsleep_8h_source.html delete mode 100644 watch__extint_8h_source.html delete mode 100644 watch__gpio_8h_source.html delete mode 100644 watch__i2c_8h_source.html delete mode 100644 watch__led_8h_source.html delete mode 100644 watch__private_8h_source.html delete mode 100644 watch__rtc_8h_source.html delete mode 100644 watch__slcd_8h_source.html delete mode 100644 watch__uart_8h_source.html delete mode 100644 watch__utility_8h_source.html diff --git a/annotated.html b/annotated.html deleted file mode 100644 index db844a91..00000000 --- a/annotated.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - -Sensor Watch: Data Structures - - - - - - - - - -
-
- - - - - - -
-
Sensor Watch -  0.0.0 -
-
A board replacement for the classic Casio F-91W wristwatch, powered by a Microchip SAM L22 microcontroller.
-
-
- - - - - - - -
- -
-
- - -
- -
- -
-
-
Data Structures
-
-
-
Here are the data structures with brief descriptions:
- - -
 Cwatch_date_time
-
-
- - - - diff --git a/classes.html b/classes.html deleted file mode 100644 index 211762b3..00000000 --- a/classes.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - -Sensor Watch: Data Structure Index - - - - - - - - - -
-
- - - - - - -
-
Sensor Watch -  0.0.0 -
-
A board replacement for the classic Casio F-91W wristwatch, powered by a Microchip SAM L22 microcontroller.
-
-
- - - - - - - -
- -
-
- - -
- -
- -
-
-
Data Structure Index
-
-
- - -
- - - - diff --git a/dir_9dad893af07e666757bee97778571595.html b/dir_9dad893af07e666757bee97778571595.html deleted file mode 100644 index b4576c7a..00000000 --- a/dir_9dad893af07e666757bee97778571595.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - -Sensor Watch: watch-library/watch Directory Reference - - - - - - - - - -
-
- - - - - - -
-
Sensor Watch -  0.0.0 -
-
A board replacement for the classic Casio F-91W wristwatch, powered by a Microchip SAM L22 microcontroller.
-
-
- - - - - - - - -
-
- - -
- -
- - -
-
-
-
watch Directory Reference
-
-
- - - - -

-Files

file  watch.h [code]
 
-
- - - - diff --git a/dir_f1a087a6659d970f5756e21fc1ac4961.html b/dir_f1a087a6659d970f5756e21fc1ac4961.html deleted file mode 100644 index e68ac90c..00000000 --- a/dir_f1a087a6659d970f5756e21fc1ac4961.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - -Sensor Watch: watch-library Directory Reference - - - - - - - - - -
-
- - - - - - -
-
Sensor Watch -  0.0.0 -
-
A board replacement for the classic Casio F-91W wristwatch, powered by a Microchip SAM L22 microcontroller.
-
-
- - - - - - - - -
-
- - -
- -
- - -
-
-
-
watch-library Directory Reference
-
-
- - -

-Directories

-
- - - - diff --git a/files.html b/files.html deleted file mode 100644 index d3f4bc91..00000000 --- a/files.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - -Sensor Watch: File List - - - - - - - - - -
-
- - - - - - -
-
Sensor Watch -  0.0.0 -
-
A board replacement for the classic Casio F-91W wristwatch, powered by a Microchip SAM L22 microcontroller.
-
-
- - - - - - - -
- -
-
- - -
- -
- -
-
-
File List
-
-
-
Here is a list of all documented files with brief descriptions:
-
[detail level 123]
- - - - - - - - - - - - - - - - - -
  watch-library
  watch
 tusb_config.h
 watch.h
 watch_adc.h
 watch_app.h
 watch_buzzer.h
 watch_deepsleep.h
 watch_extint.h
 watch_gpio.h
 watch_i2c.h
 watch_led.h
 watch_private.h
 watch_rtc.h
 watch_slcd.h
 watch_uart.h
 watch_utility.h
-
-
- - - - diff --git a/globals.html b/globals.html deleted file mode 100644 index 41992148..00000000 --- a/globals.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - -Sensor Watch: Globals - - - - - - - - - -
-
- - - - - - -
-
Sensor Watch -  0.0.0 -
-
A board replacement for the classic Casio F-91W wristwatch, powered by a Microchip SAM L22 microcontroller.
-
-
- - - - - - - -
- -
-
- - -
- -
- -
-
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:
-
- - - - diff --git a/globals_func.html b/globals_func.html deleted file mode 100644 index 0e65ee51..00000000 --- a/globals_func.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - -Sensor Watch: Globals - - - - - - - - - -
-
- - - - - - -
-
Sensor Watch -  0.0.0 -
-
A board replacement for the classic Casio F-91W wristwatch, powered by a Microchip SAM L22 microcontroller.
-
-
- - - - - - - -
- -
-
- - -
- -
- -
-
- - - - diff --git a/group__adc.html b/group__adc.html deleted file mode 100644 index 4718ef4a..00000000 --- a/group__adc.html +++ /dev/null @@ -1,354 +0,0 @@ - - - - - - - -Sensor Watch: Analog Input - - - - - - - - - -
-
- - - - - - -
-
Sensor Watch -  0.0.0 -
-
A board replacement for the classic Casio F-91W wristwatch, powered by a Microchip SAM L22 microcontroller.
-
-
- - - - - - - -
- -
-
- - -
- -
- -
- -
-
Analog Input
-
-
- -

This section covers functions related to the SAM L22's analog-to-digital converter, as well as configuring and reading values from the five analog-capable pins on the 9-pin connector. -More...

- - - - -

-Enumerations

enum  watch_adc_reference_voltage { ADC_REFERENCE_INTREF = ADC_REFCTRL_REFSEL_INTREF_Val -, ADC_REFERENCE_VCC_DIV1POINT6 = ADC_REFCTRL_REFSEL_INTVCC0_Val -, ADC_REFERENCE_VCC_DIV2 = ADC_REFCTRL_REFSEL_INTVCC1_Val -, ADC_REFERENCE_VCC = ADC_REFCTRL_REFSEL_INTVCC2_Val - }
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Functions

-void watch_enable_adc (void)
 Enables the ADC peripheral. You must call this before attempting to read a value from an analog pin.
 
void watch_enable_analog_input (const uint8_t pin)
 Configures the selected pin for analog input. More...
 
uint16_t watch_get_analog_pin_level (const uint8_t pin)
 Reads an analog value from one of the pins. More...
 
void watch_set_analog_num_samples (uint16_t samples)
 Sets the number of samples to accumulate when measuring a pin level. Default is 16. More...
 
void watch_set_analog_sampling_length (uint8_t cycles)
 Sets the length of time spent sampling, which allows measurement of higher impedance inputs. Default is 1. More...
 
void watch_set_analog_reference_voltage (watch_adc_reference_voltage reference)
 Selects the reference voltage to use for analog readings. Default is ADC_REFERENCE_VCC. More...
 
uint16_t watch_get_vcc_voltage (void)
 Returns the voltage of the VCC supply in millivolts (i.e. 3000 mV == 3.0 V). If running on a coin cell, this will be the battery voltage. More...
 
void watch_disable_analog_input (const uint8_t pin)
 Disables the analog circuitry on the selected pin. More...
 
void watch_disable_adc (void)
 Disables the ADC peripheral. More...
 
-

Detailed Description

-

This section covers functions related to the SAM L22's analog-to-digital converter, as well as configuring and reading values from the five analog-capable pins on the 9-pin connector.

-

Function Documentation

- -

◆ watch_disable_adc()

- -
-
- - - - - -
- - - - - - - - -
void watch_disable_adc (void )
-
-inline
-
- -

Disables the ADC peripheral.

-
Note
You will need to call watch_enable_adc to re-enable the ADC peripheral. When you do, it will have the default settings of 16 samples and 1 measurement cycle; if you customized these parameters, you will need to set them up again.
- -
-
- -

◆ watch_disable_analog_input()

- -
-
- - - - - -
- - - - - - - - -
void watch_disable_analog_input (const uint8_t pin)
-
-inline
-
- -

Disables the analog circuitry on the selected pin.

-
Parameters
- - -
pinOne of pins A0-A4.
-
-
- -
-
- -

◆ watch_enable_analog_input()

- -
-
- - - - - - - - -
void watch_enable_analog_input (const uint8_t pin)
-
- -

Configures the selected pin for analog input.

-
Parameters
- - -
pinOne of pins A0-A4.
-
-
- -
-
- -

◆ watch_get_analog_pin_level()

- -
-
- - - - - - - - -
uint16_t watch_get_analog_pin_level (const uint8_t pin)
-
- -

Reads an analog value from one of the pins.

-
Parameters
- - -
pinOne of pins A0-A4.
-
-
-
Returns
a 16-bit unsigned integer from 0-65535 representing the sampled value, unless you have changed the number of samples.
-
See also
watch_set_num_analog_samples for details on how that function changes the values returned from this one.
- -
-
- -

◆ watch_get_vcc_voltage()

- -
-
- - - - - - - - -
uint16_t watch_get_vcc_voltage (void )
-
- -

Returns the voltage of the VCC supply in millivolts (i.e. 3000 mV == 3.0 V). If running on a coin cell, this will be the battery voltage.

-

Unlike other ADC functions, this function does not return a raw value from the ADC, but rather scales it to an actual number of millivolts. This is because the ADC doesn't let us measure VCC per se; it instead lets us measure VCC / 4, and we choose to measure it against the internal reference voltage of 1.024 V. In short, the ADC gives us a number that's complicated to deal with, so we just turn it into a useful number for you :)

Note
This function depends on INTREF being 1.024V. If you have changed it by poking at the supply controller's VREF.SEL bits, this function will return inaccurate values.
- -
-
- -

◆ watch_set_analog_num_samples()

- -
-
- - - - - - - - -
void watch_set_analog_num_samples (uint16_t samples)
-
- -

Sets the number of samples to accumulate when measuring a pin level. Default is 16.

-
Parameters
- - -
samplesA power of 2 <= 1024. Specifically: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512 or 1024. Any other value will be ignored.
-
-
-

The SAM L22's ADC has a resolution of 12 bits. By default, the watch configures the ADC to take 16 samples of the analog input and accumulate them in the result register; this effectively gives us a 16-bit resolution, at the cost of taking 16 ADC cycles to complete a measurement. If you are measuring a slowly changing signal like a thermistor output or an ambient light sensor this is probably fine, even desirable. If you are measuring something a bit more fast-paced, like an analog accelerometer, you may wish to exchange precision for speed. In this case you may call this function to configure the ADC to accumulate fewer samples. HOWEVER! Note that this may change the range of values returned from watch_get_analog_pin_level:

    -
  • For watch_set_num_analog_samples(1), the returned value will be 12 bits (0-4095).
  • -
  • For watch_set_num_analog_samples(2), the returned value will be 13 bits (0-8191).
  • -
  • For watch_set_num_analog_samples(4), the returned value will be 14 bits (0-16383).
  • -
  • For watch_set_num_analog_samples(8), the returned value will be 15 bits (0-32767). For sampling values over 16, the returned value will still be 16 bits (0-65535); the ADC will automatically divide the measured value by whatever factor is necessary to fit the result in 16 bits.
    See also
    watch_get_analog_pin_level
    -
  • -
- -
-
- -

◆ watch_set_analog_reference_voltage()

- -
-
- - - - - - - - -
void watch_set_analog_reference_voltage (watch_adc_reference_voltage reference)
-
- -

Selects the reference voltage to use for analog readings. Default is ADC_REFERENCE_VCC.

-
Parameters
- - -
referenceOne of ADC_REFERENCE_VCC, ADC_REFERENCE_VCC_DIV1POINT6, ADC_REFERENCE_VCC_DIV2 or ADC_REFERENCE_INTREF.
-
-
-

In order to turn an analog voltage into a 16-bit integer, the ADC needs to compare the measured voltage to a reference point. For example, if you were powering the watch with VCC == 3.0V and you had two 10K resistors connected in series from 3V to GND, you could expect to get 3 volts when you measure the top of the voltage divider, 0 volts at the bottom, and 1.5 volts in the middle. If you read these values uising a reference voltage of ADC_REFERENCE_VCC, the top value would be about 65535, the bottom about 0, and the middle about 32768. However! If we used ADC_REFERENCE_VCC_DIV2 as our reference, we would expect to get 65535 both at the top and the middle, because the largest value the ADC can measure in this configutation is 1.5V (VCC / 2).

-

By changing the reference voltage from ADC_REFERENCE_VCC to ADC_REFERENCE_VCC_DIV1POINT6 or ADC_REFERENCE_VCC_DIV2, you can get more resolution when measuring small voltages (i.e. a phototransistor circuit in low light).

-

There is also a special reference voltage called ADC_REFERENCE_INTREF. The SAM L22's Supply Controller provides a selectable voltage reference (by default, 1.024 V) that you can select as a reference voltage for ADC conversions. Unlike the three references we talked about in the last paragraph, this reference voltage does not depend on VCC, which makes it very useful for measuring the battery voltage (since you can't really compare VCC to itself). You can change the INTREF voltage to 2.048 or 4.096 V by poking at the supply controller's VREF register, but the watch library does not support this use case.

- -
-
- -

◆ watch_set_analog_sampling_length()

- -
-
- - - - - - - - -
void watch_set_analog_sampling_length (uint8_t cycles)
-
- -

Sets the length of time spent sampling, which allows measurement of higher impedance inputs. Default is 1.

-
Parameters
- - -
cyclesThe number of ADC cycles to sample, between 1 and 64.
-
-
-
See also
this article by Thea Flowers: https://blog.thea.codes/getting-the-most-out-of-the-samd21-adc/ which is where I learned all of this.
-

To measure an analog value, the SAM L22 must charge a capacitor to the analog voltage presented at the input. This takes time. Importantly, the higher the input impedance, the more time this takes. As a basic example: if you are using a thermistor tied to VCC to measure temperature, the capacitor has to charge through the thermistor. The higher the resistor value, the higher the input impedance, and the more time we need to allow for the measurement. By default, the ADC is configured to run on a 500 kHz clock with a sample time of one cycle. This is appropriate for an input impedance up to about 28kΩ. Setting the sampling time to 4 cycles allows for an input impedance up to 123kΩ. Setting the sampling time to the maximum of 64 cycles theoretically allows for input impedance up to 2 MΩ. (I based these numbers on the calculator in the linked blog post; it also has a ton of great info on the SAM D21 ADC, which is similar to the SAM L22's).

- -
-
-
- - - - diff --git a/group__app.html b/group__app.html deleted file mode 100644 index a2cea10c..00000000 --- a/group__app.html +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - - -Sensor Watch: Application Framework - - - - - - - - - -
-
- - - - - - -
-
Sensor Watch -  0.0.0 -
-
A board replacement for the classic Casio F-91W wristwatch, powered by a Microchip SAM L22 microcontroller.
-
-
- - - - - - - -
- -
-
- - -
- -
- -
- -
-
Application Framework
-
-
- -

This section covers the functions that you will implement in your app.c file when designing a Sensor Watch app. -More...

- - - - - - - - - - - - - - - - - - - - -

-Functions

-void app_init (void)
 A function you will implement to initialize your application state. The app_init function is called before anything else. Use it to set up any internal data structures or application state required by your app, but don't configure any peripherals just yet.
 
-void app_wake_from_backup (void)
 A function you will implement to wake from BACKUP mode, which wipes the system's RAM, and with it, your application's state. You may have chosen to store some important application state in the RTC's backup registers prior to entering this mode. You may restore that state here.
 
void app_setup (void)
 A function you will implement to set up your application. The app_setup function is like setup() in Arduino. It is called once when the program begins. You should set pin modes and enable any peripherals you want to set up (real-time clock, I2C, etc.) Depending on your application, you may or may not want to configure sensors on your sensor board here. For example, a low-power accelerometer that will run at all times should be configured here, whereas you may want to enable a more power-hungry sensor only when you need it. More...
 
bool app_loop (void)
 A function you will implement to serve as the app's main run loop. This method will be called repeatedly, or if you enter STANDBY mode, as soon as the device wakes from sleep. More...
 
void app_prepare_for_standby (void)
 A function you will implement to prepare to enter STANDBY mode. The app_prepare_for_standby function is called after your app_loop function returns true, and just before the watch enters STANDBY mode. In this mode most peripherals are shut down, and no code will run until the watch receives an interrupt (generally either the 1Hz tick or a press on one of the buttons). More...
 
-void app_wake_from_standby (void)
 A method you will implement to configure the app after waking from STANDBY mode.
 
-

Detailed Description

-

This section covers the functions that you will implement in your app.c file when designing a Sensor Watch app.

-

You should be able to write a watch app by simply implementing these functions and declaring callbacks for various GPIO and peripheral interrupts. The main.c file takes care of calling these functions for you. The general flow:

-
    -
  1. Your app_init() function is called.
      -
    • This method should only be used to set your initial application state.
    • -
    -
  2. -
  3. If your app is waking from BACKUP, app_wake_from_backup() is called.
      -
    • If you saved state in the RTC's backup registers, you can restore it here.
    • -
    -
  4. -
  5. Your app_setup() method is called.
      -
    • You may wish to enable some functionality and peripherals here.
    • -
    • You should definitely set up some interrupts here.
    • -
    -
  6. -
  7. The main run loop begins: your app_loop() function is called.
      -
    • Run code and update your UI here.
    • -
    • Return true if your app is prepared to enter STANDBY mode.
    • -
    -
  8. -
  9. This step differs depending on the value returned by app_loop:
      -
    • If you returned false, execution resumes at (4).
    • -
    • If you returned true, app_prepare_for_standby() is called; execution moves on to (6).
    • -
    -
  10. -
  11. The microcontroller enters STANDBY mode.
      -
    • No user code will run, and the watch will enter a low power mode.
    • -
    • The watch will remain in this state until an interrupt wakes it.
    • -
    -
  12. -
  13. Once woken from STANDBY, your app_wake_from_standby() function is called.
      -
    • After this, execution resumes at (4).
    • -
    -
  14. -
-

Function Documentation

- -

◆ app_loop()

- -
-
- - - - - - - - -
bool app_loop (void )
-
- -

A function you will implement to serve as the app's main run loop. This method will be called repeatedly, or if you enter STANDBY mode, as soon as the device wakes from sleep.

-
Returns
You should return true if your app is prepared to enter STANDBY mode. If you return false, your app's app_loop method will be called again immediately. Note that in STANDBY mode, the watch will consume only about 95 microamperes of power, whereas if you return false and keep the app awake, it will consume about 355 microamperes. This is the difference between months of battery life and days. As much as possible, you should limit the amount of time your app spends awake.
-
Note
Only the RTC, the segment LCD controller and the external interrupt controller run in STANDBY mode. If you are using, e.g. the PWM function to set a custom LED color, you should return false here until you are finished with that operation. Note however that the peripherals will continue running after waking up, so e.g. the I2C controller, if configured, will sleep in STANDBY. But you can use it again as soon as your app wakes up.
- -
-
- -

◆ app_prepare_for_standby()

- -
-
- - - - - - - - -
void app_prepare_for_standby (void )
-
- -

A function you will implement to prepare to enter STANDBY mode. The app_prepare_for_standby function is called after your app_loop function returns true, and just before the watch enters STANDBY mode. In this mode most peripherals are shut down, and no code will run until the watch receives an interrupt (generally either the 1Hz tick or a press on one of the buttons).

-
Note
If you are PWM'ing the LED or playing a sound on the buzzer, the TC/TCC peripherals that drive those operations will not run in STANDBY. BUT! the output pins will retain the state they had when entering standby. This means you could end up entering standby with an LED on and draining power, or with a DC potential across the piezo buzzer that could damage it if left in this state. If your app_loop does not prevent sleep during these activities, you should make sure to disable these outputs in app_prepare_for_standby.
- -
-
- -

◆ app_setup()

- -
-
- - - - - - - - -
void app_setup (void )
-
- -

A function you will implement to set up your application. The app_setup function is like setup() in Arduino. It is called once when the program begins. You should set pin modes and enable any peripherals you want to set up (real-time clock, I2C, etc.) Depending on your application, you may or may not want to configure sensors on your sensor board here. For example, a low-power accelerometer that will run at all times should be configured here, whereas you may want to enable a more power-hungry sensor only when you need it.

-
Note
If your app enters the ultra-low power BACKUP sleep mode, this function will be called again when it wakes from that deep sleep state. In this state, the RTC will still be configured with the correct date and time.
- -
-
-
- - - - diff --git a/group__buttons.html b/group__buttons.html deleted file mode 100644 index 0a9633fb..00000000 --- a/group__buttons.html +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - - -Sensor Watch: Buttons & External Interrupts - - - - - - - - - -
-
- - - - - - -
-
Sensor Watch -  0.0.0 -
-
A board replacement for the classic Casio F-91W wristwatch, powered by a Microchip SAM L22 microcontroller.
-
-
- - - - - - - -
- -
-
- - -
- -
- -
- -
-
Buttons & External Interrupts
-
-
- -

This section covers functions related to the three buttons: Light, Mode and Alarm, as well as external interrupts from devices on the nine-pin connector. -More...

- - - - - -

-Typedefs

-typedef enum watch_interrupt_trigger watch_interrupt_trigger
 An enum defining the types of interrupt trigger you wish to scan for.
 
- - - - -

-Enumerations

enum  watch_interrupt_trigger { INTERRUPT_TRIGGER_NONE = 0 -, INTERRUPT_TRIGGER_RISING -, INTERRUPT_TRIGGER_FALLING -, INTERRUPT_TRIGGER_BOTH - }
 An enum defining the types of interrupt trigger you wish to scan for.
 
- - - - - - - - - - - - - - -

-Functions

-void watch_enable_external_interrupts (void)
 Enables the external interrupt controller.
 
-void watch_disable_external_interrupts (void)
 Disables the external interrupt controller.
 
void watch_register_interrupt_callback (const uint8_t pin, ext_irq_cb_t callback, watch_interrupt_trigger trigger)
 Configures an external interrupt callback on one of the external interrupt pins. More...
 
__attribute__ ((deprecated("Use watch_register_interrupt_callback or watch_register_extwake_callback instead"))) void watch_register_button_callback(const uint8_t pin
 
__attribute__ ((deprecated("Use watch_enable_external_interrupts instead"))) void watch_enable_buttons(void)
 
- - - -

-Variables

-ext_irq_cb_t callback
 
-

Detailed Description

-

This section covers functions related to the three buttons: Light, Mode and Alarm, as well as external interrupts from devices on the nine-pin connector.

-

The buttons are the core input UI of the watch, and the way the user will interact with your application. They are active high, pulled down by the microcontroller, and triggered when one of the "pushers" brings a tab from the metal frame into contact with the edge of the board. Note that the buttons can only wake the watch from STANDBY mode, at least as of the current SAM L22 silicon revision. The external interrupt controller runs in STANDBY mode, but it does not run in BACKUP mode; to wake from BACKUP, buttons will not cut it.

-

Function Documentation

- -

◆ watch_register_interrupt_callback()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void watch_register_interrupt_callback (const uint8_t pin,
ext_irq_cb_t callback,
watch_interrupt_trigger trigger 
)
-
- -

Configures an external interrupt callback on one of the external interrupt pins.

-

You can set one interrupt callback per pin, and you can monitor for a rising condition, a falling condition, or both. If you just want to detect a button press, register your interrupt with INTERRUPT_TRIGGER_RISING; if you want to detect an active-low interrupt signal from a device on the nine-pin connector, use INTERRUPT_TRIGGER_FALLING. If you want to detect both rising and falling conditions (i.e. button down and button up), use INTERRUPT_TRIGGER_BOTH and use watch_get_pin_level to check the pin level in your callback to determine which condition caused the interrupt.

Parameters
- - - - -
pinOne of BTN_LIGHT, BTN_MODE, BTN_ALARM, A0, A1, A3 or A4. If the pin parameter matches one of the three button pins, this function will also enable an internal pull-down resistor. If the pin parameter is A0-A4, you are responsible for setting any required pull configuration using watch_enable_pull_up or watch_enable_pull_down.
callbackThe function you wish to have called when the button is pressed.
triggerThe condition on which you wish to trigger: rising, falling or both.
-
-
-
Note
Pins A2 and A4 can also generate interrupts via the watch_register_extwake_callback function, which will allow them to trigger even when the watch is in deep sleep mode.
-
Warning
As of now, A2 is not usable via the watch_register_interrupt_callback function. To enable an external interrupt on pin A2, use the watch_register_extwake_callback function. This issue will be addressed in a future revision of the watch library.
- -
-
-
- - - - diff --git a/group__buzzer.html b/group__buzzer.html deleted file mode 100644 index 7d9a1ed2..00000000 --- a/group__buzzer.html +++ /dev/null @@ -1,559 +0,0 @@ - - - - - - - -Sensor Watch: Buzzer - - - - - - - - - -
-
- - - - - - -
-
Sensor Watch -  0.0.0 -
-
A board replacement for the classic Casio F-91W wristwatch, powered by a Microchip SAM L22 microcontroller.
-
-
- - - - - - - -
- -
-
- - -
- -
- -
- -
-
Buzzer
-
-
- -

This section covers functions related to the piezo buzzer embedded in the F-91W's back plate. -More...

- - - - - -

-Typedefs

-typedef enum BuzzerNote BuzzerNote
 87 notes for use with watch_buzzer_play_note
 
- - - - -

-Enumerations

enum  BuzzerNote {
-  BUZZER_NOTE_A1 -, BUZZER_NOTE_A1SHARP_B1FLAT -, BUZZER_NOTE_B1 -, BUZZER_NOTE_C2 -,
-  BUZZER_NOTE_C2SHARP_D2FLAT -, BUZZER_NOTE_D2 -, BUZZER_NOTE_D2SHARP_E2FLAT -, BUZZER_NOTE_E2 -,
-  BUZZER_NOTE_F2 -, BUZZER_NOTE_F2SHARP_G2FLAT -, BUZZER_NOTE_G2 -, BUZZER_NOTE_G2SHARP_A2FLAT -,
-  BUZZER_NOTE_A2 -, BUZZER_NOTE_A2SHARP_B2FLAT -, BUZZER_NOTE_B2 -, BUZZER_NOTE_C3 -,
-  BUZZER_NOTE_C3SHARP_D3FLAT -, BUZZER_NOTE_D3 -, BUZZER_NOTE_D3SHARP_E3FLAT -, BUZZER_NOTE_E3 -,
-  BUZZER_NOTE_F3 -, BUZZER_NOTE_F3SHARP_G3FLAT -, BUZZER_NOTE_G3 -, BUZZER_NOTE_G3SHARP_A3FLAT -,
-  BUZZER_NOTE_A3 -, BUZZER_NOTE_A3SHARP_B3FLAT -, BUZZER_NOTE_B3 -, BUZZER_NOTE_C4 -,
-  BUZZER_NOTE_C4SHARP_D4FLAT -, BUZZER_NOTE_D4 -, BUZZER_NOTE_D4SHARP_E4FLAT -, BUZZER_NOTE_E4 -,
-  BUZZER_NOTE_F4 -, BUZZER_NOTE_F4SHARP_G4FLAT -, BUZZER_NOTE_G4 -, BUZZER_NOTE_G4SHARP_A4FLAT -,
-  BUZZER_NOTE_A4 -, BUZZER_NOTE_A4SHARP_B4FLAT -, BUZZER_NOTE_B4 -, BUZZER_NOTE_C5 -,
-  BUZZER_NOTE_C5SHARP_D5FLAT -, BUZZER_NOTE_D5 -, BUZZER_NOTE_D5SHARP_E5FLAT -, BUZZER_NOTE_E5 -,
-  BUZZER_NOTE_F5 -, BUZZER_NOTE_F5SHARP_G5FLAT -, BUZZER_NOTE_G5 -, BUZZER_NOTE_G5SHARP_A5FLAT -,
-  BUZZER_NOTE_A5 -, BUZZER_NOTE_A5SHARP_B5FLAT -, BUZZER_NOTE_B5 -, BUZZER_NOTE_C6 -,
-  BUZZER_NOTE_C6SHARP_D6FLAT -, BUZZER_NOTE_D6 -, BUZZER_NOTE_D6SHARP_E6FLAT -, BUZZER_NOTE_E6 -,
-  BUZZER_NOTE_F6 -, BUZZER_NOTE_F6SHARP_G6FLAT -, BUZZER_NOTE_G6 -, BUZZER_NOTE_G6SHARP_A6FLAT -,
-  BUZZER_NOTE_A6 -, BUZZER_NOTE_A6SHARP_B6FLAT -, BUZZER_NOTE_B6 -, BUZZER_NOTE_C7 -,
-  BUZZER_NOTE_C7SHARP_D7FLAT -, BUZZER_NOTE_D7 -, BUZZER_NOTE_D7SHARP_E7FLAT -, BUZZER_NOTE_E7 -,
-  BUZZER_NOTE_F7 -, BUZZER_NOTE_F7SHARP_G7FLAT -, BUZZER_NOTE_G7 -, BUZZER_NOTE_G7SHARP_A7FLAT -,
-  BUZZER_NOTE_A7 -, BUZZER_NOTE_A7SHARP_B7FLAT -, BUZZER_NOTE_B7 -, BUZZER_NOTE_C8 -,
-  BUZZER_NOTE_C8SHARP_D8FLAT -, BUZZER_NOTE_D8 -, BUZZER_NOTE_D8SHARP_E8FLAT -, BUZZER_NOTE_E8 -,
-  BUZZER_NOTE_F8 -, BUZZER_NOTE_F8SHARP_G8FLAT -, BUZZER_NOTE_G8 -, BUZZER_NOTE_G8SHARP_A8FLAT -,
-  BUZZER_NOTE_A8 -, BUZZER_NOTE_A8SHARP_B8FLAT -, BUZZER_NOTE_B8 -, BUZZER_NOTE_REST -
- }
 87 notes for use with watch_buzzer_play_note More...
 
- - - - - - - - - - - - - - - - - - - -

-Functions

-void watch_enable_buzzer (void)
 Enables the TCC peripheral, which drives the buzzer.
 
void watch_set_buzzer_period (uint32_t period)
 Sets the period of the buzzer. More...
 
void watch_disable_buzzer (void)
 Disables the TCC peripheral that drives the buzzer. More...
 
void watch_set_buzzer_on (void)
 Turns the buzzer output on. It will emit a continuous sound at the given frequency. More...
 
-void watch_set_buzzer_off (void)
 Turns the buzzer output off.
 
void watch_buzzer_play_note (BuzzerNote note, uint16_t duration_ms)
 Plays the given note for a set duration. More...
 
- - - - -

-Variables

-const uint16_t NotePeriods [108]
 An array of periods for all the notes on a piano, corresponding to the names in BuzzerNote.
 
-

Detailed Description

-

This section covers functions related to the piezo buzzer embedded in the F-91W's back plate.

-

Enumeration Type Documentation

- -

◆ BuzzerNote

- -
-
- - - - -
enum BuzzerNote
-
- -

87 notes for use with watch_buzzer_play_note

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Enumerator
BUZZER_NOTE_A1 

55.00 Hz

-
BUZZER_NOTE_A1SHARP_B1FLAT 

58.27 Hz

-
BUZZER_NOTE_B1 

61.74 Hz

-
BUZZER_NOTE_C2 

65.41 Hz

-
BUZZER_NOTE_C2SHARP_D2FLAT 

69.30 Hz

-
BUZZER_NOTE_D2 

73.42 Hz

-
BUZZER_NOTE_D2SHARP_E2FLAT 

77.78 Hz

-
BUZZER_NOTE_E2 

82.41 Hz

-
BUZZER_NOTE_F2 

87.31 Hz

-
BUZZER_NOTE_F2SHARP_G2FLAT 

92.50 Hz

-
BUZZER_NOTE_G2 

98.00 Hz

-
BUZZER_NOTE_G2SHARP_A2FLAT 

103.83 Hz

-
BUZZER_NOTE_A2 

110.00 Hz

-
BUZZER_NOTE_A2SHARP_B2FLAT 

116.54 Hz

-
BUZZER_NOTE_B2 

123.47 Hz

-
BUZZER_NOTE_C3 

130.81 Hz

-
BUZZER_NOTE_C3SHARP_D3FLAT 

138.59 Hz

-
BUZZER_NOTE_D3 

146.83 Hz

-
BUZZER_NOTE_D3SHARP_E3FLAT 

155.56 Hz

-
BUZZER_NOTE_E3 

164.81 Hz

-
BUZZER_NOTE_F3 

174.61 Hz

-
BUZZER_NOTE_F3SHARP_G3FLAT 

185.00 Hz

-
BUZZER_NOTE_G3 

196.00 Hz

-
BUZZER_NOTE_G3SHARP_A3FLAT 

207.65 Hz

-
BUZZER_NOTE_A3 

220.00 Hz

-
BUZZER_NOTE_A3SHARP_B3FLAT 

233.08 Hz

-
BUZZER_NOTE_B3 

246.94 Hz

-
BUZZER_NOTE_C4 

261.63 Hz

-
BUZZER_NOTE_C4SHARP_D4FLAT 

277.18 Hz

-
BUZZER_NOTE_D4 

293.66 Hz

-
BUZZER_NOTE_D4SHARP_E4FLAT 

311.13 Hz

-
BUZZER_NOTE_E4 

329.63 Hz

-
BUZZER_NOTE_F4 

349.23 Hz

-
BUZZER_NOTE_F4SHARP_G4FLAT 

369.99 Hz

-
BUZZER_NOTE_G4 

392.00 Hz

-
BUZZER_NOTE_G4SHARP_A4FLAT 

415.30 Hz

-
BUZZER_NOTE_A4 

440.00 Hz

-
BUZZER_NOTE_A4SHARP_B4FLAT 

466.16 Hz

-
BUZZER_NOTE_B4 

493.88 Hz

-
BUZZER_NOTE_C5 

523.25 Hz

-
BUZZER_NOTE_C5SHARP_D5FLAT 

554.37 Hz

-
BUZZER_NOTE_D5 

587.33 Hz

-
BUZZER_NOTE_D5SHARP_E5FLAT 

622.25 Hz

-
BUZZER_NOTE_E5 

659.25 Hz

-
BUZZER_NOTE_F5 

698.46 Hz

-
BUZZER_NOTE_F5SHARP_G5FLAT 

739.99 Hz

-
BUZZER_NOTE_G5 

783.99 Hz

-
BUZZER_NOTE_G5SHARP_A5FLAT 

830.61 Hz

-
BUZZER_NOTE_A5 

880.00 Hz

-
BUZZER_NOTE_A5SHARP_B5FLAT 

932.33 Hz

-
BUZZER_NOTE_B5 

987.77 Hz

-
BUZZER_NOTE_C6 

1046.50 Hz

-
BUZZER_NOTE_C6SHARP_D6FLAT 

1108.73 Hz

-
BUZZER_NOTE_D6 

1174.66 Hz

-
BUZZER_NOTE_D6SHARP_E6FLAT 

1244.51 Hz

-
BUZZER_NOTE_E6 

1318.51 Hz

-
BUZZER_NOTE_F6 

1396.91 Hz

-
BUZZER_NOTE_F6SHARP_G6FLAT 

1479.98 Hz

-
BUZZER_NOTE_G6 

1567.98 Hz

-
BUZZER_NOTE_G6SHARP_A6FLAT 

1661.22 Hz

-
BUZZER_NOTE_A6 

1760.00 Hz

-
BUZZER_NOTE_A6SHARP_B6FLAT 

1864.66 Hz

-
BUZZER_NOTE_B6 

1975.53 Hz

-
BUZZER_NOTE_C7 

2093.00 Hz

-
BUZZER_NOTE_C7SHARP_D7FLAT 

2217.46 Hz

-
BUZZER_NOTE_D7 

2349.32 Hz

-
BUZZER_NOTE_D7SHARP_E7FLAT 

2489.02 Hz

-
BUZZER_NOTE_E7 

2637.02 Hz

-
BUZZER_NOTE_F7 

2793.83 Hz

-
BUZZER_NOTE_F7SHARP_G7FLAT 

2959.96 Hz

-
BUZZER_NOTE_G7 

3135.96 Hz

-
BUZZER_NOTE_G7SHARP_A7FLAT 

3322.44 Hz

-
BUZZER_NOTE_A7 

3520.00 Hz

-
BUZZER_NOTE_A7SHARP_B7FLAT 

3729.31 Hz

-
BUZZER_NOTE_B7 

3951.07 Hz

-
BUZZER_NOTE_C8 

4186.01 Hz

-
BUZZER_NOTE_C8SHARP_D8FLAT 

4434.92 Hz

-
BUZZER_NOTE_D8 

4698.63 Hz

-
BUZZER_NOTE_D8SHARP_E8FLAT 

4978.03 Hz

-
BUZZER_NOTE_E8 

5274.04 Hz

-
BUZZER_NOTE_F8 

5587.65 Hz

-
BUZZER_NOTE_F8SHARP_G8FLAT 

5919.91 Hz

-
BUZZER_NOTE_G8 

6271.93 Hz

-
BUZZER_NOTE_G8SHARP_A8FLAT 

6644.88 Hz

-
BUZZER_NOTE_A8 

7040.00 Hz

-
BUZZER_NOTE_A8SHARP_B8FLAT 

7458.62 Hz

-
BUZZER_NOTE_B8 

7902.13 Hz

-
BUZZER_NOTE_REST 

no sound

-
- -
-
-

Function Documentation

- -

◆ watch_buzzer_play_note()

- -
-
- - - - - - - - - - - - - - - - - - -
void watch_buzzer_play_note (BuzzerNote note,
uint16_t duration_ms 
)
-
- -

Plays the given note for a set duration.

-
Parameters
- - - -
noteThe note you wish to play, or BUZZER_NOTE_REST to disable output for the given duration.
duration_msThe duration of the note.
-
-
-
Note
Note that this will block your UI for the duration of the note's play time, and it will after this call, the buzzer period will be set to the period of this note.
- -
-
- -

◆ watch_disable_buzzer()

- -
-
- - - - - - - - -
void watch_disable_buzzer (void )
-
- -

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

◆ watch_set_buzzer_on()

- -
-
- - - - - -
- - - - - - - - -
void watch_set_buzzer_on (void )
-
-inline
-
- -

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

◆ watch_set_buzzer_period()

- -
-
- - - - - -
- - - - - - - - -
void watch_set_buzzer_period (uint32_t period)
-
-inline
-
- -

Sets the period of the buzzer.

-
Parameters
- - -
periodThe 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
-
-
- -
-
-
- - - - diff --git a/group__debug.html b/group__debug.html deleted file mode 100644 index fa063a4a..00000000 --- a/group__debug.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - -Sensor Watch: Debug UART - - - - - - - - - -
-
- - - - - - -
-
Sensor Watch -  0.0.0 -
-
A board replacement for the classic Casio F-91W wristwatch, powered by a Microchip SAM L22 microcontroller.
-
-
- - - - - - - -
- -
-
- - -
- -
- -
- -
-
Debug UART
-
-
- -

This section covers functions related to the debug UART, available on pin D1 of the 9-pin connector. -More...

- - - - - -

-Functions

 __attribute__ ((deprecated("Use printf to log debug messages over USB."))) void watch_enable_debug_uart(uint32_t baud)
 Initializes the debug UART. More...
 
-

Detailed Description

-

This section covers functions related to the debug UART, available on pin D1 of the 9-pin connector.

-
Warning
These functions were used early on in development, before the TinyUSB CDC was implemented. You can now print debug messages to the USB console using printf, rendering this bit irrelevant. These methods will likely be refactored out in the future, in favor of a more full-featured UART on the nine-pin connector.
-

Function Documentation

- -

◆ __attribute__()

- -
-
- - - - - - - - -
__attribute__ ((deprecated("Use printf to log debug messages over USB.")) )
-
- -

Initializes the debug UART.

-

Outputs a string on the debug UART.

-

Outputs a single character on the debug UART.

-
Parameters
- - - - -
baudThe baud rate
cThe character you wish to output.
sA null-terminated string.
-
-
- -
-
-
- - - - diff --git a/group__deepsleep.html b/group__deepsleep.html deleted file mode 100644 index e95bd01c..00000000 --- a/group__deepsleep.html +++ /dev/null @@ -1,325 +0,0 @@ - - - - - - - -Sensor Watch: Sleep Control - - - - - - - - - -
-
- - - - - - -
-
Sensor Watch -  0.0.0 -
-
A board replacement for the classic Casio F-91W wristwatch, powered by a Microchip SAM L22 microcontroller.
-
-
- - - - - - - -
- -
-
- - -
- -
- -
- -
-
Sleep Control
-
-
- -

This section covers functions related to the various sleep modes available to the watch, including Sleep, Deep Sleep, and BACKUP mode. -More...

- - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Functions

void watch_register_extwake_callback (uint8_t pin, ext_irq_cb_t callback, bool level)
 Registers a callback on one of the RTC's external wake pins, which can wake the device from Sleep, Deep Sleep and BACKUP modes (but see warning re: BACKUP mode). More...
 
void watch_disable_extwake_interrupt (uint8_t pin)
 Unregisters the RTC interrupt on one of the EXTWAKE pins. This will prevent a value change on one of these pins from waking the device. More...
 
void watch_store_backup_data (uint32_t data, uint8_t reg)
 Stores data in one of the RTC's backup registers, which retain their data in BACKUP mode. More...
 
uint32_t watch_get_backup_data (uint8_t reg)
 Gets 32 bits of data from the RTC's BACKUP register. More...
 
void watch_enter_sleep_mode (void)
 enters Sleep Mode by disabling all pins and peripherals except the RTC and the LCD. More...
 
void watch_enter_deep_sleep_mode (void)
 enters Deep Sleep Mode by disabling all pins and peripherals except the RTC. More...
 
void watch_enter_backup_mode (void)
 Enters the SAM L22's lowest-power mode, BACKUP. More...
 
__attribute__ ((deprecated("Use watch_enter_sleep_mode or watch_enter_deep_sleep_mode instead"))) void watch_enter_shallow_sleep(bool display_on)
 
__attribute__ ((deprecated("Use watch_enter_backup_mode instead"))) void watch_enter_deep_sleep(void)
 
-

Detailed Description

-

This section covers functions related to the various sleep modes available to the watch, including Sleep, Deep Sleep, and BACKUP mode.

-

These terms changed meaning a bit over the course of development; if you are coming to this documentation after having worked with an earlier version of the library, these definitions should clarify the terminology. Terms in all caps are modes of the SAM L22; terms in Title Case are specific implementations in this library.

-

Function Documentation

- -

◆ watch_disable_extwake_interrupt()

- -
-
- - - - - - - - -
void watch_disable_extwake_interrupt (uint8_t pin)
-
- -

Unregisters the RTC interrupt on one of the EXTWAKE pins. This will prevent a value change on one of these pins from waking the device.

-
Parameters
- - -
pinEither pin BTN_ALARM, A2, or A4. If the pin is BTN_ALARM, this function DOES NOT disable the internal pull down on that pin.
-
-
- -
-
- -

◆ watch_enter_backup_mode()

- -
-
- - - - - - - - -
void watch_enter_backup_mode (void )
-
- -

Enters the SAM L22's lowest-power mode, BACKUP.

-

This function does some housekeeping before entering BACKUP mode. It first disables all pins and peripherals except for the RTC, and disables the tick interrupt (since that would wake us up from BACKUP mode). Once again, if you wish to wake from the A2 or the A4 interrupt, you must first configure this by calling watch_register_extwake_callback.

Note
If you have a callback set for an external wake interrupt, it will be called if triggered while in ACTIVE, STANDBY, Sleep and Deep Sleep modes, but it will not be called when waking from BACKUP mode. Waking from backup is effectively like waking from reset, except that your app_wake_from_backup function will be called.
-
Warning
On current revisions of the SAM L22 silicon, the ALARM_BTN pin (PA02 RTC/IN2) cannot wake the device from deep sleep mode. There is an errata note (Reference: 15010) that says that due to a silicon bug, RTC/IN2 is not functional in BACKUP. As a result, you should not call this function unless you have a device on the nine-pin connector with an external interrupt on pin A2 or A4 (i.e. an accelerometer with an interrupt pin).
- -
-
- -

◆ watch_enter_deep_sleep_mode()

- -
-
- - - - - - - - -
void watch_enter_deep_sleep_mode (void )
-
- -

enters Deep Sleep Mode by disabling all pins and peripherals except the RTC.

-

Short of BACKUP mode, this is the lowest power mode you can enter while retaining your application state (and the ability to wake with the alarm button). Just note that the display will be completely off, so you should document to the user of your application that they will need to press the alarm button to wake the device, or use a sensor board with support for an external wake pin.

-

All notes from watch_enter_sleep_mode apply here, except for power consumption. You can estimate the power consumption of this mode to be on the order of 12 microwatts (about 4µA at 3 V).

- -
-
- -

◆ watch_enter_sleep_mode()

- -
-
- - - - - - - - -
void watch_enter_sleep_mode (void )
-
- -

enters Sleep Mode by disabling all pins and peripherals except the RTC and the LCD.

-

This sleep mode is not the lowest power mode available, but it has the benefit of allowing you to display a message to the user while asleep. You can also set an alarm interrupt to wake at a configfurable interval (every minute, hour or day) to update the display. You can wake from this mode by pressing the ALARM button, if you registered an extwake callback on the ALARM button. Also note that when your app wakes from this sleep mode, your app_setup method will be called again, since this function will have disabled things you set up there.

-

Note that to wake from either the ALARM button, the A2 interrupt or the A4 interrupt, you must first configure this by calling watch_register_extwake_callback.

-

You can estimate the power consumption of this mode to be on the order of 30 microwatts (about 10 µA at 3 V).

- -
-
- -

◆ watch_get_backup_data()

- -
-
- - - - - - - - -
uint32_t watch_get_backup_data (uint8_t reg)
-
- -

Gets 32 bits of data from the RTC's BACKUP register.

-
Parameters
- - -
regA register from 0-7.
-
-
-
Returns
An unsigned 32 bit integer with the from the backup register.
- -
-
- -

◆ watch_register_extwake_callback()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void watch_register_extwake_callback (uint8_t pin,
ext_irq_cb_t callback,
bool level 
)
-
- -

Registers a callback on one of the RTC's external wake pins, which can wake the device from Sleep, Deep Sleep and BACKUP modes (but see warning re: BACKUP mode).

-
Parameters
- - - - -
pinEither pin BTN_ALARM, A2, or A4. These are the three external wake pins. If the pin is BTN_ALARM, this function also enables an internal pull down on that pin.
callbackThe callback to be called if this pin triggers outside of BACKUP mode. If this is NULL, no callback will be called even in normal modes, but the interrupt will still be enabled so that it can wake the device.
levelThe level you wish to scan for: true for rising, false for falling. Note that you cannot scan for both rising and falling edges like you can with the external interrupt pins; with the external wake interrupt, you can only get one or the other.
-
-
-
Note
When in ACTIVE, STANDBY and Sleep / Deep sleep modes, this will function much like a standard external interrupt situation: these pins will wake the device, and your callback will be called. However, if the device enters BACKUP mode and one of these pins wakes the device, your callback WILL NOT be called, as the device is basically waking from reset at that point.
-
Warning
As of the current SAM L22 silicon revision (rev B), the BTN_ALARM pin cannot wake the device from BACKUP mode. You can still use this function to register a BTN_ALARM interrupt in normal or deep sleep mode, but to wake from BACKUP, you will need to use pin A2 or A4.
- -
-
- -

◆ watch_store_backup_data()

- -
-
- - - - - - - - - - - - - - - - - - -
void watch_store_backup_data (uint32_t data,
uint8_t reg 
)
-
- -

Stores data in one of the RTC's backup registers, which retain their data in BACKUP mode.

-
Parameters
- - - -
dataAn unsigned 32 bit integer with the data you wish to store.
regA register from 0-7.
-
-
- -
-
-
- - - - diff --git a/group__gpio.html b/group__gpio.html deleted file mode 100644 index abce3977..00000000 --- a/group__gpio.html +++ /dev/null @@ -1,332 +0,0 @@ - - - - - - - -Sensor Watch: Digital Input and Output - - - - - - - - - -
-
- - - - - - -
-
Sensor Watch -  0.0.0 -
-
A board replacement for the classic Casio F-91W wristwatch, powered by a Microchip SAM L22 microcontroller.
-
-
- - - - - - - -
- -
-
- - -
- -
- -
- -
-
Digital Input and Output
-
-
- -

This section covers functions related to general-purpose input and output signals. -More...

- - - - - - - - - - - - - - - - - - - - - - - - - - -

-Functions

void watch_enable_digital_input (const uint8_t pin)
 Configures the selected pin for digital input. More...
 
void watch_disable_digital_input (const uint8_t pin)
 Disables any digital input, along with any pull-up or pull-down configuration. More...
 
void watch_enable_pull_up (const uint8_t pin)
 Enables a pull-up resistor on the selected pin. More...
 
void watch_enable_pull_down (const uint8_t pin)
 Enables a pull-down resistor on the selected pin. More...
 
bool watch_get_pin_level (const uint8_t pin)
 Gets the level of the selected pin. More...
 
void watch_enable_digital_output (const uint8_t pin)
 Configures the selected pin for digital output. More...
 
void watch_disable_digital_output (const uint8_t pin)
 Disables digital output on the selected pin. More...
 
void watch_set_pin_level (const uint8_t pin, const bool level)
 Sets the level of the selected pin. More...
 
-

Detailed Description

-

This section covers functions related to general-purpose input and output signals.

-

Function Documentation

- -

◆ watch_disable_digital_input()

- -
-
- - - - - - - - -
void watch_disable_digital_input (const uint8_t pin)
-
- -

Disables any digital input, along with any pull-up or pull-down configuration.

-
Parameters
- - -
pinThe pin that you wish to disable.
-
-
- -
-
- -

◆ watch_disable_digital_output()

- -
-
- - - - - - - - -
void watch_disable_digital_output (const uint8_t pin)
-
- -

Disables digital output on the selected pin.

-
Parameters
- - -
pinThe pin that you wish disable.
-
-
- -
-
- -

◆ watch_enable_digital_input()

- -
-
- - - - - - - - -
void watch_enable_digital_input (const uint8_t pin)
-
- -

Configures the selected pin for digital input.

-
Parameters
- - -
pinThe pin that you wish to act as an input.
-
-
- -
-
- -

◆ watch_enable_digital_output()

- -
-
- - - - - - - - -
void watch_enable_digital_output (const uint8_t pin)
-
- -

Configures the selected pin for digital output.

-
Parameters
- - -
pinThe pin that you wish to act as an output.
-
-
- -
-
- -

◆ watch_enable_pull_down()

- -
-
- - - - - - - - -
void watch_enable_pull_down (const uint8_t pin)
-
- -

Enables a pull-down resistor on the selected pin.

-
Parameters
- - -
pinThe pin that you wish to configure.
-
-
- -
-
- -

◆ watch_enable_pull_up()

- -
-
- - - - - - - - -
void watch_enable_pull_up (const uint8_t pin)
-
- -

Enables a pull-up resistor on the selected pin.

-
Parameters
- - -
pinThe pin that you wish to configure.
-
-
- -
-
- -

◆ watch_get_pin_level()

- -
-
- - - - - - - - -
bool watch_get_pin_level (const uint8_t pin)
-
- -

Gets the level of the selected pin.

-
Parameters
- - -
pinThe pin whose value you wish to read.
-
-
-
Returns
true if the pin was logic high; otherwise, false.
- -
-
- -

◆ watch_set_pin_level()

- -
-
- - - - - - - - - - - - - - - - - - -
void watch_set_pin_level (const uint8_t pin,
const bool level 
)
-
- -

Sets the level of the selected pin.

-
Parameters
- - - -
pinThe pin whose value you wish to set.
levelThe level you wish to set: true for high, false for low.
-
-
- -
-
-
- - - - diff --git a/group__i2c.html b/group__i2c.html deleted file mode 100644 index af989f8d..00000000 --- a/group__i2c.html +++ /dev/null @@ -1,404 +0,0 @@ - - - - - - - -Sensor Watch: I2C Controller Driver - - - - - - - - - -
-
- - - - - - -
-
Sensor Watch -  0.0.0 -
-
A board replacement for the classic Casio F-91W wristwatch, powered by a Microchip SAM L22 microcontroller.
-
-
- - - - - - - -
- -
-
- - -
- -
- -
- -
-
I2C Controller Driver
-
-
- -

This section covers functions related to the SAM L22's built-I2C driver, including configuring the I2C bus, putting values directly on the bus and reading data from registers on I2C devices. -More...

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Functions

-void watch_enable_i2c (void)
 Enables the I2C peripheral. Call this before attempting to interface with I2C devices.
 
-void watch_disable_i2c (void)
 Disables the I2C peripheral.
 
void watch_i2c_send (int16_t addr, uint8_t *buf, uint16_t length)
 Sends a series of values to a device on the I2C bus. More...
 
void watch_i2c_receive (int16_t addr, uint8_t *buf, uint16_t length)
 Receives a series of values from a device on the I2C bus. More...
 
void watch_i2c_write8 (int16_t addr, uint8_t reg, uint8_t data)
 Writes a byte to a register in an I2C device. More...
 
uint8_t watch_i2c_read8 (int16_t addr, uint8_t reg)
 Reads a byte from a register in an I2C device. More...
 
uint16_t watch_i2c_read16 (int16_t addr, uint8_t reg)
 Reads an unsigned little-endian word from a register in an I2C device. More...
 
uint32_t watch_i2c_read24 (int16_t addr, uint8_t reg)
 Reads three bytes as an unsigned little-endian int from a register in an I2C device. More...
 
uint32_t watch_i2c_read32 (int16_t addr, uint8_t reg)
 Reads an unsigned little-endian int from a register in an I2C device. More...
 
-

Detailed Description

-

This section covers functions related to the SAM L22's built-I2C driver, including configuring the I2C bus, putting values directly on the bus and reading data from registers on I2C devices.

-

Function Documentation

- -

◆ watch_i2c_read16()

- -
-
- - - - - - - - - - - - - - - - - - -
uint16_t watch_i2c_read16 (int16_t addr,
uint8_t reg 
)
-
- -

Reads an unsigned little-endian word from a register in an I2C device.

-
Parameters
- - - -
addrThe address of the device you wish to address.
regThe register on the device that you wish to read.
-
-
-
Returns
An unsigned word representing the value of the register that was read.
-
Note
This reads two bytes into the word in bus order. If the device returns the LSB first and then the MSB, you can use this value as returned. If the device returns the data in big-endian order or uses some other kind of fancy bit packing, you may need to shuffle some bits around.
- -
-
- -

◆ watch_i2c_read24()

- -
-
- - - - - - - - - - - - - - - - - - -
uint32_t watch_i2c_read24 (int16_t addr,
uint8_t reg 
)
-
- -

Reads three bytes as an unsigned little-endian int from a register in an I2C device.

-
Parameters
- - - -
addrThe address of the device you wish to address.
regThe register on the device that you wish to read.
-
-
-
Returns
An unsigned word representing the value of the register that was read.
-
Note
This reads three bytes into the word in bus order. If the device returns these bytes LSB first, you can use this value as returned. If there is a sign bit, the device returns the data in big-endian order, or it uses some other kind of fancy bit packing, you may need to shuffle some bits around.
- -
-
- -

◆ watch_i2c_read32()

- -
-
- - - - - - - - - - - - - - - - - - -
uint32_t watch_i2c_read32 (int16_t addr,
uint8_t reg 
)
-
- -

Reads an unsigned little-endian int from a register in an I2C device.

-
Parameters
- - - -
addrThe address of the device you wish to address.
regThe register on the device that you wish to read.
-
-
-
Returns
An unsigned word representing the value of the register that was read.
-
Note
This reads three bytes into the word in bus order. If the device returns these bytes LSB first, you can use this value as returned. If the device returns the data in big-endian order, or it uses some other kind of fancy bit packing, you may need to shuffle some bits around.
- -
-
- -

◆ watch_i2c_read8()

- -
-
- - - - - - - - - - - - - - - - - - -
uint8_t watch_i2c_read8 (int16_t addr,
uint8_t reg 
)
-
- -

Reads a byte from a register in an I2C device.

-
Parameters
- - - -
addrThe address of the device you wish to address.
regThe register on the device that you wish to read.
-
-
-
Returns
An unsigned byte representing the value of the register that was read.
- -
-
- -

◆ watch_i2c_receive()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void watch_i2c_receive (int16_t addr,
uint8_t * buf,
uint16_t length 
)
-
- -

Receives a series of values from a device on the I2C bus.

-
Parameters
- - - - -
addrThe address of the device you wish to hear from.
bufStorage for the incoming bytes; on return, it will contain the received data.
lengthThe number of bytes that you wish to receive.
-
-
- -
-
- -

◆ watch_i2c_send()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void watch_i2c_send (int16_t addr,
uint8_t * buf,
uint16_t length 
)
-
- -

Sends a series of values to a device on the I2C bus.

-
Parameters
- - - - -
addrThe address of the device you wish to talk to.
bufA series of unsigned bytes; the data you wish to transmit.
lengthThe number of bytes in buf that you wish to send.
-
-
- -
-
- -

◆ watch_i2c_write8()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void watch_i2c_write8 (int16_t addr,
uint8_t reg,
uint8_t data 
)
-
- -

Writes a byte to a register in an I2C device.

-
Parameters
- - - - -
addrThe address of the device you wish to address.
regThe register on the device that you wish to set.
dataThe value that you wish to set the register to.
-
-
- -
-
-
- - - - diff --git a/group__led.html b/group__led.html deleted file mode 100644 index f21e92c1..00000000 --- a/group__led.html +++ /dev/null @@ -1,260 +0,0 @@ - - - - - - - -Sensor Watch: LED Control - - - - - - - - - -
-
- - - - - - -
-
Sensor Watch -  0.0.0 -
-
A board replacement for the classic Casio F-91W wristwatch, powered by a Microchip SAM L22 microcontroller.
-
-
- - - - - - - -
- -
-
- - -
- -
- -
- -
-
LED Control
-
-
- -

This section covers functions related to the bi-color red/green LED mounted behind the LCD. -More...

- - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Functions

void watch_enable_leds (void)
 Enables the bi-color LED. More...
 
void watch_disable_leds (void)
 Disables the LEDs. More...
 
void watch_set_led_color (uint8_t red, uint8_t green)
 Sets the LED to a custom color by modulating each output's duty cycle. More...
 
void watch_set_led_red (void)
 Sets the red LED to full brightness, and turns the green LED off. More...
 
void watch_set_led_green (void)
 Sets the green LED to full brightness, and turns the red LED off. More...
 
void watch_set_led_yellow (void)
 Sets both red and green LEDs to full brightness. More...
 
-void watch_set_led_off (void)
 Turns both the red and the green LEDs off.
 
__attribute__ ((deprecated("Use watch_enable_leds instead"))) void watch_enable_led(bool unused)
 
__attribute__ ((deprecated("Use watch_disable_leds instead"))) void watch_disable_led(bool unused)
 
-

Detailed Description

-

This section covers functions related to the bi-color red/green LED mounted behind the LCD.

-

The SAM L22 is an exceedingly power efficient chip, whereas the LED's are relatively power- hungry. The green LED, at full power, consumes more power than the whole chip in active mode, and the red LED consumes about twelve times as much power! The LED's should thus be used only sparingly in order to preserve battery life.

Note
Some watches use a red/blue LED instead of a red/green LED. You will be able to determine this easily when you double tap the reset button: if the pulsing bootloader LED is red, you have a red/green edition; if it is blue, you have a red/blue edition. For red/blue watches, build your project with the command make LED=BLUE, and the watch library will automatically swap the pins so that watch_set_led_red sets the red LED, and watch_set_led_green sets the blue one.
-

Function Documentation

- -

◆ watch_disable_leds()

- -
-
- - - - - - - - -
void watch_disable_leds (void )
-
- -

Disables the LEDs.

-
Note
This method will also disable the buzzer, since the buzzer and LED both make use of the same peripheral to drive their PWM behavior.
- -
-
- -

◆ watch_enable_leds()

- -
-
- - - - - - - - -
void watch_enable_leds (void )
-
- -

Enables the bi-color LED.

-
Note
The TCC peripheral that drives the LEDs does not run in STANDBY mode — but the outputs do! This means that if you set either red, green or both LEDs to full power, they will shine even when your app is asleep. If, however, you set a custom color using watch_set_led_color, the color will not display correctly in STANDBY mode. You will need to keep your app running while the LED is on.
- -
-
- -

◆ watch_set_led_color()

- -
-
- - - - - - - - - - - - - - - - - - -
void watch_set_led_color (uint8_t red,
uint8_t green 
)
-
- -

Sets the LED to a custom color by modulating each output's duty cycle.

-
Parameters
- - - -
redThe red value from 0-255.
greenThe green value from 0-255. If your watch has a red/blue LED, this will be the blue value.
-
-
-
Note
If you are displaying a custom color, you will need to prevent your app from going to sleep while the LED is on; otherwise, the color will not display correctly. You can do this by returning false in your app_loop method.
- -
-
- -

◆ watch_set_led_green()

- -
-
- - - - - - - - -
void watch_set_led_green (void )
-
- -

Sets the green LED to full brightness, and turns the red LED off.

-

Of the two LED's in the RG bi-color LED, the green LED is the more power-efficient one (~0.44 mA).

Note
If your watch has a red/blue LED, this method will set the LED to blue.
- -
-
- -

◆ watch_set_led_red()

- -
-
- - - - - - - - -
void watch_set_led_red (void )
-
- -

Sets the red LED to full brightness, and turns the green LED off.

-

Of the two LED's in the RG bi-color LED, the red LED is the less power-efficient one (~4.5 mA).

- -
-
- -

◆ watch_set_led_yellow()

- -
-
- - - - - - - - -
void watch_set_led_yellow (void )
-
- -

Sets both red and green LEDs to full brightness.

-

The total current draw between the two LED's in this mode will be ~5 mA, which is more than the watch draws in any other mode. Take care not to drain the battery.

Note
If your watch has a red/blue LED, this method will set the LED to pink.
- -
-
-
- - - - diff --git a/group__rtc.html b/group__rtc.html deleted file mode 100644 index e7c63354..00000000 --- a/group__rtc.html +++ /dev/null @@ -1,431 +0,0 @@ - - - - - - - -Sensor Watch: Real-Time Clock - - - - - - - - - -
-
- - - - - - -
-
Sensor Watch -  0.0.0 -
-
A board replacement for the classic Casio F-91W wristwatch, powered by a Microchip SAM L22 microcontroller.
-
-
- - - - - - - -
- -
-
- - -
- -
- -
- -
-
Real-Time Clock
-
-
- -

This section covers functions related to the SAM L22's real-time clock peripheral, including date, time and alarm functions. -More...

- - - - -

-Data Structures

union  watch_date_time
 
- - - -

-Macros

-#define WATCH_RTC_REFERENCE_YEAR   (2020)
 
- - - -

-Typedefs

-typedef enum watch_rtc_alarm_match watch_rtc_alarm_match
 
- - - -

-Enumerations

enum  watch_rtc_alarm_match { ALARM_MATCH_DISABLED = 0 -, ALARM_MATCH_SS -, ALARM_MATCH_MMSS -, ALARM_MATCH_HHMMSS - }
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-Functions

-bool _watch_rtc_is_enabled (void)
 Called by main.c to check if the RTC is enabled. You may call this function, but outside of app_init, it should always return true.
 
void watch_rtc_set_date_time (watch_date_time date_time)
 Sets the date and time. More...
 
watch_date_time watch_rtc_get_date_time (void)
 Returns the date and time. More...
 
void watch_rtc_register_alarm_callback (ext_irq_cb_t callback, watch_date_time alarm_time, watch_rtc_alarm_match mask)
 Registers an alarm callback that will be called when the RTC time matches the target time, as masked by the provided mask. More...
 
-void watch_rtc_disable_alarm_callback (void)
 Disables the alarm callback.
 
void watch_rtc_register_tick_callback (ext_irq_cb_t callback)
 Registers a "tick" callback that will be called once per second. More...
 
-void watch_rtc_disable_tick_callback (void)
 Disables the tick callback for the given period.
 
void watch_rtc_register_periodic_callback (ext_irq_cb_t callback, uint8_t frequency)
 Registers a callback that will be called at a configurable period. More...
 
void watch_rtc_disable_periodic_callback (uint8_t frequency)
 Disables the tick callback for the given period. More...
 
-void watch_rtc_disable_all_periodic_callbacks (void)
 Disables all periodic callbacks, including the once-per-second tick callback.
 
 __attribute__ ((deprecated("Use watch_rtc_set_date_time function instead"))) void watch_set_date_time(struct calendar_date_time date_time)
 Sets the system date and time. More...
 
 __attribute__ ((deprecated("Use the watch_rtc_get_date_time function instead"))) void watch_get_date_time(struct calendar_date_time *date_time)
 Returns the system date and time in the provided struct. More...
 
 __attribute__ ((deprecated("Use the watch_rtc_register_tick_callback function instead"))) void watch_register_tick_callback(ext_irq_cb_t callback)
 Registers a "tick" callback that will be called once per second. More...
 
-

Detailed Description

-

This section covers functions related to the SAM L22's real-time clock peripheral, including date, time and alarm functions.

-

The real-time clock is the only peripheral that main.c enables for you. It is the cornerstone of low power operation on the watch, and it is required for several key functions that we assume will be available, namely the wake from BACKUP mode and the callback on the ALARM button. It is also required for the operation of the 1 Hz tick interrupt, which you will most likely use to wake from STANDBY mode.

-

Function Documentation

- -

◆ __attribute__() [1/3]

- -
-
- - - - - - - - -
__attribute__ ((deprecated("Use the watch_rtc_get_date_time function instead")) )
-
- -

Returns the system date and time in the provided struct.

-
Parameters
- - -
date_timeA pointer to a calendar_date_time struct. It will have with the correct date and time on return.
-
-
- -
-
- -

◆ __attribute__() [2/3]

- -
-
- - - - - - - - -
__attribute__ ((deprecated("Use the watch_rtc_register_tick_callback function instead")) )
-
- -

Registers a "tick" callback that will be called once per second.

-
Parameters
- - -
callbackThe function you wish to have called when the clock ticks. If you pass in NULL, the tick interrupt will still be enabled, but no callback function will be called.
-
-
- -
-
- -

◆ __attribute__() [3/3]

- -
-
- - - - - - - - -
__attribute__ ((deprecated("Use watch_rtc_set_date_time function instead")) )
-
- -

Sets the system date and time.

-
Parameters
- - -
date_timeA struct representing the date and time you wish to set.
-
-
- -
-
- -

◆ watch_rtc_disable_periodic_callback()

- -
-
- - - - - - - - -
void watch_rtc_disable_periodic_callback (uint8_t frequency)
-
- -

Disables the tick callback for the given period.

-
Parameters
- - -
frequencyThe frequency of the tick you wish to disable, in Hz. Must be a power of 2, from 1 to 128.
-
-
- -
-
- -

◆ watch_rtc_get_date_time()

- -
-
- - - - - - - - -
watch_date_time watch_rtc_get_date_time (void )
-
- -

Returns the date and time.

-
Returns
A watch_date_time with the current date and time, with a year value from 0-63 representing 2020-2083.
-
See also
watch_rtc_set_date_time for notes about how the year is stored.
- -
-
- -

◆ watch_rtc_register_alarm_callback()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
void watch_rtc_register_alarm_callback (ext_irq_cb_t callback,
watch_date_time alarm_time,
watch_rtc_alarm_match mask 
)
-
- -

Registers an alarm callback that will be called when the RTC time matches the target time, as masked by the provided mask.

-
Parameters
- - - - -
callbackThe function you wish to have called when the alarm fires. If this value is NULL, the alarm interrupt will still be enabled, but no callback function will be called.
alarm_timeThe time that you wish to match. The date is currently ignored.
maskOne of the values in watch_rtc_alarm_match indicating which values to check.
-
-
-

The alarm interrupt is a versatile tool for scheduling events in the future, especially since it can wake the device from all sleep modes. The key to its versatility is the mask parameter. Suppose we set an alarm for midnight, 00:00:00.

    -
  • if mask is ALARM_MATCH_SS, the alarm will fire every minute when the clock ticks to seconds == 0.
  • -
  • with ALARM_MATCH_MMSS, the alarm will once an hour, at the top of each hour.
  • -
  • with ALARM_MATCH_HHMMSS, the alarm will fire at midnight every day. In theory the SAM L22's alarm function can match on days, months and even years, but I have not had success with this yet; as such, I am omitting these options for now.
  • -
- -
-
- -

◆ watch_rtc_register_periodic_callback()

- -
-
- - - - - - - - - - - - - - - - - - -
void watch_rtc_register_periodic_callback (ext_irq_cb_t callback,
uint8_t frequency 
)
-
- -

Registers a callback that will be called at a configurable period.

-
Parameters
- - - -
callbackThe function you wish to have called at the specified period. If you pass in NULL, the periodic interrupt will still be enabled, but no callback function will be called.
frequencyThe frequency of the tick in Hz. Must be a power of 2, from 1 to 128 inclusive.
-
-
-
Note
A 1 Hz tick (
-
See also
watch_rtc_register_tick_callback) is suitable for most applications, in that it gives you a chance to update the display once a second — an ideal update rate for a watch! If however you are displaying a value (such as an accelerometer output) that updates more frequently than once per second, you may want to tick at 16 or 32 Hz to update the screen more quickly. Just remember that the more frequent the tick, the more power your Application Framework will consume. Ideally you should enable the fast tick only when the user requires it (i.e. in response to an input event), and move back to the slow tick after some time.
-

Also note that the RTC peripheral does not have sub-second resolution, so even if you set a 2 or 4 Hz interval, the system will not have any way of telling you where you are within a given second; watch_rtc_get_date_time will return the exact same timestamp until the second ticks over.

- -
-
- -

◆ watch_rtc_register_tick_callback()

- -
-
- - - - - - - - -
void watch_rtc_register_tick_callback (ext_irq_cb_t callback)
-
- -

Registers a "tick" callback that will be called once per second.

-
Parameters
- - -
callbackThe function you wish to have called when the clock ticks. If you pass in NULL, the tick interrupt will still be enabled, but no callback function will be called.
-
-
-
Note
this is equivalent to calling watch_rtc_register_periodic_callback with a frequency of 1. It can be disabled with either watch_rtc_disable_tick_callback() or watch_rtc_disable_periodic_callback(1), and will also be disabled when watch_rtc_disable_all_periodic_callbacks is called.
- -
-
- -

◆ watch_rtc_set_date_time()

- -
-
- - - - - - - - -
void watch_rtc_set_date_time (watch_date_time date_time)
-
- -

Sets the date and time.

-
Parameters
- - -
date_timeThe date and time you wish to set, with a year value from 0-63 representing 2020-2083.
-
-
-
Note
The SAM L22 stores the year as six bits representing a value from 0 to 63. It treats this as a year offset from a reference year, which must be a leap year. Since 2020 was a leap year, and it allows useful dates through 2083, it is assumed that watch apps will use 2020 as the reference year; thus 1 means 2021, 2 means 2022, etc. You will be responsible for handling this offset in your code, if the calendar year is needed for timestamp calculation logic or display purposes.
- -
-
-
- - - - diff --git a/group__slcd.html b/group__slcd.html deleted file mode 100644 index 945e3fcc..00000000 --- a/group__slcd.html +++ /dev/null @@ -1,541 +0,0 @@ - - - - - - - -Sensor Watch: Segment LCD Display - - - - - - - - - -
-
- - - - - - -
-
Sensor Watch -  0.0.0 -
-
A board replacement for the classic Casio F-91W wristwatch, powered by a Microchip SAM L22 microcontroller.
-
-
- - - - - - - -
- -
-
- - -
- -
- -
- -
-
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. More...
 
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. More...
 
-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. More...
 
-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. More...
 
void watch_clear_indicator (WatchIndicatorSegment indicator)
 Clears an indicator on the LCD. Use this to turn off one of the indicator segments. More...
 
void watch_clear_all_indicators (void)
 Clears all indicator segments. More...
 
void watch_start_character_blink (char character, uint32_t duration)
 Blinks a single character in position 7. Does not affect other positions. More...
 
void watch_stop_blink (void)
 Stops and clears all blinking segments. More...
 
void watch_start_tick_animation (uint32_t duration)
 Begins a two-segment "tick-tock" animation in position 8. More...
 
bool watch_tick_animation_is_running (void)
 Checks if the tick animation is currently running. More...
 
void watch_stop_tick_animation (void)
 Stops the tick/tock animation and clears all animating segments. More...
 
-

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

- -
-
- - - - -
enum 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)
-
-inline
-
- -

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 
)
-
-inline
-
- -

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)
-
-inline
-
- -

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 
)
-
-inline
-
- -

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.
- -
-
-
- - - - diff --git a/group__utility.html b/group__utility.html deleted file mode 100644 index 4c31d1e0..00000000 --- a/group__utility.html +++ /dev/null @@ -1,396 +0,0 @@ - - - - - - - -Sensor Watch: Utility Functions - - - - - - - - - -
-
- - - - - - -
-
Sensor Watch -  0.0.0 -
-
A board replacement for the classic Casio F-91W wristwatch, powered by a Microchip SAM L22 microcontroller.
-
-
- - - - - - - -
- -
-
- - -
- -
- -
- -
-
Utility Functions
-
-
- -

This section covers various useful functions that don't fit anywhere else. -More...

- - - - - - - - - - - - - - - - - - - - -

-Functions

const char * watch_utility_get_weekday (watch_date_time date_time)
 Returns a two-letter weekday for the given timestamp, suitable for display in positions 0-1 of the watch face. More...
 
uint32_t watch_utility_convert_to_unix_time (uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, uint32_t utc_offset)
 Returns the UNIX time (seconds since 1970) for a given date/time in UTC. More...
 
uint32_t watch_utility_date_time_to_unix_time (watch_date_time date_time, uint32_t utc_offset)
 Returns the UNIX time (seconds since 1970) for a given watch_date_time struct. More...
 
watch_date_time watch_utility_date_time_from_unix_time (uint32_t timestamp, uint32_t utc_offset)
 Returns the UNIX time (seconds since 1970) for a given watch_date_time struct. More...
 
watch_date_time watch_utility_date_time_convert_zone (watch_date_time date_time, uint32_t origin_utc_offset, uint32_t destination_utc_offset)
 Converts a time from a given time zone to another time zone. More...
 
float watch_utility_thermistor_temperature (uint16_t value, bool highside, float b_coefficient, float nominal_temperature, float nominal_resistance, float series_resistance)
 Returns a temperature in degrees Celsius for a given thermistor voltage divider circuit. More...
 
-

Detailed Description

-

This section covers various useful functions that don't fit anywhere else.

-

Function Documentation

- -

◆ watch_utility_convert_to_unix_time()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uint32_t watch_utility_convert_to_unix_time (uint16_t year,
uint8_t month,
uint8_t day,
uint8_t hour,
uint8_t minute,
uint8_t second,
uint32_t utc_offset 
)
-
- -

Returns the UNIX time (seconds since 1970) for a given date/time in UTC.

-
Parameters
- - - - - - - - - -
date_timeThe watch_date_time that you wish to convert.
yearThe year of the date you wish to convert.
monthThe month of the date you wish to convert.
dayThe day of the date you wish to convert.
hourThe hour of the date you wish to convert.
minuteThe minute of the date you wish to convert.
secondThe second of the date you wish to convert.
utc_offsetThe number of seconds that date_time is offset from UTC, or 0 if the time is UTC.
-
-
-
Returns
A UNIX timestamp for the given date/time and UTC offset.
-
Note
Implemented by Wesley Ellis (tahnok) and based on BSD-licensed code by Josh Haberman: https://blog.reverberate.org/2020/05/12/optimizing-date-algorithms.html
- -
-
- -

◆ watch_utility_date_time_convert_zone()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
watch_date_time watch_utility_date_time_convert_zone (watch_date_time date_time,
uint32_t origin_utc_offset,
uint32_t destination_utc_offset 
)
-
- -

Converts a time from a given time zone to another time zone.

-
Parameters
- - - - -
date_timeThe watch_date_time that you wish to convert
origin_utc_offsetThe number of seconds from UTC in the origin time zone
destination_utc_offsetThe number of seconds from UTC in the destination time zone
-
-
-
Returns
A watch_date_time for the given UNIX timestamp and UTC offset, or if outside the range that watch_date_time can represent, a watch_date_time with all fields set to 0.
-
Note
Adapted from MIT-licensed code from musl, Copyright © 2005-2014 Rich Felker, et al.: https://github.com/esmil/musl/blob/1cc81f5cb0df2b66a795ff0c26d7bbc4d16e13c6/src/time/__secs_to_tm.c
- -
-
- -

◆ watch_utility_date_time_from_unix_time()

- -
-
- - - - - - - - - - - - - - - - - - -
watch_date_time watch_utility_date_time_from_unix_time (uint32_t timestamp,
uint32_t utc_offset 
)
-
- -

Returns the UNIX time (seconds since 1970) for a given watch_date_time struct.

-
Parameters
- - - -
timestampThe UNIX timestamp that you wish to convert.
utc_offsetThe number of seconds that you wish date_time to be offset from UTC.
-
-
-
Returns
A watch_date_time for the given UNIX timestamp and UTC offset, or if outside the range that watch_date_time can represent, a watch_date_time with all fields set to 0.
-
Note
Adapted from MIT-licensed code from musl, Copyright © 2005-2014 Rich Felker, et al.: https://github.com/esmil/musl/blob/1cc81f5cb0df2b66a795ff0c26d7bbc4d16e13c6/src/time/__secs_to_tm.c
- -
-
- -

◆ watch_utility_date_time_to_unix_time()

- -
-
- - - - - - - - - - - - - - - - - - -
uint32_t watch_utility_date_time_to_unix_time (watch_date_time date_time,
uint32_t utc_offset 
)
-
- -

Returns the UNIX time (seconds since 1970) for a given watch_date_time struct.

-
Parameters
- - - -
date_timeThe watch_date_time that you wish to convert.
utc_offsetThe number of seconds that date_time is offset from UTC, or 0 if the time is UTC.
-
-
-
Returns
A UNIX timestamp for the given watch_date_time and UTC offset.
- -
-
- -

◆ watch_utility_get_weekday()

- -
-
- - - - - - - - -
const char* watch_utility_get_weekday (watch_date_time date_time)
-
- -

Returns a two-letter weekday for the given timestamp, suitable for display in positions 0-1 of the watch face.

-
Parameters
- - -
date_timeThe watch_date_time whose weekday you want.
-
-
- -
-
- -

◆ watch_utility_thermistor_temperature()

- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
float watch_utility_thermistor_temperature (uint16_t value,
bool highside,
float b_coefficient,
float nominal_temperature,
float nominal_resistance,
float series_resistance 
)
-
- -

Returns a temperature in degrees Celsius for a given thermistor voltage divider circuit.

-
Parameters
- - - - - - - -
valueThe raw analog reading from the thermistor pin (0-65535)
highsideTrue if the thermistor is connected to VCC and the series resistor is connected to GND; false if the thermistor is connected to GND and the series resistor is connected to VCC.
b_coefficientFrom your thermistor's data sheet, the B25/85 coefficient. A typical value will be between 2000 and 5000.
nominal_temperatureFrom your thermistor's data sheet, the temperature (in Celsius) at which the thermistor's resistance is at its nominal value.
nominal_resistanceThe thermistor's resistance at the nominal temperature.
series_resistanceThe value of the other resistor in the voltage divider.
-
-
-
Note
Ported from Adafruit's MIT-licensed CircuitPython thermistor code, (c) 2017 Scott Shawcroft: https://github.com/adafruit/Adafruit_CircuitPython_Thermistor/blob/main/adafruit_thermistor.py
- -
-
-
- - - - diff --git a/index.html b/index.html index 42a25091..69142487 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ -Sensor Watch: Sensor Watch Documentation +Sensor Watch: Main Page @@ -62,25 +62,11 @@ $(function() { -
+
-
Sensor Watch Documentation
+
Sensor Watch Documentation
-

This documentation covers most of the functions you will use to interact with the Sensor Watch hardware. It is divided into the following sections:

    -
  • Application Framework - This section covers the functions that you will implement in your app.c file when designing a Sensor Watch app.
  • -
  • Real-Time Clock - This section covers functions related to the SAM L22's real-time clock peripheral, including date, time and alarm 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.
  • -
  • Buttons & External Interrupts - This section covers functions related to the three buttons: Light, Mode and Alarm.
  • -
  • LED Control - This section covers functions related to the bi-color red/green LED mounted behind the LCD.
  • -
  • Buzzer - This section covers functions related to the piezo buzzer.
  • -
  • Analog Input - This section covers functions related to the SAM L22's analog-to-digital converter, as well as configuring and reading values from the five analog-capable pins on the 9-pin connector.
  • -
  • Digital Input and Output - This section covers functions related to general-purpose input and output signals.
  • -
  • I2C Controller Driver - This section covers functions related to the SAM L22's built-I2C driver, including configuring the I2C bus, putting values directly on the bus and reading data from registers on I2C devices.
  • -
  • Debug UART - This section covers functions related to the debug UART, available on pin D1 of the 9-pin connector.
  • -
  • Sleep Control - This section covers functions related to preparing for and entering BACKUP mode, the deepest sleep mode available on the SAM L22.
  • -
-