Zephyr API Documentation 4.0.0-rc2
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
maxim_ds3231_alarm Struct Reference

Information defining the alarm configuration. More...

#include <maxim_ds3231.h>

Data Fields

time_t time
 Time specification for an RTC alarm.
 
maxim_ds3231_alarm_callback_handler_t handler
 Handler to be invoked when alarms are signalled.
 
void * user_data
 User-provided pointer passed to alarm callback.
 
uint8_t flags
 Flags controlling configuration of the alarm alarm.
 

Detailed Description

Information defining the alarm configuration.

DS3231 alarms can be set to fire at specific times or at the rollover of minute, hour, day, or day of week.

When an alarm is configured with a handler an interrupt will be generated and the handler called from the system work queue.

When an alarm is configured without a handler, or a persisted alarm is present, alarms can be read using maxim_ds3231_check_alarms().

Field Documentation

◆ flags

uint8_t maxim_ds3231_alarm::flags

Flags controlling configuration of the alarm alarm.

See MAXIM_DS3231_ALARM_FLAGS_IGNSE and related constants.

Note that as described the alarm mask fields require that if a unit is not ignored, higher-precision units must also not be ignored. For example, if match on hours is enabled, match on minutes and seconds must also be enabled. Failure to comply with this requirement will cause maxim_ds3231_set_alarm() to return an error, leaving the alarm configuration unchanged.

◆ handler

maxim_ds3231_alarm_callback_handler_t maxim_ds3231_alarm::handler

Handler to be invoked when alarms are signalled.

If this is null the alarm will not be triggered by the INTn/SQW GPIO. This is a "persisted" alarm from its role in using the DS3231 to trigger a wake from deep sleep. The application should use maxim_ds3231_check_alarms() to determine whether such an alarm has been triggered.

If this is not null the driver will monitor the ISW GPIO for alarm signals and will invoke the handler with a parameter carrying the value returned by maxim_ds3231_check_alarms(). The corresponding status flags will be cleared in the device before the handler is invoked.

The handler will be invoked from the system work queue.

◆ time

time_t maxim_ds3231_alarm::time

Time specification for an RTC alarm.

Though specified as a UNIX time, the alarm parameters are determined by converting to civil time and interpreting the component hours, minutes, seconds, day-of-week, and day-of-month fields, mediated by the corresponding flags.

The year and month are ignored, but be aware that gmtime() determines day-of-week based on calendar date. Decoded alarm times will fall within 1978-01 since 1978-01-01 (first of month) was a Sunday (first of week).

◆ user_data

void* maxim_ds3231_alarm::user_data

User-provided pointer passed to alarm callback.


The documentation for this struct was generated from the following file: