Skip to content

Rtc v2 #136

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 32 commits into from
Sep 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e01c533
added DAC with basic features
David-OConnor Sep 1, 2020
6bd5df1
added dac example
David-OConnor Sep 1, 2020
d7a6388
moved rprintln
David-OConnor Sep 1, 2020
71a7472
fixed some bugs
David-OConnor Sep 1, 2020
0b62bf2
Disable clocks on disable
David-OConnor Sep 1, 2020
a0a536b
Fixed typo
David-OConnor Sep 1, 2020
dc1f6b4
fmt
David-OConnor Sep 1, 2020
1da6b83
Only support dac on f303
David-OConnor Sep 1, 2020
4bc1152
Tweaked example
David-OConnor Sep 1, 2020
d070c5e
Updated trait
David-OConnor Sep 2, 2020
ee997be
Added trigger support
David-OConnor Sep 2, 2020
6a6130a
Cleaned up RTC module a bit
David-OConnor Sep 3, 2020
6c504cd
synced rcc.rs
David-OConnor Sep 3, 2020
ba64ec9
only allow dac on 303
David-OConnor Sep 3, 2020
f9f8932
Addressed more of the rtc review
David-OConnor Sep 3, 2020
2d332a8
More RTC tweaks: Bug fixes, and review changes
David-OConnor Sep 3, 2020
d555dde
More rtc tweaks
David-OConnor Sep 3, 2020
1cb53a8
Travis fix
David-OConnor Sep 3, 2020
ecbd13c
Fixed a bug with hours_to_register
David-OConnor Sep 3, 2020
404070c
Ran clippy
David-OConnor Sep 3, 2020
e5c8147
Removed rtc code
David-OConnor Sep 3, 2020
c722478
First commit
David-OConnor Sep 3, 2020
87ab0a2
Removed dac example in cargo.toml
David-OConnor Sep 3, 2020
350ac46
Added note about prediv_s and prediv_a, with reference
David-OConnor Sep 3, 2020
5600431
fmt/travis
David-OConnor Sep 4, 2020
35905a2
Many tweaks
David-OConnor Sep 4, 2020
be05905
More review changes
David-OConnor Sep 4, 2020
835939c
fmt/travis
David-OConnor Sep 4, 2020
c6f0e58
More cleanup
David-OConnor Sep 6, 2020
17472a9
Changed some modify to write
David-OConnor Sep 8, 2020
d443bd1
Added changelog entry
David-OConnor Sep 8, 2020
994a7b3
Merge branch 'master' into rtc
David-OConnor Sep 8, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Support for 16-bit words with SPI ([#107](https://github.com/stm32-rs/stm32f3xx-hal/pull/107))
- SPI support for reclock after initialization ([#98](https://github.com/stm32-rs/stm32f3xx-hal/pull/98))
- Support for `stm32f302x6` and `stm32f302x8` devices ([#132](https://github.com/stm32-rs/stm32f3xx-hal/pull/132))
- Support for the onboard real-time clock (RTC) ([#136](https://github.com/stm32-rs/stm32f3xx-hal/pull/136))

## [v0.5.0] - 2020-07-21

Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ embedded-dma = "0.1"
embedded-hal = "0.2"
nb = "0.1"
stm32f3 = "0.11"
rtcc = "0.2"

[dependencies.bare-metal]
version = "0.2"
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ pub mod pwm;
#[cfg(feature = "device-selected")]
pub mod rcc;
#[cfg(feature = "device-selected")]
pub mod rtc;
#[cfg(feature = "device-selected")]
pub mod serial;
#[cfg(feature = "device-selected")]
pub mod spi;
Expand Down
15 changes: 15 additions & 0 deletions src/rcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ impl RccExt for RCC {
ahb: AHB { _0: () },
apb1: APB1 { _0: () },
apb2: APB2 { _0: () },
bdcr: BDCR { _0: () },
cfgr: CFGR {
hse: None,
hclk: None,
Expand Down Expand Up @@ -48,6 +49,8 @@ pub struct Rcc {
pub apb1: APB1,
/// Advanced Peripheral Bus 2 (APB2) registers
pub apb2: APB2,
/// RCC Backup Domain
pub bdcr: BDCR,
/// Clock configuration
pub cfgr: CFGR,
}
Expand Down Expand Up @@ -190,6 +193,18 @@ mod usb_clocking {
}
}

/// Backup Domain Control register (RCC_BDCR)
pub struct BDCR {
_0: (),
}

impl BDCR {
pub(crate) fn bdcr(&mut self) -> &rcc::BDCR {
// NOTE(unsafe) this proxy grants exclusive access to this register
unsafe { &(*RCC::ptr()).bdcr }
}
}

/// Clock configuration
///
/// An instance of this struct is aquired from the [Rcc](../struct.Rcc.html) struct.
Expand Down
Loading