Skip to Content
Block descriptionsRTCRTC Alarm in Set Mode

RTC Alarm Set Block Description

The RTC Alarm block operating in Set mode enables the configuration and initialization of an RTC hardware alarm. To retrieve information regarding the currently active alarm parameters, use the RTC Alarm Get Block. The block responsible for handling the generated hardware interrupt signal is detailed on the RTC Alarm IRQ subpage.



RTC Alarm Set block

Table of Contents

Inputs

Input NameTypeDescription
Houruint8The target hour parameter to be set for the RTC alarm.
Minuint8The target minute parameter to be set for the RTC alarm.
Secuint8The target second parameter to be set for the RTC alarm.
Maskuint32The main time and date mask bitfield configuration. Maps directly to the masking bits within the hardware RTC_ALRMAR (or RTC_ALRMBR) registers. Setting a specific bit to 1 forces the hardware comparator to ignore that time unit when validating the alarm trigger.
Bitfield Combinations:
0x00000080 (bit MSK1) – masks seconds validation.
0x00008000 (bit MSK2) – masks minutes validation.
0x00800000 (bit MSK3) – masks hours validation.
0x80000000 (bit MSK4) – masks date/day validation (month or week day variant).
SubSecond Maskuint32The subseconds fractional bitfield mask configuration. Maps directly to the MASKSS[3:0] bits within the hardware RTC_ALRMASSR (or RTC_ALRMBSSR) registers. Dictates the range of least significant bits in the fractional down-counter ignored during evaluation.
Values:
0x00000000 – masking inactive; all fractional subsecond register bits are matched.
0x01000000 to 0x0E000000 – sequential bit mask scaling spanning ranges from position [0] up to [14:0].
0x0F000000 – complete mask coverage; subseconds matching constraints are ignored entirely.
Date WeekDay Seluint32Day type operational mode evaluation filter selector. Maps directly to the WDSEL bit within the hardware RTC_ALRMAR (or RTC_ALRMBR) registers. Controls how the underlying field value matches temporal parameters.
Values:
0x00000000 – WDSEL bit cleared to 0 (interprets value directly as a calendar day of the month).
0x40000000 – WDSEL bit asserted to 1 (interprets value directly as a dedicated day of the week).
Date Week Dayuint32The raw day register target value matched for the active alarm event. Maps to the tens/units bits DT[1:0] / DU[3:0] (for calendar month day mode) or the raw lower units bits DU[2:0] (for week day mode) inside the hardware RTC_ALRMAR (or RTC_ALRMBR) registers.
Values:
For DATE mode: formatted BCD values spanning from 0x01 to 0x31 (mapped at register index [29:24]).
For WEEKDAY mode: formatted BCD values spanning from 0x01 (Monday) to 0x07 (Sunday) (mapped at register index [26:24]).

Outputs

Output NameTypeDescription
StatusboolThe operational status of the RTC alarm write routing:
1 – alarm configured and written successfully
0 – failed to execute alarm write query

Block Parameters

ParameterDescription
Get or Set AlarmSelects the active operational mode for the RTC Alarm block interface:
Set Alarm – writes a custom configuration profile down to the RTC hardware.
Get Alarm – reads the current baseline configuration back from the RTC hardware.
Type of alarm IRQSpecifies the target hardware interrupt routing channel category:
RTC_ALARM_A – main Alarm A pipeline channel used to schedule events or trigger hardware wakeups.
RTC_ALARM_B – auxiliary Alarm B pipeline channel running asynchronously and fully independent of Alarm A.
RTC_WAKEUP – high-efficiency cyclic Wake Up timer channel.
RTC formatDetermines the raw encoding schema parsed across data paths:
RTC_FORMAT_BIN – conventional standard binary standard integer parsing format.
RTC_FORMAT_BCD – Binary-Coded Decimal notation schema; individual digits are isolated into discrete 4-bit nibbles.
Sample timeSpecifies the software cyclic refresh execution update interval for the block.


Parameters for RTC Alarm block in Set mode

CubeMX Configuration for a Given MCU Model

The baseline hardware peripheral setup required for the RTC is detailed in the dedicated CubeMX Configuration for a Given MCU Model subpage.

See Also

Last updated on