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 binary only mode subseconds param. expressed in milliseconds #101

Closed
wants to merge 17 commits into from

Conversation

FRASTM
Copy link
Contributor

@FRASTM FRASTM commented Sep 21, 2023

When the RTC is configured in BINARY only mode, only the Subsecond register is used
The getTime is a getSubSeconds with subSeconds parameter as a 32bit number of millliseconds
The setAlarm is a setAlarmSubSeconds with subSeconds parameter as a 32bit number of millliseconds
The getDate returns 0
The setTime has no effect execpt resetting the subseconds counter.
The setDate has no effect .

based on #93

fpistm and others added 11 commits September 15, 2023 10:01
else this prevent isConfigured(void) to return correct value.

Signed-off-by: Frederic Pillon <[email protected]>
prediv was not properly computed and some misalignment's
could occur depending of the RTC state at init.

Signed-off-by: Frederic Pillon <[email protected]>
(a)synchronous prescalers values depend on the RTC clock source.

Signed-off-by: Frederic Pillon <[email protected]>
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]>
Co-authored-by: Frederic Pillon <[email protected]>
Formatted with Arduino astyle.

Signed-off-by: Frederic Pillon <[email protected]>
Configure the alarm depending on the MIX mode
In case the RTC is running in MIX mode (binary and calendar),
the subsecond register is a 32-bit value (and not msec)

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 (binary + calendar) or BCD
and sets Alarm A & B (if exists) few ms after the current time.

Signed-off-by: Francois Ramu <[email protected]>
In BIN ONLY mode, the Time and Date registers are 0.
The Subsecond param in expressed in a nb of milliseconds
on a 32-bit value.

Signed-off-by: Francois Ramu <[email protected]>
This examples is configuring the RTC in BIN mode (binary only)
and sets Alarm A & B (if exists) a few ms after the current time.

Signed-off-by: Francois Ramu <[email protected]>
@fpistm fpistm closed this Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

2 participants