Skip to content

Commit 3c1c363

Browse files
committed
Update to work as stand alone lib
1 parent 473e9cb commit 3c1c363

File tree

8 files changed

+93
-684
lines changed

8 files changed

+93
-684
lines changed

src/capture.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
use crate::{hal, stm32};
2+
13
use super::timer;
2-
use crate::dma::mux::DmaMuxResources;
3-
use crate::dma::traits::TargetAddress;
4-
use crate::dma::PeripheralToMemory;
5-
use crate::stm32::{HRTIM_TIMA, HRTIM_TIMB, HRTIM_TIMC, HRTIM_TIMD, HRTIM_TIME, HRTIM_TIMF};
4+
use crate::mcu::DmaMuxResources;
5+
use hal::dma::traits::TargetAddress;
6+
use hal::dma::PeripheralToMemory;
7+
use stm32::{HRTIM_TIMA, HRTIM_TIMB, HRTIM_TIMC, HRTIM_TIMD, HRTIM_TIME, HRTIM_TIMF};
68
use core::marker::PhantomData;
79

810
pub struct Ch1;

src/control.rs

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
use crate::{
2-
hrtim::fault::{
3-
FltMonitor1, FltMonitor2, FltMonitor3, FltMonitor4, FltMonitor5, FltMonitor6, FltMonitorSys,
4-
},
5-
rcc::{Enable, Rcc, Reset},
6-
stm32::{HRTIM_COMMON, RCC},
1+
use crate::fault::{
2+
FltMonitor1, FltMonitor2, FltMonitor3, FltMonitor4, FltMonitor5, FltMonitor6, FltMonitorSys,
73
};
4+
use crate::{hal, stm32};
5+
use hal::rcc::{Enable, Rcc, Reset};
6+
use stm32::{HRTIM_COMMON, RCC};
87

98
use super::{external_event::EevInputs, fault::FaultInputs};
109

@@ -19,8 +18,8 @@ impl HrControltExt for HRTIM_COMMON {
1918
unsafe {
2019
let rcc_ptr = &*RCC::ptr();
2120

22-
HRTIM_COMMON::enable(rcc_ptr);
23-
HRTIM_COMMON::reset(rcc_ptr);
21+
<HRTIM_COMMON as Enable>::enable(rcc_ptr);
22+
<HRTIM_COMMON as Reset>::reset(rcc_ptr);
2423
}
2524

2625
// Start calibration procedure
@@ -257,15 +256,15 @@ macro_rules! impl_adc1234_trigger {
257256
}
258257
}
259258

260-
$(impl From<&$t> for crate::adc::config::ExternalTrigger12 {
259+
$(impl From<&$t> for hal::adc::config::ExternalTrigger12 {
261260
fn from(_val: &$t) -> Self {
262-
crate::adc::config::ExternalTrigger12::$variant12
261+
hal::adc::config::ExternalTrigger12::$variant12
263262
}
264263
})*
265264

266-
impl From<&$t> for crate::adc::config::ExternalTrigger345 {
265+
impl From<&$t> for hal::adc::config::ExternalTrigger345 {
267266
fn from(_val: &$t) -> Self {
268-
crate::adc::config::ExternalTrigger345::$variant345
267+
hal::adc::config::ExternalTrigger345::$variant345
269268
}
270269
}
271270
)*}
@@ -285,15 +284,15 @@ macro_rules! impl_adc5678910_trigger {
285284
}
286285
}
287286

288-
impl From<&$t> for crate::adc::config::ExternalTrigger12 {
287+
impl From<&$t> for hal::adc::config::ExternalTrigger12 {
289288
fn from(_val: &$t) -> Self {
290-
crate::adc::config::ExternalTrigger12::$variant12
289+
hal::adc::config::ExternalTrigger12::$variant12
291290
}
292291
}
293292

294-
impl From<&$t> for crate::adc::config::ExternalTrigger345 {
293+
impl From<&$t> for hal::adc::config::ExternalTrigger345 {
295294
fn from(_val: &$t) -> Self {
296-
crate::adc::config::ExternalTrigger345::$variant345
295+
hal::adc::config::ExternalTrigger345::$variant345
297296
}
298297
}
299298

0 commit comments

Comments
 (0)