Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- PWM output on complementary channels only for single channel timers (TIM16 + TIM17)
- impl embedded_hal_1::spi::SpiBus for SPI
- impl embedded_hal_1::digital traits for Pins
- impl core::{Deref, DerefMut} for Rcc

### Fixed

Expand Down
15 changes: 15 additions & 0 deletions src/rcc.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::pac::RCC;
use crate::time::Hertz;
use core::ops::{Deref, DerefMut};

/// Extension trait that sets up the `RCC` peripheral
pub trait RccExt {
Expand Down Expand Up @@ -45,6 +46,20 @@ pub struct Rcc {
pub(crate) regs: RCC,
}

impl Deref for Rcc {
type Target = RCC;

fn deref(&self) -> &Self::Target {
&self.regs
}
}

impl DerefMut for Rcc {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.regs
}
}

pub enum HSEBypassMode {
/// Not bypassed: for crystals
NotBypassed,
Expand Down
Loading