Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rtc mix sketch #94

Closed
wants to merge 7 commits into from
Closed

Rtc mix sketch #94

wants to merge 7 commits into from

Conversation

FRASTM
Copy link
Contributor

@FRASTM FRASTM commented Jul 3, 2023

This examples is configuring the RTC in MIX mode
(binary + calendar BCD) and set Alarm B (if exists)
few ticks after the current time, whenAlarm A is set
in calendar mode.
Mainly used on stm32wl55 devices.

Requires #93

@FRASTM
Copy link
Contributor Author

FRASTM commented Jul 3, 2023

Running on the nucleo_wl55jc:

10:40:10.494 -> start at subsec = 18
10:40:10.494 -> set Alarm A 
10:40:10.494 -> set Alarm B at = 318
10:40:10.494 -> Alarm B Match! at subsec = 318
10:40:11.703 -> Alarm A Match! at subsec = 1280

This is valid when the RTC_BINARY_MIX mode exists in the RTC
(bitfield in the RTC ICSR register)
Set the RTC mode through a setBinaryMode function to be called
before begin.

Signed-off-by: Francois Ramu <[email protected]>
@FRASTM FRASTM force-pushed the rtc_mix_sketch branch 4 times, most recently from b96c037 to 8f3732b Compare July 11, 2023 11:12
@FRASTM FRASTM force-pushed the rtc_mix_sketch branch 2 times, most recently from a6c929f to be6a565 Compare September 7, 2023 09:03
configure the Alarm with Second mask --> trigs IRQHandler
The Autoclear bit field depends on the RTC ALARM  SSR register.

Signed-off-by: Francois Ramu <[email protected]>
When the RTC is running in MIX mode (bianry and calendar),
the ssub-second register is a 32-bit value which must not be converted
in ms

Signed-off-by: Francois Ramu <[email protected]>
In case the RTC is running in MIX mode (BINary and calendar),
the subsecond register is a 32-bit value (and not msec)

Signed-off-by: Francois Ramu <[email protected]>
@FRASTM FRASTM marked this pull request as ready for review September 7, 2023 11:58
@FRASTM FRASTM force-pushed the rtc_mix_sketch branch 4 times, most recently from 58ace9d to 7653a11 Compare September 8, 2023 14:45
Set the subsecond for the alarm value.
Add the HAL_MSP_Init/DeInit function from the rtc library.

Signed-off-by: Francois Ramu <[email protected]>
The binaryMode_t is retrieved directly from the RTC mode,
not as a parameter.
The Subsecond parameter is expressed in millisecond in
RTC_SetTime/GetTime RTC_StartAlarm/GetAlarm

Signed-off-by: Francois Ramu <[email protected]>
This examples is configuring the RTC in MIX mode
(binary + calendar BCD) and set Alarm B (if exists)
few ms after the current time, whenAlarm A is set
in calendar mode.
Mainly used on stm32wl55 devices.
@FRASTM
Copy link
Contributor Author

FRASTM commented Sep 8, 2023

Now sketch is in the #93

@FRASTM FRASTM closed this Sep 8, 2023
@fpistm fpistm added the duplicate This issue or pull request already exists label Sep 8, 2023
@FRASTM FRASTM deleted the rtc_mix_sketch branch September 13, 2023 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
Development

Successfully merging this pull request may close these issues.

2 participants