diff options
| author | Robin Mueller <[email protected]> | 2025-09-22 00:43:02 +0200 |
|---|---|---|
| committer | Robin Mueller <[email protected]> | 2025-09-22 00:45:29 +0200 |
| commit | d1b55faace4b5059c726d94dd2d7f1ad3805ab48 (patch) | |
| tree | 569ff71846b17f13a61504b6b88ebcd5ef184c16 | |
| parent | f7c3005345df07bad5c42612fd73974bd569affb (diff) | |
code review changes
| -rw-r--r-- | embassy-nrf/src/chips/nrf51.rs | 2 | ||||
| -rw-r--r-- | embassy-nrf/src/chips/nrf52805.rs | 4 | ||||
| -rw-r--r-- | embassy-nrf/src/chips/nrf52810.rs | 2 | ||||
| -rw-r--r-- | embassy-nrf/src/chips/nrf52811.rs | 2 | ||||
| -rw-r--r-- | embassy-nrf/src/chips/nrf52820.rs | 2 | ||||
| -rw-r--r-- | embassy-nrf/src/chips/nrf52832.rs | 2 | ||||
| -rw-r--r-- | embassy-nrf/src/chips/nrf52833.rs | 2 | ||||
| -rw-r--r-- | embassy-nrf/src/chips/nrf52840.rs | 2 | ||||
| -rw-r--r-- | embassy-nrf/src/chips/nrf5340_app.rs | 2 | ||||
| -rw-r--r-- | embassy-nrf/src/chips/nrf5340_net.rs | 2 | ||||
| -rw-r--r-- | embassy-nrf/src/chips/nrf9120.rs | 2 | ||||
| -rw-r--r-- | embassy-nrf/src/chips/nrf9160.rs | 2 | ||||
| -rw-r--r-- | embassy-nrf/src/rtc.rs | 15 |
13 files changed, 29 insertions, 12 deletions
diff --git a/embassy-nrf/src/chips/nrf51.rs b/embassy-nrf/src/chips/nrf51.rs index 393af4e75..3976e8ff0 100644 --- a/embassy-nrf/src/chips/nrf51.rs +++ b/embassy-nrf/src/chips/nrf51.rs | |||
| @@ -8,6 +8,7 @@ pub const FLASH_SIZE: usize = 128 * 1024; | |||
| 8 | embassy_hal_internal::peripherals! { | 8 | embassy_hal_internal::peripherals! { |
| 9 | // RTC | 9 | // RTC |
| 10 | RTC0, | 10 | RTC0, |
| 11 | #[cfg(not(feature = "time-driver-rtc1"))] | ||
| 11 | RTC1, | 12 | RTC1, |
| 12 | 13 | ||
| 13 | // WDT | 14 | // WDT |
| @@ -111,6 +112,7 @@ impl_timer!(TIMER2, TIMER2, TIMER2); | |||
| 111 | impl_rng!(RNG, RNG, RNG); | 112 | impl_rng!(RNG, RNG, RNG); |
| 112 | 113 | ||
| 113 | impl_rtc!(RTC0, RTC0, RTC0); | 114 | impl_rtc!(RTC0, RTC0, RTC0); |
| 115 | #[cfg(not(feature = "time-driver-rtc1"))] | ||
| 114 | impl_rtc!(RTC1, RTC1, RTC1); | 116 | impl_rtc!(RTC1, RTC1, RTC1); |
| 115 | 117 | ||
| 116 | impl_pin!(P0_00, 0, 0); | 118 | impl_pin!(P0_00, 0, 0); |
diff --git a/embassy-nrf/src/chips/nrf52805.rs b/embassy-nrf/src/chips/nrf52805.rs index 427298a56..63ba6999a 100644 --- a/embassy-nrf/src/chips/nrf52805.rs +++ b/embassy-nrf/src/chips/nrf52805.rs | |||
| @@ -12,6 +12,7 @@ pub const APPROTECT_MIN_BUILD_CODE: u8 = b'B'; | |||
| 12 | embassy_hal_internal::peripherals! { | 12 | embassy_hal_internal::peripherals! { |
| 13 | // RTC | 13 | // RTC |
| 14 | RTC0, | 14 | RTC0, |
| 15 | #[cfg(not(feature="time-driver-rtc1"))] | ||
| 15 | RTC1, | 16 | RTC1, |
| 16 | 17 | ||
| 17 | // WDT | 18 | // WDT |
| @@ -157,6 +158,7 @@ impl_timer!(TIMER1, TIMER1, TIMER1); | |||
| 157 | impl_timer!(TIMER2, TIMER2, TIMER2); | 158 | impl_timer!(TIMER2, TIMER2, TIMER2); |
| 158 | 159 | ||
| 159 | impl_rtc!(RTC0, RTC0, RTC0); | 160 | impl_rtc!(RTC0, RTC0, RTC0); |
| 161 | #[cfg(not(feature = "time-driver-rtc1"))] | ||
| 160 | impl_rtc!(RTC1, RTC1, RTC1); | 162 | impl_rtc!(RTC1, RTC1, RTC1); |
| 161 | 163 | ||
| 162 | impl_pin!(P0_00, 0, 0); | 164 | impl_pin!(P0_00, 0, 0); |
| @@ -237,12 +239,12 @@ embassy_hal_internal::interrupt_mod!( | |||
| 237 | TIMER0, | 239 | TIMER0, |
| 238 | TIMER1, | 240 | TIMER1, |
| 239 | TIMER2, | 241 | TIMER2, |
| 240 | RTC0, | ||
| 241 | TEMP, | 242 | TEMP, |
| 242 | RNG, | 243 | RNG, |
| 243 | ECB, | 244 | ECB, |
| 244 | AAR_CCM, | 245 | AAR_CCM, |
| 245 | WDT, | 246 | WDT, |
| 247 | RTC0, | ||
| 246 | RTC1, | 248 | RTC1, |
| 247 | QDEC, | 249 | QDEC, |
| 248 | EGU0_SWI0, | 250 | EGU0_SWI0, |
diff --git a/embassy-nrf/src/chips/nrf52810.rs b/embassy-nrf/src/chips/nrf52810.rs index c99b54265..7f744f9fb 100644 --- a/embassy-nrf/src/chips/nrf52810.rs +++ b/embassy-nrf/src/chips/nrf52810.rs | |||
| @@ -12,6 +12,7 @@ pub const APPROTECT_MIN_BUILD_CODE: u8 = b'E'; | |||
| 12 | embassy_hal_internal::peripherals! { | 12 | embassy_hal_internal::peripherals! { |
| 13 | // RTC | 13 | // RTC |
| 14 | RTC0, | 14 | RTC0, |
| 15 | #[cfg(not(feature="time-driver-rtc1"))] | ||
| 15 | RTC1, | 16 | RTC1, |
| 16 | 17 | ||
| 17 | // WDT | 18 | // WDT |
| @@ -167,6 +168,7 @@ impl_timer!(TIMER1, TIMER1, TIMER1); | |||
| 167 | impl_timer!(TIMER2, TIMER2, TIMER2); | 168 | impl_timer!(TIMER2, TIMER2, TIMER2); |
| 168 | 169 | ||
| 169 | impl_rtc!(RTC0, RTC0, RTC0); | 170 | impl_rtc!(RTC0, RTC0, RTC0); |
| 171 | #[cfg(not(feature = "time-driver-rtc1"))] | ||
| 170 | impl_rtc!(RTC1, RTC1, RTC1); | 172 | impl_rtc!(RTC1, RTC1, RTC1); |
| 171 | 173 | ||
| 172 | impl_pin!(P0_00, 0, 0); | 174 | impl_pin!(P0_00, 0, 0); |
diff --git a/embassy-nrf/src/chips/nrf52811.rs b/embassy-nrf/src/chips/nrf52811.rs index 5f7a67f06..908167e31 100644 --- a/embassy-nrf/src/chips/nrf52811.rs +++ b/embassy-nrf/src/chips/nrf52811.rs | |||
| @@ -12,6 +12,7 @@ pub const APPROTECT_MIN_BUILD_CODE: u8 = b'B'; | |||
| 12 | embassy_hal_internal::peripherals! { | 12 | embassy_hal_internal::peripherals! { |
| 13 | // RTC | 13 | // RTC |
| 14 | RTC0, | 14 | RTC0, |
| 15 | #[cfg(not(feature="time-driver-rtc1"))] | ||
| 15 | RTC1, | 16 | RTC1, |
| 16 | 17 | ||
| 17 | // WDT | 18 | // WDT |
| @@ -169,6 +170,7 @@ impl_timer!(TIMER1, TIMER1, TIMER1); | |||
| 169 | impl_timer!(TIMER2, TIMER2, TIMER2); | 170 | impl_timer!(TIMER2, TIMER2, TIMER2); |
| 170 | 171 | ||
| 171 | impl_rtc!(RTC0, RTC0, RTC0); | 172 | impl_rtc!(RTC0, RTC0, RTC0); |
| 173 | #[cfg(not(feature = "time-driver-rtc1"))] | ||
| 172 | impl_rtc!(RTC1, RTC1, RTC1); | 174 | impl_rtc!(RTC1, RTC1, RTC1); |
| 173 | 175 | ||
| 174 | impl_pin!(P0_00, 0, 0); | 176 | impl_pin!(P0_00, 0, 0); |
diff --git a/embassy-nrf/src/chips/nrf52820.rs b/embassy-nrf/src/chips/nrf52820.rs index 1677fcf02..22360575b 100644 --- a/embassy-nrf/src/chips/nrf52820.rs +++ b/embassy-nrf/src/chips/nrf52820.rs | |||
| @@ -15,6 +15,7 @@ embassy_hal_internal::peripherals! { | |||
| 15 | 15 | ||
| 16 | // RTC | 16 | // RTC |
| 17 | RTC0, | 17 | RTC0, |
| 18 | #[cfg(not(feature="time-driver-rtc1"))] | ||
| 18 | RTC1, | 19 | RTC1, |
| 19 | 20 | ||
| 20 | // WDT | 21 | // WDT |
| @@ -165,6 +166,7 @@ impl_timer!(TIMER2, TIMER2, TIMER2); | |||
| 165 | impl_timer!(TIMER3, TIMER3, TIMER3, extended); | 166 | impl_timer!(TIMER3, TIMER3, TIMER3, extended); |
| 166 | 167 | ||
| 167 | impl_rtc!(RTC0, RTC0, RTC0); | 168 | impl_rtc!(RTC0, RTC0, RTC0); |
| 169 | #[cfg(not(feature = "time-driver-rtc1"))] | ||
| 168 | impl_rtc!(RTC1, RTC1, RTC1); | 170 | impl_rtc!(RTC1, RTC1, RTC1); |
| 169 | 171 | ||
| 170 | impl_qdec!(QDEC, QDEC, QDEC); | 172 | impl_qdec!(QDEC, QDEC, QDEC); |
diff --git a/embassy-nrf/src/chips/nrf52832.rs b/embassy-nrf/src/chips/nrf52832.rs index 6b735e218..1598df3fe 100644 --- a/embassy-nrf/src/chips/nrf52832.rs +++ b/embassy-nrf/src/chips/nrf52832.rs | |||
| @@ -16,6 +16,7 @@ pub const APPROTECT_MIN_BUILD_CODE: u8 = b'G'; | |||
| 16 | embassy_hal_internal::peripherals! { | 16 | embassy_hal_internal::peripherals! { |
| 17 | // RTC | 17 | // RTC |
| 18 | RTC0, | 18 | RTC0, |
| 19 | #[cfg(not(feature="time-driver-rtc1"))] | ||
| 19 | RTC1, | 20 | RTC1, |
| 20 | RTC2, | 21 | RTC2, |
| 21 | 22 | ||
| @@ -183,6 +184,7 @@ impl_twis!(TWISPI0, TWIS0, TWISPI0); | |||
| 183 | impl_twis!(TWISPI1, TWIS1, TWISPI1); | 184 | impl_twis!(TWISPI1, TWIS1, TWISPI1); |
| 184 | 185 | ||
| 185 | impl_rtc!(RTC0, RTC0, RTC0); | 186 | impl_rtc!(RTC0, RTC0, RTC0); |
| 187 | #[cfg(not(feature = "time-driver-rtc1"))] | ||
| 186 | impl_rtc!(RTC1, RTC1, RTC1); | 188 | impl_rtc!(RTC1, RTC1, RTC1); |
| 187 | impl_rtc!(RTC2, RTC2, RTC2); | 189 | impl_rtc!(RTC2, RTC2, RTC2); |
| 188 | 190 | ||
diff --git a/embassy-nrf/src/chips/nrf52833.rs b/embassy-nrf/src/chips/nrf52833.rs index b9c75f54b..6931fb064 100644 --- a/embassy-nrf/src/chips/nrf52833.rs +++ b/embassy-nrf/src/chips/nrf52833.rs | |||
| @@ -15,6 +15,7 @@ embassy_hal_internal::peripherals! { | |||
| 15 | 15 | ||
| 16 | // RTC | 16 | // RTC |
| 17 | RTC0, | 17 | RTC0, |
| 18 | #[cfg(not(feature = "time-driver-rtc1"))] | ||
| 18 | RTC1, | 19 | RTC1, |
| 19 | RTC2, | 20 | RTC2, |
| 20 | 21 | ||
| @@ -224,6 +225,7 @@ impl_timer!(TIMER3, TIMER3, TIMER3, extended); | |||
| 224 | impl_timer!(TIMER4, TIMER4, TIMER4, extended); | 225 | impl_timer!(TIMER4, TIMER4, TIMER4, extended); |
| 225 | 226 | ||
| 226 | impl_rtc!(RTC0, RTC0, RTC0); | 227 | impl_rtc!(RTC0, RTC0, RTC0); |
| 228 | #[cfg(not(feature = "time-driver-rtc1"))] | ||
| 227 | impl_rtc!(RTC1, RTC1, RTC1); | 229 | impl_rtc!(RTC1, RTC1, RTC1); |
| 228 | impl_rtc!(RTC2, RTC2, RTC2); | 230 | impl_rtc!(RTC2, RTC2, RTC2); |
| 229 | 231 | ||
diff --git a/embassy-nrf/src/chips/nrf52840.rs b/embassy-nrf/src/chips/nrf52840.rs index ccfa1f747..5fa521aae 100644 --- a/embassy-nrf/src/chips/nrf52840.rs +++ b/embassy-nrf/src/chips/nrf52840.rs | |||
| @@ -15,6 +15,7 @@ embassy_hal_internal::peripherals! { | |||
| 15 | 15 | ||
| 16 | // RTC | 16 | // RTC |
| 17 | RTC0, | 17 | RTC0, |
| 18 | #[cfg(not(feature = "time-driver-rtc1"))] | ||
| 18 | RTC1, | 19 | RTC1, |
| 19 | RTC2, | 20 | RTC2, |
| 20 | 21 | ||
| @@ -221,6 +222,7 @@ impl_timer!(TIMER3, TIMER3, TIMER3, extended); | |||
| 221 | impl_timer!(TIMER4, TIMER4, TIMER4, extended); | 222 | impl_timer!(TIMER4, TIMER4, TIMER4, extended); |
| 222 | 223 | ||
| 223 | impl_rtc!(RTC0, RTC0, RTC0); | 224 | impl_rtc!(RTC0, RTC0, RTC0); |
| 225 | #[cfg(not(feature = "time-driver-rtc1"))] | ||
| 224 | impl_rtc!(RTC1, RTC1, RTC1); | 226 | impl_rtc!(RTC1, RTC1, RTC1); |
| 225 | impl_rtc!(RTC2, RTC2, RTC2); | 227 | impl_rtc!(RTC2, RTC2, RTC2); |
| 226 | 228 | ||
diff --git a/embassy-nrf/src/chips/nrf5340_app.rs b/embassy-nrf/src/chips/nrf5340_app.rs index eb429db21..730c9842d 100644 --- a/embassy-nrf/src/chips/nrf5340_app.rs +++ b/embassy-nrf/src/chips/nrf5340_app.rs | |||
| @@ -168,6 +168,7 @@ embassy_hal_internal::peripherals! { | |||
| 168 | 168 | ||
| 169 | // RTC | 169 | // RTC |
| 170 | RTC0, | 170 | RTC0, |
| 171 | #[cfg(not(feature = "time-driver-rtc1"))] | ||
| 171 | RTC1, | 172 | RTC1, |
| 172 | 173 | ||
| 173 | // WDT | 174 | // WDT |
| @@ -370,6 +371,7 @@ impl_timer!(TIMER1, TIMER1, TIMER1); | |||
| 370 | impl_timer!(TIMER2, TIMER2, TIMER2); | 371 | impl_timer!(TIMER2, TIMER2, TIMER2); |
| 371 | 372 | ||
| 372 | impl_rtc!(RTC0, RTC0, RTC0); | 373 | impl_rtc!(RTC0, RTC0, RTC0); |
| 374 | #[cfg(not(feature = "time-driver-rtc1"))] | ||
| 373 | impl_rtc!(RTC1, RTC1, RTC1); | 375 | impl_rtc!(RTC1, RTC1, RTC1); |
| 374 | 376 | ||
| 375 | impl_qspi!(QSPI, QSPI, QSPI); | 377 | impl_qspi!(QSPI, QSPI, QSPI); |
diff --git a/embassy-nrf/src/chips/nrf5340_net.rs b/embassy-nrf/src/chips/nrf5340_net.rs index a8de288a9..413afc5c5 100644 --- a/embassy-nrf/src/chips/nrf5340_net.rs +++ b/embassy-nrf/src/chips/nrf5340_net.rs | |||
| @@ -59,6 +59,7 @@ pub const FLASH_SIZE: usize = 256 * 1024; | |||
| 59 | embassy_hal_internal::peripherals! { | 59 | embassy_hal_internal::peripherals! { |
| 60 | // RTC | 60 | // RTC |
| 61 | RTC0, | 61 | RTC0, |
| 62 | #[cfg(not(feature = "time-driver-rtc1"))] | ||
| 62 | RTC1, | 63 | RTC1, |
| 63 | 64 | ||
| 64 | // WDT | 65 | // WDT |
| @@ -219,6 +220,7 @@ impl_timer!(TIMER1, TIMER1, TIMER1); | |||
| 219 | impl_timer!(TIMER2, TIMER2, TIMER2); | 220 | impl_timer!(TIMER2, TIMER2, TIMER2); |
| 220 | 221 | ||
| 221 | impl_rtc!(RTC0, RTC0, RTC0); | 222 | impl_rtc!(RTC0, RTC0, RTC0); |
| 223 | #[cfg(not(feature = "time-driver-rtc1"))] | ||
| 222 | impl_rtc!(RTC1, RTC1, RTC1); | 224 | impl_rtc!(RTC1, RTC1, RTC1); |
| 223 | 225 | ||
| 224 | impl_rng!(RNG, RNG, RNG); | 226 | impl_rng!(RNG, RNG, RNG); |
diff --git a/embassy-nrf/src/chips/nrf9120.rs b/embassy-nrf/src/chips/nrf9120.rs index 9008a23a8..5aee19d97 100644 --- a/embassy-nrf/src/chips/nrf9120.rs +++ b/embassy-nrf/src/chips/nrf9120.rs | |||
| @@ -131,6 +131,7 @@ pub const FLASH_SIZE: usize = 1024 * 1024; | |||
| 131 | embassy_hal_internal::peripherals! { | 131 | embassy_hal_internal::peripherals! { |
| 132 | // RTC | 132 | // RTC |
| 133 | RTC0, | 133 | RTC0, |
| 134 | #[cfg(not(feature = "time-driver-rtc1"))] | ||
| 134 | RTC1, | 135 | RTC1, |
| 135 | 136 | ||
| 136 | // WDT | 137 | // WDT |
| @@ -277,6 +278,7 @@ impl_timer!(TIMER1, TIMER1, TIMER1); | |||
| 277 | impl_timer!(TIMER2, TIMER2, TIMER2); | 278 | impl_timer!(TIMER2, TIMER2, TIMER2); |
| 278 | 279 | ||
| 279 | impl_rtc!(RTC0, RTC0, RTC0); | 280 | impl_rtc!(RTC0, RTC0, RTC0); |
| 281 | #[cfg(not(feature = "time-driver-rtc1"))] | ||
| 280 | impl_rtc!(RTC1, RTC1, RTC1); | 282 | impl_rtc!(RTC1, RTC1, RTC1); |
| 281 | 283 | ||
| 282 | impl_pin!(P0_00, 0, 0); | 284 | impl_pin!(P0_00, 0, 0); |
diff --git a/embassy-nrf/src/chips/nrf9160.rs b/embassy-nrf/src/chips/nrf9160.rs index dbb06d71a..64aec217c 100644 --- a/embassy-nrf/src/chips/nrf9160.rs +++ b/embassy-nrf/src/chips/nrf9160.rs | |||
| @@ -131,6 +131,7 @@ pub const FLASH_SIZE: usize = 1024 * 1024; | |||
| 131 | embassy_hal_internal::peripherals! { | 131 | embassy_hal_internal::peripherals! { |
| 132 | // RTC | 132 | // RTC |
| 133 | RTC0, | 133 | RTC0, |
| 134 | #[cfg(not(feature = "time-driver-rtc1"))] | ||
| 134 | RTC1, | 135 | RTC1, |
| 135 | 136 | ||
| 136 | // WDT | 137 | // WDT |
| @@ -277,6 +278,7 @@ impl_timer!(TIMER1, TIMER1, TIMER1); | |||
| 277 | impl_timer!(TIMER2, TIMER2, TIMER2); | 278 | impl_timer!(TIMER2, TIMER2, TIMER2); |
| 278 | 279 | ||
| 279 | impl_rtc!(RTC0, RTC0, RTC0); | 280 | impl_rtc!(RTC0, RTC0, RTC0); |
| 281 | #[cfg(not(feature = "time-driver-rtc1"))] | ||
| 280 | impl_rtc!(RTC1, RTC1, RTC1); | 282 | impl_rtc!(RTC1, RTC1, RTC1); |
| 281 | 283 | ||
| 282 | impl_pin!(P0_00, 0, 0); | 284 | impl_pin!(P0_00, 0, 0); |
diff --git a/embassy-nrf/src/rtc.rs b/embassy-nrf/src/rtc.rs index 5dd427fde..1a90d1e24 100644 --- a/embassy-nrf/src/rtc.rs +++ b/embassy-nrf/src/rtc.rs | |||
| @@ -17,11 +17,6 @@ pub struct PrescalerOutOfRangeError(u32); | |||
| 17 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 17 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 18 | pub struct CompareOutOfRangeError(u32); | 18 | pub struct CompareOutOfRangeError(u32); |
| 19 | 19 | ||
| 20 | /// Compare register is not implemented for RTC0. | ||
| 21 | #[derive(Debug, PartialEq, Eq)] | ||
| 22 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||
| 23 | pub struct CompareRegNotImplementedError; | ||
| 24 | |||
| 25 | /// Interrupts/Events that can be generated by the RTCn peripheral. | 20 | /// Interrupts/Events that can be generated by the RTCn peripheral. |
| 26 | #[derive(Debug, Copy, Clone, PartialEq, Eq)] | 21 | #[derive(Debug, Copy, Clone, PartialEq, Eq)] |
| 27 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 22 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| @@ -93,15 +88,12 @@ macro_rules! impl_rtc { | |||
| 93 | } | 88 | } |
| 94 | 89 | ||
| 95 | /// nRF RTC driver. | 90 | /// nRF RTC driver. |
| 96 | /// | ||
| 97 | /// If the `time-driver-rtc1` feature is enabled, the creation of a driver with RTC1 will conflict | ||
| 98 | /// with the time driver implementation. | ||
| 99 | pub struct Rtc<'d, T: Instance>(Peri<'d, T>); | 91 | pub struct Rtc<'d, T: Instance>(Peri<'d, T>); |
| 100 | 92 | ||
| 101 | impl<'d, T: Instance> Rtc<'d, T> { | 93 | impl<'d, T: Instance> Rtc<'d, T> { |
| 102 | /// Create a new `Rtc` driver. | 94 | /// Create a new `Rtc` driver. |
| 103 | /// | 95 | /// |
| 104 | /// fRTC = 32_768 / (`prescaler` + 1 ) | 96 | /// fRTC \[Hz\] = 32_768 / (`prescaler` + 1 ) |
| 105 | pub fn new(rtc: Peri<'d, T>, prescaler: u32) -> Result<Self, PrescalerOutOfRangeError> { | 97 | pub fn new(rtc: Peri<'d, T>, prescaler: u32) -> Result<Self, PrescalerOutOfRangeError> { |
| 106 | if prescaler >= (1 << 12) { | 98 | if prescaler >= (1 << 12) { |
| 107 | return Err(PrescalerOutOfRangeError(prescaler)); | 99 | return Err(PrescalerOutOfRangeError(prescaler)); |
| @@ -128,6 +120,7 @@ impl<'d, T: Instance> Rtc<'d, T> { | |||
| 128 | } | 120 | } |
| 129 | 121 | ||
| 130 | /// Direct access to the RTC registers. | 122 | /// Direct access to the RTC registers. |
| 123 | #[cfg(feature = "unstable-pac")] | ||
| 131 | #[inline] | 124 | #[inline] |
| 132 | pub fn regs(&mut self) -> pac::rtc::Rtc { | 125 | pub fn regs(&mut self) -> pac::rtc::Rtc { |
| 133 | T::regs() | 126 | T::regs() |
| @@ -145,7 +138,7 @@ impl<'d, T: Instance> Rtc<'d, T> { | |||
| 145 | T::regs().tasks_stop().write_value(1); | 138 | T::regs().tasks_stop().write_value(1); |
| 146 | } | 139 | } |
| 147 | 140 | ||
| 148 | /// Enables interrupts for the given [RtcInterrupt] source. | 141 | /// Enables interrupts for the given [Interrupt] source. |
| 149 | /// | 142 | /// |
| 150 | /// Optionally also enables the interrupt in the NVIC. | 143 | /// Optionally also enables the interrupt in the NVIC. |
| 151 | pub fn enable_interrupt(&mut self, int: Interrupt, enable_in_nvic: bool) { | 144 | pub fn enable_interrupt(&mut self, int: Interrupt, enable_in_nvic: bool) { |
| @@ -163,7 +156,7 @@ impl<'d, T: Instance> Rtc<'d, T> { | |||
| 163 | } | 156 | } |
| 164 | } | 157 | } |
| 165 | 158 | ||
| 166 | /// Disables interrupts for the given [RtcInterrupt] source. | 159 | /// Disables interrupts for the given [Interrupt] source. |
| 167 | /// | 160 | /// |
| 168 | /// Optionally also disables the interrupt in the NVIC. | 161 | /// Optionally also disables the interrupt in the NVIC. |
| 169 | pub fn disable_interrupt(&mut self, int: Interrupt, disable_in_nvic: bool) { | 162 | pub fn disable_interrupt(&mut self, int: Interrupt, disable_in_nvic: bool) { |
