Skip to content

stm32F1 set/get prescaler div interface change #56

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

Merged
merged 2 commits into from
Nov 23, 2021

Conversation

FRASTM
Copy link
Contributor

@FRASTM FRASTM commented Nov 19, 2021

This PR is defining the set/getPrediv functions in case of stm32F1
With this soc device, the prescaler is a 32bit value corresponding to the DIV registers (read-only) or PREScaler registers (write-only). This configuration is adapted to keep the interface unchanged for other soc.
The prediv variable is keeping the value read or written.
The RTC_init is not changed.

This PR supersed #38

Requires the change in the stm32duino/STM32Examples : stm32duino/STM32Examples#53

Signed-off-by: Francois Ramu [email protected]

@FRASTM FRASTM force-pushed the f1_pdiv branch 3 times, most recently from 59ddcf4 to 9103ae5 Compare November 22, 2021 08:32
@FRASTM FRASTM closed this Nov 22, 2021
@FRASTM FRASTM deleted the f1_pdiv branch November 22, 2021 08:33
@FRASTM FRASTM restored the f1_pdiv branch November 22, 2021 08:33
@FRASTM FRASTM reopened this Nov 22, 2021
@FRASTM
Copy link
Contributor Author

FRASTM commented Nov 22, 2021

Requires change in the ./Arduino/libraries/STM32duino_Examples/examples/NonReg/RTC/RTC_Tests
for the stm32F1 to have a prediv mapped on a 32bit value

@FRASTM
Copy link
Contributor Author

FRASTM commented Nov 22, 2021

Creating new set/get prediv interface for the stm32F1 where parameters differ from other soc series.

Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default value should be RTC_AUTO_1_SECOND then uin32_t should be used to avoid cast?

@fpistm fpistm added the enhancement New feature or request label Nov 22, 2021
@fpistm fpistm added this to the 1.2.0 milestone Nov 22, 2021
@FRASTM
Copy link
Contributor Author

FRASTM commented Nov 22, 2021

with suggested changes, removing parameters when useless
Changing the function help for the stm32F1

Using the stm32F1 existing functions to write/read the
RTC prescaler registers (hold by the prediv var).
In that case only one param is considered.

Signed-off-by: Francois Ramu <[email protected]>
The stm32F1 prescaler is asynchronous and mapped on a 32bit param.

Signed-off-by: Francois Ramu <[email protected]>
@FRASTM
Copy link
Contributor Author

FRASTM commented Nov 22, 2021

add declaration in the rtc.h
changing comment and function help section

Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants