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

Implement STM32 RTC alarms #3834

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

markus-k
Copy link
Contributor

@markus-k markus-k commented Feb 2, 2025

Implements setting up and awaiting RTC alarms.

Example:

    let mut rtc = Rtc::new(p.RTC, RtcConfig::default());

    rtc.set_alarm(
        Alarm::A,
        RtcAlarmMatch {
            subsecond: None,
            second: None,
            minute: None,
            hour: None,
            hour_is_pm: false,
            date: None,
        },
    );

    // would wait until the second increments
    rtc.wait_for_alarm(Alarm::A).await;

Still quite WIP as the different stm32 lines differ quite a bit in EXTI/IRQs. So far tested on STM32 G0, G4, L0 and F3.

Posting this here already to gather some feedback, if there is any. Maybe the actual implementation should be moved to the v2/v3 modules as they do differ quite a bit and need lots of conditionals.

Needs embassy-rs/stm32-data#565 and embassy-rs/stm32-data#564 merged and released in stm32-data.

Implements setting up and awaiting RTC alarms. Still quite WIP
as the differnt stm32 lines differ quite a bit in EXTI/IRQs.

So far tested on STM32 G0, G4, L0 and F3.
@Dirbaio
Copy link
Member

Dirbaio commented Feb 2, 2025

Needs embassy-rs/stm32-data#565 and embassy-rs/stm32-data#564 merged and released in stm32-data.

now that they're merged, switch embassy-stm32 to use stm32-data from git (uncomment the two lines, update the commit hash). We do stm32-metapac+embassy-stm32 releases at the same time.

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

Successfully merging this pull request may close these issues.

2 participants