-
Notifications
You must be signed in to change notification settings - Fork 9
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
First pass at watchdog #3
base: master
Are you sure you want to change the base?
Conversation
Some links Looks like 2 different peripherals at least. Very similar, but maybe more in series 1, this implementation is series 0 EFM32 Series 0 consists of: https://www.silabs.com/documents/public/application-notes/an0015.1-efr32-efm32-series-1-watchdog.pdf |
Self { wdog } | ||
} | ||
|
||
fn free(self) -> registers::WDOG { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there precedent in any other HAL for using free
for the "undo the construction step" operation?
I'm using .destroy
in thunderboard-sltb001a BSC, not sure I had a reference there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[cfg(feature = "unproven")] | ||
#[allow(dead_code)] | ||
impl Watchdog { | ||
pub fn new(wdog: registers::WDOG) -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To get a usable watchdog, some clock needs to be routed there, and should not be deconfigurable before freeing (destroying, see below) the watchdog first.
In the EFM32GG that clock is WDOGCLK configurable from ULRFCO, LFRCO or LFXO; I think this should be a with_clock
(or any better unification of that name) a with other peripherals.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then well have to not use the embedded_hal implementation. Not that I care
Doesn't have any new up config (as we dont need it, our bootloader set us up)