diff options
| author | James Munns <[email protected]> | 2025-12-04 18:46:39 +0100 |
|---|---|---|
| committer | James Munns <[email protected]> | 2025-12-04 18:47:31 +0100 |
| commit | c3bc8fe8c0db112e5f2f66580104fc49b02890d2 (patch) | |
| tree | eea7adc15021697ea980289edd6235daaa12d6ee /embassy-mcxa/src/pins.rs | |
| parent | 5182b2ed54f991b40b45fd2de75f597358ff9c3e (diff) | |
| parent | 277ab0d2e8714edf37a0ee84cda1059d9944ecef (diff) | |
Import embassy-mcxa repo
Merge remote-tracking branch 'james-e-mcxa/james/upstream' into james/upstream-mcxa
Diffstat (limited to 'embassy-mcxa/src/pins.rs')
| -rw-r--r-- | embassy-mcxa/src/pins.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/embassy-mcxa/src/pins.rs b/embassy-mcxa/src/pins.rs new file mode 100644 index 000000000..fdf1b0a86 --- /dev/null +++ b/embassy-mcxa/src/pins.rs | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | //! Pin configuration helpers (separate from peripheral drivers). | ||
| 2 | use crate::pac; | ||
| 3 | |||
| 4 | pub unsafe fn configure_adc_pins() { | ||
| 5 | // P1_10 = ADC1_A8 | ||
| 6 | let port1 = &*pac::Port1::ptr(); | ||
| 7 | port1.pcr10().write(|w| { | ||
| 8 | w.ps() | ||
| 9 | .ps0() | ||
| 10 | .pe() | ||
| 11 | .pe0() | ||
| 12 | .sre() | ||
| 13 | .sre0() | ||
| 14 | .ode() | ||
| 15 | .ode0() | ||
| 16 | .dse() | ||
| 17 | .dse0() | ||
| 18 | .mux() | ||
| 19 | .mux0() | ||
| 20 | .ibe() | ||
| 21 | .ibe0() | ||
| 22 | .inv() | ||
| 23 | .inv0() | ||
| 24 | .lk() | ||
| 25 | .lk0() | ||
| 26 | }); | ||
| 27 | core::arch::asm!("dsb sy; isb sy"); | ||
| 28 | } | ||
