Repository navigation
Conversation
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]>
Contributor
Author
|
with this PR and running the sketch mixRTCAlarm: |
FRASTM
force-pushed
the
rtc_mix_millisec
branch
3 times, most recently
from
July 11, 2023 11:11
adeb2e4 to
614cc5c
Compare
FRASTM
force-pushed
the
rtc_mix_millisec
branch
2 times, most recently
from
July 21, 2023 12:37
45d9df2 to
87aec09
Compare
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]>
Set the subsecond for the alarm value. 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]>
FRASTM
force-pushed
the
rtc_mix_millisec
branch
from
September 7, 2023 08:18
87aec09 to
93aac7a
Compare
Contributor
Author
|
Now squashed in #93 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
STM32RTC APi has subsecond parameter which is a value in milliseconds
Becasue of the BINARY MIX mode, the parameter subsecond could be confusing as the subsecond register of the RTC is:
For example, in MIX mode, when RTC is clocked by the LSE (32768Hz) the tick is downcounting at 256Hz
(1 tick is ~ 3.9ms )
The RTC subsecond register is converted in ms by
(0xFFFFFFFF - SubSecReg) * 1000/256And N miliseconds is converted in ticks (count unit) by
0xFFFFFFFF - (SubSecReg * 256) /1000With this PR, the STM32RTC API is always giving the subsecond parameter in a nb of milliseconds.
Especially with functions:
getSubSeconds() and getTime()
getAlarmSubSeconds()
setAlarmSubSeconds() and setAlarmTime()
setSubSeconds() and setTime() (but Subsecond value is ignored there RO register)