diff options
| author | Dario Nieuwenhuis <[email protected]> | 2021-05-21 17:21:36 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-05-21 17:21:36 +0200 |
| commit | 0bc440233cdb2d0fd3fdc1ba69e9a25cd8eccfa9 (patch) | |
| tree | 8f49c12a35b569f0f8a6050005c4caca93090393 | |
| parent | b5cdd296dd875c42974e85671473efeaadd70345 (diff) | |
| parent | b3eda9914b27913fa5c8edb9050e236ba3053bd1 (diff) | |
Merge pull request #184 from bobmcwhirter/spi_v3
Spi v3
121 files changed, 14862 insertions, 6726 deletions
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml index 81bd032c8..65f42b158 100644 --- a/embassy-stm32/Cargo.toml +++ b/embassy-stm32/Cargo.toml | |||
| @@ -182,119 +182,119 @@ stm32f479vg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_r | |||
| 182 | stm32f479vi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_stm32f4", "_syscfg", "_syscfg_f4", "_usart", "_usart_v1",] | 182 | stm32f479vi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_stm32f4", "_syscfg", "_syscfg_f4", "_usart", "_usart_v1",] |
| 183 | stm32f479zg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_stm32f4", "_syscfg", "_syscfg_f4", "_usart", "_usart_v1",] | 183 | stm32f479zg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_stm32f4", "_syscfg", "_syscfg_f4", "_usart", "_usart_v1",] |
| 184 | stm32f479zi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_stm32f4", "_syscfg", "_syscfg_f4", "_usart", "_usart_v1",] | 184 | stm32f479zi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_stm32f4", "_syscfg", "_syscfg_f4", "_usart", "_usart_v1",] |
| 185 | stm32h723ve = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 185 | stm32h723ve = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 186 | stm32h723vg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 186 | stm32h723vg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 187 | stm32h723ze = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 187 | stm32h723ze = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 188 | stm32h723zg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 188 | stm32h723zg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 189 | stm32h725ae = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 189 | stm32h725ae = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 190 | stm32h725ag = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 190 | stm32h725ag = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 191 | stm32h725ie = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 191 | stm32h725ie = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 192 | stm32h725ig = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 192 | stm32h725ig = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 193 | stm32h725re = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 193 | stm32h725re = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 194 | stm32h725rg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 194 | stm32h725rg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 195 | stm32h725ve = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 195 | stm32h725ve = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 196 | stm32h725vg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 196 | stm32h725vg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 197 | stm32h725ze = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 197 | stm32h725ze = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 198 | stm32h725zg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 198 | stm32h725zg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 199 | stm32h730ab = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 199 | stm32h730ab = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 200 | stm32h730ib = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 200 | stm32h730ib = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 201 | stm32h730vb = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 201 | stm32h730vb = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 202 | stm32h730zb = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 202 | stm32h730zb = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 203 | stm32h733vg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 203 | stm32h733vg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 204 | stm32h733zg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 204 | stm32h733zg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 205 | stm32h735ag = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 205 | stm32h735ag = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 206 | stm32h735ig = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 206 | stm32h735ig = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 207 | stm32h735rg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 207 | stm32h735rg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 208 | stm32h735vg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 208 | stm32h735vg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 209 | stm32h735zg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 209 | stm32h735zg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 210 | stm32h742ag = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 210 | stm32h742ag = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 211 | stm32h742ai = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 211 | stm32h742ai = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 212 | stm32h742bg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 212 | stm32h742bg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 213 | stm32h742bi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 213 | stm32h742bi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 214 | stm32h742ig = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 214 | stm32h742ig = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 215 | stm32h742ii = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 215 | stm32h742ii = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 216 | stm32h742vg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 216 | stm32h742vg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 217 | stm32h742vi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 217 | stm32h742vi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 218 | stm32h742xg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 218 | stm32h742xg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 219 | stm32h742xi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 219 | stm32h742xi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 220 | stm32h742zg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 220 | stm32h742zg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 221 | stm32h742zi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 221 | stm32h742zi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 222 | stm32h743ag = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 222 | stm32h743ag = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 223 | stm32h743ai = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 223 | stm32h743ai = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 224 | stm32h743bg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 224 | stm32h743bg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 225 | stm32h743bi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 225 | stm32h743bi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 226 | stm32h743ig = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 226 | stm32h743ig = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 227 | stm32h743ii = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 227 | stm32h743ii = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 228 | stm32h743vg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 228 | stm32h743vg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 229 | stm32h743vi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 229 | stm32h743vi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 230 | stm32h743xg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 230 | stm32h743xg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 231 | stm32h743xi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 231 | stm32h743xi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 232 | stm32h743zg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 232 | stm32h743zg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 233 | stm32h743zi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 233 | stm32h743zi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 234 | stm32h745bg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 234 | stm32h745bg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 235 | stm32h745bi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 235 | stm32h745bi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 236 | stm32h745ig = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 236 | stm32h745ig = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 237 | stm32h745ii = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 237 | stm32h745ii = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 238 | stm32h745xg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 238 | stm32h745xg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 239 | stm32h745xi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 239 | stm32h745xi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 240 | stm32h745zg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 240 | stm32h745zg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 241 | stm32h745zi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 241 | stm32h745zi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 242 | stm32h747ag = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 242 | stm32h747ag = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 243 | stm32h747ai = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 243 | stm32h747ai = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 244 | stm32h747bg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 244 | stm32h747bg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 245 | stm32h747bi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 245 | stm32h747bi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 246 | stm32h747ig = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 246 | stm32h747ig = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 247 | stm32h747ii = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 247 | stm32h747ii = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 248 | stm32h747xg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 248 | stm32h747xg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 249 | stm32h747xi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 249 | stm32h747xi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 250 | stm32h747zi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 250 | stm32h747zi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 251 | stm32h750ib = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 251 | stm32h750ib = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 252 | stm32h750vb = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 252 | stm32h750vb = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 253 | stm32h750xb = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 253 | stm32h750xb = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 254 | stm32h750zb = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 254 | stm32h750zb = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 255 | stm32h753ai = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 255 | stm32h753ai = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 256 | stm32h753bi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 256 | stm32h753bi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 257 | stm32h753ii = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 257 | stm32h753ii = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 258 | stm32h753vi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 258 | stm32h753vi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 259 | stm32h753xi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 259 | stm32h753xi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 260 | stm32h753zi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 260 | stm32h753zi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 261 | stm32h755bi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 261 | stm32h755bi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 262 | stm32h755ii = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 262 | stm32h755ii = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 263 | stm32h755xi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 263 | stm32h755xi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 264 | stm32h755zi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 264 | stm32h755zi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 265 | stm32h757ai = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 265 | stm32h757ai = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 266 | stm32h757bi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 266 | stm32h757bi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 267 | stm32h757ii = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 267 | stm32h757ii = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 268 | stm32h757xi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 268 | stm32h757xi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 269 | stm32h757zi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 269 | stm32h757zi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 270 | stm32h7a3ag = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 270 | stm32h7a3ag = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 271 | stm32h7a3ai = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 271 | stm32h7a3ai = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 272 | stm32h7a3ig = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 272 | stm32h7a3ig = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 273 | stm32h7a3ii = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 273 | stm32h7a3ii = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 274 | stm32h7a3lg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 274 | stm32h7a3lg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 275 | stm32h7a3li = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 275 | stm32h7a3li = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 276 | stm32h7a3ng = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 276 | stm32h7a3ng = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 277 | stm32h7a3ni = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 277 | stm32h7a3ni = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 278 | stm32h7a3qi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 278 | stm32h7a3qi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 279 | stm32h7a3rg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 279 | stm32h7a3rg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 280 | stm32h7a3ri = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 280 | stm32h7a3ri = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 281 | stm32h7a3vg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 281 | stm32h7a3vg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 282 | stm32h7a3vi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 282 | stm32h7a3vi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 283 | stm32h7a3zg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 283 | stm32h7a3zg = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 284 | stm32h7a3zi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 284 | stm32h7a3zi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 285 | stm32h7b0ab = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 285 | stm32h7b0ab = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 286 | stm32h7b0ib = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 286 | stm32h7b0ib = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 287 | stm32h7b0rb = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 287 | stm32h7b0rb = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 288 | stm32h7b0vb = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 288 | stm32h7b0vb = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 289 | stm32h7b0zb = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 289 | stm32h7b0zb = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 290 | stm32h7b3ai = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 290 | stm32h7b3ai = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 291 | stm32h7b3ii = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 291 | stm32h7b3ii = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 292 | stm32h7b3li = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 292 | stm32h7b3li = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 293 | stm32h7b3ni = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 293 | stm32h7b3ni = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 294 | stm32h7b3qi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 294 | stm32h7b3qi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 295 | stm32h7b3ri = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 295 | stm32h7b3ri = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 296 | stm32h7b3vi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 296 | stm32h7b3vi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 297 | stm32h7b3zi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_stm32h7", "_syscfg", "_syscfg_h7",] | 297 | stm32h7b3zi = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 298 | stm32l412c8 = [ "_dma", "_dma_v1", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_stm32l4", "_syscfg", "_syscfg_l4", "_usart", "_usart_v2",] | 298 | stm32l412c8 = [ "_dma", "_dma_v1", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_stm32l4", "_syscfg", "_syscfg_l4", "_usart", "_usart_v2",] |
| 299 | stm32l412cb = [ "_dma", "_dma_v1", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_stm32l4", "_syscfg", "_syscfg_l4", "_usart", "_usart_v2",] | 299 | stm32l412cb = [ "_dma", "_dma_v1", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_stm32l4", "_syscfg", "_syscfg_l4", "_usart", "_usart_v2",] |
| 300 | stm32l412k8 = [ "_dma", "_dma_v1", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_stm32l4", "_syscfg", "_syscfg_l4", "_usart", "_usart_v2",] | 300 | stm32l412k8 = [ "_dma", "_dma_v1", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_stm32l4", "_syscfg", "_syscfg_l4", "_usart", "_usart_v2",] |
| @@ -450,6 +450,7 @@ _sdmmc_v2 = [] | |||
| 450 | _spi = [] | 450 | _spi = [] |
| 451 | _spi_v1 = [] | 451 | _spi_v1 = [] |
| 452 | _spi_v2 = [] | 452 | _spi_v2 = [] |
| 453 | _spi_v3 = [] | ||
| 453 | _stm32f4 = [] | 454 | _stm32f4 = [] |
| 454 | _stm32h7 = [] | 455 | _stm32h7 = [] |
| 455 | _stm32l4 = [] | 456 | _stm32l4 = [] |
diff --git a/embassy-stm32/gen.py b/embassy-stm32/gen.py index 3eb570f19..6c931e4a7 100644 --- a/embassy-stm32/gen.py +++ b/embassy-stm32/gen.py | |||
| @@ -119,16 +119,17 @@ for chip in chips.values(): | |||
| 119 | f.write(f'impl_rng!({name}, HASH_RNG);') | 119 | f.write(f'impl_rng!({name}, HASH_RNG);') |
| 120 | 120 | ||
| 121 | if block_mod == 'spi': | 121 | if block_mod == 'spi': |
| 122 | clock = peri['clock'] | 122 | if 'clock' in peri: |
| 123 | f.write(f'impl_spi!({name}, {clock});') | 123 | clock = peri['clock'] |
| 124 | for pin, funcs in af.items(): | 124 | f.write(f'impl_spi!({name}, {clock});') |
| 125 | if pin in pins: | 125 | for pin, funcs in af.items(): |
| 126 | if func := funcs.get(f'{name}_SCK'): | 126 | if pin in pins: |
| 127 | f.write(f'impl_spi_pin!({name}, SckPin, {pin}, {func});') | 127 | if func := funcs.get(f'{name}_SCK'): |
| 128 | if func := funcs.get(f'{name}_MOSI'): | 128 | f.write(f'impl_spi_pin!({name}, SckPin, {pin}, {func});') |
| 129 | f.write(f'impl_spi_pin!({name}, MosiPin, {pin}, {func});') | 129 | if func := funcs.get(f'{name}_MOSI'): |
| 130 | if func := funcs.get(f'{name}_MISO'): | 130 | f.write(f'impl_spi_pin!({name}, MosiPin, {pin}, {func});') |
| 131 | f.write(f'impl_spi_pin!({name}, MisoPin, {pin}, {func});') | 131 | if func := funcs.get(f'{name}_MISO'): |
| 132 | f.write(f'impl_spi_pin!({name}, MisoPin, {pin}, {func});') | ||
| 132 | 133 | ||
| 133 | if block_mod == 'gpio': | 134 | if block_mod == 'gpio': |
| 134 | custom_singletons = True | 135 | custom_singletons = True |
diff --git a/embassy-stm32/src/pac/regs.rs b/embassy-stm32/src/pac/regs.rs index 42af348da..ca3190ecd 100644 --- a/embassy-stm32/src/pac/regs.rs +++ b/embassy-stm32/src/pac/regs.rs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![doc = "Peripheral access API (generated using svd2rust v0.17.0 (22741fa 2021-04-20))"] | 2 | #![doc = "Peripheral access API (generated using svd2rust v0.17.0 (22741fa 2021-04-20))"] |
| 3 | pub mod syscfg_h7 { | 3 | pub mod syscfg_l4 { |
| 4 | use crate::generic::*; | 4 | use crate::generic::*; |
| 5 | #[doc = "System configuration controller"] | 5 | #[doc = "System configuration controller"] |
| 6 | #[derive(Copy, Clone)] | 6 | #[derive(Copy, Clone)] |
| @@ -8,8 +8,12 @@ pub mod syscfg_h7 { | |||
| 8 | unsafe impl Send for Syscfg {} | 8 | unsafe impl Send for Syscfg {} |
| 9 | unsafe impl Sync for Syscfg {} | 9 | unsafe impl Sync for Syscfg {} |
| 10 | impl Syscfg { | 10 | impl Syscfg { |
| 11 | #[doc = "peripheral mode configuration register"] | 11 | #[doc = "memory remap register"] |
| 12 | pub fn pmcr(self) -> Reg<regs::Pmcr, RW> { | 12 | pub fn memrmp(self) -> Reg<regs::Memrmp, RW> { |
| 13 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 14 | } | ||
| 15 | #[doc = "configuration register 1"] | ||
| 16 | pub fn cfgr1(self) -> Reg<regs::Cfgr1, RW> { | ||
| 13 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | 17 | unsafe { Reg::from_ptr(self.0.add(4usize)) } |
| 14 | } | 18 | } |
| 15 | #[doc = "external interrupt configuration register 1"] | 19 | #[doc = "external interrupt configuration register 1"] |
| @@ -17,968 +21,1030 @@ pub mod syscfg_h7 { | |||
| 17 | assert!(n < 4usize); | 21 | assert!(n < 4usize); |
| 18 | unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) } | 22 | unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) } |
| 19 | } | 23 | } |
| 20 | #[doc = "compensation cell control/status register"] | 24 | #[doc = "SCSR"] |
| 21 | pub fn cccsr(self) -> Reg<regs::Cccsr, RW> { | 25 | pub fn scsr(self) -> Reg<regs::Scsr, RW> { |
| 22 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | 26 | unsafe { Reg::from_ptr(self.0.add(24usize)) } |
| 23 | } | ||
| 24 | #[doc = "SYSCFG compensation cell value register"] | ||
| 25 | pub fn ccvr(self) -> Reg<regs::Ccvr, R> { | ||
| 26 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | ||
| 27 | } | ||
| 28 | #[doc = "SYSCFG compensation cell code register"] | ||
| 29 | pub fn cccr(self) -> Reg<regs::Cccr, RW> { | ||
| 30 | unsafe { Reg::from_ptr(self.0.add(40usize)) } | ||
| 31 | } | ||
| 32 | #[doc = "SYSCFG power control register"] | ||
| 33 | pub fn pwrcr(self) -> Reg<regs::Pwrcr, RW> { | ||
| 34 | unsafe { Reg::from_ptr(self.0.add(44usize)) } | ||
| 35 | } | ||
| 36 | #[doc = "SYSCFG package register"] | ||
| 37 | pub fn pkgr(self) -> Reg<regs::Pkgr, R> { | ||
| 38 | unsafe { Reg::from_ptr(self.0.add(292usize)) } | ||
| 39 | } | ||
| 40 | #[doc = "SYSCFG user register 0"] | ||
| 41 | pub fn ur0(self) -> Reg<regs::Ur0, R> { | ||
| 42 | unsafe { Reg::from_ptr(self.0.add(768usize)) } | ||
| 43 | } | ||
| 44 | #[doc = "SYSCFG user register 2"] | ||
| 45 | pub fn ur2(self) -> Reg<regs::Ur2, RW> { | ||
| 46 | unsafe { Reg::from_ptr(self.0.add(776usize)) } | ||
| 47 | } | ||
| 48 | #[doc = "SYSCFG user register 3"] | ||
| 49 | pub fn ur3(self) -> Reg<regs::Ur3, RW> { | ||
| 50 | unsafe { Reg::from_ptr(self.0.add(780usize)) } | ||
| 51 | } | ||
| 52 | #[doc = "SYSCFG user register 4"] | ||
| 53 | pub fn ur4(self) -> Reg<regs::Ur4, R> { | ||
| 54 | unsafe { Reg::from_ptr(self.0.add(784usize)) } | ||
| 55 | } | ||
| 56 | #[doc = "SYSCFG user register 5"] | ||
| 57 | pub fn ur5(self) -> Reg<regs::Ur5, R> { | ||
| 58 | unsafe { Reg::from_ptr(self.0.add(788usize)) } | ||
| 59 | } | ||
| 60 | #[doc = "SYSCFG user register 6"] | ||
| 61 | pub fn ur6(self) -> Reg<regs::Ur6, R> { | ||
| 62 | unsafe { Reg::from_ptr(self.0.add(792usize)) } | ||
| 63 | } | ||
| 64 | #[doc = "SYSCFG user register 7"] | ||
| 65 | pub fn ur7(self) -> Reg<regs::Ur7, R> { | ||
| 66 | unsafe { Reg::from_ptr(self.0.add(796usize)) } | ||
| 67 | } | ||
| 68 | #[doc = "SYSCFG user register 8"] | ||
| 69 | pub fn ur8(self) -> Reg<regs::Ur8, R> { | ||
| 70 | unsafe { Reg::from_ptr(self.0.add(800usize)) } | ||
| 71 | } | ||
| 72 | #[doc = "SYSCFG user register 9"] | ||
| 73 | pub fn ur9(self) -> Reg<regs::Ur9, R> { | ||
| 74 | unsafe { Reg::from_ptr(self.0.add(804usize)) } | ||
| 75 | } | ||
| 76 | #[doc = "SYSCFG user register 10"] | ||
| 77 | pub fn ur10(self) -> Reg<regs::Ur10, R> { | ||
| 78 | unsafe { Reg::from_ptr(self.0.add(808usize)) } | ||
| 79 | } | ||
| 80 | #[doc = "SYSCFG user register 11"] | ||
| 81 | pub fn ur11(self) -> Reg<regs::Ur11, R> { | ||
| 82 | unsafe { Reg::from_ptr(self.0.add(812usize)) } | ||
| 83 | } | ||
| 84 | #[doc = "SYSCFG user register 12"] | ||
| 85 | pub fn ur12(self) -> Reg<regs::Ur12, R> { | ||
| 86 | unsafe { Reg::from_ptr(self.0.add(816usize)) } | ||
| 87 | } | ||
| 88 | #[doc = "SYSCFG user register 13"] | ||
| 89 | pub fn ur13(self) -> Reg<regs::Ur13, R> { | ||
| 90 | unsafe { Reg::from_ptr(self.0.add(820usize)) } | ||
| 91 | } | ||
| 92 | #[doc = "SYSCFG user register 14"] | ||
| 93 | pub fn ur14(self) -> Reg<regs::Ur14, RW> { | ||
| 94 | unsafe { Reg::from_ptr(self.0.add(824usize)) } | ||
| 95 | } | 27 | } |
| 96 | #[doc = "SYSCFG user register 15"] | 28 | #[doc = "CFGR2"] |
| 97 | pub fn ur15(self) -> Reg<regs::Ur15, R> { | 29 | pub fn cfgr2(self) -> Reg<regs::Cfgr2, RW> { |
| 98 | unsafe { Reg::from_ptr(self.0.add(828usize)) } | 30 | unsafe { Reg::from_ptr(self.0.add(28usize)) } |
| 99 | } | 31 | } |
| 100 | #[doc = "SYSCFG user register 16"] | 32 | #[doc = "SWPR"] |
| 101 | pub fn ur16(self) -> Reg<regs::Ur16, R> { | 33 | pub fn swpr(self) -> Reg<regs::Swpr, W> { |
| 102 | unsafe { Reg::from_ptr(self.0.add(832usize)) } | 34 | unsafe { Reg::from_ptr(self.0.add(32usize)) } |
| 103 | } | 35 | } |
| 104 | #[doc = "SYSCFG user register 17"] | 36 | #[doc = "SKR"] |
| 105 | pub fn ur17(self) -> Reg<regs::Ur17, R> { | 37 | pub fn skr(self) -> Reg<regs::Skr, W> { |
| 106 | unsafe { Reg::from_ptr(self.0.add(836usize)) } | 38 | unsafe { Reg::from_ptr(self.0.add(36usize)) } |
| 107 | } | 39 | } |
| 108 | } | 40 | } |
| 109 | pub mod regs { | 41 | pub mod regs { |
| 110 | use crate::generic::*; | 42 | use crate::generic::*; |
| 111 | #[doc = "SYSCFG user register 12"] | 43 | #[doc = "memory remap register"] |
| 112 | #[repr(transparent)] | 44 | #[repr(transparent)] |
| 113 | #[derive(Copy, Clone, Eq, PartialEq)] | 45 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 114 | pub struct Ur12(pub u32); | 46 | pub struct Memrmp(pub u32); |
| 115 | impl Ur12 { | 47 | impl Memrmp { |
| 116 | #[doc = "Secure mode"] | 48 | #[doc = "Memory mapping selection"] |
| 117 | pub const fn secure(&self) -> bool { | 49 | pub const fn mem_mode(&self) -> u8 { |
| 118 | let val = (self.0 >> 16usize) & 0x01; | 50 | let val = (self.0 >> 0usize) & 0x07; |
| 51 | val as u8 | ||
| 52 | } | ||
| 53 | #[doc = "Memory mapping selection"] | ||
| 54 | pub fn set_mem_mode(&mut self, val: u8) { | ||
| 55 | self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize); | ||
| 56 | } | ||
| 57 | #[doc = "QUADSPI memory mapping swap"] | ||
| 58 | pub const fn qfs(&self) -> bool { | ||
| 59 | let val = (self.0 >> 3usize) & 0x01; | ||
| 119 | val != 0 | 60 | val != 0 |
| 120 | } | 61 | } |
| 121 | #[doc = "Secure mode"] | 62 | #[doc = "QUADSPI memory mapping swap"] |
| 122 | pub fn set_secure(&mut self, val: bool) { | 63 | pub fn set_qfs(&mut self, val: bool) { |
| 123 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | 64 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); |
| 65 | } | ||
| 66 | #[doc = "Flash Bank mode selection"] | ||
| 67 | pub const fn fb_mode(&self) -> bool { | ||
| 68 | let val = (self.0 >> 8usize) & 0x01; | ||
| 69 | val != 0 | ||
| 70 | } | ||
| 71 | #[doc = "Flash Bank mode selection"] | ||
| 72 | pub fn set_fb_mode(&mut self, val: bool) { | ||
| 73 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 124 | } | 74 | } |
| 125 | } | 75 | } |
| 126 | impl Default for Ur12 { | 76 | impl Default for Memrmp { |
| 127 | fn default() -> Ur12 { | 77 | fn default() -> Memrmp { |
| 128 | Ur12(0) | 78 | Memrmp(0) |
| 129 | } | 79 | } |
| 130 | } | 80 | } |
| 131 | #[doc = "SYSCFG user register 6"] | 81 | #[doc = "SWPR"] |
| 132 | #[repr(transparent)] | 82 | #[repr(transparent)] |
| 133 | #[derive(Copy, Clone, Eq, PartialEq)] | 83 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 134 | pub struct Ur6(pub u32); | 84 | pub struct Swpr(pub u32); |
| 135 | impl Ur6 { | 85 | impl Swpr { |
| 136 | #[doc = "Protected area start address for bank 1"] | 86 | #[doc = "SRAWM2 write protection."] |
| 137 | pub const fn pa_beg_1(&self) -> u16 { | 87 | pub fn pwp(&self, n: usize) -> bool { |
| 138 | let val = (self.0 >> 0usize) & 0x0fff; | 88 | assert!(n < 32usize); |
| 139 | val as u16 | 89 | let offs = 0usize + n * 1usize; |
| 140 | } | 90 | let val = (self.0 >> offs) & 0x01; |
| 141 | #[doc = "Protected area start address for bank 1"] | 91 | val != 0 |
| 142 | pub fn set_pa_beg_1(&mut self, val: u16) { | ||
| 143 | self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); | ||
| 144 | } | ||
| 145 | #[doc = "Protected area end address for bank 1"] | ||
| 146 | pub const fn pa_end_1(&self) -> u16 { | ||
| 147 | let val = (self.0 >> 16usize) & 0x0fff; | ||
| 148 | val as u16 | ||
| 149 | } | 92 | } |
| 150 | #[doc = "Protected area end address for bank 1"] | 93 | #[doc = "SRAWM2 write protection."] |
| 151 | pub fn set_pa_end_1(&mut self, val: u16) { | 94 | pub fn set_pwp(&mut self, n: usize, val: bool) { |
| 152 | self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); | 95 | assert!(n < 32usize); |
| 96 | let offs = 0usize + n * 1usize; | ||
| 97 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 153 | } | 98 | } |
| 154 | } | 99 | } |
| 155 | impl Default for Ur6 { | 100 | impl Default for Swpr { |
| 156 | fn default() -> Ur6 { | 101 | fn default() -> Swpr { |
| 157 | Ur6(0) | 102 | Swpr(0) |
| 158 | } | 103 | } |
| 159 | } | 104 | } |
| 160 | #[doc = "SYSCFG user register 16"] | 105 | #[doc = "configuration register 1"] |
| 161 | #[repr(transparent)] | 106 | #[repr(transparent)] |
| 162 | #[derive(Copy, Clone, Eq, PartialEq)] | 107 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 163 | pub struct Ur16(pub u32); | 108 | pub struct Cfgr1(pub u32); |
| 164 | impl Ur16 { | 109 | impl Cfgr1 { |
| 165 | #[doc = "Freeze independent watchdog in Stop mode"] | 110 | #[doc = "Firewall disable"] |
| 166 | pub const fn fziwdgstp(&self) -> bool { | 111 | pub const fn fwdis(&self) -> bool { |
| 167 | let val = (self.0 >> 0usize) & 0x01; | 112 | let val = (self.0 >> 0usize) & 0x01; |
| 168 | val != 0 | 113 | val != 0 |
| 169 | } | 114 | } |
| 170 | #[doc = "Freeze independent watchdog in Stop mode"] | 115 | #[doc = "Firewall disable"] |
| 171 | pub fn set_fziwdgstp(&mut self, val: bool) { | 116 | pub fn set_fwdis(&mut self, val: bool) { |
| 172 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 117 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 173 | } | 118 | } |
| 174 | #[doc = "Private key programmed"] | 119 | #[doc = "I/O analog switch voltage booster enable"] |
| 175 | pub const fn pkp(&self) -> bool { | 120 | pub const fn boosten(&self) -> bool { |
| 121 | let val = (self.0 >> 8usize) & 0x01; | ||
| 122 | val != 0 | ||
| 123 | } | ||
| 124 | #[doc = "I/O analog switch voltage booster enable"] | ||
| 125 | pub fn set_boosten(&mut self, val: bool) { | ||
| 126 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 127 | } | ||
| 128 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB6"] | ||
| 129 | pub const fn i2c_pb6_fmp(&self) -> bool { | ||
| 176 | let val = (self.0 >> 16usize) & 0x01; | 130 | let val = (self.0 >> 16usize) & 0x01; |
| 177 | val != 0 | 131 | val != 0 |
| 178 | } | 132 | } |
| 179 | #[doc = "Private key programmed"] | 133 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB6"] |
| 180 | pub fn set_pkp(&mut self, val: bool) { | 134 | pub fn set_i2c_pb6_fmp(&mut self, val: bool) { |
| 181 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | 135 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); |
| 182 | } | 136 | } |
| 137 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB7"] | ||
| 138 | pub const fn i2c_pb7_fmp(&self) -> bool { | ||
| 139 | let val = (self.0 >> 17usize) & 0x01; | ||
| 140 | val != 0 | ||
| 141 | } | ||
| 142 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB7"] | ||
| 143 | pub fn set_i2c_pb7_fmp(&mut self, val: bool) { | ||
| 144 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); | ||
| 145 | } | ||
| 146 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB8"] | ||
| 147 | pub const fn i2c_pb8_fmp(&self) -> bool { | ||
| 148 | let val = (self.0 >> 18usize) & 0x01; | ||
| 149 | val != 0 | ||
| 150 | } | ||
| 151 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB8"] | ||
| 152 | pub fn set_i2c_pb8_fmp(&mut self, val: bool) { | ||
| 153 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); | ||
| 154 | } | ||
| 155 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB9"] | ||
| 156 | pub const fn i2c_pb9_fmp(&self) -> bool { | ||
| 157 | let val = (self.0 >> 19usize) & 0x01; | ||
| 158 | val != 0 | ||
| 159 | } | ||
| 160 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB9"] | ||
| 161 | pub fn set_i2c_pb9_fmp(&mut self, val: bool) { | ||
| 162 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); | ||
| 163 | } | ||
| 164 | #[doc = "I2C1 Fast-mode Plus driving capability activation"] | ||
| 165 | pub const fn i2c1_fmp(&self) -> bool { | ||
| 166 | let val = (self.0 >> 20usize) & 0x01; | ||
| 167 | val != 0 | ||
| 168 | } | ||
| 169 | #[doc = "I2C1 Fast-mode Plus driving capability activation"] | ||
| 170 | pub fn set_i2c1_fmp(&mut self, val: bool) { | ||
| 171 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); | ||
| 172 | } | ||
| 173 | #[doc = "I2C2 Fast-mode Plus driving capability activation"] | ||
| 174 | pub const fn i2c2_fmp(&self) -> bool { | ||
| 175 | let val = (self.0 >> 21usize) & 0x01; | ||
| 176 | val != 0 | ||
| 177 | } | ||
| 178 | #[doc = "I2C2 Fast-mode Plus driving capability activation"] | ||
| 179 | pub fn set_i2c2_fmp(&mut self, val: bool) { | ||
| 180 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); | ||
| 181 | } | ||
| 182 | #[doc = "I2C3 Fast-mode Plus driving capability activation"] | ||
| 183 | pub const fn i2c3_fmp(&self) -> bool { | ||
| 184 | let val = (self.0 >> 22usize) & 0x01; | ||
| 185 | val != 0 | ||
| 186 | } | ||
| 187 | #[doc = "I2C3 Fast-mode Plus driving capability activation"] | ||
| 188 | pub fn set_i2c3_fmp(&mut self, val: bool) { | ||
| 189 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); | ||
| 190 | } | ||
| 191 | #[doc = "Floating Point Unit interrupts enable bits"] | ||
| 192 | pub const fn fpu_ie(&self) -> u8 { | ||
| 193 | let val = (self.0 >> 26usize) & 0x3f; | ||
| 194 | val as u8 | ||
| 195 | } | ||
| 196 | #[doc = "Floating Point Unit interrupts enable bits"] | ||
| 197 | pub fn set_fpu_ie(&mut self, val: u8) { | ||
| 198 | self.0 = (self.0 & !(0x3f << 26usize)) | (((val as u32) & 0x3f) << 26usize); | ||
| 199 | } | ||
| 183 | } | 200 | } |
| 184 | impl Default for Ur16 { | 201 | impl Default for Cfgr1 { |
| 185 | fn default() -> Ur16 { | 202 | fn default() -> Cfgr1 { |
| 186 | Ur16(0) | 203 | Cfgr1(0) |
| 187 | } | 204 | } |
| 188 | } | 205 | } |
| 189 | #[doc = "SYSCFG user register 3"] | 206 | #[doc = "external interrupt configuration register 4"] |
| 190 | #[repr(transparent)] | 207 | #[repr(transparent)] |
| 191 | #[derive(Copy, Clone, Eq, PartialEq)] | 208 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 192 | pub struct Ur3(pub u32); | 209 | pub struct Exticr(pub u32); |
| 193 | impl Ur3 { | 210 | impl Exticr { |
| 194 | #[doc = "Boot Address 1"] | 211 | #[doc = "EXTI12 configuration bits"] |
| 195 | pub const fn boot_add1(&self) -> u16 { | 212 | pub fn exti(&self, n: usize) -> u8 { |
| 196 | let val = (self.0 >> 16usize) & 0xffff; | 213 | assert!(n < 4usize); |
| 197 | val as u16 | 214 | let offs = 0usize + n * 4usize; |
| 215 | let val = (self.0 >> offs) & 0x0f; | ||
| 216 | val as u8 | ||
| 198 | } | 217 | } |
| 199 | #[doc = "Boot Address 1"] | 218 | #[doc = "EXTI12 configuration bits"] |
| 200 | pub fn set_boot_add1(&mut self, val: u16) { | 219 | pub fn set_exti(&mut self, n: usize, val: u8) { |
| 201 | self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize); | 220 | assert!(n < 4usize); |
| 221 | let offs = 0usize + n * 4usize; | ||
| 222 | self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs); | ||
| 202 | } | 223 | } |
| 203 | } | 224 | } |
| 204 | impl Default for Ur3 { | 225 | impl Default for Exticr { |
| 205 | fn default() -> Ur3 { | 226 | fn default() -> Exticr { |
| 206 | Ur3(0) | 227 | Exticr(0) |
| 207 | } | 228 | } |
| 208 | } | 229 | } |
| 209 | #[doc = "SYSCFG user register 8"] | 230 | #[doc = "CFGR2"] |
| 210 | #[repr(transparent)] | 231 | #[repr(transparent)] |
| 211 | #[derive(Copy, Clone, Eq, PartialEq)] | 232 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 212 | pub struct Ur8(pub u32); | 233 | pub struct Cfgr2(pub u32); |
| 213 | impl Ur8 { | 234 | impl Cfgr2 { |
| 214 | #[doc = "Mass erase protected area disabled for bank 2"] | 235 | #[doc = "Cortex LOCKUP (Hardfault) output enable bit"] |
| 215 | pub const fn mepad_2(&self) -> bool { | 236 | pub const fn cll(&self) -> bool { |
| 216 | let val = (self.0 >> 0usize) & 0x01; | 237 | let val = (self.0 >> 0usize) & 0x01; |
| 217 | val != 0 | 238 | val != 0 |
| 218 | } | 239 | } |
| 219 | #[doc = "Mass erase protected area disabled for bank 2"] | 240 | #[doc = "Cortex LOCKUP (Hardfault) output enable bit"] |
| 220 | pub fn set_mepad_2(&mut self, val: bool) { | 241 | pub fn set_cll(&mut self, val: bool) { |
| 221 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 242 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 222 | } | 243 | } |
| 223 | #[doc = "Mass erase secured area disabled for bank 2"] | 244 | #[doc = "SRAM2 parity lock bit"] |
| 224 | pub const fn mesad_2(&self) -> bool { | 245 | pub const fn spl(&self) -> bool { |
| 225 | let val = (self.0 >> 16usize) & 0x01; | 246 | let val = (self.0 >> 1usize) & 0x01; |
| 226 | val != 0 | 247 | val != 0 |
| 227 | } | 248 | } |
| 228 | #[doc = "Mass erase secured area disabled for bank 2"] | 249 | #[doc = "SRAM2 parity lock bit"] |
| 229 | pub fn set_mesad_2(&mut self, val: bool) { | 250 | pub fn set_spl(&mut self, val: bool) { |
| 230 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | 251 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 252 | } | ||
| 253 | #[doc = "PVD lock enable bit"] | ||
| 254 | pub const fn pvdl(&self) -> bool { | ||
| 255 | let val = (self.0 >> 2usize) & 0x01; | ||
| 256 | val != 0 | ||
| 257 | } | ||
| 258 | #[doc = "PVD lock enable bit"] | ||
| 259 | pub fn set_pvdl(&mut self, val: bool) { | ||
| 260 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 261 | } | ||
| 262 | #[doc = "ECC Lock"] | ||
| 263 | pub const fn eccl(&self) -> bool { | ||
| 264 | let val = (self.0 >> 3usize) & 0x01; | ||
| 265 | val != 0 | ||
| 266 | } | ||
| 267 | #[doc = "ECC Lock"] | ||
| 268 | pub fn set_eccl(&mut self, val: bool) { | ||
| 269 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | ||
| 270 | } | ||
| 271 | #[doc = "SRAM2 parity error flag"] | ||
| 272 | pub const fn spf(&self) -> bool { | ||
| 273 | let val = (self.0 >> 8usize) & 0x01; | ||
| 274 | val != 0 | ||
| 275 | } | ||
| 276 | #[doc = "SRAM2 parity error flag"] | ||
| 277 | pub fn set_spf(&mut self, val: bool) { | ||
| 278 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 231 | } | 279 | } |
| 232 | } | 280 | } |
| 233 | impl Default for Ur8 { | 281 | impl Default for Cfgr2 { |
| 234 | fn default() -> Ur8 { | 282 | fn default() -> Cfgr2 { |
| 235 | Ur8(0) | 283 | Cfgr2(0) |
| 236 | } | 284 | } |
| 237 | } | 285 | } |
| 238 | #[doc = "SYSCFG compensation cell value register"] | 286 | #[doc = "SKR"] |
| 239 | #[repr(transparent)] | 287 | #[repr(transparent)] |
| 240 | #[derive(Copy, Clone, Eq, PartialEq)] | 288 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 241 | pub struct Ccvr(pub u32); | 289 | pub struct Skr(pub u32); |
| 242 | impl Ccvr { | 290 | impl Skr { |
| 243 | #[doc = "NMOS compensation value"] | 291 | #[doc = "SRAM2 write protection key for software erase"] |
| 244 | pub const fn ncv(&self) -> u8 { | 292 | pub const fn key(&self) -> u8 { |
| 245 | let val = (self.0 >> 0usize) & 0x0f; | 293 | let val = (self.0 >> 0usize) & 0xff; |
| 246 | val as u8 | ||
| 247 | } | ||
| 248 | #[doc = "NMOS compensation value"] | ||
| 249 | pub fn set_ncv(&mut self, val: u8) { | ||
| 250 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); | ||
| 251 | } | ||
| 252 | #[doc = "PMOS compensation value"] | ||
| 253 | pub const fn pcv(&self) -> u8 { | ||
| 254 | let val = (self.0 >> 4usize) & 0x0f; | ||
| 255 | val as u8 | 294 | val as u8 |
| 256 | } | 295 | } |
| 257 | #[doc = "PMOS compensation value"] | 296 | #[doc = "SRAM2 write protection key for software erase"] |
| 258 | pub fn set_pcv(&mut self, val: u8) { | 297 | pub fn set_key(&mut self, val: u8) { |
| 259 | self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize); | 298 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); |
| 260 | } | 299 | } |
| 261 | } | 300 | } |
| 262 | impl Default for Ccvr { | 301 | impl Default for Skr { |
| 263 | fn default() -> Ccvr { | 302 | fn default() -> Skr { |
| 264 | Ccvr(0) | 303 | Skr(0) |
| 265 | } | 304 | } |
| 266 | } | 305 | } |
| 267 | #[doc = "SYSCFG user register 11"] | 306 | #[doc = "SCSR"] |
| 268 | #[repr(transparent)] | 307 | #[repr(transparent)] |
| 269 | #[derive(Copy, Clone, Eq, PartialEq)] | 308 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 270 | pub struct Ur11(pub u32); | 309 | pub struct Scsr(pub u32); |
| 271 | impl Ur11 { | 310 | impl Scsr { |
| 272 | #[doc = "Secured area end address for bank 2"] | 311 | #[doc = "SRAM2 Erase"] |
| 273 | pub const fn sa_end_2(&self) -> u16 { | 312 | pub const fn sram2er(&self) -> bool { |
| 274 | let val = (self.0 >> 0usize) & 0x0fff; | 313 | let val = (self.0 >> 0usize) & 0x01; |
| 275 | val as u16 | 314 | val != 0 |
| 276 | } | 315 | } |
| 277 | #[doc = "Secured area end address for bank 2"] | 316 | #[doc = "SRAM2 Erase"] |
| 278 | pub fn set_sa_end_2(&mut self, val: u16) { | 317 | pub fn set_sram2er(&mut self, val: bool) { |
| 279 | self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); | 318 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 280 | } | 319 | } |
| 281 | #[doc = "Independent Watchdog 1 mode"] | 320 | #[doc = "SRAM2 busy by erase operation"] |
| 282 | pub const fn iwdg1m(&self) -> bool { | 321 | pub const fn sram2bsy(&self) -> bool { |
| 283 | let val = (self.0 >> 16usize) & 0x01; | 322 | let val = (self.0 >> 1usize) & 0x01; |
| 284 | val != 0 | 323 | val != 0 |
| 285 | } | 324 | } |
| 286 | #[doc = "Independent Watchdog 1 mode"] | 325 | #[doc = "SRAM2 busy by erase operation"] |
| 287 | pub fn set_iwdg1m(&mut self, val: bool) { | 326 | pub fn set_sram2bsy(&mut self, val: bool) { |
| 288 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | 327 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 289 | } | 328 | } |
| 290 | } | 329 | } |
| 291 | impl Default for Ur11 { | 330 | impl Default for Scsr { |
| 292 | fn default() -> Ur11 { | 331 | fn default() -> Scsr { |
| 293 | Ur11(0) | 332 | Scsr(0) |
| 294 | } | 333 | } |
| 295 | } | 334 | } |
| 296 | #[doc = "SYSCFG user register 9"] | 335 | } |
| 336 | } | ||
| 337 | pub mod sdmmc_v2 { | ||
| 338 | use crate::generic::*; | ||
| 339 | #[doc = "SDMMC"] | ||
| 340 | #[derive(Copy, Clone)] | ||
| 341 | pub struct Sdmmc(pub *mut u8); | ||
| 342 | unsafe impl Send for Sdmmc {} | ||
| 343 | unsafe impl Sync for Sdmmc {} | ||
| 344 | impl Sdmmc { | ||
| 345 | #[doc = "SDMMC power control register"] | ||
| 346 | pub fn power(self) -> Reg<regs::Power, RW> { | ||
| 347 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 348 | } | ||
| 349 | #[doc = "The SDMMC_CLKCR register controls the SDMMC_CK output clock, the SDMMC_RX_CLK receive clock, and the bus width."] | ||
| 350 | pub fn clkcr(self) -> Reg<regs::Clkcr, RW> { | ||
| 351 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 352 | } | ||
| 353 | #[doc = "The SDMMC_ARGR register contains a 32-bit command argument, which is sent to a card as part of a command message."] | ||
| 354 | pub fn argr(self) -> Reg<regs::Argr, RW> { | ||
| 355 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 356 | } | ||
| 357 | #[doc = "The SDMMC_CMDR register contains the command index and command type bits. The command index is sent to a card as part of a command message. The command type bits control the command path state machine (CPSM)."] | ||
| 358 | pub fn cmdr(self) -> Reg<regs::Cmdr, RW> { | ||
| 359 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 360 | } | ||
| 361 | #[doc = "SDMMC command response register"] | ||
| 362 | pub fn respcmdr(self) -> Reg<regs::Respcmdr, R> { | ||
| 363 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 364 | } | ||
| 365 | #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] | ||
| 366 | pub fn respr(self, n: usize) -> Reg<regs::Resp1r, R> { | ||
| 367 | assert!(n < 4usize); | ||
| 368 | unsafe { Reg::from_ptr(self.0.add(20usize + n * 4usize)) } | ||
| 369 | } | ||
| 370 | #[doc = "The SDMMC_DTIMER register contains the data timeout period, in card bus clock periods. A counter loads the value from the SDMMC_DTIMER register, and starts decrementing when the data path state machine (DPSM) enters the Wait_R or Busy state. If the timer reaches 0 while the DPSM is in either of these states, the timeout status flag is set."] | ||
| 371 | pub fn dtimer(self) -> Reg<regs::Dtimer, RW> { | ||
| 372 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | ||
| 373 | } | ||
| 374 | #[doc = "The SDMMC_DLENR register contains the number of data bytes to be transferred. The value is loaded into the data counter when data transfer starts."] | ||
| 375 | pub fn dlenr(self) -> Reg<regs::Dlenr, RW> { | ||
| 376 | unsafe { Reg::from_ptr(self.0.add(40usize)) } | ||
| 377 | } | ||
| 378 | #[doc = "The SDMMC_DCTRL register control the data path state machine (DPSM)."] | ||
| 379 | pub fn dctrl(self) -> Reg<regs::Dctrl, RW> { | ||
| 380 | unsafe { Reg::from_ptr(self.0.add(44usize)) } | ||
| 381 | } | ||
| 382 | #[doc = "The SDMMC_DCNTR register loads the value from the data length register (see SDMMC_DLENR) when the DPSM moves from the Idle state to the Wait_R or Wait_S state. As data is transferred, the counter decrements the value until it reaches 0. The DPSM then moves to the Idle state and when there has been no error, the data status end flag (DATAEND) is set."] | ||
| 383 | pub fn dcntr(self) -> Reg<regs::Dcntr, R> { | ||
| 384 | unsafe { Reg::from_ptr(self.0.add(48usize)) } | ||
| 385 | } | ||
| 386 | #[doc = "The SDMMC_STAR register is a read-only register. It contains two types of flag:Static flags (bits [29,21,11:0]): these bits remain asserted until they are cleared by writing to the SDMMC interrupt Clear register (see SDMMC_ICR)Dynamic flags (bits [20:12]): these bits change state depending on the state of the underlying logic (for example, FIFO full and empty flags are asserted and de-asserted as data while written to the FIFO)"] | ||
| 387 | pub fn star(self) -> Reg<regs::Star, R> { | ||
| 388 | unsafe { Reg::from_ptr(self.0.add(52usize)) } | ||
| 389 | } | ||
| 390 | #[doc = "The SDMMC_ICR register is a write-only register. Writing a bit with 1 clears the corresponding bit in the SDMMC_STAR status register."] | ||
| 391 | pub fn icr(self) -> Reg<regs::Icr, RW> { | ||
| 392 | unsafe { Reg::from_ptr(self.0.add(56usize)) } | ||
| 393 | } | ||
| 394 | #[doc = "The interrupt mask register determines which status flags generate an interrupt request by setting the corresponding bit to 1."] | ||
| 395 | pub fn maskr(self) -> Reg<regs::Maskr, RW> { | ||
| 396 | unsafe { Reg::from_ptr(self.0.add(60usize)) } | ||
| 397 | } | ||
| 398 | #[doc = "The SDMMC_ACKTIMER register contains the acknowledgment timeout period, in SDMMC_CK bus clock periods. A counter loads the value from the SDMMC_ACKTIMER register, and starts decrementing when the data path state machine (DPSM) enters the Wait_Ack state. If the timer reaches 0 while the DPSM is in this states, the acknowledgment timeout status flag is set."] | ||
| 399 | pub fn acktimer(self) -> Reg<regs::Acktimer, RW> { | ||
| 400 | unsafe { Reg::from_ptr(self.0.add(64usize)) } | ||
| 401 | } | ||
| 402 | #[doc = "The receive and transmit FIFOs can be read or written as 32-bit wide registers. The FIFOs contain 32 entries on 32 sequential addresses. This allows the CPU to use its load and store multiple operands to read from/write to the FIFO."] | ||
| 403 | pub fn idmactrlr(self) -> Reg<regs::Idmactrlr, RW> { | ||
| 404 | unsafe { Reg::from_ptr(self.0.add(80usize)) } | ||
| 405 | } | ||
| 406 | #[doc = "The SDMMC_IDMABSIZER register contains the buffers size when in double buffer configuration."] | ||
| 407 | pub fn idmabsizer(self) -> Reg<regs::Idmabsizer, RW> { | ||
| 408 | unsafe { Reg::from_ptr(self.0.add(84usize)) } | ||
| 409 | } | ||
| 410 | #[doc = "The SDMMC_IDMABASE0R register contains the memory buffer base address in single buffer configuration and the buffer 0 base address in double buffer configuration."] | ||
| 411 | pub fn idmabase0r(self) -> Reg<regs::Idmabase0r, RW> { | ||
| 412 | unsafe { Reg::from_ptr(self.0.add(88usize)) } | ||
| 413 | } | ||
| 414 | #[doc = "The SDMMC_IDMABASE1R register contains the double buffer configuration second buffer memory base address."] | ||
| 415 | pub fn idmabase1r(self) -> Reg<regs::Idmabase1r, RW> { | ||
| 416 | unsafe { Reg::from_ptr(self.0.add(92usize)) } | ||
| 417 | } | ||
| 418 | #[doc = "The receive and transmit FIFOs can be only read or written as word (32-bit) wide registers. The FIFOs contain 16 entries on sequential addresses. This allows the CPU to use its load and store multiple operands to read from/write to the FIFO.When accessing SDMMC_FIFOR with half word or byte access an AHB bus fault is generated."] | ||
| 419 | pub fn fifor(self) -> Reg<regs::Fifor, RW> { | ||
| 420 | unsafe { Reg::from_ptr(self.0.add(128usize)) } | ||
| 421 | } | ||
| 422 | #[doc = "SDMMC IP version register"] | ||
| 423 | pub fn ver(self) -> Reg<regs::Ver, R> { | ||
| 424 | unsafe { Reg::from_ptr(self.0.add(1012usize)) } | ||
| 425 | } | ||
| 426 | #[doc = "SDMMC IP identification register"] | ||
| 427 | pub fn id(self) -> Reg<regs::Id, R> { | ||
| 428 | unsafe { Reg::from_ptr(self.0.add(1016usize)) } | ||
| 429 | } | ||
| 430 | } | ||
| 431 | pub mod regs { | ||
| 432 | use crate::generic::*; | ||
| 433 | #[doc = "The SDMMC_IDMABASE1R register contains the double buffer configuration second buffer memory base address."] | ||
| 297 | #[repr(transparent)] | 434 | #[repr(transparent)] |
| 298 | #[derive(Copy, Clone, Eq, PartialEq)] | 435 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 299 | pub struct Ur9(pub u32); | 436 | pub struct Idmabase1r(pub u32); |
| 300 | impl Ur9 { | 437 | impl Idmabase1r { |
| 301 | #[doc = "Write protection for flash bank 2"] | 438 | #[doc = "Buffer 1 memory base address, shall be word aligned (bit [1:0] |
| 302 | pub const fn wrpn_2(&self) -> u8 { | 439 | are always 0 and read only). This register can be written by firmware when DPSM is inactive (DPSMACT = 0), and can dynamically be written by firmware when DPSM active (DPSMACT = 1) and memory buffer 1 is inactive (IDMABACT = 0)."] |
| 303 | let val = (self.0 >> 0usize) & 0xff; | 440 | pub const fn idmabase1(&self) -> u32 { |
| 304 | val as u8 | 441 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 305 | } | 442 | val as u32 |
| 306 | #[doc = "Write protection for flash bank 2"] | ||
| 307 | pub fn set_wrpn_2(&mut self, val: u8) { | ||
| 308 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | ||
| 309 | } | ||
| 310 | #[doc = "Protected area start address for bank 2"] | ||
| 311 | pub const fn pa_beg_2(&self) -> u16 { | ||
| 312 | let val = (self.0 >> 16usize) & 0x0fff; | ||
| 313 | val as u16 | ||
| 314 | } | 443 | } |
| 315 | #[doc = "Protected area start address for bank 2"] | 444 | #[doc = "Buffer 1 memory base address, shall be word aligned (bit [1:0] |
| 316 | pub fn set_pa_beg_2(&mut self, val: u16) { | 445 | are always 0 and read only). This register can be written by firmware when DPSM is inactive (DPSMACT = 0), and can dynamically be written by firmware when DPSM active (DPSMACT = 1) and memory buffer 1 is inactive (IDMABACT = 0)."] |
| 317 | self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); | 446 | pub fn set_idmabase1(&mut self, val: u32) { |
| 447 | self.0 = | ||
| 448 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 318 | } | 449 | } |
| 319 | } | 450 | } |
| 320 | impl Default for Ur9 { | 451 | impl Default for Idmabase1r { |
| 321 | fn default() -> Ur9 { | 452 | fn default() -> Idmabase1r { |
| 322 | Ur9(0) | 453 | Idmabase1r(0) |
| 323 | } | 454 | } |
| 324 | } | 455 | } |
| 325 | #[doc = "SYSCFG power control register"] | 456 | #[doc = "SDMMC command response register"] |
| 326 | #[repr(transparent)] | 457 | #[repr(transparent)] |
| 327 | #[derive(Copy, Clone, Eq, PartialEq)] | 458 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 328 | pub struct Pwrcr(pub u32); | 459 | pub struct Respcmdr(pub u32); |
| 329 | impl Pwrcr { | 460 | impl Respcmdr { |
| 330 | #[doc = "Overdrive enable"] | 461 | #[doc = "Response command index"] |
| 331 | pub const fn oden(&self) -> u8 { | 462 | pub const fn respcmd(&self) -> u8 { |
| 332 | let val = (self.0 >> 0usize) & 0x0f; | 463 | let val = (self.0 >> 0usize) & 0x3f; |
| 333 | val as u8 | 464 | val as u8 |
| 334 | } | 465 | } |
| 335 | #[doc = "Overdrive enable"] | 466 | #[doc = "Response command index"] |
| 336 | pub fn set_oden(&mut self, val: u8) { | 467 | pub fn set_respcmd(&mut self, val: u8) { |
| 337 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); | 468 | self.0 = (self.0 & !(0x3f << 0usize)) | (((val as u32) & 0x3f) << 0usize); |
| 338 | } | 469 | } |
| 339 | } | 470 | } |
| 340 | impl Default for Pwrcr { | 471 | impl Default for Respcmdr { |
| 341 | fn default() -> Pwrcr { | 472 | fn default() -> Respcmdr { |
| 342 | Pwrcr(0) | 473 | Respcmdr(0) |
| 343 | } | 474 | } |
| 344 | } | 475 | } |
| 345 | #[doc = "SYSCFG user register 15"] | 476 | #[doc = "The SDMMC_DCNTR register loads the value from the data length register (see SDMMC_DLENR) when the DPSM moves from the Idle state to the Wait_R or Wait_S state. As data is transferred, the counter decrements the value until it reaches 0. The DPSM then moves to the Idle state and when there has been no error, the data status end flag (DATAEND) is set."] |
| 346 | #[repr(transparent)] | 477 | #[repr(transparent)] |
| 347 | #[derive(Copy, Clone, Eq, PartialEq)] | 478 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 348 | pub struct Ur15(pub u32); | 479 | pub struct Dcntr(pub u32); |
| 349 | impl Ur15 { | 480 | impl Dcntr { |
| 350 | #[doc = "Freeze independent watchdog in Standby mode"] | 481 | #[doc = "Data count value When read, the number of remaining data bytes to be transferred is returned. Write has no effect."] |
| 351 | pub const fn fziwdgstb(&self) -> bool { | 482 | pub const fn datacount(&self) -> u32 { |
| 352 | let val = (self.0 >> 16usize) & 0x01; | 483 | let val = (self.0 >> 0usize) & 0x01ff_ffff; |
| 353 | val != 0 | 484 | val as u32 |
| 354 | } | 485 | } |
| 355 | #[doc = "Freeze independent watchdog in Standby mode"] | 486 | #[doc = "Data count value When read, the number of remaining data bytes to be transferred is returned. Write has no effect."] |
| 356 | pub fn set_fziwdgstb(&mut self, val: bool) { | 487 | pub fn set_datacount(&mut self, val: u32) { |
| 357 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | 488 | self.0 = |
| 489 | (self.0 & !(0x01ff_ffff << 0usize)) | (((val as u32) & 0x01ff_ffff) << 0usize); | ||
| 358 | } | 490 | } |
| 359 | } | 491 | } |
| 360 | impl Default for Ur15 { | 492 | impl Default for Dcntr { |
| 361 | fn default() -> Ur15 { | 493 | fn default() -> Dcntr { |
| 362 | Ur15(0) | 494 | Dcntr(0) |
| 363 | } | 495 | } |
| 364 | } | 496 | } |
| 365 | #[doc = "SYSCFG compensation cell code register"] | 497 | #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] |
| 366 | #[repr(transparent)] | 498 | #[repr(transparent)] |
| 367 | #[derive(Copy, Clone, Eq, PartialEq)] | 499 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 368 | pub struct Cccr(pub u32); | 500 | pub struct Resp4r(pub u32); |
| 369 | impl Cccr { | 501 | impl Resp4r { |
| 370 | #[doc = "NMOS compensation code"] | 502 | #[doc = "see Table404."] |
| 371 | pub const fn ncc(&self) -> u8 { | 503 | pub const fn cardstatus4(&self) -> u32 { |
| 372 | let val = (self.0 >> 0usize) & 0x0f; | 504 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 373 | val as u8 | 505 | val as u32 |
| 374 | } | ||
| 375 | #[doc = "NMOS compensation code"] | ||
| 376 | pub fn set_ncc(&mut self, val: u8) { | ||
| 377 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); | ||
| 378 | } | ||
| 379 | #[doc = "PMOS compensation code"] | ||
| 380 | pub const fn pcc(&self) -> u8 { | ||
| 381 | let val = (self.0 >> 4usize) & 0x0f; | ||
| 382 | val as u8 | ||
| 383 | } | 506 | } |
| 384 | #[doc = "PMOS compensation code"] | 507 | #[doc = "see Table404."] |
| 385 | pub fn set_pcc(&mut self, val: u8) { | 508 | pub fn set_cardstatus4(&mut self, val: u32) { |
| 386 | self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize); | 509 | self.0 = |
| 510 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 387 | } | 511 | } |
| 388 | } | 512 | } |
| 389 | impl Default for Cccr { | 513 | impl Default for Resp4r { |
| 390 | fn default() -> Cccr { | 514 | fn default() -> Resp4r { |
| 391 | Cccr(0) | 515 | Resp4r(0) |
| 392 | } | 516 | } |
| 393 | } | 517 | } |
| 394 | #[doc = "SYSCFG user register 2"] | 518 | #[doc = "The SDMMC_ACKTIMER register contains the acknowledgment timeout period, in SDMMC_CK bus clock periods. A counter loads the value from the SDMMC_ACKTIMER register, and starts decrementing when the data path state machine (DPSM) enters the Wait_Ack state. If the timer reaches 0 while the DPSM is in this states, the acknowledgment timeout status flag is set."] |
| 395 | #[repr(transparent)] | 519 | #[repr(transparent)] |
| 396 | #[derive(Copy, Clone, Eq, PartialEq)] | 520 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 397 | pub struct Ur2(pub u32); | 521 | pub struct Acktimer(pub u32); |
| 398 | impl Ur2 { | 522 | impl Acktimer { |
| 399 | #[doc = "BOR_LVL Brownout Reset Threshold Level"] | 523 | #[doc = "Boot acknowledgment timeout period This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). Boot acknowledgment timeout period expressed in card bus clock periods."] |
| 400 | pub const fn borh(&self) -> u8 { | 524 | pub const fn acktime(&self) -> u32 { |
| 401 | let val = (self.0 >> 0usize) & 0x03; | 525 | let val = (self.0 >> 0usize) & 0x01ff_ffff; |
| 402 | val as u8 | 526 | val as u32 |
| 403 | } | ||
| 404 | #[doc = "BOR_LVL Brownout Reset Threshold Level"] | ||
| 405 | pub fn set_borh(&mut self, val: u8) { | ||
| 406 | self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize); | ||
| 407 | } | ||
| 408 | #[doc = "Boot Address 0"] | ||
| 409 | pub const fn boot_add0(&self) -> u16 { | ||
| 410 | let val = (self.0 >> 16usize) & 0xffff; | ||
| 411 | val as u16 | ||
| 412 | } | 527 | } |
| 413 | #[doc = "Boot Address 0"] | 528 | #[doc = "Boot acknowledgment timeout period This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). Boot acknowledgment timeout period expressed in card bus clock periods."] |
| 414 | pub fn set_boot_add0(&mut self, val: u16) { | 529 | pub fn set_acktime(&mut self, val: u32) { |
| 415 | self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize); | 530 | self.0 = |
| 531 | (self.0 & !(0x01ff_ffff << 0usize)) | (((val as u32) & 0x01ff_ffff) << 0usize); | ||
| 416 | } | 532 | } |
| 417 | } | 533 | } |
| 418 | impl Default for Ur2 { | 534 | impl Default for Acktimer { |
| 419 | fn default() -> Ur2 { | 535 | fn default() -> Acktimer { |
| 420 | Ur2(0) | 536 | Acktimer(0) |
| 421 | } | 537 | } |
| 422 | } | 538 | } |
| 423 | #[doc = "SYSCFG user register 14"] | 539 | #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] |
| 424 | #[repr(transparent)] | 540 | #[repr(transparent)] |
| 425 | #[derive(Copy, Clone, Eq, PartialEq)] | 541 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 426 | pub struct Ur14(pub u32); | 542 | pub struct Resp2r(pub u32); |
| 427 | impl Ur14 { | 543 | impl Resp2r { |
| 428 | #[doc = "D1 Stop Reset"] | 544 | #[doc = "see Table404."] |
| 429 | pub const fn d1stprst(&self) -> bool { | 545 | pub const fn cardstatus2(&self) -> u32 { |
| 430 | let val = (self.0 >> 0usize) & 0x01; | 546 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 431 | val != 0 | 547 | val as u32 |
| 432 | } | 548 | } |
| 433 | #[doc = "D1 Stop Reset"] | 549 | #[doc = "see Table404."] |
| 434 | pub fn set_d1stprst(&mut self, val: bool) { | 550 | pub fn set_cardstatus2(&mut self, val: u32) { |
| 435 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 551 | self.0 = |
| 552 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 436 | } | 553 | } |
| 437 | } | 554 | } |
| 438 | impl Default for Ur14 { | 555 | impl Default for Resp2r { |
| 439 | fn default() -> Ur14 { | 556 | fn default() -> Resp2r { |
| 440 | Ur14(0) | 557 | Resp2r(0) |
| 441 | } | 558 | } |
| 442 | } | 559 | } |
| 443 | #[doc = "SYSCFG user register 0"] | 560 | #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] |
| 444 | #[repr(transparent)] | 561 | #[repr(transparent)] |
| 445 | #[derive(Copy, Clone, Eq, PartialEq)] | 562 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 446 | pub struct Ur0(pub u32); | 563 | pub struct Resp1r(pub u32); |
| 447 | impl Ur0 { | 564 | impl Resp1r { |
| 448 | #[doc = "Bank Swap"] | 565 | #[doc = "see Table 432"] |
| 449 | pub const fn bks(&self) -> bool { | 566 | pub const fn cardstatus1(&self) -> u32 { |
| 450 | let val = (self.0 >> 0usize) & 0x01; | 567 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 451 | val != 0 | 568 | val as u32 |
| 452 | } | ||
| 453 | #[doc = "Bank Swap"] | ||
| 454 | pub fn set_bks(&mut self, val: bool) { | ||
| 455 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 456 | } | ||
| 457 | #[doc = "Readout protection"] | ||
| 458 | pub const fn rdp(&self) -> u8 { | ||
| 459 | let val = (self.0 >> 16usize) & 0xff; | ||
| 460 | val as u8 | ||
| 461 | } | 569 | } |
| 462 | #[doc = "Readout protection"] | 570 | #[doc = "see Table 432"] |
| 463 | pub fn set_rdp(&mut self, val: u8) { | 571 | pub fn set_cardstatus1(&mut self, val: u32) { |
| 464 | self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize); | 572 | self.0 = |
| 573 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 465 | } | 574 | } |
| 466 | } | 575 | } |
| 467 | impl Default for Ur0 { | 576 | impl Default for Resp1r { |
| 468 | fn default() -> Ur0 { | 577 | fn default() -> Resp1r { |
| 469 | Ur0(0) | 578 | Resp1r(0) |
| 470 | } | 579 | } |
| 471 | } | 580 | } |
| 472 | #[doc = "external interrupt configuration register 2"] | 581 | #[doc = "The SDMMC_IDMABASE0R register contains the memory buffer base address in single buffer configuration and the buffer 0 base address in double buffer configuration."] |
| 473 | #[repr(transparent)] | 582 | #[repr(transparent)] |
| 474 | #[derive(Copy, Clone, Eq, PartialEq)] | 583 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 475 | pub struct Exticr(pub u32); | 584 | pub struct Idmabase0r(pub u32); |
| 476 | impl Exticr { | 585 | impl Idmabase0r { |
| 477 | #[doc = "EXTI x configuration (x = 4 to 7)"] | 586 | #[doc = "Buffer 0 memory base address bits [31:2], shall be word aligned (bit [1:0] |
| 478 | pub fn exti(&self, n: usize) -> u8 { | 587 | are always 0 and read only). This register can be written by firmware when DPSM is inactive (DPSMACT = 0), and can dynamically be written by firmware when DPSM active (DPSMACT = 1) and memory buffer 0 is inactive (IDMABACT = 1)."] |
| 479 | assert!(n < 4usize); | 588 | pub const fn idmabase0(&self) -> u32 { |
| 480 | let offs = 0usize + n * 4usize; | 589 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 481 | let val = (self.0 >> offs) & 0x0f; | 590 | val as u32 |
| 482 | val as u8 | ||
| 483 | } | 591 | } |
| 484 | #[doc = "EXTI x configuration (x = 4 to 7)"] | 592 | #[doc = "Buffer 0 memory base address bits [31:2], shall be word aligned (bit [1:0] |
| 485 | pub fn set_exti(&mut self, n: usize, val: u8) { | 593 | are always 0 and read only). This register can be written by firmware when DPSM is inactive (DPSMACT = 0), and can dynamically be written by firmware when DPSM active (DPSMACT = 1) and memory buffer 0 is inactive (IDMABACT = 1)."] |
| 486 | assert!(n < 4usize); | 594 | pub fn set_idmabase0(&mut self, val: u32) { |
| 487 | let offs = 0usize + n * 4usize; | 595 | self.0 = |
| 488 | self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs); | 596 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); |
| 489 | } | 597 | } |
| 490 | } | 598 | } |
| 491 | impl Default for Exticr { | 599 | impl Default for Idmabase0r { |
| 492 | fn default() -> Exticr { | 600 | fn default() -> Idmabase0r { |
| 493 | Exticr(0) | 601 | Idmabase0r(0) |
| 494 | } | 602 | } |
| 495 | } | 603 | } |
| 496 | #[doc = "peripheral mode configuration register"] | 604 | #[doc = "The SDMMC_ICR register is a write-only register. Writing a bit with 1 clears the corresponding bit in the SDMMC_STAR status register."] |
| 497 | #[repr(transparent)] | 605 | #[repr(transparent)] |
| 498 | #[derive(Copy, Clone, Eq, PartialEq)] | 606 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 499 | pub struct Pmcr(pub u32); | 607 | pub struct Icr(pub u32); |
| 500 | impl Pmcr { | 608 | impl Icr { |
| 501 | #[doc = "I2C1 Fm+"] | 609 | #[doc = "CCRCFAIL flag clear bit Set by software to clear the CCRCFAIL flag."] |
| 502 | pub const fn i2c1fmp(&self) -> bool { | 610 | pub const fn ccrcfailc(&self) -> bool { |
| 503 | let val = (self.0 >> 0usize) & 0x01; | 611 | let val = (self.0 >> 0usize) & 0x01; |
| 504 | val != 0 | 612 | val != 0 |
| 505 | } | 613 | } |
| 506 | #[doc = "I2C1 Fm+"] | 614 | #[doc = "CCRCFAIL flag clear bit Set by software to clear the CCRCFAIL flag."] |
| 507 | pub fn set_i2c1fmp(&mut self, val: bool) { | 615 | pub fn set_ccrcfailc(&mut self, val: bool) { |
| 508 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 616 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 509 | } | 617 | } |
| 510 | #[doc = "I2C2 Fm+"] | 618 | #[doc = "DCRCFAIL flag clear bit Set by software to clear the DCRCFAIL flag."] |
| 511 | pub const fn i2c2fmp(&self) -> bool { | 619 | pub const fn dcrcfailc(&self) -> bool { |
| 512 | let val = (self.0 >> 1usize) & 0x01; | 620 | let val = (self.0 >> 1usize) & 0x01; |
| 513 | val != 0 | 621 | val != 0 |
| 514 | } | 622 | } |
| 515 | #[doc = "I2C2 Fm+"] | 623 | #[doc = "DCRCFAIL flag clear bit Set by software to clear the DCRCFAIL flag."] |
| 516 | pub fn set_i2c2fmp(&mut self, val: bool) { | 624 | pub fn set_dcrcfailc(&mut self, val: bool) { |
| 517 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 625 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 518 | } | 626 | } |
| 519 | #[doc = "I2C3 Fm+"] | 627 | #[doc = "CTIMEOUT flag clear bit Set by software to clear the CTIMEOUT flag."] |
| 520 | pub const fn i2c3fmp(&self) -> bool { | 628 | pub const fn ctimeoutc(&self) -> bool { |
| 521 | let val = (self.0 >> 2usize) & 0x01; | 629 | let val = (self.0 >> 2usize) & 0x01; |
| 522 | val != 0 | 630 | val != 0 |
| 523 | } | 631 | } |
| 524 | #[doc = "I2C3 Fm+"] | 632 | #[doc = "CTIMEOUT flag clear bit Set by software to clear the CTIMEOUT flag."] |
| 525 | pub fn set_i2c3fmp(&mut self, val: bool) { | 633 | pub fn set_ctimeoutc(&mut self, val: bool) { |
| 526 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 634 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 527 | } | 635 | } |
| 528 | #[doc = "I2C4 Fm+"] | 636 | #[doc = "DTIMEOUT flag clear bit Set by software to clear the DTIMEOUT flag."] |
| 529 | pub const fn i2c4fmp(&self) -> bool { | 637 | pub const fn dtimeoutc(&self) -> bool { |
| 530 | let val = (self.0 >> 3usize) & 0x01; | 638 | let val = (self.0 >> 3usize) & 0x01; |
| 531 | val != 0 | 639 | val != 0 |
| 532 | } | 640 | } |
| 533 | #[doc = "I2C4 Fm+"] | 641 | #[doc = "DTIMEOUT flag clear bit Set by software to clear the DTIMEOUT flag."] |
| 534 | pub fn set_i2c4fmp(&mut self, val: bool) { | 642 | pub fn set_dtimeoutc(&mut self, val: bool) { |
| 535 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 643 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); |
| 536 | } | 644 | } |
| 537 | #[doc = "PB(6) Fm+"] | 645 | #[doc = "TXUNDERR flag clear bit Set by software to clear TXUNDERR flag."] |
| 538 | pub const fn pb6fmp(&self) -> bool { | 646 | pub const fn txunderrc(&self) -> bool { |
| 539 | let val = (self.0 >> 4usize) & 0x01; | 647 | let val = (self.0 >> 4usize) & 0x01; |
| 540 | val != 0 | 648 | val != 0 |
| 541 | } | 649 | } |
| 542 | #[doc = "PB(6) Fm+"] | 650 | #[doc = "TXUNDERR flag clear bit Set by software to clear TXUNDERR flag."] |
| 543 | pub fn set_pb6fmp(&mut self, val: bool) { | 651 | pub fn set_txunderrc(&mut self, val: bool) { |
| 544 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 652 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 545 | } | 653 | } |
| 546 | #[doc = "PB(7) Fast Mode Plus"] | 654 | #[doc = "RXOVERR flag clear bit Set by software to clear the RXOVERR flag."] |
| 547 | pub const fn pb7fmp(&self) -> bool { | 655 | pub const fn rxoverrc(&self) -> bool { |
| 548 | let val = (self.0 >> 5usize) & 0x01; | 656 | let val = (self.0 >> 5usize) & 0x01; |
| 549 | val != 0 | 657 | val != 0 |
| 550 | } | 658 | } |
| 551 | #[doc = "PB(7) Fast Mode Plus"] | 659 | #[doc = "RXOVERR flag clear bit Set by software to clear the RXOVERR flag."] |
| 552 | pub fn set_pb7fmp(&mut self, val: bool) { | 660 | pub fn set_rxoverrc(&mut self, val: bool) { |
| 553 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 661 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 554 | } | 662 | } |
| 555 | #[doc = "PB(8) Fast Mode Plus"] | 663 | #[doc = "CMDREND flag clear bit Set by software to clear the CMDREND flag."] |
| 556 | pub const fn pb8fmp(&self) -> bool { | 664 | pub const fn cmdrendc(&self) -> bool { |
| 557 | let val = (self.0 >> 6usize) & 0x01; | 665 | let val = (self.0 >> 6usize) & 0x01; |
| 558 | val != 0 | 666 | val != 0 |
| 559 | } | 667 | } |
| 560 | #[doc = "PB(8) Fast Mode Plus"] | 668 | #[doc = "CMDREND flag clear bit Set by software to clear the CMDREND flag."] |
| 561 | pub fn set_pb8fmp(&mut self, val: bool) { | 669 | pub fn set_cmdrendc(&mut self, val: bool) { |
| 562 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 670 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 563 | } | 671 | } |
| 564 | #[doc = "PB(9) Fm+"] | 672 | #[doc = "CMDSENT flag clear bit Set by software to clear the CMDSENT flag."] |
| 565 | pub const fn pb9fmp(&self) -> bool { | 673 | pub const fn cmdsentc(&self) -> bool { |
| 566 | let val = (self.0 >> 7usize) & 0x01; | 674 | let val = (self.0 >> 7usize) & 0x01; |
| 567 | val != 0 | 675 | val != 0 |
| 568 | } | 676 | } |
| 569 | #[doc = "PB(9) Fm+"] | 677 | #[doc = "CMDSENT flag clear bit Set by software to clear the CMDSENT flag."] |
| 570 | pub fn set_pb9fmp(&mut self, val: bool) { | 678 | pub fn set_cmdsentc(&mut self, val: bool) { |
| 571 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 679 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 572 | } | 680 | } |
| 573 | #[doc = "Booster Enable"] | 681 | #[doc = "DATAEND flag clear bit Set by software to clear the DATAEND flag."] |
| 574 | pub const fn booste(&self) -> bool { | 682 | pub const fn dataendc(&self) -> bool { |
| 575 | let val = (self.0 >> 8usize) & 0x01; | 683 | let val = (self.0 >> 8usize) & 0x01; |
| 576 | val != 0 | 684 | val != 0 |
| 577 | } | 685 | } |
| 578 | #[doc = "Booster Enable"] | 686 | #[doc = "DATAEND flag clear bit Set by software to clear the DATAEND flag."] |
| 579 | pub fn set_booste(&mut self, val: bool) { | 687 | pub fn set_dataendc(&mut self, val: bool) { |
| 580 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 688 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 581 | } | 689 | } |
| 582 | #[doc = "Analog switch supply voltage selection"] | 690 | #[doc = "DHOLD flag clear bit Set by software to clear the DHOLD flag."] |
| 583 | pub const fn boostvddsel(&self) -> bool { | 691 | pub const fn dholdc(&self) -> bool { |
| 584 | let val = (self.0 >> 9usize) & 0x01; | 692 | let val = (self.0 >> 9usize) & 0x01; |
| 585 | val != 0 | 693 | val != 0 |
| 586 | } | 694 | } |
| 587 | #[doc = "Analog switch supply voltage selection"] | 695 | #[doc = "DHOLD flag clear bit Set by software to clear the DHOLD flag."] |
| 588 | pub fn set_boostvddsel(&mut self, val: bool) { | 696 | pub fn set_dholdc(&mut self, val: bool) { |
| 589 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | 697 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); |
| 590 | } | 698 | } |
| 591 | #[doc = "Ethernet PHY Interface Selection"] | 699 | #[doc = "DBCKEND flag clear bit Set by software to clear the DBCKEND flag."] |
| 592 | pub const fn epis(&self) -> u8 { | 700 | pub const fn dbckendc(&self) -> bool { |
| 593 | let val = (self.0 >> 21usize) & 0x07; | 701 | let val = (self.0 >> 10usize) & 0x01; |
| 594 | val as u8 | 702 | val != 0 |
| 595 | } | 703 | } |
| 596 | #[doc = "Ethernet PHY Interface Selection"] | 704 | #[doc = "DBCKEND flag clear bit Set by software to clear the DBCKEND flag."] |
| 597 | pub fn set_epis(&mut self, val: u8) { | 705 | pub fn set_dbckendc(&mut self, val: bool) { |
| 598 | self.0 = (self.0 & !(0x07 << 21usize)) | (((val as u32) & 0x07) << 21usize); | 706 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); |
| 599 | } | 707 | } |
| 600 | #[doc = "PA0 Switch Open"] | 708 | #[doc = "DABORT flag clear bit Set by software to clear the DABORT flag."] |
| 601 | pub const fn pa0so(&self) -> bool { | 709 | pub const fn dabortc(&self) -> bool { |
| 710 | let val = (self.0 >> 11usize) & 0x01; | ||
| 711 | val != 0 | ||
| 712 | } | ||
| 713 | #[doc = "DABORT flag clear bit Set by software to clear the DABORT flag."] | ||
| 714 | pub fn set_dabortc(&mut self, val: bool) { | ||
| 715 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); | ||
| 716 | } | ||
| 717 | #[doc = "BUSYD0END flag clear bit Set by software to clear the BUSYD0END flag."] | ||
| 718 | pub const fn busyd0endc(&self) -> bool { | ||
| 719 | let val = (self.0 >> 21usize) & 0x01; | ||
| 720 | val != 0 | ||
| 721 | } | ||
| 722 | #[doc = "BUSYD0END flag clear bit Set by software to clear the BUSYD0END flag."] | ||
| 723 | pub fn set_busyd0endc(&mut self, val: bool) { | ||
| 724 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); | ||
| 725 | } | ||
| 726 | #[doc = "SDIOIT flag clear bit Set by software to clear the SDIOIT flag."] | ||
| 727 | pub const fn sdioitc(&self) -> bool { | ||
| 728 | let val = (self.0 >> 22usize) & 0x01; | ||
| 729 | val != 0 | ||
| 730 | } | ||
| 731 | #[doc = "SDIOIT flag clear bit Set by software to clear the SDIOIT flag."] | ||
| 732 | pub fn set_sdioitc(&mut self, val: bool) { | ||
| 733 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); | ||
| 734 | } | ||
| 735 | #[doc = "ACKFAIL flag clear bit Set by software to clear the ACKFAIL flag."] | ||
| 736 | pub const fn ackfailc(&self) -> bool { | ||
| 737 | let val = (self.0 >> 23usize) & 0x01; | ||
| 738 | val != 0 | ||
| 739 | } | ||
| 740 | #[doc = "ACKFAIL flag clear bit Set by software to clear the ACKFAIL flag."] | ||
| 741 | pub fn set_ackfailc(&mut self, val: bool) { | ||
| 742 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); | ||
| 743 | } | ||
| 744 | #[doc = "ACKTIMEOUT flag clear bit Set by software to clear the ACKTIMEOUT flag."] | ||
| 745 | pub const fn acktimeoutc(&self) -> bool { | ||
| 602 | let val = (self.0 >> 24usize) & 0x01; | 746 | let val = (self.0 >> 24usize) & 0x01; |
| 603 | val != 0 | 747 | val != 0 |
| 604 | } | 748 | } |
| 605 | #[doc = "PA0 Switch Open"] | 749 | #[doc = "ACKTIMEOUT flag clear bit Set by software to clear the ACKTIMEOUT flag."] |
| 606 | pub fn set_pa0so(&mut self, val: bool) { | 750 | pub fn set_acktimeoutc(&mut self, val: bool) { |
| 607 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize); | 751 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize); |
| 608 | } | 752 | } |
| 609 | #[doc = "PA1 Switch Open"] | 753 | #[doc = "VSWEND flag clear bit Set by software to clear the VSWEND flag."] |
| 610 | pub const fn pa1so(&self) -> bool { | 754 | pub const fn vswendc(&self) -> bool { |
| 611 | let val = (self.0 >> 25usize) & 0x01; | 755 | let val = (self.0 >> 25usize) & 0x01; |
| 612 | val != 0 | 756 | val != 0 |
| 613 | } | 757 | } |
| 614 | #[doc = "PA1 Switch Open"] | 758 | #[doc = "VSWEND flag clear bit Set by software to clear the VSWEND flag."] |
| 615 | pub fn set_pa1so(&mut self, val: bool) { | 759 | pub fn set_vswendc(&mut self, val: bool) { |
| 616 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize); | 760 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize); |
| 617 | } | 761 | } |
| 618 | #[doc = "PC2 Switch Open"] | 762 | #[doc = "CKSTOP flag clear bit Set by software to clear the CKSTOP flag."] |
| 619 | pub const fn pc2so(&self) -> bool { | 763 | pub const fn ckstopc(&self) -> bool { |
| 620 | let val = (self.0 >> 26usize) & 0x01; | 764 | let val = (self.0 >> 26usize) & 0x01; |
| 621 | val != 0 | 765 | val != 0 |
| 622 | } | 766 | } |
| 623 | #[doc = "PC2 Switch Open"] | 767 | #[doc = "CKSTOP flag clear bit Set by software to clear the CKSTOP flag."] |
| 624 | pub fn set_pc2so(&mut self, val: bool) { | 768 | pub fn set_ckstopc(&mut self, val: bool) { |
| 625 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); | 769 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); |
| 626 | } | 770 | } |
| 627 | #[doc = "PC3 Switch Open"] | 771 | #[doc = "IDMA transfer error clear bit Set by software to clear the IDMATE flag."] |
| 628 | pub const fn pc3so(&self) -> bool { | 772 | pub const fn idmatec(&self) -> bool { |
| 629 | let val = (self.0 >> 27usize) & 0x01; | 773 | let val = (self.0 >> 27usize) & 0x01; |
| 630 | val != 0 | 774 | val != 0 |
| 631 | } | 775 | } |
| 632 | #[doc = "PC3 Switch Open"] | 776 | #[doc = "IDMA transfer error clear bit Set by software to clear the IDMATE flag."] |
| 633 | pub fn set_pc3so(&mut self, val: bool) { | 777 | pub fn set_idmatec(&mut self, val: bool) { |
| 634 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize); | 778 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize); |
| 635 | } | 779 | } |
| 636 | } | 780 | #[doc = "IDMA buffer transfer complete clear bit Set by software to clear the IDMABTC flag."] |
| 637 | impl Default for Pmcr { | 781 | pub const fn idmabtcc(&self) -> bool { |
| 638 | fn default() -> Pmcr { | 782 | let val = (self.0 >> 28usize) & 0x01; |
| 639 | Pmcr(0) | ||
| 640 | } | ||
| 641 | } | ||
| 642 | #[doc = "SYSCFG user register 5"] | ||
| 643 | #[repr(transparent)] | ||
| 644 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 645 | pub struct Ur5(pub u32); | ||
| 646 | impl Ur5 { | ||
| 647 | #[doc = "Mass erase secured area disabled for bank 1"] | ||
| 648 | pub const fn mesad_1(&self) -> bool { | ||
| 649 | let val = (self.0 >> 0usize) & 0x01; | ||
| 650 | val != 0 | 783 | val != 0 |
| 651 | } | 784 | } |
| 652 | #[doc = "Mass erase secured area disabled for bank 1"] | 785 | #[doc = "IDMA buffer transfer complete clear bit Set by software to clear the IDMABTC flag."] |
| 653 | pub fn set_mesad_1(&mut self, val: bool) { | 786 | pub fn set_idmabtcc(&mut self, val: bool) { |
| 654 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 787 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize); |
| 655 | } | ||
| 656 | #[doc = "Write protection for flash bank 1"] | ||
| 657 | pub const fn wrpn_1(&self) -> u8 { | ||
| 658 | let val = (self.0 >> 16usize) & 0xff; | ||
| 659 | val as u8 | ||
| 660 | } | ||
| 661 | #[doc = "Write protection for flash bank 1"] | ||
| 662 | pub fn set_wrpn_1(&mut self, val: u8) { | ||
| 663 | self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize); | ||
| 664 | } | 788 | } |
| 665 | } | 789 | } |
| 666 | impl Default for Ur5 { | 790 | impl Default for Icr { |
| 667 | fn default() -> Ur5 { | 791 | fn default() -> Icr { |
| 668 | Ur5(0) | 792 | Icr(0) |
| 669 | } | 793 | } |
| 670 | } | 794 | } |
| 671 | #[doc = "SYSCFG user register 7"] | 795 | #[doc = "The SDMMC_CLKCR register controls the SDMMC_CK output clock, the SDMMC_RX_CLK receive clock, and the bus width."] |
| 672 | #[repr(transparent)] | 796 | #[repr(transparent)] |
| 673 | #[derive(Copy, Clone, Eq, PartialEq)] | 797 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 674 | pub struct Ur7(pub u32); | 798 | pub struct Clkcr(pub u32); |
| 675 | impl Ur7 { | 799 | impl Clkcr { |
| 676 | #[doc = "Secured area start address for bank 1"] | 800 | #[doc = "Clock divide factor This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0). This field defines the divide factor between the input clock (SDMMCCLK) and the output clock (SDMMC_CK): SDMMC_CK frequency = SDMMCCLK / [2 * CLKDIV]. 0xx: etc.. xxx: etc.."] |
| 677 | pub const fn sa_beg_1(&self) -> u16 { | 801 | pub const fn clkdiv(&self) -> u16 { |
| 678 | let val = (self.0 >> 0usize) & 0x0fff; | 802 | let val = (self.0 >> 0usize) & 0x03ff; |
| 679 | val as u16 | 803 | val as u16 |
| 680 | } | 804 | } |
| 681 | #[doc = "Secured area start address for bank 1"] | 805 | #[doc = "Clock divide factor This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0). This field defines the divide factor between the input clock (SDMMCCLK) and the output clock (SDMMC_CK): SDMMC_CK frequency = SDMMCCLK / [2 * CLKDIV]. 0xx: etc.. xxx: etc.."] |
| 682 | pub fn set_sa_beg_1(&mut self, val: u16) { | 806 | pub fn set_clkdiv(&mut self, val: u16) { |
| 683 | self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); | 807 | self.0 = (self.0 & !(0x03ff << 0usize)) | (((val as u32) & 0x03ff) << 0usize); |
| 684 | } | ||
| 685 | #[doc = "Secured area end address for bank 1"] | ||
| 686 | pub const fn sa_end_1(&self) -> u16 { | ||
| 687 | let val = (self.0 >> 16usize) & 0x0fff; | ||
| 688 | val as u16 | ||
| 689 | } | 808 | } |
| 690 | #[doc = "Secured area end address for bank 1"] | 809 | #[doc = "Power saving configuration bit This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0) For power saving, the SDMMC_CK clock output can be disabled when the bus is idle by setting PWRSAV:"] |
| 691 | pub fn set_sa_end_1(&mut self, val: u16) { | 810 | pub const fn pwrsav(&self) -> bool { |
| 692 | self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); | 811 | let val = (self.0 >> 12usize) & 0x01; |
| 812 | val != 0 | ||
| 693 | } | 813 | } |
| 694 | } | 814 | #[doc = "Power saving configuration bit This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0) For power saving, the SDMMC_CK clock output can be disabled when the bus is idle by setting PWRSAV:"] |
| 695 | impl Default for Ur7 { | 815 | pub fn set_pwrsav(&mut self, val: bool) { |
| 696 | fn default() -> Ur7 { | 816 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); |
| 697 | Ur7(0) | ||
| 698 | } | 817 | } |
| 699 | } | 818 | #[doc = "Wide bus mode enable bit This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"] |
| 700 | #[doc = "SYSCFG user register 13"] | 819 | pub const fn widbus(&self) -> u8 { |
| 701 | #[repr(transparent)] | 820 | let val = (self.0 >> 14usize) & 0x03; |
| 702 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 703 | pub struct Ur13(pub u32); | ||
| 704 | impl Ur13 { | ||
| 705 | #[doc = "Secured DTCM RAM Size"] | ||
| 706 | pub const fn sdrs(&self) -> u8 { | ||
| 707 | let val = (self.0 >> 0usize) & 0x03; | ||
| 708 | val as u8 | 821 | val as u8 |
| 709 | } | 822 | } |
| 710 | #[doc = "Secured DTCM RAM Size"] | 823 | #[doc = "Wide bus mode enable bit This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"] |
| 711 | pub fn set_sdrs(&mut self, val: u8) { | 824 | pub fn set_widbus(&mut self, val: u8) { |
| 712 | self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize); | 825 | self.0 = (self.0 & !(0x03 << 14usize)) | (((val as u32) & 0x03) << 14usize); |
| 713 | } | 826 | } |
| 714 | #[doc = "D1 Standby reset"] | 827 | #[doc = "SDMMC_CK dephasing selection bit for data and Command. This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0). When clock division = 1 (CLKDIV = 0), this bit has no effect. Data and Command change on SDMMC_CK falling edge. When clock division >1 (CLKDIV > 0) & DDR = 0: - SDMMC_CK edge occurs on SDMMCCLK rising edge. When clock division >1 (CLKDIV > 0) & DDR = 1: - Data changed on the SDMMCCLK falling edge succeeding a SDMMC_CK edge. - SDMMC_CK edge occurs on SDMMCCLK rising edge. - Data changed on the SDMMC_CK falling edge succeeding a SDMMC_CK edge. - SDMMC_CK edge occurs on SDMMCCLK rising edge."] |
| 715 | pub const fn d1sbrst(&self) -> bool { | 828 | pub const fn negedge(&self) -> bool { |
| 716 | let val = (self.0 >> 16usize) & 0x01; | 829 | let val = (self.0 >> 16usize) & 0x01; |
| 717 | val != 0 | 830 | val != 0 |
| 718 | } | 831 | } |
| 719 | #[doc = "D1 Standby reset"] | 832 | #[doc = "SDMMC_CK dephasing selection bit for data and Command. This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0). When clock division = 1 (CLKDIV = 0), this bit has no effect. Data and Command change on SDMMC_CK falling edge. When clock division >1 (CLKDIV > 0) & DDR = 0: - SDMMC_CK edge occurs on SDMMCCLK rising edge. When clock division >1 (CLKDIV > 0) & DDR = 1: - Data changed on the SDMMCCLK falling edge succeeding a SDMMC_CK edge. - SDMMC_CK edge occurs on SDMMCCLK rising edge. - Data changed on the SDMMC_CK falling edge succeeding a SDMMC_CK edge. - SDMMC_CK edge occurs on SDMMCCLK rising edge."] |
| 720 | pub fn set_d1sbrst(&mut self, val: bool) { | 833 | pub fn set_negedge(&mut self, val: bool) { |
| 721 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | 834 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); |
| 722 | } | 835 | } |
| 723 | } | 836 | #[doc = "Hardware flow control enable This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0) When Hardware flow control is enabled, the meaning of the TXFIFOE and RXFIFOF flags change, please see SDMMC status register definition in Section56.8.11."] |
| 724 | impl Default for Ur13 { | 837 | pub const fn hwfc_en(&self) -> bool { |
| 725 | fn default() -> Ur13 { | 838 | let val = (self.0 >> 17usize) & 0x01; |
| 726 | Ur13(0) | 839 | val != 0 |
| 727 | } | 840 | } |
| 728 | } | 841 | #[doc = "Hardware flow control enable This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0) When Hardware flow control is enabled, the meaning of the TXFIFOE and RXFIFOF flags change, please see SDMMC status register definition in Section56.8.11."] |
| 729 | #[doc = "SYSCFG user register 4"] | 842 | pub fn set_hwfc_en(&mut self, val: bool) { |
| 730 | #[repr(transparent)] | 843 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); |
| 731 | #[derive(Copy, Clone, Eq, PartialEq)] | 844 | } |
| 732 | pub struct Ur4(pub u32); | 845 | #[doc = "Data rate signaling selection This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0) DDR rate shall only be selected with 4-bit or 8-bit wide bus mode. (WIDBUS > 00). DDR = 1 has no effect when WIDBUS = 00 (1-bit wide bus). DDR rate shall only be selected with clock division >1. (CLKDIV > 0)"] |
| 733 | impl Ur4 { | 846 | pub const fn ddr(&self) -> bool { |
| 734 | #[doc = "Mass Erase Protected Area Disabled for bank 1"] | 847 | let val = (self.0 >> 18usize) & 0x01; |
| 735 | pub const fn mepad_1(&self) -> bool { | ||
| 736 | let val = (self.0 >> 16usize) & 0x01; | ||
| 737 | val != 0 | 848 | val != 0 |
| 738 | } | 849 | } |
| 739 | #[doc = "Mass Erase Protected Area Disabled for bank 1"] | 850 | #[doc = "Data rate signaling selection This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0) DDR rate shall only be selected with 4-bit or 8-bit wide bus mode. (WIDBUS > 00). DDR = 1 has no effect when WIDBUS = 00 (1-bit wide bus). DDR rate shall only be selected with clock division >1. (CLKDIV > 0)"] |
| 740 | pub fn set_mepad_1(&mut self, val: bool) { | 851 | pub fn set_ddr(&mut self, val: bool) { |
| 741 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | 852 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); |
| 853 | } | ||
| 854 | #[doc = "Bus speed mode selection between DS, HS, SDR12, SDR25 and SDR50, DDR50, SDR104. This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"] | ||
| 855 | pub const fn busspeed(&self) -> bool { | ||
| 856 | let val = (self.0 >> 19usize) & 0x01; | ||
| 857 | val != 0 | ||
| 858 | } | ||
| 859 | #[doc = "Bus speed mode selection between DS, HS, SDR12, SDR25 and SDR50, DDR50, SDR104. This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"] | ||
| 860 | pub fn set_busspeed(&mut self, val: bool) { | ||
| 861 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); | ||
| 862 | } | ||
| 863 | #[doc = "Receive clock selection. These bits can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"] | ||
| 864 | pub const fn selclkrx(&self) -> u8 { | ||
| 865 | let val = (self.0 >> 20usize) & 0x03; | ||
| 866 | val as u8 | ||
| 867 | } | ||
| 868 | #[doc = "Receive clock selection. These bits can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"] | ||
| 869 | pub fn set_selclkrx(&mut self, val: u8) { | ||
| 870 | self.0 = (self.0 & !(0x03 << 20usize)) | (((val as u32) & 0x03) << 20usize); | ||
| 742 | } | 871 | } |
| 743 | } | 872 | } |
| 744 | impl Default for Ur4 { | 873 | impl Default for Clkcr { |
| 745 | fn default() -> Ur4 { | 874 | fn default() -> Clkcr { |
| 746 | Ur4(0) | 875 | Clkcr(0) |
| 747 | } | 876 | } |
| 748 | } | 877 | } |
| 749 | #[doc = "SYSCFG user register 10"] | 878 | #[doc = "The receive and transmit FIFOs can be read or written as 32-bit wide registers. The FIFOs contain 32 entries on 32 sequential addresses. This allows the CPU to use its load and store multiple operands to read from/write to the FIFO."] |
| 750 | #[repr(transparent)] | 879 | #[repr(transparent)] |
| 751 | #[derive(Copy, Clone, Eq, PartialEq)] | 880 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 752 | pub struct Ur10(pub u32); | 881 | pub struct Idmactrlr(pub u32); |
| 753 | impl Ur10 { | 882 | impl Idmactrlr { |
| 754 | #[doc = "Protected area end address for bank 2"] | 883 | #[doc = "IDMA enable This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] |
| 755 | pub const fn pa_end_2(&self) -> u16 { | 884 | pub const fn idmaen(&self) -> bool { |
| 756 | let val = (self.0 >> 0usize) & 0x0fff; | 885 | let val = (self.0 >> 0usize) & 0x01; |
| 757 | val as u16 | 886 | val != 0 |
| 758 | } | 887 | } |
| 759 | #[doc = "Protected area end address for bank 2"] | 888 | #[doc = "IDMA enable This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] |
| 760 | pub fn set_pa_end_2(&mut self, val: u16) { | 889 | pub fn set_idmaen(&mut self, val: bool) { |
| 761 | self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); | 890 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 762 | } | 891 | } |
| 763 | #[doc = "Secured area start address for bank 2"] | 892 | #[doc = "Buffer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] |
| 764 | pub const fn sa_beg_2(&self) -> u16 { | 893 | pub const fn idmabmode(&self) -> bool { |
| 765 | let val = (self.0 >> 16usize) & 0x0fff; | 894 | let val = (self.0 >> 1usize) & 0x01; |
| 766 | val as u16 | 895 | val != 0 |
| 767 | } | 896 | } |
| 768 | #[doc = "Secured area start address for bank 2"] | 897 | #[doc = "Buffer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] |
| 769 | pub fn set_sa_beg_2(&mut self, val: u16) { | 898 | pub fn set_idmabmode(&mut self, val: bool) { |
| 770 | self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); | 899 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 900 | } | ||
| 901 | #[doc = "Double buffer mode active buffer indication This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). When IDMA is enabled this bit is toggled by hardware."] | ||
| 902 | pub const fn idmabact(&self) -> bool { | ||
| 903 | let val = (self.0 >> 2usize) & 0x01; | ||
| 904 | val != 0 | ||
| 905 | } | ||
| 906 | #[doc = "Double buffer mode active buffer indication This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). When IDMA is enabled this bit is toggled by hardware."] | ||
| 907 | pub fn set_idmabact(&mut self, val: bool) { | ||
| 908 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 771 | } | 909 | } |
| 772 | } | 910 | } |
| 773 | impl Default for Ur10 { | 911 | impl Default for Idmactrlr { |
| 774 | fn default() -> Ur10 { | 912 | fn default() -> Idmactrlr { |
| 775 | Ur10(0) | 913 | Idmactrlr(0) |
| 776 | } | 914 | } |
| 777 | } | 915 | } |
| 778 | #[doc = "SYSCFG user register 17"] | 916 | #[doc = "The SDMMC_DLENR register contains the number of data bytes to be transferred. The value is loaded into the data counter when data transfer starts."] |
| 779 | #[repr(transparent)] | 917 | #[repr(transparent)] |
| 780 | #[derive(Copy, Clone, Eq, PartialEq)] | 918 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 781 | pub struct Ur17(pub u32); | 919 | pub struct Dlenr(pub u32); |
| 782 | impl Ur17 { | 920 | impl Dlenr { |
| 783 | #[doc = "I/O high speed / low voltage"] | 921 | #[doc = "Data length value This register can only be written by firmware when DPSM is inactive (DPSMACT = 0). Number of data bytes to be transferred. When DDR = 1 DATALENGTH is truncated to a multiple of 2. (The last odd byte is not transfered) When DATALENGTH = 0 no data will be transfered, when requested by a CPSMEN and CMDTRANS = 1 also no command will be transfered. DTEN and CPSMEN are cleared to 0."] |
| 784 | pub const fn io_hslv(&self) -> bool { | 922 | pub const fn datalength(&self) -> u32 { |
| 785 | let val = (self.0 >> 0usize) & 0x01; | 923 | let val = (self.0 >> 0usize) & 0x01ff_ffff; |
| 786 | val != 0 | 924 | val as u32 |
| 787 | } | 925 | } |
| 788 | #[doc = "I/O high speed / low voltage"] | 926 | #[doc = "Data length value This register can only be written by firmware when DPSM is inactive (DPSMACT = 0). Number of data bytes to be transferred. When DDR = 1 DATALENGTH is truncated to a multiple of 2. (The last odd byte is not transfered) When DATALENGTH = 0 no data will be transfered, when requested by a CPSMEN and CMDTRANS = 1 also no command will be transfered. DTEN and CPSMEN are cleared to 0."] |
| 789 | pub fn set_io_hslv(&mut self, val: bool) { | 927 | pub fn set_datalength(&mut self, val: u32) { |
| 790 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 928 | self.0 = |
| 929 | (self.0 & !(0x01ff_ffff << 0usize)) | (((val as u32) & 0x01ff_ffff) << 0usize); | ||
| 791 | } | 930 | } |
| 792 | } | 931 | } |
| 793 | impl Default for Ur17 { | 932 | impl Default for Dlenr { |
| 794 | fn default() -> Ur17 { | 933 | fn default() -> Dlenr { |
| 795 | Ur17(0) | 934 | Dlenr(0) |
| 796 | } | 935 | } |
| 797 | } | 936 | } |
| 798 | #[doc = "SYSCFG package register"] | 937 | #[doc = "SDMMC IP version register"] |
| 799 | #[repr(transparent)] | 938 | #[repr(transparent)] |
| 800 | #[derive(Copy, Clone, Eq, PartialEq)] | 939 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 801 | pub struct Pkgr(pub u32); | 940 | pub struct Ver(pub u32); |
| 802 | impl Pkgr { | 941 | impl Ver { |
| 803 | #[doc = "Package"] | 942 | #[doc = "IP minor revision number."] |
| 804 | pub const fn pkg(&self) -> u8 { | 943 | pub const fn minrev(&self) -> u8 { |
| 805 | let val = (self.0 >> 0usize) & 0x0f; | 944 | let val = (self.0 >> 0usize) & 0x0f; |
| 806 | val as u8 | 945 | val as u8 |
| 807 | } | 946 | } |
| 808 | #[doc = "Package"] | 947 | #[doc = "IP minor revision number."] |
| 809 | pub fn set_pkg(&mut self, val: u8) { | 948 | pub fn set_minrev(&mut self, val: u8) { |
| 810 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); | 949 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); |
| 811 | } | 950 | } |
| 951 | #[doc = "IP major revision number."] | ||
| 952 | pub const fn majrev(&self) -> u8 { | ||
| 953 | let val = (self.0 >> 4usize) & 0x0f; | ||
| 954 | val as u8 | ||
| 955 | } | ||
| 956 | #[doc = "IP major revision number."] | ||
| 957 | pub fn set_majrev(&mut self, val: u8) { | ||
| 958 | self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize); | ||
| 959 | } | ||
| 812 | } | 960 | } |
| 813 | impl Default for Pkgr { | 961 | impl Default for Ver { |
| 814 | fn default() -> Pkgr { | 962 | fn default() -> Ver { |
| 815 | Pkgr(0) | 963 | Ver(0) |
| 816 | } | 964 | } |
| 817 | } | 965 | } |
| 818 | #[doc = "compensation cell control/status register"] | 966 | #[doc = "The SDMMC_ARGR register contains a 32-bit command argument, which is sent to a card as part of a command message."] |
| 819 | #[repr(transparent)] | 967 | #[repr(transparent)] |
| 820 | #[derive(Copy, Clone, Eq, PartialEq)] | 968 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 821 | pub struct Cccsr(pub u32); | 969 | pub struct Argr(pub u32); |
| 822 | impl Cccsr { | 970 | impl Argr { |
| 823 | #[doc = "enable"] | 971 | #[doc = "Command argument. These bits can only be written by firmware when CPSM is disabled (CPSMEN = 0). Command argument sent to a card as part of a command message. If a command contains an argument, it must be loaded into this register before writing a command to the command register."] |
| 824 | pub const fn en(&self) -> bool { | 972 | pub const fn cmdarg(&self) -> u32 { |
| 825 | let val = (self.0 >> 0usize) & 0x01; | 973 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 826 | val != 0 | 974 | val as u32 |
| 827 | } | 975 | } |
| 828 | #[doc = "enable"] | 976 | #[doc = "Command argument. These bits can only be written by firmware when CPSM is disabled (CPSMEN = 0). Command argument sent to a card as part of a command message. If a command contains an argument, it must be loaded into this register before writing a command to the command register."] |
| 829 | pub fn set_en(&mut self, val: bool) { | 977 | pub fn set_cmdarg(&mut self, val: u32) { |
| 830 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 978 | self.0 = |
| 979 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 831 | } | 980 | } |
| 832 | #[doc = "Code selection"] | 981 | } |
| 833 | pub const fn cs(&self) -> bool { | 982 | impl Default for Argr { |
| 834 | let val = (self.0 >> 1usize) & 0x01; | 983 | fn default() -> Argr { |
| 835 | val != 0 | 984 | Argr(0) |
| 836 | } | 985 | } |
| 837 | #[doc = "Code selection"] | 986 | } |
| 838 | pub fn set_cs(&mut self, val: bool) { | 987 | #[doc = "SDMMC IP identification register"] |
| 839 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 988 | #[repr(transparent)] |
| 989 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 990 | pub struct Id(pub u32); | ||
| 991 | impl Id { | ||
| 992 | #[doc = "SDMMC IP identification."] | ||
| 993 | pub const fn ip_id(&self) -> u32 { | ||
| 994 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 995 | val as u32 | ||
| 840 | } | 996 | } |
| 841 | #[doc = "Compensation cell ready flag"] | 997 | #[doc = "SDMMC IP identification."] |
| 842 | pub const fn ready(&self) -> bool { | 998 | pub fn set_ip_id(&mut self, val: u32) { |
| 843 | let val = (self.0 >> 8usize) & 0x01; | 999 | self.0 = |
| 844 | val != 0 | 1000 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); |
| 845 | } | 1001 | } |
| 846 | #[doc = "Compensation cell ready flag"] | 1002 | } |
| 847 | pub fn set_ready(&mut self, val: bool) { | 1003 | impl Default for Id { |
| 848 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 1004 | fn default() -> Id { |
| 1005 | Id(0) | ||
| 849 | } | 1006 | } |
| 850 | #[doc = "High-speed at low-voltage"] | 1007 | } |
| 851 | pub const fn hslv(&self) -> bool { | 1008 | #[doc = "The receive and transmit FIFOs can be only read or written as word (32-bit) wide registers. The FIFOs contain 16 entries on sequential addresses. This allows the CPU to use its load and store multiple operands to read from/write to the FIFO.When accessing SDMMC_FIFOR with half word or byte access an AHB bus fault is generated."] |
| 852 | let val = (self.0 >> 16usize) & 0x01; | 1009 | #[repr(transparent)] |
| 853 | val != 0 | 1010 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 1011 | pub struct Fifor(pub u32); | ||
| 1012 | impl Fifor { | ||
| 1013 | #[doc = "Receive and transmit FIFO data This register can only be read or written by firmware when the DPSM is active (DPSMACT=1). The FIFO data occupies 16 entries of 32-bit words."] | ||
| 1014 | pub const fn fifodata(&self) -> u32 { | ||
| 1015 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 1016 | val as u32 | ||
| 854 | } | 1017 | } |
| 855 | #[doc = "High-speed at low-voltage"] | 1018 | #[doc = "Receive and transmit FIFO data This register can only be read or written by firmware when the DPSM is active (DPSMACT=1). The FIFO data occupies 16 entries of 32-bit words."] |
| 856 | pub fn set_hslv(&mut self, val: bool) { | 1019 | pub fn set_fifodata(&mut self, val: u32) { |
| 857 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | 1020 | self.0 = |
| 1021 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 858 | } | 1022 | } |
| 859 | } | 1023 | } |
| 860 | impl Default for Cccsr { | 1024 | impl Default for Fifor { |
| 861 | fn default() -> Cccsr { | 1025 | fn default() -> Fifor { |
| 862 | Cccsr(0) | 1026 | Fifor(0) |
| 863 | } | 1027 | } |
| 864 | } | 1028 | } |
| 865 | } | ||
| 866 | } | ||
| 867 | pub mod sdmmc_v2 { | ||
| 868 | use crate::generic::*; | ||
| 869 | #[doc = "SDMMC"] | ||
| 870 | #[derive(Copy, Clone)] | ||
| 871 | pub struct Sdmmc(pub *mut u8); | ||
| 872 | unsafe impl Send for Sdmmc {} | ||
| 873 | unsafe impl Sync for Sdmmc {} | ||
| 874 | impl Sdmmc { | ||
| 875 | #[doc = "SDMMC power control register"] | ||
| 876 | pub fn power(self) -> Reg<regs::Power, RW> { | ||
| 877 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 878 | } | ||
| 879 | #[doc = "The SDMMC_CLKCR register controls the SDMMC_CK output clock, the SDMMC_RX_CLK receive clock, and the bus width."] | ||
| 880 | pub fn clkcr(self) -> Reg<regs::Clkcr, RW> { | ||
| 881 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 882 | } | ||
| 883 | #[doc = "The SDMMC_ARGR register contains a 32-bit command argument, which is sent to a card as part of a command message."] | ||
| 884 | pub fn argr(self) -> Reg<regs::Argr, RW> { | ||
| 885 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 886 | } | ||
| 887 | #[doc = "The SDMMC_CMDR register contains the command index and command type bits. The command index is sent to a card as part of a command message. The command type bits control the command path state machine (CPSM)."] | ||
| 888 | pub fn cmdr(self) -> Reg<regs::Cmdr, RW> { | ||
| 889 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 890 | } | ||
| 891 | #[doc = "SDMMC command response register"] | ||
| 892 | pub fn respcmdr(self) -> Reg<regs::Respcmdr, R> { | ||
| 893 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 894 | } | ||
| 895 | #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] | ||
| 896 | pub fn respr(self, n: usize) -> Reg<regs::Resp1r, R> { | ||
| 897 | assert!(n < 4usize); | ||
| 898 | unsafe { Reg::from_ptr(self.0.add(20usize + n * 4usize)) } | ||
| 899 | } | ||
| 900 | #[doc = "The SDMMC_DTIMER register contains the data timeout period, in card bus clock periods. A counter loads the value from the SDMMC_DTIMER register, and starts decrementing when the data path state machine (DPSM) enters the Wait_R or Busy state. If the timer reaches 0 while the DPSM is in either of these states, the timeout status flag is set."] | 1029 | #[doc = "The SDMMC_DTIMER register contains the data timeout period, in card bus clock periods. A counter loads the value from the SDMMC_DTIMER register, and starts decrementing when the data path state machine (DPSM) enters the Wait_R or Busy state. If the timer reaches 0 while the DPSM is in either of these states, the timeout status flag is set."] |
| 901 | pub fn dtimer(self) -> Reg<regs::Dtimer, RW> { | ||
| 902 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | ||
| 903 | } | ||
| 904 | #[doc = "The SDMMC_DLENR register contains the number of data bytes to be transferred. The value is loaded into the data counter when data transfer starts."] | ||
| 905 | pub fn dlenr(self) -> Reg<regs::Dlenr, RW> { | ||
| 906 | unsafe { Reg::from_ptr(self.0.add(40usize)) } | ||
| 907 | } | ||
| 908 | #[doc = "The SDMMC_DCTRL register control the data path state machine (DPSM)."] | ||
| 909 | pub fn dctrl(self) -> Reg<regs::Dctrl, RW> { | ||
| 910 | unsafe { Reg::from_ptr(self.0.add(44usize)) } | ||
| 911 | } | ||
| 912 | #[doc = "The SDMMC_DCNTR register loads the value from the data length register (see SDMMC_DLENR) when the DPSM moves from the Idle state to the Wait_R or Wait_S state. As data is transferred, the counter decrements the value until it reaches 0. The DPSM then moves to the Idle state and when there has been no error, the data status end flag (DATAEND) is set."] | ||
| 913 | pub fn dcntr(self) -> Reg<regs::Dcntr, R> { | ||
| 914 | unsafe { Reg::from_ptr(self.0.add(48usize)) } | ||
| 915 | } | ||
| 916 | #[doc = "The SDMMC_STAR register is a read-only register. It contains two types of flag:Static flags (bits [29,21,11:0]): these bits remain asserted until they are cleared by writing to the SDMMC interrupt Clear register (see SDMMC_ICR)Dynamic flags (bits [20:12]): these bits change state depending on the state of the underlying logic (for example, FIFO full and empty flags are asserted and de-asserted as data while written to the FIFO)"] | ||
| 917 | pub fn star(self) -> Reg<regs::Star, R> { | ||
| 918 | unsafe { Reg::from_ptr(self.0.add(52usize)) } | ||
| 919 | } | ||
| 920 | #[doc = "The SDMMC_ICR register is a write-only register. Writing a bit with 1 clears the corresponding bit in the SDMMC_STAR status register."] | ||
| 921 | pub fn icr(self) -> Reg<regs::Icr, RW> { | ||
| 922 | unsafe { Reg::from_ptr(self.0.add(56usize)) } | ||
| 923 | } | ||
| 924 | #[doc = "The interrupt mask register determines which status flags generate an interrupt request by setting the corresponding bit to 1."] | ||
| 925 | pub fn maskr(self) -> Reg<regs::Maskr, RW> { | ||
| 926 | unsafe { Reg::from_ptr(self.0.add(60usize)) } | ||
| 927 | } | ||
| 928 | #[doc = "The SDMMC_ACKTIMER register contains the acknowledgment timeout period, in SDMMC_CK bus clock periods. A counter loads the value from the SDMMC_ACKTIMER register, and starts decrementing when the data path state machine (DPSM) enters the Wait_Ack state. If the timer reaches 0 while the DPSM is in this states, the acknowledgment timeout status flag is set."] | ||
| 929 | pub fn acktimer(self) -> Reg<regs::Acktimer, RW> { | ||
| 930 | unsafe { Reg::from_ptr(self.0.add(64usize)) } | ||
| 931 | } | ||
| 932 | #[doc = "The receive and transmit FIFOs can be read or written as 32-bit wide registers. The FIFOs contain 32 entries on 32 sequential addresses. This allows the CPU to use its load and store multiple operands to read from/write to the FIFO."] | ||
| 933 | pub fn idmactrlr(self) -> Reg<regs::Idmactrlr, RW> { | ||
| 934 | unsafe { Reg::from_ptr(self.0.add(80usize)) } | ||
| 935 | } | ||
| 936 | #[doc = "The SDMMC_IDMABSIZER register contains the buffers size when in double buffer configuration."] | ||
| 937 | pub fn idmabsizer(self) -> Reg<regs::Idmabsizer, RW> { | ||
| 938 | unsafe { Reg::from_ptr(self.0.add(84usize)) } | ||
| 939 | } | ||
| 940 | #[doc = "The SDMMC_IDMABASE0R register contains the memory buffer base address in single buffer configuration and the buffer 0 base address in double buffer configuration."] | ||
| 941 | pub fn idmabase0r(self) -> Reg<regs::Idmabase0r, RW> { | ||
| 942 | unsafe { Reg::from_ptr(self.0.add(88usize)) } | ||
| 943 | } | ||
| 944 | #[doc = "The SDMMC_IDMABASE1R register contains the double buffer configuration second buffer memory base address."] | ||
| 945 | pub fn idmabase1r(self) -> Reg<regs::Idmabase1r, RW> { | ||
| 946 | unsafe { Reg::from_ptr(self.0.add(92usize)) } | ||
| 947 | } | ||
| 948 | #[doc = "The receive and transmit FIFOs can be only read or written as word (32-bit) wide registers. The FIFOs contain 16 entries on sequential addresses. This allows the CPU to use its load and store multiple operands to read from/write to the FIFO.When accessing SDMMC_FIFOR with half word or byte access an AHB bus fault is generated."] | ||
| 949 | pub fn fifor(self) -> Reg<regs::Fifor, RW> { | ||
| 950 | unsafe { Reg::from_ptr(self.0.add(128usize)) } | ||
| 951 | } | ||
| 952 | #[doc = "SDMMC IP version register"] | ||
| 953 | pub fn ver(self) -> Reg<regs::Ver, R> { | ||
| 954 | unsafe { Reg::from_ptr(self.0.add(1012usize)) } | ||
| 955 | } | ||
| 956 | #[doc = "SDMMC IP identification register"] | ||
| 957 | pub fn id(self) -> Reg<regs::Id, R> { | ||
| 958 | unsafe { Reg::from_ptr(self.0.add(1016usize)) } | ||
| 959 | } | ||
| 960 | } | ||
| 961 | pub mod regs { | ||
| 962 | use crate::generic::*; | ||
| 963 | #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] | ||
| 964 | #[repr(transparent)] | 1030 | #[repr(transparent)] |
| 965 | #[derive(Copy, Clone, Eq, PartialEq)] | 1031 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 966 | pub struct Resp4r(pub u32); | 1032 | pub struct Dtimer(pub u32); |
| 967 | impl Resp4r { | 1033 | impl Dtimer { |
| 968 | #[doc = "see Table404."] | 1034 | #[doc = "Data and R1b busy timeout period This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0). Data and R1b busy timeout period expressed in card bus clock periods."] |
| 969 | pub const fn cardstatus4(&self) -> u32 { | 1035 | pub const fn datatime(&self) -> u32 { |
| 970 | let val = (self.0 >> 0usize) & 0xffff_ffff; | 1036 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 971 | val as u32 | 1037 | val as u32 |
| 972 | } | 1038 | } |
| 973 | #[doc = "see Table404."] | 1039 | #[doc = "Data and R1b busy timeout period This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0). Data and R1b busy timeout period expressed in card bus clock periods."] |
| 974 | pub fn set_cardstatus4(&mut self, val: u32) { | 1040 | pub fn set_datatime(&mut self, val: u32) { |
| 975 | self.0 = | 1041 | self.0 = |
| 976 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | 1042 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); |
| 977 | } | 1043 | } |
| 978 | } | 1044 | } |
| 979 | impl Default for Resp4r { | 1045 | impl Default for Dtimer { |
| 980 | fn default() -> Resp4r { | 1046 | fn default() -> Dtimer { |
| 981 | Resp4r(0) | 1047 | Dtimer(0) |
| 982 | } | 1048 | } |
| 983 | } | 1049 | } |
| 984 | #[doc = "The SDMMC_STAR register is a read-only register. It contains two types of flag:Static flags (bits [29,21,11:0]): these bits remain asserted until they are cleared by writing to the SDMMC interrupt Clear register (see SDMMC_ICR)Dynamic flags (bits [20:12]): these bits change state depending on the state of the underlying logic (for example, FIFO full and empty flags are asserted and de-asserted as data while written to the FIFO)"] | 1050 | #[doc = "The SDMMC_STAR register is a read-only register. It contains two types of flag:Static flags (bits [29,21,11:0]): these bits remain asserted until they are cleared by writing to the SDMMC interrupt Clear register (see SDMMC_ICR)Dynamic flags (bits [20:12]): these bits change state depending on the state of the underlying logic (for example, FIFO full and empty flags are asserted and de-asserted as data while written to the FIFO)"] |
| @@ -1300,132 +1366,6 @@ pub mod sdmmc_v2 { | |||
| 1300 | Power(0) | 1366 | Power(0) |
| 1301 | } | 1367 | } |
| 1302 | } | 1368 | } |
| 1303 | #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] | ||
| 1304 | #[repr(transparent)] | ||
| 1305 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1306 | pub struct Resp1r(pub u32); | ||
| 1307 | impl Resp1r { | ||
| 1308 | #[doc = "see Table 432"] | ||
| 1309 | pub const fn cardstatus1(&self) -> u32 { | ||
| 1310 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 1311 | val as u32 | ||
| 1312 | } | ||
| 1313 | #[doc = "see Table 432"] | ||
| 1314 | pub fn set_cardstatus1(&mut self, val: u32) { | ||
| 1315 | self.0 = | ||
| 1316 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 1317 | } | ||
| 1318 | } | ||
| 1319 | impl Default for Resp1r { | ||
| 1320 | fn default() -> Resp1r { | ||
| 1321 | Resp1r(0) | ||
| 1322 | } | ||
| 1323 | } | ||
| 1324 | #[doc = "The SDMMC_IDMABASE0R register contains the memory buffer base address in single buffer configuration and the buffer 0 base address in double buffer configuration."] | ||
| 1325 | #[repr(transparent)] | ||
| 1326 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1327 | pub struct Idmabase0r(pub u32); | ||
| 1328 | impl Idmabase0r { | ||
| 1329 | #[doc = "Buffer 0 memory base address bits [31:2], shall be word aligned (bit [1:0] | ||
| 1330 | are always 0 and read only). This register can be written by firmware when DPSM is inactive (DPSMACT = 0), and can dynamically be written by firmware when DPSM active (DPSMACT = 1) and memory buffer 0 is inactive (IDMABACT = 1)."] | ||
| 1331 | pub const fn idmabase0(&self) -> u32 { | ||
| 1332 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 1333 | val as u32 | ||
| 1334 | } | ||
| 1335 | #[doc = "Buffer 0 memory base address bits [31:2], shall be word aligned (bit [1:0] | ||
| 1336 | are always 0 and read only). This register can be written by firmware when DPSM is inactive (DPSMACT = 0), and can dynamically be written by firmware when DPSM active (DPSMACT = 1) and memory buffer 0 is inactive (IDMABACT = 1)."] | ||
| 1337 | pub fn set_idmabase0(&mut self, val: u32) { | ||
| 1338 | self.0 = | ||
| 1339 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 1340 | } | ||
| 1341 | } | ||
| 1342 | impl Default for Idmabase0r { | ||
| 1343 | fn default() -> Idmabase0r { | ||
| 1344 | Idmabase0r(0) | ||
| 1345 | } | ||
| 1346 | } | ||
| 1347 | #[doc = "The SDMMC_DCNTR register loads the value from the data length register (see SDMMC_DLENR) when the DPSM moves from the Idle state to the Wait_R or Wait_S state. As data is transferred, the counter decrements the value until it reaches 0. The DPSM then moves to the Idle state and when there has been no error, the data status end flag (DATAEND) is set."] | ||
| 1348 | #[repr(transparent)] | ||
| 1349 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1350 | pub struct Dcntr(pub u32); | ||
| 1351 | impl Dcntr { | ||
| 1352 | #[doc = "Data count value When read, the number of remaining data bytes to be transferred is returned. Write has no effect."] | ||
| 1353 | pub const fn datacount(&self) -> u32 { | ||
| 1354 | let val = (self.0 >> 0usize) & 0x01ff_ffff; | ||
| 1355 | val as u32 | ||
| 1356 | } | ||
| 1357 | #[doc = "Data count value When read, the number of remaining data bytes to be transferred is returned. Write has no effect."] | ||
| 1358 | pub fn set_datacount(&mut self, val: u32) { | ||
| 1359 | self.0 = | ||
| 1360 | (self.0 & !(0x01ff_ffff << 0usize)) | (((val as u32) & 0x01ff_ffff) << 0usize); | ||
| 1361 | } | ||
| 1362 | } | ||
| 1363 | impl Default for Dcntr { | ||
| 1364 | fn default() -> Dcntr { | ||
| 1365 | Dcntr(0) | ||
| 1366 | } | ||
| 1367 | } | ||
| 1368 | #[doc = "SDMMC command response register"] | ||
| 1369 | #[repr(transparent)] | ||
| 1370 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1371 | pub struct Respcmdr(pub u32); | ||
| 1372 | impl Respcmdr { | ||
| 1373 | #[doc = "Response command index"] | ||
| 1374 | pub const fn respcmd(&self) -> u8 { | ||
| 1375 | let val = (self.0 >> 0usize) & 0x3f; | ||
| 1376 | val as u8 | ||
| 1377 | } | ||
| 1378 | #[doc = "Response command index"] | ||
| 1379 | pub fn set_respcmd(&mut self, val: u8) { | ||
| 1380 | self.0 = (self.0 & !(0x3f << 0usize)) | (((val as u32) & 0x3f) << 0usize); | ||
| 1381 | } | ||
| 1382 | } | ||
| 1383 | impl Default for Respcmdr { | ||
| 1384 | fn default() -> Respcmdr { | ||
| 1385 | Respcmdr(0) | ||
| 1386 | } | ||
| 1387 | } | ||
| 1388 | #[doc = "The SDMMC_IDMABSIZER register contains the buffers size when in double buffer configuration."] | ||
| 1389 | #[repr(transparent)] | ||
| 1390 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1391 | pub struct Idmabsizer(pub u32); | ||
| 1392 | impl Idmabsizer { | ||
| 1393 | #[doc = "Number of transfers per buffer. This 8-bit value shall be multiplied by 8 to get the size of the buffer in 32-bit words and by 32 to get the size of the buffer in bytes. Example: IDMABNDT = 0x01: buffer size = 8 words = 32 bytes. These bits can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] | ||
| 1394 | pub const fn idmabndt(&self) -> u8 { | ||
| 1395 | let val = (self.0 >> 5usize) & 0xff; | ||
| 1396 | val as u8 | ||
| 1397 | } | ||
| 1398 | #[doc = "Number of transfers per buffer. This 8-bit value shall be multiplied by 8 to get the size of the buffer in 32-bit words and by 32 to get the size of the buffer in bytes. Example: IDMABNDT = 0x01: buffer size = 8 words = 32 bytes. These bits can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] | ||
| 1399 | pub fn set_idmabndt(&mut self, val: u8) { | ||
| 1400 | self.0 = (self.0 & !(0xff << 5usize)) | (((val as u32) & 0xff) << 5usize); | ||
| 1401 | } | ||
| 1402 | } | ||
| 1403 | impl Default for Idmabsizer { | ||
| 1404 | fn default() -> Idmabsizer { | ||
| 1405 | Idmabsizer(0) | ||
| 1406 | } | ||
| 1407 | } | ||
| 1408 | #[doc = "The SDMMC_ARGR register contains a 32-bit command argument, which is sent to a card as part of a command message."] | ||
| 1409 | #[repr(transparent)] | ||
| 1410 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1411 | pub struct Argr(pub u32); | ||
| 1412 | impl Argr { | ||
| 1413 | #[doc = "Command argument. These bits can only be written by firmware when CPSM is disabled (CPSMEN = 0). Command argument sent to a card as part of a command message. If a command contains an argument, it must be loaded into this register before writing a command to the command register."] | ||
| 1414 | pub const fn cmdarg(&self) -> u32 { | ||
| 1415 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 1416 | val as u32 | ||
| 1417 | } | ||
| 1418 | #[doc = "Command argument. These bits can only be written by firmware when CPSM is disabled (CPSMEN = 0). Command argument sent to a card as part of a command message. If a command contains an argument, it must be loaded into this register before writing a command to the command register."] | ||
| 1419 | pub fn set_cmdarg(&mut self, val: u32) { | ||
| 1420 | self.0 = | ||
| 1421 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 1422 | } | ||
| 1423 | } | ||
| 1424 | impl Default for Argr { | ||
| 1425 | fn default() -> Argr { | ||
| 1426 | Argr(0) | ||
| 1427 | } | ||
| 1428 | } | ||
| 1429 | #[doc = "The SDMMC_CMDR register contains the command index and command type bits. The command index is sent to a card as part of a command message. The command type bits control the command path state machine (CPSM)."] | 1369 | #[doc = "The SDMMC_CMDR register contains the command index and command type bits. The command index is sent to a card as part of a command message. The command type bits control the command path state machine (CPSM)."] |
| 1430 | #[repr(transparent)] | 1370 | #[repr(transparent)] |
| 1431 | #[derive(Copy, Clone, Eq, PartialEq)] | 1371 | #[derive(Copy, Clone, Eq, PartialEq)] |
| @@ -1536,50 +1476,6 @@ are always 0 and read only). This register can be written by firmware when DPSM | |||
| 1536 | Cmdr(0) | 1476 | Cmdr(0) |
| 1537 | } | 1477 | } |
| 1538 | } | 1478 | } |
| 1539 | #[doc = "The SDMMC_IDMABASE1R register contains the double buffer configuration second buffer memory base address."] | ||
| 1540 | #[repr(transparent)] | ||
| 1541 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1542 | pub struct Idmabase1r(pub u32); | ||
| 1543 | impl Idmabase1r { | ||
| 1544 | #[doc = "Buffer 1 memory base address, shall be word aligned (bit [1:0] | ||
| 1545 | are always 0 and read only). This register can be written by firmware when DPSM is inactive (DPSMACT = 0), and can dynamically be written by firmware when DPSM active (DPSMACT = 1) and memory buffer 1 is inactive (IDMABACT = 0)."] | ||
| 1546 | pub const fn idmabase1(&self) -> u32 { | ||
| 1547 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 1548 | val as u32 | ||
| 1549 | } | ||
| 1550 | #[doc = "Buffer 1 memory base address, shall be word aligned (bit [1:0] | ||
| 1551 | are always 0 and read only). This register can be written by firmware when DPSM is inactive (DPSMACT = 0), and can dynamically be written by firmware when DPSM active (DPSMACT = 1) and memory buffer 1 is inactive (IDMABACT = 0)."] | ||
| 1552 | pub fn set_idmabase1(&mut self, val: u32) { | ||
| 1553 | self.0 = | ||
| 1554 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 1555 | } | ||
| 1556 | } | ||
| 1557 | impl Default for Idmabase1r { | ||
| 1558 | fn default() -> Idmabase1r { | ||
| 1559 | Idmabase1r(0) | ||
| 1560 | } | ||
| 1561 | } | ||
| 1562 | #[doc = "SDMMC IP identification register"] | ||
| 1563 | #[repr(transparent)] | ||
| 1564 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1565 | pub struct Id(pub u32); | ||
| 1566 | impl Id { | ||
| 1567 | #[doc = "SDMMC IP identification."] | ||
| 1568 | pub const fn ip_id(&self) -> u32 { | ||
| 1569 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 1570 | val as u32 | ||
| 1571 | } | ||
| 1572 | #[doc = "SDMMC IP identification."] | ||
| 1573 | pub fn set_ip_id(&mut self, val: u32) { | ||
| 1574 | self.0 = | ||
| 1575 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 1576 | } | ||
| 1577 | } | ||
| 1578 | impl Default for Id { | ||
| 1579 | fn default() -> Id { | ||
| 1580 | Id(0) | ||
| 1581 | } | ||
| 1582 | } | ||
| 1583 | #[doc = "The SDMMC_DCTRL register control the data path state machine (DPSM)."] | 1479 | #[doc = "The SDMMC_DCTRL register control the data path state machine (DPSM)."] |
| 1584 | #[repr(transparent)] | 1480 | #[repr(transparent)] |
| 1585 | #[derive(Copy, Clone, Eq, PartialEq)] | 1481 | #[derive(Copy, Clone, Eq, PartialEq)] |
| @@ -1681,139 +1577,6 @@ are always 0 and read only). This register can be written by firmware when DPSM | |||
| 1681 | Dctrl(0) | 1577 | Dctrl(0) |
| 1682 | } | 1578 | } |
| 1683 | } | 1579 | } |
| 1684 | #[doc = "The SDMMC_DLENR register contains the number of data bytes to be transferred. The value is loaded into the data counter when data transfer starts."] | ||
| 1685 | #[repr(transparent)] | ||
| 1686 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1687 | pub struct Dlenr(pub u32); | ||
| 1688 | impl Dlenr { | ||
| 1689 | #[doc = "Data length value This register can only be written by firmware when DPSM is inactive (DPSMACT = 0). Number of data bytes to be transferred. When DDR = 1 DATALENGTH is truncated to a multiple of 2. (The last odd byte is not transfered) When DATALENGTH = 0 no data will be transfered, when requested by a CPSMEN and CMDTRANS = 1 also no command will be transfered. DTEN and CPSMEN are cleared to 0."] | ||
| 1690 | pub const fn datalength(&self) -> u32 { | ||
| 1691 | let val = (self.0 >> 0usize) & 0x01ff_ffff; | ||
| 1692 | val as u32 | ||
| 1693 | } | ||
| 1694 | #[doc = "Data length value This register can only be written by firmware when DPSM is inactive (DPSMACT = 0). Number of data bytes to be transferred. When DDR = 1 DATALENGTH is truncated to a multiple of 2. (The last odd byte is not transfered) When DATALENGTH = 0 no data will be transfered, when requested by a CPSMEN and CMDTRANS = 1 also no command will be transfered. DTEN and CPSMEN are cleared to 0."] | ||
| 1695 | pub fn set_datalength(&mut self, val: u32) { | ||
| 1696 | self.0 = | ||
| 1697 | (self.0 & !(0x01ff_ffff << 0usize)) | (((val as u32) & 0x01ff_ffff) << 0usize); | ||
| 1698 | } | ||
| 1699 | } | ||
| 1700 | impl Default for Dlenr { | ||
| 1701 | fn default() -> Dlenr { | ||
| 1702 | Dlenr(0) | ||
| 1703 | } | ||
| 1704 | } | ||
| 1705 | #[doc = "The SDMMC_CLKCR register controls the SDMMC_CK output clock, the SDMMC_RX_CLK receive clock, and the bus width."] | ||
| 1706 | #[repr(transparent)] | ||
| 1707 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1708 | pub struct Clkcr(pub u32); | ||
| 1709 | impl Clkcr { | ||
| 1710 | #[doc = "Clock divide factor This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0). This field defines the divide factor between the input clock (SDMMCCLK) and the output clock (SDMMC_CK): SDMMC_CK frequency = SDMMCCLK / [2 * CLKDIV]. 0xx: etc.. xxx: etc.."] | ||
| 1711 | pub const fn clkdiv(&self) -> u16 { | ||
| 1712 | let val = (self.0 >> 0usize) & 0x03ff; | ||
| 1713 | val as u16 | ||
| 1714 | } | ||
| 1715 | #[doc = "Clock divide factor This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0). This field defines the divide factor between the input clock (SDMMCCLK) and the output clock (SDMMC_CK): SDMMC_CK frequency = SDMMCCLK / [2 * CLKDIV]. 0xx: etc.. xxx: etc.."] | ||
| 1716 | pub fn set_clkdiv(&mut self, val: u16) { | ||
| 1717 | self.0 = (self.0 & !(0x03ff << 0usize)) | (((val as u32) & 0x03ff) << 0usize); | ||
| 1718 | } | ||
| 1719 | #[doc = "Power saving configuration bit This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0) For power saving, the SDMMC_CK clock output can be disabled when the bus is idle by setting PWRSAV:"] | ||
| 1720 | pub const fn pwrsav(&self) -> bool { | ||
| 1721 | let val = (self.0 >> 12usize) & 0x01; | ||
| 1722 | val != 0 | ||
| 1723 | } | ||
| 1724 | #[doc = "Power saving configuration bit This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0) For power saving, the SDMMC_CK clock output can be disabled when the bus is idle by setting PWRSAV:"] | ||
| 1725 | pub fn set_pwrsav(&mut self, val: bool) { | ||
| 1726 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); | ||
| 1727 | } | ||
| 1728 | #[doc = "Wide bus mode enable bit This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"] | ||
| 1729 | pub const fn widbus(&self) -> u8 { | ||
| 1730 | let val = (self.0 >> 14usize) & 0x03; | ||
| 1731 | val as u8 | ||
| 1732 | } | ||
| 1733 | #[doc = "Wide bus mode enable bit This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"] | ||
| 1734 | pub fn set_widbus(&mut self, val: u8) { | ||
| 1735 | self.0 = (self.0 & !(0x03 << 14usize)) | (((val as u32) & 0x03) << 14usize); | ||
| 1736 | } | ||
| 1737 | #[doc = "SDMMC_CK dephasing selection bit for data and Command. This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0). When clock division = 1 (CLKDIV = 0), this bit has no effect. Data and Command change on SDMMC_CK falling edge. When clock division >1 (CLKDIV > 0) & DDR = 0: - SDMMC_CK edge occurs on SDMMCCLK rising edge. When clock division >1 (CLKDIV > 0) & DDR = 1: - Data changed on the SDMMCCLK falling edge succeeding a SDMMC_CK edge. - SDMMC_CK edge occurs on SDMMCCLK rising edge. - Data changed on the SDMMC_CK falling edge succeeding a SDMMC_CK edge. - SDMMC_CK edge occurs on SDMMCCLK rising edge."] | ||
| 1738 | pub const fn negedge(&self) -> bool { | ||
| 1739 | let val = (self.0 >> 16usize) & 0x01; | ||
| 1740 | val != 0 | ||
| 1741 | } | ||
| 1742 | #[doc = "SDMMC_CK dephasing selection bit for data and Command. This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0). When clock division = 1 (CLKDIV = 0), this bit has no effect. Data and Command change on SDMMC_CK falling edge. When clock division >1 (CLKDIV > 0) & DDR = 0: - SDMMC_CK edge occurs on SDMMCCLK rising edge. When clock division >1 (CLKDIV > 0) & DDR = 1: - Data changed on the SDMMCCLK falling edge succeeding a SDMMC_CK edge. - SDMMC_CK edge occurs on SDMMCCLK rising edge. - Data changed on the SDMMC_CK falling edge succeeding a SDMMC_CK edge. - SDMMC_CK edge occurs on SDMMCCLK rising edge."] | ||
| 1743 | pub fn set_negedge(&mut self, val: bool) { | ||
| 1744 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | ||
| 1745 | } | ||
| 1746 | #[doc = "Hardware flow control enable This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0) When Hardware flow control is enabled, the meaning of the TXFIFOE and RXFIFOF flags change, please see SDMMC status register definition in Section56.8.11."] | ||
| 1747 | pub const fn hwfc_en(&self) -> bool { | ||
| 1748 | let val = (self.0 >> 17usize) & 0x01; | ||
| 1749 | val != 0 | ||
| 1750 | } | ||
| 1751 | #[doc = "Hardware flow control enable This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0) When Hardware flow control is enabled, the meaning of the TXFIFOE and RXFIFOF flags change, please see SDMMC status register definition in Section56.8.11."] | ||
| 1752 | pub fn set_hwfc_en(&mut self, val: bool) { | ||
| 1753 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); | ||
| 1754 | } | ||
| 1755 | #[doc = "Data rate signaling selection This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0) DDR rate shall only be selected with 4-bit or 8-bit wide bus mode. (WIDBUS > 00). DDR = 1 has no effect when WIDBUS = 00 (1-bit wide bus). DDR rate shall only be selected with clock division >1. (CLKDIV > 0)"] | ||
| 1756 | pub const fn ddr(&self) -> bool { | ||
| 1757 | let val = (self.0 >> 18usize) & 0x01; | ||
| 1758 | val != 0 | ||
| 1759 | } | ||
| 1760 | #[doc = "Data rate signaling selection This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0) DDR rate shall only be selected with 4-bit or 8-bit wide bus mode. (WIDBUS > 00). DDR = 1 has no effect when WIDBUS = 00 (1-bit wide bus). DDR rate shall only be selected with clock division >1. (CLKDIV > 0)"] | ||
| 1761 | pub fn set_ddr(&mut self, val: bool) { | ||
| 1762 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); | ||
| 1763 | } | ||
| 1764 | #[doc = "Bus speed mode selection between DS, HS, SDR12, SDR25 and SDR50, DDR50, SDR104. This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"] | ||
| 1765 | pub const fn busspeed(&self) -> bool { | ||
| 1766 | let val = (self.0 >> 19usize) & 0x01; | ||
| 1767 | val != 0 | ||
| 1768 | } | ||
| 1769 | #[doc = "Bus speed mode selection between DS, HS, SDR12, SDR25 and SDR50, DDR50, SDR104. This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"] | ||
| 1770 | pub fn set_busspeed(&mut self, val: bool) { | ||
| 1771 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); | ||
| 1772 | } | ||
| 1773 | #[doc = "Receive clock selection. These bits can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"] | ||
| 1774 | pub const fn selclkrx(&self) -> u8 { | ||
| 1775 | let val = (self.0 >> 20usize) & 0x03; | ||
| 1776 | val as u8 | ||
| 1777 | } | ||
| 1778 | #[doc = "Receive clock selection. These bits can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"] | ||
| 1779 | pub fn set_selclkrx(&mut self, val: u8) { | ||
| 1780 | self.0 = (self.0 & !(0x03 << 20usize)) | (((val as u32) & 0x03) << 20usize); | ||
| 1781 | } | ||
| 1782 | } | ||
| 1783 | impl Default for Clkcr { | ||
| 1784 | fn default() -> Clkcr { | ||
| 1785 | Clkcr(0) | ||
| 1786 | } | ||
| 1787 | } | ||
| 1788 | #[doc = "SDMMC IP version register"] | ||
| 1789 | #[repr(transparent)] | ||
| 1790 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1791 | pub struct Ver(pub u32); | ||
| 1792 | impl Ver { | ||
| 1793 | #[doc = "IP minor revision number."] | ||
| 1794 | pub const fn minrev(&self) -> u8 { | ||
| 1795 | let val = (self.0 >> 0usize) & 0x0f; | ||
| 1796 | val as u8 | ||
| 1797 | } | ||
| 1798 | #[doc = "IP minor revision number."] | ||
| 1799 | pub fn set_minrev(&mut self, val: u8) { | ||
| 1800 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); | ||
| 1801 | } | ||
| 1802 | #[doc = "IP major revision number."] | ||
| 1803 | pub const fn majrev(&self) -> u8 { | ||
| 1804 | let val = (self.0 >> 4usize) & 0x0f; | ||
| 1805 | val as u8 | ||
| 1806 | } | ||
| 1807 | #[doc = "IP major revision number."] | ||
| 1808 | pub fn set_majrev(&mut self, val: u8) { | ||
| 1809 | self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize); | ||
| 1810 | } | ||
| 1811 | } | ||
| 1812 | impl Default for Ver { | ||
| 1813 | fn default() -> Ver { | ||
| 1814 | Ver(0) | ||
| 1815 | } | ||
| 1816 | } | ||
| 1817 | #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] | 1580 | #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] |
| 1818 | #[repr(transparent)] | 1581 | #[repr(transparent)] |
| 1819 | #[derive(Copy, Clone, Eq, PartialEq)] | 1582 | #[derive(Copy, Clone, Eq, PartialEq)] |
| @@ -1835,27 +1598,6 @@ are always 0 and read only). This register can be written by firmware when DPSM | |||
| 1835 | Resp3r(0) | 1598 | Resp3r(0) |
| 1836 | } | 1599 | } |
| 1837 | } | 1600 | } |
| 1838 | #[doc = "The SDMMC_ACKTIMER register contains the acknowledgment timeout period, in SDMMC_CK bus clock periods. A counter loads the value from the SDMMC_ACKTIMER register, and starts decrementing when the data path state machine (DPSM) enters the Wait_Ack state. If the timer reaches 0 while the DPSM is in this states, the acknowledgment timeout status flag is set."] | ||
| 1839 | #[repr(transparent)] | ||
| 1840 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1841 | pub struct Acktimer(pub u32); | ||
| 1842 | impl Acktimer { | ||
| 1843 | #[doc = "Boot acknowledgment timeout period This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). Boot acknowledgment timeout period expressed in card bus clock periods."] | ||
| 1844 | pub const fn acktime(&self) -> u32 { | ||
| 1845 | let val = (self.0 >> 0usize) & 0x01ff_ffff; | ||
| 1846 | val as u32 | ||
| 1847 | } | ||
| 1848 | #[doc = "Boot acknowledgment timeout period This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). Boot acknowledgment timeout period expressed in card bus clock periods."] | ||
| 1849 | pub fn set_acktime(&mut self, val: u32) { | ||
| 1850 | self.0 = | ||
| 1851 | (self.0 & !(0x01ff_ffff << 0usize)) | (((val as u32) & 0x01ff_ffff) << 0usize); | ||
| 1852 | } | ||
| 1853 | } | ||
| 1854 | impl Default for Acktimer { | ||
| 1855 | fn default() -> Acktimer { | ||
| 1856 | Acktimer(0) | ||
| 1857 | } | ||
| 1858 | } | ||
| 1859 | #[doc = "The interrupt mask register determines which status flags generate an interrupt request by setting the corresponding bit to 1."] | 1601 | #[doc = "The interrupt mask register determines which status flags generate an interrupt request by setting the corresponding bit to 1."] |
| 1860 | #[repr(transparent)] | 1602 | #[repr(transparent)] |
| 1861 | #[derive(Copy, Clone, Eq, PartialEq)] | 1603 | #[derive(Copy, Clone, Eq, PartialEq)] |
| @@ -2074,2511 +1816,751 @@ are always 0 and read only). This register can be written by firmware when DPSM | |||
| 2074 | Maskr(0) | 1816 | Maskr(0) |
| 2075 | } | 1817 | } |
| 2076 | } | 1818 | } |
| 2077 | #[doc = "The receive and transmit FIFOs can be only read or written as word (32-bit) wide registers. The FIFOs contain 16 entries on sequential addresses. This allows the CPU to use its load and store multiple operands to read from/write to the FIFO.When accessing SDMMC_FIFOR with half word or byte access an AHB bus fault is generated."] | 1819 | #[doc = "The SDMMC_IDMABSIZER register contains the buffers size when in double buffer configuration."] |
| 2078 | #[repr(transparent)] | ||
| 2079 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2080 | pub struct Fifor(pub u32); | ||
| 2081 | impl Fifor { | ||
| 2082 | #[doc = "Receive and transmit FIFO data This register can only be read or written by firmware when the DPSM is active (DPSMACT=1). The FIFO data occupies 16 entries of 32-bit words."] | ||
| 2083 | pub const fn fifodata(&self) -> u32 { | ||
| 2084 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 2085 | val as u32 | ||
| 2086 | } | ||
| 2087 | #[doc = "Receive and transmit FIFO data This register can only be read or written by firmware when the DPSM is active (DPSMACT=1). The FIFO data occupies 16 entries of 32-bit words."] | ||
| 2088 | pub fn set_fifodata(&mut self, val: u32) { | ||
| 2089 | self.0 = | ||
| 2090 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 2091 | } | ||
| 2092 | } | ||
| 2093 | impl Default for Fifor { | ||
| 2094 | fn default() -> Fifor { | ||
| 2095 | Fifor(0) | ||
| 2096 | } | ||
| 2097 | } | ||
| 2098 | #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] | ||
| 2099 | #[repr(transparent)] | ||
| 2100 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2101 | pub struct Resp2r(pub u32); | ||
| 2102 | impl Resp2r { | ||
| 2103 | #[doc = "see Table404."] | ||
| 2104 | pub const fn cardstatus2(&self) -> u32 { | ||
| 2105 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 2106 | val as u32 | ||
| 2107 | } | ||
| 2108 | #[doc = "see Table404."] | ||
| 2109 | pub fn set_cardstatus2(&mut self, val: u32) { | ||
| 2110 | self.0 = | ||
| 2111 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 2112 | } | ||
| 2113 | } | ||
| 2114 | impl Default for Resp2r { | ||
| 2115 | fn default() -> Resp2r { | ||
| 2116 | Resp2r(0) | ||
| 2117 | } | ||
| 2118 | } | ||
| 2119 | #[doc = "The receive and transmit FIFOs can be read or written as 32-bit wide registers. The FIFOs contain 32 entries on 32 sequential addresses. This allows the CPU to use its load and store multiple operands to read from/write to the FIFO."] | ||
| 2120 | #[repr(transparent)] | ||
| 2121 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2122 | pub struct Idmactrlr(pub u32); | ||
| 2123 | impl Idmactrlr { | ||
| 2124 | #[doc = "IDMA enable This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] | ||
| 2125 | pub const fn idmaen(&self) -> bool { | ||
| 2126 | let val = (self.0 >> 0usize) & 0x01; | ||
| 2127 | val != 0 | ||
| 2128 | } | ||
| 2129 | #[doc = "IDMA enable This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] | ||
| 2130 | pub fn set_idmaen(&mut self, val: bool) { | ||
| 2131 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 2132 | } | ||
| 2133 | #[doc = "Buffer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] | ||
| 2134 | pub const fn idmabmode(&self) -> bool { | ||
| 2135 | let val = (self.0 >> 1usize) & 0x01; | ||
| 2136 | val != 0 | ||
| 2137 | } | ||
| 2138 | #[doc = "Buffer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] | ||
| 2139 | pub fn set_idmabmode(&mut self, val: bool) { | ||
| 2140 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | ||
| 2141 | } | ||
| 2142 | #[doc = "Double buffer mode active buffer indication This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). When IDMA is enabled this bit is toggled by hardware."] | ||
| 2143 | pub const fn idmabact(&self) -> bool { | ||
| 2144 | let val = (self.0 >> 2usize) & 0x01; | ||
| 2145 | val != 0 | ||
| 2146 | } | ||
| 2147 | #[doc = "Double buffer mode active buffer indication This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). When IDMA is enabled this bit is toggled by hardware."] | ||
| 2148 | pub fn set_idmabact(&mut self, val: bool) { | ||
| 2149 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 2150 | } | ||
| 2151 | } | ||
| 2152 | impl Default for Idmactrlr { | ||
| 2153 | fn default() -> Idmactrlr { | ||
| 2154 | Idmactrlr(0) | ||
| 2155 | } | ||
| 2156 | } | ||
| 2157 | #[doc = "The SDMMC_ICR register is a write-only register. Writing a bit with 1 clears the corresponding bit in the SDMMC_STAR status register."] | ||
| 2158 | #[repr(transparent)] | ||
| 2159 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2160 | pub struct Icr(pub u32); | ||
| 2161 | impl Icr { | ||
| 2162 | #[doc = "CCRCFAIL flag clear bit Set by software to clear the CCRCFAIL flag."] | ||
| 2163 | pub const fn ccrcfailc(&self) -> bool { | ||
| 2164 | let val = (self.0 >> 0usize) & 0x01; | ||
| 2165 | val != 0 | ||
| 2166 | } | ||
| 2167 | #[doc = "CCRCFAIL flag clear bit Set by software to clear the CCRCFAIL flag."] | ||
| 2168 | pub fn set_ccrcfailc(&mut self, val: bool) { | ||
| 2169 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 2170 | } | ||
| 2171 | #[doc = "DCRCFAIL flag clear bit Set by software to clear the DCRCFAIL flag."] | ||
| 2172 | pub const fn dcrcfailc(&self) -> bool { | ||
| 2173 | let val = (self.0 >> 1usize) & 0x01; | ||
| 2174 | val != 0 | ||
| 2175 | } | ||
| 2176 | #[doc = "DCRCFAIL flag clear bit Set by software to clear the DCRCFAIL flag."] | ||
| 2177 | pub fn set_dcrcfailc(&mut self, val: bool) { | ||
| 2178 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | ||
| 2179 | } | ||
| 2180 | #[doc = "CTIMEOUT flag clear bit Set by software to clear the CTIMEOUT flag."] | ||
| 2181 | pub const fn ctimeoutc(&self) -> bool { | ||
| 2182 | let val = (self.0 >> 2usize) & 0x01; | ||
| 2183 | val != 0 | ||
| 2184 | } | ||
| 2185 | #[doc = "CTIMEOUT flag clear bit Set by software to clear the CTIMEOUT flag."] | ||
| 2186 | pub fn set_ctimeoutc(&mut self, val: bool) { | ||
| 2187 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 2188 | } | ||
| 2189 | #[doc = "DTIMEOUT flag clear bit Set by software to clear the DTIMEOUT flag."] | ||
| 2190 | pub const fn dtimeoutc(&self) -> bool { | ||
| 2191 | let val = (self.0 >> 3usize) & 0x01; | ||
| 2192 | val != 0 | ||
| 2193 | } | ||
| 2194 | #[doc = "DTIMEOUT flag clear bit Set by software to clear the DTIMEOUT flag."] | ||
| 2195 | pub fn set_dtimeoutc(&mut self, val: bool) { | ||
| 2196 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | ||
| 2197 | } | ||
| 2198 | #[doc = "TXUNDERR flag clear bit Set by software to clear TXUNDERR flag."] | ||
| 2199 | pub const fn txunderrc(&self) -> bool { | ||
| 2200 | let val = (self.0 >> 4usize) & 0x01; | ||
| 2201 | val != 0 | ||
| 2202 | } | ||
| 2203 | #[doc = "TXUNDERR flag clear bit Set by software to clear TXUNDERR flag."] | ||
| 2204 | pub fn set_txunderrc(&mut self, val: bool) { | ||
| 2205 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | ||
| 2206 | } | ||
| 2207 | #[doc = "RXOVERR flag clear bit Set by software to clear the RXOVERR flag."] | ||
| 2208 | pub const fn rxoverrc(&self) -> bool { | ||
| 2209 | let val = (self.0 >> 5usize) & 0x01; | ||
| 2210 | val != 0 | ||
| 2211 | } | ||
| 2212 | #[doc = "RXOVERR flag clear bit Set by software to clear the RXOVERR flag."] | ||
| 2213 | pub fn set_rxoverrc(&mut self, val: bool) { | ||
| 2214 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 2215 | } | ||
| 2216 | #[doc = "CMDREND flag clear bit Set by software to clear the CMDREND flag."] | ||
| 2217 | pub const fn cmdrendc(&self) -> bool { | ||
| 2218 | let val = (self.0 >> 6usize) & 0x01; | ||
| 2219 | val != 0 | ||
| 2220 | } | ||
| 2221 | #[doc = "CMDREND flag clear bit Set by software to clear the CMDREND flag."] | ||
| 2222 | pub fn set_cmdrendc(&mut self, val: bool) { | ||
| 2223 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 2224 | } | ||
| 2225 | #[doc = "CMDSENT flag clear bit Set by software to clear the CMDSENT flag."] | ||
| 2226 | pub const fn cmdsentc(&self) -> bool { | ||
| 2227 | let val = (self.0 >> 7usize) & 0x01; | ||
| 2228 | val != 0 | ||
| 2229 | } | ||
| 2230 | #[doc = "CMDSENT flag clear bit Set by software to clear the CMDSENT flag."] | ||
| 2231 | pub fn set_cmdsentc(&mut self, val: bool) { | ||
| 2232 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 2233 | } | ||
| 2234 | #[doc = "DATAEND flag clear bit Set by software to clear the DATAEND flag."] | ||
| 2235 | pub const fn dataendc(&self) -> bool { | ||
| 2236 | let val = (self.0 >> 8usize) & 0x01; | ||
| 2237 | val != 0 | ||
| 2238 | } | ||
| 2239 | #[doc = "DATAEND flag clear bit Set by software to clear the DATAEND flag."] | ||
| 2240 | pub fn set_dataendc(&mut self, val: bool) { | ||
| 2241 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 2242 | } | ||
| 2243 | #[doc = "DHOLD flag clear bit Set by software to clear the DHOLD flag."] | ||
| 2244 | pub const fn dholdc(&self) -> bool { | ||
| 2245 | let val = (self.0 >> 9usize) & 0x01; | ||
| 2246 | val != 0 | ||
| 2247 | } | ||
| 2248 | #[doc = "DHOLD flag clear bit Set by software to clear the DHOLD flag."] | ||
| 2249 | pub fn set_dholdc(&mut self, val: bool) { | ||
| 2250 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | ||
| 2251 | } | ||
| 2252 | #[doc = "DBCKEND flag clear bit Set by software to clear the DBCKEND flag."] | ||
| 2253 | pub const fn dbckendc(&self) -> bool { | ||
| 2254 | let val = (self.0 >> 10usize) & 0x01; | ||
| 2255 | val != 0 | ||
| 2256 | } | ||
| 2257 | #[doc = "DBCKEND flag clear bit Set by software to clear the DBCKEND flag."] | ||
| 2258 | pub fn set_dbckendc(&mut self, val: bool) { | ||
| 2259 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | ||
| 2260 | } | ||
| 2261 | #[doc = "DABORT flag clear bit Set by software to clear the DABORT flag."] | ||
| 2262 | pub const fn dabortc(&self) -> bool { | ||
| 2263 | let val = (self.0 >> 11usize) & 0x01; | ||
| 2264 | val != 0 | ||
| 2265 | } | ||
| 2266 | #[doc = "DABORT flag clear bit Set by software to clear the DABORT flag."] | ||
| 2267 | pub fn set_dabortc(&mut self, val: bool) { | ||
| 2268 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); | ||
| 2269 | } | ||
| 2270 | #[doc = "BUSYD0END flag clear bit Set by software to clear the BUSYD0END flag."] | ||
| 2271 | pub const fn busyd0endc(&self) -> bool { | ||
| 2272 | let val = (self.0 >> 21usize) & 0x01; | ||
| 2273 | val != 0 | ||
| 2274 | } | ||
| 2275 | #[doc = "BUSYD0END flag clear bit Set by software to clear the BUSYD0END flag."] | ||
| 2276 | pub fn set_busyd0endc(&mut self, val: bool) { | ||
| 2277 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); | ||
| 2278 | } | ||
| 2279 | #[doc = "SDIOIT flag clear bit Set by software to clear the SDIOIT flag."] | ||
| 2280 | pub const fn sdioitc(&self) -> bool { | ||
| 2281 | let val = (self.0 >> 22usize) & 0x01; | ||
| 2282 | val != 0 | ||
| 2283 | } | ||
| 2284 | #[doc = "SDIOIT flag clear bit Set by software to clear the SDIOIT flag."] | ||
| 2285 | pub fn set_sdioitc(&mut self, val: bool) { | ||
| 2286 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); | ||
| 2287 | } | ||
| 2288 | #[doc = "ACKFAIL flag clear bit Set by software to clear the ACKFAIL flag."] | ||
| 2289 | pub const fn ackfailc(&self) -> bool { | ||
| 2290 | let val = (self.0 >> 23usize) & 0x01; | ||
| 2291 | val != 0 | ||
| 2292 | } | ||
| 2293 | #[doc = "ACKFAIL flag clear bit Set by software to clear the ACKFAIL flag."] | ||
| 2294 | pub fn set_ackfailc(&mut self, val: bool) { | ||
| 2295 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); | ||
| 2296 | } | ||
| 2297 | #[doc = "ACKTIMEOUT flag clear bit Set by software to clear the ACKTIMEOUT flag."] | ||
| 2298 | pub const fn acktimeoutc(&self) -> bool { | ||
| 2299 | let val = (self.0 >> 24usize) & 0x01; | ||
| 2300 | val != 0 | ||
| 2301 | } | ||
| 2302 | #[doc = "ACKTIMEOUT flag clear bit Set by software to clear the ACKTIMEOUT flag."] | ||
| 2303 | pub fn set_acktimeoutc(&mut self, val: bool) { | ||
| 2304 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize); | ||
| 2305 | } | ||
| 2306 | #[doc = "VSWEND flag clear bit Set by software to clear the VSWEND flag."] | ||
| 2307 | pub const fn vswendc(&self) -> bool { | ||
| 2308 | let val = (self.0 >> 25usize) & 0x01; | ||
| 2309 | val != 0 | ||
| 2310 | } | ||
| 2311 | #[doc = "VSWEND flag clear bit Set by software to clear the VSWEND flag."] | ||
| 2312 | pub fn set_vswendc(&mut self, val: bool) { | ||
| 2313 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize); | ||
| 2314 | } | ||
| 2315 | #[doc = "CKSTOP flag clear bit Set by software to clear the CKSTOP flag."] | ||
| 2316 | pub const fn ckstopc(&self) -> bool { | ||
| 2317 | let val = (self.0 >> 26usize) & 0x01; | ||
| 2318 | val != 0 | ||
| 2319 | } | ||
| 2320 | #[doc = "CKSTOP flag clear bit Set by software to clear the CKSTOP flag."] | ||
| 2321 | pub fn set_ckstopc(&mut self, val: bool) { | ||
| 2322 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); | ||
| 2323 | } | ||
| 2324 | #[doc = "IDMA transfer error clear bit Set by software to clear the IDMATE flag."] | ||
| 2325 | pub const fn idmatec(&self) -> bool { | ||
| 2326 | let val = (self.0 >> 27usize) & 0x01; | ||
| 2327 | val != 0 | ||
| 2328 | } | ||
| 2329 | #[doc = "IDMA transfer error clear bit Set by software to clear the IDMATE flag."] | ||
| 2330 | pub fn set_idmatec(&mut self, val: bool) { | ||
| 2331 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize); | ||
| 2332 | } | ||
| 2333 | #[doc = "IDMA buffer transfer complete clear bit Set by software to clear the IDMABTC flag."] | ||
| 2334 | pub const fn idmabtcc(&self) -> bool { | ||
| 2335 | let val = (self.0 >> 28usize) & 0x01; | ||
| 2336 | val != 0 | ||
| 2337 | } | ||
| 2338 | #[doc = "IDMA buffer transfer complete clear bit Set by software to clear the IDMABTC flag."] | ||
| 2339 | pub fn set_idmabtcc(&mut self, val: bool) { | ||
| 2340 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize); | ||
| 2341 | } | ||
| 2342 | } | ||
| 2343 | impl Default for Icr { | ||
| 2344 | fn default() -> Icr { | ||
| 2345 | Icr(0) | ||
| 2346 | } | ||
| 2347 | } | ||
| 2348 | #[doc = "The SDMMC_DTIMER register contains the data timeout period, in card bus clock periods. A counter loads the value from the SDMMC_DTIMER register, and starts decrementing when the data path state machine (DPSM) enters the Wait_R or Busy state. If the timer reaches 0 while the DPSM is in either of these states, the timeout status flag is set."] | ||
| 2349 | #[repr(transparent)] | ||
| 2350 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2351 | pub struct Dtimer(pub u32); | ||
| 2352 | impl Dtimer { | ||
| 2353 | #[doc = "Data and R1b busy timeout period This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0). Data and R1b busy timeout period expressed in card bus clock periods."] | ||
| 2354 | pub const fn datatime(&self) -> u32 { | ||
| 2355 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 2356 | val as u32 | ||
| 2357 | } | ||
| 2358 | #[doc = "Data and R1b busy timeout period This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0). Data and R1b busy timeout period expressed in card bus clock periods."] | ||
| 2359 | pub fn set_datatime(&mut self, val: u32) { | ||
| 2360 | self.0 = | ||
| 2361 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 2362 | } | ||
| 2363 | } | ||
| 2364 | impl Default for Dtimer { | ||
| 2365 | fn default() -> Dtimer { | ||
| 2366 | Dtimer(0) | ||
| 2367 | } | ||
| 2368 | } | ||
| 2369 | } | ||
| 2370 | } | ||
| 2371 | pub mod syscfg_f4 { | ||
| 2372 | use crate::generic::*; | ||
| 2373 | #[doc = "System configuration controller"] | ||
| 2374 | #[derive(Copy, Clone)] | ||
| 2375 | pub struct Syscfg(pub *mut u8); | ||
| 2376 | unsafe impl Send for Syscfg {} | ||
| 2377 | unsafe impl Sync for Syscfg {} | ||
| 2378 | impl Syscfg { | ||
| 2379 | #[doc = "memory remap register"] | ||
| 2380 | pub fn memrm(self) -> Reg<regs::Memrm, RW> { | ||
| 2381 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 2382 | } | ||
| 2383 | #[doc = "peripheral mode configuration register"] | ||
| 2384 | pub fn pmc(self) -> Reg<regs::Pmc, RW> { | ||
| 2385 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 2386 | } | ||
| 2387 | #[doc = "external interrupt configuration register"] | ||
| 2388 | pub fn exticr(self, n: usize) -> Reg<regs::Exticr, RW> { | ||
| 2389 | assert!(n < 4usize); | ||
| 2390 | unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) } | ||
| 2391 | } | ||
| 2392 | #[doc = "Compensation cell control register"] | ||
| 2393 | pub fn cmpcr(self) -> Reg<regs::Cmpcr, R> { | ||
| 2394 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | ||
| 2395 | } | ||
| 2396 | } | ||
| 2397 | pub mod regs { | ||
| 2398 | use crate::generic::*; | ||
| 2399 | #[doc = "peripheral mode configuration register"] | ||
| 2400 | #[repr(transparent)] | ||
| 2401 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2402 | pub struct Pmc(pub u32); | ||
| 2403 | impl Pmc { | ||
| 2404 | #[doc = "ADC1DC2"] | ||
| 2405 | pub const fn adc1dc2(&self) -> bool { | ||
| 2406 | let val = (self.0 >> 16usize) & 0x01; | ||
| 2407 | val != 0 | ||
| 2408 | } | ||
| 2409 | #[doc = "ADC1DC2"] | ||
| 2410 | pub fn set_adc1dc2(&mut self, val: bool) { | ||
| 2411 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | ||
| 2412 | } | ||
| 2413 | #[doc = "ADC2DC2"] | ||
| 2414 | pub const fn adc2dc2(&self) -> bool { | ||
| 2415 | let val = (self.0 >> 17usize) & 0x01; | ||
| 2416 | val != 0 | ||
| 2417 | } | ||
| 2418 | #[doc = "ADC2DC2"] | ||
| 2419 | pub fn set_adc2dc2(&mut self, val: bool) { | ||
| 2420 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); | ||
| 2421 | } | ||
| 2422 | #[doc = "ADC3DC2"] | ||
| 2423 | pub const fn adc3dc2(&self) -> bool { | ||
| 2424 | let val = (self.0 >> 18usize) & 0x01; | ||
| 2425 | val != 0 | ||
| 2426 | } | ||
| 2427 | #[doc = "ADC3DC2"] | ||
| 2428 | pub fn set_adc3dc2(&mut self, val: bool) { | ||
| 2429 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); | ||
| 2430 | } | ||
| 2431 | #[doc = "Ethernet PHY interface selection"] | ||
| 2432 | pub const fn mii_rmii_sel(&self) -> bool { | ||
| 2433 | let val = (self.0 >> 23usize) & 0x01; | ||
| 2434 | val != 0 | ||
| 2435 | } | ||
| 2436 | #[doc = "Ethernet PHY interface selection"] | ||
| 2437 | pub fn set_mii_rmii_sel(&mut self, val: bool) { | ||
| 2438 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); | ||
| 2439 | } | ||
| 2440 | } | ||
| 2441 | impl Default for Pmc { | ||
| 2442 | fn default() -> Pmc { | ||
| 2443 | Pmc(0) | ||
| 2444 | } | ||
| 2445 | } | ||
| 2446 | #[doc = "memory remap register"] | ||
| 2447 | #[repr(transparent)] | ||
| 2448 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2449 | pub struct Memrm(pub u32); | ||
| 2450 | impl Memrm { | ||
| 2451 | #[doc = "Memory mapping selection"] | ||
| 2452 | pub const fn mem_mode(&self) -> u8 { | ||
| 2453 | let val = (self.0 >> 0usize) & 0x07; | ||
| 2454 | val as u8 | ||
| 2455 | } | ||
| 2456 | #[doc = "Memory mapping selection"] | ||
| 2457 | pub fn set_mem_mode(&mut self, val: u8) { | ||
| 2458 | self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize); | ||
| 2459 | } | ||
| 2460 | #[doc = "Flash bank mode selection"] | ||
| 2461 | pub const fn fb_mode(&self) -> bool { | ||
| 2462 | let val = (self.0 >> 8usize) & 0x01; | ||
| 2463 | val != 0 | ||
| 2464 | } | ||
| 2465 | #[doc = "Flash bank mode selection"] | ||
| 2466 | pub fn set_fb_mode(&mut self, val: bool) { | ||
| 2467 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 2468 | } | ||
| 2469 | #[doc = "FMC memory mapping swap"] | ||
| 2470 | pub const fn swp_fmc(&self) -> u8 { | ||
| 2471 | let val = (self.0 >> 10usize) & 0x03; | ||
| 2472 | val as u8 | ||
| 2473 | } | ||
| 2474 | #[doc = "FMC memory mapping swap"] | ||
| 2475 | pub fn set_swp_fmc(&mut self, val: u8) { | ||
| 2476 | self.0 = (self.0 & !(0x03 << 10usize)) | (((val as u32) & 0x03) << 10usize); | ||
| 2477 | } | ||
| 2478 | } | ||
| 2479 | impl Default for Memrm { | ||
| 2480 | fn default() -> Memrm { | ||
| 2481 | Memrm(0) | ||
| 2482 | } | ||
| 2483 | } | ||
| 2484 | #[doc = "Compensation cell control register"] | ||
| 2485 | #[repr(transparent)] | ||
| 2486 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2487 | pub struct Cmpcr(pub u32); | ||
| 2488 | impl Cmpcr { | ||
| 2489 | #[doc = "Compensation cell power-down"] | ||
| 2490 | pub const fn cmp_pd(&self) -> bool { | ||
| 2491 | let val = (self.0 >> 0usize) & 0x01; | ||
| 2492 | val != 0 | ||
| 2493 | } | ||
| 2494 | #[doc = "Compensation cell power-down"] | ||
| 2495 | pub fn set_cmp_pd(&mut self, val: bool) { | ||
| 2496 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 2497 | } | ||
| 2498 | #[doc = "READY"] | ||
| 2499 | pub const fn ready(&self) -> bool { | ||
| 2500 | let val = (self.0 >> 8usize) & 0x01; | ||
| 2501 | val != 0 | ||
| 2502 | } | ||
| 2503 | #[doc = "READY"] | ||
| 2504 | pub fn set_ready(&mut self, val: bool) { | ||
| 2505 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 2506 | } | ||
| 2507 | } | ||
| 2508 | impl Default for Cmpcr { | ||
| 2509 | fn default() -> Cmpcr { | ||
| 2510 | Cmpcr(0) | ||
| 2511 | } | ||
| 2512 | } | ||
| 2513 | #[doc = "external interrupt configuration register"] | ||
| 2514 | #[repr(transparent)] | 1820 | #[repr(transparent)] |
| 2515 | #[derive(Copy, Clone, Eq, PartialEq)] | 1821 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 2516 | pub struct Exticr(pub u32); | 1822 | pub struct Idmabsizer(pub u32); |
| 2517 | impl Exticr { | 1823 | impl Idmabsizer { |
| 2518 | #[doc = "EXTI x configuration"] | 1824 | #[doc = "Number of transfers per buffer. This 8-bit value shall be multiplied by 8 to get the size of the buffer in 32-bit words and by 32 to get the size of the buffer in bytes. Example: IDMABNDT = 0x01: buffer size = 8 words = 32 bytes. These bits can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] |
| 2519 | pub fn exti(&self, n: usize) -> u8 { | 1825 | pub const fn idmabndt(&self) -> u8 { |
| 2520 | assert!(n < 4usize); | 1826 | let val = (self.0 >> 5usize) & 0xff; |
| 2521 | let offs = 0usize + n * 4usize; | ||
| 2522 | let val = (self.0 >> offs) & 0x0f; | ||
| 2523 | val as u8 | 1827 | val as u8 |
| 2524 | } | 1828 | } |
| 2525 | #[doc = "EXTI x configuration"] | 1829 | #[doc = "Number of transfers per buffer. This 8-bit value shall be multiplied by 8 to get the size of the buffer in 32-bit words and by 32 to get the size of the buffer in bytes. Example: IDMABNDT = 0x01: buffer size = 8 words = 32 bytes. These bits can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] |
| 2526 | pub fn set_exti(&mut self, n: usize, val: u8) { | 1830 | pub fn set_idmabndt(&mut self, val: u8) { |
| 2527 | assert!(n < 4usize); | 1831 | self.0 = (self.0 & !(0xff << 5usize)) | (((val as u32) & 0xff) << 5usize); |
| 2528 | let offs = 0usize + n * 4usize; | ||
| 2529 | self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs); | ||
| 2530 | } | 1832 | } |
| 2531 | } | 1833 | } |
| 2532 | impl Default for Exticr { | 1834 | impl Default for Idmabsizer { |
| 2533 | fn default() -> Exticr { | 1835 | fn default() -> Idmabsizer { |
| 2534 | Exticr(0) | 1836 | Idmabsizer(0) |
| 2535 | } | 1837 | } |
| 2536 | } | 1838 | } |
| 2537 | } | 1839 | } |
| 2538 | } | 1840 | } |
| 2539 | pub mod timer_v1 { | 1841 | pub mod spi_v1 { |
| 2540 | use crate::generic::*; | 1842 | use crate::generic::*; |
| 2541 | #[doc = "Advanced-timers"] | 1843 | #[doc = "Serial peripheral interface"] |
| 2542 | #[derive(Copy, Clone)] | ||
| 2543 | pub struct TimAdv(pub *mut u8); | ||
| 2544 | unsafe impl Send for TimAdv {} | ||
| 2545 | unsafe impl Sync for TimAdv {} | ||
| 2546 | impl TimAdv { | ||
| 2547 | #[doc = "control register 1"] | ||
| 2548 | pub fn cr1(self) -> Reg<regs::Cr1Gp, RW> { | ||
| 2549 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 2550 | } | ||
| 2551 | #[doc = "control register 2"] | ||
| 2552 | pub fn cr2(self) -> Reg<regs::Cr2Adv, RW> { | ||
| 2553 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 2554 | } | ||
| 2555 | #[doc = "slave mode control register"] | ||
| 2556 | pub fn smcr(self) -> Reg<regs::Smcr, RW> { | ||
| 2557 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 2558 | } | ||
| 2559 | #[doc = "DMA/Interrupt enable register"] | ||
| 2560 | pub fn dier(self) -> Reg<regs::DierAdv, RW> { | ||
| 2561 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 2562 | } | ||
| 2563 | #[doc = "status register"] | ||
| 2564 | pub fn sr(self) -> Reg<regs::SrAdv, RW> { | ||
| 2565 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 2566 | } | ||
| 2567 | #[doc = "event generation register"] | ||
| 2568 | pub fn egr(self) -> Reg<regs::EgrAdv, W> { | ||
| 2569 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 2570 | } | ||
| 2571 | #[doc = "capture/compare mode register 1 (input mode)"] | ||
| 2572 | pub fn ccmr_input(self, n: usize) -> Reg<regs::CcmrInput, RW> { | ||
| 2573 | assert!(n < 2usize); | ||
| 2574 | unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) } | ||
| 2575 | } | ||
| 2576 | #[doc = "capture/compare mode register 1 (output mode)"] | ||
| 2577 | pub fn ccmr_output(self, n: usize) -> Reg<regs::CcmrOutput, RW> { | ||
| 2578 | assert!(n < 2usize); | ||
| 2579 | unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) } | ||
| 2580 | } | ||
| 2581 | #[doc = "capture/compare enable register"] | ||
| 2582 | pub fn ccer(self) -> Reg<regs::CcerAdv, RW> { | ||
| 2583 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | ||
| 2584 | } | ||
| 2585 | #[doc = "counter"] | ||
| 2586 | pub fn cnt(self) -> Reg<regs::Cnt16, RW> { | ||
| 2587 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | ||
| 2588 | } | ||
| 2589 | #[doc = "prescaler"] | ||
| 2590 | pub fn psc(self) -> Reg<regs::Psc, RW> { | ||
| 2591 | unsafe { Reg::from_ptr(self.0.add(40usize)) } | ||
| 2592 | } | ||
| 2593 | #[doc = "auto-reload register"] | ||
| 2594 | pub fn arr(self) -> Reg<regs::Arr16, RW> { | ||
| 2595 | unsafe { Reg::from_ptr(self.0.add(44usize)) } | ||
| 2596 | } | ||
| 2597 | #[doc = "repetition counter register"] | ||
| 2598 | pub fn rcr(self) -> Reg<regs::Rcr, RW> { | ||
| 2599 | unsafe { Reg::from_ptr(self.0.add(48usize)) } | ||
| 2600 | } | ||
| 2601 | #[doc = "capture/compare register"] | ||
| 2602 | pub fn ccr(self, n: usize) -> Reg<regs::Ccr16, RW> { | ||
| 2603 | assert!(n < 4usize); | ||
| 2604 | unsafe { Reg::from_ptr(self.0.add(52usize + n * 4usize)) } | ||
| 2605 | } | ||
| 2606 | #[doc = "break and dead-time register"] | ||
| 2607 | pub fn bdtr(self) -> Reg<regs::Bdtr, RW> { | ||
| 2608 | unsafe { Reg::from_ptr(self.0.add(68usize)) } | ||
| 2609 | } | ||
| 2610 | #[doc = "DMA control register"] | ||
| 2611 | pub fn dcr(self) -> Reg<regs::Dcr, RW> { | ||
| 2612 | unsafe { Reg::from_ptr(self.0.add(72usize)) } | ||
| 2613 | } | ||
| 2614 | #[doc = "DMA address for full transfer"] | ||
| 2615 | pub fn dmar(self) -> Reg<regs::Dmar, RW> { | ||
| 2616 | unsafe { Reg::from_ptr(self.0.add(76usize)) } | ||
| 2617 | } | ||
| 2618 | } | ||
| 2619 | #[doc = "General purpose 16-bit timer"] | ||
| 2620 | #[derive(Copy, Clone)] | ||
| 2621 | pub struct TimGp16(pub *mut u8); | ||
| 2622 | unsafe impl Send for TimGp16 {} | ||
| 2623 | unsafe impl Sync for TimGp16 {} | ||
| 2624 | impl TimGp16 { | ||
| 2625 | #[doc = "control register 1"] | ||
| 2626 | pub fn cr1(self) -> Reg<regs::Cr1Gp, RW> { | ||
| 2627 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 2628 | } | ||
| 2629 | #[doc = "control register 2"] | ||
| 2630 | pub fn cr2(self) -> Reg<regs::Cr2Gp, RW> { | ||
| 2631 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 2632 | } | ||
| 2633 | #[doc = "slave mode control register"] | ||
| 2634 | pub fn smcr(self) -> Reg<regs::Smcr, RW> { | ||
| 2635 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 2636 | } | ||
| 2637 | #[doc = "DMA/Interrupt enable register"] | ||
| 2638 | pub fn dier(self) -> Reg<regs::DierGp, RW> { | ||
| 2639 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 2640 | } | ||
| 2641 | #[doc = "status register"] | ||
| 2642 | pub fn sr(self) -> Reg<regs::SrGp, RW> { | ||
| 2643 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 2644 | } | ||
| 2645 | #[doc = "event generation register"] | ||
| 2646 | pub fn egr(self) -> Reg<regs::EgrGp, W> { | ||
| 2647 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 2648 | } | ||
| 2649 | #[doc = "capture/compare mode register 1 (input mode)"] | ||
| 2650 | pub fn ccmr_input(self, n: usize) -> Reg<regs::CcmrInput, RW> { | ||
| 2651 | assert!(n < 2usize); | ||
| 2652 | unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) } | ||
| 2653 | } | ||
| 2654 | #[doc = "capture/compare mode register 1 (output mode)"] | ||
| 2655 | pub fn ccmr_output(self, n: usize) -> Reg<regs::CcmrOutput, RW> { | ||
| 2656 | assert!(n < 2usize); | ||
| 2657 | unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) } | ||
| 2658 | } | ||
| 2659 | #[doc = "capture/compare enable register"] | ||
| 2660 | pub fn ccer(self) -> Reg<regs::CcerGp, RW> { | ||
| 2661 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | ||
| 2662 | } | ||
| 2663 | #[doc = "counter"] | ||
| 2664 | pub fn cnt(self) -> Reg<regs::Cnt16, RW> { | ||
| 2665 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | ||
| 2666 | } | ||
| 2667 | #[doc = "prescaler"] | ||
| 2668 | pub fn psc(self) -> Reg<regs::Psc, RW> { | ||
| 2669 | unsafe { Reg::from_ptr(self.0.add(40usize)) } | ||
| 2670 | } | ||
| 2671 | #[doc = "auto-reload register"] | ||
| 2672 | pub fn arr(self) -> Reg<regs::Arr16, RW> { | ||
| 2673 | unsafe { Reg::from_ptr(self.0.add(44usize)) } | ||
| 2674 | } | ||
| 2675 | #[doc = "capture/compare register"] | ||
| 2676 | pub fn ccr(self, n: usize) -> Reg<regs::Ccr16, RW> { | ||
| 2677 | assert!(n < 4usize); | ||
| 2678 | unsafe { Reg::from_ptr(self.0.add(52usize + n * 4usize)) } | ||
| 2679 | } | ||
| 2680 | #[doc = "DMA control register"] | ||
| 2681 | pub fn dcr(self) -> Reg<regs::Dcr, RW> { | ||
| 2682 | unsafe { Reg::from_ptr(self.0.add(72usize)) } | ||
| 2683 | } | ||
| 2684 | #[doc = "DMA address for full transfer"] | ||
| 2685 | pub fn dmar(self) -> Reg<regs::Dmar, RW> { | ||
| 2686 | unsafe { Reg::from_ptr(self.0.add(76usize)) } | ||
| 2687 | } | ||
| 2688 | } | ||
| 2689 | #[doc = "Basic timer"] | ||
| 2690 | #[derive(Copy, Clone)] | 1844 | #[derive(Copy, Clone)] |
| 2691 | pub struct TimBasic(pub *mut u8); | 1845 | pub struct Spi(pub *mut u8); |
| 2692 | unsafe impl Send for TimBasic {} | 1846 | unsafe impl Send for Spi {} |
| 2693 | unsafe impl Sync for TimBasic {} | 1847 | unsafe impl Sync for Spi {} |
| 2694 | impl TimBasic { | 1848 | impl Spi { |
| 2695 | #[doc = "control register 1"] | 1849 | #[doc = "control register 1"] |
| 2696 | pub fn cr1(self) -> Reg<regs::Cr1Basic, RW> { | 1850 | pub fn cr1(self) -> Reg<regs::Cr1, RW> { |
| 2697 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | 1851 | unsafe { Reg::from_ptr(self.0.add(0usize)) } |
| 2698 | } | 1852 | } |
| 2699 | #[doc = "control register 2"] | 1853 | #[doc = "control register 2"] |
| 2700 | pub fn cr2(self) -> Reg<regs::Cr2Basic, RW> { | 1854 | pub fn cr2(self) -> Reg<regs::Cr2, RW> { |
| 2701 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | 1855 | unsafe { Reg::from_ptr(self.0.add(4usize)) } |
| 2702 | } | 1856 | } |
| 2703 | #[doc = "DMA/Interrupt enable register"] | ||
| 2704 | pub fn dier(self) -> Reg<regs::DierBasic, RW> { | ||
| 2705 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 2706 | } | ||
| 2707 | #[doc = "status register"] | 1857 | #[doc = "status register"] |
| 2708 | pub fn sr(self) -> Reg<regs::SrBasic, RW> { | 1858 | pub fn sr(self) -> Reg<regs::Sr, RW> { |
| 2709 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 2710 | } | ||
| 2711 | #[doc = "event generation register"] | ||
| 2712 | pub fn egr(self) -> Reg<regs::EgrBasic, W> { | ||
| 2713 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 2714 | } | ||
| 2715 | #[doc = "counter"] | ||
| 2716 | pub fn cnt(self) -> Reg<regs::Cnt16, RW> { | ||
| 2717 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | ||
| 2718 | } | ||
| 2719 | #[doc = "prescaler"] | ||
| 2720 | pub fn psc(self) -> Reg<regs::Psc, RW> { | ||
| 2721 | unsafe { Reg::from_ptr(self.0.add(40usize)) } | ||
| 2722 | } | ||
| 2723 | #[doc = "auto-reload register"] | ||
| 2724 | pub fn arr(self) -> Reg<regs::Arr16, RW> { | ||
| 2725 | unsafe { Reg::from_ptr(self.0.add(44usize)) } | ||
| 2726 | } | ||
| 2727 | } | ||
| 2728 | #[doc = "General purpose 32-bit timer"] | ||
| 2729 | #[derive(Copy, Clone)] | ||
| 2730 | pub struct TimGp32(pub *mut u8); | ||
| 2731 | unsafe impl Send for TimGp32 {} | ||
| 2732 | unsafe impl Sync for TimGp32 {} | ||
| 2733 | impl TimGp32 { | ||
| 2734 | #[doc = "control register 1"] | ||
| 2735 | pub fn cr1(self) -> Reg<regs::Cr1Gp, RW> { | ||
| 2736 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 2737 | } | ||
| 2738 | #[doc = "control register 2"] | ||
| 2739 | pub fn cr2(self) -> Reg<regs::Cr2Gp, RW> { | ||
| 2740 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 2741 | } | ||
| 2742 | #[doc = "slave mode control register"] | ||
| 2743 | pub fn smcr(self) -> Reg<regs::Smcr, RW> { | ||
| 2744 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | 1859 | unsafe { Reg::from_ptr(self.0.add(8usize)) } |
| 2745 | } | 1860 | } |
| 2746 | #[doc = "DMA/Interrupt enable register"] | 1861 | #[doc = "data register"] |
| 2747 | pub fn dier(self) -> Reg<regs::DierGp, RW> { | 1862 | pub fn dr(self) -> Reg<regs::Dr, RW> { |
| 2748 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | 1863 | unsafe { Reg::from_ptr(self.0.add(12usize)) } |
| 2749 | } | 1864 | } |
| 2750 | #[doc = "status register"] | 1865 | #[doc = "CRC polynomial register"] |
| 2751 | pub fn sr(self) -> Reg<regs::SrGp, RW> { | 1866 | pub fn crcpr(self) -> Reg<regs::Crcpr, RW> { |
| 2752 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | 1867 | unsafe { Reg::from_ptr(self.0.add(16usize)) } |
| 2753 | } | 1868 | } |
| 2754 | #[doc = "event generation register"] | 1869 | #[doc = "RX CRC register"] |
| 2755 | pub fn egr(self) -> Reg<regs::EgrGp, W> { | 1870 | pub fn rxcrcr(self) -> Reg<regs::Rxcrcr, R> { |
| 2756 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | 1871 | unsafe { Reg::from_ptr(self.0.add(20usize)) } |
| 2757 | } | 1872 | } |
| 2758 | #[doc = "capture/compare mode register 1 (input mode)"] | 1873 | #[doc = "TX CRC register"] |
| 2759 | pub fn ccmr_input(self, n: usize) -> Reg<regs::CcmrInput, RW> { | 1874 | pub fn txcrcr(self) -> Reg<regs::Txcrcr, R> { |
| 2760 | assert!(n < 2usize); | 1875 | unsafe { Reg::from_ptr(self.0.add(24usize)) } |
| 2761 | unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) } | ||
| 2762 | } | ||
| 2763 | #[doc = "capture/compare mode register 1 (output mode)"] | ||
| 2764 | pub fn ccmr_output(self, n: usize) -> Reg<regs::CcmrOutput, RW> { | ||
| 2765 | assert!(n < 2usize); | ||
| 2766 | unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) } | ||
| 2767 | } | ||
| 2768 | #[doc = "capture/compare enable register"] | ||
| 2769 | pub fn ccer(self) -> Reg<regs::CcerGp, RW> { | ||
| 2770 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | ||
| 2771 | } | ||
| 2772 | #[doc = "counter"] | ||
| 2773 | pub fn cnt(self) -> Reg<regs::Cnt32, RW> { | ||
| 2774 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | ||
| 2775 | } | ||
| 2776 | #[doc = "prescaler"] | ||
| 2777 | pub fn psc(self) -> Reg<regs::Psc, RW> { | ||
| 2778 | unsafe { Reg::from_ptr(self.0.add(40usize)) } | ||
| 2779 | } | ||
| 2780 | #[doc = "auto-reload register"] | ||
| 2781 | pub fn arr(self) -> Reg<regs::Arr32, RW> { | ||
| 2782 | unsafe { Reg::from_ptr(self.0.add(44usize)) } | ||
| 2783 | } | ||
| 2784 | #[doc = "capture/compare register"] | ||
| 2785 | pub fn ccr(self, n: usize) -> Reg<regs::Ccr32, RW> { | ||
| 2786 | assert!(n < 4usize); | ||
| 2787 | unsafe { Reg::from_ptr(self.0.add(52usize + n * 4usize)) } | ||
| 2788 | } | ||
| 2789 | #[doc = "DMA control register"] | ||
| 2790 | pub fn dcr(self) -> Reg<regs::Dcr, RW> { | ||
| 2791 | unsafe { Reg::from_ptr(self.0.add(72usize)) } | ||
| 2792 | } | ||
| 2793 | #[doc = "DMA address for full transfer"] | ||
| 2794 | pub fn dmar(self) -> Reg<regs::Dmar, RW> { | ||
| 2795 | unsafe { Reg::from_ptr(self.0.add(76usize)) } | ||
| 2796 | } | 1876 | } |
| 2797 | } | 1877 | } |
| 2798 | pub mod vals { | 1878 | pub mod vals { |
| 2799 | use crate::generic::*; | 1879 | use crate::generic::*; |
| 2800 | #[repr(transparent)] | 1880 | #[repr(transparent)] |
| 2801 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 1881 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 2802 | pub struct Ocpe(pub u8); | 1882 | pub struct Bidimode(pub u8); |
| 2803 | impl Ocpe { | 1883 | impl Bidimode { |
| 2804 | #[doc = "Preload register on CCR2 disabled. New values written to CCR2 are taken into account immediately"] | 1884 | #[doc = "2-line unidirectional data mode selected"] |
| 2805 | pub const DISABLED: Self = Self(0); | 1885 | pub const UNIDIRECTIONAL: Self = Self(0); |
| 2806 | #[doc = "Preload register on CCR2 enabled. Preload value is loaded into active register on each update event"] | 1886 | #[doc = "1-line bidirectional data mode selected"] |
| 2807 | pub const ENABLED: Self = Self(0x01); | 1887 | pub const BIDIRECTIONAL: Self = Self(0x01); |
| 2808 | } | ||
| 2809 | #[repr(transparent)] | ||
| 2810 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2811 | pub struct Msm(pub u8); | ||
| 2812 | impl Msm { | ||
| 2813 | #[doc = "No action"] | ||
| 2814 | pub const NOSYNC: Self = Self(0); | ||
| 2815 | #[doc = "The effect of an event on the trigger input (TRGI) is delayed to allow a perfect synchronization between the current timer and its slaves (through TRGO). It is useful if we want to synchronize several timers on a single external event."] | ||
| 2816 | pub const SYNC: Self = Self(0x01); | ||
| 2817 | } | ||
| 2818 | #[repr(transparent)] | ||
| 2819 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2820 | pub struct Ocm(pub u8); | ||
| 2821 | impl Ocm { | ||
| 2822 | #[doc = "The comparison between the output compare register TIMx_CCRy and the counter TIMx_CNT has no effect on the outputs"] | ||
| 2823 | pub const FROZEN: Self = Self(0); | ||
| 2824 | #[doc = "Set channel to active level on match. OCyREF signal is forced high when the counter matches the capture/compare register"] | ||
| 2825 | pub const ACTIVEONMATCH: Self = Self(0x01); | ||
| 2826 | #[doc = "Set channel to inactive level on match. OCyREF signal is forced low when the counter matches the capture/compare register"] | ||
| 2827 | pub const INACTIVEONMATCH: Self = Self(0x02); | ||
| 2828 | #[doc = "OCyREF toggles when TIMx_CNT=TIMx_CCRy"] | ||
| 2829 | pub const TOGGLE: Self = Self(0x03); | ||
| 2830 | #[doc = "OCyREF is forced low"] | ||
| 2831 | pub const FORCEINACTIVE: Self = Self(0x04); | ||
| 2832 | #[doc = "OCyREF is forced high"] | ||
| 2833 | pub const FORCEACTIVE: Self = Self(0x05); | ||
| 2834 | #[doc = "In upcounting, channel is active as long as TIMx_CNT<TIMx_CCRy else inactive. In downcounting, channel is inactive as long as TIMx_CNT>TIMx_CCRy else active"] | ||
| 2835 | pub const PWMMODE1: Self = Self(0x06); | ||
| 2836 | #[doc = "Inversely to PwmMode1"] | ||
| 2837 | pub const PWMMODE2: Self = Self(0x07); | ||
| 2838 | } | ||
| 2839 | #[repr(transparent)] | ||
| 2840 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2841 | pub struct Mms(pub u8); | ||
| 2842 | impl Mms { | ||
| 2843 | #[doc = "The UG bit from the TIMx_EGR register is used as trigger output"] | ||
| 2844 | pub const RESET: Self = Self(0); | ||
| 2845 | #[doc = "The counter enable signal, CNT_EN, is used as trigger output"] | ||
| 2846 | pub const ENABLE: Self = Self(0x01); | ||
| 2847 | #[doc = "The update event is selected as trigger output"] | ||
| 2848 | pub const UPDATE: Self = Self(0x02); | ||
| 2849 | #[doc = "The trigger output send a positive pulse when the CC1IF flag it to be set, as soon as a capture or a compare match occurred"] | ||
| 2850 | pub const COMPAREPULSE: Self = Self(0x03); | ||
| 2851 | #[doc = "OC1REF signal is used as trigger output"] | ||
| 2852 | pub const COMPAREOC1: Self = Self(0x04); | ||
| 2853 | #[doc = "OC2REF signal is used as trigger output"] | ||
| 2854 | pub const COMPAREOC2: Self = Self(0x05); | ||
| 2855 | #[doc = "OC3REF signal is used as trigger output"] | ||
| 2856 | pub const COMPAREOC3: Self = Self(0x06); | ||
| 2857 | #[doc = "OC4REF signal is used as trigger output"] | ||
| 2858 | pub const COMPAREOC4: Self = Self(0x07); | ||
| 2859 | } | ||
| 2860 | #[repr(transparent)] | ||
| 2861 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2862 | pub struct Arpe(pub u8); | ||
| 2863 | impl Arpe { | ||
| 2864 | #[doc = "TIMx_APRR register is not buffered"] | ||
| 2865 | pub const DISABLED: Self = Self(0); | ||
| 2866 | #[doc = "TIMx_APRR register is buffered"] | ||
| 2867 | pub const ENABLED: Self = Self(0x01); | ||
| 2868 | } | ||
| 2869 | #[repr(transparent)] | ||
| 2870 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2871 | pub struct CcmrOutputCcs(pub u8); | ||
| 2872 | impl CcmrOutputCcs { | ||
| 2873 | #[doc = "CCx channel is configured as output"] | ||
| 2874 | pub const OUTPUT: Self = Self(0); | ||
| 2875 | } | ||
| 2876 | #[repr(transparent)] | ||
| 2877 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2878 | pub struct Ckd(pub u8); | ||
| 2879 | impl Ckd { | ||
| 2880 | #[doc = "t_DTS = t_CK_INT"] | ||
| 2881 | pub const DIV1: Self = Self(0); | ||
| 2882 | #[doc = "t_DTS = 2 × t_CK_INT"] | ||
| 2883 | pub const DIV2: Self = Self(0x01); | ||
| 2884 | #[doc = "t_DTS = 4 × t_CK_INT"] | ||
| 2885 | pub const DIV4: Self = Self(0x02); | ||
| 2886 | } | ||
| 2887 | #[repr(transparent)] | ||
| 2888 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2889 | pub struct Urs(pub u8); | ||
| 2890 | impl Urs { | ||
| 2891 | #[doc = "Any of counter overflow/underflow, setting UG, or update through slave mode, generates an update interrupt or DMA request"] | ||
| 2892 | pub const ANYEVENT: Self = Self(0); | ||
| 2893 | #[doc = "Only counter overflow/underflow generates an update interrupt or DMA request"] | ||
| 2894 | pub const COUNTERONLY: Self = Self(0x01); | ||
| 2895 | } | ||
| 2896 | #[repr(transparent)] | ||
| 2897 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2898 | pub struct Etps(pub u8); | ||
| 2899 | impl Etps { | ||
| 2900 | #[doc = "Prescaler OFF"] | ||
| 2901 | pub const DIV1: Self = Self(0); | ||
| 2902 | #[doc = "ETRP frequency divided by 2"] | ||
| 2903 | pub const DIV2: Self = Self(0x01); | ||
| 2904 | #[doc = "ETRP frequency divided by 4"] | ||
| 2905 | pub const DIV4: Self = Self(0x02); | ||
| 2906 | #[doc = "ETRP frequency divided by 8"] | ||
| 2907 | pub const DIV8: Self = Self(0x03); | ||
| 2908 | } | ||
| 2909 | #[repr(transparent)] | ||
| 2910 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2911 | pub struct Ece(pub u8); | ||
| 2912 | impl Ece { | ||
| 2913 | #[doc = "External clock mode 2 disabled"] | ||
| 2914 | pub const DISABLED: Self = Self(0); | ||
| 2915 | #[doc = "External clock mode 2 enabled. The counter is clocked by any active edge on the ETRF signal."] | ||
| 2916 | pub const ENABLED: Self = Self(0x01); | ||
| 2917 | } | ||
| 2918 | #[repr(transparent)] | ||
| 2919 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2920 | pub struct Dir(pub u8); | ||
| 2921 | impl Dir { | ||
| 2922 | #[doc = "Counter used as upcounter"] | ||
| 2923 | pub const UP: Self = Self(0); | ||
| 2924 | #[doc = "Counter used as downcounter"] | ||
| 2925 | pub const DOWN: Self = Self(0x01); | ||
| 2926 | } | 1888 | } |
| 2927 | #[repr(transparent)] | 1889 | #[repr(transparent)] |
| 2928 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 1890 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 2929 | pub struct Sms(pub u8); | 1891 | pub struct Cpha(pub u8); |
| 2930 | impl Sms { | 1892 | impl Cpha { |
| 2931 | #[doc = "Slave mode disabled - if CEN = ‘1 then the prescaler is clocked directly by the internal clock."] | 1893 | #[doc = "The first clock transition is the first data capture edge"] |
| 2932 | pub const DISABLED: Self = Self(0); | 1894 | pub const FIRSTEDGE: Self = Self(0); |
| 2933 | #[doc = "Encoder mode 1 - Counter counts up/down on TI2FP1 edge depending on TI1FP2 level."] | 1895 | #[doc = "The second clock transition is the first data capture edge"] |
| 2934 | pub const ENCODER_MODE_1: Self = Self(0x01); | 1896 | pub const SECONDEDGE: Self = Self(0x01); |
| 2935 | #[doc = "Encoder mode 2 - Counter counts up/down on TI1FP2 edge depending on TI2FP1 level."] | ||
| 2936 | pub const ENCODER_MODE_2: Self = Self(0x02); | ||
| 2937 | #[doc = "Encoder mode 3 - Counter counts up/down on both TI1FP1 and TI2FP2 edges depending on the level of the other input."] | ||
| 2938 | pub const ENCODER_MODE_3: Self = Self(0x03); | ||
| 2939 | #[doc = "Reset Mode - Rising edge of the selected trigger input (TRGI) reinitializes the counter and generates an update of the registers."] | ||
| 2940 | pub const RESET_MODE: Self = Self(0x04); | ||
| 2941 | #[doc = "Gated Mode - The counter clock is enabled when the trigger input (TRGI) is high. The counter stops (but is not reset) as soon as the trigger becomes low. Both start and stop of the counter are controlled."] | ||
| 2942 | pub const GATED_MODE: Self = Self(0x05); | ||
| 2943 | #[doc = "Trigger Mode - The counter starts at a rising edge of the trigger TRGI (but it is not reset). Only the start of the counter is controlled."] | ||
| 2944 | pub const TRIGGER_MODE: Self = Self(0x06); | ||
| 2945 | #[doc = "External Clock Mode 1 - Rising edges of the selected trigger (TRGI) clock the counter."] | ||
| 2946 | pub const EXT_CLOCK_MODE: Self = Self(0x07); | ||
| 2947 | } | 1897 | } |
| 2948 | #[repr(transparent)] | 1898 | #[repr(transparent)] |
| 2949 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 1899 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 2950 | pub struct Ossi(pub u8); | 1900 | pub struct Frf(pub u8); |
| 2951 | impl Ossi { | 1901 | impl Frf { |
| 2952 | #[doc = "When inactive, OC/OCN outputs are disabled"] | 1902 | #[doc = "SPI Motorola mode"] |
| 2953 | pub const DISABLED: Self = Self(0); | 1903 | pub const MOTOROLA: Self = Self(0); |
| 2954 | #[doc = "When inactive, OC/OCN outputs are forced to idle level"] | 1904 | #[doc = "SPI TI mode"] |
| 2955 | pub const IDLELEVEL: Self = Self(0x01); | 1905 | pub const TI: Self = Self(0x01); |
| 2956 | } | 1906 | } |
| 2957 | #[repr(transparent)] | 1907 | #[repr(transparent)] |
| 2958 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 1908 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 2959 | pub struct Etp(pub u8); | 1909 | pub struct Iscfg(pub u8); |
| 2960 | impl Etp { | 1910 | impl Iscfg { |
| 2961 | #[doc = "ETR is noninverted, active at high level or rising edge"] | 1911 | #[doc = "Slave - transmit"] |
| 2962 | pub const NOTINVERTED: Self = Self(0); | 1912 | pub const SLAVETX: Self = Self(0); |
| 2963 | #[doc = "ETR is inverted, active at low level or falling edge"] | 1913 | #[doc = "Slave - receive"] |
| 2964 | pub const INVERTED: Self = Self(0x01); | 1914 | pub const SLAVERX: Self = Self(0x01); |
| 1915 | #[doc = "Master - transmit"] | ||
| 1916 | pub const MASTERTX: Self = Self(0x02); | ||
| 1917 | #[doc = "Master - receive"] | ||
| 1918 | pub const MASTERRX: Self = Self(0x03); | ||
| 2965 | } | 1919 | } |
| 2966 | #[repr(transparent)] | 1920 | #[repr(transparent)] |
| 2967 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 1921 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 2968 | pub struct Ts(pub u8); | 1922 | pub struct Rxonly(pub u8); |
| 2969 | impl Ts { | 1923 | impl Rxonly { |
| 2970 | #[doc = "Internal Trigger 0 (ITR0)"] | 1924 | #[doc = "Full duplex (Transmit and receive)"] |
| 2971 | pub const ITR0: Self = Self(0); | 1925 | pub const FULLDUPLEX: Self = Self(0); |
| 2972 | #[doc = "Internal Trigger 1 (ITR1)"] | 1926 | #[doc = "Output disabled (Receive-only mode)"] |
| 2973 | pub const ITR1: Self = Self(0x01); | 1927 | pub const OUTPUTDISABLED: Self = Self(0x01); |
| 2974 | #[doc = "Internal Trigger 2 (ITR2)"] | ||
| 2975 | pub const ITR2: Self = Self(0x02); | ||
| 2976 | #[doc = "TI1 Edge Detector (TI1F_ED)"] | ||
| 2977 | pub const TI1F_ED: Self = Self(0x04); | ||
| 2978 | #[doc = "Filtered Timer Input 1 (TI1FP1)"] | ||
| 2979 | pub const TI1FP1: Self = Self(0x05); | ||
| 2980 | #[doc = "Filtered Timer Input 2 (TI2FP2)"] | ||
| 2981 | pub const TI2FP2: Self = Self(0x06); | ||
| 2982 | #[doc = "External Trigger input (ETRF)"] | ||
| 2983 | pub const ETRF: Self = Self(0x07); | ||
| 2984 | } | 1928 | } |
| 2985 | #[repr(transparent)] | 1929 | #[repr(transparent)] |
| 2986 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 1930 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 2987 | pub struct Ccds(pub u8); | 1931 | pub struct Bidioe(pub u8); |
| 2988 | impl Ccds { | 1932 | impl Bidioe { |
| 2989 | #[doc = "CCx DMA request sent when CCx event occurs"] | 1933 | #[doc = "Output disabled (receive-only mode)"] |
| 2990 | pub const ONCOMPARE: Self = Self(0); | 1934 | pub const OUTPUTDISABLED: Self = Self(0); |
| 2991 | #[doc = "CCx DMA request sent when update event occurs"] | 1935 | #[doc = "Output enabled (transmit-only mode)"] |
| 2992 | pub const ONUPDATE: Self = Self(0x01); | 1936 | pub const OUTPUTENABLED: Self = Self(0x01); |
| 2993 | } | 1937 | } |
| 2994 | #[repr(transparent)] | 1938 | #[repr(transparent)] |
| 2995 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 1939 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 2996 | pub struct Cms(pub u8); | 1940 | pub struct Br(pub u8); |
| 2997 | impl Cms { | 1941 | impl Br { |
| 2998 | #[doc = "The counter counts up or down depending on the direction bit"] | 1942 | #[doc = "f_PCLK / 2"] |
| 2999 | pub const EDGEALIGNED: Self = Self(0); | 1943 | pub const DIV2: Self = Self(0); |
| 3000 | #[doc = "The counter counts up and down alternatively. Output compare interrupt flags are set only when the counter is counting down."] | 1944 | #[doc = "f_PCLK / 4"] |
| 3001 | pub const CENTERALIGNED1: Self = Self(0x01); | 1945 | pub const DIV4: Self = Self(0x01); |
| 3002 | #[doc = "The counter counts up and down alternatively. Output compare interrupt flags are set only when the counter is counting up."] | 1946 | #[doc = "f_PCLK / 8"] |
| 3003 | pub const CENTERALIGNED2: Self = Self(0x02); | 1947 | pub const DIV8: Self = Self(0x02); |
| 3004 | #[doc = "The counter counts up and down alternatively. Output compare interrupt flags are set both when the counter is counting up or down."] | 1948 | #[doc = "f_PCLK / 16"] |
| 3005 | pub const CENTERALIGNED3: Self = Self(0x03); | 1949 | pub const DIV16: Self = Self(0x03); |
| 1950 | #[doc = "f_PCLK / 32"] | ||
| 1951 | pub const DIV32: Self = Self(0x04); | ||
| 1952 | #[doc = "f_PCLK / 64"] | ||
| 1953 | pub const DIV64: Self = Self(0x05); | ||
| 1954 | #[doc = "f_PCLK / 128"] | ||
| 1955 | pub const DIV128: Self = Self(0x06); | ||
| 1956 | #[doc = "f_PCLK / 256"] | ||
| 1957 | pub const DIV256: Self = Self(0x07); | ||
| 3006 | } | 1958 | } |
| 3007 | #[repr(transparent)] | 1959 | #[repr(transparent)] |
| 3008 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 1960 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 3009 | pub struct Tis(pub u8); | 1961 | pub struct Cpol(pub u8); |
| 3010 | impl Tis { | 1962 | impl Cpol { |
| 3011 | #[doc = "The TIMx_CH1 pin is connected to TI1 input"] | 1963 | #[doc = "CK to 0 when idle"] |
| 3012 | pub const NORMAL: Self = Self(0); | 1964 | pub const IDLELOW: Self = Self(0); |
| 3013 | #[doc = "The TIMx_CH1, CH2, CH3 pins are connected to TI1 input"] | 1965 | #[doc = "CK to 1 when idle"] |
| 3014 | pub const XOR: Self = Self(0x01); | 1966 | pub const IDLEHIGH: Self = Self(0x01); |
| 3015 | } | 1967 | } |
| 3016 | #[repr(transparent)] | 1968 | #[repr(transparent)] |
| 3017 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 1969 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 3018 | pub struct CcmrInputCcs(pub u8); | 1970 | pub struct Mstr(pub u8); |
| 3019 | impl CcmrInputCcs { | 1971 | impl Mstr { |
| 3020 | #[doc = "CCx channel is configured as input, normal mapping: ICx mapped to TIx"] | 1972 | #[doc = "Slave configuration"] |
| 3021 | pub const TI4: Self = Self(0x01); | 1973 | pub const SLAVE: Self = Self(0); |
| 3022 | #[doc = "CCx channel is configured as input, alternate mapping (switches 1 with 2, 3 with 4)"] | 1974 | #[doc = "Master configuration"] |
| 3023 | pub const TI3: Self = Self(0x02); | 1975 | pub const MASTER: Self = Self(0x01); |
| 3024 | #[doc = "CCx channel is configured as input, ICx is mapped on TRC"] | ||
| 3025 | pub const TRC: Self = Self(0x03); | ||
| 3026 | } | 1976 | } |
| 3027 | #[repr(transparent)] | 1977 | #[repr(transparent)] |
| 3028 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 1978 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 3029 | pub struct Etf(pub u8); | 1979 | pub struct Frer(pub u8); |
| 3030 | impl Etf { | 1980 | impl Frer { |
| 3031 | #[doc = "No filter, sampling is done at fDTS"] | 1981 | #[doc = "No frame format error"] |
| 3032 | pub const NOFILTER: Self = Self(0); | 1982 | pub const NOERROR: Self = Self(0); |
| 3033 | #[doc = "fSAMPLING=fCK_INT, N=2"] | 1983 | #[doc = "A frame format error occurred"] |
| 3034 | pub const FCK_INT_N2: Self = Self(0x01); | 1984 | pub const ERROR: Self = Self(0x01); |
| 3035 | #[doc = "fSAMPLING=fCK_INT, N=4"] | ||
| 3036 | pub const FCK_INT_N4: Self = Self(0x02); | ||
| 3037 | #[doc = "fSAMPLING=fCK_INT, N=8"] | ||
| 3038 | pub const FCK_INT_N8: Self = Self(0x03); | ||
| 3039 | #[doc = "fSAMPLING=fDTS/2, N=6"] | ||
| 3040 | pub const FDTS_DIV2_N6: Self = Self(0x04); | ||
| 3041 | #[doc = "fSAMPLING=fDTS/2, N=8"] | ||
| 3042 | pub const FDTS_DIV2_N8: Self = Self(0x05); | ||
| 3043 | #[doc = "fSAMPLING=fDTS/4, N=6"] | ||
| 3044 | pub const FDTS_DIV4_N6: Self = Self(0x06); | ||
| 3045 | #[doc = "fSAMPLING=fDTS/4, N=8"] | ||
| 3046 | pub const FDTS_DIV4_N8: Self = Self(0x07); | ||
| 3047 | #[doc = "fSAMPLING=fDTS/8, N=6"] | ||
| 3048 | pub const FDTS_DIV8_N6: Self = Self(0x08); | ||
| 3049 | #[doc = "fSAMPLING=fDTS/8, N=8"] | ||
| 3050 | pub const FDTS_DIV8_N8: Self = Self(0x09); | ||
| 3051 | #[doc = "fSAMPLING=fDTS/16, N=5"] | ||
| 3052 | pub const FDTS_DIV16_N5: Self = Self(0x0a); | ||
| 3053 | #[doc = "fSAMPLING=fDTS/16, N=6"] | ||
| 3054 | pub const FDTS_DIV16_N6: Self = Self(0x0b); | ||
| 3055 | #[doc = "fSAMPLING=fDTS/16, N=8"] | ||
| 3056 | pub const FDTS_DIV16_N8: Self = Self(0x0c); | ||
| 3057 | #[doc = "fSAMPLING=fDTS/32, N=5"] | ||
| 3058 | pub const FDTS_DIV32_N5: Self = Self(0x0d); | ||
| 3059 | #[doc = "fSAMPLING=fDTS/32, N=6"] | ||
| 3060 | pub const FDTS_DIV32_N6: Self = Self(0x0e); | ||
| 3061 | #[doc = "fSAMPLING=fDTS/32, N=8"] | ||
| 3062 | pub const FDTS_DIV32_N8: Self = Self(0x0f); | ||
| 3063 | } | 1985 | } |
| 3064 | #[repr(transparent)] | 1986 | #[repr(transparent)] |
| 3065 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 1987 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 3066 | pub struct Ossr(pub u8); | 1988 | pub struct Lsbfirst(pub u8); |
| 3067 | impl Ossr { | 1989 | impl Lsbfirst { |
| 3068 | #[doc = "When inactive, OC/OCN outputs are disabled"] | 1990 | #[doc = "Data is transmitted/received with the MSB first"] |
| 3069 | pub const DISABLED: Self = Self(0); | 1991 | pub const MSBFIRST: Self = Self(0); |
| 3070 | #[doc = "When inactive, OC/OCN outputs are enabled with their inactive level"] | 1992 | #[doc = "Data is transmitted/received with the LSB first"] |
| 3071 | pub const IDLELEVEL: Self = Self(0x01); | 1993 | pub const LSBFIRST: Self = Self(0x01); |
| 3072 | } | 1994 | } |
| 3073 | #[repr(transparent)] | 1995 | #[repr(transparent)] |
| 3074 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 1996 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 3075 | pub struct Icf(pub u8); | 1997 | pub struct Dff(pub u8); |
| 3076 | impl Icf { | 1998 | impl Dff { |
| 3077 | #[doc = "No filter, sampling is done at fDTS"] | 1999 | #[doc = "8-bit data frame format is selected for transmission/reception"] |
| 3078 | pub const NOFILTER: Self = Self(0); | 2000 | pub const EIGHTBIT: Self = Self(0); |
| 3079 | #[doc = "fSAMPLING=fCK_INT, N=2"] | 2001 | #[doc = "16-bit data frame format is selected for transmission/reception"] |
| 3080 | pub const FCK_INT_N2: Self = Self(0x01); | 2002 | pub const SIXTEENBIT: Self = Self(0x01); |
| 3081 | #[doc = "fSAMPLING=fCK_INT, N=4"] | ||
| 3082 | pub const FCK_INT_N4: Self = Self(0x02); | ||
| 3083 | #[doc = "fSAMPLING=fCK_INT, N=8"] | ||
| 3084 | pub const FCK_INT_N8: Self = Self(0x03); | ||
| 3085 | #[doc = "fSAMPLING=fDTS/2, N=6"] | ||
| 3086 | pub const FDTS_DIV2_N6: Self = Self(0x04); | ||
| 3087 | #[doc = "fSAMPLING=fDTS/2, N=8"] | ||
| 3088 | pub const FDTS_DIV2_N8: Self = Self(0x05); | ||
| 3089 | #[doc = "fSAMPLING=fDTS/4, N=6"] | ||
| 3090 | pub const FDTS_DIV4_N6: Self = Self(0x06); | ||
| 3091 | #[doc = "fSAMPLING=fDTS/4, N=8"] | ||
| 3092 | pub const FDTS_DIV4_N8: Self = Self(0x07); | ||
| 3093 | #[doc = "fSAMPLING=fDTS/8, N=6"] | ||
| 3094 | pub const FDTS_DIV8_N6: Self = Self(0x08); | ||
| 3095 | #[doc = "fSAMPLING=fDTS/8, N=8"] | ||
| 3096 | pub const FDTS_DIV8_N8: Self = Self(0x09); | ||
| 3097 | #[doc = "fSAMPLING=fDTS/16, N=5"] | ||
| 3098 | pub const FDTS_DIV16_N5: Self = Self(0x0a); | ||
| 3099 | #[doc = "fSAMPLING=fDTS/16, N=6"] | ||
| 3100 | pub const FDTS_DIV16_N6: Self = Self(0x0b); | ||
| 3101 | #[doc = "fSAMPLING=fDTS/16, N=8"] | ||
| 3102 | pub const FDTS_DIV16_N8: Self = Self(0x0c); | ||
| 3103 | #[doc = "fSAMPLING=fDTS/32, N=5"] | ||
| 3104 | pub const FDTS_DIV32_N5: Self = Self(0x0d); | ||
| 3105 | #[doc = "fSAMPLING=fDTS/32, N=6"] | ||
| 3106 | pub const FDTS_DIV32_N6: Self = Self(0x0e); | ||
| 3107 | #[doc = "fSAMPLING=fDTS/32, N=8"] | ||
| 3108 | pub const FDTS_DIV32_N8: Self = Self(0x0f); | ||
| 3109 | } | 2003 | } |
| 3110 | #[repr(transparent)] | 2004 | #[repr(transparent)] |
| 3111 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 2005 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 3112 | pub struct Opm(pub u8); | 2006 | pub struct Crcnext(pub u8); |
| 3113 | impl Opm { | 2007 | impl Crcnext { |
| 3114 | #[doc = "Counter is not stopped at update event"] | 2008 | #[doc = "Next transmit value is from Tx buffer"] |
| 3115 | pub const DISABLED: Self = Self(0); | 2009 | pub const TXBUFFER: Self = Self(0); |
| 3116 | #[doc = "Counter stops counting at the next update event (clearing the CEN bit)"] | 2010 | #[doc = "Next transmit value is from Tx CRC register"] |
| 3117 | pub const ENABLED: Self = Self(0x01); | 2011 | pub const CRC: Self = Self(0x01); |
| 3118 | } | 2012 | } |
| 3119 | } | 2013 | } |
| 3120 | pub mod regs { | 2014 | pub mod regs { |
| 3121 | use crate::generic::*; | 2015 | use crate::generic::*; |
| 3122 | #[doc = "slave mode control register"] | 2016 | #[doc = "control register 2"] |
| 3123 | #[repr(transparent)] | ||
| 3124 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3125 | pub struct Smcr(pub u32); | ||
| 3126 | impl Smcr { | ||
| 3127 | #[doc = "Slave mode selection"] | ||
| 3128 | pub const fn sms(&self) -> super::vals::Sms { | ||
| 3129 | let val = (self.0 >> 0usize) & 0x07; | ||
| 3130 | super::vals::Sms(val as u8) | ||
| 3131 | } | ||
| 3132 | #[doc = "Slave mode selection"] | ||
| 3133 | pub fn set_sms(&mut self, val: super::vals::Sms) { | ||
| 3134 | self.0 = (self.0 & !(0x07 << 0usize)) | (((val.0 as u32) & 0x07) << 0usize); | ||
| 3135 | } | ||
| 3136 | #[doc = "Trigger selection"] | ||
| 3137 | pub const fn ts(&self) -> super::vals::Ts { | ||
| 3138 | let val = (self.0 >> 4usize) & 0x07; | ||
| 3139 | super::vals::Ts(val as u8) | ||
| 3140 | } | ||
| 3141 | #[doc = "Trigger selection"] | ||
| 3142 | pub fn set_ts(&mut self, val: super::vals::Ts) { | ||
| 3143 | self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize); | ||
| 3144 | } | ||
| 3145 | #[doc = "Master/Slave mode"] | ||
| 3146 | pub const fn msm(&self) -> super::vals::Msm { | ||
| 3147 | let val = (self.0 >> 7usize) & 0x01; | ||
| 3148 | super::vals::Msm(val as u8) | ||
| 3149 | } | ||
| 3150 | #[doc = "Master/Slave mode"] | ||
| 3151 | pub fn set_msm(&mut self, val: super::vals::Msm) { | ||
| 3152 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 3153 | } | ||
| 3154 | #[doc = "External trigger filter"] | ||
| 3155 | pub const fn etf(&self) -> super::vals::Etf { | ||
| 3156 | let val = (self.0 >> 8usize) & 0x0f; | ||
| 3157 | super::vals::Etf(val as u8) | ||
| 3158 | } | ||
| 3159 | #[doc = "External trigger filter"] | ||
| 3160 | pub fn set_etf(&mut self, val: super::vals::Etf) { | ||
| 3161 | self.0 = (self.0 & !(0x0f << 8usize)) | (((val.0 as u32) & 0x0f) << 8usize); | ||
| 3162 | } | ||
| 3163 | #[doc = "External trigger prescaler"] | ||
| 3164 | pub const fn etps(&self) -> super::vals::Etps { | ||
| 3165 | let val = (self.0 >> 12usize) & 0x03; | ||
| 3166 | super::vals::Etps(val as u8) | ||
| 3167 | } | ||
| 3168 | #[doc = "External trigger prescaler"] | ||
| 3169 | pub fn set_etps(&mut self, val: super::vals::Etps) { | ||
| 3170 | self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize); | ||
| 3171 | } | ||
| 3172 | #[doc = "External clock enable"] | ||
| 3173 | pub const fn ece(&self) -> super::vals::Ece { | ||
| 3174 | let val = (self.0 >> 14usize) & 0x01; | ||
| 3175 | super::vals::Ece(val as u8) | ||
| 3176 | } | ||
| 3177 | #[doc = "External clock enable"] | ||
| 3178 | pub fn set_ece(&mut self, val: super::vals::Ece) { | ||
| 3179 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | ||
| 3180 | } | ||
| 3181 | #[doc = "External trigger polarity"] | ||
| 3182 | pub const fn etp(&self) -> super::vals::Etp { | ||
| 3183 | let val = (self.0 >> 15usize) & 0x01; | ||
| 3184 | super::vals::Etp(val as u8) | ||
| 3185 | } | ||
| 3186 | #[doc = "External trigger polarity"] | ||
| 3187 | pub fn set_etp(&mut self, val: super::vals::Etp) { | ||
| 3188 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 3189 | } | ||
| 3190 | } | ||
| 3191 | impl Default for Smcr { | ||
| 3192 | fn default() -> Smcr { | ||
| 3193 | Smcr(0) | ||
| 3194 | } | ||
| 3195 | } | ||
| 3196 | #[doc = "event generation register"] | ||
| 3197 | #[repr(transparent)] | 2017 | #[repr(transparent)] |
| 3198 | #[derive(Copy, Clone, Eq, PartialEq)] | 2018 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 3199 | pub struct EgrGp(pub u32); | 2019 | pub struct Cr2(pub u32); |
| 3200 | impl EgrGp { | 2020 | impl Cr2 { |
| 3201 | #[doc = "Update generation"] | 2021 | #[doc = "Rx buffer DMA enable"] |
| 3202 | pub const fn ug(&self) -> bool { | 2022 | pub const fn rxdmaen(&self) -> bool { |
| 3203 | let val = (self.0 >> 0usize) & 0x01; | 2023 | let val = (self.0 >> 0usize) & 0x01; |
| 3204 | val != 0 | 2024 | val != 0 |
| 3205 | } | 2025 | } |
| 3206 | #[doc = "Update generation"] | 2026 | #[doc = "Rx buffer DMA enable"] |
| 3207 | pub fn set_ug(&mut self, val: bool) { | 2027 | pub fn set_rxdmaen(&mut self, val: bool) { |
| 3208 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 2028 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 3209 | } | 2029 | } |
| 3210 | #[doc = "Capture/compare 1 generation"] | 2030 | #[doc = "Tx buffer DMA enable"] |
| 3211 | pub fn ccg(&self, n: usize) -> bool { | 2031 | pub const fn txdmaen(&self) -> bool { |
| 3212 | assert!(n < 4usize); | 2032 | let val = (self.0 >> 1usize) & 0x01; |
| 3213 | let offs = 1usize + n * 1usize; | ||
| 3214 | let val = (self.0 >> offs) & 0x01; | ||
| 3215 | val != 0 | ||
| 3216 | } | ||
| 3217 | #[doc = "Capture/compare 1 generation"] | ||
| 3218 | pub fn set_ccg(&mut self, n: usize, val: bool) { | ||
| 3219 | assert!(n < 4usize); | ||
| 3220 | let offs = 1usize + n * 1usize; | ||
| 3221 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 3222 | } | ||
| 3223 | #[doc = "Capture/Compare control update generation"] | ||
| 3224 | pub const fn comg(&self) -> bool { | ||
| 3225 | let val = (self.0 >> 5usize) & 0x01; | ||
| 3226 | val != 0 | ||
| 3227 | } | ||
| 3228 | #[doc = "Capture/Compare control update generation"] | ||
| 3229 | pub fn set_comg(&mut self, val: bool) { | ||
| 3230 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 3231 | } | ||
| 3232 | #[doc = "Trigger generation"] | ||
| 3233 | pub const fn tg(&self) -> bool { | ||
| 3234 | let val = (self.0 >> 6usize) & 0x01; | ||
| 3235 | val != 0 | ||
| 3236 | } | ||
| 3237 | #[doc = "Trigger generation"] | ||
| 3238 | pub fn set_tg(&mut self, val: bool) { | ||
| 3239 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 3240 | } | ||
| 3241 | #[doc = "Break generation"] | ||
| 3242 | pub const fn bg(&self) -> bool { | ||
| 3243 | let val = (self.0 >> 7usize) & 0x01; | ||
| 3244 | val != 0 | 2033 | val != 0 |
| 3245 | } | 2034 | } |
| 3246 | #[doc = "Break generation"] | 2035 | #[doc = "Tx buffer DMA enable"] |
| 3247 | pub fn set_bg(&mut self, val: bool) { | 2036 | pub fn set_txdmaen(&mut self, val: bool) { |
| 3248 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 2037 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 3249 | } | ||
| 3250 | } | ||
| 3251 | impl Default for EgrGp { | ||
| 3252 | fn default() -> EgrGp { | ||
| 3253 | EgrGp(0) | ||
| 3254 | } | ||
| 3255 | } | ||
| 3256 | #[doc = "auto-reload register"] | ||
| 3257 | #[repr(transparent)] | ||
| 3258 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3259 | pub struct Arr16(pub u32); | ||
| 3260 | impl Arr16 { | ||
| 3261 | #[doc = "Auto-reload value"] | ||
| 3262 | pub const fn arr(&self) -> u16 { | ||
| 3263 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 3264 | val as u16 | ||
| 3265 | } | ||
| 3266 | #[doc = "Auto-reload value"] | ||
| 3267 | pub fn set_arr(&mut self, val: u16) { | ||
| 3268 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 3269 | } | ||
| 3270 | } | ||
| 3271 | impl Default for Arr16 { | ||
| 3272 | fn default() -> Arr16 { | ||
| 3273 | Arr16(0) | ||
| 3274 | } | ||
| 3275 | } | ||
| 3276 | #[doc = "capture/compare mode register 1 (input mode)"] | ||
| 3277 | #[repr(transparent)] | ||
| 3278 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3279 | pub struct CcmrInput(pub u32); | ||
| 3280 | impl CcmrInput { | ||
| 3281 | #[doc = "Capture/Compare 1 selection"] | ||
| 3282 | pub fn ccs(&self, n: usize) -> super::vals::CcmrInputCcs { | ||
| 3283 | assert!(n < 2usize); | ||
| 3284 | let offs = 0usize + n * 8usize; | ||
| 3285 | let val = (self.0 >> offs) & 0x03; | ||
| 3286 | super::vals::CcmrInputCcs(val as u8) | ||
| 3287 | } | ||
| 3288 | #[doc = "Capture/Compare 1 selection"] | ||
| 3289 | pub fn set_ccs(&mut self, n: usize, val: super::vals::CcmrInputCcs) { | ||
| 3290 | assert!(n < 2usize); | ||
| 3291 | let offs = 0usize + n * 8usize; | ||
| 3292 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | ||
| 3293 | } | ||
| 3294 | #[doc = "Input capture 1 prescaler"] | ||
| 3295 | pub fn icpsc(&self, n: usize) -> u8 { | ||
| 3296 | assert!(n < 2usize); | ||
| 3297 | let offs = 2usize + n * 8usize; | ||
| 3298 | let val = (self.0 >> offs) & 0x03; | ||
| 3299 | val as u8 | ||
| 3300 | } | ||
| 3301 | #[doc = "Input capture 1 prescaler"] | ||
| 3302 | pub fn set_icpsc(&mut self, n: usize, val: u8) { | ||
| 3303 | assert!(n < 2usize); | ||
| 3304 | let offs = 2usize + n * 8usize; | ||
| 3305 | self.0 = (self.0 & !(0x03 << offs)) | (((val as u32) & 0x03) << offs); | ||
| 3306 | } | ||
| 3307 | #[doc = "Input capture 1 filter"] | ||
| 3308 | pub fn icf(&self, n: usize) -> super::vals::Icf { | ||
| 3309 | assert!(n < 2usize); | ||
| 3310 | let offs = 4usize + n * 8usize; | ||
| 3311 | let val = (self.0 >> offs) & 0x0f; | ||
| 3312 | super::vals::Icf(val as u8) | ||
| 3313 | } | ||
| 3314 | #[doc = "Input capture 1 filter"] | ||
| 3315 | pub fn set_icf(&mut self, n: usize, val: super::vals::Icf) { | ||
| 3316 | assert!(n < 2usize); | ||
| 3317 | let offs = 4usize + n * 8usize; | ||
| 3318 | self.0 = (self.0 & !(0x0f << offs)) | (((val.0 as u32) & 0x0f) << offs); | ||
| 3319 | } | ||
| 3320 | } | ||
| 3321 | impl Default for CcmrInput { | ||
| 3322 | fn default() -> CcmrInput { | ||
| 3323 | CcmrInput(0) | ||
| 3324 | } | ||
| 3325 | } | ||
| 3326 | #[doc = "repetition counter register"] | ||
| 3327 | #[repr(transparent)] | ||
| 3328 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3329 | pub struct Rcr(pub u32); | ||
| 3330 | impl Rcr { | ||
| 3331 | #[doc = "Repetition counter value"] | ||
| 3332 | pub const fn rep(&self) -> u8 { | ||
| 3333 | let val = (self.0 >> 0usize) & 0xff; | ||
| 3334 | val as u8 | ||
| 3335 | } | ||
| 3336 | #[doc = "Repetition counter value"] | ||
| 3337 | pub fn set_rep(&mut self, val: u8) { | ||
| 3338 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | ||
| 3339 | } | ||
| 3340 | } | ||
| 3341 | impl Default for Rcr { | ||
| 3342 | fn default() -> Rcr { | ||
| 3343 | Rcr(0) | ||
| 3344 | } | ||
| 3345 | } | ||
| 3346 | #[doc = "capture/compare register 1"] | ||
| 3347 | #[repr(transparent)] | ||
| 3348 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3349 | pub struct Ccr32(pub u32); | ||
| 3350 | impl Ccr32 { | ||
| 3351 | #[doc = "Capture/Compare 1 value"] | ||
| 3352 | pub const fn ccr(&self) -> u32 { | ||
| 3353 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 3354 | val as u32 | ||
| 3355 | } | ||
| 3356 | #[doc = "Capture/Compare 1 value"] | ||
| 3357 | pub fn set_ccr(&mut self, val: u32) { | ||
| 3358 | self.0 = | ||
| 3359 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 3360 | } | ||
| 3361 | } | ||
| 3362 | impl Default for Ccr32 { | ||
| 3363 | fn default() -> Ccr32 { | ||
| 3364 | Ccr32(0) | ||
| 3365 | } | 2038 | } |
| 3366 | } | 2039 | #[doc = "SS output enable"] |
| 3367 | #[doc = "status register"] | 2040 | pub const fn ssoe(&self) -> bool { |
| 3368 | #[repr(transparent)] | 2041 | let val = (self.0 >> 2usize) & 0x01; |
| 3369 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3370 | pub struct SrGp(pub u32); | ||
| 3371 | impl SrGp { | ||
| 3372 | #[doc = "Update interrupt flag"] | ||
| 3373 | pub const fn uif(&self) -> bool { | ||
| 3374 | let val = (self.0 >> 0usize) & 0x01; | ||
| 3375 | val != 0 | 2042 | val != 0 |
| 3376 | } | 2043 | } |
| 3377 | #[doc = "Update interrupt flag"] | 2044 | #[doc = "SS output enable"] |
| 3378 | pub fn set_uif(&mut self, val: bool) { | 2045 | pub fn set_ssoe(&mut self, val: bool) { |
| 3379 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 2046 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 3380 | } | 2047 | } |
| 3381 | #[doc = "Capture/compare 1 interrupt flag"] | 2048 | #[doc = "Frame format"] |
| 3382 | pub fn ccif(&self, n: usize) -> bool { | 2049 | pub const fn frf(&self) -> super::vals::Frf { |
| 3383 | assert!(n < 4usize); | 2050 | let val = (self.0 >> 4usize) & 0x01; |
| 3384 | let offs = 1usize + n * 1usize; | 2051 | super::vals::Frf(val as u8) |
| 3385 | let val = (self.0 >> offs) & 0x01; | ||
| 3386 | val != 0 | ||
| 3387 | } | 2052 | } |
| 3388 | #[doc = "Capture/compare 1 interrupt flag"] | 2053 | #[doc = "Frame format"] |
| 3389 | pub fn set_ccif(&mut self, n: usize, val: bool) { | 2054 | pub fn set_frf(&mut self, val: super::vals::Frf) { |
| 3390 | assert!(n < 4usize); | 2055 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); |
| 3391 | let offs = 1usize + n * 1usize; | ||
| 3392 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 3393 | } | 2056 | } |
| 3394 | #[doc = "COM interrupt flag"] | 2057 | #[doc = "Error interrupt enable"] |
| 3395 | pub const fn comif(&self) -> bool { | 2058 | pub const fn errie(&self) -> bool { |
| 3396 | let val = (self.0 >> 5usize) & 0x01; | 2059 | let val = (self.0 >> 5usize) & 0x01; |
| 3397 | val != 0 | 2060 | val != 0 |
| 3398 | } | 2061 | } |
| 3399 | #[doc = "COM interrupt flag"] | 2062 | #[doc = "Error interrupt enable"] |
| 3400 | pub fn set_comif(&mut self, val: bool) { | 2063 | pub fn set_errie(&mut self, val: bool) { |
| 3401 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 2064 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 3402 | } | 2065 | } |
| 3403 | #[doc = "Trigger interrupt flag"] | 2066 | #[doc = "RX buffer not empty interrupt enable"] |
| 3404 | pub const fn tif(&self) -> bool { | 2067 | pub const fn rxneie(&self) -> bool { |
| 3405 | let val = (self.0 >> 6usize) & 0x01; | 2068 | let val = (self.0 >> 6usize) & 0x01; |
| 3406 | val != 0 | 2069 | val != 0 |
| 3407 | } | 2070 | } |
| 3408 | #[doc = "Trigger interrupt flag"] | 2071 | #[doc = "RX buffer not empty interrupt enable"] |
| 3409 | pub fn set_tif(&mut self, val: bool) { | 2072 | pub fn set_rxneie(&mut self, val: bool) { |
| 3410 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 2073 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 3411 | } | 2074 | } |
| 3412 | #[doc = "Break interrupt flag"] | 2075 | #[doc = "Tx buffer empty interrupt enable"] |
| 3413 | pub const fn bif(&self) -> bool { | 2076 | pub const fn txeie(&self) -> bool { |
| 3414 | let val = (self.0 >> 7usize) & 0x01; | 2077 | let val = (self.0 >> 7usize) & 0x01; |
| 3415 | val != 0 | 2078 | val != 0 |
| 3416 | } | 2079 | } |
| 3417 | #[doc = "Break interrupt flag"] | 2080 | #[doc = "Tx buffer empty interrupt enable"] |
| 3418 | pub fn set_bif(&mut self, val: bool) { | 2081 | pub fn set_txeie(&mut self, val: bool) { |
| 3419 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 2082 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 3420 | } | 2083 | } |
| 3421 | #[doc = "Capture/Compare 1 overcapture flag"] | ||
| 3422 | pub fn ccof(&self, n: usize) -> bool { | ||
| 3423 | assert!(n < 4usize); | ||
| 3424 | let offs = 9usize + n * 1usize; | ||
| 3425 | let val = (self.0 >> offs) & 0x01; | ||
| 3426 | val != 0 | ||
| 3427 | } | ||
| 3428 | #[doc = "Capture/Compare 1 overcapture flag"] | ||
| 3429 | pub fn set_ccof(&mut self, n: usize, val: bool) { | ||
| 3430 | assert!(n < 4usize); | ||
| 3431 | let offs = 9usize + n * 1usize; | ||
| 3432 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 3433 | } | ||
| 3434 | } | ||
| 3435 | impl Default for SrGp { | ||
| 3436 | fn default() -> SrGp { | ||
| 3437 | SrGp(0) | ||
| 3438 | } | ||
| 3439 | } | ||
| 3440 | #[doc = "control register 1"] | ||
| 3441 | #[repr(transparent)] | ||
| 3442 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3443 | pub struct Cr1Basic(pub u32); | ||
| 3444 | impl Cr1Basic { | ||
| 3445 | #[doc = "Counter enable"] | ||
| 3446 | pub const fn cen(&self) -> bool { | ||
| 3447 | let val = (self.0 >> 0usize) & 0x01; | ||
| 3448 | val != 0 | ||
| 3449 | } | ||
| 3450 | #[doc = "Counter enable"] | ||
| 3451 | pub fn set_cen(&mut self, val: bool) { | ||
| 3452 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 3453 | } | ||
| 3454 | #[doc = "Update disable"] | ||
| 3455 | pub const fn udis(&self) -> bool { | ||
| 3456 | let val = (self.0 >> 1usize) & 0x01; | ||
| 3457 | val != 0 | ||
| 3458 | } | ||
| 3459 | #[doc = "Update disable"] | ||
| 3460 | pub fn set_udis(&mut self, val: bool) { | ||
| 3461 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | ||
| 3462 | } | ||
| 3463 | #[doc = "Update request source"] | ||
| 3464 | pub const fn urs(&self) -> super::vals::Urs { | ||
| 3465 | let val = (self.0 >> 2usize) & 0x01; | ||
| 3466 | super::vals::Urs(val as u8) | ||
| 3467 | } | ||
| 3468 | #[doc = "Update request source"] | ||
| 3469 | pub fn set_urs(&mut self, val: super::vals::Urs) { | ||
| 3470 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 3471 | } | ||
| 3472 | #[doc = "One-pulse mode"] | ||
| 3473 | pub const fn opm(&self) -> super::vals::Opm { | ||
| 3474 | let val = (self.0 >> 3usize) & 0x01; | ||
| 3475 | super::vals::Opm(val as u8) | ||
| 3476 | } | ||
| 3477 | #[doc = "One-pulse mode"] | ||
| 3478 | pub fn set_opm(&mut self, val: super::vals::Opm) { | ||
| 3479 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 3480 | } | ||
| 3481 | #[doc = "Auto-reload preload enable"] | ||
| 3482 | pub const fn arpe(&self) -> super::vals::Arpe { | ||
| 3483 | let val = (self.0 >> 7usize) & 0x01; | ||
| 3484 | super::vals::Arpe(val as u8) | ||
| 3485 | } | ||
| 3486 | #[doc = "Auto-reload preload enable"] | ||
| 3487 | pub fn set_arpe(&mut self, val: super::vals::Arpe) { | ||
| 3488 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 3489 | } | ||
| 3490 | } | 2084 | } |
| 3491 | impl Default for Cr1Basic { | 2085 | impl Default for Cr2 { |
| 3492 | fn default() -> Cr1Basic { | 2086 | fn default() -> Cr2 { |
| 3493 | Cr1Basic(0) | 2087 | Cr2(0) |
| 3494 | } | ||
| 3495 | } | ||
| 3496 | #[doc = "control register 2"] | ||
| 3497 | #[repr(transparent)] | ||
| 3498 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3499 | pub struct Cr2Adv(pub u32); | ||
| 3500 | impl Cr2Adv { | ||
| 3501 | #[doc = "Capture/compare preloaded control"] | ||
| 3502 | pub const fn ccpc(&self) -> bool { | ||
| 3503 | let val = (self.0 >> 0usize) & 0x01; | ||
| 3504 | val != 0 | ||
| 3505 | } | ||
| 3506 | #[doc = "Capture/compare preloaded control"] | ||
| 3507 | pub fn set_ccpc(&mut self, val: bool) { | ||
| 3508 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 3509 | } | ||
| 3510 | #[doc = "Capture/compare control update selection"] | ||
| 3511 | pub const fn ccus(&self) -> bool { | ||
| 3512 | let val = (self.0 >> 2usize) & 0x01; | ||
| 3513 | val != 0 | ||
| 3514 | } | ||
| 3515 | #[doc = "Capture/compare control update selection"] | ||
| 3516 | pub fn set_ccus(&mut self, val: bool) { | ||
| 3517 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 3518 | } | ||
| 3519 | #[doc = "Capture/compare DMA selection"] | ||
| 3520 | pub const fn ccds(&self) -> super::vals::Ccds { | ||
| 3521 | let val = (self.0 >> 3usize) & 0x01; | ||
| 3522 | super::vals::Ccds(val as u8) | ||
| 3523 | } | ||
| 3524 | #[doc = "Capture/compare DMA selection"] | ||
| 3525 | pub fn set_ccds(&mut self, val: super::vals::Ccds) { | ||
| 3526 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 3527 | } | ||
| 3528 | #[doc = "Master mode selection"] | ||
| 3529 | pub const fn mms(&self) -> super::vals::Mms { | ||
| 3530 | let val = (self.0 >> 4usize) & 0x07; | ||
| 3531 | super::vals::Mms(val as u8) | ||
| 3532 | } | ||
| 3533 | #[doc = "Master mode selection"] | ||
| 3534 | pub fn set_mms(&mut self, val: super::vals::Mms) { | ||
| 3535 | self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize); | ||
| 3536 | } | ||
| 3537 | #[doc = "TI1 selection"] | ||
| 3538 | pub const fn ti1s(&self) -> super::vals::Tis { | ||
| 3539 | let val = (self.0 >> 7usize) & 0x01; | ||
| 3540 | super::vals::Tis(val as u8) | ||
| 3541 | } | ||
| 3542 | #[doc = "TI1 selection"] | ||
| 3543 | pub fn set_ti1s(&mut self, val: super::vals::Tis) { | ||
| 3544 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 3545 | } | ||
| 3546 | #[doc = "Output Idle state 1"] | ||
| 3547 | pub fn ois(&self, n: usize) -> bool { | ||
| 3548 | assert!(n < 4usize); | ||
| 3549 | let offs = 8usize + n * 2usize; | ||
| 3550 | let val = (self.0 >> offs) & 0x01; | ||
| 3551 | val != 0 | ||
| 3552 | } | ||
| 3553 | #[doc = "Output Idle state 1"] | ||
| 3554 | pub fn set_ois(&mut self, n: usize, val: bool) { | ||
| 3555 | assert!(n < 4usize); | ||
| 3556 | let offs = 8usize + n * 2usize; | ||
| 3557 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 3558 | } | ||
| 3559 | #[doc = "Output Idle state 1"] | ||
| 3560 | pub const fn ois1n(&self) -> bool { | ||
| 3561 | let val = (self.0 >> 9usize) & 0x01; | ||
| 3562 | val != 0 | ||
| 3563 | } | ||
| 3564 | #[doc = "Output Idle state 1"] | ||
| 3565 | pub fn set_ois1n(&mut self, val: bool) { | ||
| 3566 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | ||
| 3567 | } | ||
| 3568 | #[doc = "Output Idle state 2"] | ||
| 3569 | pub const fn ois2n(&self) -> bool { | ||
| 3570 | let val = (self.0 >> 11usize) & 0x01; | ||
| 3571 | val != 0 | ||
| 3572 | } | ||
| 3573 | #[doc = "Output Idle state 2"] | ||
| 3574 | pub fn set_ois2n(&mut self, val: bool) { | ||
| 3575 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); | ||
| 3576 | } | ||
| 3577 | #[doc = "Output Idle state 3"] | ||
| 3578 | pub const fn ois3n(&self) -> bool { | ||
| 3579 | let val = (self.0 >> 13usize) & 0x01; | ||
| 3580 | val != 0 | ||
| 3581 | } | ||
| 3582 | #[doc = "Output Idle state 3"] | ||
| 3583 | pub fn set_ois3n(&mut self, val: bool) { | ||
| 3584 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | ||
| 3585 | } | ||
| 3586 | } | ||
| 3587 | impl Default for Cr2Adv { | ||
| 3588 | fn default() -> Cr2Adv { | ||
| 3589 | Cr2Adv(0) | ||
| 3590 | } | ||
| 3591 | } | ||
| 3592 | #[doc = "control register 2"] | ||
| 3593 | #[repr(transparent)] | ||
| 3594 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3595 | pub struct Cr2Gp(pub u32); | ||
| 3596 | impl Cr2Gp { | ||
| 3597 | #[doc = "Capture/compare DMA selection"] | ||
| 3598 | pub const fn ccds(&self) -> super::vals::Ccds { | ||
| 3599 | let val = (self.0 >> 3usize) & 0x01; | ||
| 3600 | super::vals::Ccds(val as u8) | ||
| 3601 | } | ||
| 3602 | #[doc = "Capture/compare DMA selection"] | ||
| 3603 | pub fn set_ccds(&mut self, val: super::vals::Ccds) { | ||
| 3604 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 3605 | } | ||
| 3606 | #[doc = "Master mode selection"] | ||
| 3607 | pub const fn mms(&self) -> super::vals::Mms { | ||
| 3608 | let val = (self.0 >> 4usize) & 0x07; | ||
| 3609 | super::vals::Mms(val as u8) | ||
| 3610 | } | ||
| 3611 | #[doc = "Master mode selection"] | ||
| 3612 | pub fn set_mms(&mut self, val: super::vals::Mms) { | ||
| 3613 | self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize); | ||
| 3614 | } | ||
| 3615 | #[doc = "TI1 selection"] | ||
| 3616 | pub const fn ti1s(&self) -> super::vals::Tis { | ||
| 3617 | let val = (self.0 >> 7usize) & 0x01; | ||
| 3618 | super::vals::Tis(val as u8) | ||
| 3619 | } | ||
| 3620 | #[doc = "TI1 selection"] | ||
| 3621 | pub fn set_ti1s(&mut self, val: super::vals::Tis) { | ||
| 3622 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 3623 | } | ||
| 3624 | } | ||
| 3625 | impl Default for Cr2Gp { | ||
| 3626 | fn default() -> Cr2Gp { | ||
| 3627 | Cr2Gp(0) | ||
| 3628 | } | 2088 | } |
| 3629 | } | 2089 | } |
| 3630 | #[doc = "capture/compare register 1"] | 2090 | #[doc = "TX CRC register"] |
| 3631 | #[repr(transparent)] | 2091 | #[repr(transparent)] |
| 3632 | #[derive(Copy, Clone, Eq, PartialEq)] | 2092 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 3633 | pub struct Ccr16(pub u32); | 2093 | pub struct Txcrcr(pub u32); |
| 3634 | impl Ccr16 { | 2094 | impl Txcrcr { |
| 3635 | #[doc = "Capture/Compare 1 value"] | 2095 | #[doc = "Tx CRC register"] |
| 3636 | pub const fn ccr(&self) -> u16 { | 2096 | pub const fn tx_crc(&self) -> u16 { |
| 3637 | let val = (self.0 >> 0usize) & 0xffff; | 2097 | let val = (self.0 >> 0usize) & 0xffff; |
| 3638 | val as u16 | 2098 | val as u16 |
| 3639 | } | 2099 | } |
| 3640 | #[doc = "Capture/Compare 1 value"] | 2100 | #[doc = "Tx CRC register"] |
| 3641 | pub fn set_ccr(&mut self, val: u16) { | 2101 | pub fn set_tx_crc(&mut self, val: u16) { |
| 3642 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | 2102 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); |
| 3643 | } | 2103 | } |
| 3644 | } | 2104 | } |
| 3645 | impl Default for Ccr16 { | 2105 | impl Default for Txcrcr { |
| 3646 | fn default() -> Ccr16 { | 2106 | fn default() -> Txcrcr { |
| 3647 | Ccr16(0) | 2107 | Txcrcr(0) |
| 3648 | } | ||
| 3649 | } | ||
| 3650 | #[doc = "DMA/Interrupt enable register"] | ||
| 3651 | #[repr(transparent)] | ||
| 3652 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3653 | pub struct DierBasic(pub u32); | ||
| 3654 | impl DierBasic { | ||
| 3655 | #[doc = "Update interrupt enable"] | ||
| 3656 | pub const fn uie(&self) -> bool { | ||
| 3657 | let val = (self.0 >> 0usize) & 0x01; | ||
| 3658 | val != 0 | ||
| 3659 | } | ||
| 3660 | #[doc = "Update interrupt enable"] | ||
| 3661 | pub fn set_uie(&mut self, val: bool) { | ||
| 3662 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 3663 | } | ||
| 3664 | #[doc = "Update DMA request enable"] | ||
| 3665 | pub const fn ude(&self) -> bool { | ||
| 3666 | let val = (self.0 >> 8usize) & 0x01; | ||
| 3667 | val != 0 | ||
| 3668 | } | ||
| 3669 | #[doc = "Update DMA request enable"] | ||
| 3670 | pub fn set_ude(&mut self, val: bool) { | ||
| 3671 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 3672 | } | ||
| 3673 | } | ||
| 3674 | impl Default for DierBasic { | ||
| 3675 | fn default() -> DierBasic { | ||
| 3676 | DierBasic(0) | ||
| 3677 | } | ||
| 3678 | } | ||
| 3679 | #[doc = "counter"] | ||
| 3680 | #[repr(transparent)] | ||
| 3681 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3682 | pub struct Cnt32(pub u32); | ||
| 3683 | impl Cnt32 { | ||
| 3684 | #[doc = "counter value"] | ||
| 3685 | pub const fn cnt(&self) -> u32 { | ||
| 3686 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 3687 | val as u32 | ||
| 3688 | } | ||
| 3689 | #[doc = "counter value"] | ||
| 3690 | pub fn set_cnt(&mut self, val: u32) { | ||
| 3691 | self.0 = | ||
| 3692 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 3693 | } | ||
| 3694 | } | ||
| 3695 | impl Default for Cnt32 { | ||
| 3696 | fn default() -> Cnt32 { | ||
| 3697 | Cnt32(0) | ||
| 3698 | } | 2108 | } |
| 3699 | } | 2109 | } |
| 3700 | #[doc = "capture/compare mode register 2 (output mode)"] | 2110 | #[doc = "data register"] |
| 3701 | #[repr(transparent)] | 2111 | #[repr(transparent)] |
| 3702 | #[derive(Copy, Clone, Eq, PartialEq)] | 2112 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 3703 | pub struct CcmrOutput(pub u32); | 2113 | pub struct Dr(pub u32); |
| 3704 | impl CcmrOutput { | 2114 | impl Dr { |
| 3705 | #[doc = "Capture/Compare 3 selection"] | 2115 | #[doc = "Data register"] |
| 3706 | pub fn ccs(&self, n: usize) -> super::vals::CcmrOutputCcs { | 2116 | pub const fn dr(&self) -> u16 { |
| 3707 | assert!(n < 2usize); | 2117 | let val = (self.0 >> 0usize) & 0xffff; |
| 3708 | let offs = 0usize + n * 8usize; | 2118 | val as u16 |
| 3709 | let val = (self.0 >> offs) & 0x03; | ||
| 3710 | super::vals::CcmrOutputCcs(val as u8) | ||
| 3711 | } | ||
| 3712 | #[doc = "Capture/Compare 3 selection"] | ||
| 3713 | pub fn set_ccs(&mut self, n: usize, val: super::vals::CcmrOutputCcs) { | ||
| 3714 | assert!(n < 2usize); | ||
| 3715 | let offs = 0usize + n * 8usize; | ||
| 3716 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | ||
| 3717 | } | ||
| 3718 | #[doc = "Output compare 3 fast enable"] | ||
| 3719 | pub fn ocfe(&self, n: usize) -> bool { | ||
| 3720 | assert!(n < 2usize); | ||
| 3721 | let offs = 2usize + n * 8usize; | ||
| 3722 | let val = (self.0 >> offs) & 0x01; | ||
| 3723 | val != 0 | ||
| 3724 | } | ||
| 3725 | #[doc = "Output compare 3 fast enable"] | ||
| 3726 | pub fn set_ocfe(&mut self, n: usize, val: bool) { | ||
| 3727 | assert!(n < 2usize); | ||
| 3728 | let offs = 2usize + n * 8usize; | ||
| 3729 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 3730 | } | ||
| 3731 | #[doc = "Output compare 3 preload enable"] | ||
| 3732 | pub fn ocpe(&self, n: usize) -> super::vals::Ocpe { | ||
| 3733 | assert!(n < 2usize); | ||
| 3734 | let offs = 3usize + n * 8usize; | ||
| 3735 | let val = (self.0 >> offs) & 0x01; | ||
| 3736 | super::vals::Ocpe(val as u8) | ||
| 3737 | } | ||
| 3738 | #[doc = "Output compare 3 preload enable"] | ||
| 3739 | pub fn set_ocpe(&mut self, n: usize, val: super::vals::Ocpe) { | ||
| 3740 | assert!(n < 2usize); | ||
| 3741 | let offs = 3usize + n * 8usize; | ||
| 3742 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 3743 | } | ||
| 3744 | #[doc = "Output compare 3 mode"] | ||
| 3745 | pub fn ocm(&self, n: usize) -> super::vals::Ocm { | ||
| 3746 | assert!(n < 2usize); | ||
| 3747 | let offs = 4usize + n * 8usize; | ||
| 3748 | let val = (self.0 >> offs) & 0x07; | ||
| 3749 | super::vals::Ocm(val as u8) | ||
| 3750 | } | ||
| 3751 | #[doc = "Output compare 3 mode"] | ||
| 3752 | pub fn set_ocm(&mut self, n: usize, val: super::vals::Ocm) { | ||
| 3753 | assert!(n < 2usize); | ||
| 3754 | let offs = 4usize + n * 8usize; | ||
| 3755 | self.0 = (self.0 & !(0x07 << offs)) | (((val.0 as u32) & 0x07) << offs); | ||
| 3756 | } | ||
| 3757 | #[doc = "Output compare 3 clear enable"] | ||
| 3758 | pub fn occe(&self, n: usize) -> bool { | ||
| 3759 | assert!(n < 2usize); | ||
| 3760 | let offs = 7usize + n * 8usize; | ||
| 3761 | let val = (self.0 >> offs) & 0x01; | ||
| 3762 | val != 0 | ||
| 3763 | } | 2119 | } |
| 3764 | #[doc = "Output compare 3 clear enable"] | 2120 | #[doc = "Data register"] |
| 3765 | pub fn set_occe(&mut self, n: usize, val: bool) { | 2121 | pub fn set_dr(&mut self, val: u16) { |
| 3766 | assert!(n < 2usize); | 2122 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); |
| 3767 | let offs = 7usize + n * 8usize; | ||
| 3768 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 3769 | } | 2123 | } |
| 3770 | } | 2124 | } |
| 3771 | impl Default for CcmrOutput { | 2125 | impl Default for Dr { |
| 3772 | fn default() -> CcmrOutput { | 2126 | fn default() -> Dr { |
| 3773 | CcmrOutput(0) | 2127 | Dr(0) |
| 3774 | } | 2128 | } |
| 3775 | } | 2129 | } |
| 3776 | #[doc = "control register 1"] | 2130 | #[doc = "status register"] |
| 3777 | #[repr(transparent)] | 2131 | #[repr(transparent)] |
| 3778 | #[derive(Copy, Clone, Eq, PartialEq)] | 2132 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 3779 | pub struct Cr1Gp(pub u32); | 2133 | pub struct Sr(pub u32); |
| 3780 | impl Cr1Gp { | 2134 | impl Sr { |
| 3781 | #[doc = "Counter enable"] | 2135 | #[doc = "Receive buffer not empty"] |
| 3782 | pub const fn cen(&self) -> bool { | 2136 | pub const fn rxne(&self) -> bool { |
| 3783 | let val = (self.0 >> 0usize) & 0x01; | 2137 | let val = (self.0 >> 0usize) & 0x01; |
| 3784 | val != 0 | 2138 | val != 0 |
| 3785 | } | 2139 | } |
| 3786 | #[doc = "Counter enable"] | 2140 | #[doc = "Receive buffer not empty"] |
| 3787 | pub fn set_cen(&mut self, val: bool) { | 2141 | pub fn set_rxne(&mut self, val: bool) { |
| 3788 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 2142 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 3789 | } | 2143 | } |
| 3790 | #[doc = "Update disable"] | 2144 | #[doc = "Transmit buffer empty"] |
| 3791 | pub const fn udis(&self) -> bool { | 2145 | pub const fn txe(&self) -> bool { |
| 3792 | let val = (self.0 >> 1usize) & 0x01; | 2146 | let val = (self.0 >> 1usize) & 0x01; |
| 3793 | val != 0 | 2147 | val != 0 |
| 3794 | } | 2148 | } |
| 3795 | #[doc = "Update disable"] | 2149 | #[doc = "Transmit buffer empty"] |
| 3796 | pub fn set_udis(&mut self, val: bool) { | 2150 | pub fn set_txe(&mut self, val: bool) { |
| 3797 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 2151 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 3798 | } | 2152 | } |
| 3799 | #[doc = "Update request source"] | 2153 | #[doc = "CRC error flag"] |
| 3800 | pub const fn urs(&self) -> super::vals::Urs { | 2154 | pub const fn crcerr(&self) -> bool { |
| 3801 | let val = (self.0 >> 2usize) & 0x01; | ||
| 3802 | super::vals::Urs(val as u8) | ||
| 3803 | } | ||
| 3804 | #[doc = "Update request source"] | ||
| 3805 | pub fn set_urs(&mut self, val: super::vals::Urs) { | ||
| 3806 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 3807 | } | ||
| 3808 | #[doc = "One-pulse mode"] | ||
| 3809 | pub const fn opm(&self) -> super::vals::Opm { | ||
| 3810 | let val = (self.0 >> 3usize) & 0x01; | ||
| 3811 | super::vals::Opm(val as u8) | ||
| 3812 | } | ||
| 3813 | #[doc = "One-pulse mode"] | ||
| 3814 | pub fn set_opm(&mut self, val: super::vals::Opm) { | ||
| 3815 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 3816 | } | ||
| 3817 | #[doc = "Direction"] | ||
| 3818 | pub const fn dir(&self) -> super::vals::Dir { | ||
| 3819 | let val = (self.0 >> 4usize) & 0x01; | 2155 | let val = (self.0 >> 4usize) & 0x01; |
| 3820 | super::vals::Dir(val as u8) | ||
| 3821 | } | ||
| 3822 | #[doc = "Direction"] | ||
| 3823 | pub fn set_dir(&mut self, val: super::vals::Dir) { | ||
| 3824 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 3825 | } | ||
| 3826 | #[doc = "Center-aligned mode selection"] | ||
| 3827 | pub const fn cms(&self) -> super::vals::Cms { | ||
| 3828 | let val = (self.0 >> 5usize) & 0x03; | ||
| 3829 | super::vals::Cms(val as u8) | ||
| 3830 | } | ||
| 3831 | #[doc = "Center-aligned mode selection"] | ||
| 3832 | pub fn set_cms(&mut self, val: super::vals::Cms) { | ||
| 3833 | self.0 = (self.0 & !(0x03 << 5usize)) | (((val.0 as u32) & 0x03) << 5usize); | ||
| 3834 | } | ||
| 3835 | #[doc = "Auto-reload preload enable"] | ||
| 3836 | pub const fn arpe(&self) -> super::vals::Arpe { | ||
| 3837 | let val = (self.0 >> 7usize) & 0x01; | ||
| 3838 | super::vals::Arpe(val as u8) | ||
| 3839 | } | ||
| 3840 | #[doc = "Auto-reload preload enable"] | ||
| 3841 | pub fn set_arpe(&mut self, val: super::vals::Arpe) { | ||
| 3842 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 3843 | } | ||
| 3844 | #[doc = "Clock division"] | ||
| 3845 | pub const fn ckd(&self) -> super::vals::Ckd { | ||
| 3846 | let val = (self.0 >> 8usize) & 0x03; | ||
| 3847 | super::vals::Ckd(val as u8) | ||
| 3848 | } | ||
| 3849 | #[doc = "Clock division"] | ||
| 3850 | pub fn set_ckd(&mut self, val: super::vals::Ckd) { | ||
| 3851 | self.0 = (self.0 & !(0x03 << 8usize)) | (((val.0 as u32) & 0x03) << 8usize); | ||
| 3852 | } | ||
| 3853 | } | ||
| 3854 | impl Default for Cr1Gp { | ||
| 3855 | fn default() -> Cr1Gp { | ||
| 3856 | Cr1Gp(0) | ||
| 3857 | } | ||
| 3858 | } | ||
| 3859 | #[doc = "status register"] | ||
| 3860 | #[repr(transparent)] | ||
| 3861 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3862 | pub struct SrAdv(pub u32); | ||
| 3863 | impl SrAdv { | ||
| 3864 | #[doc = "Update interrupt flag"] | ||
| 3865 | pub const fn uif(&self) -> bool { | ||
| 3866 | let val = (self.0 >> 0usize) & 0x01; | ||
| 3867 | val != 0 | 2156 | val != 0 |
| 3868 | } | 2157 | } |
| 3869 | #[doc = "Update interrupt flag"] | 2158 | #[doc = "CRC error flag"] |
| 3870 | pub fn set_uif(&mut self, val: bool) { | 2159 | pub fn set_crcerr(&mut self, val: bool) { |
| 3871 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 2160 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 3872 | } | ||
| 3873 | #[doc = "Capture/compare 1 interrupt flag"] | ||
| 3874 | pub fn ccif(&self, n: usize) -> bool { | ||
| 3875 | assert!(n < 4usize); | ||
| 3876 | let offs = 1usize + n * 1usize; | ||
| 3877 | let val = (self.0 >> offs) & 0x01; | ||
| 3878 | val != 0 | ||
| 3879 | } | ||
| 3880 | #[doc = "Capture/compare 1 interrupt flag"] | ||
| 3881 | pub fn set_ccif(&mut self, n: usize, val: bool) { | ||
| 3882 | assert!(n < 4usize); | ||
| 3883 | let offs = 1usize + n * 1usize; | ||
| 3884 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 3885 | } | 2161 | } |
| 3886 | #[doc = "COM interrupt flag"] | 2162 | #[doc = "Mode fault"] |
| 3887 | pub const fn comif(&self) -> bool { | 2163 | pub const fn modf(&self) -> bool { |
| 3888 | let val = (self.0 >> 5usize) & 0x01; | 2164 | let val = (self.0 >> 5usize) & 0x01; |
| 3889 | val != 0 | 2165 | val != 0 |
| 3890 | } | 2166 | } |
| 3891 | #[doc = "COM interrupt flag"] | 2167 | #[doc = "Mode fault"] |
| 3892 | pub fn set_comif(&mut self, val: bool) { | 2168 | pub fn set_modf(&mut self, val: bool) { |
| 3893 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 2169 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 3894 | } | 2170 | } |
| 3895 | #[doc = "Trigger interrupt flag"] | 2171 | #[doc = "Overrun flag"] |
| 3896 | pub const fn tif(&self) -> bool { | 2172 | pub const fn ovr(&self) -> bool { |
| 3897 | let val = (self.0 >> 6usize) & 0x01; | 2173 | let val = (self.0 >> 6usize) & 0x01; |
| 3898 | val != 0 | 2174 | val != 0 |
| 3899 | } | 2175 | } |
| 3900 | #[doc = "Trigger interrupt flag"] | 2176 | #[doc = "Overrun flag"] |
| 3901 | pub fn set_tif(&mut self, val: bool) { | 2177 | pub fn set_ovr(&mut self, val: bool) { |
| 3902 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 2178 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 3903 | } | 2179 | } |
| 3904 | #[doc = "Break interrupt flag"] | 2180 | #[doc = "Busy flag"] |
| 3905 | pub const fn bif(&self) -> bool { | 2181 | pub const fn bsy(&self) -> bool { |
| 3906 | let val = (self.0 >> 7usize) & 0x01; | 2182 | let val = (self.0 >> 7usize) & 0x01; |
| 3907 | val != 0 | 2183 | val != 0 |
| 3908 | } | 2184 | } |
| 3909 | #[doc = "Break interrupt flag"] | 2185 | #[doc = "Busy flag"] |
| 3910 | pub fn set_bif(&mut self, val: bool) { | 2186 | pub fn set_bsy(&mut self, val: bool) { |
| 3911 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 2187 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 3912 | } | 2188 | } |
| 3913 | #[doc = "Capture/Compare 1 overcapture flag"] | 2189 | #[doc = "TI frame format error"] |
| 3914 | pub fn ccof(&self, n: usize) -> bool { | 2190 | pub const fn fre(&self) -> bool { |
| 3915 | assert!(n < 4usize); | 2191 | let val = (self.0 >> 8usize) & 0x01; |
| 3916 | let offs = 9usize + n * 1usize; | ||
| 3917 | let val = (self.0 >> offs) & 0x01; | ||
| 3918 | val != 0 | ||
| 3919 | } | ||
| 3920 | #[doc = "Capture/Compare 1 overcapture flag"] | ||
| 3921 | pub fn set_ccof(&mut self, n: usize, val: bool) { | ||
| 3922 | assert!(n < 4usize); | ||
| 3923 | let offs = 9usize + n * 1usize; | ||
| 3924 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 3925 | } | ||
| 3926 | } | ||
| 3927 | impl Default for SrAdv { | ||
| 3928 | fn default() -> SrAdv { | ||
| 3929 | SrAdv(0) | ||
| 3930 | } | ||
| 3931 | } | ||
| 3932 | #[doc = "control register 2"] | ||
| 3933 | #[repr(transparent)] | ||
| 3934 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3935 | pub struct Cr2Basic(pub u32); | ||
| 3936 | impl Cr2Basic { | ||
| 3937 | #[doc = "Master mode selection"] | ||
| 3938 | pub const fn mms(&self) -> super::vals::Mms { | ||
| 3939 | let val = (self.0 >> 4usize) & 0x07; | ||
| 3940 | super::vals::Mms(val as u8) | ||
| 3941 | } | ||
| 3942 | #[doc = "Master mode selection"] | ||
| 3943 | pub fn set_mms(&mut self, val: super::vals::Mms) { | ||
| 3944 | self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize); | ||
| 3945 | } | ||
| 3946 | } | ||
| 3947 | impl Default for Cr2Basic { | ||
| 3948 | fn default() -> Cr2Basic { | ||
| 3949 | Cr2Basic(0) | ||
| 3950 | } | ||
| 3951 | } | ||
| 3952 | #[doc = "capture/compare enable register"] | ||
| 3953 | #[repr(transparent)] | ||
| 3954 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3955 | pub struct CcerAdv(pub u32); | ||
| 3956 | impl CcerAdv { | ||
| 3957 | #[doc = "Capture/Compare 1 output enable"] | ||
| 3958 | pub fn cce(&self, n: usize) -> bool { | ||
| 3959 | assert!(n < 4usize); | ||
| 3960 | let offs = 0usize + n * 4usize; | ||
| 3961 | let val = (self.0 >> offs) & 0x01; | ||
| 3962 | val != 0 | ||
| 3963 | } | ||
| 3964 | #[doc = "Capture/Compare 1 output enable"] | ||
| 3965 | pub fn set_cce(&mut self, n: usize, val: bool) { | ||
| 3966 | assert!(n < 4usize); | ||
| 3967 | let offs = 0usize + n * 4usize; | ||
| 3968 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 3969 | } | ||
| 3970 | #[doc = "Capture/Compare 1 output Polarity"] | ||
| 3971 | pub fn ccp(&self, n: usize) -> bool { | ||
| 3972 | assert!(n < 4usize); | ||
| 3973 | let offs = 1usize + n * 4usize; | ||
| 3974 | let val = (self.0 >> offs) & 0x01; | ||
| 3975 | val != 0 | ||
| 3976 | } | ||
| 3977 | #[doc = "Capture/Compare 1 output Polarity"] | ||
| 3978 | pub fn set_ccp(&mut self, n: usize, val: bool) { | ||
| 3979 | assert!(n < 4usize); | ||
| 3980 | let offs = 1usize + n * 4usize; | ||
| 3981 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 3982 | } | ||
| 3983 | #[doc = "Capture/Compare 1 complementary output enable"] | ||
| 3984 | pub fn ccne(&self, n: usize) -> bool { | ||
| 3985 | assert!(n < 4usize); | ||
| 3986 | let offs = 2usize + n * 4usize; | ||
| 3987 | let val = (self.0 >> offs) & 0x01; | ||
| 3988 | val != 0 | ||
| 3989 | } | ||
| 3990 | #[doc = "Capture/Compare 1 complementary output enable"] | ||
| 3991 | pub fn set_ccne(&mut self, n: usize, val: bool) { | ||
| 3992 | assert!(n < 4usize); | ||
| 3993 | let offs = 2usize + n * 4usize; | ||
| 3994 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 3995 | } | ||
| 3996 | #[doc = "Capture/Compare 1 output Polarity"] | ||
| 3997 | pub fn ccnp(&self, n: usize) -> bool { | ||
| 3998 | assert!(n < 4usize); | ||
| 3999 | let offs = 3usize + n * 4usize; | ||
| 4000 | let val = (self.0 >> offs) & 0x01; | ||
| 4001 | val != 0 | 2192 | val != 0 |
| 4002 | } | 2193 | } |
| 4003 | #[doc = "Capture/Compare 1 output Polarity"] | 2194 | #[doc = "TI frame format error"] |
| 4004 | pub fn set_ccnp(&mut self, n: usize, val: bool) { | 2195 | pub fn set_fre(&mut self, val: bool) { |
| 4005 | assert!(n < 4usize); | 2196 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 4006 | let offs = 3usize + n * 4usize; | ||
| 4007 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 4008 | } | 2197 | } |
| 4009 | } | 2198 | } |
| 4010 | impl Default for CcerAdv { | 2199 | impl Default for Sr { |
| 4011 | fn default() -> CcerAdv { | 2200 | fn default() -> Sr { |
| 4012 | CcerAdv(0) | 2201 | Sr(0) |
| 4013 | } | 2202 | } |
| 4014 | } | 2203 | } |
| 4015 | #[doc = "DMA control register"] | 2204 | #[doc = "control register 1"] |
| 4016 | #[repr(transparent)] | 2205 | #[repr(transparent)] |
| 4017 | #[derive(Copy, Clone, Eq, PartialEq)] | 2206 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 4018 | pub struct Dcr(pub u32); | 2207 | pub struct Cr1(pub u32); |
| 4019 | impl Dcr { | 2208 | impl Cr1 { |
| 4020 | #[doc = "DMA base address"] | 2209 | #[doc = "Clock phase"] |
| 4021 | pub const fn dba(&self) -> u8 { | 2210 | pub const fn cpha(&self) -> super::vals::Cpha { |
| 4022 | let val = (self.0 >> 0usize) & 0x1f; | 2211 | let val = (self.0 >> 0usize) & 0x01; |
| 4023 | val as u8 | 2212 | super::vals::Cpha(val as u8) |
| 4024 | } | ||
| 4025 | #[doc = "DMA base address"] | ||
| 4026 | pub fn set_dba(&mut self, val: u8) { | ||
| 4027 | self.0 = (self.0 & !(0x1f << 0usize)) | (((val as u32) & 0x1f) << 0usize); | ||
| 4028 | } | ||
| 4029 | #[doc = "DMA burst length"] | ||
| 4030 | pub const fn dbl(&self) -> u8 { | ||
| 4031 | let val = (self.0 >> 8usize) & 0x1f; | ||
| 4032 | val as u8 | ||
| 4033 | } | ||
| 4034 | #[doc = "DMA burst length"] | ||
| 4035 | pub fn set_dbl(&mut self, val: u8) { | ||
| 4036 | self.0 = (self.0 & !(0x1f << 8usize)) | (((val as u32) & 0x1f) << 8usize); | ||
| 4037 | } | 2213 | } |
| 4038 | } | 2214 | #[doc = "Clock phase"] |
| 4039 | impl Default for Dcr { | 2215 | pub fn set_cpha(&mut self, val: super::vals::Cpha) { |
| 4040 | fn default() -> Dcr { | 2216 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 4041 | Dcr(0) | ||
| 4042 | } | 2217 | } |
| 4043 | } | 2218 | #[doc = "Clock polarity"] |
| 4044 | #[doc = "DMA/Interrupt enable register"] | 2219 | pub const fn cpol(&self) -> super::vals::Cpol { |
| 4045 | #[repr(transparent)] | 2220 | let val = (self.0 >> 1usize) & 0x01; |
| 4046 | #[derive(Copy, Clone, Eq, PartialEq)] | 2221 | super::vals::Cpol(val as u8) |
| 4047 | pub struct DierAdv(pub u32); | ||
| 4048 | impl DierAdv { | ||
| 4049 | #[doc = "Update interrupt enable"] | ||
| 4050 | pub const fn uie(&self) -> bool { | ||
| 4051 | let val = (self.0 >> 0usize) & 0x01; | ||
| 4052 | val != 0 | ||
| 4053 | } | 2222 | } |
| 4054 | #[doc = "Update interrupt enable"] | 2223 | #[doc = "Clock polarity"] |
| 4055 | pub fn set_uie(&mut self, val: bool) { | 2224 | pub fn set_cpol(&mut self, val: super::vals::Cpol) { |
| 4056 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 2225 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); |
| 4057 | } | 2226 | } |
| 4058 | #[doc = "Capture/Compare 1 interrupt enable"] | 2227 | #[doc = "Master selection"] |
| 4059 | pub fn ccie(&self, n: usize) -> bool { | 2228 | pub const fn mstr(&self) -> super::vals::Mstr { |
| 4060 | assert!(n < 4usize); | 2229 | let val = (self.0 >> 2usize) & 0x01; |
| 4061 | let offs = 1usize + n * 1usize; | 2230 | super::vals::Mstr(val as u8) |
| 4062 | let val = (self.0 >> offs) & 0x01; | ||
| 4063 | val != 0 | ||
| 4064 | } | 2231 | } |
| 4065 | #[doc = "Capture/Compare 1 interrupt enable"] | 2232 | #[doc = "Master selection"] |
| 4066 | pub fn set_ccie(&mut self, n: usize, val: bool) { | 2233 | pub fn set_mstr(&mut self, val: super::vals::Mstr) { |
| 4067 | assert!(n < 4usize); | 2234 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); |
| 4068 | let offs = 1usize + n * 1usize; | ||
| 4069 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 4070 | } | 2235 | } |
| 4071 | #[doc = "COM interrupt enable"] | 2236 | #[doc = "Baud rate control"] |
| 4072 | pub const fn comie(&self) -> bool { | 2237 | pub const fn br(&self) -> super::vals::Br { |
| 4073 | let val = (self.0 >> 5usize) & 0x01; | 2238 | let val = (self.0 >> 3usize) & 0x07; |
| 4074 | val != 0 | 2239 | super::vals::Br(val as u8) |
| 4075 | } | 2240 | } |
| 4076 | #[doc = "COM interrupt enable"] | 2241 | #[doc = "Baud rate control"] |
| 4077 | pub fn set_comie(&mut self, val: bool) { | 2242 | pub fn set_br(&mut self, val: super::vals::Br) { |
| 4078 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 2243 | self.0 = (self.0 & !(0x07 << 3usize)) | (((val.0 as u32) & 0x07) << 3usize); |
| 4079 | } | 2244 | } |
| 4080 | #[doc = "Trigger interrupt enable"] | 2245 | #[doc = "SPI enable"] |
| 4081 | pub const fn tie(&self) -> bool { | 2246 | pub const fn spe(&self) -> bool { |
| 4082 | let val = (self.0 >> 6usize) & 0x01; | 2247 | let val = (self.0 >> 6usize) & 0x01; |
| 4083 | val != 0 | 2248 | val != 0 |
| 4084 | } | 2249 | } |
| 4085 | #[doc = "Trigger interrupt enable"] | 2250 | #[doc = "SPI enable"] |
| 4086 | pub fn set_tie(&mut self, val: bool) { | 2251 | pub fn set_spe(&mut self, val: bool) { |
| 4087 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 2252 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 4088 | } | 2253 | } |
| 4089 | #[doc = "Break interrupt enable"] | 2254 | #[doc = "Frame format"] |
| 4090 | pub const fn bie(&self) -> bool { | 2255 | pub const fn lsbfirst(&self) -> super::vals::Lsbfirst { |
| 4091 | let val = (self.0 >> 7usize) & 0x01; | 2256 | let val = (self.0 >> 7usize) & 0x01; |
| 4092 | val != 0 | 2257 | super::vals::Lsbfirst(val as u8) |
| 4093 | } | 2258 | } |
| 4094 | #[doc = "Break interrupt enable"] | 2259 | #[doc = "Frame format"] |
| 4095 | pub fn set_bie(&mut self, val: bool) { | 2260 | pub fn set_lsbfirst(&mut self, val: super::vals::Lsbfirst) { |
| 4096 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 2261 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); |
| 4097 | } | 2262 | } |
| 4098 | #[doc = "Update DMA request enable"] | 2263 | #[doc = "Internal slave select"] |
| 4099 | pub const fn ude(&self) -> bool { | 2264 | pub const fn ssi(&self) -> bool { |
| 4100 | let val = (self.0 >> 8usize) & 0x01; | 2265 | let val = (self.0 >> 8usize) & 0x01; |
| 4101 | val != 0 | 2266 | val != 0 |
| 4102 | } | 2267 | } |
| 4103 | #[doc = "Update DMA request enable"] | 2268 | #[doc = "Internal slave select"] |
| 4104 | pub fn set_ude(&mut self, val: bool) { | 2269 | pub fn set_ssi(&mut self, val: bool) { |
| 4105 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 2270 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 4106 | } | 2271 | } |
| 4107 | #[doc = "Capture/Compare 1 DMA request enable"] | 2272 | #[doc = "Software slave management"] |
| 4108 | pub fn ccde(&self, n: usize) -> bool { | 2273 | pub const fn ssm(&self) -> bool { |
| 4109 | assert!(n < 4usize); | 2274 | let val = (self.0 >> 9usize) & 0x01; |
| 4110 | let offs = 9usize + n * 1usize; | ||
| 4111 | let val = (self.0 >> offs) & 0x01; | ||
| 4112 | val != 0 | ||
| 4113 | } | ||
| 4114 | #[doc = "Capture/Compare 1 DMA request enable"] | ||
| 4115 | pub fn set_ccde(&mut self, n: usize, val: bool) { | ||
| 4116 | assert!(n < 4usize); | ||
| 4117 | let offs = 9usize + n * 1usize; | ||
| 4118 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 4119 | } | ||
| 4120 | #[doc = "COM DMA request enable"] | ||
| 4121 | pub const fn comde(&self) -> bool { | ||
| 4122 | let val = (self.0 >> 13usize) & 0x01; | ||
| 4123 | val != 0 | ||
| 4124 | } | ||
| 4125 | #[doc = "COM DMA request enable"] | ||
| 4126 | pub fn set_comde(&mut self, val: bool) { | ||
| 4127 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | ||
| 4128 | } | ||
| 4129 | #[doc = "Trigger DMA request enable"] | ||
| 4130 | pub const fn tde(&self) -> bool { | ||
| 4131 | let val = (self.0 >> 14usize) & 0x01; | ||
| 4132 | val != 0 | 2275 | val != 0 |
| 4133 | } | 2276 | } |
| 4134 | #[doc = "Trigger DMA request enable"] | 2277 | #[doc = "Software slave management"] |
| 4135 | pub fn set_tde(&mut self, val: bool) { | 2278 | pub fn set_ssm(&mut self, val: bool) { |
| 4136 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | 2279 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); |
| 4137 | } | ||
| 4138 | } | ||
| 4139 | impl Default for DierAdv { | ||
| 4140 | fn default() -> DierAdv { | ||
| 4141 | DierAdv(0) | ||
| 4142 | } | ||
| 4143 | } | ||
| 4144 | #[doc = "break and dead-time register"] | ||
| 4145 | #[repr(transparent)] | ||
| 4146 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4147 | pub struct Bdtr(pub u32); | ||
| 4148 | impl Bdtr { | ||
| 4149 | #[doc = "Dead-time generator setup"] | ||
| 4150 | pub const fn dtg(&self) -> u8 { | ||
| 4151 | let val = (self.0 >> 0usize) & 0xff; | ||
| 4152 | val as u8 | ||
| 4153 | } | ||
| 4154 | #[doc = "Dead-time generator setup"] | ||
| 4155 | pub fn set_dtg(&mut self, val: u8) { | ||
| 4156 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | ||
| 4157 | } | ||
| 4158 | #[doc = "Lock configuration"] | ||
| 4159 | pub const fn lock(&self) -> u8 { | ||
| 4160 | let val = (self.0 >> 8usize) & 0x03; | ||
| 4161 | val as u8 | ||
| 4162 | } | ||
| 4163 | #[doc = "Lock configuration"] | ||
| 4164 | pub fn set_lock(&mut self, val: u8) { | ||
| 4165 | self.0 = (self.0 & !(0x03 << 8usize)) | (((val as u32) & 0x03) << 8usize); | ||
| 4166 | } | 2280 | } |
| 4167 | #[doc = "Off-state selection for Idle mode"] | 2281 | #[doc = "Receive only"] |
| 4168 | pub const fn ossi(&self) -> super::vals::Ossi { | 2282 | pub const fn rxonly(&self) -> super::vals::Rxonly { |
| 4169 | let val = (self.0 >> 10usize) & 0x01; | 2283 | let val = (self.0 >> 10usize) & 0x01; |
| 4170 | super::vals::Ossi(val as u8) | 2284 | super::vals::Rxonly(val as u8) |
| 4171 | } | 2285 | } |
| 4172 | #[doc = "Off-state selection for Idle mode"] | 2286 | #[doc = "Receive only"] |
| 4173 | pub fn set_ossi(&mut self, val: super::vals::Ossi) { | 2287 | pub fn set_rxonly(&mut self, val: super::vals::Rxonly) { |
| 4174 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); | 2288 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); |
| 4175 | } | 2289 | } |
| 4176 | #[doc = "Off-state selection for Run mode"] | 2290 | #[doc = "Data frame format"] |
| 4177 | pub const fn ossr(&self) -> super::vals::Ossr { | 2291 | pub const fn dff(&self) -> super::vals::Dff { |
| 4178 | let val = (self.0 >> 11usize) & 0x01; | 2292 | let val = (self.0 >> 11usize) & 0x01; |
| 4179 | super::vals::Ossr(val as u8) | 2293 | super::vals::Dff(val as u8) |
| 4180 | } | 2294 | } |
| 4181 | #[doc = "Off-state selection for Run mode"] | 2295 | #[doc = "Data frame format"] |
| 4182 | pub fn set_ossr(&mut self, val: super::vals::Ossr) { | 2296 | pub fn set_dff(&mut self, val: super::vals::Dff) { |
| 4183 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); | 2297 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); |
| 4184 | } | 2298 | } |
| 4185 | #[doc = "Break enable"] | 2299 | #[doc = "CRC transfer next"] |
| 4186 | pub const fn bke(&self) -> bool { | 2300 | pub const fn crcnext(&self) -> super::vals::Crcnext { |
| 4187 | let val = (self.0 >> 12usize) & 0x01; | 2301 | let val = (self.0 >> 12usize) & 0x01; |
| 4188 | val != 0 | 2302 | super::vals::Crcnext(val as u8) |
| 4189 | } | 2303 | } |
| 4190 | #[doc = "Break enable"] | 2304 | #[doc = "CRC transfer next"] |
| 4191 | pub fn set_bke(&mut self, val: bool) { | 2305 | pub fn set_crcnext(&mut self, val: super::vals::Crcnext) { |
| 4192 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); | 2306 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); |
| 4193 | } | 2307 | } |
| 4194 | #[doc = "Break polarity"] | 2308 | #[doc = "Hardware CRC calculation enable"] |
| 4195 | pub const fn bkp(&self) -> bool { | 2309 | pub const fn crcen(&self) -> bool { |
| 4196 | let val = (self.0 >> 13usize) & 0x01; | 2310 | let val = (self.0 >> 13usize) & 0x01; |
| 4197 | val != 0 | 2311 | val != 0 |
| 4198 | } | 2312 | } |
| 4199 | #[doc = "Break polarity"] | 2313 | #[doc = "Hardware CRC calculation enable"] |
| 4200 | pub fn set_bkp(&mut self, val: bool) { | 2314 | pub fn set_crcen(&mut self, val: bool) { |
| 4201 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | 2315 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); |
| 4202 | } | 2316 | } |
| 4203 | #[doc = "Automatic output enable"] | 2317 | #[doc = "Output enable in bidirectional mode"] |
| 4204 | pub const fn aoe(&self) -> bool { | 2318 | pub const fn bidioe(&self) -> super::vals::Bidioe { |
| 4205 | let val = (self.0 >> 14usize) & 0x01; | 2319 | let val = (self.0 >> 14usize) & 0x01; |
| 4206 | val != 0 | 2320 | super::vals::Bidioe(val as u8) |
| 4207 | } | 2321 | } |
| 4208 | #[doc = "Automatic output enable"] | 2322 | #[doc = "Output enable in bidirectional mode"] |
| 4209 | pub fn set_aoe(&mut self, val: bool) { | 2323 | pub fn set_bidioe(&mut self, val: super::vals::Bidioe) { |
| 4210 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | 2324 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); |
| 4211 | } | 2325 | } |
| 4212 | #[doc = "Main output enable"] | 2326 | #[doc = "Bidirectional data mode enable"] |
| 4213 | pub const fn moe(&self) -> bool { | 2327 | pub const fn bidimode(&self) -> super::vals::Bidimode { |
| 4214 | let val = (self.0 >> 15usize) & 0x01; | 2328 | let val = (self.0 >> 15usize) & 0x01; |
| 4215 | val != 0 | 2329 | super::vals::Bidimode(val as u8) |
| 4216 | } | 2330 | } |
| 4217 | #[doc = "Main output enable"] | 2331 | #[doc = "Bidirectional data mode enable"] |
| 4218 | pub fn set_moe(&mut self, val: bool) { | 2332 | pub fn set_bidimode(&mut self, val: super::vals::Bidimode) { |
| 4219 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); | 2333 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); |
| 4220 | } | 2334 | } |
| 4221 | } | 2335 | } |
| 4222 | impl Default for Bdtr { | 2336 | impl Default for Cr1 { |
| 4223 | fn default() -> Bdtr { | 2337 | fn default() -> Cr1 { |
| 4224 | Bdtr(0) | 2338 | Cr1(0) |
| 4225 | } | 2339 | } |
| 4226 | } | 2340 | } |
| 4227 | #[doc = "event generation register"] | 2341 | #[doc = "RX CRC register"] |
| 4228 | #[repr(transparent)] | 2342 | #[repr(transparent)] |
| 4229 | #[derive(Copy, Clone, Eq, PartialEq)] | 2343 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 4230 | pub struct EgrAdv(pub u32); | 2344 | pub struct Rxcrcr(pub u32); |
| 4231 | impl EgrAdv { | 2345 | impl Rxcrcr { |
| 4232 | #[doc = "Update generation"] | 2346 | #[doc = "Rx CRC register"] |
| 4233 | pub const fn ug(&self) -> bool { | 2347 | pub const fn rx_crc(&self) -> u16 { |
| 4234 | let val = (self.0 >> 0usize) & 0x01; | 2348 | let val = (self.0 >> 0usize) & 0xffff; |
| 4235 | val != 0 | 2349 | val as u16 |
| 4236 | } | ||
| 4237 | #[doc = "Update generation"] | ||
| 4238 | pub fn set_ug(&mut self, val: bool) { | ||
| 4239 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 4240 | } | ||
| 4241 | #[doc = "Capture/compare 1 generation"] | ||
| 4242 | pub fn ccg(&self, n: usize) -> bool { | ||
| 4243 | assert!(n < 4usize); | ||
| 4244 | let offs = 1usize + n * 1usize; | ||
| 4245 | let val = (self.0 >> offs) & 0x01; | ||
| 4246 | val != 0 | ||
| 4247 | } | ||
| 4248 | #[doc = "Capture/compare 1 generation"] | ||
| 4249 | pub fn set_ccg(&mut self, n: usize, val: bool) { | ||
| 4250 | assert!(n < 4usize); | ||
| 4251 | let offs = 1usize + n * 1usize; | ||
| 4252 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 4253 | } | ||
| 4254 | #[doc = "Capture/Compare control update generation"] | ||
| 4255 | pub const fn comg(&self) -> bool { | ||
| 4256 | let val = (self.0 >> 5usize) & 0x01; | ||
| 4257 | val != 0 | ||
| 4258 | } | ||
| 4259 | #[doc = "Capture/Compare control update generation"] | ||
| 4260 | pub fn set_comg(&mut self, val: bool) { | ||
| 4261 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 4262 | } | ||
| 4263 | #[doc = "Trigger generation"] | ||
| 4264 | pub const fn tg(&self) -> bool { | ||
| 4265 | let val = (self.0 >> 6usize) & 0x01; | ||
| 4266 | val != 0 | ||
| 4267 | } | ||
| 4268 | #[doc = "Trigger generation"] | ||
| 4269 | pub fn set_tg(&mut self, val: bool) { | ||
| 4270 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 4271 | } | ||
| 4272 | #[doc = "Break generation"] | ||
| 4273 | pub const fn bg(&self) -> bool { | ||
| 4274 | let val = (self.0 >> 7usize) & 0x01; | ||
| 4275 | val != 0 | ||
| 4276 | } | 2350 | } |
| 4277 | #[doc = "Break generation"] | 2351 | #[doc = "Rx CRC register"] |
| 4278 | pub fn set_bg(&mut self, val: bool) { | 2352 | pub fn set_rx_crc(&mut self, val: u16) { |
| 4279 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 2353 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); |
| 4280 | } | 2354 | } |
| 4281 | } | 2355 | } |
| 4282 | impl Default for EgrAdv { | 2356 | impl Default for Rxcrcr { |
| 4283 | fn default() -> EgrAdv { | 2357 | fn default() -> Rxcrcr { |
| 4284 | EgrAdv(0) | 2358 | Rxcrcr(0) |
| 4285 | } | 2359 | } |
| 4286 | } | 2360 | } |
| 4287 | #[doc = "status register"] | 2361 | #[doc = "CRC polynomial register"] |
| 4288 | #[repr(transparent)] | 2362 | #[repr(transparent)] |
| 4289 | #[derive(Copy, Clone, Eq, PartialEq)] | 2363 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 4290 | pub struct SrBasic(pub u32); | 2364 | pub struct Crcpr(pub u32); |
| 4291 | impl SrBasic { | 2365 | impl Crcpr { |
| 4292 | #[doc = "Update interrupt flag"] | 2366 | #[doc = "CRC polynomial register"] |
| 4293 | pub const fn uif(&self) -> bool { | 2367 | pub const fn crcpoly(&self) -> u16 { |
| 4294 | let val = (self.0 >> 0usize) & 0x01; | 2368 | let val = (self.0 >> 0usize) & 0xffff; |
| 4295 | val != 0 | 2369 | val as u16 |
| 4296 | } | 2370 | } |
| 4297 | #[doc = "Update interrupt flag"] | 2371 | #[doc = "CRC polynomial register"] |
| 4298 | pub fn set_uif(&mut self, val: bool) { | 2372 | pub fn set_crcpoly(&mut self, val: u16) { |
| 4299 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 2373 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); |
| 4300 | } | 2374 | } |
| 4301 | } | 2375 | } |
| 4302 | impl Default for SrBasic { | 2376 | impl Default for Crcpr { |
| 4303 | fn default() -> SrBasic { | 2377 | fn default() -> Crcpr { |
| 4304 | SrBasic(0) | 2378 | Crcpr(0) |
| 4305 | } | 2379 | } |
| 4306 | } | 2380 | } |
| 4307 | #[doc = "auto-reload register"] | 2381 | } |
| 4308 | #[repr(transparent)] | 2382 | } |
| 4309 | #[derive(Copy, Clone, Eq, PartialEq)] | 2383 | pub mod gpio_v2 { |
| 4310 | pub struct Arr32(pub u32); | 2384 | use crate::generic::*; |
| 4311 | impl Arr32 { | 2385 | #[doc = "General-purpose I/Os"] |
| 4312 | #[doc = "Auto-reload value"] | 2386 | #[derive(Copy, Clone)] |
| 4313 | pub const fn arr(&self) -> u32 { | 2387 | pub struct Gpio(pub *mut u8); |
| 4314 | let val = (self.0 >> 0usize) & 0xffff_ffff; | 2388 | unsafe impl Send for Gpio {} |
| 4315 | val as u32 | 2389 | unsafe impl Sync for Gpio {} |
| 4316 | } | 2390 | impl Gpio { |
| 4317 | #[doc = "Auto-reload value"] | 2391 | #[doc = "GPIO port mode register"] |
| 4318 | pub fn set_arr(&mut self, val: u32) { | 2392 | pub fn moder(self) -> Reg<regs::Moder, RW> { |
| 4319 | self.0 = | 2393 | unsafe { Reg::from_ptr(self.0.add(0usize)) } |
| 4320 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 4321 | } | ||
| 4322 | } | 2394 | } |
| 4323 | impl Default for Arr32 { | 2395 | #[doc = "GPIO port output type register"] |
| 4324 | fn default() -> Arr32 { | 2396 | pub fn otyper(self) -> Reg<regs::Otyper, RW> { |
| 4325 | Arr32(0) | 2397 | unsafe { Reg::from_ptr(self.0.add(4usize)) } |
| 4326 | } | ||
| 4327 | } | 2398 | } |
| 4328 | #[doc = "counter"] | 2399 | #[doc = "GPIO port output speed register"] |
| 4329 | #[repr(transparent)] | 2400 | pub fn ospeedr(self) -> Reg<regs::Ospeedr, RW> { |
| 4330 | #[derive(Copy, Clone, Eq, PartialEq)] | 2401 | unsafe { Reg::from_ptr(self.0.add(8usize)) } |
| 4331 | pub struct Cnt16(pub u32); | ||
| 4332 | impl Cnt16 { | ||
| 4333 | #[doc = "counter value"] | ||
| 4334 | pub const fn cnt(&self) -> u16 { | ||
| 4335 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 4336 | val as u16 | ||
| 4337 | } | ||
| 4338 | #[doc = "counter value"] | ||
| 4339 | pub fn set_cnt(&mut self, val: u16) { | ||
| 4340 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 4341 | } | ||
| 4342 | } | 2402 | } |
| 4343 | impl Default for Cnt16 { | 2403 | #[doc = "GPIO port pull-up/pull-down register"] |
| 4344 | fn default() -> Cnt16 { | 2404 | pub fn pupdr(self) -> Reg<regs::Pupdr, RW> { |
| 4345 | Cnt16(0) | 2405 | unsafe { Reg::from_ptr(self.0.add(12usize)) } |
| 4346 | } | ||
| 4347 | } | 2406 | } |
| 4348 | #[doc = "DMA/Interrupt enable register"] | 2407 | #[doc = "GPIO port input data register"] |
| 2408 | pub fn idr(self) -> Reg<regs::Idr, R> { | ||
| 2409 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 2410 | } | ||
| 2411 | #[doc = "GPIO port output data register"] | ||
| 2412 | pub fn odr(self) -> Reg<regs::Odr, RW> { | ||
| 2413 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 2414 | } | ||
| 2415 | #[doc = "GPIO port bit set/reset register"] | ||
| 2416 | pub fn bsrr(self) -> Reg<regs::Bsrr, W> { | ||
| 2417 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | ||
| 2418 | } | ||
| 2419 | #[doc = "GPIO port configuration lock register"] | ||
| 2420 | pub fn lckr(self) -> Reg<regs::Lckr, RW> { | ||
| 2421 | unsafe { Reg::from_ptr(self.0.add(28usize)) } | ||
| 2422 | } | ||
| 2423 | #[doc = "GPIO alternate function register (low, high)"] | ||
| 2424 | pub fn afr(self, n: usize) -> Reg<regs::Afr, RW> { | ||
| 2425 | assert!(n < 2usize); | ||
| 2426 | unsafe { Reg::from_ptr(self.0.add(32usize + n * 4usize)) } | ||
| 2427 | } | ||
| 2428 | } | ||
| 2429 | pub mod regs { | ||
| 2430 | use crate::generic::*; | ||
| 2431 | #[doc = "GPIO port mode register"] | ||
| 4349 | #[repr(transparent)] | 2432 | #[repr(transparent)] |
| 4350 | #[derive(Copy, Clone, Eq, PartialEq)] | 2433 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 4351 | pub struct DierGp(pub u32); | 2434 | pub struct Moder(pub u32); |
| 4352 | impl DierGp { | 2435 | impl Moder { |
| 4353 | #[doc = "Update interrupt enable"] | 2436 | #[doc = "Port x configuration bits (y = 0..15)"] |
| 4354 | pub const fn uie(&self) -> bool { | 2437 | pub fn moder(&self, n: usize) -> super::vals::Moder { |
| 4355 | let val = (self.0 >> 0usize) & 0x01; | 2438 | assert!(n < 16usize); |
| 4356 | val != 0 | 2439 | let offs = 0usize + n * 2usize; |
| 4357 | } | 2440 | let val = (self.0 >> offs) & 0x03; |
| 4358 | #[doc = "Update interrupt enable"] | 2441 | super::vals::Moder(val as u8) |
| 4359 | pub fn set_uie(&mut self, val: bool) { | ||
| 4360 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 4361 | } | ||
| 4362 | #[doc = "Capture/Compare 1 interrupt enable"] | ||
| 4363 | pub fn ccie(&self, n: usize) -> bool { | ||
| 4364 | assert!(n < 4usize); | ||
| 4365 | let offs = 1usize + n * 1usize; | ||
| 4366 | let val = (self.0 >> offs) & 0x01; | ||
| 4367 | val != 0 | ||
| 4368 | } | ||
| 4369 | #[doc = "Capture/Compare 1 interrupt enable"] | ||
| 4370 | pub fn set_ccie(&mut self, n: usize, val: bool) { | ||
| 4371 | assert!(n < 4usize); | ||
| 4372 | let offs = 1usize + n * 1usize; | ||
| 4373 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 4374 | } | ||
| 4375 | #[doc = "Trigger interrupt enable"] | ||
| 4376 | pub const fn tie(&self) -> bool { | ||
| 4377 | let val = (self.0 >> 6usize) & 0x01; | ||
| 4378 | val != 0 | ||
| 4379 | } | ||
| 4380 | #[doc = "Trigger interrupt enable"] | ||
| 4381 | pub fn set_tie(&mut self, val: bool) { | ||
| 4382 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 4383 | } | ||
| 4384 | #[doc = "Update DMA request enable"] | ||
| 4385 | pub const fn ude(&self) -> bool { | ||
| 4386 | let val = (self.0 >> 8usize) & 0x01; | ||
| 4387 | val != 0 | ||
| 4388 | } | ||
| 4389 | #[doc = "Update DMA request enable"] | ||
| 4390 | pub fn set_ude(&mut self, val: bool) { | ||
| 4391 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 4392 | } | ||
| 4393 | #[doc = "Capture/Compare 1 DMA request enable"] | ||
| 4394 | pub fn ccde(&self, n: usize) -> bool { | ||
| 4395 | assert!(n < 4usize); | ||
| 4396 | let offs = 9usize + n * 1usize; | ||
| 4397 | let val = (self.0 >> offs) & 0x01; | ||
| 4398 | val != 0 | ||
| 4399 | } | ||
| 4400 | #[doc = "Capture/Compare 1 DMA request enable"] | ||
| 4401 | pub fn set_ccde(&mut self, n: usize, val: bool) { | ||
| 4402 | assert!(n < 4usize); | ||
| 4403 | let offs = 9usize + n * 1usize; | ||
| 4404 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 4405 | } | ||
| 4406 | #[doc = "Trigger DMA request enable"] | ||
| 4407 | pub const fn tde(&self) -> bool { | ||
| 4408 | let val = (self.0 >> 14usize) & 0x01; | ||
| 4409 | val != 0 | ||
| 4410 | } | 2442 | } |
| 4411 | #[doc = "Trigger DMA request enable"] | 2443 | #[doc = "Port x configuration bits (y = 0..15)"] |
| 4412 | pub fn set_tde(&mut self, val: bool) { | 2444 | pub fn set_moder(&mut self, n: usize, val: super::vals::Moder) { |
| 4413 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | 2445 | assert!(n < 16usize); |
| 2446 | let offs = 0usize + n * 2usize; | ||
| 2447 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | ||
| 4414 | } | 2448 | } |
| 4415 | } | 2449 | } |
| 4416 | impl Default for DierGp { | 2450 | impl Default for Moder { |
| 4417 | fn default() -> DierGp { | 2451 | fn default() -> Moder { |
| 4418 | DierGp(0) | 2452 | Moder(0) |
| 4419 | } | 2453 | } |
| 4420 | } | 2454 | } |
| 4421 | #[doc = "prescaler"] | 2455 | #[doc = "GPIO port output type register"] |
| 4422 | #[repr(transparent)] | 2456 | #[repr(transparent)] |
| 4423 | #[derive(Copy, Clone, Eq, PartialEq)] | 2457 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 4424 | pub struct Psc(pub u32); | 2458 | pub struct Otyper(pub u32); |
| 4425 | impl Psc { | 2459 | impl Otyper { |
| 4426 | #[doc = "Prescaler value"] | 2460 | #[doc = "Port x configuration bits (y = 0..15)"] |
| 4427 | pub const fn psc(&self) -> u16 { | 2461 | pub fn ot(&self, n: usize) -> super::vals::Ot { |
| 4428 | let val = (self.0 >> 0usize) & 0xffff; | 2462 | assert!(n < 16usize); |
| 4429 | val as u16 | 2463 | let offs = 0usize + n * 1usize; |
| 2464 | let val = (self.0 >> offs) & 0x01; | ||
| 2465 | super::vals::Ot(val as u8) | ||
| 4430 | } | 2466 | } |
| 4431 | #[doc = "Prescaler value"] | 2467 | #[doc = "Port x configuration bits (y = 0..15)"] |
| 4432 | pub fn set_psc(&mut self, val: u16) { | 2468 | pub fn set_ot(&mut self, n: usize, val: super::vals::Ot) { |
| 4433 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | 2469 | assert!(n < 16usize); |
| 2470 | let offs = 0usize + n * 1usize; | ||
| 2471 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 4434 | } | 2472 | } |
| 4435 | } | 2473 | } |
| 4436 | impl Default for Psc { | 2474 | impl Default for Otyper { |
| 4437 | fn default() -> Psc { | 2475 | fn default() -> Otyper { |
| 4438 | Psc(0) | 2476 | Otyper(0) |
| 4439 | } | 2477 | } |
| 4440 | } | 2478 | } |
| 4441 | #[doc = "event generation register"] | 2479 | #[doc = "GPIO alternate function register"] |
| 4442 | #[repr(transparent)] | 2480 | #[repr(transparent)] |
| 4443 | #[derive(Copy, Clone, Eq, PartialEq)] | 2481 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 4444 | pub struct EgrBasic(pub u32); | 2482 | pub struct Afr(pub u32); |
| 4445 | impl EgrBasic { | 2483 | impl Afr { |
| 4446 | #[doc = "Update generation"] | 2484 | #[doc = "Alternate function selection for port x bit y (y = 0..15)"] |
| 4447 | pub const fn ug(&self) -> bool { | 2485 | pub fn afr(&self, n: usize) -> super::vals::Afr { |
| 4448 | let val = (self.0 >> 0usize) & 0x01; | 2486 | assert!(n < 8usize); |
| 4449 | val != 0 | 2487 | let offs = 0usize + n * 4usize; |
| 2488 | let val = (self.0 >> offs) & 0x0f; | ||
| 2489 | super::vals::Afr(val as u8) | ||
| 4450 | } | 2490 | } |
| 4451 | #[doc = "Update generation"] | 2491 | #[doc = "Alternate function selection for port x bit y (y = 0..15)"] |
| 4452 | pub fn set_ug(&mut self, val: bool) { | 2492 | pub fn set_afr(&mut self, n: usize, val: super::vals::Afr) { |
| 4453 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 2493 | assert!(n < 8usize); |
| 2494 | let offs = 0usize + n * 4usize; | ||
| 2495 | self.0 = (self.0 & !(0x0f << offs)) | (((val.0 as u32) & 0x0f) << offs); | ||
| 4454 | } | 2496 | } |
| 4455 | } | 2497 | } |
| 4456 | impl Default for EgrBasic { | 2498 | impl Default for Afr { |
| 4457 | fn default() -> EgrBasic { | 2499 | fn default() -> Afr { |
| 4458 | EgrBasic(0) | 2500 | Afr(0) |
| 4459 | } | 2501 | } |
| 4460 | } | 2502 | } |
| 4461 | #[doc = "DMA address for full transfer"] | 2503 | #[doc = "GPIO port output data register"] |
| 4462 | #[repr(transparent)] | 2504 | #[repr(transparent)] |
| 4463 | #[derive(Copy, Clone, Eq, PartialEq)] | 2505 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 4464 | pub struct Dmar(pub u32); | 2506 | pub struct Odr(pub u32); |
| 4465 | impl Dmar { | 2507 | impl Odr { |
| 4466 | #[doc = "DMA register for burst accesses"] | 2508 | #[doc = "Port output data (y = 0..15)"] |
| 4467 | pub const fn dmab(&self) -> u16 { | 2509 | pub fn odr(&self, n: usize) -> super::vals::Odr { |
| 4468 | let val = (self.0 >> 0usize) & 0xffff; | 2510 | assert!(n < 16usize); |
| 4469 | val as u16 | 2511 | let offs = 0usize + n * 1usize; |
| 2512 | let val = (self.0 >> offs) & 0x01; | ||
| 2513 | super::vals::Odr(val as u8) | ||
| 4470 | } | 2514 | } |
| 4471 | #[doc = "DMA register for burst accesses"] | 2515 | #[doc = "Port output data (y = 0..15)"] |
| 4472 | pub fn set_dmab(&mut self, val: u16) { | 2516 | pub fn set_odr(&mut self, n: usize, val: super::vals::Odr) { |
| 4473 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | 2517 | assert!(n < 16usize); |
| 2518 | let offs = 0usize + n * 1usize; | ||
| 2519 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 4474 | } | 2520 | } |
| 4475 | } | 2521 | } |
| 4476 | impl Default for Dmar { | 2522 | impl Default for Odr { |
| 4477 | fn default() -> Dmar { | 2523 | fn default() -> Odr { |
| 4478 | Dmar(0) | 2524 | Odr(0) |
| 4479 | } | 2525 | } |
| 4480 | } | 2526 | } |
| 4481 | #[doc = "capture/compare enable register"] | 2527 | #[doc = "GPIO port pull-up/pull-down register"] |
| 4482 | #[repr(transparent)] | 2528 | #[repr(transparent)] |
| 4483 | #[derive(Copy, Clone, Eq, PartialEq)] | 2529 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 4484 | pub struct CcerGp(pub u32); | 2530 | pub struct Pupdr(pub u32); |
| 4485 | impl CcerGp { | 2531 | impl Pupdr { |
| 4486 | #[doc = "Capture/Compare 1 output enable"] | 2532 | #[doc = "Port x configuration bits (y = 0..15)"] |
| 4487 | pub fn cce(&self, n: usize) -> bool { | 2533 | pub fn pupdr(&self, n: usize) -> super::vals::Pupdr { |
| 4488 | assert!(n < 4usize); | 2534 | assert!(n < 16usize); |
| 4489 | let offs = 0usize + n * 4usize; | 2535 | let offs = 0usize + n * 2usize; |
| 4490 | let val = (self.0 >> offs) & 0x01; | 2536 | let val = (self.0 >> offs) & 0x03; |
| 4491 | val != 0 | 2537 | super::vals::Pupdr(val as u8) |
| 4492 | } | ||
| 4493 | #[doc = "Capture/Compare 1 output enable"] | ||
| 4494 | pub fn set_cce(&mut self, n: usize, val: bool) { | ||
| 4495 | assert!(n < 4usize); | ||
| 4496 | let offs = 0usize + n * 4usize; | ||
| 4497 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 4498 | } | ||
| 4499 | #[doc = "Capture/Compare 1 output Polarity"] | ||
| 4500 | pub fn ccp(&self, n: usize) -> bool { | ||
| 4501 | assert!(n < 4usize); | ||
| 4502 | let offs = 1usize + n * 4usize; | ||
| 4503 | let val = (self.0 >> offs) & 0x01; | ||
| 4504 | val != 0 | ||
| 4505 | } | ||
| 4506 | #[doc = "Capture/Compare 1 output Polarity"] | ||
| 4507 | pub fn set_ccp(&mut self, n: usize, val: bool) { | ||
| 4508 | assert!(n < 4usize); | ||
| 4509 | let offs = 1usize + n * 4usize; | ||
| 4510 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 4511 | } | ||
| 4512 | #[doc = "Capture/Compare 1 output Polarity"] | ||
| 4513 | pub fn ccnp(&self, n: usize) -> bool { | ||
| 4514 | assert!(n < 4usize); | ||
| 4515 | let offs = 3usize + n * 4usize; | ||
| 4516 | let val = (self.0 >> offs) & 0x01; | ||
| 4517 | val != 0 | ||
| 4518 | } | 2538 | } |
| 4519 | #[doc = "Capture/Compare 1 output Polarity"] | 2539 | #[doc = "Port x configuration bits (y = 0..15)"] |
| 4520 | pub fn set_ccnp(&mut self, n: usize, val: bool) { | 2540 | pub fn set_pupdr(&mut self, n: usize, val: super::vals::Pupdr) { |
| 4521 | assert!(n < 4usize); | 2541 | assert!(n < 16usize); |
| 4522 | let offs = 3usize + n * 4usize; | 2542 | let offs = 0usize + n * 2usize; |
| 4523 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | 2543 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); |
| 4524 | } | 2544 | } |
| 4525 | } | 2545 | } |
| 4526 | impl Default for CcerGp { | 2546 | impl Default for Pupdr { |
| 4527 | fn default() -> CcerGp { | 2547 | fn default() -> Pupdr { |
| 4528 | CcerGp(0) | 2548 | Pupdr(0) |
| 4529 | } | 2549 | } |
| 4530 | } | 2550 | } |
| 4531 | } | 2551 | #[doc = "GPIO port input data register"] |
| 4532 | } | ||
| 4533 | pub mod gpio_v1 { | ||
| 4534 | use crate::generic::*; | ||
| 4535 | #[doc = "General purpose I/O"] | ||
| 4536 | #[derive(Copy, Clone)] | ||
| 4537 | pub struct Gpio(pub *mut u8); | ||
| 4538 | unsafe impl Send for Gpio {} | ||
| 4539 | unsafe impl Sync for Gpio {} | ||
| 4540 | impl Gpio { | ||
| 4541 | #[doc = "Port configuration register low (GPIOn_CRL)"] | ||
| 4542 | pub fn cr(self, n: usize) -> Reg<regs::Cr, RW> { | ||
| 4543 | assert!(n < 2usize); | ||
| 4544 | unsafe { Reg::from_ptr(self.0.add(0usize + n * 4usize)) } | ||
| 4545 | } | ||
| 4546 | #[doc = "Port input data register (GPIOn_IDR)"] | ||
| 4547 | pub fn idr(self) -> Reg<regs::Idr, R> { | ||
| 4548 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 4549 | } | ||
| 4550 | #[doc = "Port output data register (GPIOn_ODR)"] | ||
| 4551 | pub fn odr(self) -> Reg<regs::Odr, RW> { | ||
| 4552 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 4553 | } | ||
| 4554 | #[doc = "Port bit set/reset register (GPIOn_BSRR)"] | ||
| 4555 | pub fn bsrr(self) -> Reg<regs::Bsrr, W> { | ||
| 4556 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 4557 | } | ||
| 4558 | #[doc = "Port bit reset register (GPIOn_BRR)"] | ||
| 4559 | pub fn brr(self) -> Reg<regs::Brr, W> { | ||
| 4560 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 4561 | } | ||
| 4562 | #[doc = "Port configuration lock register"] | ||
| 4563 | pub fn lckr(self) -> Reg<regs::Lckr, RW> { | ||
| 4564 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | ||
| 4565 | } | ||
| 4566 | } | ||
| 4567 | pub mod regs { | ||
| 4568 | use crate::generic::*; | ||
| 4569 | #[doc = "Port input data register (GPIOn_IDR)"] | ||
| 4570 | #[repr(transparent)] | 2552 | #[repr(transparent)] |
| 4571 | #[derive(Copy, Clone, Eq, PartialEq)] | 2553 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 4572 | pub struct Idr(pub u32); | 2554 | pub struct Idr(pub u32); |
| 4573 | impl Idr { | 2555 | impl Idr { |
| 4574 | #[doc = "Port input data"] | 2556 | #[doc = "Port input data (y = 0..15)"] |
| 4575 | pub fn idr(&self, n: usize) -> super::vals::Idr { | 2557 | pub fn idr(&self, n: usize) -> super::vals::Idr { |
| 4576 | assert!(n < 16usize); | 2558 | assert!(n < 16usize); |
| 4577 | let offs = 0usize + n * 1usize; | 2559 | let offs = 0usize + n * 1usize; |
| 4578 | let val = (self.0 >> offs) & 0x01; | 2560 | let val = (self.0 >> offs) & 0x01; |
| 4579 | super::vals::Idr(val as u8) | 2561 | super::vals::Idr(val as u8) |
| 4580 | } | 2562 | } |
| 4581 | #[doc = "Port input data"] | 2563 | #[doc = "Port input data (y = 0..15)"] |
| 4582 | pub fn set_idr(&mut self, n: usize, val: super::vals::Idr) { | 2564 | pub fn set_idr(&mut self, n: usize, val: super::vals::Idr) { |
| 4583 | assert!(n < 16usize); | 2565 | assert!(n < 16usize); |
| 4584 | let offs = 0usize + n * 1usize; | 2566 | let offs = 0usize + n * 1usize; |
| @@ -4590,80 +2572,65 @@ pub mod gpio_v1 { | |||
| 4590 | Idr(0) | 2572 | Idr(0) |
| 4591 | } | 2573 | } |
| 4592 | } | 2574 | } |
| 4593 | #[doc = "Port bit reset register (GPIOn_BRR)"] | 2575 | #[doc = "GPIO port configuration lock register"] |
| 4594 | #[repr(transparent)] | 2576 | #[repr(transparent)] |
| 4595 | #[derive(Copy, Clone, Eq, PartialEq)] | 2577 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 4596 | pub struct Brr(pub u32); | 2578 | pub struct Lckr(pub u32); |
| 4597 | impl Brr { | 2579 | impl Lckr { |
| 4598 | #[doc = "Reset bit"] | 2580 | #[doc = "Port x lock bit y (y= 0..15)"] |
| 4599 | pub fn br(&self, n: usize) -> bool { | 2581 | pub fn lck(&self, n: usize) -> super::vals::Lck { |
| 4600 | assert!(n < 16usize); | 2582 | assert!(n < 16usize); |
| 4601 | let offs = 0usize + n * 1usize; | 2583 | let offs = 0usize + n * 1usize; |
| 4602 | let val = (self.0 >> offs) & 0x01; | 2584 | let val = (self.0 >> offs) & 0x01; |
| 4603 | val != 0 | 2585 | super::vals::Lck(val as u8) |
| 4604 | } | 2586 | } |
| 4605 | #[doc = "Reset bit"] | 2587 | #[doc = "Port x lock bit y (y= 0..15)"] |
| 4606 | pub fn set_br(&mut self, n: usize, val: bool) { | 2588 | pub fn set_lck(&mut self, n: usize, val: super::vals::Lck) { |
| 4607 | assert!(n < 16usize); | 2589 | assert!(n < 16usize); |
| 4608 | let offs = 0usize + n * 1usize; | 2590 | let offs = 0usize + n * 1usize; |
| 4609 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | 2591 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); |
| 4610 | } | ||
| 4611 | } | ||
| 4612 | impl Default for Brr { | ||
| 4613 | fn default() -> Brr { | ||
| 4614 | Brr(0) | ||
| 4615 | } | 2592 | } |
| 4616 | } | 2593 | #[doc = "Port x lock bit y (y= 0..15)"] |
| 4617 | #[doc = "Port output data register (GPIOn_ODR)"] | 2594 | pub const fn lckk(&self) -> super::vals::Lckk { |
| 4618 | #[repr(transparent)] | 2595 | let val = (self.0 >> 16usize) & 0x01; |
| 4619 | #[derive(Copy, Clone, Eq, PartialEq)] | 2596 | super::vals::Lckk(val as u8) |
| 4620 | pub struct Odr(pub u32); | ||
| 4621 | impl Odr { | ||
| 4622 | #[doc = "Port output data"] | ||
| 4623 | pub fn odr(&self, n: usize) -> super::vals::Odr { | ||
| 4624 | assert!(n < 16usize); | ||
| 4625 | let offs = 0usize + n * 1usize; | ||
| 4626 | let val = (self.0 >> offs) & 0x01; | ||
| 4627 | super::vals::Odr(val as u8) | ||
| 4628 | } | 2597 | } |
| 4629 | #[doc = "Port output data"] | 2598 | #[doc = "Port x lock bit y (y= 0..15)"] |
| 4630 | pub fn set_odr(&mut self, n: usize, val: super::vals::Odr) { | 2599 | pub fn set_lckk(&mut self, val: super::vals::Lckk) { |
| 4631 | assert!(n < 16usize); | 2600 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); |
| 4632 | let offs = 0usize + n * 1usize; | ||
| 4633 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 4634 | } | 2601 | } |
| 4635 | } | 2602 | } |
| 4636 | impl Default for Odr { | 2603 | impl Default for Lckr { |
| 4637 | fn default() -> Odr { | 2604 | fn default() -> Lckr { |
| 4638 | Odr(0) | 2605 | Lckr(0) |
| 4639 | } | 2606 | } |
| 4640 | } | 2607 | } |
| 4641 | #[doc = "Port bit set/reset register (GPIOn_BSRR)"] | 2608 | #[doc = "GPIO port bit set/reset register"] |
| 4642 | #[repr(transparent)] | 2609 | #[repr(transparent)] |
| 4643 | #[derive(Copy, Clone, Eq, PartialEq)] | 2610 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 4644 | pub struct Bsrr(pub u32); | 2611 | pub struct Bsrr(pub u32); |
| 4645 | impl Bsrr { | 2612 | impl Bsrr { |
| 4646 | #[doc = "Set bit"] | 2613 | #[doc = "Port x set bit y (y= 0..15)"] |
| 4647 | pub fn bs(&self, n: usize) -> bool { | 2614 | pub fn bs(&self, n: usize) -> bool { |
| 4648 | assert!(n < 16usize); | 2615 | assert!(n < 16usize); |
| 4649 | let offs = 0usize + n * 1usize; | 2616 | let offs = 0usize + n * 1usize; |
| 4650 | let val = (self.0 >> offs) & 0x01; | 2617 | let val = (self.0 >> offs) & 0x01; |
| 4651 | val != 0 | 2618 | val != 0 |
| 4652 | } | 2619 | } |
| 4653 | #[doc = "Set bit"] | 2620 | #[doc = "Port x set bit y (y= 0..15)"] |
| 4654 | pub fn set_bs(&mut self, n: usize, val: bool) { | 2621 | pub fn set_bs(&mut self, n: usize, val: bool) { |
| 4655 | assert!(n < 16usize); | 2622 | assert!(n < 16usize); |
| 4656 | let offs = 0usize + n * 1usize; | 2623 | let offs = 0usize + n * 1usize; |
| 4657 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | 2624 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); |
| 4658 | } | 2625 | } |
| 4659 | #[doc = "Reset bit"] | 2626 | #[doc = "Port x set bit y (y= 0..15)"] |
| 4660 | pub fn br(&self, n: usize) -> bool { | 2627 | pub fn br(&self, n: usize) -> bool { |
| 4661 | assert!(n < 16usize); | 2628 | assert!(n < 16usize); |
| 4662 | let offs = 16usize + n * 1usize; | 2629 | let offs = 16usize + n * 1usize; |
| 4663 | let val = (self.0 >> offs) & 0x01; | 2630 | let val = (self.0 >> offs) & 0x01; |
| 4664 | val != 0 | 2631 | val != 0 |
| 4665 | } | 2632 | } |
| 4666 | #[doc = "Reset bit"] | 2633 | #[doc = "Port x set bit y (y= 0..15)"] |
| 4667 | pub fn set_br(&mut self, n: usize, val: bool) { | 2634 | pub fn set_br(&mut self, n: usize, val: bool) { |
| 4668 | assert!(n < 16usize); | 2635 | assert!(n < 16usize); |
| 4669 | let offs = 16usize + n * 1usize; | 2636 | let offs = 16usize + n * 1usize; |
| @@ -4675,74 +2642,28 @@ pub mod gpio_v1 { | |||
| 4675 | Bsrr(0) | 2642 | Bsrr(0) |
| 4676 | } | 2643 | } |
| 4677 | } | 2644 | } |
| 4678 | #[doc = "Port configuration register (GPIOn_CRx)"] | 2645 | #[doc = "GPIO port output speed register"] |
| 4679 | #[repr(transparent)] | ||
| 4680 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4681 | pub struct Cr(pub u32); | ||
| 4682 | impl Cr { | ||
| 4683 | #[doc = "Port n mode bits"] | ||
| 4684 | pub fn mode(&self, n: usize) -> super::vals::Mode { | ||
| 4685 | assert!(n < 8usize); | ||
| 4686 | let offs = 0usize + n * 4usize; | ||
| 4687 | let val = (self.0 >> offs) & 0x03; | ||
| 4688 | super::vals::Mode(val as u8) | ||
| 4689 | } | ||
| 4690 | #[doc = "Port n mode bits"] | ||
| 4691 | pub fn set_mode(&mut self, n: usize, val: super::vals::Mode) { | ||
| 4692 | assert!(n < 8usize); | ||
| 4693 | let offs = 0usize + n * 4usize; | ||
| 4694 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | ||
| 4695 | } | ||
| 4696 | #[doc = "Port n configuration bits"] | ||
| 4697 | pub fn cnf(&self, n: usize) -> super::vals::Cnf { | ||
| 4698 | assert!(n < 8usize); | ||
| 4699 | let offs = 2usize + n * 4usize; | ||
| 4700 | let val = (self.0 >> offs) & 0x03; | ||
| 4701 | super::vals::Cnf(val as u8) | ||
| 4702 | } | ||
| 4703 | #[doc = "Port n configuration bits"] | ||
| 4704 | pub fn set_cnf(&mut self, n: usize, val: super::vals::Cnf) { | ||
| 4705 | assert!(n < 8usize); | ||
| 4706 | let offs = 2usize + n * 4usize; | ||
| 4707 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | ||
| 4708 | } | ||
| 4709 | } | ||
| 4710 | impl Default for Cr { | ||
| 4711 | fn default() -> Cr { | ||
| 4712 | Cr(0) | ||
| 4713 | } | ||
| 4714 | } | ||
| 4715 | #[doc = "Port configuration lock register"] | ||
| 4716 | #[repr(transparent)] | 2646 | #[repr(transparent)] |
| 4717 | #[derive(Copy, Clone, Eq, PartialEq)] | 2647 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 4718 | pub struct Lckr(pub u32); | 2648 | pub struct Ospeedr(pub u32); |
| 4719 | impl Lckr { | 2649 | impl Ospeedr { |
| 4720 | #[doc = "Port A Lock bit"] | 2650 | #[doc = "Port x configuration bits (y = 0..15)"] |
| 4721 | pub fn lck(&self, n: usize) -> super::vals::Lck { | 2651 | pub fn ospeedr(&self, n: usize) -> super::vals::Ospeedr { |
| 4722 | assert!(n < 16usize); | 2652 | assert!(n < 16usize); |
| 4723 | let offs = 0usize + n * 1usize; | 2653 | let offs = 0usize + n * 2usize; |
| 4724 | let val = (self.0 >> offs) & 0x01; | 2654 | let val = (self.0 >> offs) & 0x03; |
| 4725 | super::vals::Lck(val as u8) | 2655 | super::vals::Ospeedr(val as u8) |
| 4726 | } | 2656 | } |
| 4727 | #[doc = "Port A Lock bit"] | 2657 | #[doc = "Port x configuration bits (y = 0..15)"] |
| 4728 | pub fn set_lck(&mut self, n: usize, val: super::vals::Lck) { | 2658 | pub fn set_ospeedr(&mut self, n: usize, val: super::vals::Ospeedr) { |
| 4729 | assert!(n < 16usize); | 2659 | assert!(n < 16usize); |
| 4730 | let offs = 0usize + n * 1usize; | 2660 | let offs = 0usize + n * 2usize; |
| 4731 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | 2661 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); |
| 4732 | } | ||
| 4733 | #[doc = "Lock key"] | ||
| 4734 | pub const fn lckk(&self) -> super::vals::Lckk { | ||
| 4735 | let val = (self.0 >> 16usize) & 0x01; | ||
| 4736 | super::vals::Lckk(val as u8) | ||
| 4737 | } | ||
| 4738 | #[doc = "Lock key"] | ||
| 4739 | pub fn set_lckk(&mut self, val: super::vals::Lckk) { | ||
| 4740 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 4741 | } | 2662 | } |
| 4742 | } | 2663 | } |
| 4743 | impl Default for Lckr { | 2664 | impl Default for Ospeedr { |
| 4744 | fn default() -> Lckr { | 2665 | fn default() -> Ospeedr { |
| 4745 | Lckr(0) | 2666 | Ospeedr(0) |
| 4746 | } | 2667 | } |
| 4747 | } | 2668 | } |
| 4748 | } | 2669 | } |
| @@ -4759,43 +2680,19 @@ pub mod gpio_v1 { | |||
| 4759 | } | 2680 | } |
| 4760 | #[repr(transparent)] | 2681 | #[repr(transparent)] |
| 4761 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 2682 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 4762 | pub struct Idr(pub u8); | ||
| 4763 | impl Idr { | ||
| 4764 | #[doc = "Input is logic low"] | ||
| 4765 | pub const LOW: Self = Self(0); | ||
| 4766 | #[doc = "Input is logic high"] | ||
| 4767 | pub const HIGH: Self = Self(0x01); | ||
| 4768 | } | ||
| 4769 | #[repr(transparent)] | ||
| 4770 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4771 | pub struct Odr(pub u8); | ||
| 4772 | impl Odr { | ||
| 4773 | #[doc = "Set output to logic low"] | ||
| 4774 | pub const LOW: Self = Self(0); | ||
| 4775 | #[doc = "Set output to logic high"] | ||
| 4776 | pub const HIGH: Self = Self(0x01); | ||
| 4777 | } | ||
| 4778 | #[repr(transparent)] | ||
| 4779 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4780 | pub struct Brw(pub u8); | 2683 | pub struct Brw(pub u8); |
| 4781 | impl Brw { | 2684 | impl Brw { |
| 4782 | #[doc = "No action on the corresponding ODx bit"] | 2685 | #[doc = "Resets the corresponding ODRx bit"] |
| 4783 | pub const NOACTION: Self = Self(0); | ||
| 4784 | #[doc = "Reset the ODx bit"] | ||
| 4785 | pub const RESET: Self = Self(0x01); | 2686 | pub const RESET: Self = Self(0x01); |
| 4786 | } | 2687 | } |
| 4787 | #[repr(transparent)] | 2688 | #[repr(transparent)] |
| 4788 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 2689 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 4789 | pub struct Cnf(pub u8); | 2690 | pub struct Ot(pub u8); |
| 4790 | impl Cnf { | 2691 | impl Ot { |
| 4791 | #[doc = "Analog mode / Push-Pull mode"] | 2692 | #[doc = "Output push-pull (reset state)"] |
| 4792 | pub const PUSHPULL: Self = Self(0); | 2693 | pub const PUSHPULL: Self = Self(0); |
| 4793 | #[doc = "Floating input (reset state) / Open Drain-Mode"] | 2694 | #[doc = "Output open-drain"] |
| 4794 | pub const OPENDRAIN: Self = Self(0x01); | 2695 | pub const OPENDRAIN: Self = Self(0x01); |
| 4795 | #[doc = "Input with pull-up/pull-down / Alternate Function Push-Pull Mode"] | ||
| 4796 | pub const ALTPUSHPULL: Self = Self(0x02); | ||
| 4797 | #[doc = "Alternate Function Open-Drain Mode"] | ||
| 4798 | pub const ALTOPENDRAIN: Self = Self(0x03); | ||
| 4799 | } | 2696 | } |
| 4800 | #[repr(transparent)] | 2697 | #[repr(transparent)] |
| 4801 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 2698 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| @@ -4808,95 +2705,212 @@ pub mod gpio_v1 { | |||
| 4808 | } | 2705 | } |
| 4809 | #[repr(transparent)] | 2706 | #[repr(transparent)] |
| 4810 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 2707 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 2708 | pub struct Moder(pub u8); | ||
| 2709 | impl Moder { | ||
| 2710 | #[doc = "Input mode (reset state)"] | ||
| 2711 | pub const INPUT: Self = Self(0); | ||
| 2712 | #[doc = "General purpose output mode"] | ||
| 2713 | pub const OUTPUT: Self = Self(0x01); | ||
| 2714 | #[doc = "Alternate function mode"] | ||
| 2715 | pub const ALTERNATE: Self = Self(0x02); | ||
| 2716 | #[doc = "Analog mode"] | ||
| 2717 | pub const ANALOG: Self = Self(0x03); | ||
| 2718 | } | ||
| 2719 | #[repr(transparent)] | ||
| 2720 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4811 | pub struct Bsw(pub u8); | 2721 | pub struct Bsw(pub u8); |
| 4812 | impl Bsw { | 2722 | impl Bsw { |
| 4813 | #[doc = "No action on the corresponding ODx bit"] | ||
| 4814 | pub const NOACTION: Self = Self(0); | ||
| 4815 | #[doc = "Sets the corresponding ODRx bit"] | 2723 | #[doc = "Sets the corresponding ODRx bit"] |
| 4816 | pub const SET: Self = Self(0x01); | 2724 | pub const SET: Self = Self(0x01); |
| 4817 | } | 2725 | } |
| 4818 | #[repr(transparent)] | 2726 | #[repr(transparent)] |
| 4819 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 2727 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 4820 | pub struct Mode(pub u8); | 2728 | pub struct Pupdr(pub u8); |
| 4821 | impl Mode { | 2729 | impl Pupdr { |
| 4822 | #[doc = "Input mode (reset state)"] | 2730 | #[doc = "No pull-up, pull-down"] |
| 4823 | pub const INPUT: Self = Self(0); | 2731 | pub const FLOATING: Self = Self(0); |
| 4824 | #[doc = "Output mode 10 MHz"] | 2732 | #[doc = "Pull-up"] |
| 4825 | pub const OUTPUT: Self = Self(0x01); | 2733 | pub const PULLUP: Self = Self(0x01); |
| 4826 | #[doc = "Output mode 2 MHz"] | 2734 | #[doc = "Pull-down"] |
| 4827 | pub const OUTPUT2: Self = Self(0x02); | 2735 | pub const PULLDOWN: Self = Self(0x02); |
| 4828 | #[doc = "Output mode 50 MHz"] | 2736 | } |
| 4829 | pub const OUTPUT50: Self = Self(0x03); | 2737 | #[repr(transparent)] |
| 2738 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2739 | pub struct Ospeedr(pub u8); | ||
| 2740 | impl Ospeedr { | ||
| 2741 | #[doc = "Low speed"] | ||
| 2742 | pub const LOWSPEED: Self = Self(0); | ||
| 2743 | #[doc = "Medium speed"] | ||
| 2744 | pub const MEDIUMSPEED: Self = Self(0x01); | ||
| 2745 | #[doc = "High speed"] | ||
| 2746 | pub const HIGHSPEED: Self = Self(0x02); | ||
| 2747 | #[doc = "Very high speed"] | ||
| 2748 | pub const VERYHIGHSPEED: Self = Self(0x03); | ||
| 2749 | } | ||
| 2750 | #[repr(transparent)] | ||
| 2751 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2752 | pub struct Idr(pub u8); | ||
| 2753 | impl Idr { | ||
| 2754 | #[doc = "Input is logic low"] | ||
| 2755 | pub const LOW: Self = Self(0); | ||
| 2756 | #[doc = "Input is logic high"] | ||
| 2757 | pub const HIGH: Self = Self(0x01); | ||
| 2758 | } | ||
| 2759 | #[repr(transparent)] | ||
| 2760 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2761 | pub struct Afr(pub u8); | ||
| 2762 | impl Afr { | ||
| 2763 | #[doc = "AF0"] | ||
| 2764 | pub const AF0: Self = Self(0); | ||
| 2765 | #[doc = "AF1"] | ||
| 2766 | pub const AF1: Self = Self(0x01); | ||
| 2767 | #[doc = "AF2"] | ||
| 2768 | pub const AF2: Self = Self(0x02); | ||
| 2769 | #[doc = "AF3"] | ||
| 2770 | pub const AF3: Self = Self(0x03); | ||
| 2771 | #[doc = "AF4"] | ||
| 2772 | pub const AF4: Self = Self(0x04); | ||
| 2773 | #[doc = "AF5"] | ||
| 2774 | pub const AF5: Self = Self(0x05); | ||
| 2775 | #[doc = "AF6"] | ||
| 2776 | pub const AF6: Self = Self(0x06); | ||
| 2777 | #[doc = "AF7"] | ||
| 2778 | pub const AF7: Self = Self(0x07); | ||
| 2779 | #[doc = "AF8"] | ||
| 2780 | pub const AF8: Self = Self(0x08); | ||
| 2781 | #[doc = "AF9"] | ||
| 2782 | pub const AF9: Self = Self(0x09); | ||
| 2783 | #[doc = "AF10"] | ||
| 2784 | pub const AF10: Self = Self(0x0a); | ||
| 2785 | #[doc = "AF11"] | ||
| 2786 | pub const AF11: Self = Self(0x0b); | ||
| 2787 | #[doc = "AF12"] | ||
| 2788 | pub const AF12: Self = Self(0x0c); | ||
| 2789 | #[doc = "AF13"] | ||
| 2790 | pub const AF13: Self = Self(0x0d); | ||
| 2791 | #[doc = "AF14"] | ||
| 2792 | pub const AF14: Self = Self(0x0e); | ||
| 2793 | #[doc = "AF15"] | ||
| 2794 | pub const AF15: Self = Self(0x0f); | ||
| 2795 | } | ||
| 2796 | #[repr(transparent)] | ||
| 2797 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2798 | pub struct Odr(pub u8); | ||
| 2799 | impl Odr { | ||
| 2800 | #[doc = "Set output to logic low"] | ||
| 2801 | pub const LOW: Self = Self(0); | ||
| 2802 | #[doc = "Set output to logic high"] | ||
| 2803 | pub const HIGH: Self = Self(0x01); | ||
| 4830 | } | 2804 | } |
| 4831 | } | 2805 | } |
| 4832 | } | 2806 | } |
| 4833 | pub mod generic { | 2807 | pub mod rng_v1 { |
| 4834 | use core::marker::PhantomData; | 2808 | use crate::generic::*; |
| 4835 | #[derive(Copy, Clone)] | 2809 | #[doc = "Random number generator"] |
| 4836 | pub struct RW; | ||
| 4837 | #[derive(Copy, Clone)] | ||
| 4838 | pub struct R; | ||
| 4839 | #[derive(Copy, Clone)] | ||
| 4840 | pub struct W; | ||
| 4841 | mod sealed { | ||
| 4842 | use super::*; | ||
| 4843 | pub trait Access {} | ||
| 4844 | impl Access for R {} | ||
| 4845 | impl Access for W {} | ||
| 4846 | impl Access for RW {} | ||
| 4847 | } | ||
| 4848 | pub trait Access: sealed::Access + Copy {} | ||
| 4849 | impl Access for R {} | ||
| 4850 | impl Access for W {} | ||
| 4851 | impl Access for RW {} | ||
| 4852 | pub trait Read: Access {} | ||
| 4853 | impl Read for RW {} | ||
| 4854 | impl Read for R {} | ||
| 4855 | pub trait Write: Access {} | ||
| 4856 | impl Write for RW {} | ||
| 4857 | impl Write for W {} | ||
| 4858 | #[derive(Copy, Clone)] | 2810 | #[derive(Copy, Clone)] |
| 4859 | pub struct Reg<T: Copy, A: Access> { | 2811 | pub struct Rng(pub *mut u8); |
| 4860 | ptr: *mut u8, | 2812 | unsafe impl Send for Rng {} |
| 4861 | phantom: PhantomData<*mut (T, A)>, | 2813 | unsafe impl Sync for Rng {} |
| 4862 | } | 2814 | impl Rng { |
| 4863 | unsafe impl<T: Copy, A: Access> Send for Reg<T, A> {} | 2815 | #[doc = "control register"] |
| 4864 | unsafe impl<T: Copy, A: Access> Sync for Reg<T, A> {} | 2816 | pub fn cr(self) -> Reg<regs::Cr, RW> { |
| 4865 | impl<T: Copy, A: Access> Reg<T, A> { | 2817 | unsafe { Reg::from_ptr(self.0.add(0usize)) } |
| 4866 | pub fn from_ptr(ptr: *mut u8) -> Self { | ||
| 4867 | Self { | ||
| 4868 | ptr, | ||
| 4869 | phantom: PhantomData, | ||
| 4870 | } | ||
| 4871 | } | 2818 | } |
| 4872 | pub fn ptr(&self) -> *mut T { | 2819 | #[doc = "status register"] |
| 4873 | self.ptr as _ | 2820 | pub fn sr(self) -> Reg<regs::Sr, RW> { |
| 2821 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 4874 | } | 2822 | } |
| 4875 | } | 2823 | #[doc = "data register"] |
| 4876 | impl<T: Copy, A: Read> Reg<T, A> { | 2824 | pub fn dr(self) -> Reg<u32, R> { |
| 4877 | pub unsafe fn read(&self) -> T { | 2825 | unsafe { Reg::from_ptr(self.0.add(8usize)) } |
| 4878 | (self.ptr as *mut T).read_volatile() | ||
| 4879 | } | 2826 | } |
| 4880 | } | 2827 | } |
| 4881 | impl<T: Copy, A: Write> Reg<T, A> { | 2828 | pub mod regs { |
| 4882 | pub unsafe fn write_value(&self, val: T) { | 2829 | use crate::generic::*; |
| 4883 | (self.ptr as *mut T).write_volatile(val) | 2830 | #[doc = "control register"] |
| 2831 | #[repr(transparent)] | ||
| 2832 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2833 | pub struct Cr(pub u32); | ||
| 2834 | impl Cr { | ||
| 2835 | #[doc = "Random number generator enable"] | ||
| 2836 | pub const fn rngen(&self) -> bool { | ||
| 2837 | let val = (self.0 >> 2usize) & 0x01; | ||
| 2838 | val != 0 | ||
| 2839 | } | ||
| 2840 | #[doc = "Random number generator enable"] | ||
| 2841 | pub fn set_rngen(&mut self, val: bool) { | ||
| 2842 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 2843 | } | ||
| 2844 | #[doc = "Interrupt enable"] | ||
| 2845 | pub const fn ie(&self) -> bool { | ||
| 2846 | let val = (self.0 >> 3usize) & 0x01; | ||
| 2847 | val != 0 | ||
| 2848 | } | ||
| 2849 | #[doc = "Interrupt enable"] | ||
| 2850 | pub fn set_ie(&mut self, val: bool) { | ||
| 2851 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | ||
| 2852 | } | ||
| 4884 | } | 2853 | } |
| 4885 | } | 2854 | impl Default for Cr { |
| 4886 | impl<T: Default + Copy, A: Write> Reg<T, A> { | 2855 | fn default() -> Cr { |
| 4887 | pub unsafe fn write<R>(&self, f: impl FnOnce(&mut T) -> R) -> R { | 2856 | Cr(0) |
| 4888 | let mut val = Default::default(); | 2857 | } |
| 4889 | let res = f(&mut val); | ||
| 4890 | self.write_value(val); | ||
| 4891 | res | ||
| 4892 | } | 2858 | } |
| 4893 | } | 2859 | #[doc = "status register"] |
| 4894 | impl<T: Copy, A: Read + Write> Reg<T, A> { | 2860 | #[repr(transparent)] |
| 4895 | pub unsafe fn modify<R>(&self, f: impl FnOnce(&mut T) -> R) -> R { | 2861 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 4896 | let mut val = self.read(); | 2862 | pub struct Sr(pub u32); |
| 4897 | let res = f(&mut val); | 2863 | impl Sr { |
| 4898 | self.write_value(val); | 2864 | #[doc = "Data ready"] |
| 4899 | res | 2865 | pub const fn drdy(&self) -> bool { |
| 2866 | let val = (self.0 >> 0usize) & 0x01; | ||
| 2867 | val != 0 | ||
| 2868 | } | ||
| 2869 | #[doc = "Data ready"] | ||
| 2870 | pub fn set_drdy(&mut self, val: bool) { | ||
| 2871 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 2872 | } | ||
| 2873 | #[doc = "Clock error current status"] | ||
| 2874 | pub const fn cecs(&self) -> bool { | ||
| 2875 | let val = (self.0 >> 1usize) & 0x01; | ||
| 2876 | val != 0 | ||
| 2877 | } | ||
| 2878 | #[doc = "Clock error current status"] | ||
| 2879 | pub fn set_cecs(&mut self, val: bool) { | ||
| 2880 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | ||
| 2881 | } | ||
| 2882 | #[doc = "Seed error current status"] | ||
| 2883 | pub const fn secs(&self) -> bool { | ||
| 2884 | let val = (self.0 >> 2usize) & 0x01; | ||
| 2885 | val != 0 | ||
| 2886 | } | ||
| 2887 | #[doc = "Seed error current status"] | ||
| 2888 | pub fn set_secs(&mut self, val: bool) { | ||
| 2889 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 2890 | } | ||
| 2891 | #[doc = "Clock error interrupt status"] | ||
| 2892 | pub const fn ceis(&self) -> bool { | ||
| 2893 | let val = (self.0 >> 5usize) & 0x01; | ||
| 2894 | val != 0 | ||
| 2895 | } | ||
| 2896 | #[doc = "Clock error interrupt status"] | ||
| 2897 | pub fn set_ceis(&mut self, val: bool) { | ||
| 2898 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 2899 | } | ||
| 2900 | #[doc = "Seed error interrupt status"] | ||
| 2901 | pub const fn seis(&self) -> bool { | ||
| 2902 | let val = (self.0 >> 6usize) & 0x01; | ||
| 2903 | val != 0 | ||
| 2904 | } | ||
| 2905 | #[doc = "Seed error interrupt status"] | ||
| 2906 | pub fn set_seis(&mut self, val: bool) { | ||
| 2907 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 2908 | } | ||
| 2909 | } | ||
| 2910 | impl Default for Sr { | ||
| 2911 | fn default() -> Sr { | ||
| 2912 | Sr(0) | ||
| 2913 | } | ||
| 4900 | } | 2914 | } |
| 4901 | } | 2915 | } |
| 4902 | } | 2916 | } |
| @@ -4947,69 +2961,6 @@ pub mod dma_v1 { | |||
| 4947 | } | 2961 | } |
| 4948 | pub mod regs { | 2962 | pub mod regs { |
| 4949 | use crate::generic::*; | 2963 | use crate::generic::*; |
| 4950 | #[doc = "DMA interrupt flag clear register (DMA_IFCR)"] | ||
| 4951 | #[repr(transparent)] | ||
| 4952 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4953 | pub struct Ifcr(pub u32); | ||
| 4954 | impl Ifcr { | ||
| 4955 | #[doc = "Channel 1 Global interrupt clear"] | ||
| 4956 | pub fn cgif(&self, n: usize) -> bool { | ||
| 4957 | assert!(n < 7usize); | ||
| 4958 | let offs = 0usize + n * 4usize; | ||
| 4959 | let val = (self.0 >> offs) & 0x01; | ||
| 4960 | val != 0 | ||
| 4961 | } | ||
| 4962 | #[doc = "Channel 1 Global interrupt clear"] | ||
| 4963 | pub fn set_cgif(&mut self, n: usize, val: bool) { | ||
| 4964 | assert!(n < 7usize); | ||
| 4965 | let offs = 0usize + n * 4usize; | ||
| 4966 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 4967 | } | ||
| 4968 | #[doc = "Channel 1 Transfer Complete clear"] | ||
| 4969 | pub fn ctcif(&self, n: usize) -> bool { | ||
| 4970 | assert!(n < 7usize); | ||
| 4971 | let offs = 1usize + n * 4usize; | ||
| 4972 | let val = (self.0 >> offs) & 0x01; | ||
| 4973 | val != 0 | ||
| 4974 | } | ||
| 4975 | #[doc = "Channel 1 Transfer Complete clear"] | ||
| 4976 | pub fn set_ctcif(&mut self, n: usize, val: bool) { | ||
| 4977 | assert!(n < 7usize); | ||
| 4978 | let offs = 1usize + n * 4usize; | ||
| 4979 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 4980 | } | ||
| 4981 | #[doc = "Channel 1 Half Transfer clear"] | ||
| 4982 | pub fn chtif(&self, n: usize) -> bool { | ||
| 4983 | assert!(n < 7usize); | ||
| 4984 | let offs = 2usize + n * 4usize; | ||
| 4985 | let val = (self.0 >> offs) & 0x01; | ||
| 4986 | val != 0 | ||
| 4987 | } | ||
| 4988 | #[doc = "Channel 1 Half Transfer clear"] | ||
| 4989 | pub fn set_chtif(&mut self, n: usize, val: bool) { | ||
| 4990 | assert!(n < 7usize); | ||
| 4991 | let offs = 2usize + n * 4usize; | ||
| 4992 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 4993 | } | ||
| 4994 | #[doc = "Channel 1 Transfer Error clear"] | ||
| 4995 | pub fn cteif(&self, n: usize) -> bool { | ||
| 4996 | assert!(n < 7usize); | ||
| 4997 | let offs = 3usize + n * 4usize; | ||
| 4998 | let val = (self.0 >> offs) & 0x01; | ||
| 4999 | val != 0 | ||
| 5000 | } | ||
| 5001 | #[doc = "Channel 1 Transfer Error clear"] | ||
| 5002 | pub fn set_cteif(&mut self, n: usize, val: bool) { | ||
| 5003 | assert!(n < 7usize); | ||
| 5004 | let offs = 3usize + n * 4usize; | ||
| 5005 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 5006 | } | ||
| 5007 | } | ||
| 5008 | impl Default for Ifcr { | ||
| 5009 | fn default() -> Ifcr { | ||
| 5010 | Ifcr(0) | ||
| 5011 | } | ||
| 5012 | } | ||
| 5013 | #[doc = "DMA interrupt status register (DMA_ISR)"] | 2964 | #[doc = "DMA interrupt status register (DMA_ISR)"] |
| 5014 | #[repr(transparent)] | 2965 | #[repr(transparent)] |
| 5015 | #[derive(Copy, Clone, Eq, PartialEq)] | 2966 | #[derive(Copy, Clone, Eq, PartialEq)] |
| @@ -5073,26 +3024,6 @@ pub mod dma_v1 { | |||
| 5073 | Isr(0) | 3024 | Isr(0) |
| 5074 | } | 3025 | } |
| 5075 | } | 3026 | } |
| 5076 | #[doc = "DMA channel 1 number of data register"] | ||
| 5077 | #[repr(transparent)] | ||
| 5078 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5079 | pub struct Ndtr(pub u32); | ||
| 5080 | impl Ndtr { | ||
| 5081 | #[doc = "Number of data to transfer"] | ||
| 5082 | pub const fn ndt(&self) -> u16 { | ||
| 5083 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 5084 | val as u16 | ||
| 5085 | } | ||
| 5086 | #[doc = "Number of data to transfer"] | ||
| 5087 | pub fn set_ndt(&mut self, val: u16) { | ||
| 5088 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 5089 | } | ||
| 5090 | } | ||
| 5091 | impl Default for Ndtr { | ||
| 5092 | fn default() -> Ndtr { | ||
| 5093 | Ndtr(0) | ||
| 5094 | } | ||
| 5095 | } | ||
| 5096 | #[doc = "DMA channel configuration register (DMA_CCR)"] | 3027 | #[doc = "DMA channel configuration register (DMA_CCR)"] |
| 5097 | #[repr(transparent)] | 3028 | #[repr(transparent)] |
| 5098 | #[derive(Copy, Clone, Eq, PartialEq)] | 3029 | #[derive(Copy, Clone, Eq, PartialEq)] |
| @@ -5212,355 +3143,87 @@ pub mod dma_v1 { | |||
| 5212 | Cr(0) | 3143 | Cr(0) |
| 5213 | } | 3144 | } |
| 5214 | } | 3145 | } |
| 5215 | } | 3146 | #[doc = "DMA channel 1 number of data register"] |
| 5216 | pub mod vals { | ||
| 5217 | use crate::generic::*; | ||
| 5218 | #[repr(transparent)] | ||
| 5219 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5220 | pub struct Memmem(pub u8); | ||
| 5221 | impl Memmem { | ||
| 5222 | #[doc = "Memory to memory mode disabled"] | ||
| 5223 | pub const DISABLED: Self = Self(0); | ||
| 5224 | #[doc = "Memory to memory mode enabled"] | ||
| 5225 | pub const ENABLED: Self = Self(0x01); | ||
| 5226 | } | ||
| 5227 | #[repr(transparent)] | ||
| 5228 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5229 | pub struct Circ(pub u8); | ||
| 5230 | impl Circ { | ||
| 5231 | #[doc = "Circular buffer disabled"] | ||
| 5232 | pub const DISABLED: Self = Self(0); | ||
| 5233 | #[doc = "Circular buffer enabled"] | ||
| 5234 | pub const ENABLED: Self = Self(0x01); | ||
| 5235 | } | ||
| 5236 | #[repr(transparent)] | ||
| 5237 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5238 | pub struct Inc(pub u8); | ||
| 5239 | impl Inc { | ||
| 5240 | #[doc = "Increment mode disabled"] | ||
| 5241 | pub const DISABLED: Self = Self(0); | ||
| 5242 | #[doc = "Increment mode enabled"] | ||
| 5243 | pub const ENABLED: Self = Self(0x01); | ||
| 5244 | } | ||
| 5245 | #[repr(transparent)] | ||
| 5246 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5247 | pub struct Dir(pub u8); | ||
| 5248 | impl Dir { | ||
| 5249 | #[doc = "Read from peripheral"] | ||
| 5250 | pub const FROMPERIPHERAL: Self = Self(0); | ||
| 5251 | #[doc = "Read from memory"] | ||
| 5252 | pub const FROMMEMORY: Self = Self(0x01); | ||
| 5253 | } | ||
| 5254 | #[repr(transparent)] | ||
| 5255 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5256 | pub struct Size(pub u8); | ||
| 5257 | impl Size { | ||
| 5258 | #[doc = "8-bit size"] | ||
| 5259 | pub const BITS8: Self = Self(0); | ||
| 5260 | #[doc = "16-bit size"] | ||
| 5261 | pub const BITS16: Self = Self(0x01); | ||
| 5262 | #[doc = "32-bit size"] | ||
| 5263 | pub const BITS32: Self = Self(0x02); | ||
| 5264 | } | ||
| 5265 | #[repr(transparent)] | ||
| 5266 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5267 | pub struct Pl(pub u8); | ||
| 5268 | impl Pl { | ||
| 5269 | #[doc = "Low priority"] | ||
| 5270 | pub const LOW: Self = Self(0); | ||
| 5271 | #[doc = "Medium priority"] | ||
| 5272 | pub const MEDIUM: Self = Self(0x01); | ||
| 5273 | #[doc = "High priority"] | ||
| 5274 | pub const HIGH: Self = Self(0x02); | ||
| 5275 | #[doc = "Very high priority"] | ||
| 5276 | pub const VERYHIGH: Self = Self(0x03); | ||
| 5277 | } | ||
| 5278 | } | ||
| 5279 | } | ||
| 5280 | pub mod gpio_v2 { | ||
| 5281 | use crate::generic::*; | ||
| 5282 | #[doc = "General-purpose I/Os"] | ||
| 5283 | #[derive(Copy, Clone)] | ||
| 5284 | pub struct Gpio(pub *mut u8); | ||
| 5285 | unsafe impl Send for Gpio {} | ||
| 5286 | unsafe impl Sync for Gpio {} | ||
| 5287 | impl Gpio { | ||
| 5288 | #[doc = "GPIO port mode register"] | ||
| 5289 | pub fn moder(self) -> Reg<regs::Moder, RW> { | ||
| 5290 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 5291 | } | ||
| 5292 | #[doc = "GPIO port output type register"] | ||
| 5293 | pub fn otyper(self) -> Reg<regs::Otyper, RW> { | ||
| 5294 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 5295 | } | ||
| 5296 | #[doc = "GPIO port output speed register"] | ||
| 5297 | pub fn ospeedr(self) -> Reg<regs::Ospeedr, RW> { | ||
| 5298 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 5299 | } | ||
| 5300 | #[doc = "GPIO port pull-up/pull-down register"] | ||
| 5301 | pub fn pupdr(self) -> Reg<regs::Pupdr, RW> { | ||
| 5302 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 5303 | } | ||
| 5304 | #[doc = "GPIO port input data register"] | ||
| 5305 | pub fn idr(self) -> Reg<regs::Idr, R> { | ||
| 5306 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 5307 | } | ||
| 5308 | #[doc = "GPIO port output data register"] | ||
| 5309 | pub fn odr(self) -> Reg<regs::Odr, RW> { | ||
| 5310 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 5311 | } | ||
| 5312 | #[doc = "GPIO port bit set/reset register"] | ||
| 5313 | pub fn bsrr(self) -> Reg<regs::Bsrr, W> { | ||
| 5314 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | ||
| 5315 | } | ||
| 5316 | #[doc = "GPIO port configuration lock register"] | ||
| 5317 | pub fn lckr(self) -> Reg<regs::Lckr, RW> { | ||
| 5318 | unsafe { Reg::from_ptr(self.0.add(28usize)) } | ||
| 5319 | } | ||
| 5320 | #[doc = "GPIO alternate function register (low, high)"] | ||
| 5321 | pub fn afr(self, n: usize) -> Reg<regs::Afr, RW> { | ||
| 5322 | assert!(n < 2usize); | ||
| 5323 | unsafe { Reg::from_ptr(self.0.add(32usize + n * 4usize)) } | ||
| 5324 | } | ||
| 5325 | } | ||
| 5326 | pub mod regs { | ||
| 5327 | use crate::generic::*; | ||
| 5328 | #[doc = "GPIO port input data register"] | ||
| 5329 | #[repr(transparent)] | ||
| 5330 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5331 | pub struct Idr(pub u32); | ||
| 5332 | impl Idr { | ||
| 5333 | #[doc = "Port input data (y = 0..15)"] | ||
| 5334 | pub fn idr(&self, n: usize) -> super::vals::Idr { | ||
| 5335 | assert!(n < 16usize); | ||
| 5336 | let offs = 0usize + n * 1usize; | ||
| 5337 | let val = (self.0 >> offs) & 0x01; | ||
| 5338 | super::vals::Idr(val as u8) | ||
| 5339 | } | ||
| 5340 | #[doc = "Port input data (y = 0..15)"] | ||
| 5341 | pub fn set_idr(&mut self, n: usize, val: super::vals::Idr) { | ||
| 5342 | assert!(n < 16usize); | ||
| 5343 | let offs = 0usize + n * 1usize; | ||
| 5344 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 5345 | } | ||
| 5346 | } | ||
| 5347 | impl Default for Idr { | ||
| 5348 | fn default() -> Idr { | ||
| 5349 | Idr(0) | ||
| 5350 | } | ||
| 5351 | } | ||
| 5352 | #[doc = "GPIO port pull-up/pull-down register"] | ||
| 5353 | #[repr(transparent)] | ||
| 5354 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5355 | pub struct Pupdr(pub u32); | ||
| 5356 | impl Pupdr { | ||
| 5357 | #[doc = "Port x configuration bits (y = 0..15)"] | ||
| 5358 | pub fn pupdr(&self, n: usize) -> super::vals::Pupdr { | ||
| 5359 | assert!(n < 16usize); | ||
| 5360 | let offs = 0usize + n * 2usize; | ||
| 5361 | let val = (self.0 >> offs) & 0x03; | ||
| 5362 | super::vals::Pupdr(val as u8) | ||
| 5363 | } | ||
| 5364 | #[doc = "Port x configuration bits (y = 0..15)"] | ||
| 5365 | pub fn set_pupdr(&mut self, n: usize, val: super::vals::Pupdr) { | ||
| 5366 | assert!(n < 16usize); | ||
| 5367 | let offs = 0usize + n * 2usize; | ||
| 5368 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | ||
| 5369 | } | ||
| 5370 | } | ||
| 5371 | impl Default for Pupdr { | ||
| 5372 | fn default() -> Pupdr { | ||
| 5373 | Pupdr(0) | ||
| 5374 | } | ||
| 5375 | } | ||
| 5376 | #[doc = "GPIO port output type register"] | ||
| 5377 | #[repr(transparent)] | 3147 | #[repr(transparent)] |
| 5378 | #[derive(Copy, Clone, Eq, PartialEq)] | 3148 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 5379 | pub struct Otyper(pub u32); | 3149 | pub struct Ndtr(pub u32); |
| 5380 | impl Otyper { | 3150 | impl Ndtr { |
| 5381 | #[doc = "Port x configuration bits (y = 0..15)"] | 3151 | #[doc = "Number of data to transfer"] |
| 5382 | pub fn ot(&self, n: usize) -> super::vals::Ot { | 3152 | pub const fn ndt(&self) -> u16 { |
| 5383 | assert!(n < 16usize); | 3153 | let val = (self.0 >> 0usize) & 0xffff; |
| 5384 | let offs = 0usize + n * 1usize; | 3154 | val as u16 |
| 5385 | let val = (self.0 >> offs) & 0x01; | ||
| 5386 | super::vals::Ot(val as u8) | ||
| 5387 | } | 3155 | } |
| 5388 | #[doc = "Port x configuration bits (y = 0..15)"] | 3156 | #[doc = "Number of data to transfer"] |
| 5389 | pub fn set_ot(&mut self, n: usize, val: super::vals::Ot) { | 3157 | pub fn set_ndt(&mut self, val: u16) { |
| 5390 | assert!(n < 16usize); | 3158 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); |
| 5391 | let offs = 0usize + n * 1usize; | ||
| 5392 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 5393 | } | 3159 | } |
| 5394 | } | 3160 | } |
| 5395 | impl Default for Otyper { | 3161 | impl Default for Ndtr { |
| 5396 | fn default() -> Otyper { | 3162 | fn default() -> Ndtr { |
| 5397 | Otyper(0) | 3163 | Ndtr(0) |
| 5398 | } | 3164 | } |
| 5399 | } | 3165 | } |
| 5400 | #[doc = "GPIO port bit set/reset register"] | 3166 | #[doc = "DMA interrupt flag clear register (DMA_IFCR)"] |
| 5401 | #[repr(transparent)] | 3167 | #[repr(transparent)] |
| 5402 | #[derive(Copy, Clone, Eq, PartialEq)] | 3168 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 5403 | pub struct Bsrr(pub u32); | 3169 | pub struct Ifcr(pub u32); |
| 5404 | impl Bsrr { | 3170 | impl Ifcr { |
| 5405 | #[doc = "Port x set bit y (y= 0..15)"] | 3171 | #[doc = "Channel 1 Global interrupt clear"] |
| 5406 | pub fn bs(&self, n: usize) -> bool { | 3172 | pub fn cgif(&self, n: usize) -> bool { |
| 5407 | assert!(n < 16usize); | 3173 | assert!(n < 7usize); |
| 5408 | let offs = 0usize + n * 1usize; | 3174 | let offs = 0usize + n * 4usize; |
| 5409 | let val = (self.0 >> offs) & 0x01; | 3175 | let val = (self.0 >> offs) & 0x01; |
| 5410 | val != 0 | 3176 | val != 0 |
| 5411 | } | 3177 | } |
| 5412 | #[doc = "Port x set bit y (y= 0..15)"] | 3178 | #[doc = "Channel 1 Global interrupt clear"] |
| 5413 | pub fn set_bs(&mut self, n: usize, val: bool) { | 3179 | pub fn set_cgif(&mut self, n: usize, val: bool) { |
| 5414 | assert!(n < 16usize); | 3180 | assert!(n < 7usize); |
| 5415 | let offs = 0usize + n * 1usize; | 3181 | let offs = 0usize + n * 4usize; |
| 5416 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | 3182 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); |
| 5417 | } | 3183 | } |
| 5418 | #[doc = "Port x set bit y (y= 0..15)"] | 3184 | #[doc = "Channel 1 Transfer Complete clear"] |
| 5419 | pub fn br(&self, n: usize) -> bool { | 3185 | pub fn ctcif(&self, n: usize) -> bool { |
| 5420 | assert!(n < 16usize); | 3186 | assert!(n < 7usize); |
| 5421 | let offs = 16usize + n * 1usize; | 3187 | let offs = 1usize + n * 4usize; |
| 5422 | let val = (self.0 >> offs) & 0x01; | 3188 | let val = (self.0 >> offs) & 0x01; |
| 5423 | val != 0 | 3189 | val != 0 |
| 5424 | } | 3190 | } |
| 5425 | #[doc = "Port x set bit y (y= 0..15)"] | 3191 | #[doc = "Channel 1 Transfer Complete clear"] |
| 5426 | pub fn set_br(&mut self, n: usize, val: bool) { | 3192 | pub fn set_ctcif(&mut self, n: usize, val: bool) { |
| 5427 | assert!(n < 16usize); | 3193 | assert!(n < 7usize); |
| 5428 | let offs = 16usize + n * 1usize; | 3194 | let offs = 1usize + n * 4usize; |
| 5429 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | 3195 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); |
| 5430 | } | 3196 | } |
| 5431 | } | 3197 | #[doc = "Channel 1 Half Transfer clear"] |
| 5432 | impl Default for Bsrr { | 3198 | pub fn chtif(&self, n: usize) -> bool { |
| 5433 | fn default() -> Bsrr { | 3199 | assert!(n < 7usize); |
| 5434 | Bsrr(0) | 3200 | let offs = 2usize + n * 4usize; |
| 5435 | } | ||
| 5436 | } | ||
| 5437 | #[doc = "GPIO port configuration lock register"] | ||
| 5438 | #[repr(transparent)] | ||
| 5439 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5440 | pub struct Lckr(pub u32); | ||
| 5441 | impl Lckr { | ||
| 5442 | #[doc = "Port x lock bit y (y= 0..15)"] | ||
| 5443 | pub fn lck(&self, n: usize) -> super::vals::Lck { | ||
| 5444 | assert!(n < 16usize); | ||
| 5445 | let offs = 0usize + n * 1usize; | ||
| 5446 | let val = (self.0 >> offs) & 0x01; | 3201 | let val = (self.0 >> offs) & 0x01; |
| 5447 | super::vals::Lck(val as u8) | 3202 | val != 0 |
| 5448 | } | ||
| 5449 | #[doc = "Port x lock bit y (y= 0..15)"] | ||
| 5450 | pub fn set_lck(&mut self, n: usize, val: super::vals::Lck) { | ||
| 5451 | assert!(n < 16usize); | ||
| 5452 | let offs = 0usize + n * 1usize; | ||
| 5453 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 5454 | } | ||
| 5455 | #[doc = "Port x lock bit y (y= 0..15)"] | ||
| 5456 | pub const fn lckk(&self) -> super::vals::Lckk { | ||
| 5457 | let val = (self.0 >> 16usize) & 0x01; | ||
| 5458 | super::vals::Lckk(val as u8) | ||
| 5459 | } | ||
| 5460 | #[doc = "Port x lock bit y (y= 0..15)"] | ||
| 5461 | pub fn set_lckk(&mut self, val: super::vals::Lckk) { | ||
| 5462 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 5463 | } | ||
| 5464 | } | ||
| 5465 | impl Default for Lckr { | ||
| 5466 | fn default() -> Lckr { | ||
| 5467 | Lckr(0) | ||
| 5468 | } | ||
| 5469 | } | ||
| 5470 | #[doc = "GPIO port mode register"] | ||
| 5471 | #[repr(transparent)] | ||
| 5472 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5473 | pub struct Moder(pub u32); | ||
| 5474 | impl Moder { | ||
| 5475 | #[doc = "Port x configuration bits (y = 0..15)"] | ||
| 5476 | pub fn moder(&self, n: usize) -> super::vals::Moder { | ||
| 5477 | assert!(n < 16usize); | ||
| 5478 | let offs = 0usize + n * 2usize; | ||
| 5479 | let val = (self.0 >> offs) & 0x03; | ||
| 5480 | super::vals::Moder(val as u8) | ||
| 5481 | } | ||
| 5482 | #[doc = "Port x configuration bits (y = 0..15)"] | ||
| 5483 | pub fn set_moder(&mut self, n: usize, val: super::vals::Moder) { | ||
| 5484 | assert!(n < 16usize); | ||
| 5485 | let offs = 0usize + n * 2usize; | ||
| 5486 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | ||
| 5487 | } | 3203 | } |
| 5488 | } | 3204 | #[doc = "Channel 1 Half Transfer clear"] |
| 5489 | impl Default for Moder { | 3205 | pub fn set_chtif(&mut self, n: usize, val: bool) { |
| 5490 | fn default() -> Moder { | 3206 | assert!(n < 7usize); |
| 5491 | Moder(0) | 3207 | let offs = 2usize + n * 4usize; |
| 3208 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 5492 | } | 3209 | } |
| 5493 | } | 3210 | #[doc = "Channel 1 Transfer Error clear"] |
| 5494 | #[doc = "GPIO port output data register"] | 3211 | pub fn cteif(&self, n: usize) -> bool { |
| 5495 | #[repr(transparent)] | 3212 | assert!(n < 7usize); |
| 5496 | #[derive(Copy, Clone, Eq, PartialEq)] | 3213 | let offs = 3usize + n * 4usize; |
| 5497 | pub struct Odr(pub u32); | ||
| 5498 | impl Odr { | ||
| 5499 | #[doc = "Port output data (y = 0..15)"] | ||
| 5500 | pub fn odr(&self, n: usize) -> super::vals::Odr { | ||
| 5501 | assert!(n < 16usize); | ||
| 5502 | let offs = 0usize + n * 1usize; | ||
| 5503 | let val = (self.0 >> offs) & 0x01; | 3214 | let val = (self.0 >> offs) & 0x01; |
| 5504 | super::vals::Odr(val as u8) | 3215 | val != 0 |
| 5505 | } | ||
| 5506 | #[doc = "Port output data (y = 0..15)"] | ||
| 5507 | pub fn set_odr(&mut self, n: usize, val: super::vals::Odr) { | ||
| 5508 | assert!(n < 16usize); | ||
| 5509 | let offs = 0usize + n * 1usize; | ||
| 5510 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 5511 | } | ||
| 5512 | } | ||
| 5513 | impl Default for Odr { | ||
| 5514 | fn default() -> Odr { | ||
| 5515 | Odr(0) | ||
| 5516 | } | ||
| 5517 | } | ||
| 5518 | #[doc = "GPIO alternate function register"] | ||
| 5519 | #[repr(transparent)] | ||
| 5520 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5521 | pub struct Afr(pub u32); | ||
| 5522 | impl Afr { | ||
| 5523 | #[doc = "Alternate function selection for port x bit y (y = 0..15)"] | ||
| 5524 | pub fn afr(&self, n: usize) -> super::vals::Afr { | ||
| 5525 | assert!(n < 8usize); | ||
| 5526 | let offs = 0usize + n * 4usize; | ||
| 5527 | let val = (self.0 >> offs) & 0x0f; | ||
| 5528 | super::vals::Afr(val as u8) | ||
| 5529 | } | ||
| 5530 | #[doc = "Alternate function selection for port x bit y (y = 0..15)"] | ||
| 5531 | pub fn set_afr(&mut self, n: usize, val: super::vals::Afr) { | ||
| 5532 | assert!(n < 8usize); | ||
| 5533 | let offs = 0usize + n * 4usize; | ||
| 5534 | self.0 = (self.0 & !(0x0f << offs)) | (((val.0 as u32) & 0x0f) << offs); | ||
| 5535 | } | ||
| 5536 | } | ||
| 5537 | impl Default for Afr { | ||
| 5538 | fn default() -> Afr { | ||
| 5539 | Afr(0) | ||
| 5540 | } | ||
| 5541 | } | ||
| 5542 | #[doc = "GPIO port output speed register"] | ||
| 5543 | #[repr(transparent)] | ||
| 5544 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5545 | pub struct Ospeedr(pub u32); | ||
| 5546 | impl Ospeedr { | ||
| 5547 | #[doc = "Port x configuration bits (y = 0..15)"] | ||
| 5548 | pub fn ospeedr(&self, n: usize) -> super::vals::Ospeedr { | ||
| 5549 | assert!(n < 16usize); | ||
| 5550 | let offs = 0usize + n * 2usize; | ||
| 5551 | let val = (self.0 >> offs) & 0x03; | ||
| 5552 | super::vals::Ospeedr(val as u8) | ||
| 5553 | } | 3216 | } |
| 5554 | #[doc = "Port x configuration bits (y = 0..15)"] | 3217 | #[doc = "Channel 1 Transfer Error clear"] |
| 5555 | pub fn set_ospeedr(&mut self, n: usize, val: super::vals::Ospeedr) { | 3218 | pub fn set_cteif(&mut self, n: usize, val: bool) { |
| 5556 | assert!(n < 16usize); | 3219 | assert!(n < 7usize); |
| 5557 | let offs = 0usize + n * 2usize; | 3220 | let offs = 3usize + n * 4usize; |
| 5558 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | 3221 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); |
| 5559 | } | 3222 | } |
| 5560 | } | 3223 | } |
| 5561 | impl Default for Ospeedr { | 3224 | impl Default for Ifcr { |
| 5562 | fn default() -> Ospeedr { | 3225 | fn default() -> Ifcr { |
| 5563 | Ospeedr(0) | 3226 | Ifcr(0) |
| 5564 | } | 3227 | } |
| 5565 | } | 3228 | } |
| 5566 | } | 3229 | } |
| @@ -5568,1269 +3231,1922 @@ pub mod gpio_v2 { | |||
| 5568 | use crate::generic::*; | 3231 | use crate::generic::*; |
| 5569 | #[repr(transparent)] | 3232 | #[repr(transparent)] |
| 5570 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 3233 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 5571 | pub struct Idr(pub u8); | 3234 | pub struct Dir(pub u8); |
| 5572 | impl Idr { | 3235 | impl Dir { |
| 5573 | #[doc = "Input is logic low"] | 3236 | #[doc = "Read from peripheral"] |
| 5574 | pub const LOW: Self = Self(0); | 3237 | pub const FROMPERIPHERAL: Self = Self(0); |
| 5575 | #[doc = "Input is logic high"] | 3238 | #[doc = "Read from memory"] |
| 5576 | pub const HIGH: Self = Self(0x01); | 3239 | pub const FROMMEMORY: Self = Self(0x01); |
| 5577 | } | ||
| 5578 | #[repr(transparent)] | ||
| 5579 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5580 | pub struct Bsw(pub u8); | ||
| 5581 | impl Bsw { | ||
| 5582 | #[doc = "Sets the corresponding ODRx bit"] | ||
| 5583 | pub const SET: Self = Self(0x01); | ||
| 5584 | } | ||
| 5585 | #[repr(transparent)] | ||
| 5586 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5587 | pub struct Lckk(pub u8); | ||
| 5588 | impl Lckk { | ||
| 5589 | #[doc = "Port configuration lock key not active"] | ||
| 5590 | pub const NOTACTIVE: Self = Self(0); | ||
| 5591 | #[doc = "Port configuration lock key active"] | ||
| 5592 | pub const ACTIVE: Self = Self(0x01); | ||
| 5593 | } | ||
| 5594 | #[repr(transparent)] | ||
| 5595 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5596 | pub struct Lck(pub u8); | ||
| 5597 | impl Lck { | ||
| 5598 | #[doc = "Port configuration not locked"] | ||
| 5599 | pub const UNLOCKED: Self = Self(0); | ||
| 5600 | #[doc = "Port configuration locked"] | ||
| 5601 | pub const LOCKED: Self = Self(0x01); | ||
| 5602 | } | ||
| 5603 | #[repr(transparent)] | ||
| 5604 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5605 | pub struct Brw(pub u8); | ||
| 5606 | impl Brw { | ||
| 5607 | #[doc = "Resets the corresponding ODRx bit"] | ||
| 5608 | pub const RESET: Self = Self(0x01); | ||
| 5609 | } | ||
| 5610 | #[repr(transparent)] | ||
| 5611 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5612 | pub struct Ospeedr(pub u8); | ||
| 5613 | impl Ospeedr { | ||
| 5614 | #[doc = "Low speed"] | ||
| 5615 | pub const LOWSPEED: Self = Self(0); | ||
| 5616 | #[doc = "Medium speed"] | ||
| 5617 | pub const MEDIUMSPEED: Self = Self(0x01); | ||
| 5618 | #[doc = "High speed"] | ||
| 5619 | pub const HIGHSPEED: Self = Self(0x02); | ||
| 5620 | #[doc = "Very high speed"] | ||
| 5621 | pub const VERYHIGHSPEED: Self = Self(0x03); | ||
| 5622 | } | 3240 | } |
| 5623 | #[repr(transparent)] | 3241 | #[repr(transparent)] |
| 5624 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 3242 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 5625 | pub struct Ot(pub u8); | 3243 | pub struct Inc(pub u8); |
| 5626 | impl Ot { | 3244 | impl Inc { |
| 5627 | #[doc = "Output push-pull (reset state)"] | 3245 | #[doc = "Increment mode disabled"] |
| 5628 | pub const PUSHPULL: Self = Self(0); | 3246 | pub const DISABLED: Self = Self(0); |
| 5629 | #[doc = "Output open-drain"] | 3247 | #[doc = "Increment mode enabled"] |
| 5630 | pub const OPENDRAIN: Self = Self(0x01); | 3248 | pub const ENABLED: Self = Self(0x01); |
| 5631 | } | 3249 | } |
| 5632 | #[repr(transparent)] | 3250 | #[repr(transparent)] |
| 5633 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 3251 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 5634 | pub struct Afr(pub u8); | 3252 | pub struct Circ(pub u8); |
| 5635 | impl Afr { | 3253 | impl Circ { |
| 5636 | #[doc = "AF0"] | 3254 | #[doc = "Circular buffer disabled"] |
| 5637 | pub const AF0: Self = Self(0); | 3255 | pub const DISABLED: Self = Self(0); |
| 5638 | #[doc = "AF1"] | 3256 | #[doc = "Circular buffer enabled"] |
| 5639 | pub const AF1: Self = Self(0x01); | 3257 | pub const ENABLED: Self = Self(0x01); |
| 5640 | #[doc = "AF2"] | ||
| 5641 | pub const AF2: Self = Self(0x02); | ||
| 5642 | #[doc = "AF3"] | ||
| 5643 | pub const AF3: Self = Self(0x03); | ||
| 5644 | #[doc = "AF4"] | ||
| 5645 | pub const AF4: Self = Self(0x04); | ||
| 5646 | #[doc = "AF5"] | ||
| 5647 | pub const AF5: Self = Self(0x05); | ||
| 5648 | #[doc = "AF6"] | ||
| 5649 | pub const AF6: Self = Self(0x06); | ||
| 5650 | #[doc = "AF7"] | ||
| 5651 | pub const AF7: Self = Self(0x07); | ||
| 5652 | #[doc = "AF8"] | ||
| 5653 | pub const AF8: Self = Self(0x08); | ||
| 5654 | #[doc = "AF9"] | ||
| 5655 | pub const AF9: Self = Self(0x09); | ||
| 5656 | #[doc = "AF10"] | ||
| 5657 | pub const AF10: Self = Self(0x0a); | ||
| 5658 | #[doc = "AF11"] | ||
| 5659 | pub const AF11: Self = Self(0x0b); | ||
| 5660 | #[doc = "AF12"] | ||
| 5661 | pub const AF12: Self = Self(0x0c); | ||
| 5662 | #[doc = "AF13"] | ||
| 5663 | pub const AF13: Self = Self(0x0d); | ||
| 5664 | #[doc = "AF14"] | ||
| 5665 | pub const AF14: Self = Self(0x0e); | ||
| 5666 | #[doc = "AF15"] | ||
| 5667 | pub const AF15: Self = Self(0x0f); | ||
| 5668 | } | 3258 | } |
| 5669 | #[repr(transparent)] | 3259 | #[repr(transparent)] |
| 5670 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 3260 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 5671 | pub struct Moder(pub u8); | 3261 | pub struct Pl(pub u8); |
| 5672 | impl Moder { | 3262 | impl Pl { |
| 5673 | #[doc = "Input mode (reset state)"] | 3263 | #[doc = "Low priority"] |
| 5674 | pub const INPUT: Self = Self(0); | 3264 | pub const LOW: Self = Self(0); |
| 5675 | #[doc = "General purpose output mode"] | 3265 | #[doc = "Medium priority"] |
| 5676 | pub const OUTPUT: Self = Self(0x01); | 3266 | pub const MEDIUM: Self = Self(0x01); |
| 5677 | #[doc = "Alternate function mode"] | 3267 | #[doc = "High priority"] |
| 5678 | pub const ALTERNATE: Self = Self(0x02); | 3268 | pub const HIGH: Self = Self(0x02); |
| 5679 | #[doc = "Analog mode"] | 3269 | #[doc = "Very high priority"] |
| 5680 | pub const ANALOG: Self = Self(0x03); | 3270 | pub const VERYHIGH: Self = Self(0x03); |
| 5681 | } | 3271 | } |
| 5682 | #[repr(transparent)] | 3272 | #[repr(transparent)] |
| 5683 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 3273 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 5684 | pub struct Odr(pub u8); | 3274 | pub struct Memmem(pub u8); |
| 5685 | impl Odr { | 3275 | impl Memmem { |
| 5686 | #[doc = "Set output to logic low"] | 3276 | #[doc = "Memory to memory mode disabled"] |
| 5687 | pub const LOW: Self = Self(0); | 3277 | pub const DISABLED: Self = Self(0); |
| 5688 | #[doc = "Set output to logic high"] | 3278 | #[doc = "Memory to memory mode enabled"] |
| 5689 | pub const HIGH: Self = Self(0x01); | 3279 | pub const ENABLED: Self = Self(0x01); |
| 5690 | } | 3280 | } |
| 5691 | #[repr(transparent)] | 3281 | #[repr(transparent)] |
| 5692 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 3282 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 5693 | pub struct Pupdr(pub u8); | 3283 | pub struct Size(pub u8); |
| 5694 | impl Pupdr { | 3284 | impl Size { |
| 5695 | #[doc = "No pull-up, pull-down"] | 3285 | #[doc = "8-bit size"] |
| 5696 | pub const FLOATING: Self = Self(0); | 3286 | pub const BITS8: Self = Self(0); |
| 5697 | #[doc = "Pull-up"] | 3287 | #[doc = "16-bit size"] |
| 5698 | pub const PULLUP: Self = Self(0x01); | 3288 | pub const BITS16: Self = Self(0x01); |
| 5699 | #[doc = "Pull-down"] | 3289 | #[doc = "32-bit size"] |
| 5700 | pub const PULLDOWN: Self = Self(0x02); | 3290 | pub const BITS32: Self = Self(0x02); |
| 5701 | } | 3291 | } |
| 5702 | } | 3292 | } |
| 5703 | } | 3293 | } |
| 5704 | pub mod exti_v1 { | 3294 | pub mod syscfg_f4 { |
| 5705 | use crate::generic::*; | 3295 | use crate::generic::*; |
| 5706 | #[doc = "External interrupt/event controller"] | 3296 | #[doc = "System configuration controller"] |
| 5707 | #[derive(Copy, Clone)] | 3297 | #[derive(Copy, Clone)] |
| 5708 | pub struct Exti(pub *mut u8); | 3298 | pub struct Syscfg(pub *mut u8); |
| 5709 | unsafe impl Send for Exti {} | 3299 | unsafe impl Send for Syscfg {} |
| 5710 | unsafe impl Sync for Exti {} | 3300 | unsafe impl Sync for Syscfg {} |
| 5711 | impl Exti { | 3301 | impl Syscfg { |
| 5712 | #[doc = "Interrupt mask register (EXTI_IMR)"] | 3302 | #[doc = "memory remap register"] |
| 5713 | pub fn imr(self) -> Reg<regs::Imr, RW> { | 3303 | pub fn memrm(self) -> Reg<regs::Memrm, RW> { |
| 5714 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | 3304 | unsafe { Reg::from_ptr(self.0.add(0usize)) } |
| 5715 | } | 3305 | } |
| 5716 | #[doc = "Event mask register (EXTI_EMR)"] | 3306 | #[doc = "peripheral mode configuration register"] |
| 5717 | pub fn emr(self) -> Reg<regs::Emr, RW> { | 3307 | pub fn pmc(self) -> Reg<regs::Pmc, RW> { |
| 5718 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | 3308 | unsafe { Reg::from_ptr(self.0.add(4usize)) } |
| 5719 | } | 3309 | } |
| 5720 | #[doc = "Rising Trigger selection register (EXTI_RTSR)"] | 3310 | #[doc = "external interrupt configuration register"] |
| 5721 | pub fn rtsr(self) -> Reg<regs::Rtsr, RW> { | 3311 | pub fn exticr(self, n: usize) -> Reg<regs::Exticr, RW> { |
| 5722 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | 3312 | assert!(n < 4usize); |
| 5723 | } | 3313 | unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) } |
| 5724 | #[doc = "Falling Trigger selection register (EXTI_FTSR)"] | ||
| 5725 | pub fn ftsr(self) -> Reg<regs::Ftsr, RW> { | ||
| 5726 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 5727 | } | ||
| 5728 | #[doc = "Software interrupt event register (EXTI_SWIER)"] | ||
| 5729 | pub fn swier(self) -> Reg<regs::Swier, RW> { | ||
| 5730 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 5731 | } | 3314 | } |
| 5732 | #[doc = "Pending register (EXTI_PR)"] | 3315 | #[doc = "Compensation cell control register"] |
| 5733 | pub fn pr(self) -> Reg<regs::Pr, RW> { | 3316 | pub fn cmpcr(self) -> Reg<regs::Cmpcr, R> { |
| 5734 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | 3317 | unsafe { Reg::from_ptr(self.0.add(32usize)) } |
| 5735 | } | 3318 | } |
| 5736 | } | 3319 | } |
| 5737 | pub mod regs { | 3320 | pub mod regs { |
| 5738 | use crate::generic::*; | 3321 | use crate::generic::*; |
| 5739 | #[doc = "Rising Trigger selection register (EXTI_RTSR)"] | 3322 | #[doc = "peripheral mode configuration register"] |
| 5740 | #[repr(transparent)] | 3323 | #[repr(transparent)] |
| 5741 | #[derive(Copy, Clone, Eq, PartialEq)] | 3324 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 5742 | pub struct Rtsr(pub u32); | 3325 | pub struct Pmc(pub u32); |
| 5743 | impl Rtsr { | 3326 | impl Pmc { |
| 5744 | #[doc = "Rising trigger event configuration of line 0"] | 3327 | #[doc = "ADC1DC2"] |
| 5745 | pub fn tr(&self, n: usize) -> super::vals::Tr { | 3328 | pub const fn adc1dc2(&self) -> bool { |
| 5746 | assert!(n < 23usize); | 3329 | let val = (self.0 >> 16usize) & 0x01; |
| 5747 | let offs = 0usize + n * 1usize; | 3330 | val != 0 |
| 5748 | let val = (self.0 >> offs) & 0x01; | ||
| 5749 | super::vals::Tr(val as u8) | ||
| 5750 | } | 3331 | } |
| 5751 | #[doc = "Rising trigger event configuration of line 0"] | 3332 | #[doc = "ADC1DC2"] |
| 5752 | pub fn set_tr(&mut self, n: usize, val: super::vals::Tr) { | 3333 | pub fn set_adc1dc2(&mut self, val: bool) { |
| 5753 | assert!(n < 23usize); | 3334 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); |
| 5754 | let offs = 0usize + n * 1usize; | ||
| 5755 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 5756 | } | 3335 | } |
| 5757 | } | 3336 | #[doc = "ADC2DC2"] |
| 5758 | impl Default for Rtsr { | 3337 | pub const fn adc2dc2(&self) -> bool { |
| 5759 | fn default() -> Rtsr { | 3338 | let val = (self.0 >> 17usize) & 0x01; |
| 5760 | Rtsr(0) | 3339 | val != 0 |
| 5761 | } | 3340 | } |
| 5762 | } | 3341 | #[doc = "ADC2DC2"] |
| 5763 | #[doc = "Interrupt mask register (EXTI_IMR)"] | 3342 | pub fn set_adc2dc2(&mut self, val: bool) { |
| 5764 | #[repr(transparent)] | 3343 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); |
| 5765 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5766 | pub struct Imr(pub u32); | ||
| 5767 | impl Imr { | ||
| 5768 | #[doc = "Interrupt Mask on line 0"] | ||
| 5769 | pub fn mr(&self, n: usize) -> super::vals::Mr { | ||
| 5770 | assert!(n < 23usize); | ||
| 5771 | let offs = 0usize + n * 1usize; | ||
| 5772 | let val = (self.0 >> offs) & 0x01; | ||
| 5773 | super::vals::Mr(val as u8) | ||
| 5774 | } | 3344 | } |
| 5775 | #[doc = "Interrupt Mask on line 0"] | 3345 | #[doc = "ADC3DC2"] |
| 5776 | pub fn set_mr(&mut self, n: usize, val: super::vals::Mr) { | 3346 | pub const fn adc3dc2(&self) -> bool { |
| 5777 | assert!(n < 23usize); | 3347 | let val = (self.0 >> 18usize) & 0x01; |
| 5778 | let offs = 0usize + n * 1usize; | 3348 | val != 0 |
| 5779 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 5780 | } | 3349 | } |
| 5781 | } | 3350 | #[doc = "ADC3DC2"] |
| 5782 | impl Default for Imr { | 3351 | pub fn set_adc3dc2(&mut self, val: bool) { |
| 5783 | fn default() -> Imr { | 3352 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); |
| 5784 | Imr(0) | ||
| 5785 | } | 3353 | } |
| 5786 | } | 3354 | #[doc = "Ethernet PHY interface selection"] |
| 5787 | #[doc = "Software interrupt event register (EXTI_SWIER)"] | 3355 | pub const fn mii_rmii_sel(&self) -> bool { |
| 5788 | #[repr(transparent)] | 3356 | let val = (self.0 >> 23usize) & 0x01; |
| 5789 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5790 | pub struct Swier(pub u32); | ||
| 5791 | impl Swier { | ||
| 5792 | #[doc = "Software Interrupt on line 0"] | ||
| 5793 | pub fn swier(&self, n: usize) -> bool { | ||
| 5794 | assert!(n < 23usize); | ||
| 5795 | let offs = 0usize + n * 1usize; | ||
| 5796 | let val = (self.0 >> offs) & 0x01; | ||
| 5797 | val != 0 | 3357 | val != 0 |
| 5798 | } | 3358 | } |
| 5799 | #[doc = "Software Interrupt on line 0"] | 3359 | #[doc = "Ethernet PHY interface selection"] |
| 5800 | pub fn set_swier(&mut self, n: usize, val: bool) { | 3360 | pub fn set_mii_rmii_sel(&mut self, val: bool) { |
| 5801 | assert!(n < 23usize); | 3361 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); |
| 5802 | let offs = 0usize + n * 1usize; | ||
| 5803 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 5804 | } | 3362 | } |
| 5805 | } | 3363 | } |
| 5806 | impl Default for Swier { | 3364 | impl Default for Pmc { |
| 5807 | fn default() -> Swier { | 3365 | fn default() -> Pmc { |
| 5808 | Swier(0) | 3366 | Pmc(0) |
| 5809 | } | 3367 | } |
| 5810 | } | 3368 | } |
| 5811 | #[doc = "Event mask register (EXTI_EMR)"] | 3369 | #[doc = "external interrupt configuration register"] |
| 5812 | #[repr(transparent)] | 3370 | #[repr(transparent)] |
| 5813 | #[derive(Copy, Clone, Eq, PartialEq)] | 3371 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 5814 | pub struct Emr(pub u32); | 3372 | pub struct Exticr(pub u32); |
| 5815 | impl Emr { | 3373 | impl Exticr { |
| 5816 | #[doc = "Event Mask on line 0"] | 3374 | #[doc = "EXTI x configuration"] |
| 5817 | pub fn mr(&self, n: usize) -> super::vals::Mr { | 3375 | pub fn exti(&self, n: usize) -> u8 { |
| 5818 | assert!(n < 23usize); | 3376 | assert!(n < 4usize); |
| 5819 | let offs = 0usize + n * 1usize; | 3377 | let offs = 0usize + n * 4usize; |
| 5820 | let val = (self.0 >> offs) & 0x01; | 3378 | let val = (self.0 >> offs) & 0x0f; |
| 5821 | super::vals::Mr(val as u8) | 3379 | val as u8 |
| 5822 | } | 3380 | } |
| 5823 | #[doc = "Event Mask on line 0"] | 3381 | #[doc = "EXTI x configuration"] |
| 5824 | pub fn set_mr(&mut self, n: usize, val: super::vals::Mr) { | 3382 | pub fn set_exti(&mut self, n: usize, val: u8) { |
| 5825 | assert!(n < 23usize); | 3383 | assert!(n < 4usize); |
| 5826 | let offs = 0usize + n * 1usize; | 3384 | let offs = 0usize + n * 4usize; |
| 5827 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | 3385 | self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs); |
| 5828 | } | 3386 | } |
| 5829 | } | 3387 | } |
| 5830 | impl Default for Emr { | 3388 | impl Default for Exticr { |
| 5831 | fn default() -> Emr { | 3389 | fn default() -> Exticr { |
| 5832 | Emr(0) | 3390 | Exticr(0) |
| 5833 | } | 3391 | } |
| 5834 | } | 3392 | } |
| 5835 | #[doc = "Pending register (EXTI_PR)"] | 3393 | #[doc = "Compensation cell control register"] |
| 5836 | #[repr(transparent)] | 3394 | #[repr(transparent)] |
| 5837 | #[derive(Copy, Clone, Eq, PartialEq)] | 3395 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 5838 | pub struct Pr(pub u32); | 3396 | pub struct Cmpcr(pub u32); |
| 5839 | impl Pr { | 3397 | impl Cmpcr { |
| 5840 | #[doc = "Pending bit 0"] | 3398 | #[doc = "Compensation cell power-down"] |
| 5841 | pub fn pr(&self, n: usize) -> bool { | 3399 | pub const fn cmp_pd(&self) -> bool { |
| 5842 | assert!(n < 23usize); | 3400 | let val = (self.0 >> 0usize) & 0x01; |
| 5843 | let offs = 0usize + n * 1usize; | ||
| 5844 | let val = (self.0 >> offs) & 0x01; | ||
| 5845 | val != 0 | 3401 | val != 0 |
| 5846 | } | 3402 | } |
| 5847 | #[doc = "Pending bit 0"] | 3403 | #[doc = "Compensation cell power-down"] |
| 5848 | pub fn set_pr(&mut self, n: usize, val: bool) { | 3404 | pub fn set_cmp_pd(&mut self, val: bool) { |
| 5849 | assert!(n < 23usize); | 3405 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 5850 | let offs = 0usize + n * 1usize; | 3406 | } |
| 5851 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | 3407 | #[doc = "READY"] |
| 3408 | pub const fn ready(&self) -> bool { | ||
| 3409 | let val = (self.0 >> 8usize) & 0x01; | ||
| 3410 | val != 0 | ||
| 3411 | } | ||
| 3412 | #[doc = "READY"] | ||
| 3413 | pub fn set_ready(&mut self, val: bool) { | ||
| 3414 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 5852 | } | 3415 | } |
| 5853 | } | 3416 | } |
| 5854 | impl Default for Pr { | 3417 | impl Default for Cmpcr { |
| 5855 | fn default() -> Pr { | 3418 | fn default() -> Cmpcr { |
| 5856 | Pr(0) | 3419 | Cmpcr(0) |
| 5857 | } | 3420 | } |
| 5858 | } | 3421 | } |
| 5859 | #[doc = "Falling Trigger selection register (EXTI_FTSR)"] | 3422 | #[doc = "memory remap register"] |
| 5860 | #[repr(transparent)] | 3423 | #[repr(transparent)] |
| 5861 | #[derive(Copy, Clone, Eq, PartialEq)] | 3424 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 5862 | pub struct Ftsr(pub u32); | 3425 | pub struct Memrm(pub u32); |
| 5863 | impl Ftsr { | 3426 | impl Memrm { |
| 5864 | #[doc = "Falling trigger event configuration of line 0"] | 3427 | #[doc = "Memory mapping selection"] |
| 5865 | pub fn tr(&self, n: usize) -> super::vals::Tr { | 3428 | pub const fn mem_mode(&self) -> u8 { |
| 5866 | assert!(n < 23usize); | 3429 | let val = (self.0 >> 0usize) & 0x07; |
| 5867 | let offs = 0usize + n * 1usize; | 3430 | val as u8 |
| 5868 | let val = (self.0 >> offs) & 0x01; | ||
| 5869 | super::vals::Tr(val as u8) | ||
| 5870 | } | 3431 | } |
| 5871 | #[doc = "Falling trigger event configuration of line 0"] | 3432 | #[doc = "Memory mapping selection"] |
| 5872 | pub fn set_tr(&mut self, n: usize, val: super::vals::Tr) { | 3433 | pub fn set_mem_mode(&mut self, val: u8) { |
| 5873 | assert!(n < 23usize); | 3434 | self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize); |
| 5874 | let offs = 0usize + n * 1usize; | ||
| 5875 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 5876 | } | 3435 | } |
| 5877 | } | 3436 | #[doc = "Flash bank mode selection"] |
| 5878 | impl Default for Ftsr { | 3437 | pub const fn fb_mode(&self) -> bool { |
| 5879 | fn default() -> Ftsr { | 3438 | let val = (self.0 >> 8usize) & 0x01; |
| 5880 | Ftsr(0) | 3439 | val != 0 |
| 3440 | } | ||
| 3441 | #[doc = "Flash bank mode selection"] | ||
| 3442 | pub fn set_fb_mode(&mut self, val: bool) { | ||
| 3443 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 3444 | } | ||
| 3445 | #[doc = "FMC memory mapping swap"] | ||
| 3446 | pub const fn swp_fmc(&self) -> u8 { | ||
| 3447 | let val = (self.0 >> 10usize) & 0x03; | ||
| 3448 | val as u8 | ||
| 3449 | } | ||
| 3450 | #[doc = "FMC memory mapping swap"] | ||
| 3451 | pub fn set_swp_fmc(&mut self, val: u8) { | ||
| 3452 | self.0 = (self.0 & !(0x03 << 10usize)) | (((val as u32) & 0x03) << 10usize); | ||
| 5881 | } | 3453 | } |
| 5882 | } | 3454 | } |
| 5883 | } | 3455 | impl Default for Memrm { |
| 5884 | pub mod vals { | 3456 | fn default() -> Memrm { |
| 5885 | use crate::generic::*; | 3457 | Memrm(0) |
| 5886 | #[repr(transparent)] | 3458 | } |
| 5887 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5888 | pub struct Prw(pub u8); | ||
| 5889 | impl Prw { | ||
| 5890 | #[doc = "Clears pending bit"] | ||
| 5891 | pub const CLEAR: Self = Self(0x01); | ||
| 5892 | } | ||
| 5893 | #[repr(transparent)] | ||
| 5894 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5895 | pub struct Prr(pub u8); | ||
| 5896 | impl Prr { | ||
| 5897 | #[doc = "No trigger request occurred"] | ||
| 5898 | pub const NOTPENDING: Self = Self(0); | ||
| 5899 | #[doc = "Selected trigger request occurred"] | ||
| 5900 | pub const PENDING: Self = Self(0x01); | ||
| 5901 | } | ||
| 5902 | #[repr(transparent)] | ||
| 5903 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5904 | pub struct Tr(pub u8); | ||
| 5905 | impl Tr { | ||
| 5906 | #[doc = "Falling edge trigger is disabled"] | ||
| 5907 | pub const DISABLED: Self = Self(0); | ||
| 5908 | #[doc = "Falling edge trigger is enabled"] | ||
| 5909 | pub const ENABLED: Self = Self(0x01); | ||
| 5910 | } | ||
| 5911 | #[repr(transparent)] | ||
| 5912 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5913 | pub struct Mr(pub u8); | ||
| 5914 | impl Mr { | ||
| 5915 | #[doc = "Interrupt request line is masked"] | ||
| 5916 | pub const MASKED: Self = Self(0); | ||
| 5917 | #[doc = "Interrupt request line is unmasked"] | ||
| 5918 | pub const UNMASKED: Self = Self(0x01); | ||
| 5919 | } | ||
| 5920 | #[repr(transparent)] | ||
| 5921 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5922 | pub struct Swierw(pub u8); | ||
| 5923 | impl Swierw { | ||
| 5924 | #[doc = "Generates an interrupt request"] | ||
| 5925 | pub const PEND: Self = Self(0x01); | ||
| 5926 | } | 3459 | } |
| 5927 | } | 3460 | } |
| 5928 | } | 3461 | } |
| 5929 | pub mod usart_v1 { | 3462 | pub mod syscfg_h7 { |
| 5930 | use crate::generic::*; | 3463 | use crate::generic::*; |
| 5931 | #[doc = "Universal synchronous asynchronous receiver transmitter"] | 3464 | #[doc = "System configuration controller"] |
| 5932 | #[derive(Copy, Clone)] | 3465 | #[derive(Copy, Clone)] |
| 5933 | pub struct Usart(pub *mut u8); | 3466 | pub struct Syscfg(pub *mut u8); |
| 5934 | unsafe impl Send for Usart {} | 3467 | unsafe impl Send for Syscfg {} |
| 5935 | unsafe impl Sync for Usart {} | 3468 | unsafe impl Sync for Syscfg {} |
| 5936 | impl Usart { | 3469 | impl Syscfg { |
| 5937 | #[doc = "Status register"] | 3470 | #[doc = "peripheral mode configuration register"] |
| 5938 | pub fn sr(self) -> Reg<regs::Sr, RW> { | 3471 | pub fn pmcr(self) -> Reg<regs::Pmcr, RW> { |
| 5939 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 5940 | } | ||
| 5941 | #[doc = "Data register"] | ||
| 5942 | pub fn dr(self) -> Reg<regs::Dr, RW> { | ||
| 5943 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | 3472 | unsafe { Reg::from_ptr(self.0.add(4usize)) } |
| 5944 | } | 3473 | } |
| 5945 | #[doc = "Baud rate register"] | 3474 | #[doc = "external interrupt configuration register 1"] |
| 5946 | pub fn brr(self) -> Reg<regs::Brr, RW> { | 3475 | pub fn exticr(self, n: usize) -> Reg<regs::Exticr, RW> { |
| 5947 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | 3476 | assert!(n < 4usize); |
| 3477 | unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) } | ||
| 5948 | } | 3478 | } |
| 5949 | #[doc = "Control register 1"] | 3479 | #[doc = "compensation cell control/status register"] |
| 5950 | pub fn cr1(self) -> Reg<regs::Cr1, RW> { | 3480 | pub fn cccsr(self) -> Reg<regs::Cccsr, RW> { |
| 5951 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | 3481 | unsafe { Reg::from_ptr(self.0.add(32usize)) } |
| 5952 | } | 3482 | } |
| 5953 | #[doc = "Control register 2"] | 3483 | #[doc = "SYSCFG compensation cell value register"] |
| 5954 | pub fn cr2(self) -> Reg<regs::Cr2Usart, RW> { | 3484 | pub fn ccvr(self) -> Reg<regs::Ccvr, R> { |
| 5955 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | 3485 | unsafe { Reg::from_ptr(self.0.add(36usize)) } |
| 5956 | } | 3486 | } |
| 5957 | #[doc = "Control register 3"] | 3487 | #[doc = "SYSCFG compensation cell code register"] |
| 5958 | pub fn cr3(self) -> Reg<regs::Cr3Usart, RW> { | 3488 | pub fn cccr(self) -> Reg<regs::Cccr, RW> { |
| 5959 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | 3489 | unsafe { Reg::from_ptr(self.0.add(40usize)) } |
| 5960 | } | 3490 | } |
| 5961 | #[doc = "Guard time and prescaler register"] | 3491 | #[doc = "SYSCFG power control register"] |
| 5962 | pub fn gtpr(self) -> Reg<regs::Gtpr, RW> { | 3492 | pub fn pwrcr(self) -> Reg<regs::Pwrcr, RW> { |
| 5963 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | 3493 | unsafe { Reg::from_ptr(self.0.add(44usize)) } |
| 5964 | } | 3494 | } |
| 5965 | } | 3495 | #[doc = "SYSCFG package register"] |
| 5966 | #[doc = "Universal asynchronous receiver transmitter"] | 3496 | pub fn pkgr(self) -> Reg<regs::Pkgr, R> { |
| 5967 | #[derive(Copy, Clone)] | 3497 | unsafe { Reg::from_ptr(self.0.add(292usize)) } |
| 5968 | pub struct Uart(pub *mut u8); | ||
| 5969 | unsafe impl Send for Uart {} | ||
| 5970 | unsafe impl Sync for Uart {} | ||
| 5971 | impl Uart { | ||
| 5972 | #[doc = "Status register"] | ||
| 5973 | pub fn sr(self) -> Reg<regs::Sr, RW> { | ||
| 5974 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 5975 | } | 3498 | } |
| 5976 | #[doc = "Data register"] | 3499 | #[doc = "SYSCFG user register 0"] |
| 5977 | pub fn dr(self) -> Reg<regs::Dr, RW> { | 3500 | pub fn ur0(self) -> Reg<regs::Ur0, R> { |
| 5978 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | 3501 | unsafe { Reg::from_ptr(self.0.add(768usize)) } |
| 5979 | } | 3502 | } |
| 5980 | #[doc = "Baud rate register"] | 3503 | #[doc = "SYSCFG user register 2"] |
| 5981 | pub fn brr(self) -> Reg<regs::Brr, RW> { | 3504 | pub fn ur2(self) -> Reg<regs::Ur2, RW> { |
| 5982 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | 3505 | unsafe { Reg::from_ptr(self.0.add(776usize)) } |
| 5983 | } | 3506 | } |
| 5984 | #[doc = "Control register 1"] | 3507 | #[doc = "SYSCFG user register 3"] |
| 5985 | pub fn cr1(self) -> Reg<regs::Cr1, RW> { | 3508 | pub fn ur3(self) -> Reg<regs::Ur3, RW> { |
| 5986 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | 3509 | unsafe { Reg::from_ptr(self.0.add(780usize)) } |
| 5987 | } | 3510 | } |
| 5988 | #[doc = "Control register 2"] | 3511 | #[doc = "SYSCFG user register 4"] |
| 5989 | pub fn cr2(self) -> Reg<regs::Cr2, RW> { | 3512 | pub fn ur4(self) -> Reg<regs::Ur4, R> { |
| 5990 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | 3513 | unsafe { Reg::from_ptr(self.0.add(784usize)) } |
| 5991 | } | 3514 | } |
| 5992 | #[doc = "Control register 3"] | 3515 | #[doc = "SYSCFG user register 5"] |
| 5993 | pub fn cr3(self) -> Reg<regs::Cr3, RW> { | 3516 | pub fn ur5(self) -> Reg<regs::Ur5, R> { |
| 5994 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | 3517 | unsafe { Reg::from_ptr(self.0.add(788usize)) } |
| 5995 | } | 3518 | } |
| 5996 | } | 3519 | #[doc = "SYSCFG user register 6"] |
| 5997 | pub mod vals { | 3520 | pub fn ur6(self) -> Reg<regs::Ur6, R> { |
| 5998 | use crate::generic::*; | 3521 | unsafe { Reg::from_ptr(self.0.add(792usize)) } |
| 5999 | #[repr(transparent)] | ||
| 6000 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 6001 | pub struct Hdsel(pub u8); | ||
| 6002 | impl Hdsel { | ||
| 6003 | #[doc = "Half duplex mode is not selected"] | ||
| 6004 | pub const FULLDUPLEX: Self = Self(0); | ||
| 6005 | #[doc = "Half duplex mode is selected"] | ||
| 6006 | pub const HALFDUPLEX: Self = Self(0x01); | ||
| 6007 | } | 3522 | } |
| 6008 | #[repr(transparent)] | 3523 | #[doc = "SYSCFG user register 7"] |
| 6009 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 3524 | pub fn ur7(self) -> Reg<regs::Ur7, R> { |
| 6010 | pub struct M(pub u8); | 3525 | unsafe { Reg::from_ptr(self.0.add(796usize)) } |
| 6011 | impl M { | ||
| 6012 | #[doc = "8 data bits"] | ||
| 6013 | pub const M8: Self = Self(0); | ||
| 6014 | #[doc = "9 data bits"] | ||
| 6015 | pub const M9: Self = Self(0x01); | ||
| 6016 | } | 3526 | } |
| 6017 | #[repr(transparent)] | 3527 | #[doc = "SYSCFG user register 8"] |
| 6018 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 3528 | pub fn ur8(self) -> Reg<regs::Ur8, R> { |
| 6019 | pub struct Cpol(pub u8); | 3529 | unsafe { Reg::from_ptr(self.0.add(800usize)) } |
| 6020 | impl Cpol { | ||
| 6021 | #[doc = "Steady low value on CK pin outside transmission window"] | ||
| 6022 | pub const LOW: Self = Self(0); | ||
| 6023 | #[doc = "Steady high value on CK pin outside transmission window"] | ||
| 6024 | pub const HIGH: Self = Self(0x01); | ||
| 6025 | } | 3530 | } |
| 6026 | #[repr(transparent)] | 3531 | #[doc = "SYSCFG user register 9"] |
| 6027 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 3532 | pub fn ur9(self) -> Reg<regs::Ur9, R> { |
| 6028 | pub struct Rwu(pub u8); | 3533 | unsafe { Reg::from_ptr(self.0.add(804usize)) } |
| 6029 | impl Rwu { | ||
| 6030 | #[doc = "Receiver in active mode"] | ||
| 6031 | pub const ACTIVE: Self = Self(0); | ||
| 6032 | #[doc = "Receiver in mute mode"] | ||
| 6033 | pub const MUTE: Self = Self(0x01); | ||
| 6034 | } | 3534 | } |
| 6035 | #[repr(transparent)] | 3535 | #[doc = "SYSCFG user register 10"] |
| 6036 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 3536 | pub fn ur10(self) -> Reg<regs::Ur10, R> { |
| 6037 | pub struct Ps(pub u8); | 3537 | unsafe { Reg::from_ptr(self.0.add(808usize)) } |
| 6038 | impl Ps { | ||
| 6039 | #[doc = "Even parity"] | ||
| 6040 | pub const EVEN: Self = Self(0); | ||
| 6041 | #[doc = "Odd parity"] | ||
| 6042 | pub const ODD: Self = Self(0x01); | ||
| 6043 | } | 3538 | } |
| 6044 | #[repr(transparent)] | 3539 | #[doc = "SYSCFG user register 11"] |
| 6045 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 3540 | pub fn ur11(self) -> Reg<regs::Ur11, R> { |
| 6046 | pub struct Irlp(pub u8); | 3541 | unsafe { Reg::from_ptr(self.0.add(812usize)) } |
| 6047 | impl Irlp { | ||
| 6048 | #[doc = "Normal mode"] | ||
| 6049 | pub const NORMAL: Self = Self(0); | ||
| 6050 | #[doc = "Low-power mode"] | ||
| 6051 | pub const LOWPOWER: Self = Self(0x01); | ||
| 6052 | } | 3542 | } |
| 6053 | #[repr(transparent)] | 3543 | #[doc = "SYSCFG user register 12"] |
| 6054 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 3544 | pub fn ur12(self) -> Reg<regs::Ur12, R> { |
| 6055 | pub struct Stop(pub u8); | 3545 | unsafe { Reg::from_ptr(self.0.add(816usize)) } |
| 6056 | impl Stop { | ||
| 6057 | #[doc = "1 stop bit"] | ||
| 6058 | pub const STOP1: Self = Self(0); | ||
| 6059 | #[doc = "0.5 stop bits"] | ||
| 6060 | pub const STOP0P5: Self = Self(0x01); | ||
| 6061 | #[doc = "2 stop bits"] | ||
| 6062 | pub const STOP2: Self = Self(0x02); | ||
| 6063 | #[doc = "1.5 stop bits"] | ||
| 6064 | pub const STOP1P5: Self = Self(0x03); | ||
| 6065 | } | 3546 | } |
| 6066 | #[repr(transparent)] | 3547 | #[doc = "SYSCFG user register 13"] |
| 6067 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 3548 | pub fn ur13(self) -> Reg<regs::Ur13, R> { |
| 6068 | pub struct Cpha(pub u8); | 3549 | unsafe { Reg::from_ptr(self.0.add(820usize)) } |
| 6069 | impl Cpha { | ||
| 6070 | #[doc = "The first clock transition is the first data capture edge"] | ||
| 6071 | pub const FIRST: Self = Self(0); | ||
| 6072 | #[doc = "The second clock transition is the first data capture edge"] | ||
| 6073 | pub const SECOND: Self = Self(0x01); | ||
| 6074 | } | 3550 | } |
| 6075 | #[repr(transparent)] | 3551 | #[doc = "SYSCFG user register 14"] |
| 6076 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 3552 | pub fn ur14(self) -> Reg<regs::Ur14, RW> { |
| 6077 | pub struct Wake(pub u8); | 3553 | unsafe { Reg::from_ptr(self.0.add(824usize)) } |
| 6078 | impl Wake { | ||
| 6079 | #[doc = "USART wakeup on idle line"] | ||
| 6080 | pub const IDLELINE: Self = Self(0); | ||
| 6081 | #[doc = "USART wakeup on address mark"] | ||
| 6082 | pub const ADDRESSMARK: Self = Self(0x01); | ||
| 6083 | } | 3554 | } |
| 6084 | #[repr(transparent)] | 3555 | #[doc = "SYSCFG user register 15"] |
| 6085 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 3556 | pub fn ur15(self) -> Reg<regs::Ur15, R> { |
| 6086 | pub struct Lbdl(pub u8); | 3557 | unsafe { Reg::from_ptr(self.0.add(828usize)) } |
| 6087 | impl Lbdl { | ||
| 6088 | #[doc = "10-bit break detection"] | ||
| 6089 | pub const LBDL10: Self = Self(0); | ||
| 6090 | #[doc = "11-bit break detection"] | ||
| 6091 | pub const LBDL11: Self = Self(0x01); | ||
| 6092 | } | 3558 | } |
| 6093 | #[repr(transparent)] | 3559 | #[doc = "SYSCFG user register 16"] |
| 6094 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 3560 | pub fn ur16(self) -> Reg<regs::Ur16, R> { |
| 6095 | pub struct Sbk(pub u8); | 3561 | unsafe { Reg::from_ptr(self.0.add(832usize)) } |
| 6096 | impl Sbk { | 3562 | } |
| 6097 | #[doc = "No break character is transmitted"] | 3563 | #[doc = "SYSCFG user register 17"] |
| 6098 | pub const NOBREAK: Self = Self(0); | 3564 | pub fn ur17(self) -> Reg<regs::Ur17, R> { |
| 6099 | #[doc = "Break character transmitted"] | 3565 | unsafe { Reg::from_ptr(self.0.add(836usize)) } |
| 6100 | pub const BREAK: Self = Self(0x01); | ||
| 6101 | } | 3566 | } |
| 6102 | } | 3567 | } |
| 6103 | pub mod regs { | 3568 | pub mod regs { |
| 6104 | use crate::generic::*; | 3569 | use crate::generic::*; |
| 6105 | #[doc = "Status register"] | 3570 | #[doc = "SYSCFG user register 13"] |
| 6106 | #[repr(transparent)] | 3571 | #[repr(transparent)] |
| 6107 | #[derive(Copy, Clone, Eq, PartialEq)] | 3572 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 6108 | pub struct Sr(pub u32); | 3573 | pub struct Ur13(pub u32); |
| 6109 | impl Sr { | 3574 | impl Ur13 { |
| 6110 | #[doc = "Parity error"] | 3575 | #[doc = "Secured DTCM RAM Size"] |
| 6111 | pub const fn pe(&self) -> bool { | 3576 | pub const fn sdrs(&self) -> u8 { |
| 3577 | let val = (self.0 >> 0usize) & 0x03; | ||
| 3578 | val as u8 | ||
| 3579 | } | ||
| 3580 | #[doc = "Secured DTCM RAM Size"] | ||
| 3581 | pub fn set_sdrs(&mut self, val: u8) { | ||
| 3582 | self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize); | ||
| 3583 | } | ||
| 3584 | #[doc = "D1 Standby reset"] | ||
| 3585 | pub const fn d1sbrst(&self) -> bool { | ||
| 3586 | let val = (self.0 >> 16usize) & 0x01; | ||
| 3587 | val != 0 | ||
| 3588 | } | ||
| 3589 | #[doc = "D1 Standby reset"] | ||
| 3590 | pub fn set_d1sbrst(&mut self, val: bool) { | ||
| 3591 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | ||
| 3592 | } | ||
| 3593 | } | ||
| 3594 | impl Default for Ur13 { | ||
| 3595 | fn default() -> Ur13 { | ||
| 3596 | Ur13(0) | ||
| 3597 | } | ||
| 3598 | } | ||
| 3599 | #[doc = "peripheral mode configuration register"] | ||
| 3600 | #[repr(transparent)] | ||
| 3601 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3602 | pub struct Pmcr(pub u32); | ||
| 3603 | impl Pmcr { | ||
| 3604 | #[doc = "I2C1 Fm+"] | ||
| 3605 | pub const fn i2c1fmp(&self) -> bool { | ||
| 6112 | let val = (self.0 >> 0usize) & 0x01; | 3606 | let val = (self.0 >> 0usize) & 0x01; |
| 6113 | val != 0 | 3607 | val != 0 |
| 6114 | } | 3608 | } |
| 6115 | #[doc = "Parity error"] | 3609 | #[doc = "I2C1 Fm+"] |
| 6116 | pub fn set_pe(&mut self, val: bool) { | 3610 | pub fn set_i2c1fmp(&mut self, val: bool) { |
| 6117 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 3611 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 6118 | } | 3612 | } |
| 6119 | #[doc = "Framing error"] | 3613 | #[doc = "I2C2 Fm+"] |
| 6120 | pub const fn fe(&self) -> bool { | 3614 | pub const fn i2c2fmp(&self) -> bool { |
| 6121 | let val = (self.0 >> 1usize) & 0x01; | 3615 | let val = (self.0 >> 1usize) & 0x01; |
| 6122 | val != 0 | 3616 | val != 0 |
| 6123 | } | 3617 | } |
| 6124 | #[doc = "Framing error"] | 3618 | #[doc = "I2C2 Fm+"] |
| 6125 | pub fn set_fe(&mut self, val: bool) { | 3619 | pub fn set_i2c2fmp(&mut self, val: bool) { |
| 6126 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 3620 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 6127 | } | 3621 | } |
| 6128 | #[doc = "Noise error flag"] | 3622 | #[doc = "I2C3 Fm+"] |
| 6129 | pub const fn ne(&self) -> bool { | 3623 | pub const fn i2c3fmp(&self) -> bool { |
| 6130 | let val = (self.0 >> 2usize) & 0x01; | 3624 | let val = (self.0 >> 2usize) & 0x01; |
| 6131 | val != 0 | 3625 | val != 0 |
| 6132 | } | 3626 | } |
| 6133 | #[doc = "Noise error flag"] | 3627 | #[doc = "I2C3 Fm+"] |
| 6134 | pub fn set_ne(&mut self, val: bool) { | 3628 | pub fn set_i2c3fmp(&mut self, val: bool) { |
| 6135 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 3629 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 6136 | } | 3630 | } |
| 6137 | #[doc = "Overrun error"] | 3631 | #[doc = "I2C4 Fm+"] |
| 6138 | pub const fn ore(&self) -> bool { | 3632 | pub const fn i2c4fmp(&self) -> bool { |
| 6139 | let val = (self.0 >> 3usize) & 0x01; | 3633 | let val = (self.0 >> 3usize) & 0x01; |
| 6140 | val != 0 | 3634 | val != 0 |
| 6141 | } | 3635 | } |
| 6142 | #[doc = "Overrun error"] | 3636 | #[doc = "I2C4 Fm+"] |
| 6143 | pub fn set_ore(&mut self, val: bool) { | 3637 | pub fn set_i2c4fmp(&mut self, val: bool) { |
| 6144 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 3638 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); |
| 6145 | } | 3639 | } |
| 6146 | #[doc = "IDLE line detected"] | 3640 | #[doc = "PB(6) Fm+"] |
| 6147 | pub const fn idle(&self) -> bool { | 3641 | pub const fn pb6fmp(&self) -> bool { |
| 6148 | let val = (self.0 >> 4usize) & 0x01; | 3642 | let val = (self.0 >> 4usize) & 0x01; |
| 6149 | val != 0 | 3643 | val != 0 |
| 6150 | } | 3644 | } |
| 6151 | #[doc = "IDLE line detected"] | 3645 | #[doc = "PB(6) Fm+"] |
| 6152 | pub fn set_idle(&mut self, val: bool) { | 3646 | pub fn set_pb6fmp(&mut self, val: bool) { |
| 6153 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 3647 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 6154 | } | 3648 | } |
| 6155 | #[doc = "Read data register not empty"] | 3649 | #[doc = "PB(7) Fast Mode Plus"] |
| 6156 | pub const fn rxne(&self) -> bool { | 3650 | pub const fn pb7fmp(&self) -> bool { |
| 6157 | let val = (self.0 >> 5usize) & 0x01; | 3651 | let val = (self.0 >> 5usize) & 0x01; |
| 6158 | val != 0 | 3652 | val != 0 |
| 6159 | } | 3653 | } |
| 6160 | #[doc = "Read data register not empty"] | 3654 | #[doc = "PB(7) Fast Mode Plus"] |
| 6161 | pub fn set_rxne(&mut self, val: bool) { | 3655 | pub fn set_pb7fmp(&mut self, val: bool) { |
| 6162 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 3656 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 6163 | } | 3657 | } |
| 6164 | #[doc = "Transmission complete"] | 3658 | #[doc = "PB(8) Fast Mode Plus"] |
| 6165 | pub const fn tc(&self) -> bool { | 3659 | pub const fn pb8fmp(&self) -> bool { |
| 6166 | let val = (self.0 >> 6usize) & 0x01; | 3660 | let val = (self.0 >> 6usize) & 0x01; |
| 6167 | val != 0 | 3661 | val != 0 |
| 6168 | } | 3662 | } |
| 6169 | #[doc = "Transmission complete"] | 3663 | #[doc = "PB(8) Fast Mode Plus"] |
| 6170 | pub fn set_tc(&mut self, val: bool) { | 3664 | pub fn set_pb8fmp(&mut self, val: bool) { |
| 6171 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 3665 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 6172 | } | 3666 | } |
| 6173 | #[doc = "Transmit data register empty"] | 3667 | #[doc = "PB(9) Fm+"] |
| 6174 | pub const fn txe(&self) -> bool { | 3668 | pub const fn pb9fmp(&self) -> bool { |
| 6175 | let val = (self.0 >> 7usize) & 0x01; | 3669 | let val = (self.0 >> 7usize) & 0x01; |
| 6176 | val != 0 | 3670 | val != 0 |
| 6177 | } | 3671 | } |
| 6178 | #[doc = "Transmit data register empty"] | 3672 | #[doc = "PB(9) Fm+"] |
| 6179 | pub fn set_txe(&mut self, val: bool) { | 3673 | pub fn set_pb9fmp(&mut self, val: bool) { |
| 6180 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 3674 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 6181 | } | 3675 | } |
| 6182 | #[doc = "LIN break detection flag"] | 3676 | #[doc = "Booster Enable"] |
| 6183 | pub const fn lbd(&self) -> bool { | 3677 | pub const fn booste(&self) -> bool { |
| 6184 | let val = (self.0 >> 8usize) & 0x01; | 3678 | let val = (self.0 >> 8usize) & 0x01; |
| 6185 | val != 0 | 3679 | val != 0 |
| 6186 | } | 3680 | } |
| 6187 | #[doc = "LIN break detection flag"] | 3681 | #[doc = "Booster Enable"] |
| 6188 | pub fn set_lbd(&mut self, val: bool) { | 3682 | pub fn set_booste(&mut self, val: bool) { |
| 6189 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 3683 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 6190 | } | 3684 | } |
| 3685 | #[doc = "Analog switch supply voltage selection"] | ||
| 3686 | pub const fn boostvddsel(&self) -> bool { | ||
| 3687 | let val = (self.0 >> 9usize) & 0x01; | ||
| 3688 | val != 0 | ||
| 3689 | } | ||
| 3690 | #[doc = "Analog switch supply voltage selection"] | ||
| 3691 | pub fn set_boostvddsel(&mut self, val: bool) { | ||
| 3692 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | ||
| 3693 | } | ||
| 3694 | #[doc = "Ethernet PHY Interface Selection"] | ||
| 3695 | pub const fn epis(&self) -> u8 { | ||
| 3696 | let val = (self.0 >> 21usize) & 0x07; | ||
| 3697 | val as u8 | ||
| 3698 | } | ||
| 3699 | #[doc = "Ethernet PHY Interface Selection"] | ||
| 3700 | pub fn set_epis(&mut self, val: u8) { | ||
| 3701 | self.0 = (self.0 & !(0x07 << 21usize)) | (((val as u32) & 0x07) << 21usize); | ||
| 3702 | } | ||
| 3703 | #[doc = "PA0 Switch Open"] | ||
| 3704 | pub const fn pa0so(&self) -> bool { | ||
| 3705 | let val = (self.0 >> 24usize) & 0x01; | ||
| 3706 | val != 0 | ||
| 3707 | } | ||
| 3708 | #[doc = "PA0 Switch Open"] | ||
| 3709 | pub fn set_pa0so(&mut self, val: bool) { | ||
| 3710 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize); | ||
| 3711 | } | ||
| 3712 | #[doc = "PA1 Switch Open"] | ||
| 3713 | pub const fn pa1so(&self) -> bool { | ||
| 3714 | let val = (self.0 >> 25usize) & 0x01; | ||
| 3715 | val != 0 | ||
| 3716 | } | ||
| 3717 | #[doc = "PA1 Switch Open"] | ||
| 3718 | pub fn set_pa1so(&mut self, val: bool) { | ||
| 3719 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize); | ||
| 3720 | } | ||
| 3721 | #[doc = "PC2 Switch Open"] | ||
| 3722 | pub const fn pc2so(&self) -> bool { | ||
| 3723 | let val = (self.0 >> 26usize) & 0x01; | ||
| 3724 | val != 0 | ||
| 3725 | } | ||
| 3726 | #[doc = "PC2 Switch Open"] | ||
| 3727 | pub fn set_pc2so(&mut self, val: bool) { | ||
| 3728 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); | ||
| 3729 | } | ||
| 3730 | #[doc = "PC3 Switch Open"] | ||
| 3731 | pub const fn pc3so(&self) -> bool { | ||
| 3732 | let val = (self.0 >> 27usize) & 0x01; | ||
| 3733 | val != 0 | ||
| 3734 | } | ||
| 3735 | #[doc = "PC3 Switch Open"] | ||
| 3736 | pub fn set_pc3so(&mut self, val: bool) { | ||
| 3737 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize); | ||
| 3738 | } | ||
| 6191 | } | 3739 | } |
| 6192 | impl Default for Sr { | 3740 | impl Default for Pmcr { |
| 6193 | fn default() -> Sr { | 3741 | fn default() -> Pmcr { |
| 6194 | Sr(0) | 3742 | Pmcr(0) |
| 6195 | } | 3743 | } |
| 6196 | } | 3744 | } |
| 6197 | #[doc = "Control register 2"] | 3745 | #[doc = "SYSCFG user register 2"] |
| 6198 | #[repr(transparent)] | 3746 | #[repr(transparent)] |
| 6199 | #[derive(Copy, Clone, Eq, PartialEq)] | 3747 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 6200 | pub struct Cr2(pub u32); | 3748 | pub struct Ur2(pub u32); |
| 6201 | impl Cr2 { | 3749 | impl Ur2 { |
| 6202 | #[doc = "Address of the USART node"] | 3750 | #[doc = "BOR_LVL Brownout Reset Threshold Level"] |
| 6203 | pub const fn add(&self) -> u8 { | 3751 | pub const fn borh(&self) -> u8 { |
| 3752 | let val = (self.0 >> 0usize) & 0x03; | ||
| 3753 | val as u8 | ||
| 3754 | } | ||
| 3755 | #[doc = "BOR_LVL Brownout Reset Threshold Level"] | ||
| 3756 | pub fn set_borh(&mut self, val: u8) { | ||
| 3757 | self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize); | ||
| 3758 | } | ||
| 3759 | #[doc = "Boot Address 0"] | ||
| 3760 | pub const fn boot_add0(&self) -> u16 { | ||
| 3761 | let val = (self.0 >> 16usize) & 0xffff; | ||
| 3762 | val as u16 | ||
| 3763 | } | ||
| 3764 | #[doc = "Boot Address 0"] | ||
| 3765 | pub fn set_boot_add0(&mut self, val: u16) { | ||
| 3766 | self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize); | ||
| 3767 | } | ||
| 3768 | } | ||
| 3769 | impl Default for Ur2 { | ||
| 3770 | fn default() -> Ur2 { | ||
| 3771 | Ur2(0) | ||
| 3772 | } | ||
| 3773 | } | ||
| 3774 | #[doc = "SYSCFG user register 6"] | ||
| 3775 | #[repr(transparent)] | ||
| 3776 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3777 | pub struct Ur6(pub u32); | ||
| 3778 | impl Ur6 { | ||
| 3779 | #[doc = "Protected area start address for bank 1"] | ||
| 3780 | pub const fn pa_beg_1(&self) -> u16 { | ||
| 3781 | let val = (self.0 >> 0usize) & 0x0fff; | ||
| 3782 | val as u16 | ||
| 3783 | } | ||
| 3784 | #[doc = "Protected area start address for bank 1"] | ||
| 3785 | pub fn set_pa_beg_1(&mut self, val: u16) { | ||
| 3786 | self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); | ||
| 3787 | } | ||
| 3788 | #[doc = "Protected area end address for bank 1"] | ||
| 3789 | pub const fn pa_end_1(&self) -> u16 { | ||
| 3790 | let val = (self.0 >> 16usize) & 0x0fff; | ||
| 3791 | val as u16 | ||
| 3792 | } | ||
| 3793 | #[doc = "Protected area end address for bank 1"] | ||
| 3794 | pub fn set_pa_end_1(&mut self, val: u16) { | ||
| 3795 | self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); | ||
| 3796 | } | ||
| 3797 | } | ||
| 3798 | impl Default for Ur6 { | ||
| 3799 | fn default() -> Ur6 { | ||
| 3800 | Ur6(0) | ||
| 3801 | } | ||
| 3802 | } | ||
| 3803 | #[doc = "SYSCFG power control register"] | ||
| 3804 | #[repr(transparent)] | ||
| 3805 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3806 | pub struct Pwrcr(pub u32); | ||
| 3807 | impl Pwrcr { | ||
| 3808 | #[doc = "Overdrive enable"] | ||
| 3809 | pub const fn oden(&self) -> u8 { | ||
| 6204 | let val = (self.0 >> 0usize) & 0x0f; | 3810 | let val = (self.0 >> 0usize) & 0x0f; |
| 6205 | val as u8 | 3811 | val as u8 |
| 6206 | } | 3812 | } |
| 6207 | #[doc = "Address of the USART node"] | 3813 | #[doc = "Overdrive enable"] |
| 6208 | pub fn set_add(&mut self, val: u8) { | 3814 | pub fn set_oden(&mut self, val: u8) { |
| 6209 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); | 3815 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); |
| 6210 | } | 3816 | } |
| 6211 | #[doc = "lin break detection length"] | 3817 | } |
| 6212 | pub const fn lbdl(&self) -> super::vals::Lbdl { | 3818 | impl Default for Pwrcr { |
| 6213 | let val = (self.0 >> 5usize) & 0x01; | 3819 | fn default() -> Pwrcr { |
| 6214 | super::vals::Lbdl(val as u8) | 3820 | Pwrcr(0) |
| 6215 | } | 3821 | } |
| 6216 | #[doc = "lin break detection length"] | 3822 | } |
| 6217 | pub fn set_lbdl(&mut self, val: super::vals::Lbdl) { | 3823 | #[doc = "SYSCFG user register 17"] |
| 6218 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | 3824 | #[repr(transparent)] |
| 3825 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3826 | pub struct Ur17(pub u32); | ||
| 3827 | impl Ur17 { | ||
| 3828 | #[doc = "I/O high speed / low voltage"] | ||
| 3829 | pub const fn io_hslv(&self) -> bool { | ||
| 3830 | let val = (self.0 >> 0usize) & 0x01; | ||
| 3831 | val != 0 | ||
| 6219 | } | 3832 | } |
| 6220 | #[doc = "LIN break detection interrupt enable"] | 3833 | #[doc = "I/O high speed / low voltage"] |
| 6221 | pub const fn lbdie(&self) -> bool { | 3834 | pub fn set_io_hslv(&mut self, val: bool) { |
| 6222 | let val = (self.0 >> 6usize) & 0x01; | 3835 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 3836 | } | ||
| 3837 | } | ||
| 3838 | impl Default for Ur17 { | ||
| 3839 | fn default() -> Ur17 { | ||
| 3840 | Ur17(0) | ||
| 3841 | } | ||
| 3842 | } | ||
| 3843 | #[doc = "SYSCFG user register 12"] | ||
| 3844 | #[repr(transparent)] | ||
| 3845 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3846 | pub struct Ur12(pub u32); | ||
| 3847 | impl Ur12 { | ||
| 3848 | #[doc = "Secure mode"] | ||
| 3849 | pub const fn secure(&self) -> bool { | ||
| 3850 | let val = (self.0 >> 16usize) & 0x01; | ||
| 6223 | val != 0 | 3851 | val != 0 |
| 6224 | } | 3852 | } |
| 6225 | #[doc = "LIN break detection interrupt enable"] | 3853 | #[doc = "Secure mode"] |
| 6226 | pub fn set_lbdie(&mut self, val: bool) { | 3854 | pub fn set_secure(&mut self, val: bool) { |
| 6227 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 3855 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); |
| 6228 | } | 3856 | } |
| 6229 | #[doc = "STOP bits"] | 3857 | } |
| 6230 | pub const fn stop(&self) -> super::vals::Stop { | 3858 | impl Default for Ur12 { |
| 6231 | let val = (self.0 >> 12usize) & 0x03; | 3859 | fn default() -> Ur12 { |
| 6232 | super::vals::Stop(val as u8) | 3860 | Ur12(0) |
| 6233 | } | 3861 | } |
| 6234 | #[doc = "STOP bits"] | 3862 | } |
| 6235 | pub fn set_stop(&mut self, val: super::vals::Stop) { | 3863 | #[doc = "SYSCFG user register 11"] |
| 6236 | self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize); | 3864 | #[repr(transparent)] |
| 3865 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3866 | pub struct Ur11(pub u32); | ||
| 3867 | impl Ur11 { | ||
| 3868 | #[doc = "Secured area end address for bank 2"] | ||
| 3869 | pub const fn sa_end_2(&self) -> u16 { | ||
| 3870 | let val = (self.0 >> 0usize) & 0x0fff; | ||
| 3871 | val as u16 | ||
| 6237 | } | 3872 | } |
| 6238 | #[doc = "LIN mode enable"] | 3873 | #[doc = "Secured area end address for bank 2"] |
| 6239 | pub const fn linen(&self) -> bool { | 3874 | pub fn set_sa_end_2(&mut self, val: u16) { |
| 6240 | let val = (self.0 >> 14usize) & 0x01; | 3875 | self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); |
| 3876 | } | ||
| 3877 | #[doc = "Independent Watchdog 1 mode"] | ||
| 3878 | pub const fn iwdg1m(&self) -> bool { | ||
| 3879 | let val = (self.0 >> 16usize) & 0x01; | ||
| 6241 | val != 0 | 3880 | val != 0 |
| 6242 | } | 3881 | } |
| 6243 | #[doc = "LIN mode enable"] | 3882 | #[doc = "Independent Watchdog 1 mode"] |
| 6244 | pub fn set_linen(&mut self, val: bool) { | 3883 | pub fn set_iwdg1m(&mut self, val: bool) { |
| 6245 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | 3884 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); |
| 6246 | } | 3885 | } |
| 6247 | } | 3886 | } |
| 6248 | impl Default for Cr2 { | 3887 | impl Default for Ur11 { |
| 6249 | fn default() -> Cr2 { | 3888 | fn default() -> Ur11 { |
| 6250 | Cr2(0) | 3889 | Ur11(0) |
| 6251 | } | 3890 | } |
| 6252 | } | 3891 | } |
| 6253 | #[doc = "Control register 1"] | 3892 | #[doc = "compensation cell control/status register"] |
| 6254 | #[repr(transparent)] | 3893 | #[repr(transparent)] |
| 6255 | #[derive(Copy, Clone, Eq, PartialEq)] | 3894 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 6256 | pub struct Cr1(pub u32); | 3895 | pub struct Cccsr(pub u32); |
| 6257 | impl Cr1 { | 3896 | impl Cccsr { |
| 6258 | #[doc = "Send break"] | 3897 | #[doc = "enable"] |
| 6259 | pub const fn sbk(&self) -> super::vals::Sbk { | 3898 | pub const fn en(&self) -> bool { |
| 6260 | let val = (self.0 >> 0usize) & 0x01; | 3899 | let val = (self.0 >> 0usize) & 0x01; |
| 6261 | super::vals::Sbk(val as u8) | 3900 | val != 0 |
| 6262 | } | 3901 | } |
| 6263 | #[doc = "Send break"] | 3902 | #[doc = "enable"] |
| 6264 | pub fn set_sbk(&mut self, val: super::vals::Sbk) { | 3903 | pub fn set_en(&mut self, val: bool) { |
| 6265 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | 3904 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 6266 | } | 3905 | } |
| 6267 | #[doc = "Receiver wakeup"] | 3906 | #[doc = "Code selection"] |
| 6268 | pub const fn rwu(&self) -> super::vals::Rwu { | 3907 | pub const fn cs(&self) -> bool { |
| 6269 | let val = (self.0 >> 1usize) & 0x01; | 3908 | let val = (self.0 >> 1usize) & 0x01; |
| 6270 | super::vals::Rwu(val as u8) | 3909 | val != 0 |
| 6271 | } | 3910 | } |
| 6272 | #[doc = "Receiver wakeup"] | 3911 | #[doc = "Code selection"] |
| 6273 | pub fn set_rwu(&mut self, val: super::vals::Rwu) { | 3912 | pub fn set_cs(&mut self, val: bool) { |
| 6274 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | 3913 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 6275 | } | 3914 | } |
| 6276 | #[doc = "Receiver enable"] | 3915 | #[doc = "Compensation cell ready flag"] |
| 6277 | pub const fn re(&self) -> bool { | 3916 | pub const fn ready(&self) -> bool { |
| 6278 | let val = (self.0 >> 2usize) & 0x01; | 3917 | let val = (self.0 >> 8usize) & 0x01; |
| 6279 | val != 0 | 3918 | val != 0 |
| 6280 | } | 3919 | } |
| 6281 | #[doc = "Receiver enable"] | 3920 | #[doc = "Compensation cell ready flag"] |
| 6282 | pub fn set_re(&mut self, val: bool) { | 3921 | pub fn set_ready(&mut self, val: bool) { |
| 6283 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 3922 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 6284 | } | 3923 | } |
| 6285 | #[doc = "Transmitter enable"] | 3924 | #[doc = "High-speed at low-voltage"] |
| 6286 | pub const fn te(&self) -> bool { | 3925 | pub const fn hslv(&self) -> bool { |
| 6287 | let val = (self.0 >> 3usize) & 0x01; | 3926 | let val = (self.0 >> 16usize) & 0x01; |
| 6288 | val != 0 | 3927 | val != 0 |
| 6289 | } | 3928 | } |
| 6290 | #[doc = "Transmitter enable"] | 3929 | #[doc = "High-speed at low-voltage"] |
| 6291 | pub fn set_te(&mut self, val: bool) { | 3930 | pub fn set_hslv(&mut self, val: bool) { |
| 6292 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 3931 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); |
| 6293 | } | 3932 | } |
| 6294 | #[doc = "IDLE interrupt enable"] | 3933 | } |
| 6295 | pub const fn idleie(&self) -> bool { | 3934 | impl Default for Cccsr { |
| 6296 | let val = (self.0 >> 4usize) & 0x01; | 3935 | fn default() -> Cccsr { |
| 3936 | Cccsr(0) | ||
| 3937 | } | ||
| 3938 | } | ||
| 3939 | #[doc = "SYSCFG user register 8"] | ||
| 3940 | #[repr(transparent)] | ||
| 3941 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3942 | pub struct Ur8(pub u32); | ||
| 3943 | impl Ur8 { | ||
| 3944 | #[doc = "Mass erase protected area disabled for bank 2"] | ||
| 3945 | pub const fn mepad_2(&self) -> bool { | ||
| 3946 | let val = (self.0 >> 0usize) & 0x01; | ||
| 6297 | val != 0 | 3947 | val != 0 |
| 6298 | } | 3948 | } |
| 6299 | #[doc = "IDLE interrupt enable"] | 3949 | #[doc = "Mass erase protected area disabled for bank 2"] |
| 6300 | pub fn set_idleie(&mut self, val: bool) { | 3950 | pub fn set_mepad_2(&mut self, val: bool) { |
| 6301 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 3951 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 6302 | } | 3952 | } |
| 6303 | #[doc = "RXNE interrupt enable"] | 3953 | #[doc = "Mass erase secured area disabled for bank 2"] |
| 6304 | pub const fn rxneie(&self) -> bool { | 3954 | pub const fn mesad_2(&self) -> bool { |
| 6305 | let val = (self.0 >> 5usize) & 0x01; | 3955 | let val = (self.0 >> 16usize) & 0x01; |
| 6306 | val != 0 | 3956 | val != 0 |
| 6307 | } | 3957 | } |
| 6308 | #[doc = "RXNE interrupt enable"] | 3958 | #[doc = "Mass erase secured area disabled for bank 2"] |
| 6309 | pub fn set_rxneie(&mut self, val: bool) { | 3959 | pub fn set_mesad_2(&mut self, val: bool) { |
| 6310 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 3960 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); |
| 6311 | } | 3961 | } |
| 6312 | #[doc = "Transmission complete interrupt enable"] | 3962 | } |
| 6313 | pub const fn tcie(&self) -> bool { | 3963 | impl Default for Ur8 { |
| 6314 | let val = (self.0 >> 6usize) & 0x01; | 3964 | fn default() -> Ur8 { |
| 3965 | Ur8(0) | ||
| 3966 | } | ||
| 3967 | } | ||
| 3968 | #[doc = "SYSCFG user register 5"] | ||
| 3969 | #[repr(transparent)] | ||
| 3970 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3971 | pub struct Ur5(pub u32); | ||
| 3972 | impl Ur5 { | ||
| 3973 | #[doc = "Mass erase secured area disabled for bank 1"] | ||
| 3974 | pub const fn mesad_1(&self) -> bool { | ||
| 3975 | let val = (self.0 >> 0usize) & 0x01; | ||
| 6315 | val != 0 | 3976 | val != 0 |
| 6316 | } | 3977 | } |
| 6317 | #[doc = "Transmission complete interrupt enable"] | 3978 | #[doc = "Mass erase secured area disabled for bank 1"] |
| 6318 | pub fn set_tcie(&mut self, val: bool) { | 3979 | pub fn set_mesad_1(&mut self, val: bool) { |
| 6319 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 3980 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 6320 | } | 3981 | } |
| 6321 | #[doc = "TXE interrupt enable"] | 3982 | #[doc = "Write protection for flash bank 1"] |
| 6322 | pub const fn txeie(&self) -> bool { | 3983 | pub const fn wrpn_1(&self) -> u8 { |
| 6323 | let val = (self.0 >> 7usize) & 0x01; | 3984 | let val = (self.0 >> 16usize) & 0xff; |
| 6324 | val != 0 | 3985 | val as u8 |
| 6325 | } | 3986 | } |
| 6326 | #[doc = "TXE interrupt enable"] | 3987 | #[doc = "Write protection for flash bank 1"] |
| 6327 | pub fn set_txeie(&mut self, val: bool) { | 3988 | pub fn set_wrpn_1(&mut self, val: u8) { |
| 6328 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 3989 | self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize); |
| 6329 | } | 3990 | } |
| 6330 | #[doc = "PE interrupt enable"] | 3991 | } |
| 6331 | pub const fn peie(&self) -> bool { | 3992 | impl Default for Ur5 { |
| 6332 | let val = (self.0 >> 8usize) & 0x01; | 3993 | fn default() -> Ur5 { |
| 3994 | Ur5(0) | ||
| 3995 | } | ||
| 3996 | } | ||
| 3997 | #[doc = "SYSCFG user register 14"] | ||
| 3998 | #[repr(transparent)] | ||
| 3999 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4000 | pub struct Ur14(pub u32); | ||
| 4001 | impl Ur14 { | ||
| 4002 | #[doc = "D1 Stop Reset"] | ||
| 4003 | pub const fn d1stprst(&self) -> bool { | ||
| 4004 | let val = (self.0 >> 0usize) & 0x01; | ||
| 6333 | val != 0 | 4005 | val != 0 |
| 6334 | } | 4006 | } |
| 6335 | #[doc = "PE interrupt enable"] | 4007 | #[doc = "D1 Stop Reset"] |
| 6336 | pub fn set_peie(&mut self, val: bool) { | 4008 | pub fn set_d1stprst(&mut self, val: bool) { |
| 6337 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 4009 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 6338 | } | 4010 | } |
| 6339 | #[doc = "Parity selection"] | 4011 | } |
| 6340 | pub const fn ps(&self) -> super::vals::Ps { | 4012 | impl Default for Ur14 { |
| 6341 | let val = (self.0 >> 9usize) & 0x01; | 4013 | fn default() -> Ur14 { |
| 6342 | super::vals::Ps(val as u8) | 4014 | Ur14(0) |
| 6343 | } | 4015 | } |
| 6344 | #[doc = "Parity selection"] | 4016 | } |
| 6345 | pub fn set_ps(&mut self, val: super::vals::Ps) { | 4017 | #[doc = "SYSCFG user register 10"] |
| 6346 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | 4018 | #[repr(transparent)] |
| 4019 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4020 | pub struct Ur10(pub u32); | ||
| 4021 | impl Ur10 { | ||
| 4022 | #[doc = "Protected area end address for bank 2"] | ||
| 4023 | pub const fn pa_end_2(&self) -> u16 { | ||
| 4024 | let val = (self.0 >> 0usize) & 0x0fff; | ||
| 4025 | val as u16 | ||
| 6347 | } | 4026 | } |
| 6348 | #[doc = "Parity control enable"] | 4027 | #[doc = "Protected area end address for bank 2"] |
| 6349 | pub const fn pce(&self) -> bool { | 4028 | pub fn set_pa_end_2(&mut self, val: u16) { |
| 6350 | let val = (self.0 >> 10usize) & 0x01; | 4029 | self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); |
| 6351 | val != 0 | ||
| 6352 | } | 4030 | } |
| 6353 | #[doc = "Parity control enable"] | 4031 | #[doc = "Secured area start address for bank 2"] |
| 6354 | pub fn set_pce(&mut self, val: bool) { | 4032 | pub const fn sa_beg_2(&self) -> u16 { |
| 6355 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | 4033 | let val = (self.0 >> 16usize) & 0x0fff; |
| 4034 | val as u16 | ||
| 6356 | } | 4035 | } |
| 6357 | #[doc = "Wakeup method"] | 4036 | #[doc = "Secured area start address for bank 2"] |
| 6358 | pub const fn wake(&self) -> super::vals::Wake { | 4037 | pub fn set_sa_beg_2(&mut self, val: u16) { |
| 6359 | let val = (self.0 >> 11usize) & 0x01; | 4038 | self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); |
| 6360 | super::vals::Wake(val as u8) | ||
| 6361 | } | 4039 | } |
| 6362 | #[doc = "Wakeup method"] | 4040 | } |
| 6363 | pub fn set_wake(&mut self, val: super::vals::Wake) { | 4041 | impl Default for Ur10 { |
| 6364 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); | 4042 | fn default() -> Ur10 { |
| 4043 | Ur10(0) | ||
| 6365 | } | 4044 | } |
| 6366 | #[doc = "Word length"] | 4045 | } |
| 6367 | pub const fn m(&self) -> super::vals::M { | 4046 | #[doc = "SYSCFG user register 16"] |
| 6368 | let val = (self.0 >> 12usize) & 0x01; | 4047 | #[repr(transparent)] |
| 6369 | super::vals::M(val as u8) | 4048 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 4049 | pub struct Ur16(pub u32); | ||
| 4050 | impl Ur16 { | ||
| 4051 | #[doc = "Freeze independent watchdog in Stop mode"] | ||
| 4052 | pub const fn fziwdgstp(&self) -> bool { | ||
| 4053 | let val = (self.0 >> 0usize) & 0x01; | ||
| 4054 | val != 0 | ||
| 6370 | } | 4055 | } |
| 6371 | #[doc = "Word length"] | 4056 | #[doc = "Freeze independent watchdog in Stop mode"] |
| 6372 | pub fn set_m(&mut self, val: super::vals::M) { | 4057 | pub fn set_fziwdgstp(&mut self, val: bool) { |
| 6373 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | 4058 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 6374 | } | 4059 | } |
| 6375 | #[doc = "USART enable"] | 4060 | #[doc = "Private key programmed"] |
| 6376 | pub const fn ue(&self) -> bool { | 4061 | pub const fn pkp(&self) -> bool { |
| 6377 | let val = (self.0 >> 13usize) & 0x01; | 4062 | let val = (self.0 >> 16usize) & 0x01; |
| 6378 | val != 0 | 4063 | val != 0 |
| 6379 | } | 4064 | } |
| 6380 | #[doc = "USART enable"] | 4065 | #[doc = "Private key programmed"] |
| 6381 | pub fn set_ue(&mut self, val: bool) { | 4066 | pub fn set_pkp(&mut self, val: bool) { |
| 6382 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | 4067 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); |
| 6383 | } | 4068 | } |
| 6384 | } | 4069 | } |
| 6385 | impl Default for Cr1 { | 4070 | impl Default for Ur16 { |
| 6386 | fn default() -> Cr1 { | 4071 | fn default() -> Ur16 { |
| 6387 | Cr1(0) | 4072 | Ur16(0) |
| 6388 | } | 4073 | } |
| 6389 | } | 4074 | } |
| 6390 | #[doc = "Guard time and prescaler register"] | 4075 | #[doc = "SYSCFG user register 0"] |
| 6391 | #[repr(transparent)] | 4076 | #[repr(transparent)] |
| 6392 | #[derive(Copy, Clone, Eq, PartialEq)] | 4077 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 6393 | pub struct Gtpr(pub u32); | 4078 | pub struct Ur0(pub u32); |
| 6394 | impl Gtpr { | 4079 | impl Ur0 { |
| 6395 | #[doc = "Prescaler value"] | 4080 | #[doc = "Bank Swap"] |
| 6396 | pub const fn psc(&self) -> u8 { | 4081 | pub const fn bks(&self) -> bool { |
| 6397 | let val = (self.0 >> 0usize) & 0xff; | 4082 | let val = (self.0 >> 0usize) & 0x01; |
| 6398 | val as u8 | 4083 | val != 0 |
| 6399 | } | 4084 | } |
| 6400 | #[doc = "Prescaler value"] | 4085 | #[doc = "Bank Swap"] |
| 6401 | pub fn set_psc(&mut self, val: u8) { | 4086 | pub fn set_bks(&mut self, val: bool) { |
| 6402 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | 4087 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 6403 | } | 4088 | } |
| 6404 | #[doc = "Guard time value"] | 4089 | #[doc = "Readout protection"] |
| 6405 | pub const fn gt(&self) -> u8 { | 4090 | pub const fn rdp(&self) -> u8 { |
| 6406 | let val = (self.0 >> 8usize) & 0xff; | 4091 | let val = (self.0 >> 16usize) & 0xff; |
| 6407 | val as u8 | 4092 | val as u8 |
| 6408 | } | 4093 | } |
| 6409 | #[doc = "Guard time value"] | 4094 | #[doc = "Readout protection"] |
| 6410 | pub fn set_gt(&mut self, val: u8) { | 4095 | pub fn set_rdp(&mut self, val: u8) { |
| 6411 | self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize); | 4096 | self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize); |
| 6412 | } | 4097 | } |
| 6413 | } | 4098 | } |
| 6414 | impl Default for Gtpr { | 4099 | impl Default for Ur0 { |
| 6415 | fn default() -> Gtpr { | 4100 | fn default() -> Ur0 { |
| 6416 | Gtpr(0) | 4101 | Ur0(0) |
| 6417 | } | 4102 | } |
| 6418 | } | 4103 | } |
| 6419 | #[doc = "Baud rate register"] | 4104 | #[doc = "SYSCFG user register 7"] |
| 6420 | #[repr(transparent)] | 4105 | #[repr(transparent)] |
| 6421 | #[derive(Copy, Clone, Eq, PartialEq)] | 4106 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 6422 | pub struct Brr(pub u32); | 4107 | pub struct Ur7(pub u32); |
| 6423 | impl Brr { | 4108 | impl Ur7 { |
| 6424 | #[doc = "fraction of USARTDIV"] | 4109 | #[doc = "Secured area start address for bank 1"] |
| 6425 | pub const fn div_fraction(&self) -> u8 { | 4110 | pub const fn sa_beg_1(&self) -> u16 { |
| 6426 | let val = (self.0 >> 0usize) & 0x0f; | 4111 | let val = (self.0 >> 0usize) & 0x0fff; |
| 6427 | val as u8 | 4112 | val as u16 |
| 6428 | } | 4113 | } |
| 6429 | #[doc = "fraction of USARTDIV"] | 4114 | #[doc = "Secured area start address for bank 1"] |
| 6430 | pub fn set_div_fraction(&mut self, val: u8) { | 4115 | pub fn set_sa_beg_1(&mut self, val: u16) { |
| 6431 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); | 4116 | self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); |
| 6432 | } | 4117 | } |
| 6433 | #[doc = "mantissa of USARTDIV"] | 4118 | #[doc = "Secured area end address for bank 1"] |
| 6434 | pub const fn div_mantissa(&self) -> u16 { | 4119 | pub const fn sa_end_1(&self) -> u16 { |
| 6435 | let val = (self.0 >> 4usize) & 0x0fff; | 4120 | let val = (self.0 >> 16usize) & 0x0fff; |
| 6436 | val as u16 | 4121 | val as u16 |
| 6437 | } | 4122 | } |
| 6438 | #[doc = "mantissa of USARTDIV"] | 4123 | #[doc = "Secured area end address for bank 1"] |
| 6439 | pub fn set_div_mantissa(&mut self, val: u16) { | 4124 | pub fn set_sa_end_1(&mut self, val: u16) { |
| 6440 | self.0 = (self.0 & !(0x0fff << 4usize)) | (((val as u32) & 0x0fff) << 4usize); | 4125 | self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); |
| 6441 | } | 4126 | } |
| 6442 | } | 4127 | } |
| 6443 | impl Default for Brr { | 4128 | impl Default for Ur7 { |
| 6444 | fn default() -> Brr { | 4129 | fn default() -> Ur7 { |
| 6445 | Brr(0) | 4130 | Ur7(0) |
| 6446 | } | 4131 | } |
| 6447 | } | 4132 | } |
| 6448 | #[doc = "Control register 2"] | 4133 | #[doc = "SYSCFG compensation cell code register"] |
| 6449 | #[repr(transparent)] | 4134 | #[repr(transparent)] |
| 6450 | #[derive(Copy, Clone, Eq, PartialEq)] | 4135 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 6451 | pub struct Cr2Usart(pub u32); | 4136 | pub struct Cccr(pub u32); |
| 6452 | impl Cr2Usart { | 4137 | impl Cccr { |
| 6453 | #[doc = "Address of the USART node"] | 4138 | #[doc = "NMOS compensation code"] |
| 6454 | pub const fn add(&self) -> u8 { | 4139 | pub const fn ncc(&self) -> u8 { |
| 6455 | let val = (self.0 >> 0usize) & 0x0f; | 4140 | let val = (self.0 >> 0usize) & 0x0f; |
| 6456 | val as u8 | 4141 | val as u8 |
| 6457 | } | 4142 | } |
| 6458 | #[doc = "Address of the USART node"] | 4143 | #[doc = "NMOS compensation code"] |
| 6459 | pub fn set_add(&mut self, val: u8) { | 4144 | pub fn set_ncc(&mut self, val: u8) { |
| 6460 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); | 4145 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); |
| 6461 | } | 4146 | } |
| 6462 | #[doc = "lin break detection length"] | 4147 | #[doc = "PMOS compensation code"] |
| 6463 | pub const fn lbdl(&self) -> super::vals::Lbdl { | 4148 | pub const fn pcc(&self) -> u8 { |
| 6464 | let val = (self.0 >> 5usize) & 0x01; | 4149 | let val = (self.0 >> 4usize) & 0x0f; |
| 6465 | super::vals::Lbdl(val as u8) | 4150 | val as u8 |
| 6466 | } | 4151 | } |
| 6467 | #[doc = "lin break detection length"] | 4152 | #[doc = "PMOS compensation code"] |
| 6468 | pub fn set_lbdl(&mut self, val: super::vals::Lbdl) { | 4153 | pub fn set_pcc(&mut self, val: u8) { |
| 6469 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | 4154 | self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize); |
| 6470 | } | 4155 | } |
| 6471 | #[doc = "LIN break detection interrupt enable"] | 4156 | } |
| 6472 | pub const fn lbdie(&self) -> bool { | 4157 | impl Default for Cccr { |
| 6473 | let val = (self.0 >> 6usize) & 0x01; | 4158 | fn default() -> Cccr { |
| 4159 | Cccr(0) | ||
| 4160 | } | ||
| 4161 | } | ||
| 4162 | #[doc = "SYSCFG user register 4"] | ||
| 4163 | #[repr(transparent)] | ||
| 4164 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4165 | pub struct Ur4(pub u32); | ||
| 4166 | impl Ur4 { | ||
| 4167 | #[doc = "Mass Erase Protected Area Disabled for bank 1"] | ||
| 4168 | pub const fn mepad_1(&self) -> bool { | ||
| 4169 | let val = (self.0 >> 16usize) & 0x01; | ||
| 6474 | val != 0 | 4170 | val != 0 |
| 6475 | } | 4171 | } |
| 6476 | #[doc = "LIN break detection interrupt enable"] | 4172 | #[doc = "Mass Erase Protected Area Disabled for bank 1"] |
| 6477 | pub fn set_lbdie(&mut self, val: bool) { | 4173 | pub fn set_mepad_1(&mut self, val: bool) { |
| 6478 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 4174 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); |
| 6479 | } | 4175 | } |
| 6480 | #[doc = "Last bit clock pulse"] | 4176 | } |
| 6481 | pub const fn lbcl(&self) -> bool { | 4177 | impl Default for Ur4 { |
| 6482 | let val = (self.0 >> 8usize) & 0x01; | 4178 | fn default() -> Ur4 { |
| 4179 | Ur4(0) | ||
| 4180 | } | ||
| 4181 | } | ||
| 4182 | #[doc = "SYSCFG package register"] | ||
| 4183 | #[repr(transparent)] | ||
| 4184 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4185 | pub struct Pkgr(pub u32); | ||
| 4186 | impl Pkgr { | ||
| 4187 | #[doc = "Package"] | ||
| 4188 | pub const fn pkg(&self) -> u8 { | ||
| 4189 | let val = (self.0 >> 0usize) & 0x0f; | ||
| 4190 | val as u8 | ||
| 4191 | } | ||
| 4192 | #[doc = "Package"] | ||
| 4193 | pub fn set_pkg(&mut self, val: u8) { | ||
| 4194 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); | ||
| 4195 | } | ||
| 4196 | } | ||
| 4197 | impl Default for Pkgr { | ||
| 4198 | fn default() -> Pkgr { | ||
| 4199 | Pkgr(0) | ||
| 4200 | } | ||
| 4201 | } | ||
| 4202 | #[doc = "SYSCFG user register 15"] | ||
| 4203 | #[repr(transparent)] | ||
| 4204 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4205 | pub struct Ur15(pub u32); | ||
| 4206 | impl Ur15 { | ||
| 4207 | #[doc = "Freeze independent watchdog in Standby mode"] | ||
| 4208 | pub const fn fziwdgstb(&self) -> bool { | ||
| 4209 | let val = (self.0 >> 16usize) & 0x01; | ||
| 6483 | val != 0 | 4210 | val != 0 |
| 6484 | } | 4211 | } |
| 6485 | #[doc = "Last bit clock pulse"] | 4212 | #[doc = "Freeze independent watchdog in Standby mode"] |
| 6486 | pub fn set_lbcl(&mut self, val: bool) { | 4213 | pub fn set_fziwdgstb(&mut self, val: bool) { |
| 6487 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 4214 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); |
| 6488 | } | 4215 | } |
| 6489 | #[doc = "Clock phase"] | 4216 | } |
| 6490 | pub const fn cpha(&self) -> super::vals::Cpha { | 4217 | impl Default for Ur15 { |
| 6491 | let val = (self.0 >> 9usize) & 0x01; | 4218 | fn default() -> Ur15 { |
| 6492 | super::vals::Cpha(val as u8) | 4219 | Ur15(0) |
| 6493 | } | 4220 | } |
| 6494 | #[doc = "Clock phase"] | 4221 | } |
| 6495 | pub fn set_cpha(&mut self, val: super::vals::Cpha) { | 4222 | #[doc = "SYSCFG user register 3"] |
| 6496 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | 4223 | #[repr(transparent)] |
| 4224 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4225 | pub struct Ur3(pub u32); | ||
| 4226 | impl Ur3 { | ||
| 4227 | #[doc = "Boot Address 1"] | ||
| 4228 | pub const fn boot_add1(&self) -> u16 { | ||
| 4229 | let val = (self.0 >> 16usize) & 0xffff; | ||
| 4230 | val as u16 | ||
| 6497 | } | 4231 | } |
| 6498 | #[doc = "Clock polarity"] | 4232 | #[doc = "Boot Address 1"] |
| 6499 | pub const fn cpol(&self) -> super::vals::Cpol { | 4233 | pub fn set_boot_add1(&mut self, val: u16) { |
| 6500 | let val = (self.0 >> 10usize) & 0x01; | 4234 | self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize); |
| 6501 | super::vals::Cpol(val as u8) | ||
| 6502 | } | 4235 | } |
| 6503 | #[doc = "Clock polarity"] | 4236 | } |
| 6504 | pub fn set_cpol(&mut self, val: super::vals::Cpol) { | 4237 | impl Default for Ur3 { |
| 6505 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); | 4238 | fn default() -> Ur3 { |
| 4239 | Ur3(0) | ||
| 6506 | } | 4240 | } |
| 6507 | #[doc = "Clock enable"] | 4241 | } |
| 6508 | pub const fn clken(&self) -> bool { | 4242 | #[doc = "SYSCFG user register 9"] |
| 6509 | let val = (self.0 >> 11usize) & 0x01; | 4243 | #[repr(transparent)] |
| 6510 | val != 0 | 4244 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 4245 | pub struct Ur9(pub u32); | ||
| 4246 | impl Ur9 { | ||
| 4247 | #[doc = "Write protection for flash bank 2"] | ||
| 4248 | pub const fn wrpn_2(&self) -> u8 { | ||
| 4249 | let val = (self.0 >> 0usize) & 0xff; | ||
| 4250 | val as u8 | ||
| 6511 | } | 4251 | } |
| 6512 | #[doc = "Clock enable"] | 4252 | #[doc = "Write protection for flash bank 2"] |
| 6513 | pub fn set_clken(&mut self, val: bool) { | 4253 | pub fn set_wrpn_2(&mut self, val: u8) { |
| 6514 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); | 4254 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); |
| 6515 | } | 4255 | } |
| 6516 | #[doc = "STOP bits"] | 4256 | #[doc = "Protected area start address for bank 2"] |
| 6517 | pub const fn stop(&self) -> super::vals::Stop { | 4257 | pub const fn pa_beg_2(&self) -> u16 { |
| 6518 | let val = (self.0 >> 12usize) & 0x03; | 4258 | let val = (self.0 >> 16usize) & 0x0fff; |
| 6519 | super::vals::Stop(val as u8) | 4259 | val as u16 |
| 6520 | } | 4260 | } |
| 6521 | #[doc = "STOP bits"] | 4261 | #[doc = "Protected area start address for bank 2"] |
| 6522 | pub fn set_stop(&mut self, val: super::vals::Stop) { | 4262 | pub fn set_pa_beg_2(&mut self, val: u16) { |
| 6523 | self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize); | 4263 | self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); |
| 6524 | } | 4264 | } |
| 6525 | #[doc = "LIN mode enable"] | 4265 | } |
| 6526 | pub const fn linen(&self) -> bool { | 4266 | impl Default for Ur9 { |
| 6527 | let val = (self.0 >> 14usize) & 0x01; | 4267 | fn default() -> Ur9 { |
| 6528 | val != 0 | 4268 | Ur9(0) |
| 6529 | } | 4269 | } |
| 6530 | #[doc = "LIN mode enable"] | 4270 | } |
| 6531 | pub fn set_linen(&mut self, val: bool) { | 4271 | #[doc = "external interrupt configuration register 2"] |
| 6532 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | 4272 | #[repr(transparent)] |
| 4273 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4274 | pub struct Exticr(pub u32); | ||
| 4275 | impl Exticr { | ||
| 4276 | #[doc = "EXTI x configuration (x = 4 to 7)"] | ||
| 4277 | pub fn exti(&self, n: usize) -> u8 { | ||
| 4278 | assert!(n < 4usize); | ||
| 4279 | let offs = 0usize + n * 4usize; | ||
| 4280 | let val = (self.0 >> offs) & 0x0f; | ||
| 4281 | val as u8 | ||
| 4282 | } | ||
| 4283 | #[doc = "EXTI x configuration (x = 4 to 7)"] | ||
| 4284 | pub fn set_exti(&mut self, n: usize, val: u8) { | ||
| 4285 | assert!(n < 4usize); | ||
| 4286 | let offs = 0usize + n * 4usize; | ||
| 4287 | self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs); | ||
| 6533 | } | 4288 | } |
| 6534 | } | 4289 | } |
| 6535 | impl Default for Cr2Usart { | 4290 | impl Default for Exticr { |
| 6536 | fn default() -> Cr2Usart { | 4291 | fn default() -> Exticr { |
| 6537 | Cr2Usart(0) | 4292 | Exticr(0) |
| 6538 | } | 4293 | } |
| 6539 | } | 4294 | } |
| 6540 | #[doc = "Data register"] | 4295 | #[doc = "SYSCFG compensation cell value register"] |
| 6541 | #[repr(transparent)] | 4296 | #[repr(transparent)] |
| 6542 | #[derive(Copy, Clone, Eq, PartialEq)] | 4297 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 6543 | pub struct Dr(pub u32); | 4298 | pub struct Ccvr(pub u32); |
| 6544 | impl Dr { | 4299 | impl Ccvr { |
| 6545 | #[doc = "Data value"] | 4300 | #[doc = "NMOS compensation value"] |
| 6546 | pub const fn dr(&self) -> u16 { | 4301 | pub const fn ncv(&self) -> u8 { |
| 6547 | let val = (self.0 >> 0usize) & 0x01ff; | 4302 | let val = (self.0 >> 0usize) & 0x0f; |
| 6548 | val as u16 | 4303 | val as u8 |
| 6549 | } | 4304 | } |
| 6550 | #[doc = "Data value"] | 4305 | #[doc = "NMOS compensation value"] |
| 6551 | pub fn set_dr(&mut self, val: u16) { | 4306 | pub fn set_ncv(&mut self, val: u8) { |
| 6552 | self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize); | 4307 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); |
| 4308 | } | ||
| 4309 | #[doc = "PMOS compensation value"] | ||
| 4310 | pub const fn pcv(&self) -> u8 { | ||
| 4311 | let val = (self.0 >> 4usize) & 0x0f; | ||
| 4312 | val as u8 | ||
| 4313 | } | ||
| 4314 | #[doc = "PMOS compensation value"] | ||
| 4315 | pub fn set_pcv(&mut self, val: u8) { | ||
| 4316 | self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize); | ||
| 6553 | } | 4317 | } |
| 6554 | } | 4318 | } |
| 6555 | impl Default for Dr { | 4319 | impl Default for Ccvr { |
| 6556 | fn default() -> Dr { | 4320 | fn default() -> Ccvr { |
| 6557 | Dr(0) | 4321 | Ccvr(0) |
| 6558 | } | 4322 | } |
| 6559 | } | 4323 | } |
| 6560 | #[doc = "Control register 3"] | 4324 | } |
| 4325 | } | ||
| 4326 | pub mod gpio_v1 { | ||
| 4327 | use crate::generic::*; | ||
| 4328 | #[doc = "General purpose I/O"] | ||
| 4329 | #[derive(Copy, Clone)] | ||
| 4330 | pub struct Gpio(pub *mut u8); | ||
| 4331 | unsafe impl Send for Gpio {} | ||
| 4332 | unsafe impl Sync for Gpio {} | ||
| 4333 | impl Gpio { | ||
| 4334 | #[doc = "Port configuration register low (GPIOn_CRL)"] | ||
| 4335 | pub fn cr(self, n: usize) -> Reg<regs::Cr, RW> { | ||
| 4336 | assert!(n < 2usize); | ||
| 4337 | unsafe { Reg::from_ptr(self.0.add(0usize + n * 4usize)) } | ||
| 4338 | } | ||
| 4339 | #[doc = "Port input data register (GPIOn_IDR)"] | ||
| 4340 | pub fn idr(self) -> Reg<regs::Idr, R> { | ||
| 4341 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 4342 | } | ||
| 4343 | #[doc = "Port output data register (GPIOn_ODR)"] | ||
| 4344 | pub fn odr(self) -> Reg<regs::Odr, RW> { | ||
| 4345 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 4346 | } | ||
| 4347 | #[doc = "Port bit set/reset register (GPIOn_BSRR)"] | ||
| 4348 | pub fn bsrr(self) -> Reg<regs::Bsrr, W> { | ||
| 4349 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 4350 | } | ||
| 4351 | #[doc = "Port bit reset register (GPIOn_BRR)"] | ||
| 4352 | pub fn brr(self) -> Reg<regs::Brr, W> { | ||
| 4353 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 4354 | } | ||
| 4355 | #[doc = "Port configuration lock register"] | ||
| 4356 | pub fn lckr(self) -> Reg<regs::Lckr, RW> { | ||
| 4357 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | ||
| 4358 | } | ||
| 4359 | } | ||
| 4360 | pub mod vals { | ||
| 4361 | use crate::generic::*; | ||
| 4362 | #[repr(transparent)] | ||
| 4363 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4364 | pub struct Odr(pub u8); | ||
| 4365 | impl Odr { | ||
| 4366 | #[doc = "Set output to logic low"] | ||
| 4367 | pub const LOW: Self = Self(0); | ||
| 4368 | #[doc = "Set output to logic high"] | ||
| 4369 | pub const HIGH: Self = Self(0x01); | ||
| 4370 | } | ||
| 4371 | #[repr(transparent)] | ||
| 4372 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4373 | pub struct Cnf(pub u8); | ||
| 4374 | impl Cnf { | ||
| 4375 | #[doc = "Analog mode / Push-Pull mode"] | ||
| 4376 | pub const PUSHPULL: Self = Self(0); | ||
| 4377 | #[doc = "Floating input (reset state) / Open Drain-Mode"] | ||
| 4378 | pub const OPENDRAIN: Self = Self(0x01); | ||
| 4379 | #[doc = "Input with pull-up/pull-down / Alternate Function Push-Pull Mode"] | ||
| 4380 | pub const ALTPUSHPULL: Self = Self(0x02); | ||
| 4381 | #[doc = "Alternate Function Open-Drain Mode"] | ||
| 4382 | pub const ALTOPENDRAIN: Self = Self(0x03); | ||
| 4383 | } | ||
| 4384 | #[repr(transparent)] | ||
| 4385 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4386 | pub struct Mode(pub u8); | ||
| 4387 | impl Mode { | ||
| 4388 | #[doc = "Input mode (reset state)"] | ||
| 4389 | pub const INPUT: Self = Self(0); | ||
| 4390 | #[doc = "Output mode 10 MHz"] | ||
| 4391 | pub const OUTPUT: Self = Self(0x01); | ||
| 4392 | #[doc = "Output mode 2 MHz"] | ||
| 4393 | pub const OUTPUT2: Self = Self(0x02); | ||
| 4394 | #[doc = "Output mode 50 MHz"] | ||
| 4395 | pub const OUTPUT50: Self = Self(0x03); | ||
| 4396 | } | ||
| 4397 | #[repr(transparent)] | ||
| 4398 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4399 | pub struct Brw(pub u8); | ||
| 4400 | impl Brw { | ||
| 4401 | #[doc = "No action on the corresponding ODx bit"] | ||
| 4402 | pub const NOACTION: Self = Self(0); | ||
| 4403 | #[doc = "Reset the ODx bit"] | ||
| 4404 | pub const RESET: Self = Self(0x01); | ||
| 4405 | } | ||
| 4406 | #[repr(transparent)] | ||
| 4407 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4408 | pub struct Lckk(pub u8); | ||
| 4409 | impl Lckk { | ||
| 4410 | #[doc = "Port configuration lock key not active"] | ||
| 4411 | pub const NOTACTIVE: Self = Self(0); | ||
| 4412 | #[doc = "Port configuration lock key active"] | ||
| 4413 | pub const ACTIVE: Self = Self(0x01); | ||
| 4414 | } | ||
| 4415 | #[repr(transparent)] | ||
| 4416 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4417 | pub struct Lck(pub u8); | ||
| 4418 | impl Lck { | ||
| 4419 | #[doc = "Port configuration not locked"] | ||
| 4420 | pub const UNLOCKED: Self = Self(0); | ||
| 4421 | #[doc = "Port configuration locked"] | ||
| 4422 | pub const LOCKED: Self = Self(0x01); | ||
| 4423 | } | ||
| 4424 | #[repr(transparent)] | ||
| 4425 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4426 | pub struct Idr(pub u8); | ||
| 4427 | impl Idr { | ||
| 4428 | #[doc = "Input is logic low"] | ||
| 4429 | pub const LOW: Self = Self(0); | ||
| 4430 | #[doc = "Input is logic high"] | ||
| 4431 | pub const HIGH: Self = Self(0x01); | ||
| 4432 | } | ||
| 4433 | #[repr(transparent)] | ||
| 4434 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4435 | pub struct Bsw(pub u8); | ||
| 4436 | impl Bsw { | ||
| 4437 | #[doc = "No action on the corresponding ODx bit"] | ||
| 4438 | pub const NOACTION: Self = Self(0); | ||
| 4439 | #[doc = "Sets the corresponding ODRx bit"] | ||
| 4440 | pub const SET: Self = Self(0x01); | ||
| 4441 | } | ||
| 4442 | } | ||
| 4443 | pub mod regs { | ||
| 4444 | use crate::generic::*; | ||
| 4445 | #[doc = "Port bit set/reset register (GPIOn_BSRR)"] | ||
| 6561 | #[repr(transparent)] | 4446 | #[repr(transparent)] |
| 6562 | #[derive(Copy, Clone, Eq, PartialEq)] | 4447 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 6563 | pub struct Cr3(pub u32); | 4448 | pub struct Bsrr(pub u32); |
| 6564 | impl Cr3 { | 4449 | impl Bsrr { |
| 6565 | #[doc = "Error interrupt enable"] | 4450 | #[doc = "Set bit"] |
| 6566 | pub const fn eie(&self) -> bool { | 4451 | pub fn bs(&self, n: usize) -> bool { |
| 6567 | let val = (self.0 >> 0usize) & 0x01; | 4452 | assert!(n < 16usize); |
| 4453 | let offs = 0usize + n * 1usize; | ||
| 4454 | let val = (self.0 >> offs) & 0x01; | ||
| 6568 | val != 0 | 4455 | val != 0 |
| 6569 | } | 4456 | } |
| 6570 | #[doc = "Error interrupt enable"] | 4457 | #[doc = "Set bit"] |
| 6571 | pub fn set_eie(&mut self, val: bool) { | 4458 | pub fn set_bs(&mut self, n: usize, val: bool) { |
| 6572 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 4459 | assert!(n < 16usize); |
| 4460 | let offs = 0usize + n * 1usize; | ||
| 4461 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 6573 | } | 4462 | } |
| 6574 | #[doc = "IrDA mode enable"] | 4463 | #[doc = "Reset bit"] |
| 6575 | pub const fn iren(&self) -> bool { | 4464 | pub fn br(&self, n: usize) -> bool { |
| 6576 | let val = (self.0 >> 1usize) & 0x01; | 4465 | assert!(n < 16usize); |
| 4466 | let offs = 16usize + n * 1usize; | ||
| 4467 | let val = (self.0 >> offs) & 0x01; | ||
| 6577 | val != 0 | 4468 | val != 0 |
| 6578 | } | 4469 | } |
| 6579 | #[doc = "IrDA mode enable"] | 4470 | #[doc = "Reset bit"] |
| 6580 | pub fn set_iren(&mut self, val: bool) { | 4471 | pub fn set_br(&mut self, n: usize, val: bool) { |
| 6581 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 4472 | assert!(n < 16usize); |
| 4473 | let offs = 16usize + n * 1usize; | ||
| 4474 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 6582 | } | 4475 | } |
| 6583 | #[doc = "IrDA low-power"] | 4476 | } |
| 6584 | pub const fn irlp(&self) -> super::vals::Irlp { | 4477 | impl Default for Bsrr { |
| 6585 | let val = (self.0 >> 2usize) & 0x01; | 4478 | fn default() -> Bsrr { |
| 6586 | super::vals::Irlp(val as u8) | 4479 | Bsrr(0) |
| 6587 | } | 4480 | } |
| 6588 | #[doc = "IrDA low-power"] | 4481 | } |
| 6589 | pub fn set_irlp(&mut self, val: super::vals::Irlp) { | 4482 | #[doc = "Port output data register (GPIOn_ODR)"] |
| 6590 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | 4483 | #[repr(transparent)] |
| 4484 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4485 | pub struct Odr(pub u32); | ||
| 4486 | impl Odr { | ||
| 4487 | #[doc = "Port output data"] | ||
| 4488 | pub fn odr(&self, n: usize) -> super::vals::Odr { | ||
| 4489 | assert!(n < 16usize); | ||
| 4490 | let offs = 0usize + n * 1usize; | ||
| 4491 | let val = (self.0 >> offs) & 0x01; | ||
| 4492 | super::vals::Odr(val as u8) | ||
| 6591 | } | 4493 | } |
| 6592 | #[doc = "Half-duplex selection"] | 4494 | #[doc = "Port output data"] |
| 6593 | pub const fn hdsel(&self) -> super::vals::Hdsel { | 4495 | pub fn set_odr(&mut self, n: usize, val: super::vals::Odr) { |
| 6594 | let val = (self.0 >> 3usize) & 0x01; | 4496 | assert!(n < 16usize); |
| 6595 | super::vals::Hdsel(val as u8) | 4497 | let offs = 0usize + n * 1usize; |
| 4498 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 6596 | } | 4499 | } |
| 6597 | #[doc = "Half-duplex selection"] | 4500 | } |
| 6598 | pub fn set_hdsel(&mut self, val: super::vals::Hdsel) { | 4501 | impl Default for Odr { |
| 6599 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | 4502 | fn default() -> Odr { |
| 4503 | Odr(0) | ||
| 6600 | } | 4504 | } |
| 6601 | #[doc = "DMA enable receiver"] | 4505 | } |
| 6602 | pub const fn dmar(&self) -> bool { | 4506 | #[doc = "Port configuration lock register"] |
| 6603 | let val = (self.0 >> 6usize) & 0x01; | 4507 | #[repr(transparent)] |
| 6604 | val != 0 | 4508 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 4509 | pub struct Lckr(pub u32); | ||
| 4510 | impl Lckr { | ||
| 4511 | #[doc = "Port A Lock bit"] | ||
| 4512 | pub fn lck(&self, n: usize) -> super::vals::Lck { | ||
| 4513 | assert!(n < 16usize); | ||
| 4514 | let offs = 0usize + n * 1usize; | ||
| 4515 | let val = (self.0 >> offs) & 0x01; | ||
| 4516 | super::vals::Lck(val as u8) | ||
| 6605 | } | 4517 | } |
| 6606 | #[doc = "DMA enable receiver"] | 4518 | #[doc = "Port A Lock bit"] |
| 6607 | pub fn set_dmar(&mut self, val: bool) { | 4519 | pub fn set_lck(&mut self, n: usize, val: super::vals::Lck) { |
| 6608 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 4520 | assert!(n < 16usize); |
| 4521 | let offs = 0usize + n * 1usize; | ||
| 4522 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 6609 | } | 4523 | } |
| 6610 | #[doc = "DMA enable transmitter"] | 4524 | #[doc = "Lock key"] |
| 6611 | pub const fn dmat(&self) -> bool { | 4525 | pub const fn lckk(&self) -> super::vals::Lckk { |
| 6612 | let val = (self.0 >> 7usize) & 0x01; | 4526 | let val = (self.0 >> 16usize) & 0x01; |
| 4527 | super::vals::Lckk(val as u8) | ||
| 4528 | } | ||
| 4529 | #[doc = "Lock key"] | ||
| 4530 | pub fn set_lckk(&mut self, val: super::vals::Lckk) { | ||
| 4531 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 4532 | } | ||
| 4533 | } | ||
| 4534 | impl Default for Lckr { | ||
| 4535 | fn default() -> Lckr { | ||
| 4536 | Lckr(0) | ||
| 4537 | } | ||
| 4538 | } | ||
| 4539 | #[doc = "Port input data register (GPIOn_IDR)"] | ||
| 4540 | #[repr(transparent)] | ||
| 4541 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4542 | pub struct Idr(pub u32); | ||
| 4543 | impl Idr { | ||
| 4544 | #[doc = "Port input data"] | ||
| 4545 | pub fn idr(&self, n: usize) -> super::vals::Idr { | ||
| 4546 | assert!(n < 16usize); | ||
| 4547 | let offs = 0usize + n * 1usize; | ||
| 4548 | let val = (self.0 >> offs) & 0x01; | ||
| 4549 | super::vals::Idr(val as u8) | ||
| 4550 | } | ||
| 4551 | #[doc = "Port input data"] | ||
| 4552 | pub fn set_idr(&mut self, n: usize, val: super::vals::Idr) { | ||
| 4553 | assert!(n < 16usize); | ||
| 4554 | let offs = 0usize + n * 1usize; | ||
| 4555 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 4556 | } | ||
| 4557 | } | ||
| 4558 | impl Default for Idr { | ||
| 4559 | fn default() -> Idr { | ||
| 4560 | Idr(0) | ||
| 4561 | } | ||
| 4562 | } | ||
| 4563 | #[doc = "Port configuration register (GPIOn_CRx)"] | ||
| 4564 | #[repr(transparent)] | ||
| 4565 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4566 | pub struct Cr(pub u32); | ||
| 4567 | impl Cr { | ||
| 4568 | #[doc = "Port n mode bits"] | ||
| 4569 | pub fn mode(&self, n: usize) -> super::vals::Mode { | ||
| 4570 | assert!(n < 8usize); | ||
| 4571 | let offs = 0usize + n * 4usize; | ||
| 4572 | let val = (self.0 >> offs) & 0x03; | ||
| 4573 | super::vals::Mode(val as u8) | ||
| 4574 | } | ||
| 4575 | #[doc = "Port n mode bits"] | ||
| 4576 | pub fn set_mode(&mut self, n: usize, val: super::vals::Mode) { | ||
| 4577 | assert!(n < 8usize); | ||
| 4578 | let offs = 0usize + n * 4usize; | ||
| 4579 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | ||
| 4580 | } | ||
| 4581 | #[doc = "Port n configuration bits"] | ||
| 4582 | pub fn cnf(&self, n: usize) -> super::vals::Cnf { | ||
| 4583 | assert!(n < 8usize); | ||
| 4584 | let offs = 2usize + n * 4usize; | ||
| 4585 | let val = (self.0 >> offs) & 0x03; | ||
| 4586 | super::vals::Cnf(val as u8) | ||
| 4587 | } | ||
| 4588 | #[doc = "Port n configuration bits"] | ||
| 4589 | pub fn set_cnf(&mut self, n: usize, val: super::vals::Cnf) { | ||
| 4590 | assert!(n < 8usize); | ||
| 4591 | let offs = 2usize + n * 4usize; | ||
| 4592 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | ||
| 4593 | } | ||
| 4594 | } | ||
| 4595 | impl Default for Cr { | ||
| 4596 | fn default() -> Cr { | ||
| 4597 | Cr(0) | ||
| 4598 | } | ||
| 4599 | } | ||
| 4600 | #[doc = "Port bit reset register (GPIOn_BRR)"] | ||
| 4601 | #[repr(transparent)] | ||
| 4602 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4603 | pub struct Brr(pub u32); | ||
| 4604 | impl Brr { | ||
| 4605 | #[doc = "Reset bit"] | ||
| 4606 | pub fn br(&self, n: usize) -> bool { | ||
| 4607 | assert!(n < 16usize); | ||
| 4608 | let offs = 0usize + n * 1usize; | ||
| 4609 | let val = (self.0 >> offs) & 0x01; | ||
| 6613 | val != 0 | 4610 | val != 0 |
| 6614 | } | 4611 | } |
| 6615 | #[doc = "DMA enable transmitter"] | 4612 | #[doc = "Reset bit"] |
| 6616 | pub fn set_dmat(&mut self, val: bool) { | 4613 | pub fn set_br(&mut self, n: usize, val: bool) { |
| 6617 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 4614 | assert!(n < 16usize); |
| 4615 | let offs = 0usize + n * 1usize; | ||
| 4616 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 6618 | } | 4617 | } |
| 6619 | } | 4618 | } |
| 6620 | impl Default for Cr3 { | 4619 | impl Default for Brr { |
| 6621 | fn default() -> Cr3 { | 4620 | fn default() -> Brr { |
| 6622 | Cr3(0) | 4621 | Brr(0) |
| 6623 | } | 4622 | } |
| 6624 | } | 4623 | } |
| 6625 | #[doc = "Status register"] | 4624 | } |
| 4625 | } | ||
| 4626 | pub mod dma_v2 { | ||
| 4627 | use crate::generic::*; | ||
| 4628 | #[doc = "Stream cluster: S?CR, S?NDTR, S?M0AR, S?M1AR and S?FCR registers"] | ||
| 4629 | #[derive(Copy, Clone)] | ||
| 4630 | pub struct St(pub *mut u8); | ||
| 4631 | unsafe impl Send for St {} | ||
| 4632 | unsafe impl Sync for St {} | ||
| 4633 | impl St { | ||
| 4634 | #[doc = "stream x configuration register"] | ||
| 4635 | pub fn cr(self) -> Reg<regs::Cr, RW> { | ||
| 4636 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 4637 | } | ||
| 4638 | #[doc = "stream x number of data register"] | ||
| 4639 | pub fn ndtr(self) -> Reg<regs::Ndtr, RW> { | ||
| 4640 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 4641 | } | ||
| 4642 | #[doc = "stream x peripheral address register"] | ||
| 4643 | pub fn par(self) -> Reg<u32, RW> { | ||
| 4644 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 4645 | } | ||
| 4646 | #[doc = "stream x memory 0 address register"] | ||
| 4647 | pub fn m0ar(self) -> Reg<u32, RW> { | ||
| 4648 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 4649 | } | ||
| 4650 | #[doc = "stream x memory 1 address register"] | ||
| 4651 | pub fn m1ar(self) -> Reg<u32, RW> { | ||
| 4652 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 4653 | } | ||
| 4654 | #[doc = "stream x FIFO control register"] | ||
| 4655 | pub fn fcr(self) -> Reg<regs::Fcr, RW> { | ||
| 4656 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 4657 | } | ||
| 4658 | } | ||
| 4659 | #[doc = "DMA controller"] | ||
| 4660 | #[derive(Copy, Clone)] | ||
| 4661 | pub struct Dma(pub *mut u8); | ||
| 4662 | unsafe impl Send for Dma {} | ||
| 4663 | unsafe impl Sync for Dma {} | ||
| 4664 | impl Dma { | ||
| 4665 | #[doc = "low interrupt status register"] | ||
| 4666 | pub fn isr(self, n: usize) -> Reg<regs::Ixr, R> { | ||
| 4667 | assert!(n < 2usize); | ||
| 4668 | unsafe { Reg::from_ptr(self.0.add(0usize + n * 4usize)) } | ||
| 4669 | } | ||
| 4670 | #[doc = "low interrupt flag clear register"] | ||
| 4671 | pub fn ifcr(self, n: usize) -> Reg<regs::Ixr, W> { | ||
| 4672 | assert!(n < 2usize); | ||
| 4673 | unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) } | ||
| 4674 | } | ||
| 4675 | #[doc = "Stream cluster: S?CR, S?NDTR, S?M0AR, S?M1AR and S?FCR registers"] | ||
| 4676 | pub fn st(self, n: usize) -> St { | ||
| 4677 | assert!(n < 8usize); | ||
| 4678 | unsafe { St(self.0.add(16usize + n * 24usize)) } | ||
| 4679 | } | ||
| 4680 | } | ||
| 4681 | pub mod vals { | ||
| 4682 | use crate::generic::*; | ||
| 4683 | #[repr(transparent)] | ||
| 4684 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4685 | pub struct Pincos(pub u8); | ||
| 4686 | impl Pincos { | ||
| 4687 | #[doc = "The offset size for the peripheral address calculation is linked to the PSIZE"] | ||
| 4688 | pub const PSIZE: Self = Self(0); | ||
| 4689 | #[doc = "The offset size for the peripheral address calculation is fixed to 4 (32-bit alignment)"] | ||
| 4690 | pub const FIXED4: Self = Self(0x01); | ||
| 4691 | } | ||
| 4692 | #[repr(transparent)] | ||
| 4693 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4694 | pub struct Inc(pub u8); | ||
| 4695 | impl Inc { | ||
| 4696 | #[doc = "Address pointer is fixed"] | ||
| 4697 | pub const FIXED: Self = Self(0); | ||
| 4698 | #[doc = "Address pointer is incremented after each data transfer"] | ||
| 4699 | pub const INCREMENTED: Self = Self(0x01); | ||
| 4700 | } | ||
| 4701 | #[repr(transparent)] | ||
| 4702 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4703 | pub struct Ct(pub u8); | ||
| 4704 | impl Ct { | ||
| 4705 | #[doc = "The current target memory is Memory 0"] | ||
| 4706 | pub const MEMORY0: Self = Self(0); | ||
| 4707 | #[doc = "The current target memory is Memory 1"] | ||
| 4708 | pub const MEMORY1: Self = Self(0x01); | ||
| 4709 | } | ||
| 4710 | #[repr(transparent)] | ||
| 4711 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4712 | pub struct Fs(pub u8); | ||
| 4713 | impl Fs { | ||
| 4714 | #[doc = "0 < fifo_level < 1/4"] | ||
| 4715 | pub const QUARTER1: Self = Self(0); | ||
| 4716 | #[doc = "1/4 <= fifo_level < 1/2"] | ||
| 4717 | pub const QUARTER2: Self = Self(0x01); | ||
| 4718 | #[doc = "1/2 <= fifo_level < 3/4"] | ||
| 4719 | pub const QUARTER3: Self = Self(0x02); | ||
| 4720 | #[doc = "3/4 <= fifo_level < full"] | ||
| 4721 | pub const QUARTER4: Self = Self(0x03); | ||
| 4722 | #[doc = "FIFO is empty"] | ||
| 4723 | pub const EMPTY: Self = Self(0x04); | ||
| 4724 | #[doc = "FIFO is full"] | ||
| 4725 | pub const FULL: Self = Self(0x05); | ||
| 4726 | } | ||
| 4727 | #[repr(transparent)] | ||
| 4728 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4729 | pub struct Fth(pub u8); | ||
| 4730 | impl Fth { | ||
| 4731 | #[doc = "1/4 full FIFO"] | ||
| 4732 | pub const QUARTER: Self = Self(0); | ||
| 4733 | #[doc = "1/2 full FIFO"] | ||
| 4734 | pub const HALF: Self = Self(0x01); | ||
| 4735 | #[doc = "3/4 full FIFO"] | ||
| 4736 | pub const THREEQUARTERS: Self = Self(0x02); | ||
| 4737 | #[doc = "Full FIFO"] | ||
| 4738 | pub const FULL: Self = Self(0x03); | ||
| 4739 | } | ||
| 4740 | #[repr(transparent)] | ||
| 4741 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4742 | pub struct Circ(pub u8); | ||
| 4743 | impl Circ { | ||
| 4744 | #[doc = "Circular mode disabled"] | ||
| 4745 | pub const DISABLED: Self = Self(0); | ||
| 4746 | #[doc = "Circular mode enabled"] | ||
| 4747 | pub const ENABLED: Self = Self(0x01); | ||
| 4748 | } | ||
| 4749 | #[repr(transparent)] | ||
| 4750 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4751 | pub struct Size(pub u8); | ||
| 4752 | impl Size { | ||
| 4753 | #[doc = "Byte (8-bit)"] | ||
| 4754 | pub const BITS8: Self = Self(0); | ||
| 4755 | #[doc = "Half-word (16-bit)"] | ||
| 4756 | pub const BITS16: Self = Self(0x01); | ||
| 4757 | #[doc = "Word (32-bit)"] | ||
| 4758 | pub const BITS32: Self = Self(0x02); | ||
| 4759 | } | ||
| 4760 | #[repr(transparent)] | ||
| 4761 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4762 | pub struct Dmdis(pub u8); | ||
| 4763 | impl Dmdis { | ||
| 4764 | #[doc = "Direct mode is enabled"] | ||
| 4765 | pub const ENABLED: Self = Self(0); | ||
| 4766 | #[doc = "Direct mode is disabled"] | ||
| 4767 | pub const DISABLED: Self = Self(0x01); | ||
| 4768 | } | ||
| 4769 | #[repr(transparent)] | ||
| 4770 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4771 | pub struct Dbm(pub u8); | ||
| 4772 | impl Dbm { | ||
| 4773 | #[doc = "No buffer switching at the end of transfer"] | ||
| 4774 | pub const DISABLED: Self = Self(0); | ||
| 4775 | #[doc = "Memory target switched at the end of the DMA transfer"] | ||
| 4776 | pub const ENABLED: Self = Self(0x01); | ||
| 4777 | } | ||
| 4778 | #[repr(transparent)] | ||
| 4779 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4780 | pub struct Pl(pub u8); | ||
| 4781 | impl Pl { | ||
| 4782 | #[doc = "Low"] | ||
| 4783 | pub const LOW: Self = Self(0); | ||
| 4784 | #[doc = "Medium"] | ||
| 4785 | pub const MEDIUM: Self = Self(0x01); | ||
| 4786 | #[doc = "High"] | ||
| 4787 | pub const HIGH: Self = Self(0x02); | ||
| 4788 | #[doc = "Very high"] | ||
| 4789 | pub const VERYHIGH: Self = Self(0x03); | ||
| 4790 | } | ||
| 4791 | #[repr(transparent)] | ||
| 4792 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4793 | pub struct Burst(pub u8); | ||
| 4794 | impl Burst { | ||
| 4795 | #[doc = "Single transfer"] | ||
| 4796 | pub const SINGLE: Self = Self(0); | ||
| 4797 | #[doc = "Incremental burst of 4 beats"] | ||
| 4798 | pub const INCR4: Self = Self(0x01); | ||
| 4799 | #[doc = "Incremental burst of 8 beats"] | ||
| 4800 | pub const INCR8: Self = Self(0x02); | ||
| 4801 | #[doc = "Incremental burst of 16 beats"] | ||
| 4802 | pub const INCR16: Self = Self(0x03); | ||
| 4803 | } | ||
| 4804 | #[repr(transparent)] | ||
| 4805 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4806 | pub struct Dir(pub u8); | ||
| 4807 | impl Dir { | ||
| 4808 | #[doc = "Peripheral-to-memory"] | ||
| 4809 | pub const PERIPHERALTOMEMORY: Self = Self(0); | ||
| 4810 | #[doc = "Memory-to-peripheral"] | ||
| 4811 | pub const MEMORYTOPERIPHERAL: Self = Self(0x01); | ||
| 4812 | #[doc = "Memory-to-memory"] | ||
| 4813 | pub const MEMORYTOMEMORY: Self = Self(0x02); | ||
| 4814 | } | ||
| 4815 | #[repr(transparent)] | ||
| 4816 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4817 | pub struct Pfctrl(pub u8); | ||
| 4818 | impl Pfctrl { | ||
| 4819 | #[doc = "The DMA is the flow controller"] | ||
| 4820 | pub const DMA: Self = Self(0); | ||
| 4821 | #[doc = "The peripheral is the flow controller"] | ||
| 4822 | pub const PERIPHERAL: Self = Self(0x01); | ||
| 4823 | } | ||
| 4824 | } | ||
| 4825 | pub mod regs { | ||
| 4826 | use crate::generic::*; | ||
| 4827 | #[doc = "stream x number of data register"] | ||
| 6626 | #[repr(transparent)] | 4828 | #[repr(transparent)] |
| 6627 | #[derive(Copy, Clone, Eq, PartialEq)] | 4829 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 6628 | pub struct SrUsart(pub u32); | 4830 | pub struct Ndtr(pub u32); |
| 6629 | impl SrUsart { | 4831 | impl Ndtr { |
| 6630 | #[doc = "Parity error"] | 4832 | #[doc = "Number of data items to transfer"] |
| 6631 | pub const fn pe(&self) -> bool { | 4833 | pub const fn ndt(&self) -> u16 { |
| 4834 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 4835 | val as u16 | ||
| 4836 | } | ||
| 4837 | #[doc = "Number of data items to transfer"] | ||
| 4838 | pub fn set_ndt(&mut self, val: u16) { | ||
| 4839 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 4840 | } | ||
| 4841 | } | ||
| 4842 | impl Default for Ndtr { | ||
| 4843 | fn default() -> Ndtr { | ||
| 4844 | Ndtr(0) | ||
| 4845 | } | ||
| 4846 | } | ||
| 4847 | #[doc = "stream x configuration register"] | ||
| 4848 | #[repr(transparent)] | ||
| 4849 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4850 | pub struct Cr(pub u32); | ||
| 4851 | impl Cr { | ||
| 4852 | #[doc = "Stream enable / flag stream ready when read low"] | ||
| 4853 | pub const fn en(&self) -> bool { | ||
| 6632 | let val = (self.0 >> 0usize) & 0x01; | 4854 | let val = (self.0 >> 0usize) & 0x01; |
| 6633 | val != 0 | 4855 | val != 0 |
| 6634 | } | 4856 | } |
| 6635 | #[doc = "Parity error"] | 4857 | #[doc = "Stream enable / flag stream ready when read low"] |
| 6636 | pub fn set_pe(&mut self, val: bool) { | 4858 | pub fn set_en(&mut self, val: bool) { |
| 6637 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 4859 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 6638 | } | 4860 | } |
| 6639 | #[doc = "Framing error"] | 4861 | #[doc = "Direct mode error interrupt enable"] |
| 6640 | pub const fn fe(&self) -> bool { | 4862 | pub const fn dmeie(&self) -> bool { |
| 6641 | let val = (self.0 >> 1usize) & 0x01; | 4863 | let val = (self.0 >> 1usize) & 0x01; |
| 6642 | val != 0 | 4864 | val != 0 |
| 6643 | } | 4865 | } |
| 6644 | #[doc = "Framing error"] | 4866 | #[doc = "Direct mode error interrupt enable"] |
| 6645 | pub fn set_fe(&mut self, val: bool) { | 4867 | pub fn set_dmeie(&mut self, val: bool) { |
| 6646 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 4868 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 6647 | } | 4869 | } |
| 6648 | #[doc = "Noise error flag"] | 4870 | #[doc = "Transfer error interrupt enable"] |
| 6649 | pub const fn ne(&self) -> bool { | 4871 | pub const fn teie(&self) -> bool { |
| 6650 | let val = (self.0 >> 2usize) & 0x01; | 4872 | let val = (self.0 >> 2usize) & 0x01; |
| 6651 | val != 0 | 4873 | val != 0 |
| 6652 | } | 4874 | } |
| 6653 | #[doc = "Noise error flag"] | 4875 | #[doc = "Transfer error interrupt enable"] |
| 6654 | pub fn set_ne(&mut self, val: bool) { | 4876 | pub fn set_teie(&mut self, val: bool) { |
| 6655 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 4877 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 6656 | } | 4878 | } |
| 6657 | #[doc = "Overrun error"] | 4879 | #[doc = "Half transfer interrupt enable"] |
| 6658 | pub const fn ore(&self) -> bool { | 4880 | pub const fn htie(&self) -> bool { |
| 6659 | let val = (self.0 >> 3usize) & 0x01; | 4881 | let val = (self.0 >> 3usize) & 0x01; |
| 6660 | val != 0 | 4882 | val != 0 |
| 6661 | } | 4883 | } |
| 6662 | #[doc = "Overrun error"] | 4884 | #[doc = "Half transfer interrupt enable"] |
| 6663 | pub fn set_ore(&mut self, val: bool) { | 4885 | pub fn set_htie(&mut self, val: bool) { |
| 6664 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 4886 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); |
| 6665 | } | 4887 | } |
| 6666 | #[doc = "IDLE line detected"] | 4888 | #[doc = "Transfer complete interrupt enable"] |
| 6667 | pub const fn idle(&self) -> bool { | 4889 | pub const fn tcie(&self) -> bool { |
| 6668 | let val = (self.0 >> 4usize) & 0x01; | 4890 | let val = (self.0 >> 4usize) & 0x01; |
| 6669 | val != 0 | 4891 | val != 0 |
| 6670 | } | 4892 | } |
| 6671 | #[doc = "IDLE line detected"] | 4893 | #[doc = "Transfer complete interrupt enable"] |
| 6672 | pub fn set_idle(&mut self, val: bool) { | 4894 | pub fn set_tcie(&mut self, val: bool) { |
| 6673 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 4895 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 6674 | } | 4896 | } |
| 6675 | #[doc = "Read data register not empty"] | 4897 | #[doc = "Peripheral flow controller"] |
| 6676 | pub const fn rxne(&self) -> bool { | 4898 | pub const fn pfctrl(&self) -> super::vals::Pfctrl { |
| 6677 | let val = (self.0 >> 5usize) & 0x01; | 4899 | let val = (self.0 >> 5usize) & 0x01; |
| 6678 | val != 0 | 4900 | super::vals::Pfctrl(val as u8) |
| 6679 | } | ||
| 6680 | #[doc = "Read data register not empty"] | ||
| 6681 | pub fn set_rxne(&mut self, val: bool) { | ||
| 6682 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 6683 | } | ||
| 6684 | #[doc = "Transmission complete"] | ||
| 6685 | pub const fn tc(&self) -> bool { | ||
| 6686 | let val = (self.0 >> 6usize) & 0x01; | ||
| 6687 | val != 0 | ||
| 6688 | } | 4901 | } |
| 6689 | #[doc = "Transmission complete"] | 4902 | #[doc = "Peripheral flow controller"] |
| 6690 | pub fn set_tc(&mut self, val: bool) { | 4903 | pub fn set_pfctrl(&mut self, val: super::vals::Pfctrl) { |
| 6691 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 4904 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); |
| 6692 | } | 4905 | } |
| 6693 | #[doc = "Transmit data register empty"] | 4906 | #[doc = "Data transfer direction"] |
| 6694 | pub const fn txe(&self) -> bool { | 4907 | pub const fn dir(&self) -> super::vals::Dir { |
| 6695 | let val = (self.0 >> 7usize) & 0x01; | 4908 | let val = (self.0 >> 6usize) & 0x03; |
| 6696 | val != 0 | 4909 | super::vals::Dir(val as u8) |
| 6697 | } | 4910 | } |
| 6698 | #[doc = "Transmit data register empty"] | 4911 | #[doc = "Data transfer direction"] |
| 6699 | pub fn set_txe(&mut self, val: bool) { | 4912 | pub fn set_dir(&mut self, val: super::vals::Dir) { |
| 6700 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 4913 | self.0 = (self.0 & !(0x03 << 6usize)) | (((val.0 as u32) & 0x03) << 6usize); |
| 6701 | } | 4914 | } |
| 6702 | #[doc = "LIN break detection flag"] | 4915 | #[doc = "Circular mode"] |
| 6703 | pub const fn lbd(&self) -> bool { | 4916 | pub const fn circ(&self) -> super::vals::Circ { |
| 6704 | let val = (self.0 >> 8usize) & 0x01; | 4917 | let val = (self.0 >> 8usize) & 0x01; |
| 6705 | val != 0 | 4918 | super::vals::Circ(val as u8) |
| 6706 | } | 4919 | } |
| 6707 | #[doc = "LIN break detection flag"] | 4920 | #[doc = "Circular mode"] |
| 6708 | pub fn set_lbd(&mut self, val: bool) { | 4921 | pub fn set_circ(&mut self, val: super::vals::Circ) { |
| 6709 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 4922 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); |
| 6710 | } | 4923 | } |
| 6711 | #[doc = "CTS flag"] | 4924 | #[doc = "Peripheral increment mode"] |
| 6712 | pub const fn cts(&self) -> bool { | 4925 | pub const fn pinc(&self) -> super::vals::Inc { |
| 6713 | let val = (self.0 >> 9usize) & 0x01; | 4926 | let val = (self.0 >> 9usize) & 0x01; |
| 6714 | val != 0 | 4927 | super::vals::Inc(val as u8) |
| 6715 | } | 4928 | } |
| 6716 | #[doc = "CTS flag"] | 4929 | #[doc = "Peripheral increment mode"] |
| 6717 | pub fn set_cts(&mut self, val: bool) { | 4930 | pub fn set_pinc(&mut self, val: super::vals::Inc) { |
| 6718 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | 4931 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); |
| 4932 | } | ||
| 4933 | #[doc = "Memory increment mode"] | ||
| 4934 | pub const fn minc(&self) -> super::vals::Inc { | ||
| 4935 | let val = (self.0 >> 10usize) & 0x01; | ||
| 4936 | super::vals::Inc(val as u8) | ||
| 4937 | } | ||
| 4938 | #[doc = "Memory increment mode"] | ||
| 4939 | pub fn set_minc(&mut self, val: super::vals::Inc) { | ||
| 4940 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); | ||
| 4941 | } | ||
| 4942 | #[doc = "Peripheral data size"] | ||
| 4943 | pub const fn psize(&self) -> super::vals::Size { | ||
| 4944 | let val = (self.0 >> 11usize) & 0x03; | ||
| 4945 | super::vals::Size(val as u8) | ||
| 4946 | } | ||
| 4947 | #[doc = "Peripheral data size"] | ||
| 4948 | pub fn set_psize(&mut self, val: super::vals::Size) { | ||
| 4949 | self.0 = (self.0 & !(0x03 << 11usize)) | (((val.0 as u32) & 0x03) << 11usize); | ||
| 4950 | } | ||
| 4951 | #[doc = "Memory data size"] | ||
| 4952 | pub const fn msize(&self) -> super::vals::Size { | ||
| 4953 | let val = (self.0 >> 13usize) & 0x03; | ||
| 4954 | super::vals::Size(val as u8) | ||
| 4955 | } | ||
| 4956 | #[doc = "Memory data size"] | ||
| 4957 | pub fn set_msize(&mut self, val: super::vals::Size) { | ||
| 4958 | self.0 = (self.0 & !(0x03 << 13usize)) | (((val.0 as u32) & 0x03) << 13usize); | ||
| 4959 | } | ||
| 4960 | #[doc = "Peripheral increment offset size"] | ||
| 4961 | pub const fn pincos(&self) -> super::vals::Pincos { | ||
| 4962 | let val = (self.0 >> 15usize) & 0x01; | ||
| 4963 | super::vals::Pincos(val as u8) | ||
| 4964 | } | ||
| 4965 | #[doc = "Peripheral increment offset size"] | ||
| 4966 | pub fn set_pincos(&mut self, val: super::vals::Pincos) { | ||
| 4967 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 4968 | } | ||
| 4969 | #[doc = "Priority level"] | ||
| 4970 | pub const fn pl(&self) -> super::vals::Pl { | ||
| 4971 | let val = (self.0 >> 16usize) & 0x03; | ||
| 4972 | super::vals::Pl(val as u8) | ||
| 4973 | } | ||
| 4974 | #[doc = "Priority level"] | ||
| 4975 | pub fn set_pl(&mut self, val: super::vals::Pl) { | ||
| 4976 | self.0 = (self.0 & !(0x03 << 16usize)) | (((val.0 as u32) & 0x03) << 16usize); | ||
| 4977 | } | ||
| 4978 | #[doc = "Double buffer mode"] | ||
| 4979 | pub const fn dbm(&self) -> super::vals::Dbm { | ||
| 4980 | let val = (self.0 >> 18usize) & 0x01; | ||
| 4981 | super::vals::Dbm(val as u8) | ||
| 4982 | } | ||
| 4983 | #[doc = "Double buffer mode"] | ||
| 4984 | pub fn set_dbm(&mut self, val: super::vals::Dbm) { | ||
| 4985 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize); | ||
| 4986 | } | ||
| 4987 | #[doc = "Current target (only in double buffer mode)"] | ||
| 4988 | pub const fn ct(&self) -> super::vals::Ct { | ||
| 4989 | let val = (self.0 >> 19usize) & 0x01; | ||
| 4990 | super::vals::Ct(val as u8) | ||
| 4991 | } | ||
| 4992 | #[doc = "Current target (only in double buffer mode)"] | ||
| 4993 | pub fn set_ct(&mut self, val: super::vals::Ct) { | ||
| 4994 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); | ||
| 4995 | } | ||
| 4996 | #[doc = "Peripheral burst transfer configuration"] | ||
| 4997 | pub const fn pburst(&self) -> super::vals::Burst { | ||
| 4998 | let val = (self.0 >> 21usize) & 0x03; | ||
| 4999 | super::vals::Burst(val as u8) | ||
| 5000 | } | ||
| 5001 | #[doc = "Peripheral burst transfer configuration"] | ||
| 5002 | pub fn set_pburst(&mut self, val: super::vals::Burst) { | ||
| 5003 | self.0 = (self.0 & !(0x03 << 21usize)) | (((val.0 as u32) & 0x03) << 21usize); | ||
| 5004 | } | ||
| 5005 | #[doc = "Memory burst transfer configuration"] | ||
| 5006 | pub const fn mburst(&self) -> super::vals::Burst { | ||
| 5007 | let val = (self.0 >> 23usize) & 0x03; | ||
| 5008 | super::vals::Burst(val as u8) | ||
| 5009 | } | ||
| 5010 | #[doc = "Memory burst transfer configuration"] | ||
| 5011 | pub fn set_mburst(&mut self, val: super::vals::Burst) { | ||
| 5012 | self.0 = (self.0 & !(0x03 << 23usize)) | (((val.0 as u32) & 0x03) << 23usize); | ||
| 5013 | } | ||
| 5014 | #[doc = "Channel selection"] | ||
| 5015 | pub const fn chsel(&self) -> u8 { | ||
| 5016 | let val = (self.0 >> 25usize) & 0x0f; | ||
| 5017 | val as u8 | ||
| 5018 | } | ||
| 5019 | #[doc = "Channel selection"] | ||
| 5020 | pub fn set_chsel(&mut self, val: u8) { | ||
| 5021 | self.0 = (self.0 & !(0x0f << 25usize)) | (((val as u32) & 0x0f) << 25usize); | ||
| 6719 | } | 5022 | } |
| 6720 | } | 5023 | } |
| 6721 | impl Default for SrUsart { | 5024 | impl Default for Cr { |
| 6722 | fn default() -> SrUsart { | 5025 | fn default() -> Cr { |
| 6723 | SrUsart(0) | 5026 | Cr(0) |
| 6724 | } | 5027 | } |
| 6725 | } | 5028 | } |
| 6726 | #[doc = "Control register 3"] | 5029 | #[doc = "stream x FIFO control register"] |
| 6727 | #[repr(transparent)] | 5030 | #[repr(transparent)] |
| 6728 | #[derive(Copy, Clone, Eq, PartialEq)] | 5031 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 6729 | pub struct Cr3Usart(pub u32); | 5032 | pub struct Fcr(pub u32); |
| 6730 | impl Cr3Usart { | 5033 | impl Fcr { |
| 6731 | #[doc = "Error interrupt enable"] | 5034 | #[doc = "FIFO threshold selection"] |
| 6732 | pub const fn eie(&self) -> bool { | 5035 | pub const fn fth(&self) -> super::vals::Fth { |
| 6733 | let val = (self.0 >> 0usize) & 0x01; | 5036 | let val = (self.0 >> 0usize) & 0x03; |
| 6734 | val != 0 | 5037 | super::vals::Fth(val as u8) |
| 6735 | } | ||
| 6736 | #[doc = "Error interrupt enable"] | ||
| 6737 | pub fn set_eie(&mut self, val: bool) { | ||
| 6738 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 6739 | } | ||
| 6740 | #[doc = "IrDA mode enable"] | ||
| 6741 | pub const fn iren(&self) -> bool { | ||
| 6742 | let val = (self.0 >> 1usize) & 0x01; | ||
| 6743 | val != 0 | ||
| 6744 | } | 5038 | } |
| 6745 | #[doc = "IrDA mode enable"] | 5039 | #[doc = "FIFO threshold selection"] |
| 6746 | pub fn set_iren(&mut self, val: bool) { | 5040 | pub fn set_fth(&mut self, val: super::vals::Fth) { |
| 6747 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 5041 | self.0 = (self.0 & !(0x03 << 0usize)) | (((val.0 as u32) & 0x03) << 0usize); |
| 6748 | } | 5042 | } |
| 6749 | #[doc = "IrDA low-power"] | 5043 | #[doc = "Direct mode disable"] |
| 6750 | pub const fn irlp(&self) -> super::vals::Irlp { | 5044 | pub const fn dmdis(&self) -> super::vals::Dmdis { |
| 6751 | let val = (self.0 >> 2usize) & 0x01; | 5045 | let val = (self.0 >> 2usize) & 0x01; |
| 6752 | super::vals::Irlp(val as u8) | 5046 | super::vals::Dmdis(val as u8) |
| 6753 | } | 5047 | } |
| 6754 | #[doc = "IrDA low-power"] | 5048 | #[doc = "Direct mode disable"] |
| 6755 | pub fn set_irlp(&mut self, val: super::vals::Irlp) { | 5049 | pub fn set_dmdis(&mut self, val: super::vals::Dmdis) { |
| 6756 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | 5050 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); |
| 6757 | } | 5051 | } |
| 6758 | #[doc = "Half-duplex selection"] | 5052 | #[doc = "FIFO status"] |
| 6759 | pub const fn hdsel(&self) -> super::vals::Hdsel { | 5053 | pub const fn fs(&self) -> super::vals::Fs { |
| 6760 | let val = (self.0 >> 3usize) & 0x01; | 5054 | let val = (self.0 >> 3usize) & 0x07; |
| 6761 | super::vals::Hdsel(val as u8) | 5055 | super::vals::Fs(val as u8) |
| 6762 | } | 5056 | } |
| 6763 | #[doc = "Half-duplex selection"] | 5057 | #[doc = "FIFO status"] |
| 6764 | pub fn set_hdsel(&mut self, val: super::vals::Hdsel) { | 5058 | pub fn set_fs(&mut self, val: super::vals::Fs) { |
| 6765 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | 5059 | self.0 = (self.0 & !(0x07 << 3usize)) | (((val.0 as u32) & 0x07) << 3usize); |
| 6766 | } | 5060 | } |
| 6767 | #[doc = "Smartcard NACK enable"] | 5061 | #[doc = "FIFO error interrupt enable"] |
| 6768 | pub const fn nack(&self) -> bool { | 5062 | pub const fn feie(&self) -> bool { |
| 6769 | let val = (self.0 >> 4usize) & 0x01; | 5063 | let val = (self.0 >> 7usize) & 0x01; |
| 6770 | val != 0 | 5064 | val != 0 |
| 6771 | } | 5065 | } |
| 6772 | #[doc = "Smartcard NACK enable"] | 5066 | #[doc = "FIFO error interrupt enable"] |
| 6773 | pub fn set_nack(&mut self, val: bool) { | 5067 | pub fn set_feie(&mut self, val: bool) { |
| 6774 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 5068 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 6775 | } | ||
| 6776 | #[doc = "Smartcard mode enable"] | ||
| 6777 | pub const fn scen(&self) -> bool { | ||
| 6778 | let val = (self.0 >> 5usize) & 0x01; | ||
| 6779 | val != 0 | ||
| 6780 | } | 5069 | } |
| 6781 | #[doc = "Smartcard mode enable"] | 5070 | } |
| 6782 | pub fn set_scen(&mut self, val: bool) { | 5071 | impl Default for Fcr { |
| 6783 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 5072 | fn default() -> Fcr { |
| 5073 | Fcr(0) | ||
| 6784 | } | 5074 | } |
| 6785 | #[doc = "DMA enable receiver"] | 5075 | } |
| 6786 | pub const fn dmar(&self) -> bool { | 5076 | #[doc = "interrupt register"] |
| 6787 | let val = (self.0 >> 6usize) & 0x01; | 5077 | #[repr(transparent)] |
| 5078 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5079 | pub struct Ixr(pub u32); | ||
| 5080 | impl Ixr { | ||
| 5081 | #[doc = "Stream x FIFO error interrupt flag (x=3..0)"] | ||
| 5082 | pub fn feif(&self, n: usize) -> bool { | ||
| 5083 | assert!(n < 4usize); | ||
| 5084 | let offs = 0usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | ||
| 5085 | let val = (self.0 >> offs) & 0x01; | ||
| 6788 | val != 0 | 5086 | val != 0 |
| 6789 | } | 5087 | } |
| 6790 | #[doc = "DMA enable receiver"] | 5088 | #[doc = "Stream x FIFO error interrupt flag (x=3..0)"] |
| 6791 | pub fn set_dmar(&mut self, val: bool) { | 5089 | pub fn set_feif(&mut self, n: usize, val: bool) { |
| 6792 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 5090 | assert!(n < 4usize); |
| 5091 | let offs = 0usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | ||
| 5092 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 6793 | } | 5093 | } |
| 6794 | #[doc = "DMA enable transmitter"] | 5094 | #[doc = "Stream x direct mode error interrupt flag (x=3..0)"] |
| 6795 | pub const fn dmat(&self) -> bool { | 5095 | pub fn dmeif(&self, n: usize) -> bool { |
| 6796 | let val = (self.0 >> 7usize) & 0x01; | 5096 | assert!(n < 4usize); |
| 5097 | let offs = 2usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | ||
| 5098 | let val = (self.0 >> offs) & 0x01; | ||
| 6797 | val != 0 | 5099 | val != 0 |
| 6798 | } | 5100 | } |
| 6799 | #[doc = "DMA enable transmitter"] | 5101 | #[doc = "Stream x direct mode error interrupt flag (x=3..0)"] |
| 6800 | pub fn set_dmat(&mut self, val: bool) { | 5102 | pub fn set_dmeif(&mut self, n: usize, val: bool) { |
| 6801 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 5103 | assert!(n < 4usize); |
| 5104 | let offs = 2usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | ||
| 5105 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 6802 | } | 5106 | } |
| 6803 | #[doc = "RTS enable"] | 5107 | #[doc = "Stream x transfer error interrupt flag (x=3..0)"] |
| 6804 | pub const fn rtse(&self) -> bool { | 5108 | pub fn teif(&self, n: usize) -> bool { |
| 6805 | let val = (self.0 >> 8usize) & 0x01; | 5109 | assert!(n < 4usize); |
| 5110 | let offs = 3usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | ||
| 5111 | let val = (self.0 >> offs) & 0x01; | ||
| 6806 | val != 0 | 5112 | val != 0 |
| 6807 | } | 5113 | } |
| 6808 | #[doc = "RTS enable"] | 5114 | #[doc = "Stream x transfer error interrupt flag (x=3..0)"] |
| 6809 | pub fn set_rtse(&mut self, val: bool) { | 5115 | pub fn set_teif(&mut self, n: usize, val: bool) { |
| 6810 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 5116 | assert!(n < 4usize); |
| 5117 | let offs = 3usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | ||
| 5118 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 6811 | } | 5119 | } |
| 6812 | #[doc = "CTS enable"] | 5120 | #[doc = "Stream x half transfer interrupt flag (x=3..0)"] |
| 6813 | pub const fn ctse(&self) -> bool { | 5121 | pub fn htif(&self, n: usize) -> bool { |
| 6814 | let val = (self.0 >> 9usize) & 0x01; | 5122 | assert!(n < 4usize); |
| 5123 | let offs = 4usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | ||
| 5124 | let val = (self.0 >> offs) & 0x01; | ||
| 6815 | val != 0 | 5125 | val != 0 |
| 6816 | } | 5126 | } |
| 6817 | #[doc = "CTS enable"] | 5127 | #[doc = "Stream x half transfer interrupt flag (x=3..0)"] |
| 6818 | pub fn set_ctse(&mut self, val: bool) { | 5128 | pub fn set_htif(&mut self, n: usize, val: bool) { |
| 6819 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | 5129 | assert!(n < 4usize); |
| 5130 | let offs = 4usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | ||
| 5131 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 6820 | } | 5132 | } |
| 6821 | #[doc = "CTS interrupt enable"] | 5133 | #[doc = "Stream x transfer complete interrupt flag (x = 3..0)"] |
| 6822 | pub const fn ctsie(&self) -> bool { | 5134 | pub fn tcif(&self, n: usize) -> bool { |
| 6823 | let val = (self.0 >> 10usize) & 0x01; | 5135 | assert!(n < 4usize); |
| 5136 | let offs = 5usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | ||
| 5137 | let val = (self.0 >> offs) & 0x01; | ||
| 6824 | val != 0 | 5138 | val != 0 |
| 6825 | } | 5139 | } |
| 6826 | #[doc = "CTS interrupt enable"] | 5140 | #[doc = "Stream x transfer complete interrupt flag (x = 3..0)"] |
| 6827 | pub fn set_ctsie(&mut self, val: bool) { | 5141 | pub fn set_tcif(&mut self, n: usize, val: bool) { |
| 6828 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | 5142 | assert!(n < 4usize); |
| 5143 | let offs = 5usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | ||
| 5144 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 6829 | } | 5145 | } |
| 6830 | } | 5146 | } |
| 6831 | impl Default for Cr3Usart { | 5147 | impl Default for Ixr { |
| 6832 | fn default() -> Cr3Usart { | 5148 | fn default() -> Ixr { |
| 6833 | Cr3Usart(0) | 5149 | Ixr(0) |
| 6834 | } | 5150 | } |
| 6835 | } | 5151 | } |
| 6836 | } | 5152 | } |
| @@ -6892,30 +5208,21 @@ pub mod usart_v2 { | |||
| 6892 | use crate::generic::*; | 5208 | use crate::generic::*; |
| 6893 | #[repr(transparent)] | 5209 | #[repr(transparent)] |
| 6894 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 5210 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 6895 | pub struct Datainv(pub u8); | 5211 | pub struct Ps(pub u8); |
| 6896 | impl Datainv { | 5212 | impl Ps { |
| 6897 | #[doc = "Logical data from the data register are send/received in positive/direct logic"] | 5213 | #[doc = "Even parity"] |
| 6898 | pub const POSITIVE: Self = Self(0); | 5214 | pub const EVEN: Self = Self(0); |
| 6899 | #[doc = "Logical data from the data register are send/received in negative/inverse logic"] | 5215 | #[doc = "Odd parity"] |
| 6900 | pub const NEGATIVE: Self = Self(0x01); | 5216 | pub const ODD: Self = Self(0x01); |
| 6901 | } | ||
| 6902 | #[repr(transparent)] | ||
| 6903 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 6904 | pub struct Ovrdis(pub u8); | ||
| 6905 | impl Ovrdis { | ||
| 6906 | #[doc = "Overrun Error Flag, ORE, is set when received data is not read before receiving new data"] | ||
| 6907 | pub const ENABLED: Self = Self(0); | ||
| 6908 | #[doc = "Overrun functionality is disabled. If new data is received while the RXNE flag is still set the ORE flag is not set and the new received data overwrites the previous content of the RDR register"] | ||
| 6909 | pub const DISABLED: Self = Self(0x01); | ||
| 6910 | } | 5217 | } |
| 6911 | #[repr(transparent)] | 5218 | #[repr(transparent)] |
| 6912 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 5219 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 6913 | pub struct Ddre(pub u8); | 5220 | pub struct M1(pub u8); |
| 6914 | impl Ddre { | 5221 | impl M1 { |
| 6915 | #[doc = "DMA is not disabled in case of reception error"] | 5222 | #[doc = "Use M0 to set the data bits"] |
| 6916 | pub const NOTDISABLED: Self = Self(0); | 5223 | pub const M0: Self = Self(0); |
| 6917 | #[doc = "DMA is disabled following a reception error"] | 5224 | #[doc = "1 start bit, 7 data bits, n stop bits"] |
| 6918 | pub const DISABLED: Self = Self(0x01); | 5225 | pub const BIT7: Self = Self(0x01); |
| 6919 | } | 5226 | } |
| 6920 | #[repr(transparent)] | 5227 | #[repr(transparent)] |
| 6921 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 5228 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| @@ -6928,12 +5235,25 @@ pub mod usart_v2 { | |||
| 6928 | } | 5235 | } |
| 6929 | #[repr(transparent)] | 5236 | #[repr(transparent)] |
| 6930 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 5237 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 6931 | pub struct Onebit(pub u8); | 5238 | pub struct Dep(pub u8); |
| 6932 | impl Onebit { | 5239 | impl Dep { |
| 6933 | #[doc = "Three sample bit method"] | 5240 | #[doc = "DE signal is active high"] |
| 6934 | pub const SAMPLE3: Self = Self(0); | 5241 | pub const HIGH: Self = Self(0); |
| 6935 | #[doc = "One sample bit method"] | 5242 | #[doc = "DE signal is active low"] |
| 6936 | pub const SAMPLE1: Self = Self(0x01); | 5243 | pub const LOW: Self = Self(0x01); |
| 5244 | } | ||
| 5245 | #[repr(transparent)] | ||
| 5246 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5247 | pub struct Abrmod(pub u8); | ||
| 5248 | impl Abrmod { | ||
| 5249 | #[doc = "Measurement of the start bit is used to detect the baud rate"] | ||
| 5250 | pub const START: Self = Self(0); | ||
| 5251 | #[doc = "Falling edge to falling edge measurement"] | ||
| 5252 | pub const EDGE: Self = Self(0x01); | ||
| 5253 | #[doc = "0x7F frame detection"] | ||
| 5254 | pub const FRAME7F: Self = Self(0x02); | ||
| 5255 | #[doc = "0x55 frame detection"] | ||
| 5256 | pub const FRAME55: Self = Self(0x03); | ||
| 6937 | } | 5257 | } |
| 6938 | #[repr(transparent)] | 5258 | #[repr(transparent)] |
| 6939 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 5259 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| @@ -6946,12 +5266,12 @@ pub mod usart_v2 { | |||
| 6946 | } | 5266 | } |
| 6947 | #[repr(transparent)] | 5267 | #[repr(transparent)] |
| 6948 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 5268 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 6949 | pub struct Ps(pub u8); | 5269 | pub struct Msbfirst(pub u8); |
| 6950 | impl Ps { | 5270 | impl Msbfirst { |
| 6951 | #[doc = "Even parity"] | 5271 | #[doc = "data is transmitted/received with data bit 0 first, following the start bit"] |
| 6952 | pub const EVEN: Self = Self(0); | 5272 | pub const LSB: Self = Self(0); |
| 6953 | #[doc = "Odd parity"] | 5273 | #[doc = "data is transmitted/received with MSB (bit 7/8/9) first, following the start bit"] |
| 6954 | pub const ODD: Self = Self(0x01); | 5274 | pub const MSB: Self = Self(0x01); |
| 6955 | } | 5275 | } |
| 6956 | #[repr(transparent)] | 5276 | #[repr(transparent)] |
| 6957 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 5277 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| @@ -6962,57 +5282,30 @@ pub mod usart_v2 { | |||
| 6962 | } | 5282 | } |
| 6963 | #[repr(transparent)] | 5283 | #[repr(transparent)] |
| 6964 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 5284 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 6965 | pub struct Dep(pub u8); | 5285 | pub struct Ddre(pub u8); |
| 6966 | impl Dep { | 5286 | impl Ddre { |
| 6967 | #[doc = "DE signal is active high"] | 5287 | #[doc = "DMA is not disabled in case of reception error"] |
| 6968 | pub const HIGH: Self = Self(0); | 5288 | pub const NOTDISABLED: Self = Self(0); |
| 6969 | #[doc = "DE signal is active low"] | 5289 | #[doc = "DMA is disabled following a reception error"] |
| 6970 | pub const LOW: Self = Self(0x01); | 5290 | pub const DISABLED: Self = Self(0x01); |
| 6971 | } | ||
| 6972 | #[repr(transparent)] | ||
| 6973 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 6974 | pub struct Over(pub u8); | ||
| 6975 | impl Over { | ||
| 6976 | #[doc = "Oversampling by 16"] | ||
| 6977 | pub const OVERSAMPLING16: Self = Self(0); | ||
| 6978 | #[doc = "Oversampling by 8"] | ||
| 6979 | pub const OVERSAMPLING8: Self = Self(0x01); | ||
| 6980 | } | ||
| 6981 | #[repr(transparent)] | ||
| 6982 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 6983 | pub struct Rxfrq(pub u8); | ||
| 6984 | impl Rxfrq { | ||
| 6985 | #[doc = "clears the RXNE flag. This allows to discard the received data without reading it, and avoid an overrun condition"] | ||
| 6986 | pub const DISCARD: Self = Self(0x01); | ||
| 6987 | } | ||
| 6988 | #[repr(transparent)] | ||
| 6989 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 6990 | pub struct Wus(pub u8); | ||
| 6991 | impl Wus { | ||
| 6992 | #[doc = "WUF active on address match"] | ||
| 6993 | pub const ADDRESS: Self = Self(0); | ||
| 6994 | #[doc = "WuF active on Start bit detection"] | ||
| 6995 | pub const START: Self = Self(0x02); | ||
| 6996 | #[doc = "WUF active on RXNE"] | ||
| 6997 | pub const RXNE: Self = Self(0x03); | ||
| 6998 | } | 5291 | } |
| 6999 | #[repr(transparent)] | 5292 | #[repr(transparent)] |
| 7000 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 5293 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 7001 | pub struct Cpol(pub u8); | 5294 | pub struct Datainv(pub u8); |
| 7002 | impl Cpol { | 5295 | impl Datainv { |
| 7003 | #[doc = "Steady low value on CK pin outside transmission window"] | 5296 | #[doc = "Logical data from the data register are send/received in positive/direct logic"] |
| 7004 | pub const LOW: Self = Self(0); | 5297 | pub const POSITIVE: Self = Self(0); |
| 7005 | #[doc = "Steady high value on CK pin outside transmission window"] | 5298 | #[doc = "Logical data from the data register are send/received in negative/inverse logic"] |
| 7006 | pub const HIGH: Self = Self(0x01); | 5299 | pub const NEGATIVE: Self = Self(0x01); |
| 7007 | } | 5300 | } |
| 7008 | #[repr(transparent)] | 5301 | #[repr(transparent)] |
| 7009 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 5302 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 7010 | pub struct Cpha(pub u8); | 5303 | pub struct Onebit(pub u8); |
| 7011 | impl Cpha { | 5304 | impl Onebit { |
| 7012 | #[doc = "The first clock transition is the first data capture edge"] | 5305 | #[doc = "Three sample bit method"] |
| 7013 | pub const FIRST: Self = Self(0); | 5306 | pub const SAMPLE3: Self = Self(0); |
| 7014 | #[doc = "The second clock transition is the first data capture edge"] | 5307 | #[doc = "One sample bit method"] |
| 7015 | pub const SECOND: Self = Self(0x01); | 5308 | pub const SAMPLE1: Self = Self(0x01); |
| 7016 | } | 5309 | } |
| 7017 | #[repr(transparent)] | 5310 | #[repr(transparent)] |
| 7018 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 5311 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| @@ -7025,12 +5318,25 @@ pub mod usart_v2 { | |||
| 7025 | } | 5318 | } |
| 7026 | #[repr(transparent)] | 5319 | #[repr(transparent)] |
| 7027 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 5320 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 7028 | pub struct Irlp(pub u8); | 5321 | pub struct Lbdl(pub u8); |
| 7029 | impl Irlp { | 5322 | impl Lbdl { |
| 7030 | #[doc = "Normal mode"] | 5323 | #[doc = "10-bit break detection"] |
| 7031 | pub const NORMAL: Self = Self(0); | 5324 | pub const BIT10: Self = Self(0); |
| 7032 | #[doc = "Low-power mode"] | 5325 | #[doc = "11-bit break detection"] |
| 7033 | pub const LOWPOWER: Self = Self(0x01); | 5326 | pub const BIT11: Self = Self(0x01); |
| 5327 | } | ||
| 5328 | #[repr(transparent)] | ||
| 5329 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5330 | pub struct Stop(pub u8); | ||
| 5331 | impl Stop { | ||
| 5332 | #[doc = "1 stop bit"] | ||
| 5333 | pub const STOP1: Self = Self(0); | ||
| 5334 | #[doc = "0.5 stop bit"] | ||
| 5335 | pub const STOP0P5: Self = Self(0x01); | ||
| 5336 | #[doc = "2 stop bit"] | ||
| 5337 | pub const STOP2: Self = Self(0x02); | ||
| 5338 | #[doc = "1.5 stop bit"] | ||
| 5339 | pub const STOP1P5: Self = Self(0x03); | ||
| 7034 | } | 5340 | } |
| 7035 | #[repr(transparent)] | 5341 | #[repr(transparent)] |
| 7036 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 5342 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| @@ -7041,75 +5347,59 @@ pub mod usart_v2 { | |||
| 7041 | } | 5347 | } |
| 7042 | #[repr(transparent)] | 5348 | #[repr(transparent)] |
| 7043 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 5349 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 7044 | pub struct Lbcl(pub u8); | 5350 | pub struct Hdsel(pub u8); |
| 7045 | impl Lbcl { | 5351 | impl Hdsel { |
| 7046 | #[doc = "The clock pulse of the last data bit is not output to the CK pin"] | 5352 | #[doc = "Half duplex mode is not selected"] |
| 7047 | pub const NOTOUTPUT: Self = Self(0); | 5353 | pub const NOTSELECTED: Self = Self(0); |
| 7048 | #[doc = "The clock pulse of the last data bit is output to the CK pin"] | 5354 | #[doc = "Half duplex mode is selected"] |
| 7049 | pub const OUTPUT: Self = Self(0x01); | 5355 | pub const SELECTED: Self = Self(0x01); |
| 7050 | } | ||
| 7051 | #[repr(transparent)] | ||
| 7052 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7053 | pub struct Mmrq(pub u8); | ||
| 7054 | impl Mmrq { | ||
| 7055 | #[doc = "Puts the USART in mute mode and sets the RWU flag"] | ||
| 7056 | pub const MUTE: Self = Self(0x01); | ||
| 7057 | } | ||
| 7058 | #[repr(transparent)] | ||
| 7059 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7060 | pub struct Txfrq(pub u8); | ||
| 7061 | impl Txfrq { | ||
| 7062 | #[doc = "Set the TXE flags. This allows to discard the transmit data"] | ||
| 7063 | pub const DISCARD: Self = Self(0x01); | ||
| 7064 | } | 5356 | } |
| 7065 | #[repr(transparent)] | 5357 | #[repr(transparent)] |
| 7066 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 5358 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 7067 | pub struct Rxinv(pub u8); | 5359 | pub struct Cpha(pub u8); |
| 7068 | impl Rxinv { | 5360 | impl Cpha { |
| 7069 | #[doc = "RX pin signal works using the standard logic levels"] | 5361 | #[doc = "The first clock transition is the first data capture edge"] |
| 7070 | pub const STANDARD: Self = Self(0); | 5362 | pub const FIRST: Self = Self(0); |
| 7071 | #[doc = "RX pin signal values are inverted"] | 5363 | #[doc = "The second clock transition is the first data capture edge"] |
| 7072 | pub const INVERTED: Self = Self(0x01); | 5364 | pub const SECOND: Self = Self(0x01); |
| 7073 | } | 5365 | } |
| 7074 | #[repr(transparent)] | 5366 | #[repr(transparent)] |
| 7075 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 5367 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 7076 | pub struct M1(pub u8); | 5368 | pub struct Addm(pub u8); |
| 7077 | impl M1 { | 5369 | impl Addm { |
| 7078 | #[doc = "Use M0 to set the data bits"] | 5370 | #[doc = "4-bit address detection"] |
| 7079 | pub const M0: Self = Self(0); | 5371 | pub const BIT4: Self = Self(0); |
| 7080 | #[doc = "1 start bit, 7 data bits, n stop bits"] | 5372 | #[doc = "7-bit address detection"] |
| 7081 | pub const BIT7: Self = Self(0x01); | 5373 | pub const BIT7: Self = Self(0x01); |
| 7082 | } | 5374 | } |
| 7083 | #[repr(transparent)] | 5375 | #[repr(transparent)] |
| 7084 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 5376 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 7085 | pub struct Stop(pub u8); | 5377 | pub struct Wus(pub u8); |
| 7086 | impl Stop { | 5378 | impl Wus { |
| 7087 | #[doc = "1 stop bit"] | 5379 | #[doc = "WUF active on address match"] |
| 7088 | pub const STOP1: Self = Self(0); | 5380 | pub const ADDRESS: Self = Self(0); |
| 7089 | #[doc = "0.5 stop bit"] | 5381 | #[doc = "WuF active on Start bit detection"] |
| 7090 | pub const STOP0P5: Self = Self(0x01); | 5382 | pub const START: Self = Self(0x02); |
| 7091 | #[doc = "2 stop bit"] | 5383 | #[doc = "WUF active on RXNE"] |
| 7092 | pub const STOP2: Self = Self(0x02); | 5384 | pub const RXNE: Self = Self(0x03); |
| 7093 | #[doc = "1.5 stop bit"] | ||
| 7094 | pub const STOP1P5: Self = Self(0x03); | ||
| 7095 | } | 5385 | } |
| 7096 | #[repr(transparent)] | 5386 | #[repr(transparent)] |
| 7097 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 5387 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 7098 | pub struct Lbdl(pub u8); | 5388 | pub struct Over(pub u8); |
| 7099 | impl Lbdl { | 5389 | impl Over { |
| 7100 | #[doc = "10-bit break detection"] | 5390 | #[doc = "Oversampling by 16"] |
| 7101 | pub const BIT10: Self = Self(0); | 5391 | pub const OVERSAMPLING16: Self = Self(0); |
| 7102 | #[doc = "11-bit break detection"] | 5392 | #[doc = "Oversampling by 8"] |
| 7103 | pub const BIT11: Self = Self(0x01); | 5393 | pub const OVERSAMPLING8: Self = Self(0x01); |
| 7104 | } | 5394 | } |
| 7105 | #[repr(transparent)] | 5395 | #[repr(transparent)] |
| 7106 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 5396 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 7107 | pub struct Addm(pub u8); | 5397 | pub struct Cpol(pub u8); |
| 7108 | impl Addm { | 5398 | impl Cpol { |
| 7109 | #[doc = "4-bit address detection"] | 5399 | #[doc = "Steady low value on CK pin outside transmission window"] |
| 7110 | pub const BIT4: Self = Self(0); | 5400 | pub const LOW: Self = Self(0); |
| 7111 | #[doc = "7-bit address detection"] | 5401 | #[doc = "Steady high value on CK pin outside transmission window"] |
| 7112 | pub const BIT7: Self = Self(0x01); | 5402 | pub const HIGH: Self = Self(0x01); |
| 7113 | } | 5403 | } |
| 7114 | #[repr(transparent)] | 5404 | #[repr(transparent)] |
| 7115 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 5405 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| @@ -7122,97 +5412,64 @@ pub mod usart_v2 { | |||
| 7122 | } | 5412 | } |
| 7123 | #[repr(transparent)] | 5413 | #[repr(transparent)] |
| 7124 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 5414 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 7125 | pub struct Hdsel(pub u8); | 5415 | pub struct Ovrdis(pub u8); |
| 7126 | impl Hdsel { | 5416 | impl Ovrdis { |
| 7127 | #[doc = "Half duplex mode is not selected"] | 5417 | #[doc = "Overrun Error Flag, ORE, is set when received data is not read before receiving new data"] |
| 7128 | pub const NOTSELECTED: Self = Self(0); | 5418 | pub const ENABLED: Self = Self(0); |
| 7129 | #[doc = "Half duplex mode is selected"] | 5419 | #[doc = "Overrun functionality is disabled. If new data is received while the RXNE flag is still set the ORE flag is not set and the new received data overwrites the previous content of the RDR register"] |
| 7130 | pub const SELECTED: Self = Self(0x01); | 5420 | pub const DISABLED: Self = Self(0x01); |
| 7131 | } | 5421 | } |
| 7132 | #[repr(transparent)] | 5422 | #[repr(transparent)] |
| 7133 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 5423 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 7134 | pub struct Abrmod(pub u8); | 5424 | pub struct Rxinv(pub u8); |
| 7135 | impl Abrmod { | 5425 | impl Rxinv { |
| 7136 | #[doc = "Measurement of the start bit is used to detect the baud rate"] | 5426 | #[doc = "RX pin signal works using the standard logic levels"] |
| 7137 | pub const START: Self = Self(0); | 5427 | pub const STANDARD: Self = Self(0); |
| 7138 | #[doc = "Falling edge to falling edge measurement"] | 5428 | #[doc = "RX pin signal values are inverted"] |
| 7139 | pub const EDGE: Self = Self(0x01); | 5429 | pub const INVERTED: Self = Self(0x01); |
| 7140 | #[doc = "0x7F frame detection"] | ||
| 7141 | pub const FRAME7F: Self = Self(0x02); | ||
| 7142 | #[doc = "0x55 frame detection"] | ||
| 7143 | pub const FRAME55: Self = Self(0x03); | ||
| 7144 | } | 5430 | } |
| 7145 | #[repr(transparent)] | 5431 | #[repr(transparent)] |
| 7146 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 5432 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 7147 | pub struct Msbfirst(pub u8); | 5433 | pub struct Irlp(pub u8); |
| 7148 | impl Msbfirst { | 5434 | impl Irlp { |
| 7149 | #[doc = "data is transmitted/received with data bit 0 first, following the start bit"] | 5435 | #[doc = "Normal mode"] |
| 7150 | pub const LSB: Self = Self(0); | 5436 | pub const NORMAL: Self = Self(0); |
| 7151 | #[doc = "data is transmitted/received with MSB (bit 7/8/9) first, following the start bit"] | 5437 | #[doc = "Low-power mode"] |
| 7152 | pub const MSB: Self = Self(0x01); | 5438 | pub const LOWPOWER: Self = Self(0x01); |
| 7153 | } | 5439 | } |
| 7154 | } | ||
| 7155 | pub mod regs { | ||
| 7156 | use crate::generic::*; | ||
| 7157 | #[doc = "Guard time and prescaler register"] | ||
| 7158 | #[repr(transparent)] | 5440 | #[repr(transparent)] |
| 7159 | #[derive(Copy, Clone, Eq, PartialEq)] | 5441 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 7160 | pub struct Gtpr(pub u32); | 5442 | pub struct Lbcl(pub u8); |
| 7161 | impl Gtpr { | 5443 | impl Lbcl { |
| 7162 | #[doc = "Prescaler value"] | 5444 | #[doc = "The clock pulse of the last data bit is not output to the CK pin"] |
| 7163 | pub const fn psc(&self) -> u8 { | 5445 | pub const NOTOUTPUT: Self = Self(0); |
| 7164 | let val = (self.0 >> 0usize) & 0xff; | 5446 | #[doc = "The clock pulse of the last data bit is output to the CK pin"] |
| 7165 | val as u8 | 5447 | pub const OUTPUT: Self = Self(0x01); |
| 7166 | } | ||
| 7167 | #[doc = "Prescaler value"] | ||
| 7168 | pub fn set_psc(&mut self, val: u8) { | ||
| 7169 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | ||
| 7170 | } | ||
| 7171 | #[doc = "Guard time value"] | ||
| 7172 | pub const fn gt(&self) -> u8 { | ||
| 7173 | let val = (self.0 >> 8usize) & 0xff; | ||
| 7174 | val as u8 | ||
| 7175 | } | ||
| 7176 | #[doc = "Guard time value"] | ||
| 7177 | pub fn set_gt(&mut self, val: u8) { | ||
| 7178 | self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize); | ||
| 7179 | } | ||
| 7180 | } | 5448 | } |
| 7181 | impl Default for Gtpr { | 5449 | #[repr(transparent)] |
| 7182 | fn default() -> Gtpr { | 5450 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 7183 | Gtpr(0) | 5451 | pub struct Txfrq(pub u8); |
| 7184 | } | 5452 | impl Txfrq { |
| 5453 | #[doc = "Set the TXE flags. This allows to discard the transmit data"] | ||
| 5454 | pub const DISCARD: Self = Self(0x01); | ||
| 7185 | } | 5455 | } |
| 7186 | #[doc = "Receiver timeout register"] | ||
| 7187 | #[repr(transparent)] | 5456 | #[repr(transparent)] |
| 7188 | #[derive(Copy, Clone, Eq, PartialEq)] | 5457 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 7189 | pub struct Rtor(pub u32); | 5458 | pub struct Mmrq(pub u8); |
| 7190 | impl Rtor { | 5459 | impl Mmrq { |
| 7191 | #[doc = "Receiver timeout value"] | 5460 | #[doc = "Puts the USART in mute mode and sets the RWU flag"] |
| 7192 | pub const fn rto(&self) -> u32 { | 5461 | pub const MUTE: Self = Self(0x01); |
| 7193 | let val = (self.0 >> 0usize) & 0x00ff_ffff; | ||
| 7194 | val as u32 | ||
| 7195 | } | ||
| 7196 | #[doc = "Receiver timeout value"] | ||
| 7197 | pub fn set_rto(&mut self, val: u32) { | ||
| 7198 | self.0 = | ||
| 7199 | (self.0 & !(0x00ff_ffff << 0usize)) | (((val as u32) & 0x00ff_ffff) << 0usize); | ||
| 7200 | } | ||
| 7201 | #[doc = "Block Length"] | ||
| 7202 | pub const fn blen(&self) -> u8 { | ||
| 7203 | let val = (self.0 >> 24usize) & 0xff; | ||
| 7204 | val as u8 | ||
| 7205 | } | ||
| 7206 | #[doc = "Block Length"] | ||
| 7207 | pub fn set_blen(&mut self, val: u8) { | ||
| 7208 | self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize); | ||
| 7209 | } | ||
| 7210 | } | 5462 | } |
| 7211 | impl Default for Rtor { | 5463 | #[repr(transparent)] |
| 7212 | fn default() -> Rtor { | 5464 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 7213 | Rtor(0) | 5465 | pub struct Rxfrq(pub u8); |
| 7214 | } | 5466 | impl Rxfrq { |
| 5467 | #[doc = "clears the RXNE flag. This allows to discard the received data without reading it, and avoid an overrun condition"] | ||
| 5468 | pub const DISCARD: Self = Self(0x01); | ||
| 7215 | } | 5469 | } |
| 5470 | } | ||
| 5471 | pub mod regs { | ||
| 5472 | use crate::generic::*; | ||
| 7216 | #[doc = "Baud rate register"] | 5473 | #[doc = "Baud rate register"] |
| 7217 | #[repr(transparent)] | 5474 | #[repr(transparent)] |
| 7218 | #[derive(Copy, Clone, Eq, PartialEq)] | 5475 | #[derive(Copy, Clone, Eq, PartialEq)] |
| @@ -7233,24 +5490,264 @@ pub mod usart_v2 { | |||
| 7233 | Brr(0) | 5490 | Brr(0) |
| 7234 | } | 5491 | } |
| 7235 | } | 5492 | } |
| 7236 | #[doc = "Data register"] | 5493 | #[doc = "Control register 1"] |
| 7237 | #[repr(transparent)] | 5494 | #[repr(transparent)] |
| 7238 | #[derive(Copy, Clone, Eq, PartialEq)] | 5495 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 7239 | pub struct Dr(pub u32); | 5496 | pub struct Cr1(pub u32); |
| 7240 | impl Dr { | 5497 | impl Cr1 { |
| 7241 | #[doc = "data value"] | 5498 | #[doc = "USART enable"] |
| 7242 | pub const fn dr(&self) -> u16 { | 5499 | pub const fn ue(&self) -> bool { |
| 7243 | let val = (self.0 >> 0usize) & 0x01ff; | 5500 | let val = (self.0 >> 0usize) & 0x01; |
| 7244 | val as u16 | 5501 | val != 0 |
| 7245 | } | 5502 | } |
| 7246 | #[doc = "data value"] | 5503 | #[doc = "USART enable"] |
| 7247 | pub fn set_dr(&mut self, val: u16) { | 5504 | pub fn set_ue(&mut self, val: bool) { |
| 7248 | self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize); | 5505 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 5506 | } | ||
| 5507 | #[doc = "USART enable in Stop mode"] | ||
| 5508 | pub const fn uesm(&self) -> bool { | ||
| 5509 | let val = (self.0 >> 1usize) & 0x01; | ||
| 5510 | val != 0 | ||
| 5511 | } | ||
| 5512 | #[doc = "USART enable in Stop mode"] | ||
| 5513 | pub fn set_uesm(&mut self, val: bool) { | ||
| 5514 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | ||
| 5515 | } | ||
| 5516 | #[doc = "Receiver enable"] | ||
| 5517 | pub const fn re(&self) -> bool { | ||
| 5518 | let val = (self.0 >> 2usize) & 0x01; | ||
| 5519 | val != 0 | ||
| 5520 | } | ||
| 5521 | #[doc = "Receiver enable"] | ||
| 5522 | pub fn set_re(&mut self, val: bool) { | ||
| 5523 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 5524 | } | ||
| 5525 | #[doc = "Transmitter enable"] | ||
| 5526 | pub const fn te(&self) -> bool { | ||
| 5527 | let val = (self.0 >> 3usize) & 0x01; | ||
| 5528 | val != 0 | ||
| 5529 | } | ||
| 5530 | #[doc = "Transmitter enable"] | ||
| 5531 | pub fn set_te(&mut self, val: bool) { | ||
| 5532 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | ||
| 5533 | } | ||
| 5534 | #[doc = "IDLE interrupt enable"] | ||
| 5535 | pub const fn idleie(&self) -> bool { | ||
| 5536 | let val = (self.0 >> 4usize) & 0x01; | ||
| 5537 | val != 0 | ||
| 5538 | } | ||
| 5539 | #[doc = "IDLE interrupt enable"] | ||
| 5540 | pub fn set_idleie(&mut self, val: bool) { | ||
| 5541 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | ||
| 5542 | } | ||
| 5543 | #[doc = "RXNE interrupt enable"] | ||
| 5544 | pub const fn rxneie(&self) -> bool { | ||
| 5545 | let val = (self.0 >> 5usize) & 0x01; | ||
| 5546 | val != 0 | ||
| 5547 | } | ||
| 5548 | #[doc = "RXNE interrupt enable"] | ||
| 5549 | pub fn set_rxneie(&mut self, val: bool) { | ||
| 5550 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 5551 | } | ||
| 5552 | #[doc = "Transmission complete interrupt enable"] | ||
| 5553 | pub const fn tcie(&self) -> bool { | ||
| 5554 | let val = (self.0 >> 6usize) & 0x01; | ||
| 5555 | val != 0 | ||
| 5556 | } | ||
| 5557 | #[doc = "Transmission complete interrupt enable"] | ||
| 5558 | pub fn set_tcie(&mut self, val: bool) { | ||
| 5559 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 5560 | } | ||
| 5561 | #[doc = "interrupt enable"] | ||
| 5562 | pub const fn txeie(&self) -> bool { | ||
| 5563 | let val = (self.0 >> 7usize) & 0x01; | ||
| 5564 | val != 0 | ||
| 5565 | } | ||
| 5566 | #[doc = "interrupt enable"] | ||
| 5567 | pub fn set_txeie(&mut self, val: bool) { | ||
| 5568 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 5569 | } | ||
| 5570 | #[doc = "PE interrupt enable"] | ||
| 5571 | pub const fn peie(&self) -> bool { | ||
| 5572 | let val = (self.0 >> 8usize) & 0x01; | ||
| 5573 | val != 0 | ||
| 5574 | } | ||
| 5575 | #[doc = "PE interrupt enable"] | ||
| 5576 | pub fn set_peie(&mut self, val: bool) { | ||
| 5577 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 5578 | } | ||
| 5579 | #[doc = "Parity selection"] | ||
| 5580 | pub const fn ps(&self) -> super::vals::Ps { | ||
| 5581 | let val = (self.0 >> 9usize) & 0x01; | ||
| 5582 | super::vals::Ps(val as u8) | ||
| 5583 | } | ||
| 5584 | #[doc = "Parity selection"] | ||
| 5585 | pub fn set_ps(&mut self, val: super::vals::Ps) { | ||
| 5586 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | ||
| 5587 | } | ||
| 5588 | #[doc = "Parity control enable"] | ||
| 5589 | pub const fn pce(&self) -> bool { | ||
| 5590 | let val = (self.0 >> 10usize) & 0x01; | ||
| 5591 | val != 0 | ||
| 5592 | } | ||
| 5593 | #[doc = "Parity control enable"] | ||
| 5594 | pub fn set_pce(&mut self, val: bool) { | ||
| 5595 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | ||
| 5596 | } | ||
| 5597 | #[doc = "Receiver wakeup method"] | ||
| 5598 | pub const fn wake(&self) -> bool { | ||
| 5599 | let val = (self.0 >> 11usize) & 0x01; | ||
| 5600 | val != 0 | ||
| 5601 | } | ||
| 5602 | #[doc = "Receiver wakeup method"] | ||
| 5603 | pub fn set_wake(&mut self, val: bool) { | ||
| 5604 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); | ||
| 5605 | } | ||
| 5606 | #[doc = "Word length"] | ||
| 5607 | pub const fn m0(&self) -> super::vals::M0 { | ||
| 5608 | let val = (self.0 >> 12usize) & 0x01; | ||
| 5609 | super::vals::M0(val as u8) | ||
| 5610 | } | ||
| 5611 | #[doc = "Word length"] | ||
| 5612 | pub fn set_m0(&mut self, val: super::vals::M0) { | ||
| 5613 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 5614 | } | ||
| 5615 | #[doc = "Word length"] | ||
| 5616 | pub const fn m1(&self) -> super::vals::M1 { | ||
| 5617 | let val = (self.0 >> 12usize) & 0x01; | ||
| 5618 | super::vals::M1(val as u8) | ||
| 5619 | } | ||
| 5620 | #[doc = "Word length"] | ||
| 5621 | pub fn set_m1(&mut self, val: super::vals::M1) { | ||
| 5622 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 5623 | } | ||
| 5624 | #[doc = "Mute mode enable"] | ||
| 5625 | pub const fn mme(&self) -> bool { | ||
| 5626 | let val = (self.0 >> 13usize) & 0x01; | ||
| 5627 | val != 0 | ||
| 5628 | } | ||
| 5629 | #[doc = "Mute mode enable"] | ||
| 5630 | pub fn set_mme(&mut self, val: bool) { | ||
| 5631 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | ||
| 5632 | } | ||
| 5633 | #[doc = "Character match interrupt enable"] | ||
| 5634 | pub const fn cmie(&self) -> bool { | ||
| 5635 | let val = (self.0 >> 14usize) & 0x01; | ||
| 5636 | val != 0 | ||
| 5637 | } | ||
| 5638 | #[doc = "Character match interrupt enable"] | ||
| 5639 | pub fn set_cmie(&mut self, val: bool) { | ||
| 5640 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | ||
| 5641 | } | ||
| 5642 | #[doc = "Oversampling mode"] | ||
| 5643 | pub fn over(&self, n: usize) -> super::vals::Over { | ||
| 5644 | assert!(n < 1usize); | ||
| 5645 | let offs = 15usize + n * 0usize; | ||
| 5646 | let val = (self.0 >> offs) & 0x01; | ||
| 5647 | super::vals::Over(val as u8) | ||
| 5648 | } | ||
| 5649 | #[doc = "Oversampling mode"] | ||
| 5650 | pub fn set_over(&mut self, n: usize, val: super::vals::Over) { | ||
| 5651 | assert!(n < 1usize); | ||
| 5652 | let offs = 15usize + n * 0usize; | ||
| 5653 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 5654 | } | ||
| 5655 | #[doc = "Driver Enable deassertion time"] | ||
| 5656 | pub const fn dedt(&self) -> u8 { | ||
| 5657 | let val = (self.0 >> 16usize) & 0x1f; | ||
| 5658 | val as u8 | ||
| 5659 | } | ||
| 5660 | #[doc = "Driver Enable deassertion time"] | ||
| 5661 | pub fn set_dedt(&mut self, val: u8) { | ||
| 5662 | self.0 = (self.0 & !(0x1f << 16usize)) | (((val as u32) & 0x1f) << 16usize); | ||
| 5663 | } | ||
| 5664 | #[doc = "Driver Enable assertion time"] | ||
| 5665 | pub const fn deat(&self) -> u8 { | ||
| 5666 | let val = (self.0 >> 21usize) & 0x1f; | ||
| 5667 | val as u8 | ||
| 5668 | } | ||
| 5669 | #[doc = "Driver Enable assertion time"] | ||
| 5670 | pub fn set_deat(&mut self, val: u8) { | ||
| 5671 | self.0 = (self.0 & !(0x1f << 21usize)) | (((val as u32) & 0x1f) << 21usize); | ||
| 5672 | } | ||
| 5673 | #[doc = "Receiver timeout interrupt enable"] | ||
| 5674 | pub const fn rtoie(&self) -> bool { | ||
| 5675 | let val = (self.0 >> 26usize) & 0x01; | ||
| 5676 | val != 0 | ||
| 5677 | } | ||
| 5678 | #[doc = "Receiver timeout interrupt enable"] | ||
| 5679 | pub fn set_rtoie(&mut self, val: bool) { | ||
| 5680 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); | ||
| 5681 | } | ||
| 5682 | #[doc = "End of Block interrupt enable"] | ||
| 5683 | pub const fn eobie(&self) -> bool { | ||
| 5684 | let val = (self.0 >> 27usize) & 0x01; | ||
| 5685 | val != 0 | ||
| 5686 | } | ||
| 5687 | #[doc = "End of Block interrupt enable"] | ||
| 5688 | pub fn set_eobie(&mut self, val: bool) { | ||
| 5689 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize); | ||
| 7249 | } | 5690 | } |
| 7250 | } | 5691 | } |
| 7251 | impl Default for Dr { | 5692 | impl Default for Cr1 { |
| 7252 | fn default() -> Dr { | 5693 | fn default() -> Cr1 { |
| 7253 | Dr(0) | 5694 | Cr1(0) |
| 5695 | } | ||
| 5696 | } | ||
| 5697 | #[doc = "Request register"] | ||
| 5698 | #[repr(transparent)] | ||
| 5699 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5700 | pub struct Rqr(pub u32); | ||
| 5701 | impl Rqr { | ||
| 5702 | #[doc = "Auto baud rate request"] | ||
| 5703 | pub const fn abrrq(&self) -> super::vals::Abrrq { | ||
| 5704 | let val = (self.0 >> 0usize) & 0x01; | ||
| 5705 | super::vals::Abrrq(val as u8) | ||
| 5706 | } | ||
| 5707 | #[doc = "Auto baud rate request"] | ||
| 5708 | pub fn set_abrrq(&mut self, val: super::vals::Abrrq) { | ||
| 5709 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 5710 | } | ||
| 5711 | #[doc = "Send break request"] | ||
| 5712 | pub const fn sbkrq(&self) -> super::vals::Sbkrq { | ||
| 5713 | let val = (self.0 >> 1usize) & 0x01; | ||
| 5714 | super::vals::Sbkrq(val as u8) | ||
| 5715 | } | ||
| 5716 | #[doc = "Send break request"] | ||
| 5717 | pub fn set_sbkrq(&mut self, val: super::vals::Sbkrq) { | ||
| 5718 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 5719 | } | ||
| 5720 | #[doc = "Mute mode request"] | ||
| 5721 | pub const fn mmrq(&self) -> super::vals::Mmrq { | ||
| 5722 | let val = (self.0 >> 2usize) & 0x01; | ||
| 5723 | super::vals::Mmrq(val as u8) | ||
| 5724 | } | ||
| 5725 | #[doc = "Mute mode request"] | ||
| 5726 | pub fn set_mmrq(&mut self, val: super::vals::Mmrq) { | ||
| 5727 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 5728 | } | ||
| 5729 | #[doc = "Receive data flush request"] | ||
| 5730 | pub const fn rxfrq(&self) -> super::vals::Rxfrq { | ||
| 5731 | let val = (self.0 >> 3usize) & 0x01; | ||
| 5732 | super::vals::Rxfrq(val as u8) | ||
| 5733 | } | ||
| 5734 | #[doc = "Receive data flush request"] | ||
| 5735 | pub fn set_rxfrq(&mut self, val: super::vals::Rxfrq) { | ||
| 5736 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 5737 | } | ||
| 5738 | #[doc = "Transmit data flush request"] | ||
| 5739 | pub const fn txfrq(&self) -> super::vals::Txfrq { | ||
| 5740 | let val = (self.0 >> 4usize) & 0x01; | ||
| 5741 | super::vals::Txfrq(val as u8) | ||
| 5742 | } | ||
| 5743 | #[doc = "Transmit data flush request"] | ||
| 5744 | pub fn set_txfrq(&mut self, val: super::vals::Txfrq) { | ||
| 5745 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 5746 | } | ||
| 5747 | } | ||
| 5748 | impl Default for Rqr { | ||
| 5749 | fn default() -> Rqr { | ||
| 5750 | Rqr(0) | ||
| 7254 | } | 5751 | } |
| 7255 | } | 5752 | } |
| 7256 | #[doc = "Control register 2"] | 5753 | #[doc = "Control register 2"] |
| @@ -7430,208 +5927,186 @@ pub mod usart_v2 { | |||
| 7430 | Cr2(0) | 5927 | Cr2(0) |
| 7431 | } | 5928 | } |
| 7432 | } | 5929 | } |
| 7433 | #[doc = "Control register 1"] | 5930 | #[doc = "Control register 3"] |
| 7434 | #[repr(transparent)] | 5931 | #[repr(transparent)] |
| 7435 | #[derive(Copy, Clone, Eq, PartialEq)] | 5932 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 7436 | pub struct Cr1(pub u32); | 5933 | pub struct Cr3(pub u32); |
| 7437 | impl Cr1 { | 5934 | impl Cr3 { |
| 7438 | #[doc = "USART enable"] | 5935 | #[doc = "Error interrupt enable"] |
| 7439 | pub const fn ue(&self) -> bool { | 5936 | pub const fn eie(&self) -> bool { |
| 7440 | let val = (self.0 >> 0usize) & 0x01; | 5937 | let val = (self.0 >> 0usize) & 0x01; |
| 7441 | val != 0 | 5938 | val != 0 |
| 7442 | } | 5939 | } |
| 7443 | #[doc = "USART enable"] | 5940 | #[doc = "Error interrupt enable"] |
| 7444 | pub fn set_ue(&mut self, val: bool) { | 5941 | pub fn set_eie(&mut self, val: bool) { |
| 7445 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 5942 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 7446 | } | 5943 | } |
| 7447 | #[doc = "USART enable in Stop mode"] | 5944 | #[doc = "IrDA mode enable"] |
| 7448 | pub const fn uesm(&self) -> bool { | 5945 | pub const fn iren(&self) -> bool { |
| 7449 | let val = (self.0 >> 1usize) & 0x01; | 5946 | let val = (self.0 >> 1usize) & 0x01; |
| 7450 | val != 0 | 5947 | val != 0 |
| 7451 | } | 5948 | } |
| 7452 | #[doc = "USART enable in Stop mode"] | 5949 | #[doc = "IrDA mode enable"] |
| 7453 | pub fn set_uesm(&mut self, val: bool) { | 5950 | pub fn set_iren(&mut self, val: bool) { |
| 7454 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 5951 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 7455 | } | 5952 | } |
| 7456 | #[doc = "Receiver enable"] | 5953 | #[doc = "IrDA low-power"] |
| 7457 | pub const fn re(&self) -> bool { | 5954 | pub const fn irlp(&self) -> super::vals::Irlp { |
| 7458 | let val = (self.0 >> 2usize) & 0x01; | 5955 | let val = (self.0 >> 2usize) & 0x01; |
| 7459 | val != 0 | 5956 | super::vals::Irlp(val as u8) |
| 7460 | } | 5957 | } |
| 7461 | #[doc = "Receiver enable"] | 5958 | #[doc = "IrDA low-power"] |
| 7462 | pub fn set_re(&mut self, val: bool) { | 5959 | pub fn set_irlp(&mut self, val: super::vals::Irlp) { |
| 7463 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 5960 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); |
| 7464 | } | 5961 | } |
| 7465 | #[doc = "Transmitter enable"] | 5962 | #[doc = "Half-duplex selection"] |
| 7466 | pub const fn te(&self) -> bool { | 5963 | pub const fn hdsel(&self) -> super::vals::Hdsel { |
| 7467 | let val = (self.0 >> 3usize) & 0x01; | 5964 | let val = (self.0 >> 3usize) & 0x01; |
| 7468 | val != 0 | 5965 | super::vals::Hdsel(val as u8) |
| 7469 | } | 5966 | } |
| 7470 | #[doc = "Transmitter enable"] | 5967 | #[doc = "Half-duplex selection"] |
| 7471 | pub fn set_te(&mut self, val: bool) { | 5968 | pub fn set_hdsel(&mut self, val: super::vals::Hdsel) { |
| 7472 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 5969 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); |
| 7473 | } | 5970 | } |
| 7474 | #[doc = "IDLE interrupt enable"] | 5971 | #[doc = "Smartcard NACK enable"] |
| 7475 | pub const fn idleie(&self) -> bool { | 5972 | pub const fn nack(&self) -> bool { |
| 7476 | let val = (self.0 >> 4usize) & 0x01; | 5973 | let val = (self.0 >> 4usize) & 0x01; |
| 7477 | val != 0 | 5974 | val != 0 |
| 7478 | } | 5975 | } |
| 7479 | #[doc = "IDLE interrupt enable"] | 5976 | #[doc = "Smartcard NACK enable"] |
| 7480 | pub fn set_idleie(&mut self, val: bool) { | 5977 | pub fn set_nack(&mut self, val: bool) { |
| 7481 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 5978 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 7482 | } | 5979 | } |
| 7483 | #[doc = "RXNE interrupt enable"] | 5980 | #[doc = "Smartcard mode enable"] |
| 7484 | pub const fn rxneie(&self) -> bool { | 5981 | pub const fn scen(&self) -> bool { |
| 7485 | let val = (self.0 >> 5usize) & 0x01; | 5982 | let val = (self.0 >> 5usize) & 0x01; |
| 7486 | val != 0 | 5983 | val != 0 |
| 7487 | } | 5984 | } |
| 7488 | #[doc = "RXNE interrupt enable"] | 5985 | #[doc = "Smartcard mode enable"] |
| 7489 | pub fn set_rxneie(&mut self, val: bool) { | 5986 | pub fn set_scen(&mut self, val: bool) { |
| 7490 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 5987 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 7491 | } | 5988 | } |
| 7492 | #[doc = "Transmission complete interrupt enable"] | 5989 | #[doc = "DMA enable receiver"] |
| 7493 | pub const fn tcie(&self) -> bool { | 5990 | pub const fn dmar(&self) -> bool { |
| 7494 | let val = (self.0 >> 6usize) & 0x01; | 5991 | let val = (self.0 >> 6usize) & 0x01; |
| 7495 | val != 0 | 5992 | val != 0 |
| 7496 | } | 5993 | } |
| 7497 | #[doc = "Transmission complete interrupt enable"] | 5994 | #[doc = "DMA enable receiver"] |
| 7498 | pub fn set_tcie(&mut self, val: bool) { | 5995 | pub fn set_dmar(&mut self, val: bool) { |
| 7499 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 5996 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 7500 | } | 5997 | } |
| 7501 | #[doc = "interrupt enable"] | 5998 | #[doc = "DMA enable transmitter"] |
| 7502 | pub const fn txeie(&self) -> bool { | 5999 | pub const fn dmat(&self) -> bool { |
| 7503 | let val = (self.0 >> 7usize) & 0x01; | 6000 | let val = (self.0 >> 7usize) & 0x01; |
| 7504 | val != 0 | 6001 | val != 0 |
| 7505 | } | 6002 | } |
| 7506 | #[doc = "interrupt enable"] | 6003 | #[doc = "DMA enable transmitter"] |
| 7507 | pub fn set_txeie(&mut self, val: bool) { | 6004 | pub fn set_dmat(&mut self, val: bool) { |
| 7508 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 6005 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 7509 | } | 6006 | } |
| 7510 | #[doc = "PE interrupt enable"] | 6007 | #[doc = "RTS enable"] |
| 7511 | pub const fn peie(&self) -> bool { | 6008 | pub const fn rtse(&self) -> bool { |
| 7512 | let val = (self.0 >> 8usize) & 0x01; | 6009 | let val = (self.0 >> 8usize) & 0x01; |
| 7513 | val != 0 | 6010 | val != 0 |
| 7514 | } | 6011 | } |
| 7515 | #[doc = "PE interrupt enable"] | 6012 | #[doc = "RTS enable"] |
| 7516 | pub fn set_peie(&mut self, val: bool) { | 6013 | pub fn set_rtse(&mut self, val: bool) { |
| 7517 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 6014 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 7518 | } | 6015 | } |
| 7519 | #[doc = "Parity selection"] | 6016 | #[doc = "CTS enable"] |
| 7520 | pub const fn ps(&self) -> super::vals::Ps { | 6017 | pub const fn ctse(&self) -> bool { |
| 7521 | let val = (self.0 >> 9usize) & 0x01; | 6018 | let val = (self.0 >> 9usize) & 0x01; |
| 7522 | super::vals::Ps(val as u8) | 6019 | val != 0 |
| 7523 | } | 6020 | } |
| 7524 | #[doc = "Parity selection"] | 6021 | #[doc = "CTS enable"] |
| 7525 | pub fn set_ps(&mut self, val: super::vals::Ps) { | 6022 | pub fn set_ctse(&mut self, val: bool) { |
| 7526 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | 6023 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); |
| 7527 | } | 6024 | } |
| 7528 | #[doc = "Parity control enable"] | 6025 | #[doc = "CTS interrupt enable"] |
| 7529 | pub const fn pce(&self) -> bool { | 6026 | pub const fn ctsie(&self) -> bool { |
| 7530 | let val = (self.0 >> 10usize) & 0x01; | 6027 | let val = (self.0 >> 10usize) & 0x01; |
| 7531 | val != 0 | 6028 | val != 0 |
| 7532 | } | 6029 | } |
| 7533 | #[doc = "Parity control enable"] | 6030 | #[doc = "CTS interrupt enable"] |
| 7534 | pub fn set_pce(&mut self, val: bool) { | 6031 | pub fn set_ctsie(&mut self, val: bool) { |
| 7535 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | 6032 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); |
| 7536 | } | 6033 | } |
| 7537 | #[doc = "Receiver wakeup method"] | 6034 | #[doc = "One sample bit method enable"] |
| 7538 | pub const fn wake(&self) -> bool { | 6035 | pub const fn onebit(&self) -> super::vals::Onebit { |
| 7539 | let val = (self.0 >> 11usize) & 0x01; | 6036 | let val = (self.0 >> 11usize) & 0x01; |
| 7540 | val != 0 | 6037 | super::vals::Onebit(val as u8) |
| 7541 | } | ||
| 7542 | #[doc = "Receiver wakeup method"] | ||
| 7543 | pub fn set_wake(&mut self, val: bool) { | ||
| 7544 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); | ||
| 7545 | } | ||
| 7546 | #[doc = "Word length"] | ||
| 7547 | pub const fn m0(&self) -> super::vals::M0 { | ||
| 7548 | let val = (self.0 >> 12usize) & 0x01; | ||
| 7549 | super::vals::M0(val as u8) | ||
| 7550 | } | 6038 | } |
| 7551 | #[doc = "Word length"] | 6039 | #[doc = "One sample bit method enable"] |
| 7552 | pub fn set_m0(&mut self, val: super::vals::M0) { | 6040 | pub fn set_onebit(&mut self, val: super::vals::Onebit) { |
| 7553 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | 6041 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); |
| 7554 | } | 6042 | } |
| 7555 | #[doc = "Word length"] | 6043 | #[doc = "Overrun Disable"] |
| 7556 | pub const fn m1(&self) -> super::vals::M1 { | 6044 | pub const fn ovrdis(&self) -> super::vals::Ovrdis { |
| 7557 | let val = (self.0 >> 12usize) & 0x01; | 6045 | let val = (self.0 >> 12usize) & 0x01; |
| 7558 | super::vals::M1(val as u8) | 6046 | super::vals::Ovrdis(val as u8) |
| 7559 | } | 6047 | } |
| 7560 | #[doc = "Word length"] | 6048 | #[doc = "Overrun Disable"] |
| 7561 | pub fn set_m1(&mut self, val: super::vals::M1) { | 6049 | pub fn set_ovrdis(&mut self, val: super::vals::Ovrdis) { |
| 7562 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | 6050 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); |
| 7563 | } | 6051 | } |
| 7564 | #[doc = "Mute mode enable"] | 6052 | #[doc = "DMA Disable on Reception Error"] |
| 7565 | pub const fn mme(&self) -> bool { | 6053 | pub const fn ddre(&self) -> bool { |
| 7566 | let val = (self.0 >> 13usize) & 0x01; | 6054 | let val = (self.0 >> 13usize) & 0x01; |
| 7567 | val != 0 | 6055 | val != 0 |
| 7568 | } | 6056 | } |
| 7569 | #[doc = "Mute mode enable"] | 6057 | #[doc = "DMA Disable on Reception Error"] |
| 7570 | pub fn set_mme(&mut self, val: bool) { | 6058 | pub fn set_ddre(&mut self, val: bool) { |
| 7571 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | 6059 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); |
| 7572 | } | 6060 | } |
| 7573 | #[doc = "Character match interrupt enable"] | 6061 | #[doc = "Driver enable mode"] |
| 7574 | pub const fn cmie(&self) -> bool { | 6062 | pub const fn dem(&self) -> bool { |
| 7575 | let val = (self.0 >> 14usize) & 0x01; | 6063 | let val = (self.0 >> 14usize) & 0x01; |
| 7576 | val != 0 | 6064 | val != 0 |
| 7577 | } | 6065 | } |
| 7578 | #[doc = "Character match interrupt enable"] | 6066 | #[doc = "Driver enable mode"] |
| 7579 | pub fn set_cmie(&mut self, val: bool) { | 6067 | pub fn set_dem(&mut self, val: bool) { |
| 7580 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | 6068 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); |
| 7581 | } | 6069 | } |
| 7582 | #[doc = "Oversampling mode"] | 6070 | #[doc = "Driver enable polarity selection"] |
| 7583 | pub fn over(&self, n: usize) -> super::vals::Over { | 6071 | pub const fn dep(&self) -> super::vals::Dep { |
| 7584 | assert!(n < 1usize); | 6072 | let val = (self.0 >> 15usize) & 0x01; |
| 7585 | let offs = 15usize + n * 0usize; | 6073 | super::vals::Dep(val as u8) |
| 7586 | let val = (self.0 >> offs) & 0x01; | ||
| 7587 | super::vals::Over(val as u8) | ||
| 7588 | } | ||
| 7589 | #[doc = "Oversampling mode"] | ||
| 7590 | pub fn set_over(&mut self, n: usize, val: super::vals::Over) { | ||
| 7591 | assert!(n < 1usize); | ||
| 7592 | let offs = 15usize + n * 0usize; | ||
| 7593 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 7594 | } | ||
| 7595 | #[doc = "Driver Enable deassertion time"] | ||
| 7596 | pub const fn dedt(&self) -> u8 { | ||
| 7597 | let val = (self.0 >> 16usize) & 0x1f; | ||
| 7598 | val as u8 | ||
| 7599 | } | 6074 | } |
| 7600 | #[doc = "Driver Enable deassertion time"] | 6075 | #[doc = "Driver enable polarity selection"] |
| 7601 | pub fn set_dedt(&mut self, val: u8) { | 6076 | pub fn set_dep(&mut self, val: super::vals::Dep) { |
| 7602 | self.0 = (self.0 & !(0x1f << 16usize)) | (((val as u32) & 0x1f) << 16usize); | 6077 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); |
| 7603 | } | 6078 | } |
| 7604 | #[doc = "Driver Enable assertion time"] | 6079 | #[doc = "Smartcard auto-retry count"] |
| 7605 | pub const fn deat(&self) -> u8 { | 6080 | pub const fn scarcnt(&self) -> u8 { |
| 7606 | let val = (self.0 >> 21usize) & 0x1f; | 6081 | let val = (self.0 >> 17usize) & 0x07; |
| 7607 | val as u8 | 6082 | val as u8 |
| 7608 | } | 6083 | } |
| 7609 | #[doc = "Driver Enable assertion time"] | 6084 | #[doc = "Smartcard auto-retry count"] |
| 7610 | pub fn set_deat(&mut self, val: u8) { | 6085 | pub fn set_scarcnt(&mut self, val: u8) { |
| 7611 | self.0 = (self.0 & !(0x1f << 21usize)) | (((val as u32) & 0x1f) << 21usize); | 6086 | self.0 = (self.0 & !(0x07 << 17usize)) | (((val as u32) & 0x07) << 17usize); |
| 7612 | } | 6087 | } |
| 7613 | #[doc = "Receiver timeout interrupt enable"] | 6088 | #[doc = "Wakeup from Stop mode interrupt flag selection"] |
| 7614 | pub const fn rtoie(&self) -> bool { | 6089 | pub const fn wus(&self) -> super::vals::Wus { |
| 7615 | let val = (self.0 >> 26usize) & 0x01; | 6090 | let val = (self.0 >> 20usize) & 0x03; |
| 7616 | val != 0 | 6091 | super::vals::Wus(val as u8) |
| 7617 | } | 6092 | } |
| 7618 | #[doc = "Receiver timeout interrupt enable"] | 6093 | #[doc = "Wakeup from Stop mode interrupt flag selection"] |
| 7619 | pub fn set_rtoie(&mut self, val: bool) { | 6094 | pub fn set_wus(&mut self, val: super::vals::Wus) { |
| 7620 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); | 6095 | self.0 = (self.0 & !(0x03 << 20usize)) | (((val.0 as u32) & 0x03) << 20usize); |
| 7621 | } | 6096 | } |
| 7622 | #[doc = "End of Block interrupt enable"] | 6097 | #[doc = "Wakeup from Stop mode interrupt enable"] |
| 7623 | pub const fn eobie(&self) -> bool { | 6098 | pub const fn wufie(&self) -> bool { |
| 7624 | let val = (self.0 >> 27usize) & 0x01; | 6099 | let val = (self.0 >> 22usize) & 0x01; |
| 7625 | val != 0 | 6100 | val != 0 |
| 7626 | } | 6101 | } |
| 7627 | #[doc = "End of Block interrupt enable"] | 6102 | #[doc = "Wakeup from Stop mode interrupt enable"] |
| 7628 | pub fn set_eobie(&mut self, val: bool) { | 6103 | pub fn set_wufie(&mut self, val: bool) { |
| 7629 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize); | 6104 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); |
| 7630 | } | 6105 | } |
| 7631 | } | 6106 | } |
| 7632 | impl Default for Cr1 { | 6107 | impl Default for Cr3 { |
| 7633 | fn default() -> Cr1 { | 6108 | fn default() -> Cr3 { |
| 7634 | Cr1(0) | 6109 | Cr3(0) |
| 7635 | } | 6110 | } |
| 7636 | } | 6111 | } |
| 7637 | #[doc = "Interrupt & status register"] | 6112 | #[doc = "Interrupt & status register"] |
| @@ -7843,11 +6318,333 @@ pub mod usart_v2 { | |||
| 7843 | Ixr(0) | 6318 | Ixr(0) |
| 7844 | } | 6319 | } |
| 7845 | } | 6320 | } |
| 6321 | #[doc = "Receiver timeout register"] | ||
| 6322 | #[repr(transparent)] | ||
| 6323 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6324 | pub struct Rtor(pub u32); | ||
| 6325 | impl Rtor { | ||
| 6326 | #[doc = "Receiver timeout value"] | ||
| 6327 | pub const fn rto(&self) -> u32 { | ||
| 6328 | let val = (self.0 >> 0usize) & 0x00ff_ffff; | ||
| 6329 | val as u32 | ||
| 6330 | } | ||
| 6331 | #[doc = "Receiver timeout value"] | ||
| 6332 | pub fn set_rto(&mut self, val: u32) { | ||
| 6333 | self.0 = | ||
| 6334 | (self.0 & !(0x00ff_ffff << 0usize)) | (((val as u32) & 0x00ff_ffff) << 0usize); | ||
| 6335 | } | ||
| 6336 | #[doc = "Block Length"] | ||
| 6337 | pub const fn blen(&self) -> u8 { | ||
| 6338 | let val = (self.0 >> 24usize) & 0xff; | ||
| 6339 | val as u8 | ||
| 6340 | } | ||
| 6341 | #[doc = "Block Length"] | ||
| 6342 | pub fn set_blen(&mut self, val: u8) { | ||
| 6343 | self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize); | ||
| 6344 | } | ||
| 6345 | } | ||
| 6346 | impl Default for Rtor { | ||
| 6347 | fn default() -> Rtor { | ||
| 6348 | Rtor(0) | ||
| 6349 | } | ||
| 6350 | } | ||
| 6351 | #[doc = "Guard time and prescaler register"] | ||
| 6352 | #[repr(transparent)] | ||
| 6353 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6354 | pub struct Gtpr(pub u32); | ||
| 6355 | impl Gtpr { | ||
| 6356 | #[doc = "Prescaler value"] | ||
| 6357 | pub const fn psc(&self) -> u8 { | ||
| 6358 | let val = (self.0 >> 0usize) & 0xff; | ||
| 6359 | val as u8 | ||
| 6360 | } | ||
| 6361 | #[doc = "Prescaler value"] | ||
| 6362 | pub fn set_psc(&mut self, val: u8) { | ||
| 6363 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | ||
| 6364 | } | ||
| 6365 | #[doc = "Guard time value"] | ||
| 6366 | pub const fn gt(&self) -> u8 { | ||
| 6367 | let val = (self.0 >> 8usize) & 0xff; | ||
| 6368 | val as u8 | ||
| 6369 | } | ||
| 6370 | #[doc = "Guard time value"] | ||
| 6371 | pub fn set_gt(&mut self, val: u8) { | ||
| 6372 | self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize); | ||
| 6373 | } | ||
| 6374 | } | ||
| 6375 | impl Default for Gtpr { | ||
| 6376 | fn default() -> Gtpr { | ||
| 6377 | Gtpr(0) | ||
| 6378 | } | ||
| 6379 | } | ||
| 6380 | #[doc = "Data register"] | ||
| 6381 | #[repr(transparent)] | ||
| 6382 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6383 | pub struct Dr(pub u32); | ||
| 6384 | impl Dr { | ||
| 6385 | #[doc = "data value"] | ||
| 6386 | pub const fn dr(&self) -> u16 { | ||
| 6387 | let val = (self.0 >> 0usize) & 0x01ff; | ||
| 6388 | val as u16 | ||
| 6389 | } | ||
| 6390 | #[doc = "data value"] | ||
| 6391 | pub fn set_dr(&mut self, val: u16) { | ||
| 6392 | self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize); | ||
| 6393 | } | ||
| 6394 | } | ||
| 6395 | impl Default for Dr { | ||
| 6396 | fn default() -> Dr { | ||
| 6397 | Dr(0) | ||
| 6398 | } | ||
| 6399 | } | ||
| 6400 | } | ||
| 6401 | } | ||
| 6402 | pub mod generic { | ||
| 6403 | use core::marker::PhantomData; | ||
| 6404 | #[derive(Copy, Clone)] | ||
| 6405 | pub struct RW; | ||
| 6406 | #[derive(Copy, Clone)] | ||
| 6407 | pub struct R; | ||
| 6408 | #[derive(Copy, Clone)] | ||
| 6409 | pub struct W; | ||
| 6410 | mod sealed { | ||
| 6411 | use super::*; | ||
| 6412 | pub trait Access {} | ||
| 6413 | impl Access for R {} | ||
| 6414 | impl Access for W {} | ||
| 6415 | impl Access for RW {} | ||
| 6416 | } | ||
| 6417 | pub trait Access: sealed::Access + Copy {} | ||
| 6418 | impl Access for R {} | ||
| 6419 | impl Access for W {} | ||
| 6420 | impl Access for RW {} | ||
| 6421 | pub trait Read: Access {} | ||
| 6422 | impl Read for RW {} | ||
| 6423 | impl Read for R {} | ||
| 6424 | pub trait Write: Access {} | ||
| 6425 | impl Write for RW {} | ||
| 6426 | impl Write for W {} | ||
| 6427 | #[derive(Copy, Clone)] | ||
| 6428 | pub struct Reg<T: Copy, A: Access> { | ||
| 6429 | ptr: *mut u8, | ||
| 6430 | phantom: PhantomData<*mut (T, A)>, | ||
| 6431 | } | ||
| 6432 | unsafe impl<T: Copy, A: Access> Send for Reg<T, A> {} | ||
| 6433 | unsafe impl<T: Copy, A: Access> Sync for Reg<T, A> {} | ||
| 6434 | impl<T: Copy, A: Access> Reg<T, A> { | ||
| 6435 | pub fn from_ptr(ptr: *mut u8) -> Self { | ||
| 6436 | Self { | ||
| 6437 | ptr, | ||
| 6438 | phantom: PhantomData, | ||
| 6439 | } | ||
| 6440 | } | ||
| 6441 | pub fn ptr(&self) -> *mut T { | ||
| 6442 | self.ptr as _ | ||
| 6443 | } | ||
| 6444 | } | ||
| 6445 | impl<T: Copy, A: Read> Reg<T, A> { | ||
| 6446 | pub unsafe fn read(&self) -> T { | ||
| 6447 | (self.ptr as *mut T).read_volatile() | ||
| 6448 | } | ||
| 6449 | } | ||
| 6450 | impl<T: Copy, A: Write> Reg<T, A> { | ||
| 6451 | pub unsafe fn write_value(&self, val: T) { | ||
| 6452 | (self.ptr as *mut T).write_volatile(val) | ||
| 6453 | } | ||
| 6454 | } | ||
| 6455 | impl<T: Default + Copy, A: Write> Reg<T, A> { | ||
| 6456 | pub unsafe fn write<R>(&self, f: impl FnOnce(&mut T) -> R) -> R { | ||
| 6457 | let mut val = Default::default(); | ||
| 6458 | let res = f(&mut val); | ||
| 6459 | self.write_value(val); | ||
| 6460 | res | ||
| 6461 | } | ||
| 6462 | } | ||
| 6463 | impl<T: Copy, A: Read + Write> Reg<T, A> { | ||
| 6464 | pub unsafe fn modify<R>(&self, f: impl FnOnce(&mut T) -> R) -> R { | ||
| 6465 | let mut val = self.read(); | ||
| 6466 | let res = f(&mut val); | ||
| 6467 | self.write_value(val); | ||
| 6468 | res | ||
| 6469 | } | ||
| 6470 | } | ||
| 6471 | } | ||
| 6472 | pub mod usart_v1 { | ||
| 6473 | use crate::generic::*; | ||
| 6474 | #[doc = "Universal asynchronous receiver transmitter"] | ||
| 6475 | #[derive(Copy, Clone)] | ||
| 6476 | pub struct Uart(pub *mut u8); | ||
| 6477 | unsafe impl Send for Uart {} | ||
| 6478 | unsafe impl Sync for Uart {} | ||
| 6479 | impl Uart { | ||
| 6480 | #[doc = "Status register"] | ||
| 6481 | pub fn sr(self) -> Reg<regs::Sr, RW> { | ||
| 6482 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 6483 | } | ||
| 6484 | #[doc = "Data register"] | ||
| 6485 | pub fn dr(self) -> Reg<regs::Dr, RW> { | ||
| 6486 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 6487 | } | ||
| 6488 | #[doc = "Baud rate register"] | ||
| 6489 | pub fn brr(self) -> Reg<regs::Brr, RW> { | ||
| 6490 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 6491 | } | ||
| 6492 | #[doc = "Control register 1"] | ||
| 6493 | pub fn cr1(self) -> Reg<regs::Cr1, RW> { | ||
| 6494 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 6495 | } | ||
| 6496 | #[doc = "Control register 2"] | ||
| 6497 | pub fn cr2(self) -> Reg<regs::Cr2, RW> { | ||
| 6498 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 6499 | } | ||
| 6500 | #[doc = "Control register 3"] | ||
| 6501 | pub fn cr3(self) -> Reg<regs::Cr3, RW> { | ||
| 6502 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 6503 | } | ||
| 6504 | } | ||
| 6505 | #[doc = "Universal synchronous asynchronous receiver transmitter"] | ||
| 6506 | #[derive(Copy, Clone)] | ||
| 6507 | pub struct Usart(pub *mut u8); | ||
| 6508 | unsafe impl Send for Usart {} | ||
| 6509 | unsafe impl Sync for Usart {} | ||
| 6510 | impl Usart { | ||
| 6511 | #[doc = "Status register"] | ||
| 6512 | pub fn sr(self) -> Reg<regs::Sr, RW> { | ||
| 6513 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 6514 | } | ||
| 6515 | #[doc = "Data register"] | ||
| 6516 | pub fn dr(self) -> Reg<regs::Dr, RW> { | ||
| 6517 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 6518 | } | ||
| 6519 | #[doc = "Baud rate register"] | ||
| 6520 | pub fn brr(self) -> Reg<regs::Brr, RW> { | ||
| 6521 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 6522 | } | ||
| 6523 | #[doc = "Control register 1"] | ||
| 6524 | pub fn cr1(self) -> Reg<regs::Cr1, RW> { | ||
| 6525 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 6526 | } | ||
| 6527 | #[doc = "Control register 2"] | ||
| 6528 | pub fn cr2(self) -> Reg<regs::Cr2Usart, RW> { | ||
| 6529 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 6530 | } | ||
| 6531 | #[doc = "Control register 3"] | ||
| 6532 | pub fn cr3(self) -> Reg<regs::Cr3Usart, RW> { | ||
| 6533 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 6534 | } | ||
| 6535 | #[doc = "Guard time and prescaler register"] | ||
| 6536 | pub fn gtpr(self) -> Reg<regs::Gtpr, RW> { | ||
| 6537 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | ||
| 6538 | } | ||
| 6539 | } | ||
| 6540 | pub mod regs { | ||
| 6541 | use crate::generic::*; | ||
| 6542 | #[doc = "Status register"] | ||
| 6543 | #[repr(transparent)] | ||
| 6544 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6545 | pub struct SrUsart(pub u32); | ||
| 6546 | impl SrUsart { | ||
| 6547 | #[doc = "Parity error"] | ||
| 6548 | pub const fn pe(&self) -> bool { | ||
| 6549 | let val = (self.0 >> 0usize) & 0x01; | ||
| 6550 | val != 0 | ||
| 6551 | } | ||
| 6552 | #[doc = "Parity error"] | ||
| 6553 | pub fn set_pe(&mut self, val: bool) { | ||
| 6554 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 6555 | } | ||
| 6556 | #[doc = "Framing error"] | ||
| 6557 | pub const fn fe(&self) -> bool { | ||
| 6558 | let val = (self.0 >> 1usize) & 0x01; | ||
| 6559 | val != 0 | ||
| 6560 | } | ||
| 6561 | #[doc = "Framing error"] | ||
| 6562 | pub fn set_fe(&mut self, val: bool) { | ||
| 6563 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | ||
| 6564 | } | ||
| 6565 | #[doc = "Noise error flag"] | ||
| 6566 | pub const fn ne(&self) -> bool { | ||
| 6567 | let val = (self.0 >> 2usize) & 0x01; | ||
| 6568 | val != 0 | ||
| 6569 | } | ||
| 6570 | #[doc = "Noise error flag"] | ||
| 6571 | pub fn set_ne(&mut self, val: bool) { | ||
| 6572 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 6573 | } | ||
| 6574 | #[doc = "Overrun error"] | ||
| 6575 | pub const fn ore(&self) -> bool { | ||
| 6576 | let val = (self.0 >> 3usize) & 0x01; | ||
| 6577 | val != 0 | ||
| 6578 | } | ||
| 6579 | #[doc = "Overrun error"] | ||
| 6580 | pub fn set_ore(&mut self, val: bool) { | ||
| 6581 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | ||
| 6582 | } | ||
| 6583 | #[doc = "IDLE line detected"] | ||
| 6584 | pub const fn idle(&self) -> bool { | ||
| 6585 | let val = (self.0 >> 4usize) & 0x01; | ||
| 6586 | val != 0 | ||
| 6587 | } | ||
| 6588 | #[doc = "IDLE line detected"] | ||
| 6589 | pub fn set_idle(&mut self, val: bool) { | ||
| 6590 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | ||
| 6591 | } | ||
| 6592 | #[doc = "Read data register not empty"] | ||
| 6593 | pub const fn rxne(&self) -> bool { | ||
| 6594 | let val = (self.0 >> 5usize) & 0x01; | ||
| 6595 | val != 0 | ||
| 6596 | } | ||
| 6597 | #[doc = "Read data register not empty"] | ||
| 6598 | pub fn set_rxne(&mut self, val: bool) { | ||
| 6599 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 6600 | } | ||
| 6601 | #[doc = "Transmission complete"] | ||
| 6602 | pub const fn tc(&self) -> bool { | ||
| 6603 | let val = (self.0 >> 6usize) & 0x01; | ||
| 6604 | val != 0 | ||
| 6605 | } | ||
| 6606 | #[doc = "Transmission complete"] | ||
| 6607 | pub fn set_tc(&mut self, val: bool) { | ||
| 6608 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 6609 | } | ||
| 6610 | #[doc = "Transmit data register empty"] | ||
| 6611 | pub const fn txe(&self) -> bool { | ||
| 6612 | let val = (self.0 >> 7usize) & 0x01; | ||
| 6613 | val != 0 | ||
| 6614 | } | ||
| 6615 | #[doc = "Transmit data register empty"] | ||
| 6616 | pub fn set_txe(&mut self, val: bool) { | ||
| 6617 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 6618 | } | ||
| 6619 | #[doc = "LIN break detection flag"] | ||
| 6620 | pub const fn lbd(&self) -> bool { | ||
| 6621 | let val = (self.0 >> 8usize) & 0x01; | ||
| 6622 | val != 0 | ||
| 6623 | } | ||
| 6624 | #[doc = "LIN break detection flag"] | ||
| 6625 | pub fn set_lbd(&mut self, val: bool) { | ||
| 6626 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 6627 | } | ||
| 6628 | #[doc = "CTS flag"] | ||
| 6629 | pub const fn cts(&self) -> bool { | ||
| 6630 | let val = (self.0 >> 9usize) & 0x01; | ||
| 6631 | val != 0 | ||
| 6632 | } | ||
| 6633 | #[doc = "CTS flag"] | ||
| 6634 | pub fn set_cts(&mut self, val: bool) { | ||
| 6635 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | ||
| 6636 | } | ||
| 6637 | } | ||
| 6638 | impl Default for SrUsart { | ||
| 6639 | fn default() -> SrUsart { | ||
| 6640 | SrUsart(0) | ||
| 6641 | } | ||
| 6642 | } | ||
| 7846 | #[doc = "Control register 3"] | 6643 | #[doc = "Control register 3"] |
| 7847 | #[repr(transparent)] | 6644 | #[repr(transparent)] |
| 7848 | #[derive(Copy, Clone, Eq, PartialEq)] | 6645 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 7849 | pub struct Cr3(pub u32); | 6646 | pub struct Cr3Usart(pub u32); |
| 7850 | impl Cr3 { | 6647 | impl Cr3Usart { |
| 7851 | #[doc = "Error interrupt enable"] | 6648 | #[doc = "Error interrupt enable"] |
| 7852 | pub const fn eie(&self) -> bool { | 6649 | pub const fn eie(&self) -> bool { |
| 7853 | let val = (self.0 >> 0usize) & 0x01; | 6650 | let val = (self.0 >> 0usize) & 0x01; |
| @@ -7947,544 +6744,530 @@ pub mod usart_v2 { | |||
| 7947 | pub fn set_ctsie(&mut self, val: bool) { | 6744 | pub fn set_ctsie(&mut self, val: bool) { |
| 7948 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | 6745 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); |
| 7949 | } | 6746 | } |
| 7950 | #[doc = "One sample bit method enable"] | 6747 | } |
| 7951 | pub const fn onebit(&self) -> super::vals::Onebit { | 6748 | impl Default for Cr3Usart { |
| 7952 | let val = (self.0 >> 11usize) & 0x01; | 6749 | fn default() -> Cr3Usart { |
| 7953 | super::vals::Onebit(val as u8) | 6750 | Cr3Usart(0) |
| 7954 | } | 6751 | } |
| 7955 | #[doc = "One sample bit method enable"] | 6752 | } |
| 7956 | pub fn set_onebit(&mut self, val: super::vals::Onebit) { | 6753 | #[doc = "Control register 2"] |
| 7957 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); | 6754 | #[repr(transparent)] |
| 6755 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6756 | pub struct Cr2Usart(pub u32); | ||
| 6757 | impl Cr2Usart { | ||
| 6758 | #[doc = "Address of the USART node"] | ||
| 6759 | pub const fn add(&self) -> u8 { | ||
| 6760 | let val = (self.0 >> 0usize) & 0x0f; | ||
| 6761 | val as u8 | ||
| 7958 | } | 6762 | } |
| 7959 | #[doc = "Overrun Disable"] | 6763 | #[doc = "Address of the USART node"] |
| 7960 | pub const fn ovrdis(&self) -> super::vals::Ovrdis { | 6764 | pub fn set_add(&mut self, val: u8) { |
| 7961 | let val = (self.0 >> 12usize) & 0x01; | 6765 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); |
| 7962 | super::vals::Ovrdis(val as u8) | ||
| 7963 | } | 6766 | } |
| 7964 | #[doc = "Overrun Disable"] | 6767 | #[doc = "lin break detection length"] |
| 7965 | pub fn set_ovrdis(&mut self, val: super::vals::Ovrdis) { | 6768 | pub const fn lbdl(&self) -> super::vals::Lbdl { |
| 7966 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | 6769 | let val = (self.0 >> 5usize) & 0x01; |
| 6770 | super::vals::Lbdl(val as u8) | ||
| 7967 | } | 6771 | } |
| 7968 | #[doc = "DMA Disable on Reception Error"] | 6772 | #[doc = "lin break detection length"] |
| 7969 | pub const fn ddre(&self) -> bool { | 6773 | pub fn set_lbdl(&mut self, val: super::vals::Lbdl) { |
| 7970 | let val = (self.0 >> 13usize) & 0x01; | 6774 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); |
| 6775 | } | ||
| 6776 | #[doc = "LIN break detection interrupt enable"] | ||
| 6777 | pub const fn lbdie(&self) -> bool { | ||
| 6778 | let val = (self.0 >> 6usize) & 0x01; | ||
| 7971 | val != 0 | 6779 | val != 0 |
| 7972 | } | 6780 | } |
| 7973 | #[doc = "DMA Disable on Reception Error"] | 6781 | #[doc = "LIN break detection interrupt enable"] |
| 7974 | pub fn set_ddre(&mut self, val: bool) { | 6782 | pub fn set_lbdie(&mut self, val: bool) { |
| 7975 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | 6783 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 7976 | } | 6784 | } |
| 7977 | #[doc = "Driver enable mode"] | 6785 | #[doc = "Last bit clock pulse"] |
| 7978 | pub const fn dem(&self) -> bool { | 6786 | pub const fn lbcl(&self) -> bool { |
| 7979 | let val = (self.0 >> 14usize) & 0x01; | 6787 | let val = (self.0 >> 8usize) & 0x01; |
| 7980 | val != 0 | 6788 | val != 0 |
| 7981 | } | 6789 | } |
| 7982 | #[doc = "Driver enable mode"] | 6790 | #[doc = "Last bit clock pulse"] |
| 7983 | pub fn set_dem(&mut self, val: bool) { | 6791 | pub fn set_lbcl(&mut self, val: bool) { |
| 7984 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | 6792 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 7985 | } | 6793 | } |
| 7986 | #[doc = "Driver enable polarity selection"] | 6794 | #[doc = "Clock phase"] |
| 7987 | pub const fn dep(&self) -> super::vals::Dep { | 6795 | pub const fn cpha(&self) -> super::vals::Cpha { |
| 7988 | let val = (self.0 >> 15usize) & 0x01; | 6796 | let val = (self.0 >> 9usize) & 0x01; |
| 7989 | super::vals::Dep(val as u8) | 6797 | super::vals::Cpha(val as u8) |
| 7990 | } | 6798 | } |
| 7991 | #[doc = "Driver enable polarity selection"] | 6799 | #[doc = "Clock phase"] |
| 7992 | pub fn set_dep(&mut self, val: super::vals::Dep) { | 6800 | pub fn set_cpha(&mut self, val: super::vals::Cpha) { |
| 7993 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | 6801 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); |
| 7994 | } | 6802 | } |
| 7995 | #[doc = "Smartcard auto-retry count"] | 6803 | #[doc = "Clock polarity"] |
| 7996 | pub const fn scarcnt(&self) -> u8 { | 6804 | pub const fn cpol(&self) -> super::vals::Cpol { |
| 7997 | let val = (self.0 >> 17usize) & 0x07; | 6805 | let val = (self.0 >> 10usize) & 0x01; |
| 7998 | val as u8 | 6806 | super::vals::Cpol(val as u8) |
| 7999 | } | 6807 | } |
| 8000 | #[doc = "Smartcard auto-retry count"] | 6808 | #[doc = "Clock polarity"] |
| 8001 | pub fn set_scarcnt(&mut self, val: u8) { | 6809 | pub fn set_cpol(&mut self, val: super::vals::Cpol) { |
| 8002 | self.0 = (self.0 & !(0x07 << 17usize)) | (((val as u32) & 0x07) << 17usize); | 6810 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); |
| 8003 | } | 6811 | } |
| 8004 | #[doc = "Wakeup from Stop mode interrupt flag selection"] | 6812 | #[doc = "Clock enable"] |
| 8005 | pub const fn wus(&self) -> super::vals::Wus { | 6813 | pub const fn clken(&self) -> bool { |
| 8006 | let val = (self.0 >> 20usize) & 0x03; | 6814 | let val = (self.0 >> 11usize) & 0x01; |
| 8007 | super::vals::Wus(val as u8) | 6815 | val != 0 |
| 8008 | } | 6816 | } |
| 8009 | #[doc = "Wakeup from Stop mode interrupt flag selection"] | 6817 | #[doc = "Clock enable"] |
| 8010 | pub fn set_wus(&mut self, val: super::vals::Wus) { | 6818 | pub fn set_clken(&mut self, val: bool) { |
| 8011 | self.0 = (self.0 & !(0x03 << 20usize)) | (((val.0 as u32) & 0x03) << 20usize); | 6819 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); |
| 8012 | } | 6820 | } |
| 8013 | #[doc = "Wakeup from Stop mode interrupt enable"] | 6821 | #[doc = "STOP bits"] |
| 8014 | pub const fn wufie(&self) -> bool { | 6822 | pub const fn stop(&self) -> super::vals::Stop { |
| 8015 | let val = (self.0 >> 22usize) & 0x01; | 6823 | let val = (self.0 >> 12usize) & 0x03; |
| 6824 | super::vals::Stop(val as u8) | ||
| 6825 | } | ||
| 6826 | #[doc = "STOP bits"] | ||
| 6827 | pub fn set_stop(&mut self, val: super::vals::Stop) { | ||
| 6828 | self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize); | ||
| 6829 | } | ||
| 6830 | #[doc = "LIN mode enable"] | ||
| 6831 | pub const fn linen(&self) -> bool { | ||
| 6832 | let val = (self.0 >> 14usize) & 0x01; | ||
| 8016 | val != 0 | 6833 | val != 0 |
| 8017 | } | 6834 | } |
| 8018 | #[doc = "Wakeup from Stop mode interrupt enable"] | 6835 | #[doc = "LIN mode enable"] |
| 8019 | pub fn set_wufie(&mut self, val: bool) { | 6836 | pub fn set_linen(&mut self, val: bool) { |
| 8020 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); | 6837 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); |
| 8021 | } | 6838 | } |
| 8022 | } | 6839 | } |
| 8023 | impl Default for Cr3 { | 6840 | impl Default for Cr2Usart { |
| 8024 | fn default() -> Cr3 { | 6841 | fn default() -> Cr2Usart { |
| 8025 | Cr3(0) | 6842 | Cr2Usart(0) |
| 8026 | } | 6843 | } |
| 8027 | } | 6844 | } |
| 8028 | #[doc = "Request register"] | 6845 | #[doc = "Control register 1"] |
| 8029 | #[repr(transparent)] | 6846 | #[repr(transparent)] |
| 8030 | #[derive(Copy, Clone, Eq, PartialEq)] | 6847 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 8031 | pub struct Rqr(pub u32); | 6848 | pub struct Cr1(pub u32); |
| 8032 | impl Rqr { | 6849 | impl Cr1 { |
| 8033 | #[doc = "Auto baud rate request"] | 6850 | #[doc = "Send break"] |
| 8034 | pub const fn abrrq(&self) -> super::vals::Abrrq { | 6851 | pub const fn sbk(&self) -> super::vals::Sbk { |
| 8035 | let val = (self.0 >> 0usize) & 0x01; | 6852 | let val = (self.0 >> 0usize) & 0x01; |
| 8036 | super::vals::Abrrq(val as u8) | 6853 | super::vals::Sbk(val as u8) |
| 8037 | } | 6854 | } |
| 8038 | #[doc = "Auto baud rate request"] | 6855 | #[doc = "Send break"] |
| 8039 | pub fn set_abrrq(&mut self, val: super::vals::Abrrq) { | 6856 | pub fn set_sbk(&mut self, val: super::vals::Sbk) { |
| 8040 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | 6857 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 8041 | } | 6858 | } |
| 8042 | #[doc = "Send break request"] | 6859 | #[doc = "Receiver wakeup"] |
| 8043 | pub const fn sbkrq(&self) -> super::vals::Sbkrq { | 6860 | pub const fn rwu(&self) -> super::vals::Rwu { |
| 8044 | let val = (self.0 >> 1usize) & 0x01; | 6861 | let val = (self.0 >> 1usize) & 0x01; |
| 8045 | super::vals::Sbkrq(val as u8) | 6862 | super::vals::Rwu(val as u8) |
| 8046 | } | 6863 | } |
| 8047 | #[doc = "Send break request"] | 6864 | #[doc = "Receiver wakeup"] |
| 8048 | pub fn set_sbkrq(&mut self, val: super::vals::Sbkrq) { | 6865 | pub fn set_rwu(&mut self, val: super::vals::Rwu) { |
| 8049 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | 6866 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); |
| 8050 | } | 6867 | } |
| 8051 | #[doc = "Mute mode request"] | 6868 | #[doc = "Receiver enable"] |
| 8052 | pub const fn mmrq(&self) -> super::vals::Mmrq { | 6869 | pub const fn re(&self) -> bool { |
| 8053 | let val = (self.0 >> 2usize) & 0x01; | 6870 | let val = (self.0 >> 2usize) & 0x01; |
| 8054 | super::vals::Mmrq(val as u8) | ||
| 8055 | } | ||
| 8056 | #[doc = "Mute mode request"] | ||
| 8057 | pub fn set_mmrq(&mut self, val: super::vals::Mmrq) { | ||
| 8058 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 8059 | } | ||
| 8060 | #[doc = "Receive data flush request"] | ||
| 8061 | pub const fn rxfrq(&self) -> super::vals::Rxfrq { | ||
| 8062 | let val = (self.0 >> 3usize) & 0x01; | ||
| 8063 | super::vals::Rxfrq(val as u8) | ||
| 8064 | } | ||
| 8065 | #[doc = "Receive data flush request"] | ||
| 8066 | pub fn set_rxfrq(&mut self, val: super::vals::Rxfrq) { | ||
| 8067 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 8068 | } | ||
| 8069 | #[doc = "Transmit data flush request"] | ||
| 8070 | pub const fn txfrq(&self) -> super::vals::Txfrq { | ||
| 8071 | let val = (self.0 >> 4usize) & 0x01; | ||
| 8072 | super::vals::Txfrq(val as u8) | ||
| 8073 | } | ||
| 8074 | #[doc = "Transmit data flush request"] | ||
| 8075 | pub fn set_txfrq(&mut self, val: super::vals::Txfrq) { | ||
| 8076 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 8077 | } | ||
| 8078 | } | ||
| 8079 | impl Default for Rqr { | ||
| 8080 | fn default() -> Rqr { | ||
| 8081 | Rqr(0) | ||
| 8082 | } | ||
| 8083 | } | ||
| 8084 | } | ||
| 8085 | } | ||
| 8086 | pub mod spi_v1 { | ||
| 8087 | use crate::generic::*; | ||
| 8088 | #[doc = "Serial peripheral interface"] | ||
| 8089 | #[derive(Copy, Clone)] | ||
| 8090 | pub struct Spi(pub *mut u8); | ||
| 8091 | unsafe impl Send for Spi {} | ||
| 8092 | unsafe impl Sync for Spi {} | ||
| 8093 | impl Spi { | ||
| 8094 | #[doc = "control register 1"] | ||
| 8095 | pub fn cr1(self) -> Reg<regs::Cr1, RW> { | ||
| 8096 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 8097 | } | ||
| 8098 | #[doc = "control register 2"] | ||
| 8099 | pub fn cr2(self) -> Reg<regs::Cr2, RW> { | ||
| 8100 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 8101 | } | ||
| 8102 | #[doc = "status register"] | ||
| 8103 | pub fn sr(self) -> Reg<regs::Sr, RW> { | ||
| 8104 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 8105 | } | ||
| 8106 | #[doc = "data register"] | ||
| 8107 | pub fn dr(self) -> Reg<regs::Dr, RW> { | ||
| 8108 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 8109 | } | ||
| 8110 | #[doc = "CRC polynomial register"] | ||
| 8111 | pub fn crcpr(self) -> Reg<regs::Crcpr, RW> { | ||
| 8112 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 8113 | } | ||
| 8114 | #[doc = "RX CRC register"] | ||
| 8115 | pub fn rxcrcr(self) -> Reg<regs::Rxcrcr, R> { | ||
| 8116 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 8117 | } | ||
| 8118 | #[doc = "TX CRC register"] | ||
| 8119 | pub fn txcrcr(self) -> Reg<regs::Txcrcr, R> { | ||
| 8120 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | ||
| 8121 | } | ||
| 8122 | } | ||
| 8123 | pub mod regs { | ||
| 8124 | use crate::generic::*; | ||
| 8125 | #[doc = "TX CRC register"] | ||
| 8126 | #[repr(transparent)] | ||
| 8127 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 8128 | pub struct Txcrcr(pub u32); | ||
| 8129 | impl Txcrcr { | ||
| 8130 | #[doc = "Tx CRC register"] | ||
| 8131 | pub const fn tx_crc(&self) -> u16 { | ||
| 8132 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 8133 | val as u16 | ||
| 8134 | } | ||
| 8135 | #[doc = "Tx CRC register"] | ||
| 8136 | pub fn set_tx_crc(&mut self, val: u16) { | ||
| 8137 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 8138 | } | ||
| 8139 | } | ||
| 8140 | impl Default for Txcrcr { | ||
| 8141 | fn default() -> Txcrcr { | ||
| 8142 | Txcrcr(0) | ||
| 8143 | } | ||
| 8144 | } | ||
| 8145 | #[doc = "status register"] | ||
| 8146 | #[repr(transparent)] | ||
| 8147 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 8148 | pub struct Sr(pub u32); | ||
| 8149 | impl Sr { | ||
| 8150 | #[doc = "Receive buffer not empty"] | ||
| 8151 | pub const fn rxne(&self) -> bool { | ||
| 8152 | let val = (self.0 >> 0usize) & 0x01; | ||
| 8153 | val != 0 | 6871 | val != 0 |
| 8154 | } | 6872 | } |
| 8155 | #[doc = "Receive buffer not empty"] | 6873 | #[doc = "Receiver enable"] |
| 8156 | pub fn set_rxne(&mut self, val: bool) { | 6874 | pub fn set_re(&mut self, val: bool) { |
| 8157 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 6875 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 8158 | } | 6876 | } |
| 8159 | #[doc = "Transmit buffer empty"] | 6877 | #[doc = "Transmitter enable"] |
| 8160 | pub const fn txe(&self) -> bool { | 6878 | pub const fn te(&self) -> bool { |
| 8161 | let val = (self.0 >> 1usize) & 0x01; | 6879 | let val = (self.0 >> 3usize) & 0x01; |
| 8162 | val != 0 | 6880 | val != 0 |
| 8163 | } | 6881 | } |
| 8164 | #[doc = "Transmit buffer empty"] | 6882 | #[doc = "Transmitter enable"] |
| 8165 | pub fn set_txe(&mut self, val: bool) { | 6883 | pub fn set_te(&mut self, val: bool) { |
| 8166 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 6884 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); |
| 8167 | } | 6885 | } |
| 8168 | #[doc = "CRC error flag"] | 6886 | #[doc = "IDLE interrupt enable"] |
| 8169 | pub const fn crcerr(&self) -> bool { | 6887 | pub const fn idleie(&self) -> bool { |
| 8170 | let val = (self.0 >> 4usize) & 0x01; | 6888 | let val = (self.0 >> 4usize) & 0x01; |
| 8171 | val != 0 | 6889 | val != 0 |
| 8172 | } | 6890 | } |
| 8173 | #[doc = "CRC error flag"] | 6891 | #[doc = "IDLE interrupt enable"] |
| 8174 | pub fn set_crcerr(&mut self, val: bool) { | 6892 | pub fn set_idleie(&mut self, val: bool) { |
| 8175 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 6893 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 8176 | } | 6894 | } |
| 8177 | #[doc = "Mode fault"] | 6895 | #[doc = "RXNE interrupt enable"] |
| 8178 | pub const fn modf(&self) -> bool { | 6896 | pub const fn rxneie(&self) -> bool { |
| 8179 | let val = (self.0 >> 5usize) & 0x01; | 6897 | let val = (self.0 >> 5usize) & 0x01; |
| 8180 | val != 0 | 6898 | val != 0 |
| 8181 | } | 6899 | } |
| 8182 | #[doc = "Mode fault"] | 6900 | #[doc = "RXNE interrupt enable"] |
| 8183 | pub fn set_modf(&mut self, val: bool) { | 6901 | pub fn set_rxneie(&mut self, val: bool) { |
| 8184 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 6902 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 8185 | } | 6903 | } |
| 8186 | #[doc = "Overrun flag"] | 6904 | #[doc = "Transmission complete interrupt enable"] |
| 8187 | pub const fn ovr(&self) -> bool { | 6905 | pub const fn tcie(&self) -> bool { |
| 8188 | let val = (self.0 >> 6usize) & 0x01; | 6906 | let val = (self.0 >> 6usize) & 0x01; |
| 8189 | val != 0 | 6907 | val != 0 |
| 8190 | } | 6908 | } |
| 8191 | #[doc = "Overrun flag"] | 6909 | #[doc = "Transmission complete interrupt enable"] |
| 8192 | pub fn set_ovr(&mut self, val: bool) { | 6910 | pub fn set_tcie(&mut self, val: bool) { |
| 8193 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 6911 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 8194 | } | 6912 | } |
| 8195 | #[doc = "Busy flag"] | 6913 | #[doc = "TXE interrupt enable"] |
| 8196 | pub const fn bsy(&self) -> bool { | 6914 | pub const fn txeie(&self) -> bool { |
| 8197 | let val = (self.0 >> 7usize) & 0x01; | 6915 | let val = (self.0 >> 7usize) & 0x01; |
| 8198 | val != 0 | 6916 | val != 0 |
| 8199 | } | 6917 | } |
| 8200 | #[doc = "Busy flag"] | 6918 | #[doc = "TXE interrupt enable"] |
| 8201 | pub fn set_bsy(&mut self, val: bool) { | 6919 | pub fn set_txeie(&mut self, val: bool) { |
| 8202 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 6920 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 8203 | } | 6921 | } |
| 8204 | #[doc = "TI frame format error"] | 6922 | #[doc = "PE interrupt enable"] |
| 8205 | pub const fn fre(&self) -> bool { | 6923 | pub const fn peie(&self) -> bool { |
| 8206 | let val = (self.0 >> 8usize) & 0x01; | 6924 | let val = (self.0 >> 8usize) & 0x01; |
| 8207 | val != 0 | 6925 | val != 0 |
| 8208 | } | 6926 | } |
| 8209 | #[doc = "TI frame format error"] | 6927 | #[doc = "PE interrupt enable"] |
| 8210 | pub fn set_fre(&mut self, val: bool) { | 6928 | pub fn set_peie(&mut self, val: bool) { |
| 8211 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 6929 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 8212 | } | 6930 | } |
| 8213 | } | 6931 | #[doc = "Parity selection"] |
| 8214 | impl Default for Sr { | 6932 | pub const fn ps(&self) -> super::vals::Ps { |
| 8215 | fn default() -> Sr { | 6933 | let val = (self.0 >> 9usize) & 0x01; |
| 8216 | Sr(0) | 6934 | super::vals::Ps(val as u8) |
| 8217 | } | 6935 | } |
| 8218 | } | 6936 | #[doc = "Parity selection"] |
| 8219 | #[doc = "CRC polynomial register"] | 6937 | pub fn set_ps(&mut self, val: super::vals::Ps) { |
| 8220 | #[repr(transparent)] | 6938 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); |
| 8221 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 8222 | pub struct Crcpr(pub u32); | ||
| 8223 | impl Crcpr { | ||
| 8224 | #[doc = "CRC polynomial register"] | ||
| 8225 | pub const fn crcpoly(&self) -> u16 { | ||
| 8226 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 8227 | val as u16 | ||
| 8228 | } | 6939 | } |
| 8229 | #[doc = "CRC polynomial register"] | 6940 | #[doc = "Parity control enable"] |
| 8230 | pub fn set_crcpoly(&mut self, val: u16) { | 6941 | pub const fn pce(&self) -> bool { |
| 8231 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | 6942 | let val = (self.0 >> 10usize) & 0x01; |
| 6943 | val != 0 | ||
| 6944 | } | ||
| 6945 | #[doc = "Parity control enable"] | ||
| 6946 | pub fn set_pce(&mut self, val: bool) { | ||
| 6947 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | ||
| 6948 | } | ||
| 6949 | #[doc = "Wakeup method"] | ||
| 6950 | pub const fn wake(&self) -> super::vals::Wake { | ||
| 6951 | let val = (self.0 >> 11usize) & 0x01; | ||
| 6952 | super::vals::Wake(val as u8) | ||
| 6953 | } | ||
| 6954 | #[doc = "Wakeup method"] | ||
| 6955 | pub fn set_wake(&mut self, val: super::vals::Wake) { | ||
| 6956 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); | ||
| 6957 | } | ||
| 6958 | #[doc = "Word length"] | ||
| 6959 | pub const fn m(&self) -> super::vals::M { | ||
| 6960 | let val = (self.0 >> 12usize) & 0x01; | ||
| 6961 | super::vals::M(val as u8) | ||
| 6962 | } | ||
| 6963 | #[doc = "Word length"] | ||
| 6964 | pub fn set_m(&mut self, val: super::vals::M) { | ||
| 6965 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 6966 | } | ||
| 6967 | #[doc = "USART enable"] | ||
| 6968 | pub const fn ue(&self) -> bool { | ||
| 6969 | let val = (self.0 >> 13usize) & 0x01; | ||
| 6970 | val != 0 | ||
| 6971 | } | ||
| 6972 | #[doc = "USART enable"] | ||
| 6973 | pub fn set_ue(&mut self, val: bool) { | ||
| 6974 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | ||
| 8232 | } | 6975 | } |
| 8233 | } | 6976 | } |
| 8234 | impl Default for Crcpr { | 6977 | impl Default for Cr1 { |
| 8235 | fn default() -> Crcpr { | 6978 | fn default() -> Cr1 { |
| 8236 | Crcpr(0) | 6979 | Cr1(0) |
| 8237 | } | 6980 | } |
| 8238 | } | 6981 | } |
| 8239 | #[doc = "data register"] | 6982 | #[doc = "Baud rate register"] |
| 8240 | #[repr(transparent)] | 6983 | #[repr(transparent)] |
| 8241 | #[derive(Copy, Clone, Eq, PartialEq)] | 6984 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 8242 | pub struct Dr(pub u32); | 6985 | pub struct Brr(pub u32); |
| 8243 | impl Dr { | 6986 | impl Brr { |
| 8244 | #[doc = "Data register"] | 6987 | #[doc = "fraction of USARTDIV"] |
| 8245 | pub const fn dr(&self) -> u16 { | 6988 | pub const fn div_fraction(&self) -> u8 { |
| 8246 | let val = (self.0 >> 0usize) & 0xffff; | 6989 | let val = (self.0 >> 0usize) & 0x0f; |
| 6990 | val as u8 | ||
| 6991 | } | ||
| 6992 | #[doc = "fraction of USARTDIV"] | ||
| 6993 | pub fn set_div_fraction(&mut self, val: u8) { | ||
| 6994 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); | ||
| 6995 | } | ||
| 6996 | #[doc = "mantissa of USARTDIV"] | ||
| 6997 | pub const fn div_mantissa(&self) -> u16 { | ||
| 6998 | let val = (self.0 >> 4usize) & 0x0fff; | ||
| 8247 | val as u16 | 6999 | val as u16 |
| 8248 | } | 7000 | } |
| 8249 | #[doc = "Data register"] | 7001 | #[doc = "mantissa of USARTDIV"] |
| 8250 | pub fn set_dr(&mut self, val: u16) { | 7002 | pub fn set_div_mantissa(&mut self, val: u16) { |
| 8251 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | 7003 | self.0 = (self.0 & !(0x0fff << 4usize)) | (((val as u32) & 0x0fff) << 4usize); |
| 8252 | } | 7004 | } |
| 8253 | } | 7005 | } |
| 8254 | impl Default for Dr { | 7006 | impl Default for Brr { |
| 8255 | fn default() -> Dr { | 7007 | fn default() -> Brr { |
| 8256 | Dr(0) | 7008 | Brr(0) |
| 8257 | } | 7009 | } |
| 8258 | } | 7010 | } |
| 8259 | #[doc = "control register 2"] | 7011 | #[doc = "Control register 3"] |
| 8260 | #[repr(transparent)] | 7012 | #[repr(transparent)] |
| 8261 | #[derive(Copy, Clone, Eq, PartialEq)] | 7013 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 8262 | pub struct Cr2(pub u32); | 7014 | pub struct Cr3(pub u32); |
| 8263 | impl Cr2 { | 7015 | impl Cr3 { |
| 8264 | #[doc = "Rx buffer DMA enable"] | 7016 | #[doc = "Error interrupt enable"] |
| 8265 | pub const fn rxdmaen(&self) -> bool { | 7017 | pub const fn eie(&self) -> bool { |
| 8266 | let val = (self.0 >> 0usize) & 0x01; | 7018 | let val = (self.0 >> 0usize) & 0x01; |
| 8267 | val != 0 | 7019 | val != 0 |
| 8268 | } | 7020 | } |
| 8269 | #[doc = "Rx buffer DMA enable"] | 7021 | #[doc = "Error interrupt enable"] |
| 8270 | pub fn set_rxdmaen(&mut self, val: bool) { | 7022 | pub fn set_eie(&mut self, val: bool) { |
| 8271 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 7023 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 8272 | } | 7024 | } |
| 8273 | #[doc = "Tx buffer DMA enable"] | 7025 | #[doc = "IrDA mode enable"] |
| 8274 | pub const fn txdmaen(&self) -> bool { | 7026 | pub const fn iren(&self) -> bool { |
| 8275 | let val = (self.0 >> 1usize) & 0x01; | 7027 | let val = (self.0 >> 1usize) & 0x01; |
| 8276 | val != 0 | 7028 | val != 0 |
| 8277 | } | 7029 | } |
| 8278 | #[doc = "Tx buffer DMA enable"] | 7030 | #[doc = "IrDA mode enable"] |
| 8279 | pub fn set_txdmaen(&mut self, val: bool) { | 7031 | pub fn set_iren(&mut self, val: bool) { |
| 8280 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 7032 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 8281 | } | 7033 | } |
| 8282 | #[doc = "SS output enable"] | 7034 | #[doc = "IrDA low-power"] |
| 8283 | pub const fn ssoe(&self) -> bool { | 7035 | pub const fn irlp(&self) -> super::vals::Irlp { |
| 8284 | let val = (self.0 >> 2usize) & 0x01; | 7036 | let val = (self.0 >> 2usize) & 0x01; |
| 8285 | val != 0 | 7037 | super::vals::Irlp(val as u8) |
| 8286 | } | ||
| 8287 | #[doc = "SS output enable"] | ||
| 8288 | pub fn set_ssoe(&mut self, val: bool) { | ||
| 8289 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 8290 | } | ||
| 8291 | #[doc = "Frame format"] | ||
| 8292 | pub const fn frf(&self) -> super::vals::Frf { | ||
| 8293 | let val = (self.0 >> 4usize) & 0x01; | ||
| 8294 | super::vals::Frf(val as u8) | ||
| 8295 | } | 7038 | } |
| 8296 | #[doc = "Frame format"] | 7039 | #[doc = "IrDA low-power"] |
| 8297 | pub fn set_frf(&mut self, val: super::vals::Frf) { | 7040 | pub fn set_irlp(&mut self, val: super::vals::Irlp) { |
| 8298 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | 7041 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); |
| 8299 | } | 7042 | } |
| 8300 | #[doc = "Error interrupt enable"] | 7043 | #[doc = "Half-duplex selection"] |
| 8301 | pub const fn errie(&self) -> bool { | 7044 | pub const fn hdsel(&self) -> super::vals::Hdsel { |
| 8302 | let val = (self.0 >> 5usize) & 0x01; | 7045 | let val = (self.0 >> 3usize) & 0x01; |
| 8303 | val != 0 | 7046 | super::vals::Hdsel(val as u8) |
| 8304 | } | 7047 | } |
| 8305 | #[doc = "Error interrupt enable"] | 7048 | #[doc = "Half-duplex selection"] |
| 8306 | pub fn set_errie(&mut self, val: bool) { | 7049 | pub fn set_hdsel(&mut self, val: super::vals::Hdsel) { |
| 8307 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 7050 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); |
| 8308 | } | 7051 | } |
| 8309 | #[doc = "RX buffer not empty interrupt enable"] | 7052 | #[doc = "DMA enable receiver"] |
| 8310 | pub const fn rxneie(&self) -> bool { | 7053 | pub const fn dmar(&self) -> bool { |
| 8311 | let val = (self.0 >> 6usize) & 0x01; | 7054 | let val = (self.0 >> 6usize) & 0x01; |
| 8312 | val != 0 | 7055 | val != 0 |
| 8313 | } | 7056 | } |
| 8314 | #[doc = "RX buffer not empty interrupt enable"] | 7057 | #[doc = "DMA enable receiver"] |
| 8315 | pub fn set_rxneie(&mut self, val: bool) { | 7058 | pub fn set_dmar(&mut self, val: bool) { |
| 8316 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 7059 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 8317 | } | 7060 | } |
| 8318 | #[doc = "Tx buffer empty interrupt enable"] | 7061 | #[doc = "DMA enable transmitter"] |
| 8319 | pub const fn txeie(&self) -> bool { | 7062 | pub const fn dmat(&self) -> bool { |
| 8320 | let val = (self.0 >> 7usize) & 0x01; | 7063 | let val = (self.0 >> 7usize) & 0x01; |
| 8321 | val != 0 | 7064 | val != 0 |
| 8322 | } | 7065 | } |
| 8323 | #[doc = "Tx buffer empty interrupt enable"] | 7066 | #[doc = "DMA enable transmitter"] |
| 8324 | pub fn set_txeie(&mut self, val: bool) { | 7067 | pub fn set_dmat(&mut self, val: bool) { |
| 8325 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 7068 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 8326 | } | 7069 | } |
| 8327 | } | 7070 | } |
| 8328 | impl Default for Cr2 { | 7071 | impl Default for Cr3 { |
| 8329 | fn default() -> Cr2 { | 7072 | fn default() -> Cr3 { |
| 8330 | Cr2(0) | 7073 | Cr3(0) |
| 8331 | } | 7074 | } |
| 8332 | } | 7075 | } |
| 8333 | #[doc = "control register 1"] | 7076 | #[doc = "Control register 2"] |
| 8334 | #[repr(transparent)] | 7077 | #[repr(transparent)] |
| 8335 | #[derive(Copy, Clone, Eq, PartialEq)] | 7078 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 8336 | pub struct Cr1(pub u32); | 7079 | pub struct Cr2(pub u32); |
| 8337 | impl Cr1 { | 7080 | impl Cr2 { |
| 8338 | #[doc = "Clock phase"] | 7081 | #[doc = "Address of the USART node"] |
| 8339 | pub const fn cpha(&self) -> super::vals::Cpha { | 7082 | pub const fn add(&self) -> u8 { |
| 8340 | let val = (self.0 >> 0usize) & 0x01; | 7083 | let val = (self.0 >> 0usize) & 0x0f; |
| 8341 | super::vals::Cpha(val as u8) | 7084 | val as u8 |
| 8342 | } | 7085 | } |
| 8343 | #[doc = "Clock phase"] | 7086 | #[doc = "Address of the USART node"] |
| 8344 | pub fn set_cpha(&mut self, val: super::vals::Cpha) { | 7087 | pub fn set_add(&mut self, val: u8) { |
| 8345 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | 7088 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); |
| 8346 | } | 7089 | } |
| 8347 | #[doc = "Clock polarity"] | 7090 | #[doc = "lin break detection length"] |
| 8348 | pub const fn cpol(&self) -> super::vals::Cpol { | 7091 | pub const fn lbdl(&self) -> super::vals::Lbdl { |
| 8349 | let val = (self.0 >> 1usize) & 0x01; | 7092 | let val = (self.0 >> 5usize) & 0x01; |
| 8350 | super::vals::Cpol(val as u8) | 7093 | super::vals::Lbdl(val as u8) |
| 8351 | } | 7094 | } |
| 8352 | #[doc = "Clock polarity"] | 7095 | #[doc = "lin break detection length"] |
| 8353 | pub fn set_cpol(&mut self, val: super::vals::Cpol) { | 7096 | pub fn set_lbdl(&mut self, val: super::vals::Lbdl) { |
| 8354 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | 7097 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); |
| 8355 | } | 7098 | } |
| 8356 | #[doc = "Master selection"] | 7099 | #[doc = "LIN break detection interrupt enable"] |
| 8357 | pub const fn mstr(&self) -> super::vals::Mstr { | 7100 | pub const fn lbdie(&self) -> bool { |
| 8358 | let val = (self.0 >> 2usize) & 0x01; | 7101 | let val = (self.0 >> 6usize) & 0x01; |
| 8359 | super::vals::Mstr(val as u8) | 7102 | val != 0 |
| 8360 | } | 7103 | } |
| 8361 | #[doc = "Master selection"] | 7104 | #[doc = "LIN break detection interrupt enable"] |
| 8362 | pub fn set_mstr(&mut self, val: super::vals::Mstr) { | 7105 | pub fn set_lbdie(&mut self, val: bool) { |
| 8363 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | 7106 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 8364 | } | 7107 | } |
| 8365 | #[doc = "Baud rate control"] | 7108 | #[doc = "STOP bits"] |
| 8366 | pub const fn br(&self) -> super::vals::Br { | 7109 | pub const fn stop(&self) -> super::vals::Stop { |
| 8367 | let val = (self.0 >> 3usize) & 0x07; | 7110 | let val = (self.0 >> 12usize) & 0x03; |
| 8368 | super::vals::Br(val as u8) | 7111 | super::vals::Stop(val as u8) |
| 8369 | } | 7112 | } |
| 8370 | #[doc = "Baud rate control"] | 7113 | #[doc = "STOP bits"] |
| 8371 | pub fn set_br(&mut self, val: super::vals::Br) { | 7114 | pub fn set_stop(&mut self, val: super::vals::Stop) { |
| 8372 | self.0 = (self.0 & !(0x07 << 3usize)) | (((val.0 as u32) & 0x07) << 3usize); | 7115 | self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize); |
| 8373 | } | 7116 | } |
| 8374 | #[doc = "SPI enable"] | 7117 | #[doc = "LIN mode enable"] |
| 8375 | pub const fn spe(&self) -> bool { | 7118 | pub const fn linen(&self) -> bool { |
| 8376 | let val = (self.0 >> 6usize) & 0x01; | 7119 | let val = (self.0 >> 14usize) & 0x01; |
| 8377 | val != 0 | 7120 | val != 0 |
| 8378 | } | 7121 | } |
| 8379 | #[doc = "SPI enable"] | 7122 | #[doc = "LIN mode enable"] |
| 8380 | pub fn set_spe(&mut self, val: bool) { | 7123 | pub fn set_linen(&mut self, val: bool) { |
| 8381 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 7124 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); |
| 8382 | } | 7125 | } |
| 8383 | #[doc = "Frame format"] | 7126 | } |
| 8384 | pub const fn lsbfirst(&self) -> super::vals::Lsbfirst { | 7127 | impl Default for Cr2 { |
| 8385 | let val = (self.0 >> 7usize) & 0x01; | 7128 | fn default() -> Cr2 { |
| 8386 | super::vals::Lsbfirst(val as u8) | 7129 | Cr2(0) |
| 8387 | } | 7130 | } |
| 8388 | #[doc = "Frame format"] | 7131 | } |
| 8389 | pub fn set_lsbfirst(&mut self, val: super::vals::Lsbfirst) { | 7132 | #[doc = "Guard time and prescaler register"] |
| 8390 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | 7133 | #[repr(transparent)] |
| 7134 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 7135 | pub struct Gtpr(pub u32); | ||
| 7136 | impl Gtpr { | ||
| 7137 | #[doc = "Prescaler value"] | ||
| 7138 | pub const fn psc(&self) -> u8 { | ||
| 7139 | let val = (self.0 >> 0usize) & 0xff; | ||
| 7140 | val as u8 | ||
| 8391 | } | 7141 | } |
| 8392 | #[doc = "Internal slave select"] | 7142 | #[doc = "Prescaler value"] |
| 8393 | pub const fn ssi(&self) -> bool { | 7143 | pub fn set_psc(&mut self, val: u8) { |
| 8394 | let val = (self.0 >> 8usize) & 0x01; | 7144 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); |
| 7145 | } | ||
| 7146 | #[doc = "Guard time value"] | ||
| 7147 | pub const fn gt(&self) -> u8 { | ||
| 7148 | let val = (self.0 >> 8usize) & 0xff; | ||
| 7149 | val as u8 | ||
| 7150 | } | ||
| 7151 | #[doc = "Guard time value"] | ||
| 7152 | pub fn set_gt(&mut self, val: u8) { | ||
| 7153 | self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize); | ||
| 7154 | } | ||
| 7155 | } | ||
| 7156 | impl Default for Gtpr { | ||
| 7157 | fn default() -> Gtpr { | ||
| 7158 | Gtpr(0) | ||
| 7159 | } | ||
| 7160 | } | ||
| 7161 | #[doc = "Status register"] | ||
| 7162 | #[repr(transparent)] | ||
| 7163 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 7164 | pub struct Sr(pub u32); | ||
| 7165 | impl Sr { | ||
| 7166 | #[doc = "Parity error"] | ||
| 7167 | pub const fn pe(&self) -> bool { | ||
| 7168 | let val = (self.0 >> 0usize) & 0x01; | ||
| 8395 | val != 0 | 7169 | val != 0 |
| 8396 | } | 7170 | } |
| 8397 | #[doc = "Internal slave select"] | 7171 | #[doc = "Parity error"] |
| 8398 | pub fn set_ssi(&mut self, val: bool) { | 7172 | pub fn set_pe(&mut self, val: bool) { |
| 8399 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 7173 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 8400 | } | 7174 | } |
| 8401 | #[doc = "Software slave management"] | 7175 | #[doc = "Framing error"] |
| 8402 | pub const fn ssm(&self) -> bool { | 7176 | pub const fn fe(&self) -> bool { |
| 8403 | let val = (self.0 >> 9usize) & 0x01; | 7177 | let val = (self.0 >> 1usize) & 0x01; |
| 8404 | val != 0 | 7178 | val != 0 |
| 8405 | } | 7179 | } |
| 8406 | #[doc = "Software slave management"] | 7180 | #[doc = "Framing error"] |
| 8407 | pub fn set_ssm(&mut self, val: bool) { | 7181 | pub fn set_fe(&mut self, val: bool) { |
| 8408 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | 7182 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 8409 | } | 7183 | } |
| 8410 | #[doc = "Receive only"] | 7184 | #[doc = "Noise error flag"] |
| 8411 | pub const fn rxonly(&self) -> super::vals::Rxonly { | 7185 | pub const fn ne(&self) -> bool { |
| 8412 | let val = (self.0 >> 10usize) & 0x01; | 7186 | let val = (self.0 >> 2usize) & 0x01; |
| 8413 | super::vals::Rxonly(val as u8) | 7187 | val != 0 |
| 8414 | } | 7188 | } |
| 8415 | #[doc = "Receive only"] | 7189 | #[doc = "Noise error flag"] |
| 8416 | pub fn set_rxonly(&mut self, val: super::vals::Rxonly) { | 7190 | pub fn set_ne(&mut self, val: bool) { |
| 8417 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); | 7191 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 8418 | } | 7192 | } |
| 8419 | #[doc = "Data frame format"] | 7193 | #[doc = "Overrun error"] |
| 8420 | pub const fn dff(&self) -> super::vals::Dff { | 7194 | pub const fn ore(&self) -> bool { |
| 8421 | let val = (self.0 >> 11usize) & 0x01; | 7195 | let val = (self.0 >> 3usize) & 0x01; |
| 8422 | super::vals::Dff(val as u8) | 7196 | val != 0 |
| 8423 | } | 7197 | } |
| 8424 | #[doc = "Data frame format"] | 7198 | #[doc = "Overrun error"] |
| 8425 | pub fn set_dff(&mut self, val: super::vals::Dff) { | 7199 | pub fn set_ore(&mut self, val: bool) { |
| 8426 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); | 7200 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); |
| 8427 | } | 7201 | } |
| 8428 | #[doc = "CRC transfer next"] | 7202 | #[doc = "IDLE line detected"] |
| 8429 | pub const fn crcnext(&self) -> super::vals::Crcnext { | 7203 | pub const fn idle(&self) -> bool { |
| 8430 | let val = (self.0 >> 12usize) & 0x01; | 7204 | let val = (self.0 >> 4usize) & 0x01; |
| 8431 | super::vals::Crcnext(val as u8) | 7205 | val != 0 |
| 8432 | } | 7206 | } |
| 8433 | #[doc = "CRC transfer next"] | 7207 | #[doc = "IDLE line detected"] |
| 8434 | pub fn set_crcnext(&mut self, val: super::vals::Crcnext) { | 7208 | pub fn set_idle(&mut self, val: bool) { |
| 8435 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | 7209 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 8436 | } | 7210 | } |
| 8437 | #[doc = "Hardware CRC calculation enable"] | 7211 | #[doc = "Read data register not empty"] |
| 8438 | pub const fn crcen(&self) -> bool { | 7212 | pub const fn rxne(&self) -> bool { |
| 8439 | let val = (self.0 >> 13usize) & 0x01; | 7213 | let val = (self.0 >> 5usize) & 0x01; |
| 8440 | val != 0 | 7214 | val != 0 |
| 8441 | } | 7215 | } |
| 8442 | #[doc = "Hardware CRC calculation enable"] | 7216 | #[doc = "Read data register not empty"] |
| 8443 | pub fn set_crcen(&mut self, val: bool) { | 7217 | pub fn set_rxne(&mut self, val: bool) { |
| 8444 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | 7218 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 8445 | } | 7219 | } |
| 8446 | #[doc = "Output enable in bidirectional mode"] | 7220 | #[doc = "Transmission complete"] |
| 8447 | pub const fn bidioe(&self) -> super::vals::Bidioe { | 7221 | pub const fn tc(&self) -> bool { |
| 8448 | let val = (self.0 >> 14usize) & 0x01; | 7222 | let val = (self.0 >> 6usize) & 0x01; |
| 8449 | super::vals::Bidioe(val as u8) | 7223 | val != 0 |
| 8450 | } | 7224 | } |
| 8451 | #[doc = "Output enable in bidirectional mode"] | 7225 | #[doc = "Transmission complete"] |
| 8452 | pub fn set_bidioe(&mut self, val: super::vals::Bidioe) { | 7226 | pub fn set_tc(&mut self, val: bool) { |
| 8453 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | 7227 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 8454 | } | 7228 | } |
| 8455 | #[doc = "Bidirectional data mode enable"] | 7229 | #[doc = "Transmit data register empty"] |
| 8456 | pub const fn bidimode(&self) -> super::vals::Bidimode { | 7230 | pub const fn txe(&self) -> bool { |
| 8457 | let val = (self.0 >> 15usize) & 0x01; | 7231 | let val = (self.0 >> 7usize) & 0x01; |
| 8458 | super::vals::Bidimode(val as u8) | 7232 | val != 0 |
| 8459 | } | 7233 | } |
| 8460 | #[doc = "Bidirectional data mode enable"] | 7234 | #[doc = "Transmit data register empty"] |
| 8461 | pub fn set_bidimode(&mut self, val: super::vals::Bidimode) { | 7235 | pub fn set_txe(&mut self, val: bool) { |
| 8462 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | 7236 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 7237 | } | ||
| 7238 | #[doc = "LIN break detection flag"] | ||
| 7239 | pub const fn lbd(&self) -> bool { | ||
| 7240 | let val = (self.0 >> 8usize) & 0x01; | ||
| 7241 | val != 0 | ||
| 7242 | } | ||
| 7243 | #[doc = "LIN break detection flag"] | ||
| 7244 | pub fn set_lbd(&mut self, val: bool) { | ||
| 7245 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 8463 | } | 7246 | } |
| 8464 | } | 7247 | } |
| 8465 | impl Default for Cr1 { | 7248 | impl Default for Sr { |
| 8466 | fn default() -> Cr1 { | 7249 | fn default() -> Sr { |
| 8467 | Cr1(0) | 7250 | Sr(0) |
| 8468 | } | 7251 | } |
| 8469 | } | 7252 | } |
| 8470 | #[doc = "RX CRC register"] | 7253 | #[doc = "Data register"] |
| 8471 | #[repr(transparent)] | 7254 | #[repr(transparent)] |
| 8472 | #[derive(Copy, Clone, Eq, PartialEq)] | 7255 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 8473 | pub struct Rxcrcr(pub u32); | 7256 | pub struct Dr(pub u32); |
| 8474 | impl Rxcrcr { | 7257 | impl Dr { |
| 8475 | #[doc = "Rx CRC register"] | 7258 | #[doc = "Data value"] |
| 8476 | pub const fn rx_crc(&self) -> u16 { | 7259 | pub const fn dr(&self) -> u16 { |
| 8477 | let val = (self.0 >> 0usize) & 0xffff; | 7260 | let val = (self.0 >> 0usize) & 0x01ff; |
| 8478 | val as u16 | 7261 | val as u16 |
| 8479 | } | 7262 | } |
| 8480 | #[doc = "Rx CRC register"] | 7263 | #[doc = "Data value"] |
| 8481 | pub fn set_rx_crc(&mut self, val: u16) { | 7264 | pub fn set_dr(&mut self, val: u16) { |
| 8482 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | 7265 | self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize); |
| 8483 | } | 7266 | } |
| 8484 | } | 7267 | } |
| 8485 | impl Default for Rxcrcr { | 7268 | impl Default for Dr { |
| 8486 | fn default() -> Rxcrcr { | 7269 | fn default() -> Dr { |
| 8487 | Rxcrcr(0) | 7270 | Dr(0) |
| 8488 | } | 7271 | } |
| 8489 | } | 7272 | } |
| 8490 | } | 7273 | } |
| @@ -8492,74 +7275,176 @@ pub mod spi_v1 { | |||
| 8492 | use crate::generic::*; | 7275 | use crate::generic::*; |
| 8493 | #[repr(transparent)] | 7276 | #[repr(transparent)] |
| 8494 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7277 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8495 | pub struct Br(pub u8); | 7278 | pub struct Ps(pub u8); |
| 8496 | impl Br { | 7279 | impl Ps { |
| 8497 | #[doc = "f_PCLK / 2"] | 7280 | #[doc = "Even parity"] |
| 8498 | pub const DIV2: Self = Self(0); | 7281 | pub const EVEN: Self = Self(0); |
| 8499 | #[doc = "f_PCLK / 4"] | 7282 | #[doc = "Odd parity"] |
| 8500 | pub const DIV4: Self = Self(0x01); | 7283 | pub const ODD: Self = Self(0x01); |
| 8501 | #[doc = "f_PCLK / 8"] | ||
| 8502 | pub const DIV8: Self = Self(0x02); | ||
| 8503 | #[doc = "f_PCLK / 16"] | ||
| 8504 | pub const DIV16: Self = Self(0x03); | ||
| 8505 | #[doc = "f_PCLK / 32"] | ||
| 8506 | pub const DIV32: Self = Self(0x04); | ||
| 8507 | #[doc = "f_PCLK / 64"] | ||
| 8508 | pub const DIV64: Self = Self(0x05); | ||
| 8509 | #[doc = "f_PCLK / 128"] | ||
| 8510 | pub const DIV128: Self = Self(0x06); | ||
| 8511 | #[doc = "f_PCLK / 256"] | ||
| 8512 | pub const DIV256: Self = Self(0x07); | ||
| 8513 | } | 7284 | } |
| 8514 | #[repr(transparent)] | 7285 | #[repr(transparent)] |
| 8515 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7286 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8516 | pub struct Lsbfirst(pub u8); | 7287 | pub struct Rwu(pub u8); |
| 8517 | impl Lsbfirst { | 7288 | impl Rwu { |
| 8518 | #[doc = "Data is transmitted/received with the MSB first"] | 7289 | #[doc = "Receiver in active mode"] |
| 8519 | pub const MSBFIRST: Self = Self(0); | 7290 | pub const ACTIVE: Self = Self(0); |
| 8520 | #[doc = "Data is transmitted/received with the LSB first"] | 7291 | #[doc = "Receiver in mute mode"] |
| 8521 | pub const LSBFIRST: Self = Self(0x01); | 7292 | pub const MUTE: Self = Self(0x01); |
| 8522 | } | 7293 | } |
| 8523 | #[repr(transparent)] | 7294 | #[repr(transparent)] |
| 8524 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7295 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8525 | pub struct Dff(pub u8); | 7296 | pub struct Lbdl(pub u8); |
| 8526 | impl Dff { | 7297 | impl Lbdl { |
| 8527 | #[doc = "8-bit data frame format is selected for transmission/reception"] | 7298 | #[doc = "10-bit break detection"] |
| 8528 | pub const EIGHTBIT: Self = Self(0); | 7299 | pub const LBDL10: Self = Self(0); |
| 8529 | #[doc = "16-bit data frame format is selected for transmission/reception"] | 7300 | #[doc = "11-bit break detection"] |
| 8530 | pub const SIXTEENBIT: Self = Self(0x01); | 7301 | pub const LBDL11: Self = Self(0x01); |
| 8531 | } | 7302 | } |
| 8532 | #[repr(transparent)] | 7303 | #[repr(transparent)] |
| 8533 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7304 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8534 | pub struct Crcnext(pub u8); | 7305 | pub struct Cpha(pub u8); |
| 8535 | impl Crcnext { | 7306 | impl Cpha { |
| 8536 | #[doc = "Next transmit value is from Tx buffer"] | 7307 | #[doc = "The first clock transition is the first data capture edge"] |
| 8537 | pub const TXBUFFER: Self = Self(0); | 7308 | pub const FIRST: Self = Self(0); |
| 8538 | #[doc = "Next transmit value is from Tx CRC register"] | 7309 | #[doc = "The second clock transition is the first data capture edge"] |
| 8539 | pub const CRC: Self = Self(0x01); | 7310 | pub const SECOND: Self = Self(0x01); |
| 8540 | } | 7311 | } |
| 8541 | #[repr(transparent)] | 7312 | #[repr(transparent)] |
| 8542 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7313 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8543 | pub struct Bidimode(pub u8); | 7314 | pub struct Cpol(pub u8); |
| 8544 | impl Bidimode { | 7315 | impl Cpol { |
| 8545 | #[doc = "2-line unidirectional data mode selected"] | 7316 | #[doc = "Steady low value on CK pin outside transmission window"] |
| 8546 | pub const UNIDIRECTIONAL: Self = Self(0); | 7317 | pub const LOW: Self = Self(0); |
| 8547 | #[doc = "1-line bidirectional data mode selected"] | 7318 | #[doc = "Steady high value on CK pin outside transmission window"] |
| 8548 | pub const BIDIRECTIONAL: Self = Self(0x01); | 7319 | pub const HIGH: Self = Self(0x01); |
| 8549 | } | 7320 | } |
| 8550 | #[repr(transparent)] | 7321 | #[repr(transparent)] |
| 8551 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7322 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8552 | pub struct Frer(pub u8); | 7323 | pub struct Wake(pub u8); |
| 8553 | impl Frer { | 7324 | impl Wake { |
| 8554 | #[doc = "No frame format error"] | 7325 | #[doc = "USART wakeup on idle line"] |
| 8555 | pub const NOERROR: Self = Self(0); | 7326 | pub const IDLELINE: Self = Self(0); |
| 8556 | #[doc = "A frame format error occurred"] | 7327 | #[doc = "USART wakeup on address mark"] |
| 8557 | pub const ERROR: Self = Self(0x01); | 7328 | pub const ADDRESSMARK: Self = Self(0x01); |
| 8558 | } | 7329 | } |
| 8559 | #[repr(transparent)] | 7330 | #[repr(transparent)] |
| 8560 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7331 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8561 | pub struct Mstr(pub u8); | 7332 | pub struct Hdsel(pub u8); |
| 8562 | impl Mstr { | 7333 | impl Hdsel { |
| 7334 | #[doc = "Half duplex mode is not selected"] | ||
| 7335 | pub const FULLDUPLEX: Self = Self(0); | ||
| 7336 | #[doc = "Half duplex mode is selected"] | ||
| 7337 | pub const HALFDUPLEX: Self = Self(0x01); | ||
| 7338 | } | ||
| 7339 | #[repr(transparent)] | ||
| 7340 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7341 | pub struct Irlp(pub u8); | ||
| 7342 | impl Irlp { | ||
| 7343 | #[doc = "Normal mode"] | ||
| 7344 | pub const NORMAL: Self = Self(0); | ||
| 7345 | #[doc = "Low-power mode"] | ||
| 7346 | pub const LOWPOWER: Self = Self(0x01); | ||
| 7347 | } | ||
| 7348 | #[repr(transparent)] | ||
| 7349 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7350 | pub struct M(pub u8); | ||
| 7351 | impl M { | ||
| 7352 | #[doc = "8 data bits"] | ||
| 7353 | pub const M8: Self = Self(0); | ||
| 7354 | #[doc = "9 data bits"] | ||
| 7355 | pub const M9: Self = Self(0x01); | ||
| 7356 | } | ||
| 7357 | #[repr(transparent)] | ||
| 7358 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7359 | pub struct Stop(pub u8); | ||
| 7360 | impl Stop { | ||
| 7361 | #[doc = "1 stop bit"] | ||
| 7362 | pub const STOP1: Self = Self(0); | ||
| 7363 | #[doc = "0.5 stop bits"] | ||
| 7364 | pub const STOP0P5: Self = Self(0x01); | ||
| 7365 | #[doc = "2 stop bits"] | ||
| 7366 | pub const STOP2: Self = Self(0x02); | ||
| 7367 | #[doc = "1.5 stop bits"] | ||
| 7368 | pub const STOP1P5: Self = Self(0x03); | ||
| 7369 | } | ||
| 7370 | #[repr(transparent)] | ||
| 7371 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7372 | pub struct Sbk(pub u8); | ||
| 7373 | impl Sbk { | ||
| 7374 | #[doc = "No break character is transmitted"] | ||
| 7375 | pub const NOBREAK: Self = Self(0); | ||
| 7376 | #[doc = "Break character transmitted"] | ||
| 7377 | pub const BREAK: Self = Self(0x01); | ||
| 7378 | } | ||
| 7379 | } | ||
| 7380 | } | ||
| 7381 | pub mod spi_v3 { | ||
| 7382 | use crate::generic::*; | ||
| 7383 | #[doc = "Serial peripheral interface"] | ||
| 7384 | #[derive(Copy, Clone)] | ||
| 7385 | pub struct Spi(pub *mut u8); | ||
| 7386 | unsafe impl Send for Spi {} | ||
| 7387 | unsafe impl Sync for Spi {} | ||
| 7388 | impl Spi { | ||
| 7389 | #[doc = "control register 1"] | ||
| 7390 | pub fn cr1(self) -> Reg<regs::Cr1, RW> { | ||
| 7391 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 7392 | } | ||
| 7393 | #[doc = "control register 2"] | ||
| 7394 | pub fn cr2(self) -> Reg<regs::Cr2, RW> { | ||
| 7395 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 7396 | } | ||
| 7397 | #[doc = "configuration register 1"] | ||
| 7398 | pub fn cfg1(self) -> Reg<regs::Cfg1, RW> { | ||
| 7399 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 7400 | } | ||
| 7401 | #[doc = "configuration register 2"] | ||
| 7402 | pub fn cfg2(self) -> Reg<regs::Cfg2, RW> { | ||
| 7403 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 7404 | } | ||
| 7405 | #[doc = "Interrupt Enable Register"] | ||
| 7406 | pub fn ier(self) -> Reg<regs::Ier, RW> { | ||
| 7407 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 7408 | } | ||
| 7409 | #[doc = "Status Register"] | ||
| 7410 | pub fn sr(self) -> Reg<regs::Sr, R> { | ||
| 7411 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 7412 | } | ||
| 7413 | #[doc = "Interrupt/Status Flags Clear Register"] | ||
| 7414 | pub fn ifcr(self) -> Reg<regs::Ifcr, W> { | ||
| 7415 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | ||
| 7416 | } | ||
| 7417 | #[doc = "Transmit Data Register"] | ||
| 7418 | pub fn txdr(self) -> Reg<regs::Txdr, W> { | ||
| 7419 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | ||
| 7420 | } | ||
| 7421 | #[doc = "Receive Data Register"] | ||
| 7422 | pub fn rxdr(self) -> Reg<regs::Rxdr, R> { | ||
| 7423 | unsafe { Reg::from_ptr(self.0.add(48usize)) } | ||
| 7424 | } | ||
| 7425 | #[doc = "Polynomial Register"] | ||
| 7426 | pub fn crcpoly(self) -> Reg<regs::Crcpoly, RW> { | ||
| 7427 | unsafe { Reg::from_ptr(self.0.add(64usize)) } | ||
| 7428 | } | ||
| 7429 | #[doc = "Transmitter CRC Register"] | ||
| 7430 | pub fn txcrc(self) -> Reg<regs::Txcrc, RW> { | ||
| 7431 | unsafe { Reg::from_ptr(self.0.add(68usize)) } | ||
| 7432 | } | ||
| 7433 | #[doc = "Receiver CRC Register"] | ||
| 7434 | pub fn rxcrc(self) -> Reg<regs::Rxcrc, RW> { | ||
| 7435 | unsafe { Reg::from_ptr(self.0.add(72usize)) } | ||
| 7436 | } | ||
| 7437 | #[doc = "Underrun Data Register"] | ||
| 7438 | pub fn udrdr(self) -> Reg<regs::Udrdr, RW> { | ||
| 7439 | unsafe { Reg::from_ptr(self.0.add(76usize)) } | ||
| 7440 | } | ||
| 7441 | } | ||
| 7442 | pub mod vals { | ||
| 7443 | use crate::generic::*; | ||
| 7444 | #[repr(transparent)] | ||
| 7445 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7446 | pub struct Master(pub u8); | ||
| 7447 | impl Master { | ||
| 8563 | #[doc = "Slave configuration"] | 7448 | #[doc = "Slave configuration"] |
| 8564 | pub const SLAVE: Self = Self(0); | 7449 | pub const SLAVE: Self = Self(0); |
| 8565 | #[doc = "Master configuration"] | 7450 | #[doc = "Master configuration"] |
| @@ -8567,15 +7452,6 @@ pub mod spi_v1 { | |||
| 8567 | } | 7452 | } |
| 8568 | #[repr(transparent)] | 7453 | #[repr(transparent)] |
| 8569 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7454 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8570 | pub struct Rxonly(pub u8); | ||
| 8571 | impl Rxonly { | ||
| 8572 | #[doc = "Full duplex (Transmit and receive)"] | ||
| 8573 | pub const FULLDUPLEX: Self = Self(0); | ||
| 8574 | #[doc = "Output disabled (Receive-only mode)"] | ||
| 8575 | pub const OUTPUTDISABLED: Self = Self(0x01); | ||
| 8576 | } | ||
| 8577 | #[repr(transparent)] | ||
| 8578 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 8579 | pub struct Cpha(pub u8); | 7455 | pub struct Cpha(pub u8); |
| 8580 | impl Cpha { | 7456 | impl Cpha { |
| 8581 | #[doc = "The first clock transition is the first data capture edge"] | 7457 | #[doc = "The first clock transition is the first data capture edge"] |
| @@ -8585,16 +7461,75 @@ pub mod spi_v1 { | |||
| 8585 | } | 7461 | } |
| 8586 | #[repr(transparent)] | 7462 | #[repr(transparent)] |
| 8587 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7463 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8588 | pub struct Iscfg(pub u8); | 7464 | pub struct Datlen(pub u8); |
| 8589 | impl Iscfg { | 7465 | impl Datlen { |
| 8590 | #[doc = "Slave - transmit"] | 7466 | #[doc = "16 bit data length"] |
| 8591 | pub const SLAVETX: Self = Self(0); | 7467 | pub const BITS16: Self = Self(0); |
| 8592 | #[doc = "Slave - receive"] | 7468 | #[doc = "24 bit data length"] |
| 8593 | pub const SLAVERX: Self = Self(0x01); | 7469 | pub const BITS24: Self = Self(0x01); |
| 8594 | #[doc = "Master - transmit"] | 7470 | #[doc = "32 bit data length"] |
| 8595 | pub const MASTERTX: Self = Self(0x02); | 7471 | pub const BITS32: Self = Self(0x02); |
| 8596 | #[doc = "Master - receive"] | 7472 | } |
| 8597 | pub const MASTERRX: Self = Self(0x03); | 7473 | #[repr(transparent)] |
| 7474 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7475 | pub struct Comm(pub u8); | ||
| 7476 | impl Comm { | ||
| 7477 | #[doc = "Full duplex"] | ||
| 7478 | pub const FULLDUPLEX: Self = Self(0); | ||
| 7479 | #[doc = "Simplex transmitter only"] | ||
| 7480 | pub const TRANSMITTER: Self = Self(0x01); | ||
| 7481 | #[doc = "Simplex receiver only"] | ||
| 7482 | pub const RECEIVER: Self = Self(0x02); | ||
| 7483 | #[doc = "Half duplex"] | ||
| 7484 | pub const HALFDUPLEX: Self = Self(0x03); | ||
| 7485 | } | ||
| 7486 | #[repr(transparent)] | ||
| 7487 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7488 | pub struct Ssiop(pub u8); | ||
| 7489 | impl Ssiop { | ||
| 7490 | #[doc = "Low level is active for SS signal"] | ||
| 7491 | pub const ACTIVELOW: Self = Self(0); | ||
| 7492 | #[doc = "High level is active for SS signal"] | ||
| 7493 | pub const ACTIVEHIGH: Self = Self(0x01); | ||
| 7494 | } | ||
| 7495 | #[repr(transparent)] | ||
| 7496 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7497 | pub struct Datfmt(pub u8); | ||
| 7498 | impl Datfmt { | ||
| 7499 | #[doc = "The data inside RXDR and TXDR are right aligned"] | ||
| 7500 | pub const RIGHTALIGNED: Self = Self(0); | ||
| 7501 | #[doc = "The data inside RXDR and TXDR are left aligned"] | ||
| 7502 | pub const LEFTALIGNED: Self = Self(0x01); | ||
| 7503 | } | ||
| 7504 | #[repr(transparent)] | ||
| 7505 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7506 | pub struct Tcrcini(pub u8); | ||
| 7507 | impl Tcrcini { | ||
| 7508 | #[doc = "All zeros TX CRC initialization pattern"] | ||
| 7509 | pub const ALLZEROS: Self = Self(0); | ||
| 7510 | #[doc = "All ones TX CRC initialization pattern"] | ||
| 7511 | pub const ALLONES: Self = Self(0x01); | ||
| 7512 | } | ||
| 7513 | #[repr(transparent)] | ||
| 7514 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7515 | pub struct Mbr(pub u8); | ||
| 7516 | impl Mbr { | ||
| 7517 | #[doc = "f_spi_ker_ck / 2"] | ||
| 7518 | pub const DIV2: Self = Self(0); | ||
| 7519 | #[doc = "f_spi_ker_ck / 4"] | ||
| 7520 | pub const DIV4: Self = Self(0x01); | ||
| 7521 | #[doc = "f_spi_ker_ck / 8"] | ||
| 7522 | pub const DIV8: Self = Self(0x02); | ||
| 7523 | #[doc = "f_spi_ker_ck / 16"] | ||
| 7524 | pub const DIV16: Self = Self(0x03); | ||
| 7525 | #[doc = "f_spi_ker_ck / 32"] | ||
| 7526 | pub const DIV32: Self = Self(0x04); | ||
| 7527 | #[doc = "f_spi_ker_ck / 64"] | ||
| 7528 | pub const DIV64: Self = Self(0x05); | ||
| 7529 | #[doc = "f_spi_ker_ck / 128"] | ||
| 7530 | pub const DIV128: Self = Self(0x06); | ||
| 7531 | #[doc = "f_spi_ker_ck / 256"] | ||
| 7532 | pub const DIV256: Self = Self(0x07); | ||
| 8598 | } | 7533 | } |
| 8599 | #[repr(transparent)] | 7534 | #[repr(transparent)] |
| 8600 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7535 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| @@ -8607,754 +7542,1259 @@ pub mod spi_v1 { | |||
| 8607 | } | 7542 | } |
| 8608 | #[repr(transparent)] | 7543 | #[repr(transparent)] |
| 8609 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7544 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8610 | pub struct Frf(pub u8); | 7545 | pub struct Udrdet(pub u8); |
| 8611 | impl Frf { | 7546 | impl Udrdet { |
| 8612 | #[doc = "SPI Motorola mode"] | 7547 | #[doc = "Underrun is detected at begin of data frame"] |
| 8613 | pub const MOTOROLA: Self = Self(0); | 7548 | pub const STARTOFFRAME: Self = Self(0); |
| 8614 | #[doc = "SPI TI mode"] | 7549 | #[doc = "Underrun is detected at end of last data frame"] |
| 8615 | pub const TI: Self = Self(0x01); | 7550 | pub const ENDOFFRAME: Self = Self(0x01); |
| 7551 | #[doc = "Underrun is detected at begin of active SS signal"] | ||
| 7552 | pub const STARTOFSLAVESELECT: Self = Self(0x02); | ||
| 8616 | } | 7553 | } |
| 8617 | #[repr(transparent)] | 7554 | #[repr(transparent)] |
| 8618 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7555 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8619 | pub struct Bidioe(pub u8); | 7556 | pub struct Rxwne(pub u8); |
| 8620 | impl Bidioe { | 7557 | impl Rxwne { |
| 8621 | #[doc = "Output disabled (receive-only mode)"] | 7558 | #[doc = "Less than 32-bit data frame received"] |
| 8622 | pub const OUTPUTDISABLED: Self = Self(0); | 7559 | pub const LESSTHAN32: Self = Self(0); |
| 8623 | #[doc = "Output enabled (transmit-only mode)"] | 7560 | #[doc = "At least 32-bit data frame received"] |
| 8624 | pub const OUTPUTENABLED: Self = Self(0x01); | 7561 | pub const ATLEAST32: Self = Self(0x01); |
| 8625 | } | ||
| 8626 | } | ||
| 8627 | } | ||
| 8628 | pub mod syscfg_l4 { | ||
| 8629 | use crate::generic::*; | ||
| 8630 | #[doc = "System configuration controller"] | ||
| 8631 | #[derive(Copy, Clone)] | ||
| 8632 | pub struct Syscfg(pub *mut u8); | ||
| 8633 | unsafe impl Send for Syscfg {} | ||
| 8634 | unsafe impl Sync for Syscfg {} | ||
| 8635 | impl Syscfg { | ||
| 8636 | #[doc = "memory remap register"] | ||
| 8637 | pub fn memrmp(self) -> Reg<regs::Memrmp, RW> { | ||
| 8638 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 8639 | } | 7562 | } |
| 8640 | #[doc = "configuration register 1"] | 7563 | #[repr(transparent)] |
| 8641 | pub fn cfgr1(self) -> Reg<regs::Cfgr1, RW> { | 7564 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8642 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | 7565 | pub struct Crc(pub u8); |
| 8643 | } | 7566 | impl Crc { |
| 8644 | #[doc = "external interrupt configuration register 1"] | 7567 | #[doc = "Full size (33/17 bit) CRC polynomial is not used"] |
| 8645 | pub fn exticr(self, n: usize) -> Reg<regs::Exticr, RW> { | 7568 | pub const DISABLED: Self = Self(0); |
| 8646 | assert!(n < 4usize); | 7569 | #[doc = "Full size (33/17 bit) CRC polynomial is used"] |
| 8647 | unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) } | 7570 | pub const ENABLED: Self = Self(0x01); |
| 8648 | } | ||
| 8649 | #[doc = "SCSR"] | ||
| 8650 | pub fn scsr(self) -> Reg<regs::Scsr, RW> { | ||
| 8651 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | ||
| 8652 | } | 7571 | } |
| 8653 | #[doc = "CFGR2"] | 7572 | #[repr(transparent)] |
| 8654 | pub fn cfgr2(self) -> Reg<regs::Cfgr2, RW> { | 7573 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8655 | unsafe { Reg::from_ptr(self.0.add(28usize)) } | 7574 | pub struct Hddir(pub u8); |
| 7575 | impl Hddir { | ||
| 7576 | #[doc = "Receiver in half duplex mode"] | ||
| 7577 | pub const RECEIVER: Self = Self(0); | ||
| 7578 | #[doc = "Transmitter in half duplex mode"] | ||
| 7579 | pub const TRANSMITTER: Self = Self(0x01); | ||
| 8656 | } | 7580 | } |
| 8657 | #[doc = "SWPR"] | 7581 | #[repr(transparent)] |
| 8658 | pub fn swpr(self) -> Reg<regs::Swpr, W> { | 7582 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8659 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | 7583 | pub struct Sp(pub u8); |
| 7584 | impl Sp { | ||
| 7585 | #[doc = "Motorola SPI protocol"] | ||
| 7586 | pub const MOTOROLA: Self = Self(0); | ||
| 7587 | #[doc = "TI SPI protocol"] | ||
| 7588 | pub const TI: Self = Self(0x01); | ||
| 8660 | } | 7589 | } |
| 8661 | #[doc = "SKR"] | 7590 | #[repr(transparent)] |
| 8662 | pub fn skr(self) -> Reg<regs::Skr, W> { | 7591 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8663 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | 7592 | pub struct Rxplvl(pub u8); |
| 7593 | impl Rxplvl { | ||
| 7594 | #[doc = "Zero frames beyond packing ratio available"] | ||
| 7595 | pub const ZEROFRAMES: Self = Self(0); | ||
| 7596 | #[doc = "One frame beyond packing ratio available"] | ||
| 7597 | pub const ONEFRAME: Self = Self(0x01); | ||
| 7598 | #[doc = "Two frame beyond packing ratio available"] | ||
| 7599 | pub const TWOFRAMES: Self = Self(0x02); | ||
| 7600 | #[doc = "Three frame beyond packing ratio available"] | ||
| 7601 | pub const THREEFRAMES: Self = Self(0x03); | ||
| 7602 | } | ||
| 7603 | #[repr(transparent)] | ||
| 7604 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7605 | pub struct Ssom(pub u8); | ||
| 7606 | impl Ssom { | ||
| 7607 | #[doc = "SS is asserted until data transfer complete"] | ||
| 7608 | pub const ASSERTED: Self = Self(0); | ||
| 7609 | #[doc = "Data frames interleaved with SS not asserted during MIDI"] | ||
| 7610 | pub const NOTASSERTED: Self = Self(0x01); | ||
| 7611 | } | ||
| 7612 | #[repr(transparent)] | ||
| 7613 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7614 | pub struct Fthlv(pub u8); | ||
| 7615 | impl Fthlv { | ||
| 7616 | #[doc = "1 frame"] | ||
| 7617 | pub const ONEFRAME: Self = Self(0); | ||
| 7618 | #[doc = "2 frames"] | ||
| 7619 | pub const TWOFRAMES: Self = Self(0x01); | ||
| 7620 | #[doc = "3 frames"] | ||
| 7621 | pub const THREEFRAMES: Self = Self(0x02); | ||
| 7622 | #[doc = "4 frames"] | ||
| 7623 | pub const FOURFRAMES: Self = Self(0x03); | ||
| 7624 | #[doc = "5 frames"] | ||
| 7625 | pub const FIVEFRAMES: Self = Self(0x04); | ||
| 7626 | #[doc = "6 frames"] | ||
| 7627 | pub const SIXFRAMES: Self = Self(0x05); | ||
| 7628 | #[doc = "7 frames"] | ||
| 7629 | pub const SEVENFRAMES: Self = Self(0x06); | ||
| 7630 | #[doc = "8 frames"] | ||
| 7631 | pub const EIGHTFRAMES: Self = Self(0x07); | ||
| 7632 | #[doc = "9 frames"] | ||
| 7633 | pub const NINEFRAMES: Self = Self(0x08); | ||
| 7634 | #[doc = "10 frames"] | ||
| 7635 | pub const TENFRAMES: Self = Self(0x09); | ||
| 7636 | #[doc = "11 frames"] | ||
| 7637 | pub const ELEVENFRAMES: Self = Self(0x0a); | ||
| 7638 | #[doc = "12 frames"] | ||
| 7639 | pub const TWELVEFRAMES: Self = Self(0x0b); | ||
| 7640 | #[doc = "13 frames"] | ||
| 7641 | pub const THIRTEENFRAMES: Self = Self(0x0c); | ||
| 7642 | #[doc = "14 frames"] | ||
| 7643 | pub const FOURTEENFRAMES: Self = Self(0x0d); | ||
| 7644 | #[doc = "15 frames"] | ||
| 7645 | pub const FIFTEENFRAMES: Self = Self(0x0e); | ||
| 7646 | #[doc = "16 frames"] | ||
| 7647 | pub const SIXTEENFRAMES: Self = Self(0x0f); | ||
| 7648 | } | ||
| 7649 | #[repr(transparent)] | ||
| 7650 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7651 | pub struct Afcntr(pub u8); | ||
| 7652 | impl Afcntr { | ||
| 7653 | #[doc = "Peripheral takes no control of GPIOs while disabled"] | ||
| 7654 | pub const NOTCONTROLLED: Self = Self(0); | ||
| 7655 | #[doc = "Peripheral controls GPIOs while disabled"] | ||
| 7656 | pub const CONTROLLED: Self = Self(0x01); | ||
| 7657 | } | ||
| 7658 | #[repr(transparent)] | ||
| 7659 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7660 | pub struct Udrcfg(pub u8); | ||
| 7661 | impl Udrcfg { | ||
| 7662 | #[doc = "Slave sends a constant underrun pattern"] | ||
| 7663 | pub const CONSTANT: Self = Self(0); | ||
| 7664 | #[doc = "Slave repeats last received data frame from master"] | ||
| 7665 | pub const REPEATRECEIVED: Self = Self(0x01); | ||
| 7666 | #[doc = "Slave repeats last transmitted data frame"] | ||
| 7667 | pub const REPEATTRANSMITTED: Self = Self(0x02); | ||
| 7668 | } | ||
| 7669 | #[repr(transparent)] | ||
| 7670 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7671 | pub struct Rcrcini(pub u8); | ||
| 7672 | impl Rcrcini { | ||
| 7673 | #[doc = "All zeros RX CRC initialization pattern"] | ||
| 7674 | pub const ALLZEROS: Self = Self(0); | ||
| 7675 | #[doc = "All ones RX CRC initialization pattern"] | ||
| 7676 | pub const ALLONES: Self = Self(0x01); | ||
| 7677 | } | ||
| 7678 | #[repr(transparent)] | ||
| 7679 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7680 | pub struct Lsbfrst(pub u8); | ||
| 7681 | impl Lsbfrst { | ||
| 7682 | #[doc = "Data is transmitted/received with the MSB first"] | ||
| 7683 | pub const MSBFIRST: Self = Self(0); | ||
| 7684 | #[doc = "Data is transmitted/received with the LSB first"] | ||
| 7685 | pub const LSBFIRST: Self = Self(0x01); | ||
| 8664 | } | 7686 | } |
| 8665 | } | 7687 | } |
| 8666 | pub mod regs { | 7688 | pub mod regs { |
| 8667 | use crate::generic::*; | 7689 | use crate::generic::*; |
| 8668 | #[doc = "CFGR2"] | 7690 | #[doc = "Underrun Data Register"] |
| 8669 | #[repr(transparent)] | 7691 | #[repr(transparent)] |
| 8670 | #[derive(Copy, Clone, Eq, PartialEq)] | 7692 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 8671 | pub struct Cfgr2(pub u32); | 7693 | pub struct Udrdr(pub u32); |
| 8672 | impl Cfgr2 { | 7694 | impl Udrdr { |
| 8673 | #[doc = "Cortex LOCKUP (Hardfault) output enable bit"] | 7695 | #[doc = "Data at slave underrun condition"] |
| 8674 | pub const fn cll(&self) -> bool { | 7696 | pub const fn udrdr(&self) -> u32 { |
| 8675 | let val = (self.0 >> 0usize) & 0x01; | 7697 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 7698 | val as u32 | ||
| 7699 | } | ||
| 7700 | #[doc = "Data at slave underrun condition"] | ||
| 7701 | pub fn set_udrdr(&mut self, val: u32) { | ||
| 7702 | self.0 = | ||
| 7703 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 7704 | } | ||
| 7705 | } | ||
| 7706 | impl Default for Udrdr { | ||
| 7707 | fn default() -> Udrdr { | ||
| 7708 | Udrdr(0) | ||
| 7709 | } | ||
| 7710 | } | ||
| 7711 | #[doc = "Polynomial Register"] | ||
| 7712 | #[repr(transparent)] | ||
| 7713 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 7714 | pub struct Crcpoly(pub u32); | ||
| 7715 | impl Crcpoly { | ||
| 7716 | #[doc = "CRC polynomial register"] | ||
| 7717 | pub const fn crcpoly(&self) -> u32 { | ||
| 7718 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 7719 | val as u32 | ||
| 7720 | } | ||
| 7721 | #[doc = "CRC polynomial register"] | ||
| 7722 | pub fn set_crcpoly(&mut self, val: u32) { | ||
| 7723 | self.0 = | ||
| 7724 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 7725 | } | ||
| 7726 | } | ||
| 7727 | impl Default for Crcpoly { | ||
| 7728 | fn default() -> Crcpoly { | ||
| 7729 | Crcpoly(0) | ||
| 7730 | } | ||
| 7731 | } | ||
| 7732 | #[doc = "Interrupt/Status Flags Clear Register"] | ||
| 7733 | #[repr(transparent)] | ||
| 7734 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 7735 | pub struct Ifcr(pub u32); | ||
| 7736 | impl Ifcr { | ||
| 7737 | #[doc = "End Of Transfer flag clear"] | ||
| 7738 | pub const fn eotc(&self) -> bool { | ||
| 7739 | let val = (self.0 >> 3usize) & 0x01; | ||
| 8676 | val != 0 | 7740 | val != 0 |
| 8677 | } | 7741 | } |
| 8678 | #[doc = "Cortex LOCKUP (Hardfault) output enable bit"] | 7742 | #[doc = "End Of Transfer flag clear"] |
| 8679 | pub fn set_cll(&mut self, val: bool) { | 7743 | pub fn set_eotc(&mut self, val: bool) { |
| 8680 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 7744 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); |
| 8681 | } | 7745 | } |
| 8682 | #[doc = "SRAM2 parity lock bit"] | 7746 | #[doc = "Transmission Transfer Filled flag clear"] |
| 8683 | pub const fn spl(&self) -> bool { | 7747 | pub const fn txtfc(&self) -> bool { |
| 8684 | let val = (self.0 >> 1usize) & 0x01; | 7748 | let val = (self.0 >> 4usize) & 0x01; |
| 8685 | val != 0 | 7749 | val != 0 |
| 8686 | } | 7750 | } |
| 8687 | #[doc = "SRAM2 parity lock bit"] | 7751 | #[doc = "Transmission Transfer Filled flag clear"] |
| 8688 | pub fn set_spl(&mut self, val: bool) { | 7752 | pub fn set_txtfc(&mut self, val: bool) { |
| 8689 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 7753 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 8690 | } | 7754 | } |
| 8691 | #[doc = "PVD lock enable bit"] | 7755 | #[doc = "Underrun flag clear"] |
| 8692 | pub const fn pvdl(&self) -> bool { | 7756 | pub const fn udrc(&self) -> bool { |
| 8693 | let val = (self.0 >> 2usize) & 0x01; | 7757 | let val = (self.0 >> 5usize) & 0x01; |
| 8694 | val != 0 | 7758 | val != 0 |
| 8695 | } | 7759 | } |
| 8696 | #[doc = "PVD lock enable bit"] | 7760 | #[doc = "Underrun flag clear"] |
| 8697 | pub fn set_pvdl(&mut self, val: bool) { | 7761 | pub fn set_udrc(&mut self, val: bool) { |
| 8698 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 7762 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 8699 | } | 7763 | } |
| 8700 | #[doc = "ECC Lock"] | 7764 | #[doc = "Overrun flag clear"] |
| 8701 | pub const fn eccl(&self) -> bool { | 7765 | pub const fn ovrc(&self) -> bool { |
| 8702 | let val = (self.0 >> 3usize) & 0x01; | 7766 | let val = (self.0 >> 6usize) & 0x01; |
| 8703 | val != 0 | 7767 | val != 0 |
| 8704 | } | 7768 | } |
| 8705 | #[doc = "ECC Lock"] | 7769 | #[doc = "Overrun flag clear"] |
| 8706 | pub fn set_eccl(&mut self, val: bool) { | 7770 | pub fn set_ovrc(&mut self, val: bool) { |
| 8707 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 7771 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 8708 | } | 7772 | } |
| 8709 | #[doc = "SRAM2 parity error flag"] | 7773 | #[doc = "CRC Error flag clear"] |
| 8710 | pub const fn spf(&self) -> bool { | 7774 | pub const fn crcec(&self) -> bool { |
| 7775 | let val = (self.0 >> 7usize) & 0x01; | ||
| 7776 | val != 0 | ||
| 7777 | } | ||
| 7778 | #[doc = "CRC Error flag clear"] | ||
| 7779 | pub fn set_crcec(&mut self, val: bool) { | ||
| 7780 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 7781 | } | ||
| 7782 | #[doc = "TI frame format error flag clear"] | ||
| 7783 | pub const fn tifrec(&self) -> bool { | ||
| 8711 | let val = (self.0 >> 8usize) & 0x01; | 7784 | let val = (self.0 >> 8usize) & 0x01; |
| 8712 | val != 0 | 7785 | val != 0 |
| 8713 | } | 7786 | } |
| 8714 | #[doc = "SRAM2 parity error flag"] | 7787 | #[doc = "TI frame format error flag clear"] |
| 8715 | pub fn set_spf(&mut self, val: bool) { | 7788 | pub fn set_tifrec(&mut self, val: bool) { |
| 8716 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 7789 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 8717 | } | 7790 | } |
| 7791 | #[doc = "Mode Fault flag clear"] | ||
| 7792 | pub const fn modfc(&self) -> bool { | ||
| 7793 | let val = (self.0 >> 9usize) & 0x01; | ||
| 7794 | val != 0 | ||
| 7795 | } | ||
| 7796 | #[doc = "Mode Fault flag clear"] | ||
| 7797 | pub fn set_modfc(&mut self, val: bool) { | ||
| 7798 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | ||
| 7799 | } | ||
| 7800 | #[doc = "TSERFC flag clear"] | ||
| 7801 | pub const fn tserfc(&self) -> bool { | ||
| 7802 | let val = (self.0 >> 10usize) & 0x01; | ||
| 7803 | val != 0 | ||
| 7804 | } | ||
| 7805 | #[doc = "TSERFC flag clear"] | ||
| 7806 | pub fn set_tserfc(&mut self, val: bool) { | ||
| 7807 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | ||
| 7808 | } | ||
| 7809 | #[doc = "SUSPend flag clear"] | ||
| 7810 | pub const fn suspc(&self) -> bool { | ||
| 7811 | let val = (self.0 >> 11usize) & 0x01; | ||
| 7812 | val != 0 | ||
| 7813 | } | ||
| 7814 | #[doc = "SUSPend flag clear"] | ||
| 7815 | pub fn set_suspc(&mut self, val: bool) { | ||
| 7816 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); | ||
| 7817 | } | ||
| 8718 | } | 7818 | } |
| 8719 | impl Default for Cfgr2 { | 7819 | impl Default for Ifcr { |
| 8720 | fn default() -> Cfgr2 { | 7820 | fn default() -> Ifcr { |
| 8721 | Cfgr2(0) | 7821 | Ifcr(0) |
| 8722 | } | 7822 | } |
| 8723 | } | 7823 | } |
| 8724 | #[doc = "external interrupt configuration register 4"] | 7824 | #[doc = "control register 2"] |
| 8725 | #[repr(transparent)] | 7825 | #[repr(transparent)] |
| 8726 | #[derive(Copy, Clone, Eq, PartialEq)] | 7826 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 8727 | pub struct Exticr(pub u32); | 7827 | pub struct Cr2(pub u32); |
| 8728 | impl Exticr { | 7828 | impl Cr2 { |
| 8729 | #[doc = "EXTI12 configuration bits"] | 7829 | #[doc = "Number of data at current transfer"] |
| 8730 | pub fn exti(&self, n: usize) -> u8 { | 7830 | pub const fn tsize(&self) -> u16 { |
| 8731 | assert!(n < 4usize); | 7831 | let val = (self.0 >> 0usize) & 0xffff; |
| 8732 | let offs = 0usize + n * 4usize; | 7832 | val as u16 |
| 8733 | let val = (self.0 >> offs) & 0x0f; | ||
| 8734 | val as u8 | ||
| 8735 | } | 7833 | } |
| 8736 | #[doc = "EXTI12 configuration bits"] | 7834 | #[doc = "Number of data at current transfer"] |
| 8737 | pub fn set_exti(&mut self, n: usize, val: u8) { | 7835 | pub fn set_tsize(&mut self, val: u16) { |
| 8738 | assert!(n < 4usize); | 7836 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); |
| 8739 | let offs = 0usize + n * 4usize; | 7837 | } |
| 8740 | self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs); | 7838 | #[doc = "Number of data transfer extension to be reload into TSIZE just when a previous"] |
| 7839 | pub const fn tser(&self) -> u16 { | ||
| 7840 | let val = (self.0 >> 16usize) & 0xffff; | ||
| 7841 | val as u16 | ||
| 7842 | } | ||
| 7843 | #[doc = "Number of data transfer extension to be reload into TSIZE just when a previous"] | ||
| 7844 | pub fn set_tser(&mut self, val: u16) { | ||
| 7845 | self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize); | ||
| 8741 | } | 7846 | } |
| 8742 | } | 7847 | } |
| 8743 | impl Default for Exticr { | 7848 | impl Default for Cr2 { |
| 8744 | fn default() -> Exticr { | 7849 | fn default() -> Cr2 { |
| 8745 | Exticr(0) | 7850 | Cr2(0) |
| 8746 | } | 7851 | } |
| 8747 | } | 7852 | } |
| 8748 | #[doc = "SWPR"] | 7853 | #[doc = "Transmitter CRC Register"] |
| 8749 | #[repr(transparent)] | 7854 | #[repr(transparent)] |
| 8750 | #[derive(Copy, Clone, Eq, PartialEq)] | 7855 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 8751 | pub struct Swpr(pub u32); | 7856 | pub struct Txcrc(pub u32); |
| 8752 | impl Swpr { | 7857 | impl Txcrc { |
| 8753 | #[doc = "SRAWM2 write protection."] | 7858 | #[doc = "CRC register for transmitter"] |
| 8754 | pub fn pwp(&self, n: usize) -> bool { | 7859 | pub const fn txcrc(&self) -> u32 { |
| 8755 | assert!(n < 32usize); | 7860 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 8756 | let offs = 0usize + n * 1usize; | 7861 | val as u32 |
| 8757 | let val = (self.0 >> offs) & 0x01; | ||
| 8758 | val != 0 | ||
| 8759 | } | 7862 | } |
| 8760 | #[doc = "SRAWM2 write protection."] | 7863 | #[doc = "CRC register for transmitter"] |
| 8761 | pub fn set_pwp(&mut self, n: usize, val: bool) { | 7864 | pub fn set_txcrc(&mut self, val: u32) { |
| 8762 | assert!(n < 32usize); | 7865 | self.0 = |
| 8763 | let offs = 0usize + n * 1usize; | 7866 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); |
| 8764 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 8765 | } | 7867 | } |
| 8766 | } | 7868 | } |
| 8767 | impl Default for Swpr { | 7869 | impl Default for Txcrc { |
| 8768 | fn default() -> Swpr { | 7870 | fn default() -> Txcrc { |
| 8769 | Swpr(0) | 7871 | Txcrc(0) |
| 8770 | } | 7872 | } |
| 8771 | } | 7873 | } |
| 8772 | #[doc = "SKR"] | 7874 | #[doc = "Transmit Data Register"] |
| 8773 | #[repr(transparent)] | 7875 | #[repr(transparent)] |
| 8774 | #[derive(Copy, Clone, Eq, PartialEq)] | 7876 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 8775 | pub struct Skr(pub u32); | 7877 | pub struct Txdr(pub u32); |
| 8776 | impl Skr { | 7878 | impl Txdr { |
| 8777 | #[doc = "SRAM2 write protection key for software erase"] | 7879 | #[doc = "Transmit data register"] |
| 8778 | pub const fn key(&self) -> u8 { | 7880 | pub const fn txdr(&self) -> u32 { |
| 8779 | let val = (self.0 >> 0usize) & 0xff; | 7881 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 8780 | val as u8 | 7882 | val as u32 |
| 8781 | } | 7883 | } |
| 8782 | #[doc = "SRAM2 write protection key for software erase"] | 7884 | #[doc = "Transmit data register"] |
| 8783 | pub fn set_key(&mut self, val: u8) { | 7885 | pub fn set_txdr(&mut self, val: u32) { |
| 8784 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | 7886 | self.0 = |
| 7887 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 8785 | } | 7888 | } |
| 8786 | } | 7889 | } |
| 8787 | impl Default for Skr { | 7890 | impl Default for Txdr { |
| 8788 | fn default() -> Skr { | 7891 | fn default() -> Txdr { |
| 8789 | Skr(0) | 7892 | Txdr(0) |
| 8790 | } | 7893 | } |
| 8791 | } | 7894 | } |
| 8792 | #[doc = "memory remap register"] | 7895 | #[doc = "Status Register"] |
| 8793 | #[repr(transparent)] | 7896 | #[repr(transparent)] |
| 8794 | #[derive(Copy, Clone, Eq, PartialEq)] | 7897 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 8795 | pub struct Memrmp(pub u32); | 7898 | pub struct Sr(pub u32); |
| 8796 | impl Memrmp { | 7899 | impl Sr { |
| 8797 | #[doc = "Memory mapping selection"] | 7900 | #[doc = "Rx-Packet available"] |
| 8798 | pub const fn mem_mode(&self) -> u8 { | 7901 | pub const fn rxp(&self) -> bool { |
| 8799 | let val = (self.0 >> 0usize) & 0x07; | 7902 | let val = (self.0 >> 0usize) & 0x01; |
| 8800 | val as u8 | 7903 | val != 0 |
| 8801 | } | 7904 | } |
| 8802 | #[doc = "Memory mapping selection"] | 7905 | #[doc = "Rx-Packet available"] |
| 8803 | pub fn set_mem_mode(&mut self, val: u8) { | 7906 | pub fn set_rxp(&mut self, val: bool) { |
| 8804 | self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize); | 7907 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 8805 | } | 7908 | } |
| 8806 | #[doc = "QUADSPI memory mapping swap"] | 7909 | #[doc = "Tx-Packet space available"] |
| 8807 | pub const fn qfs(&self) -> bool { | 7910 | pub const fn txp(&self) -> bool { |
| 8808 | let val = (self.0 >> 3usize) & 0x01; | 7911 | let val = (self.0 >> 1usize) & 0x01; |
| 8809 | val != 0 | 7912 | val != 0 |
| 8810 | } | 7913 | } |
| 8811 | #[doc = "QUADSPI memory mapping swap"] | 7914 | #[doc = "Tx-Packet space available"] |
| 8812 | pub fn set_qfs(&mut self, val: bool) { | 7915 | pub fn set_txp(&mut self, val: bool) { |
| 8813 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 7916 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 8814 | } | 7917 | } |
| 8815 | #[doc = "Flash Bank mode selection"] | 7918 | #[doc = "Duplex Packet"] |
| 8816 | pub const fn fb_mode(&self) -> bool { | 7919 | pub const fn dxp(&self) -> bool { |
| 8817 | let val = (self.0 >> 8usize) & 0x01; | 7920 | let val = (self.0 >> 2usize) & 0x01; |
| 8818 | val != 0 | 7921 | val != 0 |
| 8819 | } | 7922 | } |
| 8820 | #[doc = "Flash Bank mode selection"] | 7923 | #[doc = "Duplex Packet"] |
| 8821 | pub fn set_fb_mode(&mut self, val: bool) { | 7924 | pub fn set_dxp(&mut self, val: bool) { |
| 8822 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 7925 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 8823 | } | 7926 | } |
| 8824 | } | 7927 | #[doc = "End Of Transfer"] |
| 8825 | impl Default for Memrmp { | 7928 | pub const fn eot(&self) -> bool { |
| 8826 | fn default() -> Memrmp { | 7929 | let val = (self.0 >> 3usize) & 0x01; |
| 8827 | Memrmp(0) | 7930 | val != 0 |
| 8828 | } | 7931 | } |
| 8829 | } | 7932 | #[doc = "End Of Transfer"] |
| 8830 | #[doc = "configuration register 1"] | 7933 | pub fn set_eot(&mut self, val: bool) { |
| 8831 | #[repr(transparent)] | 7934 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); |
| 8832 | #[derive(Copy, Clone, Eq, PartialEq)] | 7935 | } |
| 8833 | pub struct Cfgr1(pub u32); | 7936 | #[doc = "Transmission Transfer Filled"] |
| 8834 | impl Cfgr1 { | 7937 | pub const fn txtf(&self) -> bool { |
| 8835 | #[doc = "Firewall disable"] | 7938 | let val = (self.0 >> 4usize) & 0x01; |
| 8836 | pub const fn fwdis(&self) -> bool { | ||
| 8837 | let val = (self.0 >> 0usize) & 0x01; | ||
| 8838 | val != 0 | 7939 | val != 0 |
| 8839 | } | 7940 | } |
| 8840 | #[doc = "Firewall disable"] | 7941 | #[doc = "Transmission Transfer Filled"] |
| 8841 | pub fn set_fwdis(&mut self, val: bool) { | 7942 | pub fn set_txtf(&mut self, val: bool) { |
| 8842 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 7943 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 8843 | } | 7944 | } |
| 8844 | #[doc = "I/O analog switch voltage booster enable"] | 7945 | #[doc = "Underrun at slave transmission mode"] |
| 8845 | pub const fn boosten(&self) -> bool { | 7946 | pub const fn udr(&self) -> bool { |
| 8846 | let val = (self.0 >> 8usize) & 0x01; | 7947 | let val = (self.0 >> 5usize) & 0x01; |
| 8847 | val != 0 | 7948 | val != 0 |
| 8848 | } | 7949 | } |
| 8849 | #[doc = "I/O analog switch voltage booster enable"] | 7950 | #[doc = "Underrun at slave transmission mode"] |
| 8850 | pub fn set_boosten(&mut self, val: bool) { | 7951 | pub fn set_udr(&mut self, val: bool) { |
| 8851 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 7952 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 8852 | } | 7953 | } |
| 8853 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB6"] | 7954 | #[doc = "Overrun"] |
| 8854 | pub const fn i2c_pb6_fmp(&self) -> bool { | 7955 | pub const fn ovr(&self) -> bool { |
| 8855 | let val = (self.0 >> 16usize) & 0x01; | 7956 | let val = (self.0 >> 6usize) & 0x01; |
| 8856 | val != 0 | 7957 | val != 0 |
| 8857 | } | 7958 | } |
| 8858 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB6"] | 7959 | #[doc = "Overrun"] |
| 8859 | pub fn set_i2c_pb6_fmp(&mut self, val: bool) { | 7960 | pub fn set_ovr(&mut self, val: bool) { |
| 8860 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | 7961 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 8861 | } | 7962 | } |
| 8862 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB7"] | 7963 | #[doc = "CRC Error"] |
| 8863 | pub const fn i2c_pb7_fmp(&self) -> bool { | 7964 | pub const fn crce(&self) -> bool { |
| 8864 | let val = (self.0 >> 17usize) & 0x01; | 7965 | let val = (self.0 >> 7usize) & 0x01; |
| 8865 | val != 0 | 7966 | val != 0 |
| 8866 | } | 7967 | } |
| 8867 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB7"] | 7968 | #[doc = "CRC Error"] |
| 8868 | pub fn set_i2c_pb7_fmp(&mut self, val: bool) { | 7969 | pub fn set_crce(&mut self, val: bool) { |
| 8869 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); | 7970 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 8870 | } | 7971 | } |
| 8871 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB8"] | 7972 | #[doc = "TI frame format error"] |
| 8872 | pub const fn i2c_pb8_fmp(&self) -> bool { | 7973 | pub const fn tifre(&self) -> bool { |
| 8873 | let val = (self.0 >> 18usize) & 0x01; | 7974 | let val = (self.0 >> 8usize) & 0x01; |
| 8874 | val != 0 | 7975 | val != 0 |
| 8875 | } | 7976 | } |
| 8876 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB8"] | 7977 | #[doc = "TI frame format error"] |
| 8877 | pub fn set_i2c_pb8_fmp(&mut self, val: bool) { | 7978 | pub fn set_tifre(&mut self, val: bool) { |
| 8878 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); | 7979 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 8879 | } | 7980 | } |
| 8880 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB9"] | 7981 | #[doc = "Mode Fault"] |
| 8881 | pub const fn i2c_pb9_fmp(&self) -> bool { | 7982 | pub const fn modf(&self) -> bool { |
| 8882 | let val = (self.0 >> 19usize) & 0x01; | 7983 | let val = (self.0 >> 9usize) & 0x01; |
| 8883 | val != 0 | 7984 | val != 0 |
| 8884 | } | 7985 | } |
| 8885 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB9"] | 7986 | #[doc = "Mode Fault"] |
| 8886 | pub fn set_i2c_pb9_fmp(&mut self, val: bool) { | 7987 | pub fn set_modf(&mut self, val: bool) { |
| 8887 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); | 7988 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); |
| 8888 | } | 7989 | } |
| 8889 | #[doc = "I2C1 Fast-mode Plus driving capability activation"] | 7990 | #[doc = "Additional number of SPI data to be transacted was reload"] |
| 8890 | pub const fn i2c1_fmp(&self) -> bool { | 7991 | pub const fn tserf(&self) -> bool { |
| 8891 | let val = (self.0 >> 20usize) & 0x01; | 7992 | let val = (self.0 >> 10usize) & 0x01; |
| 8892 | val != 0 | 7993 | val != 0 |
| 8893 | } | 7994 | } |
| 8894 | #[doc = "I2C1 Fast-mode Plus driving capability activation"] | 7995 | #[doc = "Additional number of SPI data to be transacted was reload"] |
| 8895 | pub fn set_i2c1_fmp(&mut self, val: bool) { | 7996 | pub fn set_tserf(&mut self, val: bool) { |
| 8896 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); | 7997 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); |
| 8897 | } | 7998 | } |
| 8898 | #[doc = "I2C2 Fast-mode Plus driving capability activation"] | 7999 | #[doc = "SUSPend"] |
| 8899 | pub const fn i2c2_fmp(&self) -> bool { | 8000 | pub const fn susp(&self) -> bool { |
| 8900 | let val = (self.0 >> 21usize) & 0x01; | 8001 | let val = (self.0 >> 11usize) & 0x01; |
| 8901 | val != 0 | 8002 | val != 0 |
| 8902 | } | 8003 | } |
| 8903 | #[doc = "I2C2 Fast-mode Plus driving capability activation"] | 8004 | #[doc = "SUSPend"] |
| 8904 | pub fn set_i2c2_fmp(&mut self, val: bool) { | 8005 | pub fn set_susp(&mut self, val: bool) { |
| 8905 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); | 8006 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); |
| 8906 | } | 8007 | } |
| 8907 | #[doc = "I2C3 Fast-mode Plus driving capability activation"] | 8008 | #[doc = "TxFIFO transmission complete"] |
| 8908 | pub const fn i2c3_fmp(&self) -> bool { | 8009 | pub const fn txc(&self) -> bool { |
| 8909 | let val = (self.0 >> 22usize) & 0x01; | 8010 | let val = (self.0 >> 12usize) & 0x01; |
| 8910 | val != 0 | 8011 | val != 0 |
| 8911 | } | 8012 | } |
| 8912 | #[doc = "I2C3 Fast-mode Plus driving capability activation"] | 8013 | #[doc = "TxFIFO transmission complete"] |
| 8913 | pub fn set_i2c3_fmp(&mut self, val: bool) { | 8014 | pub fn set_txc(&mut self, val: bool) { |
| 8914 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); | 8015 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); |
| 8915 | } | 8016 | } |
| 8916 | #[doc = "Floating Point Unit interrupts enable bits"] | 8017 | #[doc = "RxFIFO Packing LeVeL"] |
| 8917 | pub const fn fpu_ie(&self) -> u8 { | 8018 | pub const fn rxplvl(&self) -> super::vals::Rxplvl { |
| 8918 | let val = (self.0 >> 26usize) & 0x3f; | 8019 | let val = (self.0 >> 13usize) & 0x03; |
| 8919 | val as u8 | 8020 | super::vals::Rxplvl(val as u8) |
| 8920 | } | 8021 | } |
| 8921 | #[doc = "Floating Point Unit interrupts enable bits"] | 8022 | #[doc = "RxFIFO Packing LeVeL"] |
| 8922 | pub fn set_fpu_ie(&mut self, val: u8) { | 8023 | pub fn set_rxplvl(&mut self, val: super::vals::Rxplvl) { |
| 8923 | self.0 = (self.0 & !(0x3f << 26usize)) | (((val as u32) & 0x3f) << 26usize); | 8024 | self.0 = (self.0 & !(0x03 << 13usize)) | (((val.0 as u32) & 0x03) << 13usize); |
| 8025 | } | ||
| 8026 | #[doc = "RxFIFO Word Not Empty"] | ||
| 8027 | pub const fn rxwne(&self) -> super::vals::Rxwne { | ||
| 8028 | let val = (self.0 >> 15usize) & 0x01; | ||
| 8029 | super::vals::Rxwne(val as u8) | ||
| 8030 | } | ||
| 8031 | #[doc = "RxFIFO Word Not Empty"] | ||
| 8032 | pub fn set_rxwne(&mut self, val: super::vals::Rxwne) { | ||
| 8033 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 8034 | } | ||
| 8035 | #[doc = "Number of data frames remaining in current TSIZE session"] | ||
| 8036 | pub const fn ctsize(&self) -> u16 { | ||
| 8037 | let val = (self.0 >> 16usize) & 0xffff; | ||
| 8038 | val as u16 | ||
| 8039 | } | ||
| 8040 | #[doc = "Number of data frames remaining in current TSIZE session"] | ||
| 8041 | pub fn set_ctsize(&mut self, val: u16) { | ||
| 8042 | self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize); | ||
| 8924 | } | 8043 | } |
| 8925 | } | 8044 | } |
| 8926 | impl Default for Cfgr1 { | 8045 | impl Default for Sr { |
| 8927 | fn default() -> Cfgr1 { | 8046 | fn default() -> Sr { |
| 8928 | Cfgr1(0) | 8047 | Sr(0) |
| 8929 | } | 8048 | } |
| 8930 | } | 8049 | } |
| 8931 | #[doc = "SCSR"] | 8050 | #[doc = "control register 1"] |
| 8932 | #[repr(transparent)] | 8051 | #[repr(transparent)] |
| 8933 | #[derive(Copy, Clone, Eq, PartialEq)] | 8052 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 8934 | pub struct Scsr(pub u32); | 8053 | pub struct Cr1(pub u32); |
| 8935 | impl Scsr { | 8054 | impl Cr1 { |
| 8936 | #[doc = "SRAM2 Erase"] | 8055 | #[doc = "Serial Peripheral Enable"] |
| 8937 | pub const fn sram2er(&self) -> bool { | 8056 | pub const fn spe(&self) -> bool { |
| 8938 | let val = (self.0 >> 0usize) & 0x01; | 8057 | let val = (self.0 >> 0usize) & 0x01; |
| 8939 | val != 0 | 8058 | val != 0 |
| 8940 | } | 8059 | } |
| 8941 | #[doc = "SRAM2 Erase"] | 8060 | #[doc = "Serial Peripheral Enable"] |
| 8942 | pub fn set_sram2er(&mut self, val: bool) { | 8061 | pub fn set_spe(&mut self, val: bool) { |
| 8943 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 8062 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 8944 | } | 8063 | } |
| 8945 | #[doc = "SRAM2 busy by erase operation"] | 8064 | #[doc = "Master automatic SUSP in Receive mode"] |
| 8946 | pub const fn sram2bsy(&self) -> bool { | 8065 | pub const fn masrx(&self) -> bool { |
| 8947 | let val = (self.0 >> 1usize) & 0x01; | 8066 | let val = (self.0 >> 8usize) & 0x01; |
| 8948 | val != 0 | 8067 | val != 0 |
| 8949 | } | 8068 | } |
| 8950 | #[doc = "SRAM2 busy by erase operation"] | 8069 | #[doc = "Master automatic SUSP in Receive mode"] |
| 8951 | pub fn set_sram2bsy(&mut self, val: bool) { | 8070 | pub fn set_masrx(&mut self, val: bool) { |
| 8952 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 8071 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 8953 | } | 8072 | } |
| 8954 | } | 8073 | #[doc = "Master transfer start"] |
| 8955 | impl Default for Scsr { | 8074 | pub const fn cstart(&self) -> bool { |
| 8956 | fn default() -> Scsr { | 8075 | let val = (self.0 >> 9usize) & 0x01; |
| 8957 | Scsr(0) | 8076 | val != 0 |
| 8077 | } | ||
| 8078 | #[doc = "Master transfer start"] | ||
| 8079 | pub fn set_cstart(&mut self, val: bool) { | ||
| 8080 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | ||
| 8081 | } | ||
| 8082 | #[doc = "Master SUSPend request"] | ||
| 8083 | pub const fn csusp(&self) -> bool { | ||
| 8084 | let val = (self.0 >> 10usize) & 0x01; | ||
| 8085 | val != 0 | ||
| 8086 | } | ||
| 8087 | #[doc = "Master SUSPend request"] | ||
| 8088 | pub fn set_csusp(&mut self, val: bool) { | ||
| 8089 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | ||
| 8090 | } | ||
| 8091 | #[doc = "Rx/Tx direction at Half-duplex mode"] | ||
| 8092 | pub const fn hddir(&self) -> super::vals::Hddir { | ||
| 8093 | let val = (self.0 >> 11usize) & 0x01; | ||
| 8094 | super::vals::Hddir(val as u8) | ||
| 8095 | } | ||
| 8096 | #[doc = "Rx/Tx direction at Half-duplex mode"] | ||
| 8097 | pub fn set_hddir(&mut self, val: super::vals::Hddir) { | ||
| 8098 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); | ||
| 8099 | } | ||
| 8100 | #[doc = "Internal SS signal input level"] | ||
| 8101 | pub const fn ssi(&self) -> bool { | ||
| 8102 | let val = (self.0 >> 12usize) & 0x01; | ||
| 8103 | val != 0 | ||
| 8104 | } | ||
| 8105 | #[doc = "Internal SS signal input level"] | ||
| 8106 | pub fn set_ssi(&mut self, val: bool) { | ||
| 8107 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); | ||
| 8108 | } | ||
| 8109 | #[doc = "32-bit CRC polynomial configuration"] | ||
| 8110 | pub const fn crc33_17(&self) -> super::vals::Crc { | ||
| 8111 | let val = (self.0 >> 13usize) & 0x01; | ||
| 8112 | super::vals::Crc(val as u8) | ||
| 8113 | } | ||
| 8114 | #[doc = "32-bit CRC polynomial configuration"] | ||
| 8115 | pub fn set_crc33_17(&mut self, val: super::vals::Crc) { | ||
| 8116 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize); | ||
| 8117 | } | ||
| 8118 | #[doc = "CRC calculation initialization pattern control for receiver"] | ||
| 8119 | pub const fn rcrcini(&self) -> super::vals::Rcrcini { | ||
| 8120 | let val = (self.0 >> 14usize) & 0x01; | ||
| 8121 | super::vals::Rcrcini(val as u8) | ||
| 8122 | } | ||
| 8123 | #[doc = "CRC calculation initialization pattern control for receiver"] | ||
| 8124 | pub fn set_rcrcini(&mut self, val: super::vals::Rcrcini) { | ||
| 8125 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | ||
| 8126 | } | ||
| 8127 | #[doc = "CRC calculation initialization pattern control for transmitter"] | ||
| 8128 | pub const fn tcrcini(&self) -> super::vals::Tcrcini { | ||
| 8129 | let val = (self.0 >> 15usize) & 0x01; | ||
| 8130 | super::vals::Tcrcini(val as u8) | ||
| 8131 | } | ||
| 8132 | #[doc = "CRC calculation initialization pattern control for transmitter"] | ||
| 8133 | pub fn set_tcrcini(&mut self, val: super::vals::Tcrcini) { | ||
| 8134 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 8135 | } | ||
| 8136 | #[doc = "Locking the AF configuration of associated IOs"] | ||
| 8137 | pub const fn iolock(&self) -> bool { | ||
| 8138 | let val = (self.0 >> 16usize) & 0x01; | ||
| 8139 | val != 0 | ||
| 8140 | } | ||
| 8141 | #[doc = "Locking the AF configuration of associated IOs"] | ||
| 8142 | pub fn set_iolock(&mut self, val: bool) { | ||
| 8143 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | ||
| 8958 | } | 8144 | } |
| 8959 | } | 8145 | } |
| 8960 | } | 8146 | impl Default for Cr1 { |
| 8961 | } | 8147 | fn default() -> Cr1 { |
| 8962 | pub mod rng_v1 { | 8148 | Cr1(0) |
| 8963 | use crate::generic::*; | 8149 | } |
| 8964 | #[doc = "Random number generator"] | ||
| 8965 | #[derive(Copy, Clone)] | ||
| 8966 | pub struct Rng(pub *mut u8); | ||
| 8967 | unsafe impl Send for Rng {} | ||
| 8968 | unsafe impl Sync for Rng {} | ||
| 8969 | impl Rng { | ||
| 8970 | #[doc = "control register"] | ||
| 8971 | pub fn cr(self) -> Reg<regs::Cr, RW> { | ||
| 8972 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 8973 | } | ||
| 8974 | #[doc = "status register"] | ||
| 8975 | pub fn sr(self) -> Reg<regs::Sr, RW> { | ||
| 8976 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 8977 | } | ||
| 8978 | #[doc = "data register"] | ||
| 8979 | pub fn dr(self) -> Reg<u32, R> { | ||
| 8980 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 8981 | } | 8150 | } |
| 8982 | } | 8151 | #[doc = "Interrupt Enable Register"] |
| 8983 | pub mod regs { | ||
| 8984 | use crate::generic::*; | ||
| 8985 | #[doc = "status register"] | ||
| 8986 | #[repr(transparent)] | 8152 | #[repr(transparent)] |
| 8987 | #[derive(Copy, Clone, Eq, PartialEq)] | 8153 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 8988 | pub struct Sr(pub u32); | 8154 | pub struct Ier(pub u32); |
| 8989 | impl Sr { | 8155 | impl Ier { |
| 8990 | #[doc = "Data ready"] | 8156 | #[doc = "RXP Interrupt Enable"] |
| 8991 | pub const fn drdy(&self) -> bool { | 8157 | pub const fn rxpie(&self) -> bool { |
| 8992 | let val = (self.0 >> 0usize) & 0x01; | 8158 | let val = (self.0 >> 0usize) & 0x01; |
| 8993 | val != 0 | 8159 | val != 0 |
| 8994 | } | 8160 | } |
| 8995 | #[doc = "Data ready"] | 8161 | #[doc = "RXP Interrupt Enable"] |
| 8996 | pub fn set_drdy(&mut self, val: bool) { | 8162 | pub fn set_rxpie(&mut self, val: bool) { |
| 8997 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 8163 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 8998 | } | 8164 | } |
| 8999 | #[doc = "Clock error current status"] | 8165 | #[doc = "TXP interrupt enable"] |
| 9000 | pub const fn cecs(&self) -> bool { | 8166 | pub const fn txpie(&self) -> bool { |
| 9001 | let val = (self.0 >> 1usize) & 0x01; | 8167 | let val = (self.0 >> 1usize) & 0x01; |
| 9002 | val != 0 | 8168 | val != 0 |
| 9003 | } | 8169 | } |
| 9004 | #[doc = "Clock error current status"] | 8170 | #[doc = "TXP interrupt enable"] |
| 9005 | pub fn set_cecs(&mut self, val: bool) { | 8171 | pub fn set_txpie(&mut self, val: bool) { |
| 9006 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 8172 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 9007 | } | 8173 | } |
| 9008 | #[doc = "Seed error current status"] | 8174 | #[doc = "DXP interrupt enabled"] |
| 9009 | pub const fn secs(&self) -> bool { | 8175 | pub const fn dxpie(&self) -> bool { |
| 9010 | let val = (self.0 >> 2usize) & 0x01; | 8176 | let val = (self.0 >> 2usize) & 0x01; |
| 9011 | val != 0 | 8177 | val != 0 |
| 9012 | } | 8178 | } |
| 9013 | #[doc = "Seed error current status"] | 8179 | #[doc = "DXP interrupt enabled"] |
| 9014 | pub fn set_secs(&mut self, val: bool) { | 8180 | pub fn set_dxpie(&mut self, val: bool) { |
| 9015 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 8181 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 9016 | } | 8182 | } |
| 9017 | #[doc = "Clock error interrupt status"] | 8183 | #[doc = "EOT, SUSP and TXC interrupt enable"] |
| 9018 | pub const fn ceis(&self) -> bool { | 8184 | pub const fn eotie(&self) -> bool { |
| 8185 | let val = (self.0 >> 3usize) & 0x01; | ||
| 8186 | val != 0 | ||
| 8187 | } | ||
| 8188 | #[doc = "EOT, SUSP and TXC interrupt enable"] | ||
| 8189 | pub fn set_eotie(&mut self, val: bool) { | ||
| 8190 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | ||
| 8191 | } | ||
| 8192 | #[doc = "TXTFIE interrupt enable"] | ||
| 8193 | pub const fn txtfie(&self) -> bool { | ||
| 8194 | let val = (self.0 >> 4usize) & 0x01; | ||
| 8195 | val != 0 | ||
| 8196 | } | ||
| 8197 | #[doc = "TXTFIE interrupt enable"] | ||
| 8198 | pub fn set_txtfie(&mut self, val: bool) { | ||
| 8199 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | ||
| 8200 | } | ||
| 8201 | #[doc = "UDR interrupt enable"] | ||
| 8202 | pub const fn udrie(&self) -> bool { | ||
| 9019 | let val = (self.0 >> 5usize) & 0x01; | 8203 | let val = (self.0 >> 5usize) & 0x01; |
| 9020 | val != 0 | 8204 | val != 0 |
| 9021 | } | 8205 | } |
| 9022 | #[doc = "Clock error interrupt status"] | 8206 | #[doc = "UDR interrupt enable"] |
| 9023 | pub fn set_ceis(&mut self, val: bool) { | 8207 | pub fn set_udrie(&mut self, val: bool) { |
| 9024 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 8208 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 9025 | } | 8209 | } |
| 9026 | #[doc = "Seed error interrupt status"] | 8210 | #[doc = "OVR interrupt enable"] |
| 9027 | pub const fn seis(&self) -> bool { | 8211 | pub const fn ovrie(&self) -> bool { |
| 9028 | let val = (self.0 >> 6usize) & 0x01; | 8212 | let val = (self.0 >> 6usize) & 0x01; |
| 9029 | val != 0 | 8213 | val != 0 |
| 9030 | } | 8214 | } |
| 9031 | #[doc = "Seed error interrupt status"] | 8215 | #[doc = "OVR interrupt enable"] |
| 9032 | pub fn set_seis(&mut self, val: bool) { | 8216 | pub fn set_ovrie(&mut self, val: bool) { |
| 9033 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 8217 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 9034 | } | 8218 | } |
| 8219 | #[doc = "CRC Interrupt enable"] | ||
| 8220 | pub const fn crceie(&self) -> bool { | ||
| 8221 | let val = (self.0 >> 7usize) & 0x01; | ||
| 8222 | val != 0 | ||
| 8223 | } | ||
| 8224 | #[doc = "CRC Interrupt enable"] | ||
| 8225 | pub fn set_crceie(&mut self, val: bool) { | ||
| 8226 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 8227 | } | ||
| 8228 | #[doc = "TIFRE interrupt enable"] | ||
| 8229 | pub const fn tifreie(&self) -> bool { | ||
| 8230 | let val = (self.0 >> 8usize) & 0x01; | ||
| 8231 | val != 0 | ||
| 8232 | } | ||
| 8233 | #[doc = "TIFRE interrupt enable"] | ||
| 8234 | pub fn set_tifreie(&mut self, val: bool) { | ||
| 8235 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 8236 | } | ||
| 8237 | #[doc = "Mode Fault interrupt enable"] | ||
| 8238 | pub const fn modfie(&self) -> bool { | ||
| 8239 | let val = (self.0 >> 9usize) & 0x01; | ||
| 8240 | val != 0 | ||
| 8241 | } | ||
| 8242 | #[doc = "Mode Fault interrupt enable"] | ||
| 8243 | pub fn set_modfie(&mut self, val: bool) { | ||
| 8244 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | ||
| 8245 | } | ||
| 8246 | #[doc = "Additional number of transactions reload interrupt enable"] | ||
| 8247 | pub const fn tserfie(&self) -> bool { | ||
| 8248 | let val = (self.0 >> 10usize) & 0x01; | ||
| 8249 | val != 0 | ||
| 8250 | } | ||
| 8251 | #[doc = "Additional number of transactions reload interrupt enable"] | ||
| 8252 | pub fn set_tserfie(&mut self, val: bool) { | ||
| 8253 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | ||
| 8254 | } | ||
| 9035 | } | 8255 | } |
| 9036 | impl Default for Sr { | 8256 | impl Default for Ier { |
| 9037 | fn default() -> Sr { | 8257 | fn default() -> Ier { |
| 9038 | Sr(0) | 8258 | Ier(0) |
| 9039 | } | 8259 | } |
| 9040 | } | 8260 | } |
| 9041 | #[doc = "control register"] | 8261 | #[doc = "Receive Data Register"] |
| 9042 | #[repr(transparent)] | 8262 | #[repr(transparent)] |
| 9043 | #[derive(Copy, Clone, Eq, PartialEq)] | 8263 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9044 | pub struct Cr(pub u32); | 8264 | pub struct Rxdr(pub u32); |
| 9045 | impl Cr { | 8265 | impl Rxdr { |
| 9046 | #[doc = "Random number generator enable"] | 8266 | #[doc = "Receive data register"] |
| 9047 | pub const fn rngen(&self) -> bool { | 8267 | pub const fn rxdr(&self) -> u32 { |
| 9048 | let val = (self.0 >> 2usize) & 0x01; | 8268 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 8269 | val as u32 | ||
| 8270 | } | ||
| 8271 | #[doc = "Receive data register"] | ||
| 8272 | pub fn set_rxdr(&mut self, val: u32) { | ||
| 8273 | self.0 = | ||
| 8274 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 8275 | } | ||
| 8276 | } | ||
| 8277 | impl Default for Rxdr { | ||
| 8278 | fn default() -> Rxdr { | ||
| 8279 | Rxdr(0) | ||
| 8280 | } | ||
| 8281 | } | ||
| 8282 | #[doc = "configuration register 2"] | ||
| 8283 | #[repr(transparent)] | ||
| 8284 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 8285 | pub struct Cfg2(pub u32); | ||
| 8286 | impl Cfg2 { | ||
| 8287 | #[doc = "Master SS Idleness"] | ||
| 8288 | pub const fn mssi(&self) -> u8 { | ||
| 8289 | let val = (self.0 >> 0usize) & 0x0f; | ||
| 8290 | val as u8 | ||
| 8291 | } | ||
| 8292 | #[doc = "Master SS Idleness"] | ||
| 8293 | pub fn set_mssi(&mut self, val: u8) { | ||
| 8294 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); | ||
| 8295 | } | ||
| 8296 | #[doc = "Master Inter-Data Idleness"] | ||
| 8297 | pub const fn midi(&self) -> u8 { | ||
| 8298 | let val = (self.0 >> 4usize) & 0x0f; | ||
| 8299 | val as u8 | ||
| 8300 | } | ||
| 8301 | #[doc = "Master Inter-Data Idleness"] | ||
| 8302 | pub fn set_midi(&mut self, val: u8) { | ||
| 8303 | self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize); | ||
| 8304 | } | ||
| 8305 | #[doc = "Swap functionality of MISO and MOSI pins"] | ||
| 8306 | pub const fn ioswp(&self) -> bool { | ||
| 8307 | let val = (self.0 >> 15usize) & 0x01; | ||
| 9049 | val != 0 | 8308 | val != 0 |
| 9050 | } | 8309 | } |
| 9051 | #[doc = "Random number generator enable"] | 8310 | #[doc = "Swap functionality of MISO and MOSI pins"] |
| 9052 | pub fn set_rngen(&mut self, val: bool) { | 8311 | pub fn set_ioswp(&mut self, val: bool) { |
| 9053 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 8312 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); |
| 9054 | } | 8313 | } |
| 9055 | #[doc = "Interrupt enable"] | 8314 | #[doc = "SPI Communication Mode"] |
| 9056 | pub const fn ie(&self) -> bool { | 8315 | pub const fn comm(&self) -> super::vals::Comm { |
| 9057 | let val = (self.0 >> 3usize) & 0x01; | 8316 | let val = (self.0 >> 17usize) & 0x03; |
| 8317 | super::vals::Comm(val as u8) | ||
| 8318 | } | ||
| 8319 | #[doc = "SPI Communication Mode"] | ||
| 8320 | pub fn set_comm(&mut self, val: super::vals::Comm) { | ||
| 8321 | self.0 = (self.0 & !(0x03 << 17usize)) | (((val.0 as u32) & 0x03) << 17usize); | ||
| 8322 | } | ||
| 8323 | #[doc = "Serial Protocol"] | ||
| 8324 | pub const fn sp(&self) -> super::vals::Sp { | ||
| 8325 | let val = (self.0 >> 19usize) & 0x07; | ||
| 8326 | super::vals::Sp(val as u8) | ||
| 8327 | } | ||
| 8328 | #[doc = "Serial Protocol"] | ||
| 8329 | pub fn set_sp(&mut self, val: super::vals::Sp) { | ||
| 8330 | self.0 = (self.0 & !(0x07 << 19usize)) | (((val.0 as u32) & 0x07) << 19usize); | ||
| 8331 | } | ||
| 8332 | #[doc = "SPI Master"] | ||
| 8333 | pub const fn master(&self) -> super::vals::Master { | ||
| 8334 | let val = (self.0 >> 22usize) & 0x01; | ||
| 8335 | super::vals::Master(val as u8) | ||
| 8336 | } | ||
| 8337 | #[doc = "SPI Master"] | ||
| 8338 | pub fn set_master(&mut self, val: super::vals::Master) { | ||
| 8339 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize); | ||
| 8340 | } | ||
| 8341 | #[doc = "Data frame format"] | ||
| 8342 | pub const fn lsbfrst(&self) -> super::vals::Lsbfrst { | ||
| 8343 | let val = (self.0 >> 23usize) & 0x01; | ||
| 8344 | super::vals::Lsbfrst(val as u8) | ||
| 8345 | } | ||
| 8346 | #[doc = "Data frame format"] | ||
| 8347 | pub fn set_lsbfrst(&mut self, val: super::vals::Lsbfrst) { | ||
| 8348 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize); | ||
| 8349 | } | ||
| 8350 | #[doc = "Clock phase"] | ||
| 8351 | pub const fn cpha(&self) -> super::vals::Cpha { | ||
| 8352 | let val = (self.0 >> 24usize) & 0x01; | ||
| 8353 | super::vals::Cpha(val as u8) | ||
| 8354 | } | ||
| 8355 | #[doc = "Clock phase"] | ||
| 8356 | pub fn set_cpha(&mut self, val: super::vals::Cpha) { | ||
| 8357 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); | ||
| 8358 | } | ||
| 8359 | #[doc = "Clock polarity"] | ||
| 8360 | pub const fn cpol(&self) -> super::vals::Cpol { | ||
| 8361 | let val = (self.0 >> 25usize) & 0x01; | ||
| 8362 | super::vals::Cpol(val as u8) | ||
| 8363 | } | ||
| 8364 | #[doc = "Clock polarity"] | ||
| 8365 | pub fn set_cpol(&mut self, val: super::vals::Cpol) { | ||
| 8366 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize); | ||
| 8367 | } | ||
| 8368 | #[doc = "Software management of SS signal input"] | ||
| 8369 | pub const fn ssm(&self) -> bool { | ||
| 8370 | let val = (self.0 >> 26usize) & 0x01; | ||
| 9058 | val != 0 | 8371 | val != 0 |
| 9059 | } | 8372 | } |
| 9060 | #[doc = "Interrupt enable"] | 8373 | #[doc = "Software management of SS signal input"] |
| 9061 | pub fn set_ie(&mut self, val: bool) { | 8374 | pub fn set_ssm(&mut self, val: bool) { |
| 9062 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 8375 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); |
| 8376 | } | ||
| 8377 | #[doc = "SS input/output polarity"] | ||
| 8378 | pub const fn ssiop(&self) -> super::vals::Ssiop { | ||
| 8379 | let val = (self.0 >> 28usize) & 0x01; | ||
| 8380 | super::vals::Ssiop(val as u8) | ||
| 8381 | } | ||
| 8382 | #[doc = "SS input/output polarity"] | ||
| 8383 | pub fn set_ssiop(&mut self, val: super::vals::Ssiop) { | ||
| 8384 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); | ||
| 8385 | } | ||
| 8386 | #[doc = "SS output enable"] | ||
| 8387 | pub const fn ssoe(&self) -> bool { | ||
| 8388 | let val = (self.0 >> 29usize) & 0x01; | ||
| 8389 | val != 0 | ||
| 8390 | } | ||
| 8391 | #[doc = "SS output enable"] | ||
| 8392 | pub fn set_ssoe(&mut self, val: bool) { | ||
| 8393 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize); | ||
| 8394 | } | ||
| 8395 | #[doc = "SS output management in master mode"] | ||
| 8396 | pub const fn ssom(&self) -> super::vals::Ssom { | ||
| 8397 | let val = (self.0 >> 30usize) & 0x01; | ||
| 8398 | super::vals::Ssom(val as u8) | ||
| 8399 | } | ||
| 8400 | #[doc = "SS output management in master mode"] | ||
| 8401 | pub fn set_ssom(&mut self, val: super::vals::Ssom) { | ||
| 8402 | self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize); | ||
| 8403 | } | ||
| 8404 | #[doc = "Alternate function GPIOs control"] | ||
| 8405 | pub const fn afcntr(&self) -> super::vals::Afcntr { | ||
| 8406 | let val = (self.0 >> 31usize) & 0x01; | ||
| 8407 | super::vals::Afcntr(val as u8) | ||
| 8408 | } | ||
| 8409 | #[doc = "Alternate function GPIOs control"] | ||
| 8410 | pub fn set_afcntr(&mut self, val: super::vals::Afcntr) { | ||
| 8411 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize); | ||
| 9063 | } | 8412 | } |
| 9064 | } | 8413 | } |
| 9065 | impl Default for Cr { | 8414 | impl Default for Cfg2 { |
| 9066 | fn default() -> Cr { | 8415 | fn default() -> Cfg2 { |
| 9067 | Cr(0) | 8416 | Cfg2(0) |
| 8417 | } | ||
| 8418 | } | ||
| 8419 | #[doc = "Receiver CRC Register"] | ||
| 8420 | #[repr(transparent)] | ||
| 8421 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 8422 | pub struct Rxcrc(pub u32); | ||
| 8423 | impl Rxcrc { | ||
| 8424 | #[doc = "CRC register for receiver"] | ||
| 8425 | pub const fn rxcrc(&self) -> u32 { | ||
| 8426 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 8427 | val as u32 | ||
| 8428 | } | ||
| 8429 | #[doc = "CRC register for receiver"] | ||
| 8430 | pub fn set_rxcrc(&mut self, val: u32) { | ||
| 8431 | self.0 = | ||
| 8432 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 8433 | } | ||
| 8434 | } | ||
| 8435 | impl Default for Rxcrc { | ||
| 8436 | fn default() -> Rxcrc { | ||
| 8437 | Rxcrc(0) | ||
| 8438 | } | ||
| 8439 | } | ||
| 8440 | #[doc = "configuration register 1"] | ||
| 8441 | #[repr(transparent)] | ||
| 8442 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 8443 | pub struct Cfg1(pub u32); | ||
| 8444 | impl Cfg1 { | ||
| 8445 | #[doc = "Number of bits in at single SPI data frame"] | ||
| 8446 | pub const fn dsize(&self) -> u8 { | ||
| 8447 | let val = (self.0 >> 0usize) & 0x1f; | ||
| 8448 | val as u8 | ||
| 8449 | } | ||
| 8450 | #[doc = "Number of bits in at single SPI data frame"] | ||
| 8451 | pub fn set_dsize(&mut self, val: u8) { | ||
| 8452 | self.0 = (self.0 & !(0x1f << 0usize)) | (((val as u32) & 0x1f) << 0usize); | ||
| 8453 | } | ||
| 8454 | #[doc = "threshold level"] | ||
| 8455 | pub const fn fthlv(&self) -> super::vals::Fthlv { | ||
| 8456 | let val = (self.0 >> 5usize) & 0x0f; | ||
| 8457 | super::vals::Fthlv(val as u8) | ||
| 8458 | } | ||
| 8459 | #[doc = "threshold level"] | ||
| 8460 | pub fn set_fthlv(&mut self, val: super::vals::Fthlv) { | ||
| 8461 | self.0 = (self.0 & !(0x0f << 5usize)) | (((val.0 as u32) & 0x0f) << 5usize); | ||
| 8462 | } | ||
| 8463 | #[doc = "Behavior of slave transmitter at underrun condition"] | ||
| 8464 | pub const fn udrcfg(&self) -> super::vals::Udrcfg { | ||
| 8465 | let val = (self.0 >> 9usize) & 0x03; | ||
| 8466 | super::vals::Udrcfg(val as u8) | ||
| 8467 | } | ||
| 8468 | #[doc = "Behavior of slave transmitter at underrun condition"] | ||
| 8469 | pub fn set_udrcfg(&mut self, val: super::vals::Udrcfg) { | ||
| 8470 | self.0 = (self.0 & !(0x03 << 9usize)) | (((val.0 as u32) & 0x03) << 9usize); | ||
| 8471 | } | ||
| 8472 | #[doc = "Detection of underrun condition at slave transmitter"] | ||
| 8473 | pub const fn udrdet(&self) -> super::vals::Udrdet { | ||
| 8474 | let val = (self.0 >> 11usize) & 0x03; | ||
| 8475 | super::vals::Udrdet(val as u8) | ||
| 8476 | } | ||
| 8477 | #[doc = "Detection of underrun condition at slave transmitter"] | ||
| 8478 | pub fn set_udrdet(&mut self, val: super::vals::Udrdet) { | ||
| 8479 | self.0 = (self.0 & !(0x03 << 11usize)) | (((val.0 as u32) & 0x03) << 11usize); | ||
| 8480 | } | ||
| 8481 | #[doc = "Rx DMA stream enable"] | ||
| 8482 | pub const fn rxdmaen(&self) -> bool { | ||
| 8483 | let val = (self.0 >> 14usize) & 0x01; | ||
| 8484 | val != 0 | ||
| 8485 | } | ||
| 8486 | #[doc = "Rx DMA stream enable"] | ||
| 8487 | pub fn set_rxdmaen(&mut self, val: bool) { | ||
| 8488 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | ||
| 8489 | } | ||
| 8490 | #[doc = "Tx DMA stream enable"] | ||
| 8491 | pub const fn txdmaen(&self) -> bool { | ||
| 8492 | let val = (self.0 >> 15usize) & 0x01; | ||
| 8493 | val != 0 | ||
| 8494 | } | ||
| 8495 | #[doc = "Tx DMA stream enable"] | ||
| 8496 | pub fn set_txdmaen(&mut self, val: bool) { | ||
| 8497 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); | ||
| 8498 | } | ||
| 8499 | #[doc = "Length of CRC frame to be transacted and compared"] | ||
| 8500 | pub const fn crcsize(&self) -> u8 { | ||
| 8501 | let val = (self.0 >> 16usize) & 0x1f; | ||
| 8502 | val as u8 | ||
| 8503 | } | ||
| 8504 | #[doc = "Length of CRC frame to be transacted and compared"] | ||
| 8505 | pub fn set_crcsize(&mut self, val: u8) { | ||
| 8506 | self.0 = (self.0 & !(0x1f << 16usize)) | (((val as u32) & 0x1f) << 16usize); | ||
| 8507 | } | ||
| 8508 | #[doc = "Hardware CRC computation enable"] | ||
| 8509 | pub const fn crcen(&self) -> bool { | ||
| 8510 | let val = (self.0 >> 22usize) & 0x01; | ||
| 8511 | val != 0 | ||
| 8512 | } | ||
| 8513 | #[doc = "Hardware CRC computation enable"] | ||
| 8514 | pub fn set_crcen(&mut self, val: bool) { | ||
| 8515 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); | ||
| 8516 | } | ||
| 8517 | #[doc = "Master baud rate"] | ||
| 8518 | pub const fn mbr(&self) -> super::vals::Mbr { | ||
| 8519 | let val = (self.0 >> 28usize) & 0x07; | ||
| 8520 | super::vals::Mbr(val as u8) | ||
| 8521 | } | ||
| 8522 | #[doc = "Master baud rate"] | ||
| 8523 | pub fn set_mbr(&mut self, val: super::vals::Mbr) { | ||
| 8524 | self.0 = (self.0 & !(0x07 << 28usize)) | (((val.0 as u32) & 0x07) << 28usize); | ||
| 8525 | } | ||
| 8526 | } | ||
| 8527 | impl Default for Cfg1 { | ||
| 8528 | fn default() -> Cfg1 { | ||
| 8529 | Cfg1(0) | ||
| 9068 | } | 8530 | } |
| 9069 | } | 8531 | } |
| 9070 | } | 8532 | } |
| 9071 | } | 8533 | } |
| 9072 | pub mod spi_v2 { | 8534 | pub mod exti_v1 { |
| 9073 | use crate::generic::*; | 8535 | use crate::generic::*; |
| 9074 | #[doc = "Serial peripheral interface"] | 8536 | #[doc = "External interrupt/event controller"] |
| 9075 | #[derive(Copy, Clone)] | 8537 | #[derive(Copy, Clone)] |
| 9076 | pub struct Spi(pub *mut u8); | 8538 | pub struct Exti(pub *mut u8); |
| 9077 | unsafe impl Send for Spi {} | 8539 | unsafe impl Send for Exti {} |
| 9078 | unsafe impl Sync for Spi {} | 8540 | unsafe impl Sync for Exti {} |
| 9079 | impl Spi { | 8541 | impl Exti { |
| 9080 | #[doc = "control register 1"] | 8542 | #[doc = "Interrupt mask register (EXTI_IMR)"] |
| 9081 | pub fn cr1(self) -> Reg<regs::Cr1, RW> { | 8543 | pub fn imr(self) -> Reg<regs::Imr, RW> { |
| 9082 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | 8544 | unsafe { Reg::from_ptr(self.0.add(0usize)) } |
| 9083 | } | 8545 | } |
| 9084 | #[doc = "control register 2"] | 8546 | #[doc = "Event mask register (EXTI_EMR)"] |
| 9085 | pub fn cr2(self) -> Reg<regs::Cr2, RW> { | 8547 | pub fn emr(self) -> Reg<regs::Emr, RW> { |
| 9086 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | 8548 | unsafe { Reg::from_ptr(self.0.add(4usize)) } |
| 9087 | } | 8549 | } |
| 9088 | #[doc = "status register"] | 8550 | #[doc = "Rising Trigger selection register (EXTI_RTSR)"] |
| 9089 | pub fn sr(self) -> Reg<regs::Sr, RW> { | 8551 | pub fn rtsr(self) -> Reg<regs::Rtsr, RW> { |
| 9090 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | 8552 | unsafe { Reg::from_ptr(self.0.add(8usize)) } |
| 9091 | } | 8553 | } |
| 9092 | #[doc = "data register"] | 8554 | #[doc = "Falling Trigger selection register (EXTI_FTSR)"] |
| 9093 | pub fn dr(self) -> Reg<regs::Dr, RW> { | 8555 | pub fn ftsr(self) -> Reg<regs::Ftsr, RW> { |
| 9094 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | 8556 | unsafe { Reg::from_ptr(self.0.add(12usize)) } |
| 9095 | } | 8557 | } |
| 9096 | #[doc = "CRC polynomial register"] | 8558 | #[doc = "Software interrupt event register (EXTI_SWIER)"] |
| 9097 | pub fn crcpr(self) -> Reg<regs::Crcpr, RW> { | 8559 | pub fn swier(self) -> Reg<regs::Swier, RW> { |
| 9098 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | 8560 | unsafe { Reg::from_ptr(self.0.add(16usize)) } |
| 9099 | } | 8561 | } |
| 9100 | #[doc = "RX CRC register"] | 8562 | #[doc = "Pending register (EXTI_PR)"] |
| 9101 | pub fn rxcrcr(self) -> Reg<regs::Rxcrcr, R> { | 8563 | pub fn pr(self) -> Reg<regs::Pr, RW> { |
| 9102 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | 8564 | unsafe { Reg::from_ptr(self.0.add(20usize)) } |
| 9103 | } | 8565 | } |
| 9104 | #[doc = "TX CRC register"] | ||
| 9105 | pub fn txcrcr(self) -> Reg<regs::Txcrcr, R> { | ||
| 9106 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | ||
| 9107 | } | ||
| 9108 | } | 8566 | } |
| 9109 | pub mod vals { | 8567 | pub mod regs { |
| 9110 | use crate::generic::*; | 8568 | use crate::generic::*; |
| 8569 | #[doc = "Pending register (EXTI_PR)"] | ||
| 9111 | #[repr(transparent)] | 8570 | #[repr(transparent)] |
| 9112 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8571 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9113 | pub struct Ftlvlr(pub u8); | 8572 | pub struct Pr(pub u32); |
| 9114 | impl Ftlvlr { | 8573 | impl Pr { |
| 9115 | #[doc = "Tx FIFO Empty"] | 8574 | #[doc = "Pending bit 0"] |
| 9116 | pub const EMPTY: Self = Self(0); | 8575 | pub fn pr(&self, n: usize) -> bool { |
| 9117 | #[doc = "Tx 1/4 FIFO"] | 8576 | assert!(n < 23usize); |
| 9118 | pub const QUARTER: Self = Self(0x01); | 8577 | let offs = 0usize + n * 1usize; |
| 9119 | #[doc = "Tx 1/2 FIFO"] | 8578 | let val = (self.0 >> offs) & 0x01; |
| 9120 | pub const HALF: Self = Self(0x02); | 8579 | val != 0 |
| 9121 | #[doc = "Tx FIFO full"] | 8580 | } |
| 9122 | pub const FULL: Self = Self(0x03); | 8581 | #[doc = "Pending bit 0"] |
| 9123 | } | 8582 | pub fn set_pr(&mut self, n: usize, val: bool) { |
| 9124 | #[repr(transparent)] | 8583 | assert!(n < 23usize); |
| 9125 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8584 | let offs = 0usize + n * 1usize; |
| 9126 | pub struct Crcnext(pub u8); | 8585 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); |
| 9127 | impl Crcnext { | 8586 | } |
| 9128 | #[doc = "Next transmit value is from Tx buffer"] | ||
| 9129 | pub const TXBUFFER: Self = Self(0); | ||
| 9130 | #[doc = "Next transmit value is from Tx CRC register"] | ||
| 9131 | pub const CRC: Self = Self(0x01); | ||
| 9132 | } | 8587 | } |
| 9133 | #[repr(transparent)] | 8588 | impl Default for Pr { |
| 9134 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8589 | fn default() -> Pr { |
| 9135 | pub struct Rxonly(pub u8); | 8590 | Pr(0) |
| 9136 | impl Rxonly { | 8591 | } |
| 9137 | #[doc = "Full duplex (Transmit and receive)"] | ||
| 9138 | pub const FULLDUPLEX: Self = Self(0); | ||
| 9139 | #[doc = "Output disabled (Receive-only mode)"] | ||
| 9140 | pub const OUTPUTDISABLED: Self = Self(0x01); | ||
| 9141 | } | 8592 | } |
| 8593 | #[doc = "Interrupt mask register (EXTI_IMR)"] | ||
| 9142 | #[repr(transparent)] | 8594 | #[repr(transparent)] |
| 9143 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8595 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9144 | pub struct Cpol(pub u8); | 8596 | pub struct Imr(pub u32); |
| 9145 | impl Cpol { | 8597 | impl Imr { |
| 9146 | #[doc = "CK to 0 when idle"] | 8598 | #[doc = "Interrupt Mask on line 0"] |
| 9147 | pub const IDLELOW: Self = Self(0); | 8599 | pub fn mr(&self, n: usize) -> super::vals::Mr { |
| 9148 | #[doc = "CK to 1 when idle"] | 8600 | assert!(n < 23usize); |
| 9149 | pub const IDLEHIGH: Self = Self(0x01); | 8601 | let offs = 0usize + n * 1usize; |
| 8602 | let val = (self.0 >> offs) & 0x01; | ||
| 8603 | super::vals::Mr(val as u8) | ||
| 8604 | } | ||
| 8605 | #[doc = "Interrupt Mask on line 0"] | ||
| 8606 | pub fn set_mr(&mut self, n: usize, val: super::vals::Mr) { | ||
| 8607 | assert!(n < 23usize); | ||
| 8608 | let offs = 0usize + n * 1usize; | ||
| 8609 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 8610 | } | ||
| 9150 | } | 8611 | } |
| 9151 | #[repr(transparent)] | 8612 | impl Default for Imr { |
| 9152 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8613 | fn default() -> Imr { |
| 9153 | pub struct Frlvlr(pub u8); | 8614 | Imr(0) |
| 9154 | impl Frlvlr { | 8615 | } |
| 9155 | #[doc = "Rx FIFO Empty"] | ||
| 9156 | pub const EMPTY: Self = Self(0); | ||
| 9157 | #[doc = "Rx 1/4 FIFO"] | ||
| 9158 | pub const QUARTER: Self = Self(0x01); | ||
| 9159 | #[doc = "Rx 1/2 FIFO"] | ||
| 9160 | pub const HALF: Self = Self(0x02); | ||
| 9161 | #[doc = "Rx FIFO full"] | ||
| 9162 | pub const FULL: Self = Self(0x03); | ||
| 9163 | } | 8616 | } |
| 8617 | #[doc = "Rising Trigger selection register (EXTI_RTSR)"] | ||
| 9164 | #[repr(transparent)] | 8618 | #[repr(transparent)] |
| 9165 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8619 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9166 | pub struct Ds(pub u8); | 8620 | pub struct Rtsr(pub u32); |
| 9167 | impl Ds { | 8621 | impl Rtsr { |
| 9168 | #[doc = "4-bit"] | 8622 | #[doc = "Rising trigger event configuration of line 0"] |
| 9169 | pub const FOURBIT: Self = Self(0x03); | 8623 | pub fn tr(&self, n: usize) -> super::vals::Tr { |
| 9170 | #[doc = "5-bit"] | 8624 | assert!(n < 23usize); |
| 9171 | pub const FIVEBIT: Self = Self(0x04); | 8625 | let offs = 0usize + n * 1usize; |
| 9172 | #[doc = "6-bit"] | 8626 | let val = (self.0 >> offs) & 0x01; |
| 9173 | pub const SIXBIT: Self = Self(0x05); | 8627 | super::vals::Tr(val as u8) |
| 9174 | #[doc = "7-bit"] | 8628 | } |
| 9175 | pub const SEVENBIT: Self = Self(0x06); | 8629 | #[doc = "Rising trigger event configuration of line 0"] |
| 9176 | #[doc = "8-bit"] | 8630 | pub fn set_tr(&mut self, n: usize, val: super::vals::Tr) { |
| 9177 | pub const EIGHTBIT: Self = Self(0x07); | 8631 | assert!(n < 23usize); |
| 9178 | #[doc = "9-bit"] | 8632 | let offs = 0usize + n * 1usize; |
| 9179 | pub const NINEBIT: Self = Self(0x08); | 8633 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); |
| 9180 | #[doc = "10-bit"] | 8634 | } |
| 9181 | pub const TENBIT: Self = Self(0x09); | ||
| 9182 | #[doc = "11-bit"] | ||
| 9183 | pub const ELEVENBIT: Self = Self(0x0a); | ||
| 9184 | #[doc = "12-bit"] | ||
| 9185 | pub const TWELVEBIT: Self = Self(0x0b); | ||
| 9186 | #[doc = "13-bit"] | ||
| 9187 | pub const THIRTEENBIT: Self = Self(0x0c); | ||
| 9188 | #[doc = "14-bit"] | ||
| 9189 | pub const FOURTEENBIT: Self = Self(0x0d); | ||
| 9190 | #[doc = "15-bit"] | ||
| 9191 | pub const FIFTEENBIT: Self = Self(0x0e); | ||
| 9192 | #[doc = "16-bit"] | ||
| 9193 | pub const SIXTEENBIT: Self = Self(0x0f); | ||
| 9194 | } | 8635 | } |
| 9195 | #[repr(transparent)] | 8636 | impl Default for Rtsr { |
| 9196 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8637 | fn default() -> Rtsr { |
| 9197 | pub struct LdmaRx(pub u8); | 8638 | Rtsr(0) |
| 9198 | impl LdmaRx { | 8639 | } |
| 9199 | #[doc = "Number of data to transfer for receive is even"] | ||
| 9200 | pub const EVEN: Self = Self(0); | ||
| 9201 | #[doc = "Number of data to transfer for receive is odd"] | ||
| 9202 | pub const ODD: Self = Self(0x01); | ||
| 9203 | } | 8640 | } |
| 8641 | #[doc = "Falling Trigger selection register (EXTI_FTSR)"] | ||
| 9204 | #[repr(transparent)] | 8642 | #[repr(transparent)] |
| 9205 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8643 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9206 | pub struct Mstr(pub u8); | 8644 | pub struct Ftsr(pub u32); |
| 9207 | impl Mstr { | 8645 | impl Ftsr { |
| 9208 | #[doc = "Slave configuration"] | 8646 | #[doc = "Falling trigger event configuration of line 0"] |
| 9209 | pub const SLAVE: Self = Self(0); | 8647 | pub fn tr(&self, n: usize) -> super::vals::Tr { |
| 9210 | #[doc = "Master configuration"] | 8648 | assert!(n < 23usize); |
| 9211 | pub const MASTER: Self = Self(0x01); | 8649 | let offs = 0usize + n * 1usize; |
| 8650 | let val = (self.0 >> offs) & 0x01; | ||
| 8651 | super::vals::Tr(val as u8) | ||
| 8652 | } | ||
| 8653 | #[doc = "Falling trigger event configuration of line 0"] | ||
| 8654 | pub fn set_tr(&mut self, n: usize, val: super::vals::Tr) { | ||
| 8655 | assert!(n < 23usize); | ||
| 8656 | let offs = 0usize + n * 1usize; | ||
| 8657 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 8658 | } | ||
| 9212 | } | 8659 | } |
| 9213 | #[repr(transparent)] | 8660 | impl Default for Ftsr { |
| 9214 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8661 | fn default() -> Ftsr { |
| 9215 | pub struct Crcl(pub u8); | 8662 | Ftsr(0) |
| 9216 | impl Crcl { | 8663 | } |
| 9217 | #[doc = "8-bit CRC length"] | ||
| 9218 | pub const EIGHTBIT: Self = Self(0); | ||
| 9219 | #[doc = "16-bit CRC length"] | ||
| 9220 | pub const SIXTEENBIT: Self = Self(0x01); | ||
| 9221 | } | 8664 | } |
| 8665 | #[doc = "Software interrupt event register (EXTI_SWIER)"] | ||
| 9222 | #[repr(transparent)] | 8666 | #[repr(transparent)] |
| 9223 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8667 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9224 | pub struct Bidioe(pub u8); | 8668 | pub struct Swier(pub u32); |
| 9225 | impl Bidioe { | 8669 | impl Swier { |
| 9226 | #[doc = "Output disabled (receive-only mode)"] | 8670 | #[doc = "Software Interrupt on line 0"] |
| 9227 | pub const OUTPUTDISABLED: Self = Self(0); | 8671 | pub fn swier(&self, n: usize) -> bool { |
| 9228 | #[doc = "Output enabled (transmit-only mode)"] | 8672 | assert!(n < 23usize); |
| 9229 | pub const OUTPUTENABLED: Self = Self(0x01); | 8673 | let offs = 0usize + n * 1usize; |
| 8674 | let val = (self.0 >> offs) & 0x01; | ||
| 8675 | val != 0 | ||
| 8676 | } | ||
| 8677 | #[doc = "Software Interrupt on line 0"] | ||
| 8678 | pub fn set_swier(&mut self, n: usize, val: bool) { | ||
| 8679 | assert!(n < 23usize); | ||
| 8680 | let offs = 0usize + n * 1usize; | ||
| 8681 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 8682 | } | ||
| 9230 | } | 8683 | } |
| 9231 | #[repr(transparent)] | 8684 | impl Default for Swier { |
| 9232 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8685 | fn default() -> Swier { |
| 9233 | pub struct Frer(pub u8); | 8686 | Swier(0) |
| 9234 | impl Frer { | 8687 | } |
| 9235 | #[doc = "No frame format error"] | ||
| 9236 | pub const NOERROR: Self = Self(0); | ||
| 9237 | #[doc = "A frame format error occurred"] | ||
| 9238 | pub const ERROR: Self = Self(0x01); | ||
| 9239 | } | 8688 | } |
| 8689 | #[doc = "Event mask register (EXTI_EMR)"] | ||
| 9240 | #[repr(transparent)] | 8690 | #[repr(transparent)] |
| 9241 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8691 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9242 | pub struct Bidimode(pub u8); | 8692 | pub struct Emr(pub u32); |
| 9243 | impl Bidimode { | 8693 | impl Emr { |
| 9244 | #[doc = "2-line unidirectional data mode selected"] | 8694 | #[doc = "Event Mask on line 0"] |
| 9245 | pub const UNIDIRECTIONAL: Self = Self(0); | 8695 | pub fn mr(&self, n: usize) -> super::vals::Mr { |
| 9246 | #[doc = "1-line bidirectional data mode selected"] | 8696 | assert!(n < 23usize); |
| 9247 | pub const BIDIRECTIONAL: Self = Self(0x01); | 8697 | let offs = 0usize + n * 1usize; |
| 8698 | let val = (self.0 >> offs) & 0x01; | ||
| 8699 | super::vals::Mr(val as u8) | ||
| 8700 | } | ||
| 8701 | #[doc = "Event Mask on line 0"] | ||
| 8702 | pub fn set_mr(&mut self, n: usize, val: super::vals::Mr) { | ||
| 8703 | assert!(n < 23usize); | ||
| 8704 | let offs = 0usize + n * 1usize; | ||
| 8705 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 8706 | } | ||
| 9248 | } | 8707 | } |
| 9249 | #[repr(transparent)] | 8708 | impl Default for Emr { |
| 9250 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8709 | fn default() -> Emr { |
| 9251 | pub struct Br(pub u8); | 8710 | Emr(0) |
| 9252 | impl Br { | 8711 | } |
| 9253 | #[doc = "f_PCLK / 2"] | ||
| 9254 | pub const DIV2: Self = Self(0); | ||
| 9255 | #[doc = "f_PCLK / 4"] | ||
| 9256 | pub const DIV4: Self = Self(0x01); | ||
| 9257 | #[doc = "f_PCLK / 8"] | ||
| 9258 | pub const DIV8: Self = Self(0x02); | ||
| 9259 | #[doc = "f_PCLK / 16"] | ||
| 9260 | pub const DIV16: Self = Self(0x03); | ||
| 9261 | #[doc = "f_PCLK / 32"] | ||
| 9262 | pub const DIV32: Self = Self(0x04); | ||
| 9263 | #[doc = "f_PCLK / 64"] | ||
| 9264 | pub const DIV64: Self = Self(0x05); | ||
| 9265 | #[doc = "f_PCLK / 128"] | ||
| 9266 | pub const DIV128: Self = Self(0x06); | ||
| 9267 | #[doc = "f_PCLK / 256"] | ||
| 9268 | pub const DIV256: Self = Self(0x07); | ||
| 9269 | } | 8712 | } |
| 8713 | } | ||
| 8714 | pub mod vals { | ||
| 8715 | use crate::generic::*; | ||
| 9270 | #[repr(transparent)] | 8716 | #[repr(transparent)] |
| 9271 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8717 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 9272 | pub struct Cpha(pub u8); | 8718 | pub struct Prw(pub u8); |
| 9273 | impl Cpha { | 8719 | impl Prw { |
| 9274 | #[doc = "The first clock transition is the first data capture edge"] | 8720 | #[doc = "Clears pending bit"] |
| 9275 | pub const FIRSTEDGE: Self = Self(0); | 8721 | pub const CLEAR: Self = Self(0x01); |
| 9276 | #[doc = "The second clock transition is the first data capture edge"] | ||
| 9277 | pub const SECONDEDGE: Self = Self(0x01); | ||
| 9278 | } | 8722 | } |
| 9279 | #[repr(transparent)] | 8723 | #[repr(transparent)] |
| 9280 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8724 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 9281 | pub struct Frxth(pub u8); | 8725 | pub struct Mr(pub u8); |
| 9282 | impl Frxth { | 8726 | impl Mr { |
| 9283 | #[doc = "RXNE event is generated if the FIFO level is greater than or equal to 1/2 (16-bit)"] | 8727 | #[doc = "Interrupt request line is masked"] |
| 9284 | pub const HALF: Self = Self(0); | 8728 | pub const MASKED: Self = Self(0); |
| 9285 | #[doc = "RXNE event is generated if the FIFO level is greater than or equal to 1/4 (8-bit)"] | 8729 | #[doc = "Interrupt request line is unmasked"] |
| 9286 | pub const QUARTER: Self = Self(0x01); | 8730 | pub const UNMASKED: Self = Self(0x01); |
| 9287 | } | 8731 | } |
| 9288 | #[repr(transparent)] | 8732 | #[repr(transparent)] |
| 9289 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8733 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 9290 | pub struct Frf(pub u8); | 8734 | pub struct Tr(pub u8); |
| 9291 | impl Frf { | 8735 | impl Tr { |
| 9292 | #[doc = "SPI Motorola mode"] | 8736 | #[doc = "Falling edge trigger is disabled"] |
| 9293 | pub const MOTOROLA: Self = Self(0); | 8737 | pub const DISABLED: Self = Self(0); |
| 9294 | #[doc = "SPI TI mode"] | 8738 | #[doc = "Falling edge trigger is enabled"] |
| 9295 | pub const TI: Self = Self(0x01); | 8739 | pub const ENABLED: Self = Self(0x01); |
| 9296 | } | 8740 | } |
| 9297 | #[repr(transparent)] | 8741 | #[repr(transparent)] |
| 9298 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8742 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 9299 | pub struct LdmaTx(pub u8); | 8743 | pub struct Swierw(pub u8); |
| 9300 | impl LdmaTx { | 8744 | impl Swierw { |
| 9301 | #[doc = "Number of data to transfer for transmit is even"] | 8745 | #[doc = "Generates an interrupt request"] |
| 9302 | pub const EVEN: Self = Self(0); | 8746 | pub const PEND: Self = Self(0x01); |
| 9303 | #[doc = "Number of data to transfer for transmit is odd"] | ||
| 9304 | pub const ODD: Self = Self(0x01); | ||
| 9305 | } | 8747 | } |
| 9306 | #[repr(transparent)] | 8748 | #[repr(transparent)] |
| 9307 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8749 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 9308 | pub struct Lsbfirst(pub u8); | 8750 | pub struct Prr(pub u8); |
| 9309 | impl Lsbfirst { | 8751 | impl Prr { |
| 9310 | #[doc = "Data is transmitted/received with the MSB first"] | 8752 | #[doc = "No trigger request occurred"] |
| 9311 | pub const MSBFIRST: Self = Self(0); | 8753 | pub const NOTPENDING: Self = Self(0); |
| 9312 | #[doc = "Data is transmitted/received with the LSB first"] | 8754 | #[doc = "Selected trigger request occurred"] |
| 9313 | pub const LSBFIRST: Self = Self(0x01); | 8755 | pub const PENDING: Self = Self(0x01); |
| 9314 | } | 8756 | } |
| 9315 | } | 8757 | } |
| 9316 | pub mod regs { | 8758 | } |
| 9317 | use crate::generic::*; | 8759 | pub mod spi_v2 { |
| 9318 | #[doc = "TX CRC register"] | 8760 | use crate::generic::*; |
| 9319 | #[repr(transparent)] | 8761 | #[doc = "Serial peripheral interface"] |
| 9320 | #[derive(Copy, Clone, Eq, PartialEq)] | 8762 | #[derive(Copy, Clone)] |
| 9321 | pub struct Txcrcr(pub u32); | 8763 | pub struct Spi(pub *mut u8); |
| 9322 | impl Txcrcr { | 8764 | unsafe impl Send for Spi {} |
| 9323 | #[doc = "Tx CRC register"] | 8765 | unsafe impl Sync for Spi {} |
| 9324 | pub const fn tx_crc(&self) -> u16 { | 8766 | impl Spi { |
| 9325 | let val = (self.0 >> 0usize) & 0xffff; | 8767 | #[doc = "control register 1"] |
| 9326 | val as u16 | 8768 | pub fn cr1(self) -> Reg<regs::Cr1, RW> { |
| 9327 | } | 8769 | unsafe { Reg::from_ptr(self.0.add(0usize)) } |
| 9328 | #[doc = "Tx CRC register"] | ||
| 9329 | pub fn set_tx_crc(&mut self, val: u16) { | ||
| 9330 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 9331 | } | ||
| 9332 | } | 8770 | } |
| 9333 | impl Default for Txcrcr { | 8771 | #[doc = "control register 2"] |
| 9334 | fn default() -> Txcrcr { | 8772 | pub fn cr2(self) -> Reg<regs::Cr2, RW> { |
| 9335 | Txcrcr(0) | 8773 | unsafe { Reg::from_ptr(self.0.add(4usize)) } |
| 9336 | } | 8774 | } |
| 8775 | #[doc = "status register"] | ||
| 8776 | pub fn sr(self) -> Reg<regs::Sr, RW> { | ||
| 8777 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 8778 | } | ||
| 8779 | #[doc = "data register"] | ||
| 8780 | pub fn dr(self) -> Reg<regs::Dr, RW> { | ||
| 8781 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 8782 | } | ||
| 8783 | #[doc = "CRC polynomial register"] | ||
| 8784 | pub fn crcpr(self) -> Reg<regs::Crcpr, RW> { | ||
| 8785 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 9337 | } | 8786 | } |
| 9338 | #[doc = "RX CRC register"] | 8787 | #[doc = "RX CRC register"] |
| 9339 | #[repr(transparent)] | 8788 | pub fn rxcrcr(self) -> Reg<regs::Rxcrcr, R> { |
| 9340 | #[derive(Copy, Clone, Eq, PartialEq)] | 8789 | unsafe { Reg::from_ptr(self.0.add(20usize)) } |
| 9341 | pub struct Rxcrcr(pub u32); | ||
| 9342 | impl Rxcrcr { | ||
| 9343 | #[doc = "Rx CRC register"] | ||
| 9344 | pub const fn rx_crc(&self) -> u16 { | ||
| 9345 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 9346 | val as u16 | ||
| 9347 | } | ||
| 9348 | #[doc = "Rx CRC register"] | ||
| 9349 | pub fn set_rx_crc(&mut self, val: u16) { | ||
| 9350 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 9351 | } | ||
| 9352 | } | 8790 | } |
| 9353 | impl Default for Rxcrcr { | 8791 | #[doc = "TX CRC register"] |
| 9354 | fn default() -> Rxcrcr { | 8792 | pub fn txcrcr(self) -> Reg<regs::Txcrcr, R> { |
| 9355 | Rxcrcr(0) | 8793 | unsafe { Reg::from_ptr(self.0.add(24usize)) } |
| 9356 | } | ||
| 9357 | } | 8794 | } |
| 8795 | } | ||
| 8796 | pub mod regs { | ||
| 8797 | use crate::generic::*; | ||
| 9358 | #[doc = "status register"] | 8798 | #[doc = "status register"] |
| 9359 | #[repr(transparent)] | 8799 | #[repr(transparent)] |
| 9360 | #[derive(Copy, Clone, Eq, PartialEq)] | 8800 | #[derive(Copy, Clone, Eq, PartialEq)] |
| @@ -9447,24 +8887,64 @@ pub mod spi_v2 { | |||
| 9447 | Sr(0) | 8887 | Sr(0) |
| 9448 | } | 8888 | } |
| 9449 | } | 8889 | } |
| 9450 | #[doc = "data register"] | 8890 | #[doc = "TX CRC register"] |
| 9451 | #[repr(transparent)] | 8891 | #[repr(transparent)] |
| 9452 | #[derive(Copy, Clone, Eq, PartialEq)] | 8892 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9453 | pub struct Dr(pub u32); | 8893 | pub struct Txcrcr(pub u32); |
| 9454 | impl Dr { | 8894 | impl Txcrcr { |
| 9455 | #[doc = "Data register"] | 8895 | #[doc = "Tx CRC register"] |
| 9456 | pub const fn dr(&self) -> u16 { | 8896 | pub const fn tx_crc(&self) -> u16 { |
| 9457 | let val = (self.0 >> 0usize) & 0xffff; | 8897 | let val = (self.0 >> 0usize) & 0xffff; |
| 9458 | val as u16 | 8898 | val as u16 |
| 9459 | } | 8899 | } |
| 9460 | #[doc = "Data register"] | 8900 | #[doc = "Tx CRC register"] |
| 9461 | pub fn set_dr(&mut self, val: u16) { | 8901 | pub fn set_tx_crc(&mut self, val: u16) { |
| 9462 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | 8902 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); |
| 9463 | } | 8903 | } |
| 9464 | } | 8904 | } |
| 9465 | impl Default for Dr { | 8905 | impl Default for Txcrcr { |
| 9466 | fn default() -> Dr { | 8906 | fn default() -> Txcrcr { |
| 9467 | Dr(0) | 8907 | Txcrcr(0) |
| 8908 | } | ||
| 8909 | } | ||
| 8910 | #[doc = "RX CRC register"] | ||
| 8911 | #[repr(transparent)] | ||
| 8912 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 8913 | pub struct Rxcrcr(pub u32); | ||
| 8914 | impl Rxcrcr { | ||
| 8915 | #[doc = "Rx CRC register"] | ||
| 8916 | pub const fn rx_crc(&self) -> u16 { | ||
| 8917 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 8918 | val as u16 | ||
| 8919 | } | ||
| 8920 | #[doc = "Rx CRC register"] | ||
| 8921 | pub fn set_rx_crc(&mut self, val: u16) { | ||
| 8922 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 8923 | } | ||
| 8924 | } | ||
| 8925 | impl Default for Rxcrcr { | ||
| 8926 | fn default() -> Rxcrcr { | ||
| 8927 | Rxcrcr(0) | ||
| 8928 | } | ||
| 8929 | } | ||
| 8930 | #[doc = "CRC polynomial register"] | ||
| 8931 | #[repr(transparent)] | ||
| 8932 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 8933 | pub struct Crcpr(pub u32); | ||
| 8934 | impl Crcpr { | ||
| 8935 | #[doc = "CRC polynomial register"] | ||
| 8936 | pub const fn crcpoly(&self) -> u16 { | ||
| 8937 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 8938 | val as u16 | ||
| 8939 | } | ||
| 8940 | #[doc = "CRC polynomial register"] | ||
| 8941 | pub fn set_crcpoly(&mut self, val: u16) { | ||
| 8942 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 8943 | } | ||
| 8944 | } | ||
| 8945 | impl Default for Crcpr { | ||
| 8946 | fn default() -> Crcpr { | ||
| 8947 | Crcpr(0) | ||
| 9468 | } | 8948 | } |
| 9469 | } | 8949 | } |
| 9470 | #[doc = "control register 2"] | 8950 | #[doc = "control register 2"] |
| @@ -9723,552 +9203,2225 @@ pub mod spi_v2 { | |||
| 9723 | Cr1(0) | 9203 | Cr1(0) |
| 9724 | } | 9204 | } |
| 9725 | } | 9205 | } |
| 9726 | #[doc = "CRC polynomial register"] | 9206 | #[doc = "data register"] |
| 9727 | #[repr(transparent)] | 9207 | #[repr(transparent)] |
| 9728 | #[derive(Copy, Clone, Eq, PartialEq)] | 9208 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9729 | pub struct Crcpr(pub u32); | 9209 | pub struct Dr(pub u32); |
| 9730 | impl Crcpr { | 9210 | impl Dr { |
| 9731 | #[doc = "CRC polynomial register"] | 9211 | #[doc = "Data register"] |
| 9732 | pub const fn crcpoly(&self) -> u16 { | 9212 | pub const fn dr(&self) -> u16 { |
| 9733 | let val = (self.0 >> 0usize) & 0xffff; | 9213 | let val = (self.0 >> 0usize) & 0xffff; |
| 9734 | val as u16 | 9214 | val as u16 |
| 9735 | } | 9215 | } |
| 9736 | #[doc = "CRC polynomial register"] | 9216 | #[doc = "Data register"] |
| 9737 | pub fn set_crcpoly(&mut self, val: u16) { | 9217 | pub fn set_dr(&mut self, val: u16) { |
| 9738 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | 9218 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); |
| 9739 | } | 9219 | } |
| 9740 | } | 9220 | } |
| 9741 | impl Default for Crcpr { | 9221 | impl Default for Dr { |
| 9742 | fn default() -> Crcpr { | 9222 | fn default() -> Dr { |
| 9743 | Crcpr(0) | 9223 | Dr(0) |
| 9744 | } | 9224 | } |
| 9745 | } | 9225 | } |
| 9746 | } | 9226 | } |
| 9227 | pub mod vals { | ||
| 9228 | use crate::generic::*; | ||
| 9229 | #[repr(transparent)] | ||
| 9230 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9231 | pub struct Lsbfirst(pub u8); | ||
| 9232 | impl Lsbfirst { | ||
| 9233 | #[doc = "Data is transmitted/received with the MSB first"] | ||
| 9234 | pub const MSBFIRST: Self = Self(0); | ||
| 9235 | #[doc = "Data is transmitted/received with the LSB first"] | ||
| 9236 | pub const LSBFIRST: Self = Self(0x01); | ||
| 9237 | } | ||
| 9238 | #[repr(transparent)] | ||
| 9239 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9240 | pub struct Frer(pub u8); | ||
| 9241 | impl Frer { | ||
| 9242 | #[doc = "No frame format error"] | ||
| 9243 | pub const NOERROR: Self = Self(0); | ||
| 9244 | #[doc = "A frame format error occurred"] | ||
| 9245 | pub const ERROR: Self = Self(0x01); | ||
| 9246 | } | ||
| 9247 | #[repr(transparent)] | ||
| 9248 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9249 | pub struct LdmaTx(pub u8); | ||
| 9250 | impl LdmaTx { | ||
| 9251 | #[doc = "Number of data to transfer for transmit is even"] | ||
| 9252 | pub const EVEN: Self = Self(0); | ||
| 9253 | #[doc = "Number of data to transfer for transmit is odd"] | ||
| 9254 | pub const ODD: Self = Self(0x01); | ||
| 9255 | } | ||
| 9256 | #[repr(transparent)] | ||
| 9257 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9258 | pub struct Bidioe(pub u8); | ||
| 9259 | impl Bidioe { | ||
| 9260 | #[doc = "Output disabled (receive-only mode)"] | ||
| 9261 | pub const OUTPUTDISABLED: Self = Self(0); | ||
| 9262 | #[doc = "Output enabled (transmit-only mode)"] | ||
| 9263 | pub const OUTPUTENABLED: Self = Self(0x01); | ||
| 9264 | } | ||
| 9265 | #[repr(transparent)] | ||
| 9266 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9267 | pub struct Cpol(pub u8); | ||
| 9268 | impl Cpol { | ||
| 9269 | #[doc = "CK to 0 when idle"] | ||
| 9270 | pub const IDLELOW: Self = Self(0); | ||
| 9271 | #[doc = "CK to 1 when idle"] | ||
| 9272 | pub const IDLEHIGH: Self = Self(0x01); | ||
| 9273 | } | ||
| 9274 | #[repr(transparent)] | ||
| 9275 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9276 | pub struct Frf(pub u8); | ||
| 9277 | impl Frf { | ||
| 9278 | #[doc = "SPI Motorola mode"] | ||
| 9279 | pub const MOTOROLA: Self = Self(0); | ||
| 9280 | #[doc = "SPI TI mode"] | ||
| 9281 | pub const TI: Self = Self(0x01); | ||
| 9282 | } | ||
| 9283 | #[repr(transparent)] | ||
| 9284 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9285 | pub struct Crcnext(pub u8); | ||
| 9286 | impl Crcnext { | ||
| 9287 | #[doc = "Next transmit value is from Tx buffer"] | ||
| 9288 | pub const TXBUFFER: Self = Self(0); | ||
| 9289 | #[doc = "Next transmit value is from Tx CRC register"] | ||
| 9290 | pub const CRC: Self = Self(0x01); | ||
| 9291 | } | ||
| 9292 | #[repr(transparent)] | ||
| 9293 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9294 | pub struct Ftlvlr(pub u8); | ||
| 9295 | impl Ftlvlr { | ||
| 9296 | #[doc = "Tx FIFO Empty"] | ||
| 9297 | pub const EMPTY: Self = Self(0); | ||
| 9298 | #[doc = "Tx 1/4 FIFO"] | ||
| 9299 | pub const QUARTER: Self = Self(0x01); | ||
| 9300 | #[doc = "Tx 1/2 FIFO"] | ||
| 9301 | pub const HALF: Self = Self(0x02); | ||
| 9302 | #[doc = "Tx FIFO full"] | ||
| 9303 | pub const FULL: Self = Self(0x03); | ||
| 9304 | } | ||
| 9305 | #[repr(transparent)] | ||
| 9306 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9307 | pub struct Bidimode(pub u8); | ||
| 9308 | impl Bidimode { | ||
| 9309 | #[doc = "2-line unidirectional data mode selected"] | ||
| 9310 | pub const UNIDIRECTIONAL: Self = Self(0); | ||
| 9311 | #[doc = "1-line bidirectional data mode selected"] | ||
| 9312 | pub const BIDIRECTIONAL: Self = Self(0x01); | ||
| 9313 | } | ||
| 9314 | #[repr(transparent)] | ||
| 9315 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9316 | pub struct Cpha(pub u8); | ||
| 9317 | impl Cpha { | ||
| 9318 | #[doc = "The first clock transition is the first data capture edge"] | ||
| 9319 | pub const FIRSTEDGE: Self = Self(0); | ||
| 9320 | #[doc = "The second clock transition is the first data capture edge"] | ||
| 9321 | pub const SECONDEDGE: Self = Self(0x01); | ||
| 9322 | } | ||
| 9323 | #[repr(transparent)] | ||
| 9324 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9325 | pub struct Crcl(pub u8); | ||
| 9326 | impl Crcl { | ||
| 9327 | #[doc = "8-bit CRC length"] | ||
| 9328 | pub const EIGHTBIT: Self = Self(0); | ||
| 9329 | #[doc = "16-bit CRC length"] | ||
| 9330 | pub const SIXTEENBIT: Self = Self(0x01); | ||
| 9331 | } | ||
| 9332 | #[repr(transparent)] | ||
| 9333 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9334 | pub struct LdmaRx(pub u8); | ||
| 9335 | impl LdmaRx { | ||
| 9336 | #[doc = "Number of data to transfer for receive is even"] | ||
| 9337 | pub const EVEN: Self = Self(0); | ||
| 9338 | #[doc = "Number of data to transfer for receive is odd"] | ||
| 9339 | pub const ODD: Self = Self(0x01); | ||
| 9340 | } | ||
| 9341 | #[repr(transparent)] | ||
| 9342 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9343 | pub struct Frxth(pub u8); | ||
| 9344 | impl Frxth { | ||
| 9345 | #[doc = "RXNE event is generated if the FIFO level is greater than or equal to 1/2 (16-bit)"] | ||
| 9346 | pub const HALF: Self = Self(0); | ||
| 9347 | #[doc = "RXNE event is generated if the FIFO level is greater than or equal to 1/4 (8-bit)"] | ||
| 9348 | pub const QUARTER: Self = Self(0x01); | ||
| 9349 | } | ||
| 9350 | #[repr(transparent)] | ||
| 9351 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9352 | pub struct Mstr(pub u8); | ||
| 9353 | impl Mstr { | ||
| 9354 | #[doc = "Slave configuration"] | ||
| 9355 | pub const SLAVE: Self = Self(0); | ||
| 9356 | #[doc = "Master configuration"] | ||
| 9357 | pub const MASTER: Self = Self(0x01); | ||
| 9358 | } | ||
| 9359 | #[repr(transparent)] | ||
| 9360 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9361 | pub struct Ds(pub u8); | ||
| 9362 | impl Ds { | ||
| 9363 | #[doc = "4-bit"] | ||
| 9364 | pub const FOURBIT: Self = Self(0x03); | ||
| 9365 | #[doc = "5-bit"] | ||
| 9366 | pub const FIVEBIT: Self = Self(0x04); | ||
| 9367 | #[doc = "6-bit"] | ||
| 9368 | pub const SIXBIT: Self = Self(0x05); | ||
| 9369 | #[doc = "7-bit"] | ||
| 9370 | pub const SEVENBIT: Self = Self(0x06); | ||
| 9371 | #[doc = "8-bit"] | ||
| 9372 | pub const EIGHTBIT: Self = Self(0x07); | ||
| 9373 | #[doc = "9-bit"] | ||
| 9374 | pub const NINEBIT: Self = Self(0x08); | ||
| 9375 | #[doc = "10-bit"] | ||
| 9376 | pub const TENBIT: Self = Self(0x09); | ||
| 9377 | #[doc = "11-bit"] | ||
| 9378 | pub const ELEVENBIT: Self = Self(0x0a); | ||
| 9379 | #[doc = "12-bit"] | ||
| 9380 | pub const TWELVEBIT: Self = Self(0x0b); | ||
| 9381 | #[doc = "13-bit"] | ||
| 9382 | pub const THIRTEENBIT: Self = Self(0x0c); | ||
| 9383 | #[doc = "14-bit"] | ||
| 9384 | pub const FOURTEENBIT: Self = Self(0x0d); | ||
| 9385 | #[doc = "15-bit"] | ||
| 9386 | pub const FIFTEENBIT: Self = Self(0x0e); | ||
| 9387 | #[doc = "16-bit"] | ||
| 9388 | pub const SIXTEENBIT: Self = Self(0x0f); | ||
| 9389 | } | ||
| 9390 | #[repr(transparent)] | ||
| 9391 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9392 | pub struct Frlvlr(pub u8); | ||
| 9393 | impl Frlvlr { | ||
| 9394 | #[doc = "Rx FIFO Empty"] | ||
| 9395 | pub const EMPTY: Self = Self(0); | ||
| 9396 | #[doc = "Rx 1/4 FIFO"] | ||
| 9397 | pub const QUARTER: Self = Self(0x01); | ||
| 9398 | #[doc = "Rx 1/2 FIFO"] | ||
| 9399 | pub const HALF: Self = Self(0x02); | ||
| 9400 | #[doc = "Rx FIFO full"] | ||
| 9401 | pub const FULL: Self = Self(0x03); | ||
| 9402 | } | ||
| 9403 | #[repr(transparent)] | ||
| 9404 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9405 | pub struct Rxonly(pub u8); | ||
| 9406 | impl Rxonly { | ||
| 9407 | #[doc = "Full duplex (Transmit and receive)"] | ||
| 9408 | pub const FULLDUPLEX: Self = Self(0); | ||
| 9409 | #[doc = "Output disabled (Receive-only mode)"] | ||
| 9410 | pub const OUTPUTDISABLED: Self = Self(0x01); | ||
| 9411 | } | ||
| 9412 | #[repr(transparent)] | ||
| 9413 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9414 | pub struct Br(pub u8); | ||
| 9415 | impl Br { | ||
| 9416 | #[doc = "f_PCLK / 2"] | ||
| 9417 | pub const DIV2: Self = Self(0); | ||
| 9418 | #[doc = "f_PCLK / 4"] | ||
| 9419 | pub const DIV4: Self = Self(0x01); | ||
| 9420 | #[doc = "f_PCLK / 8"] | ||
| 9421 | pub const DIV8: Self = Self(0x02); | ||
| 9422 | #[doc = "f_PCLK / 16"] | ||
| 9423 | pub const DIV16: Self = Self(0x03); | ||
| 9424 | #[doc = "f_PCLK / 32"] | ||
| 9425 | pub const DIV32: Self = Self(0x04); | ||
| 9426 | #[doc = "f_PCLK / 64"] | ||
| 9427 | pub const DIV64: Self = Self(0x05); | ||
| 9428 | #[doc = "f_PCLK / 128"] | ||
| 9429 | pub const DIV128: Self = Self(0x06); | ||
| 9430 | #[doc = "f_PCLK / 256"] | ||
| 9431 | pub const DIV256: Self = Self(0x07); | ||
| 9432 | } | ||
| 9433 | } | ||
| 9747 | } | 9434 | } |
| 9748 | pub mod dma_v2 { | 9435 | pub mod timer_v1 { |
| 9749 | use crate::generic::*; | 9436 | use crate::generic::*; |
| 9750 | #[doc = "Stream cluster: S?CR, S?NDTR, S?M0AR, S?M1AR and S?FCR registers"] | 9437 | #[doc = "General purpose 32-bit timer"] |
| 9751 | #[derive(Copy, Clone)] | 9438 | #[derive(Copy, Clone)] |
| 9752 | pub struct St(pub *mut u8); | 9439 | pub struct TimGp32(pub *mut u8); |
| 9753 | unsafe impl Send for St {} | 9440 | unsafe impl Send for TimGp32 {} |
| 9754 | unsafe impl Sync for St {} | 9441 | unsafe impl Sync for TimGp32 {} |
| 9755 | impl St { | 9442 | impl TimGp32 { |
| 9756 | #[doc = "stream x configuration register"] | 9443 | #[doc = "control register 1"] |
| 9757 | pub fn cr(self) -> Reg<regs::Cr, RW> { | 9444 | pub fn cr1(self) -> Reg<regs::Cr1Gp, RW> { |
| 9758 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | 9445 | unsafe { Reg::from_ptr(self.0.add(0usize)) } |
| 9759 | } | 9446 | } |
| 9760 | #[doc = "stream x number of data register"] | 9447 | #[doc = "control register 2"] |
| 9761 | pub fn ndtr(self) -> Reg<regs::Ndtr, RW> { | 9448 | pub fn cr2(self) -> Reg<regs::Cr2Gp, RW> { |
| 9762 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | 9449 | unsafe { Reg::from_ptr(self.0.add(4usize)) } |
| 9763 | } | 9450 | } |
| 9764 | #[doc = "stream x peripheral address register"] | 9451 | #[doc = "slave mode control register"] |
| 9765 | pub fn par(self) -> Reg<u32, RW> { | 9452 | pub fn smcr(self) -> Reg<regs::Smcr, RW> { |
| 9766 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | 9453 | unsafe { Reg::from_ptr(self.0.add(8usize)) } |
| 9767 | } | 9454 | } |
| 9768 | #[doc = "stream x memory 0 address register"] | 9455 | #[doc = "DMA/Interrupt enable register"] |
| 9769 | pub fn m0ar(self) -> Reg<u32, RW> { | 9456 | pub fn dier(self) -> Reg<regs::DierGp, RW> { |
| 9770 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | 9457 | unsafe { Reg::from_ptr(self.0.add(12usize)) } |
| 9771 | } | 9458 | } |
| 9772 | #[doc = "stream x memory 1 address register"] | 9459 | #[doc = "status register"] |
| 9773 | pub fn m1ar(self) -> Reg<u32, RW> { | 9460 | pub fn sr(self) -> Reg<regs::SrGp, RW> { |
| 9774 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | 9461 | unsafe { Reg::from_ptr(self.0.add(16usize)) } |
| 9775 | } | 9462 | } |
| 9776 | #[doc = "stream x FIFO control register"] | 9463 | #[doc = "event generation register"] |
| 9777 | pub fn fcr(self) -> Reg<regs::Fcr, RW> { | 9464 | pub fn egr(self) -> Reg<regs::EgrGp, W> { |
| 9778 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | 9465 | unsafe { Reg::from_ptr(self.0.add(20usize)) } |
| 9779 | } | 9466 | } |
| 9467 | #[doc = "capture/compare mode register 1 (input mode)"] | ||
| 9468 | pub fn ccmr_input(self, n: usize) -> Reg<regs::CcmrInput, RW> { | ||
| 9469 | assert!(n < 2usize); | ||
| 9470 | unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) } | ||
| 9471 | } | ||
| 9472 | #[doc = "capture/compare mode register 1 (output mode)"] | ||
| 9473 | pub fn ccmr_output(self, n: usize) -> Reg<regs::CcmrOutput, RW> { | ||
| 9474 | assert!(n < 2usize); | ||
| 9475 | unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) } | ||
| 9476 | } | ||
| 9477 | #[doc = "capture/compare enable register"] | ||
| 9478 | pub fn ccer(self) -> Reg<regs::CcerGp, RW> { | ||
| 9479 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | ||
| 9480 | } | ||
| 9481 | #[doc = "counter"] | ||
| 9482 | pub fn cnt(self) -> Reg<regs::Cnt32, RW> { | ||
| 9483 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | ||
| 9484 | } | ||
| 9485 | #[doc = "prescaler"] | ||
| 9486 | pub fn psc(self) -> Reg<regs::Psc, RW> { | ||
| 9487 | unsafe { Reg::from_ptr(self.0.add(40usize)) } | ||
| 9488 | } | ||
| 9489 | #[doc = "auto-reload register"] | ||
| 9490 | pub fn arr(self) -> Reg<regs::Arr32, RW> { | ||
| 9491 | unsafe { Reg::from_ptr(self.0.add(44usize)) } | ||
| 9492 | } | ||
| 9493 | #[doc = "capture/compare register"] | ||
| 9494 | pub fn ccr(self, n: usize) -> Reg<regs::Ccr32, RW> { | ||
| 9495 | assert!(n < 4usize); | ||
| 9496 | unsafe { Reg::from_ptr(self.0.add(52usize + n * 4usize)) } | ||
| 9497 | } | ||
| 9498 | #[doc = "DMA control register"] | ||
| 9499 | pub fn dcr(self) -> Reg<regs::Dcr, RW> { | ||
| 9500 | unsafe { Reg::from_ptr(self.0.add(72usize)) } | ||
| 9501 | } | ||
| 9502 | #[doc = "DMA address for full transfer"] | ||
| 9503 | pub fn dmar(self) -> Reg<regs::Dmar, RW> { | ||
| 9504 | unsafe { Reg::from_ptr(self.0.add(76usize)) } | ||
| 9505 | } | ||
| 9780 | } | 9506 | } |
| 9781 | #[doc = "DMA controller"] | 9507 | #[doc = "Advanced-timers"] |
| 9782 | #[derive(Copy, Clone)] | 9508 | #[derive(Copy, Clone)] |
| 9783 | pub struct Dma(pub *mut u8); | 9509 | pub struct TimAdv(pub *mut u8); |
| 9784 | unsafe impl Send for Dma {} | 9510 | unsafe impl Send for TimAdv {} |
| 9785 | unsafe impl Sync for Dma {} | 9511 | unsafe impl Sync for TimAdv {} |
| 9786 | impl Dma { | 9512 | impl TimAdv { |
| 9787 | #[doc = "low interrupt status register"] | 9513 | #[doc = "control register 1"] |
| 9788 | pub fn isr(self, n: usize) -> Reg<regs::Ixr, R> { | 9514 | pub fn cr1(self) -> Reg<regs::Cr1Gp, RW> { |
| 9515 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 9516 | } | ||
| 9517 | #[doc = "control register 2"] | ||
| 9518 | pub fn cr2(self) -> Reg<regs::Cr2Adv, RW> { | ||
| 9519 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 9520 | } | ||
| 9521 | #[doc = "slave mode control register"] | ||
| 9522 | pub fn smcr(self) -> Reg<regs::Smcr, RW> { | ||
| 9523 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 9524 | } | ||
| 9525 | #[doc = "DMA/Interrupt enable register"] | ||
| 9526 | pub fn dier(self) -> Reg<regs::DierAdv, RW> { | ||
| 9527 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 9528 | } | ||
| 9529 | #[doc = "status register"] | ||
| 9530 | pub fn sr(self) -> Reg<regs::SrAdv, RW> { | ||
| 9531 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 9532 | } | ||
| 9533 | #[doc = "event generation register"] | ||
| 9534 | pub fn egr(self) -> Reg<regs::EgrAdv, W> { | ||
| 9535 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 9536 | } | ||
| 9537 | #[doc = "capture/compare mode register 1 (input mode)"] | ||
| 9538 | pub fn ccmr_input(self, n: usize) -> Reg<regs::CcmrInput, RW> { | ||
| 9789 | assert!(n < 2usize); | 9539 | assert!(n < 2usize); |
| 9790 | unsafe { Reg::from_ptr(self.0.add(0usize + n * 4usize)) } | 9540 | unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) } |
| 9791 | } | 9541 | } |
| 9792 | #[doc = "low interrupt flag clear register"] | 9542 | #[doc = "capture/compare mode register 1 (output mode)"] |
| 9793 | pub fn ifcr(self, n: usize) -> Reg<regs::Ixr, W> { | 9543 | pub fn ccmr_output(self, n: usize) -> Reg<regs::CcmrOutput, RW> { |
| 9794 | assert!(n < 2usize); | 9544 | assert!(n < 2usize); |
| 9795 | unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) } | 9545 | unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) } |
| 9796 | } | 9546 | } |
| 9797 | #[doc = "Stream cluster: S?CR, S?NDTR, S?M0AR, S?M1AR and S?FCR registers"] | 9547 | #[doc = "capture/compare enable register"] |
| 9798 | pub fn st(self, n: usize) -> St { | 9548 | pub fn ccer(self) -> Reg<regs::CcerAdv, RW> { |
| 9799 | assert!(n < 8usize); | 9549 | unsafe { Reg::from_ptr(self.0.add(32usize)) } |
| 9800 | unsafe { St(self.0.add(16usize + n * 24usize)) } | 9550 | } |
| 9551 | #[doc = "counter"] | ||
| 9552 | pub fn cnt(self) -> Reg<regs::Cnt16, RW> { | ||
| 9553 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | ||
| 9554 | } | ||
| 9555 | #[doc = "prescaler"] | ||
| 9556 | pub fn psc(self) -> Reg<regs::Psc, RW> { | ||
| 9557 | unsafe { Reg::from_ptr(self.0.add(40usize)) } | ||
| 9558 | } | ||
| 9559 | #[doc = "auto-reload register"] | ||
| 9560 | pub fn arr(self) -> Reg<regs::Arr16, RW> { | ||
| 9561 | unsafe { Reg::from_ptr(self.0.add(44usize)) } | ||
| 9562 | } | ||
| 9563 | #[doc = "repetition counter register"] | ||
| 9564 | pub fn rcr(self) -> Reg<regs::Rcr, RW> { | ||
| 9565 | unsafe { Reg::from_ptr(self.0.add(48usize)) } | ||
| 9566 | } | ||
| 9567 | #[doc = "capture/compare register"] | ||
| 9568 | pub fn ccr(self, n: usize) -> Reg<regs::Ccr16, RW> { | ||
| 9569 | assert!(n < 4usize); | ||
| 9570 | unsafe { Reg::from_ptr(self.0.add(52usize + n * 4usize)) } | ||
| 9571 | } | ||
| 9572 | #[doc = "break and dead-time register"] | ||
| 9573 | pub fn bdtr(self) -> Reg<regs::Bdtr, RW> { | ||
| 9574 | unsafe { Reg::from_ptr(self.0.add(68usize)) } | ||
| 9575 | } | ||
| 9576 | #[doc = "DMA control register"] | ||
| 9577 | pub fn dcr(self) -> Reg<regs::Dcr, RW> { | ||
| 9578 | unsafe { Reg::from_ptr(self.0.add(72usize)) } | ||
| 9579 | } | ||
| 9580 | #[doc = "DMA address for full transfer"] | ||
| 9581 | pub fn dmar(self) -> Reg<regs::Dmar, RW> { | ||
| 9582 | unsafe { Reg::from_ptr(self.0.add(76usize)) } | ||
| 9583 | } | ||
| 9584 | } | ||
| 9585 | #[doc = "Basic timer"] | ||
| 9586 | #[derive(Copy, Clone)] | ||
| 9587 | pub struct TimBasic(pub *mut u8); | ||
| 9588 | unsafe impl Send for TimBasic {} | ||
| 9589 | unsafe impl Sync for TimBasic {} | ||
| 9590 | impl TimBasic { | ||
| 9591 | #[doc = "control register 1"] | ||
| 9592 | pub fn cr1(self) -> Reg<regs::Cr1Basic, RW> { | ||
| 9593 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 9594 | } | ||
| 9595 | #[doc = "control register 2"] | ||
| 9596 | pub fn cr2(self) -> Reg<regs::Cr2Basic, RW> { | ||
| 9597 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 9598 | } | ||
| 9599 | #[doc = "DMA/Interrupt enable register"] | ||
| 9600 | pub fn dier(self) -> Reg<regs::DierBasic, RW> { | ||
| 9601 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 9602 | } | ||
| 9603 | #[doc = "status register"] | ||
| 9604 | pub fn sr(self) -> Reg<regs::SrBasic, RW> { | ||
| 9605 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 9606 | } | ||
| 9607 | #[doc = "event generation register"] | ||
| 9608 | pub fn egr(self) -> Reg<regs::EgrBasic, W> { | ||
| 9609 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 9610 | } | ||
| 9611 | #[doc = "counter"] | ||
| 9612 | pub fn cnt(self) -> Reg<regs::Cnt16, RW> { | ||
| 9613 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | ||
| 9614 | } | ||
| 9615 | #[doc = "prescaler"] | ||
| 9616 | pub fn psc(self) -> Reg<regs::Psc, RW> { | ||
| 9617 | unsafe { Reg::from_ptr(self.0.add(40usize)) } | ||
| 9618 | } | ||
| 9619 | #[doc = "auto-reload register"] | ||
| 9620 | pub fn arr(self) -> Reg<regs::Arr16, RW> { | ||
| 9621 | unsafe { Reg::from_ptr(self.0.add(44usize)) } | ||
| 9622 | } | ||
| 9623 | } | ||
| 9624 | #[doc = "General purpose 16-bit timer"] | ||
| 9625 | #[derive(Copy, Clone)] | ||
| 9626 | pub struct TimGp16(pub *mut u8); | ||
| 9627 | unsafe impl Send for TimGp16 {} | ||
| 9628 | unsafe impl Sync for TimGp16 {} | ||
| 9629 | impl TimGp16 { | ||
| 9630 | #[doc = "control register 1"] | ||
| 9631 | pub fn cr1(self) -> Reg<regs::Cr1Gp, RW> { | ||
| 9632 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 9633 | } | ||
| 9634 | #[doc = "control register 2"] | ||
| 9635 | pub fn cr2(self) -> Reg<regs::Cr2Gp, RW> { | ||
| 9636 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 9637 | } | ||
| 9638 | #[doc = "slave mode control register"] | ||
| 9639 | pub fn smcr(self) -> Reg<regs::Smcr, RW> { | ||
| 9640 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 9641 | } | ||
| 9642 | #[doc = "DMA/Interrupt enable register"] | ||
| 9643 | pub fn dier(self) -> Reg<regs::DierGp, RW> { | ||
| 9644 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 9645 | } | ||
| 9646 | #[doc = "status register"] | ||
| 9647 | pub fn sr(self) -> Reg<regs::SrGp, RW> { | ||
| 9648 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 9649 | } | ||
| 9650 | #[doc = "event generation register"] | ||
| 9651 | pub fn egr(self) -> Reg<regs::EgrGp, W> { | ||
| 9652 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 9653 | } | ||
| 9654 | #[doc = "capture/compare mode register 1 (input mode)"] | ||
| 9655 | pub fn ccmr_input(self, n: usize) -> Reg<regs::CcmrInput, RW> { | ||
| 9656 | assert!(n < 2usize); | ||
| 9657 | unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) } | ||
| 9658 | } | ||
| 9659 | #[doc = "capture/compare mode register 1 (output mode)"] | ||
| 9660 | pub fn ccmr_output(self, n: usize) -> Reg<regs::CcmrOutput, RW> { | ||
| 9661 | assert!(n < 2usize); | ||
| 9662 | unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) } | ||
| 9663 | } | ||
| 9664 | #[doc = "capture/compare enable register"] | ||
| 9665 | pub fn ccer(self) -> Reg<regs::CcerGp, RW> { | ||
| 9666 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | ||
| 9667 | } | ||
| 9668 | #[doc = "counter"] | ||
| 9669 | pub fn cnt(self) -> Reg<regs::Cnt16, RW> { | ||
| 9670 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | ||
| 9671 | } | ||
| 9672 | #[doc = "prescaler"] | ||
| 9673 | pub fn psc(self) -> Reg<regs::Psc, RW> { | ||
| 9674 | unsafe { Reg::from_ptr(self.0.add(40usize)) } | ||
| 9675 | } | ||
| 9676 | #[doc = "auto-reload register"] | ||
| 9677 | pub fn arr(self) -> Reg<regs::Arr16, RW> { | ||
| 9678 | unsafe { Reg::from_ptr(self.0.add(44usize)) } | ||
| 9679 | } | ||
| 9680 | #[doc = "capture/compare register"] | ||
| 9681 | pub fn ccr(self, n: usize) -> Reg<regs::Ccr16, RW> { | ||
| 9682 | assert!(n < 4usize); | ||
| 9683 | unsafe { Reg::from_ptr(self.0.add(52usize + n * 4usize)) } | ||
| 9684 | } | ||
| 9685 | #[doc = "DMA control register"] | ||
| 9686 | pub fn dcr(self) -> Reg<regs::Dcr, RW> { | ||
| 9687 | unsafe { Reg::from_ptr(self.0.add(72usize)) } | ||
| 9688 | } | ||
| 9689 | #[doc = "DMA address for full transfer"] | ||
| 9690 | pub fn dmar(self) -> Reg<regs::Dmar, RW> { | ||
| 9691 | unsafe { Reg::from_ptr(self.0.add(76usize)) } | ||
| 9801 | } | 9692 | } |
| 9802 | } | 9693 | } |
| 9803 | pub mod vals { | 9694 | pub mod vals { |
| 9804 | use crate::generic::*; | 9695 | use crate::generic::*; |
| 9805 | #[repr(transparent)] | 9696 | #[repr(transparent)] |
| 9806 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 9697 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 9807 | pub struct Fs(pub u8); | 9698 | pub struct Ckd(pub u8); |
| 9808 | impl Fs { | 9699 | impl Ckd { |
| 9809 | #[doc = "0 < fifo_level < 1/4"] | 9700 | #[doc = "t_DTS = t_CK_INT"] |
| 9810 | pub const QUARTER1: Self = Self(0); | 9701 | pub const DIV1: Self = Self(0); |
| 9811 | #[doc = "1/4 <= fifo_level < 1/2"] | 9702 | #[doc = "t_DTS = 2 × t_CK_INT"] |
| 9812 | pub const QUARTER2: Self = Self(0x01); | 9703 | pub const DIV2: Self = Self(0x01); |
| 9813 | #[doc = "1/2 <= fifo_level < 3/4"] | 9704 | #[doc = "t_DTS = 4 × t_CK_INT"] |
| 9814 | pub const QUARTER3: Self = Self(0x02); | 9705 | pub const DIV4: Self = Self(0x02); |
| 9815 | #[doc = "3/4 <= fifo_level < full"] | ||
| 9816 | pub const QUARTER4: Self = Self(0x03); | ||
| 9817 | #[doc = "FIFO is empty"] | ||
| 9818 | pub const EMPTY: Self = Self(0x04); | ||
| 9819 | #[doc = "FIFO is full"] | ||
| 9820 | pub const FULL: Self = Self(0x05); | ||
| 9821 | } | 9706 | } |
| 9822 | #[repr(transparent)] | 9707 | #[repr(transparent)] |
| 9823 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 9708 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 9824 | pub struct Pfctrl(pub u8); | 9709 | pub struct Ts(pub u8); |
| 9825 | impl Pfctrl { | 9710 | impl Ts { |
| 9826 | #[doc = "The DMA is the flow controller"] | 9711 | #[doc = "Internal Trigger 0 (ITR0)"] |
| 9827 | pub const DMA: Self = Self(0); | 9712 | pub const ITR0: Self = Self(0); |
| 9828 | #[doc = "The peripheral is the flow controller"] | 9713 | #[doc = "Internal Trigger 1 (ITR1)"] |
| 9829 | pub const PERIPHERAL: Self = Self(0x01); | 9714 | pub const ITR1: Self = Self(0x01); |
| 9715 | #[doc = "Internal Trigger 2 (ITR2)"] | ||
| 9716 | pub const ITR2: Self = Self(0x02); | ||
| 9717 | #[doc = "TI1 Edge Detector (TI1F_ED)"] | ||
| 9718 | pub const TI1F_ED: Self = Self(0x04); | ||
| 9719 | #[doc = "Filtered Timer Input 1 (TI1FP1)"] | ||
| 9720 | pub const TI1FP1: Self = Self(0x05); | ||
| 9721 | #[doc = "Filtered Timer Input 2 (TI2FP2)"] | ||
| 9722 | pub const TI2FP2: Self = Self(0x06); | ||
| 9723 | #[doc = "External Trigger input (ETRF)"] | ||
| 9724 | pub const ETRF: Self = Self(0x07); | ||
| 9830 | } | 9725 | } |
| 9831 | #[repr(transparent)] | 9726 | #[repr(transparent)] |
| 9832 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 9727 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 9833 | pub struct Pl(pub u8); | 9728 | pub struct Tis(pub u8); |
| 9834 | impl Pl { | 9729 | impl Tis { |
| 9835 | #[doc = "Low"] | 9730 | #[doc = "The TIMx_CH1 pin is connected to TI1 input"] |
| 9836 | pub const LOW: Self = Self(0); | 9731 | pub const NORMAL: Self = Self(0); |
| 9837 | #[doc = "Medium"] | 9732 | #[doc = "The TIMx_CH1, CH2, CH3 pins are connected to TI1 input"] |
| 9838 | pub const MEDIUM: Self = Self(0x01); | 9733 | pub const XOR: Self = Self(0x01); |
| 9839 | #[doc = "High"] | ||
| 9840 | pub const HIGH: Self = Self(0x02); | ||
| 9841 | #[doc = "Very high"] | ||
| 9842 | pub const VERYHIGH: Self = Self(0x03); | ||
| 9843 | } | 9734 | } |
| 9844 | #[repr(transparent)] | 9735 | #[repr(transparent)] |
| 9845 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 9736 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 9846 | pub struct Size(pub u8); | 9737 | pub struct Etf(pub u8); |
| 9847 | impl Size { | 9738 | impl Etf { |
| 9848 | #[doc = "Byte (8-bit)"] | 9739 | #[doc = "No filter, sampling is done at fDTS"] |
| 9849 | pub const BITS8: Self = Self(0); | 9740 | pub const NOFILTER: Self = Self(0); |
| 9850 | #[doc = "Half-word (16-bit)"] | 9741 | #[doc = "fSAMPLING=fCK_INT, N=2"] |
| 9851 | pub const BITS16: Self = Self(0x01); | 9742 | pub const FCK_INT_N2: Self = Self(0x01); |
| 9852 | #[doc = "Word (32-bit)"] | 9743 | #[doc = "fSAMPLING=fCK_INT, N=4"] |
| 9853 | pub const BITS32: Self = Self(0x02); | 9744 | pub const FCK_INT_N4: Self = Self(0x02); |
| 9745 | #[doc = "fSAMPLING=fCK_INT, N=8"] | ||
| 9746 | pub const FCK_INT_N8: Self = Self(0x03); | ||
| 9747 | #[doc = "fSAMPLING=fDTS/2, N=6"] | ||
| 9748 | pub const FDTS_DIV2_N6: Self = Self(0x04); | ||
| 9749 | #[doc = "fSAMPLING=fDTS/2, N=8"] | ||
| 9750 | pub const FDTS_DIV2_N8: Self = Self(0x05); | ||
| 9751 | #[doc = "fSAMPLING=fDTS/4, N=6"] | ||
| 9752 | pub const FDTS_DIV4_N6: Self = Self(0x06); | ||
| 9753 | #[doc = "fSAMPLING=fDTS/4, N=8"] | ||
| 9754 | pub const FDTS_DIV4_N8: Self = Self(0x07); | ||
| 9755 | #[doc = "fSAMPLING=fDTS/8, N=6"] | ||
| 9756 | pub const FDTS_DIV8_N6: Self = Self(0x08); | ||
| 9757 | #[doc = "fSAMPLING=fDTS/8, N=8"] | ||
| 9758 | pub const FDTS_DIV8_N8: Self = Self(0x09); | ||
| 9759 | #[doc = "fSAMPLING=fDTS/16, N=5"] | ||
| 9760 | pub const FDTS_DIV16_N5: Self = Self(0x0a); | ||
| 9761 | #[doc = "fSAMPLING=fDTS/16, N=6"] | ||
| 9762 | pub const FDTS_DIV16_N6: Self = Self(0x0b); | ||
| 9763 | #[doc = "fSAMPLING=fDTS/16, N=8"] | ||
| 9764 | pub const FDTS_DIV16_N8: Self = Self(0x0c); | ||
| 9765 | #[doc = "fSAMPLING=fDTS/32, N=5"] | ||
| 9766 | pub const FDTS_DIV32_N5: Self = Self(0x0d); | ||
| 9767 | #[doc = "fSAMPLING=fDTS/32, N=6"] | ||
| 9768 | pub const FDTS_DIV32_N6: Self = Self(0x0e); | ||
| 9769 | #[doc = "fSAMPLING=fDTS/32, N=8"] | ||
| 9770 | pub const FDTS_DIV32_N8: Self = Self(0x0f); | ||
| 9854 | } | 9771 | } |
| 9855 | #[repr(transparent)] | 9772 | #[repr(transparent)] |
| 9856 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 9773 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 9857 | pub struct Circ(pub u8); | 9774 | pub struct Ocpe(pub u8); |
| 9858 | impl Circ { | 9775 | impl Ocpe { |
| 9859 | #[doc = "Circular mode disabled"] | 9776 | #[doc = "Preload register on CCR2 disabled. New values written to CCR2 are taken into account immediately"] |
| 9860 | pub const DISABLED: Self = Self(0); | 9777 | pub const DISABLED: Self = Self(0); |
| 9861 | #[doc = "Circular mode enabled"] | 9778 | #[doc = "Preload register on CCR2 enabled. Preload value is loaded into active register on each update event"] |
| 9862 | pub const ENABLED: Self = Self(0x01); | 9779 | pub const ENABLED: Self = Self(0x01); |
| 9863 | } | 9780 | } |
| 9864 | #[repr(transparent)] | 9781 | #[repr(transparent)] |
| 9865 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 9782 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 9866 | pub struct Dmdis(pub u8); | 9783 | pub struct Ocm(pub u8); |
| 9867 | impl Dmdis { | 9784 | impl Ocm { |
| 9868 | #[doc = "Direct mode is enabled"] | 9785 | #[doc = "The comparison between the output compare register TIMx_CCRy and the counter TIMx_CNT has no effect on the outputs"] |
| 9869 | pub const ENABLED: Self = Self(0); | 9786 | pub const FROZEN: Self = Self(0); |
| 9870 | #[doc = "Direct mode is disabled"] | 9787 | #[doc = "Set channel to active level on match. OCyREF signal is forced high when the counter matches the capture/compare register"] |
| 9871 | pub const DISABLED: Self = Self(0x01); | 9788 | pub const ACTIVEONMATCH: Self = Self(0x01); |
| 9789 | #[doc = "Set channel to inactive level on match. OCyREF signal is forced low when the counter matches the capture/compare register"] | ||
| 9790 | pub const INACTIVEONMATCH: Self = Self(0x02); | ||
| 9791 | #[doc = "OCyREF toggles when TIMx_CNT=TIMx_CCRy"] | ||
| 9792 | pub const TOGGLE: Self = Self(0x03); | ||
| 9793 | #[doc = "OCyREF is forced low"] | ||
| 9794 | pub const FORCEINACTIVE: Self = Self(0x04); | ||
| 9795 | #[doc = "OCyREF is forced high"] | ||
| 9796 | pub const FORCEACTIVE: Self = Self(0x05); | ||
| 9797 | #[doc = "In upcounting, channel is active as long as TIMx_CNT<TIMx_CCRy else inactive. In downcounting, channel is inactive as long as TIMx_CNT>TIMx_CCRy else active"] | ||
| 9798 | pub const PWMMODE1: Self = Self(0x06); | ||
| 9799 | #[doc = "Inversely to PwmMode1"] | ||
| 9800 | pub const PWMMODE2: Self = Self(0x07); | ||
| 9801 | } | ||
| 9802 | #[repr(transparent)] | ||
| 9803 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9804 | pub struct Mms(pub u8); | ||
| 9805 | impl Mms { | ||
| 9806 | #[doc = "The UG bit from the TIMx_EGR register is used as trigger output"] | ||
| 9807 | pub const RESET: Self = Self(0); | ||
| 9808 | #[doc = "The counter enable signal, CNT_EN, is used as trigger output"] | ||
| 9809 | pub const ENABLE: Self = Self(0x01); | ||
| 9810 | #[doc = "The update event is selected as trigger output"] | ||
| 9811 | pub const UPDATE: Self = Self(0x02); | ||
| 9812 | #[doc = "The trigger output send a positive pulse when the CC1IF flag it to be set, as soon as a capture or a compare match occurred"] | ||
| 9813 | pub const COMPAREPULSE: Self = Self(0x03); | ||
| 9814 | #[doc = "OC1REF signal is used as trigger output"] | ||
| 9815 | pub const COMPAREOC1: Self = Self(0x04); | ||
| 9816 | #[doc = "OC2REF signal is used as trigger output"] | ||
| 9817 | pub const COMPAREOC2: Self = Self(0x05); | ||
| 9818 | #[doc = "OC3REF signal is used as trigger output"] | ||
| 9819 | pub const COMPAREOC3: Self = Self(0x06); | ||
| 9820 | #[doc = "OC4REF signal is used as trigger output"] | ||
| 9821 | pub const COMPAREOC4: Self = Self(0x07); | ||
| 9822 | } | ||
| 9823 | #[repr(transparent)] | ||
| 9824 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9825 | pub struct CcmrOutputCcs(pub u8); | ||
| 9826 | impl CcmrOutputCcs { | ||
| 9827 | #[doc = "CCx channel is configured as output"] | ||
| 9828 | pub const OUTPUT: Self = Self(0); | ||
| 9829 | } | ||
| 9830 | #[repr(transparent)] | ||
| 9831 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9832 | pub struct Arpe(pub u8); | ||
| 9833 | impl Arpe { | ||
| 9834 | #[doc = "TIMx_APRR register is not buffered"] | ||
| 9835 | pub const DISABLED: Self = Self(0); | ||
| 9836 | #[doc = "TIMx_APRR register is buffered"] | ||
| 9837 | pub const ENABLED: Self = Self(0x01); | ||
| 9838 | } | ||
| 9839 | #[repr(transparent)] | ||
| 9840 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9841 | pub struct Etps(pub u8); | ||
| 9842 | impl Etps { | ||
| 9843 | #[doc = "Prescaler OFF"] | ||
| 9844 | pub const DIV1: Self = Self(0); | ||
| 9845 | #[doc = "ETRP frequency divided by 2"] | ||
| 9846 | pub const DIV2: Self = Self(0x01); | ||
| 9847 | #[doc = "ETRP frequency divided by 4"] | ||
| 9848 | pub const DIV4: Self = Self(0x02); | ||
| 9849 | #[doc = "ETRP frequency divided by 8"] | ||
| 9850 | pub const DIV8: Self = Self(0x03); | ||
| 9872 | } | 9851 | } |
| 9873 | #[repr(transparent)] | 9852 | #[repr(transparent)] |
| 9874 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 9853 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 9875 | pub struct Dir(pub u8); | 9854 | pub struct Dir(pub u8); |
| 9876 | impl Dir { | 9855 | impl Dir { |
| 9877 | #[doc = "Peripheral-to-memory"] | 9856 | #[doc = "Counter used as upcounter"] |
| 9878 | pub const PERIPHERALTOMEMORY: Self = Self(0); | 9857 | pub const UP: Self = Self(0); |
| 9879 | #[doc = "Memory-to-peripheral"] | 9858 | #[doc = "Counter used as downcounter"] |
| 9880 | pub const MEMORYTOPERIPHERAL: Self = Self(0x01); | 9859 | pub const DOWN: Self = Self(0x01); |
| 9881 | #[doc = "Memory-to-memory"] | ||
| 9882 | pub const MEMORYTOMEMORY: Self = Self(0x02); | ||
| 9883 | } | 9860 | } |
| 9884 | #[repr(transparent)] | 9861 | #[repr(transparent)] |
| 9885 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 9862 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 9886 | pub struct Fth(pub u8); | 9863 | pub struct Sms(pub u8); |
| 9887 | impl Fth { | 9864 | impl Sms { |
| 9888 | #[doc = "1/4 full FIFO"] | 9865 | #[doc = "Slave mode disabled - if CEN = ‘1 then the prescaler is clocked directly by the internal clock."] |
| 9889 | pub const QUARTER: Self = Self(0); | 9866 | pub const DISABLED: Self = Self(0); |
| 9890 | #[doc = "1/2 full FIFO"] | 9867 | #[doc = "Encoder mode 1 - Counter counts up/down on TI2FP1 edge depending on TI1FP2 level."] |
| 9891 | pub const HALF: Self = Self(0x01); | 9868 | pub const ENCODER_MODE_1: Self = Self(0x01); |
| 9892 | #[doc = "3/4 full FIFO"] | 9869 | #[doc = "Encoder mode 2 - Counter counts up/down on TI1FP2 edge depending on TI2FP1 level."] |
| 9893 | pub const THREEQUARTERS: Self = Self(0x02); | 9870 | pub const ENCODER_MODE_2: Self = Self(0x02); |
| 9894 | #[doc = "Full FIFO"] | 9871 | #[doc = "Encoder mode 3 - Counter counts up/down on both TI1FP1 and TI2FP2 edges depending on the level of the other input."] |
| 9895 | pub const FULL: Self = Self(0x03); | 9872 | pub const ENCODER_MODE_3: Self = Self(0x03); |
| 9873 | #[doc = "Reset Mode - Rising edge of the selected trigger input (TRGI) reinitializes the counter and generates an update of the registers."] | ||
| 9874 | pub const RESET_MODE: Self = Self(0x04); | ||
| 9875 | #[doc = "Gated Mode - The counter clock is enabled when the trigger input (TRGI) is high. The counter stops (but is not reset) as soon as the trigger becomes low. Both start and stop of the counter are controlled."] | ||
| 9876 | pub const GATED_MODE: Self = Self(0x05); | ||
| 9877 | #[doc = "Trigger Mode - The counter starts at a rising edge of the trigger TRGI (but it is not reset). Only the start of the counter is controlled."] | ||
| 9878 | pub const TRIGGER_MODE: Self = Self(0x06); | ||
| 9879 | #[doc = "External Clock Mode 1 - Rising edges of the selected trigger (TRGI) clock the counter."] | ||
| 9880 | pub const EXT_CLOCK_MODE: Self = Self(0x07); | ||
| 9896 | } | 9881 | } |
| 9897 | #[repr(transparent)] | 9882 | #[repr(transparent)] |
| 9898 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 9883 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 9899 | pub struct Inc(pub u8); | 9884 | pub struct Cms(pub u8); |
| 9900 | impl Inc { | 9885 | impl Cms { |
| 9901 | #[doc = "Address pointer is fixed"] | 9886 | #[doc = "The counter counts up or down depending on the direction bit"] |
| 9902 | pub const FIXED: Self = Self(0); | 9887 | pub const EDGEALIGNED: Self = Self(0); |
| 9903 | #[doc = "Address pointer is incremented after each data transfer"] | 9888 | #[doc = "The counter counts up and down alternatively. Output compare interrupt flags are set only when the counter is counting down."] |
| 9904 | pub const INCREMENTED: Self = Self(0x01); | 9889 | pub const CENTERALIGNED1: Self = Self(0x01); |
| 9890 | #[doc = "The counter counts up and down alternatively. Output compare interrupt flags are set only when the counter is counting up."] | ||
| 9891 | pub const CENTERALIGNED2: Self = Self(0x02); | ||
| 9892 | #[doc = "The counter counts up and down alternatively. Output compare interrupt flags are set both when the counter is counting up or down."] | ||
| 9893 | pub const CENTERALIGNED3: Self = Self(0x03); | ||
| 9905 | } | 9894 | } |
| 9906 | #[repr(transparent)] | 9895 | #[repr(transparent)] |
| 9907 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 9896 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 9908 | pub struct Burst(pub u8); | 9897 | pub struct Ccds(pub u8); |
| 9909 | impl Burst { | 9898 | impl Ccds { |
| 9910 | #[doc = "Single transfer"] | 9899 | #[doc = "CCx DMA request sent when CCx event occurs"] |
| 9911 | pub const SINGLE: Self = Self(0); | 9900 | pub const ONCOMPARE: Self = Self(0); |
| 9912 | #[doc = "Incremental burst of 4 beats"] | 9901 | #[doc = "CCx DMA request sent when update event occurs"] |
| 9913 | pub const INCR4: Self = Self(0x01); | 9902 | pub const ONUPDATE: Self = Self(0x01); |
| 9914 | #[doc = "Incremental burst of 8 beats"] | ||
| 9915 | pub const INCR8: Self = Self(0x02); | ||
| 9916 | #[doc = "Incremental burst of 16 beats"] | ||
| 9917 | pub const INCR16: Self = Self(0x03); | ||
| 9918 | } | 9903 | } |
| 9919 | #[repr(transparent)] | 9904 | #[repr(transparent)] |
| 9920 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 9905 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 9921 | pub struct Pincos(pub u8); | 9906 | pub struct Opm(pub u8); |
| 9922 | impl Pincos { | 9907 | impl Opm { |
| 9923 | #[doc = "The offset size for the peripheral address calculation is linked to the PSIZE"] | 9908 | #[doc = "Counter is not stopped at update event"] |
| 9924 | pub const PSIZE: Self = Self(0); | 9909 | pub const DISABLED: Self = Self(0); |
| 9925 | #[doc = "The offset size for the peripheral address calculation is fixed to 4 (32-bit alignment)"] | 9910 | #[doc = "Counter stops counting at the next update event (clearing the CEN bit)"] |
| 9926 | pub const FIXED4: Self = Self(0x01); | 9911 | pub const ENABLED: Self = Self(0x01); |
| 9927 | } | 9912 | } |
| 9928 | #[repr(transparent)] | 9913 | #[repr(transparent)] |
| 9929 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 9914 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 9930 | pub struct Dbm(pub u8); | 9915 | pub struct Etp(pub u8); |
| 9931 | impl Dbm { | 9916 | impl Etp { |
| 9932 | #[doc = "No buffer switching at the end of transfer"] | 9917 | #[doc = "ETR is noninverted, active at high level or rising edge"] |
| 9918 | pub const NOTINVERTED: Self = Self(0); | ||
| 9919 | #[doc = "ETR is inverted, active at low level or falling edge"] | ||
| 9920 | pub const INVERTED: Self = Self(0x01); | ||
| 9921 | } | ||
| 9922 | #[repr(transparent)] | ||
| 9923 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9924 | pub struct Urs(pub u8); | ||
| 9925 | impl Urs { | ||
| 9926 | #[doc = "Any of counter overflow/underflow, setting UG, or update through slave mode, generates an update interrupt or DMA request"] | ||
| 9927 | pub const ANYEVENT: Self = Self(0); | ||
| 9928 | #[doc = "Only counter overflow/underflow generates an update interrupt or DMA request"] | ||
| 9929 | pub const COUNTERONLY: Self = Self(0x01); | ||
| 9930 | } | ||
| 9931 | #[repr(transparent)] | ||
| 9932 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9933 | pub struct Ossr(pub u8); | ||
| 9934 | impl Ossr { | ||
| 9935 | #[doc = "When inactive, OC/OCN outputs are disabled"] | ||
| 9933 | pub const DISABLED: Self = Self(0); | 9936 | pub const DISABLED: Self = Self(0); |
| 9934 | #[doc = "Memory target switched at the end of the DMA transfer"] | 9937 | #[doc = "When inactive, OC/OCN outputs are enabled with their inactive level"] |
| 9935 | pub const ENABLED: Self = Self(0x01); | 9938 | pub const IDLELEVEL: Self = Self(0x01); |
| 9936 | } | 9939 | } |
| 9937 | #[repr(transparent)] | 9940 | #[repr(transparent)] |
| 9938 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 9941 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 9939 | pub struct Ct(pub u8); | 9942 | pub struct CcmrInputCcs(pub u8); |
| 9940 | impl Ct { | 9943 | impl CcmrInputCcs { |
| 9941 | #[doc = "The current target memory is Memory 0"] | 9944 | #[doc = "CCx channel is configured as input, normal mapping: ICx mapped to TIx"] |
| 9942 | pub const MEMORY0: Self = Self(0); | 9945 | pub const TI4: Self = Self(0x01); |
| 9943 | #[doc = "The current target memory is Memory 1"] | 9946 | #[doc = "CCx channel is configured as input, alternate mapping (switches 1 with 2, 3 with 4)"] |
| 9944 | pub const MEMORY1: Self = Self(0x01); | 9947 | pub const TI3: Self = Self(0x02); |
| 9948 | #[doc = "CCx channel is configured as input, ICx is mapped on TRC"] | ||
| 9949 | pub const TRC: Self = Self(0x03); | ||
| 9950 | } | ||
| 9951 | #[repr(transparent)] | ||
| 9952 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9953 | pub struct Ossi(pub u8); | ||
| 9954 | impl Ossi { | ||
| 9955 | #[doc = "When inactive, OC/OCN outputs are disabled"] | ||
| 9956 | pub const DISABLED: Self = Self(0); | ||
| 9957 | #[doc = "When inactive, OC/OCN outputs are forced to idle level"] | ||
| 9958 | pub const IDLELEVEL: Self = Self(0x01); | ||
| 9959 | } | ||
| 9960 | #[repr(transparent)] | ||
| 9961 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9962 | pub struct Msm(pub u8); | ||
| 9963 | impl Msm { | ||
| 9964 | #[doc = "No action"] | ||
| 9965 | pub const NOSYNC: Self = Self(0); | ||
| 9966 | #[doc = "The effect of an event on the trigger input (TRGI) is delayed to allow a perfect synchronization between the current timer and its slaves (through TRGO). It is useful if we want to synchronize several timers on a single external event."] | ||
| 9967 | pub const SYNC: Self = Self(0x01); | ||
| 9968 | } | ||
| 9969 | #[repr(transparent)] | ||
| 9970 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 9971 | pub struct Icf(pub u8); | ||
| 9972 | impl Icf { | ||
| 9973 | #[doc = "No filter, sampling is done at fDTS"] | ||
| 9974 | pub const NOFILTER: Self = Self(0); | ||
| 9975 | #[doc = "fSAMPLING=fCK_INT, N=2"] | ||
| 9976 | pub const FCK_INT_N2: Self = Self(0x01); | ||
| 9977 | #[doc = "fSAMPLING=fCK_INT, N=4"] | ||
| 9978 | pub const FCK_INT_N4: Self = Self(0x02); | ||
| 9979 | #[doc = "fSAMPLING=fCK_INT, N=8"] | ||
| 9980 | pub const FCK_INT_N8: Self = Self(0x03); | ||
| 9981 | #[doc = "fSAMPLING=fDTS/2, N=6"] | ||
| 9982 | pub const FDTS_DIV2_N6: Self = Self(0x04); | ||
| 9983 | #[doc = "fSAMPLING=fDTS/2, N=8"] | ||
| 9984 | pub const FDTS_DIV2_N8: Self = Self(0x05); | ||
| 9985 | #[doc = "fSAMPLING=fDTS/4, N=6"] | ||
| 9986 | pub const FDTS_DIV4_N6: Self = Self(0x06); | ||
| 9987 | #[doc = "fSAMPLING=fDTS/4, N=8"] | ||
| 9988 | pub const FDTS_DIV4_N8: Self = Self(0x07); | ||
| 9989 | #[doc = "fSAMPLING=fDTS/8, N=6"] | ||
| 9990 | pub const FDTS_DIV8_N6: Self = Self(0x08); | ||
| 9991 | #[doc = "fSAMPLING=fDTS/8, N=8"] | ||
| 9992 | pub const FDTS_DIV8_N8: Self = Self(0x09); | ||
| 9993 | #[doc = "fSAMPLING=fDTS/16, N=5"] | ||
| 9994 | pub const FDTS_DIV16_N5: Self = Self(0x0a); | ||
| 9995 | #[doc = "fSAMPLING=fDTS/16, N=6"] | ||
| 9996 | pub const FDTS_DIV16_N6: Self = Self(0x0b); | ||
| 9997 | #[doc = "fSAMPLING=fDTS/16, N=8"] | ||
| 9998 | pub const FDTS_DIV16_N8: Self = Self(0x0c); | ||
| 9999 | #[doc = "fSAMPLING=fDTS/32, N=5"] | ||
| 10000 | pub const FDTS_DIV32_N5: Self = Self(0x0d); | ||
| 10001 | #[doc = "fSAMPLING=fDTS/32, N=6"] | ||
| 10002 | pub const FDTS_DIV32_N6: Self = Self(0x0e); | ||
| 10003 | #[doc = "fSAMPLING=fDTS/32, N=8"] | ||
| 10004 | pub const FDTS_DIV32_N8: Self = Self(0x0f); | ||
| 10005 | } | ||
| 10006 | #[repr(transparent)] | ||
| 10007 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 10008 | pub struct Ece(pub u8); | ||
| 10009 | impl Ece { | ||
| 10010 | #[doc = "External clock mode 2 disabled"] | ||
| 10011 | pub const DISABLED: Self = Self(0); | ||
| 10012 | #[doc = "External clock mode 2 enabled. The counter is clocked by any active edge on the ETRF signal."] | ||
| 10013 | pub const ENABLED: Self = Self(0x01); | ||
| 9945 | } | 10014 | } |
| 9946 | } | 10015 | } |
| 9947 | pub mod regs { | 10016 | pub mod regs { |
| 9948 | use crate::generic::*; | 10017 | use crate::generic::*; |
| 9949 | #[doc = "stream x FIFO control register"] | 10018 | #[doc = "capture/compare register 1"] |
| 9950 | #[repr(transparent)] | 10019 | #[repr(transparent)] |
| 9951 | #[derive(Copy, Clone, Eq, PartialEq)] | 10020 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9952 | pub struct Fcr(pub u32); | 10021 | pub struct Ccr32(pub u32); |
| 9953 | impl Fcr { | 10022 | impl Ccr32 { |
| 9954 | #[doc = "FIFO threshold selection"] | 10023 | #[doc = "Capture/Compare 1 value"] |
| 9955 | pub const fn fth(&self) -> super::vals::Fth { | 10024 | pub const fn ccr(&self) -> u32 { |
| 9956 | let val = (self.0 >> 0usize) & 0x03; | 10025 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 9957 | super::vals::Fth(val as u8) | 10026 | val as u32 |
| 9958 | } | 10027 | } |
| 9959 | #[doc = "FIFO threshold selection"] | 10028 | #[doc = "Capture/Compare 1 value"] |
| 9960 | pub fn set_fth(&mut self, val: super::vals::Fth) { | 10029 | pub fn set_ccr(&mut self, val: u32) { |
| 9961 | self.0 = (self.0 & !(0x03 << 0usize)) | (((val.0 as u32) & 0x03) << 0usize); | 10030 | self.0 = |
| 10031 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 9962 | } | 10032 | } |
| 9963 | #[doc = "Direct mode disable"] | 10033 | } |
| 9964 | pub const fn dmdis(&self) -> super::vals::Dmdis { | 10034 | impl Default for Ccr32 { |
| 10035 | fn default() -> Ccr32 { | ||
| 10036 | Ccr32(0) | ||
| 10037 | } | ||
| 10038 | } | ||
| 10039 | #[doc = "control register 1"] | ||
| 10040 | #[repr(transparent)] | ||
| 10041 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 10042 | pub struct Cr1Basic(pub u32); | ||
| 10043 | impl Cr1Basic { | ||
| 10044 | #[doc = "Counter enable"] | ||
| 10045 | pub const fn cen(&self) -> bool { | ||
| 10046 | let val = (self.0 >> 0usize) & 0x01; | ||
| 10047 | val != 0 | ||
| 10048 | } | ||
| 10049 | #[doc = "Counter enable"] | ||
| 10050 | pub fn set_cen(&mut self, val: bool) { | ||
| 10051 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 10052 | } | ||
| 10053 | #[doc = "Update disable"] | ||
| 10054 | pub const fn udis(&self) -> bool { | ||
| 10055 | let val = (self.0 >> 1usize) & 0x01; | ||
| 10056 | val != 0 | ||
| 10057 | } | ||
| 10058 | #[doc = "Update disable"] | ||
| 10059 | pub fn set_udis(&mut self, val: bool) { | ||
| 10060 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | ||
| 10061 | } | ||
| 10062 | #[doc = "Update request source"] | ||
| 10063 | pub const fn urs(&self) -> super::vals::Urs { | ||
| 9965 | let val = (self.0 >> 2usize) & 0x01; | 10064 | let val = (self.0 >> 2usize) & 0x01; |
| 9966 | super::vals::Dmdis(val as u8) | 10065 | super::vals::Urs(val as u8) |
| 9967 | } | 10066 | } |
| 9968 | #[doc = "Direct mode disable"] | 10067 | #[doc = "Update request source"] |
| 9969 | pub fn set_dmdis(&mut self, val: super::vals::Dmdis) { | 10068 | pub fn set_urs(&mut self, val: super::vals::Urs) { |
| 9970 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | 10069 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); |
| 9971 | } | 10070 | } |
| 9972 | #[doc = "FIFO status"] | 10071 | #[doc = "One-pulse mode"] |
| 9973 | pub const fn fs(&self) -> super::vals::Fs { | 10072 | pub const fn opm(&self) -> super::vals::Opm { |
| 9974 | let val = (self.0 >> 3usize) & 0x07; | 10073 | let val = (self.0 >> 3usize) & 0x01; |
| 9975 | super::vals::Fs(val as u8) | 10074 | super::vals::Opm(val as u8) |
| 9976 | } | 10075 | } |
| 9977 | #[doc = "FIFO status"] | 10076 | #[doc = "One-pulse mode"] |
| 9978 | pub fn set_fs(&mut self, val: super::vals::Fs) { | 10077 | pub fn set_opm(&mut self, val: super::vals::Opm) { |
| 9979 | self.0 = (self.0 & !(0x07 << 3usize)) | (((val.0 as u32) & 0x07) << 3usize); | 10078 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); |
| 9980 | } | 10079 | } |
| 9981 | #[doc = "FIFO error interrupt enable"] | 10080 | #[doc = "Auto-reload preload enable"] |
| 9982 | pub const fn feie(&self) -> bool { | 10081 | pub const fn arpe(&self) -> super::vals::Arpe { |
| 10082 | let val = (self.0 >> 7usize) & 0x01; | ||
| 10083 | super::vals::Arpe(val as u8) | ||
| 10084 | } | ||
| 10085 | #[doc = "Auto-reload preload enable"] | ||
| 10086 | pub fn set_arpe(&mut self, val: super::vals::Arpe) { | ||
| 10087 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 10088 | } | ||
| 10089 | } | ||
| 10090 | impl Default for Cr1Basic { | ||
| 10091 | fn default() -> Cr1Basic { | ||
| 10092 | Cr1Basic(0) | ||
| 10093 | } | ||
| 10094 | } | ||
| 10095 | #[doc = "capture/compare mode register 1 (input mode)"] | ||
| 10096 | #[repr(transparent)] | ||
| 10097 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 10098 | pub struct CcmrInput(pub u32); | ||
| 10099 | impl CcmrInput { | ||
| 10100 | #[doc = "Capture/Compare 1 selection"] | ||
| 10101 | pub fn ccs(&self, n: usize) -> super::vals::CcmrInputCcs { | ||
| 10102 | assert!(n < 2usize); | ||
| 10103 | let offs = 0usize + n * 8usize; | ||
| 10104 | let val = (self.0 >> offs) & 0x03; | ||
| 10105 | super::vals::CcmrInputCcs(val as u8) | ||
| 10106 | } | ||
| 10107 | #[doc = "Capture/Compare 1 selection"] | ||
| 10108 | pub fn set_ccs(&mut self, n: usize, val: super::vals::CcmrInputCcs) { | ||
| 10109 | assert!(n < 2usize); | ||
| 10110 | let offs = 0usize + n * 8usize; | ||
| 10111 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | ||
| 10112 | } | ||
| 10113 | #[doc = "Input capture 1 prescaler"] | ||
| 10114 | pub fn icpsc(&self, n: usize) -> u8 { | ||
| 10115 | assert!(n < 2usize); | ||
| 10116 | let offs = 2usize + n * 8usize; | ||
| 10117 | let val = (self.0 >> offs) & 0x03; | ||
| 10118 | val as u8 | ||
| 10119 | } | ||
| 10120 | #[doc = "Input capture 1 prescaler"] | ||
| 10121 | pub fn set_icpsc(&mut self, n: usize, val: u8) { | ||
| 10122 | assert!(n < 2usize); | ||
| 10123 | let offs = 2usize + n * 8usize; | ||
| 10124 | self.0 = (self.0 & !(0x03 << offs)) | (((val as u32) & 0x03) << offs); | ||
| 10125 | } | ||
| 10126 | #[doc = "Input capture 1 filter"] | ||
| 10127 | pub fn icf(&self, n: usize) -> super::vals::Icf { | ||
| 10128 | assert!(n < 2usize); | ||
| 10129 | let offs = 4usize + n * 8usize; | ||
| 10130 | let val = (self.0 >> offs) & 0x0f; | ||
| 10131 | super::vals::Icf(val as u8) | ||
| 10132 | } | ||
| 10133 | #[doc = "Input capture 1 filter"] | ||
| 10134 | pub fn set_icf(&mut self, n: usize, val: super::vals::Icf) { | ||
| 10135 | assert!(n < 2usize); | ||
| 10136 | let offs = 4usize + n * 8usize; | ||
| 10137 | self.0 = (self.0 & !(0x0f << offs)) | (((val.0 as u32) & 0x0f) << offs); | ||
| 10138 | } | ||
| 10139 | } | ||
| 10140 | impl Default for CcmrInput { | ||
| 10141 | fn default() -> CcmrInput { | ||
| 10142 | CcmrInput(0) | ||
| 10143 | } | ||
| 10144 | } | ||
| 10145 | #[doc = "slave mode control register"] | ||
| 10146 | #[repr(transparent)] | ||
| 10147 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 10148 | pub struct Smcr(pub u32); | ||
| 10149 | impl Smcr { | ||
| 10150 | #[doc = "Slave mode selection"] | ||
| 10151 | pub const fn sms(&self) -> super::vals::Sms { | ||
| 10152 | let val = (self.0 >> 0usize) & 0x07; | ||
| 10153 | super::vals::Sms(val as u8) | ||
| 10154 | } | ||
| 10155 | #[doc = "Slave mode selection"] | ||
| 10156 | pub fn set_sms(&mut self, val: super::vals::Sms) { | ||
| 10157 | self.0 = (self.0 & !(0x07 << 0usize)) | (((val.0 as u32) & 0x07) << 0usize); | ||
| 10158 | } | ||
| 10159 | #[doc = "Trigger selection"] | ||
| 10160 | pub const fn ts(&self) -> super::vals::Ts { | ||
| 10161 | let val = (self.0 >> 4usize) & 0x07; | ||
| 10162 | super::vals::Ts(val as u8) | ||
| 10163 | } | ||
| 10164 | #[doc = "Trigger selection"] | ||
| 10165 | pub fn set_ts(&mut self, val: super::vals::Ts) { | ||
| 10166 | self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize); | ||
| 10167 | } | ||
| 10168 | #[doc = "Master/Slave mode"] | ||
| 10169 | pub const fn msm(&self) -> super::vals::Msm { | ||
| 10170 | let val = (self.0 >> 7usize) & 0x01; | ||
| 10171 | super::vals::Msm(val as u8) | ||
| 10172 | } | ||
| 10173 | #[doc = "Master/Slave mode"] | ||
| 10174 | pub fn set_msm(&mut self, val: super::vals::Msm) { | ||
| 10175 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 10176 | } | ||
| 10177 | #[doc = "External trigger filter"] | ||
| 10178 | pub const fn etf(&self) -> super::vals::Etf { | ||
| 10179 | let val = (self.0 >> 8usize) & 0x0f; | ||
| 10180 | super::vals::Etf(val as u8) | ||
| 10181 | } | ||
| 10182 | #[doc = "External trigger filter"] | ||
| 10183 | pub fn set_etf(&mut self, val: super::vals::Etf) { | ||
| 10184 | self.0 = (self.0 & !(0x0f << 8usize)) | (((val.0 as u32) & 0x0f) << 8usize); | ||
| 10185 | } | ||
| 10186 | #[doc = "External trigger prescaler"] | ||
| 10187 | pub const fn etps(&self) -> super::vals::Etps { | ||
| 10188 | let val = (self.0 >> 12usize) & 0x03; | ||
| 10189 | super::vals::Etps(val as u8) | ||
| 10190 | } | ||
| 10191 | #[doc = "External trigger prescaler"] | ||
| 10192 | pub fn set_etps(&mut self, val: super::vals::Etps) { | ||
| 10193 | self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize); | ||
| 10194 | } | ||
| 10195 | #[doc = "External clock enable"] | ||
| 10196 | pub const fn ece(&self) -> super::vals::Ece { | ||
| 10197 | let val = (self.0 >> 14usize) & 0x01; | ||
| 10198 | super::vals::Ece(val as u8) | ||
| 10199 | } | ||
| 10200 | #[doc = "External clock enable"] | ||
| 10201 | pub fn set_ece(&mut self, val: super::vals::Ece) { | ||
| 10202 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | ||
| 10203 | } | ||
| 10204 | #[doc = "External trigger polarity"] | ||
| 10205 | pub const fn etp(&self) -> super::vals::Etp { | ||
| 10206 | let val = (self.0 >> 15usize) & 0x01; | ||
| 10207 | super::vals::Etp(val as u8) | ||
| 10208 | } | ||
| 10209 | #[doc = "External trigger polarity"] | ||
| 10210 | pub fn set_etp(&mut self, val: super::vals::Etp) { | ||
| 10211 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 10212 | } | ||
| 10213 | } | ||
| 10214 | impl Default for Smcr { | ||
| 10215 | fn default() -> Smcr { | ||
| 10216 | Smcr(0) | ||
| 10217 | } | ||
| 10218 | } | ||
| 10219 | #[doc = "counter"] | ||
| 10220 | #[repr(transparent)] | ||
| 10221 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 10222 | pub struct Cnt16(pub u32); | ||
| 10223 | impl Cnt16 { | ||
| 10224 | #[doc = "counter value"] | ||
| 10225 | pub const fn cnt(&self) -> u16 { | ||
| 10226 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 10227 | val as u16 | ||
| 10228 | } | ||
| 10229 | #[doc = "counter value"] | ||
| 10230 | pub fn set_cnt(&mut self, val: u16) { | ||
| 10231 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 10232 | } | ||
| 10233 | } | ||
| 10234 | impl Default for Cnt16 { | ||
| 10235 | fn default() -> Cnt16 { | ||
| 10236 | Cnt16(0) | ||
| 10237 | } | ||
| 10238 | } | ||
| 10239 | #[doc = "prescaler"] | ||
| 10240 | #[repr(transparent)] | ||
| 10241 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 10242 | pub struct Psc(pub u32); | ||
| 10243 | impl Psc { | ||
| 10244 | #[doc = "Prescaler value"] | ||
| 10245 | pub const fn psc(&self) -> u16 { | ||
| 10246 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 10247 | val as u16 | ||
| 10248 | } | ||
| 10249 | #[doc = "Prescaler value"] | ||
| 10250 | pub fn set_psc(&mut self, val: u16) { | ||
| 10251 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 10252 | } | ||
| 10253 | } | ||
| 10254 | impl Default for Psc { | ||
| 10255 | fn default() -> Psc { | ||
| 10256 | Psc(0) | ||
| 10257 | } | ||
| 10258 | } | ||
| 10259 | #[doc = "control register 2"] | ||
| 10260 | #[repr(transparent)] | ||
| 10261 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 10262 | pub struct Cr2Gp(pub u32); | ||
| 10263 | impl Cr2Gp { | ||
| 10264 | #[doc = "Capture/compare DMA selection"] | ||
| 10265 | pub const fn ccds(&self) -> super::vals::Ccds { | ||
| 10266 | let val = (self.0 >> 3usize) & 0x01; | ||
| 10267 | super::vals::Ccds(val as u8) | ||
| 10268 | } | ||
| 10269 | #[doc = "Capture/compare DMA selection"] | ||
| 10270 | pub fn set_ccds(&mut self, val: super::vals::Ccds) { | ||
| 10271 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 10272 | } | ||
| 10273 | #[doc = "Master mode selection"] | ||
| 10274 | pub const fn mms(&self) -> super::vals::Mms { | ||
| 10275 | let val = (self.0 >> 4usize) & 0x07; | ||
| 10276 | super::vals::Mms(val as u8) | ||
| 10277 | } | ||
| 10278 | #[doc = "Master mode selection"] | ||
| 10279 | pub fn set_mms(&mut self, val: super::vals::Mms) { | ||
| 10280 | self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize); | ||
| 10281 | } | ||
| 10282 | #[doc = "TI1 selection"] | ||
| 10283 | pub const fn ti1s(&self) -> super::vals::Tis { | ||
| 9983 | let val = (self.0 >> 7usize) & 0x01; | 10284 | let val = (self.0 >> 7usize) & 0x01; |
| 10285 | super::vals::Tis(val as u8) | ||
| 10286 | } | ||
| 10287 | #[doc = "TI1 selection"] | ||
| 10288 | pub fn set_ti1s(&mut self, val: super::vals::Tis) { | ||
| 10289 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 10290 | } | ||
| 10291 | } | ||
| 10292 | impl Default for Cr2Gp { | ||
| 10293 | fn default() -> Cr2Gp { | ||
| 10294 | Cr2Gp(0) | ||
| 10295 | } | ||
| 10296 | } | ||
| 10297 | #[doc = "repetition counter register"] | ||
| 10298 | #[repr(transparent)] | ||
| 10299 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 10300 | pub struct Rcr(pub u32); | ||
| 10301 | impl Rcr { | ||
| 10302 | #[doc = "Repetition counter value"] | ||
| 10303 | pub const fn rep(&self) -> u8 { | ||
| 10304 | let val = (self.0 >> 0usize) & 0xff; | ||
| 10305 | val as u8 | ||
| 10306 | } | ||
| 10307 | #[doc = "Repetition counter value"] | ||
| 10308 | pub fn set_rep(&mut self, val: u8) { | ||
| 10309 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | ||
| 10310 | } | ||
| 10311 | } | ||
| 10312 | impl Default for Rcr { | ||
| 10313 | fn default() -> Rcr { | ||
| 10314 | Rcr(0) | ||
| 10315 | } | ||
| 10316 | } | ||
| 10317 | #[doc = "capture/compare mode register 2 (output mode)"] | ||
| 10318 | #[repr(transparent)] | ||
| 10319 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 10320 | pub struct CcmrOutput(pub u32); | ||
| 10321 | impl CcmrOutput { | ||
| 10322 | #[doc = "Capture/Compare 3 selection"] | ||
| 10323 | pub fn ccs(&self, n: usize) -> super::vals::CcmrOutputCcs { | ||
| 10324 | assert!(n < 2usize); | ||
| 10325 | let offs = 0usize + n * 8usize; | ||
| 10326 | let val = (self.0 >> offs) & 0x03; | ||
| 10327 | super::vals::CcmrOutputCcs(val as u8) | ||
| 10328 | } | ||
| 10329 | #[doc = "Capture/Compare 3 selection"] | ||
| 10330 | pub fn set_ccs(&mut self, n: usize, val: super::vals::CcmrOutputCcs) { | ||
| 10331 | assert!(n < 2usize); | ||
| 10332 | let offs = 0usize + n * 8usize; | ||
| 10333 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | ||
| 10334 | } | ||
| 10335 | #[doc = "Output compare 3 fast enable"] | ||
| 10336 | pub fn ocfe(&self, n: usize) -> bool { | ||
| 10337 | assert!(n < 2usize); | ||
| 10338 | let offs = 2usize + n * 8usize; | ||
| 10339 | let val = (self.0 >> offs) & 0x01; | ||
| 9984 | val != 0 | 10340 | val != 0 |
| 9985 | } | 10341 | } |
| 9986 | #[doc = "FIFO error interrupt enable"] | 10342 | #[doc = "Output compare 3 fast enable"] |
| 9987 | pub fn set_feie(&mut self, val: bool) { | 10343 | pub fn set_ocfe(&mut self, n: usize, val: bool) { |
| 10344 | assert!(n < 2usize); | ||
| 10345 | let offs = 2usize + n * 8usize; | ||
| 10346 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 10347 | } | ||
| 10348 | #[doc = "Output compare 3 preload enable"] | ||
| 10349 | pub fn ocpe(&self, n: usize) -> super::vals::Ocpe { | ||
| 10350 | assert!(n < 2usize); | ||
| 10351 | let offs = 3usize + n * 8usize; | ||
| 10352 | let val = (self.0 >> offs) & 0x01; | ||
| 10353 | super::vals::Ocpe(val as u8) | ||
| 10354 | } | ||
| 10355 | #[doc = "Output compare 3 preload enable"] | ||
| 10356 | pub fn set_ocpe(&mut self, n: usize, val: super::vals::Ocpe) { | ||
| 10357 | assert!(n < 2usize); | ||
| 10358 | let offs = 3usize + n * 8usize; | ||
| 10359 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 10360 | } | ||
| 10361 | #[doc = "Output compare 3 mode"] | ||
| 10362 | pub fn ocm(&self, n: usize) -> super::vals::Ocm { | ||
| 10363 | assert!(n < 2usize); | ||
| 10364 | let offs = 4usize + n * 8usize; | ||
| 10365 | let val = (self.0 >> offs) & 0x07; | ||
| 10366 | super::vals::Ocm(val as u8) | ||
| 10367 | } | ||
| 10368 | #[doc = "Output compare 3 mode"] | ||
| 10369 | pub fn set_ocm(&mut self, n: usize, val: super::vals::Ocm) { | ||
| 10370 | assert!(n < 2usize); | ||
| 10371 | let offs = 4usize + n * 8usize; | ||
| 10372 | self.0 = (self.0 & !(0x07 << offs)) | (((val.0 as u32) & 0x07) << offs); | ||
| 10373 | } | ||
| 10374 | #[doc = "Output compare 3 clear enable"] | ||
| 10375 | pub fn occe(&self, n: usize) -> bool { | ||
| 10376 | assert!(n < 2usize); | ||
| 10377 | let offs = 7usize + n * 8usize; | ||
| 10378 | let val = (self.0 >> offs) & 0x01; | ||
| 10379 | val != 0 | ||
| 10380 | } | ||
| 10381 | #[doc = "Output compare 3 clear enable"] | ||
| 10382 | pub fn set_occe(&mut self, n: usize, val: bool) { | ||
| 10383 | assert!(n < 2usize); | ||
| 10384 | let offs = 7usize + n * 8usize; | ||
| 10385 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 10386 | } | ||
| 10387 | } | ||
| 10388 | impl Default for CcmrOutput { | ||
| 10389 | fn default() -> CcmrOutput { | ||
| 10390 | CcmrOutput(0) | ||
| 10391 | } | ||
| 10392 | } | ||
| 10393 | #[doc = "event generation register"] | ||
| 10394 | #[repr(transparent)] | ||
| 10395 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 10396 | pub struct EgrGp(pub u32); | ||
| 10397 | impl EgrGp { | ||
| 10398 | #[doc = "Update generation"] | ||
| 10399 | pub const fn ug(&self) -> bool { | ||
| 10400 | let val = (self.0 >> 0usize) & 0x01; | ||
| 10401 | val != 0 | ||
| 10402 | } | ||
| 10403 | #[doc = "Update generation"] | ||
| 10404 | pub fn set_ug(&mut self, val: bool) { | ||
| 10405 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 10406 | } | ||
| 10407 | #[doc = "Capture/compare 1 generation"] | ||
| 10408 | pub fn ccg(&self, n: usize) -> bool { | ||
| 10409 | assert!(n < 4usize); | ||
| 10410 | let offs = 1usize + n * 1usize; | ||
| 10411 | let val = (self.0 >> offs) & 0x01; | ||
| 10412 | val != 0 | ||
| 10413 | } | ||
| 10414 | #[doc = "Capture/compare 1 generation"] | ||
| 10415 | pub fn set_ccg(&mut self, n: usize, val: bool) { | ||
| 10416 | assert!(n < 4usize); | ||
| 10417 | let offs = 1usize + n * 1usize; | ||
| 10418 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 10419 | } | ||
| 10420 | #[doc = "Capture/Compare control update generation"] | ||
| 10421 | pub const fn comg(&self) -> bool { | ||
| 10422 | let val = (self.0 >> 5usize) & 0x01; | ||
| 10423 | val != 0 | ||
| 10424 | } | ||
| 10425 | #[doc = "Capture/Compare control update generation"] | ||
| 10426 | pub fn set_comg(&mut self, val: bool) { | ||
| 10427 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 10428 | } | ||
| 10429 | #[doc = "Trigger generation"] | ||
| 10430 | pub const fn tg(&self) -> bool { | ||
| 10431 | let val = (self.0 >> 6usize) & 0x01; | ||
| 10432 | val != 0 | ||
| 10433 | } | ||
| 10434 | #[doc = "Trigger generation"] | ||
| 10435 | pub fn set_tg(&mut self, val: bool) { | ||
| 10436 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 10437 | } | ||
| 10438 | #[doc = "Break generation"] | ||
| 10439 | pub const fn bg(&self) -> bool { | ||
| 10440 | let val = (self.0 >> 7usize) & 0x01; | ||
| 10441 | val != 0 | ||
| 10442 | } | ||
| 10443 | #[doc = "Break generation"] | ||
| 10444 | pub fn set_bg(&mut self, val: bool) { | ||
| 9988 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 10445 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 9989 | } | 10446 | } |
| 9990 | } | 10447 | } |
| 9991 | impl Default for Fcr { | 10448 | impl Default for EgrGp { |
| 9992 | fn default() -> Fcr { | 10449 | fn default() -> EgrGp { |
| 9993 | Fcr(0) | 10450 | EgrGp(0) |
| 9994 | } | 10451 | } |
| 9995 | } | 10452 | } |
| 9996 | #[doc = "stream x number of data register"] | 10453 | #[doc = "capture/compare enable register"] |
| 9997 | #[repr(transparent)] | 10454 | #[repr(transparent)] |
| 9998 | #[derive(Copy, Clone, Eq, PartialEq)] | 10455 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9999 | pub struct Ndtr(pub u32); | 10456 | pub struct CcerAdv(pub u32); |
| 10000 | impl Ndtr { | 10457 | impl CcerAdv { |
| 10001 | #[doc = "Number of data items to transfer"] | 10458 | #[doc = "Capture/Compare 1 output enable"] |
| 10002 | pub const fn ndt(&self) -> u16 { | 10459 | pub fn cce(&self, n: usize) -> bool { |
| 10460 | assert!(n < 4usize); | ||
| 10461 | let offs = 0usize + n * 4usize; | ||
| 10462 | let val = (self.0 >> offs) & 0x01; | ||
| 10463 | val != 0 | ||
| 10464 | } | ||
| 10465 | #[doc = "Capture/Compare 1 output enable"] | ||
| 10466 | pub fn set_cce(&mut self, n: usize, val: bool) { | ||
| 10467 | assert!(n < 4usize); | ||
| 10468 | let offs = 0usize + n * 4usize; | ||
| 10469 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 10470 | } | ||
| 10471 | #[doc = "Capture/Compare 1 output Polarity"] | ||
| 10472 | pub fn ccp(&self, n: usize) -> bool { | ||
| 10473 | assert!(n < 4usize); | ||
| 10474 | let offs = 1usize + n * 4usize; | ||
| 10475 | let val = (self.0 >> offs) & 0x01; | ||
| 10476 | val != 0 | ||
| 10477 | } | ||
| 10478 | #[doc = "Capture/Compare 1 output Polarity"] | ||
| 10479 | pub fn set_ccp(&mut self, n: usize, val: bool) { | ||
| 10480 | assert!(n < 4usize); | ||
| 10481 | let offs = 1usize + n * 4usize; | ||
| 10482 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 10483 | } | ||
| 10484 | #[doc = "Capture/Compare 1 complementary output enable"] | ||
| 10485 | pub fn ccne(&self, n: usize) -> bool { | ||
| 10486 | assert!(n < 4usize); | ||
| 10487 | let offs = 2usize + n * 4usize; | ||
| 10488 | let val = (self.0 >> offs) & 0x01; | ||
| 10489 | val != 0 | ||
| 10490 | } | ||
| 10491 | #[doc = "Capture/Compare 1 complementary output enable"] | ||
| 10492 | pub fn set_ccne(&mut self, n: usize, val: bool) { | ||
| 10493 | assert!(n < 4usize); | ||
| 10494 | let offs = 2usize + n * 4usize; | ||
| 10495 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 10496 | } | ||
| 10497 | #[doc = "Capture/Compare 1 output Polarity"] | ||
| 10498 | pub fn ccnp(&self, n: usize) -> bool { | ||
| 10499 | assert!(n < 4usize); | ||
| 10500 | let offs = 3usize + n * 4usize; | ||
| 10501 | let val = (self.0 >> offs) & 0x01; | ||
| 10502 | val != 0 | ||
| 10503 | } | ||
| 10504 | #[doc = "Capture/Compare 1 output Polarity"] | ||
| 10505 | pub fn set_ccnp(&mut self, n: usize, val: bool) { | ||
| 10506 | assert!(n < 4usize); | ||
| 10507 | let offs = 3usize + n * 4usize; | ||
| 10508 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 10509 | } | ||
| 10510 | } | ||
| 10511 | impl Default for CcerAdv { | ||
| 10512 | fn default() -> CcerAdv { | ||
| 10513 | CcerAdv(0) | ||
| 10514 | } | ||
| 10515 | } | ||
| 10516 | #[doc = "status register"] | ||
| 10517 | #[repr(transparent)] | ||
| 10518 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 10519 | pub struct SrBasic(pub u32); | ||
| 10520 | impl SrBasic { | ||
| 10521 | #[doc = "Update interrupt flag"] | ||
| 10522 | pub const fn uif(&self) -> bool { | ||
| 10523 | let val = (self.0 >> 0usize) & 0x01; | ||
| 10524 | val != 0 | ||
| 10525 | } | ||
| 10526 | #[doc = "Update interrupt flag"] | ||
| 10527 | pub fn set_uif(&mut self, val: bool) { | ||
| 10528 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 10529 | } | ||
| 10530 | } | ||
| 10531 | impl Default for SrBasic { | ||
| 10532 | fn default() -> SrBasic { | ||
| 10533 | SrBasic(0) | ||
| 10534 | } | ||
| 10535 | } | ||
| 10536 | #[doc = "status register"] | ||
| 10537 | #[repr(transparent)] | ||
| 10538 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 10539 | pub struct SrAdv(pub u32); | ||
| 10540 | impl SrAdv { | ||
| 10541 | #[doc = "Update interrupt flag"] | ||
| 10542 | pub const fn uif(&self) -> bool { | ||
| 10543 | let val = (self.0 >> 0usize) & 0x01; | ||
| 10544 | val != 0 | ||
| 10545 | } | ||
| 10546 | #[doc = "Update interrupt flag"] | ||
| 10547 | pub fn set_uif(&mut self, val: bool) { | ||
| 10548 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 10549 | } | ||
| 10550 | #[doc = "Capture/compare 1 interrupt flag"] | ||
| 10551 | pub fn ccif(&self, n: usize) -> bool { | ||
| 10552 | assert!(n < 4usize); | ||
| 10553 | let offs = 1usize + n * 1usize; | ||
| 10554 | let val = (self.0 >> offs) & 0x01; | ||
| 10555 | val != 0 | ||
| 10556 | } | ||
| 10557 | #[doc = "Capture/compare 1 interrupt flag"] | ||
| 10558 | pub fn set_ccif(&mut self, n: usize, val: bool) { | ||
| 10559 | assert!(n < 4usize); | ||
| 10560 | let offs = 1usize + n * 1usize; | ||
| 10561 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 10562 | } | ||
| 10563 | #[doc = "COM interrupt flag"] | ||
| 10564 | pub const fn comif(&self) -> bool { | ||
| 10565 | let val = (self.0 >> 5usize) & 0x01; | ||
| 10566 | val != 0 | ||
| 10567 | } | ||
| 10568 | #[doc = "COM interrupt flag"] | ||
| 10569 | pub fn set_comif(&mut self, val: bool) { | ||
| 10570 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 10571 | } | ||
| 10572 | #[doc = "Trigger interrupt flag"] | ||
| 10573 | pub const fn tif(&self) -> bool { | ||
| 10574 | let val = (self.0 >> 6usize) & 0x01; | ||
| 10575 | val != 0 | ||
| 10576 | } | ||
| 10577 | #[doc = "Trigger interrupt flag"] | ||
| 10578 | pub fn set_tif(&mut self, val: bool) { | ||
| 10579 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 10580 | } | ||
| 10581 | #[doc = "Break interrupt flag"] | ||
| 10582 | pub const fn bif(&self) -> bool { | ||
| 10583 | let val = (self.0 >> 7usize) & 0x01; | ||
| 10584 | val != 0 | ||
| 10585 | } | ||
| 10586 | #[doc = "Break interrupt flag"] | ||
| 10587 | pub fn set_bif(&mut self, val: bool) { | ||
| 10588 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 10589 | } | ||
| 10590 | #[doc = "Capture/Compare 1 overcapture flag"] | ||
| 10591 | pub fn ccof(&self, n: usize) -> bool { | ||
| 10592 | assert!(n < 4usize); | ||
| 10593 | let offs = 9usize + n * 1usize; | ||
| 10594 | let val = (self.0 >> offs) & 0x01; | ||
| 10595 | val != 0 | ||
| 10596 | } | ||
| 10597 | #[doc = "Capture/Compare 1 overcapture flag"] | ||
| 10598 | pub fn set_ccof(&mut self, n: usize, val: bool) { | ||
| 10599 | assert!(n < 4usize); | ||
| 10600 | let offs = 9usize + n * 1usize; | ||
| 10601 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 10602 | } | ||
| 10603 | } | ||
| 10604 | impl Default for SrAdv { | ||
| 10605 | fn default() -> SrAdv { | ||
| 10606 | SrAdv(0) | ||
| 10607 | } | ||
| 10608 | } | ||
| 10609 | #[doc = "auto-reload register"] | ||
| 10610 | #[repr(transparent)] | ||
| 10611 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 10612 | pub struct Arr16(pub u32); | ||
| 10613 | impl Arr16 { | ||
| 10614 | #[doc = "Auto-reload value"] | ||
| 10615 | pub const fn arr(&self) -> u16 { | ||
| 10003 | let val = (self.0 >> 0usize) & 0xffff; | 10616 | let val = (self.0 >> 0usize) & 0xffff; |
| 10004 | val as u16 | 10617 | val as u16 |
| 10005 | } | 10618 | } |
| 10006 | #[doc = "Number of data items to transfer"] | 10619 | #[doc = "Auto-reload value"] |
| 10007 | pub fn set_ndt(&mut self, val: u16) { | 10620 | pub fn set_arr(&mut self, val: u16) { |
| 10008 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | 10621 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); |
| 10009 | } | 10622 | } |
| 10010 | } | 10623 | } |
| 10011 | impl Default for Ndtr { | 10624 | impl Default for Arr16 { |
| 10012 | fn default() -> Ndtr { | 10625 | fn default() -> Arr16 { |
| 10013 | Ndtr(0) | 10626 | Arr16(0) |
| 10014 | } | 10627 | } |
| 10015 | } | 10628 | } |
| 10016 | #[doc = "stream x configuration register"] | 10629 | #[doc = "status register"] |
| 10017 | #[repr(transparent)] | 10630 | #[repr(transparent)] |
| 10018 | #[derive(Copy, Clone, Eq, PartialEq)] | 10631 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 10019 | pub struct Cr(pub u32); | 10632 | pub struct SrGp(pub u32); |
| 10020 | impl Cr { | 10633 | impl SrGp { |
| 10021 | #[doc = "Stream enable / flag stream ready when read low"] | 10634 | #[doc = "Update interrupt flag"] |
| 10022 | pub const fn en(&self) -> bool { | 10635 | pub const fn uif(&self) -> bool { |
| 10023 | let val = (self.0 >> 0usize) & 0x01; | 10636 | let val = (self.0 >> 0usize) & 0x01; |
| 10024 | val != 0 | 10637 | val != 0 |
| 10025 | } | 10638 | } |
| 10026 | #[doc = "Stream enable / flag stream ready when read low"] | 10639 | #[doc = "Update interrupt flag"] |
| 10027 | pub fn set_en(&mut self, val: bool) { | 10640 | pub fn set_uif(&mut self, val: bool) { |
| 10028 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 10641 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 10029 | } | 10642 | } |
| 10030 | #[doc = "Direct mode error interrupt enable"] | 10643 | #[doc = "Capture/compare 1 interrupt flag"] |
| 10031 | pub const fn dmeie(&self) -> bool { | 10644 | pub fn ccif(&self, n: usize) -> bool { |
| 10032 | let val = (self.0 >> 1usize) & 0x01; | 10645 | assert!(n < 4usize); |
| 10646 | let offs = 1usize + n * 1usize; | ||
| 10647 | let val = (self.0 >> offs) & 0x01; | ||
| 10033 | val != 0 | 10648 | val != 0 |
| 10034 | } | 10649 | } |
| 10035 | #[doc = "Direct mode error interrupt enable"] | 10650 | #[doc = "Capture/compare 1 interrupt flag"] |
| 10036 | pub fn set_dmeie(&mut self, val: bool) { | 10651 | pub fn set_ccif(&mut self, n: usize, val: bool) { |
| 10037 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 10652 | assert!(n < 4usize); |
| 10653 | let offs = 1usize + n * 1usize; | ||
| 10654 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 10038 | } | 10655 | } |
| 10039 | #[doc = "Transfer error interrupt enable"] | 10656 | #[doc = "COM interrupt flag"] |
| 10040 | pub const fn teie(&self) -> bool { | 10657 | pub const fn comif(&self) -> bool { |
| 10658 | let val = (self.0 >> 5usize) & 0x01; | ||
| 10659 | val != 0 | ||
| 10660 | } | ||
| 10661 | #[doc = "COM interrupt flag"] | ||
| 10662 | pub fn set_comif(&mut self, val: bool) { | ||
| 10663 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 10664 | } | ||
| 10665 | #[doc = "Trigger interrupt flag"] | ||
| 10666 | pub const fn tif(&self) -> bool { | ||
| 10667 | let val = (self.0 >> 6usize) & 0x01; | ||
| 10668 | val != 0 | ||
| 10669 | } | ||
| 10670 | #[doc = "Trigger interrupt flag"] | ||
| 10671 | pub fn set_tif(&mut self, val: bool) { | ||
| 10672 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 10673 | } | ||
| 10674 | #[doc = "Break interrupt flag"] | ||
| 10675 | pub const fn bif(&self) -> bool { | ||
| 10676 | let val = (self.0 >> 7usize) & 0x01; | ||
| 10677 | val != 0 | ||
| 10678 | } | ||
| 10679 | #[doc = "Break interrupt flag"] | ||
| 10680 | pub fn set_bif(&mut self, val: bool) { | ||
| 10681 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 10682 | } | ||
| 10683 | #[doc = "Capture/Compare 1 overcapture flag"] | ||
| 10684 | pub fn ccof(&self, n: usize) -> bool { | ||
| 10685 | assert!(n < 4usize); | ||
| 10686 | let offs = 9usize + n * 1usize; | ||
| 10687 | let val = (self.0 >> offs) & 0x01; | ||
| 10688 | val != 0 | ||
| 10689 | } | ||
| 10690 | #[doc = "Capture/Compare 1 overcapture flag"] | ||
| 10691 | pub fn set_ccof(&mut self, n: usize, val: bool) { | ||
| 10692 | assert!(n < 4usize); | ||
| 10693 | let offs = 9usize + n * 1usize; | ||
| 10694 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 10695 | } | ||
| 10696 | } | ||
| 10697 | impl Default for SrGp { | ||
| 10698 | fn default() -> SrGp { | ||
| 10699 | SrGp(0) | ||
| 10700 | } | ||
| 10701 | } | ||
| 10702 | #[doc = "event generation register"] | ||
| 10703 | #[repr(transparent)] | ||
| 10704 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 10705 | pub struct EgrBasic(pub u32); | ||
| 10706 | impl EgrBasic { | ||
| 10707 | #[doc = "Update generation"] | ||
| 10708 | pub const fn ug(&self) -> bool { | ||
| 10709 | let val = (self.0 >> 0usize) & 0x01; | ||
| 10710 | val != 0 | ||
| 10711 | } | ||
| 10712 | #[doc = "Update generation"] | ||
| 10713 | pub fn set_ug(&mut self, val: bool) { | ||
| 10714 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 10715 | } | ||
| 10716 | } | ||
| 10717 | impl Default for EgrBasic { | ||
| 10718 | fn default() -> EgrBasic { | ||
| 10719 | EgrBasic(0) | ||
| 10720 | } | ||
| 10721 | } | ||
| 10722 | #[doc = "DMA/Interrupt enable register"] | ||
| 10723 | #[repr(transparent)] | ||
| 10724 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 10725 | pub struct DierGp(pub u32); | ||
| 10726 | impl DierGp { | ||
| 10727 | #[doc = "Update interrupt enable"] | ||
| 10728 | pub const fn uie(&self) -> bool { | ||
| 10729 | let val = (self.0 >> 0usize) & 0x01; | ||
| 10730 | val != 0 | ||
| 10731 | } | ||
| 10732 | #[doc = "Update interrupt enable"] | ||
| 10733 | pub fn set_uie(&mut self, val: bool) { | ||
| 10734 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 10735 | } | ||
| 10736 | #[doc = "Capture/Compare 1 interrupt enable"] | ||
| 10737 | pub fn ccie(&self, n: usize) -> bool { | ||
| 10738 | assert!(n < 4usize); | ||
| 10739 | let offs = 1usize + n * 1usize; | ||
| 10740 | let val = (self.0 >> offs) & 0x01; | ||
| 10741 | val != 0 | ||
| 10742 | } | ||
| 10743 | #[doc = "Capture/Compare 1 interrupt enable"] | ||
| 10744 | pub fn set_ccie(&mut self, n: usize, val: bool) { | ||
| 10745 | assert!(n < 4usize); | ||
| 10746 | let offs = 1usize + n * 1usize; | ||
| 10747 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 10748 | } | ||
| 10749 | #[doc = "Trigger interrupt enable"] | ||
| 10750 | pub const fn tie(&self) -> bool { | ||
| 10751 | let val = (self.0 >> 6usize) & 0x01; | ||
| 10752 | val != 0 | ||
| 10753 | } | ||
| 10754 | #[doc = "Trigger interrupt enable"] | ||
| 10755 | pub fn set_tie(&mut self, val: bool) { | ||
| 10756 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 10757 | } | ||
| 10758 | #[doc = "Update DMA request enable"] | ||
| 10759 | pub const fn ude(&self) -> bool { | ||
| 10760 | let val = (self.0 >> 8usize) & 0x01; | ||
| 10761 | val != 0 | ||
| 10762 | } | ||
| 10763 | #[doc = "Update DMA request enable"] | ||
| 10764 | pub fn set_ude(&mut self, val: bool) { | ||
| 10765 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 10766 | } | ||
| 10767 | #[doc = "Capture/Compare 1 DMA request enable"] | ||
| 10768 | pub fn ccde(&self, n: usize) -> bool { | ||
| 10769 | assert!(n < 4usize); | ||
| 10770 | let offs = 9usize + n * 1usize; | ||
| 10771 | let val = (self.0 >> offs) & 0x01; | ||
| 10772 | val != 0 | ||
| 10773 | } | ||
| 10774 | #[doc = "Capture/Compare 1 DMA request enable"] | ||
| 10775 | pub fn set_ccde(&mut self, n: usize, val: bool) { | ||
| 10776 | assert!(n < 4usize); | ||
| 10777 | let offs = 9usize + n * 1usize; | ||
| 10778 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 10779 | } | ||
| 10780 | #[doc = "Trigger DMA request enable"] | ||
| 10781 | pub const fn tde(&self) -> bool { | ||
| 10782 | let val = (self.0 >> 14usize) & 0x01; | ||
| 10783 | val != 0 | ||
| 10784 | } | ||
| 10785 | #[doc = "Trigger DMA request enable"] | ||
| 10786 | pub fn set_tde(&mut self, val: bool) { | ||
| 10787 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | ||
| 10788 | } | ||
| 10789 | } | ||
| 10790 | impl Default for DierGp { | ||
| 10791 | fn default() -> DierGp { | ||
| 10792 | DierGp(0) | ||
| 10793 | } | ||
| 10794 | } | ||
| 10795 | #[doc = "control register 2"] | ||
| 10796 | #[repr(transparent)] | ||
| 10797 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 10798 | pub struct Cr2Adv(pub u32); | ||
| 10799 | impl Cr2Adv { | ||
| 10800 | #[doc = "Capture/compare preloaded control"] | ||
| 10801 | pub const fn ccpc(&self) -> bool { | ||
| 10802 | let val = (self.0 >> 0usize) & 0x01; | ||
| 10803 | val != 0 | ||
| 10804 | } | ||
| 10805 | #[doc = "Capture/compare preloaded control"] | ||
| 10806 | pub fn set_ccpc(&mut self, val: bool) { | ||
| 10807 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 10808 | } | ||
| 10809 | #[doc = "Capture/compare control update selection"] | ||
| 10810 | pub const fn ccus(&self) -> bool { | ||
| 10041 | let val = (self.0 >> 2usize) & 0x01; | 10811 | let val = (self.0 >> 2usize) & 0x01; |
| 10042 | val != 0 | 10812 | val != 0 |
| 10043 | } | 10813 | } |
| 10044 | #[doc = "Transfer error interrupt enable"] | 10814 | #[doc = "Capture/compare control update selection"] |
| 10045 | pub fn set_teie(&mut self, val: bool) { | 10815 | pub fn set_ccus(&mut self, val: bool) { |
| 10046 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 10816 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 10047 | } | 10817 | } |
| 10048 | #[doc = "Half transfer interrupt enable"] | 10818 | #[doc = "Capture/compare DMA selection"] |
| 10049 | pub const fn htie(&self) -> bool { | 10819 | pub const fn ccds(&self) -> super::vals::Ccds { |
| 10050 | let val = (self.0 >> 3usize) & 0x01; | 10820 | let val = (self.0 >> 3usize) & 0x01; |
| 10821 | super::vals::Ccds(val as u8) | ||
| 10822 | } | ||
| 10823 | #[doc = "Capture/compare DMA selection"] | ||
| 10824 | pub fn set_ccds(&mut self, val: super::vals::Ccds) { | ||
| 10825 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 10826 | } | ||
| 10827 | #[doc = "Master mode selection"] | ||
| 10828 | pub const fn mms(&self) -> super::vals::Mms { | ||
| 10829 | let val = (self.0 >> 4usize) & 0x07; | ||
| 10830 | super::vals::Mms(val as u8) | ||
| 10831 | } | ||
| 10832 | #[doc = "Master mode selection"] | ||
| 10833 | pub fn set_mms(&mut self, val: super::vals::Mms) { | ||
| 10834 | self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize); | ||
| 10835 | } | ||
| 10836 | #[doc = "TI1 selection"] | ||
| 10837 | pub const fn ti1s(&self) -> super::vals::Tis { | ||
| 10838 | let val = (self.0 >> 7usize) & 0x01; | ||
| 10839 | super::vals::Tis(val as u8) | ||
| 10840 | } | ||
| 10841 | #[doc = "TI1 selection"] | ||
| 10842 | pub fn set_ti1s(&mut self, val: super::vals::Tis) { | ||
| 10843 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 10844 | } | ||
| 10845 | #[doc = "Output Idle state 1"] | ||
| 10846 | pub fn ois(&self, n: usize) -> bool { | ||
| 10847 | assert!(n < 4usize); | ||
| 10848 | let offs = 8usize + n * 2usize; | ||
| 10849 | let val = (self.0 >> offs) & 0x01; | ||
| 10051 | val != 0 | 10850 | val != 0 |
| 10052 | } | 10851 | } |
| 10053 | #[doc = "Half transfer interrupt enable"] | 10852 | #[doc = "Output Idle state 1"] |
| 10054 | pub fn set_htie(&mut self, val: bool) { | 10853 | pub fn set_ois(&mut self, n: usize, val: bool) { |
| 10055 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 10854 | assert!(n < 4usize); |
| 10855 | let offs = 8usize + n * 2usize; | ||
| 10856 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 10056 | } | 10857 | } |
| 10057 | #[doc = "Transfer complete interrupt enable"] | 10858 | #[doc = "Output Idle state 1"] |
| 10058 | pub const fn tcie(&self) -> bool { | 10859 | pub const fn ois1n(&self) -> bool { |
| 10059 | let val = (self.0 >> 4usize) & 0x01; | 10860 | let val = (self.0 >> 9usize) & 0x01; |
| 10060 | val != 0 | 10861 | val != 0 |
| 10061 | } | 10862 | } |
| 10062 | #[doc = "Transfer complete interrupt enable"] | 10863 | #[doc = "Output Idle state 1"] |
| 10063 | pub fn set_tcie(&mut self, val: bool) { | 10864 | pub fn set_ois1n(&mut self, val: bool) { |
| 10064 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 10865 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); |
| 10065 | } | 10866 | } |
| 10066 | #[doc = "Peripheral flow controller"] | 10867 | #[doc = "Output Idle state 2"] |
| 10067 | pub const fn pfctrl(&self) -> super::vals::Pfctrl { | 10868 | pub const fn ois2n(&self) -> bool { |
| 10068 | let val = (self.0 >> 5usize) & 0x01; | 10869 | let val = (self.0 >> 11usize) & 0x01; |
| 10069 | super::vals::Pfctrl(val as u8) | 10870 | val != 0 |
| 10070 | } | 10871 | } |
| 10071 | #[doc = "Peripheral flow controller"] | 10872 | #[doc = "Output Idle state 2"] |
| 10072 | pub fn set_pfctrl(&mut self, val: super::vals::Pfctrl) { | 10873 | pub fn set_ois2n(&mut self, val: bool) { |
| 10073 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | 10874 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); |
| 10074 | } | 10875 | } |
| 10075 | #[doc = "Data transfer direction"] | 10876 | #[doc = "Output Idle state 3"] |
| 10076 | pub const fn dir(&self) -> super::vals::Dir { | 10877 | pub const fn ois3n(&self) -> bool { |
| 10077 | let val = (self.0 >> 6usize) & 0x03; | 10878 | let val = (self.0 >> 13usize) & 0x01; |
| 10078 | super::vals::Dir(val as u8) | 10879 | val != 0 |
| 10079 | } | 10880 | } |
| 10080 | #[doc = "Data transfer direction"] | 10881 | #[doc = "Output Idle state 3"] |
| 10081 | pub fn set_dir(&mut self, val: super::vals::Dir) { | 10882 | pub fn set_ois3n(&mut self, val: bool) { |
| 10082 | self.0 = (self.0 & !(0x03 << 6usize)) | (((val.0 as u32) & 0x03) << 6usize); | 10883 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); |
| 10083 | } | 10884 | } |
| 10084 | #[doc = "Circular mode"] | 10885 | } |
| 10085 | pub const fn circ(&self) -> super::vals::Circ { | 10886 | impl Default for Cr2Adv { |
| 10887 | fn default() -> Cr2Adv { | ||
| 10888 | Cr2Adv(0) | ||
| 10889 | } | ||
| 10890 | } | ||
| 10891 | #[doc = "DMA/Interrupt enable register"] | ||
| 10892 | #[repr(transparent)] | ||
| 10893 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 10894 | pub struct DierBasic(pub u32); | ||
| 10895 | impl DierBasic { | ||
| 10896 | #[doc = "Update interrupt enable"] | ||
| 10897 | pub const fn uie(&self) -> bool { | ||
| 10898 | let val = (self.0 >> 0usize) & 0x01; | ||
| 10899 | val != 0 | ||
| 10900 | } | ||
| 10901 | #[doc = "Update interrupt enable"] | ||
| 10902 | pub fn set_uie(&mut self, val: bool) { | ||
| 10903 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 10904 | } | ||
| 10905 | #[doc = "Update DMA request enable"] | ||
| 10906 | pub const fn ude(&self) -> bool { | ||
| 10086 | let val = (self.0 >> 8usize) & 0x01; | 10907 | let val = (self.0 >> 8usize) & 0x01; |
| 10087 | super::vals::Circ(val as u8) | 10908 | val != 0 |
| 10088 | } | 10909 | } |
| 10089 | #[doc = "Circular mode"] | 10910 | #[doc = "Update DMA request enable"] |
| 10090 | pub fn set_circ(&mut self, val: super::vals::Circ) { | 10911 | pub fn set_ude(&mut self, val: bool) { |
| 10091 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); | 10912 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 10092 | } | 10913 | } |
| 10093 | #[doc = "Peripheral increment mode"] | 10914 | } |
| 10094 | pub const fn pinc(&self) -> super::vals::Inc { | 10915 | impl Default for DierBasic { |
| 10095 | let val = (self.0 >> 9usize) & 0x01; | 10916 | fn default() -> DierBasic { |
| 10096 | super::vals::Inc(val as u8) | 10917 | DierBasic(0) |
| 10097 | } | 10918 | } |
| 10098 | #[doc = "Peripheral increment mode"] | 10919 | } |
| 10099 | pub fn set_pinc(&mut self, val: super::vals::Inc) { | 10920 | #[doc = "event generation register"] |
| 10100 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | 10921 | #[repr(transparent)] |
| 10922 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 10923 | pub struct EgrAdv(pub u32); | ||
| 10924 | impl EgrAdv { | ||
| 10925 | #[doc = "Update generation"] | ||
| 10926 | pub const fn ug(&self) -> bool { | ||
| 10927 | let val = (self.0 >> 0usize) & 0x01; | ||
| 10928 | val != 0 | ||
| 10101 | } | 10929 | } |
| 10102 | #[doc = "Memory increment mode"] | 10930 | #[doc = "Update generation"] |
| 10103 | pub const fn minc(&self) -> super::vals::Inc { | 10931 | pub fn set_ug(&mut self, val: bool) { |
| 10932 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 10933 | } | ||
| 10934 | #[doc = "Capture/compare 1 generation"] | ||
| 10935 | pub fn ccg(&self, n: usize) -> bool { | ||
| 10936 | assert!(n < 4usize); | ||
| 10937 | let offs = 1usize + n * 1usize; | ||
| 10938 | let val = (self.0 >> offs) & 0x01; | ||
| 10939 | val != 0 | ||
| 10940 | } | ||
| 10941 | #[doc = "Capture/compare 1 generation"] | ||
| 10942 | pub fn set_ccg(&mut self, n: usize, val: bool) { | ||
| 10943 | assert!(n < 4usize); | ||
| 10944 | let offs = 1usize + n * 1usize; | ||
| 10945 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 10946 | } | ||
| 10947 | #[doc = "Capture/Compare control update generation"] | ||
| 10948 | pub const fn comg(&self) -> bool { | ||
| 10949 | let val = (self.0 >> 5usize) & 0x01; | ||
| 10950 | val != 0 | ||
| 10951 | } | ||
| 10952 | #[doc = "Capture/Compare control update generation"] | ||
| 10953 | pub fn set_comg(&mut self, val: bool) { | ||
| 10954 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 10955 | } | ||
| 10956 | #[doc = "Trigger generation"] | ||
| 10957 | pub const fn tg(&self) -> bool { | ||
| 10958 | let val = (self.0 >> 6usize) & 0x01; | ||
| 10959 | val != 0 | ||
| 10960 | } | ||
| 10961 | #[doc = "Trigger generation"] | ||
| 10962 | pub fn set_tg(&mut self, val: bool) { | ||
| 10963 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 10964 | } | ||
| 10965 | #[doc = "Break generation"] | ||
| 10966 | pub const fn bg(&self) -> bool { | ||
| 10967 | let val = (self.0 >> 7usize) & 0x01; | ||
| 10968 | val != 0 | ||
| 10969 | } | ||
| 10970 | #[doc = "Break generation"] | ||
| 10971 | pub fn set_bg(&mut self, val: bool) { | ||
| 10972 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 10973 | } | ||
| 10974 | } | ||
| 10975 | impl Default for EgrAdv { | ||
| 10976 | fn default() -> EgrAdv { | ||
| 10977 | EgrAdv(0) | ||
| 10978 | } | ||
| 10979 | } | ||
| 10980 | #[doc = "break and dead-time register"] | ||
| 10981 | #[repr(transparent)] | ||
| 10982 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 10983 | pub struct Bdtr(pub u32); | ||
| 10984 | impl Bdtr { | ||
| 10985 | #[doc = "Dead-time generator setup"] | ||
| 10986 | pub const fn dtg(&self) -> u8 { | ||
| 10987 | let val = (self.0 >> 0usize) & 0xff; | ||
| 10988 | val as u8 | ||
| 10989 | } | ||
| 10990 | #[doc = "Dead-time generator setup"] | ||
| 10991 | pub fn set_dtg(&mut self, val: u8) { | ||
| 10992 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | ||
| 10993 | } | ||
| 10994 | #[doc = "Lock configuration"] | ||
| 10995 | pub const fn lock(&self) -> u8 { | ||
| 10996 | let val = (self.0 >> 8usize) & 0x03; | ||
| 10997 | val as u8 | ||
| 10998 | } | ||
| 10999 | #[doc = "Lock configuration"] | ||
| 11000 | pub fn set_lock(&mut self, val: u8) { | ||
| 11001 | self.0 = (self.0 & !(0x03 << 8usize)) | (((val as u32) & 0x03) << 8usize); | ||
| 11002 | } | ||
| 11003 | #[doc = "Off-state selection for Idle mode"] | ||
| 11004 | pub const fn ossi(&self) -> super::vals::Ossi { | ||
| 10104 | let val = (self.0 >> 10usize) & 0x01; | 11005 | let val = (self.0 >> 10usize) & 0x01; |
| 10105 | super::vals::Inc(val as u8) | 11006 | super::vals::Ossi(val as u8) |
| 10106 | } | 11007 | } |
| 10107 | #[doc = "Memory increment mode"] | 11008 | #[doc = "Off-state selection for Idle mode"] |
| 10108 | pub fn set_minc(&mut self, val: super::vals::Inc) { | 11009 | pub fn set_ossi(&mut self, val: super::vals::Ossi) { |
| 10109 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); | 11010 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); |
| 10110 | } | 11011 | } |
| 10111 | #[doc = "Peripheral data size"] | 11012 | #[doc = "Off-state selection for Run mode"] |
| 10112 | pub const fn psize(&self) -> super::vals::Size { | 11013 | pub const fn ossr(&self) -> super::vals::Ossr { |
| 10113 | let val = (self.0 >> 11usize) & 0x03; | 11014 | let val = (self.0 >> 11usize) & 0x01; |
| 10114 | super::vals::Size(val as u8) | 11015 | super::vals::Ossr(val as u8) |
| 10115 | } | 11016 | } |
| 10116 | #[doc = "Peripheral data size"] | 11017 | #[doc = "Off-state selection for Run mode"] |
| 10117 | pub fn set_psize(&mut self, val: super::vals::Size) { | 11018 | pub fn set_ossr(&mut self, val: super::vals::Ossr) { |
| 10118 | self.0 = (self.0 & !(0x03 << 11usize)) | (((val.0 as u32) & 0x03) << 11usize); | 11019 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); |
| 10119 | } | 11020 | } |
| 10120 | #[doc = "Memory data size"] | 11021 | #[doc = "Break enable"] |
| 10121 | pub const fn msize(&self) -> super::vals::Size { | 11022 | pub const fn bke(&self) -> bool { |
| 10122 | let val = (self.0 >> 13usize) & 0x03; | 11023 | let val = (self.0 >> 12usize) & 0x01; |
| 10123 | super::vals::Size(val as u8) | 11024 | val != 0 |
| 10124 | } | 11025 | } |
| 10125 | #[doc = "Memory data size"] | 11026 | #[doc = "Break enable"] |
| 10126 | pub fn set_msize(&mut self, val: super::vals::Size) { | 11027 | pub fn set_bke(&mut self, val: bool) { |
| 10127 | self.0 = (self.0 & !(0x03 << 13usize)) | (((val.0 as u32) & 0x03) << 13usize); | 11028 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); |
| 10128 | } | 11029 | } |
| 10129 | #[doc = "Peripheral increment offset size"] | 11030 | #[doc = "Break polarity"] |
| 10130 | pub const fn pincos(&self) -> super::vals::Pincos { | 11031 | pub const fn bkp(&self) -> bool { |
| 11032 | let val = (self.0 >> 13usize) & 0x01; | ||
| 11033 | val != 0 | ||
| 11034 | } | ||
| 11035 | #[doc = "Break polarity"] | ||
| 11036 | pub fn set_bkp(&mut self, val: bool) { | ||
| 11037 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | ||
| 11038 | } | ||
| 11039 | #[doc = "Automatic output enable"] | ||
| 11040 | pub const fn aoe(&self) -> bool { | ||
| 11041 | let val = (self.0 >> 14usize) & 0x01; | ||
| 11042 | val != 0 | ||
| 11043 | } | ||
| 11044 | #[doc = "Automatic output enable"] | ||
| 11045 | pub fn set_aoe(&mut self, val: bool) { | ||
| 11046 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | ||
| 11047 | } | ||
| 11048 | #[doc = "Main output enable"] | ||
| 11049 | pub const fn moe(&self) -> bool { | ||
| 10131 | let val = (self.0 >> 15usize) & 0x01; | 11050 | let val = (self.0 >> 15usize) & 0x01; |
| 10132 | super::vals::Pincos(val as u8) | 11051 | val != 0 |
| 10133 | } | 11052 | } |
| 10134 | #[doc = "Peripheral increment offset size"] | 11053 | #[doc = "Main output enable"] |
| 10135 | pub fn set_pincos(&mut self, val: super::vals::Pincos) { | 11054 | pub fn set_moe(&mut self, val: bool) { |
| 10136 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | 11055 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); |
| 10137 | } | 11056 | } |
| 10138 | #[doc = "Priority level"] | 11057 | } |
| 10139 | pub const fn pl(&self) -> super::vals::Pl { | 11058 | impl Default for Bdtr { |
| 10140 | let val = (self.0 >> 16usize) & 0x03; | 11059 | fn default() -> Bdtr { |
| 10141 | super::vals::Pl(val as u8) | 11060 | Bdtr(0) |
| 10142 | } | 11061 | } |
| 10143 | #[doc = "Priority level"] | 11062 | } |
| 10144 | pub fn set_pl(&mut self, val: super::vals::Pl) { | 11063 | #[doc = "counter"] |
| 10145 | self.0 = (self.0 & !(0x03 << 16usize)) | (((val.0 as u32) & 0x03) << 16usize); | 11064 | #[repr(transparent)] |
| 11065 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 11066 | pub struct Cnt32(pub u32); | ||
| 11067 | impl Cnt32 { | ||
| 11068 | #[doc = "counter value"] | ||
| 11069 | pub const fn cnt(&self) -> u32 { | ||
| 11070 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 11071 | val as u32 | ||
| 10146 | } | 11072 | } |
| 10147 | #[doc = "Double buffer mode"] | 11073 | #[doc = "counter value"] |
| 10148 | pub const fn dbm(&self) -> super::vals::Dbm { | 11074 | pub fn set_cnt(&mut self, val: u32) { |
| 10149 | let val = (self.0 >> 18usize) & 0x01; | 11075 | self.0 = |
| 10150 | super::vals::Dbm(val as u8) | 11076 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); |
| 10151 | } | 11077 | } |
| 10152 | #[doc = "Double buffer mode"] | 11078 | } |
| 10153 | pub fn set_dbm(&mut self, val: super::vals::Dbm) { | 11079 | impl Default for Cnt32 { |
| 10154 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize); | 11080 | fn default() -> Cnt32 { |
| 11081 | Cnt32(0) | ||
| 10155 | } | 11082 | } |
| 10156 | #[doc = "Current target (only in double buffer mode)"] | 11083 | } |
| 10157 | pub const fn ct(&self) -> super::vals::Ct { | 11084 | #[doc = "auto-reload register"] |
| 10158 | let val = (self.0 >> 19usize) & 0x01; | 11085 | #[repr(transparent)] |
| 10159 | super::vals::Ct(val as u8) | 11086 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 11087 | pub struct Arr32(pub u32); | ||
| 11088 | impl Arr32 { | ||
| 11089 | #[doc = "Auto-reload value"] | ||
| 11090 | pub const fn arr(&self) -> u32 { | ||
| 11091 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 11092 | val as u32 | ||
| 10160 | } | 11093 | } |
| 10161 | #[doc = "Current target (only in double buffer mode)"] | 11094 | #[doc = "Auto-reload value"] |
| 10162 | pub fn set_ct(&mut self, val: super::vals::Ct) { | 11095 | pub fn set_arr(&mut self, val: u32) { |
| 10163 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); | 11096 | self.0 = |
| 11097 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 10164 | } | 11098 | } |
| 10165 | #[doc = "Peripheral burst transfer configuration"] | 11099 | } |
| 10166 | pub const fn pburst(&self) -> super::vals::Burst { | 11100 | impl Default for Arr32 { |
| 10167 | let val = (self.0 >> 21usize) & 0x03; | 11101 | fn default() -> Arr32 { |
| 10168 | super::vals::Burst(val as u8) | 11102 | Arr32(0) |
| 10169 | } | 11103 | } |
| 10170 | #[doc = "Peripheral burst transfer configuration"] | 11104 | } |
| 10171 | pub fn set_pburst(&mut self, val: super::vals::Burst) { | 11105 | #[doc = "control register 1"] |
| 10172 | self.0 = (self.0 & !(0x03 << 21usize)) | (((val.0 as u32) & 0x03) << 21usize); | 11106 | #[repr(transparent)] |
| 11107 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 11108 | pub struct Cr1Gp(pub u32); | ||
| 11109 | impl Cr1Gp { | ||
| 11110 | #[doc = "Counter enable"] | ||
| 11111 | pub const fn cen(&self) -> bool { | ||
| 11112 | let val = (self.0 >> 0usize) & 0x01; | ||
| 11113 | val != 0 | ||
| 10173 | } | 11114 | } |
| 10174 | #[doc = "Memory burst transfer configuration"] | 11115 | #[doc = "Counter enable"] |
| 10175 | pub const fn mburst(&self) -> super::vals::Burst { | 11116 | pub fn set_cen(&mut self, val: bool) { |
| 10176 | let val = (self.0 >> 23usize) & 0x03; | 11117 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 10177 | super::vals::Burst(val as u8) | ||
| 10178 | } | 11118 | } |
| 10179 | #[doc = "Memory burst transfer configuration"] | 11119 | #[doc = "Update disable"] |
| 10180 | pub fn set_mburst(&mut self, val: super::vals::Burst) { | 11120 | pub const fn udis(&self) -> bool { |
| 10181 | self.0 = (self.0 & !(0x03 << 23usize)) | (((val.0 as u32) & 0x03) << 23usize); | 11121 | let val = (self.0 >> 1usize) & 0x01; |
| 11122 | val != 0 | ||
| 10182 | } | 11123 | } |
| 10183 | #[doc = "Channel selection"] | 11124 | #[doc = "Update disable"] |
| 10184 | pub const fn chsel(&self) -> u8 { | 11125 | pub fn set_udis(&mut self, val: bool) { |
| 10185 | let val = (self.0 >> 25usize) & 0x0f; | 11126 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 10186 | val as u8 | ||
| 10187 | } | 11127 | } |
| 10188 | #[doc = "Channel selection"] | 11128 | #[doc = "Update request source"] |
| 10189 | pub fn set_chsel(&mut self, val: u8) { | 11129 | pub const fn urs(&self) -> super::vals::Urs { |
| 10190 | self.0 = (self.0 & !(0x0f << 25usize)) | (((val as u32) & 0x0f) << 25usize); | 11130 | let val = (self.0 >> 2usize) & 0x01; |
| 11131 | super::vals::Urs(val as u8) | ||
| 11132 | } | ||
| 11133 | #[doc = "Update request source"] | ||
| 11134 | pub fn set_urs(&mut self, val: super::vals::Urs) { | ||
| 11135 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 11136 | } | ||
| 11137 | #[doc = "One-pulse mode"] | ||
| 11138 | pub const fn opm(&self) -> super::vals::Opm { | ||
| 11139 | let val = (self.0 >> 3usize) & 0x01; | ||
| 11140 | super::vals::Opm(val as u8) | ||
| 11141 | } | ||
| 11142 | #[doc = "One-pulse mode"] | ||
| 11143 | pub fn set_opm(&mut self, val: super::vals::Opm) { | ||
| 11144 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 11145 | } | ||
| 11146 | #[doc = "Direction"] | ||
| 11147 | pub const fn dir(&self) -> super::vals::Dir { | ||
| 11148 | let val = (self.0 >> 4usize) & 0x01; | ||
| 11149 | super::vals::Dir(val as u8) | ||
| 11150 | } | ||
| 11151 | #[doc = "Direction"] | ||
| 11152 | pub fn set_dir(&mut self, val: super::vals::Dir) { | ||
| 11153 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 11154 | } | ||
| 11155 | #[doc = "Center-aligned mode selection"] | ||
| 11156 | pub const fn cms(&self) -> super::vals::Cms { | ||
| 11157 | let val = (self.0 >> 5usize) & 0x03; | ||
| 11158 | super::vals::Cms(val as u8) | ||
| 11159 | } | ||
| 11160 | #[doc = "Center-aligned mode selection"] | ||
| 11161 | pub fn set_cms(&mut self, val: super::vals::Cms) { | ||
| 11162 | self.0 = (self.0 & !(0x03 << 5usize)) | (((val.0 as u32) & 0x03) << 5usize); | ||
| 11163 | } | ||
| 11164 | #[doc = "Auto-reload preload enable"] | ||
| 11165 | pub const fn arpe(&self) -> super::vals::Arpe { | ||
| 11166 | let val = (self.0 >> 7usize) & 0x01; | ||
| 11167 | super::vals::Arpe(val as u8) | ||
| 11168 | } | ||
| 11169 | #[doc = "Auto-reload preload enable"] | ||
| 11170 | pub fn set_arpe(&mut self, val: super::vals::Arpe) { | ||
| 11171 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 11172 | } | ||
| 11173 | #[doc = "Clock division"] | ||
| 11174 | pub const fn ckd(&self) -> super::vals::Ckd { | ||
| 11175 | let val = (self.0 >> 8usize) & 0x03; | ||
| 11176 | super::vals::Ckd(val as u8) | ||
| 11177 | } | ||
| 11178 | #[doc = "Clock division"] | ||
| 11179 | pub fn set_ckd(&mut self, val: super::vals::Ckd) { | ||
| 11180 | self.0 = (self.0 & !(0x03 << 8usize)) | (((val.0 as u32) & 0x03) << 8usize); | ||
| 10191 | } | 11181 | } |
| 10192 | } | 11182 | } |
| 10193 | impl Default for Cr { | 11183 | impl Default for Cr1Gp { |
| 10194 | fn default() -> Cr { | 11184 | fn default() -> Cr1Gp { |
| 10195 | Cr(0) | 11185 | Cr1Gp(0) |
| 10196 | } | 11186 | } |
| 10197 | } | 11187 | } |
| 10198 | #[doc = "interrupt register"] | 11188 | #[doc = "DMA/Interrupt enable register"] |
| 10199 | #[repr(transparent)] | 11189 | #[repr(transparent)] |
| 10200 | #[derive(Copy, Clone, Eq, PartialEq)] | 11190 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 10201 | pub struct Ixr(pub u32); | 11191 | pub struct DierAdv(pub u32); |
| 10202 | impl Ixr { | 11192 | impl DierAdv { |
| 10203 | #[doc = "Stream x FIFO error interrupt flag (x=3..0)"] | 11193 | #[doc = "Update interrupt enable"] |
| 10204 | pub fn feif(&self, n: usize) -> bool { | 11194 | pub const fn uie(&self) -> bool { |
| 11195 | let val = (self.0 >> 0usize) & 0x01; | ||
| 11196 | val != 0 | ||
| 11197 | } | ||
| 11198 | #[doc = "Update interrupt enable"] | ||
| 11199 | pub fn set_uie(&mut self, val: bool) { | ||
| 11200 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 11201 | } | ||
| 11202 | #[doc = "Capture/Compare 1 interrupt enable"] | ||
| 11203 | pub fn ccie(&self, n: usize) -> bool { | ||
| 10205 | assert!(n < 4usize); | 11204 | assert!(n < 4usize); |
| 10206 | let offs = 0usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | 11205 | let offs = 1usize + n * 1usize; |
| 10207 | let val = (self.0 >> offs) & 0x01; | 11206 | let val = (self.0 >> offs) & 0x01; |
| 10208 | val != 0 | 11207 | val != 0 |
| 10209 | } | 11208 | } |
| 10210 | #[doc = "Stream x FIFO error interrupt flag (x=3..0)"] | 11209 | #[doc = "Capture/Compare 1 interrupt enable"] |
| 10211 | pub fn set_feif(&mut self, n: usize, val: bool) { | 11210 | pub fn set_ccie(&mut self, n: usize, val: bool) { |
| 10212 | assert!(n < 4usize); | 11211 | assert!(n < 4usize); |
| 10213 | let offs = 0usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | 11212 | let offs = 1usize + n * 1usize; |
| 10214 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | 11213 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); |
| 10215 | } | 11214 | } |
| 10216 | #[doc = "Stream x direct mode error interrupt flag (x=3..0)"] | 11215 | #[doc = "COM interrupt enable"] |
| 10217 | pub fn dmeif(&self, n: usize) -> bool { | 11216 | pub const fn comie(&self) -> bool { |
| 11217 | let val = (self.0 >> 5usize) & 0x01; | ||
| 11218 | val != 0 | ||
| 11219 | } | ||
| 11220 | #[doc = "COM interrupt enable"] | ||
| 11221 | pub fn set_comie(&mut self, val: bool) { | ||
| 11222 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 11223 | } | ||
| 11224 | #[doc = "Trigger interrupt enable"] | ||
| 11225 | pub const fn tie(&self) -> bool { | ||
| 11226 | let val = (self.0 >> 6usize) & 0x01; | ||
| 11227 | val != 0 | ||
| 11228 | } | ||
| 11229 | #[doc = "Trigger interrupt enable"] | ||
| 11230 | pub fn set_tie(&mut self, val: bool) { | ||
| 11231 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 11232 | } | ||
| 11233 | #[doc = "Break interrupt enable"] | ||
| 11234 | pub const fn bie(&self) -> bool { | ||
| 11235 | let val = (self.0 >> 7usize) & 0x01; | ||
| 11236 | val != 0 | ||
| 11237 | } | ||
| 11238 | #[doc = "Break interrupt enable"] | ||
| 11239 | pub fn set_bie(&mut self, val: bool) { | ||
| 11240 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 11241 | } | ||
| 11242 | #[doc = "Update DMA request enable"] | ||
| 11243 | pub const fn ude(&self) -> bool { | ||
| 11244 | let val = (self.0 >> 8usize) & 0x01; | ||
| 11245 | val != 0 | ||
| 11246 | } | ||
| 11247 | #[doc = "Update DMA request enable"] | ||
| 11248 | pub fn set_ude(&mut self, val: bool) { | ||
| 11249 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 11250 | } | ||
| 11251 | #[doc = "Capture/Compare 1 DMA request enable"] | ||
| 11252 | pub fn ccde(&self, n: usize) -> bool { | ||
| 10218 | assert!(n < 4usize); | 11253 | assert!(n < 4usize); |
| 10219 | let offs = 2usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | 11254 | let offs = 9usize + n * 1usize; |
| 10220 | let val = (self.0 >> offs) & 0x01; | 11255 | let val = (self.0 >> offs) & 0x01; |
| 10221 | val != 0 | 11256 | val != 0 |
| 10222 | } | 11257 | } |
| 10223 | #[doc = "Stream x direct mode error interrupt flag (x=3..0)"] | 11258 | #[doc = "Capture/Compare 1 DMA request enable"] |
| 10224 | pub fn set_dmeif(&mut self, n: usize, val: bool) { | 11259 | pub fn set_ccde(&mut self, n: usize, val: bool) { |
| 10225 | assert!(n < 4usize); | 11260 | assert!(n < 4usize); |
| 10226 | let offs = 2usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | 11261 | let offs = 9usize + n * 1usize; |
| 10227 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | 11262 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); |
| 10228 | } | 11263 | } |
| 10229 | #[doc = "Stream x transfer error interrupt flag (x=3..0)"] | 11264 | #[doc = "COM DMA request enable"] |
| 10230 | pub fn teif(&self, n: usize) -> bool { | 11265 | pub const fn comde(&self) -> bool { |
| 11266 | let val = (self.0 >> 13usize) & 0x01; | ||
| 11267 | val != 0 | ||
| 11268 | } | ||
| 11269 | #[doc = "COM DMA request enable"] | ||
| 11270 | pub fn set_comde(&mut self, val: bool) { | ||
| 11271 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | ||
| 11272 | } | ||
| 11273 | #[doc = "Trigger DMA request enable"] | ||
| 11274 | pub const fn tde(&self) -> bool { | ||
| 11275 | let val = (self.0 >> 14usize) & 0x01; | ||
| 11276 | val != 0 | ||
| 11277 | } | ||
| 11278 | #[doc = "Trigger DMA request enable"] | ||
| 11279 | pub fn set_tde(&mut self, val: bool) { | ||
| 11280 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | ||
| 11281 | } | ||
| 11282 | } | ||
| 11283 | impl Default for DierAdv { | ||
| 11284 | fn default() -> DierAdv { | ||
| 11285 | DierAdv(0) | ||
| 11286 | } | ||
| 11287 | } | ||
| 11288 | #[doc = "capture/compare register 1"] | ||
| 11289 | #[repr(transparent)] | ||
| 11290 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 11291 | pub struct Ccr16(pub u32); | ||
| 11292 | impl Ccr16 { | ||
| 11293 | #[doc = "Capture/Compare 1 value"] | ||
| 11294 | pub const fn ccr(&self) -> u16 { | ||
| 11295 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 11296 | val as u16 | ||
| 11297 | } | ||
| 11298 | #[doc = "Capture/Compare 1 value"] | ||
| 11299 | pub fn set_ccr(&mut self, val: u16) { | ||
| 11300 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 11301 | } | ||
| 11302 | } | ||
| 11303 | impl Default for Ccr16 { | ||
| 11304 | fn default() -> Ccr16 { | ||
| 11305 | Ccr16(0) | ||
| 11306 | } | ||
| 11307 | } | ||
| 11308 | #[doc = "capture/compare enable register"] | ||
| 11309 | #[repr(transparent)] | ||
| 11310 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 11311 | pub struct CcerGp(pub u32); | ||
| 11312 | impl CcerGp { | ||
| 11313 | #[doc = "Capture/Compare 1 output enable"] | ||
| 11314 | pub fn cce(&self, n: usize) -> bool { | ||
| 10231 | assert!(n < 4usize); | 11315 | assert!(n < 4usize); |
| 10232 | let offs = 3usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | 11316 | let offs = 0usize + n * 4usize; |
| 10233 | let val = (self.0 >> offs) & 0x01; | 11317 | let val = (self.0 >> offs) & 0x01; |
| 10234 | val != 0 | 11318 | val != 0 |
| 10235 | } | 11319 | } |
| 10236 | #[doc = "Stream x transfer error interrupt flag (x=3..0)"] | 11320 | #[doc = "Capture/Compare 1 output enable"] |
| 10237 | pub fn set_teif(&mut self, n: usize, val: bool) { | 11321 | pub fn set_cce(&mut self, n: usize, val: bool) { |
| 10238 | assert!(n < 4usize); | 11322 | assert!(n < 4usize); |
| 10239 | let offs = 3usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | 11323 | let offs = 0usize + n * 4usize; |
| 10240 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | 11324 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); |
| 10241 | } | 11325 | } |
| 10242 | #[doc = "Stream x half transfer interrupt flag (x=3..0)"] | 11326 | #[doc = "Capture/Compare 1 output Polarity"] |
| 10243 | pub fn htif(&self, n: usize) -> bool { | 11327 | pub fn ccp(&self, n: usize) -> bool { |
| 10244 | assert!(n < 4usize); | 11328 | assert!(n < 4usize); |
| 10245 | let offs = 4usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | 11329 | let offs = 1usize + n * 4usize; |
| 10246 | let val = (self.0 >> offs) & 0x01; | 11330 | let val = (self.0 >> offs) & 0x01; |
| 10247 | val != 0 | 11331 | val != 0 |
| 10248 | } | 11332 | } |
| 10249 | #[doc = "Stream x half transfer interrupt flag (x=3..0)"] | 11333 | #[doc = "Capture/Compare 1 output Polarity"] |
| 10250 | pub fn set_htif(&mut self, n: usize, val: bool) { | 11334 | pub fn set_ccp(&mut self, n: usize, val: bool) { |
| 10251 | assert!(n < 4usize); | 11335 | assert!(n < 4usize); |
| 10252 | let offs = 4usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | 11336 | let offs = 1usize + n * 4usize; |
| 10253 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | 11337 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); |
| 10254 | } | 11338 | } |
| 10255 | #[doc = "Stream x transfer complete interrupt flag (x = 3..0)"] | 11339 | #[doc = "Capture/Compare 1 output Polarity"] |
| 10256 | pub fn tcif(&self, n: usize) -> bool { | 11340 | pub fn ccnp(&self, n: usize) -> bool { |
| 10257 | assert!(n < 4usize); | 11341 | assert!(n < 4usize); |
| 10258 | let offs = 5usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | 11342 | let offs = 3usize + n * 4usize; |
| 10259 | let val = (self.0 >> offs) & 0x01; | 11343 | let val = (self.0 >> offs) & 0x01; |
| 10260 | val != 0 | 11344 | val != 0 |
| 10261 | } | 11345 | } |
| 10262 | #[doc = "Stream x transfer complete interrupt flag (x = 3..0)"] | 11346 | #[doc = "Capture/Compare 1 output Polarity"] |
| 10263 | pub fn set_tcif(&mut self, n: usize, val: bool) { | 11347 | pub fn set_ccnp(&mut self, n: usize, val: bool) { |
| 10264 | assert!(n < 4usize); | 11348 | assert!(n < 4usize); |
| 10265 | let offs = 5usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | 11349 | let offs = 3usize + n * 4usize; |
| 10266 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | 11350 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); |
| 10267 | } | 11351 | } |
| 10268 | } | 11352 | } |
| 10269 | impl Default for Ixr { | 11353 | impl Default for CcerGp { |
| 10270 | fn default() -> Ixr { | 11354 | fn default() -> CcerGp { |
| 10271 | Ixr(0) | 11355 | CcerGp(0) |
| 11356 | } | ||
| 11357 | } | ||
| 11358 | #[doc = "DMA control register"] | ||
| 11359 | #[repr(transparent)] | ||
| 11360 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 11361 | pub struct Dcr(pub u32); | ||
| 11362 | impl Dcr { | ||
| 11363 | #[doc = "DMA base address"] | ||
| 11364 | pub const fn dba(&self) -> u8 { | ||
| 11365 | let val = (self.0 >> 0usize) & 0x1f; | ||
| 11366 | val as u8 | ||
| 11367 | } | ||
| 11368 | #[doc = "DMA base address"] | ||
| 11369 | pub fn set_dba(&mut self, val: u8) { | ||
| 11370 | self.0 = (self.0 & !(0x1f << 0usize)) | (((val as u32) & 0x1f) << 0usize); | ||
| 11371 | } | ||
| 11372 | #[doc = "DMA burst length"] | ||
| 11373 | pub const fn dbl(&self) -> u8 { | ||
| 11374 | let val = (self.0 >> 8usize) & 0x1f; | ||
| 11375 | val as u8 | ||
| 11376 | } | ||
| 11377 | #[doc = "DMA burst length"] | ||
| 11378 | pub fn set_dbl(&mut self, val: u8) { | ||
| 11379 | self.0 = (self.0 & !(0x1f << 8usize)) | (((val as u32) & 0x1f) << 8usize); | ||
| 11380 | } | ||
| 11381 | } | ||
| 11382 | impl Default for Dcr { | ||
| 11383 | fn default() -> Dcr { | ||
| 11384 | Dcr(0) | ||
| 11385 | } | ||
| 11386 | } | ||
| 11387 | #[doc = "control register 2"] | ||
| 11388 | #[repr(transparent)] | ||
| 11389 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 11390 | pub struct Cr2Basic(pub u32); | ||
| 11391 | impl Cr2Basic { | ||
| 11392 | #[doc = "Master mode selection"] | ||
| 11393 | pub const fn mms(&self) -> super::vals::Mms { | ||
| 11394 | let val = (self.0 >> 4usize) & 0x07; | ||
| 11395 | super::vals::Mms(val as u8) | ||
| 11396 | } | ||
| 11397 | #[doc = "Master mode selection"] | ||
| 11398 | pub fn set_mms(&mut self, val: super::vals::Mms) { | ||
| 11399 | self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize); | ||
| 11400 | } | ||
| 11401 | } | ||
| 11402 | impl Default for Cr2Basic { | ||
| 11403 | fn default() -> Cr2Basic { | ||
| 11404 | Cr2Basic(0) | ||
| 11405 | } | ||
| 11406 | } | ||
| 11407 | #[doc = "DMA address for full transfer"] | ||
| 11408 | #[repr(transparent)] | ||
| 11409 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 11410 | pub struct Dmar(pub u32); | ||
| 11411 | impl Dmar { | ||
| 11412 | #[doc = "DMA register for burst accesses"] | ||
| 11413 | pub const fn dmab(&self) -> u16 { | ||
| 11414 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 11415 | val as u16 | ||
| 11416 | } | ||
| 11417 | #[doc = "DMA register for burst accesses"] | ||
| 11418 | pub fn set_dmab(&mut self, val: u16) { | ||
| 11419 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 11420 | } | ||
| 11421 | } | ||
| 11422 | impl Default for Dmar { | ||
| 11423 | fn default() -> Dmar { | ||
| 11424 | Dmar(0) | ||
| 10272 | } | 11425 | } |
| 10273 | } | 11426 | } |
| 10274 | } | 11427 | } |
diff --git a/embassy-stm32/src/pac/stm32h723ve.rs b/embassy-stm32/src/pac/stm32h723ve.rs index aedcde8e5..3952a98dc 100644 --- a/embassy-stm32/src/pac/stm32h723ve.rs +++ b/embassy-stm32/src/pac/stm32h723ve.rs | |||
| @@ -229,12 +229,66 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 232 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 233 | impl_spi!(SPI1, APB2); | ||
| 234 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 235 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 236 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 237 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 238 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 239 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 240 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 241 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 242 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 243 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 244 | impl_spi!(SPI2, APB1); | ||
| 245 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 246 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 247 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 248 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 249 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 250 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 251 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 252 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 253 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 254 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 255 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 256 | impl_spi!(SPI3, APB1); | ||
| 257 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 258 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 259 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 260 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 261 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 262 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 263 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 264 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 265 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 266 | impl_spi!(SPI4, APB2); | ||
| 267 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 268 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 269 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 270 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 271 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 272 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 273 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 274 | impl_spi!(SPI6, APB4); | ||
| 275 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 276 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 277 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 278 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 279 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 280 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 281 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 282 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 283 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 284 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 232 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 285 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 233 | pub use regs::dma_v2 as dma; | 286 | pub use regs::dma_v2 as dma; |
| 234 | pub use regs::exti_v1 as exti; | 287 | pub use regs::exti_v1 as exti; |
| 235 | pub use regs::gpio_v2 as gpio; | 288 | pub use regs::gpio_v2 as gpio; |
| 236 | pub use regs::rng_v1 as rng; | 289 | pub use regs::rng_v1 as rng; |
| 237 | pub use regs::sdmmc_v2 as sdmmc; | 290 | pub use regs::sdmmc_v2 as sdmmc; |
| 291 | pub use regs::spi_v3 as spi; | ||
| 238 | pub use regs::syscfg_h7 as syscfg; | 292 | pub use regs::syscfg_h7 as syscfg; |
| 239 | mod regs; | 293 | mod regs; |
| 240 | use embassy_extras::peripherals; | 294 | use embassy_extras::peripherals; |
| @@ -252,7 +306,7 @@ peripherals!( | |||
| 252 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 306 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, |
| 253 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 307 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, |
| 254 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 308 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, |
| 255 | PK14, PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 309 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG |
| 256 | ); | 310 | ); |
| 257 | 311 | ||
| 258 | pub mod interrupt { | 312 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h723vg.rs b/embassy-stm32/src/pac/stm32h723vg.rs index aedcde8e5..3952a98dc 100644 --- a/embassy-stm32/src/pac/stm32h723vg.rs +++ b/embassy-stm32/src/pac/stm32h723vg.rs | |||
| @@ -229,12 +229,66 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 232 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 233 | impl_spi!(SPI1, APB2); | ||
| 234 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 235 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 236 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 237 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 238 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 239 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 240 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 241 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 242 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 243 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 244 | impl_spi!(SPI2, APB1); | ||
| 245 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 246 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 247 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 248 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 249 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 250 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 251 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 252 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 253 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 254 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 255 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 256 | impl_spi!(SPI3, APB1); | ||
| 257 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 258 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 259 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 260 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 261 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 262 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 263 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 264 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 265 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 266 | impl_spi!(SPI4, APB2); | ||
| 267 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 268 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 269 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 270 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 271 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 272 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 273 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 274 | impl_spi!(SPI6, APB4); | ||
| 275 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 276 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 277 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 278 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 279 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 280 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 281 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 282 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 283 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 284 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 232 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 285 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 233 | pub use regs::dma_v2 as dma; | 286 | pub use regs::dma_v2 as dma; |
| 234 | pub use regs::exti_v1 as exti; | 287 | pub use regs::exti_v1 as exti; |
| 235 | pub use regs::gpio_v2 as gpio; | 288 | pub use regs::gpio_v2 as gpio; |
| 236 | pub use regs::rng_v1 as rng; | 289 | pub use regs::rng_v1 as rng; |
| 237 | pub use regs::sdmmc_v2 as sdmmc; | 290 | pub use regs::sdmmc_v2 as sdmmc; |
| 291 | pub use regs::spi_v3 as spi; | ||
| 238 | pub use regs::syscfg_h7 as syscfg; | 292 | pub use regs::syscfg_h7 as syscfg; |
| 239 | mod regs; | 293 | mod regs; |
| 240 | use embassy_extras::peripherals; | 294 | use embassy_extras::peripherals; |
| @@ -252,7 +306,7 @@ peripherals!( | |||
| 252 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 306 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, |
| 253 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 307 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, |
| 254 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 308 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, |
| 255 | PK14, PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 309 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG |
| 256 | ); | 310 | ); |
| 257 | 311 | ||
| 258 | pub mod interrupt { | 312 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h723ze.rs b/embassy-stm32/src/pac/stm32h723ze.rs index aedcde8e5..f314aa31d 100644 --- a/embassy-stm32/src/pac/stm32h723ze.rs +++ b/embassy-stm32/src/pac/stm32h723ze.rs | |||
| @@ -229,12 +229,77 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 232 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 233 | impl_spi!(SPI1, APB2); | ||
| 234 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 235 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 236 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 237 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 238 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 239 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 240 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 241 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 242 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 243 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 244 | impl_spi!(SPI2, APB1); | ||
| 245 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 246 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 247 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 248 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 249 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 250 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 251 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 252 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 253 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 254 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 255 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 256 | impl_spi!(SPI3, APB1); | ||
| 257 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 258 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 259 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 260 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 261 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 262 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 263 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 264 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 265 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 266 | impl_spi!(SPI4, APB2); | ||
| 267 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 268 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 269 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 270 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 271 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 272 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 273 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 274 | impl_spi!(SPI5, APB2); | ||
| 275 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 276 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 277 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 278 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 279 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 280 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 281 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 282 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 283 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 284 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 285 | impl_spi!(SPI6, APB4); | ||
| 286 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 287 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 288 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 289 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 290 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 291 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 292 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 293 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 232 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 233 | pub use regs::dma_v2 as dma; | 297 | pub use regs::dma_v2 as dma; |
| 234 | pub use regs::exti_v1 as exti; | 298 | pub use regs::exti_v1 as exti; |
| 235 | pub use regs::gpio_v2 as gpio; | 299 | pub use regs::gpio_v2 as gpio; |
| 236 | pub use regs::rng_v1 as rng; | 300 | pub use regs::rng_v1 as rng; |
| 237 | pub use regs::sdmmc_v2 as sdmmc; | 301 | pub use regs::sdmmc_v2 as sdmmc; |
| 302 | pub use regs::spi_v3 as spi; | ||
| 238 | pub use regs::syscfg_h7 as syscfg; | 303 | pub use regs::syscfg_h7 as syscfg; |
| 239 | mod regs; | 304 | mod regs; |
| 240 | use embassy_extras::peripherals; | 305 | use embassy_extras::peripherals; |
| @@ -252,7 +317,7 @@ peripherals!( | |||
| 252 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 317 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, |
| 253 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 318 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, |
| 254 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 319 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, |
| 255 | PK14, PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 320 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 256 | ); | 321 | ); |
| 257 | 322 | ||
| 258 | pub mod interrupt { | 323 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h723zg.rs b/embassy-stm32/src/pac/stm32h723zg.rs index aedcde8e5..f314aa31d 100644 --- a/embassy-stm32/src/pac/stm32h723zg.rs +++ b/embassy-stm32/src/pac/stm32h723zg.rs | |||
| @@ -229,12 +229,77 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 232 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 233 | impl_spi!(SPI1, APB2); | ||
| 234 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 235 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 236 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 237 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 238 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 239 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 240 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 241 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 242 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 243 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 244 | impl_spi!(SPI2, APB1); | ||
| 245 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 246 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 247 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 248 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 249 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 250 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 251 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 252 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 253 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 254 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 255 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 256 | impl_spi!(SPI3, APB1); | ||
| 257 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 258 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 259 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 260 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 261 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 262 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 263 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 264 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 265 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 266 | impl_spi!(SPI4, APB2); | ||
| 267 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 268 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 269 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 270 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 271 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 272 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 273 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 274 | impl_spi!(SPI5, APB2); | ||
| 275 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 276 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 277 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 278 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 279 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 280 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 281 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 282 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 283 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 284 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 285 | impl_spi!(SPI6, APB4); | ||
| 286 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 287 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 288 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 289 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 290 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 291 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 292 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 293 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 232 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 233 | pub use regs::dma_v2 as dma; | 297 | pub use regs::dma_v2 as dma; |
| 234 | pub use regs::exti_v1 as exti; | 298 | pub use regs::exti_v1 as exti; |
| 235 | pub use regs::gpio_v2 as gpio; | 299 | pub use regs::gpio_v2 as gpio; |
| 236 | pub use regs::rng_v1 as rng; | 300 | pub use regs::rng_v1 as rng; |
| 237 | pub use regs::sdmmc_v2 as sdmmc; | 301 | pub use regs::sdmmc_v2 as sdmmc; |
| 302 | pub use regs::spi_v3 as spi; | ||
| 238 | pub use regs::syscfg_h7 as syscfg; | 303 | pub use regs::syscfg_h7 as syscfg; |
| 239 | mod regs; | 304 | mod regs; |
| 240 | use embassy_extras::peripherals; | 305 | use embassy_extras::peripherals; |
| @@ -252,7 +317,7 @@ peripherals!( | |||
| 252 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 317 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, |
| 253 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 318 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, |
| 254 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 319 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, |
| 255 | PK14, PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 320 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 256 | ); | 321 | ); |
| 257 | 322 | ||
| 258 | pub mod interrupt { | 323 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h725ae.rs b/embassy-stm32/src/pac/stm32h725ae.rs index aedcde8e5..f314aa31d 100644 --- a/embassy-stm32/src/pac/stm32h725ae.rs +++ b/embassy-stm32/src/pac/stm32h725ae.rs | |||
| @@ -229,12 +229,77 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 232 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 233 | impl_spi!(SPI1, APB2); | ||
| 234 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 235 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 236 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 237 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 238 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 239 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 240 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 241 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 242 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 243 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 244 | impl_spi!(SPI2, APB1); | ||
| 245 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 246 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 247 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 248 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 249 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 250 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 251 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 252 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 253 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 254 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 255 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 256 | impl_spi!(SPI3, APB1); | ||
| 257 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 258 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 259 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 260 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 261 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 262 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 263 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 264 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 265 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 266 | impl_spi!(SPI4, APB2); | ||
| 267 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 268 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 269 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 270 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 271 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 272 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 273 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 274 | impl_spi!(SPI5, APB2); | ||
| 275 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 276 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 277 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 278 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 279 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 280 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 281 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 282 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 283 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 284 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 285 | impl_spi!(SPI6, APB4); | ||
| 286 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 287 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 288 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 289 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 290 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 291 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 292 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 293 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 232 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 233 | pub use regs::dma_v2 as dma; | 297 | pub use regs::dma_v2 as dma; |
| 234 | pub use regs::exti_v1 as exti; | 298 | pub use regs::exti_v1 as exti; |
| 235 | pub use regs::gpio_v2 as gpio; | 299 | pub use regs::gpio_v2 as gpio; |
| 236 | pub use regs::rng_v1 as rng; | 300 | pub use regs::rng_v1 as rng; |
| 237 | pub use regs::sdmmc_v2 as sdmmc; | 301 | pub use regs::sdmmc_v2 as sdmmc; |
| 302 | pub use regs::spi_v3 as spi; | ||
| 238 | pub use regs::syscfg_h7 as syscfg; | 303 | pub use regs::syscfg_h7 as syscfg; |
| 239 | mod regs; | 304 | mod regs; |
| 240 | use embassy_extras::peripherals; | 305 | use embassy_extras::peripherals; |
| @@ -252,7 +317,7 @@ peripherals!( | |||
| 252 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 317 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, |
| 253 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 318 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, |
| 254 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 319 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, |
| 255 | PK14, PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 320 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 256 | ); | 321 | ); |
| 257 | 322 | ||
| 258 | pub mod interrupt { | 323 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h725ag.rs b/embassy-stm32/src/pac/stm32h725ag.rs index aedcde8e5..f314aa31d 100644 --- a/embassy-stm32/src/pac/stm32h725ag.rs +++ b/embassy-stm32/src/pac/stm32h725ag.rs | |||
| @@ -229,12 +229,77 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 232 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 233 | impl_spi!(SPI1, APB2); | ||
| 234 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 235 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 236 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 237 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 238 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 239 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 240 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 241 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 242 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 243 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 244 | impl_spi!(SPI2, APB1); | ||
| 245 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 246 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 247 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 248 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 249 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 250 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 251 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 252 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 253 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 254 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 255 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 256 | impl_spi!(SPI3, APB1); | ||
| 257 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 258 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 259 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 260 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 261 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 262 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 263 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 264 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 265 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 266 | impl_spi!(SPI4, APB2); | ||
| 267 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 268 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 269 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 270 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 271 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 272 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 273 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 274 | impl_spi!(SPI5, APB2); | ||
| 275 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 276 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 277 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 278 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 279 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 280 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 281 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 282 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 283 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 284 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 285 | impl_spi!(SPI6, APB4); | ||
| 286 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 287 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 288 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 289 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 290 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 291 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 292 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 293 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 232 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 233 | pub use regs::dma_v2 as dma; | 297 | pub use regs::dma_v2 as dma; |
| 234 | pub use regs::exti_v1 as exti; | 298 | pub use regs::exti_v1 as exti; |
| 235 | pub use regs::gpio_v2 as gpio; | 299 | pub use regs::gpio_v2 as gpio; |
| 236 | pub use regs::rng_v1 as rng; | 300 | pub use regs::rng_v1 as rng; |
| 237 | pub use regs::sdmmc_v2 as sdmmc; | 301 | pub use regs::sdmmc_v2 as sdmmc; |
| 302 | pub use regs::spi_v3 as spi; | ||
| 238 | pub use regs::syscfg_h7 as syscfg; | 303 | pub use regs::syscfg_h7 as syscfg; |
| 239 | mod regs; | 304 | mod regs; |
| 240 | use embassy_extras::peripherals; | 305 | use embassy_extras::peripherals; |
| @@ -252,7 +317,7 @@ peripherals!( | |||
| 252 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 317 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, |
| 253 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 318 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, |
| 254 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 319 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, |
| 255 | PK14, PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 320 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 256 | ); | 321 | ); |
| 257 | 322 | ||
| 258 | pub mod interrupt { | 323 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h725ie.rs b/embassy-stm32/src/pac/stm32h725ie.rs index aedcde8e5..f314aa31d 100644 --- a/embassy-stm32/src/pac/stm32h725ie.rs +++ b/embassy-stm32/src/pac/stm32h725ie.rs | |||
| @@ -229,12 +229,77 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 232 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 233 | impl_spi!(SPI1, APB2); | ||
| 234 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 235 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 236 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 237 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 238 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 239 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 240 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 241 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 242 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 243 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 244 | impl_spi!(SPI2, APB1); | ||
| 245 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 246 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 247 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 248 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 249 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 250 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 251 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 252 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 253 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 254 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 255 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 256 | impl_spi!(SPI3, APB1); | ||
| 257 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 258 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 259 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 260 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 261 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 262 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 263 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 264 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 265 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 266 | impl_spi!(SPI4, APB2); | ||
| 267 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 268 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 269 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 270 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 271 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 272 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 273 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 274 | impl_spi!(SPI5, APB2); | ||
| 275 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 276 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 277 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 278 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 279 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 280 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 281 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 282 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 283 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 284 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 285 | impl_spi!(SPI6, APB4); | ||
| 286 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 287 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 288 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 289 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 290 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 291 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 292 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 293 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 232 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 233 | pub use regs::dma_v2 as dma; | 297 | pub use regs::dma_v2 as dma; |
| 234 | pub use regs::exti_v1 as exti; | 298 | pub use regs::exti_v1 as exti; |
| 235 | pub use regs::gpio_v2 as gpio; | 299 | pub use regs::gpio_v2 as gpio; |
| 236 | pub use regs::rng_v1 as rng; | 300 | pub use regs::rng_v1 as rng; |
| 237 | pub use regs::sdmmc_v2 as sdmmc; | 301 | pub use regs::sdmmc_v2 as sdmmc; |
| 302 | pub use regs::spi_v3 as spi; | ||
| 238 | pub use regs::syscfg_h7 as syscfg; | 303 | pub use regs::syscfg_h7 as syscfg; |
| 239 | mod regs; | 304 | mod regs; |
| 240 | use embassy_extras::peripherals; | 305 | use embassy_extras::peripherals; |
| @@ -252,7 +317,7 @@ peripherals!( | |||
| 252 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 317 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, |
| 253 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 318 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, |
| 254 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 319 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, |
| 255 | PK14, PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 320 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 256 | ); | 321 | ); |
| 257 | 322 | ||
| 258 | pub mod interrupt { | 323 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h725ig.rs b/embassy-stm32/src/pac/stm32h725ig.rs index aedcde8e5..f314aa31d 100644 --- a/embassy-stm32/src/pac/stm32h725ig.rs +++ b/embassy-stm32/src/pac/stm32h725ig.rs | |||
| @@ -229,12 +229,77 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 232 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 233 | impl_spi!(SPI1, APB2); | ||
| 234 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 235 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 236 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 237 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 238 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 239 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 240 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 241 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 242 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 243 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 244 | impl_spi!(SPI2, APB1); | ||
| 245 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 246 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 247 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 248 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 249 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 250 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 251 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 252 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 253 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 254 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 255 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 256 | impl_spi!(SPI3, APB1); | ||
| 257 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 258 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 259 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 260 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 261 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 262 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 263 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 264 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 265 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 266 | impl_spi!(SPI4, APB2); | ||
| 267 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 268 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 269 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 270 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 271 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 272 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 273 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 274 | impl_spi!(SPI5, APB2); | ||
| 275 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 276 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 277 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 278 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 279 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 280 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 281 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 282 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 283 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 284 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 285 | impl_spi!(SPI6, APB4); | ||
| 286 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 287 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 288 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 289 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 290 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 291 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 292 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 293 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 232 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 233 | pub use regs::dma_v2 as dma; | 297 | pub use regs::dma_v2 as dma; |
| 234 | pub use regs::exti_v1 as exti; | 298 | pub use regs::exti_v1 as exti; |
| 235 | pub use regs::gpio_v2 as gpio; | 299 | pub use regs::gpio_v2 as gpio; |
| 236 | pub use regs::rng_v1 as rng; | 300 | pub use regs::rng_v1 as rng; |
| 237 | pub use regs::sdmmc_v2 as sdmmc; | 301 | pub use regs::sdmmc_v2 as sdmmc; |
| 302 | pub use regs::spi_v3 as spi; | ||
| 238 | pub use regs::syscfg_h7 as syscfg; | 303 | pub use regs::syscfg_h7 as syscfg; |
| 239 | mod regs; | 304 | mod regs; |
| 240 | use embassy_extras::peripherals; | 305 | use embassy_extras::peripherals; |
| @@ -252,7 +317,7 @@ peripherals!( | |||
| 252 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 317 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, |
| 253 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 318 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, |
| 254 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 319 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, |
| 255 | PK14, PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 320 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 256 | ); | 321 | ); |
| 257 | 322 | ||
| 258 | pub mod interrupt { | 323 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h725re.rs b/embassy-stm32/src/pac/stm32h725re.rs index aedcde8e5..ed3c37327 100644 --- a/embassy-stm32/src/pac/stm32h725re.rs +++ b/embassy-stm32/src/pac/stm32h725re.rs | |||
| @@ -229,12 +229,58 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 232 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 233 | impl_spi!(SPI1, APB2); | ||
| 234 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 235 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 236 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 237 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 238 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 239 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 240 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 241 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 242 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 243 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 244 | impl_spi!(SPI2, APB1); | ||
| 245 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 246 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 247 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 248 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 249 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 250 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 251 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 252 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 253 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 254 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 255 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 256 | impl_spi!(SPI3, APB1); | ||
| 257 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 258 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 259 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 260 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 261 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 262 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 263 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 264 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 265 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 266 | impl_spi!(SPI6, APB4); | ||
| 267 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 268 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 269 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 270 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 271 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 272 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 273 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 274 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 275 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 276 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 232 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 277 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 233 | pub use regs::dma_v2 as dma; | 278 | pub use regs::dma_v2 as dma; |
| 234 | pub use regs::exti_v1 as exti; | 279 | pub use regs::exti_v1 as exti; |
| 235 | pub use regs::gpio_v2 as gpio; | 280 | pub use regs::gpio_v2 as gpio; |
| 236 | pub use regs::rng_v1 as rng; | 281 | pub use regs::rng_v1 as rng; |
| 237 | pub use regs::sdmmc_v2 as sdmmc; | 282 | pub use regs::sdmmc_v2 as sdmmc; |
| 283 | pub use regs::spi_v3 as spi; | ||
| 238 | pub use regs::syscfg_h7 as syscfg; | 284 | pub use regs::syscfg_h7 as syscfg; |
| 239 | mod regs; | 285 | mod regs; |
| 240 | use embassy_extras::peripherals; | 286 | use embassy_extras::peripherals; |
| @@ -252,7 +298,7 @@ peripherals!( | |||
| 252 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 298 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, |
| 253 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 299 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, |
| 254 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 300 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, |
| 255 | PK14, PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 301 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI6, SYSCFG |
| 256 | ); | 302 | ); |
| 257 | 303 | ||
| 258 | pub mod interrupt { | 304 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h725rg.rs b/embassy-stm32/src/pac/stm32h725rg.rs index aedcde8e5..ed3c37327 100644 --- a/embassy-stm32/src/pac/stm32h725rg.rs +++ b/embassy-stm32/src/pac/stm32h725rg.rs | |||
| @@ -229,12 +229,58 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 232 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 233 | impl_spi!(SPI1, APB2); | ||
| 234 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 235 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 236 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 237 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 238 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 239 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 240 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 241 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 242 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 243 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 244 | impl_spi!(SPI2, APB1); | ||
| 245 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 246 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 247 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 248 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 249 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 250 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 251 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 252 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 253 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 254 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 255 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 256 | impl_spi!(SPI3, APB1); | ||
| 257 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 258 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 259 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 260 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 261 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 262 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 263 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 264 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 265 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 266 | impl_spi!(SPI6, APB4); | ||
| 267 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 268 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 269 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 270 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 271 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 272 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 273 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 274 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 275 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 276 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 232 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 277 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 233 | pub use regs::dma_v2 as dma; | 278 | pub use regs::dma_v2 as dma; |
| 234 | pub use regs::exti_v1 as exti; | 279 | pub use regs::exti_v1 as exti; |
| 235 | pub use regs::gpio_v2 as gpio; | 280 | pub use regs::gpio_v2 as gpio; |
| 236 | pub use regs::rng_v1 as rng; | 281 | pub use regs::rng_v1 as rng; |
| 237 | pub use regs::sdmmc_v2 as sdmmc; | 282 | pub use regs::sdmmc_v2 as sdmmc; |
| 283 | pub use regs::spi_v3 as spi; | ||
| 238 | pub use regs::syscfg_h7 as syscfg; | 284 | pub use regs::syscfg_h7 as syscfg; |
| 239 | mod regs; | 285 | mod regs; |
| 240 | use embassy_extras::peripherals; | 286 | use embassy_extras::peripherals; |
| @@ -252,7 +298,7 @@ peripherals!( | |||
| 252 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 298 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, |
| 253 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 299 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, |
| 254 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 300 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, |
| 255 | PK14, PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 301 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI6, SYSCFG |
| 256 | ); | 302 | ); |
| 257 | 303 | ||
| 258 | pub mod interrupt { | 304 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h725ve.rs b/embassy-stm32/src/pac/stm32h725ve.rs index aedcde8e5..3952a98dc 100644 --- a/embassy-stm32/src/pac/stm32h725ve.rs +++ b/embassy-stm32/src/pac/stm32h725ve.rs | |||
| @@ -229,12 +229,66 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 232 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 233 | impl_spi!(SPI1, APB2); | ||
| 234 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 235 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 236 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 237 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 238 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 239 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 240 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 241 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 242 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 243 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 244 | impl_spi!(SPI2, APB1); | ||
| 245 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 246 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 247 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 248 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 249 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 250 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 251 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 252 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 253 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 254 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 255 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 256 | impl_spi!(SPI3, APB1); | ||
| 257 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 258 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 259 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 260 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 261 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 262 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 263 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 264 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 265 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 266 | impl_spi!(SPI4, APB2); | ||
| 267 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 268 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 269 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 270 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 271 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 272 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 273 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 274 | impl_spi!(SPI6, APB4); | ||
| 275 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 276 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 277 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 278 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 279 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 280 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 281 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 282 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 283 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 284 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 232 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 285 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 233 | pub use regs::dma_v2 as dma; | 286 | pub use regs::dma_v2 as dma; |
| 234 | pub use regs::exti_v1 as exti; | 287 | pub use regs::exti_v1 as exti; |
| 235 | pub use regs::gpio_v2 as gpio; | 288 | pub use regs::gpio_v2 as gpio; |
| 236 | pub use regs::rng_v1 as rng; | 289 | pub use regs::rng_v1 as rng; |
| 237 | pub use regs::sdmmc_v2 as sdmmc; | 290 | pub use regs::sdmmc_v2 as sdmmc; |
| 291 | pub use regs::spi_v3 as spi; | ||
| 238 | pub use regs::syscfg_h7 as syscfg; | 292 | pub use regs::syscfg_h7 as syscfg; |
| 239 | mod regs; | 293 | mod regs; |
| 240 | use embassy_extras::peripherals; | 294 | use embassy_extras::peripherals; |
| @@ -252,7 +306,7 @@ peripherals!( | |||
| 252 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 306 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, |
| 253 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 307 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, |
| 254 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 308 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, |
| 255 | PK14, PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 309 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG |
| 256 | ); | 310 | ); |
| 257 | 311 | ||
| 258 | pub mod interrupt { | 312 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h725vg.rs b/embassy-stm32/src/pac/stm32h725vg.rs index aedcde8e5..3952a98dc 100644 --- a/embassy-stm32/src/pac/stm32h725vg.rs +++ b/embassy-stm32/src/pac/stm32h725vg.rs | |||
| @@ -229,12 +229,66 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 232 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 233 | impl_spi!(SPI1, APB2); | ||
| 234 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 235 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 236 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 237 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 238 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 239 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 240 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 241 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 242 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 243 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 244 | impl_spi!(SPI2, APB1); | ||
| 245 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 246 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 247 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 248 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 249 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 250 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 251 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 252 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 253 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 254 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 255 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 256 | impl_spi!(SPI3, APB1); | ||
| 257 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 258 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 259 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 260 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 261 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 262 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 263 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 264 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 265 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 266 | impl_spi!(SPI4, APB2); | ||
| 267 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 268 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 269 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 270 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 271 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 272 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 273 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 274 | impl_spi!(SPI6, APB4); | ||
| 275 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 276 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 277 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 278 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 279 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 280 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 281 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 282 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 283 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 284 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 232 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 285 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 233 | pub use regs::dma_v2 as dma; | 286 | pub use regs::dma_v2 as dma; |
| 234 | pub use regs::exti_v1 as exti; | 287 | pub use regs::exti_v1 as exti; |
| 235 | pub use regs::gpio_v2 as gpio; | 288 | pub use regs::gpio_v2 as gpio; |
| 236 | pub use regs::rng_v1 as rng; | 289 | pub use regs::rng_v1 as rng; |
| 237 | pub use regs::sdmmc_v2 as sdmmc; | 290 | pub use regs::sdmmc_v2 as sdmmc; |
| 291 | pub use regs::spi_v3 as spi; | ||
| 238 | pub use regs::syscfg_h7 as syscfg; | 292 | pub use regs::syscfg_h7 as syscfg; |
| 239 | mod regs; | 293 | mod regs; |
| 240 | use embassy_extras::peripherals; | 294 | use embassy_extras::peripherals; |
| @@ -252,7 +306,7 @@ peripherals!( | |||
| 252 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 306 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, |
| 253 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 307 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, |
| 254 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 308 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, |
| 255 | PK14, PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 309 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG |
| 256 | ); | 310 | ); |
| 257 | 311 | ||
| 258 | pub mod interrupt { | 312 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h725ze.rs b/embassy-stm32/src/pac/stm32h725ze.rs index aedcde8e5..f314aa31d 100644 --- a/embassy-stm32/src/pac/stm32h725ze.rs +++ b/embassy-stm32/src/pac/stm32h725ze.rs | |||
| @@ -229,12 +229,77 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 232 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 233 | impl_spi!(SPI1, APB2); | ||
| 234 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 235 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 236 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 237 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 238 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 239 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 240 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 241 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 242 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 243 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 244 | impl_spi!(SPI2, APB1); | ||
| 245 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 246 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 247 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 248 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 249 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 250 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 251 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 252 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 253 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 254 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 255 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 256 | impl_spi!(SPI3, APB1); | ||
| 257 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 258 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 259 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 260 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 261 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 262 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 263 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 264 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 265 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 266 | impl_spi!(SPI4, APB2); | ||
| 267 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 268 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 269 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 270 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 271 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 272 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 273 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 274 | impl_spi!(SPI5, APB2); | ||
| 275 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 276 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 277 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 278 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 279 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 280 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 281 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 282 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 283 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 284 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 285 | impl_spi!(SPI6, APB4); | ||
| 286 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 287 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 288 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 289 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 290 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 291 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 292 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 293 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 232 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 233 | pub use regs::dma_v2 as dma; | 297 | pub use regs::dma_v2 as dma; |
| 234 | pub use regs::exti_v1 as exti; | 298 | pub use regs::exti_v1 as exti; |
| 235 | pub use regs::gpio_v2 as gpio; | 299 | pub use regs::gpio_v2 as gpio; |
| 236 | pub use regs::rng_v1 as rng; | 300 | pub use regs::rng_v1 as rng; |
| 237 | pub use regs::sdmmc_v2 as sdmmc; | 301 | pub use regs::sdmmc_v2 as sdmmc; |
| 302 | pub use regs::spi_v3 as spi; | ||
| 238 | pub use regs::syscfg_h7 as syscfg; | 303 | pub use regs::syscfg_h7 as syscfg; |
| 239 | mod regs; | 304 | mod regs; |
| 240 | use embassy_extras::peripherals; | 305 | use embassy_extras::peripherals; |
| @@ -252,7 +317,7 @@ peripherals!( | |||
| 252 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 317 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, |
| 253 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 318 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, |
| 254 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 319 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, |
| 255 | PK14, PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 320 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 256 | ); | 321 | ); |
| 257 | 322 | ||
| 258 | pub mod interrupt { | 323 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h725zg.rs b/embassy-stm32/src/pac/stm32h725zg.rs index aedcde8e5..f314aa31d 100644 --- a/embassy-stm32/src/pac/stm32h725zg.rs +++ b/embassy-stm32/src/pac/stm32h725zg.rs | |||
| @@ -229,12 +229,77 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 232 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 233 | impl_spi!(SPI1, APB2); | ||
| 234 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 235 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 236 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 237 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 238 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 239 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 240 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 241 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 242 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 243 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 244 | impl_spi!(SPI2, APB1); | ||
| 245 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 246 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 247 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 248 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 249 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 250 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 251 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 252 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 253 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 254 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 255 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 256 | impl_spi!(SPI3, APB1); | ||
| 257 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 258 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 259 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 260 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 261 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 262 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 263 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 264 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 265 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 266 | impl_spi!(SPI4, APB2); | ||
| 267 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 268 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 269 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 270 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 271 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 272 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 273 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 274 | impl_spi!(SPI5, APB2); | ||
| 275 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 276 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 277 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 278 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 279 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 280 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 281 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 282 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 283 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 284 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 285 | impl_spi!(SPI6, APB4); | ||
| 286 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 287 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 288 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 289 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 290 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 291 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 292 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 293 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 232 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 233 | pub use regs::dma_v2 as dma; | 297 | pub use regs::dma_v2 as dma; |
| 234 | pub use regs::exti_v1 as exti; | 298 | pub use regs::exti_v1 as exti; |
| 235 | pub use regs::gpio_v2 as gpio; | 299 | pub use regs::gpio_v2 as gpio; |
| 236 | pub use regs::rng_v1 as rng; | 300 | pub use regs::rng_v1 as rng; |
| 237 | pub use regs::sdmmc_v2 as sdmmc; | 301 | pub use regs::sdmmc_v2 as sdmmc; |
| 302 | pub use regs::spi_v3 as spi; | ||
| 238 | pub use regs::syscfg_h7 as syscfg; | 303 | pub use regs::syscfg_h7 as syscfg; |
| 239 | mod regs; | 304 | mod regs; |
| 240 | use embassy_extras::peripherals; | 305 | use embassy_extras::peripherals; |
| @@ -252,7 +317,7 @@ peripherals!( | |||
| 252 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 317 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, |
| 253 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 318 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, |
| 254 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 319 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, |
| 255 | PK14, PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 320 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 256 | ); | 321 | ); |
| 257 | 322 | ||
| 258 | pub mod interrupt { | 323 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h730ab.rs b/embassy-stm32/src/pac/stm32h730ab.rs index 589a1fd07..bb6a4d2cb 100644 --- a/embassy-stm32/src/pac/stm32h730ab.rs +++ b/embassy-stm32/src/pac/stm32h730ab.rs | |||
| @@ -229,12 +229,77 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 232 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 233 | impl_spi!(SPI1, APB2); | ||
| 234 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 235 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 236 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 237 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 238 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 239 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 240 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 241 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 242 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 243 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 244 | impl_spi!(SPI2, APB1); | ||
| 245 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 246 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 247 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 248 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 249 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 250 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 251 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 252 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 253 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 254 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 255 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 256 | impl_spi!(SPI3, APB1); | ||
| 257 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 258 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 259 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 260 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 261 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 262 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 263 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 264 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 265 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 266 | impl_spi!(SPI4, APB2); | ||
| 267 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 268 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 269 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 270 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 271 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 272 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 273 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 274 | impl_spi!(SPI5, APB2); | ||
| 275 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 276 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 277 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 278 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 279 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 280 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 281 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 282 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 283 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 284 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 285 | impl_spi!(SPI6, APB4); | ||
| 286 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 287 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 288 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 289 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 290 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 291 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 292 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 293 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 232 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 233 | pub use regs::dma_v2 as dma; | 297 | pub use regs::dma_v2 as dma; |
| 234 | pub use regs::exti_v1 as exti; | 298 | pub use regs::exti_v1 as exti; |
| 235 | pub use regs::gpio_v2 as gpio; | 299 | pub use regs::gpio_v2 as gpio; |
| 236 | pub use regs::rng_v1 as rng; | 300 | pub use regs::rng_v1 as rng; |
| 237 | pub use regs::sdmmc_v2 as sdmmc; | 301 | pub use regs::sdmmc_v2 as sdmmc; |
| 302 | pub use regs::spi_v3 as spi; | ||
| 238 | pub use regs::syscfg_h7 as syscfg; | 303 | pub use regs::syscfg_h7 as syscfg; |
| 239 | mod regs; | 304 | mod regs; |
| 240 | use embassy_extras::peripherals; | 305 | use embassy_extras::peripherals; |
| @@ -252,7 +317,7 @@ peripherals!( | |||
| 252 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 317 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, |
| 253 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 318 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, |
| 254 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 319 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, |
| 255 | PK14, PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 320 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 256 | ); | 321 | ); |
| 257 | 322 | ||
| 258 | pub mod interrupt { | 323 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h730ib.rs b/embassy-stm32/src/pac/stm32h730ib.rs index 589a1fd07..bb6a4d2cb 100644 --- a/embassy-stm32/src/pac/stm32h730ib.rs +++ b/embassy-stm32/src/pac/stm32h730ib.rs | |||
| @@ -229,12 +229,77 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 232 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 233 | impl_spi!(SPI1, APB2); | ||
| 234 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 235 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 236 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 237 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 238 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 239 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 240 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 241 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 242 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 243 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 244 | impl_spi!(SPI2, APB1); | ||
| 245 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 246 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 247 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 248 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 249 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 250 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 251 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 252 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 253 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 254 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 255 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 256 | impl_spi!(SPI3, APB1); | ||
| 257 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 258 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 259 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 260 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 261 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 262 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 263 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 264 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 265 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 266 | impl_spi!(SPI4, APB2); | ||
| 267 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 268 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 269 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 270 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 271 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 272 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 273 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 274 | impl_spi!(SPI5, APB2); | ||
| 275 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 276 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 277 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 278 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 279 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 280 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 281 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 282 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 283 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 284 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 285 | impl_spi!(SPI6, APB4); | ||
| 286 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 287 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 288 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 289 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 290 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 291 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 292 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 293 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 232 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 233 | pub use regs::dma_v2 as dma; | 297 | pub use regs::dma_v2 as dma; |
| 234 | pub use regs::exti_v1 as exti; | 298 | pub use regs::exti_v1 as exti; |
| 235 | pub use regs::gpio_v2 as gpio; | 299 | pub use regs::gpio_v2 as gpio; |
| 236 | pub use regs::rng_v1 as rng; | 300 | pub use regs::rng_v1 as rng; |
| 237 | pub use regs::sdmmc_v2 as sdmmc; | 301 | pub use regs::sdmmc_v2 as sdmmc; |
| 302 | pub use regs::spi_v3 as spi; | ||
| 238 | pub use regs::syscfg_h7 as syscfg; | 303 | pub use regs::syscfg_h7 as syscfg; |
| 239 | mod regs; | 304 | mod regs; |
| 240 | use embassy_extras::peripherals; | 305 | use embassy_extras::peripherals; |
| @@ -252,7 +317,7 @@ peripherals!( | |||
| 252 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 317 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, |
| 253 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 318 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, |
| 254 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 319 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, |
| 255 | PK14, PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 320 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 256 | ); | 321 | ); |
| 257 | 322 | ||
| 258 | pub mod interrupt { | 323 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h730vb.rs b/embassy-stm32/src/pac/stm32h730vb.rs index 589a1fd07..0a40d4028 100644 --- a/embassy-stm32/src/pac/stm32h730vb.rs +++ b/embassy-stm32/src/pac/stm32h730vb.rs | |||
| @@ -229,12 +229,66 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 232 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 233 | impl_spi!(SPI1, APB2); | ||
| 234 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 235 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 236 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 237 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 238 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 239 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 240 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 241 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 242 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 243 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 244 | impl_spi!(SPI2, APB1); | ||
| 245 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 246 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 247 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 248 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 249 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 250 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 251 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 252 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 253 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 254 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 255 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 256 | impl_spi!(SPI3, APB1); | ||
| 257 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 258 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 259 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 260 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 261 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 262 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 263 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 264 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 265 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 266 | impl_spi!(SPI4, APB2); | ||
| 267 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 268 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 269 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 270 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 271 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 272 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 273 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 274 | impl_spi!(SPI6, APB4); | ||
| 275 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 276 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 277 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 278 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 279 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 280 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 281 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 282 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 283 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 284 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 232 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 285 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 233 | pub use regs::dma_v2 as dma; | 286 | pub use regs::dma_v2 as dma; |
| 234 | pub use regs::exti_v1 as exti; | 287 | pub use regs::exti_v1 as exti; |
| 235 | pub use regs::gpio_v2 as gpio; | 288 | pub use regs::gpio_v2 as gpio; |
| 236 | pub use regs::rng_v1 as rng; | 289 | pub use regs::rng_v1 as rng; |
| 237 | pub use regs::sdmmc_v2 as sdmmc; | 290 | pub use regs::sdmmc_v2 as sdmmc; |
| 291 | pub use regs::spi_v3 as spi; | ||
| 238 | pub use regs::syscfg_h7 as syscfg; | 292 | pub use regs::syscfg_h7 as syscfg; |
| 239 | mod regs; | 293 | mod regs; |
| 240 | use embassy_extras::peripherals; | 294 | use embassy_extras::peripherals; |
| @@ -252,7 +306,7 @@ peripherals!( | |||
| 252 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 306 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, |
| 253 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 307 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, |
| 254 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 308 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, |
| 255 | PK14, PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 309 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG |
| 256 | ); | 310 | ); |
| 257 | 311 | ||
| 258 | pub mod interrupt { | 312 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h730zb.rs b/embassy-stm32/src/pac/stm32h730zb.rs index 589a1fd07..bb6a4d2cb 100644 --- a/embassy-stm32/src/pac/stm32h730zb.rs +++ b/embassy-stm32/src/pac/stm32h730zb.rs | |||
| @@ -229,12 +229,77 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 232 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 233 | impl_spi!(SPI1, APB2); | ||
| 234 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 235 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 236 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 237 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 238 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 239 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 240 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 241 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 242 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 243 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 244 | impl_spi!(SPI2, APB1); | ||
| 245 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 246 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 247 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 248 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 249 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 250 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 251 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 252 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 253 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 254 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 255 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 256 | impl_spi!(SPI3, APB1); | ||
| 257 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 258 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 259 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 260 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 261 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 262 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 263 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 264 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 265 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 266 | impl_spi!(SPI4, APB2); | ||
| 267 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 268 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 269 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 270 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 271 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 272 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 273 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 274 | impl_spi!(SPI5, APB2); | ||
| 275 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 276 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 277 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 278 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 279 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 280 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 281 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 282 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 283 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 284 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 285 | impl_spi!(SPI6, APB4); | ||
| 286 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 287 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 288 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 289 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 290 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 291 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 292 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 293 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 232 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 233 | pub use regs::dma_v2 as dma; | 297 | pub use regs::dma_v2 as dma; |
| 234 | pub use regs::exti_v1 as exti; | 298 | pub use regs::exti_v1 as exti; |
| 235 | pub use regs::gpio_v2 as gpio; | 299 | pub use regs::gpio_v2 as gpio; |
| 236 | pub use regs::rng_v1 as rng; | 300 | pub use regs::rng_v1 as rng; |
| 237 | pub use regs::sdmmc_v2 as sdmmc; | 301 | pub use regs::sdmmc_v2 as sdmmc; |
| 302 | pub use regs::spi_v3 as spi; | ||
| 238 | pub use regs::syscfg_h7 as syscfg; | 303 | pub use regs::syscfg_h7 as syscfg; |
| 239 | mod regs; | 304 | mod regs; |
| 240 | use embassy_extras::peripherals; | 305 | use embassy_extras::peripherals; |
| @@ -252,7 +317,7 @@ peripherals!( | |||
| 252 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 317 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, |
| 253 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 318 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, |
| 254 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 319 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, |
| 255 | PK14, PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 320 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 256 | ); | 321 | ); |
| 257 | 322 | ||
| 258 | pub mod interrupt { | 323 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h733vg.rs b/embassy-stm32/src/pac/stm32h733vg.rs index 589a1fd07..0a40d4028 100644 --- a/embassy-stm32/src/pac/stm32h733vg.rs +++ b/embassy-stm32/src/pac/stm32h733vg.rs | |||
| @@ -229,12 +229,66 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 232 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 233 | impl_spi!(SPI1, APB2); | ||
| 234 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 235 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 236 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 237 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 238 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 239 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 240 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 241 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 242 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 243 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 244 | impl_spi!(SPI2, APB1); | ||
| 245 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 246 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 247 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 248 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 249 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 250 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 251 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 252 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 253 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 254 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 255 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 256 | impl_spi!(SPI3, APB1); | ||
| 257 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 258 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 259 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 260 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 261 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 262 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 263 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 264 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 265 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 266 | impl_spi!(SPI4, APB2); | ||
| 267 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 268 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 269 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 270 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 271 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 272 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 273 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 274 | impl_spi!(SPI6, APB4); | ||
| 275 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 276 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 277 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 278 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 279 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 280 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 281 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 282 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 283 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 284 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 232 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 285 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 233 | pub use regs::dma_v2 as dma; | 286 | pub use regs::dma_v2 as dma; |
| 234 | pub use regs::exti_v1 as exti; | 287 | pub use regs::exti_v1 as exti; |
| 235 | pub use regs::gpio_v2 as gpio; | 288 | pub use regs::gpio_v2 as gpio; |
| 236 | pub use regs::rng_v1 as rng; | 289 | pub use regs::rng_v1 as rng; |
| 237 | pub use regs::sdmmc_v2 as sdmmc; | 290 | pub use regs::sdmmc_v2 as sdmmc; |
| 291 | pub use regs::spi_v3 as spi; | ||
| 238 | pub use regs::syscfg_h7 as syscfg; | 292 | pub use regs::syscfg_h7 as syscfg; |
| 239 | mod regs; | 293 | mod regs; |
| 240 | use embassy_extras::peripherals; | 294 | use embassy_extras::peripherals; |
| @@ -252,7 +306,7 @@ peripherals!( | |||
| 252 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 306 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, |
| 253 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 307 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, |
| 254 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 308 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, |
| 255 | PK14, PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 309 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG |
| 256 | ); | 310 | ); |
| 257 | 311 | ||
| 258 | pub mod interrupt { | 312 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h733zg.rs b/embassy-stm32/src/pac/stm32h733zg.rs index 589a1fd07..bb6a4d2cb 100644 --- a/embassy-stm32/src/pac/stm32h733zg.rs +++ b/embassy-stm32/src/pac/stm32h733zg.rs | |||
| @@ -229,12 +229,77 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 232 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 233 | impl_spi!(SPI1, APB2); | ||
| 234 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 235 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 236 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 237 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 238 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 239 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 240 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 241 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 242 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 243 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 244 | impl_spi!(SPI2, APB1); | ||
| 245 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 246 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 247 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 248 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 249 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 250 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 251 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 252 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 253 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 254 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 255 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 256 | impl_spi!(SPI3, APB1); | ||
| 257 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 258 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 259 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 260 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 261 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 262 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 263 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 264 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 265 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 266 | impl_spi!(SPI4, APB2); | ||
| 267 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 268 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 269 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 270 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 271 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 272 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 273 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 274 | impl_spi!(SPI5, APB2); | ||
| 275 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 276 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 277 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 278 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 279 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 280 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 281 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 282 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 283 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 284 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 285 | impl_spi!(SPI6, APB4); | ||
| 286 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 287 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 288 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 289 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 290 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 291 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 292 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 293 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 232 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 233 | pub use regs::dma_v2 as dma; | 297 | pub use regs::dma_v2 as dma; |
| 234 | pub use regs::exti_v1 as exti; | 298 | pub use regs::exti_v1 as exti; |
| 235 | pub use regs::gpio_v2 as gpio; | 299 | pub use regs::gpio_v2 as gpio; |
| 236 | pub use regs::rng_v1 as rng; | 300 | pub use regs::rng_v1 as rng; |
| 237 | pub use regs::sdmmc_v2 as sdmmc; | 301 | pub use regs::sdmmc_v2 as sdmmc; |
| 302 | pub use regs::spi_v3 as spi; | ||
| 238 | pub use regs::syscfg_h7 as syscfg; | 303 | pub use regs::syscfg_h7 as syscfg; |
| 239 | mod regs; | 304 | mod regs; |
| 240 | use embassy_extras::peripherals; | 305 | use embassy_extras::peripherals; |
| @@ -252,7 +317,7 @@ peripherals!( | |||
| 252 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 317 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, |
| 253 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 318 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, |
| 254 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 319 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, |
| 255 | PK14, PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 320 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 256 | ); | 321 | ); |
| 257 | 322 | ||
| 258 | pub mod interrupt { | 323 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h735ag.rs b/embassy-stm32/src/pac/stm32h735ag.rs index 589a1fd07..bb6a4d2cb 100644 --- a/embassy-stm32/src/pac/stm32h735ag.rs +++ b/embassy-stm32/src/pac/stm32h735ag.rs | |||
| @@ -229,12 +229,77 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 232 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 233 | impl_spi!(SPI1, APB2); | ||
| 234 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 235 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 236 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 237 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 238 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 239 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 240 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 241 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 242 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 243 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 244 | impl_spi!(SPI2, APB1); | ||
| 245 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 246 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 247 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 248 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 249 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 250 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 251 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 252 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 253 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 254 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 255 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 256 | impl_spi!(SPI3, APB1); | ||
| 257 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 258 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 259 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 260 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 261 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 262 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 263 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 264 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 265 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 266 | impl_spi!(SPI4, APB2); | ||
| 267 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 268 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 269 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 270 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 271 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 272 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 273 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 274 | impl_spi!(SPI5, APB2); | ||
| 275 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 276 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 277 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 278 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 279 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 280 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 281 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 282 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 283 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 284 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 285 | impl_spi!(SPI6, APB4); | ||
| 286 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 287 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 288 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 289 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 290 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 291 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 292 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 293 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 232 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 233 | pub use regs::dma_v2 as dma; | 297 | pub use regs::dma_v2 as dma; |
| 234 | pub use regs::exti_v1 as exti; | 298 | pub use regs::exti_v1 as exti; |
| 235 | pub use regs::gpio_v2 as gpio; | 299 | pub use regs::gpio_v2 as gpio; |
| 236 | pub use regs::rng_v1 as rng; | 300 | pub use regs::rng_v1 as rng; |
| 237 | pub use regs::sdmmc_v2 as sdmmc; | 301 | pub use regs::sdmmc_v2 as sdmmc; |
| 302 | pub use regs::spi_v3 as spi; | ||
| 238 | pub use regs::syscfg_h7 as syscfg; | 303 | pub use regs::syscfg_h7 as syscfg; |
| 239 | mod regs; | 304 | mod regs; |
| 240 | use embassy_extras::peripherals; | 305 | use embassy_extras::peripherals; |
| @@ -252,7 +317,7 @@ peripherals!( | |||
| 252 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 317 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, |
| 253 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 318 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, |
| 254 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 319 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, |
| 255 | PK14, PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 320 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 256 | ); | 321 | ); |
| 257 | 322 | ||
| 258 | pub mod interrupt { | 323 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h735ig.rs b/embassy-stm32/src/pac/stm32h735ig.rs index 589a1fd07..bb6a4d2cb 100644 --- a/embassy-stm32/src/pac/stm32h735ig.rs +++ b/embassy-stm32/src/pac/stm32h735ig.rs | |||
| @@ -229,12 +229,77 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 232 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 233 | impl_spi!(SPI1, APB2); | ||
| 234 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 235 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 236 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 237 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 238 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 239 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 240 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 241 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 242 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 243 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 244 | impl_spi!(SPI2, APB1); | ||
| 245 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 246 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 247 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 248 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 249 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 250 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 251 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 252 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 253 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 254 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 255 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 256 | impl_spi!(SPI3, APB1); | ||
| 257 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 258 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 259 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 260 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 261 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 262 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 263 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 264 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 265 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 266 | impl_spi!(SPI4, APB2); | ||
| 267 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 268 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 269 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 270 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 271 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 272 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 273 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 274 | impl_spi!(SPI5, APB2); | ||
| 275 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 276 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 277 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 278 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 279 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 280 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 281 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 282 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 283 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 284 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 285 | impl_spi!(SPI6, APB4); | ||
| 286 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 287 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 288 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 289 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 290 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 291 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 292 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 293 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 232 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 233 | pub use regs::dma_v2 as dma; | 297 | pub use regs::dma_v2 as dma; |
| 234 | pub use regs::exti_v1 as exti; | 298 | pub use regs::exti_v1 as exti; |
| 235 | pub use regs::gpio_v2 as gpio; | 299 | pub use regs::gpio_v2 as gpio; |
| 236 | pub use regs::rng_v1 as rng; | 300 | pub use regs::rng_v1 as rng; |
| 237 | pub use regs::sdmmc_v2 as sdmmc; | 301 | pub use regs::sdmmc_v2 as sdmmc; |
| 302 | pub use regs::spi_v3 as spi; | ||
| 238 | pub use regs::syscfg_h7 as syscfg; | 303 | pub use regs::syscfg_h7 as syscfg; |
| 239 | mod regs; | 304 | mod regs; |
| 240 | use embassy_extras::peripherals; | 305 | use embassy_extras::peripherals; |
| @@ -252,7 +317,7 @@ peripherals!( | |||
| 252 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 317 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, |
| 253 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 318 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, |
| 254 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 319 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, |
| 255 | PK14, PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 320 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 256 | ); | 321 | ); |
| 257 | 322 | ||
| 258 | pub mod interrupt { | 323 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h735rg.rs b/embassy-stm32/src/pac/stm32h735rg.rs index 589a1fd07..d522fba17 100644 --- a/embassy-stm32/src/pac/stm32h735rg.rs +++ b/embassy-stm32/src/pac/stm32h735rg.rs | |||
| @@ -229,12 +229,58 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 232 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 233 | impl_spi!(SPI1, APB2); | ||
| 234 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 235 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 236 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 237 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 238 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 239 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 240 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 241 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 242 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 243 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 244 | impl_spi!(SPI2, APB1); | ||
| 245 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 246 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 247 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 248 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 249 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 250 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 251 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 252 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 253 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 254 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 255 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 256 | impl_spi!(SPI3, APB1); | ||
| 257 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 258 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 259 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 260 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 261 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 262 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 263 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 264 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 265 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 266 | impl_spi!(SPI6, APB4); | ||
| 267 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 268 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 269 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 270 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 271 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 272 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 273 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 274 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 275 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 276 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 232 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 277 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 233 | pub use regs::dma_v2 as dma; | 278 | pub use regs::dma_v2 as dma; |
| 234 | pub use regs::exti_v1 as exti; | 279 | pub use regs::exti_v1 as exti; |
| 235 | pub use regs::gpio_v2 as gpio; | 280 | pub use regs::gpio_v2 as gpio; |
| 236 | pub use regs::rng_v1 as rng; | 281 | pub use regs::rng_v1 as rng; |
| 237 | pub use regs::sdmmc_v2 as sdmmc; | 282 | pub use regs::sdmmc_v2 as sdmmc; |
| 283 | pub use regs::spi_v3 as spi; | ||
| 238 | pub use regs::syscfg_h7 as syscfg; | 284 | pub use regs::syscfg_h7 as syscfg; |
| 239 | mod regs; | 285 | mod regs; |
| 240 | use embassy_extras::peripherals; | 286 | use embassy_extras::peripherals; |
| @@ -252,7 +298,7 @@ peripherals!( | |||
| 252 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 298 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, |
| 253 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 299 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, |
| 254 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 300 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, |
| 255 | PK14, PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 301 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI6, SYSCFG |
| 256 | ); | 302 | ); |
| 257 | 303 | ||
| 258 | pub mod interrupt { | 304 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h735vg.rs b/embassy-stm32/src/pac/stm32h735vg.rs index 589a1fd07..0a40d4028 100644 --- a/embassy-stm32/src/pac/stm32h735vg.rs +++ b/embassy-stm32/src/pac/stm32h735vg.rs | |||
| @@ -229,12 +229,66 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 232 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 233 | impl_spi!(SPI1, APB2); | ||
| 234 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 235 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 236 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 237 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 238 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 239 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 240 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 241 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 242 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 243 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 244 | impl_spi!(SPI2, APB1); | ||
| 245 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 246 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 247 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 248 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 249 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 250 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 251 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 252 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 253 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 254 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 255 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 256 | impl_spi!(SPI3, APB1); | ||
| 257 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 258 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 259 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 260 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 261 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 262 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 263 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 264 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 265 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 266 | impl_spi!(SPI4, APB2); | ||
| 267 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 268 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 269 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 270 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 271 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 272 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 273 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 274 | impl_spi!(SPI6, APB4); | ||
| 275 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 276 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 277 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 278 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 279 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 280 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 281 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 282 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 283 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 284 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 232 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 285 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 233 | pub use regs::dma_v2 as dma; | 286 | pub use regs::dma_v2 as dma; |
| 234 | pub use regs::exti_v1 as exti; | 287 | pub use regs::exti_v1 as exti; |
| 235 | pub use regs::gpio_v2 as gpio; | 288 | pub use regs::gpio_v2 as gpio; |
| 236 | pub use regs::rng_v1 as rng; | 289 | pub use regs::rng_v1 as rng; |
| 237 | pub use regs::sdmmc_v2 as sdmmc; | 290 | pub use regs::sdmmc_v2 as sdmmc; |
| 291 | pub use regs::spi_v3 as spi; | ||
| 238 | pub use regs::syscfg_h7 as syscfg; | 292 | pub use regs::syscfg_h7 as syscfg; |
| 239 | mod regs; | 293 | mod regs; |
| 240 | use embassy_extras::peripherals; | 294 | use embassy_extras::peripherals; |
| @@ -252,7 +306,7 @@ peripherals!( | |||
| 252 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 306 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, |
| 253 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 307 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, |
| 254 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 308 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, |
| 255 | PK14, PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 309 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG |
| 256 | ); | 310 | ); |
| 257 | 311 | ||
| 258 | pub mod interrupt { | 312 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h735zg.rs b/embassy-stm32/src/pac/stm32h735zg.rs index 589a1fd07..bb6a4d2cb 100644 --- a/embassy-stm32/src/pac/stm32h735zg.rs +++ b/embassy-stm32/src/pac/stm32h735zg.rs | |||
| @@ -229,12 +229,77 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 229 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 230 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 231 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 232 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 233 | impl_spi!(SPI1, APB2); | ||
| 234 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 235 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 236 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 237 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 238 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 239 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 240 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 241 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 242 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 243 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 244 | impl_spi!(SPI2, APB1); | ||
| 245 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 246 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 247 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 248 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 249 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 250 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 251 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 252 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 253 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 254 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 255 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 256 | impl_spi!(SPI3, APB1); | ||
| 257 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 258 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 259 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 260 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 261 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 262 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 263 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 264 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 265 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 266 | impl_spi!(SPI4, APB2); | ||
| 267 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 268 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 269 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 270 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 271 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 272 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 273 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 274 | impl_spi!(SPI5, APB2); | ||
| 275 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 276 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 277 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 278 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 279 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 280 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 281 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 282 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 283 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 284 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 285 | impl_spi!(SPI6, APB4); | ||
| 286 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 287 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 288 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 289 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 290 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 291 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 292 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 293 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 232 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 233 | pub use regs::dma_v2 as dma; | 297 | pub use regs::dma_v2 as dma; |
| 234 | pub use regs::exti_v1 as exti; | 298 | pub use regs::exti_v1 as exti; |
| 235 | pub use regs::gpio_v2 as gpio; | 299 | pub use regs::gpio_v2 as gpio; |
| 236 | pub use regs::rng_v1 as rng; | 300 | pub use regs::rng_v1 as rng; |
| 237 | pub use regs::sdmmc_v2 as sdmmc; | 301 | pub use regs::sdmmc_v2 as sdmmc; |
| 302 | pub use regs::spi_v3 as spi; | ||
| 238 | pub use regs::syscfg_h7 as syscfg; | 303 | pub use regs::syscfg_h7 as syscfg; |
| 239 | mod regs; | 304 | mod regs; |
| 240 | use embassy_extras::peripherals; | 305 | use embassy_extras::peripherals; |
| @@ -252,7 +317,7 @@ peripherals!( | |||
| 252 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 317 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, |
| 253 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 318 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, |
| 254 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 319 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, |
| 255 | PK14, PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 320 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 256 | ); | 321 | ); |
| 257 | 322 | ||
| 258 | pub mod interrupt { | 323 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h742ag.rs b/embassy-stm32/src/pac/stm32h742ag.rs index 6277a595f..f676ff8e3 100644 --- a/embassy-stm32/src/pac/stm32h742ag.rs +++ b/embassy-stm32/src/pac/stm32h742ag.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h742ai.rs b/embassy-stm32/src/pac/stm32h742ai.rs index 6277a595f..f676ff8e3 100644 --- a/embassy-stm32/src/pac/stm32h742ai.rs +++ b/embassy-stm32/src/pac/stm32h742ai.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h742bg.rs b/embassy-stm32/src/pac/stm32h742bg.rs index 6277a595f..f676ff8e3 100644 --- a/embassy-stm32/src/pac/stm32h742bg.rs +++ b/embassy-stm32/src/pac/stm32h742bg.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h742bi.rs b/embassy-stm32/src/pac/stm32h742bi.rs index 6277a595f..f676ff8e3 100644 --- a/embassy-stm32/src/pac/stm32h742bi.rs +++ b/embassy-stm32/src/pac/stm32h742bi.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h742ig.rs b/embassy-stm32/src/pac/stm32h742ig.rs index 6277a595f..f676ff8e3 100644 --- a/embassy-stm32/src/pac/stm32h742ig.rs +++ b/embassy-stm32/src/pac/stm32h742ig.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h742ii.rs b/embassy-stm32/src/pac/stm32h742ii.rs index 6277a595f..f676ff8e3 100644 --- a/embassy-stm32/src/pac/stm32h742ii.rs +++ b/embassy-stm32/src/pac/stm32h742ii.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h742vg.rs b/embassy-stm32/src/pac/stm32h742vg.rs index 6277a595f..79e11dda0 100644 --- a/embassy-stm32/src/pac/stm32h742vg.rs +++ b/embassy-stm32/src/pac/stm32h742vg.rs | |||
| @@ -239,12 +239,58 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 287 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 288 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 289 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 290 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 291 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 292 | pub use regs::sdmmc_v2 as sdmmc; |
| 293 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 294 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 295 | mod regs; |
| 250 | use embassy_extras::peripherals; | 296 | use embassy_extras::peripherals; |
| @@ -263,7 +309,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 309 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 310 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 311 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 312 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG |
| 267 | ); | 313 | ); |
| 268 | 314 | ||
| 269 | pub mod interrupt { | 315 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h742vi.rs b/embassy-stm32/src/pac/stm32h742vi.rs index 6277a595f..79e11dda0 100644 --- a/embassy-stm32/src/pac/stm32h742vi.rs +++ b/embassy-stm32/src/pac/stm32h742vi.rs | |||
| @@ -239,12 +239,58 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 287 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 288 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 289 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 290 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 291 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 292 | pub use regs::sdmmc_v2 as sdmmc; |
| 293 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 294 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 295 | mod regs; |
| 250 | use embassy_extras::peripherals; | 296 | use embassy_extras::peripherals; |
| @@ -263,7 +309,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 309 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 310 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 311 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 312 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG |
| 267 | ); | 313 | ); |
| 268 | 314 | ||
| 269 | pub mod interrupt { | 315 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h742xg.rs b/embassy-stm32/src/pac/stm32h742xg.rs index 6277a595f..f676ff8e3 100644 --- a/embassy-stm32/src/pac/stm32h742xg.rs +++ b/embassy-stm32/src/pac/stm32h742xg.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h742xi.rs b/embassy-stm32/src/pac/stm32h742xi.rs index 6277a595f..f676ff8e3 100644 --- a/embassy-stm32/src/pac/stm32h742xi.rs +++ b/embassy-stm32/src/pac/stm32h742xi.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h742zg.rs b/embassy-stm32/src/pac/stm32h742zg.rs index 6277a595f..f676ff8e3 100644 --- a/embassy-stm32/src/pac/stm32h742zg.rs +++ b/embassy-stm32/src/pac/stm32h742zg.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h742zi.rs b/embassy-stm32/src/pac/stm32h742zi.rs index 6277a595f..f676ff8e3 100644 --- a/embassy-stm32/src/pac/stm32h742zi.rs +++ b/embassy-stm32/src/pac/stm32h742zi.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h743ag.rs b/embassy-stm32/src/pac/stm32h743ag.rs index 47e811b48..38061bdb4 100644 --- a/embassy-stm32/src/pac/stm32h743ag.rs +++ b/embassy-stm32/src/pac/stm32h743ag.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h743ai.rs b/embassy-stm32/src/pac/stm32h743ai.rs index 47e811b48..38061bdb4 100644 --- a/embassy-stm32/src/pac/stm32h743ai.rs +++ b/embassy-stm32/src/pac/stm32h743ai.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h743bg.rs b/embassy-stm32/src/pac/stm32h743bg.rs index 47e811b48..38061bdb4 100644 --- a/embassy-stm32/src/pac/stm32h743bg.rs +++ b/embassy-stm32/src/pac/stm32h743bg.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h743bi.rs b/embassy-stm32/src/pac/stm32h743bi.rs index 47e811b48..38061bdb4 100644 --- a/embassy-stm32/src/pac/stm32h743bi.rs +++ b/embassy-stm32/src/pac/stm32h743bi.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h743ig.rs b/embassy-stm32/src/pac/stm32h743ig.rs index 47e811b48..38061bdb4 100644 --- a/embassy-stm32/src/pac/stm32h743ig.rs +++ b/embassy-stm32/src/pac/stm32h743ig.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h743ii.rs b/embassy-stm32/src/pac/stm32h743ii.rs index 47e811b48..38061bdb4 100644 --- a/embassy-stm32/src/pac/stm32h743ii.rs +++ b/embassy-stm32/src/pac/stm32h743ii.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h743vg.rs b/embassy-stm32/src/pac/stm32h743vg.rs index 47e811b48..b5a5698b0 100644 --- a/embassy-stm32/src/pac/stm32h743vg.rs +++ b/embassy-stm32/src/pac/stm32h743vg.rs | |||
| @@ -239,12 +239,58 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 287 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 288 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 289 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 290 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 291 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 292 | pub use regs::sdmmc_v2 as sdmmc; |
| 293 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 294 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 295 | mod regs; |
| 250 | use embassy_extras::peripherals; | 296 | use embassy_extras::peripherals; |
| @@ -263,7 +309,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 309 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 310 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 311 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 312 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG |
| 267 | ); | 313 | ); |
| 268 | 314 | ||
| 269 | pub mod interrupt { | 315 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h743vi.rs b/embassy-stm32/src/pac/stm32h743vi.rs index 47e811b48..b5a5698b0 100644 --- a/embassy-stm32/src/pac/stm32h743vi.rs +++ b/embassy-stm32/src/pac/stm32h743vi.rs | |||
| @@ -239,12 +239,58 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 287 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 288 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 289 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 290 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 291 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 292 | pub use regs::sdmmc_v2 as sdmmc; |
| 293 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 294 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 295 | mod regs; |
| 250 | use embassy_extras::peripherals; | 296 | use embassy_extras::peripherals; |
| @@ -263,7 +309,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 309 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 310 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 311 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 312 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG |
| 267 | ); | 313 | ); |
| 268 | 314 | ||
| 269 | pub mod interrupt { | 315 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h743xg.rs b/embassy-stm32/src/pac/stm32h743xg.rs index 47e811b48..38061bdb4 100644 --- a/embassy-stm32/src/pac/stm32h743xg.rs +++ b/embassy-stm32/src/pac/stm32h743xg.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h743xi.rs b/embassy-stm32/src/pac/stm32h743xi.rs index 47e811b48..38061bdb4 100644 --- a/embassy-stm32/src/pac/stm32h743xi.rs +++ b/embassy-stm32/src/pac/stm32h743xi.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h743zg.rs b/embassy-stm32/src/pac/stm32h743zg.rs index 47e811b48..38061bdb4 100644 --- a/embassy-stm32/src/pac/stm32h743zg.rs +++ b/embassy-stm32/src/pac/stm32h743zg.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h743zi.rs b/embassy-stm32/src/pac/stm32h743zi.rs index 47e811b48..38061bdb4 100644 --- a/embassy-stm32/src/pac/stm32h743zi.rs +++ b/embassy-stm32/src/pac/stm32h743zi.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h745bg.rs b/embassy-stm32/src/pac/stm32h745bg.rs index 3a92848f5..e21307b22 100644 --- a/embassy-stm32/src/pac/stm32h745bg.rs +++ b/embassy-stm32/src/pac/stm32h745bg.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h745bi.rs b/embassy-stm32/src/pac/stm32h745bi.rs index 3a92848f5..e21307b22 100644 --- a/embassy-stm32/src/pac/stm32h745bi.rs +++ b/embassy-stm32/src/pac/stm32h745bi.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h745ig.rs b/embassy-stm32/src/pac/stm32h745ig.rs index 3a92848f5..e21307b22 100644 --- a/embassy-stm32/src/pac/stm32h745ig.rs +++ b/embassy-stm32/src/pac/stm32h745ig.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h745ii.rs b/embassy-stm32/src/pac/stm32h745ii.rs index 3a92848f5..e21307b22 100644 --- a/embassy-stm32/src/pac/stm32h745ii.rs +++ b/embassy-stm32/src/pac/stm32h745ii.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h745xg.rs b/embassy-stm32/src/pac/stm32h745xg.rs index 3a92848f5..e21307b22 100644 --- a/embassy-stm32/src/pac/stm32h745xg.rs +++ b/embassy-stm32/src/pac/stm32h745xg.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h745xi.rs b/embassy-stm32/src/pac/stm32h745xi.rs index 3a92848f5..e21307b22 100644 --- a/embassy-stm32/src/pac/stm32h745xi.rs +++ b/embassy-stm32/src/pac/stm32h745xi.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h745zg.rs b/embassy-stm32/src/pac/stm32h745zg.rs index 3a92848f5..e21307b22 100644 --- a/embassy-stm32/src/pac/stm32h745zg.rs +++ b/embassy-stm32/src/pac/stm32h745zg.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h745zi.rs b/embassy-stm32/src/pac/stm32h745zi.rs index 3a92848f5..e21307b22 100644 --- a/embassy-stm32/src/pac/stm32h745zi.rs +++ b/embassy-stm32/src/pac/stm32h745zi.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h747ag.rs b/embassy-stm32/src/pac/stm32h747ag.rs index ade3d41dd..ca37684de 100644 --- a/embassy-stm32/src/pac/stm32h747ag.rs +++ b/embassy-stm32/src/pac/stm32h747ag.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h747ai.rs b/embassy-stm32/src/pac/stm32h747ai.rs index ade3d41dd..ca37684de 100644 --- a/embassy-stm32/src/pac/stm32h747ai.rs +++ b/embassy-stm32/src/pac/stm32h747ai.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h747bg.rs b/embassy-stm32/src/pac/stm32h747bg.rs index ade3d41dd..ca37684de 100644 --- a/embassy-stm32/src/pac/stm32h747bg.rs +++ b/embassy-stm32/src/pac/stm32h747bg.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h747bi.rs b/embassy-stm32/src/pac/stm32h747bi.rs index ade3d41dd..ca37684de 100644 --- a/embassy-stm32/src/pac/stm32h747bi.rs +++ b/embassy-stm32/src/pac/stm32h747bi.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h747ig.rs b/embassy-stm32/src/pac/stm32h747ig.rs index ade3d41dd..ca37684de 100644 --- a/embassy-stm32/src/pac/stm32h747ig.rs +++ b/embassy-stm32/src/pac/stm32h747ig.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h747ii.rs b/embassy-stm32/src/pac/stm32h747ii.rs index ade3d41dd..ca37684de 100644 --- a/embassy-stm32/src/pac/stm32h747ii.rs +++ b/embassy-stm32/src/pac/stm32h747ii.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h747xg.rs b/embassy-stm32/src/pac/stm32h747xg.rs index ade3d41dd..ca37684de 100644 --- a/embassy-stm32/src/pac/stm32h747xg.rs +++ b/embassy-stm32/src/pac/stm32h747xg.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h747xi.rs b/embassy-stm32/src/pac/stm32h747xi.rs index ade3d41dd..ca37684de 100644 --- a/embassy-stm32/src/pac/stm32h747xi.rs +++ b/embassy-stm32/src/pac/stm32h747xi.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h747zi.rs b/embassy-stm32/src/pac/stm32h747zi.rs index ade3d41dd..3dbb88f18 100644 --- a/embassy-stm32/src/pac/stm32h747zi.rs +++ b/embassy-stm32/src/pac/stm32h747zi.rs | |||
| @@ -239,12 +239,58 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 287 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 288 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 289 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 290 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 291 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 292 | pub use regs::sdmmc_v2 as sdmmc; |
| 293 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 294 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 295 | mod regs; |
| 250 | use embassy_extras::peripherals; | 296 | use embassy_extras::peripherals; |
| @@ -263,7 +309,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 309 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 310 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 311 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 312 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG |
| 267 | ); | 313 | ); |
| 268 | 314 | ||
| 269 | pub mod interrupt { | 315 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h750ib.rs b/embassy-stm32/src/pac/stm32h750ib.rs index cfaf3608c..3e60f9bf6 100644 --- a/embassy-stm32/src/pac/stm32h750ib.rs +++ b/embassy-stm32/src/pac/stm32h750ib.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h750vb.rs b/embassy-stm32/src/pac/stm32h750vb.rs index cfaf3608c..4ed7e06b8 100644 --- a/embassy-stm32/src/pac/stm32h750vb.rs +++ b/embassy-stm32/src/pac/stm32h750vb.rs | |||
| @@ -239,12 +239,58 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 287 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 288 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 289 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 290 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 291 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 292 | pub use regs::sdmmc_v2 as sdmmc; |
| 293 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 294 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 295 | mod regs; |
| 250 | use embassy_extras::peripherals; | 296 | use embassy_extras::peripherals; |
| @@ -263,7 +309,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 309 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 310 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 311 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 312 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG |
| 267 | ); | 313 | ); |
| 268 | 314 | ||
| 269 | pub mod interrupt { | 315 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h750xb.rs b/embassy-stm32/src/pac/stm32h750xb.rs index cfaf3608c..3e60f9bf6 100644 --- a/embassy-stm32/src/pac/stm32h750xb.rs +++ b/embassy-stm32/src/pac/stm32h750xb.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h750zb.rs b/embassy-stm32/src/pac/stm32h750zb.rs index cfaf3608c..3e60f9bf6 100644 --- a/embassy-stm32/src/pac/stm32h750zb.rs +++ b/embassy-stm32/src/pac/stm32h750zb.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h753ai.rs b/embassy-stm32/src/pac/stm32h753ai.rs index cfaf3608c..3e60f9bf6 100644 --- a/embassy-stm32/src/pac/stm32h753ai.rs +++ b/embassy-stm32/src/pac/stm32h753ai.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h753bi.rs b/embassy-stm32/src/pac/stm32h753bi.rs index cfaf3608c..3e60f9bf6 100644 --- a/embassy-stm32/src/pac/stm32h753bi.rs +++ b/embassy-stm32/src/pac/stm32h753bi.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h753ii.rs b/embassy-stm32/src/pac/stm32h753ii.rs index cfaf3608c..3e60f9bf6 100644 --- a/embassy-stm32/src/pac/stm32h753ii.rs +++ b/embassy-stm32/src/pac/stm32h753ii.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h753vi.rs b/embassy-stm32/src/pac/stm32h753vi.rs index cfaf3608c..4ed7e06b8 100644 --- a/embassy-stm32/src/pac/stm32h753vi.rs +++ b/embassy-stm32/src/pac/stm32h753vi.rs | |||
| @@ -239,12 +239,58 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 287 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 288 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 289 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 290 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 291 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 292 | pub use regs::sdmmc_v2 as sdmmc; |
| 293 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 294 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 295 | mod regs; |
| 250 | use embassy_extras::peripherals; | 296 | use embassy_extras::peripherals; |
| @@ -263,7 +309,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 309 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 310 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 311 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 312 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG |
| 267 | ); | 313 | ); |
| 268 | 314 | ||
| 269 | pub mod interrupt { | 315 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h753xi.rs b/embassy-stm32/src/pac/stm32h753xi.rs index cfaf3608c..3e60f9bf6 100644 --- a/embassy-stm32/src/pac/stm32h753xi.rs +++ b/embassy-stm32/src/pac/stm32h753xi.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h753zi.rs b/embassy-stm32/src/pac/stm32h753zi.rs index cfaf3608c..3e60f9bf6 100644 --- a/embassy-stm32/src/pac/stm32h753zi.rs +++ b/embassy-stm32/src/pac/stm32h753zi.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h755bi.rs b/embassy-stm32/src/pac/stm32h755bi.rs index 673440d22..8141aa290 100644 --- a/embassy-stm32/src/pac/stm32h755bi.rs +++ b/embassy-stm32/src/pac/stm32h755bi.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h755ii.rs b/embassy-stm32/src/pac/stm32h755ii.rs index 673440d22..8141aa290 100644 --- a/embassy-stm32/src/pac/stm32h755ii.rs +++ b/embassy-stm32/src/pac/stm32h755ii.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h755xi.rs b/embassy-stm32/src/pac/stm32h755xi.rs index 673440d22..8141aa290 100644 --- a/embassy-stm32/src/pac/stm32h755xi.rs +++ b/embassy-stm32/src/pac/stm32h755xi.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h755zi.rs b/embassy-stm32/src/pac/stm32h755zi.rs index 673440d22..8141aa290 100644 --- a/embassy-stm32/src/pac/stm32h755zi.rs +++ b/embassy-stm32/src/pac/stm32h755zi.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h757ai.rs b/embassy-stm32/src/pac/stm32h757ai.rs index 66057ae06..bc78a72f4 100644 --- a/embassy-stm32/src/pac/stm32h757ai.rs +++ b/embassy-stm32/src/pac/stm32h757ai.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h757bi.rs b/embassy-stm32/src/pac/stm32h757bi.rs index 66057ae06..bc78a72f4 100644 --- a/embassy-stm32/src/pac/stm32h757bi.rs +++ b/embassy-stm32/src/pac/stm32h757bi.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h757ii.rs b/embassy-stm32/src/pac/stm32h757ii.rs index 66057ae06..bc78a72f4 100644 --- a/embassy-stm32/src/pac/stm32h757ii.rs +++ b/embassy-stm32/src/pac/stm32h757ii.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h757xi.rs b/embassy-stm32/src/pac/stm32h757xi.rs index 66057ae06..bc78a72f4 100644 --- a/embassy-stm32/src/pac/stm32h757xi.rs +++ b/embassy-stm32/src/pac/stm32h757xi.rs | |||
| @@ -239,12 +239,69 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 287 | impl_spi!(SPI5, APB2); | ||
| 288 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 289 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 290 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 291 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 292 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 293 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 294 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 295 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 299 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 300 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 301 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 302 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 303 | pub use regs::sdmmc_v2 as sdmmc; |
| 304 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 305 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 306 | mod regs; |
| 250 | use embassy_extras::peripherals; | 307 | use embassy_extras::peripherals; |
| @@ -263,7 +320,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 320 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 321 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 322 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 323 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 267 | ); | 324 | ); |
| 268 | 325 | ||
| 269 | pub mod interrupt { | 326 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h757zi.rs b/embassy-stm32/src/pac/stm32h757zi.rs index 66057ae06..9eed14029 100644 --- a/embassy-stm32/src/pac/stm32h757zi.rs +++ b/embassy-stm32/src/pac/stm32h757zi.rs | |||
| @@ -239,12 +239,58 @@ impl_sdmmc_pin!(SDMMC2, D7Pin, PC7, 10); | |||
| 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); | 239 | impl_sdmmc_pin!(SDMMC2, CkPin, PD6, 11); |
| 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); | 240 | impl_sdmmc_pin!(SDMMC2, CmdPin, PD7, 11); |
| 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); | 241 | impl_sdmmc_pin!(SDMMC2, D2Pin, PG11, 10); |
| 242 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 243 | impl_spi!(SPI1, APB2); | ||
| 244 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 245 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 246 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 247 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 248 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 249 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 250 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 253 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 254 | impl_spi!(SPI2, APB1); | ||
| 255 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 256 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 257 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 258 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 259 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 260 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 261 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 262 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 263 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 268 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 269 | impl_spi!(SPI3, APB1); | ||
| 270 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 271 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 272 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 273 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 274 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 275 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 276 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 278 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 279 | impl_spi!(SPI4, APB2); | ||
| 280 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 281 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 282 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 283 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 284 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 286 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 242 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 287 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 243 | pub use regs::dma_v2 as dma; | 288 | pub use regs::dma_v2 as dma; |
| 244 | pub use regs::exti_v1 as exti; | 289 | pub use regs::exti_v1 as exti; |
| 245 | pub use regs::gpio_v2 as gpio; | 290 | pub use regs::gpio_v2 as gpio; |
| 246 | pub use regs::rng_v1 as rng; | 291 | pub use regs::rng_v1 as rng; |
| 247 | pub use regs::sdmmc_v2 as sdmmc; | 292 | pub use regs::sdmmc_v2 as sdmmc; |
| 293 | pub use regs::spi_v3 as spi; | ||
| 248 | pub use regs::syscfg_h7 as syscfg; | 294 | pub use regs::syscfg_h7 as syscfg; |
| 249 | mod regs; | 295 | mod regs; |
| 250 | use embassy_extras::peripherals; | 296 | use embassy_extras::peripherals; |
| @@ -263,7 +309,7 @@ peripherals!( | |||
| 263 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 309 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 264 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 310 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 265 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 311 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 266 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 312 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG |
| 267 | ); | 313 | ); |
| 268 | 314 | ||
| 269 | pub mod interrupt { | 315 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7a3ag.rs b/embassy-stm32/src/pac/stm32h7a3ag.rs index cc3b10a98..1f31a5da6 100644 --- a/embassy-stm32/src/pac/stm32h7a3ag.rs +++ b/embassy-stm32/src/pac/stm32h7a3ag.rs | |||
| @@ -246,12 +246,80 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 286 | impl_spi!(SPI4, APB2); | ||
| 287 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 288 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 289 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 290 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 291 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 292 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 293 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 294 | impl_spi!(SPI5, APB2); | ||
| 295 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 297 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 298 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 299 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 300 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 301 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 302 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 303 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 304 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 305 | impl_spi!(SPI6, APB4); | ||
| 306 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 307 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 308 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 309 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 310 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 311 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 312 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 313 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 317 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 318 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 319 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 320 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 321 | pub use regs::sdmmc_v2 as sdmmc; |
| 322 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 323 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 324 | mod regs; |
| 257 | use embassy_extras::peripherals; | 325 | use embassy_extras::peripherals; |
| @@ -270,7 +338,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 338 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 339 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 340 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 341 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 274 | ); | 342 | ); |
| 275 | 343 | ||
| 276 | pub mod interrupt { | 344 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7a3ai.rs b/embassy-stm32/src/pac/stm32h7a3ai.rs index cc3b10a98..1f31a5da6 100644 --- a/embassy-stm32/src/pac/stm32h7a3ai.rs +++ b/embassy-stm32/src/pac/stm32h7a3ai.rs | |||
| @@ -246,12 +246,80 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 286 | impl_spi!(SPI4, APB2); | ||
| 287 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 288 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 289 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 290 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 291 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 292 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 293 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 294 | impl_spi!(SPI5, APB2); | ||
| 295 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 297 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 298 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 299 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 300 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 301 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 302 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 303 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 304 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 305 | impl_spi!(SPI6, APB4); | ||
| 306 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 307 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 308 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 309 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 310 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 311 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 312 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 313 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 317 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 318 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 319 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 320 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 321 | pub use regs::sdmmc_v2 as sdmmc; |
| 322 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 323 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 324 | mod regs; |
| 257 | use embassy_extras::peripherals; | 325 | use embassy_extras::peripherals; |
| @@ -270,7 +338,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 338 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 339 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 340 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 341 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 274 | ); | 342 | ); |
| 275 | 343 | ||
| 276 | pub mod interrupt { | 344 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7a3ig.rs b/embassy-stm32/src/pac/stm32h7a3ig.rs index cc3b10a98..1f31a5da6 100644 --- a/embassy-stm32/src/pac/stm32h7a3ig.rs +++ b/embassy-stm32/src/pac/stm32h7a3ig.rs | |||
| @@ -246,12 +246,80 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 286 | impl_spi!(SPI4, APB2); | ||
| 287 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 288 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 289 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 290 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 291 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 292 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 293 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 294 | impl_spi!(SPI5, APB2); | ||
| 295 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 297 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 298 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 299 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 300 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 301 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 302 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 303 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 304 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 305 | impl_spi!(SPI6, APB4); | ||
| 306 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 307 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 308 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 309 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 310 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 311 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 312 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 313 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 317 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 318 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 319 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 320 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 321 | pub use regs::sdmmc_v2 as sdmmc; |
| 322 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 323 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 324 | mod regs; |
| 257 | use embassy_extras::peripherals; | 325 | use embassy_extras::peripherals; |
| @@ -270,7 +338,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 338 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 339 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 340 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 341 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 274 | ); | 342 | ); |
| 275 | 343 | ||
| 276 | pub mod interrupt { | 344 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7a3ii.rs b/embassy-stm32/src/pac/stm32h7a3ii.rs index cc3b10a98..1f31a5da6 100644 --- a/embassy-stm32/src/pac/stm32h7a3ii.rs +++ b/embassy-stm32/src/pac/stm32h7a3ii.rs | |||
| @@ -246,12 +246,80 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 286 | impl_spi!(SPI4, APB2); | ||
| 287 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 288 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 289 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 290 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 291 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 292 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 293 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 294 | impl_spi!(SPI5, APB2); | ||
| 295 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 297 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 298 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 299 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 300 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 301 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 302 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 303 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 304 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 305 | impl_spi!(SPI6, APB4); | ||
| 306 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 307 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 308 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 309 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 310 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 311 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 312 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 313 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 317 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 318 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 319 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 320 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 321 | pub use regs::sdmmc_v2 as sdmmc; |
| 322 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 323 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 324 | mod regs; |
| 257 | use embassy_extras::peripherals; | 325 | use embassy_extras::peripherals; |
| @@ -270,7 +338,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 338 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 339 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 340 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 341 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 274 | ); | 342 | ); |
| 275 | 343 | ||
| 276 | pub mod interrupt { | 344 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7a3lg.rs b/embassy-stm32/src/pac/stm32h7a3lg.rs index cc3b10a98..1f31a5da6 100644 --- a/embassy-stm32/src/pac/stm32h7a3lg.rs +++ b/embassy-stm32/src/pac/stm32h7a3lg.rs | |||
| @@ -246,12 +246,80 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 286 | impl_spi!(SPI4, APB2); | ||
| 287 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 288 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 289 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 290 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 291 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 292 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 293 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 294 | impl_spi!(SPI5, APB2); | ||
| 295 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 297 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 298 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 299 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 300 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 301 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 302 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 303 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 304 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 305 | impl_spi!(SPI6, APB4); | ||
| 306 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 307 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 308 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 309 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 310 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 311 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 312 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 313 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 317 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 318 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 319 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 320 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 321 | pub use regs::sdmmc_v2 as sdmmc; |
| 322 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 323 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 324 | mod regs; |
| 257 | use embassy_extras::peripherals; | 325 | use embassy_extras::peripherals; |
| @@ -270,7 +338,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 338 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 339 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 340 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 341 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 274 | ); | 342 | ); |
| 275 | 343 | ||
| 276 | pub mod interrupt { | 344 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7a3li.rs b/embassy-stm32/src/pac/stm32h7a3li.rs index cc3b10a98..1f31a5da6 100644 --- a/embassy-stm32/src/pac/stm32h7a3li.rs +++ b/embassy-stm32/src/pac/stm32h7a3li.rs | |||
| @@ -246,12 +246,80 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 286 | impl_spi!(SPI4, APB2); | ||
| 287 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 288 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 289 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 290 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 291 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 292 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 293 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 294 | impl_spi!(SPI5, APB2); | ||
| 295 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 297 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 298 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 299 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 300 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 301 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 302 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 303 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 304 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 305 | impl_spi!(SPI6, APB4); | ||
| 306 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 307 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 308 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 309 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 310 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 311 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 312 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 313 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 317 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 318 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 319 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 320 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 321 | pub use regs::sdmmc_v2 as sdmmc; |
| 322 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 323 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 324 | mod regs; |
| 257 | use embassy_extras::peripherals; | 325 | use embassy_extras::peripherals; |
| @@ -270,7 +338,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 338 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 339 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 340 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 341 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 274 | ); | 342 | ); |
| 275 | 343 | ||
| 276 | pub mod interrupt { | 344 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7a3ng.rs b/embassy-stm32/src/pac/stm32h7a3ng.rs index cc3b10a98..1f31a5da6 100644 --- a/embassy-stm32/src/pac/stm32h7a3ng.rs +++ b/embassy-stm32/src/pac/stm32h7a3ng.rs | |||
| @@ -246,12 +246,80 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 286 | impl_spi!(SPI4, APB2); | ||
| 287 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 288 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 289 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 290 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 291 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 292 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 293 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 294 | impl_spi!(SPI5, APB2); | ||
| 295 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 297 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 298 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 299 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 300 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 301 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 302 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 303 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 304 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 305 | impl_spi!(SPI6, APB4); | ||
| 306 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 307 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 308 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 309 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 310 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 311 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 312 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 313 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 317 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 318 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 319 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 320 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 321 | pub use regs::sdmmc_v2 as sdmmc; |
| 322 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 323 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 324 | mod regs; |
| 257 | use embassy_extras::peripherals; | 325 | use embassy_extras::peripherals; |
| @@ -270,7 +338,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 338 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 339 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 340 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 341 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 274 | ); | 342 | ); |
| 275 | 343 | ||
| 276 | pub mod interrupt { | 344 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7a3ni.rs b/embassy-stm32/src/pac/stm32h7a3ni.rs index cc3b10a98..1f31a5da6 100644 --- a/embassy-stm32/src/pac/stm32h7a3ni.rs +++ b/embassy-stm32/src/pac/stm32h7a3ni.rs | |||
| @@ -246,12 +246,80 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 286 | impl_spi!(SPI4, APB2); | ||
| 287 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 288 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 289 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 290 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 291 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 292 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 293 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 294 | impl_spi!(SPI5, APB2); | ||
| 295 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 297 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 298 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 299 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 300 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 301 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 302 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 303 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 304 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 305 | impl_spi!(SPI6, APB4); | ||
| 306 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 307 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 308 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 309 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 310 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 311 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 312 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 313 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 317 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 318 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 319 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 320 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 321 | pub use regs::sdmmc_v2 as sdmmc; |
| 322 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 323 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 324 | mod regs; |
| 257 | use embassy_extras::peripherals; | 325 | use embassy_extras::peripherals; |
| @@ -270,7 +338,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 338 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 339 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 340 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 341 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 274 | ); | 342 | ); |
| 275 | 343 | ||
| 276 | pub mod interrupt { | 344 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7a3qi.rs b/embassy-stm32/src/pac/stm32h7a3qi.rs index cc3b10a98..42b8a002f 100644 --- a/embassy-stm32/src/pac/stm32h7a3qi.rs +++ b/embassy-stm32/src/pac/stm32h7a3qi.rs | |||
| @@ -246,12 +246,69 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 286 | impl_spi!(SPI4, APB2); | ||
| 287 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 288 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 289 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 290 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 291 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 292 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 293 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 294 | impl_spi!(SPI6, APB4); | ||
| 295 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 296 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 297 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 298 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 299 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 300 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 301 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 302 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 303 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 304 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 305 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 306 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 307 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 308 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 309 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 310 | pub use regs::sdmmc_v2 as sdmmc; |
| 311 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 312 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 313 | mod regs; |
| 257 | use embassy_extras::peripherals; | 314 | use embassy_extras::peripherals; |
| @@ -270,7 +327,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 327 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 328 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 329 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 330 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG |
| 274 | ); | 331 | ); |
| 275 | 332 | ||
| 276 | pub mod interrupt { | 333 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7a3rg.rs b/embassy-stm32/src/pac/stm32h7a3rg.rs index cc3b10a98..625450dbe 100644 --- a/embassy-stm32/src/pac/stm32h7a3rg.rs +++ b/embassy-stm32/src/pac/stm32h7a3rg.rs | |||
| @@ -246,12 +246,61 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 286 | impl_spi!(SPI6, APB4); | ||
| 287 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 288 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 289 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 290 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 291 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 292 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 293 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 294 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 295 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 296 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 297 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 298 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 299 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 300 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 301 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 302 | pub use regs::sdmmc_v2 as sdmmc; |
| 303 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 304 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 305 | mod regs; |
| 257 | use embassy_extras::peripherals; | 306 | use embassy_extras::peripherals; |
| @@ -270,7 +319,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 319 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 320 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 321 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 322 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI6, SYSCFG |
| 274 | ); | 323 | ); |
| 275 | 324 | ||
| 276 | pub mod interrupt { | 325 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7a3ri.rs b/embassy-stm32/src/pac/stm32h7a3ri.rs index cc3b10a98..625450dbe 100644 --- a/embassy-stm32/src/pac/stm32h7a3ri.rs +++ b/embassy-stm32/src/pac/stm32h7a3ri.rs | |||
| @@ -246,12 +246,61 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 286 | impl_spi!(SPI6, APB4); | ||
| 287 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 288 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 289 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 290 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 291 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 292 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 293 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 294 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 295 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 296 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 297 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 298 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 299 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 300 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 301 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 302 | pub use regs::sdmmc_v2 as sdmmc; |
| 303 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 304 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 305 | mod regs; |
| 257 | use embassy_extras::peripherals; | 306 | use embassy_extras::peripherals; |
| @@ -270,7 +319,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 319 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 320 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 321 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 322 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI6, SYSCFG |
| 274 | ); | 323 | ); |
| 275 | 324 | ||
| 276 | pub mod interrupt { | 325 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7a3vg.rs b/embassy-stm32/src/pac/stm32h7a3vg.rs index cc3b10a98..42b8a002f 100644 --- a/embassy-stm32/src/pac/stm32h7a3vg.rs +++ b/embassy-stm32/src/pac/stm32h7a3vg.rs | |||
| @@ -246,12 +246,69 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 286 | impl_spi!(SPI4, APB2); | ||
| 287 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 288 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 289 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 290 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 291 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 292 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 293 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 294 | impl_spi!(SPI6, APB4); | ||
| 295 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 296 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 297 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 298 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 299 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 300 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 301 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 302 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 303 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 304 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 305 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 306 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 307 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 308 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 309 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 310 | pub use regs::sdmmc_v2 as sdmmc; |
| 311 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 312 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 313 | mod regs; |
| 257 | use embassy_extras::peripherals; | 314 | use embassy_extras::peripherals; |
| @@ -270,7 +327,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 327 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 328 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 329 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 330 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG |
| 274 | ); | 331 | ); |
| 275 | 332 | ||
| 276 | pub mod interrupt { | 333 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7a3vi.rs b/embassy-stm32/src/pac/stm32h7a3vi.rs index cc3b10a98..42b8a002f 100644 --- a/embassy-stm32/src/pac/stm32h7a3vi.rs +++ b/embassy-stm32/src/pac/stm32h7a3vi.rs | |||
| @@ -246,12 +246,69 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 286 | impl_spi!(SPI4, APB2); | ||
| 287 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 288 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 289 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 290 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 291 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 292 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 293 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 294 | impl_spi!(SPI6, APB4); | ||
| 295 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 296 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 297 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 298 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 299 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 300 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 301 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 302 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 303 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 304 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 305 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 306 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 307 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 308 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 309 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 310 | pub use regs::sdmmc_v2 as sdmmc; |
| 311 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 312 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 313 | mod regs; |
| 257 | use embassy_extras::peripherals; | 314 | use embassy_extras::peripherals; |
| @@ -270,7 +327,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 327 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 328 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 329 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 330 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG |
| 274 | ); | 331 | ); |
| 275 | 332 | ||
| 276 | pub mod interrupt { | 333 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7a3zg.rs b/embassy-stm32/src/pac/stm32h7a3zg.rs index cc3b10a98..1f31a5da6 100644 --- a/embassy-stm32/src/pac/stm32h7a3zg.rs +++ b/embassy-stm32/src/pac/stm32h7a3zg.rs | |||
| @@ -246,12 +246,80 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 286 | impl_spi!(SPI4, APB2); | ||
| 287 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 288 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 289 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 290 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 291 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 292 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 293 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 294 | impl_spi!(SPI5, APB2); | ||
| 295 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 297 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 298 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 299 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 300 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 301 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 302 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 303 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 304 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 305 | impl_spi!(SPI6, APB4); | ||
| 306 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 307 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 308 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 309 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 310 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 311 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 312 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 313 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 317 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 318 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 319 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 320 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 321 | pub use regs::sdmmc_v2 as sdmmc; |
| 322 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 323 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 324 | mod regs; |
| 257 | use embassy_extras::peripherals; | 325 | use embassy_extras::peripherals; |
| @@ -270,7 +338,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 338 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 339 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 340 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 341 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 274 | ); | 342 | ); |
| 275 | 343 | ||
| 276 | pub mod interrupt { | 344 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7a3zi.rs b/embassy-stm32/src/pac/stm32h7a3zi.rs index cc3b10a98..1f31a5da6 100644 --- a/embassy-stm32/src/pac/stm32h7a3zi.rs +++ b/embassy-stm32/src/pac/stm32h7a3zi.rs | |||
| @@ -246,12 +246,80 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 286 | impl_spi!(SPI4, APB2); | ||
| 287 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 288 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 289 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 290 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 291 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 292 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 293 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 294 | impl_spi!(SPI5, APB2); | ||
| 295 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 297 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 298 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 299 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 300 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 301 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 302 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 303 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 304 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 305 | impl_spi!(SPI6, APB4); | ||
| 306 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 307 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 308 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 309 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 310 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 311 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 312 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 313 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 317 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 318 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 319 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 320 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 321 | pub use regs::sdmmc_v2 as sdmmc; |
| 322 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 323 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 324 | mod regs; |
| 257 | use embassy_extras::peripherals; | 325 | use embassy_extras::peripherals; |
| @@ -270,7 +338,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 338 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 339 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 340 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 341 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 274 | ); | 342 | ); |
| 275 | 343 | ||
| 276 | pub mod interrupt { | 344 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7b0ab.rs b/embassy-stm32/src/pac/stm32h7b0ab.rs index cba2c71b0..6d01166cc 100644 --- a/embassy-stm32/src/pac/stm32h7b0ab.rs +++ b/embassy-stm32/src/pac/stm32h7b0ab.rs | |||
| @@ -246,12 +246,80 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 286 | impl_spi!(SPI4, APB2); | ||
| 287 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 288 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 289 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 290 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 291 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 292 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 293 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 294 | impl_spi!(SPI5, APB2); | ||
| 295 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 297 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 298 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 299 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 300 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 301 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 302 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 303 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 304 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 305 | impl_spi!(SPI6, APB4); | ||
| 306 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 307 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 308 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 309 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 310 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 311 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 312 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 313 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 317 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 318 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 319 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 320 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 321 | pub use regs::sdmmc_v2 as sdmmc; |
| 322 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 323 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 324 | mod regs; |
| 257 | use embassy_extras::peripherals; | 325 | use embassy_extras::peripherals; |
| @@ -270,7 +338,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 338 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 339 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 340 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 341 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 274 | ); | 342 | ); |
| 275 | 343 | ||
| 276 | pub mod interrupt { | 344 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7b0ib.rs b/embassy-stm32/src/pac/stm32h7b0ib.rs index cba2c71b0..6d01166cc 100644 --- a/embassy-stm32/src/pac/stm32h7b0ib.rs +++ b/embassy-stm32/src/pac/stm32h7b0ib.rs | |||
| @@ -246,12 +246,80 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 286 | impl_spi!(SPI4, APB2); | ||
| 287 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 288 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 289 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 290 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 291 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 292 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 293 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 294 | impl_spi!(SPI5, APB2); | ||
| 295 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 297 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 298 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 299 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 300 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 301 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 302 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 303 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 304 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 305 | impl_spi!(SPI6, APB4); | ||
| 306 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 307 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 308 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 309 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 310 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 311 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 312 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 313 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 317 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 318 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 319 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 320 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 321 | pub use regs::sdmmc_v2 as sdmmc; |
| 322 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 323 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 324 | mod regs; |
| 257 | use embassy_extras::peripherals; | 325 | use embassy_extras::peripherals; |
| @@ -270,7 +338,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 338 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 339 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 340 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 341 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 274 | ); | 342 | ); |
| 275 | 343 | ||
| 276 | pub mod interrupt { | 344 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7b0rb.rs b/embassy-stm32/src/pac/stm32h7b0rb.rs index cba2c71b0..3880f8938 100644 --- a/embassy-stm32/src/pac/stm32h7b0rb.rs +++ b/embassy-stm32/src/pac/stm32h7b0rb.rs | |||
| @@ -246,12 +246,61 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 286 | impl_spi!(SPI6, APB4); | ||
| 287 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 288 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 289 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 290 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 291 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 292 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 293 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 294 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 295 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 296 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 297 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 298 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 299 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 300 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 301 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 302 | pub use regs::sdmmc_v2 as sdmmc; |
| 303 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 304 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 305 | mod regs; |
| 257 | use embassy_extras::peripherals; | 306 | use embassy_extras::peripherals; |
| @@ -270,7 +319,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 319 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 320 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 321 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 322 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI6, SYSCFG |
| 274 | ); | 323 | ); |
| 275 | 324 | ||
| 276 | pub mod interrupt { | 325 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7b0vb.rs b/embassy-stm32/src/pac/stm32h7b0vb.rs index cba2c71b0..d0f3a0384 100644 --- a/embassy-stm32/src/pac/stm32h7b0vb.rs +++ b/embassy-stm32/src/pac/stm32h7b0vb.rs | |||
| @@ -246,12 +246,69 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 286 | impl_spi!(SPI4, APB2); | ||
| 287 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 288 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 289 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 290 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 291 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 292 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 293 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 294 | impl_spi!(SPI6, APB4); | ||
| 295 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 296 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 297 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 298 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 299 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 300 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 301 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 302 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 303 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 304 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 305 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 306 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 307 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 308 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 309 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 310 | pub use regs::sdmmc_v2 as sdmmc; |
| 311 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 312 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 313 | mod regs; |
| 257 | use embassy_extras::peripherals; | 314 | use embassy_extras::peripherals; |
| @@ -270,7 +327,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 327 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 328 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 329 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 330 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG |
| 274 | ); | 331 | ); |
| 275 | 332 | ||
| 276 | pub mod interrupt { | 333 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7b0zb.rs b/embassy-stm32/src/pac/stm32h7b0zb.rs index cba2c71b0..6d01166cc 100644 --- a/embassy-stm32/src/pac/stm32h7b0zb.rs +++ b/embassy-stm32/src/pac/stm32h7b0zb.rs | |||
| @@ -246,12 +246,80 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 286 | impl_spi!(SPI4, APB2); | ||
| 287 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 288 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 289 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 290 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 291 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 292 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 293 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 294 | impl_spi!(SPI5, APB2); | ||
| 295 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 297 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 298 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 299 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 300 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 301 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 302 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 303 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 304 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 305 | impl_spi!(SPI6, APB4); | ||
| 306 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 307 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 308 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 309 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 310 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 311 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 312 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 313 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 317 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 318 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 319 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 320 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 321 | pub use regs::sdmmc_v2 as sdmmc; |
| 322 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 323 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 324 | mod regs; |
| 257 | use embassy_extras::peripherals; | 325 | use embassy_extras::peripherals; |
| @@ -270,7 +338,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 338 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 339 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 340 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 341 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 274 | ); | 342 | ); |
| 275 | 343 | ||
| 276 | pub mod interrupt { | 344 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7b3ai.rs b/embassy-stm32/src/pac/stm32h7b3ai.rs index cba2c71b0..6d01166cc 100644 --- a/embassy-stm32/src/pac/stm32h7b3ai.rs +++ b/embassy-stm32/src/pac/stm32h7b3ai.rs | |||
| @@ -246,12 +246,80 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 286 | impl_spi!(SPI4, APB2); | ||
| 287 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 288 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 289 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 290 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 291 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 292 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 293 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 294 | impl_spi!(SPI5, APB2); | ||
| 295 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 297 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 298 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 299 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 300 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 301 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 302 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 303 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 304 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 305 | impl_spi!(SPI6, APB4); | ||
| 306 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 307 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 308 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 309 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 310 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 311 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 312 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 313 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 317 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 318 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 319 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 320 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 321 | pub use regs::sdmmc_v2 as sdmmc; |
| 322 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 323 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 324 | mod regs; |
| 257 | use embassy_extras::peripherals; | 325 | use embassy_extras::peripherals; |
| @@ -270,7 +338,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 338 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 339 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 340 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 341 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 274 | ); | 342 | ); |
| 275 | 343 | ||
| 276 | pub mod interrupt { | 344 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7b3ii.rs b/embassy-stm32/src/pac/stm32h7b3ii.rs index cba2c71b0..6d01166cc 100644 --- a/embassy-stm32/src/pac/stm32h7b3ii.rs +++ b/embassy-stm32/src/pac/stm32h7b3ii.rs | |||
| @@ -246,12 +246,80 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 286 | impl_spi!(SPI4, APB2); | ||
| 287 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 288 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 289 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 290 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 291 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 292 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 293 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 294 | impl_spi!(SPI5, APB2); | ||
| 295 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 297 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 298 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 299 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 300 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 301 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 302 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 303 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 304 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 305 | impl_spi!(SPI6, APB4); | ||
| 306 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 307 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 308 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 309 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 310 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 311 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 312 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 313 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 317 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 318 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 319 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 320 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 321 | pub use regs::sdmmc_v2 as sdmmc; |
| 322 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 323 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 324 | mod regs; |
| 257 | use embassy_extras::peripherals; | 325 | use embassy_extras::peripherals; |
| @@ -270,7 +338,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 338 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 339 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 340 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 341 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 274 | ); | 342 | ); |
| 275 | 343 | ||
| 276 | pub mod interrupt { | 344 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7b3li.rs b/embassy-stm32/src/pac/stm32h7b3li.rs index cba2c71b0..6d01166cc 100644 --- a/embassy-stm32/src/pac/stm32h7b3li.rs +++ b/embassy-stm32/src/pac/stm32h7b3li.rs | |||
| @@ -246,12 +246,80 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 286 | impl_spi!(SPI4, APB2); | ||
| 287 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 288 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 289 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 290 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 291 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 292 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 293 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 294 | impl_spi!(SPI5, APB2); | ||
| 295 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 297 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 298 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 299 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 300 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 301 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 302 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 303 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 304 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 305 | impl_spi!(SPI6, APB4); | ||
| 306 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 307 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 308 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 309 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 310 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 311 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 312 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 313 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 317 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 318 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 319 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 320 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 321 | pub use regs::sdmmc_v2 as sdmmc; |
| 322 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 323 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 324 | mod regs; |
| 257 | use embassy_extras::peripherals; | 325 | use embassy_extras::peripherals; |
| @@ -270,7 +338,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 338 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 339 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 340 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 341 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 274 | ); | 342 | ); |
| 275 | 343 | ||
| 276 | pub mod interrupt { | 344 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7b3ni.rs b/embassy-stm32/src/pac/stm32h7b3ni.rs index cba2c71b0..6d01166cc 100644 --- a/embassy-stm32/src/pac/stm32h7b3ni.rs +++ b/embassy-stm32/src/pac/stm32h7b3ni.rs | |||
| @@ -246,12 +246,80 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 286 | impl_spi!(SPI4, APB2); | ||
| 287 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 288 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 289 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 290 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 291 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 292 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 293 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 294 | impl_spi!(SPI5, APB2); | ||
| 295 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 297 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 298 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 299 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 300 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 301 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 302 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 303 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 304 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 305 | impl_spi!(SPI6, APB4); | ||
| 306 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 307 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 308 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 309 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 310 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 311 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 312 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 313 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 317 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 318 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 319 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 320 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 321 | pub use regs::sdmmc_v2 as sdmmc; |
| 322 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 323 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 324 | mod regs; |
| 257 | use embassy_extras::peripherals; | 325 | use embassy_extras::peripherals; |
| @@ -270,7 +338,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 338 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 339 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 340 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 341 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 274 | ); | 342 | ); |
| 275 | 343 | ||
| 276 | pub mod interrupt { | 344 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7b3qi.rs b/embassy-stm32/src/pac/stm32h7b3qi.rs index cba2c71b0..d0f3a0384 100644 --- a/embassy-stm32/src/pac/stm32h7b3qi.rs +++ b/embassy-stm32/src/pac/stm32h7b3qi.rs | |||
| @@ -246,12 +246,69 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 286 | impl_spi!(SPI4, APB2); | ||
| 287 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 288 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 289 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 290 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 291 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 292 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 293 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 294 | impl_spi!(SPI6, APB4); | ||
| 295 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 296 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 297 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 298 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 299 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 300 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 301 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 302 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 303 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 304 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 305 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 306 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 307 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 308 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 309 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 310 | pub use regs::sdmmc_v2 as sdmmc; |
| 311 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 312 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 313 | mod regs; |
| 257 | use embassy_extras::peripherals; | 314 | use embassy_extras::peripherals; |
| @@ -270,7 +327,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 327 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 328 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 329 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 330 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG |
| 274 | ); | 331 | ); |
| 275 | 332 | ||
| 276 | pub mod interrupt { | 333 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7b3ri.rs b/embassy-stm32/src/pac/stm32h7b3ri.rs index cba2c71b0..3880f8938 100644 --- a/embassy-stm32/src/pac/stm32h7b3ri.rs +++ b/embassy-stm32/src/pac/stm32h7b3ri.rs | |||
| @@ -246,12 +246,61 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 286 | impl_spi!(SPI6, APB4); | ||
| 287 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 288 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 289 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 290 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 291 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 292 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 293 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 294 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 295 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 296 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 297 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 298 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 299 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 300 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 301 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 302 | pub use regs::sdmmc_v2 as sdmmc; |
| 303 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 304 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 305 | mod regs; |
| 257 | use embassy_extras::peripherals; | 306 | use embassy_extras::peripherals; |
| @@ -270,7 +319,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 319 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 320 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 321 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 322 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI6, SYSCFG |
| 274 | ); | 323 | ); |
| 275 | 324 | ||
| 276 | pub mod interrupt { | 325 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7b3vi.rs b/embassy-stm32/src/pac/stm32h7b3vi.rs index cba2c71b0..d0f3a0384 100644 --- a/embassy-stm32/src/pac/stm32h7b3vi.rs +++ b/embassy-stm32/src/pac/stm32h7b3vi.rs | |||
| @@ -246,12 +246,69 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 286 | impl_spi!(SPI4, APB2); | ||
| 287 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 288 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 289 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 290 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 291 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 292 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 293 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 294 | impl_spi!(SPI6, APB4); | ||
| 295 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 296 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 297 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 298 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 299 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 300 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 301 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 302 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 303 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 304 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 305 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 306 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 307 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 308 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 309 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 310 | pub use regs::sdmmc_v2 as sdmmc; |
| 311 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 312 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 313 | mod regs; |
| 257 | use embassy_extras::peripherals; | 314 | use embassy_extras::peripherals; |
| @@ -270,7 +327,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 327 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 328 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 329 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 330 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG |
| 274 | ); | 331 | ); |
| 275 | 332 | ||
| 276 | pub mod interrupt { | 333 | pub mod interrupt { |
diff --git a/embassy-stm32/src/pac/stm32h7b3zi.rs b/embassy-stm32/src/pac/stm32h7b3zi.rs index cba2c71b0..6d01166cc 100644 --- a/embassy-stm32/src/pac/stm32h7b3zi.rs +++ b/embassy-stm32/src/pac/stm32h7b3zi.rs | |||
| @@ -246,12 +246,80 @@ impl_sdmmc_pin!(SDMMC2, D3Pin, PG12, 10); | |||
| 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); | 246 | impl_sdmmc_pin!(SDMMC2, D6Pin, PG13, 10); |
| 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); | 247 | impl_sdmmc_pin!(SDMMC2, D7Pin, PG14, 10); |
| 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); | 248 | impl_sdmmc_pin!(SDMMC2, D0Pin, PG9, 11); |
| 249 | pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); | ||
| 250 | impl_spi!(SPI1, APB2); | ||
| 251 | impl_spi_pin!(SPI1, SckPin, PA5, 5); | ||
| 252 | impl_spi_pin!(SPI1, MisoPin, PA6, 5); | ||
| 253 | impl_spi_pin!(SPI1, MosiPin, PA7, 5); | ||
| 254 | impl_spi_pin!(SPI1, SckPin, PB3, 5); | ||
| 255 | impl_spi_pin!(SPI1, MisoPin, PB4, 5); | ||
| 256 | impl_spi_pin!(SPI1, MosiPin, PB5, 5); | ||
| 257 | impl_spi_pin!(SPI1, MosiPin, PD7, 5); | ||
| 258 | impl_spi_pin!(SPI1, SckPin, PG11, 5); | ||
| 259 | impl_spi_pin!(SPI1, MisoPin, PG9, 5); | ||
| 260 | pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); | ||
| 261 | impl_spi!(SPI2, APB1); | ||
| 262 | impl_spi_pin!(SPI2, SckPin, PA12, 5); | ||
| 263 | impl_spi_pin!(SPI2, SckPin, PA9, 5); | ||
| 264 | impl_spi_pin!(SPI2, SckPin, PB10, 5); | ||
| 265 | impl_spi_pin!(SPI2, SckPin, PB13, 5); | ||
| 266 | impl_spi_pin!(SPI2, MisoPin, PB14, 5); | ||
| 267 | impl_spi_pin!(SPI2, MosiPin, PB15, 5); | ||
| 268 | impl_spi_pin!(SPI2, MosiPin, PC1, 5); | ||
| 269 | impl_spi_pin!(SPI2, MisoPin, PC2, 5); | ||
| 270 | impl_spi_pin!(SPI2, MosiPin, PC3, 5); | ||
| 271 | impl_spi_pin!(SPI2, SckPin, PD3, 5); | ||
| 272 | impl_spi_pin!(SPI2, SckPin, PI1, 5); | ||
| 273 | impl_spi_pin!(SPI2, MisoPin, PI2, 5); | ||
| 274 | impl_spi_pin!(SPI2, MosiPin, PI3, 5); | ||
| 275 | pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); | ||
| 276 | impl_spi!(SPI3, APB1); | ||
| 277 | impl_spi_pin!(SPI3, MosiPin, PB2, 7); | ||
| 278 | impl_spi_pin!(SPI3, SckPin, PB3, 6); | ||
| 279 | impl_spi_pin!(SPI3, MisoPin, PB4, 6); | ||
| 280 | impl_spi_pin!(SPI3, MosiPin, PB5, 7); | ||
| 281 | impl_spi_pin!(SPI3, SckPin, PC10, 6); | ||
| 282 | impl_spi_pin!(SPI3, MisoPin, PC11, 6); | ||
| 283 | impl_spi_pin!(SPI3, MosiPin, PC12, 6); | ||
| 284 | impl_spi_pin!(SPI3, MosiPin, PD6, 5); | ||
| 285 | pub const SPI4: spi::Spi = spi::Spi(0x40013400 as _); | ||
| 286 | impl_spi!(SPI4, APB2); | ||
| 287 | impl_spi_pin!(SPI4, SckPin, PE12, 5); | ||
| 288 | impl_spi_pin!(SPI4, MisoPin, PE13, 5); | ||
| 289 | impl_spi_pin!(SPI4, MosiPin, PE14, 5); | ||
| 290 | impl_spi_pin!(SPI4, SckPin, PE2, 5); | ||
| 291 | impl_spi_pin!(SPI4, MisoPin, PE5, 5); | ||
| 292 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | ||
| 293 | pub const SPI5: spi::Spi = spi::Spi(0x40015000 as _); | ||
| 294 | impl_spi!(SPI5, APB2); | ||
| 295 | impl_spi_pin!(SPI5, MosiPin, PF11, 5); | ||
| 296 | impl_spi_pin!(SPI5, SckPin, PF7, 5); | ||
| 297 | impl_spi_pin!(SPI5, MisoPin, PF8, 5); | ||
| 298 | impl_spi_pin!(SPI5, MosiPin, PF9, 5); | ||
| 299 | impl_spi_pin!(SPI5, SckPin, PH6, 5); | ||
| 300 | impl_spi_pin!(SPI5, MisoPin, PH7, 5); | ||
| 301 | impl_spi_pin!(SPI5, MosiPin, PJ10, 5); | ||
| 302 | impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | ||
| 303 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | ||
| 304 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | ||
| 305 | impl_spi!(SPI6, APB4); | ||
| 306 | impl_spi_pin!(SPI6, SckPin, PA5, 8); | ||
| 307 | impl_spi_pin!(SPI6, MisoPin, PA6, 8); | ||
| 308 | impl_spi_pin!(SPI6, MosiPin, PA7, 8); | ||
| 309 | impl_spi_pin!(SPI6, SckPin, PB3, 8); | ||
| 310 | impl_spi_pin!(SPI6, MisoPin, PB4, 8); | ||
| 311 | impl_spi_pin!(SPI6, MosiPin, PB5, 8); | ||
| 312 | impl_spi_pin!(SPI6, SckPin, PC12, 5); | ||
| 313 | impl_spi_pin!(SPI6, MisoPin, PG12, 5); | ||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | ||
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | ||
| 249 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 250 | pub use regs::dma_v2 as dma; | 317 | pub use regs::dma_v2 as dma; |
| 251 | pub use regs::exti_v1 as exti; | 318 | pub use regs::exti_v1 as exti; |
| 252 | pub use regs::gpio_v2 as gpio; | 319 | pub use regs::gpio_v2 as gpio; |
| 253 | pub use regs::rng_v1 as rng; | 320 | pub use regs::rng_v1 as rng; |
| 254 | pub use regs::sdmmc_v2 as sdmmc; | 321 | pub use regs::sdmmc_v2 as sdmmc; |
| 322 | pub use regs::spi_v3 as spi; | ||
| 255 | pub use regs::syscfg_h7 as syscfg; | 323 | pub use regs::syscfg_h7 as syscfg; |
| 256 | mod regs; | 324 | mod regs; |
| 257 | use embassy_extras::peripherals; | 325 | use embassy_extras::peripherals; |
| @@ -270,7 +338,7 @@ peripherals!( | |||
| 270 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 338 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, |
| 271 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 339 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, |
| 272 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 340 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, |
| 273 | PK15, RNG, SDMMC1, SDMMC2, SYSCFG | 341 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG |
| 274 | ); | 342 | ); |
| 275 | 343 | ||
| 276 | pub mod interrupt { | 344 | pub mod interrupt { |
diff --git a/embassy-stm32/src/spi/mod.rs b/embassy-stm32/src/spi/mod.rs index 9f62a5ec9..09a9d702f 100644 --- a/embassy-stm32/src/spi/mod.rs +++ b/embassy-stm32/src/spi/mod.rs | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | #[cfg_attr(feature = "_spi_v1", path = "v1.rs")] | 3 | #[cfg_attr(feature = "_spi_v1", path = "v1.rs")] |
| 4 | #[cfg_attr(feature = "_spi_v2", path = "v2.rs")] | 4 | #[cfg_attr(feature = "_spi_v2", path = "v2.rs")] |
| 5 | #[cfg_attr(feature = "_spi_v3", path = "v3.rs")] | ||
| 5 | mod _version; | 6 | mod _version; |
| 6 | pub use _version::*; | 7 | pub use _version::*; |
| 7 | 8 | ||
diff --git a/embassy-stm32/src/spi/v1.rs b/embassy-stm32/src/spi/v1.rs index a464c4275..d1f0473cc 100644 --- a/embassy-stm32/src/spi/v1.rs +++ b/embassy-stm32/src/spi/v1.rs | |||
| @@ -5,6 +5,7 @@ use crate::pac::spi; | |||
| 5 | use crate::spi::{ByteOrder, Config, Error, Instance, MisoPin, MosiPin, SckPin, WordSize}; | 5 | use crate::spi::{ByteOrder, Config, Error, Instance, MisoPin, MosiPin, SckPin, WordSize}; |
| 6 | use crate::time::Hertz; | 6 | use crate::time::Hertz; |
| 7 | use core::marker::PhantomData; | 7 | use core::marker::PhantomData; |
| 8 | use core::ptr; | ||
| 8 | use embassy::util::Unborrow; | 9 | use embassy::util::Unborrow; |
| 9 | use embassy_extras::unborrow; | 10 | use embassy_extras::unborrow; |
| 10 | pub use embedded_hal::spi::{Mode, Phase, Polarity, MODE_0, MODE_1, MODE_2, MODE_3}; | 11 | pub use embedded_hal::spi::{Mode, Phase, Polarity, MODE_0, MODE_1, MODE_2, MODE_3}; |
| @@ -53,7 +54,7 @@ impl<'d, T: Instance> Spi<'d, T> { | |||
| 53 | let miso = miso.degrade(); | 54 | let miso = miso.degrade(); |
| 54 | 55 | ||
| 55 | unsafe { | 56 | unsafe { |
| 56 | T::regs().cr2().write(|w| { | 57 | T::regs().cr2().modify(|w| { |
| 57 | w.set_ssoe(false); | 58 | w.set_ssoe(false); |
| 58 | }); | 59 | }); |
| 59 | } | 60 | } |
| @@ -61,7 +62,7 @@ impl<'d, T: Instance> Spi<'d, T> { | |||
| 61 | let br = Self::compute_baud_rate(pclk, freq.into()); | 62 | let br = Self::compute_baud_rate(pclk, freq.into()); |
| 62 | 63 | ||
| 63 | unsafe { | 64 | unsafe { |
| 64 | T::regs().cr1().write(|w| { | 65 | T::regs().cr1().modify(|w| { |
| 65 | w.set_cpha( | 66 | w.set_cpha( |
| 66 | match config.mode.phase == Phase::CaptureOnSecondTransition { | 67 | match config.mode.phase == Phase::CaptureOnSecondTransition { |
| 67 | true => spi::vals::Cpha::SECONDEDGE, | 68 | true => spi::vals::Cpha::SECONDEDGE, |
| @@ -151,7 +152,8 @@ impl<'d, T: Instance> embedded_hal::blocking::spi::Write<u8> for Spi<'d, T> { | |||
| 151 | // spin | 152 | // spin |
| 152 | } | 153 | } |
| 153 | unsafe { | 154 | unsafe { |
| 154 | regs.dr().write(|reg| reg.0 = *word as u32); | 155 | let dr = regs.dr().ptr() as *mut u8; |
| 156 | ptr::write_volatile(dr, *word); | ||
| 155 | } | 157 | } |
| 156 | loop { | 158 | loop { |
| 157 | let sr = unsafe { regs.sr().read() }; | 159 | let sr = unsafe { regs.sr().read() }; |
| @@ -186,12 +188,19 @@ impl<'d, T: Instance> embedded_hal::blocking::spi::Transfer<u8> for Spi<'d, T> { | |||
| 186 | // spin | 188 | // spin |
| 187 | } | 189 | } |
| 188 | unsafe { | 190 | unsafe { |
| 189 | regs.dr().write(|reg| reg.0 = *word as u32); | 191 | let dr = regs.dr().ptr() as *mut u8; |
| 192 | ptr::write_volatile(dr, *word); | ||
| 190 | } | 193 | } |
| 194 | |||
| 191 | while unsafe { !regs.sr().read().rxne() } { | 195 | while unsafe { !regs.sr().read().rxne() } { |
| 192 | // spin waiting for inbound to shift in. | 196 | // spin waiting for inbound to shift in. |
| 193 | } | 197 | } |
| 194 | *word = unsafe { regs.dr().read().0 as u8 }; | 198 | |
| 199 | unsafe { | ||
| 200 | let dr = regs.dr().ptr() as *const u8; | ||
| 201 | *word = ptr::read_volatile(dr); | ||
| 202 | } | ||
| 203 | |||
| 195 | let sr = unsafe { regs.sr().read() }; | 204 | let sr = unsafe { regs.sr().read() }; |
| 196 | if sr.fre() { | 205 | if sr.fre() { |
| 197 | return Err(Error::Framing); | 206 | return Err(Error::Framing); |
| @@ -220,7 +229,8 @@ impl<'d, T: Instance> embedded_hal::blocking::spi::Write<u16> for Spi<'d, T> { | |||
| 220 | // spin | 229 | // spin |
| 221 | } | 230 | } |
| 222 | unsafe { | 231 | unsafe { |
| 223 | regs.dr().write(|reg| reg.0 = *word as u32); | 232 | let dr = regs.dr().ptr() as *mut u16; |
| 233 | ptr::write_volatile(dr, *word); | ||
| 224 | } | 234 | } |
| 225 | loop { | 235 | loop { |
| 226 | let sr = unsafe { regs.sr().read() }; | 236 | let sr = unsafe { regs.sr().read() }; |
| @@ -255,12 +265,17 @@ impl<'d, T: Instance> embedded_hal::blocking::spi::Transfer<u16> for Spi<'d, T> | |||
| 255 | // spin | 265 | // spin |
| 256 | } | 266 | } |
| 257 | unsafe { | 267 | unsafe { |
| 258 | regs.dr().write(|reg| reg.0 = *word as u32); | 268 | let dr = regs.dr().ptr() as *mut u16; |
| 269 | ptr::write_volatile(dr, *word); | ||
| 259 | } | 270 | } |
| 260 | while unsafe { !regs.sr().read().rxne() } { | 271 | while unsafe { !regs.sr().read().rxne() } { |
| 261 | // spin waiting for inbound to shift in. | 272 | // spin waiting for inbound to shift in. |
| 262 | } | 273 | } |
| 263 | *word = unsafe { regs.dr().read().0 as u16 }; | 274 | unsafe { |
| 275 | let dr = regs.dr().ptr() as *const u16; | ||
| 276 | *word = ptr::read_volatile(dr); | ||
| 277 | } | ||
| 278 | |||
| 264 | let sr = unsafe { regs.sr().read() }; | 279 | let sr = unsafe { regs.sr().read() }; |
| 265 | if sr.fre() { | 280 | if sr.fre() { |
| 266 | return Err(Error::Framing); | 281 | return Err(Error::Framing); |
diff --git a/embassy-stm32/src/spi/v2.rs b/embassy-stm32/src/spi/v2.rs index b6ae8b275..393adc4e9 100644 --- a/embassy-stm32/src/spi/v2.rs +++ b/embassy-stm32/src/spi/v2.rs | |||
| @@ -4,9 +4,10 @@ use crate::gpio::{AnyPin, Pin}; | |||
| 4 | use crate::pac::gpio::vals::{Afr, Moder}; | 4 | use crate::pac::gpio::vals::{Afr, Moder}; |
| 5 | use crate::pac::gpio::Gpio; | 5 | use crate::pac::gpio::Gpio; |
| 6 | use crate::pac::spi; | 6 | use crate::pac::spi; |
| 7 | use crate::spi::{ByteOrder, Config, Instance, MisoPin, MosiPin, SckPin, WordSize}; | 7 | use crate::spi::{ByteOrder, Config, Error, Instance, MisoPin, MosiPin, SckPin, WordSize}; |
| 8 | use crate::time::Hertz; | 8 | use crate::time::Hertz; |
| 9 | use core::marker::PhantomData; | 9 | use core::marker::PhantomData; |
| 10 | use core::ptr; | ||
| 10 | use embassy::util::Unborrow; | 11 | use embassy::util::Unborrow; |
| 11 | use embassy_extras::unborrow; | 12 | use embassy_extras::unborrow; |
| 12 | pub use embedded_hal::spi::{Mode, Phase, Polarity, MODE_0, MODE_1, MODE_2, MODE_3}; | 13 | pub use embedded_hal::spi::{Mode, Phase, Polarity, MODE_0, MODE_1, MODE_2, MODE_3}; |
| @@ -52,25 +53,22 @@ impl<'d, T: Instance> Spi<'d, T> { | |||
| 52 | unborrow!(sck, mosi, miso); | 53 | unborrow!(sck, mosi, miso); |
| 53 | 54 | ||
| 54 | unsafe { | 55 | unsafe { |
| 55 | Self::configure_pin(sck.block(), sck.pin() as _, sck.af()); | 56 | Self::configure_pin(sck.block(), sck.pin() as _, sck.af_num()); |
| 56 | Self::configure_pin(mosi.block(), mosi.pin() as _, mosi.af()); | 57 | Self::configure_pin(mosi.block(), mosi.pin() as _, mosi.af_num()); |
| 57 | Self::configure_pin(miso.block(), miso.pin() as _, miso.af()); | 58 | Self::configure_pin(miso.block(), miso.pin() as _, miso.af_num()); |
| 58 | } | 59 | } |
| 59 | 60 | ||
| 60 | let sck = sck.degrade(); | 61 | let sck = sck.degrade(); |
| 61 | let mosi = mosi.degrade(); | 62 | let mosi = mosi.degrade(); |
| 62 | let miso = miso.degrade(); | 63 | let miso = miso.degrade(); |
| 63 | 64 | ||
| 64 | unsafe { | ||
| 65 | T::regs().cr2().write(|w| { | ||
| 66 | w.set_ssoe(false); | ||
| 67 | }); | ||
| 68 | } | ||
| 69 | |||
| 70 | let br = Self::compute_baud_rate(pclk, freq.into()); | 65 | let br = Self::compute_baud_rate(pclk, freq.into()); |
| 71 | 66 | ||
| 72 | unsafe { | 67 | unsafe { |
| 73 | T::regs().cr1().write(|w| { | 68 | T::regs().cr2().modify(|w| { |
| 69 | w.set_ssoe(false); | ||
| 70 | }); | ||
| 71 | T::regs().cr1().modify(|w| { | ||
| 74 | w.set_cpha( | 72 | w.set_cpha( |
| 75 | match config.mode.phase == Phase::CaptureOnSecondTransition { | 73 | match config.mode.phase == Phase::CaptureOnSecondTransition { |
| 76 | true => spi::vals::Cpha::SECONDEDGE, | 74 | true => spi::vals::Cpha::SECONDEDGE, |
| @@ -84,7 +82,6 @@ impl<'d, T: Instance> Spi<'d, T> { | |||
| 84 | 82 | ||
| 85 | w.set_mstr(spi::vals::Mstr::MASTER); | 83 | w.set_mstr(spi::vals::Mstr::MASTER); |
| 86 | w.set_br(spi::vals::Br(br)); | 84 | w.set_br(spi::vals::Br(br)); |
| 87 | w.set_spe(true); | ||
| 88 | w.set_lsbfirst(match config.byte_order { | 85 | w.set_lsbfirst(match config.byte_order { |
| 89 | ByteOrder::LsbFirst => spi::vals::Lsbfirst::LSBFIRST, | 86 | ByteOrder::LsbFirst => spi::vals::Lsbfirst::LSBFIRST, |
| 90 | ByteOrder::MsbFirst => spi::vals::Lsbfirst::MSBFIRST, | 87 | ByteOrder::MsbFirst => spi::vals::Lsbfirst::MSBFIRST, |
| @@ -93,6 +90,7 @@ impl<'d, T: Instance> Spi<'d, T> { | |||
| 93 | w.set_ssm(true); | 90 | w.set_ssm(true); |
| 94 | w.set_crcen(false); | 91 | w.set_crcen(false); |
| 95 | w.set_bidimode(spi::vals::Bidimode::UNIDIRECTIONAL); | 92 | w.set_bidimode(spi::vals::Bidimode::UNIDIRECTIONAL); |
| 93 | w.set_spe(true); | ||
| 96 | }); | 94 | }); |
| 97 | } | 95 | } |
| 98 | 96 | ||
| @@ -131,9 +129,15 @@ impl<'d, T: Instance> Spi<'d, T> { | |||
| 131 | 129 | ||
| 132 | fn set_word_size(word_size: WordSize) { | 130 | fn set_word_size(word_size: WordSize) { |
| 133 | unsafe { | 131 | unsafe { |
| 134 | T::regs().cr2().write(|w| { | 132 | T::regs().cr1().modify(|w| { |
| 135 | w.set_ds(word_size.ds()); | 133 | w.set_spe(false); |
| 134 | }); | ||
| 135 | T::regs().cr2().modify(|w| { | ||
| 136 | w.set_frxth(word_size.frxth()); | 136 | w.set_frxth(word_size.frxth()); |
| 137 | w.set_ds(word_size.ds()); | ||
| 138 | }); | ||
| 139 | T::regs().cr1().modify(|w| { | ||
| 140 | w.set_spe(true); | ||
| 137 | }); | 141 | }); |
| 138 | } | 142 | } |
| 139 | } | 143 | } |
| @@ -149,12 +153,6 @@ impl<'d, T: Instance> Drop for Spi<'d, T> { | |||
| 149 | } | 153 | } |
| 150 | } | 154 | } |
| 151 | 155 | ||
| 152 | pub enum Error { | ||
| 153 | Framing, | ||
| 154 | Crc, | ||
| 155 | Overrun, | ||
| 156 | } | ||
| 157 | |||
| 158 | impl<'d, T: Instance> embedded_hal::blocking::spi::Write<u8> for Spi<'d, T> { | 156 | impl<'d, T: Instance> embedded_hal::blocking::spi::Write<u8> for Spi<'d, T> { |
| 159 | type Error = Error; | 157 | type Error = Error; |
| 160 | 158 | ||
| @@ -162,12 +160,13 @@ impl<'d, T: Instance> embedded_hal::blocking::spi::Write<u8> for Spi<'d, T> { | |||
| 162 | Self::set_word_size(WordSize::EightBit); | 160 | Self::set_word_size(WordSize::EightBit); |
| 163 | let regs = T::regs(); | 161 | let regs = T::regs(); |
| 164 | 162 | ||
| 165 | for word in words.iter() { | 163 | for (i, word) in words.iter().enumerate() { |
| 166 | while unsafe { !regs.sr().read().txe() } { | 164 | while unsafe { !regs.sr().read().txe() } { |
| 167 | // spin | 165 | // spin |
| 168 | } | 166 | } |
| 169 | unsafe { | 167 | unsafe { |
| 170 | regs.dr().write(|reg| reg.0 = *word as u32); | 168 | let dr = regs.dr().ptr() as *mut u8; |
| 169 | ptr::write_volatile(dr, *word); | ||
| 171 | } | 170 | } |
| 172 | loop { | 171 | loop { |
| 173 | let sr = unsafe { regs.sr().read() }; | 172 | let sr = unsafe { regs.sr().read() }; |
| @@ -197,17 +196,33 @@ impl<'d, T: Instance> embedded_hal::blocking::spi::Transfer<u8> for Spi<'d, T> { | |||
| 197 | Self::set_word_size(WordSize::EightBit); | 196 | Self::set_word_size(WordSize::EightBit); |
| 198 | let regs = T::regs(); | 197 | let regs = T::regs(); |
| 199 | 198 | ||
| 200 | for word in words.iter_mut() { | 199 | for (i, word) in words.iter_mut().enumerate() { |
| 201 | while unsafe { !regs.sr().read().txe() } { | 200 | while unsafe { !regs.sr().read().txe() } { |
| 202 | // spin | 201 | // spin |
| 203 | } | 202 | } |
| 204 | unsafe { | 203 | unsafe { |
| 205 | regs.dr().write(|reg| reg.0 = *word as u32); | 204 | let dr = regs.dr().ptr() as *mut u8; |
| 205 | ptr::write_volatile(dr, *word); | ||
| 206 | } | 206 | } |
| 207 | while unsafe { !regs.sr().read().rxne() } { | 207 | loop { |
| 208 | // spin waiting for inbound to shift in. | 208 | let sr = unsafe { regs.sr().read() }; |
| 209 | if sr.rxne() { | ||
| 210 | break; | ||
| 211 | } | ||
| 212 | if sr.fre() { | ||
| 213 | return Err(Error::Framing); | ||
| 214 | } | ||
| 215 | if sr.ovr() { | ||
| 216 | return Err(Error::Overrun); | ||
| 217 | } | ||
| 218 | if sr.crcerr() { | ||
| 219 | return Err(Error::Crc); | ||
| 220 | } | ||
| 221 | } | ||
| 222 | unsafe { | ||
| 223 | let dr = regs.dr().ptr() as *const u8; | ||
| 224 | *word = ptr::read_volatile(dr); | ||
| 209 | } | 225 | } |
| 210 | *word = unsafe { regs.dr().read().0 as u8 }; | ||
| 211 | let sr = unsafe { regs.sr().read() }; | 226 | let sr = unsafe { regs.sr().read() }; |
| 212 | if sr.fre() { | 227 | if sr.fre() { |
| 213 | return Err(Error::Framing); | 228 | return Err(Error::Framing); |
| @@ -236,7 +251,8 @@ impl<'d, T: Instance> embedded_hal::blocking::spi::Write<u16> for Spi<'d, T> { | |||
| 236 | // spin | 251 | // spin |
| 237 | } | 252 | } |
| 238 | unsafe { | 253 | unsafe { |
| 239 | regs.dr().write(|reg| reg.0 = *word as u32); | 254 | let dr = regs.dr().ptr() as *mut u16; |
| 255 | ptr::write_volatile(dr, *word); | ||
| 240 | } | 256 | } |
| 241 | loop { | 257 | loop { |
| 242 | let sr = unsafe { regs.sr().read() }; | 258 | let sr = unsafe { regs.sr().read() }; |
| @@ -271,12 +287,16 @@ impl<'d, T: Instance> embedded_hal::blocking::spi::Transfer<u16> for Spi<'d, T> | |||
| 271 | // spin | 287 | // spin |
| 272 | } | 288 | } |
| 273 | unsafe { | 289 | unsafe { |
| 274 | regs.dr().write(|reg| reg.0 = *word as u32); | 290 | let dr = regs.dr().ptr() as *mut u16; |
| 291 | ptr::write_volatile(dr, *word); | ||
| 275 | } | 292 | } |
| 276 | while unsafe { !regs.sr().read().rxne() } { | 293 | while unsafe { !regs.sr().read().rxne() } { |
| 277 | // spin waiting for inbound to shift in. | 294 | // spin waiting for inbound to shift in. |
| 278 | } | 295 | } |
| 279 | *word = unsafe { regs.dr().read().0 as u16 }; | 296 | unsafe { |
| 297 | let dr = regs.dr().ptr() as *const u16; | ||
| 298 | *word = ptr::read_volatile(dr); | ||
| 299 | } | ||
| 280 | let sr = unsafe { regs.sr().read() }; | 300 | let sr = unsafe { regs.sr().read() }; |
| 281 | if sr.fre() { | 301 | if sr.fre() { |
| 282 | return Err(Error::Framing); | 302 | return Err(Error::Framing); |
diff --git a/embassy-stm32/src/spi/v3.rs b/embassy-stm32/src/spi/v3.rs new file mode 100644 index 000000000..c3f66430c --- /dev/null +++ b/embassy-stm32/src/spi/v3.rs | |||
| @@ -0,0 +1,360 @@ | |||
| 1 | #![macro_use] | ||
| 2 | |||
| 3 | use crate::gpio::{AnyPin, Pin}; | ||
| 4 | use crate::pac::gpio::vals::{Afr, Moder}; | ||
| 5 | use crate::pac::gpio::Gpio; | ||
| 6 | use crate::pac::spi; | ||
| 7 | use crate::spi::{ByteOrder, Config, Error, Instance, MisoPin, MosiPin, SckPin, WordSize}; | ||
| 8 | use crate::time::Hertz; | ||
| 9 | use core::marker::PhantomData; | ||
| 10 | use core::ptr; | ||
| 11 | use embassy::util::Unborrow; | ||
| 12 | use embassy_extras::unborrow; | ||
| 13 | pub use embedded_hal::spi::{Mode, Phase, Polarity, MODE_0, MODE_1, MODE_2, MODE_3}; | ||
| 14 | |||
| 15 | impl WordSize { | ||
| 16 | fn dsize(&self) -> u8 { | ||
| 17 | match self { | ||
| 18 | WordSize::EightBit => 0b0111, | ||
| 19 | WordSize::SixteenBit => 0b1111, | ||
| 20 | } | ||
| 21 | } | ||
| 22 | |||
| 23 | fn frxth(&self) -> spi::vals::Fthlv { | ||
| 24 | match self { | ||
| 25 | WordSize::EightBit => spi::vals::Fthlv::ONEFRAME, | ||
| 26 | WordSize::SixteenBit => spi::vals::Fthlv::ONEFRAME, | ||
| 27 | } | ||
| 28 | } | ||
| 29 | } | ||
| 30 | |||
| 31 | pub struct Spi<'d, T: Instance> { | ||
| 32 | //peri: T, | ||
| 33 | sck: AnyPin, | ||
| 34 | mosi: AnyPin, | ||
| 35 | miso: AnyPin, | ||
| 36 | phantom: PhantomData<&'d mut T>, | ||
| 37 | } | ||
| 38 | |||
| 39 | impl<'d, T: Instance> Spi<'d, T> { | ||
| 40 | pub fn new<F>( | ||
| 41 | pclk: Hertz, | ||
| 42 | peri: impl Unborrow<Target = T> + 'd, | ||
| 43 | sck: impl Unborrow<Target = impl SckPin<T>>, | ||
| 44 | mosi: impl Unborrow<Target = impl MosiPin<T>>, | ||
| 45 | miso: impl Unborrow<Target = impl MisoPin<T>>, | ||
| 46 | freq: F, | ||
| 47 | config: Config, | ||
| 48 | ) -> Self | ||
| 49 | where | ||
| 50 | F: Into<Hertz>, | ||
| 51 | { | ||
| 52 | unborrow!(peri); | ||
| 53 | unborrow!(sck, mosi, miso); | ||
| 54 | |||
| 55 | unsafe { | ||
| 56 | Self::configure_pin(sck.block(), sck.pin() as _, sck.af_num()); | ||
| 57 | //sck.block().otyper().modify(|w| w.set_ot(sck.pin() as _, crate::pac::gpio::vals::Ot::PUSHPULL)); | ||
| 58 | Self::configure_pin(mosi.block(), mosi.pin() as _, mosi.af_num()); | ||
| 59 | //mosi.block().otyper().modify(|w| w.set_ot(mosi.pin() as _, crate::pac::gpio::vals::Ot::PUSHPULL)); | ||
| 60 | Self::configure_pin(miso.block(), miso.pin() as _, miso.af_num()); | ||
| 61 | } | ||
| 62 | |||
| 63 | let sck = sck.degrade(); | ||
| 64 | let mosi = mosi.degrade(); | ||
| 65 | let miso = miso.degrade(); | ||
| 66 | |||
| 67 | let br = Self::compute_baud_rate(pclk, freq.into()); | ||
| 68 | unsafe { | ||
| 69 | T::regs().ifcr().write(|w| w.0 = 0xffff_ffff); | ||
| 70 | T::regs().cfg2().modify(|w| { | ||
| 71 | //w.set_ssoe(true); | ||
| 72 | w.set_ssoe(false); | ||
| 73 | w.set_cpha( | ||
| 74 | match config.mode.phase == Phase::CaptureOnSecondTransition { | ||
| 75 | true => spi::vals::Cpha::SECONDEDGE, | ||
| 76 | false => spi::vals::Cpha::FIRSTEDGE, | ||
| 77 | }, | ||
| 78 | ); | ||
| 79 | w.set_cpol(match config.mode.polarity == Polarity::IdleHigh { | ||
| 80 | true => spi::vals::Cpol::IDLEHIGH, | ||
| 81 | false => spi::vals::Cpol::IDLELOW, | ||
| 82 | }); | ||
| 83 | w.set_lsbfrst(match config.byte_order { | ||
| 84 | ByteOrder::LsbFirst => spi::vals::Lsbfrst::LSBFIRST, | ||
| 85 | ByteOrder::MsbFirst => spi::vals::Lsbfrst::MSBFIRST, | ||
| 86 | }); | ||
| 87 | w.set_ssm(true); | ||
| 88 | w.set_master(spi::vals::Master::MASTER); | ||
| 89 | w.set_comm(spi::vals::Comm::FULLDUPLEX); | ||
| 90 | w.set_ssom(spi::vals::Ssom::ASSERTED); | ||
| 91 | w.set_midi(0); | ||
| 92 | w.set_mssi(0); | ||
| 93 | w.set_afcntr(spi::vals::Afcntr::CONTROLLED); | ||
| 94 | w.set_ssiop(spi::vals::Ssiop::ACTIVEHIGH); | ||
| 95 | }); | ||
| 96 | T::regs().cfg1().modify(|w| { | ||
| 97 | w.set_crcen(false); | ||
| 98 | w.set_mbr(spi::vals::Mbr(br)); | ||
| 99 | w.set_dsize(WordSize::EightBit.dsize()); | ||
| 100 | //w.set_fthlv(WordSize::EightBit.frxth()); | ||
| 101 | }); | ||
| 102 | T::regs().cr2().modify(|w| { | ||
| 103 | w.set_tsize(0); | ||
| 104 | w.set_tser(0); | ||
| 105 | }); | ||
| 106 | T::regs().cr1().modify(|w| { | ||
| 107 | w.set_ssi(false); | ||
| 108 | w.set_spe(true); | ||
| 109 | }); | ||
| 110 | } | ||
| 111 | |||
| 112 | Self { | ||
| 113 | //peri, | ||
| 114 | sck, | ||
| 115 | mosi, | ||
| 116 | miso, | ||
| 117 | phantom: PhantomData, | ||
| 118 | } | ||
| 119 | } | ||
| 120 | |||
| 121 | unsafe fn configure_pin(block: Gpio, pin: usize, af_num: u8) { | ||
| 122 | let (afr, n_af) = if pin < 8 { (0, pin) } else { (1, pin - 8) }; | ||
| 123 | block.moder().modify(|w| w.set_moder(pin, Moder::ALTERNATE)); | ||
| 124 | block.afr(afr).modify(|w| w.set_afr(n_af, Afr(af_num))); | ||
| 125 | block | ||
| 126 | .ospeedr() | ||
| 127 | .modify(|w| w.set_ospeedr(pin, crate::pac::gpio::vals::Ospeedr::VERYHIGHSPEED)); | ||
| 128 | } | ||
| 129 | |||
| 130 | unsafe fn unconfigure_pin(block: Gpio, pin: usize) { | ||
| 131 | block.moder().modify(|w| w.set_moder(pin, Moder::ANALOG)); | ||
| 132 | } | ||
| 133 | |||
| 134 | fn compute_baud_rate(clocks: Hertz, freq: Hertz) -> u8 { | ||
| 135 | match clocks.0 / freq.0 { | ||
| 136 | 0 => unreachable!(), | ||
| 137 | 1..=2 => 0b000, | ||
| 138 | 3..=5 => 0b001, | ||
| 139 | 6..=11 => 0b010, | ||
| 140 | 12..=23 => 0b011, | ||
| 141 | 24..=39 => 0b100, | ||
| 142 | 40..=95 => 0b101, | ||
| 143 | 96..=191 => 0b110, | ||
| 144 | _ => 0b111, | ||
| 145 | } | ||
| 146 | } | ||
| 147 | |||
| 148 | fn set_word_size(word_size: WordSize) { | ||
| 149 | unsafe { | ||
| 150 | T::regs().cr1().modify(|w| { | ||
| 151 | w.set_csusp(true); | ||
| 152 | }); | ||
| 153 | while T::regs().sr().read().eot() {} | ||
| 154 | T::regs().cr1().modify(|w| { | ||
| 155 | w.set_spe(false); | ||
| 156 | }); | ||
| 157 | T::regs().cfg1().modify(|w| { | ||
| 158 | w.set_dsize(word_size.dsize()); | ||
| 159 | }); | ||
| 160 | T::regs().cr1().modify(|w| { | ||
| 161 | w.set_spe(true); | ||
| 162 | }); | ||
| 163 | } | ||
| 164 | } | ||
| 165 | } | ||
| 166 | |||
| 167 | impl<'d, T: Instance> Drop for Spi<'d, T> { | ||
| 168 | fn drop(&mut self) { | ||
| 169 | unsafe { | ||
| 170 | Self::unconfigure_pin(self.sck.block(), self.sck.pin() as _); | ||
| 171 | Self::unconfigure_pin(self.mosi.block(), self.mosi.pin() as _); | ||
| 172 | Self::unconfigure_pin(self.miso.block(), self.miso.pin() as _); | ||
| 173 | } | ||
| 174 | } | ||
| 175 | } | ||
| 176 | |||
| 177 | impl<'d, T: Instance> embedded_hal::blocking::spi::Write<u8> for Spi<'d, T> { | ||
| 178 | type Error = Error; | ||
| 179 | |||
| 180 | fn write(&mut self, words: &[u8]) -> Result<(), Self::Error> { | ||
| 181 | Self::set_word_size(WordSize::EightBit); | ||
| 182 | let regs = T::regs(); | ||
| 183 | |||
| 184 | for word in words.iter() { | ||
| 185 | while unsafe { !regs.sr().read().txp() } { | ||
| 186 | // spin | ||
| 187 | } | ||
| 188 | unsafe { | ||
| 189 | let txdr = regs.txdr().ptr() as *mut u8; | ||
| 190 | ptr::write_volatile(txdr, *word); | ||
| 191 | regs.cr1().modify(|reg| reg.set_cstart(true)); | ||
| 192 | } | ||
| 193 | loop { | ||
| 194 | let sr = unsafe { regs.sr().read() }; | ||
| 195 | if sr.tifre() { | ||
| 196 | return Err(Error::Framing); | ||
| 197 | } | ||
| 198 | if sr.ovr() { | ||
| 199 | return Err(Error::Overrun); | ||
| 200 | } | ||
| 201 | if sr.crce() { | ||
| 202 | return Err(Error::Crc); | ||
| 203 | } | ||
| 204 | if !sr.txp() { | ||
| 205 | // loop waiting for TXE | ||
| 206 | } | ||
| 207 | } | ||
| 208 | } | ||
| 209 | |||
| 210 | Ok(()) | ||
| 211 | } | ||
| 212 | } | ||
| 213 | |||
| 214 | impl<'d, T: Instance> embedded_hal::blocking::spi::Transfer<u8> for Spi<'d, T> { | ||
| 215 | type Error = Error; | ||
| 216 | |||
| 217 | fn transfer<'w>(&mut self, words: &'w mut [u8]) -> Result<&'w [u8], Self::Error> { | ||
| 218 | Self::set_word_size(WordSize::EightBit); | ||
| 219 | let regs = T::regs(); | ||
| 220 | |||
| 221 | for (i, word) in words.iter_mut().enumerate() { | ||
| 222 | unsafe { | ||
| 223 | regs.cr1().modify(|reg| { | ||
| 224 | reg.set_ssi(false); | ||
| 225 | }); | ||
| 226 | } | ||
| 227 | while unsafe { !regs.sr().read().txp() } { | ||
| 228 | // spin | ||
| 229 | } | ||
| 230 | unsafe { | ||
| 231 | let txdr = regs.txdr().ptr() as *mut u8; | ||
| 232 | ptr::write_volatile(txdr, *word); | ||
| 233 | regs.cr1().modify(|reg| reg.set_cstart(true)); | ||
| 234 | } | ||
| 235 | loop { | ||
| 236 | let sr = unsafe { regs.sr().read() }; | ||
| 237 | |||
| 238 | if sr.rxp() { | ||
| 239 | break; | ||
| 240 | } | ||
| 241 | if sr.tifre() { | ||
| 242 | return Err(Error::Framing); | ||
| 243 | } | ||
| 244 | if sr.ovr() { | ||
| 245 | return Err(Error::Overrun); | ||
| 246 | } | ||
| 247 | if sr.crce() { | ||
| 248 | return Err(Error::Crc); | ||
| 249 | } | ||
| 250 | } | ||
| 251 | unsafe { | ||
| 252 | let rxdr = regs.rxdr().ptr() as *const u8; | ||
| 253 | *word = ptr::read_volatile(rxdr); | ||
| 254 | } | ||
| 255 | let sr = unsafe { regs.sr().read() }; | ||
| 256 | if sr.tifre() { | ||
| 257 | return Err(Error::Framing); | ||
| 258 | } | ||
| 259 | if sr.ovr() { | ||
| 260 | return Err(Error::Overrun); | ||
| 261 | } | ||
| 262 | if sr.crce() { | ||
| 263 | return Err(Error::Crc); | ||
| 264 | } | ||
| 265 | } | ||
| 266 | |||
| 267 | Ok(words) | ||
| 268 | } | ||
| 269 | } | ||
| 270 | |||
| 271 | impl<'d, T: Instance> embedded_hal::blocking::spi::Write<u16> for Spi<'d, T> { | ||
| 272 | type Error = Error; | ||
| 273 | |||
| 274 | fn write(&mut self, words: &[u16]) -> Result<(), Self::Error> { | ||
| 275 | Self::set_word_size(WordSize::SixteenBit); | ||
| 276 | let regs = T::regs(); | ||
| 277 | |||
| 278 | for word in words.iter() { | ||
| 279 | while unsafe { !regs.sr().read().txp() } { | ||
| 280 | // spin | ||
| 281 | } | ||
| 282 | unsafe { | ||
| 283 | let txdr = regs.txdr().ptr() as *mut u16; | ||
| 284 | ptr::write_volatile(txdr, *word); | ||
| 285 | regs.cr1().modify(|reg| reg.set_cstart(true)); | ||
| 286 | } | ||
| 287 | loop { | ||
| 288 | let sr = unsafe { regs.sr().read() }; | ||
| 289 | if sr.tifre() { | ||
| 290 | return Err(Error::Framing); | ||
| 291 | } | ||
| 292 | if sr.ovr() { | ||
| 293 | return Err(Error::Overrun); | ||
| 294 | } | ||
| 295 | if sr.crce() { | ||
| 296 | return Err(Error::Crc); | ||
| 297 | } | ||
| 298 | if !sr.txp() { | ||
| 299 | // loop waiting for TXE | ||
| 300 | } | ||
| 301 | } | ||
| 302 | } | ||
| 303 | |||
| 304 | Ok(()) | ||
| 305 | } | ||
| 306 | } | ||
| 307 | |||
| 308 | impl<'d, T: Instance> embedded_hal::blocking::spi::Transfer<u16> for Spi<'d, T> { | ||
| 309 | type Error = Error; | ||
| 310 | |||
| 311 | fn transfer<'w>(&mut self, words: &'w mut [u16]) -> Result<&'w [u16], Self::Error> { | ||
| 312 | Self::set_word_size(WordSize::SixteenBit); | ||
| 313 | let regs = T::regs(); | ||
| 314 | |||
| 315 | for word in words.iter_mut() { | ||
| 316 | while unsafe { !regs.sr().read().txp() } { | ||
| 317 | // spin | ||
| 318 | } | ||
| 319 | unsafe { | ||
| 320 | let txdr = regs.txdr().ptr() as *mut u16; | ||
| 321 | ptr::write_volatile(txdr, *word); | ||
| 322 | regs.cr1().modify(|reg| reg.set_cstart(true)); | ||
| 323 | } | ||
| 324 | |||
| 325 | loop { | ||
| 326 | let sr = unsafe { regs.sr().read() }; | ||
| 327 | |||
| 328 | if sr.rxp() { | ||
| 329 | break; | ||
| 330 | } | ||
| 331 | if sr.tifre() { | ||
| 332 | return Err(Error::Framing); | ||
| 333 | } | ||
| 334 | if sr.ovr() { | ||
| 335 | return Err(Error::Overrun); | ||
| 336 | } | ||
| 337 | if sr.crce() { | ||
| 338 | return Err(Error::Crc); | ||
| 339 | } | ||
| 340 | } | ||
| 341 | |||
| 342 | unsafe { | ||
| 343 | let rxdr = regs.rxdr().ptr() as *const u16; | ||
| 344 | *word = ptr::read_volatile(rxdr); | ||
| 345 | } | ||
| 346 | let sr = unsafe { regs.sr().read() }; | ||
| 347 | if sr.tifre() { | ||
| 348 | return Err(Error::Framing); | ||
| 349 | } | ||
| 350 | if sr.ovr() { | ||
| 351 | return Err(Error::Overrun); | ||
| 352 | } | ||
| 353 | if sr.crce() { | ||
| 354 | return Err(Error::Crc); | ||
| 355 | } | ||
| 356 | } | ||
| 357 | |||
| 358 | Ok(words) | ||
| 359 | } | ||
| 360 | } | ||
diff --git a/embassy-stm32/stm32-data b/embassy-stm32/stm32-data | |||
| Subproject 67db3905b34f062c55ceff09b1beac8444b78ca | Subproject 982713663b9e7359ca0acd55231bb90dfc25e68 | ||
