Commit f93b505
authored
Add stm32l4r9 support (#270)
* src/dma.rs: disable `cselr` for stm32l4+
The stm32l4+ devices do not have this register,
but use a separate peripheral (DMAMUX) for routing between
peripherals and DMA controllers.
* src/rcc/enable.rs: fix some issues for stm32l4+
* src/i2c.rs: define stm32l4+ pins
* src/spi.rs: add `unsafe` where required by stm32l4r9 PAC.
To make this implementation also usable by stm32l4+ devices,
some additional use of `unsafe` is necessary because of PAC differences.
* src/timer.rs: disable creation of TIM4 for stm32l4+ because of PAC error.
In the current release of the stm32l4 PAC,
the `cnt` register of TIM3 and tim4 have an incorrect width.
This was fixed in stm32-rs#669, once this is included in the next
release, we will be able to start using TIM3 and TIM4.
* Create module dmamux.rs as common interface for DMA request mapping.
The new stm32l4+ devices use a separate peripheral (DMAMUX) for routing
a DMA request line between peripherals and DMA controllers, whereas the
"old" stm32l4 devices use the `CSELR` register for request mapping.
This module tries to abstract this difference, and provides a common
interface for all L4 devices.
This commit also enable the DMAMUX clock when required.
* Use new dmamux interface in adc.rs, serial.rs and spi.rs
* src/lib.rs: enable most modules for stm32l4+ devices as well1 parent c3b68e8 commit f93b505
9 files changed
+794
-59
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
526 | 527 | | |
527 | 528 | | |
528 | 529 | | |
529 | | - | |
| 530 | + | |
530 | 531 | | |
531 | 532 | | |
532 | 533 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
644 | 644 | | |
645 | 645 | | |
646 | 646 | | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
647 | 657 | | |
648 | 658 | | |
649 | 659 | | |
| |||
1072 | 1082 | | |
1073 | 1083 | | |
1074 | 1084 | | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
1075 | 1097 | | |
1076 | 1098 | | |
1077 | 1099 | | |
| |||
0 commit comments