|
2 | 2 | /// through oscilloscope. They are not using HAL, but instead they access the
|
3 | 3 | /// hardware directly to save troubles passing resources.
|
4 | 4 | ///
|
5 |
| -/// A: Daisy pin 1, PB12 |
6 |
| -/// B: Daisy pin 2, PC11 |
7 |
| -/// C: Daisy pin 3, PC10 |
| 5 | +/// A: Daisy Patch SM pin A3, PA0 |
| 6 | +/// B: Daisy Patch SM pin A8, PB14 |
| 7 | +/// C: Daisy Patch SM pin A9, PB15 |
8 | 8 | #[macro_export]
|
9 | 9 | macro_rules! profile {
|
10 | 10 | (a, on) => {{
|
11 |
| - use daisy_bsp::hal::pac::{GPIOB, RCC}; |
| 11 | + use daisy::hal::pac::{GPIOA, RCC}; |
12 | 12 | let rcc = unsafe { &*RCC::ptr() };
|
13 |
| - let gpiob = unsafe { &*GPIOB::ptr() }; |
| 13 | + let gpiob = unsafe { &*GPIOA::ptr() }; |
14 | 14 | rcc.ahb4enr.modify(|_, w| w.gpioben().set_bit());
|
15 |
| - gpiob.moder.modify(|_, w| w.moder12().output()); |
16 |
| - gpiob.odr.modify(|_, w| w.odr12().set_bit()); |
| 15 | + gpiob.moder.modify(|_, w| w.moder0().output()); |
| 16 | + gpiob.odr.modify(|_, w| w.odr0().set_bit()); |
17 | 17 | }};
|
18 | 18 | (a, off) => {{
|
19 |
| - use daisy_bsp::hal::pac::{GPIOB, RCC}; |
| 19 | + use daisy::hal::pac::{GPIOA, RCC}; |
20 | 20 | let rcc = unsafe { &*RCC::ptr() };
|
21 |
| - let gpiob = unsafe { &*GPIOB::ptr() }; |
| 21 | + let gpiob = unsafe { &*GPIOA::ptr() }; |
22 | 22 | rcc.ahb4enr.modify(|_, w| w.gpioben().set_bit());
|
23 |
| - gpiob.moder.modify(|_, w| w.moder12().output()); |
24 |
| - gpiob.odr.modify(|_, w| w.odr12().clear_bit()); |
| 23 | + gpiob.moder.modify(|_, w| w.moder0().output()); |
| 24 | + gpiob.odr.modify(|_, w| w.odr0().clear_bit()); |
25 | 25 | }};
|
26 | 26 | (b, on) => {{
|
27 |
| - use daisy_bsp::hal::pac::{GPIOC, RCC}; |
| 27 | + use daisy::hal::pac::{GPIOB, RCC}; |
28 | 28 | let rcc = unsafe { &*RCC::ptr() };
|
29 |
| - let gpioc = unsafe { &*GPIOC::ptr() }; |
| 29 | + let gpioc = unsafe { &*GPIOB::ptr() }; |
30 | 30 | rcc.ahb4enr.modify(|_, w| w.gpiocen().set_bit());
|
31 |
| - gpioc.moder.modify(|_, w| w.moder11().output()); |
32 |
| - gpioc.odr.modify(|_, w| w.odr11().set_bit()); |
| 31 | + gpioc.moder.modify(|_, w| w.moder14().output()); |
| 32 | + gpioc.odr.modify(|_, w| w.odr14().set_bit()); |
33 | 33 | }};
|
34 | 34 | (b, off) => {{
|
35 |
| - use daisy_bsp::hal::pac::{GPIOC, RCC}; |
| 35 | + use daisy::hal::pac::{GPIOB, RCC}; |
36 | 36 | let rcc = unsafe { &*RCC::ptr() };
|
37 |
| - let gpioc = unsafe { &*GPIOC::ptr() }; |
| 37 | + let gpioc = unsafe { &*GPIOB::ptr() }; |
38 | 38 | rcc.ahb4enr.modify(|_, w| w.gpiocen().set_bit());
|
39 |
| - gpioc.moder.modify(|_, w| w.moder11().output()); |
40 |
| - gpioc.odr.modify(|_, w| w.odr11().clear_bit()); |
| 39 | + gpioc.moder.modify(|_, w| w.moder14().output()); |
| 40 | + gpioc.odr.modify(|_, w| w.odr14().clear_bit()); |
41 | 41 | }};
|
42 | 42 | (c, on) => {{
|
43 |
| - use daisy_bsp::hal::pac::{GPIOC, RCC}; |
| 43 | + use daisy::hal::pac::{GPIOB, RCC}; |
44 | 44 | let rcc = unsafe { &*RCC::ptr() };
|
45 |
| - let gpioc = unsafe { &*GPIOC::ptr() }; |
| 45 | + let gpioc = unsafe { &*GPIOB::ptr() }; |
46 | 46 | rcc.ahb4enr.modify(|_, w| w.gpiocen().set_bit());
|
47 |
| - gpioc.moder.modify(|_, w| w.moder10().output()); |
48 |
| - gpioc.odr.modify(|_, w| w.odr10().set_bit()); |
| 47 | + gpioc.moder.modify(|_, w| w.moder15().output()); |
| 48 | + gpioc.odr.modify(|_, w| w.odr15().set_bit()); |
49 | 49 | }};
|
50 | 50 | (c, off) => {{
|
51 |
| - use daisy_bsp::hal::pac::{GPIOC, RCC}; |
| 51 | + use daisy::hal::pac::{GPIOB, RCC}; |
52 | 52 | let rcc = unsafe { &*RCC::ptr() };
|
53 |
| - let gpioc = unsafe { &*GPIOC::ptr() }; |
| 53 | + let gpioc = unsafe { &*GPIOB::ptr() }; |
54 | 54 | rcc.ahb4enr.modify(|_, w| w.gpiocen().set_bit());
|
55 |
| - gpioc.moder.modify(|_, w| w.moder10().output()); |
56 |
| - gpioc.odr.modify(|_, w| w.odr10().clear_bit()); |
| 55 | + gpioc.moder.modify(|_, w| w.moder15().output()); |
| 56 | + gpioc.odr.modify(|_, w| w.odr15().clear_bit()); |
57 | 57 | }};
|
58 | 58 | }
|
0 commit comments