diff options
126 files changed, 24366 insertions, 11316 deletions
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml index 0fa08150e..7fce5b87a 100644 --- a/embassy-stm32/Cargo.toml +++ b/embassy-stm32/Cargo.toml | |||
| @@ -31,6 +31,9 @@ defmt-info = [ ] | |||
| 31 | defmt-warn = [ ] | 31 | defmt-warn = [ ] |
| 32 | defmt-error = [ ] | 32 | defmt-error = [ ] |
| 33 | sdmmc-rs = ["embedded-sdmmc"] | 33 | sdmmc-rs = ["embedded-sdmmc"] |
| 34 | # Unstable feature to give access to the pac used in embassy-stm32, changes with this feature don't | ||
| 35 | # follow semver | ||
| 36 | pac = [] | ||
| 34 | 37 | ||
| 35 | # BEGIN GENERATED FEATURES | 38 | # BEGIN GENERATED FEATURES |
| 36 | stm32f401cb = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_spi", "_spi_v1", "_stm32f4", "_syscfg", "_syscfg_f4", "_usart", "_usart_v1",] | 39 | stm32f401cb = [ "_dma", "_dma_v2", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_spi", "_spi_v1", "_stm32f4", "_syscfg", "_syscfg_f4", "_usart", "_usart_v1",] |
| @@ -182,119 +185,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",] | 185 | 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",] | 186 | 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",] | 187 | 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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 188 | stm32h723ve = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 189 | stm32h723vg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 190 | stm32h723ze = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 191 | stm32h723zg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 192 | stm32h725ae = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 193 | stm32h725ag = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 194 | stm32h725ie = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 195 | stm32h725ig = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 196 | stm32h725re = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 197 | stm32h725rg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 198 | stm32h725ve = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 199 | stm32h725vg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 200 | stm32h725ze = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 201 | stm32h725zg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 202 | stm32h730ab = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 203 | stm32h730ib = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 204 | stm32h730vb = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 205 | stm32h730zb = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 206 | stm32h733vg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 207 | stm32h733zg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 208 | stm32h735ag = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 209 | stm32h735ig = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 210 | stm32h735rg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 211 | stm32h735vg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 212 | stm32h735zg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 213 | stm32h742ag = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 214 | stm32h742ai = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 215 | stm32h742bg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 216 | stm32h742bi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 217 | stm32h742ig = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 218 | stm32h742ii = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 219 | stm32h742vg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 220 | stm32h742vi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 221 | stm32h742xg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 222 | stm32h742xi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 223 | stm32h742zg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 224 | stm32h742zi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 225 | stm32h743ag = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 226 | stm32h743ai = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 227 | stm32h743bg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 228 | stm32h743bi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 229 | stm32h743ig = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 230 | stm32h743ii = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 231 | stm32h743vg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 232 | stm32h743vi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 233 | stm32h743xg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 234 | stm32h743xi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 235 | stm32h743zg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 236 | stm32h743zi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 237 | stm32h745bg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 238 | stm32h745bi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 239 | stm32h745ig = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 240 | stm32h745ii = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 241 | stm32h745xg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 242 | stm32h745xi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 243 | stm32h745zg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 244 | stm32h745zi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 245 | stm32h747ag = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 246 | stm32h747ai = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 247 | stm32h747bg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 248 | stm32h747bi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 249 | stm32h747ig = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 250 | stm32h747ii = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 251 | stm32h747xg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 252 | stm32h747xi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 253 | stm32h747zi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 254 | stm32h750ib = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 255 | stm32h750vb = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 256 | stm32h750xb = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 257 | stm32h750zb = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 258 | stm32h753ai = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 259 | stm32h753bi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 260 | stm32h753ii = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 261 | stm32h753vi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 262 | stm32h753xi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 263 | stm32h753zi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 264 | stm32h755bi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 265 | stm32h755ii = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 266 | stm32h755xi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 267 | stm32h755zi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 268 | stm32h757ai = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 269 | stm32h757bi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 270 | stm32h757ii = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 271 | stm32h757xi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 272 | stm32h757zi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rcc", "_rcc_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 273 | stm32h7a3ag = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 274 | stm32h7a3ai = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 275 | stm32h7a3ig = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 276 | stm32h7a3ii = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 277 | stm32h7a3lg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 278 | stm32h7a3li = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 279 | stm32h7a3ng = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 280 | stm32h7a3ni = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 281 | stm32h7a3qi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 282 | stm32h7a3rg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 283 | stm32h7a3ri = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 284 | stm32h7a3vg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 285 | stm32h7a3vi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 286 | stm32h7a3zg = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 287 | stm32h7a3zi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 288 | stm32h7b0ab = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 289 | stm32h7b0ib = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 290 | stm32h7b0rb = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 291 | stm32h7b0vb = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 292 | stm32h7b0zb = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 293 | stm32h7b3ai = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 294 | stm32h7b3ii = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 295 | stm32h7b3li = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 296 | stm32h7b3ni = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 297 | stm32h7b3qi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 298 | stm32h7b3ri = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 299 | stm32h7b3vi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_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", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] | 300 | stm32h7b3zi = [ "_dbgmcu", "_dbgmcu_h7", "_dma", "_dma_v2", "_exti", "_exti_v1", "_flash", "_flash_h7", "_gpio", "_gpio_v2", "_i2c", "_i2c_v2", "_pwr", "_pwr_h7", "_rng", "_rng_v1", "_sdmmc", "_sdmmc_v2", "_spi", "_spi_v3", "_stm32h7", "_syscfg", "_syscfg_h7",] |
| 298 | stm32l010c6 = [ "_dma", "_dma_v1", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rcc", "_rcc_l0", "_stm32l0", "_syscfg", "_syscfg_l0", "_usart", "_usart_v2",] | 301 | stm32l010c6 = [ "_dma", "_dma_v1", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rcc", "_rcc_l0", "_stm32l0", "_syscfg", "_syscfg_l0", "_usart", "_usart_v2",] |
| 299 | stm32l010f4 = [ "_dma", "_dma_v1", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rcc", "_rcc_l0", "_stm32l0", "_syscfg", "_syscfg_l0", "_usart", "_usart_v2",] | 302 | stm32l010f4 = [ "_dma", "_dma_v1", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rcc", "_rcc_l0", "_stm32l0", "_syscfg", "_syscfg_l0", "_usart", "_usart_v2",] |
| 300 | stm32l010k4 = [ "_dma", "_dma_v1", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rcc", "_rcc_l0", "_stm32l0", "_syscfg", "_syscfg_l0", "_usart", "_usart_v2",] | 303 | stm32l010k4 = [ "_dma", "_dma_v1", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rcc", "_rcc_l0", "_stm32l0", "_syscfg", "_syscfg_l0", "_usart", "_usart_v2",] |
| @@ -536,14 +539,23 @@ stm32l4s7zi = [ "_dma", "_dma_v1", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_r | |||
| 536 | stm32l4s9ai = [ "_dma", "_dma_v1", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_spi", "_spi_v2", "_stm32l4p", "_syscfg", "_syscfg_l4",] | 539 | stm32l4s9ai = [ "_dma", "_dma_v1", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_spi", "_spi_v2", "_stm32l4p", "_syscfg", "_syscfg_l4",] |
| 537 | stm32l4s9vi = [ "_dma", "_dma_v1", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_spi", "_spi_v2", "_stm32l4p", "_syscfg", "_syscfg_l4",] | 540 | stm32l4s9vi = [ "_dma", "_dma_v1", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_spi", "_spi_v2", "_stm32l4p", "_syscfg", "_syscfg_l4",] |
| 538 | stm32l4s9zi = [ "_dma", "_dma_v1", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_spi", "_spi_v2", "_stm32l4p", "_syscfg", "_syscfg_l4",] | 541 | stm32l4s9zi = [ "_dma", "_dma_v1", "_exti", "_exti_v1", "_gpio", "_gpio_v2", "_rng", "_rng_v1", "_spi", "_spi_v2", "_stm32l4p", "_syscfg", "_syscfg_l4",] |
| 542 | _dbgmcu = [] | ||
| 543 | _dbgmcu_h7 = [] | ||
| 539 | _dma = [] | 544 | _dma = [] |
| 540 | _dma_v1 = [] | 545 | _dma_v1 = [] |
| 541 | _dma_v2 = [] | 546 | _dma_v2 = [] |
| 542 | _exti = [] | 547 | _exti = [] |
| 543 | _exti_v1 = [] | 548 | _exti_v1 = [] |
| 549 | _flash = [] | ||
| 550 | _flash_h7 = [] | ||
| 544 | _gpio = [] | 551 | _gpio = [] |
| 545 | _gpio_v2 = [] | 552 | _gpio_v2 = [] |
| 553 | _i2c = [] | ||
| 554 | _i2c_v2 = [] | ||
| 555 | _pwr = [] | ||
| 556 | _pwr_h7 = [] | ||
| 546 | _rcc = [] | 557 | _rcc = [] |
| 558 | _rcc_h7 = [] | ||
| 547 | _rcc_l0 = [] | 559 | _rcc_l0 = [] |
| 548 | _rng = [ "rand_core",] | 560 | _rng = [ "rand_core",] |
| 549 | _rng_v1 = [] | 561 | _rng_v1 = [] |
diff --git a/embassy-stm32/gen.py b/embassy-stm32/gen.py index ba674207d..05cc3d3b7 100644 --- a/embassy-stm32/gen.py +++ b/embassy-stm32/gen.py | |||
| @@ -42,7 +42,8 @@ with open('src/pac/mod.rs', 'w') as f: | |||
| 42 | f'#[cfg_attr(feature="{chip["name"]}", path="{chip["name"]}.rs")]\n') | 42 | f'#[cfg_attr(feature="{chip["name"]}", path="{chip["name"]}.rs")]\n') |
| 43 | f.write('mod chip;\n') | 43 | f.write('mod chip;\n') |
| 44 | f.write('pub use chip::*;\n') | 44 | f.write('pub use chip::*;\n') |
| 45 | f.write('pub(crate) mod regs;\n') | 45 | f.write('#[allow(dead_code, unused_imports)]\n') |
| 46 | f.write('pub mod regs;\n') | ||
| 46 | 47 | ||
| 47 | # ========= Generate pac/stm32xxx.rs | 48 | # ========= Generate pac/stm32xxx.rs |
| 48 | 49 | ||
diff --git a/embassy-stm32/src/lib.rs b/embassy-stm32/src/lib.rs index c856c8eb1..8f8dd753b 100644 --- a/embassy-stm32/src/lib.rs +++ b/embassy-stm32/src/lib.rs | |||
| @@ -13,6 +13,8 @@ pub mod fmt; | |||
| 13 | pub mod dma; | 13 | pub mod dma; |
| 14 | pub mod exti; | 14 | pub mod exti; |
| 15 | pub mod gpio; | 15 | pub mod gpio; |
| 16 | pub mod pwr; | ||
| 17 | pub mod rcc; | ||
| 16 | #[cfg(feature = "_rng")] | 18 | #[cfg(feature = "_rng")] |
| 17 | pub mod rng; | 19 | pub mod rng; |
| 18 | #[cfg(feature = "_sdmmc")] | 20 | #[cfg(feature = "_sdmmc")] |
| @@ -23,8 +25,11 @@ pub mod spi; | |||
| 23 | pub mod usart; | 25 | pub mod usart; |
| 24 | 26 | ||
| 25 | // This must go LAST so that it sees the `impl_foo!` macros | 27 | // This must go LAST so that it sees the `impl_foo!` macros |
| 26 | mod pac; | 28 | #[cfg(feature = "pac")] |
| 29 | pub mod pac; | ||
| 27 | 30 | ||
| 31 | #[cfg(not(feature = "pac"))] | ||
| 32 | mod pac; | ||
| 28 | pub mod time; | 33 | pub mod time; |
| 29 | 34 | ||
| 30 | pub use embassy_macros::interrupt; | 35 | pub use embassy_macros::interrupt; |
diff --git a/embassy-stm32/src/pac/mod.rs b/embassy-stm32/src/pac/mod.rs index 4f629e33d..8ed31d7b4 100644 --- a/embassy-stm32/src/pac/mod.rs +++ b/embassy-stm32/src/pac/mod.rs | |||
| @@ -503,4 +503,5 @@ | |||
| 503 | #[cfg_attr(feature = "stm32l4s9zi", path = "stm32l4s9zi.rs")] | 503 | #[cfg_attr(feature = "stm32l4s9zi", path = "stm32l4s9zi.rs")] |
| 504 | mod chip; | 504 | mod chip; |
| 505 | pub use chip::*; | 505 | pub use chip::*; |
| 506 | pub(crate) mod regs; | 506 | #[allow(dead_code, unused_imports)] |
| 507 | pub mod regs; | ||
diff --git a/embassy-stm32/src/pac/regs.rs b/embassy-stm32/src/pac/regs.rs index 34742e420..f52a7d88e 100644 --- a/embassy-stm32/src/pac/regs.rs +++ b/embassy-stm32/src/pac/regs.rs | |||
| @@ -1,290 +1,340 @@ | |||
| 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 usart_v1 { | 3 | pub mod syscfg_l0 { |
| 4 | use crate::generic::*; | 4 | use crate::generic::*; |
| 5 | #[doc = "Universal synchronous asynchronous receiver transmitter"] | 5 | #[doc = "System configuration controller"] |
| 6 | #[derive(Copy, Clone)] | ||
| 7 | pub struct Usart(pub *mut u8); | ||
| 8 | unsafe impl Send for Usart {} | ||
| 9 | unsafe impl Sync for Usart {} | ||
| 10 | impl Usart { | ||
| 11 | #[doc = "Status register"] | ||
| 12 | pub fn sr(self) -> Reg<regs::Sr, RW> { | ||
| 13 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 14 | } | ||
| 15 | #[doc = "Data register"] | ||
| 16 | pub fn dr(self) -> Reg<regs::Dr, RW> { | ||
| 17 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 18 | } | ||
| 19 | #[doc = "Baud rate register"] | ||
| 20 | pub fn brr(self) -> Reg<regs::Brr, RW> { | ||
| 21 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 22 | } | ||
| 23 | #[doc = "Control register 1"] | ||
| 24 | pub fn cr1(self) -> Reg<regs::Cr1, RW> { | ||
| 25 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 26 | } | ||
| 27 | #[doc = "Control register 2"] | ||
| 28 | pub fn cr2(self) -> Reg<regs::Cr2Usart, RW> { | ||
| 29 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 30 | } | ||
| 31 | #[doc = "Control register 3"] | ||
| 32 | pub fn cr3(self) -> Reg<regs::Cr3Usart, RW> { | ||
| 33 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 34 | } | ||
| 35 | #[doc = "Guard time and prescaler register"] | ||
| 36 | pub fn gtpr(self) -> Reg<regs::Gtpr, RW> { | ||
| 37 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | ||
| 38 | } | ||
| 39 | } | ||
| 40 | #[doc = "Universal asynchronous receiver transmitter"] | ||
| 41 | #[derive(Copy, Clone)] | 6 | #[derive(Copy, Clone)] |
| 42 | pub struct Uart(pub *mut u8); | 7 | pub struct Syscfg(pub *mut u8); |
| 43 | unsafe impl Send for Uart {} | 8 | unsafe impl Send for Syscfg {} |
| 44 | unsafe impl Sync for Uart {} | 9 | unsafe impl Sync for Syscfg {} |
| 45 | impl Uart { | 10 | impl Syscfg { |
| 46 | #[doc = "Status register"] | 11 | #[doc = "configuration register 1"] |
| 47 | pub fn sr(self) -> Reg<regs::Sr, RW> { | 12 | pub fn cfgr1(self) -> Reg<regs::Cfgr1, RW> { |
| 48 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | 13 | unsafe { Reg::from_ptr(self.0.add(0usize)) } |
| 49 | } | 14 | } |
| 50 | #[doc = "Data register"] | 15 | #[doc = "CFGR2"] |
| 51 | pub fn dr(self) -> Reg<regs::Dr, RW> { | 16 | pub fn cfgr2(self) -> Reg<regs::Cfgr2, RW> { |
| 52 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | 17 | unsafe { Reg::from_ptr(self.0.add(4usize)) } |
| 53 | } | 18 | } |
| 54 | #[doc = "Baud rate register"] | 19 | #[doc = "external interrupt configuration register"] |
| 55 | pub fn brr(self) -> Reg<regs::Brr, RW> { | 20 | pub fn exticr(self, n: usize) -> Reg<regs::Exticr, RW> { |
| 56 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | 21 | assert!(n < 4usize); |
| 57 | } | 22 | unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) } |
| 58 | #[doc = "Control register 1"] | ||
| 59 | pub fn cr1(self) -> Reg<regs::Cr1, RW> { | ||
| 60 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 61 | } | ||
| 62 | #[doc = "Control register 2"] | ||
| 63 | pub fn cr2(self) -> Reg<regs::Cr2, RW> { | ||
| 64 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 65 | } | 23 | } |
| 66 | #[doc = "Control register 3"] | 24 | #[doc = "CFGR3"] |
| 67 | pub fn cr3(self) -> Reg<regs::Cr3, RW> { | 25 | pub fn cfgr3(self) -> Reg<regs::Cfgr3, RW> { |
| 68 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | 26 | unsafe { Reg::from_ptr(self.0.add(32usize)) } |
| 69 | } | 27 | } |
| 70 | } | 28 | } |
| 71 | pub mod regs { | 29 | pub mod regs { |
| 72 | use crate::generic::*; | 30 | use crate::generic::*; |
| 73 | #[doc = "Status register"] | 31 | #[doc = "CFGR2"] |
| 74 | #[repr(transparent)] | 32 | #[repr(transparent)] |
| 75 | #[derive(Copy, Clone, Eq, PartialEq)] | 33 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 76 | pub struct SrUsart(pub u32); | 34 | pub struct Cfgr2(pub u32); |
| 77 | impl SrUsart { | 35 | impl Cfgr2 { |
| 78 | #[doc = "Parity error"] | 36 | #[doc = "Firewall disable bit"] |
| 79 | pub const fn pe(&self) -> bool { | 37 | pub const fn fwdis(&self) -> bool { |
| 80 | let val = (self.0 >> 0usize) & 0x01; | 38 | let val = (self.0 >> 0usize) & 0x01; |
| 81 | val != 0 | 39 | val != 0 |
| 82 | } | 40 | } |
| 83 | #[doc = "Parity error"] | 41 | #[doc = "Firewall disable bit"] |
| 84 | pub fn set_pe(&mut self, val: bool) { | 42 | pub fn set_fwdis(&mut self, val: bool) { |
| 85 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 43 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 86 | } | 44 | } |
| 87 | #[doc = "Framing error"] | 45 | #[doc = "Fm+ drive capability on PB6 enable bit"] |
| 88 | pub const fn fe(&self) -> bool { | 46 | pub const fn i2c_pb6_fmp(&self) -> bool { |
| 89 | let val = (self.0 >> 1usize) & 0x01; | 47 | let val = (self.0 >> 8usize) & 0x01; |
| 90 | val != 0 | 48 | val != 0 |
| 91 | } | 49 | } |
| 92 | #[doc = "Framing error"] | 50 | #[doc = "Fm+ drive capability on PB6 enable bit"] |
| 93 | pub fn set_fe(&mut self, val: bool) { | 51 | pub fn set_i2c_pb6_fmp(&mut self, val: bool) { |
| 94 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 52 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 95 | } | 53 | } |
| 96 | #[doc = "Noise error flag"] | 54 | #[doc = "Fm+ drive capability on PB7 enable bit"] |
| 97 | pub const fn ne(&self) -> bool { | 55 | pub const fn i2c_pb7_fmp(&self) -> bool { |
| 98 | let val = (self.0 >> 2usize) & 0x01; | 56 | let val = (self.0 >> 9usize) & 0x01; |
| 99 | val != 0 | 57 | val != 0 |
| 100 | } | 58 | } |
| 101 | #[doc = "Noise error flag"] | 59 | #[doc = "Fm+ drive capability on PB7 enable bit"] |
| 102 | pub fn set_ne(&mut self, val: bool) { | 60 | pub fn set_i2c_pb7_fmp(&mut self, val: bool) { |
| 103 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 61 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); |
| 104 | } | 62 | } |
| 105 | #[doc = "Overrun error"] | 63 | #[doc = "Fm+ drive capability on PB8 enable bit"] |
| 106 | pub const fn ore(&self) -> bool { | 64 | pub const fn i2c_pb8_fmp(&self) -> bool { |
| 107 | let val = (self.0 >> 3usize) & 0x01; | 65 | let val = (self.0 >> 10usize) & 0x01; |
| 108 | val != 0 | 66 | val != 0 |
| 109 | } | 67 | } |
| 110 | #[doc = "Overrun error"] | 68 | #[doc = "Fm+ drive capability on PB8 enable bit"] |
| 111 | pub fn set_ore(&mut self, val: bool) { | 69 | pub fn set_i2c_pb8_fmp(&mut self, val: bool) { |
| 112 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 70 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); |
| 113 | } | 71 | } |
| 114 | #[doc = "IDLE line detected"] | 72 | #[doc = "Fm+ drive capability on PB9 enable bit"] |
| 115 | pub const fn idle(&self) -> bool { | 73 | pub const fn i2c_pb9_fmp(&self) -> bool { |
| 116 | let val = (self.0 >> 4usize) & 0x01; | 74 | let val = (self.0 >> 11usize) & 0x01; |
| 117 | val != 0 | 75 | val != 0 |
| 118 | } | 76 | } |
| 119 | #[doc = "IDLE line detected"] | 77 | #[doc = "Fm+ drive capability on PB9 enable bit"] |
| 120 | pub fn set_idle(&mut self, val: bool) { | 78 | pub fn set_i2c_pb9_fmp(&mut self, val: bool) { |
| 121 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 79 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); |
| 122 | } | 80 | } |
| 123 | #[doc = "Read data register not empty"] | 81 | #[doc = "I2C1 Fm+ drive capability enable bit"] |
| 124 | pub const fn rxne(&self) -> bool { | 82 | pub const fn i2c1_fmp(&self) -> bool { |
| 125 | let val = (self.0 >> 5usize) & 0x01; | 83 | let val = (self.0 >> 12usize) & 0x01; |
| 126 | val != 0 | 84 | val != 0 |
| 127 | } | 85 | } |
| 128 | #[doc = "Read data register not empty"] | 86 | #[doc = "I2C1 Fm+ drive capability enable bit"] |
| 129 | pub fn set_rxne(&mut self, val: bool) { | 87 | pub fn set_i2c1_fmp(&mut self, val: bool) { |
| 130 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 88 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); |
| 131 | } | 89 | } |
| 132 | #[doc = "Transmission complete"] | 90 | #[doc = "I2C2 Fm+ drive capability enable bit"] |
| 133 | pub const fn tc(&self) -> bool { | 91 | pub const fn i2c2_fmp(&self) -> bool { |
| 134 | let val = (self.0 >> 6usize) & 0x01; | 92 | let val = (self.0 >> 13usize) & 0x01; |
| 135 | val != 0 | 93 | val != 0 |
| 136 | } | 94 | } |
| 137 | #[doc = "Transmission complete"] | 95 | #[doc = "I2C2 Fm+ drive capability enable bit"] |
| 138 | pub fn set_tc(&mut self, val: bool) { | 96 | pub fn set_i2c2_fmp(&mut self, val: bool) { |
| 139 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 97 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); |
| 140 | } | 98 | } |
| 141 | #[doc = "Transmit data register empty"] | 99 | #[doc = "I2C3 Fm+ drive capability enable bit"] |
| 142 | pub const fn txe(&self) -> bool { | 100 | pub const fn i2c3_fmp(&self) -> bool { |
| 143 | let val = (self.0 >> 7usize) & 0x01; | 101 | let val = (self.0 >> 14usize) & 0x01; |
| 144 | val != 0 | 102 | val != 0 |
| 145 | } | 103 | } |
| 146 | #[doc = "Transmit data register empty"] | 104 | #[doc = "I2C3 Fm+ drive capability enable bit"] |
| 147 | pub fn set_txe(&mut self, val: bool) { | 105 | pub fn set_i2c3_fmp(&mut self, val: bool) { |
| 148 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 106 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); |
| 149 | } | 107 | } |
| 150 | #[doc = "LIN break detection flag"] | 108 | } |
| 151 | pub const fn lbd(&self) -> bool { | 109 | impl Default for Cfgr2 { |
| 152 | let val = (self.0 >> 8usize) & 0x01; | 110 | fn default() -> Cfgr2 { |
| 153 | val != 0 | 111 | Cfgr2(0) |
| 154 | } | 112 | } |
| 155 | #[doc = "LIN break detection flag"] | 113 | } |
| 156 | pub fn set_lbd(&mut self, val: bool) { | 114 | #[doc = "configuration register 1"] |
| 157 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 115 | #[repr(transparent)] |
| 116 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 117 | pub struct Cfgr1(pub u32); | ||
| 118 | impl Cfgr1 { | ||
| 119 | #[doc = "Memory mapping selection bits"] | ||
| 120 | pub const fn mem_mode(&self) -> u8 { | ||
| 121 | let val = (self.0 >> 0usize) & 0x03; | ||
| 122 | val as u8 | ||
| 158 | } | 123 | } |
| 159 | #[doc = "CTS flag"] | 124 | #[doc = "Memory mapping selection bits"] |
| 160 | pub const fn cts(&self) -> bool { | 125 | pub fn set_mem_mode(&mut self, val: u8) { |
| 161 | let val = (self.0 >> 9usize) & 0x01; | 126 | self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize); |
| 127 | } | ||
| 128 | #[doc = "User bank swapping"] | ||
| 129 | pub const fn ufb(&self) -> bool { | ||
| 130 | let val = (self.0 >> 3usize) & 0x01; | ||
| 162 | val != 0 | 131 | val != 0 |
| 163 | } | 132 | } |
| 164 | #[doc = "CTS flag"] | 133 | #[doc = "User bank swapping"] |
| 165 | pub fn set_cts(&mut self, val: bool) { | 134 | pub fn set_ufb(&mut self, val: bool) { |
| 166 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | 135 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); |
| 136 | } | ||
| 137 | #[doc = "Boot mode selected by the boot pins status bits"] | ||
| 138 | pub const fn boot_mode(&self) -> u8 { | ||
| 139 | let val = (self.0 >> 8usize) & 0x03; | ||
| 140 | val as u8 | ||
| 141 | } | ||
| 142 | #[doc = "Boot mode selected by the boot pins status bits"] | ||
| 143 | pub fn set_boot_mode(&mut self, val: u8) { | ||
| 144 | self.0 = (self.0 & !(0x03 << 8usize)) | (((val as u32) & 0x03) << 8usize); | ||
| 167 | } | 145 | } |
| 168 | } | 146 | } |
| 169 | impl Default for SrUsart { | 147 | impl Default for Cfgr1 { |
| 170 | fn default() -> SrUsart { | 148 | fn default() -> Cfgr1 { |
| 171 | SrUsart(0) | 149 | Cfgr1(0) |
| 172 | } | 150 | } |
| 173 | } | 151 | } |
| 174 | #[doc = "Status register"] | 152 | #[doc = "external interrupt configuration register 1-4"] |
| 175 | #[repr(transparent)] | 153 | #[repr(transparent)] |
| 176 | #[derive(Copy, Clone, Eq, PartialEq)] | 154 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 177 | pub struct Sr(pub u32); | 155 | pub struct Exticr(pub u32); |
| 178 | impl Sr { | 156 | impl Exticr { |
| 179 | #[doc = "Parity error"] | 157 | #[doc = "EXTI configuration bits"] |
| 180 | pub const fn pe(&self) -> bool { | 158 | pub fn exti(&self, n: usize) -> u8 { |
| 181 | let val = (self.0 >> 0usize) & 0x01; | 159 | assert!(n < 4usize); |
| 182 | val != 0 | 160 | let offs = 0usize + n * 4usize; |
| 161 | let val = (self.0 >> offs) & 0x0f; | ||
| 162 | val as u8 | ||
| 183 | } | 163 | } |
| 184 | #[doc = "Parity error"] | 164 | #[doc = "EXTI configuration bits"] |
| 185 | pub fn set_pe(&mut self, val: bool) { | 165 | pub fn set_exti(&mut self, n: usize, val: u8) { |
| 186 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 166 | assert!(n < 4usize); |
| 167 | let offs = 0usize + n * 4usize; | ||
| 168 | self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs); | ||
| 187 | } | 169 | } |
| 188 | #[doc = "Framing error"] | 170 | } |
| 189 | pub const fn fe(&self) -> bool { | 171 | impl Default for Exticr { |
| 190 | let val = (self.0 >> 1usize) & 0x01; | 172 | fn default() -> Exticr { |
| 173 | Exticr(0) | ||
| 174 | } | ||
| 175 | } | ||
| 176 | #[doc = "CFGR3"] | ||
| 177 | #[repr(transparent)] | ||
| 178 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 179 | pub struct Cfgr3(pub u32); | ||
| 180 | impl Cfgr3 { | ||
| 181 | #[doc = "VREFINT enable and scaler control for COMP2 enable bit"] | ||
| 182 | pub const fn en_vrefint(&self) -> bool { | ||
| 183 | let val = (self.0 >> 0usize) & 0x01; | ||
| 191 | val != 0 | 184 | val != 0 |
| 192 | } | 185 | } |
| 193 | #[doc = "Framing error"] | 186 | #[doc = "VREFINT enable and scaler control for COMP2 enable bit"] |
| 194 | pub fn set_fe(&mut self, val: bool) { | 187 | pub fn set_en_vrefint(&mut self, val: bool) { |
| 195 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 188 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 196 | } | 189 | } |
| 197 | #[doc = "Noise error flag"] | 190 | #[doc = "VREFINT_ADC connection bit"] |
| 198 | pub const fn ne(&self) -> bool { | 191 | pub const fn sel_vref_out(&self) -> u8 { |
| 199 | let val = (self.0 >> 2usize) & 0x01; | 192 | let val = (self.0 >> 4usize) & 0x03; |
| 200 | val != 0 | 193 | val as u8 |
| 201 | } | 194 | } |
| 202 | #[doc = "Noise error flag"] | 195 | #[doc = "VREFINT_ADC connection bit"] |
| 203 | pub fn set_ne(&mut self, val: bool) { | 196 | pub fn set_sel_vref_out(&mut self, val: u8) { |
| 204 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 197 | self.0 = (self.0 & !(0x03 << 4usize)) | (((val as u32) & 0x03) << 4usize); |
| 205 | } | 198 | } |
| 206 | #[doc = "Overrun error"] | 199 | #[doc = "VREFINT reference for ADC enable bit"] |
| 207 | pub const fn ore(&self) -> bool { | 200 | pub const fn enbuf_vrefint_adc(&self) -> bool { |
| 208 | let val = (self.0 >> 3usize) & 0x01; | 201 | let val = (self.0 >> 8usize) & 0x01; |
| 209 | val != 0 | 202 | val != 0 |
| 210 | } | 203 | } |
| 211 | #[doc = "Overrun error"] | 204 | #[doc = "VREFINT reference for ADC enable bit"] |
| 212 | pub fn set_ore(&mut self, val: bool) { | 205 | pub fn set_enbuf_vrefint_adc(&mut self, val: bool) { |
| 213 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 206 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 214 | } | 207 | } |
| 215 | #[doc = "IDLE line detected"] | 208 | #[doc = "Temperature sensor reference for ADC enable bit"] |
| 216 | pub const fn idle(&self) -> bool { | 209 | pub const fn enbuf_sensor_adc(&self) -> bool { |
| 217 | let val = (self.0 >> 4usize) & 0x01; | 210 | let val = (self.0 >> 9usize) & 0x01; |
| 218 | val != 0 | 211 | val != 0 |
| 219 | } | 212 | } |
| 220 | #[doc = "IDLE line detected"] | 213 | #[doc = "Temperature sensor reference for ADC enable bit"] |
| 221 | pub fn set_idle(&mut self, val: bool) { | 214 | pub fn set_enbuf_sensor_adc(&mut self, val: bool) { |
| 222 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 215 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); |
| 223 | } | 216 | } |
| 224 | #[doc = "Read data register not empty"] | 217 | #[doc = "VREFINT reference for COMP2 scaler enable bit"] |
| 225 | pub const fn rxne(&self) -> bool { | 218 | pub const fn enbuf_vrefint_comp2(&self) -> bool { |
| 226 | let val = (self.0 >> 5usize) & 0x01; | 219 | let val = (self.0 >> 12usize) & 0x01; |
| 227 | val != 0 | 220 | val != 0 |
| 228 | } | 221 | } |
| 229 | #[doc = "Read data register not empty"] | 222 | #[doc = "VREFINT reference for COMP2 scaler enable bit"] |
| 230 | pub fn set_rxne(&mut self, val: bool) { | 223 | pub fn set_enbuf_vrefint_comp2(&mut self, val: bool) { |
| 231 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 224 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); |
| 232 | } | 225 | } |
| 233 | #[doc = "Transmission complete"] | 226 | #[doc = "VREFINT reference for HSI48 oscillator enable bit"] |
| 234 | pub const fn tc(&self) -> bool { | 227 | pub const fn enref_hsi48(&self) -> bool { |
| 235 | let val = (self.0 >> 6usize) & 0x01; | 228 | let val = (self.0 >> 13usize) & 0x01; |
| 236 | val != 0 | 229 | val != 0 |
| 237 | } | 230 | } |
| 238 | #[doc = "Transmission complete"] | 231 | #[doc = "VREFINT reference for HSI48 oscillator enable bit"] |
| 239 | pub fn set_tc(&mut self, val: bool) { | 232 | pub fn set_enref_hsi48(&mut self, val: bool) { |
| 240 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 233 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); |
| 241 | } | 234 | } |
| 242 | #[doc = "Transmit data register empty"] | 235 | #[doc = "VREFINT ready flag"] |
| 243 | pub const fn txe(&self) -> bool { | 236 | pub const fn vrefint_rdyf(&self) -> bool { |
| 244 | let val = (self.0 >> 7usize) & 0x01; | 237 | let val = (self.0 >> 30usize) & 0x01; |
| 245 | val != 0 | 238 | val != 0 |
| 246 | } | 239 | } |
| 247 | #[doc = "Transmit data register empty"] | 240 | #[doc = "VREFINT ready flag"] |
| 248 | pub fn set_txe(&mut self, val: bool) { | 241 | pub fn set_vrefint_rdyf(&mut self, val: bool) { |
| 249 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 242 | self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize); |
| 250 | } | 243 | } |
| 251 | #[doc = "LIN break detection flag"] | 244 | #[doc = "SYSCFG_CFGR3 lock bit"] |
| 252 | pub const fn lbd(&self) -> bool { | 245 | pub const fn ref_lock(&self) -> bool { |
| 253 | let val = (self.0 >> 8usize) & 0x01; | 246 | let val = (self.0 >> 31usize) & 0x01; |
| 254 | val != 0 | 247 | val != 0 |
| 255 | } | 248 | } |
| 256 | #[doc = "LIN break detection flag"] | 249 | #[doc = "SYSCFG_CFGR3 lock bit"] |
| 257 | pub fn set_lbd(&mut self, val: bool) { | 250 | pub fn set_ref_lock(&mut self, val: bool) { |
| 258 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 251 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize); |
| 259 | } | 252 | } |
| 260 | } | 253 | } |
| 261 | impl Default for Sr { | 254 | impl Default for Cfgr3 { |
| 262 | fn default() -> Sr { | 255 | fn default() -> Cfgr3 { |
| 263 | Sr(0) | 256 | Cfgr3(0) |
| 264 | } | 257 | } |
| 265 | } | 258 | } |
| 259 | } | ||
| 260 | } | ||
| 261 | pub mod usart_v2 { | ||
| 262 | use crate::generic::*; | ||
| 263 | #[doc = "Universal synchronous asynchronous receiver transmitter"] | ||
| 264 | #[derive(Copy, Clone)] | ||
| 265 | pub struct Usart(pub *mut u8); | ||
| 266 | unsafe impl Send for Usart {} | ||
| 267 | unsafe impl Sync for Usart {} | ||
| 268 | impl Usart { | ||
| 269 | #[doc = "Control register 1"] | ||
| 270 | pub fn cr1(self) -> Reg<regs::Cr1, RW> { | ||
| 271 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 272 | } | ||
| 273 | #[doc = "Control register 2"] | ||
| 274 | pub fn cr2(self) -> Reg<regs::Cr2, RW> { | ||
| 275 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 276 | } | ||
| 277 | #[doc = "Control register 3"] | ||
| 278 | pub fn cr3(self) -> Reg<regs::Cr3, RW> { | ||
| 279 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 280 | } | ||
| 281 | #[doc = "Baud rate register"] | ||
| 282 | pub fn brr(self) -> Reg<regs::Brr, RW> { | ||
| 283 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 284 | } | ||
| 285 | #[doc = "Guard time and prescaler register"] | ||
| 286 | pub fn gtpr(self) -> Reg<regs::Gtpr, RW> { | ||
| 287 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 288 | } | ||
| 289 | #[doc = "Receiver timeout register"] | ||
| 290 | pub fn rtor(self) -> Reg<regs::Rtor, RW> { | ||
| 291 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 292 | } | ||
| 293 | #[doc = "Request register"] | ||
| 294 | pub fn rqr(self) -> Reg<regs::Rqr, W> { | ||
| 295 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | ||
| 296 | } | ||
| 297 | #[doc = "Interrupt & status register"] | ||
| 298 | pub fn isr(self) -> Reg<regs::Ixr, R> { | ||
| 299 | unsafe { Reg::from_ptr(self.0.add(28usize)) } | ||
| 300 | } | ||
| 301 | #[doc = "Interrupt flag clear register"] | ||
| 302 | pub fn icr(self) -> Reg<regs::Ixr, W> { | ||
| 303 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | ||
| 304 | } | ||
| 305 | #[doc = "Receive data register"] | ||
| 306 | pub fn rdr(self) -> Reg<regs::Dr, R> { | ||
| 307 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | ||
| 308 | } | ||
| 309 | #[doc = "Transmit data register"] | ||
| 310 | pub fn tdr(self) -> Reg<regs::Dr, RW> { | ||
| 311 | unsafe { Reg::from_ptr(self.0.add(40usize)) } | ||
| 312 | } | ||
| 313 | } | ||
| 314 | pub mod regs { | ||
| 315 | use crate::generic::*; | ||
| 266 | #[doc = "Control register 1"] | 316 | #[doc = "Control register 1"] |
| 267 | #[repr(transparent)] | 317 | #[repr(transparent)] |
| 268 | #[derive(Copy, Clone, Eq, PartialEq)] | 318 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 269 | pub struct Cr1(pub u32); | 319 | pub struct Cr1(pub u32); |
| 270 | impl Cr1 { | 320 | impl Cr1 { |
| 271 | #[doc = "Send break"] | 321 | #[doc = "USART enable"] |
| 272 | pub const fn sbk(&self) -> super::vals::Sbk { | 322 | pub const fn ue(&self) -> bool { |
| 273 | let val = (self.0 >> 0usize) & 0x01; | 323 | let val = (self.0 >> 0usize) & 0x01; |
| 274 | super::vals::Sbk(val as u8) | 324 | val != 0 |
| 275 | } | 325 | } |
| 276 | #[doc = "Send break"] | 326 | #[doc = "USART enable"] |
| 277 | pub fn set_sbk(&mut self, val: super::vals::Sbk) { | 327 | pub fn set_ue(&mut self, val: bool) { |
| 278 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | 328 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 279 | } | 329 | } |
| 280 | #[doc = "Receiver wakeup"] | 330 | #[doc = "USART enable in Stop mode"] |
| 281 | pub const fn rwu(&self) -> super::vals::Rwu { | 331 | pub const fn uesm(&self) -> bool { |
| 282 | let val = (self.0 >> 1usize) & 0x01; | 332 | let val = (self.0 >> 1usize) & 0x01; |
| 283 | super::vals::Rwu(val as u8) | 333 | val != 0 |
| 284 | } | 334 | } |
| 285 | #[doc = "Receiver wakeup"] | 335 | #[doc = "USART enable in Stop mode"] |
| 286 | pub fn set_rwu(&mut self, val: super::vals::Rwu) { | 336 | pub fn set_uesm(&mut self, val: bool) { |
| 287 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | 337 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 288 | } | 338 | } |
| 289 | #[doc = "Receiver enable"] | 339 | #[doc = "Receiver enable"] |
| 290 | pub const fn re(&self) -> bool { | 340 | pub const fn re(&self) -> bool { |
| @@ -331,12 +381,12 @@ pub mod usart_v1 { | |||
| 331 | pub fn set_tcie(&mut self, val: bool) { | 381 | pub fn set_tcie(&mut self, val: bool) { |
| 332 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 382 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 333 | } | 383 | } |
| 334 | #[doc = "TXE interrupt enable"] | 384 | #[doc = "interrupt enable"] |
| 335 | pub const fn txeie(&self) -> bool { | 385 | pub const fn txeie(&self) -> bool { |
| 336 | let val = (self.0 >> 7usize) & 0x01; | 386 | let val = (self.0 >> 7usize) & 0x01; |
| 337 | val != 0 | 387 | val != 0 |
| 338 | } | 388 | } |
| 339 | #[doc = "TXE interrupt enable"] | 389 | #[doc = "interrupt enable"] |
| 340 | pub fn set_txeie(&mut self, val: bool) { | 390 | pub fn set_txeie(&mut self, val: bool) { |
| 341 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 391 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 342 | } | 392 | } |
| @@ -367,33 +417,100 @@ pub mod usart_v1 { | |||
| 367 | pub fn set_pce(&mut self, val: bool) { | 417 | pub fn set_pce(&mut self, val: bool) { |
| 368 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | 418 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); |
| 369 | } | 419 | } |
| 370 | #[doc = "Wakeup method"] | 420 | #[doc = "Receiver wakeup method"] |
| 371 | pub const fn wake(&self) -> super::vals::Wake { | 421 | pub const fn wake(&self) -> bool { |
| 372 | let val = (self.0 >> 11usize) & 0x01; | 422 | let val = (self.0 >> 11usize) & 0x01; |
| 373 | super::vals::Wake(val as u8) | 423 | val != 0 |
| 374 | } | 424 | } |
| 375 | #[doc = "Wakeup method"] | 425 | #[doc = "Receiver wakeup method"] |
| 376 | pub fn set_wake(&mut self, val: super::vals::Wake) { | 426 | pub fn set_wake(&mut self, val: bool) { |
| 377 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); | 427 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); |
| 378 | } | 428 | } |
| 379 | #[doc = "Word length"] | 429 | #[doc = "Word length"] |
| 380 | pub const fn m(&self) -> super::vals::M { | 430 | pub const fn m0(&self) -> super::vals::M0 { |
| 381 | let val = (self.0 >> 12usize) & 0x01; | 431 | let val = (self.0 >> 12usize) & 0x01; |
| 382 | super::vals::M(val as u8) | 432 | super::vals::M0(val as u8) |
| 383 | } | 433 | } |
| 384 | #[doc = "Word length"] | 434 | #[doc = "Word length"] |
| 385 | pub fn set_m(&mut self, val: super::vals::M) { | 435 | pub fn set_m0(&mut self, val: super::vals::M0) { |
| 386 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | 436 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); |
| 387 | } | 437 | } |
| 388 | #[doc = "USART enable"] | 438 | #[doc = "Word length"] |
| 389 | pub const fn ue(&self) -> bool { | 439 | pub const fn m1(&self) -> super::vals::M1 { |
| 440 | let val = (self.0 >> 12usize) & 0x01; | ||
| 441 | super::vals::M1(val as u8) | ||
| 442 | } | ||
| 443 | #[doc = "Word length"] | ||
| 444 | pub fn set_m1(&mut self, val: super::vals::M1) { | ||
| 445 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 446 | } | ||
| 447 | #[doc = "Mute mode enable"] | ||
| 448 | pub const fn mme(&self) -> bool { | ||
| 390 | let val = (self.0 >> 13usize) & 0x01; | 449 | let val = (self.0 >> 13usize) & 0x01; |
| 391 | val != 0 | 450 | val != 0 |
| 392 | } | 451 | } |
| 393 | #[doc = "USART enable"] | 452 | #[doc = "Mute mode enable"] |
| 394 | pub fn set_ue(&mut self, val: bool) { | 453 | pub fn set_mme(&mut self, val: bool) { |
| 395 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | 454 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); |
| 396 | } | 455 | } |
| 456 | #[doc = "Character match interrupt enable"] | ||
| 457 | pub const fn cmie(&self) -> bool { | ||
| 458 | let val = (self.0 >> 14usize) & 0x01; | ||
| 459 | val != 0 | ||
| 460 | } | ||
| 461 | #[doc = "Character match interrupt enable"] | ||
| 462 | pub fn set_cmie(&mut self, val: bool) { | ||
| 463 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | ||
| 464 | } | ||
| 465 | #[doc = "Oversampling mode"] | ||
| 466 | pub fn over(&self, n: usize) -> super::vals::Over { | ||
| 467 | assert!(n < 1usize); | ||
| 468 | let offs = 15usize + n * 0usize; | ||
| 469 | let val = (self.0 >> offs) & 0x01; | ||
| 470 | super::vals::Over(val as u8) | ||
| 471 | } | ||
| 472 | #[doc = "Oversampling mode"] | ||
| 473 | pub fn set_over(&mut self, n: usize, val: super::vals::Over) { | ||
| 474 | assert!(n < 1usize); | ||
| 475 | let offs = 15usize + n * 0usize; | ||
| 476 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 477 | } | ||
| 478 | #[doc = "Driver Enable deassertion time"] | ||
| 479 | pub const fn dedt(&self) -> u8 { | ||
| 480 | let val = (self.0 >> 16usize) & 0x1f; | ||
| 481 | val as u8 | ||
| 482 | } | ||
| 483 | #[doc = "Driver Enable deassertion time"] | ||
| 484 | pub fn set_dedt(&mut self, val: u8) { | ||
| 485 | self.0 = (self.0 & !(0x1f << 16usize)) | (((val as u32) & 0x1f) << 16usize); | ||
| 486 | } | ||
| 487 | #[doc = "Driver Enable assertion time"] | ||
| 488 | pub const fn deat(&self) -> u8 { | ||
| 489 | let val = (self.0 >> 21usize) & 0x1f; | ||
| 490 | val as u8 | ||
| 491 | } | ||
| 492 | #[doc = "Driver Enable assertion time"] | ||
| 493 | pub fn set_deat(&mut self, val: u8) { | ||
| 494 | self.0 = (self.0 & !(0x1f << 21usize)) | (((val as u32) & 0x1f) << 21usize); | ||
| 495 | } | ||
| 496 | #[doc = "Receiver timeout interrupt enable"] | ||
| 497 | pub const fn rtoie(&self) -> bool { | ||
| 498 | let val = (self.0 >> 26usize) & 0x01; | ||
| 499 | val != 0 | ||
| 500 | } | ||
| 501 | #[doc = "Receiver timeout interrupt enable"] | ||
| 502 | pub fn set_rtoie(&mut self, val: bool) { | ||
| 503 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); | ||
| 504 | } | ||
| 505 | #[doc = "End of Block interrupt enable"] | ||
| 506 | pub const fn eobie(&self) -> bool { | ||
| 507 | let val = (self.0 >> 27usize) & 0x01; | ||
| 508 | val != 0 | ||
| 509 | } | ||
| 510 | #[doc = "End of Block interrupt enable"] | ||
| 511 | pub fn set_eobie(&mut self, val: bool) { | ||
| 512 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize); | ||
| 513 | } | ||
| 397 | } | 514 | } |
| 398 | impl Default for Cr1 { | 515 | impl Default for Cr1 { |
| 399 | fn default() -> Cr1 { | 516 | fn default() -> Cr1 { |
| @@ -441,6 +558,24 @@ pub mod usart_v1 { | |||
| 441 | pub fn set_hdsel(&mut self, val: super::vals::Hdsel) { | 558 | pub fn set_hdsel(&mut self, val: super::vals::Hdsel) { |
| 442 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | 559 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); |
| 443 | } | 560 | } |
| 561 | #[doc = "Smartcard NACK enable"] | ||
| 562 | pub const fn nack(&self) -> bool { | ||
| 563 | let val = (self.0 >> 4usize) & 0x01; | ||
| 564 | val != 0 | ||
| 565 | } | ||
| 566 | #[doc = "Smartcard NACK enable"] | ||
| 567 | pub fn set_nack(&mut self, val: bool) { | ||
| 568 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | ||
| 569 | } | ||
| 570 | #[doc = "Smartcard mode enable"] | ||
| 571 | pub const fn scen(&self) -> bool { | ||
| 572 | let val = (self.0 >> 5usize) & 0x01; | ||
| 573 | val != 0 | ||
| 574 | } | ||
| 575 | #[doc = "Smartcard mode enable"] | ||
| 576 | pub fn set_scen(&mut self, val: bool) { | ||
| 577 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 578 | } | ||
| 444 | #[doc = "DMA enable receiver"] | 579 | #[doc = "DMA enable receiver"] |
| 445 | pub const fn dmar(&self) -> bool { | 580 | pub const fn dmar(&self) -> bool { |
| 446 | let val = (self.0 >> 6usize) & 0x01; | 581 | let val = (self.0 >> 6usize) & 0x01; |
| @@ -459,61 +594,414 @@ pub mod usart_v1 { | |||
| 459 | pub fn set_dmat(&mut self, val: bool) { | 594 | pub fn set_dmat(&mut self, val: bool) { |
| 460 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 595 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 461 | } | 596 | } |
| 597 | #[doc = "RTS enable"] | ||
| 598 | pub const fn rtse(&self) -> bool { | ||
| 599 | let val = (self.0 >> 8usize) & 0x01; | ||
| 600 | val != 0 | ||
| 601 | } | ||
| 602 | #[doc = "RTS enable"] | ||
| 603 | pub fn set_rtse(&mut self, val: bool) { | ||
| 604 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 605 | } | ||
| 606 | #[doc = "CTS enable"] | ||
| 607 | pub const fn ctse(&self) -> bool { | ||
| 608 | let val = (self.0 >> 9usize) & 0x01; | ||
| 609 | val != 0 | ||
| 610 | } | ||
| 611 | #[doc = "CTS enable"] | ||
| 612 | pub fn set_ctse(&mut self, val: bool) { | ||
| 613 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | ||
| 614 | } | ||
| 615 | #[doc = "CTS interrupt enable"] | ||
| 616 | pub const fn ctsie(&self) -> bool { | ||
| 617 | let val = (self.0 >> 10usize) & 0x01; | ||
| 618 | val != 0 | ||
| 619 | } | ||
| 620 | #[doc = "CTS interrupt enable"] | ||
| 621 | pub fn set_ctsie(&mut self, val: bool) { | ||
| 622 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | ||
| 623 | } | ||
| 624 | #[doc = "One sample bit method enable"] | ||
| 625 | pub const fn onebit(&self) -> super::vals::Onebit { | ||
| 626 | let val = (self.0 >> 11usize) & 0x01; | ||
| 627 | super::vals::Onebit(val as u8) | ||
| 628 | } | ||
| 629 | #[doc = "One sample bit method enable"] | ||
| 630 | pub fn set_onebit(&mut self, val: super::vals::Onebit) { | ||
| 631 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); | ||
| 632 | } | ||
| 633 | #[doc = "Overrun Disable"] | ||
| 634 | pub const fn ovrdis(&self) -> super::vals::Ovrdis { | ||
| 635 | let val = (self.0 >> 12usize) & 0x01; | ||
| 636 | super::vals::Ovrdis(val as u8) | ||
| 637 | } | ||
| 638 | #[doc = "Overrun Disable"] | ||
| 639 | pub fn set_ovrdis(&mut self, val: super::vals::Ovrdis) { | ||
| 640 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 641 | } | ||
| 642 | #[doc = "DMA Disable on Reception Error"] | ||
| 643 | pub const fn ddre(&self) -> bool { | ||
| 644 | let val = (self.0 >> 13usize) & 0x01; | ||
| 645 | val != 0 | ||
| 646 | } | ||
| 647 | #[doc = "DMA Disable on Reception Error"] | ||
| 648 | pub fn set_ddre(&mut self, val: bool) { | ||
| 649 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | ||
| 650 | } | ||
| 651 | #[doc = "Driver enable mode"] | ||
| 652 | pub const fn dem(&self) -> bool { | ||
| 653 | let val = (self.0 >> 14usize) & 0x01; | ||
| 654 | val != 0 | ||
| 655 | } | ||
| 656 | #[doc = "Driver enable mode"] | ||
| 657 | pub fn set_dem(&mut self, val: bool) { | ||
| 658 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | ||
| 659 | } | ||
| 660 | #[doc = "Driver enable polarity selection"] | ||
| 661 | pub const fn dep(&self) -> super::vals::Dep { | ||
| 662 | let val = (self.0 >> 15usize) & 0x01; | ||
| 663 | super::vals::Dep(val as u8) | ||
| 664 | } | ||
| 665 | #[doc = "Driver enable polarity selection"] | ||
| 666 | pub fn set_dep(&mut self, val: super::vals::Dep) { | ||
| 667 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 668 | } | ||
| 669 | #[doc = "Smartcard auto-retry count"] | ||
| 670 | pub const fn scarcnt(&self) -> u8 { | ||
| 671 | let val = (self.0 >> 17usize) & 0x07; | ||
| 672 | val as u8 | ||
| 673 | } | ||
| 674 | #[doc = "Smartcard auto-retry count"] | ||
| 675 | pub fn set_scarcnt(&mut self, val: u8) { | ||
| 676 | self.0 = (self.0 & !(0x07 << 17usize)) | (((val as u32) & 0x07) << 17usize); | ||
| 677 | } | ||
| 678 | #[doc = "Wakeup from Stop mode interrupt flag selection"] | ||
| 679 | pub const fn wus(&self) -> super::vals::Wus { | ||
| 680 | let val = (self.0 >> 20usize) & 0x03; | ||
| 681 | super::vals::Wus(val as u8) | ||
| 682 | } | ||
| 683 | #[doc = "Wakeup from Stop mode interrupt flag selection"] | ||
| 684 | pub fn set_wus(&mut self, val: super::vals::Wus) { | ||
| 685 | self.0 = (self.0 & !(0x03 << 20usize)) | (((val.0 as u32) & 0x03) << 20usize); | ||
| 686 | } | ||
| 687 | #[doc = "Wakeup from Stop mode interrupt enable"] | ||
| 688 | pub const fn wufie(&self) -> bool { | ||
| 689 | let val = (self.0 >> 22usize) & 0x01; | ||
| 690 | val != 0 | ||
| 691 | } | ||
| 692 | #[doc = "Wakeup from Stop mode interrupt enable"] | ||
| 693 | pub fn set_wufie(&mut self, val: bool) { | ||
| 694 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); | ||
| 695 | } | ||
| 462 | } | 696 | } |
| 463 | impl Default for Cr3 { | 697 | impl Default for Cr3 { |
| 464 | fn default() -> Cr3 { | 698 | fn default() -> Cr3 { |
| 465 | Cr3(0) | 699 | Cr3(0) |
| 466 | } | 700 | } |
| 467 | } | 701 | } |
| 468 | #[doc = "Guard time and prescaler register"] | 702 | #[doc = "Baud rate register"] |
| 469 | #[repr(transparent)] | 703 | #[repr(transparent)] |
| 470 | #[derive(Copy, Clone, Eq, PartialEq)] | 704 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 471 | pub struct Gtpr(pub u32); | 705 | pub struct Brr(pub u32); |
| 472 | impl Gtpr { | 706 | impl Brr { |
| 473 | #[doc = "Prescaler value"] | 707 | #[doc = "mantissa of USARTDIV"] |
| 474 | pub const fn psc(&self) -> u8 { | 708 | pub const fn brr(&self) -> u16 { |
| 475 | let val = (self.0 >> 0usize) & 0xff; | 709 | let val = (self.0 >> 0usize) & 0xffff; |
| 476 | val as u8 | 710 | val as u16 |
| 477 | } | 711 | } |
| 478 | #[doc = "Prescaler value"] | 712 | #[doc = "mantissa of USARTDIV"] |
| 479 | pub fn set_psc(&mut self, val: u8) { | 713 | pub fn set_brr(&mut self, val: u16) { |
| 480 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | 714 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); |
| 481 | } | 715 | } |
| 482 | #[doc = "Guard time value"] | 716 | } |
| 483 | pub const fn gt(&self) -> u8 { | 717 | impl Default for Brr { |
| 484 | let val = (self.0 >> 8usize) & 0xff; | 718 | fn default() -> Brr { |
| 719 | Brr(0) | ||
| 720 | } | ||
| 721 | } | ||
| 722 | #[doc = "Receiver timeout register"] | ||
| 723 | #[repr(transparent)] | ||
| 724 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 725 | pub struct Rtor(pub u32); | ||
| 726 | impl Rtor { | ||
| 727 | #[doc = "Receiver timeout value"] | ||
| 728 | pub const fn rto(&self) -> u32 { | ||
| 729 | let val = (self.0 >> 0usize) & 0x00ff_ffff; | ||
| 730 | val as u32 | ||
| 731 | } | ||
| 732 | #[doc = "Receiver timeout value"] | ||
| 733 | pub fn set_rto(&mut self, val: u32) { | ||
| 734 | self.0 = | ||
| 735 | (self.0 & !(0x00ff_ffff << 0usize)) | (((val as u32) & 0x00ff_ffff) << 0usize); | ||
| 736 | } | ||
| 737 | #[doc = "Block Length"] | ||
| 738 | pub const fn blen(&self) -> u8 { | ||
| 739 | let val = (self.0 >> 24usize) & 0xff; | ||
| 485 | val as u8 | 740 | val as u8 |
| 486 | } | 741 | } |
| 487 | #[doc = "Guard time value"] | 742 | #[doc = "Block Length"] |
| 488 | pub fn set_gt(&mut self, val: u8) { | 743 | pub fn set_blen(&mut self, val: u8) { |
| 489 | self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize); | 744 | self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize); |
| 490 | } | 745 | } |
| 491 | } | 746 | } |
| 492 | impl Default for Gtpr { | 747 | impl Default for Rtor { |
| 493 | fn default() -> Gtpr { | 748 | fn default() -> Rtor { |
| 494 | Gtpr(0) | 749 | Rtor(0) |
| 750 | } | ||
| 751 | } | ||
| 752 | #[doc = "Interrupt & status register"] | ||
| 753 | #[repr(transparent)] | ||
| 754 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 755 | pub struct Ixr(pub u32); | ||
| 756 | impl Ixr { | ||
| 757 | #[doc = "Parity error"] | ||
| 758 | pub const fn pe(&self) -> bool { | ||
| 759 | let val = (self.0 >> 0usize) & 0x01; | ||
| 760 | val != 0 | ||
| 761 | } | ||
| 762 | #[doc = "Parity error"] | ||
| 763 | pub fn set_pe(&mut self, val: bool) { | ||
| 764 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 765 | } | ||
| 766 | #[doc = "Framing error"] | ||
| 767 | pub const fn fe(&self) -> bool { | ||
| 768 | let val = (self.0 >> 1usize) & 0x01; | ||
| 769 | val != 0 | ||
| 770 | } | ||
| 771 | #[doc = "Framing error"] | ||
| 772 | pub fn set_fe(&mut self, val: bool) { | ||
| 773 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | ||
| 774 | } | ||
| 775 | #[doc = "Noise detected flag"] | ||
| 776 | pub const fn nf(&self) -> bool { | ||
| 777 | let val = (self.0 >> 2usize) & 0x01; | ||
| 778 | val != 0 | ||
| 779 | } | ||
| 780 | #[doc = "Noise detected flag"] | ||
| 781 | pub fn set_nf(&mut self, val: bool) { | ||
| 782 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 783 | } | ||
| 784 | #[doc = "Overrun error"] | ||
| 785 | pub const fn ore(&self) -> bool { | ||
| 786 | let val = (self.0 >> 3usize) & 0x01; | ||
| 787 | val != 0 | ||
| 788 | } | ||
| 789 | #[doc = "Overrun error"] | ||
| 790 | pub fn set_ore(&mut self, val: bool) { | ||
| 791 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | ||
| 792 | } | ||
| 793 | #[doc = "Idle line detected"] | ||
| 794 | pub const fn idle(&self) -> bool { | ||
| 795 | let val = (self.0 >> 4usize) & 0x01; | ||
| 796 | val != 0 | ||
| 797 | } | ||
| 798 | #[doc = "Idle line detected"] | ||
| 799 | pub fn set_idle(&mut self, val: bool) { | ||
| 800 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | ||
| 801 | } | ||
| 802 | #[doc = "Read data register not empty"] | ||
| 803 | pub const fn rxne(&self) -> bool { | ||
| 804 | let val = (self.0 >> 5usize) & 0x01; | ||
| 805 | val != 0 | ||
| 806 | } | ||
| 807 | #[doc = "Read data register not empty"] | ||
| 808 | pub fn set_rxne(&mut self, val: bool) { | ||
| 809 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 810 | } | ||
| 811 | #[doc = "Transmission complete"] | ||
| 812 | pub const fn tc(&self) -> bool { | ||
| 813 | let val = (self.0 >> 6usize) & 0x01; | ||
| 814 | val != 0 | ||
| 815 | } | ||
| 816 | #[doc = "Transmission complete"] | ||
| 817 | pub fn set_tc(&mut self, val: bool) { | ||
| 818 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 819 | } | ||
| 820 | #[doc = "Transmit data register empty"] | ||
| 821 | pub const fn txe(&self) -> bool { | ||
| 822 | let val = (self.0 >> 7usize) & 0x01; | ||
| 823 | val != 0 | ||
| 824 | } | ||
| 825 | #[doc = "Transmit data register empty"] | ||
| 826 | pub fn set_txe(&mut self, val: bool) { | ||
| 827 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 828 | } | ||
| 829 | #[doc = "LIN break detection flag"] | ||
| 830 | pub const fn lbdf(&self) -> bool { | ||
| 831 | let val = (self.0 >> 8usize) & 0x01; | ||
| 832 | val != 0 | ||
| 833 | } | ||
| 834 | #[doc = "LIN break detection flag"] | ||
| 835 | pub fn set_lbdf(&mut self, val: bool) { | ||
| 836 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 837 | } | ||
| 838 | #[doc = "CTS interrupt flag"] | ||
| 839 | pub const fn ctsif(&self) -> bool { | ||
| 840 | let val = (self.0 >> 9usize) & 0x01; | ||
| 841 | val != 0 | ||
| 842 | } | ||
| 843 | #[doc = "CTS interrupt flag"] | ||
| 844 | pub fn set_ctsif(&mut self, val: bool) { | ||
| 845 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | ||
| 846 | } | ||
| 847 | #[doc = "CTS flag"] | ||
| 848 | pub const fn cts(&self) -> bool { | ||
| 849 | let val = (self.0 >> 10usize) & 0x01; | ||
| 850 | val != 0 | ||
| 851 | } | ||
| 852 | #[doc = "CTS flag"] | ||
| 853 | pub fn set_cts(&mut self, val: bool) { | ||
| 854 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | ||
| 855 | } | ||
| 856 | #[doc = "Receiver timeout"] | ||
| 857 | pub const fn rtof(&self) -> bool { | ||
| 858 | let val = (self.0 >> 11usize) & 0x01; | ||
| 859 | val != 0 | ||
| 860 | } | ||
| 861 | #[doc = "Receiver timeout"] | ||
| 862 | pub fn set_rtof(&mut self, val: bool) { | ||
| 863 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); | ||
| 864 | } | ||
| 865 | #[doc = "End of block flag"] | ||
| 866 | pub const fn eobf(&self) -> bool { | ||
| 867 | let val = (self.0 >> 12usize) & 0x01; | ||
| 868 | val != 0 | ||
| 869 | } | ||
| 870 | #[doc = "End of block flag"] | ||
| 871 | pub fn set_eobf(&mut self, val: bool) { | ||
| 872 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); | ||
| 873 | } | ||
| 874 | #[doc = "Auto baud rate error"] | ||
| 875 | pub const fn abre(&self) -> bool { | ||
| 876 | let val = (self.0 >> 14usize) & 0x01; | ||
| 877 | val != 0 | ||
| 878 | } | ||
| 879 | #[doc = "Auto baud rate error"] | ||
| 880 | pub fn set_abre(&mut self, val: bool) { | ||
| 881 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | ||
| 882 | } | ||
| 883 | #[doc = "Auto baud rate flag"] | ||
| 884 | pub const fn abrf(&self) -> bool { | ||
| 885 | let val = (self.0 >> 15usize) & 0x01; | ||
| 886 | val != 0 | ||
| 887 | } | ||
| 888 | #[doc = "Auto baud rate flag"] | ||
| 889 | pub fn set_abrf(&mut self, val: bool) { | ||
| 890 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); | ||
| 891 | } | ||
| 892 | #[doc = "Busy flag"] | ||
| 893 | pub const fn busy(&self) -> bool { | ||
| 894 | let val = (self.0 >> 16usize) & 0x01; | ||
| 895 | val != 0 | ||
| 896 | } | ||
| 897 | #[doc = "Busy flag"] | ||
| 898 | pub fn set_busy(&mut self, val: bool) { | ||
| 899 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | ||
| 900 | } | ||
| 901 | #[doc = "character match flag"] | ||
| 902 | pub const fn cmf(&self) -> bool { | ||
| 903 | let val = (self.0 >> 17usize) & 0x01; | ||
| 904 | val != 0 | ||
| 905 | } | ||
| 906 | #[doc = "character match flag"] | ||
| 907 | pub fn set_cmf(&mut self, val: bool) { | ||
| 908 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); | ||
| 909 | } | ||
| 910 | #[doc = "Send break flag"] | ||
| 911 | pub const fn sbkf(&self) -> bool { | ||
| 912 | let val = (self.0 >> 18usize) & 0x01; | ||
| 913 | val != 0 | ||
| 914 | } | ||
| 915 | #[doc = "Send break flag"] | ||
| 916 | pub fn set_sbkf(&mut self, val: bool) { | ||
| 917 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); | ||
| 918 | } | ||
| 919 | #[doc = "Receiver wakeup from Mute mode"] | ||
| 920 | pub const fn rwu(&self) -> bool { | ||
| 921 | let val = (self.0 >> 19usize) & 0x01; | ||
| 922 | val != 0 | ||
| 923 | } | ||
| 924 | #[doc = "Receiver wakeup from Mute mode"] | ||
| 925 | pub fn set_rwu(&mut self, val: bool) { | ||
| 926 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); | ||
| 927 | } | ||
| 928 | #[doc = "Wakeup from Stop mode flag"] | ||
| 929 | pub const fn wuf(&self) -> bool { | ||
| 930 | let val = (self.0 >> 20usize) & 0x01; | ||
| 931 | val != 0 | ||
| 932 | } | ||
| 933 | #[doc = "Wakeup from Stop mode flag"] | ||
| 934 | pub fn set_wuf(&mut self, val: bool) { | ||
| 935 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); | ||
| 936 | } | ||
| 937 | #[doc = "Transmit enable acknowledge flag"] | ||
| 938 | pub const fn teack(&self) -> bool { | ||
| 939 | let val = (self.0 >> 21usize) & 0x01; | ||
| 940 | val != 0 | ||
| 941 | } | ||
| 942 | #[doc = "Transmit enable acknowledge flag"] | ||
| 943 | pub fn set_teack(&mut self, val: bool) { | ||
| 944 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); | ||
| 945 | } | ||
| 946 | #[doc = "Receive enable acknowledge flag"] | ||
| 947 | pub const fn reack(&self) -> bool { | ||
| 948 | let val = (self.0 >> 22usize) & 0x01; | ||
| 949 | val != 0 | ||
| 950 | } | ||
| 951 | #[doc = "Receive enable acknowledge flag"] | ||
| 952 | pub fn set_reack(&mut self, val: bool) { | ||
| 953 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); | ||
| 954 | } | ||
| 955 | } | ||
| 956 | impl Default for Ixr { | ||
| 957 | fn default() -> Ixr { | ||
| 958 | Ixr(0) | ||
| 959 | } | ||
| 960 | } | ||
| 961 | #[doc = "Data register"] | ||
| 962 | #[repr(transparent)] | ||
| 963 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 964 | pub struct Dr(pub u32); | ||
| 965 | impl Dr { | ||
| 966 | #[doc = "data value"] | ||
| 967 | pub const fn dr(&self) -> u16 { | ||
| 968 | let val = (self.0 >> 0usize) & 0x01ff; | ||
| 969 | val as u16 | ||
| 970 | } | ||
| 971 | #[doc = "data value"] | ||
| 972 | pub fn set_dr(&mut self, val: u16) { | ||
| 973 | self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize); | ||
| 974 | } | ||
| 975 | } | ||
| 976 | impl Default for Dr { | ||
| 977 | fn default() -> Dr { | ||
| 978 | Dr(0) | ||
| 495 | } | 979 | } |
| 496 | } | 980 | } |
| 497 | #[doc = "Control register 2"] | 981 | #[doc = "Control register 2"] |
| 498 | #[repr(transparent)] | 982 | #[repr(transparent)] |
| 499 | #[derive(Copy, Clone, Eq, PartialEq)] | 983 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 500 | pub struct Cr2Usart(pub u32); | 984 | pub struct Cr2(pub u32); |
| 501 | impl Cr2Usart { | 985 | impl Cr2 { |
| 502 | #[doc = "Address of the USART node"] | 986 | #[doc = "7-bit Address Detection/4-bit Address Detection"] |
| 503 | pub const fn add(&self) -> u8 { | 987 | pub fn addm(&self, n: usize) -> super::vals::Addm { |
| 504 | let val = (self.0 >> 0usize) & 0x0f; | 988 | assert!(n < 1usize); |
| 505 | val as u8 | 989 | let offs = 4usize + n * 0usize; |
| 990 | let val = (self.0 >> offs) & 0x01; | ||
| 991 | super::vals::Addm(val as u8) | ||
| 506 | } | 992 | } |
| 507 | #[doc = "Address of the USART node"] | 993 | #[doc = "7-bit Address Detection/4-bit Address Detection"] |
| 508 | pub fn set_add(&mut self, val: u8) { | 994 | pub fn set_addm(&mut self, n: usize, val: super::vals::Addm) { |
| 509 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); | 995 | assert!(n < 1usize); |
| 996 | let offs = 4usize + n * 0usize; | ||
| 997 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 510 | } | 998 | } |
| 511 | #[doc = "lin break detection length"] | 999 | #[doc = "LIN break detection length"] |
| 512 | pub const fn lbdl(&self) -> super::vals::Lbdl { | 1000 | pub const fn lbdl(&self) -> super::vals::Lbdl { |
| 513 | let val = (self.0 >> 5usize) & 0x01; | 1001 | let val = (self.0 >> 5usize) & 0x01; |
| 514 | super::vals::Lbdl(val as u8) | 1002 | super::vals::Lbdl(val as u8) |
| 515 | } | 1003 | } |
| 516 | #[doc = "lin break detection length"] | 1004 | #[doc = "LIN break detection length"] |
| 517 | pub fn set_lbdl(&mut self, val: super::vals::Lbdl) { | 1005 | pub fn set_lbdl(&mut self, val: super::vals::Lbdl) { |
| 518 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | 1006 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); |
| 519 | } | 1007 | } |
| @@ -527,13 +1015,13 @@ pub mod usart_v1 { | |||
| 527 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 1015 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 528 | } | 1016 | } |
| 529 | #[doc = "Last bit clock pulse"] | 1017 | #[doc = "Last bit clock pulse"] |
| 530 | pub const fn lbcl(&self) -> bool { | 1018 | pub const fn lbcl(&self) -> super::vals::Lbcl { |
| 531 | let val = (self.0 >> 8usize) & 0x01; | 1019 | let val = (self.0 >> 8usize) & 0x01; |
| 532 | val != 0 | 1020 | super::vals::Lbcl(val as u8) |
| 533 | } | 1021 | } |
| 534 | #[doc = "Last bit clock pulse"] | 1022 | #[doc = "Last bit clock pulse"] |
| 535 | pub fn set_lbcl(&mut self, val: bool) { | 1023 | pub fn set_lbcl(&mut self, val: super::vals::Lbcl) { |
| 536 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 1024 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); |
| 537 | } | 1025 | } |
| 538 | #[doc = "Clock phase"] | 1026 | #[doc = "Clock phase"] |
| 539 | pub const fn cpha(&self) -> super::vals::Cpha { | 1027 | pub const fn cpha(&self) -> super::vals::Cpha { |
| @@ -580,220 +1068,3039 @@ pub mod usart_v1 { | |||
| 580 | pub fn set_linen(&mut self, val: bool) { | 1068 | pub fn set_linen(&mut self, val: bool) { |
| 581 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | 1069 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); |
| 582 | } | 1070 | } |
| 1071 | #[doc = "Swap TX/RX pins"] | ||
| 1072 | pub const fn swap(&self) -> super::vals::Swap { | ||
| 1073 | let val = (self.0 >> 15usize) & 0x01; | ||
| 1074 | super::vals::Swap(val as u8) | ||
| 1075 | } | ||
| 1076 | #[doc = "Swap TX/RX pins"] | ||
| 1077 | pub fn set_swap(&mut self, val: super::vals::Swap) { | ||
| 1078 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 1079 | } | ||
| 1080 | #[doc = "RX pin active level inversion"] | ||
| 1081 | pub const fn rxinv(&self) -> super::vals::Rxinv { | ||
| 1082 | let val = (self.0 >> 16usize) & 0x01; | ||
| 1083 | super::vals::Rxinv(val as u8) | ||
| 1084 | } | ||
| 1085 | #[doc = "RX pin active level inversion"] | ||
| 1086 | pub fn set_rxinv(&mut self, val: super::vals::Rxinv) { | ||
| 1087 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 1088 | } | ||
| 1089 | #[doc = "TX pin active level inversion"] | ||
| 1090 | pub const fn txinv(&self) -> super::vals::Txinv { | ||
| 1091 | let val = (self.0 >> 17usize) & 0x01; | ||
| 1092 | super::vals::Txinv(val as u8) | ||
| 1093 | } | ||
| 1094 | #[doc = "TX pin active level inversion"] | ||
| 1095 | pub fn set_txinv(&mut self, val: super::vals::Txinv) { | ||
| 1096 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize); | ||
| 1097 | } | ||
| 1098 | #[doc = "Binary data inversion"] | ||
| 1099 | pub const fn datainv(&self) -> super::vals::Datainv { | ||
| 1100 | let val = (self.0 >> 18usize) & 0x01; | ||
| 1101 | super::vals::Datainv(val as u8) | ||
| 1102 | } | ||
| 1103 | #[doc = "Binary data inversion"] | ||
| 1104 | pub fn set_datainv(&mut self, val: super::vals::Datainv) { | ||
| 1105 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize); | ||
| 1106 | } | ||
| 1107 | #[doc = "Most significant bit first"] | ||
| 1108 | pub const fn msbfirst(&self) -> super::vals::Msbfirst { | ||
| 1109 | let val = (self.0 >> 19usize) & 0x01; | ||
| 1110 | super::vals::Msbfirst(val as u8) | ||
| 1111 | } | ||
| 1112 | #[doc = "Most significant bit first"] | ||
| 1113 | pub fn set_msbfirst(&mut self, val: super::vals::Msbfirst) { | ||
| 1114 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); | ||
| 1115 | } | ||
| 1116 | #[doc = "Auto baud rate enable"] | ||
| 1117 | pub const fn abren(&self) -> bool { | ||
| 1118 | let val = (self.0 >> 20usize) & 0x01; | ||
| 1119 | val != 0 | ||
| 1120 | } | ||
| 1121 | #[doc = "Auto baud rate enable"] | ||
| 1122 | pub fn set_abren(&mut self, val: bool) { | ||
| 1123 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); | ||
| 1124 | } | ||
| 1125 | #[doc = "Auto baud rate mode"] | ||
| 1126 | pub const fn abrmod(&self) -> super::vals::Abrmod { | ||
| 1127 | let val = (self.0 >> 21usize) & 0x03; | ||
| 1128 | super::vals::Abrmod(val as u8) | ||
| 1129 | } | ||
| 1130 | #[doc = "Auto baud rate mode"] | ||
| 1131 | pub fn set_abrmod(&mut self, val: super::vals::Abrmod) { | ||
| 1132 | self.0 = (self.0 & !(0x03 << 21usize)) | (((val.0 as u32) & 0x03) << 21usize); | ||
| 1133 | } | ||
| 1134 | #[doc = "Receiver timeout enable"] | ||
| 1135 | pub const fn rtoen(&self) -> bool { | ||
| 1136 | let val = (self.0 >> 23usize) & 0x01; | ||
| 1137 | val != 0 | ||
| 1138 | } | ||
| 1139 | #[doc = "Receiver timeout enable"] | ||
| 1140 | pub fn set_rtoen(&mut self, val: bool) { | ||
| 1141 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); | ||
| 1142 | } | ||
| 1143 | #[doc = "Address of the USART node"] | ||
| 1144 | pub const fn add(&self) -> u8 { | ||
| 1145 | let val = (self.0 >> 24usize) & 0xff; | ||
| 1146 | val as u8 | ||
| 1147 | } | ||
| 1148 | #[doc = "Address of the USART node"] | ||
| 1149 | pub fn set_add(&mut self, val: u8) { | ||
| 1150 | self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize); | ||
| 1151 | } | ||
| 583 | } | 1152 | } |
| 584 | impl Default for Cr2Usart { | 1153 | impl Default for Cr2 { |
| 585 | fn default() -> Cr2Usart { | 1154 | fn default() -> Cr2 { |
| 586 | Cr2Usart(0) | 1155 | Cr2(0) |
| 587 | } | 1156 | } |
| 588 | } | 1157 | } |
| 589 | #[doc = "Baud rate register"] | 1158 | #[doc = "Guard time and prescaler register"] |
| 590 | #[repr(transparent)] | 1159 | #[repr(transparent)] |
| 591 | #[derive(Copy, Clone, Eq, PartialEq)] | 1160 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 592 | pub struct Brr(pub u32); | 1161 | pub struct Gtpr(pub u32); |
| 593 | impl Brr { | 1162 | impl Gtpr { |
| 594 | #[doc = "fraction of USARTDIV"] | 1163 | #[doc = "Prescaler value"] |
| 595 | pub const fn div_fraction(&self) -> u8 { | 1164 | pub const fn psc(&self) -> u8 { |
| 596 | let val = (self.0 >> 0usize) & 0x0f; | 1165 | let val = (self.0 >> 0usize) & 0xff; |
| 597 | val as u8 | 1166 | val as u8 |
| 598 | } | 1167 | } |
| 599 | #[doc = "fraction of USARTDIV"] | 1168 | #[doc = "Prescaler value"] |
| 600 | pub fn set_div_fraction(&mut self, val: u8) { | 1169 | pub fn set_psc(&mut self, val: u8) { |
| 601 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); | 1170 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); |
| 602 | } | 1171 | } |
| 603 | #[doc = "mantissa of USARTDIV"] | 1172 | #[doc = "Guard time value"] |
| 604 | pub const fn div_mantissa(&self) -> u16 { | 1173 | pub const fn gt(&self) -> u8 { |
| 605 | let val = (self.0 >> 4usize) & 0x0fff; | 1174 | let val = (self.0 >> 8usize) & 0xff; |
| 1175 | val as u8 | ||
| 1176 | } | ||
| 1177 | #[doc = "Guard time value"] | ||
| 1178 | pub fn set_gt(&mut self, val: u8) { | ||
| 1179 | self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize); | ||
| 1180 | } | ||
| 1181 | } | ||
| 1182 | impl Default for Gtpr { | ||
| 1183 | fn default() -> Gtpr { | ||
| 1184 | Gtpr(0) | ||
| 1185 | } | ||
| 1186 | } | ||
| 1187 | #[doc = "Request register"] | ||
| 1188 | #[repr(transparent)] | ||
| 1189 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1190 | pub struct Rqr(pub u32); | ||
| 1191 | impl Rqr { | ||
| 1192 | #[doc = "Auto baud rate request"] | ||
| 1193 | pub const fn abrrq(&self) -> super::vals::Abrrq { | ||
| 1194 | let val = (self.0 >> 0usize) & 0x01; | ||
| 1195 | super::vals::Abrrq(val as u8) | ||
| 1196 | } | ||
| 1197 | #[doc = "Auto baud rate request"] | ||
| 1198 | pub fn set_abrrq(&mut self, val: super::vals::Abrrq) { | ||
| 1199 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 1200 | } | ||
| 1201 | #[doc = "Send break request"] | ||
| 1202 | pub const fn sbkrq(&self) -> super::vals::Sbkrq { | ||
| 1203 | let val = (self.0 >> 1usize) & 0x01; | ||
| 1204 | super::vals::Sbkrq(val as u8) | ||
| 1205 | } | ||
| 1206 | #[doc = "Send break request"] | ||
| 1207 | pub fn set_sbkrq(&mut self, val: super::vals::Sbkrq) { | ||
| 1208 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 1209 | } | ||
| 1210 | #[doc = "Mute mode request"] | ||
| 1211 | pub const fn mmrq(&self) -> super::vals::Mmrq { | ||
| 1212 | let val = (self.0 >> 2usize) & 0x01; | ||
| 1213 | super::vals::Mmrq(val as u8) | ||
| 1214 | } | ||
| 1215 | #[doc = "Mute mode request"] | ||
| 1216 | pub fn set_mmrq(&mut self, val: super::vals::Mmrq) { | ||
| 1217 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 1218 | } | ||
| 1219 | #[doc = "Receive data flush request"] | ||
| 1220 | pub const fn rxfrq(&self) -> super::vals::Rxfrq { | ||
| 1221 | let val = (self.0 >> 3usize) & 0x01; | ||
| 1222 | super::vals::Rxfrq(val as u8) | ||
| 1223 | } | ||
| 1224 | #[doc = "Receive data flush request"] | ||
| 1225 | pub fn set_rxfrq(&mut self, val: super::vals::Rxfrq) { | ||
| 1226 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 1227 | } | ||
| 1228 | #[doc = "Transmit data flush request"] | ||
| 1229 | pub const fn txfrq(&self) -> super::vals::Txfrq { | ||
| 1230 | let val = (self.0 >> 4usize) & 0x01; | ||
| 1231 | super::vals::Txfrq(val as u8) | ||
| 1232 | } | ||
| 1233 | #[doc = "Transmit data flush request"] | ||
| 1234 | pub fn set_txfrq(&mut self, val: super::vals::Txfrq) { | ||
| 1235 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 1236 | } | ||
| 1237 | } | ||
| 1238 | impl Default for Rqr { | ||
| 1239 | fn default() -> Rqr { | ||
| 1240 | Rqr(0) | ||
| 1241 | } | ||
| 1242 | } | ||
| 1243 | } | ||
| 1244 | pub mod vals { | ||
| 1245 | use crate::generic::*; | ||
| 1246 | #[repr(transparent)] | ||
| 1247 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1248 | pub struct Cpol(pub u8); | ||
| 1249 | impl Cpol { | ||
| 1250 | #[doc = "Steady low value on CK pin outside transmission window"] | ||
| 1251 | pub const LOW: Self = Self(0); | ||
| 1252 | #[doc = "Steady high value on CK pin outside transmission window"] | ||
| 1253 | pub const HIGH: Self = Self(0x01); | ||
| 1254 | } | ||
| 1255 | #[repr(transparent)] | ||
| 1256 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1257 | pub struct Sbkrq(pub u8); | ||
| 1258 | impl Sbkrq { | ||
| 1259 | #[doc = "sets the SBKF flag and request to send a BREAK on the line, as soon as the transmit machine is available"] | ||
| 1260 | pub const BREAK: Self = Self(0x01); | ||
| 1261 | } | ||
| 1262 | #[repr(transparent)] | ||
| 1263 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1264 | pub struct Addm(pub u8); | ||
| 1265 | impl Addm { | ||
| 1266 | #[doc = "4-bit address detection"] | ||
| 1267 | pub const BIT4: Self = Self(0); | ||
| 1268 | #[doc = "7-bit address detection"] | ||
| 1269 | pub const BIT7: Self = Self(0x01); | ||
| 1270 | } | ||
| 1271 | #[repr(transparent)] | ||
| 1272 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1273 | pub struct Ovrdis(pub u8); | ||
| 1274 | impl Ovrdis { | ||
| 1275 | #[doc = "Overrun Error Flag, ORE, is set when received data is not read before receiving new data"] | ||
| 1276 | pub const ENABLED: Self = Self(0); | ||
| 1277 | #[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"] | ||
| 1278 | pub const DISABLED: Self = Self(0x01); | ||
| 1279 | } | ||
| 1280 | #[repr(transparent)] | ||
| 1281 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1282 | pub struct Irlp(pub u8); | ||
| 1283 | impl Irlp { | ||
| 1284 | #[doc = "Normal mode"] | ||
| 1285 | pub const NORMAL: Self = Self(0); | ||
| 1286 | #[doc = "Low-power mode"] | ||
| 1287 | pub const LOWPOWER: Self = Self(0x01); | ||
| 1288 | } | ||
| 1289 | #[repr(transparent)] | ||
| 1290 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1291 | pub struct Txfrq(pub u8); | ||
| 1292 | impl Txfrq { | ||
| 1293 | #[doc = "Set the TXE flags. This allows to discard the transmit data"] | ||
| 1294 | pub const DISCARD: Self = Self(0x01); | ||
| 1295 | } | ||
| 1296 | #[repr(transparent)] | ||
| 1297 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1298 | pub struct Wake(pub u8); | ||
| 1299 | impl Wake { | ||
| 1300 | #[doc = "Idle line"] | ||
| 1301 | pub const IDLE: Self = Self(0); | ||
| 1302 | #[doc = "Address mask"] | ||
| 1303 | pub const ADDRESS: Self = Self(0x01); | ||
| 1304 | } | ||
| 1305 | #[repr(transparent)] | ||
| 1306 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1307 | pub struct Over(pub u8); | ||
| 1308 | impl Over { | ||
| 1309 | #[doc = "Oversampling by 16"] | ||
| 1310 | pub const OVERSAMPLING16: Self = Self(0); | ||
| 1311 | #[doc = "Oversampling by 8"] | ||
| 1312 | pub const OVERSAMPLING8: Self = Self(0x01); | ||
| 1313 | } | ||
| 1314 | #[repr(transparent)] | ||
| 1315 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1316 | pub struct Stop(pub u8); | ||
| 1317 | impl Stop { | ||
| 1318 | #[doc = "1 stop bit"] | ||
| 1319 | pub const STOP1: Self = Self(0); | ||
| 1320 | #[doc = "0.5 stop bit"] | ||
| 1321 | pub const STOP0P5: Self = Self(0x01); | ||
| 1322 | #[doc = "2 stop bit"] | ||
| 1323 | pub const STOP2: Self = Self(0x02); | ||
| 1324 | #[doc = "1.5 stop bit"] | ||
| 1325 | pub const STOP1P5: Self = Self(0x03); | ||
| 1326 | } | ||
| 1327 | #[repr(transparent)] | ||
| 1328 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1329 | pub struct M0(pub u8); | ||
| 1330 | impl M0 { | ||
| 1331 | #[doc = "1 start bit, 8 data bits, n stop bits"] | ||
| 1332 | pub const BIT8: Self = Self(0); | ||
| 1333 | #[doc = "1 start bit, 9 data bits, n stop bits"] | ||
| 1334 | pub const BIT9: Self = Self(0x01); | ||
| 1335 | } | ||
| 1336 | #[repr(transparent)] | ||
| 1337 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1338 | pub struct Hdsel(pub u8); | ||
| 1339 | impl Hdsel { | ||
| 1340 | #[doc = "Half duplex mode is not selected"] | ||
| 1341 | pub const NOTSELECTED: Self = Self(0); | ||
| 1342 | #[doc = "Half duplex mode is selected"] | ||
| 1343 | pub const SELECTED: Self = Self(0x01); | ||
| 1344 | } | ||
| 1345 | #[repr(transparent)] | ||
| 1346 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1347 | pub struct Rxinv(pub u8); | ||
| 1348 | impl Rxinv { | ||
| 1349 | #[doc = "RX pin signal works using the standard logic levels"] | ||
| 1350 | pub const STANDARD: Self = Self(0); | ||
| 1351 | #[doc = "RX pin signal values are inverted"] | ||
| 1352 | pub const INVERTED: Self = Self(0x01); | ||
| 1353 | } | ||
| 1354 | #[repr(transparent)] | ||
| 1355 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1356 | pub struct M1(pub u8); | ||
| 1357 | impl M1 { | ||
| 1358 | #[doc = "Use M0 to set the data bits"] | ||
| 1359 | pub const M0: Self = Self(0); | ||
| 1360 | #[doc = "1 start bit, 7 data bits, n stop bits"] | ||
| 1361 | pub const BIT7: Self = Self(0x01); | ||
| 1362 | } | ||
| 1363 | #[repr(transparent)] | ||
| 1364 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1365 | pub struct Txinv(pub u8); | ||
| 1366 | impl Txinv { | ||
| 1367 | #[doc = "TX pin signal works using the standard logic levels"] | ||
| 1368 | pub const STANDARD: Self = Self(0); | ||
| 1369 | #[doc = "TX pin signal values are inverted"] | ||
| 1370 | pub const INVERTED: Self = Self(0x01); | ||
| 1371 | } | ||
| 1372 | #[repr(transparent)] | ||
| 1373 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1374 | pub struct Abrmod(pub u8); | ||
| 1375 | impl Abrmod { | ||
| 1376 | #[doc = "Measurement of the start bit is used to detect the baud rate"] | ||
| 1377 | pub const START: Self = Self(0); | ||
| 1378 | #[doc = "Falling edge to falling edge measurement"] | ||
| 1379 | pub const EDGE: Self = Self(0x01); | ||
| 1380 | #[doc = "0x7F frame detection"] | ||
| 1381 | pub const FRAME7F: Self = Self(0x02); | ||
| 1382 | #[doc = "0x55 frame detection"] | ||
| 1383 | pub const FRAME55: Self = Self(0x03); | ||
| 1384 | } | ||
| 1385 | #[repr(transparent)] | ||
| 1386 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1387 | pub struct Msbfirst(pub u8); | ||
| 1388 | impl Msbfirst { | ||
| 1389 | #[doc = "data is transmitted/received with data bit 0 first, following the start bit"] | ||
| 1390 | pub const LSB: Self = Self(0); | ||
| 1391 | #[doc = "data is transmitted/received with MSB (bit 7/8/9) first, following the start bit"] | ||
| 1392 | pub const MSB: Self = Self(0x01); | ||
| 1393 | } | ||
| 1394 | #[repr(transparent)] | ||
| 1395 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1396 | pub struct Swap(pub u8); | ||
| 1397 | impl Swap { | ||
| 1398 | #[doc = "TX/RX pins are used as defined in standard pinout"] | ||
| 1399 | pub const STANDARD: Self = Self(0); | ||
| 1400 | #[doc = "The TX and RX pins functions are swapped"] | ||
| 1401 | pub const SWAPPED: Self = Self(0x01); | ||
| 1402 | } | ||
| 1403 | #[repr(transparent)] | ||
| 1404 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1405 | pub struct Abrrq(pub u8); | ||
| 1406 | impl Abrrq { | ||
| 1407 | #[doc = "resets the ABRF flag in the USART_ISR and request an automatic baud rate measurement on the next received data frame"] | ||
| 1408 | pub const REQUEST: Self = Self(0x01); | ||
| 1409 | } | ||
| 1410 | #[repr(transparent)] | ||
| 1411 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1412 | pub struct Mmrq(pub u8); | ||
| 1413 | impl Mmrq { | ||
| 1414 | #[doc = "Puts the USART in mute mode and sets the RWU flag"] | ||
| 1415 | pub const MUTE: Self = Self(0x01); | ||
| 1416 | } | ||
| 1417 | #[repr(transparent)] | ||
| 1418 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1419 | pub struct Cpha(pub u8); | ||
| 1420 | impl Cpha { | ||
| 1421 | #[doc = "The first clock transition is the first data capture edge"] | ||
| 1422 | pub const FIRST: Self = Self(0); | ||
| 1423 | #[doc = "The second clock transition is the first data capture edge"] | ||
| 1424 | pub const SECOND: Self = Self(0x01); | ||
| 1425 | } | ||
| 1426 | #[repr(transparent)] | ||
| 1427 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1428 | pub struct Dep(pub u8); | ||
| 1429 | impl Dep { | ||
| 1430 | #[doc = "DE signal is active high"] | ||
| 1431 | pub const HIGH: Self = Self(0); | ||
| 1432 | #[doc = "DE signal is active low"] | ||
| 1433 | pub const LOW: Self = Self(0x01); | ||
| 1434 | } | ||
| 1435 | #[repr(transparent)] | ||
| 1436 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1437 | pub struct Lbcl(pub u8); | ||
| 1438 | impl Lbcl { | ||
| 1439 | #[doc = "The clock pulse of the last data bit is not output to the CK pin"] | ||
| 1440 | pub const NOTOUTPUT: Self = Self(0); | ||
| 1441 | #[doc = "The clock pulse of the last data bit is output to the CK pin"] | ||
| 1442 | pub const OUTPUT: Self = Self(0x01); | ||
| 1443 | } | ||
| 1444 | #[repr(transparent)] | ||
| 1445 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1446 | pub struct Ddre(pub u8); | ||
| 1447 | impl Ddre { | ||
| 1448 | #[doc = "DMA is not disabled in case of reception error"] | ||
| 1449 | pub const NOTDISABLED: Self = Self(0); | ||
| 1450 | #[doc = "DMA is disabled following a reception error"] | ||
| 1451 | pub const DISABLED: Self = Self(0x01); | ||
| 1452 | } | ||
| 1453 | #[repr(transparent)] | ||
| 1454 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1455 | pub struct Ps(pub u8); | ||
| 1456 | impl Ps { | ||
| 1457 | #[doc = "Even parity"] | ||
| 1458 | pub const EVEN: Self = Self(0); | ||
| 1459 | #[doc = "Odd parity"] | ||
| 1460 | pub const ODD: Self = Self(0x01); | ||
| 1461 | } | ||
| 1462 | #[repr(transparent)] | ||
| 1463 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1464 | pub struct Rxfrq(pub u8); | ||
| 1465 | impl Rxfrq { | ||
| 1466 | #[doc = "clears the RXNE flag. This allows to discard the received data without reading it, and avoid an overrun condition"] | ||
| 1467 | pub const DISCARD: Self = Self(0x01); | ||
| 1468 | } | ||
| 1469 | #[repr(transparent)] | ||
| 1470 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1471 | pub struct Datainv(pub u8); | ||
| 1472 | impl Datainv { | ||
| 1473 | #[doc = "Logical data from the data register are send/received in positive/direct logic"] | ||
| 1474 | pub const POSITIVE: Self = Self(0); | ||
| 1475 | #[doc = "Logical data from the data register are send/received in negative/inverse logic"] | ||
| 1476 | pub const NEGATIVE: Self = Self(0x01); | ||
| 1477 | } | ||
| 1478 | #[repr(transparent)] | ||
| 1479 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1480 | pub struct Lbdl(pub u8); | ||
| 1481 | impl Lbdl { | ||
| 1482 | #[doc = "10-bit break detection"] | ||
| 1483 | pub const BIT10: Self = Self(0); | ||
| 1484 | #[doc = "11-bit break detection"] | ||
| 1485 | pub const BIT11: Self = Self(0x01); | ||
| 1486 | } | ||
| 1487 | #[repr(transparent)] | ||
| 1488 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1489 | pub struct Onebit(pub u8); | ||
| 1490 | impl Onebit { | ||
| 1491 | #[doc = "Three sample bit method"] | ||
| 1492 | pub const SAMPLE3: Self = Self(0); | ||
| 1493 | #[doc = "One sample bit method"] | ||
| 1494 | pub const SAMPLE1: Self = Self(0x01); | ||
| 1495 | } | ||
| 1496 | #[repr(transparent)] | ||
| 1497 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1498 | pub struct Wus(pub u8); | ||
| 1499 | impl Wus { | ||
| 1500 | #[doc = "WUF active on address match"] | ||
| 1501 | pub const ADDRESS: Self = Self(0); | ||
| 1502 | #[doc = "WuF active on Start bit detection"] | ||
| 1503 | pub const START: Self = Self(0x02); | ||
| 1504 | #[doc = "WUF active on RXNE"] | ||
| 1505 | pub const RXNE: Self = Self(0x03); | ||
| 1506 | } | ||
| 1507 | } | ||
| 1508 | } | ||
| 1509 | pub mod syscfg_f4 { | ||
| 1510 | use crate::generic::*; | ||
| 1511 | #[doc = "System configuration controller"] | ||
| 1512 | #[derive(Copy, Clone)] | ||
| 1513 | pub struct Syscfg(pub *mut u8); | ||
| 1514 | unsafe impl Send for Syscfg {} | ||
| 1515 | unsafe impl Sync for Syscfg {} | ||
| 1516 | impl Syscfg { | ||
| 1517 | #[doc = "memory remap register"] | ||
| 1518 | pub fn memrm(self) -> Reg<regs::Memrm, RW> { | ||
| 1519 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 1520 | } | ||
| 1521 | #[doc = "peripheral mode configuration register"] | ||
| 1522 | pub fn pmc(self) -> Reg<regs::Pmc, RW> { | ||
| 1523 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 1524 | } | ||
| 1525 | #[doc = "external interrupt configuration register"] | ||
| 1526 | pub fn exticr(self, n: usize) -> Reg<regs::Exticr, RW> { | ||
| 1527 | assert!(n < 4usize); | ||
| 1528 | unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) } | ||
| 1529 | } | ||
| 1530 | #[doc = "Compensation cell control register"] | ||
| 1531 | pub fn cmpcr(self) -> Reg<regs::Cmpcr, R> { | ||
| 1532 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | ||
| 1533 | } | ||
| 1534 | } | ||
| 1535 | pub mod regs { | ||
| 1536 | use crate::generic::*; | ||
| 1537 | #[doc = "peripheral mode configuration register"] | ||
| 1538 | #[repr(transparent)] | ||
| 1539 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1540 | pub struct Pmc(pub u32); | ||
| 1541 | impl Pmc { | ||
| 1542 | #[doc = "ADC1DC2"] | ||
| 1543 | pub const fn adc1dc2(&self) -> bool { | ||
| 1544 | let val = (self.0 >> 16usize) & 0x01; | ||
| 1545 | val != 0 | ||
| 1546 | } | ||
| 1547 | #[doc = "ADC1DC2"] | ||
| 1548 | pub fn set_adc1dc2(&mut self, val: bool) { | ||
| 1549 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | ||
| 1550 | } | ||
| 1551 | #[doc = "ADC2DC2"] | ||
| 1552 | pub const fn adc2dc2(&self) -> bool { | ||
| 1553 | let val = (self.0 >> 17usize) & 0x01; | ||
| 1554 | val != 0 | ||
| 1555 | } | ||
| 1556 | #[doc = "ADC2DC2"] | ||
| 1557 | pub fn set_adc2dc2(&mut self, val: bool) { | ||
| 1558 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); | ||
| 1559 | } | ||
| 1560 | #[doc = "ADC3DC2"] | ||
| 1561 | pub const fn adc3dc2(&self) -> bool { | ||
| 1562 | let val = (self.0 >> 18usize) & 0x01; | ||
| 1563 | val != 0 | ||
| 1564 | } | ||
| 1565 | #[doc = "ADC3DC2"] | ||
| 1566 | pub fn set_adc3dc2(&mut self, val: bool) { | ||
| 1567 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); | ||
| 1568 | } | ||
| 1569 | #[doc = "Ethernet PHY interface selection"] | ||
| 1570 | pub const fn mii_rmii_sel(&self) -> bool { | ||
| 1571 | let val = (self.0 >> 23usize) & 0x01; | ||
| 1572 | val != 0 | ||
| 1573 | } | ||
| 1574 | #[doc = "Ethernet PHY interface selection"] | ||
| 1575 | pub fn set_mii_rmii_sel(&mut self, val: bool) { | ||
| 1576 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); | ||
| 1577 | } | ||
| 1578 | } | ||
| 1579 | impl Default for Pmc { | ||
| 1580 | fn default() -> Pmc { | ||
| 1581 | Pmc(0) | ||
| 1582 | } | ||
| 1583 | } | ||
| 1584 | #[doc = "external interrupt configuration register"] | ||
| 1585 | #[repr(transparent)] | ||
| 1586 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1587 | pub struct Exticr(pub u32); | ||
| 1588 | impl Exticr { | ||
| 1589 | #[doc = "EXTI x configuration"] | ||
| 1590 | pub fn exti(&self, n: usize) -> u8 { | ||
| 1591 | assert!(n < 4usize); | ||
| 1592 | let offs = 0usize + n * 4usize; | ||
| 1593 | let val = (self.0 >> offs) & 0x0f; | ||
| 1594 | val as u8 | ||
| 1595 | } | ||
| 1596 | #[doc = "EXTI x configuration"] | ||
| 1597 | pub fn set_exti(&mut self, n: usize, val: u8) { | ||
| 1598 | assert!(n < 4usize); | ||
| 1599 | let offs = 0usize + n * 4usize; | ||
| 1600 | self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs); | ||
| 1601 | } | ||
| 1602 | } | ||
| 1603 | impl Default for Exticr { | ||
| 1604 | fn default() -> Exticr { | ||
| 1605 | Exticr(0) | ||
| 1606 | } | ||
| 1607 | } | ||
| 1608 | #[doc = "Compensation cell control register"] | ||
| 1609 | #[repr(transparent)] | ||
| 1610 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1611 | pub struct Cmpcr(pub u32); | ||
| 1612 | impl Cmpcr { | ||
| 1613 | #[doc = "Compensation cell power-down"] | ||
| 1614 | pub const fn cmp_pd(&self) -> bool { | ||
| 1615 | let val = (self.0 >> 0usize) & 0x01; | ||
| 1616 | val != 0 | ||
| 1617 | } | ||
| 1618 | #[doc = "Compensation cell power-down"] | ||
| 1619 | pub fn set_cmp_pd(&mut self, val: bool) { | ||
| 1620 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 1621 | } | ||
| 1622 | #[doc = "READY"] | ||
| 1623 | pub const fn ready(&self) -> bool { | ||
| 1624 | let val = (self.0 >> 8usize) & 0x01; | ||
| 1625 | val != 0 | ||
| 1626 | } | ||
| 1627 | #[doc = "READY"] | ||
| 1628 | pub fn set_ready(&mut self, val: bool) { | ||
| 1629 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 1630 | } | ||
| 1631 | } | ||
| 1632 | impl Default for Cmpcr { | ||
| 1633 | fn default() -> Cmpcr { | ||
| 1634 | Cmpcr(0) | ||
| 1635 | } | ||
| 1636 | } | ||
| 1637 | #[doc = "memory remap register"] | ||
| 1638 | #[repr(transparent)] | ||
| 1639 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1640 | pub struct Memrm(pub u32); | ||
| 1641 | impl Memrm { | ||
| 1642 | #[doc = "Memory mapping selection"] | ||
| 1643 | pub const fn mem_mode(&self) -> u8 { | ||
| 1644 | let val = (self.0 >> 0usize) & 0x07; | ||
| 1645 | val as u8 | ||
| 1646 | } | ||
| 1647 | #[doc = "Memory mapping selection"] | ||
| 1648 | pub fn set_mem_mode(&mut self, val: u8) { | ||
| 1649 | self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize); | ||
| 1650 | } | ||
| 1651 | #[doc = "Flash bank mode selection"] | ||
| 1652 | pub const fn fb_mode(&self) -> bool { | ||
| 1653 | let val = (self.0 >> 8usize) & 0x01; | ||
| 1654 | val != 0 | ||
| 1655 | } | ||
| 1656 | #[doc = "Flash bank mode selection"] | ||
| 1657 | pub fn set_fb_mode(&mut self, val: bool) { | ||
| 1658 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 1659 | } | ||
| 1660 | #[doc = "FMC memory mapping swap"] | ||
| 1661 | pub const fn swp_fmc(&self) -> u8 { | ||
| 1662 | let val = (self.0 >> 10usize) & 0x03; | ||
| 1663 | val as u8 | ||
| 1664 | } | ||
| 1665 | #[doc = "FMC memory mapping swap"] | ||
| 1666 | pub fn set_swp_fmc(&mut self, val: u8) { | ||
| 1667 | self.0 = (self.0 & !(0x03 << 10usize)) | (((val as u32) & 0x03) << 10usize); | ||
| 1668 | } | ||
| 1669 | } | ||
| 1670 | impl Default for Memrm { | ||
| 1671 | fn default() -> Memrm { | ||
| 1672 | Memrm(0) | ||
| 1673 | } | ||
| 1674 | } | ||
| 1675 | } | ||
| 1676 | } | ||
| 1677 | pub mod generic { | ||
| 1678 | use core::marker::PhantomData; | ||
| 1679 | #[derive(Copy, Clone)] | ||
| 1680 | pub struct RW; | ||
| 1681 | #[derive(Copy, Clone)] | ||
| 1682 | pub struct R; | ||
| 1683 | #[derive(Copy, Clone)] | ||
| 1684 | pub struct W; | ||
| 1685 | mod sealed { | ||
| 1686 | use super::*; | ||
| 1687 | pub trait Access {} | ||
| 1688 | impl Access for R {} | ||
| 1689 | impl Access for W {} | ||
| 1690 | impl Access for RW {} | ||
| 1691 | } | ||
| 1692 | pub trait Access: sealed::Access + Copy {} | ||
| 1693 | impl Access for R {} | ||
| 1694 | impl Access for W {} | ||
| 1695 | impl Access for RW {} | ||
| 1696 | pub trait Read: Access {} | ||
| 1697 | impl Read for RW {} | ||
| 1698 | impl Read for R {} | ||
| 1699 | pub trait Write: Access {} | ||
| 1700 | impl Write for RW {} | ||
| 1701 | impl Write for W {} | ||
| 1702 | #[derive(Copy, Clone)] | ||
| 1703 | pub struct Reg<T: Copy, A: Access> { | ||
| 1704 | ptr: *mut u8, | ||
| 1705 | phantom: PhantomData<*mut (T, A)>, | ||
| 1706 | } | ||
| 1707 | unsafe impl<T: Copy, A: Access> Send for Reg<T, A> {} | ||
| 1708 | unsafe impl<T: Copy, A: Access> Sync for Reg<T, A> {} | ||
| 1709 | impl<T: Copy, A: Access> Reg<T, A> { | ||
| 1710 | pub fn from_ptr(ptr: *mut u8) -> Self { | ||
| 1711 | Self { | ||
| 1712 | ptr, | ||
| 1713 | phantom: PhantomData, | ||
| 1714 | } | ||
| 1715 | } | ||
| 1716 | pub fn ptr(&self) -> *mut T { | ||
| 1717 | self.ptr as _ | ||
| 1718 | } | ||
| 1719 | } | ||
| 1720 | impl<T: Copy, A: Read> Reg<T, A> { | ||
| 1721 | pub unsafe fn read(&self) -> T { | ||
| 1722 | (self.ptr as *mut T).read_volatile() | ||
| 1723 | } | ||
| 1724 | } | ||
| 1725 | impl<T: Copy, A: Write> Reg<T, A> { | ||
| 1726 | pub unsafe fn write_value(&self, val: T) { | ||
| 1727 | (self.ptr as *mut T).write_volatile(val) | ||
| 1728 | } | ||
| 1729 | } | ||
| 1730 | impl<T: Default + Copy, A: Write> Reg<T, A> { | ||
| 1731 | pub unsafe fn write<R>(&self, f: impl FnOnce(&mut T) -> R) -> R { | ||
| 1732 | let mut val = Default::default(); | ||
| 1733 | let res = f(&mut val); | ||
| 1734 | self.write_value(val); | ||
| 1735 | res | ||
| 1736 | } | ||
| 1737 | } | ||
| 1738 | impl<T: Copy, A: Read + Write> Reg<T, A> { | ||
| 1739 | pub unsafe fn modify<R>(&self, f: impl FnOnce(&mut T) -> R) -> R { | ||
| 1740 | let mut val = self.read(); | ||
| 1741 | let res = f(&mut val); | ||
| 1742 | self.write_value(val); | ||
| 1743 | res | ||
| 1744 | } | ||
| 1745 | } | ||
| 1746 | } | ||
| 1747 | pub mod exti_v1 { | ||
| 1748 | use crate::generic::*; | ||
| 1749 | #[doc = "External interrupt/event controller"] | ||
| 1750 | #[derive(Copy, Clone)] | ||
| 1751 | pub struct Exti(pub *mut u8); | ||
| 1752 | unsafe impl Send for Exti {} | ||
| 1753 | unsafe impl Sync for Exti {} | ||
| 1754 | impl Exti { | ||
| 1755 | #[doc = "Interrupt mask register (EXTI_IMR)"] | ||
| 1756 | pub fn imr(self) -> Reg<regs::Imr, RW> { | ||
| 1757 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 1758 | } | ||
| 1759 | #[doc = "Event mask register (EXTI_EMR)"] | ||
| 1760 | pub fn emr(self) -> Reg<regs::Emr, RW> { | ||
| 1761 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 1762 | } | ||
| 1763 | #[doc = "Rising Trigger selection register (EXTI_RTSR)"] | ||
| 1764 | pub fn rtsr(self) -> Reg<regs::Rtsr, RW> { | ||
| 1765 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 1766 | } | ||
| 1767 | #[doc = "Falling Trigger selection register (EXTI_FTSR)"] | ||
| 1768 | pub fn ftsr(self) -> Reg<regs::Ftsr, RW> { | ||
| 1769 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 1770 | } | ||
| 1771 | #[doc = "Software interrupt event register (EXTI_SWIER)"] | ||
| 1772 | pub fn swier(self) -> Reg<regs::Swier, RW> { | ||
| 1773 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 1774 | } | ||
| 1775 | #[doc = "Pending register (EXTI_PR)"] | ||
| 1776 | pub fn pr(self) -> Reg<regs::Pr, RW> { | ||
| 1777 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 1778 | } | ||
| 1779 | } | ||
| 1780 | pub mod regs { | ||
| 1781 | use crate::generic::*; | ||
| 1782 | #[doc = "Pending register (EXTI_PR)"] | ||
| 1783 | #[repr(transparent)] | ||
| 1784 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1785 | pub struct Pr(pub u32); | ||
| 1786 | impl Pr { | ||
| 1787 | #[doc = "Pending bit 0"] | ||
| 1788 | pub fn pr(&self, n: usize) -> bool { | ||
| 1789 | assert!(n < 23usize); | ||
| 1790 | let offs = 0usize + n * 1usize; | ||
| 1791 | let val = (self.0 >> offs) & 0x01; | ||
| 1792 | val != 0 | ||
| 1793 | } | ||
| 1794 | #[doc = "Pending bit 0"] | ||
| 1795 | pub fn set_pr(&mut self, n: usize, val: bool) { | ||
| 1796 | assert!(n < 23usize); | ||
| 1797 | let offs = 0usize + n * 1usize; | ||
| 1798 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 1799 | } | ||
| 1800 | } | ||
| 1801 | impl Default for Pr { | ||
| 1802 | fn default() -> Pr { | ||
| 1803 | Pr(0) | ||
| 1804 | } | ||
| 1805 | } | ||
| 1806 | #[doc = "Falling Trigger selection register (EXTI_FTSR)"] | ||
| 1807 | #[repr(transparent)] | ||
| 1808 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1809 | pub struct Ftsr(pub u32); | ||
| 1810 | impl Ftsr { | ||
| 1811 | #[doc = "Falling trigger event configuration of line 0"] | ||
| 1812 | pub fn tr(&self, n: usize) -> super::vals::Tr { | ||
| 1813 | assert!(n < 23usize); | ||
| 1814 | let offs = 0usize + n * 1usize; | ||
| 1815 | let val = (self.0 >> offs) & 0x01; | ||
| 1816 | super::vals::Tr(val as u8) | ||
| 1817 | } | ||
| 1818 | #[doc = "Falling trigger event configuration of line 0"] | ||
| 1819 | pub fn set_tr(&mut self, n: usize, val: super::vals::Tr) { | ||
| 1820 | assert!(n < 23usize); | ||
| 1821 | let offs = 0usize + n * 1usize; | ||
| 1822 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 1823 | } | ||
| 1824 | } | ||
| 1825 | impl Default for Ftsr { | ||
| 1826 | fn default() -> Ftsr { | ||
| 1827 | Ftsr(0) | ||
| 1828 | } | ||
| 1829 | } | ||
| 1830 | #[doc = "Rising Trigger selection register (EXTI_RTSR)"] | ||
| 1831 | #[repr(transparent)] | ||
| 1832 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1833 | pub struct Rtsr(pub u32); | ||
| 1834 | impl Rtsr { | ||
| 1835 | #[doc = "Rising trigger event configuration of line 0"] | ||
| 1836 | pub fn tr(&self, n: usize) -> super::vals::Tr { | ||
| 1837 | assert!(n < 23usize); | ||
| 1838 | let offs = 0usize + n * 1usize; | ||
| 1839 | let val = (self.0 >> offs) & 0x01; | ||
| 1840 | super::vals::Tr(val as u8) | ||
| 1841 | } | ||
| 1842 | #[doc = "Rising trigger event configuration of line 0"] | ||
| 1843 | pub fn set_tr(&mut self, n: usize, val: super::vals::Tr) { | ||
| 1844 | assert!(n < 23usize); | ||
| 1845 | let offs = 0usize + n * 1usize; | ||
| 1846 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 1847 | } | ||
| 1848 | } | ||
| 1849 | impl Default for Rtsr { | ||
| 1850 | fn default() -> Rtsr { | ||
| 1851 | Rtsr(0) | ||
| 1852 | } | ||
| 1853 | } | ||
| 1854 | #[doc = "Software interrupt event register (EXTI_SWIER)"] | ||
| 1855 | #[repr(transparent)] | ||
| 1856 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1857 | pub struct Swier(pub u32); | ||
| 1858 | impl Swier { | ||
| 1859 | #[doc = "Software Interrupt on line 0"] | ||
| 1860 | pub fn swier(&self, n: usize) -> bool { | ||
| 1861 | assert!(n < 23usize); | ||
| 1862 | let offs = 0usize + n * 1usize; | ||
| 1863 | let val = (self.0 >> offs) & 0x01; | ||
| 1864 | val != 0 | ||
| 1865 | } | ||
| 1866 | #[doc = "Software Interrupt on line 0"] | ||
| 1867 | pub fn set_swier(&mut self, n: usize, val: bool) { | ||
| 1868 | assert!(n < 23usize); | ||
| 1869 | let offs = 0usize + n * 1usize; | ||
| 1870 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 1871 | } | ||
| 1872 | } | ||
| 1873 | impl Default for Swier { | ||
| 1874 | fn default() -> Swier { | ||
| 1875 | Swier(0) | ||
| 1876 | } | ||
| 1877 | } | ||
| 1878 | #[doc = "Interrupt mask register (EXTI_IMR)"] | ||
| 1879 | #[repr(transparent)] | ||
| 1880 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1881 | pub struct Imr(pub u32); | ||
| 1882 | impl Imr { | ||
| 1883 | #[doc = "Interrupt Mask on line 0"] | ||
| 1884 | pub fn mr(&self, n: usize) -> super::vals::Mr { | ||
| 1885 | assert!(n < 23usize); | ||
| 1886 | let offs = 0usize + n * 1usize; | ||
| 1887 | let val = (self.0 >> offs) & 0x01; | ||
| 1888 | super::vals::Mr(val as u8) | ||
| 1889 | } | ||
| 1890 | #[doc = "Interrupt Mask on line 0"] | ||
| 1891 | pub fn set_mr(&mut self, n: usize, val: super::vals::Mr) { | ||
| 1892 | assert!(n < 23usize); | ||
| 1893 | let offs = 0usize + n * 1usize; | ||
| 1894 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 1895 | } | ||
| 1896 | } | ||
| 1897 | impl Default for Imr { | ||
| 1898 | fn default() -> Imr { | ||
| 1899 | Imr(0) | ||
| 1900 | } | ||
| 1901 | } | ||
| 1902 | #[doc = "Event mask register (EXTI_EMR)"] | ||
| 1903 | #[repr(transparent)] | ||
| 1904 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1905 | pub struct Emr(pub u32); | ||
| 1906 | impl Emr { | ||
| 1907 | #[doc = "Event Mask on line 0"] | ||
| 1908 | pub fn mr(&self, n: usize) -> super::vals::Mr { | ||
| 1909 | assert!(n < 23usize); | ||
| 1910 | let offs = 0usize + n * 1usize; | ||
| 1911 | let val = (self.0 >> offs) & 0x01; | ||
| 1912 | super::vals::Mr(val as u8) | ||
| 1913 | } | ||
| 1914 | #[doc = "Event Mask on line 0"] | ||
| 1915 | pub fn set_mr(&mut self, n: usize, val: super::vals::Mr) { | ||
| 1916 | assert!(n < 23usize); | ||
| 1917 | let offs = 0usize + n * 1usize; | ||
| 1918 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 1919 | } | ||
| 1920 | } | ||
| 1921 | impl Default for Emr { | ||
| 1922 | fn default() -> Emr { | ||
| 1923 | Emr(0) | ||
| 1924 | } | ||
| 1925 | } | ||
| 1926 | } | ||
| 1927 | pub mod vals { | ||
| 1928 | use crate::generic::*; | ||
| 1929 | #[repr(transparent)] | ||
| 1930 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1931 | pub struct Prr(pub u8); | ||
| 1932 | impl Prr { | ||
| 1933 | #[doc = "No trigger request occurred"] | ||
| 1934 | pub const NOTPENDING: Self = Self(0); | ||
| 1935 | #[doc = "Selected trigger request occurred"] | ||
| 1936 | pub const PENDING: Self = Self(0x01); | ||
| 1937 | } | ||
| 1938 | #[repr(transparent)] | ||
| 1939 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1940 | pub struct Mr(pub u8); | ||
| 1941 | impl Mr { | ||
| 1942 | #[doc = "Interrupt request line is masked"] | ||
| 1943 | pub const MASKED: Self = Self(0); | ||
| 1944 | #[doc = "Interrupt request line is unmasked"] | ||
| 1945 | pub const UNMASKED: Self = Self(0x01); | ||
| 1946 | } | ||
| 1947 | #[repr(transparent)] | ||
| 1948 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1949 | pub struct Swierw(pub u8); | ||
| 1950 | impl Swierw { | ||
| 1951 | #[doc = "Generates an interrupt request"] | ||
| 1952 | pub const PEND: Self = Self(0x01); | ||
| 1953 | } | ||
| 1954 | #[repr(transparent)] | ||
| 1955 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1956 | pub struct Prw(pub u8); | ||
| 1957 | impl Prw { | ||
| 1958 | #[doc = "Clears pending bit"] | ||
| 1959 | pub const CLEAR: Self = Self(0x01); | ||
| 1960 | } | ||
| 1961 | #[repr(transparent)] | ||
| 1962 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1963 | pub struct Tr(pub u8); | ||
| 1964 | impl Tr { | ||
| 1965 | #[doc = "Falling edge trigger is disabled"] | ||
| 1966 | pub const DISABLED: Self = Self(0); | ||
| 1967 | #[doc = "Falling edge trigger is enabled"] | ||
| 1968 | pub const ENABLED: Self = Self(0x01); | ||
| 1969 | } | ||
| 1970 | } | ||
| 1971 | } | ||
| 1972 | pub mod dma_v2 { | ||
| 1973 | use crate::generic::*; | ||
| 1974 | #[doc = "Stream cluster: S?CR, S?NDTR, S?M0AR, S?M1AR and S?FCR registers"] | ||
| 1975 | #[derive(Copy, Clone)] | ||
| 1976 | pub struct St(pub *mut u8); | ||
| 1977 | unsafe impl Send for St {} | ||
| 1978 | unsafe impl Sync for St {} | ||
| 1979 | impl St { | ||
| 1980 | #[doc = "stream x configuration register"] | ||
| 1981 | pub fn cr(self) -> Reg<regs::Cr, RW> { | ||
| 1982 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 1983 | } | ||
| 1984 | #[doc = "stream x number of data register"] | ||
| 1985 | pub fn ndtr(self) -> Reg<regs::Ndtr, RW> { | ||
| 1986 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 1987 | } | ||
| 1988 | #[doc = "stream x peripheral address register"] | ||
| 1989 | pub fn par(self) -> Reg<u32, RW> { | ||
| 1990 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 1991 | } | ||
| 1992 | #[doc = "stream x memory 0 address register"] | ||
| 1993 | pub fn m0ar(self) -> Reg<u32, RW> { | ||
| 1994 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 1995 | } | ||
| 1996 | #[doc = "stream x memory 1 address register"] | ||
| 1997 | pub fn m1ar(self) -> Reg<u32, RW> { | ||
| 1998 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 1999 | } | ||
| 2000 | #[doc = "stream x FIFO control register"] | ||
| 2001 | pub fn fcr(self) -> Reg<regs::Fcr, RW> { | ||
| 2002 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 2003 | } | ||
| 2004 | } | ||
| 2005 | #[doc = "DMA controller"] | ||
| 2006 | #[derive(Copy, Clone)] | ||
| 2007 | pub struct Dma(pub *mut u8); | ||
| 2008 | unsafe impl Send for Dma {} | ||
| 2009 | unsafe impl Sync for Dma {} | ||
| 2010 | impl Dma { | ||
| 2011 | #[doc = "low interrupt status register"] | ||
| 2012 | pub fn isr(self, n: usize) -> Reg<regs::Ixr, R> { | ||
| 2013 | assert!(n < 2usize); | ||
| 2014 | unsafe { Reg::from_ptr(self.0.add(0usize + n * 4usize)) } | ||
| 2015 | } | ||
| 2016 | #[doc = "low interrupt flag clear register"] | ||
| 2017 | pub fn ifcr(self, n: usize) -> Reg<regs::Ixr, W> { | ||
| 2018 | assert!(n < 2usize); | ||
| 2019 | unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) } | ||
| 2020 | } | ||
| 2021 | #[doc = "Stream cluster: S?CR, S?NDTR, S?M0AR, S?M1AR and S?FCR registers"] | ||
| 2022 | pub fn st(self, n: usize) -> St { | ||
| 2023 | assert!(n < 8usize); | ||
| 2024 | unsafe { St(self.0.add(16usize + n * 24usize)) } | ||
| 2025 | } | ||
| 2026 | } | ||
| 2027 | pub mod regs { | ||
| 2028 | use crate::generic::*; | ||
| 2029 | #[doc = "stream x configuration register"] | ||
| 2030 | #[repr(transparent)] | ||
| 2031 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2032 | pub struct Cr(pub u32); | ||
| 2033 | impl Cr { | ||
| 2034 | #[doc = "Stream enable / flag stream ready when read low"] | ||
| 2035 | pub const fn en(&self) -> bool { | ||
| 2036 | let val = (self.0 >> 0usize) & 0x01; | ||
| 2037 | val != 0 | ||
| 2038 | } | ||
| 2039 | #[doc = "Stream enable / flag stream ready when read low"] | ||
| 2040 | pub fn set_en(&mut self, val: bool) { | ||
| 2041 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 2042 | } | ||
| 2043 | #[doc = "Direct mode error interrupt enable"] | ||
| 2044 | pub const fn dmeie(&self) -> bool { | ||
| 2045 | let val = (self.0 >> 1usize) & 0x01; | ||
| 2046 | val != 0 | ||
| 2047 | } | ||
| 2048 | #[doc = "Direct mode error interrupt enable"] | ||
| 2049 | pub fn set_dmeie(&mut self, val: bool) { | ||
| 2050 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | ||
| 2051 | } | ||
| 2052 | #[doc = "Transfer error interrupt enable"] | ||
| 2053 | pub const fn teie(&self) -> bool { | ||
| 2054 | let val = (self.0 >> 2usize) & 0x01; | ||
| 2055 | val != 0 | ||
| 2056 | } | ||
| 2057 | #[doc = "Transfer error interrupt enable"] | ||
| 2058 | pub fn set_teie(&mut self, val: bool) { | ||
| 2059 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 2060 | } | ||
| 2061 | #[doc = "Half transfer interrupt enable"] | ||
| 2062 | pub const fn htie(&self) -> bool { | ||
| 2063 | let val = (self.0 >> 3usize) & 0x01; | ||
| 2064 | val != 0 | ||
| 2065 | } | ||
| 2066 | #[doc = "Half transfer interrupt enable"] | ||
| 2067 | pub fn set_htie(&mut self, val: bool) { | ||
| 2068 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | ||
| 2069 | } | ||
| 2070 | #[doc = "Transfer complete interrupt enable"] | ||
| 2071 | pub const fn tcie(&self) -> bool { | ||
| 2072 | let val = (self.0 >> 4usize) & 0x01; | ||
| 2073 | val != 0 | ||
| 2074 | } | ||
| 2075 | #[doc = "Transfer complete interrupt enable"] | ||
| 2076 | pub fn set_tcie(&mut self, val: bool) { | ||
| 2077 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | ||
| 2078 | } | ||
| 2079 | #[doc = "Peripheral flow controller"] | ||
| 2080 | pub const fn pfctrl(&self) -> super::vals::Pfctrl { | ||
| 2081 | let val = (self.0 >> 5usize) & 0x01; | ||
| 2082 | super::vals::Pfctrl(val as u8) | ||
| 2083 | } | ||
| 2084 | #[doc = "Peripheral flow controller"] | ||
| 2085 | pub fn set_pfctrl(&mut self, val: super::vals::Pfctrl) { | ||
| 2086 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 2087 | } | ||
| 2088 | #[doc = "Data transfer direction"] | ||
| 2089 | pub const fn dir(&self) -> super::vals::Dir { | ||
| 2090 | let val = (self.0 >> 6usize) & 0x03; | ||
| 2091 | super::vals::Dir(val as u8) | ||
| 2092 | } | ||
| 2093 | #[doc = "Data transfer direction"] | ||
| 2094 | pub fn set_dir(&mut self, val: super::vals::Dir) { | ||
| 2095 | self.0 = (self.0 & !(0x03 << 6usize)) | (((val.0 as u32) & 0x03) << 6usize); | ||
| 2096 | } | ||
| 2097 | #[doc = "Circular mode"] | ||
| 2098 | pub const fn circ(&self) -> super::vals::Circ { | ||
| 2099 | let val = (self.0 >> 8usize) & 0x01; | ||
| 2100 | super::vals::Circ(val as u8) | ||
| 2101 | } | ||
| 2102 | #[doc = "Circular mode"] | ||
| 2103 | pub fn set_circ(&mut self, val: super::vals::Circ) { | ||
| 2104 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); | ||
| 2105 | } | ||
| 2106 | #[doc = "Peripheral increment mode"] | ||
| 2107 | pub const fn pinc(&self) -> super::vals::Inc { | ||
| 2108 | let val = (self.0 >> 9usize) & 0x01; | ||
| 2109 | super::vals::Inc(val as u8) | ||
| 2110 | } | ||
| 2111 | #[doc = "Peripheral increment mode"] | ||
| 2112 | pub fn set_pinc(&mut self, val: super::vals::Inc) { | ||
| 2113 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | ||
| 2114 | } | ||
| 2115 | #[doc = "Memory increment mode"] | ||
| 2116 | pub const fn minc(&self) -> super::vals::Inc { | ||
| 2117 | let val = (self.0 >> 10usize) & 0x01; | ||
| 2118 | super::vals::Inc(val as u8) | ||
| 2119 | } | ||
| 2120 | #[doc = "Memory increment mode"] | ||
| 2121 | pub fn set_minc(&mut self, val: super::vals::Inc) { | ||
| 2122 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); | ||
| 2123 | } | ||
| 2124 | #[doc = "Peripheral data size"] | ||
| 2125 | pub const fn psize(&self) -> super::vals::Size { | ||
| 2126 | let val = (self.0 >> 11usize) & 0x03; | ||
| 2127 | super::vals::Size(val as u8) | ||
| 2128 | } | ||
| 2129 | #[doc = "Peripheral data size"] | ||
| 2130 | pub fn set_psize(&mut self, val: super::vals::Size) { | ||
| 2131 | self.0 = (self.0 & !(0x03 << 11usize)) | (((val.0 as u32) & 0x03) << 11usize); | ||
| 2132 | } | ||
| 2133 | #[doc = "Memory data size"] | ||
| 2134 | pub const fn msize(&self) -> super::vals::Size { | ||
| 2135 | let val = (self.0 >> 13usize) & 0x03; | ||
| 2136 | super::vals::Size(val as u8) | ||
| 2137 | } | ||
| 2138 | #[doc = "Memory data size"] | ||
| 2139 | pub fn set_msize(&mut self, val: super::vals::Size) { | ||
| 2140 | self.0 = (self.0 & !(0x03 << 13usize)) | (((val.0 as u32) & 0x03) << 13usize); | ||
| 2141 | } | ||
| 2142 | #[doc = "Peripheral increment offset size"] | ||
| 2143 | pub const fn pincos(&self) -> super::vals::Pincos { | ||
| 2144 | let val = (self.0 >> 15usize) & 0x01; | ||
| 2145 | super::vals::Pincos(val as u8) | ||
| 2146 | } | ||
| 2147 | #[doc = "Peripheral increment offset size"] | ||
| 2148 | pub fn set_pincos(&mut self, val: super::vals::Pincos) { | ||
| 2149 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 2150 | } | ||
| 2151 | #[doc = "Priority level"] | ||
| 2152 | pub const fn pl(&self) -> super::vals::Pl { | ||
| 2153 | let val = (self.0 >> 16usize) & 0x03; | ||
| 2154 | super::vals::Pl(val as u8) | ||
| 2155 | } | ||
| 2156 | #[doc = "Priority level"] | ||
| 2157 | pub fn set_pl(&mut self, val: super::vals::Pl) { | ||
| 2158 | self.0 = (self.0 & !(0x03 << 16usize)) | (((val.0 as u32) & 0x03) << 16usize); | ||
| 2159 | } | ||
| 2160 | #[doc = "Double buffer mode"] | ||
| 2161 | pub const fn dbm(&self) -> super::vals::Dbm { | ||
| 2162 | let val = (self.0 >> 18usize) & 0x01; | ||
| 2163 | super::vals::Dbm(val as u8) | ||
| 2164 | } | ||
| 2165 | #[doc = "Double buffer mode"] | ||
| 2166 | pub fn set_dbm(&mut self, val: super::vals::Dbm) { | ||
| 2167 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize); | ||
| 2168 | } | ||
| 2169 | #[doc = "Current target (only in double buffer mode)"] | ||
| 2170 | pub const fn ct(&self) -> super::vals::Ct { | ||
| 2171 | let val = (self.0 >> 19usize) & 0x01; | ||
| 2172 | super::vals::Ct(val as u8) | ||
| 2173 | } | ||
| 2174 | #[doc = "Current target (only in double buffer mode)"] | ||
| 2175 | pub fn set_ct(&mut self, val: super::vals::Ct) { | ||
| 2176 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); | ||
| 2177 | } | ||
| 2178 | #[doc = "Peripheral burst transfer configuration"] | ||
| 2179 | pub const fn pburst(&self) -> super::vals::Burst { | ||
| 2180 | let val = (self.0 >> 21usize) & 0x03; | ||
| 2181 | super::vals::Burst(val as u8) | ||
| 2182 | } | ||
| 2183 | #[doc = "Peripheral burst transfer configuration"] | ||
| 2184 | pub fn set_pburst(&mut self, val: super::vals::Burst) { | ||
| 2185 | self.0 = (self.0 & !(0x03 << 21usize)) | (((val.0 as u32) & 0x03) << 21usize); | ||
| 2186 | } | ||
| 2187 | #[doc = "Memory burst transfer configuration"] | ||
| 2188 | pub const fn mburst(&self) -> super::vals::Burst { | ||
| 2189 | let val = (self.0 >> 23usize) & 0x03; | ||
| 2190 | super::vals::Burst(val as u8) | ||
| 2191 | } | ||
| 2192 | #[doc = "Memory burst transfer configuration"] | ||
| 2193 | pub fn set_mburst(&mut self, val: super::vals::Burst) { | ||
| 2194 | self.0 = (self.0 & !(0x03 << 23usize)) | (((val.0 as u32) & 0x03) << 23usize); | ||
| 2195 | } | ||
| 2196 | #[doc = "Channel selection"] | ||
| 2197 | pub const fn chsel(&self) -> u8 { | ||
| 2198 | let val = (self.0 >> 25usize) & 0x0f; | ||
| 2199 | val as u8 | ||
| 2200 | } | ||
| 2201 | #[doc = "Channel selection"] | ||
| 2202 | pub fn set_chsel(&mut self, val: u8) { | ||
| 2203 | self.0 = (self.0 & !(0x0f << 25usize)) | (((val as u32) & 0x0f) << 25usize); | ||
| 2204 | } | ||
| 2205 | } | ||
| 2206 | impl Default for Cr { | ||
| 2207 | fn default() -> Cr { | ||
| 2208 | Cr(0) | ||
| 2209 | } | ||
| 2210 | } | ||
| 2211 | #[doc = "stream x number of data register"] | ||
| 2212 | #[repr(transparent)] | ||
| 2213 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2214 | pub struct Ndtr(pub u32); | ||
| 2215 | impl Ndtr { | ||
| 2216 | #[doc = "Number of data items to transfer"] | ||
| 2217 | pub const fn ndt(&self) -> u16 { | ||
| 2218 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 606 | val as u16 | 2219 | val as u16 |
| 607 | } | 2220 | } |
| 608 | #[doc = "mantissa of USARTDIV"] | 2221 | #[doc = "Number of data items to transfer"] |
| 609 | pub fn set_div_mantissa(&mut self, val: u16) { | 2222 | pub fn set_ndt(&mut self, val: u16) { |
| 610 | self.0 = (self.0 & !(0x0fff << 4usize)) | (((val as u32) & 0x0fff) << 4usize); | 2223 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); |
| 611 | } | 2224 | } |
| 612 | } | 2225 | } |
| 613 | impl Default for Brr { | 2226 | impl Default for Ndtr { |
| 614 | fn default() -> Brr { | 2227 | fn default() -> Ndtr { |
| 615 | Brr(0) | 2228 | Ndtr(0) |
| 616 | } | 2229 | } |
| 617 | } | 2230 | } |
| 618 | #[doc = "Control register 2"] | 2231 | #[doc = "interrupt register"] |
| 619 | #[repr(transparent)] | 2232 | #[repr(transparent)] |
| 620 | #[derive(Copy, Clone, Eq, PartialEq)] | 2233 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 621 | pub struct Cr2(pub u32); | 2234 | pub struct Ixr(pub u32); |
| 622 | impl Cr2 { | 2235 | impl Ixr { |
| 623 | #[doc = "Address of the USART node"] | 2236 | #[doc = "Stream x FIFO error interrupt flag (x=3..0)"] |
| 624 | pub const fn add(&self) -> u8 { | 2237 | pub fn feif(&self, n: usize) -> bool { |
| 2238 | assert!(n < 4usize); | ||
| 2239 | let offs = 0usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | ||
| 2240 | let val = (self.0 >> offs) & 0x01; | ||
| 2241 | val != 0 | ||
| 2242 | } | ||
| 2243 | #[doc = "Stream x FIFO error interrupt flag (x=3..0)"] | ||
| 2244 | pub fn set_feif(&mut self, n: usize, val: bool) { | ||
| 2245 | assert!(n < 4usize); | ||
| 2246 | let offs = 0usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | ||
| 2247 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 2248 | } | ||
| 2249 | #[doc = "Stream x direct mode error interrupt flag (x=3..0)"] | ||
| 2250 | pub fn dmeif(&self, n: usize) -> bool { | ||
| 2251 | assert!(n < 4usize); | ||
| 2252 | let offs = 2usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | ||
| 2253 | let val = (self.0 >> offs) & 0x01; | ||
| 2254 | val != 0 | ||
| 2255 | } | ||
| 2256 | #[doc = "Stream x direct mode error interrupt flag (x=3..0)"] | ||
| 2257 | pub fn set_dmeif(&mut self, n: usize, val: bool) { | ||
| 2258 | assert!(n < 4usize); | ||
| 2259 | let offs = 2usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | ||
| 2260 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 2261 | } | ||
| 2262 | #[doc = "Stream x transfer error interrupt flag (x=3..0)"] | ||
| 2263 | pub fn teif(&self, n: usize) -> bool { | ||
| 2264 | assert!(n < 4usize); | ||
| 2265 | let offs = 3usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | ||
| 2266 | let val = (self.0 >> offs) & 0x01; | ||
| 2267 | val != 0 | ||
| 2268 | } | ||
| 2269 | #[doc = "Stream x transfer error interrupt flag (x=3..0)"] | ||
| 2270 | pub fn set_teif(&mut self, n: usize, val: bool) { | ||
| 2271 | assert!(n < 4usize); | ||
| 2272 | let offs = 3usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | ||
| 2273 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 2274 | } | ||
| 2275 | #[doc = "Stream x half transfer interrupt flag (x=3..0)"] | ||
| 2276 | pub fn htif(&self, n: usize) -> bool { | ||
| 2277 | assert!(n < 4usize); | ||
| 2278 | let offs = 4usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | ||
| 2279 | let val = (self.0 >> offs) & 0x01; | ||
| 2280 | val != 0 | ||
| 2281 | } | ||
| 2282 | #[doc = "Stream x half transfer interrupt flag (x=3..0)"] | ||
| 2283 | pub fn set_htif(&mut self, n: usize, val: bool) { | ||
| 2284 | assert!(n < 4usize); | ||
| 2285 | let offs = 4usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | ||
| 2286 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 2287 | } | ||
| 2288 | #[doc = "Stream x transfer complete interrupt flag (x = 3..0)"] | ||
| 2289 | pub fn tcif(&self, n: usize) -> bool { | ||
| 2290 | assert!(n < 4usize); | ||
| 2291 | let offs = 5usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | ||
| 2292 | let val = (self.0 >> offs) & 0x01; | ||
| 2293 | val != 0 | ||
| 2294 | } | ||
| 2295 | #[doc = "Stream x transfer complete interrupt flag (x = 3..0)"] | ||
| 2296 | pub fn set_tcif(&mut self, n: usize, val: bool) { | ||
| 2297 | assert!(n < 4usize); | ||
| 2298 | let offs = 5usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | ||
| 2299 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 2300 | } | ||
| 2301 | } | ||
| 2302 | impl Default for Ixr { | ||
| 2303 | fn default() -> Ixr { | ||
| 2304 | Ixr(0) | ||
| 2305 | } | ||
| 2306 | } | ||
| 2307 | #[doc = "stream x FIFO control register"] | ||
| 2308 | #[repr(transparent)] | ||
| 2309 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2310 | pub struct Fcr(pub u32); | ||
| 2311 | impl Fcr { | ||
| 2312 | #[doc = "FIFO threshold selection"] | ||
| 2313 | pub const fn fth(&self) -> super::vals::Fth { | ||
| 2314 | let val = (self.0 >> 0usize) & 0x03; | ||
| 2315 | super::vals::Fth(val as u8) | ||
| 2316 | } | ||
| 2317 | #[doc = "FIFO threshold selection"] | ||
| 2318 | pub fn set_fth(&mut self, val: super::vals::Fth) { | ||
| 2319 | self.0 = (self.0 & !(0x03 << 0usize)) | (((val.0 as u32) & 0x03) << 0usize); | ||
| 2320 | } | ||
| 2321 | #[doc = "Direct mode disable"] | ||
| 2322 | pub const fn dmdis(&self) -> super::vals::Dmdis { | ||
| 2323 | let val = (self.0 >> 2usize) & 0x01; | ||
| 2324 | super::vals::Dmdis(val as u8) | ||
| 2325 | } | ||
| 2326 | #[doc = "Direct mode disable"] | ||
| 2327 | pub fn set_dmdis(&mut self, val: super::vals::Dmdis) { | ||
| 2328 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 2329 | } | ||
| 2330 | #[doc = "FIFO status"] | ||
| 2331 | pub const fn fs(&self) -> super::vals::Fs { | ||
| 2332 | let val = (self.0 >> 3usize) & 0x07; | ||
| 2333 | super::vals::Fs(val as u8) | ||
| 2334 | } | ||
| 2335 | #[doc = "FIFO status"] | ||
| 2336 | pub fn set_fs(&mut self, val: super::vals::Fs) { | ||
| 2337 | self.0 = (self.0 & !(0x07 << 3usize)) | (((val.0 as u32) & 0x07) << 3usize); | ||
| 2338 | } | ||
| 2339 | #[doc = "FIFO error interrupt enable"] | ||
| 2340 | pub const fn feie(&self) -> bool { | ||
| 2341 | let val = (self.0 >> 7usize) & 0x01; | ||
| 2342 | val != 0 | ||
| 2343 | } | ||
| 2344 | #[doc = "FIFO error interrupt enable"] | ||
| 2345 | pub fn set_feie(&mut self, val: bool) { | ||
| 2346 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 2347 | } | ||
| 2348 | } | ||
| 2349 | impl Default for Fcr { | ||
| 2350 | fn default() -> Fcr { | ||
| 2351 | Fcr(0) | ||
| 2352 | } | ||
| 2353 | } | ||
| 2354 | } | ||
| 2355 | pub mod vals { | ||
| 2356 | use crate::generic::*; | ||
| 2357 | #[repr(transparent)] | ||
| 2358 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2359 | pub struct Pincos(pub u8); | ||
| 2360 | impl Pincos { | ||
| 2361 | #[doc = "The offset size for the peripheral address calculation is linked to the PSIZE"] | ||
| 2362 | pub const PSIZE: Self = Self(0); | ||
| 2363 | #[doc = "The offset size for the peripheral address calculation is fixed to 4 (32-bit alignment)"] | ||
| 2364 | pub const FIXED4: Self = Self(0x01); | ||
| 2365 | } | ||
| 2366 | #[repr(transparent)] | ||
| 2367 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2368 | pub struct Dir(pub u8); | ||
| 2369 | impl Dir { | ||
| 2370 | #[doc = "Peripheral-to-memory"] | ||
| 2371 | pub const PERIPHERALTOMEMORY: Self = Self(0); | ||
| 2372 | #[doc = "Memory-to-peripheral"] | ||
| 2373 | pub const MEMORYTOPERIPHERAL: Self = Self(0x01); | ||
| 2374 | #[doc = "Memory-to-memory"] | ||
| 2375 | pub const MEMORYTOMEMORY: Self = Self(0x02); | ||
| 2376 | } | ||
| 2377 | #[repr(transparent)] | ||
| 2378 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2379 | pub struct Dmdis(pub u8); | ||
| 2380 | impl Dmdis { | ||
| 2381 | #[doc = "Direct mode is enabled"] | ||
| 2382 | pub const ENABLED: Self = Self(0); | ||
| 2383 | #[doc = "Direct mode is disabled"] | ||
| 2384 | pub const DISABLED: Self = Self(0x01); | ||
| 2385 | } | ||
| 2386 | #[repr(transparent)] | ||
| 2387 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2388 | pub struct Inc(pub u8); | ||
| 2389 | impl Inc { | ||
| 2390 | #[doc = "Address pointer is fixed"] | ||
| 2391 | pub const FIXED: Self = Self(0); | ||
| 2392 | #[doc = "Address pointer is incremented after each data transfer"] | ||
| 2393 | pub const INCREMENTED: Self = Self(0x01); | ||
| 2394 | } | ||
| 2395 | #[repr(transparent)] | ||
| 2396 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2397 | pub struct Burst(pub u8); | ||
| 2398 | impl Burst { | ||
| 2399 | #[doc = "Single transfer"] | ||
| 2400 | pub const SINGLE: Self = Self(0); | ||
| 2401 | #[doc = "Incremental burst of 4 beats"] | ||
| 2402 | pub const INCR4: Self = Self(0x01); | ||
| 2403 | #[doc = "Incremental burst of 8 beats"] | ||
| 2404 | pub const INCR8: Self = Self(0x02); | ||
| 2405 | #[doc = "Incremental burst of 16 beats"] | ||
| 2406 | pub const INCR16: Self = Self(0x03); | ||
| 2407 | } | ||
| 2408 | #[repr(transparent)] | ||
| 2409 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2410 | pub struct Dbm(pub u8); | ||
| 2411 | impl Dbm { | ||
| 2412 | #[doc = "No buffer switching at the end of transfer"] | ||
| 2413 | pub const DISABLED: Self = Self(0); | ||
| 2414 | #[doc = "Memory target switched at the end of the DMA transfer"] | ||
| 2415 | pub const ENABLED: Self = Self(0x01); | ||
| 2416 | } | ||
| 2417 | #[repr(transparent)] | ||
| 2418 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2419 | pub struct Circ(pub u8); | ||
| 2420 | impl Circ { | ||
| 2421 | #[doc = "Circular mode disabled"] | ||
| 2422 | pub const DISABLED: Self = Self(0); | ||
| 2423 | #[doc = "Circular mode enabled"] | ||
| 2424 | pub const ENABLED: Self = Self(0x01); | ||
| 2425 | } | ||
| 2426 | #[repr(transparent)] | ||
| 2427 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2428 | pub struct Size(pub u8); | ||
| 2429 | impl Size { | ||
| 2430 | #[doc = "Byte (8-bit)"] | ||
| 2431 | pub const BITS8: Self = Self(0); | ||
| 2432 | #[doc = "Half-word (16-bit)"] | ||
| 2433 | pub const BITS16: Self = Self(0x01); | ||
| 2434 | #[doc = "Word (32-bit)"] | ||
| 2435 | pub const BITS32: Self = Self(0x02); | ||
| 2436 | } | ||
| 2437 | #[repr(transparent)] | ||
| 2438 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2439 | pub struct Pl(pub u8); | ||
| 2440 | impl Pl { | ||
| 2441 | #[doc = "Low"] | ||
| 2442 | pub const LOW: Self = Self(0); | ||
| 2443 | #[doc = "Medium"] | ||
| 2444 | pub const MEDIUM: Self = Self(0x01); | ||
| 2445 | #[doc = "High"] | ||
| 2446 | pub const HIGH: Self = Self(0x02); | ||
| 2447 | #[doc = "Very high"] | ||
| 2448 | pub const VERYHIGH: Self = Self(0x03); | ||
| 2449 | } | ||
| 2450 | #[repr(transparent)] | ||
| 2451 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2452 | pub struct Pfctrl(pub u8); | ||
| 2453 | impl Pfctrl { | ||
| 2454 | #[doc = "The DMA is the flow controller"] | ||
| 2455 | pub const DMA: Self = Self(0); | ||
| 2456 | #[doc = "The peripheral is the flow controller"] | ||
| 2457 | pub const PERIPHERAL: Self = Self(0x01); | ||
| 2458 | } | ||
| 2459 | #[repr(transparent)] | ||
| 2460 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2461 | pub struct Ct(pub u8); | ||
| 2462 | impl Ct { | ||
| 2463 | #[doc = "The current target memory is Memory 0"] | ||
| 2464 | pub const MEMORY0: Self = Self(0); | ||
| 2465 | #[doc = "The current target memory is Memory 1"] | ||
| 2466 | pub const MEMORY1: Self = Self(0x01); | ||
| 2467 | } | ||
| 2468 | #[repr(transparent)] | ||
| 2469 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2470 | pub struct Fth(pub u8); | ||
| 2471 | impl Fth { | ||
| 2472 | #[doc = "1/4 full FIFO"] | ||
| 2473 | pub const QUARTER: Self = Self(0); | ||
| 2474 | #[doc = "1/2 full FIFO"] | ||
| 2475 | pub const HALF: Self = Self(0x01); | ||
| 2476 | #[doc = "3/4 full FIFO"] | ||
| 2477 | pub const THREEQUARTERS: Self = Self(0x02); | ||
| 2478 | #[doc = "Full FIFO"] | ||
| 2479 | pub const FULL: Self = Self(0x03); | ||
| 2480 | } | ||
| 2481 | #[repr(transparent)] | ||
| 2482 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 2483 | pub struct Fs(pub u8); | ||
| 2484 | impl Fs { | ||
| 2485 | #[doc = "0 < fifo_level < 1/4"] | ||
| 2486 | pub const QUARTER1: Self = Self(0); | ||
| 2487 | #[doc = "1/4 <= fifo_level < 1/2"] | ||
| 2488 | pub const QUARTER2: Self = Self(0x01); | ||
| 2489 | #[doc = "1/2 <= fifo_level < 3/4"] | ||
| 2490 | pub const QUARTER3: Self = Self(0x02); | ||
| 2491 | #[doc = "3/4 <= fifo_level < full"] | ||
| 2492 | pub const QUARTER4: Self = Self(0x03); | ||
| 2493 | #[doc = "FIFO is empty"] | ||
| 2494 | pub const EMPTY: Self = Self(0x04); | ||
| 2495 | #[doc = "FIFO is full"] | ||
| 2496 | pub const FULL: Self = Self(0x05); | ||
| 2497 | } | ||
| 2498 | } | ||
| 2499 | } | ||
| 2500 | pub mod syscfg_h7 { | ||
| 2501 | use crate::generic::*; | ||
| 2502 | #[doc = "System configuration controller"] | ||
| 2503 | #[derive(Copy, Clone)] | ||
| 2504 | pub struct Syscfg(pub *mut u8); | ||
| 2505 | unsafe impl Send for Syscfg {} | ||
| 2506 | unsafe impl Sync for Syscfg {} | ||
| 2507 | impl Syscfg { | ||
| 2508 | #[doc = "peripheral mode configuration register"] | ||
| 2509 | pub fn pmcr(self) -> Reg<regs::Pmcr, RW> { | ||
| 2510 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 2511 | } | ||
| 2512 | #[doc = "external interrupt configuration register 1"] | ||
| 2513 | pub fn exticr(self, n: usize) -> Reg<regs::Exticr, RW> { | ||
| 2514 | assert!(n < 4usize); | ||
| 2515 | unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) } | ||
| 2516 | } | ||
| 2517 | #[doc = "compensation cell control/status register"] | ||
| 2518 | pub fn cccsr(self) -> Reg<regs::Cccsr, RW> { | ||
| 2519 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | ||
| 2520 | } | ||
| 2521 | #[doc = "SYSCFG compensation cell value register"] | ||
| 2522 | pub fn ccvr(self) -> Reg<regs::Ccvr, R> { | ||
| 2523 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | ||
| 2524 | } | ||
| 2525 | #[doc = "SYSCFG compensation cell code register"] | ||
| 2526 | pub fn cccr(self) -> Reg<regs::Cccr, RW> { | ||
| 2527 | unsafe { Reg::from_ptr(self.0.add(40usize)) } | ||
| 2528 | } | ||
| 2529 | #[doc = "SYSCFG power control register"] | ||
| 2530 | pub fn pwrcr(self) -> Reg<regs::Pwrcr, RW> { | ||
| 2531 | unsafe { Reg::from_ptr(self.0.add(44usize)) } | ||
| 2532 | } | ||
| 2533 | #[doc = "SYSCFG package register"] | ||
| 2534 | pub fn pkgr(self) -> Reg<regs::Pkgr, R> { | ||
| 2535 | unsafe { Reg::from_ptr(self.0.add(292usize)) } | ||
| 2536 | } | ||
| 2537 | #[doc = "SYSCFG user register 0"] | ||
| 2538 | pub fn ur0(self) -> Reg<regs::Ur0, R> { | ||
| 2539 | unsafe { Reg::from_ptr(self.0.add(768usize)) } | ||
| 2540 | } | ||
| 2541 | #[doc = "SYSCFG user register 2"] | ||
| 2542 | pub fn ur2(self) -> Reg<regs::Ur2, RW> { | ||
| 2543 | unsafe { Reg::from_ptr(self.0.add(776usize)) } | ||
| 2544 | } | ||
| 2545 | #[doc = "SYSCFG user register 3"] | ||
| 2546 | pub fn ur3(self) -> Reg<regs::Ur3, RW> { | ||
| 2547 | unsafe { Reg::from_ptr(self.0.add(780usize)) } | ||
| 2548 | } | ||
| 2549 | #[doc = "SYSCFG user register 4"] | ||
| 2550 | pub fn ur4(self) -> Reg<regs::Ur4, R> { | ||
| 2551 | unsafe { Reg::from_ptr(self.0.add(784usize)) } | ||
| 2552 | } | ||
| 2553 | #[doc = "SYSCFG user register 5"] | ||
| 2554 | pub fn ur5(self) -> Reg<regs::Ur5, R> { | ||
| 2555 | unsafe { Reg::from_ptr(self.0.add(788usize)) } | ||
| 2556 | } | ||
| 2557 | #[doc = "SYSCFG user register 6"] | ||
| 2558 | pub fn ur6(self) -> Reg<regs::Ur6, R> { | ||
| 2559 | unsafe { Reg::from_ptr(self.0.add(792usize)) } | ||
| 2560 | } | ||
| 2561 | #[doc = "SYSCFG user register 7"] | ||
| 2562 | pub fn ur7(self) -> Reg<regs::Ur7, R> { | ||
| 2563 | unsafe { Reg::from_ptr(self.0.add(796usize)) } | ||
| 2564 | } | ||
| 2565 | #[doc = "SYSCFG user register 8"] | ||
| 2566 | pub fn ur8(self) -> Reg<regs::Ur8, R> { | ||
| 2567 | unsafe { Reg::from_ptr(self.0.add(800usize)) } | ||
| 2568 | } | ||
| 2569 | #[doc = "SYSCFG user register 9"] | ||
| 2570 | pub fn ur9(self) -> Reg<regs::Ur9, R> { | ||
| 2571 | unsafe { Reg::from_ptr(self.0.add(804usize)) } | ||
| 2572 | } | ||
| 2573 | #[doc = "SYSCFG user register 10"] | ||
| 2574 | pub fn ur10(self) -> Reg<regs::Ur10, R> { | ||
| 2575 | unsafe { Reg::from_ptr(self.0.add(808usize)) } | ||
| 2576 | } | ||
| 2577 | #[doc = "SYSCFG user register 11"] | ||
| 2578 | pub fn ur11(self) -> Reg<regs::Ur11, R> { | ||
| 2579 | unsafe { Reg::from_ptr(self.0.add(812usize)) } | ||
| 2580 | } | ||
| 2581 | #[doc = "SYSCFG user register 12"] | ||
| 2582 | pub fn ur12(self) -> Reg<regs::Ur12, R> { | ||
| 2583 | unsafe { Reg::from_ptr(self.0.add(816usize)) } | ||
| 2584 | } | ||
| 2585 | #[doc = "SYSCFG user register 13"] | ||
| 2586 | pub fn ur13(self) -> Reg<regs::Ur13, R> { | ||
| 2587 | unsafe { Reg::from_ptr(self.0.add(820usize)) } | ||
| 2588 | } | ||
| 2589 | #[doc = "SYSCFG user register 14"] | ||
| 2590 | pub fn ur14(self) -> Reg<regs::Ur14, RW> { | ||
| 2591 | unsafe { Reg::from_ptr(self.0.add(824usize)) } | ||
| 2592 | } | ||
| 2593 | #[doc = "SYSCFG user register 15"] | ||
| 2594 | pub fn ur15(self) -> Reg<regs::Ur15, R> { | ||
| 2595 | unsafe { Reg::from_ptr(self.0.add(828usize)) } | ||
| 2596 | } | ||
| 2597 | #[doc = "SYSCFG user register 16"] | ||
| 2598 | pub fn ur16(self) -> Reg<regs::Ur16, R> { | ||
| 2599 | unsafe { Reg::from_ptr(self.0.add(832usize)) } | ||
| 2600 | } | ||
| 2601 | #[doc = "SYSCFG user register 17"] | ||
| 2602 | pub fn ur17(self) -> Reg<regs::Ur17, R> { | ||
| 2603 | unsafe { Reg::from_ptr(self.0.add(836usize)) } | ||
| 2604 | } | ||
| 2605 | } | ||
| 2606 | pub mod regs { | ||
| 2607 | use crate::generic::*; | ||
| 2608 | #[doc = "SYSCFG compensation cell code register"] | ||
| 2609 | #[repr(transparent)] | ||
| 2610 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2611 | pub struct Cccr(pub u32); | ||
| 2612 | impl Cccr { | ||
| 2613 | #[doc = "NMOS compensation code"] | ||
| 2614 | pub const fn ncc(&self) -> u8 { | ||
| 625 | let val = (self.0 >> 0usize) & 0x0f; | 2615 | let val = (self.0 >> 0usize) & 0x0f; |
| 626 | val as u8 | 2616 | val as u8 |
| 627 | } | 2617 | } |
| 628 | #[doc = "Address of the USART node"] | 2618 | #[doc = "NMOS compensation code"] |
| 629 | pub fn set_add(&mut self, val: u8) { | 2619 | pub fn set_ncc(&mut self, val: u8) { |
| 630 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); | 2620 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); |
| 631 | } | 2621 | } |
| 632 | #[doc = "lin break detection length"] | 2622 | #[doc = "PMOS compensation code"] |
| 633 | pub const fn lbdl(&self) -> super::vals::Lbdl { | 2623 | pub const fn pcc(&self) -> u8 { |
| 2624 | let val = (self.0 >> 4usize) & 0x0f; | ||
| 2625 | val as u8 | ||
| 2626 | } | ||
| 2627 | #[doc = "PMOS compensation code"] | ||
| 2628 | pub fn set_pcc(&mut self, val: u8) { | ||
| 2629 | self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize); | ||
| 2630 | } | ||
| 2631 | } | ||
| 2632 | impl Default for Cccr { | ||
| 2633 | fn default() -> Cccr { | ||
| 2634 | Cccr(0) | ||
| 2635 | } | ||
| 2636 | } | ||
| 2637 | #[doc = "SYSCFG user register 2"] | ||
| 2638 | #[repr(transparent)] | ||
| 2639 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2640 | pub struct Ur2(pub u32); | ||
| 2641 | impl Ur2 { | ||
| 2642 | #[doc = "BOR_LVL Brownout Reset Threshold Level"] | ||
| 2643 | pub const fn borh(&self) -> u8 { | ||
| 2644 | let val = (self.0 >> 0usize) & 0x03; | ||
| 2645 | val as u8 | ||
| 2646 | } | ||
| 2647 | #[doc = "BOR_LVL Brownout Reset Threshold Level"] | ||
| 2648 | pub fn set_borh(&mut self, val: u8) { | ||
| 2649 | self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize); | ||
| 2650 | } | ||
| 2651 | #[doc = "Boot Address 0"] | ||
| 2652 | pub const fn boot_add0(&self) -> u16 { | ||
| 2653 | let val = (self.0 >> 16usize) & 0xffff; | ||
| 2654 | val as u16 | ||
| 2655 | } | ||
| 2656 | #[doc = "Boot Address 0"] | ||
| 2657 | pub fn set_boot_add0(&mut self, val: u16) { | ||
| 2658 | self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize); | ||
| 2659 | } | ||
| 2660 | } | ||
| 2661 | impl Default for Ur2 { | ||
| 2662 | fn default() -> Ur2 { | ||
| 2663 | Ur2(0) | ||
| 2664 | } | ||
| 2665 | } | ||
| 2666 | #[doc = "SYSCFG user register 16"] | ||
| 2667 | #[repr(transparent)] | ||
| 2668 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2669 | pub struct Ur16(pub u32); | ||
| 2670 | impl Ur16 { | ||
| 2671 | #[doc = "Freeze independent watchdog in Stop mode"] | ||
| 2672 | pub const fn fziwdgstp(&self) -> bool { | ||
| 2673 | let val = (self.0 >> 0usize) & 0x01; | ||
| 2674 | val != 0 | ||
| 2675 | } | ||
| 2676 | #[doc = "Freeze independent watchdog in Stop mode"] | ||
| 2677 | pub fn set_fziwdgstp(&mut self, val: bool) { | ||
| 2678 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 2679 | } | ||
| 2680 | #[doc = "Private key programmed"] | ||
| 2681 | pub const fn pkp(&self) -> bool { | ||
| 2682 | let val = (self.0 >> 16usize) & 0x01; | ||
| 2683 | val != 0 | ||
| 2684 | } | ||
| 2685 | #[doc = "Private key programmed"] | ||
| 2686 | pub fn set_pkp(&mut self, val: bool) { | ||
| 2687 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | ||
| 2688 | } | ||
| 2689 | } | ||
| 2690 | impl Default for Ur16 { | ||
| 2691 | fn default() -> Ur16 { | ||
| 2692 | Ur16(0) | ||
| 2693 | } | ||
| 2694 | } | ||
| 2695 | #[doc = "SYSCFG user register 6"] | ||
| 2696 | #[repr(transparent)] | ||
| 2697 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2698 | pub struct Ur6(pub u32); | ||
| 2699 | impl Ur6 { | ||
| 2700 | #[doc = "Protected area start address for bank 1"] | ||
| 2701 | pub const fn pa_beg_1(&self) -> u16 { | ||
| 2702 | let val = (self.0 >> 0usize) & 0x0fff; | ||
| 2703 | val as u16 | ||
| 2704 | } | ||
| 2705 | #[doc = "Protected area start address for bank 1"] | ||
| 2706 | pub fn set_pa_beg_1(&mut self, val: u16) { | ||
| 2707 | self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); | ||
| 2708 | } | ||
| 2709 | #[doc = "Protected area end address for bank 1"] | ||
| 2710 | pub const fn pa_end_1(&self) -> u16 { | ||
| 2711 | let val = (self.0 >> 16usize) & 0x0fff; | ||
| 2712 | val as u16 | ||
| 2713 | } | ||
| 2714 | #[doc = "Protected area end address for bank 1"] | ||
| 2715 | pub fn set_pa_end_1(&mut self, val: u16) { | ||
| 2716 | self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); | ||
| 2717 | } | ||
| 2718 | } | ||
| 2719 | impl Default for Ur6 { | ||
| 2720 | fn default() -> Ur6 { | ||
| 2721 | Ur6(0) | ||
| 2722 | } | ||
| 2723 | } | ||
| 2724 | #[doc = "SYSCFG user register 8"] | ||
| 2725 | #[repr(transparent)] | ||
| 2726 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2727 | pub struct Ur8(pub u32); | ||
| 2728 | impl Ur8 { | ||
| 2729 | #[doc = "Mass erase protected area disabled for bank 2"] | ||
| 2730 | pub const fn mepad_2(&self) -> bool { | ||
| 2731 | let val = (self.0 >> 0usize) & 0x01; | ||
| 2732 | val != 0 | ||
| 2733 | } | ||
| 2734 | #[doc = "Mass erase protected area disabled for bank 2"] | ||
| 2735 | pub fn set_mepad_2(&mut self, val: bool) { | ||
| 2736 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 2737 | } | ||
| 2738 | #[doc = "Mass erase secured area disabled for bank 2"] | ||
| 2739 | pub const fn mesad_2(&self) -> bool { | ||
| 2740 | let val = (self.0 >> 16usize) & 0x01; | ||
| 2741 | val != 0 | ||
| 2742 | } | ||
| 2743 | #[doc = "Mass erase secured area disabled for bank 2"] | ||
| 2744 | pub fn set_mesad_2(&mut self, val: bool) { | ||
| 2745 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | ||
| 2746 | } | ||
| 2747 | } | ||
| 2748 | impl Default for Ur8 { | ||
| 2749 | fn default() -> Ur8 { | ||
| 2750 | Ur8(0) | ||
| 2751 | } | ||
| 2752 | } | ||
| 2753 | #[doc = "peripheral mode configuration register"] | ||
| 2754 | #[repr(transparent)] | ||
| 2755 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2756 | pub struct Pmcr(pub u32); | ||
| 2757 | impl Pmcr { | ||
| 2758 | #[doc = "I2C1 Fm+"] | ||
| 2759 | pub const fn i2c1fmp(&self) -> bool { | ||
| 2760 | let val = (self.0 >> 0usize) & 0x01; | ||
| 2761 | val != 0 | ||
| 2762 | } | ||
| 2763 | #[doc = "I2C1 Fm+"] | ||
| 2764 | pub fn set_i2c1fmp(&mut self, val: bool) { | ||
| 2765 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 2766 | } | ||
| 2767 | #[doc = "I2C2 Fm+"] | ||
| 2768 | pub const fn i2c2fmp(&self) -> bool { | ||
| 2769 | let val = (self.0 >> 1usize) & 0x01; | ||
| 2770 | val != 0 | ||
| 2771 | } | ||
| 2772 | #[doc = "I2C2 Fm+"] | ||
| 2773 | pub fn set_i2c2fmp(&mut self, val: bool) { | ||
| 2774 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | ||
| 2775 | } | ||
| 2776 | #[doc = "I2C3 Fm+"] | ||
| 2777 | pub const fn i2c3fmp(&self) -> bool { | ||
| 2778 | let val = (self.0 >> 2usize) & 0x01; | ||
| 2779 | val != 0 | ||
| 2780 | } | ||
| 2781 | #[doc = "I2C3 Fm+"] | ||
| 2782 | pub fn set_i2c3fmp(&mut self, val: bool) { | ||
| 2783 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 2784 | } | ||
| 2785 | #[doc = "I2C4 Fm+"] | ||
| 2786 | pub const fn i2c4fmp(&self) -> bool { | ||
| 2787 | let val = (self.0 >> 3usize) & 0x01; | ||
| 2788 | val != 0 | ||
| 2789 | } | ||
| 2790 | #[doc = "I2C4 Fm+"] | ||
| 2791 | pub fn set_i2c4fmp(&mut self, val: bool) { | ||
| 2792 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | ||
| 2793 | } | ||
| 2794 | #[doc = "PB(6) Fm+"] | ||
| 2795 | pub const fn pb6fmp(&self) -> bool { | ||
| 2796 | let val = (self.0 >> 4usize) & 0x01; | ||
| 2797 | val != 0 | ||
| 2798 | } | ||
| 2799 | #[doc = "PB(6) Fm+"] | ||
| 2800 | pub fn set_pb6fmp(&mut self, val: bool) { | ||
| 2801 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | ||
| 2802 | } | ||
| 2803 | #[doc = "PB(7) Fast Mode Plus"] | ||
| 2804 | pub const fn pb7fmp(&self) -> bool { | ||
| 634 | let val = (self.0 >> 5usize) & 0x01; | 2805 | let val = (self.0 >> 5usize) & 0x01; |
| 635 | super::vals::Lbdl(val as u8) | 2806 | val != 0 |
| 636 | } | 2807 | } |
| 637 | #[doc = "lin break detection length"] | 2808 | #[doc = "PB(7) Fast Mode Plus"] |
| 638 | pub fn set_lbdl(&mut self, val: super::vals::Lbdl) { | 2809 | pub fn set_pb7fmp(&mut self, val: bool) { |
| 639 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | 2810 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 640 | } | 2811 | } |
| 641 | #[doc = "LIN break detection interrupt enable"] | 2812 | #[doc = "PB(8) Fast Mode Plus"] |
| 642 | pub const fn lbdie(&self) -> bool { | 2813 | pub const fn pb8fmp(&self) -> bool { |
| 643 | let val = (self.0 >> 6usize) & 0x01; | 2814 | let val = (self.0 >> 6usize) & 0x01; |
| 644 | val != 0 | 2815 | val != 0 |
| 645 | } | 2816 | } |
| 646 | #[doc = "LIN break detection interrupt enable"] | 2817 | #[doc = "PB(8) Fast Mode Plus"] |
| 647 | pub fn set_lbdie(&mut self, val: bool) { | 2818 | pub fn set_pb8fmp(&mut self, val: bool) { |
| 648 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 2819 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 649 | } | 2820 | } |
| 650 | #[doc = "STOP bits"] | 2821 | #[doc = "PB(9) Fm+"] |
| 651 | pub const fn stop(&self) -> super::vals::Stop { | 2822 | pub const fn pb9fmp(&self) -> bool { |
| 652 | let val = (self.0 >> 12usize) & 0x03; | 2823 | let val = (self.0 >> 7usize) & 0x01; |
| 653 | super::vals::Stop(val as u8) | 2824 | val != 0 |
| 654 | } | 2825 | } |
| 655 | #[doc = "STOP bits"] | 2826 | #[doc = "PB(9) Fm+"] |
| 656 | pub fn set_stop(&mut self, val: super::vals::Stop) { | 2827 | pub fn set_pb9fmp(&mut self, val: bool) { |
| 657 | self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize); | 2828 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 658 | } | 2829 | } |
| 659 | #[doc = "LIN mode enable"] | 2830 | #[doc = "Booster Enable"] |
| 660 | pub const fn linen(&self) -> bool { | 2831 | pub const fn booste(&self) -> bool { |
| 661 | let val = (self.0 >> 14usize) & 0x01; | 2832 | let val = (self.0 >> 8usize) & 0x01; |
| 662 | val != 0 | 2833 | val != 0 |
| 663 | } | 2834 | } |
| 664 | #[doc = "LIN mode enable"] | 2835 | #[doc = "Booster Enable"] |
| 665 | pub fn set_linen(&mut self, val: bool) { | 2836 | pub fn set_booste(&mut self, val: bool) { |
| 666 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | 2837 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 2838 | } | ||
| 2839 | #[doc = "Analog switch supply voltage selection"] | ||
| 2840 | pub const fn boostvddsel(&self) -> bool { | ||
| 2841 | let val = (self.0 >> 9usize) & 0x01; | ||
| 2842 | val != 0 | ||
| 2843 | } | ||
| 2844 | #[doc = "Analog switch supply voltage selection"] | ||
| 2845 | pub fn set_boostvddsel(&mut self, val: bool) { | ||
| 2846 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | ||
| 2847 | } | ||
| 2848 | #[doc = "Ethernet PHY Interface Selection"] | ||
| 2849 | pub const fn epis(&self) -> u8 { | ||
| 2850 | let val = (self.0 >> 21usize) & 0x07; | ||
| 2851 | val as u8 | ||
| 2852 | } | ||
| 2853 | #[doc = "Ethernet PHY Interface Selection"] | ||
| 2854 | pub fn set_epis(&mut self, val: u8) { | ||
| 2855 | self.0 = (self.0 & !(0x07 << 21usize)) | (((val as u32) & 0x07) << 21usize); | ||
| 2856 | } | ||
| 2857 | #[doc = "PA0 Switch Open"] | ||
| 2858 | pub const fn pa0so(&self) -> bool { | ||
| 2859 | let val = (self.0 >> 24usize) & 0x01; | ||
| 2860 | val != 0 | ||
| 2861 | } | ||
| 2862 | #[doc = "PA0 Switch Open"] | ||
| 2863 | pub fn set_pa0so(&mut self, val: bool) { | ||
| 2864 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize); | ||
| 2865 | } | ||
| 2866 | #[doc = "PA1 Switch Open"] | ||
| 2867 | pub const fn pa1so(&self) -> bool { | ||
| 2868 | let val = (self.0 >> 25usize) & 0x01; | ||
| 2869 | val != 0 | ||
| 2870 | } | ||
| 2871 | #[doc = "PA1 Switch Open"] | ||
| 2872 | pub fn set_pa1so(&mut self, val: bool) { | ||
| 2873 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize); | ||
| 2874 | } | ||
| 2875 | #[doc = "PC2 Switch Open"] | ||
| 2876 | pub const fn pc2so(&self) -> bool { | ||
| 2877 | let val = (self.0 >> 26usize) & 0x01; | ||
| 2878 | val != 0 | ||
| 2879 | } | ||
| 2880 | #[doc = "PC2 Switch Open"] | ||
| 2881 | pub fn set_pc2so(&mut self, val: bool) { | ||
| 2882 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); | ||
| 2883 | } | ||
| 2884 | #[doc = "PC3 Switch Open"] | ||
| 2885 | pub const fn pc3so(&self) -> bool { | ||
| 2886 | let val = (self.0 >> 27usize) & 0x01; | ||
| 2887 | val != 0 | ||
| 2888 | } | ||
| 2889 | #[doc = "PC3 Switch Open"] | ||
| 2890 | pub fn set_pc3so(&mut self, val: bool) { | ||
| 2891 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize); | ||
| 667 | } | 2892 | } |
| 668 | } | 2893 | } |
| 669 | impl Default for Cr2 { | 2894 | impl Default for Pmcr { |
| 670 | fn default() -> Cr2 { | 2895 | fn default() -> Pmcr { |
| 671 | Cr2(0) | 2896 | Pmcr(0) |
| 672 | } | 2897 | } |
| 673 | } | 2898 | } |
| 674 | #[doc = "Control register 3"] | 2899 | #[doc = "SYSCFG user register 9"] |
| 675 | #[repr(transparent)] | 2900 | #[repr(transparent)] |
| 676 | #[derive(Copy, Clone, Eq, PartialEq)] | 2901 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 677 | pub struct Cr3Usart(pub u32); | 2902 | pub struct Ur9(pub u32); |
| 678 | impl Cr3Usart { | 2903 | impl Ur9 { |
| 679 | #[doc = "Error interrupt enable"] | 2904 | #[doc = "Write protection for flash bank 2"] |
| 680 | pub const fn eie(&self) -> bool { | 2905 | pub const fn wrpn_2(&self) -> u8 { |
| 2906 | let val = (self.0 >> 0usize) & 0xff; | ||
| 2907 | val as u8 | ||
| 2908 | } | ||
| 2909 | #[doc = "Write protection for flash bank 2"] | ||
| 2910 | pub fn set_wrpn_2(&mut self, val: u8) { | ||
| 2911 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | ||
| 2912 | } | ||
| 2913 | #[doc = "Protected area start address for bank 2"] | ||
| 2914 | pub const fn pa_beg_2(&self) -> u16 { | ||
| 2915 | let val = (self.0 >> 16usize) & 0x0fff; | ||
| 2916 | val as u16 | ||
| 2917 | } | ||
| 2918 | #[doc = "Protected area start address for bank 2"] | ||
| 2919 | pub fn set_pa_beg_2(&mut self, val: u16) { | ||
| 2920 | self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); | ||
| 2921 | } | ||
| 2922 | } | ||
| 2923 | impl Default for Ur9 { | ||
| 2924 | fn default() -> Ur9 { | ||
| 2925 | Ur9(0) | ||
| 2926 | } | ||
| 2927 | } | ||
| 2928 | #[doc = "SYSCFG user register 5"] | ||
| 2929 | #[repr(transparent)] | ||
| 2930 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2931 | pub struct Ur5(pub u32); | ||
| 2932 | impl Ur5 { | ||
| 2933 | #[doc = "Mass erase secured area disabled for bank 1"] | ||
| 2934 | pub const fn mesad_1(&self) -> bool { | ||
| 681 | let val = (self.0 >> 0usize) & 0x01; | 2935 | let val = (self.0 >> 0usize) & 0x01; |
| 682 | val != 0 | 2936 | val != 0 |
| 683 | } | 2937 | } |
| 684 | #[doc = "Error interrupt enable"] | 2938 | #[doc = "Mass erase secured area disabled for bank 1"] |
| 685 | pub fn set_eie(&mut self, val: bool) { | 2939 | pub fn set_mesad_1(&mut self, val: bool) { |
| 686 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 2940 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 687 | } | 2941 | } |
| 688 | #[doc = "IrDA mode enable"] | 2942 | #[doc = "Write protection for flash bank 1"] |
| 689 | pub const fn iren(&self) -> bool { | 2943 | pub const fn wrpn_1(&self) -> u8 { |
| 2944 | let val = (self.0 >> 16usize) & 0xff; | ||
| 2945 | val as u8 | ||
| 2946 | } | ||
| 2947 | #[doc = "Write protection for flash bank 1"] | ||
| 2948 | pub fn set_wrpn_1(&mut self, val: u8) { | ||
| 2949 | self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize); | ||
| 2950 | } | ||
| 2951 | } | ||
| 2952 | impl Default for Ur5 { | ||
| 2953 | fn default() -> Ur5 { | ||
| 2954 | Ur5(0) | ||
| 2955 | } | ||
| 2956 | } | ||
| 2957 | #[doc = "SYSCFG user register 0"] | ||
| 2958 | #[repr(transparent)] | ||
| 2959 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2960 | pub struct Ur0(pub u32); | ||
| 2961 | impl Ur0 { | ||
| 2962 | #[doc = "Bank Swap"] | ||
| 2963 | pub const fn bks(&self) -> bool { | ||
| 2964 | let val = (self.0 >> 0usize) & 0x01; | ||
| 2965 | val != 0 | ||
| 2966 | } | ||
| 2967 | #[doc = "Bank Swap"] | ||
| 2968 | pub fn set_bks(&mut self, val: bool) { | ||
| 2969 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 2970 | } | ||
| 2971 | #[doc = "Readout protection"] | ||
| 2972 | pub const fn rdp(&self) -> u8 { | ||
| 2973 | let val = (self.0 >> 16usize) & 0xff; | ||
| 2974 | val as u8 | ||
| 2975 | } | ||
| 2976 | #[doc = "Readout protection"] | ||
| 2977 | pub fn set_rdp(&mut self, val: u8) { | ||
| 2978 | self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize); | ||
| 2979 | } | ||
| 2980 | } | ||
| 2981 | impl Default for Ur0 { | ||
| 2982 | fn default() -> Ur0 { | ||
| 2983 | Ur0(0) | ||
| 2984 | } | ||
| 2985 | } | ||
| 2986 | #[doc = "compensation cell control/status register"] | ||
| 2987 | #[repr(transparent)] | ||
| 2988 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2989 | pub struct Cccsr(pub u32); | ||
| 2990 | impl Cccsr { | ||
| 2991 | #[doc = "enable"] | ||
| 2992 | pub const fn en(&self) -> bool { | ||
| 2993 | let val = (self.0 >> 0usize) & 0x01; | ||
| 2994 | val != 0 | ||
| 2995 | } | ||
| 2996 | #[doc = "enable"] | ||
| 2997 | pub fn set_en(&mut self, val: bool) { | ||
| 2998 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 2999 | } | ||
| 3000 | #[doc = "Code selection"] | ||
| 3001 | pub const fn cs(&self) -> bool { | ||
| 690 | let val = (self.0 >> 1usize) & 0x01; | 3002 | let val = (self.0 >> 1usize) & 0x01; |
| 691 | val != 0 | 3003 | val != 0 |
| 692 | } | 3004 | } |
| 693 | #[doc = "IrDA mode enable"] | 3005 | #[doc = "Code selection"] |
| 694 | pub fn set_iren(&mut self, val: bool) { | 3006 | pub fn set_cs(&mut self, val: bool) { |
| 695 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 3007 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 696 | } | 3008 | } |
| 697 | #[doc = "IrDA low-power"] | 3009 | #[doc = "Compensation cell ready flag"] |
| 698 | pub const fn irlp(&self) -> super::vals::Irlp { | 3010 | pub const fn ready(&self) -> bool { |
| 699 | let val = (self.0 >> 2usize) & 0x01; | 3011 | let val = (self.0 >> 8usize) & 0x01; |
| 700 | super::vals::Irlp(val as u8) | 3012 | val != 0 |
| 701 | } | 3013 | } |
| 702 | #[doc = "IrDA low-power"] | 3014 | #[doc = "Compensation cell ready flag"] |
| 703 | pub fn set_irlp(&mut self, val: super::vals::Irlp) { | 3015 | pub fn set_ready(&mut self, val: bool) { |
| 704 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | 3016 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 705 | } | 3017 | } |
| 706 | #[doc = "Half-duplex selection"] | 3018 | #[doc = "High-speed at low-voltage"] |
| 707 | pub const fn hdsel(&self) -> super::vals::Hdsel { | 3019 | pub const fn hslv(&self) -> bool { |
| 708 | let val = (self.0 >> 3usize) & 0x01; | 3020 | let val = (self.0 >> 16usize) & 0x01; |
| 709 | super::vals::Hdsel(val as u8) | 3021 | val != 0 |
| 710 | } | 3022 | } |
| 711 | #[doc = "Half-duplex selection"] | 3023 | #[doc = "High-speed at low-voltage"] |
| 712 | pub fn set_hdsel(&mut self, val: super::vals::Hdsel) { | 3024 | pub fn set_hslv(&mut self, val: bool) { |
| 713 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | 3025 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); |
| 714 | } | 3026 | } |
| 715 | #[doc = "Smartcard NACK enable"] | 3027 | } |
| 716 | pub const fn nack(&self) -> bool { | 3028 | impl Default for Cccsr { |
| 3029 | fn default() -> Cccsr { | ||
| 3030 | Cccsr(0) | ||
| 3031 | } | ||
| 3032 | } | ||
| 3033 | #[doc = "SYSCFG user register 14"] | ||
| 3034 | #[repr(transparent)] | ||
| 3035 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3036 | pub struct Ur14(pub u32); | ||
| 3037 | impl Ur14 { | ||
| 3038 | #[doc = "D1 Stop Reset"] | ||
| 3039 | pub const fn d1stprst(&self) -> bool { | ||
| 3040 | let val = (self.0 >> 0usize) & 0x01; | ||
| 3041 | val != 0 | ||
| 3042 | } | ||
| 3043 | #[doc = "D1 Stop Reset"] | ||
| 3044 | pub fn set_d1stprst(&mut self, val: bool) { | ||
| 3045 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 3046 | } | ||
| 3047 | } | ||
| 3048 | impl Default for Ur14 { | ||
| 3049 | fn default() -> Ur14 { | ||
| 3050 | Ur14(0) | ||
| 3051 | } | ||
| 3052 | } | ||
| 3053 | #[doc = "SYSCFG power control register"] | ||
| 3054 | #[repr(transparent)] | ||
| 3055 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3056 | pub struct Pwrcr(pub u32); | ||
| 3057 | impl Pwrcr { | ||
| 3058 | #[doc = "Overdrive enable"] | ||
| 3059 | pub const fn oden(&self) -> u8 { | ||
| 3060 | let val = (self.0 >> 0usize) & 0x0f; | ||
| 3061 | val as u8 | ||
| 3062 | } | ||
| 3063 | #[doc = "Overdrive enable"] | ||
| 3064 | pub fn set_oden(&mut self, val: u8) { | ||
| 3065 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); | ||
| 3066 | } | ||
| 3067 | } | ||
| 3068 | impl Default for Pwrcr { | ||
| 3069 | fn default() -> Pwrcr { | ||
| 3070 | Pwrcr(0) | ||
| 3071 | } | ||
| 3072 | } | ||
| 3073 | #[doc = "SYSCFG user register 11"] | ||
| 3074 | #[repr(transparent)] | ||
| 3075 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3076 | pub struct Ur11(pub u32); | ||
| 3077 | impl Ur11 { | ||
| 3078 | #[doc = "Secured area end address for bank 2"] | ||
| 3079 | pub const fn sa_end_2(&self) -> u16 { | ||
| 3080 | let val = (self.0 >> 0usize) & 0x0fff; | ||
| 3081 | val as u16 | ||
| 3082 | } | ||
| 3083 | #[doc = "Secured area end address for bank 2"] | ||
| 3084 | pub fn set_sa_end_2(&mut self, val: u16) { | ||
| 3085 | self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); | ||
| 3086 | } | ||
| 3087 | #[doc = "Independent Watchdog 1 mode"] | ||
| 3088 | pub const fn iwdg1m(&self) -> bool { | ||
| 3089 | let val = (self.0 >> 16usize) & 0x01; | ||
| 3090 | val != 0 | ||
| 3091 | } | ||
| 3092 | #[doc = "Independent Watchdog 1 mode"] | ||
| 3093 | pub fn set_iwdg1m(&mut self, val: bool) { | ||
| 3094 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | ||
| 3095 | } | ||
| 3096 | } | ||
| 3097 | impl Default for Ur11 { | ||
| 3098 | fn default() -> Ur11 { | ||
| 3099 | Ur11(0) | ||
| 3100 | } | ||
| 3101 | } | ||
| 3102 | #[doc = "SYSCFG user register 15"] | ||
| 3103 | #[repr(transparent)] | ||
| 3104 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3105 | pub struct Ur15(pub u32); | ||
| 3106 | impl Ur15 { | ||
| 3107 | #[doc = "Freeze independent watchdog in Standby mode"] | ||
| 3108 | pub const fn fziwdgstb(&self) -> bool { | ||
| 3109 | let val = (self.0 >> 16usize) & 0x01; | ||
| 3110 | val != 0 | ||
| 3111 | } | ||
| 3112 | #[doc = "Freeze independent watchdog in Standby mode"] | ||
| 3113 | pub fn set_fziwdgstb(&mut self, val: bool) { | ||
| 3114 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | ||
| 3115 | } | ||
| 3116 | } | ||
| 3117 | impl Default for Ur15 { | ||
| 3118 | fn default() -> Ur15 { | ||
| 3119 | Ur15(0) | ||
| 3120 | } | ||
| 3121 | } | ||
| 3122 | #[doc = "SYSCFG user register 4"] | ||
| 3123 | #[repr(transparent)] | ||
| 3124 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3125 | pub struct Ur4(pub u32); | ||
| 3126 | impl Ur4 { | ||
| 3127 | #[doc = "Mass Erase Protected Area Disabled for bank 1"] | ||
| 3128 | pub const fn mepad_1(&self) -> bool { | ||
| 3129 | let val = (self.0 >> 16usize) & 0x01; | ||
| 3130 | val != 0 | ||
| 3131 | } | ||
| 3132 | #[doc = "Mass Erase Protected Area Disabled for bank 1"] | ||
| 3133 | pub fn set_mepad_1(&mut self, val: bool) { | ||
| 3134 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | ||
| 3135 | } | ||
| 3136 | } | ||
| 3137 | impl Default for Ur4 { | ||
| 3138 | fn default() -> Ur4 { | ||
| 3139 | Ur4(0) | ||
| 3140 | } | ||
| 3141 | } | ||
| 3142 | #[doc = "external interrupt configuration register 2"] | ||
| 3143 | #[repr(transparent)] | ||
| 3144 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3145 | pub struct Exticr(pub u32); | ||
| 3146 | impl Exticr { | ||
| 3147 | #[doc = "EXTI x configuration (x = 4 to 7)"] | ||
| 3148 | pub fn exti(&self, n: usize) -> u8 { | ||
| 3149 | assert!(n < 4usize); | ||
| 3150 | let offs = 0usize + n * 4usize; | ||
| 3151 | let val = (self.0 >> offs) & 0x0f; | ||
| 3152 | val as u8 | ||
| 3153 | } | ||
| 3154 | #[doc = "EXTI x configuration (x = 4 to 7)"] | ||
| 3155 | pub fn set_exti(&mut self, n: usize, val: u8) { | ||
| 3156 | assert!(n < 4usize); | ||
| 3157 | let offs = 0usize + n * 4usize; | ||
| 3158 | self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs); | ||
| 3159 | } | ||
| 3160 | } | ||
| 3161 | impl Default for Exticr { | ||
| 3162 | fn default() -> Exticr { | ||
| 3163 | Exticr(0) | ||
| 3164 | } | ||
| 3165 | } | ||
| 3166 | #[doc = "SYSCFG user register 13"] | ||
| 3167 | #[repr(transparent)] | ||
| 3168 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3169 | pub struct Ur13(pub u32); | ||
| 3170 | impl Ur13 { | ||
| 3171 | #[doc = "Secured DTCM RAM Size"] | ||
| 3172 | pub const fn sdrs(&self) -> u8 { | ||
| 3173 | let val = (self.0 >> 0usize) & 0x03; | ||
| 3174 | val as u8 | ||
| 3175 | } | ||
| 3176 | #[doc = "Secured DTCM RAM Size"] | ||
| 3177 | pub fn set_sdrs(&mut self, val: u8) { | ||
| 3178 | self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize); | ||
| 3179 | } | ||
| 3180 | #[doc = "D1 Standby reset"] | ||
| 3181 | pub const fn d1sbrst(&self) -> bool { | ||
| 3182 | let val = (self.0 >> 16usize) & 0x01; | ||
| 3183 | val != 0 | ||
| 3184 | } | ||
| 3185 | #[doc = "D1 Standby reset"] | ||
| 3186 | pub fn set_d1sbrst(&mut self, val: bool) { | ||
| 3187 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | ||
| 3188 | } | ||
| 3189 | } | ||
| 3190 | impl Default for Ur13 { | ||
| 3191 | fn default() -> Ur13 { | ||
| 3192 | Ur13(0) | ||
| 3193 | } | ||
| 3194 | } | ||
| 3195 | #[doc = "SYSCFG compensation cell value register"] | ||
| 3196 | #[repr(transparent)] | ||
| 3197 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3198 | pub struct Ccvr(pub u32); | ||
| 3199 | impl Ccvr { | ||
| 3200 | #[doc = "NMOS compensation value"] | ||
| 3201 | pub const fn ncv(&self) -> u8 { | ||
| 3202 | let val = (self.0 >> 0usize) & 0x0f; | ||
| 3203 | val as u8 | ||
| 3204 | } | ||
| 3205 | #[doc = "NMOS compensation value"] | ||
| 3206 | pub fn set_ncv(&mut self, val: u8) { | ||
| 3207 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); | ||
| 3208 | } | ||
| 3209 | #[doc = "PMOS compensation value"] | ||
| 3210 | pub const fn pcv(&self) -> u8 { | ||
| 3211 | let val = (self.0 >> 4usize) & 0x0f; | ||
| 3212 | val as u8 | ||
| 3213 | } | ||
| 3214 | #[doc = "PMOS compensation value"] | ||
| 3215 | pub fn set_pcv(&mut self, val: u8) { | ||
| 3216 | self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize); | ||
| 3217 | } | ||
| 3218 | } | ||
| 3219 | impl Default for Ccvr { | ||
| 3220 | fn default() -> Ccvr { | ||
| 3221 | Ccvr(0) | ||
| 3222 | } | ||
| 3223 | } | ||
| 3224 | #[doc = "SYSCFG user register 17"] | ||
| 3225 | #[repr(transparent)] | ||
| 3226 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3227 | pub struct Ur17(pub u32); | ||
| 3228 | impl Ur17 { | ||
| 3229 | #[doc = "I/O high speed / low voltage"] | ||
| 3230 | pub const fn io_hslv(&self) -> bool { | ||
| 3231 | let val = (self.0 >> 0usize) & 0x01; | ||
| 3232 | val != 0 | ||
| 3233 | } | ||
| 3234 | #[doc = "I/O high speed / low voltage"] | ||
| 3235 | pub fn set_io_hslv(&mut self, val: bool) { | ||
| 3236 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 3237 | } | ||
| 3238 | } | ||
| 3239 | impl Default for Ur17 { | ||
| 3240 | fn default() -> Ur17 { | ||
| 3241 | Ur17(0) | ||
| 3242 | } | ||
| 3243 | } | ||
| 3244 | #[doc = "SYSCFG user register 10"] | ||
| 3245 | #[repr(transparent)] | ||
| 3246 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3247 | pub struct Ur10(pub u32); | ||
| 3248 | impl Ur10 { | ||
| 3249 | #[doc = "Protected area end address for bank 2"] | ||
| 3250 | pub const fn pa_end_2(&self) -> u16 { | ||
| 3251 | let val = (self.0 >> 0usize) & 0x0fff; | ||
| 3252 | val as u16 | ||
| 3253 | } | ||
| 3254 | #[doc = "Protected area end address for bank 2"] | ||
| 3255 | pub fn set_pa_end_2(&mut self, val: u16) { | ||
| 3256 | self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); | ||
| 3257 | } | ||
| 3258 | #[doc = "Secured area start address for bank 2"] | ||
| 3259 | pub const fn sa_beg_2(&self) -> u16 { | ||
| 3260 | let val = (self.0 >> 16usize) & 0x0fff; | ||
| 3261 | val as u16 | ||
| 3262 | } | ||
| 3263 | #[doc = "Secured area start address for bank 2"] | ||
| 3264 | pub fn set_sa_beg_2(&mut self, val: u16) { | ||
| 3265 | self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); | ||
| 3266 | } | ||
| 3267 | } | ||
| 3268 | impl Default for Ur10 { | ||
| 3269 | fn default() -> Ur10 { | ||
| 3270 | Ur10(0) | ||
| 3271 | } | ||
| 3272 | } | ||
| 3273 | #[doc = "SYSCFG package register"] | ||
| 3274 | #[repr(transparent)] | ||
| 3275 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3276 | pub struct Pkgr(pub u32); | ||
| 3277 | impl Pkgr { | ||
| 3278 | #[doc = "Package"] | ||
| 3279 | pub const fn pkg(&self) -> u8 { | ||
| 3280 | let val = (self.0 >> 0usize) & 0x0f; | ||
| 3281 | val as u8 | ||
| 3282 | } | ||
| 3283 | #[doc = "Package"] | ||
| 3284 | pub fn set_pkg(&mut self, val: u8) { | ||
| 3285 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); | ||
| 3286 | } | ||
| 3287 | } | ||
| 3288 | impl Default for Pkgr { | ||
| 3289 | fn default() -> Pkgr { | ||
| 3290 | Pkgr(0) | ||
| 3291 | } | ||
| 3292 | } | ||
| 3293 | #[doc = "SYSCFG user register 12"] | ||
| 3294 | #[repr(transparent)] | ||
| 3295 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3296 | pub struct Ur12(pub u32); | ||
| 3297 | impl Ur12 { | ||
| 3298 | #[doc = "Secure mode"] | ||
| 3299 | pub const fn secure(&self) -> bool { | ||
| 3300 | let val = (self.0 >> 16usize) & 0x01; | ||
| 3301 | val != 0 | ||
| 3302 | } | ||
| 3303 | #[doc = "Secure mode"] | ||
| 3304 | pub fn set_secure(&mut self, val: bool) { | ||
| 3305 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | ||
| 3306 | } | ||
| 3307 | } | ||
| 3308 | impl Default for Ur12 { | ||
| 3309 | fn default() -> Ur12 { | ||
| 3310 | Ur12(0) | ||
| 3311 | } | ||
| 3312 | } | ||
| 3313 | #[doc = "SYSCFG user register 3"] | ||
| 3314 | #[repr(transparent)] | ||
| 3315 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3316 | pub struct Ur3(pub u32); | ||
| 3317 | impl Ur3 { | ||
| 3318 | #[doc = "Boot Address 1"] | ||
| 3319 | pub const fn boot_add1(&self) -> u16 { | ||
| 3320 | let val = (self.0 >> 16usize) & 0xffff; | ||
| 3321 | val as u16 | ||
| 3322 | } | ||
| 3323 | #[doc = "Boot Address 1"] | ||
| 3324 | pub fn set_boot_add1(&mut self, val: u16) { | ||
| 3325 | self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize); | ||
| 3326 | } | ||
| 3327 | } | ||
| 3328 | impl Default for Ur3 { | ||
| 3329 | fn default() -> Ur3 { | ||
| 3330 | Ur3(0) | ||
| 3331 | } | ||
| 3332 | } | ||
| 3333 | #[doc = "SYSCFG user register 7"] | ||
| 3334 | #[repr(transparent)] | ||
| 3335 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3336 | pub struct Ur7(pub u32); | ||
| 3337 | impl Ur7 { | ||
| 3338 | #[doc = "Secured area start address for bank 1"] | ||
| 3339 | pub const fn sa_beg_1(&self) -> u16 { | ||
| 3340 | let val = (self.0 >> 0usize) & 0x0fff; | ||
| 3341 | val as u16 | ||
| 3342 | } | ||
| 3343 | #[doc = "Secured area start address for bank 1"] | ||
| 3344 | pub fn set_sa_beg_1(&mut self, val: u16) { | ||
| 3345 | self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); | ||
| 3346 | } | ||
| 3347 | #[doc = "Secured area end address for bank 1"] | ||
| 3348 | pub const fn sa_end_1(&self) -> u16 { | ||
| 3349 | let val = (self.0 >> 16usize) & 0x0fff; | ||
| 3350 | val as u16 | ||
| 3351 | } | ||
| 3352 | #[doc = "Secured area end address for bank 1"] | ||
| 3353 | pub fn set_sa_end_1(&mut self, val: u16) { | ||
| 3354 | self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); | ||
| 3355 | } | ||
| 3356 | } | ||
| 3357 | impl Default for Ur7 { | ||
| 3358 | fn default() -> Ur7 { | ||
| 3359 | Ur7(0) | ||
| 3360 | } | ||
| 3361 | } | ||
| 3362 | } | ||
| 3363 | } | ||
| 3364 | pub mod pwr_h7 { | ||
| 3365 | use crate::generic::*; | ||
| 3366 | #[doc = "PWR"] | ||
| 3367 | #[derive(Copy, Clone)] | ||
| 3368 | pub struct Pwr(pub *mut u8); | ||
| 3369 | unsafe impl Send for Pwr {} | ||
| 3370 | unsafe impl Sync for Pwr {} | ||
| 3371 | impl Pwr { | ||
| 3372 | #[doc = "PWR control register 1"] | ||
| 3373 | pub fn cr1(self) -> Reg<regs::Cr1, RW> { | ||
| 3374 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 3375 | } | ||
| 3376 | #[doc = "PWR control status register 1"] | ||
| 3377 | pub fn csr1(self) -> Reg<regs::Csr1, R> { | ||
| 3378 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 3379 | } | ||
| 3380 | #[doc = "This register is not reset by wakeup from Standby mode, RESET signal and VDD POR. It is only reset by VSW POR and VSWRST reset. This register shall not be accessed when VSWRST bit in RCC_BDCR register resets the VSW domain.After reset, PWR_CR2 register is write-protected. Prior to modifying its content, the DBP bit in PWR_CR1 register must be set to disable the write protection."] | ||
| 3381 | pub fn cr2(self) -> Reg<regs::Cr2, RW> { | ||
| 3382 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 3383 | } | ||
| 3384 | #[doc = "Reset only by POR only, not reset by wakeup from Standby mode and RESET pad. The lower byte of this register is written once after POR and shall be written before changing VOS level or ck_sys clock frequency. No limitation applies to the upper bytes.Programming data corresponding to an invalid combination of SDLEVEL, SDEXTHP, SDEN, LDOEN and BYPASS bits (see Table9) will be ignored: data will not be written, the written-once mechanism will lock the register and any further write access will be ignored. The default supply configuration will be kept and the ACTVOSRDY bit in PWR control status register 1 (PWR_CSR1) will go on indicating invalid voltage levels. The system shall be power cycled before writing a new value."] | ||
| 3385 | pub fn cr3(self) -> Reg<regs::Cr3, RW> { | ||
| 3386 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 3387 | } | ||
| 3388 | #[doc = "This register allows controlling CPU1 power."] | ||
| 3389 | pub fn cpucr(self) -> Reg<regs::Cpucr, RW> { | ||
| 3390 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 3391 | } | ||
| 3392 | #[doc = "This register allows controlling D3 domain power.Following reset VOSRDY will be read 1 by software"] | ||
| 3393 | pub fn d3cr(self) -> Reg<regs::D3cr, RW> { | ||
| 3394 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | ||
| 3395 | } | ||
| 3396 | #[doc = "reset only by system reset, not reset by wakeup from Standby mode5 wait states are required when writing this register (when clearing a WKUPF bit in PWR_WKUPFR, the AHB write access will complete after the WKUPF has been cleared)."] | ||
| 3397 | pub fn wkupcr(self) -> Reg<regs::Wkupcr, RW> { | ||
| 3398 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | ||
| 3399 | } | ||
| 3400 | #[doc = "reset only by system reset, not reset by wakeup from Standby mode"] | ||
| 3401 | pub fn wkupfr(self) -> Reg<regs::Wkupfr, RW> { | ||
| 3402 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | ||
| 3403 | } | ||
| 3404 | #[doc = "Reset only by system reset, not reset by wakeup from Standby mode"] | ||
| 3405 | pub fn wkupepr(self) -> Reg<regs::Wkupepr, RW> { | ||
| 3406 | unsafe { Reg::from_ptr(self.0.add(40usize)) } | ||
| 3407 | } | ||
| 3408 | } | ||
| 3409 | pub mod regs { | ||
| 3410 | use crate::generic::*; | ||
| 3411 | #[doc = "reset only by system reset, not reset by wakeup from Standby mode"] | ||
| 3412 | #[repr(transparent)] | ||
| 3413 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3414 | pub struct Wkupfr(pub u32); | ||
| 3415 | impl Wkupfr { | ||
| 3416 | #[doc = "Wakeup pin WKUPF flag. This bit is set by hardware and cleared only by a Reset pin or by setting the WKUPCn+1 bit in the PWR wakeup clear register (PWR_WKUPCR)."] | ||
| 3417 | pub fn wkupf(&self, n: usize) -> bool { | ||
| 3418 | assert!(n < 6usize); | ||
| 3419 | let offs = 0usize + n * 1usize; | ||
| 3420 | let val = (self.0 >> offs) & 0x01; | ||
| 3421 | val != 0 | ||
| 3422 | } | ||
| 3423 | #[doc = "Wakeup pin WKUPF flag. This bit is set by hardware and cleared only by a Reset pin or by setting the WKUPCn+1 bit in the PWR wakeup clear register (PWR_WKUPCR)."] | ||
| 3424 | pub fn set_wkupf(&mut self, n: usize, val: bool) { | ||
| 3425 | assert!(n < 6usize); | ||
| 3426 | let offs = 0usize + n * 1usize; | ||
| 3427 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 3428 | } | ||
| 3429 | } | ||
| 3430 | impl Default for Wkupfr { | ||
| 3431 | fn default() -> Wkupfr { | ||
| 3432 | Wkupfr(0) | ||
| 3433 | } | ||
| 3434 | } | ||
| 3435 | #[doc = "Reset only by system reset, not reset by wakeup from Standby mode"] | ||
| 3436 | #[repr(transparent)] | ||
| 3437 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3438 | pub struct Wkupepr(pub u32); | ||
| 3439 | impl Wkupepr { | ||
| 3440 | #[doc = "Enable Wakeup Pin WKUPn+1 Each bit is set and cleared by software. Note: An additional wakeup event is detected if WKUPn+1 pin is enabled (by setting the WKUPENn+1 bit) when WKUPn+1 pin level is already high when WKUPPn+1 selects rising edge, or low when WKUPPn+1 selects falling edge."] | ||
| 3441 | pub fn wkupen(&self, n: usize) -> bool { | ||
| 3442 | assert!(n < 6usize); | ||
| 3443 | let offs = 0usize + n * 1usize; | ||
| 3444 | let val = (self.0 >> offs) & 0x01; | ||
| 3445 | val != 0 | ||
| 3446 | } | ||
| 3447 | #[doc = "Enable Wakeup Pin WKUPn+1 Each bit is set and cleared by software. Note: An additional wakeup event is detected if WKUPn+1 pin is enabled (by setting the WKUPENn+1 bit) when WKUPn+1 pin level is already high when WKUPPn+1 selects rising edge, or low when WKUPPn+1 selects falling edge."] | ||
| 3448 | pub fn set_wkupen(&mut self, n: usize, val: bool) { | ||
| 3449 | assert!(n < 6usize); | ||
| 3450 | let offs = 0usize + n * 1usize; | ||
| 3451 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 3452 | } | ||
| 3453 | #[doc = "Wakeup pin polarity bit for WKUPn-7 These bits define the polarity used for event detection on WKUPn-7 external wakeup pin."] | ||
| 3454 | pub fn wkupp(&self, n: usize) -> bool { | ||
| 3455 | assert!(n < 6usize); | ||
| 3456 | let offs = 8usize + n * 1usize; | ||
| 3457 | let val = (self.0 >> offs) & 0x01; | ||
| 3458 | val != 0 | ||
| 3459 | } | ||
| 3460 | #[doc = "Wakeup pin polarity bit for WKUPn-7 These bits define the polarity used for event detection on WKUPn-7 external wakeup pin."] | ||
| 3461 | pub fn set_wkupp(&mut self, n: usize, val: bool) { | ||
| 3462 | assert!(n < 6usize); | ||
| 3463 | let offs = 8usize + n * 1usize; | ||
| 3464 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 3465 | } | ||
| 3466 | #[doc = "Wakeup pin pull configuration"] | ||
| 3467 | pub fn wkuppupd(&self, n: usize) -> u8 { | ||
| 3468 | assert!(n < 6usize); | ||
| 3469 | let offs = 16usize + n * 2usize; | ||
| 3470 | let val = (self.0 >> offs) & 0x03; | ||
| 3471 | val as u8 | ||
| 3472 | } | ||
| 3473 | #[doc = "Wakeup pin pull configuration"] | ||
| 3474 | pub fn set_wkuppupd(&mut self, n: usize, val: u8) { | ||
| 3475 | assert!(n < 6usize); | ||
| 3476 | let offs = 16usize + n * 2usize; | ||
| 3477 | self.0 = (self.0 & !(0x03 << offs)) | (((val as u32) & 0x03) << offs); | ||
| 3478 | } | ||
| 3479 | } | ||
| 3480 | impl Default for Wkupepr { | ||
| 3481 | fn default() -> Wkupepr { | ||
| 3482 | Wkupepr(0) | ||
| 3483 | } | ||
| 3484 | } | ||
| 3485 | #[doc = "PWR control register 1"] | ||
| 3486 | #[repr(transparent)] | ||
| 3487 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3488 | pub struct Cr1(pub u32); | ||
| 3489 | impl Cr1 { | ||
| 3490 | #[doc = "Low-power Deepsleep with SVOS3 (SVOS4 and SVOS5 always use low-power, regardless of the setting of this bit)"] | ||
| 3491 | pub const fn lpds(&self) -> bool { | ||
| 3492 | let val = (self.0 >> 0usize) & 0x01; | ||
| 3493 | val != 0 | ||
| 3494 | } | ||
| 3495 | #[doc = "Low-power Deepsleep with SVOS3 (SVOS4 and SVOS5 always use low-power, regardless of the setting of this bit)"] | ||
| 3496 | pub fn set_lpds(&mut self, val: bool) { | ||
| 3497 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 3498 | } | ||
| 3499 | #[doc = "Programmable voltage detector enable"] | ||
| 3500 | pub const fn pvde(&self) -> bool { | ||
| 717 | let val = (self.0 >> 4usize) & 0x01; | 3501 | let val = (self.0 >> 4usize) & 0x01; |
| 718 | val != 0 | 3502 | val != 0 |
| 719 | } | 3503 | } |
| 720 | #[doc = "Smartcard NACK enable"] | 3504 | #[doc = "Programmable voltage detector enable"] |
| 721 | pub fn set_nack(&mut self, val: bool) { | 3505 | pub fn set_pvde(&mut self, val: bool) { |
| 722 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 3506 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 723 | } | 3507 | } |
| 724 | #[doc = "Smartcard mode enable"] | 3508 | #[doc = "Programmable voltage detector level selection These bits select the voltage threshold detected by the PVD. Note: Refer to Section Electrical characteristics of the product datasheet for more details."] |
| 725 | pub const fn scen(&self) -> bool { | 3509 | pub const fn pls(&self) -> u8 { |
| 3510 | let val = (self.0 >> 5usize) & 0x07; | ||
| 3511 | val as u8 | ||
| 3512 | } | ||
| 3513 | #[doc = "Programmable voltage detector level selection These bits select the voltage threshold detected by the PVD. Note: Refer to Section Electrical characteristics of the product datasheet for more details."] | ||
| 3514 | pub fn set_pls(&mut self, val: u8) { | ||
| 3515 | self.0 = (self.0 & !(0x07 << 5usize)) | (((val as u32) & 0x07) << 5usize); | ||
| 3516 | } | ||
| 3517 | #[doc = "Disable backup domain write protection In reset state, the RCC_BDCR register, the RTC registers (including the backup registers), BREN and MOEN bits in PWR_CR2 register, are protected against parasitic write access. This bit must be set to enable write access to these registers."] | ||
| 3518 | pub const fn dbp(&self) -> bool { | ||
| 3519 | let val = (self.0 >> 8usize) & 0x01; | ||
| 3520 | val != 0 | ||
| 3521 | } | ||
| 3522 | #[doc = "Disable backup domain write protection In reset state, the RCC_BDCR register, the RTC registers (including the backup registers), BREN and MOEN bits in PWR_CR2 register, are protected against parasitic write access. This bit must be set to enable write access to these registers."] | ||
| 3523 | pub fn set_dbp(&mut self, val: bool) { | ||
| 3524 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 3525 | } | ||
| 3526 | #[doc = "Flash low-power mode in DStop mode This bit allows to obtain the best trade-off between low-power consumption and restart time when exiting from DStop mode. When it is set, the Flash memory enters low-power mode when D1 domain is in DStop mode."] | ||
| 3527 | pub const fn flps(&self) -> bool { | ||
| 3528 | let val = (self.0 >> 9usize) & 0x01; | ||
| 3529 | val != 0 | ||
| 3530 | } | ||
| 3531 | #[doc = "Flash low-power mode in DStop mode This bit allows to obtain the best trade-off between low-power consumption and restart time when exiting from DStop mode. When it is set, the Flash memory enters low-power mode when D1 domain is in DStop mode."] | ||
| 3532 | pub fn set_flps(&mut self, val: bool) { | ||
| 3533 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | ||
| 3534 | } | ||
| 3535 | #[doc = "System Stop mode voltage scaling selection These bits control the VCORE voltage level in system Stop mode, to obtain the best trade-off between power consumption and performance."] | ||
| 3536 | pub const fn svos(&self) -> u8 { | ||
| 3537 | let val = (self.0 >> 14usize) & 0x03; | ||
| 3538 | val as u8 | ||
| 3539 | } | ||
| 3540 | #[doc = "System Stop mode voltage scaling selection These bits control the VCORE voltage level in system Stop mode, to obtain the best trade-off between power consumption and performance."] | ||
| 3541 | pub fn set_svos(&mut self, val: u8) { | ||
| 3542 | self.0 = (self.0 & !(0x03 << 14usize)) | (((val as u32) & 0x03) << 14usize); | ||
| 3543 | } | ||
| 3544 | #[doc = "Peripheral voltage monitor on VDDA enable"] | ||
| 3545 | pub const fn avden(&self) -> bool { | ||
| 3546 | let val = (self.0 >> 16usize) & 0x01; | ||
| 3547 | val != 0 | ||
| 3548 | } | ||
| 3549 | #[doc = "Peripheral voltage monitor on VDDA enable"] | ||
| 3550 | pub fn set_avden(&mut self, val: bool) { | ||
| 3551 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | ||
| 3552 | } | ||
| 3553 | #[doc = "Analog voltage detector level selection These bits select the voltage threshold detected by the AVD."] | ||
| 3554 | pub const fn als(&self) -> u8 { | ||
| 3555 | let val = (self.0 >> 17usize) & 0x03; | ||
| 3556 | val as u8 | ||
| 3557 | } | ||
| 3558 | #[doc = "Analog voltage detector level selection These bits select the voltage threshold detected by the AVD."] | ||
| 3559 | pub fn set_als(&mut self, val: u8) { | ||
| 3560 | self.0 = (self.0 & !(0x03 << 17usize)) | (((val as u32) & 0x03) << 17usize); | ||
| 3561 | } | ||
| 3562 | } | ||
| 3563 | impl Default for Cr1 { | ||
| 3564 | fn default() -> Cr1 { | ||
| 3565 | Cr1(0) | ||
| 3566 | } | ||
| 3567 | } | ||
| 3568 | #[doc = "PWR control status register 1"] | ||
| 3569 | #[repr(transparent)] | ||
| 3570 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3571 | pub struct Csr1(pub u32); | ||
| 3572 | impl Csr1 { | ||
| 3573 | #[doc = "Programmable voltage detect output This bit is set and cleared by hardware. It is valid only if the PVD has been enabled by the PVDE bit. Note: since the PVD is disabled in Standby mode, this bit is equal to 0 after Standby or reset until the PVDE bit is set."] | ||
| 3574 | pub const fn pvdo(&self) -> bool { | ||
| 3575 | let val = (self.0 >> 4usize) & 0x01; | ||
| 3576 | val != 0 | ||
| 3577 | } | ||
| 3578 | #[doc = "Programmable voltage detect output This bit is set and cleared by hardware. It is valid only if the PVD has been enabled by the PVDE bit. Note: since the PVD is disabled in Standby mode, this bit is equal to 0 after Standby or reset until the PVDE bit is set."] | ||
| 3579 | pub fn set_pvdo(&mut self, val: bool) { | ||
| 3580 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | ||
| 3581 | } | ||
| 3582 | #[doc = "Voltage levels ready bit for currently used VOS and SDLEVEL This bit is set to 1 by hardware when the voltage regulator and the SD converter are both disabled and Bypass mode is selected in PWR control register 3 (PWR_CR3)."] | ||
| 3583 | pub const fn actvosrdy(&self) -> bool { | ||
| 3584 | let val = (self.0 >> 13usize) & 0x01; | ||
| 3585 | val != 0 | ||
| 3586 | } | ||
| 3587 | #[doc = "Voltage levels ready bit for currently used VOS and SDLEVEL This bit is set to 1 by hardware when the voltage regulator and the SD converter are both disabled and Bypass mode is selected in PWR control register 3 (PWR_CR3)."] | ||
| 3588 | pub fn set_actvosrdy(&mut self, val: bool) { | ||
| 3589 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | ||
| 3590 | } | ||
| 3591 | #[doc = "VOS currently applied for VCORE voltage scaling selection. These bits reflect the last VOS value applied to the PMU."] | ||
| 3592 | pub const fn actvos(&self) -> u8 { | ||
| 3593 | let val = (self.0 >> 14usize) & 0x03; | ||
| 3594 | val as u8 | ||
| 3595 | } | ||
| 3596 | #[doc = "VOS currently applied for VCORE voltage scaling selection. These bits reflect the last VOS value applied to the PMU."] | ||
| 3597 | pub fn set_actvos(&mut self, val: u8) { | ||
| 3598 | self.0 = (self.0 & !(0x03 << 14usize)) | (((val as u32) & 0x03) << 14usize); | ||
| 3599 | } | ||
| 3600 | #[doc = "Analog voltage detector output on VDDA This bit is set and cleared by hardware. It is valid only if AVD on VDDA is enabled by the AVDEN bit. Note: Since the AVD is disabled in Standby mode, this bit is equal to 0 after Standby or reset until the AVDEN bit is set."] | ||
| 3601 | pub const fn avdo(&self) -> bool { | ||
| 3602 | let val = (self.0 >> 16usize) & 0x01; | ||
| 3603 | val != 0 | ||
| 3604 | } | ||
| 3605 | #[doc = "Analog voltage detector output on VDDA This bit is set and cleared by hardware. It is valid only if AVD on VDDA is enabled by the AVDEN bit. Note: Since the AVD is disabled in Standby mode, this bit is equal to 0 after Standby or reset until the AVDEN bit is set."] | ||
| 3606 | pub fn set_avdo(&mut self, val: bool) { | ||
| 3607 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | ||
| 3608 | } | ||
| 3609 | } | ||
| 3610 | impl Default for Csr1 { | ||
| 3611 | fn default() -> Csr1 { | ||
| 3612 | Csr1(0) | ||
| 3613 | } | ||
| 3614 | } | ||
| 3615 | #[doc = "This register allows controlling CPU1 power."] | ||
| 3616 | #[repr(transparent)] | ||
| 3617 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3618 | pub struct Cpucr(pub u32); | ||
| 3619 | impl Cpucr { | ||
| 3620 | #[doc = "D1 domain Power Down Deepsleep selection. This bit allows CPU1 to define the Deepsleep mode for D1 domain."] | ||
| 3621 | pub const fn pdds_d1(&self) -> bool { | ||
| 3622 | let val = (self.0 >> 0usize) & 0x01; | ||
| 3623 | val != 0 | ||
| 3624 | } | ||
| 3625 | #[doc = "D1 domain Power Down Deepsleep selection. This bit allows CPU1 to define the Deepsleep mode for D1 domain."] | ||
| 3626 | pub fn set_pdds_d1(&mut self, val: bool) { | ||
| 3627 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 3628 | } | ||
| 3629 | #[doc = "D2 domain Power Down Deepsleep. This bit allows CPU1 to define the Deepsleep mode for D2 domain."] | ||
| 3630 | pub const fn pdds_d2(&self) -> bool { | ||
| 3631 | let val = (self.0 >> 1usize) & 0x01; | ||
| 3632 | val != 0 | ||
| 3633 | } | ||
| 3634 | #[doc = "D2 domain Power Down Deepsleep. This bit allows CPU1 to define the Deepsleep mode for D2 domain."] | ||
| 3635 | pub fn set_pdds_d2(&mut self, val: bool) { | ||
| 3636 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | ||
| 3637 | } | ||
| 3638 | #[doc = "System D3 domain Power Down Deepsleep. This bit allows CPU1 to define the Deepsleep mode for System D3 domain."] | ||
| 3639 | pub const fn pdds_d3(&self) -> bool { | ||
| 3640 | let val = (self.0 >> 2usize) & 0x01; | ||
| 3641 | val != 0 | ||
| 3642 | } | ||
| 3643 | #[doc = "System D3 domain Power Down Deepsleep. This bit allows CPU1 to define the Deepsleep mode for System D3 domain."] | ||
| 3644 | pub fn set_pdds_d3(&mut self, val: bool) { | ||
| 3645 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 3646 | } | ||
| 3647 | #[doc = "STOP flag This bit is set by hardware and cleared only by any reset or by setting the CPU1 CSSF bit."] | ||
| 3648 | pub const fn stopf(&self) -> bool { | ||
| 726 | let val = (self.0 >> 5usize) & 0x01; | 3649 | let val = (self.0 >> 5usize) & 0x01; |
| 727 | val != 0 | 3650 | val != 0 |
| 728 | } | 3651 | } |
| 729 | #[doc = "Smartcard mode enable"] | 3652 | #[doc = "STOP flag This bit is set by hardware and cleared only by any reset or by setting the CPU1 CSSF bit."] |
| 730 | pub fn set_scen(&mut self, val: bool) { | 3653 | pub fn set_stopf(&mut self, val: bool) { |
| 731 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 3654 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 732 | } | 3655 | } |
| 733 | #[doc = "DMA enable receiver"] | 3656 | #[doc = "System Standby flag This bit is set by hardware and cleared only by a POR (Power-on Reset) or by setting the CPU1 CSSF bit"] |
| 734 | pub const fn dmar(&self) -> bool { | 3657 | pub const fn sbf(&self) -> bool { |
| 735 | let val = (self.0 >> 6usize) & 0x01; | 3658 | let val = (self.0 >> 6usize) & 0x01; |
| 736 | val != 0 | 3659 | val != 0 |
| 737 | } | 3660 | } |
| 738 | #[doc = "DMA enable receiver"] | 3661 | #[doc = "System Standby flag This bit is set by hardware and cleared only by a POR (Power-on Reset) or by setting the CPU1 CSSF bit"] |
| 739 | pub fn set_dmar(&mut self, val: bool) { | 3662 | pub fn set_sbf(&mut self, val: bool) { |
| 740 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 3663 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 741 | } | 3664 | } |
| 742 | #[doc = "DMA enable transmitter"] | 3665 | #[doc = "D1 domain DStandby flag This bit is set by hardware and cleared by any system reset or by setting the CPU1 CSSF bit. Once set, this bit can be cleared only when the D1 domain is no longer in DStandby mode."] |
| 743 | pub const fn dmat(&self) -> bool { | 3666 | pub const fn sbf_d1(&self) -> bool { |
| 744 | let val = (self.0 >> 7usize) & 0x01; | 3667 | let val = (self.0 >> 7usize) & 0x01; |
| 745 | val != 0 | 3668 | val != 0 |
| 746 | } | 3669 | } |
| 747 | #[doc = "DMA enable transmitter"] | 3670 | #[doc = "D1 domain DStandby flag This bit is set by hardware and cleared by any system reset or by setting the CPU1 CSSF bit. Once set, this bit can be cleared only when the D1 domain is no longer in DStandby mode."] |
| 748 | pub fn set_dmat(&mut self, val: bool) { | 3671 | pub fn set_sbf_d1(&mut self, val: bool) { |
| 749 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 3672 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 750 | } | 3673 | } |
| 751 | #[doc = "RTS enable"] | 3674 | #[doc = "D2 domain DStandby flag This bit is set by hardware and cleared by any system reset or by setting the CPU1 CSSF bit. Once set, this bit can be cleared only when the D2 domain is no longer in DStandby mode."] |
| 752 | pub const fn rtse(&self) -> bool { | 3675 | pub const fn sbf_d2(&self) -> bool { |
| 753 | let val = (self.0 >> 8usize) & 0x01; | 3676 | let val = (self.0 >> 8usize) & 0x01; |
| 754 | val != 0 | 3677 | val != 0 |
| 755 | } | 3678 | } |
| 756 | #[doc = "RTS enable"] | 3679 | #[doc = "D2 domain DStandby flag This bit is set by hardware and cleared by any system reset or by setting the CPU1 CSSF bit. Once set, this bit can be cleared only when the D2 domain is no longer in DStandby mode."] |
| 757 | pub fn set_rtse(&mut self, val: bool) { | 3680 | pub fn set_sbf_d2(&mut self, val: bool) { |
| 758 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 3681 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 759 | } | 3682 | } |
| 760 | #[doc = "CTS enable"] | 3683 | #[doc = "Clear D1 domain CPU1 Standby, Stop and HOLD flags (always read as 0) This bit is cleared to 0 by hardware."] |
| 761 | pub const fn ctse(&self) -> bool { | 3684 | pub const fn cssf(&self) -> bool { |
| 762 | let val = (self.0 >> 9usize) & 0x01; | 3685 | let val = (self.0 >> 9usize) & 0x01; |
| 763 | val != 0 | 3686 | val != 0 |
| 764 | } | 3687 | } |
| 765 | #[doc = "CTS enable"] | 3688 | #[doc = "Clear D1 domain CPU1 Standby, Stop and HOLD flags (always read as 0) This bit is cleared to 0 by hardware."] |
| 766 | pub fn set_ctse(&mut self, val: bool) { | 3689 | pub fn set_cssf(&mut self, val: bool) { |
| 767 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | 3690 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); |
| 768 | } | 3691 | } |
| 769 | #[doc = "CTS interrupt enable"] | 3692 | #[doc = "Keep system D3 domain in Run mode regardless of the CPU sub-systems modes"] |
| 770 | pub const fn ctsie(&self) -> bool { | 3693 | pub const fn run_d3(&self) -> bool { |
| 3694 | let val = (self.0 >> 11usize) & 0x01; | ||
| 3695 | val != 0 | ||
| 3696 | } | ||
| 3697 | #[doc = "Keep system D3 domain in Run mode regardless of the CPU sub-systems modes"] | ||
| 3698 | pub fn set_run_d3(&mut self, val: bool) { | ||
| 3699 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); | ||
| 3700 | } | ||
| 3701 | } | ||
| 3702 | impl Default for Cpucr { | ||
| 3703 | fn default() -> Cpucr { | ||
| 3704 | Cpucr(0) | ||
| 3705 | } | ||
| 3706 | } | ||
| 3707 | #[doc = "This register allows controlling D3 domain power.Following reset VOSRDY will be read 1 by software"] | ||
| 3708 | #[repr(transparent)] | ||
| 3709 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3710 | pub struct D3cr(pub u32); | ||
| 3711 | impl D3cr { | ||
| 3712 | #[doc = "VOS Ready bit for VCORE voltage scaling output selection. This bit is set to 1 by hardware when Bypass mode is selected in PWR control register 3 (PWR_CR3)."] | ||
| 3713 | pub const fn vosrdy(&self) -> bool { | ||
| 3714 | let val = (self.0 >> 13usize) & 0x01; | ||
| 3715 | val != 0 | ||
| 3716 | } | ||
| 3717 | #[doc = "VOS Ready bit for VCORE voltage scaling output selection. This bit is set to 1 by hardware when Bypass mode is selected in PWR control register 3 (PWR_CR3)."] | ||
| 3718 | pub fn set_vosrdy(&mut self, val: bool) { | ||
| 3719 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | ||
| 3720 | } | ||
| 3721 | #[doc = "Voltage scaling selection according to performance These bits control the VCORE voltage level and allow to obtains the best trade-off between power consumption and performance: When increasing the performance, the voltage scaling shall be changed before increasing the system frequency. When decreasing performance, the system frequency shall first be decreased before changing the voltage scaling."] | ||
| 3722 | pub const fn vos(&self) -> u8 { | ||
| 3723 | let val = (self.0 >> 14usize) & 0x03; | ||
| 3724 | val as u8 | ||
| 3725 | } | ||
| 3726 | #[doc = "Voltage scaling selection according to performance These bits control the VCORE voltage level and allow to obtains the best trade-off between power consumption and performance: When increasing the performance, the voltage scaling shall be changed before increasing the system frequency. When decreasing performance, the system frequency shall first be decreased before changing the voltage scaling."] | ||
| 3727 | pub fn set_vos(&mut self, val: u8) { | ||
| 3728 | self.0 = (self.0 & !(0x03 << 14usize)) | (((val as u32) & 0x03) << 14usize); | ||
| 3729 | } | ||
| 3730 | } | ||
| 3731 | impl Default for D3cr { | ||
| 3732 | fn default() -> D3cr { | ||
| 3733 | D3cr(0) | ||
| 3734 | } | ||
| 3735 | } | ||
| 3736 | #[doc = "reset only by system reset, not reset by wakeup from Standby mode5 wait states are required when writing this register (when clearing a WKUPF bit in PWR_WKUPFR, the AHB write access will complete after the WKUPF has been cleared)."] | ||
| 3737 | #[repr(transparent)] | ||
| 3738 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3739 | pub struct Wkupcr(pub u32); | ||
| 3740 | impl Wkupcr { | ||
| 3741 | #[doc = "Clear Wakeup pin flag for WKUP. These bits are always read as 0."] | ||
| 3742 | pub const fn wkupc(&self) -> u8 { | ||
| 3743 | let val = (self.0 >> 0usize) & 0x3f; | ||
| 3744 | val as u8 | ||
| 3745 | } | ||
| 3746 | #[doc = "Clear Wakeup pin flag for WKUP. These bits are always read as 0."] | ||
| 3747 | pub fn set_wkupc(&mut self, val: u8) { | ||
| 3748 | self.0 = (self.0 & !(0x3f << 0usize)) | (((val as u32) & 0x3f) << 0usize); | ||
| 3749 | } | ||
| 3750 | } | ||
| 3751 | impl Default for Wkupcr { | ||
| 3752 | fn default() -> Wkupcr { | ||
| 3753 | Wkupcr(0) | ||
| 3754 | } | ||
| 3755 | } | ||
| 3756 | #[doc = "Reset only by POR only, not reset by wakeup from Standby mode and RESET pad. The lower byte of this register is written once after POR and shall be written before changing VOS level or ck_sys clock frequency. No limitation applies to the upper bytes.Programming data corresponding to an invalid combination of SDLEVEL, SDEXTHP, SDEN, LDOEN and BYPASS bits (see Table9) will be ignored: data will not be written, the written-once mechanism will lock the register and any further write access will be ignored. The default supply configuration will be kept and the ACTVOSRDY bit in PWR control status register 1 (PWR_CSR1) will go on indicating invalid voltage levels. The system shall be power cycled before writing a new value."] | ||
| 3757 | #[repr(transparent)] | ||
| 3758 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3759 | pub struct Cr3(pub u32); | ||
| 3760 | impl Cr3 { | ||
| 3761 | #[doc = "Power management unit bypass"] | ||
| 3762 | pub const fn bypass(&self) -> bool { | ||
| 3763 | let val = (self.0 >> 0usize) & 0x01; | ||
| 3764 | val != 0 | ||
| 3765 | } | ||
| 3766 | #[doc = "Power management unit bypass"] | ||
| 3767 | pub fn set_bypass(&mut self, val: bool) { | ||
| 3768 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 3769 | } | ||
| 3770 | #[doc = "Low drop-out regulator enable"] | ||
| 3771 | pub const fn ldoen(&self) -> bool { | ||
| 3772 | let val = (self.0 >> 1usize) & 0x01; | ||
| 3773 | val != 0 | ||
| 3774 | } | ||
| 3775 | #[doc = "Low drop-out regulator enable"] | ||
| 3776 | pub fn set_ldoen(&mut self, val: bool) { | ||
| 3777 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | ||
| 3778 | } | ||
| 3779 | #[doc = "SD converter Enable"] | ||
| 3780 | pub const fn scuen(&self) -> bool { | ||
| 3781 | let val = (self.0 >> 2usize) & 0x01; | ||
| 3782 | val != 0 | ||
| 3783 | } | ||
| 3784 | #[doc = "SD converter Enable"] | ||
| 3785 | pub fn set_scuen(&mut self, val: bool) { | ||
| 3786 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 3787 | } | ||
| 3788 | #[doc = "VBAT charging enable"] | ||
| 3789 | pub const fn vbe(&self) -> bool { | ||
| 3790 | let val = (self.0 >> 8usize) & 0x01; | ||
| 3791 | val != 0 | ||
| 3792 | } | ||
| 3793 | #[doc = "VBAT charging enable"] | ||
| 3794 | pub fn set_vbe(&mut self, val: bool) { | ||
| 3795 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 3796 | } | ||
| 3797 | #[doc = "VBAT charging resistor selection"] | ||
| 3798 | pub const fn vbrs(&self) -> bool { | ||
| 3799 | let val = (self.0 >> 9usize) & 0x01; | ||
| 3800 | val != 0 | ||
| 3801 | } | ||
| 3802 | #[doc = "VBAT charging resistor selection"] | ||
| 3803 | pub fn set_vbrs(&mut self, val: bool) { | ||
| 3804 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | ||
| 3805 | } | ||
| 3806 | #[doc = "VDD33USB voltage level detector enable."] | ||
| 3807 | pub const fn usb33den(&self) -> bool { | ||
| 3808 | let val = (self.0 >> 24usize) & 0x01; | ||
| 3809 | val != 0 | ||
| 3810 | } | ||
| 3811 | #[doc = "VDD33USB voltage level detector enable."] | ||
| 3812 | pub fn set_usb33den(&mut self, val: bool) { | ||
| 3813 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize); | ||
| 3814 | } | ||
| 3815 | #[doc = "USB regulator enable."] | ||
| 3816 | pub const fn usbregen(&self) -> bool { | ||
| 3817 | let val = (self.0 >> 25usize) & 0x01; | ||
| 3818 | val != 0 | ||
| 3819 | } | ||
| 3820 | #[doc = "USB regulator enable."] | ||
| 3821 | pub fn set_usbregen(&mut self, val: bool) { | ||
| 3822 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize); | ||
| 3823 | } | ||
| 3824 | #[doc = "USB supply ready."] | ||
| 3825 | pub const fn usb33rdy(&self) -> bool { | ||
| 3826 | let val = (self.0 >> 26usize) & 0x01; | ||
| 3827 | val != 0 | ||
| 3828 | } | ||
| 3829 | #[doc = "USB supply ready."] | ||
| 3830 | pub fn set_usb33rdy(&mut self, val: bool) { | ||
| 3831 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); | ||
| 3832 | } | ||
| 3833 | } | ||
| 3834 | impl Default for Cr3 { | ||
| 3835 | fn default() -> Cr3 { | ||
| 3836 | Cr3(0) | ||
| 3837 | } | ||
| 3838 | } | ||
| 3839 | #[doc = "This register is not reset by wakeup from Standby mode, RESET signal and VDD POR. It is only reset by VSW POR and VSWRST reset. This register shall not be accessed when VSWRST bit in RCC_BDCR register resets the VSW domain.After reset, PWR_CR2 register is write-protected. Prior to modifying its content, the DBP bit in PWR_CR1 register must be set to disable the write protection."] | ||
| 3840 | #[repr(transparent)] | ||
| 3841 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3842 | pub struct Cr2(pub u32); | ||
| 3843 | impl Cr2 { | ||
| 3844 | #[doc = "Backup regulator enable When set, the Backup regulator (used to maintain the backup RAM content in Standby and VBAT modes) is enabled. If BREN is reset, the backup regulator is switched off. The backup RAM can still be used in Run and Stop modes. However, its content will be lost in Standby and VBAT modes. If BREN is set, the application must wait till the Backup Regulator Ready flag (BRRDY) is set to indicate that the data written into the SRAM will be maintained in Standby and VBAT modes."] | ||
| 3845 | pub const fn bren(&self) -> bool { | ||
| 3846 | let val = (self.0 >> 0usize) & 0x01; | ||
| 3847 | val != 0 | ||
| 3848 | } | ||
| 3849 | #[doc = "Backup regulator enable When set, the Backup regulator (used to maintain the backup RAM content in Standby and VBAT modes) is enabled. If BREN is reset, the backup regulator is switched off. The backup RAM can still be used in Run and Stop modes. However, its content will be lost in Standby and VBAT modes. If BREN is set, the application must wait till the Backup Regulator Ready flag (BRRDY) is set to indicate that the data written into the SRAM will be maintained in Standby and VBAT modes."] | ||
| 3850 | pub fn set_bren(&mut self, val: bool) { | ||
| 3851 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 3852 | } | ||
| 3853 | #[doc = "VBAT and temperature monitoring enable When set, the VBAT supply and temperature monitoring is enabled."] | ||
| 3854 | pub const fn monen(&self) -> bool { | ||
| 3855 | let val = (self.0 >> 4usize) & 0x01; | ||
| 3856 | val != 0 | ||
| 3857 | } | ||
| 3858 | #[doc = "VBAT and temperature monitoring enable When set, the VBAT supply and temperature monitoring is enabled."] | ||
| 3859 | pub fn set_monen(&mut self, val: bool) { | ||
| 3860 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | ||
| 3861 | } | ||
| 3862 | #[doc = "Backup regulator ready This bit is set by hardware to indicate that the Backup regulator is ready."] | ||
| 3863 | pub const fn brrdy(&self) -> bool { | ||
| 3864 | let val = (self.0 >> 16usize) & 0x01; | ||
| 3865 | val != 0 | ||
| 3866 | } | ||
| 3867 | #[doc = "Backup regulator ready This bit is set by hardware to indicate that the Backup regulator is ready."] | ||
| 3868 | pub fn set_brrdy(&mut self, val: bool) { | ||
| 3869 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | ||
| 3870 | } | ||
| 3871 | #[doc = "VBAT level monitoring versus low threshold"] | ||
| 3872 | pub const fn vbatl(&self) -> bool { | ||
| 3873 | let val = (self.0 >> 20usize) & 0x01; | ||
| 3874 | val != 0 | ||
| 3875 | } | ||
| 3876 | #[doc = "VBAT level monitoring versus low threshold"] | ||
| 3877 | pub fn set_vbatl(&mut self, val: bool) { | ||
| 3878 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); | ||
| 3879 | } | ||
| 3880 | #[doc = "VBAT level monitoring versus high threshold"] | ||
| 3881 | pub const fn vbath(&self) -> bool { | ||
| 3882 | let val = (self.0 >> 21usize) & 0x01; | ||
| 3883 | val != 0 | ||
| 3884 | } | ||
| 3885 | #[doc = "VBAT level monitoring versus high threshold"] | ||
| 3886 | pub fn set_vbath(&mut self, val: bool) { | ||
| 3887 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); | ||
| 3888 | } | ||
| 3889 | #[doc = "Temperature level monitoring versus low threshold"] | ||
| 3890 | pub const fn templ(&self) -> bool { | ||
| 3891 | let val = (self.0 >> 22usize) & 0x01; | ||
| 3892 | val != 0 | ||
| 3893 | } | ||
| 3894 | #[doc = "Temperature level monitoring versus low threshold"] | ||
| 3895 | pub fn set_templ(&mut self, val: bool) { | ||
| 3896 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); | ||
| 3897 | } | ||
| 3898 | #[doc = "Temperature level monitoring versus high threshold"] | ||
| 3899 | pub const fn temph(&self) -> bool { | ||
| 3900 | let val = (self.0 >> 23usize) & 0x01; | ||
| 3901 | val != 0 | ||
| 3902 | } | ||
| 3903 | #[doc = "Temperature level monitoring versus high threshold"] | ||
| 3904 | pub fn set_temph(&mut self, val: bool) { | ||
| 3905 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); | ||
| 3906 | } | ||
| 3907 | } | ||
| 3908 | impl Default for Cr2 { | ||
| 3909 | fn default() -> Cr2 { | ||
| 3910 | Cr2(0) | ||
| 3911 | } | ||
| 3912 | } | ||
| 3913 | } | ||
| 3914 | } | ||
| 3915 | pub mod spi_v2 { | ||
| 3916 | use crate::generic::*; | ||
| 3917 | #[doc = "Serial peripheral interface"] | ||
| 3918 | #[derive(Copy, Clone)] | ||
| 3919 | pub struct Spi(pub *mut u8); | ||
| 3920 | unsafe impl Send for Spi {} | ||
| 3921 | unsafe impl Sync for Spi {} | ||
| 3922 | impl Spi { | ||
| 3923 | #[doc = "control register 1"] | ||
| 3924 | pub fn cr1(self) -> Reg<regs::Cr1, RW> { | ||
| 3925 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 3926 | } | ||
| 3927 | #[doc = "control register 2"] | ||
| 3928 | pub fn cr2(self) -> Reg<regs::Cr2, RW> { | ||
| 3929 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 3930 | } | ||
| 3931 | #[doc = "status register"] | ||
| 3932 | pub fn sr(self) -> Reg<regs::Sr, RW> { | ||
| 3933 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 3934 | } | ||
| 3935 | #[doc = "data register"] | ||
| 3936 | pub fn dr(self) -> Reg<regs::Dr, RW> { | ||
| 3937 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 3938 | } | ||
| 3939 | #[doc = "CRC polynomial register"] | ||
| 3940 | pub fn crcpr(self) -> Reg<regs::Crcpr, RW> { | ||
| 3941 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 3942 | } | ||
| 3943 | #[doc = "RX CRC register"] | ||
| 3944 | pub fn rxcrcr(self) -> Reg<regs::Rxcrcr, R> { | ||
| 3945 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 3946 | } | ||
| 3947 | #[doc = "TX CRC register"] | ||
| 3948 | pub fn txcrcr(self) -> Reg<regs::Txcrcr, R> { | ||
| 3949 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | ||
| 3950 | } | ||
| 3951 | } | ||
| 3952 | pub mod regs { | ||
| 3953 | use crate::generic::*; | ||
| 3954 | #[doc = "control register 1"] | ||
| 3955 | #[repr(transparent)] | ||
| 3956 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3957 | pub struct Cr1(pub u32); | ||
| 3958 | impl Cr1 { | ||
| 3959 | #[doc = "Clock phase"] | ||
| 3960 | pub const fn cpha(&self) -> super::vals::Cpha { | ||
| 3961 | let val = (self.0 >> 0usize) & 0x01; | ||
| 3962 | super::vals::Cpha(val as u8) | ||
| 3963 | } | ||
| 3964 | #[doc = "Clock phase"] | ||
| 3965 | pub fn set_cpha(&mut self, val: super::vals::Cpha) { | ||
| 3966 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 3967 | } | ||
| 3968 | #[doc = "Clock polarity"] | ||
| 3969 | pub const fn cpol(&self) -> super::vals::Cpol { | ||
| 3970 | let val = (self.0 >> 1usize) & 0x01; | ||
| 3971 | super::vals::Cpol(val as u8) | ||
| 3972 | } | ||
| 3973 | #[doc = "Clock polarity"] | ||
| 3974 | pub fn set_cpol(&mut self, val: super::vals::Cpol) { | ||
| 3975 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 3976 | } | ||
| 3977 | #[doc = "Master selection"] | ||
| 3978 | pub const fn mstr(&self) -> super::vals::Mstr { | ||
| 3979 | let val = (self.0 >> 2usize) & 0x01; | ||
| 3980 | super::vals::Mstr(val as u8) | ||
| 3981 | } | ||
| 3982 | #[doc = "Master selection"] | ||
| 3983 | pub fn set_mstr(&mut self, val: super::vals::Mstr) { | ||
| 3984 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 3985 | } | ||
| 3986 | #[doc = "Baud rate control"] | ||
| 3987 | pub const fn br(&self) -> super::vals::Br { | ||
| 3988 | let val = (self.0 >> 3usize) & 0x07; | ||
| 3989 | super::vals::Br(val as u8) | ||
| 3990 | } | ||
| 3991 | #[doc = "Baud rate control"] | ||
| 3992 | pub fn set_br(&mut self, val: super::vals::Br) { | ||
| 3993 | self.0 = (self.0 & !(0x07 << 3usize)) | (((val.0 as u32) & 0x07) << 3usize); | ||
| 3994 | } | ||
| 3995 | #[doc = "SPI enable"] | ||
| 3996 | pub const fn spe(&self) -> bool { | ||
| 3997 | let val = (self.0 >> 6usize) & 0x01; | ||
| 3998 | val != 0 | ||
| 3999 | } | ||
| 4000 | #[doc = "SPI enable"] | ||
| 4001 | pub fn set_spe(&mut self, val: bool) { | ||
| 4002 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 4003 | } | ||
| 4004 | #[doc = "Frame format"] | ||
| 4005 | pub const fn lsbfirst(&self) -> super::vals::Lsbfirst { | ||
| 4006 | let val = (self.0 >> 7usize) & 0x01; | ||
| 4007 | super::vals::Lsbfirst(val as u8) | ||
| 4008 | } | ||
| 4009 | #[doc = "Frame format"] | ||
| 4010 | pub fn set_lsbfirst(&mut self, val: super::vals::Lsbfirst) { | ||
| 4011 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 4012 | } | ||
| 4013 | #[doc = "Internal slave select"] | ||
| 4014 | pub const fn ssi(&self) -> bool { | ||
| 4015 | let val = (self.0 >> 8usize) & 0x01; | ||
| 4016 | val != 0 | ||
| 4017 | } | ||
| 4018 | #[doc = "Internal slave select"] | ||
| 4019 | pub fn set_ssi(&mut self, val: bool) { | ||
| 4020 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 4021 | } | ||
| 4022 | #[doc = "Software slave management"] | ||
| 4023 | pub const fn ssm(&self) -> bool { | ||
| 4024 | let val = (self.0 >> 9usize) & 0x01; | ||
| 4025 | val != 0 | ||
| 4026 | } | ||
| 4027 | #[doc = "Software slave management"] | ||
| 4028 | pub fn set_ssm(&mut self, val: bool) { | ||
| 4029 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | ||
| 4030 | } | ||
| 4031 | #[doc = "Receive only"] | ||
| 4032 | pub const fn rxonly(&self) -> super::vals::Rxonly { | ||
| 771 | let val = (self.0 >> 10usize) & 0x01; | 4033 | let val = (self.0 >> 10usize) & 0x01; |
| 4034 | super::vals::Rxonly(val as u8) | ||
| 4035 | } | ||
| 4036 | #[doc = "Receive only"] | ||
| 4037 | pub fn set_rxonly(&mut self, val: super::vals::Rxonly) { | ||
| 4038 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); | ||
| 4039 | } | ||
| 4040 | #[doc = "CRC length"] | ||
| 4041 | pub const fn crcl(&self) -> super::vals::Crcl { | ||
| 4042 | let val = (self.0 >> 11usize) & 0x01; | ||
| 4043 | super::vals::Crcl(val as u8) | ||
| 4044 | } | ||
| 4045 | #[doc = "CRC length"] | ||
| 4046 | pub fn set_crcl(&mut self, val: super::vals::Crcl) { | ||
| 4047 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); | ||
| 4048 | } | ||
| 4049 | #[doc = "CRC transfer next"] | ||
| 4050 | pub const fn crcnext(&self) -> super::vals::Crcnext { | ||
| 4051 | let val = (self.0 >> 12usize) & 0x01; | ||
| 4052 | super::vals::Crcnext(val as u8) | ||
| 4053 | } | ||
| 4054 | #[doc = "CRC transfer next"] | ||
| 4055 | pub fn set_crcnext(&mut self, val: super::vals::Crcnext) { | ||
| 4056 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 4057 | } | ||
| 4058 | #[doc = "Hardware CRC calculation enable"] | ||
| 4059 | pub const fn crcen(&self) -> bool { | ||
| 4060 | let val = (self.0 >> 13usize) & 0x01; | ||
| 772 | val != 0 | 4061 | val != 0 |
| 773 | } | 4062 | } |
| 774 | #[doc = "CTS interrupt enable"] | 4063 | #[doc = "Hardware CRC calculation enable"] |
| 775 | pub fn set_ctsie(&mut self, val: bool) { | 4064 | pub fn set_crcen(&mut self, val: bool) { |
| 776 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | 4065 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); |
| 4066 | } | ||
| 4067 | #[doc = "Output enable in bidirectional mode"] | ||
| 4068 | pub const fn bidioe(&self) -> super::vals::Bidioe { | ||
| 4069 | let val = (self.0 >> 14usize) & 0x01; | ||
| 4070 | super::vals::Bidioe(val as u8) | ||
| 4071 | } | ||
| 4072 | #[doc = "Output enable in bidirectional mode"] | ||
| 4073 | pub fn set_bidioe(&mut self, val: super::vals::Bidioe) { | ||
| 4074 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | ||
| 4075 | } | ||
| 4076 | #[doc = "Bidirectional data mode enable"] | ||
| 4077 | pub const fn bidimode(&self) -> super::vals::Bidimode { | ||
| 4078 | let val = (self.0 >> 15usize) & 0x01; | ||
| 4079 | super::vals::Bidimode(val as u8) | ||
| 4080 | } | ||
| 4081 | #[doc = "Bidirectional data mode enable"] | ||
| 4082 | pub fn set_bidimode(&mut self, val: super::vals::Bidimode) { | ||
| 4083 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 777 | } | 4084 | } |
| 778 | } | 4085 | } |
| 779 | impl Default for Cr3Usart { | 4086 | impl Default for Cr1 { |
| 780 | fn default() -> Cr3Usart { | 4087 | fn default() -> Cr1 { |
| 781 | Cr3Usart(0) | 4088 | Cr1(0) |
| 782 | } | 4089 | } |
| 783 | } | 4090 | } |
| 784 | #[doc = "Data register"] | 4091 | #[doc = "data register"] |
| 785 | #[repr(transparent)] | 4092 | #[repr(transparent)] |
| 786 | #[derive(Copy, Clone, Eq, PartialEq)] | 4093 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 787 | pub struct Dr(pub u32); | 4094 | pub struct Dr(pub u32); |
| 788 | impl Dr { | 4095 | impl Dr { |
| 789 | #[doc = "Data value"] | 4096 | #[doc = "Data register"] |
| 790 | pub const fn dr(&self) -> u16 { | 4097 | pub const fn dr(&self) -> u16 { |
| 791 | let val = (self.0 >> 0usize) & 0x01ff; | 4098 | let val = (self.0 >> 0usize) & 0xffff; |
| 792 | val as u16 | 4099 | val as u16 |
| 793 | } | 4100 | } |
| 794 | #[doc = "Data value"] | 4101 | #[doc = "Data register"] |
| 795 | pub fn set_dr(&mut self, val: u16) { | 4102 | pub fn set_dr(&mut self, val: u16) { |
| 796 | self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize); | 4103 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); |
| 797 | } | 4104 | } |
| 798 | } | 4105 | } |
| 799 | impl Default for Dr { | 4106 | impl Default for Dr { |
| @@ -801,111 +4108,483 @@ pub mod usart_v1 { | |||
| 801 | Dr(0) | 4108 | Dr(0) |
| 802 | } | 4109 | } |
| 803 | } | 4110 | } |
| 4111 | #[doc = "control register 2"] | ||
| 4112 | #[repr(transparent)] | ||
| 4113 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4114 | pub struct Cr2(pub u32); | ||
| 4115 | impl Cr2 { | ||
| 4116 | #[doc = "Rx buffer DMA enable"] | ||
| 4117 | pub const fn rxdmaen(&self) -> bool { | ||
| 4118 | let val = (self.0 >> 0usize) & 0x01; | ||
| 4119 | val != 0 | ||
| 4120 | } | ||
| 4121 | #[doc = "Rx buffer DMA enable"] | ||
| 4122 | pub fn set_rxdmaen(&mut self, val: bool) { | ||
| 4123 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 4124 | } | ||
| 4125 | #[doc = "Tx buffer DMA enable"] | ||
| 4126 | pub const fn txdmaen(&self) -> bool { | ||
| 4127 | let val = (self.0 >> 1usize) & 0x01; | ||
| 4128 | val != 0 | ||
| 4129 | } | ||
| 4130 | #[doc = "Tx buffer DMA enable"] | ||
| 4131 | pub fn set_txdmaen(&mut self, val: bool) { | ||
| 4132 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | ||
| 4133 | } | ||
| 4134 | #[doc = "SS output enable"] | ||
| 4135 | pub const fn ssoe(&self) -> bool { | ||
| 4136 | let val = (self.0 >> 2usize) & 0x01; | ||
| 4137 | val != 0 | ||
| 4138 | } | ||
| 4139 | #[doc = "SS output enable"] | ||
| 4140 | pub fn set_ssoe(&mut self, val: bool) { | ||
| 4141 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 4142 | } | ||
| 4143 | #[doc = "NSS pulse management"] | ||
| 4144 | pub const fn nssp(&self) -> bool { | ||
| 4145 | let val = (self.0 >> 3usize) & 0x01; | ||
| 4146 | val != 0 | ||
| 4147 | } | ||
| 4148 | #[doc = "NSS pulse management"] | ||
| 4149 | pub fn set_nssp(&mut self, val: bool) { | ||
| 4150 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | ||
| 4151 | } | ||
| 4152 | #[doc = "Frame format"] | ||
| 4153 | pub const fn frf(&self) -> super::vals::Frf { | ||
| 4154 | let val = (self.0 >> 4usize) & 0x01; | ||
| 4155 | super::vals::Frf(val as u8) | ||
| 4156 | } | ||
| 4157 | #[doc = "Frame format"] | ||
| 4158 | pub fn set_frf(&mut self, val: super::vals::Frf) { | ||
| 4159 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 4160 | } | ||
| 4161 | #[doc = "Error interrupt enable"] | ||
| 4162 | pub const fn errie(&self) -> bool { | ||
| 4163 | let val = (self.0 >> 5usize) & 0x01; | ||
| 4164 | val != 0 | ||
| 4165 | } | ||
| 4166 | #[doc = "Error interrupt enable"] | ||
| 4167 | pub fn set_errie(&mut self, val: bool) { | ||
| 4168 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 4169 | } | ||
| 4170 | #[doc = "RX buffer not empty interrupt enable"] | ||
| 4171 | pub const fn rxneie(&self) -> bool { | ||
| 4172 | let val = (self.0 >> 6usize) & 0x01; | ||
| 4173 | val != 0 | ||
| 4174 | } | ||
| 4175 | #[doc = "RX buffer not empty interrupt enable"] | ||
| 4176 | pub fn set_rxneie(&mut self, val: bool) { | ||
| 4177 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 4178 | } | ||
| 4179 | #[doc = "Tx buffer empty interrupt enable"] | ||
| 4180 | pub const fn txeie(&self) -> bool { | ||
| 4181 | let val = (self.0 >> 7usize) & 0x01; | ||
| 4182 | val != 0 | ||
| 4183 | } | ||
| 4184 | #[doc = "Tx buffer empty interrupt enable"] | ||
| 4185 | pub fn set_txeie(&mut self, val: bool) { | ||
| 4186 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 4187 | } | ||
| 4188 | #[doc = "Data size"] | ||
| 4189 | pub const fn ds(&self) -> super::vals::Ds { | ||
| 4190 | let val = (self.0 >> 8usize) & 0x0f; | ||
| 4191 | super::vals::Ds(val as u8) | ||
| 4192 | } | ||
| 4193 | #[doc = "Data size"] | ||
| 4194 | pub fn set_ds(&mut self, val: super::vals::Ds) { | ||
| 4195 | self.0 = (self.0 & !(0x0f << 8usize)) | (((val.0 as u32) & 0x0f) << 8usize); | ||
| 4196 | } | ||
| 4197 | #[doc = "FIFO reception threshold"] | ||
| 4198 | pub const fn frxth(&self) -> super::vals::Frxth { | ||
| 4199 | let val = (self.0 >> 12usize) & 0x01; | ||
| 4200 | super::vals::Frxth(val as u8) | ||
| 4201 | } | ||
| 4202 | #[doc = "FIFO reception threshold"] | ||
| 4203 | pub fn set_frxth(&mut self, val: super::vals::Frxth) { | ||
| 4204 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 4205 | } | ||
| 4206 | #[doc = "Last DMA transfer for reception"] | ||
| 4207 | pub const fn ldma_rx(&self) -> super::vals::LdmaRx { | ||
| 4208 | let val = (self.0 >> 13usize) & 0x01; | ||
| 4209 | super::vals::LdmaRx(val as u8) | ||
| 4210 | } | ||
| 4211 | #[doc = "Last DMA transfer for reception"] | ||
| 4212 | pub fn set_ldma_rx(&mut self, val: super::vals::LdmaRx) { | ||
| 4213 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize); | ||
| 4214 | } | ||
| 4215 | #[doc = "Last DMA transfer for transmission"] | ||
| 4216 | pub const fn ldma_tx(&self) -> super::vals::LdmaTx { | ||
| 4217 | let val = (self.0 >> 14usize) & 0x01; | ||
| 4218 | super::vals::LdmaTx(val as u8) | ||
| 4219 | } | ||
| 4220 | #[doc = "Last DMA transfer for transmission"] | ||
| 4221 | pub fn set_ldma_tx(&mut self, val: super::vals::LdmaTx) { | ||
| 4222 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | ||
| 4223 | } | ||
| 4224 | } | ||
| 4225 | impl Default for Cr2 { | ||
| 4226 | fn default() -> Cr2 { | ||
| 4227 | Cr2(0) | ||
| 4228 | } | ||
| 4229 | } | ||
| 4230 | #[doc = "status register"] | ||
| 4231 | #[repr(transparent)] | ||
| 4232 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4233 | pub struct Sr(pub u32); | ||
| 4234 | impl Sr { | ||
| 4235 | #[doc = "Receive buffer not empty"] | ||
| 4236 | pub const fn rxne(&self) -> bool { | ||
| 4237 | let val = (self.0 >> 0usize) & 0x01; | ||
| 4238 | val != 0 | ||
| 4239 | } | ||
| 4240 | #[doc = "Receive buffer not empty"] | ||
| 4241 | pub fn set_rxne(&mut self, val: bool) { | ||
| 4242 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 4243 | } | ||
| 4244 | #[doc = "Transmit buffer empty"] | ||
| 4245 | pub const fn txe(&self) -> bool { | ||
| 4246 | let val = (self.0 >> 1usize) & 0x01; | ||
| 4247 | val != 0 | ||
| 4248 | } | ||
| 4249 | #[doc = "Transmit buffer empty"] | ||
| 4250 | pub fn set_txe(&mut self, val: bool) { | ||
| 4251 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | ||
| 4252 | } | ||
| 4253 | #[doc = "CRC error flag"] | ||
| 4254 | pub const fn crcerr(&self) -> bool { | ||
| 4255 | let val = (self.0 >> 4usize) & 0x01; | ||
| 4256 | val != 0 | ||
| 4257 | } | ||
| 4258 | #[doc = "CRC error flag"] | ||
| 4259 | pub fn set_crcerr(&mut self, val: bool) { | ||
| 4260 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | ||
| 4261 | } | ||
| 4262 | #[doc = "Mode fault"] | ||
| 4263 | pub const fn modf(&self) -> bool { | ||
| 4264 | let val = (self.0 >> 5usize) & 0x01; | ||
| 4265 | val != 0 | ||
| 4266 | } | ||
| 4267 | #[doc = "Mode fault"] | ||
| 4268 | pub fn set_modf(&mut self, val: bool) { | ||
| 4269 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 4270 | } | ||
| 4271 | #[doc = "Overrun flag"] | ||
| 4272 | pub const fn ovr(&self) -> bool { | ||
| 4273 | let val = (self.0 >> 6usize) & 0x01; | ||
| 4274 | val != 0 | ||
| 4275 | } | ||
| 4276 | #[doc = "Overrun flag"] | ||
| 4277 | pub fn set_ovr(&mut self, val: bool) { | ||
| 4278 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 4279 | } | ||
| 4280 | #[doc = "Busy flag"] | ||
| 4281 | pub const fn bsy(&self) -> bool { | ||
| 4282 | let val = (self.0 >> 7usize) & 0x01; | ||
| 4283 | val != 0 | ||
| 4284 | } | ||
| 4285 | #[doc = "Busy flag"] | ||
| 4286 | pub fn set_bsy(&mut self, val: bool) { | ||
| 4287 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 4288 | } | ||
| 4289 | #[doc = "Frame format error"] | ||
| 4290 | pub const fn fre(&self) -> bool { | ||
| 4291 | let val = (self.0 >> 8usize) & 0x01; | ||
| 4292 | val != 0 | ||
| 4293 | } | ||
| 4294 | #[doc = "Frame format error"] | ||
| 4295 | pub fn set_fre(&mut self, val: bool) { | ||
| 4296 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 4297 | } | ||
| 4298 | #[doc = "FIFO reception level"] | ||
| 4299 | pub const fn frlvl(&self) -> u8 { | ||
| 4300 | let val = (self.0 >> 9usize) & 0x03; | ||
| 4301 | val as u8 | ||
| 4302 | } | ||
| 4303 | #[doc = "FIFO reception level"] | ||
| 4304 | pub fn set_frlvl(&mut self, val: u8) { | ||
| 4305 | self.0 = (self.0 & !(0x03 << 9usize)) | (((val as u32) & 0x03) << 9usize); | ||
| 4306 | } | ||
| 4307 | #[doc = "FIFO Transmission Level"] | ||
| 4308 | pub const fn ftlvl(&self) -> u8 { | ||
| 4309 | let val = (self.0 >> 11usize) & 0x03; | ||
| 4310 | val as u8 | ||
| 4311 | } | ||
| 4312 | #[doc = "FIFO Transmission Level"] | ||
| 4313 | pub fn set_ftlvl(&mut self, val: u8) { | ||
| 4314 | self.0 = (self.0 & !(0x03 << 11usize)) | (((val as u32) & 0x03) << 11usize); | ||
| 4315 | } | ||
| 4316 | } | ||
| 4317 | impl Default for Sr { | ||
| 4318 | fn default() -> Sr { | ||
| 4319 | Sr(0) | ||
| 4320 | } | ||
| 4321 | } | ||
| 4322 | #[doc = "RX CRC register"] | ||
| 4323 | #[repr(transparent)] | ||
| 4324 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4325 | pub struct Rxcrcr(pub u32); | ||
| 4326 | impl Rxcrcr { | ||
| 4327 | #[doc = "Rx CRC register"] | ||
| 4328 | pub const fn rx_crc(&self) -> u16 { | ||
| 4329 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 4330 | val as u16 | ||
| 4331 | } | ||
| 4332 | #[doc = "Rx CRC register"] | ||
| 4333 | pub fn set_rx_crc(&mut self, val: u16) { | ||
| 4334 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 4335 | } | ||
| 4336 | } | ||
| 4337 | impl Default for Rxcrcr { | ||
| 4338 | fn default() -> Rxcrcr { | ||
| 4339 | Rxcrcr(0) | ||
| 4340 | } | ||
| 4341 | } | ||
| 4342 | #[doc = "CRC polynomial register"] | ||
| 4343 | #[repr(transparent)] | ||
| 4344 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4345 | pub struct Crcpr(pub u32); | ||
| 4346 | impl Crcpr { | ||
| 4347 | #[doc = "CRC polynomial register"] | ||
| 4348 | pub const fn crcpoly(&self) -> u16 { | ||
| 4349 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 4350 | val as u16 | ||
| 4351 | } | ||
| 4352 | #[doc = "CRC polynomial register"] | ||
| 4353 | pub fn set_crcpoly(&mut self, val: u16) { | ||
| 4354 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 4355 | } | ||
| 4356 | } | ||
| 4357 | impl Default for Crcpr { | ||
| 4358 | fn default() -> Crcpr { | ||
| 4359 | Crcpr(0) | ||
| 4360 | } | ||
| 4361 | } | ||
| 4362 | #[doc = "TX CRC register"] | ||
| 4363 | #[repr(transparent)] | ||
| 4364 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4365 | pub struct Txcrcr(pub u32); | ||
| 4366 | impl Txcrcr { | ||
| 4367 | #[doc = "Tx CRC register"] | ||
| 4368 | pub const fn tx_crc(&self) -> u16 { | ||
| 4369 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 4370 | val as u16 | ||
| 4371 | } | ||
| 4372 | #[doc = "Tx CRC register"] | ||
| 4373 | pub fn set_tx_crc(&mut self, val: u16) { | ||
| 4374 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 4375 | } | ||
| 4376 | } | ||
| 4377 | impl Default for Txcrcr { | ||
| 4378 | fn default() -> Txcrcr { | ||
| 4379 | Txcrcr(0) | ||
| 4380 | } | ||
| 4381 | } | ||
| 804 | } | 4382 | } |
| 805 | pub mod vals { | 4383 | pub mod vals { |
| 806 | use crate::generic::*; | 4384 | use crate::generic::*; |
| 807 | #[repr(transparent)] | 4385 | #[repr(transparent)] |
| 808 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 4386 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 809 | pub struct Ps(pub u8); | 4387 | pub struct Bidimode(pub u8); |
| 810 | impl Ps { | 4388 | impl Bidimode { |
| 811 | #[doc = "Even parity"] | 4389 | #[doc = "2-line unidirectional data mode selected"] |
| 812 | pub const EVEN: Self = Self(0); | 4390 | pub const UNIDIRECTIONAL: Self = Self(0); |
| 813 | #[doc = "Odd parity"] | 4391 | #[doc = "1-line bidirectional data mode selected"] |
| 814 | pub const ODD: Self = Self(0x01); | 4392 | pub const BIDIRECTIONAL: Self = Self(0x01); |
| 815 | } | 4393 | } |
| 816 | #[repr(transparent)] | 4394 | #[repr(transparent)] |
| 817 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 4395 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 818 | pub struct Wake(pub u8); | 4396 | pub struct Cpol(pub u8); |
| 819 | impl Wake { | 4397 | impl Cpol { |
| 820 | #[doc = "USART wakeup on idle line"] | 4398 | #[doc = "CK to 0 when idle"] |
| 821 | pub const IDLELINE: Self = Self(0); | 4399 | pub const IDLELOW: Self = Self(0); |
| 822 | #[doc = "USART wakeup on address mark"] | 4400 | #[doc = "CK to 1 when idle"] |
| 823 | pub const ADDRESSMARK: Self = Self(0x01); | 4401 | pub const IDLEHIGH: Self = Self(0x01); |
| 824 | } | 4402 | } |
| 825 | #[repr(transparent)] | 4403 | #[repr(transparent)] |
| 826 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 4404 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 827 | pub struct M(pub u8); | 4405 | pub struct Lsbfirst(pub u8); |
| 828 | impl M { | 4406 | impl Lsbfirst { |
| 829 | #[doc = "8 data bits"] | 4407 | #[doc = "Data is transmitted/received with the MSB first"] |
| 830 | pub const M8: Self = Self(0); | 4408 | pub const MSBFIRST: Self = Self(0); |
| 831 | #[doc = "9 data bits"] | 4409 | #[doc = "Data is transmitted/received with the LSB first"] |
| 832 | pub const M9: Self = Self(0x01); | 4410 | pub const LSBFIRST: Self = Self(0x01); |
| 833 | } | 4411 | } |
| 834 | #[repr(transparent)] | 4412 | #[repr(transparent)] |
| 835 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 4413 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 836 | pub struct Cpha(pub u8); | 4414 | pub struct Crcl(pub u8); |
| 837 | impl Cpha { | 4415 | impl Crcl { |
| 838 | #[doc = "The first clock transition is the first data capture edge"] | 4416 | #[doc = "8-bit CRC length"] |
| 839 | pub const FIRST: Self = Self(0); | 4417 | pub const EIGHTBIT: Self = Self(0); |
| 840 | #[doc = "The second clock transition is the first data capture edge"] | 4418 | #[doc = "16-bit CRC length"] |
| 841 | pub const SECOND: Self = Self(0x01); | 4419 | pub const SIXTEENBIT: Self = Self(0x01); |
| 842 | } | 4420 | } |
| 843 | #[repr(transparent)] | 4421 | #[repr(transparent)] |
| 844 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 4422 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 845 | pub struct Cpol(pub u8); | 4423 | pub struct Bidioe(pub u8); |
| 846 | impl Cpol { | 4424 | impl Bidioe { |
| 847 | #[doc = "Steady low value on CK pin outside transmission window"] | 4425 | #[doc = "Output disabled (receive-only mode)"] |
| 848 | pub const LOW: Self = Self(0); | 4426 | pub const OUTPUTDISABLED: Self = Self(0); |
| 849 | #[doc = "Steady high value on CK pin outside transmission window"] | 4427 | #[doc = "Output enabled (transmit-only mode)"] |
| 850 | pub const HIGH: Self = Self(0x01); | 4428 | pub const OUTPUTENABLED: Self = Self(0x01); |
| 851 | } | 4429 | } |
| 852 | #[repr(transparent)] | 4430 | #[repr(transparent)] |
| 853 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 4431 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 854 | pub struct Irlp(pub u8); | 4432 | pub struct Mstr(pub u8); |
| 855 | impl Irlp { | 4433 | impl Mstr { |
| 856 | #[doc = "Normal mode"] | 4434 | #[doc = "Slave configuration"] |
| 857 | pub const NORMAL: Self = Self(0); | 4435 | pub const SLAVE: Self = Self(0); |
| 858 | #[doc = "Low-power mode"] | 4436 | #[doc = "Master configuration"] |
| 859 | pub const LOWPOWER: Self = Self(0x01); | 4437 | pub const MASTER: Self = Self(0x01); |
| 860 | } | 4438 | } |
| 861 | #[repr(transparent)] | 4439 | #[repr(transparent)] |
| 862 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 4440 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 863 | pub struct Hdsel(pub u8); | 4441 | pub struct Frxth(pub u8); |
| 864 | impl Hdsel { | 4442 | impl Frxth { |
| 865 | #[doc = "Half duplex mode is not selected"] | 4443 | #[doc = "RXNE event is generated if the FIFO level is greater than or equal to 1/2 (16-bit)"] |
| 4444 | pub const HALF: Self = Self(0); | ||
| 4445 | #[doc = "RXNE event is generated if the FIFO level is greater than or equal to 1/4 (8-bit)"] | ||
| 4446 | pub const QUARTER: Self = Self(0x01); | ||
| 4447 | } | ||
| 4448 | #[repr(transparent)] | ||
| 4449 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4450 | pub struct Ftlvlr(pub u8); | ||
| 4451 | impl Ftlvlr { | ||
| 4452 | #[doc = "Tx FIFO Empty"] | ||
| 4453 | pub const EMPTY: Self = Self(0); | ||
| 4454 | #[doc = "Tx 1/4 FIFO"] | ||
| 4455 | pub const QUARTER: Self = Self(0x01); | ||
| 4456 | #[doc = "Tx 1/2 FIFO"] | ||
| 4457 | pub const HALF: Self = Self(0x02); | ||
| 4458 | #[doc = "Tx FIFO full"] | ||
| 4459 | pub const FULL: Self = Self(0x03); | ||
| 4460 | } | ||
| 4461 | #[repr(transparent)] | ||
| 4462 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4463 | pub struct Frlvlr(pub u8); | ||
| 4464 | impl Frlvlr { | ||
| 4465 | #[doc = "Rx FIFO Empty"] | ||
| 4466 | pub const EMPTY: Self = Self(0); | ||
| 4467 | #[doc = "Rx 1/4 FIFO"] | ||
| 4468 | pub const QUARTER: Self = Self(0x01); | ||
| 4469 | #[doc = "Rx 1/2 FIFO"] | ||
| 4470 | pub const HALF: Self = Self(0x02); | ||
| 4471 | #[doc = "Rx FIFO full"] | ||
| 4472 | pub const FULL: Self = Self(0x03); | ||
| 4473 | } | ||
| 4474 | #[repr(transparent)] | ||
| 4475 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4476 | pub struct Frer(pub u8); | ||
| 4477 | impl Frer { | ||
| 4478 | #[doc = "No frame format error"] | ||
| 4479 | pub const NOERROR: Self = Self(0); | ||
| 4480 | #[doc = "A frame format error occurred"] | ||
| 4481 | pub const ERROR: Self = Self(0x01); | ||
| 4482 | } | ||
| 4483 | #[repr(transparent)] | ||
| 4484 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4485 | pub struct Rxonly(pub u8); | ||
| 4486 | impl Rxonly { | ||
| 4487 | #[doc = "Full duplex (Transmit and receive)"] | ||
| 866 | pub const FULLDUPLEX: Self = Self(0); | 4488 | pub const FULLDUPLEX: Self = Self(0); |
| 867 | #[doc = "Half duplex mode is selected"] | 4489 | #[doc = "Output disabled (Receive-only mode)"] |
| 868 | pub const HALFDUPLEX: Self = Self(0x01); | 4490 | pub const OUTPUTDISABLED: Self = Self(0x01); |
| 869 | } | 4491 | } |
| 870 | #[repr(transparent)] | 4492 | #[repr(transparent)] |
| 871 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 4493 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 872 | pub struct Sbk(pub u8); | 4494 | pub struct Br(pub u8); |
| 873 | impl Sbk { | 4495 | impl Br { |
| 874 | #[doc = "No break character is transmitted"] | 4496 | #[doc = "f_PCLK / 2"] |
| 875 | pub const NOBREAK: Self = Self(0); | 4497 | pub const DIV2: Self = Self(0); |
| 876 | #[doc = "Break character transmitted"] | 4498 | #[doc = "f_PCLK / 4"] |
| 877 | pub const BREAK: Self = Self(0x01); | 4499 | pub const DIV4: Self = Self(0x01); |
| 4500 | #[doc = "f_PCLK / 8"] | ||
| 4501 | pub const DIV8: Self = Self(0x02); | ||
| 4502 | #[doc = "f_PCLK / 16"] | ||
| 4503 | pub const DIV16: Self = Self(0x03); | ||
| 4504 | #[doc = "f_PCLK / 32"] | ||
| 4505 | pub const DIV32: Self = Self(0x04); | ||
| 4506 | #[doc = "f_PCLK / 64"] | ||
| 4507 | pub const DIV64: Self = Self(0x05); | ||
| 4508 | #[doc = "f_PCLK / 128"] | ||
| 4509 | pub const DIV128: Self = Self(0x06); | ||
| 4510 | #[doc = "f_PCLK / 256"] | ||
| 4511 | pub const DIV256: Self = Self(0x07); | ||
| 878 | } | 4512 | } |
| 879 | #[repr(transparent)] | 4513 | #[repr(transparent)] |
| 880 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 4514 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 881 | pub struct Lbdl(pub u8); | 4515 | pub struct Frf(pub u8); |
| 882 | impl Lbdl { | 4516 | impl Frf { |
| 883 | #[doc = "10-bit break detection"] | 4517 | #[doc = "SPI Motorola mode"] |
| 884 | pub const LBDL10: Self = Self(0); | 4518 | pub const MOTOROLA: Self = Self(0); |
| 885 | #[doc = "11-bit break detection"] | 4519 | #[doc = "SPI TI mode"] |
| 886 | pub const LBDL11: Self = Self(0x01); | 4520 | pub const TI: Self = Self(0x01); |
| 887 | } | 4521 | } |
| 888 | #[repr(transparent)] | 4522 | #[repr(transparent)] |
| 889 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 4523 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 890 | pub struct Stop(pub u8); | 4524 | pub struct Crcnext(pub u8); |
| 891 | impl Stop { | 4525 | impl Crcnext { |
| 892 | #[doc = "1 stop bit"] | 4526 | #[doc = "Next transmit value is from Tx buffer"] |
| 893 | pub const STOP1: Self = Self(0); | 4527 | pub const TXBUFFER: Self = Self(0); |
| 894 | #[doc = "0.5 stop bits"] | 4528 | #[doc = "Next transmit value is from Tx CRC register"] |
| 895 | pub const STOP0P5: Self = Self(0x01); | 4529 | pub const CRC: Self = Self(0x01); |
| 896 | #[doc = "2 stop bits"] | ||
| 897 | pub const STOP2: Self = Self(0x02); | ||
| 898 | #[doc = "1.5 stop bits"] | ||
| 899 | pub const STOP1P5: Self = Self(0x03); | ||
| 900 | } | 4530 | } |
| 901 | #[repr(transparent)] | 4531 | #[repr(transparent)] |
| 902 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 4532 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 903 | pub struct Rwu(pub u8); | 4533 | pub struct LdmaTx(pub u8); |
| 904 | impl Rwu { | 4534 | impl LdmaTx { |
| 905 | #[doc = "Receiver in active mode"] | 4535 | #[doc = "Number of data to transfer for transmit is even"] |
| 906 | pub const ACTIVE: Self = Self(0); | 4536 | pub const EVEN: Self = Self(0); |
| 907 | #[doc = "Receiver in mute mode"] | 4537 | #[doc = "Number of data to transfer for transmit is odd"] |
| 908 | pub const MUTE: Self = Self(0x01); | 4538 | pub const ODD: Self = Self(0x01); |
| 4539 | } | ||
| 4540 | #[repr(transparent)] | ||
| 4541 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4542 | pub struct Ds(pub u8); | ||
| 4543 | impl Ds { | ||
| 4544 | #[doc = "4-bit"] | ||
| 4545 | pub const FOURBIT: Self = Self(0x03); | ||
| 4546 | #[doc = "5-bit"] | ||
| 4547 | pub const FIVEBIT: Self = Self(0x04); | ||
| 4548 | #[doc = "6-bit"] | ||
| 4549 | pub const SIXBIT: Self = Self(0x05); | ||
| 4550 | #[doc = "7-bit"] | ||
| 4551 | pub const SEVENBIT: Self = Self(0x06); | ||
| 4552 | #[doc = "8-bit"] | ||
| 4553 | pub const EIGHTBIT: Self = Self(0x07); | ||
| 4554 | #[doc = "9-bit"] | ||
| 4555 | pub const NINEBIT: Self = Self(0x08); | ||
| 4556 | #[doc = "10-bit"] | ||
| 4557 | pub const TENBIT: Self = Self(0x09); | ||
| 4558 | #[doc = "11-bit"] | ||
| 4559 | pub const ELEVENBIT: Self = Self(0x0a); | ||
| 4560 | #[doc = "12-bit"] | ||
| 4561 | pub const TWELVEBIT: Self = Self(0x0b); | ||
| 4562 | #[doc = "13-bit"] | ||
| 4563 | pub const THIRTEENBIT: Self = Self(0x0c); | ||
| 4564 | #[doc = "14-bit"] | ||
| 4565 | pub const FOURTEENBIT: Self = Self(0x0d); | ||
| 4566 | #[doc = "15-bit"] | ||
| 4567 | pub const FIFTEENBIT: Self = Self(0x0e); | ||
| 4568 | #[doc = "16-bit"] | ||
| 4569 | pub const SIXTEENBIT: Self = Self(0x0f); | ||
| 4570 | } | ||
| 4571 | #[repr(transparent)] | ||
| 4572 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4573 | pub struct LdmaRx(pub u8); | ||
| 4574 | impl LdmaRx { | ||
| 4575 | #[doc = "Number of data to transfer for receive is even"] | ||
| 4576 | pub const EVEN: Self = Self(0); | ||
| 4577 | #[doc = "Number of data to transfer for receive is odd"] | ||
| 4578 | pub const ODD: Self = Self(0x01); | ||
| 4579 | } | ||
| 4580 | #[repr(transparent)] | ||
| 4581 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4582 | pub struct Cpha(pub u8); | ||
| 4583 | impl Cpha { | ||
| 4584 | #[doc = "The first clock transition is the first data capture edge"] | ||
| 4585 | pub const FIRSTEDGE: Self = Self(0); | ||
| 4586 | #[doc = "The second clock transition is the first data capture edge"] | ||
| 4587 | pub const SECONDEDGE: Self = Self(0x01); | ||
| 909 | } | 4588 | } |
| 910 | } | 4589 | } |
| 911 | } | 4590 | } |
| @@ -1075,6 +4754,26 @@ pub mod dma_v1 { | |||
| 1075 | Cr(0) | 4754 | Cr(0) |
| 1076 | } | 4755 | } |
| 1077 | } | 4756 | } |
| 4757 | #[doc = "DMA channel 1 number of data register"] | ||
| 4758 | #[repr(transparent)] | ||
| 4759 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4760 | pub struct Ndtr(pub u32); | ||
| 4761 | impl Ndtr { | ||
| 4762 | #[doc = "Number of data to transfer"] | ||
| 4763 | pub const fn ndt(&self) -> u16 { | ||
| 4764 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 4765 | val as u16 | ||
| 4766 | } | ||
| 4767 | #[doc = "Number of data to transfer"] | ||
| 4768 | pub fn set_ndt(&mut self, val: u16) { | ||
| 4769 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 4770 | } | ||
| 4771 | } | ||
| 4772 | impl Default for Ndtr { | ||
| 4773 | fn default() -> Ndtr { | ||
| 4774 | Ndtr(0) | ||
| 4775 | } | ||
| 4776 | } | ||
| 1078 | #[doc = "DMA interrupt flag clear register (DMA_IFCR)"] | 4777 | #[doc = "DMA interrupt flag clear register (DMA_IFCR)"] |
| 1079 | #[repr(transparent)] | 4778 | #[repr(transparent)] |
| 1080 | #[derive(Copy, Clone, Eq, PartialEq)] | 4779 | #[derive(Copy, Clone, Eq, PartialEq)] |
| @@ -1138,26 +4837,6 @@ pub mod dma_v1 { | |||
| 1138 | Ifcr(0) | 4837 | Ifcr(0) |
| 1139 | } | 4838 | } |
| 1140 | } | 4839 | } |
| 1141 | #[doc = "DMA channel 1 number of data register"] | ||
| 1142 | #[repr(transparent)] | ||
| 1143 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1144 | pub struct Ndtr(pub u32); | ||
| 1145 | impl Ndtr { | ||
| 1146 | #[doc = "Number of data to transfer"] | ||
| 1147 | pub const fn ndt(&self) -> u16 { | ||
| 1148 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 1149 | val as u16 | ||
| 1150 | } | ||
| 1151 | #[doc = "Number of data to transfer"] | ||
| 1152 | pub fn set_ndt(&mut self, val: u16) { | ||
| 1153 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 1154 | } | ||
| 1155 | } | ||
| 1156 | impl Default for Ndtr { | ||
| 1157 | fn default() -> Ndtr { | ||
| 1158 | Ndtr(0) | ||
| 1159 | } | ||
| 1160 | } | ||
| 1161 | #[doc = "DMA interrupt status register (DMA_ISR)"] | 4840 | #[doc = "DMA interrupt status register (DMA_ISR)"] |
| 1162 | #[repr(transparent)] | 4841 | #[repr(transparent)] |
| 1163 | #[derive(Copy, Clone, Eq, PartialEq)] | 4842 | #[derive(Copy, Clone, Eq, PartialEq)] |
| @@ -1226,20 +4905,20 @@ pub mod dma_v1 { | |||
| 1226 | use crate::generic::*; | 4905 | use crate::generic::*; |
| 1227 | #[repr(transparent)] | 4906 | #[repr(transparent)] |
| 1228 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 4907 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 1229 | pub struct Inc(pub u8); | 4908 | pub struct Circ(pub u8); |
| 1230 | impl Inc { | 4909 | impl Circ { |
| 1231 | #[doc = "Increment mode disabled"] | 4910 | #[doc = "Circular buffer disabled"] |
| 1232 | pub const DISABLED: Self = Self(0); | 4911 | pub const DISABLED: Self = Self(0); |
| 1233 | #[doc = "Increment mode enabled"] | 4912 | #[doc = "Circular buffer enabled"] |
| 1234 | pub const ENABLED: Self = Self(0x01); | 4913 | pub const ENABLED: Self = Self(0x01); |
| 1235 | } | 4914 | } |
| 1236 | #[repr(transparent)] | 4915 | #[repr(transparent)] |
| 1237 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 4916 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 1238 | pub struct Memmem(pub u8); | 4917 | pub struct Inc(pub u8); |
| 1239 | impl Memmem { | 4918 | impl Inc { |
| 1240 | #[doc = "Memory to memory mode disabled"] | 4919 | #[doc = "Increment mode disabled"] |
| 1241 | pub const DISABLED: Self = Self(0); | 4920 | pub const DISABLED: Self = Self(0); |
| 1242 | #[doc = "Memory to memory mode enabled"] | 4921 | #[doc = "Increment mode enabled"] |
| 1243 | pub const ENABLED: Self = Self(0x01); | 4922 | pub const ENABLED: Self = Self(0x01); |
| 1244 | } | 4923 | } |
| 1245 | #[repr(transparent)] | 4924 | #[repr(transparent)] |
| @@ -1264,15 +4943,6 @@ pub mod dma_v1 { | |||
| 1264 | } | 4943 | } |
| 1265 | #[repr(transparent)] | 4944 | #[repr(transparent)] |
| 1266 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 4945 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 1267 | pub struct Circ(pub u8); | ||
| 1268 | impl Circ { | ||
| 1269 | #[doc = "Circular buffer disabled"] | ||
| 1270 | pub const DISABLED: Self = Self(0); | ||
| 1271 | #[doc = "Circular buffer enabled"] | ||
| 1272 | pub const ENABLED: Self = Self(0x01); | ||
| 1273 | } | ||
| 1274 | #[repr(transparent)] | ||
| 1275 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 1276 | pub struct Pl(pub u8); | 4946 | pub struct Pl(pub u8); |
| 1277 | impl Pl { | 4947 | impl Pl { |
| 1278 | #[doc = "Low priority"] | 4948 | #[doc = "Low priority"] |
| @@ -1284,61 +4954,31 @@ pub mod dma_v1 { | |||
| 1284 | #[doc = "Very high priority"] | 4954 | #[doc = "Very high priority"] |
| 1285 | pub const VERYHIGH: Self = Self(0x03); | 4955 | pub const VERYHIGH: Self = Self(0x03); |
| 1286 | } | 4956 | } |
| 4957 | #[repr(transparent)] | ||
| 4958 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4959 | pub struct Memmem(pub u8); | ||
| 4960 | impl Memmem { | ||
| 4961 | #[doc = "Memory to memory mode disabled"] | ||
| 4962 | pub const DISABLED: Self = Self(0); | ||
| 4963 | #[doc = "Memory to memory mode enabled"] | ||
| 4964 | pub const ENABLED: Self = Self(0x01); | ||
| 4965 | } | ||
| 1287 | } | 4966 | } |
| 1288 | } | 4967 | } |
| 1289 | pub mod timer_v1 { | 4968 | pub mod timer_v1 { |
| 1290 | use crate::generic::*; | 4969 | use crate::generic::*; |
| 1291 | #[doc = "Basic timer"] | 4970 | #[doc = "General purpose 16-bit timer"] |
| 1292 | #[derive(Copy, Clone)] | ||
| 1293 | pub struct TimBasic(pub *mut u8); | ||
| 1294 | unsafe impl Send for TimBasic {} | ||
| 1295 | unsafe impl Sync for TimBasic {} | ||
| 1296 | impl TimBasic { | ||
| 1297 | #[doc = "control register 1"] | ||
| 1298 | pub fn cr1(self) -> Reg<regs::Cr1Basic, RW> { | ||
| 1299 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 1300 | } | ||
| 1301 | #[doc = "control register 2"] | ||
| 1302 | pub fn cr2(self) -> Reg<regs::Cr2Basic, RW> { | ||
| 1303 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 1304 | } | ||
| 1305 | #[doc = "DMA/Interrupt enable register"] | ||
| 1306 | pub fn dier(self) -> Reg<regs::DierBasic, RW> { | ||
| 1307 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 1308 | } | ||
| 1309 | #[doc = "status register"] | ||
| 1310 | pub fn sr(self) -> Reg<regs::SrBasic, RW> { | ||
| 1311 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 1312 | } | ||
| 1313 | #[doc = "event generation register"] | ||
| 1314 | pub fn egr(self) -> Reg<regs::EgrBasic, W> { | ||
| 1315 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 1316 | } | ||
| 1317 | #[doc = "counter"] | ||
| 1318 | pub fn cnt(self) -> Reg<regs::Cnt16, RW> { | ||
| 1319 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | ||
| 1320 | } | ||
| 1321 | #[doc = "prescaler"] | ||
| 1322 | pub fn psc(self) -> Reg<regs::Psc, RW> { | ||
| 1323 | unsafe { Reg::from_ptr(self.0.add(40usize)) } | ||
| 1324 | } | ||
| 1325 | #[doc = "auto-reload register"] | ||
| 1326 | pub fn arr(self) -> Reg<regs::Arr16, RW> { | ||
| 1327 | unsafe { Reg::from_ptr(self.0.add(44usize)) } | ||
| 1328 | } | ||
| 1329 | } | ||
| 1330 | #[doc = "Advanced-timers"] | ||
| 1331 | #[derive(Copy, Clone)] | 4971 | #[derive(Copy, Clone)] |
| 1332 | pub struct TimAdv(pub *mut u8); | 4972 | pub struct TimGp16(pub *mut u8); |
| 1333 | unsafe impl Send for TimAdv {} | 4973 | unsafe impl Send for TimGp16 {} |
| 1334 | unsafe impl Sync for TimAdv {} | 4974 | unsafe impl Sync for TimGp16 {} |
| 1335 | impl TimAdv { | 4975 | impl TimGp16 { |
| 1336 | #[doc = "control register 1"] | 4976 | #[doc = "control register 1"] |
| 1337 | pub fn cr1(self) -> Reg<regs::Cr1Gp, RW> { | 4977 | pub fn cr1(self) -> Reg<regs::Cr1Gp, RW> { |
| 1338 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | 4978 | unsafe { Reg::from_ptr(self.0.add(0usize)) } |
| 1339 | } | 4979 | } |
| 1340 | #[doc = "control register 2"] | 4980 | #[doc = "control register 2"] |
| 1341 | pub fn cr2(self) -> Reg<regs::Cr2Adv, RW> { | 4981 | pub fn cr2(self) -> Reg<regs::Cr2Gp, RW> { |
| 1342 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | 4982 | unsafe { Reg::from_ptr(self.0.add(4usize)) } |
| 1343 | } | 4983 | } |
| 1344 | #[doc = "slave mode control register"] | 4984 | #[doc = "slave mode control register"] |
| @@ -1346,15 +4986,15 @@ pub mod timer_v1 { | |||
| 1346 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | 4986 | unsafe { Reg::from_ptr(self.0.add(8usize)) } |
| 1347 | } | 4987 | } |
| 1348 | #[doc = "DMA/Interrupt enable register"] | 4988 | #[doc = "DMA/Interrupt enable register"] |
| 1349 | pub fn dier(self) -> Reg<regs::DierAdv, RW> { | 4989 | pub fn dier(self) -> Reg<regs::DierGp, RW> { |
| 1350 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | 4990 | unsafe { Reg::from_ptr(self.0.add(12usize)) } |
| 1351 | } | 4991 | } |
| 1352 | #[doc = "status register"] | 4992 | #[doc = "status register"] |
| 1353 | pub fn sr(self) -> Reg<regs::SrAdv, RW> { | 4993 | pub fn sr(self) -> Reg<regs::SrGp, RW> { |
| 1354 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | 4994 | unsafe { Reg::from_ptr(self.0.add(16usize)) } |
| 1355 | } | 4995 | } |
| 1356 | #[doc = "event generation register"] | 4996 | #[doc = "event generation register"] |
| 1357 | pub fn egr(self) -> Reg<regs::EgrAdv, W> { | 4997 | pub fn egr(self) -> Reg<regs::EgrGp, W> { |
| 1358 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | 4998 | unsafe { Reg::from_ptr(self.0.add(20usize)) } |
| 1359 | } | 4999 | } |
| 1360 | #[doc = "capture/compare mode register 1 (input mode)"] | 5000 | #[doc = "capture/compare mode register 1 (input mode)"] |
| @@ -1368,7 +5008,7 @@ pub mod timer_v1 { | |||
| 1368 | unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) } | 5008 | unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) } |
| 1369 | } | 5009 | } |
| 1370 | #[doc = "capture/compare enable register"] | 5010 | #[doc = "capture/compare enable register"] |
| 1371 | pub fn ccer(self) -> Reg<regs::CcerAdv, RW> { | 5011 | pub fn ccer(self) -> Reg<regs::CcerGp, RW> { |
| 1372 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | 5012 | unsafe { Reg::from_ptr(self.0.add(32usize)) } |
| 1373 | } | 5013 | } |
| 1374 | #[doc = "counter"] | 5014 | #[doc = "counter"] |
| @@ -1383,19 +5023,11 @@ pub mod timer_v1 { | |||
| 1383 | pub fn arr(self) -> Reg<regs::Arr16, RW> { | 5023 | pub fn arr(self) -> Reg<regs::Arr16, RW> { |
| 1384 | unsafe { Reg::from_ptr(self.0.add(44usize)) } | 5024 | unsafe { Reg::from_ptr(self.0.add(44usize)) } |
| 1385 | } | 5025 | } |
| 1386 | #[doc = "repetition counter register"] | ||
| 1387 | pub fn rcr(self) -> Reg<regs::Rcr, RW> { | ||
| 1388 | unsafe { Reg::from_ptr(self.0.add(48usize)) } | ||
| 1389 | } | ||
| 1390 | #[doc = "capture/compare register"] | 5026 | #[doc = "capture/compare register"] |
| 1391 | pub fn ccr(self, n: usize) -> Reg<regs::Ccr16, RW> { | 5027 | pub fn ccr(self, n: usize) -> Reg<regs::Ccr16, RW> { |
| 1392 | assert!(n < 4usize); | 5028 | assert!(n < 4usize); |
| 1393 | unsafe { Reg::from_ptr(self.0.add(52usize + n * 4usize)) } | 5029 | unsafe { Reg::from_ptr(self.0.add(52usize + n * 4usize)) } |
| 1394 | } | 5030 | } |
| 1395 | #[doc = "break and dead-time register"] | ||
| 1396 | pub fn bdtr(self) -> Reg<regs::Bdtr, RW> { | ||
| 1397 | unsafe { Reg::from_ptr(self.0.add(68usize)) } | ||
| 1398 | } | ||
| 1399 | #[doc = "DMA control register"] | 5031 | #[doc = "DMA control register"] |
| 1400 | pub fn dcr(self) -> Reg<regs::Dcr, RW> { | 5032 | pub fn dcr(self) -> Reg<regs::Dcr, RW> { |
| 1401 | unsafe { Reg::from_ptr(self.0.add(72usize)) } | 5033 | unsafe { Reg::from_ptr(self.0.add(72usize)) } |
| @@ -1405,12 +5037,12 @@ pub mod timer_v1 { | |||
| 1405 | unsafe { Reg::from_ptr(self.0.add(76usize)) } | 5037 | unsafe { Reg::from_ptr(self.0.add(76usize)) } |
| 1406 | } | 5038 | } |
| 1407 | } | 5039 | } |
| 1408 | #[doc = "General purpose 16-bit timer"] | 5040 | #[doc = "General purpose 32-bit timer"] |
| 1409 | #[derive(Copy, Clone)] | 5041 | #[derive(Copy, Clone)] |
| 1410 | pub struct TimGp16(pub *mut u8); | 5042 | pub struct TimGp32(pub *mut u8); |
| 1411 | unsafe impl Send for TimGp16 {} | 5043 | unsafe impl Send for TimGp32 {} |
| 1412 | unsafe impl Sync for TimGp16 {} | 5044 | unsafe impl Sync for TimGp32 {} |
| 1413 | impl TimGp16 { | 5045 | impl TimGp32 { |
| 1414 | #[doc = "control register 1"] | 5046 | #[doc = "control register 1"] |
| 1415 | pub fn cr1(self) -> Reg<regs::Cr1Gp, RW> { | 5047 | pub fn cr1(self) -> Reg<regs::Cr1Gp, RW> { |
| 1416 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | 5048 | unsafe { Reg::from_ptr(self.0.add(0usize)) } |
| @@ -1450,7 +5082,7 @@ pub mod timer_v1 { | |||
| 1450 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | 5082 | unsafe { Reg::from_ptr(self.0.add(32usize)) } |
| 1451 | } | 5083 | } |
| 1452 | #[doc = "counter"] | 5084 | #[doc = "counter"] |
| 1453 | pub fn cnt(self) -> Reg<regs::Cnt16, RW> { | 5085 | pub fn cnt(self) -> Reg<regs::Cnt32, RW> { |
| 1454 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | 5086 | unsafe { Reg::from_ptr(self.0.add(36usize)) } |
| 1455 | } | 5087 | } |
| 1456 | #[doc = "prescaler"] | 5088 | #[doc = "prescaler"] |
| @@ -1458,11 +5090,11 @@ pub mod timer_v1 { | |||
| 1458 | unsafe { Reg::from_ptr(self.0.add(40usize)) } | 5090 | unsafe { Reg::from_ptr(self.0.add(40usize)) } |
| 1459 | } | 5091 | } |
| 1460 | #[doc = "auto-reload register"] | 5092 | #[doc = "auto-reload register"] |
| 1461 | pub fn arr(self) -> Reg<regs::Arr16, RW> { | 5093 | pub fn arr(self) -> Reg<regs::Arr32, RW> { |
| 1462 | unsafe { Reg::from_ptr(self.0.add(44usize)) } | 5094 | unsafe { Reg::from_ptr(self.0.add(44usize)) } |
| 1463 | } | 5095 | } |
| 1464 | #[doc = "capture/compare register"] | 5096 | #[doc = "capture/compare register"] |
| 1465 | pub fn ccr(self, n: usize) -> Reg<regs::Ccr16, RW> { | 5097 | pub fn ccr(self, n: usize) -> Reg<regs::Ccr32, RW> { |
| 1466 | assert!(n < 4usize); | 5098 | assert!(n < 4usize); |
| 1467 | unsafe { Reg::from_ptr(self.0.add(52usize + n * 4usize)) } | 5099 | unsafe { Reg::from_ptr(self.0.add(52usize + n * 4usize)) } |
| 1468 | } | 5100 | } |
| @@ -1475,18 +5107,18 @@ pub mod timer_v1 { | |||
| 1475 | unsafe { Reg::from_ptr(self.0.add(76usize)) } | 5107 | unsafe { Reg::from_ptr(self.0.add(76usize)) } |
| 1476 | } | 5108 | } |
| 1477 | } | 5109 | } |
| 1478 | #[doc = "General purpose 32-bit timer"] | 5110 | #[doc = "Advanced-timers"] |
| 1479 | #[derive(Copy, Clone)] | 5111 | #[derive(Copy, Clone)] |
| 1480 | pub struct TimGp32(pub *mut u8); | 5112 | pub struct TimAdv(pub *mut u8); |
| 1481 | unsafe impl Send for TimGp32 {} | 5113 | unsafe impl Send for TimAdv {} |
| 1482 | unsafe impl Sync for TimGp32 {} | 5114 | unsafe impl Sync for TimAdv {} |
| 1483 | impl TimGp32 { | 5115 | impl TimAdv { |
| 1484 | #[doc = "control register 1"] | 5116 | #[doc = "control register 1"] |
| 1485 | pub fn cr1(self) -> Reg<regs::Cr1Gp, RW> { | 5117 | pub fn cr1(self) -> Reg<regs::Cr1Gp, RW> { |
| 1486 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | 5118 | unsafe { Reg::from_ptr(self.0.add(0usize)) } |
| 1487 | } | 5119 | } |
| 1488 | #[doc = "control register 2"] | 5120 | #[doc = "control register 2"] |
| 1489 | pub fn cr2(self) -> Reg<regs::Cr2Gp, RW> { | 5121 | pub fn cr2(self) -> Reg<regs::Cr2Adv, RW> { |
| 1490 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | 5122 | unsafe { Reg::from_ptr(self.0.add(4usize)) } |
| 1491 | } | 5123 | } |
| 1492 | #[doc = "slave mode control register"] | 5124 | #[doc = "slave mode control register"] |
| @@ -1494,15 +5126,15 @@ pub mod timer_v1 { | |||
| 1494 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | 5126 | unsafe { Reg::from_ptr(self.0.add(8usize)) } |
| 1495 | } | 5127 | } |
| 1496 | #[doc = "DMA/Interrupt enable register"] | 5128 | #[doc = "DMA/Interrupt enable register"] |
| 1497 | pub fn dier(self) -> Reg<regs::DierGp, RW> { | 5129 | pub fn dier(self) -> Reg<regs::DierAdv, RW> { |
| 1498 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | 5130 | unsafe { Reg::from_ptr(self.0.add(12usize)) } |
| 1499 | } | 5131 | } |
| 1500 | #[doc = "status register"] | 5132 | #[doc = "status register"] |
| 1501 | pub fn sr(self) -> Reg<regs::SrGp, RW> { | 5133 | pub fn sr(self) -> Reg<regs::SrAdv, RW> { |
| 1502 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | 5134 | unsafe { Reg::from_ptr(self.0.add(16usize)) } |
| 1503 | } | 5135 | } |
| 1504 | #[doc = "event generation register"] | 5136 | #[doc = "event generation register"] |
| 1505 | pub fn egr(self) -> Reg<regs::EgrGp, W> { | 5137 | pub fn egr(self) -> Reg<regs::EgrAdv, W> { |
| 1506 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | 5138 | unsafe { Reg::from_ptr(self.0.add(20usize)) } |
| 1507 | } | 5139 | } |
| 1508 | #[doc = "capture/compare mode register 1 (input mode)"] | 5140 | #[doc = "capture/compare mode register 1 (input mode)"] |
| @@ -1516,11 +5148,11 @@ pub mod timer_v1 { | |||
| 1516 | unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) } | 5148 | unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) } |
| 1517 | } | 5149 | } |
| 1518 | #[doc = "capture/compare enable register"] | 5150 | #[doc = "capture/compare enable register"] |
| 1519 | pub fn ccer(self) -> Reg<regs::CcerGp, RW> { | 5151 | pub fn ccer(self) -> Reg<regs::CcerAdv, RW> { |
| 1520 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | 5152 | unsafe { Reg::from_ptr(self.0.add(32usize)) } |
| 1521 | } | 5153 | } |
| 1522 | #[doc = "counter"] | 5154 | #[doc = "counter"] |
| 1523 | pub fn cnt(self) -> Reg<regs::Cnt32, RW> { | 5155 | pub fn cnt(self) -> Reg<regs::Cnt16, RW> { |
| 1524 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | 5156 | unsafe { Reg::from_ptr(self.0.add(36usize)) } |
| 1525 | } | 5157 | } |
| 1526 | #[doc = "prescaler"] | 5158 | #[doc = "prescaler"] |
| @@ -1528,14 +5160,22 @@ pub mod timer_v1 { | |||
| 1528 | unsafe { Reg::from_ptr(self.0.add(40usize)) } | 5160 | unsafe { Reg::from_ptr(self.0.add(40usize)) } |
| 1529 | } | 5161 | } |
| 1530 | #[doc = "auto-reload register"] | 5162 | #[doc = "auto-reload register"] |
| 1531 | pub fn arr(self) -> Reg<regs::Arr32, RW> { | 5163 | pub fn arr(self) -> Reg<regs::Arr16, RW> { |
| 1532 | unsafe { Reg::from_ptr(self.0.add(44usize)) } | 5164 | unsafe { Reg::from_ptr(self.0.add(44usize)) } |
| 1533 | } | 5165 | } |
| 5166 | #[doc = "repetition counter register"] | ||
| 5167 | pub fn rcr(self) -> Reg<regs::Rcr, RW> { | ||
| 5168 | unsafe { Reg::from_ptr(self.0.add(48usize)) } | ||
| 5169 | } | ||
| 1534 | #[doc = "capture/compare register"] | 5170 | #[doc = "capture/compare register"] |
| 1535 | pub fn ccr(self, n: usize) -> Reg<regs::Ccr32, RW> { | 5171 | pub fn ccr(self, n: usize) -> Reg<regs::Ccr16, RW> { |
| 1536 | assert!(n < 4usize); | 5172 | assert!(n < 4usize); |
| 1537 | unsafe { Reg::from_ptr(self.0.add(52usize + n * 4usize)) } | 5173 | unsafe { Reg::from_ptr(self.0.add(52usize + n * 4usize)) } |
| 1538 | } | 5174 | } |
| 5175 | #[doc = "break and dead-time register"] | ||
| 5176 | pub fn bdtr(self) -> Reg<regs::Bdtr, RW> { | ||
| 5177 | unsafe { Reg::from_ptr(self.0.add(68usize)) } | ||
| 5178 | } | ||
| 1539 | #[doc = "DMA control register"] | 5179 | #[doc = "DMA control register"] |
| 1540 | pub fn dcr(self) -> Reg<regs::Dcr, RW> { | 5180 | pub fn dcr(self) -> Reg<regs::Dcr, RW> { |
| 1541 | unsafe { Reg::from_ptr(self.0.add(72usize)) } | 5181 | unsafe { Reg::from_ptr(self.0.add(72usize)) } |
| @@ -1545,13 +5185,315 @@ pub mod timer_v1 { | |||
| 1545 | unsafe { Reg::from_ptr(self.0.add(76usize)) } | 5185 | unsafe { Reg::from_ptr(self.0.add(76usize)) } |
| 1546 | } | 5186 | } |
| 1547 | } | 5187 | } |
| 5188 | #[doc = "Basic timer"] | ||
| 5189 | #[derive(Copy, Clone)] | ||
| 5190 | pub struct TimBasic(pub *mut u8); | ||
| 5191 | unsafe impl Send for TimBasic {} | ||
| 5192 | unsafe impl Sync for TimBasic {} | ||
| 5193 | impl TimBasic { | ||
| 5194 | #[doc = "control register 1"] | ||
| 5195 | pub fn cr1(self) -> Reg<regs::Cr1Basic, RW> { | ||
| 5196 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 5197 | } | ||
| 5198 | #[doc = "control register 2"] | ||
| 5199 | pub fn cr2(self) -> Reg<regs::Cr2Basic, RW> { | ||
| 5200 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 5201 | } | ||
| 5202 | #[doc = "DMA/Interrupt enable register"] | ||
| 5203 | pub fn dier(self) -> Reg<regs::DierBasic, RW> { | ||
| 5204 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 5205 | } | ||
| 5206 | #[doc = "status register"] | ||
| 5207 | pub fn sr(self) -> Reg<regs::SrBasic, RW> { | ||
| 5208 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 5209 | } | ||
| 5210 | #[doc = "event generation register"] | ||
| 5211 | pub fn egr(self) -> Reg<regs::EgrBasic, W> { | ||
| 5212 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 5213 | } | ||
| 5214 | #[doc = "counter"] | ||
| 5215 | pub fn cnt(self) -> Reg<regs::Cnt16, RW> { | ||
| 5216 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | ||
| 5217 | } | ||
| 5218 | #[doc = "prescaler"] | ||
| 5219 | pub fn psc(self) -> Reg<regs::Psc, RW> { | ||
| 5220 | unsafe { Reg::from_ptr(self.0.add(40usize)) } | ||
| 5221 | } | ||
| 5222 | #[doc = "auto-reload register"] | ||
| 5223 | pub fn arr(self) -> Reg<regs::Arr16, RW> { | ||
| 5224 | unsafe { Reg::from_ptr(self.0.add(44usize)) } | ||
| 5225 | } | ||
| 5226 | } | ||
| 1548 | pub mod regs { | 5227 | pub mod regs { |
| 1549 | use crate::generic::*; | 5228 | use crate::generic::*; |
| 5229 | #[doc = "status register"] | ||
| 5230 | #[repr(transparent)] | ||
| 5231 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5232 | pub struct SrGp(pub u32); | ||
| 5233 | impl SrGp { | ||
| 5234 | #[doc = "Update interrupt flag"] | ||
| 5235 | pub const fn uif(&self) -> bool { | ||
| 5236 | let val = (self.0 >> 0usize) & 0x01; | ||
| 5237 | val != 0 | ||
| 5238 | } | ||
| 5239 | #[doc = "Update interrupt flag"] | ||
| 5240 | pub fn set_uif(&mut self, val: bool) { | ||
| 5241 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 5242 | } | ||
| 5243 | #[doc = "Capture/compare 1 interrupt flag"] | ||
| 5244 | pub fn ccif(&self, n: usize) -> bool { | ||
| 5245 | assert!(n < 4usize); | ||
| 5246 | let offs = 1usize + n * 1usize; | ||
| 5247 | let val = (self.0 >> offs) & 0x01; | ||
| 5248 | val != 0 | ||
| 5249 | } | ||
| 5250 | #[doc = "Capture/compare 1 interrupt flag"] | ||
| 5251 | pub fn set_ccif(&mut self, n: usize, val: bool) { | ||
| 5252 | assert!(n < 4usize); | ||
| 5253 | let offs = 1usize + n * 1usize; | ||
| 5254 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 5255 | } | ||
| 5256 | #[doc = "COM interrupt flag"] | ||
| 5257 | pub const fn comif(&self) -> bool { | ||
| 5258 | let val = (self.0 >> 5usize) & 0x01; | ||
| 5259 | val != 0 | ||
| 5260 | } | ||
| 5261 | #[doc = "COM interrupt flag"] | ||
| 5262 | pub fn set_comif(&mut self, val: bool) { | ||
| 5263 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 5264 | } | ||
| 5265 | #[doc = "Trigger interrupt flag"] | ||
| 5266 | pub const fn tif(&self) -> bool { | ||
| 5267 | let val = (self.0 >> 6usize) & 0x01; | ||
| 5268 | val != 0 | ||
| 5269 | } | ||
| 5270 | #[doc = "Trigger interrupt flag"] | ||
| 5271 | pub fn set_tif(&mut self, val: bool) { | ||
| 5272 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 5273 | } | ||
| 5274 | #[doc = "Break interrupt flag"] | ||
| 5275 | pub const fn bif(&self) -> bool { | ||
| 5276 | let val = (self.0 >> 7usize) & 0x01; | ||
| 5277 | val != 0 | ||
| 5278 | } | ||
| 5279 | #[doc = "Break interrupt flag"] | ||
| 5280 | pub fn set_bif(&mut self, val: bool) { | ||
| 5281 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 5282 | } | ||
| 5283 | #[doc = "Capture/Compare 1 overcapture flag"] | ||
| 5284 | pub fn ccof(&self, n: usize) -> bool { | ||
| 5285 | assert!(n < 4usize); | ||
| 5286 | let offs = 9usize + n * 1usize; | ||
| 5287 | let val = (self.0 >> offs) & 0x01; | ||
| 5288 | val != 0 | ||
| 5289 | } | ||
| 5290 | #[doc = "Capture/Compare 1 overcapture flag"] | ||
| 5291 | pub fn set_ccof(&mut self, n: usize, val: bool) { | ||
| 5292 | assert!(n < 4usize); | ||
| 5293 | let offs = 9usize + n * 1usize; | ||
| 5294 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 5295 | } | ||
| 5296 | } | ||
| 5297 | impl Default for SrGp { | ||
| 5298 | fn default() -> SrGp { | ||
| 5299 | SrGp(0) | ||
| 5300 | } | ||
| 5301 | } | ||
| 5302 | #[doc = "event generation register"] | ||
| 5303 | #[repr(transparent)] | ||
| 5304 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5305 | pub struct EgrBasic(pub u32); | ||
| 5306 | impl EgrBasic { | ||
| 5307 | #[doc = "Update generation"] | ||
| 5308 | pub const fn ug(&self) -> bool { | ||
| 5309 | let val = (self.0 >> 0usize) & 0x01; | ||
| 5310 | val != 0 | ||
| 5311 | } | ||
| 5312 | #[doc = "Update generation"] | ||
| 5313 | pub fn set_ug(&mut self, val: bool) { | ||
| 5314 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 5315 | } | ||
| 5316 | } | ||
| 5317 | impl Default for EgrBasic { | ||
| 5318 | fn default() -> EgrBasic { | ||
| 5319 | EgrBasic(0) | ||
| 5320 | } | ||
| 5321 | } | ||
| 5322 | #[doc = "DMA address for full transfer"] | ||
| 5323 | #[repr(transparent)] | ||
| 5324 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5325 | pub struct Dmar(pub u32); | ||
| 5326 | impl Dmar { | ||
| 5327 | #[doc = "DMA register for burst accesses"] | ||
| 5328 | pub const fn dmab(&self) -> u16 { | ||
| 5329 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 5330 | val as u16 | ||
| 5331 | } | ||
| 5332 | #[doc = "DMA register for burst accesses"] | ||
| 5333 | pub fn set_dmab(&mut self, val: u16) { | ||
| 5334 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 5335 | } | ||
| 5336 | } | ||
| 5337 | impl Default for Dmar { | ||
| 5338 | fn default() -> Dmar { | ||
| 5339 | Dmar(0) | ||
| 5340 | } | ||
| 5341 | } | ||
| 5342 | #[doc = "capture/compare mode register 1 (input mode)"] | ||
| 5343 | #[repr(transparent)] | ||
| 5344 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5345 | pub struct CcmrInput(pub u32); | ||
| 5346 | impl CcmrInput { | ||
| 5347 | #[doc = "Capture/Compare 1 selection"] | ||
| 5348 | pub fn ccs(&self, n: usize) -> super::vals::CcmrInputCcs { | ||
| 5349 | assert!(n < 2usize); | ||
| 5350 | let offs = 0usize + n * 8usize; | ||
| 5351 | let val = (self.0 >> offs) & 0x03; | ||
| 5352 | super::vals::CcmrInputCcs(val as u8) | ||
| 5353 | } | ||
| 5354 | #[doc = "Capture/Compare 1 selection"] | ||
| 5355 | pub fn set_ccs(&mut self, n: usize, val: super::vals::CcmrInputCcs) { | ||
| 5356 | assert!(n < 2usize); | ||
| 5357 | let offs = 0usize + n * 8usize; | ||
| 5358 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | ||
| 5359 | } | ||
| 5360 | #[doc = "Input capture 1 prescaler"] | ||
| 5361 | pub fn icpsc(&self, n: usize) -> u8 { | ||
| 5362 | assert!(n < 2usize); | ||
| 5363 | let offs = 2usize + n * 8usize; | ||
| 5364 | let val = (self.0 >> offs) & 0x03; | ||
| 5365 | val as u8 | ||
| 5366 | } | ||
| 5367 | #[doc = "Input capture 1 prescaler"] | ||
| 5368 | pub fn set_icpsc(&mut self, n: usize, val: u8) { | ||
| 5369 | assert!(n < 2usize); | ||
| 5370 | let offs = 2usize + n * 8usize; | ||
| 5371 | self.0 = (self.0 & !(0x03 << offs)) | (((val as u32) & 0x03) << offs); | ||
| 5372 | } | ||
| 5373 | #[doc = "Input capture 1 filter"] | ||
| 5374 | pub fn icf(&self, n: usize) -> super::vals::Icf { | ||
| 5375 | assert!(n < 2usize); | ||
| 5376 | let offs = 4usize + n * 8usize; | ||
| 5377 | let val = (self.0 >> offs) & 0x0f; | ||
| 5378 | super::vals::Icf(val as u8) | ||
| 5379 | } | ||
| 5380 | #[doc = "Input capture 1 filter"] | ||
| 5381 | pub fn set_icf(&mut self, n: usize, val: super::vals::Icf) { | ||
| 5382 | assert!(n < 2usize); | ||
| 5383 | let offs = 4usize + n * 8usize; | ||
| 5384 | self.0 = (self.0 & !(0x0f << offs)) | (((val.0 as u32) & 0x0f) << offs); | ||
| 5385 | } | ||
| 5386 | } | ||
| 5387 | impl Default for CcmrInput { | ||
| 5388 | fn default() -> CcmrInput { | ||
| 5389 | CcmrInput(0) | ||
| 5390 | } | ||
| 5391 | } | ||
| 5392 | #[doc = "repetition counter register"] | ||
| 5393 | #[repr(transparent)] | ||
| 5394 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5395 | pub struct Rcr(pub u32); | ||
| 5396 | impl Rcr { | ||
| 5397 | #[doc = "Repetition counter value"] | ||
| 5398 | pub const fn rep(&self) -> u8 { | ||
| 5399 | let val = (self.0 >> 0usize) & 0xff; | ||
| 5400 | val as u8 | ||
| 5401 | } | ||
| 5402 | #[doc = "Repetition counter value"] | ||
| 5403 | pub fn set_rep(&mut self, val: u8) { | ||
| 5404 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | ||
| 5405 | } | ||
| 5406 | } | ||
| 5407 | impl Default for Rcr { | ||
| 5408 | fn default() -> Rcr { | ||
| 5409 | Rcr(0) | ||
| 5410 | } | ||
| 5411 | } | ||
| 5412 | #[doc = "event generation register"] | ||
| 5413 | #[repr(transparent)] | ||
| 5414 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5415 | pub struct EgrGp(pub u32); | ||
| 5416 | impl EgrGp { | ||
| 5417 | #[doc = "Update generation"] | ||
| 5418 | pub const fn ug(&self) -> bool { | ||
| 5419 | let val = (self.0 >> 0usize) & 0x01; | ||
| 5420 | val != 0 | ||
| 5421 | } | ||
| 5422 | #[doc = "Update generation"] | ||
| 5423 | pub fn set_ug(&mut self, val: bool) { | ||
| 5424 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 5425 | } | ||
| 5426 | #[doc = "Capture/compare 1 generation"] | ||
| 5427 | pub fn ccg(&self, n: usize) -> bool { | ||
| 5428 | assert!(n < 4usize); | ||
| 5429 | let offs = 1usize + n * 1usize; | ||
| 5430 | let val = (self.0 >> offs) & 0x01; | ||
| 5431 | val != 0 | ||
| 5432 | } | ||
| 5433 | #[doc = "Capture/compare 1 generation"] | ||
| 5434 | pub fn set_ccg(&mut self, n: usize, val: bool) { | ||
| 5435 | assert!(n < 4usize); | ||
| 5436 | let offs = 1usize + n * 1usize; | ||
| 5437 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 5438 | } | ||
| 5439 | #[doc = "Capture/Compare control update generation"] | ||
| 5440 | pub const fn comg(&self) -> bool { | ||
| 5441 | let val = (self.0 >> 5usize) & 0x01; | ||
| 5442 | val != 0 | ||
| 5443 | } | ||
| 5444 | #[doc = "Capture/Compare control update generation"] | ||
| 5445 | pub fn set_comg(&mut self, val: bool) { | ||
| 5446 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 5447 | } | ||
| 5448 | #[doc = "Trigger generation"] | ||
| 5449 | pub const fn tg(&self) -> bool { | ||
| 5450 | let val = (self.0 >> 6usize) & 0x01; | ||
| 5451 | val != 0 | ||
| 5452 | } | ||
| 5453 | #[doc = "Trigger generation"] | ||
| 5454 | pub fn set_tg(&mut self, val: bool) { | ||
| 5455 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 5456 | } | ||
| 5457 | #[doc = "Break generation"] | ||
| 5458 | pub const fn bg(&self) -> bool { | ||
| 5459 | let val = (self.0 >> 7usize) & 0x01; | ||
| 5460 | val != 0 | ||
| 5461 | } | ||
| 5462 | #[doc = "Break generation"] | ||
| 5463 | pub fn set_bg(&mut self, val: bool) { | ||
| 5464 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 5465 | } | ||
| 5466 | } | ||
| 5467 | impl Default for EgrGp { | ||
| 5468 | fn default() -> EgrGp { | ||
| 5469 | EgrGp(0) | ||
| 5470 | } | ||
| 5471 | } | ||
| 5472 | #[doc = "counter"] | ||
| 5473 | #[repr(transparent)] | ||
| 5474 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5475 | pub struct Cnt16(pub u32); | ||
| 5476 | impl Cnt16 { | ||
| 5477 | #[doc = "counter value"] | ||
| 5478 | pub const fn cnt(&self) -> u16 { | ||
| 5479 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 5480 | val as u16 | ||
| 5481 | } | ||
| 5482 | #[doc = "counter value"] | ||
| 5483 | pub fn set_cnt(&mut self, val: u16) { | ||
| 5484 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 5485 | } | ||
| 5486 | } | ||
| 5487 | impl Default for Cnt16 { | ||
| 5488 | fn default() -> Cnt16 { | ||
| 5489 | Cnt16(0) | ||
| 5490 | } | ||
| 5491 | } | ||
| 1550 | #[doc = "DMA/Interrupt enable register"] | 5492 | #[doc = "DMA/Interrupt enable register"] |
| 1551 | #[repr(transparent)] | 5493 | #[repr(transparent)] |
| 1552 | #[derive(Copy, Clone, Eq, PartialEq)] | 5494 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 1553 | pub struct DierGp(pub u32); | 5495 | pub struct DierAdv(pub u32); |
| 1554 | impl DierGp { | 5496 | impl DierAdv { |
| 1555 | #[doc = "Update interrupt enable"] | 5497 | #[doc = "Update interrupt enable"] |
| 1556 | pub const fn uie(&self) -> bool { | 5498 | pub const fn uie(&self) -> bool { |
| 1557 | let val = (self.0 >> 0usize) & 0x01; | 5499 | let val = (self.0 >> 0usize) & 0x01; |
| @@ -1574,6 +5516,15 @@ pub mod timer_v1 { | |||
| 1574 | let offs = 1usize + n * 1usize; | 5516 | let offs = 1usize + n * 1usize; |
| 1575 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | 5517 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); |
| 1576 | } | 5518 | } |
| 5519 | #[doc = "COM interrupt enable"] | ||
| 5520 | pub const fn comie(&self) -> bool { | ||
| 5521 | let val = (self.0 >> 5usize) & 0x01; | ||
| 5522 | val != 0 | ||
| 5523 | } | ||
| 5524 | #[doc = "COM interrupt enable"] | ||
| 5525 | pub fn set_comie(&mut self, val: bool) { | ||
| 5526 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 5527 | } | ||
| 1577 | #[doc = "Trigger interrupt enable"] | 5528 | #[doc = "Trigger interrupt enable"] |
| 1578 | pub const fn tie(&self) -> bool { | 5529 | pub const fn tie(&self) -> bool { |
| 1579 | let val = (self.0 >> 6usize) & 0x01; | 5530 | let val = (self.0 >> 6usize) & 0x01; |
| @@ -1583,6 +5534,15 @@ pub mod timer_v1 { | |||
| 1583 | pub fn set_tie(&mut self, val: bool) { | 5534 | pub fn set_tie(&mut self, val: bool) { |
| 1584 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 5535 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 1585 | } | 5536 | } |
| 5537 | #[doc = "Break interrupt enable"] | ||
| 5538 | pub const fn bie(&self) -> bool { | ||
| 5539 | let val = (self.0 >> 7usize) & 0x01; | ||
| 5540 | val != 0 | ||
| 5541 | } | ||
| 5542 | #[doc = "Break interrupt enable"] | ||
| 5543 | pub fn set_bie(&mut self, val: bool) { | ||
| 5544 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 5545 | } | ||
| 1586 | #[doc = "Update DMA request enable"] | 5546 | #[doc = "Update DMA request enable"] |
| 1587 | pub const fn ude(&self) -> bool { | 5547 | pub const fn ude(&self) -> bool { |
| 1588 | let val = (self.0 >> 8usize) & 0x01; | 5548 | let val = (self.0 >> 8usize) & 0x01; |
| @@ -1605,6 +5565,15 @@ pub mod timer_v1 { | |||
| 1605 | let offs = 9usize + n * 1usize; | 5565 | let offs = 9usize + n * 1usize; |
| 1606 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | 5566 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); |
| 1607 | } | 5567 | } |
| 5568 | #[doc = "COM DMA request enable"] | ||
| 5569 | pub const fn comde(&self) -> bool { | ||
| 5570 | let val = (self.0 >> 13usize) & 0x01; | ||
| 5571 | val != 0 | ||
| 5572 | } | ||
| 5573 | #[doc = "COM DMA request enable"] | ||
| 5574 | pub fn set_comde(&mut self, val: bool) { | ||
| 5575 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | ||
| 5576 | } | ||
| 1608 | #[doc = "Trigger DMA request enable"] | 5577 | #[doc = "Trigger DMA request enable"] |
| 1609 | pub const fn tde(&self) -> bool { | 5578 | pub const fn tde(&self) -> bool { |
| 1610 | let val = (self.0 >> 14usize) & 0x01; | 5579 | let val = (self.0 >> 14usize) & 0x01; |
| @@ -1615,16 +5584,34 @@ pub mod timer_v1 { | |||
| 1615 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | 5584 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); |
| 1616 | } | 5585 | } |
| 1617 | } | 5586 | } |
| 1618 | impl Default for DierGp { | 5587 | impl Default for DierAdv { |
| 1619 | fn default() -> DierGp { | 5588 | fn default() -> DierAdv { |
| 1620 | DierGp(0) | 5589 | DierAdv(0) |
| 1621 | } | 5590 | } |
| 1622 | } | 5591 | } |
| 1623 | #[doc = "control register 2"] | 5592 | #[doc = "control register 2"] |
| 1624 | #[repr(transparent)] | 5593 | #[repr(transparent)] |
| 1625 | #[derive(Copy, Clone, Eq, PartialEq)] | 5594 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 1626 | pub struct Cr2Gp(pub u32); | 5595 | pub struct Cr2Adv(pub u32); |
| 1627 | impl Cr2Gp { | 5596 | impl Cr2Adv { |
| 5597 | #[doc = "Capture/compare preloaded control"] | ||
| 5598 | pub const fn ccpc(&self) -> bool { | ||
| 5599 | let val = (self.0 >> 0usize) & 0x01; | ||
| 5600 | val != 0 | ||
| 5601 | } | ||
| 5602 | #[doc = "Capture/compare preloaded control"] | ||
| 5603 | pub fn set_ccpc(&mut self, val: bool) { | ||
| 5604 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 5605 | } | ||
| 5606 | #[doc = "Capture/compare control update selection"] | ||
| 5607 | pub const fn ccus(&self) -> bool { | ||
| 5608 | let val = (self.0 >> 2usize) & 0x01; | ||
| 5609 | val != 0 | ||
| 5610 | } | ||
| 5611 | #[doc = "Capture/compare control update selection"] | ||
| 5612 | pub fn set_ccus(&mut self, val: bool) { | ||
| 5613 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 5614 | } | ||
| 1628 | #[doc = "Capture/compare DMA selection"] | 5615 | #[doc = "Capture/compare DMA selection"] |
| 1629 | pub const fn ccds(&self) -> super::vals::Ccds { | 5616 | pub const fn ccds(&self) -> super::vals::Ccds { |
| 1630 | let val = (self.0 >> 3usize) & 0x01; | 5617 | let val = (self.0 >> 3usize) & 0x01; |
| @@ -1652,50 +5639,50 @@ pub mod timer_v1 { | |||
| 1652 | pub fn set_ti1s(&mut self, val: super::vals::Tis) { | 5639 | pub fn set_ti1s(&mut self, val: super::vals::Tis) { |
| 1653 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | 5640 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); |
| 1654 | } | 5641 | } |
| 1655 | } | 5642 | #[doc = "Output Idle state 1"] |
| 1656 | impl Default for Cr2Gp { | 5643 | pub fn ois(&self, n: usize) -> bool { |
| 1657 | fn default() -> Cr2Gp { | 5644 | assert!(n < 4usize); |
| 1658 | Cr2Gp(0) | 5645 | let offs = 8usize + n * 2usize; |
| 5646 | let val = (self.0 >> offs) & 0x01; | ||
| 5647 | val != 0 | ||
| 1659 | } | 5648 | } |
| 1660 | } | 5649 | #[doc = "Output Idle state 1"] |
| 1661 | #[doc = "status register"] | 5650 | pub fn set_ois(&mut self, n: usize, val: bool) { |
| 1662 | #[repr(transparent)] | 5651 | assert!(n < 4usize); |
| 1663 | #[derive(Copy, Clone, Eq, PartialEq)] | 5652 | let offs = 8usize + n * 2usize; |
| 1664 | pub struct SrBasic(pub u32); | 5653 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); |
| 1665 | impl SrBasic { | 5654 | } |
| 1666 | #[doc = "Update interrupt flag"] | 5655 | #[doc = "Output Idle state 1"] |
| 1667 | pub const fn uif(&self) -> bool { | 5656 | pub const fn ois1n(&self) -> bool { |
| 1668 | let val = (self.0 >> 0usize) & 0x01; | 5657 | let val = (self.0 >> 9usize) & 0x01; |
| 1669 | val != 0 | 5658 | val != 0 |
| 1670 | } | 5659 | } |
| 1671 | #[doc = "Update interrupt flag"] | 5660 | #[doc = "Output Idle state 1"] |
| 1672 | pub fn set_uif(&mut self, val: bool) { | 5661 | pub fn set_ois1n(&mut self, val: bool) { |
| 1673 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 5662 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); |
| 1674 | } | 5663 | } |
| 1675 | } | 5664 | #[doc = "Output Idle state 2"] |
| 1676 | impl Default for SrBasic { | 5665 | pub const fn ois2n(&self) -> bool { |
| 1677 | fn default() -> SrBasic { | 5666 | let val = (self.0 >> 11usize) & 0x01; |
| 1678 | SrBasic(0) | 5667 | val != 0 |
| 1679 | } | 5668 | } |
| 1680 | } | 5669 | #[doc = "Output Idle state 2"] |
| 1681 | #[doc = "event generation register"] | 5670 | pub fn set_ois2n(&mut self, val: bool) { |
| 1682 | #[repr(transparent)] | 5671 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); |
| 1683 | #[derive(Copy, Clone, Eq, PartialEq)] | 5672 | } |
| 1684 | pub struct EgrBasic(pub u32); | 5673 | #[doc = "Output Idle state 3"] |
| 1685 | impl EgrBasic { | 5674 | pub const fn ois3n(&self) -> bool { |
| 1686 | #[doc = "Update generation"] | 5675 | let val = (self.0 >> 13usize) & 0x01; |
| 1687 | pub const fn ug(&self) -> bool { | ||
| 1688 | let val = (self.0 >> 0usize) & 0x01; | ||
| 1689 | val != 0 | 5676 | val != 0 |
| 1690 | } | 5677 | } |
| 1691 | #[doc = "Update generation"] | 5678 | #[doc = "Output Idle state 3"] |
| 1692 | pub fn set_ug(&mut self, val: bool) { | 5679 | pub fn set_ois3n(&mut self, val: bool) { |
| 1693 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 5680 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); |
| 1694 | } | 5681 | } |
| 1695 | } | 5682 | } |
| 1696 | impl Default for EgrBasic { | 5683 | impl Default for Cr2Adv { |
| 1697 | fn default() -> EgrBasic { | 5684 | fn default() -> Cr2Adv { |
| 1698 | EgrBasic(0) | 5685 | Cr2Adv(0) |
| 1699 | } | 5686 | } |
| 1700 | } | 5687 | } |
| 1701 | #[doc = "control register 2"] | 5688 | #[doc = "control register 2"] |
| @@ -1718,11 +5705,155 @@ pub mod timer_v1 { | |||
| 1718 | Cr2Basic(0) | 5705 | Cr2Basic(0) |
| 1719 | } | 5706 | } |
| 1720 | } | 5707 | } |
| 5708 | #[doc = "auto-reload register"] | ||
| 5709 | #[repr(transparent)] | ||
| 5710 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5711 | pub struct Arr16(pub u32); | ||
| 5712 | impl Arr16 { | ||
| 5713 | #[doc = "Auto-reload value"] | ||
| 5714 | pub const fn arr(&self) -> u16 { | ||
| 5715 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 5716 | val as u16 | ||
| 5717 | } | ||
| 5718 | #[doc = "Auto-reload value"] | ||
| 5719 | pub fn set_arr(&mut self, val: u16) { | ||
| 5720 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 5721 | } | ||
| 5722 | } | ||
| 5723 | impl Default for Arr16 { | ||
| 5724 | fn default() -> Arr16 { | ||
| 5725 | Arr16(0) | ||
| 5726 | } | ||
| 5727 | } | ||
| 5728 | #[doc = "capture/compare enable register"] | ||
| 5729 | #[repr(transparent)] | ||
| 5730 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5731 | pub struct CcerGp(pub u32); | ||
| 5732 | impl CcerGp { | ||
| 5733 | #[doc = "Capture/Compare 1 output enable"] | ||
| 5734 | pub fn cce(&self, n: usize) -> bool { | ||
| 5735 | assert!(n < 4usize); | ||
| 5736 | let offs = 0usize + n * 4usize; | ||
| 5737 | let val = (self.0 >> offs) & 0x01; | ||
| 5738 | val != 0 | ||
| 5739 | } | ||
| 5740 | #[doc = "Capture/Compare 1 output enable"] | ||
| 5741 | pub fn set_cce(&mut self, n: usize, val: bool) { | ||
| 5742 | assert!(n < 4usize); | ||
| 5743 | let offs = 0usize + n * 4usize; | ||
| 5744 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 5745 | } | ||
| 5746 | #[doc = "Capture/Compare 1 output Polarity"] | ||
| 5747 | pub fn ccp(&self, n: usize) -> bool { | ||
| 5748 | assert!(n < 4usize); | ||
| 5749 | let offs = 1usize + n * 4usize; | ||
| 5750 | let val = (self.0 >> offs) & 0x01; | ||
| 5751 | val != 0 | ||
| 5752 | } | ||
| 5753 | #[doc = "Capture/Compare 1 output Polarity"] | ||
| 5754 | pub fn set_ccp(&mut self, n: usize, val: bool) { | ||
| 5755 | assert!(n < 4usize); | ||
| 5756 | let offs = 1usize + n * 4usize; | ||
| 5757 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 5758 | } | ||
| 5759 | #[doc = "Capture/Compare 1 output Polarity"] | ||
| 5760 | pub fn ccnp(&self, n: usize) -> bool { | ||
| 5761 | assert!(n < 4usize); | ||
| 5762 | let offs = 3usize + n * 4usize; | ||
| 5763 | let val = (self.0 >> offs) & 0x01; | ||
| 5764 | val != 0 | ||
| 5765 | } | ||
| 5766 | #[doc = "Capture/Compare 1 output Polarity"] | ||
| 5767 | pub fn set_ccnp(&mut self, n: usize, val: bool) { | ||
| 5768 | assert!(n < 4usize); | ||
| 5769 | let offs = 3usize + n * 4usize; | ||
| 5770 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 5771 | } | ||
| 5772 | } | ||
| 5773 | impl Default for CcerGp { | ||
| 5774 | fn default() -> CcerGp { | ||
| 5775 | CcerGp(0) | ||
| 5776 | } | ||
| 5777 | } | ||
| 5778 | #[doc = "slave mode control register"] | ||
| 5779 | #[repr(transparent)] | ||
| 5780 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5781 | pub struct Smcr(pub u32); | ||
| 5782 | impl Smcr { | ||
| 5783 | #[doc = "Slave mode selection"] | ||
| 5784 | pub const fn sms(&self) -> super::vals::Sms { | ||
| 5785 | let val = (self.0 >> 0usize) & 0x07; | ||
| 5786 | super::vals::Sms(val as u8) | ||
| 5787 | } | ||
| 5788 | #[doc = "Slave mode selection"] | ||
| 5789 | pub fn set_sms(&mut self, val: super::vals::Sms) { | ||
| 5790 | self.0 = (self.0 & !(0x07 << 0usize)) | (((val.0 as u32) & 0x07) << 0usize); | ||
| 5791 | } | ||
| 5792 | #[doc = "Trigger selection"] | ||
| 5793 | pub const fn ts(&self) -> super::vals::Ts { | ||
| 5794 | let val = (self.0 >> 4usize) & 0x07; | ||
| 5795 | super::vals::Ts(val as u8) | ||
| 5796 | } | ||
| 5797 | #[doc = "Trigger selection"] | ||
| 5798 | pub fn set_ts(&mut self, val: super::vals::Ts) { | ||
| 5799 | self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize); | ||
| 5800 | } | ||
| 5801 | #[doc = "Master/Slave mode"] | ||
| 5802 | pub const fn msm(&self) -> super::vals::Msm { | ||
| 5803 | let val = (self.0 >> 7usize) & 0x01; | ||
| 5804 | super::vals::Msm(val as u8) | ||
| 5805 | } | ||
| 5806 | #[doc = "Master/Slave mode"] | ||
| 5807 | pub fn set_msm(&mut self, val: super::vals::Msm) { | ||
| 5808 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 5809 | } | ||
| 5810 | #[doc = "External trigger filter"] | ||
| 5811 | pub const fn etf(&self) -> super::vals::Etf { | ||
| 5812 | let val = (self.0 >> 8usize) & 0x0f; | ||
| 5813 | super::vals::Etf(val as u8) | ||
| 5814 | } | ||
| 5815 | #[doc = "External trigger filter"] | ||
| 5816 | pub fn set_etf(&mut self, val: super::vals::Etf) { | ||
| 5817 | self.0 = (self.0 & !(0x0f << 8usize)) | (((val.0 as u32) & 0x0f) << 8usize); | ||
| 5818 | } | ||
| 5819 | #[doc = "External trigger prescaler"] | ||
| 5820 | pub const fn etps(&self) -> super::vals::Etps { | ||
| 5821 | let val = (self.0 >> 12usize) & 0x03; | ||
| 5822 | super::vals::Etps(val as u8) | ||
| 5823 | } | ||
| 5824 | #[doc = "External trigger prescaler"] | ||
| 5825 | pub fn set_etps(&mut self, val: super::vals::Etps) { | ||
| 5826 | self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize); | ||
| 5827 | } | ||
| 5828 | #[doc = "External clock enable"] | ||
| 5829 | pub const fn ece(&self) -> super::vals::Ece { | ||
| 5830 | let val = (self.0 >> 14usize) & 0x01; | ||
| 5831 | super::vals::Ece(val as u8) | ||
| 5832 | } | ||
| 5833 | #[doc = "External clock enable"] | ||
| 5834 | pub fn set_ece(&mut self, val: super::vals::Ece) { | ||
| 5835 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | ||
| 5836 | } | ||
| 5837 | #[doc = "External trigger polarity"] | ||
| 5838 | pub const fn etp(&self) -> super::vals::Etp { | ||
| 5839 | let val = (self.0 >> 15usize) & 0x01; | ||
| 5840 | super::vals::Etp(val as u8) | ||
| 5841 | } | ||
| 5842 | #[doc = "External trigger polarity"] | ||
| 5843 | pub fn set_etp(&mut self, val: super::vals::Etp) { | ||
| 5844 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 5845 | } | ||
| 5846 | } | ||
| 5847 | impl Default for Smcr { | ||
| 5848 | fn default() -> Smcr { | ||
| 5849 | Smcr(0) | ||
| 5850 | } | ||
| 5851 | } | ||
| 1721 | #[doc = "DMA/Interrupt enable register"] | 5852 | #[doc = "DMA/Interrupt enable register"] |
| 1722 | #[repr(transparent)] | 5853 | #[repr(transparent)] |
| 1723 | #[derive(Copy, Clone, Eq, PartialEq)] | 5854 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 1724 | pub struct DierBasic(pub u32); | 5855 | pub struct DierGp(pub u32); |
| 1725 | impl DierBasic { | 5856 | impl DierGp { |
| 1726 | #[doc = "Update interrupt enable"] | 5857 | #[doc = "Update interrupt enable"] |
| 1727 | pub const fn uie(&self) -> bool { | 5858 | pub const fn uie(&self) -> bool { |
| 1728 | let val = (self.0 >> 0usize) & 0x01; | 5859 | let val = (self.0 >> 0usize) & 0x01; |
| @@ -1732,6 +5863,28 @@ pub mod timer_v1 { | |||
| 1732 | pub fn set_uie(&mut self, val: bool) { | 5863 | pub fn set_uie(&mut self, val: bool) { |
| 1733 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 5864 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 1734 | } | 5865 | } |
| 5866 | #[doc = "Capture/Compare 1 interrupt enable"] | ||
| 5867 | pub fn ccie(&self, n: usize) -> bool { | ||
| 5868 | assert!(n < 4usize); | ||
| 5869 | let offs = 1usize + n * 1usize; | ||
| 5870 | let val = (self.0 >> offs) & 0x01; | ||
| 5871 | val != 0 | ||
| 5872 | } | ||
| 5873 | #[doc = "Capture/Compare 1 interrupt enable"] | ||
| 5874 | pub fn set_ccie(&mut self, n: usize, val: bool) { | ||
| 5875 | assert!(n < 4usize); | ||
| 5876 | let offs = 1usize + n * 1usize; | ||
| 5877 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 5878 | } | ||
| 5879 | #[doc = "Trigger interrupt enable"] | ||
| 5880 | pub const fn tie(&self) -> bool { | ||
| 5881 | let val = (self.0 >> 6usize) & 0x01; | ||
| 5882 | val != 0 | ||
| 5883 | } | ||
| 5884 | #[doc = "Trigger interrupt enable"] | ||
| 5885 | pub fn set_tie(&mut self, val: bool) { | ||
| 5886 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 5887 | } | ||
| 1735 | #[doc = "Update DMA request enable"] | 5888 | #[doc = "Update DMA request enable"] |
| 1736 | pub const fn ude(&self) -> bool { | 5889 | pub const fn ude(&self) -> bool { |
| 1737 | let val = (self.0 >> 8usize) & 0x01; | 5890 | let val = (self.0 >> 8usize) & 0x01; |
| @@ -1741,10 +5894,108 @@ pub mod timer_v1 { | |||
| 1741 | pub fn set_ude(&mut self, val: bool) { | 5894 | pub fn set_ude(&mut self, val: bool) { |
| 1742 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 5895 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 1743 | } | 5896 | } |
| 5897 | #[doc = "Capture/Compare 1 DMA request enable"] | ||
| 5898 | pub fn ccde(&self, n: usize) -> bool { | ||
| 5899 | assert!(n < 4usize); | ||
| 5900 | let offs = 9usize + n * 1usize; | ||
| 5901 | let val = (self.0 >> offs) & 0x01; | ||
| 5902 | val != 0 | ||
| 5903 | } | ||
| 5904 | #[doc = "Capture/Compare 1 DMA request enable"] | ||
| 5905 | pub fn set_ccde(&mut self, n: usize, val: bool) { | ||
| 5906 | assert!(n < 4usize); | ||
| 5907 | let offs = 9usize + n * 1usize; | ||
| 5908 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 5909 | } | ||
| 5910 | #[doc = "Trigger DMA request enable"] | ||
| 5911 | pub const fn tde(&self) -> bool { | ||
| 5912 | let val = (self.0 >> 14usize) & 0x01; | ||
| 5913 | val != 0 | ||
| 5914 | } | ||
| 5915 | #[doc = "Trigger DMA request enable"] | ||
| 5916 | pub fn set_tde(&mut self, val: bool) { | ||
| 5917 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | ||
| 5918 | } | ||
| 1744 | } | 5919 | } |
| 1745 | impl Default for DierBasic { | 5920 | impl Default for DierGp { |
| 1746 | fn default() -> DierBasic { | 5921 | fn default() -> DierGp { |
| 1747 | DierBasic(0) | 5922 | DierGp(0) |
| 5923 | } | ||
| 5924 | } | ||
| 5925 | #[doc = "capture/compare mode register 2 (output mode)"] | ||
| 5926 | #[repr(transparent)] | ||
| 5927 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5928 | pub struct CcmrOutput(pub u32); | ||
| 5929 | impl CcmrOutput { | ||
| 5930 | #[doc = "Capture/Compare 3 selection"] | ||
| 5931 | pub fn ccs(&self, n: usize) -> super::vals::CcmrOutputCcs { | ||
| 5932 | assert!(n < 2usize); | ||
| 5933 | let offs = 0usize + n * 8usize; | ||
| 5934 | let val = (self.0 >> offs) & 0x03; | ||
| 5935 | super::vals::CcmrOutputCcs(val as u8) | ||
| 5936 | } | ||
| 5937 | #[doc = "Capture/Compare 3 selection"] | ||
| 5938 | pub fn set_ccs(&mut self, n: usize, val: super::vals::CcmrOutputCcs) { | ||
| 5939 | assert!(n < 2usize); | ||
| 5940 | let offs = 0usize + n * 8usize; | ||
| 5941 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | ||
| 5942 | } | ||
| 5943 | #[doc = "Output compare 3 fast enable"] | ||
| 5944 | pub fn ocfe(&self, n: usize) -> bool { | ||
| 5945 | assert!(n < 2usize); | ||
| 5946 | let offs = 2usize + n * 8usize; | ||
| 5947 | let val = (self.0 >> offs) & 0x01; | ||
| 5948 | val != 0 | ||
| 5949 | } | ||
| 5950 | #[doc = "Output compare 3 fast enable"] | ||
| 5951 | pub fn set_ocfe(&mut self, n: usize, val: bool) { | ||
| 5952 | assert!(n < 2usize); | ||
| 5953 | let offs = 2usize + n * 8usize; | ||
| 5954 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 5955 | } | ||
| 5956 | #[doc = "Output compare 3 preload enable"] | ||
| 5957 | pub fn ocpe(&self, n: usize) -> super::vals::Ocpe { | ||
| 5958 | assert!(n < 2usize); | ||
| 5959 | let offs = 3usize + n * 8usize; | ||
| 5960 | let val = (self.0 >> offs) & 0x01; | ||
| 5961 | super::vals::Ocpe(val as u8) | ||
| 5962 | } | ||
| 5963 | #[doc = "Output compare 3 preload enable"] | ||
| 5964 | pub fn set_ocpe(&mut self, n: usize, val: super::vals::Ocpe) { | ||
| 5965 | assert!(n < 2usize); | ||
| 5966 | let offs = 3usize + n * 8usize; | ||
| 5967 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 5968 | } | ||
| 5969 | #[doc = "Output compare 3 mode"] | ||
| 5970 | pub fn ocm(&self, n: usize) -> super::vals::Ocm { | ||
| 5971 | assert!(n < 2usize); | ||
| 5972 | let offs = 4usize + n * 8usize; | ||
| 5973 | let val = (self.0 >> offs) & 0x07; | ||
| 5974 | super::vals::Ocm(val as u8) | ||
| 5975 | } | ||
| 5976 | #[doc = "Output compare 3 mode"] | ||
| 5977 | pub fn set_ocm(&mut self, n: usize, val: super::vals::Ocm) { | ||
| 5978 | assert!(n < 2usize); | ||
| 5979 | let offs = 4usize + n * 8usize; | ||
| 5980 | self.0 = (self.0 & !(0x07 << offs)) | (((val.0 as u32) & 0x07) << offs); | ||
| 5981 | } | ||
| 5982 | #[doc = "Output compare 3 clear enable"] | ||
| 5983 | pub fn occe(&self, n: usize) -> bool { | ||
| 5984 | assert!(n < 2usize); | ||
| 5985 | let offs = 7usize + n * 8usize; | ||
| 5986 | let val = (self.0 >> offs) & 0x01; | ||
| 5987 | val != 0 | ||
| 5988 | } | ||
| 5989 | #[doc = "Output compare 3 clear enable"] | ||
| 5990 | pub fn set_occe(&mut self, n: usize, val: bool) { | ||
| 5991 | assert!(n < 2usize); | ||
| 5992 | let offs = 7usize + n * 8usize; | ||
| 5993 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 5994 | } | ||
| 5995 | } | ||
| 5996 | impl Default for CcmrOutput { | ||
| 5997 | fn default() -> CcmrOutput { | ||
| 5998 | CcmrOutput(0) | ||
| 1748 | } | 5999 | } |
| 1749 | } | 6000 | } |
| 1750 | #[doc = "DMA control register"] | 6001 | #[doc = "DMA control register"] |
| @@ -1779,27 +6030,6 @@ pub mod timer_v1 { | |||
| 1779 | #[doc = "capture/compare register 1"] | 6030 | #[doc = "capture/compare register 1"] |
| 1780 | #[repr(transparent)] | 6031 | #[repr(transparent)] |
| 1781 | #[derive(Copy, Clone, Eq, PartialEq)] | 6032 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 1782 | pub struct Ccr32(pub u32); | ||
| 1783 | impl Ccr32 { | ||
| 1784 | #[doc = "Capture/Compare 1 value"] | ||
| 1785 | pub const fn ccr(&self) -> u32 { | ||
| 1786 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 1787 | val as u32 | ||
| 1788 | } | ||
| 1789 | #[doc = "Capture/Compare 1 value"] | ||
| 1790 | pub fn set_ccr(&mut self, val: u32) { | ||
| 1791 | self.0 = | ||
| 1792 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 1793 | } | ||
| 1794 | } | ||
| 1795 | impl Default for Ccr32 { | ||
| 1796 | fn default() -> Ccr32 { | ||
| 1797 | Ccr32(0) | ||
| 1798 | } | ||
| 1799 | } | ||
| 1800 | #[doc = "capture/compare register 1"] | ||
| 1801 | #[repr(transparent)] | ||
| 1802 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1803 | pub struct Ccr16(pub u32); | 6033 | pub struct Ccr16(pub u32); |
| 1804 | impl Ccr16 { | 6034 | impl Ccr16 { |
| 1805 | #[doc = "Capture/Compare 1 value"] | 6035 | #[doc = "Capture/Compare 1 value"] |
| @@ -1817,140 +6047,6 @@ pub mod timer_v1 { | |||
| 1817 | Ccr16(0) | 6047 | Ccr16(0) |
| 1818 | } | 6048 | } |
| 1819 | } | 6049 | } |
| 1820 | #[doc = "counter"] | ||
| 1821 | #[repr(transparent)] | ||
| 1822 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1823 | pub struct Cnt32(pub u32); | ||
| 1824 | impl Cnt32 { | ||
| 1825 | #[doc = "counter value"] | ||
| 1826 | pub const fn cnt(&self) -> u32 { | ||
| 1827 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 1828 | val as u32 | ||
| 1829 | } | ||
| 1830 | #[doc = "counter value"] | ||
| 1831 | pub fn set_cnt(&mut self, val: u32) { | ||
| 1832 | self.0 = | ||
| 1833 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 1834 | } | ||
| 1835 | } | ||
| 1836 | impl Default for Cnt32 { | ||
| 1837 | fn default() -> Cnt32 { | ||
| 1838 | Cnt32(0) | ||
| 1839 | } | ||
| 1840 | } | ||
| 1841 | #[doc = "auto-reload register"] | ||
| 1842 | #[repr(transparent)] | ||
| 1843 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1844 | pub struct Arr16(pub u32); | ||
| 1845 | impl Arr16 { | ||
| 1846 | #[doc = "Auto-reload value"] | ||
| 1847 | pub const fn arr(&self) -> u16 { | ||
| 1848 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 1849 | val as u16 | ||
| 1850 | } | ||
| 1851 | #[doc = "Auto-reload value"] | ||
| 1852 | pub fn set_arr(&mut self, val: u16) { | ||
| 1853 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 1854 | } | ||
| 1855 | } | ||
| 1856 | impl Default for Arr16 { | ||
| 1857 | fn default() -> Arr16 { | ||
| 1858 | Arr16(0) | ||
| 1859 | } | ||
| 1860 | } | ||
| 1861 | #[doc = "repetition counter register"] | ||
| 1862 | #[repr(transparent)] | ||
| 1863 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1864 | pub struct Rcr(pub u32); | ||
| 1865 | impl Rcr { | ||
| 1866 | #[doc = "Repetition counter value"] | ||
| 1867 | pub const fn rep(&self) -> u8 { | ||
| 1868 | let val = (self.0 >> 0usize) & 0xff; | ||
| 1869 | val as u8 | ||
| 1870 | } | ||
| 1871 | #[doc = "Repetition counter value"] | ||
| 1872 | pub fn set_rep(&mut self, val: u8) { | ||
| 1873 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | ||
| 1874 | } | ||
| 1875 | } | ||
| 1876 | impl Default for Rcr { | ||
| 1877 | fn default() -> Rcr { | ||
| 1878 | Rcr(0) | ||
| 1879 | } | ||
| 1880 | } | ||
| 1881 | #[doc = "status register"] | ||
| 1882 | #[repr(transparent)] | ||
| 1883 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 1884 | pub struct SrGp(pub u32); | ||
| 1885 | impl SrGp { | ||
| 1886 | #[doc = "Update interrupt flag"] | ||
| 1887 | pub const fn uif(&self) -> bool { | ||
| 1888 | let val = (self.0 >> 0usize) & 0x01; | ||
| 1889 | val != 0 | ||
| 1890 | } | ||
| 1891 | #[doc = "Update interrupt flag"] | ||
| 1892 | pub fn set_uif(&mut self, val: bool) { | ||
| 1893 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 1894 | } | ||
| 1895 | #[doc = "Capture/compare 1 interrupt flag"] | ||
| 1896 | pub fn ccif(&self, n: usize) -> bool { | ||
| 1897 | assert!(n < 4usize); | ||
| 1898 | let offs = 1usize + n * 1usize; | ||
| 1899 | let val = (self.0 >> offs) & 0x01; | ||
| 1900 | val != 0 | ||
| 1901 | } | ||
| 1902 | #[doc = "Capture/compare 1 interrupt flag"] | ||
| 1903 | pub fn set_ccif(&mut self, n: usize, val: bool) { | ||
| 1904 | assert!(n < 4usize); | ||
| 1905 | let offs = 1usize + n * 1usize; | ||
| 1906 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 1907 | } | ||
| 1908 | #[doc = "COM interrupt flag"] | ||
| 1909 | pub const fn comif(&self) -> bool { | ||
| 1910 | let val = (self.0 >> 5usize) & 0x01; | ||
| 1911 | val != 0 | ||
| 1912 | } | ||
| 1913 | #[doc = "COM interrupt flag"] | ||
| 1914 | pub fn set_comif(&mut self, val: bool) { | ||
| 1915 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 1916 | } | ||
| 1917 | #[doc = "Trigger interrupt flag"] | ||
| 1918 | pub const fn tif(&self) -> bool { | ||
| 1919 | let val = (self.0 >> 6usize) & 0x01; | ||
| 1920 | val != 0 | ||
| 1921 | } | ||
| 1922 | #[doc = "Trigger interrupt flag"] | ||
| 1923 | pub fn set_tif(&mut self, val: bool) { | ||
| 1924 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 1925 | } | ||
| 1926 | #[doc = "Break interrupt flag"] | ||
| 1927 | pub const fn bif(&self) -> bool { | ||
| 1928 | let val = (self.0 >> 7usize) & 0x01; | ||
| 1929 | val != 0 | ||
| 1930 | } | ||
| 1931 | #[doc = "Break interrupt flag"] | ||
| 1932 | pub fn set_bif(&mut self, val: bool) { | ||
| 1933 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 1934 | } | ||
| 1935 | #[doc = "Capture/Compare 1 overcapture flag"] | ||
| 1936 | pub fn ccof(&self, n: usize) -> bool { | ||
| 1937 | assert!(n < 4usize); | ||
| 1938 | let offs = 9usize + n * 1usize; | ||
| 1939 | let val = (self.0 >> offs) & 0x01; | ||
| 1940 | val != 0 | ||
| 1941 | } | ||
| 1942 | #[doc = "Capture/Compare 1 overcapture flag"] | ||
| 1943 | pub fn set_ccof(&mut self, n: usize, val: bool) { | ||
| 1944 | assert!(n < 4usize); | ||
| 1945 | let offs = 9usize + n * 1usize; | ||
| 1946 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 1947 | } | ||
| 1948 | } | ||
| 1949 | impl Default for SrGp { | ||
| 1950 | fn default() -> SrGp { | ||
| 1951 | SrGp(0) | ||
| 1952 | } | ||
| 1953 | } | ||
| 1954 | #[doc = "break and dead-time register"] | 6050 | #[doc = "break and dead-time register"] |
| 1955 | #[repr(transparent)] | 6051 | #[repr(transparent)] |
| 1956 | #[derive(Copy, Clone, Eq, PartialEq)] | 6052 | #[derive(Copy, Clone, Eq, PartialEq)] |
| @@ -2034,64 +6130,53 @@ pub mod timer_v1 { | |||
| 2034 | Bdtr(0) | 6130 | Bdtr(0) |
| 2035 | } | 6131 | } |
| 2036 | } | 6132 | } |
| 2037 | #[doc = "event generation register"] | 6133 | #[doc = "status register"] |
| 2038 | #[repr(transparent)] | 6134 | #[repr(transparent)] |
| 2039 | #[derive(Copy, Clone, Eq, PartialEq)] | 6135 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 2040 | pub struct EgrAdv(pub u32); | 6136 | pub struct SrBasic(pub u32); |
| 2041 | impl EgrAdv { | 6137 | impl SrBasic { |
| 2042 | #[doc = "Update generation"] | 6138 | #[doc = "Update interrupt flag"] |
| 2043 | pub const fn ug(&self) -> bool { | 6139 | pub const fn uif(&self) -> bool { |
| 2044 | let val = (self.0 >> 0usize) & 0x01; | 6140 | let val = (self.0 >> 0usize) & 0x01; |
| 2045 | val != 0 | 6141 | val != 0 |
| 2046 | } | 6142 | } |
| 2047 | #[doc = "Update generation"] | 6143 | #[doc = "Update interrupt flag"] |
| 2048 | pub fn set_ug(&mut self, val: bool) { | 6144 | pub fn set_uif(&mut self, val: bool) { |
| 2049 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 6145 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 2050 | } | 6146 | } |
| 2051 | #[doc = "Capture/compare 1 generation"] | 6147 | } |
| 2052 | pub fn ccg(&self, n: usize) -> bool { | 6148 | impl Default for SrBasic { |
| 2053 | assert!(n < 4usize); | 6149 | fn default() -> SrBasic { |
| 2054 | let offs = 1usize + n * 1usize; | 6150 | SrBasic(0) |
| 2055 | let val = (self.0 >> offs) & 0x01; | ||
| 2056 | val != 0 | ||
| 2057 | } | ||
| 2058 | #[doc = "Capture/compare 1 generation"] | ||
| 2059 | pub fn set_ccg(&mut self, n: usize, val: bool) { | ||
| 2060 | assert!(n < 4usize); | ||
| 2061 | let offs = 1usize + n * 1usize; | ||
| 2062 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 2063 | } | ||
| 2064 | #[doc = "Capture/Compare control update generation"] | ||
| 2065 | pub const fn comg(&self) -> bool { | ||
| 2066 | let val = (self.0 >> 5usize) & 0x01; | ||
| 2067 | val != 0 | ||
| 2068 | } | ||
| 2069 | #[doc = "Capture/Compare control update generation"] | ||
| 2070 | pub fn set_comg(&mut self, val: bool) { | ||
| 2071 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 2072 | } | 6151 | } |
| 2073 | #[doc = "Trigger generation"] | 6152 | } |
| 2074 | pub const fn tg(&self) -> bool { | 6153 | #[doc = "DMA/Interrupt enable register"] |
| 2075 | let val = (self.0 >> 6usize) & 0x01; | 6154 | #[repr(transparent)] |
| 6155 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6156 | pub struct DierBasic(pub u32); | ||
| 6157 | impl DierBasic { | ||
| 6158 | #[doc = "Update interrupt enable"] | ||
| 6159 | pub const fn uie(&self) -> bool { | ||
| 6160 | let val = (self.0 >> 0usize) & 0x01; | ||
| 2076 | val != 0 | 6161 | val != 0 |
| 2077 | } | 6162 | } |
| 2078 | #[doc = "Trigger generation"] | 6163 | #[doc = "Update interrupt enable"] |
| 2079 | pub fn set_tg(&mut self, val: bool) { | 6164 | pub fn set_uie(&mut self, val: bool) { |
| 2080 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 6165 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 2081 | } | 6166 | } |
| 2082 | #[doc = "Break generation"] | 6167 | #[doc = "Update DMA request enable"] |
| 2083 | pub const fn bg(&self) -> bool { | 6168 | pub const fn ude(&self) -> bool { |
| 2084 | let val = (self.0 >> 7usize) & 0x01; | 6169 | let val = (self.0 >> 8usize) & 0x01; |
| 2085 | val != 0 | 6170 | val != 0 |
| 2086 | } | 6171 | } |
| 2087 | #[doc = "Break generation"] | 6172 | #[doc = "Update DMA request enable"] |
| 2088 | pub fn set_bg(&mut self, val: bool) { | 6173 | pub fn set_ude(&mut self, val: bool) { |
| 2089 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 6174 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 2090 | } | 6175 | } |
| 2091 | } | 6176 | } |
| 2092 | impl Default for EgrAdv { | 6177 | impl Default for DierBasic { |
| 2093 | fn default() -> EgrAdv { | 6178 | fn default() -> DierBasic { |
| 2094 | EgrAdv(0) | 6179 | DierBasic(0) |
| 2095 | } | 6180 | } |
| 2096 | } | 6181 | } |
| 2097 | #[doc = "control register 1"] | 6182 | #[doc = "control register 1"] |
| @@ -2177,6 +6262,141 @@ pub mod timer_v1 { | |||
| 2177 | Cr1Gp(0) | 6262 | Cr1Gp(0) |
| 2178 | } | 6263 | } |
| 2179 | } | 6264 | } |
| 6265 | #[doc = "prescaler"] | ||
| 6266 | #[repr(transparent)] | ||
| 6267 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6268 | pub struct Psc(pub u32); | ||
| 6269 | impl Psc { | ||
| 6270 | #[doc = "Prescaler value"] | ||
| 6271 | pub const fn psc(&self) -> u16 { | ||
| 6272 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 6273 | val as u16 | ||
| 6274 | } | ||
| 6275 | #[doc = "Prescaler value"] | ||
| 6276 | pub fn set_psc(&mut self, val: u16) { | ||
| 6277 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 6278 | } | ||
| 6279 | } | ||
| 6280 | impl Default for Psc { | ||
| 6281 | fn default() -> Psc { | ||
| 6282 | Psc(0) | ||
| 6283 | } | ||
| 6284 | } | ||
| 6285 | #[doc = "counter"] | ||
| 6286 | #[repr(transparent)] | ||
| 6287 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6288 | pub struct Cnt32(pub u32); | ||
| 6289 | impl Cnt32 { | ||
| 6290 | #[doc = "counter value"] | ||
| 6291 | pub const fn cnt(&self) -> u32 { | ||
| 6292 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 6293 | val as u32 | ||
| 6294 | } | ||
| 6295 | #[doc = "counter value"] | ||
| 6296 | pub fn set_cnt(&mut self, val: u32) { | ||
| 6297 | self.0 = | ||
| 6298 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 6299 | } | ||
| 6300 | } | ||
| 6301 | impl Default for Cnt32 { | ||
| 6302 | fn default() -> Cnt32 { | ||
| 6303 | Cnt32(0) | ||
| 6304 | } | ||
| 6305 | } | ||
| 6306 | #[doc = "capture/compare register 1"] | ||
| 6307 | #[repr(transparent)] | ||
| 6308 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6309 | pub struct Ccr32(pub u32); | ||
| 6310 | impl Ccr32 { | ||
| 6311 | #[doc = "Capture/Compare 1 value"] | ||
| 6312 | pub const fn ccr(&self) -> u32 { | ||
| 6313 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 6314 | val as u32 | ||
| 6315 | } | ||
| 6316 | #[doc = "Capture/Compare 1 value"] | ||
| 6317 | pub fn set_ccr(&mut self, val: u32) { | ||
| 6318 | self.0 = | ||
| 6319 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 6320 | } | ||
| 6321 | } | ||
| 6322 | impl Default for Ccr32 { | ||
| 6323 | fn default() -> Ccr32 { | ||
| 6324 | Ccr32(0) | ||
| 6325 | } | ||
| 6326 | } | ||
| 6327 | #[doc = "status register"] | ||
| 6328 | #[repr(transparent)] | ||
| 6329 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6330 | pub struct SrAdv(pub u32); | ||
| 6331 | impl SrAdv { | ||
| 6332 | #[doc = "Update interrupt flag"] | ||
| 6333 | pub const fn uif(&self) -> bool { | ||
| 6334 | let val = (self.0 >> 0usize) & 0x01; | ||
| 6335 | val != 0 | ||
| 6336 | } | ||
| 6337 | #[doc = "Update interrupt flag"] | ||
| 6338 | pub fn set_uif(&mut self, val: bool) { | ||
| 6339 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 6340 | } | ||
| 6341 | #[doc = "Capture/compare 1 interrupt flag"] | ||
| 6342 | pub fn ccif(&self, n: usize) -> bool { | ||
| 6343 | assert!(n < 4usize); | ||
| 6344 | let offs = 1usize + n * 1usize; | ||
| 6345 | let val = (self.0 >> offs) & 0x01; | ||
| 6346 | val != 0 | ||
| 6347 | } | ||
| 6348 | #[doc = "Capture/compare 1 interrupt flag"] | ||
| 6349 | pub fn set_ccif(&mut self, n: usize, val: bool) { | ||
| 6350 | assert!(n < 4usize); | ||
| 6351 | let offs = 1usize + n * 1usize; | ||
| 6352 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 6353 | } | ||
| 6354 | #[doc = "COM interrupt flag"] | ||
| 6355 | pub const fn comif(&self) -> bool { | ||
| 6356 | let val = (self.0 >> 5usize) & 0x01; | ||
| 6357 | val != 0 | ||
| 6358 | } | ||
| 6359 | #[doc = "COM interrupt flag"] | ||
| 6360 | pub fn set_comif(&mut self, val: bool) { | ||
| 6361 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 6362 | } | ||
| 6363 | #[doc = "Trigger interrupt flag"] | ||
| 6364 | pub const fn tif(&self) -> bool { | ||
| 6365 | let val = (self.0 >> 6usize) & 0x01; | ||
| 6366 | val != 0 | ||
| 6367 | } | ||
| 6368 | #[doc = "Trigger interrupt flag"] | ||
| 6369 | pub fn set_tif(&mut self, val: bool) { | ||
| 6370 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 6371 | } | ||
| 6372 | #[doc = "Break interrupt flag"] | ||
| 6373 | pub const fn bif(&self) -> bool { | ||
| 6374 | let val = (self.0 >> 7usize) & 0x01; | ||
| 6375 | val != 0 | ||
| 6376 | } | ||
| 6377 | #[doc = "Break interrupt flag"] | ||
| 6378 | pub fn set_bif(&mut self, val: bool) { | ||
| 6379 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 6380 | } | ||
| 6381 | #[doc = "Capture/Compare 1 overcapture flag"] | ||
| 6382 | pub fn ccof(&self, n: usize) -> bool { | ||
| 6383 | assert!(n < 4usize); | ||
| 6384 | let offs = 9usize + n * 1usize; | ||
| 6385 | let val = (self.0 >> offs) & 0x01; | ||
| 6386 | val != 0 | ||
| 6387 | } | ||
| 6388 | #[doc = "Capture/Compare 1 overcapture flag"] | ||
| 6389 | pub fn set_ccof(&mut self, n: usize, val: bool) { | ||
| 6390 | assert!(n < 4usize); | ||
| 6391 | let offs = 9usize + n * 1usize; | ||
| 6392 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 6393 | } | ||
| 6394 | } | ||
| 6395 | impl Default for SrAdv { | ||
| 6396 | fn default() -> SrAdv { | ||
| 6397 | SrAdv(0) | ||
| 6398 | } | ||
| 6399 | } | ||
| 2180 | #[doc = "capture/compare enable register"] | 6400 | #[doc = "capture/compare enable register"] |
| 2181 | #[repr(transparent)] | 6401 | #[repr(transparent)] |
| 2182 | #[derive(Copy, Clone, Eq, PartialEq)] | 6402 | #[derive(Copy, Clone, Eq, PartialEq)] |
| @@ -2240,98 +6460,85 @@ pub mod timer_v1 { | |||
| 2240 | CcerAdv(0) | 6460 | CcerAdv(0) |
| 2241 | } | 6461 | } |
| 2242 | } | 6462 | } |
| 2243 | #[doc = "slave mode control register"] | 6463 | #[doc = "event generation register"] |
| 2244 | #[repr(transparent)] | 6464 | #[repr(transparent)] |
| 2245 | #[derive(Copy, Clone, Eq, PartialEq)] | 6465 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 2246 | pub struct Smcr(pub u32); | 6466 | pub struct EgrAdv(pub u32); |
| 2247 | impl Smcr { | 6467 | impl EgrAdv { |
| 2248 | #[doc = "Slave mode selection"] | 6468 | #[doc = "Update generation"] |
| 2249 | pub const fn sms(&self) -> super::vals::Sms { | 6469 | pub const fn ug(&self) -> bool { |
| 2250 | let val = (self.0 >> 0usize) & 0x07; | 6470 | let val = (self.0 >> 0usize) & 0x01; |
| 2251 | super::vals::Sms(val as u8) | 6471 | val != 0 |
| 2252 | } | ||
| 2253 | #[doc = "Slave mode selection"] | ||
| 2254 | pub fn set_sms(&mut self, val: super::vals::Sms) { | ||
| 2255 | self.0 = (self.0 & !(0x07 << 0usize)) | (((val.0 as u32) & 0x07) << 0usize); | ||
| 2256 | } | ||
| 2257 | #[doc = "Trigger selection"] | ||
| 2258 | pub const fn ts(&self) -> super::vals::Ts { | ||
| 2259 | let val = (self.0 >> 4usize) & 0x07; | ||
| 2260 | super::vals::Ts(val as u8) | ||
| 2261 | } | ||
| 2262 | #[doc = "Trigger selection"] | ||
| 2263 | pub fn set_ts(&mut self, val: super::vals::Ts) { | ||
| 2264 | self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize); | ||
| 2265 | } | ||
| 2266 | #[doc = "Master/Slave mode"] | ||
| 2267 | pub const fn msm(&self) -> super::vals::Msm { | ||
| 2268 | let val = (self.0 >> 7usize) & 0x01; | ||
| 2269 | super::vals::Msm(val as u8) | ||
| 2270 | } | 6472 | } |
| 2271 | #[doc = "Master/Slave mode"] | 6473 | #[doc = "Update generation"] |
| 2272 | pub fn set_msm(&mut self, val: super::vals::Msm) { | 6474 | pub fn set_ug(&mut self, val: bool) { |
| 2273 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | 6475 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 2274 | } | 6476 | } |
| 2275 | #[doc = "External trigger filter"] | 6477 | #[doc = "Capture/compare 1 generation"] |
| 2276 | pub const fn etf(&self) -> super::vals::Etf { | 6478 | pub fn ccg(&self, n: usize) -> bool { |
| 2277 | let val = (self.0 >> 8usize) & 0x0f; | 6479 | assert!(n < 4usize); |
| 2278 | super::vals::Etf(val as u8) | 6480 | let offs = 1usize + n * 1usize; |
| 6481 | let val = (self.0 >> offs) & 0x01; | ||
| 6482 | val != 0 | ||
| 2279 | } | 6483 | } |
| 2280 | #[doc = "External trigger filter"] | 6484 | #[doc = "Capture/compare 1 generation"] |
| 2281 | pub fn set_etf(&mut self, val: super::vals::Etf) { | 6485 | pub fn set_ccg(&mut self, n: usize, val: bool) { |
| 2282 | self.0 = (self.0 & !(0x0f << 8usize)) | (((val.0 as u32) & 0x0f) << 8usize); | 6486 | assert!(n < 4usize); |
| 6487 | let offs = 1usize + n * 1usize; | ||
| 6488 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 2283 | } | 6489 | } |
| 2284 | #[doc = "External trigger prescaler"] | 6490 | #[doc = "Capture/Compare control update generation"] |
| 2285 | pub const fn etps(&self) -> super::vals::Etps { | 6491 | pub const fn comg(&self) -> bool { |
| 2286 | let val = (self.0 >> 12usize) & 0x03; | 6492 | let val = (self.0 >> 5usize) & 0x01; |
| 2287 | super::vals::Etps(val as u8) | 6493 | val != 0 |
| 2288 | } | 6494 | } |
| 2289 | #[doc = "External trigger prescaler"] | 6495 | #[doc = "Capture/Compare control update generation"] |
| 2290 | pub fn set_etps(&mut self, val: super::vals::Etps) { | 6496 | pub fn set_comg(&mut self, val: bool) { |
| 2291 | self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize); | 6497 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 2292 | } | 6498 | } |
| 2293 | #[doc = "External clock enable"] | 6499 | #[doc = "Trigger generation"] |
| 2294 | pub const fn ece(&self) -> super::vals::Ece { | 6500 | pub const fn tg(&self) -> bool { |
| 2295 | let val = (self.0 >> 14usize) & 0x01; | 6501 | let val = (self.0 >> 6usize) & 0x01; |
| 2296 | super::vals::Ece(val as u8) | 6502 | val != 0 |
| 2297 | } | 6503 | } |
| 2298 | #[doc = "External clock enable"] | 6504 | #[doc = "Trigger generation"] |
| 2299 | pub fn set_ece(&mut self, val: super::vals::Ece) { | 6505 | pub fn set_tg(&mut self, val: bool) { |
| 2300 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | 6506 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 2301 | } | 6507 | } |
| 2302 | #[doc = "External trigger polarity"] | 6508 | #[doc = "Break generation"] |
| 2303 | pub const fn etp(&self) -> super::vals::Etp { | 6509 | pub const fn bg(&self) -> bool { |
| 2304 | let val = (self.0 >> 15usize) & 0x01; | 6510 | let val = (self.0 >> 7usize) & 0x01; |
| 2305 | super::vals::Etp(val as u8) | 6511 | val != 0 |
| 2306 | } | 6512 | } |
| 2307 | #[doc = "External trigger polarity"] | 6513 | #[doc = "Break generation"] |
| 2308 | pub fn set_etp(&mut self, val: super::vals::Etp) { | 6514 | pub fn set_bg(&mut self, val: bool) { |
| 2309 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | 6515 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 2310 | } | 6516 | } |
| 2311 | } | 6517 | } |
| 2312 | impl Default for Smcr { | 6518 | impl Default for EgrAdv { |
| 2313 | fn default() -> Smcr { | 6519 | fn default() -> EgrAdv { |
| 2314 | Smcr(0) | 6520 | EgrAdv(0) |
| 2315 | } | 6521 | } |
| 2316 | } | 6522 | } |
| 2317 | #[doc = "DMA address for full transfer"] | 6523 | #[doc = "auto-reload register"] |
| 2318 | #[repr(transparent)] | 6524 | #[repr(transparent)] |
| 2319 | #[derive(Copy, Clone, Eq, PartialEq)] | 6525 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 2320 | pub struct Dmar(pub u32); | 6526 | pub struct Arr32(pub u32); |
| 2321 | impl Dmar { | 6527 | impl Arr32 { |
| 2322 | #[doc = "DMA register for burst accesses"] | 6528 | #[doc = "Auto-reload value"] |
| 2323 | pub const fn dmab(&self) -> u16 { | 6529 | pub const fn arr(&self) -> u32 { |
| 2324 | let val = (self.0 >> 0usize) & 0xffff; | 6530 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 2325 | val as u16 | 6531 | val as u32 |
| 2326 | } | 6532 | } |
| 2327 | #[doc = "DMA register for burst accesses"] | 6533 | #[doc = "Auto-reload value"] |
| 2328 | pub fn set_dmab(&mut self, val: u16) { | 6534 | pub fn set_arr(&mut self, val: u32) { |
| 2329 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | 6535 | self.0 = |
| 6536 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 2330 | } | 6537 | } |
| 2331 | } | 6538 | } |
| 2332 | impl Default for Dmar { | 6539 | impl Default for Arr32 { |
| 2333 | fn default() -> Dmar { | 6540 | fn default() -> Arr32 { |
| 2334 | Dmar(0) | 6541 | Arr32(0) |
| 2335 | } | 6542 | } |
| 2336 | } | 6543 | } |
| 2337 | #[doc = "control register 1"] | 6544 | #[doc = "control register 1"] |
| @@ -2390,49 +6597,11 @@ pub mod timer_v1 { | |||
| 2390 | Cr1Basic(0) | 6597 | Cr1Basic(0) |
| 2391 | } | 6598 | } |
| 2392 | } | 6599 | } |
| 2393 | #[doc = "counter"] | ||
| 2394 | #[repr(transparent)] | ||
| 2395 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2396 | pub struct Cnt16(pub u32); | ||
| 2397 | impl Cnt16 { | ||
| 2398 | #[doc = "counter value"] | ||
| 2399 | pub const fn cnt(&self) -> u16 { | ||
| 2400 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 2401 | val as u16 | ||
| 2402 | } | ||
| 2403 | #[doc = "counter value"] | ||
| 2404 | pub fn set_cnt(&mut self, val: u16) { | ||
| 2405 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 2406 | } | ||
| 2407 | } | ||
| 2408 | impl Default for Cnt16 { | ||
| 2409 | fn default() -> Cnt16 { | ||
| 2410 | Cnt16(0) | ||
| 2411 | } | ||
| 2412 | } | ||
| 2413 | #[doc = "control register 2"] | 6600 | #[doc = "control register 2"] |
| 2414 | #[repr(transparent)] | 6601 | #[repr(transparent)] |
| 2415 | #[derive(Copy, Clone, Eq, PartialEq)] | 6602 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 2416 | pub struct Cr2Adv(pub u32); | 6603 | pub struct Cr2Gp(pub u32); |
| 2417 | impl Cr2Adv { | 6604 | impl Cr2Gp { |
| 2418 | #[doc = "Capture/compare preloaded control"] | ||
| 2419 | pub const fn ccpc(&self) -> bool { | ||
| 2420 | let val = (self.0 >> 0usize) & 0x01; | ||
| 2421 | val != 0 | ||
| 2422 | } | ||
| 2423 | #[doc = "Capture/compare preloaded control"] | ||
| 2424 | pub fn set_ccpc(&mut self, val: bool) { | ||
| 2425 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 2426 | } | ||
| 2427 | #[doc = "Capture/compare control update selection"] | ||
| 2428 | pub const fn ccus(&self) -> bool { | ||
| 2429 | let val = (self.0 >> 2usize) & 0x01; | ||
| 2430 | val != 0 | ||
| 2431 | } | ||
| 2432 | #[doc = "Capture/compare control update selection"] | ||
| 2433 | pub fn set_ccus(&mut self, val: bool) { | ||
| 2434 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 2435 | } | ||
| 2436 | #[doc = "Capture/compare DMA selection"] | 6605 | #[doc = "Capture/compare DMA selection"] |
| 2437 | pub const fn ccds(&self) -> super::vals::Ccds { | 6606 | pub const fn ccds(&self) -> super::vals::Ccds { |
| 2438 | let val = (self.0 >> 3usize) & 0x01; | 6607 | let val = (self.0 >> 3usize) & 0x01; |
| @@ -2460,530 +6629,88 @@ pub mod timer_v1 { | |||
| 2460 | pub fn set_ti1s(&mut self, val: super::vals::Tis) { | 6629 | pub fn set_ti1s(&mut self, val: super::vals::Tis) { |
| 2461 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | 6630 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); |
| 2462 | } | 6631 | } |
| 2463 | #[doc = "Output Idle state 1"] | ||
| 2464 | pub fn ois(&self, n: usize) -> bool { | ||
| 2465 | assert!(n < 4usize); | ||
| 2466 | let offs = 8usize + n * 2usize; | ||
| 2467 | let val = (self.0 >> offs) & 0x01; | ||
| 2468 | val != 0 | ||
| 2469 | } | ||
| 2470 | #[doc = "Output Idle state 1"] | ||
| 2471 | pub fn set_ois(&mut self, n: usize, val: bool) { | ||
| 2472 | assert!(n < 4usize); | ||
| 2473 | let offs = 8usize + n * 2usize; | ||
| 2474 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 2475 | } | ||
| 2476 | #[doc = "Output Idle state 1"] | ||
| 2477 | pub const fn ois1n(&self) -> bool { | ||
| 2478 | let val = (self.0 >> 9usize) & 0x01; | ||
| 2479 | val != 0 | ||
| 2480 | } | ||
| 2481 | #[doc = "Output Idle state 1"] | ||
| 2482 | pub fn set_ois1n(&mut self, val: bool) { | ||
| 2483 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | ||
| 2484 | } | ||
| 2485 | #[doc = "Output Idle state 2"] | ||
| 2486 | pub const fn ois2n(&self) -> bool { | ||
| 2487 | let val = (self.0 >> 11usize) & 0x01; | ||
| 2488 | val != 0 | ||
| 2489 | } | ||
| 2490 | #[doc = "Output Idle state 2"] | ||
| 2491 | pub fn set_ois2n(&mut self, val: bool) { | ||
| 2492 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); | ||
| 2493 | } | ||
| 2494 | #[doc = "Output Idle state 3"] | ||
| 2495 | pub const fn ois3n(&self) -> bool { | ||
| 2496 | let val = (self.0 >> 13usize) & 0x01; | ||
| 2497 | val != 0 | ||
| 2498 | } | ||
| 2499 | #[doc = "Output Idle state 3"] | ||
| 2500 | pub fn set_ois3n(&mut self, val: bool) { | ||
| 2501 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | ||
| 2502 | } | ||
| 2503 | } | ||
| 2504 | impl Default for Cr2Adv { | ||
| 2505 | fn default() -> Cr2Adv { | ||
| 2506 | Cr2Adv(0) | ||
| 2507 | } | ||
| 2508 | } | ||
| 2509 | #[doc = "DMA/Interrupt enable register"] | ||
| 2510 | #[repr(transparent)] | ||
| 2511 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2512 | pub struct DierAdv(pub u32); | ||
| 2513 | impl DierAdv { | ||
| 2514 | #[doc = "Update interrupt enable"] | ||
| 2515 | pub const fn uie(&self) -> bool { | ||
| 2516 | let val = (self.0 >> 0usize) & 0x01; | ||
| 2517 | val != 0 | ||
| 2518 | } | ||
| 2519 | #[doc = "Update interrupt enable"] | ||
| 2520 | pub fn set_uie(&mut self, val: bool) { | ||
| 2521 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 2522 | } | ||
| 2523 | #[doc = "Capture/Compare 1 interrupt enable"] | ||
| 2524 | pub fn ccie(&self, n: usize) -> bool { | ||
| 2525 | assert!(n < 4usize); | ||
| 2526 | let offs = 1usize + n * 1usize; | ||
| 2527 | let val = (self.0 >> offs) & 0x01; | ||
| 2528 | val != 0 | ||
| 2529 | } | ||
| 2530 | #[doc = "Capture/Compare 1 interrupt enable"] | ||
| 2531 | pub fn set_ccie(&mut self, n: usize, val: bool) { | ||
| 2532 | assert!(n < 4usize); | ||
| 2533 | let offs = 1usize + n * 1usize; | ||
| 2534 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 2535 | } | ||
| 2536 | #[doc = "COM interrupt enable"] | ||
| 2537 | pub const fn comie(&self) -> bool { | ||
| 2538 | let val = (self.0 >> 5usize) & 0x01; | ||
| 2539 | val != 0 | ||
| 2540 | } | ||
| 2541 | #[doc = "COM interrupt enable"] | ||
| 2542 | pub fn set_comie(&mut self, val: bool) { | ||
| 2543 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 2544 | } | ||
| 2545 | #[doc = "Trigger interrupt enable"] | ||
| 2546 | pub const fn tie(&self) -> bool { | ||
| 2547 | let val = (self.0 >> 6usize) & 0x01; | ||
| 2548 | val != 0 | ||
| 2549 | } | ||
| 2550 | #[doc = "Trigger interrupt enable"] | ||
| 2551 | pub fn set_tie(&mut self, val: bool) { | ||
| 2552 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 2553 | } | ||
| 2554 | #[doc = "Break interrupt enable"] | ||
| 2555 | pub const fn bie(&self) -> bool { | ||
| 2556 | let val = (self.0 >> 7usize) & 0x01; | ||
| 2557 | val != 0 | ||
| 2558 | } | ||
| 2559 | #[doc = "Break interrupt enable"] | ||
| 2560 | pub fn set_bie(&mut self, val: bool) { | ||
| 2561 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 2562 | } | ||
| 2563 | #[doc = "Update DMA request enable"] | ||
| 2564 | pub const fn ude(&self) -> bool { | ||
| 2565 | let val = (self.0 >> 8usize) & 0x01; | ||
| 2566 | val != 0 | ||
| 2567 | } | ||
| 2568 | #[doc = "Update DMA request enable"] | ||
| 2569 | pub fn set_ude(&mut self, val: bool) { | ||
| 2570 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 2571 | } | ||
| 2572 | #[doc = "Capture/Compare 1 DMA request enable"] | ||
| 2573 | pub fn ccde(&self, n: usize) -> bool { | ||
| 2574 | assert!(n < 4usize); | ||
| 2575 | let offs = 9usize + n * 1usize; | ||
| 2576 | let val = (self.0 >> offs) & 0x01; | ||
| 2577 | val != 0 | ||
| 2578 | } | ||
| 2579 | #[doc = "Capture/Compare 1 DMA request enable"] | ||
| 2580 | pub fn set_ccde(&mut self, n: usize, val: bool) { | ||
| 2581 | assert!(n < 4usize); | ||
| 2582 | let offs = 9usize + n * 1usize; | ||
| 2583 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 2584 | } | ||
| 2585 | #[doc = "COM DMA request enable"] | ||
| 2586 | pub const fn comde(&self) -> bool { | ||
| 2587 | let val = (self.0 >> 13usize) & 0x01; | ||
| 2588 | val != 0 | ||
| 2589 | } | ||
| 2590 | #[doc = "COM DMA request enable"] | ||
| 2591 | pub fn set_comde(&mut self, val: bool) { | ||
| 2592 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | ||
| 2593 | } | ||
| 2594 | #[doc = "Trigger DMA request enable"] | ||
| 2595 | pub const fn tde(&self) -> bool { | ||
| 2596 | let val = (self.0 >> 14usize) & 0x01; | ||
| 2597 | val != 0 | ||
| 2598 | } | ||
| 2599 | #[doc = "Trigger DMA request enable"] | ||
| 2600 | pub fn set_tde(&mut self, val: bool) { | ||
| 2601 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | ||
| 2602 | } | ||
| 2603 | } | 6632 | } |
| 2604 | impl Default for DierAdv { | 6633 | impl Default for Cr2Gp { |
| 2605 | fn default() -> DierAdv { | 6634 | fn default() -> Cr2Gp { |
| 2606 | DierAdv(0) | 6635 | Cr2Gp(0) |
| 2607 | } | ||
| 2608 | } | ||
| 2609 | #[doc = "event generation register"] | ||
| 2610 | #[repr(transparent)] | ||
| 2611 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2612 | pub struct EgrGp(pub u32); | ||
| 2613 | impl EgrGp { | ||
| 2614 | #[doc = "Update generation"] | ||
| 2615 | pub const fn ug(&self) -> bool { | ||
| 2616 | let val = (self.0 >> 0usize) & 0x01; | ||
| 2617 | val != 0 | ||
| 2618 | } | ||
| 2619 | #[doc = "Update generation"] | ||
| 2620 | pub fn set_ug(&mut self, val: bool) { | ||
| 2621 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 2622 | } | ||
| 2623 | #[doc = "Capture/compare 1 generation"] | ||
| 2624 | pub fn ccg(&self, n: usize) -> bool { | ||
| 2625 | assert!(n < 4usize); | ||
| 2626 | let offs = 1usize + n * 1usize; | ||
| 2627 | let val = (self.0 >> offs) & 0x01; | ||
| 2628 | val != 0 | ||
| 2629 | } | ||
| 2630 | #[doc = "Capture/compare 1 generation"] | ||
| 2631 | pub fn set_ccg(&mut self, n: usize, val: bool) { | ||
| 2632 | assert!(n < 4usize); | ||
| 2633 | let offs = 1usize + n * 1usize; | ||
| 2634 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 2635 | } | ||
| 2636 | #[doc = "Capture/Compare control update generation"] | ||
| 2637 | pub const fn comg(&self) -> bool { | ||
| 2638 | let val = (self.0 >> 5usize) & 0x01; | ||
| 2639 | val != 0 | ||
| 2640 | } | ||
| 2641 | #[doc = "Capture/Compare control update generation"] | ||
| 2642 | pub fn set_comg(&mut self, val: bool) { | ||
| 2643 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 2644 | } | ||
| 2645 | #[doc = "Trigger generation"] | ||
| 2646 | pub const fn tg(&self) -> bool { | ||
| 2647 | let val = (self.0 >> 6usize) & 0x01; | ||
| 2648 | val != 0 | ||
| 2649 | } | ||
| 2650 | #[doc = "Trigger generation"] | ||
| 2651 | pub fn set_tg(&mut self, val: bool) { | ||
| 2652 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 2653 | } | ||
| 2654 | #[doc = "Break generation"] | ||
| 2655 | pub const fn bg(&self) -> bool { | ||
| 2656 | let val = (self.0 >> 7usize) & 0x01; | ||
| 2657 | val != 0 | ||
| 2658 | } | ||
| 2659 | #[doc = "Break generation"] | ||
| 2660 | pub fn set_bg(&mut self, val: bool) { | ||
| 2661 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 2662 | } | ||
| 2663 | } | ||
| 2664 | impl Default for EgrGp { | ||
| 2665 | fn default() -> EgrGp { | ||
| 2666 | EgrGp(0) | ||
| 2667 | } | ||
| 2668 | } | ||
| 2669 | #[doc = "capture/compare enable register"] | ||
| 2670 | #[repr(transparent)] | ||
| 2671 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2672 | pub struct CcerGp(pub u32); | ||
| 2673 | impl CcerGp { | ||
| 2674 | #[doc = "Capture/Compare 1 output enable"] | ||
| 2675 | pub fn cce(&self, n: usize) -> bool { | ||
| 2676 | assert!(n < 4usize); | ||
| 2677 | let offs = 0usize + n * 4usize; | ||
| 2678 | let val = (self.0 >> offs) & 0x01; | ||
| 2679 | val != 0 | ||
| 2680 | } | ||
| 2681 | #[doc = "Capture/Compare 1 output enable"] | ||
| 2682 | pub fn set_cce(&mut self, n: usize, val: bool) { | ||
| 2683 | assert!(n < 4usize); | ||
| 2684 | let offs = 0usize + n * 4usize; | ||
| 2685 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 2686 | } | ||
| 2687 | #[doc = "Capture/Compare 1 output Polarity"] | ||
| 2688 | pub fn ccp(&self, n: usize) -> bool { | ||
| 2689 | assert!(n < 4usize); | ||
| 2690 | let offs = 1usize + n * 4usize; | ||
| 2691 | let val = (self.0 >> offs) & 0x01; | ||
| 2692 | val != 0 | ||
| 2693 | } | ||
| 2694 | #[doc = "Capture/Compare 1 output Polarity"] | ||
| 2695 | pub fn set_ccp(&mut self, n: usize, val: bool) { | ||
| 2696 | assert!(n < 4usize); | ||
| 2697 | let offs = 1usize + n * 4usize; | ||
| 2698 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 2699 | } | ||
| 2700 | #[doc = "Capture/Compare 1 output Polarity"] | ||
| 2701 | pub fn ccnp(&self, n: usize) -> bool { | ||
| 2702 | assert!(n < 4usize); | ||
| 2703 | let offs = 3usize + n * 4usize; | ||
| 2704 | let val = (self.0 >> offs) & 0x01; | ||
| 2705 | val != 0 | ||
| 2706 | } | ||
| 2707 | #[doc = "Capture/Compare 1 output Polarity"] | ||
| 2708 | pub fn set_ccnp(&mut self, n: usize, val: bool) { | ||
| 2709 | assert!(n < 4usize); | ||
| 2710 | let offs = 3usize + n * 4usize; | ||
| 2711 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 2712 | } | ||
| 2713 | } | ||
| 2714 | impl Default for CcerGp { | ||
| 2715 | fn default() -> CcerGp { | ||
| 2716 | CcerGp(0) | ||
| 2717 | } | ||
| 2718 | } | ||
| 2719 | #[doc = "capture/compare mode register 1 (input mode)"] | ||
| 2720 | #[repr(transparent)] | ||
| 2721 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 2722 | pub struct CcmrInput(pub u32); | ||
| 2723 | impl CcmrInput { | ||
| 2724 | #[doc = "Capture/Compare 1 selection"] | ||
| 2725 | pub fn ccs(&self, n: usize) -> super::vals::CcmrInputCcs { | ||
| 2726 | assert!(n < 2usize); | ||
| 2727 | let offs = 0usize + n * 8usize; | ||
| 2728 | let val = (self.0 >> offs) & 0x03; | ||
| 2729 | super::vals::CcmrInputCcs(val as u8) | ||
| 2730 | } | ||
| 2731 | #[doc = "Capture/Compare 1 selection"] | ||
| 2732 | pub fn set_ccs(&mut self, n: usize, val: super::vals::CcmrInputCcs) { | ||
| 2733 | assert!(n < 2usize); | ||
| 2734 | let offs = 0usize + n * 8usize; | ||
| 2735 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | ||
| 2736 | } | ||
| 2737 | #[doc = "Input capture 1 prescaler"] | ||
| 2738 | pub fn icpsc(&self, n: usize) -> u8 { | ||
| 2739 | assert!(n < 2usize); | ||
| 2740 | let offs = 2usize + n * 8usize; | ||
| 2741 | let val = (self.0 >> offs) & 0x03; | ||
| 2742 | val as u8 | ||
| 2743 | } | ||
| 2744 | #[doc = "Input capture 1 prescaler"] | ||
| 2745 | pub fn set_icpsc(&mut self, n: usize, val: u8) { | ||
| 2746 | assert!(n < 2usize); | ||
| 2747 | let offs = 2usize + n * 8usize; | ||
| 2748 | self.0 = (self.0 & !(0x03 << offs)) | (((val as u32) & 0x03) << offs); | ||
| 2749 | } | ||
| 2750 | #[doc = "Input capture 1 filter"] | ||
| 2751 | pub fn icf(&self, n: usize) -> super::vals::Icf { | ||
| 2752 | assert!(n < 2usize); | ||
| 2753 | let offs = 4usize + n * 8usize; | ||
| 2754 | let val = (self.0 >> offs) & 0x0f; | ||
| 2755 | super::vals::Icf(val as u8) | ||
| 2756 | } | ||
| 2757 | #[doc = "Input capture 1 filter"] | ||
| 2758 | pub fn set_icf(&mut self, n: usize, val: super::vals::Icf) { | ||
| 2759 | assert!(n < 2usize); | ||
| 2760 | let offs = 4usize + n * 8usize; | ||
| 2761 | self.0 = (self.0 & !(0x0f << offs)) | (((val.0 as u32) & 0x0f) << offs); | ||
| 2762 | } | ||
| 2763 | } | ||
| 2764 | impl Default for CcmrInput { | ||
| 2765 | fn default() -> CcmrInput { | ||
| 2766 | CcmrInput(0) | ||
| 2767 | } | 6636 | } |
| 2768 | } | 6637 | } |
| 2769 | #[doc = "status register"] | 6638 | } |
| 6639 | pub mod vals { | ||
| 6640 | use crate::generic::*; | ||
| 2770 | #[repr(transparent)] | 6641 | #[repr(transparent)] |
| 2771 | #[derive(Copy, Clone, Eq, PartialEq)] | 6642 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 2772 | pub struct SrAdv(pub u32); | 6643 | pub struct Ocm(pub u8); |
| 2773 | impl SrAdv { | 6644 | impl Ocm { |
| 2774 | #[doc = "Update interrupt flag"] | 6645 | #[doc = "The comparison between the output compare register TIMx_CCRy and the counter TIMx_CNT has no effect on the outputs"] |
| 2775 | pub const fn uif(&self) -> bool { | 6646 | pub const FROZEN: Self = Self(0); |
| 2776 | let val = (self.0 >> 0usize) & 0x01; | 6647 | #[doc = "Set channel to active level on match. OCyREF signal is forced high when the counter matches the capture/compare register"] |
| 2777 | val != 0 | 6648 | pub const ACTIVEONMATCH: Self = Self(0x01); |
| 2778 | } | 6649 | #[doc = "Set channel to inactive level on match. OCyREF signal is forced low when the counter matches the capture/compare register"] |
| 2779 | #[doc = "Update interrupt flag"] | 6650 | pub const INACTIVEONMATCH: Self = Self(0x02); |
| 2780 | pub fn set_uif(&mut self, val: bool) { | 6651 | #[doc = "OCyREF toggles when TIMx_CNT=TIMx_CCRy"] |
| 2781 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 6652 | pub const TOGGLE: Self = Self(0x03); |
| 2782 | } | 6653 | #[doc = "OCyREF is forced low"] |
| 2783 | #[doc = "Capture/compare 1 interrupt flag"] | 6654 | pub const FORCEINACTIVE: Self = Self(0x04); |
| 2784 | pub fn ccif(&self, n: usize) -> bool { | 6655 | #[doc = "OCyREF is forced high"] |
| 2785 | assert!(n < 4usize); | 6656 | pub const FORCEACTIVE: Self = Self(0x05); |
| 2786 | let offs = 1usize + n * 1usize; | 6657 | #[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"] |
| 2787 | let val = (self.0 >> offs) & 0x01; | 6658 | pub const PWMMODE1: Self = Self(0x06); |
| 2788 | val != 0 | 6659 | #[doc = "Inversely to PwmMode1"] |
| 2789 | } | 6660 | pub const PWMMODE2: Self = Self(0x07); |
| 2790 | #[doc = "Capture/compare 1 interrupt flag"] | ||
| 2791 | pub fn set_ccif(&mut self, n: usize, val: bool) { | ||
| 2792 | assert!(n < 4usize); | ||
| 2793 | let offs = 1usize + n * 1usize; | ||
| 2794 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 2795 | } | ||
| 2796 | #[doc = "COM interrupt flag"] | ||
| 2797 | pub const fn comif(&self) -> bool { | ||
| 2798 | let val = (self.0 >> 5usize) & 0x01; | ||
| 2799 | val != 0 | ||
| 2800 | } | ||
| 2801 | #[doc = "COM interrupt flag"] | ||
| 2802 | pub fn set_comif(&mut self, val: bool) { | ||
| 2803 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 2804 | } | ||
| 2805 | #[doc = "Trigger interrupt flag"] | ||
| 2806 | pub const fn tif(&self) -> bool { | ||
| 2807 | let val = (self.0 >> 6usize) & 0x01; | ||
| 2808 | val != 0 | ||
| 2809 | } | ||
| 2810 | #[doc = "Trigger interrupt flag"] | ||
| 2811 | pub fn set_tif(&mut self, val: bool) { | ||
| 2812 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 2813 | } | ||
| 2814 | #[doc = "Break interrupt flag"] | ||
| 2815 | pub const fn bif(&self) -> bool { | ||
| 2816 | let val = (self.0 >> 7usize) & 0x01; | ||
| 2817 | val != 0 | ||
| 2818 | } | ||
| 2819 | #[doc = "Break interrupt flag"] | ||
| 2820 | pub fn set_bif(&mut self, val: bool) { | ||
| 2821 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 2822 | } | ||
| 2823 | #[doc = "Capture/Compare 1 overcapture flag"] | ||
| 2824 | pub fn ccof(&self, n: usize) -> bool { | ||
| 2825 | assert!(n < 4usize); | ||
| 2826 | let offs = 9usize + n * 1usize; | ||
| 2827 | let val = (self.0 >> offs) & 0x01; | ||
| 2828 | val != 0 | ||
| 2829 | } | ||
| 2830 | #[doc = "Capture/Compare 1 overcapture flag"] | ||
| 2831 | pub fn set_ccof(&mut self, n: usize, val: bool) { | ||
| 2832 | assert!(n < 4usize); | ||
| 2833 | let offs = 9usize + n * 1usize; | ||
| 2834 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 2835 | } | ||
| 2836 | } | ||
| 2837 | impl Default for SrAdv { | ||
| 2838 | fn default() -> SrAdv { | ||
| 2839 | SrAdv(0) | ||
| 2840 | } | ||
| 2841 | } | 6661 | } |
| 2842 | #[doc = "capture/compare mode register 2 (output mode)"] | ||
| 2843 | #[repr(transparent)] | 6662 | #[repr(transparent)] |
| 2844 | #[derive(Copy, Clone, Eq, PartialEq)] | 6663 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 2845 | pub struct CcmrOutput(pub u32); | 6664 | pub struct Urs(pub u8); |
| 2846 | impl CcmrOutput { | 6665 | impl Urs { |
| 2847 | #[doc = "Capture/Compare 3 selection"] | 6666 | #[doc = "Any of counter overflow/underflow, setting UG, or update through slave mode, generates an update interrupt or DMA request"] |
| 2848 | pub fn ccs(&self, n: usize) -> super::vals::CcmrOutputCcs { | 6667 | pub const ANYEVENT: Self = Self(0); |
| 2849 | assert!(n < 2usize); | 6668 | #[doc = "Only counter overflow/underflow generates an update interrupt or DMA request"] |
| 2850 | let offs = 0usize + n * 8usize; | 6669 | pub const COUNTERONLY: Self = Self(0x01); |
| 2851 | let val = (self.0 >> offs) & 0x03; | ||
| 2852 | super::vals::CcmrOutputCcs(val as u8) | ||
| 2853 | } | ||
| 2854 | #[doc = "Capture/Compare 3 selection"] | ||
| 2855 | pub fn set_ccs(&mut self, n: usize, val: super::vals::CcmrOutputCcs) { | ||
| 2856 | assert!(n < 2usize); | ||
| 2857 | let offs = 0usize + n * 8usize; | ||
| 2858 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | ||
| 2859 | } | ||
| 2860 | #[doc = "Output compare 3 fast enable"] | ||
| 2861 | pub fn ocfe(&self, n: usize) -> bool { | ||
| 2862 | assert!(n < 2usize); | ||
| 2863 | let offs = 2usize + n * 8usize; | ||
| 2864 | let val = (self.0 >> offs) & 0x01; | ||
| 2865 | val != 0 | ||
| 2866 | } | ||
| 2867 | #[doc = "Output compare 3 fast enable"] | ||
| 2868 | pub fn set_ocfe(&mut self, n: usize, val: bool) { | ||
| 2869 | assert!(n < 2usize); | ||
| 2870 | let offs = 2usize + n * 8usize; | ||
| 2871 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 2872 | } | ||
| 2873 | #[doc = "Output compare 3 preload enable"] | ||
| 2874 | pub fn ocpe(&self, n: usize) -> super::vals::Ocpe { | ||
| 2875 | assert!(n < 2usize); | ||
| 2876 | let offs = 3usize + n * 8usize; | ||
| 2877 | let val = (self.0 >> offs) & 0x01; | ||
| 2878 | super::vals::Ocpe(val as u8) | ||
| 2879 | } | ||
| 2880 | #[doc = "Output compare 3 preload enable"] | ||
| 2881 | pub fn set_ocpe(&mut self, n: usize, val: super::vals::Ocpe) { | ||
| 2882 | assert!(n < 2usize); | ||
| 2883 | let offs = 3usize + n * 8usize; | ||
| 2884 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 2885 | } | ||
| 2886 | #[doc = "Output compare 3 mode"] | ||
| 2887 | pub fn ocm(&self, n: usize) -> super::vals::Ocm { | ||
| 2888 | assert!(n < 2usize); | ||
| 2889 | let offs = 4usize + n * 8usize; | ||
| 2890 | let val = (self.0 >> offs) & 0x07; | ||
| 2891 | super::vals::Ocm(val as u8) | ||
| 2892 | } | ||
| 2893 | #[doc = "Output compare 3 mode"] | ||
| 2894 | pub fn set_ocm(&mut self, n: usize, val: super::vals::Ocm) { | ||
| 2895 | assert!(n < 2usize); | ||
| 2896 | let offs = 4usize + n * 8usize; | ||
| 2897 | self.0 = (self.0 & !(0x07 << offs)) | (((val.0 as u32) & 0x07) << offs); | ||
| 2898 | } | ||
| 2899 | #[doc = "Output compare 3 clear enable"] | ||
| 2900 | pub fn occe(&self, n: usize) -> bool { | ||
| 2901 | assert!(n < 2usize); | ||
| 2902 | let offs = 7usize + n * 8usize; | ||
| 2903 | let val = (self.0 >> offs) & 0x01; | ||
| 2904 | val != 0 | ||
| 2905 | } | ||
| 2906 | #[doc = "Output compare 3 clear enable"] | ||
| 2907 | pub fn set_occe(&mut self, n: usize, val: bool) { | ||
| 2908 | assert!(n < 2usize); | ||
| 2909 | let offs = 7usize + n * 8usize; | ||
| 2910 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 2911 | } | ||
| 2912 | } | ||
| 2913 | impl Default for CcmrOutput { | ||
| 2914 | fn default() -> CcmrOutput { | ||
| 2915 | CcmrOutput(0) | ||
| 2916 | } | ||
| 2917 | } | 6670 | } |
| 2918 | #[doc = "auto-reload register"] | ||
| 2919 | #[repr(transparent)] | 6671 | #[repr(transparent)] |
| 2920 | #[derive(Copy, Clone, Eq, PartialEq)] | 6672 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 2921 | pub struct Arr32(pub u32); | 6673 | pub struct CcmrInputCcs(pub u8); |
| 2922 | impl Arr32 { | 6674 | impl CcmrInputCcs { |
| 2923 | #[doc = "Auto-reload value"] | 6675 | #[doc = "CCx channel is configured as input, normal mapping: ICx mapped to TIx"] |
| 2924 | pub const fn arr(&self) -> u32 { | 6676 | pub const TI4: Self = Self(0x01); |
| 2925 | let val = (self.0 >> 0usize) & 0xffff_ffff; | 6677 | #[doc = "CCx channel is configured as input, alternate mapping (switches 1 with 2, 3 with 4)"] |
| 2926 | val as u32 | 6678 | pub const TI3: Self = Self(0x02); |
| 2927 | } | 6679 | #[doc = "CCx channel is configured as input, ICx is mapped on TRC"] |
| 2928 | #[doc = "Auto-reload value"] | 6680 | pub const TRC: Self = Self(0x03); |
| 2929 | pub fn set_arr(&mut self, val: u32) { | ||
| 2930 | self.0 = | ||
| 2931 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 2932 | } | ||
| 2933 | } | ||
| 2934 | impl Default for Arr32 { | ||
| 2935 | fn default() -> Arr32 { | ||
| 2936 | Arr32(0) | ||
| 2937 | } | ||
| 2938 | } | 6681 | } |
| 2939 | #[doc = "prescaler"] | ||
| 2940 | #[repr(transparent)] | 6682 | #[repr(transparent)] |
| 2941 | #[derive(Copy, Clone, Eq, PartialEq)] | 6683 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 2942 | pub struct Psc(pub u32); | 6684 | pub struct Ckd(pub u8); |
| 2943 | impl Psc { | 6685 | impl Ckd { |
| 2944 | #[doc = "Prescaler value"] | 6686 | #[doc = "t_DTS = t_CK_INT"] |
| 2945 | pub const fn psc(&self) -> u16 { | 6687 | pub const DIV1: Self = Self(0); |
| 2946 | let val = (self.0 >> 0usize) & 0xffff; | 6688 | #[doc = "t_DTS = 2 × t_CK_INT"] |
| 2947 | val as u16 | 6689 | pub const DIV2: Self = Self(0x01); |
| 2948 | } | 6690 | #[doc = "t_DTS = 4 × t_CK_INT"] |
| 2949 | #[doc = "Prescaler value"] | 6691 | pub const DIV4: Self = Self(0x02); |
| 2950 | pub fn set_psc(&mut self, val: u16) { | ||
| 2951 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 2952 | } | ||
| 2953 | } | ||
| 2954 | impl Default for Psc { | ||
| 2955 | fn default() -> Psc { | ||
| 2956 | Psc(0) | ||
| 2957 | } | ||
| 2958 | } | 6692 | } |
| 2959 | } | ||
| 2960 | pub mod vals { | ||
| 2961 | use crate::generic::*; | ||
| 2962 | #[repr(transparent)] | 6693 | #[repr(transparent)] |
| 2963 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 6694 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 2964 | pub struct CcmrOutputCcs(pub u8); | 6695 | pub struct Etps(pub u8); |
| 2965 | impl CcmrOutputCcs { | 6696 | impl Etps { |
| 2966 | #[doc = "CCx channel is configured as output"] | 6697 | #[doc = "Prescaler OFF"] |
| 2967 | pub const OUTPUT: Self = Self(0); | 6698 | pub const DIV1: Self = Self(0); |
| 6699 | #[doc = "ETRP frequency divided by 2"] | ||
| 6700 | pub const DIV2: Self = Self(0x01); | ||
| 6701 | #[doc = "ETRP frequency divided by 4"] | ||
| 6702 | pub const DIV4: Self = Self(0x02); | ||
| 6703 | #[doc = "ETRP frequency divided by 8"] | ||
| 6704 | pub const DIV8: Self = Self(0x03); | ||
| 2968 | } | 6705 | } |
| 2969 | #[repr(transparent)] | 6706 | #[repr(transparent)] |
| 2970 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 6707 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 2971 | pub struct Ts(pub u8); | 6708 | pub struct Ocpe(pub u8); |
| 2972 | impl Ts { | 6709 | impl Ocpe { |
| 2973 | #[doc = "Internal Trigger 0 (ITR0)"] | 6710 | #[doc = "Preload register on CCR2 disabled. New values written to CCR2 are taken into account immediately"] |
| 2974 | pub const ITR0: Self = Self(0); | 6711 | pub const DISABLED: Self = Self(0); |
| 2975 | #[doc = "Internal Trigger 1 (ITR1)"] | 6712 | #[doc = "Preload register on CCR2 enabled. Preload value is loaded into active register on each update event"] |
| 2976 | pub const ITR1: Self = Self(0x01); | 6713 | pub const ENABLED: Self = Self(0x01); |
| 2977 | #[doc = "Internal Trigger 2 (ITR2)"] | ||
| 2978 | pub const ITR2: Self = Self(0x02); | ||
| 2979 | #[doc = "TI1 Edge Detector (TI1F_ED)"] | ||
| 2980 | pub const TI1F_ED: Self = Self(0x04); | ||
| 2981 | #[doc = "Filtered Timer Input 1 (TI1FP1)"] | ||
| 2982 | pub const TI1FP1: Self = Self(0x05); | ||
| 2983 | #[doc = "Filtered Timer Input 2 (TI2FP2)"] | ||
| 2984 | pub const TI2FP2: Self = Self(0x06); | ||
| 2985 | #[doc = "External Trigger input (ETRF)"] | ||
| 2986 | pub const ETRF: Self = Self(0x07); | ||
| 2987 | } | 6714 | } |
| 2988 | #[repr(transparent)] | 6715 | #[repr(transparent)] |
| 2989 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 6716 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| @@ -3000,6 +6727,15 @@ pub mod timer_v1 { | |||
| 3000 | } | 6727 | } |
| 3001 | #[repr(transparent)] | 6728 | #[repr(transparent)] |
| 3002 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 6729 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 6730 | pub struct Opm(pub u8); | ||
| 6731 | impl Opm { | ||
| 6732 | #[doc = "Counter is not stopped at update event"] | ||
| 6733 | pub const DISABLED: Self = Self(0); | ||
| 6734 | #[doc = "Counter stops counting at the next update event (clearing the CEN bit)"] | ||
| 6735 | pub const ENABLED: Self = Self(0x01); | ||
| 6736 | } | ||
| 6737 | #[repr(transparent)] | ||
| 6738 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 3003 | pub struct Ece(pub u8); | 6739 | pub struct Ece(pub u8); |
| 3004 | impl Ece { | 6740 | impl Ece { |
| 3005 | #[doc = "External clock mode 2 disabled"] | 6741 | #[doc = "External clock mode 2 disabled"] |
| @@ -3009,50 +6745,37 @@ pub mod timer_v1 { | |||
| 3009 | } | 6745 | } |
| 3010 | #[repr(transparent)] | 6746 | #[repr(transparent)] |
| 3011 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 6747 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 3012 | pub struct Urs(pub u8); | 6748 | pub struct Ossi(pub u8); |
| 3013 | impl Urs { | 6749 | impl Ossi { |
| 3014 | #[doc = "Any of counter overflow/underflow, setting UG, or update through slave mode, generates an update interrupt or DMA request"] | 6750 | #[doc = "When inactive, OC/OCN outputs are disabled"] |
| 3015 | pub const ANYEVENT: Self = Self(0); | ||
| 3016 | #[doc = "Only counter overflow/underflow generates an update interrupt or DMA request"] | ||
| 3017 | pub const COUNTERONLY: Self = Self(0x01); | ||
| 3018 | } | ||
| 3019 | #[repr(transparent)] | ||
| 3020 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 3021 | pub struct Opm(pub u8); | ||
| 3022 | impl Opm { | ||
| 3023 | #[doc = "Counter is not stopped at update event"] | ||
| 3024 | pub const DISABLED: Self = Self(0); | 6751 | pub const DISABLED: Self = Self(0); |
| 3025 | #[doc = "Counter stops counting at the next update event (clearing the CEN bit)"] | 6752 | #[doc = "When inactive, OC/OCN outputs are forced to idle level"] |
| 3026 | pub const ENABLED: Self = Self(0x01); | 6753 | pub const IDLELEVEL: Self = Self(0x01); |
| 3027 | } | 6754 | } |
| 3028 | #[repr(transparent)] | 6755 | #[repr(transparent)] |
| 3029 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 6756 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 3030 | pub struct Ocpe(pub u8); | 6757 | pub struct Etp(pub u8); |
| 3031 | impl Ocpe { | 6758 | impl Etp { |
| 3032 | #[doc = "Preload register on CCR2 disabled. New values written to CCR2 are taken into account immediately"] | 6759 | #[doc = "ETR is noninverted, active at high level or rising edge"] |
| 3033 | pub const DISABLED: Self = Self(0); | 6760 | pub const NOTINVERTED: Self = Self(0); |
| 3034 | #[doc = "Preload register on CCR2 enabled. Preload value is loaded into active register on each update event"] | 6761 | #[doc = "ETR is inverted, active at low level or falling edge"] |
| 3035 | pub const ENABLED: Self = Self(0x01); | 6762 | pub const INVERTED: Self = Self(0x01); |
| 3036 | } | 6763 | } |
| 3037 | #[repr(transparent)] | 6764 | #[repr(transparent)] |
| 3038 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 6765 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 3039 | pub struct Ccds(pub u8); | 6766 | pub struct Tis(pub u8); |
| 3040 | impl Ccds { | 6767 | impl Tis { |
| 3041 | #[doc = "CCx DMA request sent when CCx event occurs"] | 6768 | #[doc = "The TIMx_CH1 pin is connected to TI1 input"] |
| 3042 | pub const ONCOMPARE: Self = Self(0); | 6769 | pub const NORMAL: Self = Self(0); |
| 3043 | #[doc = "CCx DMA request sent when update event occurs"] | 6770 | #[doc = "The TIMx_CH1, CH2, CH3 pins are connected to TI1 input"] |
| 3044 | pub const ONUPDATE: Self = Self(0x01); | 6771 | pub const XOR: Self = Self(0x01); |
| 3045 | } | 6772 | } |
| 3046 | #[repr(transparent)] | 6773 | #[repr(transparent)] |
| 3047 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 6774 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 3048 | pub struct CcmrInputCcs(pub u8); | 6775 | pub struct CcmrOutputCcs(pub u8); |
| 3049 | impl CcmrInputCcs { | 6776 | impl CcmrOutputCcs { |
| 3050 | #[doc = "CCx channel is configured as input, normal mapping: ICx mapped to TIx"] | 6777 | #[doc = "CCx channel is configured as output"] |
| 3051 | pub const TI4: Self = Self(0x01); | 6778 | pub const OUTPUT: Self = Self(0); |
| 3052 | #[doc = "CCx channel is configured as input, alternate mapping (switches 1 with 2, 3 with 4)"] | ||
| 3053 | pub const TI3: Self = Self(0x02); | ||
| 3054 | #[doc = "CCx channel is configured as input, ICx is mapped on TRC"] | ||
| 3055 | pub const TRC: Self = Self(0x03); | ||
| 3056 | } | 6779 | } |
| 3057 | #[repr(transparent)] | 6780 | #[repr(transparent)] |
| 3058 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 6781 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| @@ -3065,36 +6788,6 @@ pub mod timer_v1 { | |||
| 3065 | } | 6788 | } |
| 3066 | #[repr(transparent)] | 6789 | #[repr(transparent)] |
| 3067 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 6790 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 3068 | pub struct Mms(pub u8); | ||
| 3069 | impl Mms { | ||
| 3070 | #[doc = "The UG bit from the TIMx_EGR register is used as trigger output"] | ||
| 3071 | pub const RESET: Self = Self(0); | ||
| 3072 | #[doc = "The counter enable signal, CNT_EN, is used as trigger output"] | ||
| 3073 | pub const ENABLE: Self = Self(0x01); | ||
| 3074 | #[doc = "The update event is selected as trigger output"] | ||
| 3075 | pub const UPDATE: Self = Self(0x02); | ||
| 3076 | #[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"] | ||
| 3077 | pub const COMPAREPULSE: Self = Self(0x03); | ||
| 3078 | #[doc = "OC1REF signal is used as trigger output"] | ||
| 3079 | pub const COMPAREOC1: Self = Self(0x04); | ||
| 3080 | #[doc = "OC2REF signal is used as trigger output"] | ||
| 3081 | pub const COMPAREOC2: Self = Self(0x05); | ||
| 3082 | #[doc = "OC3REF signal is used as trigger output"] | ||
| 3083 | pub const COMPAREOC3: Self = Self(0x06); | ||
| 3084 | #[doc = "OC4REF signal is used as trigger output"] | ||
| 3085 | pub const COMPAREOC4: Self = Self(0x07); | ||
| 3086 | } | ||
| 3087 | #[repr(transparent)] | ||
| 3088 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 3089 | pub struct Msm(pub u8); | ||
| 3090 | impl Msm { | ||
| 3091 | #[doc = "No action"] | ||
| 3092 | pub const NOSYNC: Self = Self(0); | ||
| 3093 | #[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."] | ||
| 3094 | pub const SYNC: Self = Self(0x01); | ||
| 3095 | } | ||
| 3096 | #[repr(transparent)] | ||
| 3097 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 3098 | pub struct Etf(pub u8); | 6791 | pub struct Etf(pub u8); |
| 3099 | impl Etf { | 6792 | impl Etf { |
| 3100 | #[doc = "No filter, sampling is done at fDTS"] | 6793 | #[doc = "No filter, sampling is done at fDTS"] |
| @@ -3132,6 +6825,15 @@ pub mod timer_v1 { | |||
| 3132 | } | 6825 | } |
| 3133 | #[repr(transparent)] | 6826 | #[repr(transparent)] |
| 3134 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 6827 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 6828 | pub struct Dir(pub u8); | ||
| 6829 | impl Dir { | ||
| 6830 | #[doc = "Counter used as upcounter"] | ||
| 6831 | pub const UP: Self = Self(0); | ||
| 6832 | #[doc = "Counter used as downcounter"] | ||
| 6833 | pub const DOWN: Self = Self(0x01); | ||
| 6834 | } | ||
| 6835 | #[repr(transparent)] | ||
| 6836 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 3135 | pub struct Icf(pub u8); | 6837 | pub struct Icf(pub u8); |
| 3136 | impl Icf { | 6838 | impl Icf { |
| 3137 | #[doc = "No filter, sampling is done at fDTS"] | 6839 | #[doc = "No filter, sampling is done at fDTS"] |
| @@ -3169,84 +6871,12 @@ pub mod timer_v1 { | |||
| 3169 | } | 6871 | } |
| 3170 | #[repr(transparent)] | 6872 | #[repr(transparent)] |
| 3171 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 6873 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 3172 | pub struct Dir(pub u8); | 6874 | pub struct Msm(pub u8); |
| 3173 | impl Dir { | 6875 | impl Msm { |
| 3174 | #[doc = "Counter used as upcounter"] | 6876 | #[doc = "No action"] |
| 3175 | pub const UP: Self = Self(0); | 6877 | pub const NOSYNC: Self = Self(0); |
| 3176 | #[doc = "Counter used as downcounter"] | 6878 | #[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."] |
| 3177 | pub const DOWN: Self = Self(0x01); | 6879 | pub const SYNC: Self = Self(0x01); |
| 3178 | } | ||
| 3179 | #[repr(transparent)] | ||
| 3180 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 3181 | pub struct Etps(pub u8); | ||
| 3182 | impl Etps { | ||
| 3183 | #[doc = "Prescaler OFF"] | ||
| 3184 | pub const DIV1: Self = Self(0); | ||
| 3185 | #[doc = "ETRP frequency divided by 2"] | ||
| 3186 | pub const DIV2: Self = Self(0x01); | ||
| 3187 | #[doc = "ETRP frequency divided by 4"] | ||
| 3188 | pub const DIV4: Self = Self(0x02); | ||
| 3189 | #[doc = "ETRP frequency divided by 8"] | ||
| 3190 | pub const DIV8: Self = Self(0x03); | ||
| 3191 | } | ||
| 3192 | #[repr(transparent)] | ||
| 3193 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 3194 | pub struct Ossr(pub u8); | ||
| 3195 | impl Ossr { | ||
| 3196 | #[doc = "When inactive, OC/OCN outputs are disabled"] | ||
| 3197 | pub const DISABLED: Self = Self(0); | ||
| 3198 | #[doc = "When inactive, OC/OCN outputs are enabled with their inactive level"] | ||
| 3199 | pub const IDLELEVEL: Self = Self(0x01); | ||
| 3200 | } | ||
| 3201 | #[repr(transparent)] | ||
| 3202 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 3203 | pub struct Ocm(pub u8); | ||
| 3204 | impl Ocm { | ||
| 3205 | #[doc = "The comparison between the output compare register TIMx_CCRy and the counter TIMx_CNT has no effect on the outputs"] | ||
| 3206 | pub const FROZEN: Self = Self(0); | ||
| 3207 | #[doc = "Set channel to active level on match. OCyREF signal is forced high when the counter matches the capture/compare register"] | ||
| 3208 | pub const ACTIVEONMATCH: Self = Self(0x01); | ||
| 3209 | #[doc = "Set channel to inactive level on match. OCyREF signal is forced low when the counter matches the capture/compare register"] | ||
| 3210 | pub const INACTIVEONMATCH: Self = Self(0x02); | ||
| 3211 | #[doc = "OCyREF toggles when TIMx_CNT=TIMx_CCRy"] | ||
| 3212 | pub const TOGGLE: Self = Self(0x03); | ||
| 3213 | #[doc = "OCyREF is forced low"] | ||
| 3214 | pub const FORCEINACTIVE: Self = Self(0x04); | ||
| 3215 | #[doc = "OCyREF is forced high"] | ||
| 3216 | pub const FORCEACTIVE: Self = Self(0x05); | ||
| 3217 | #[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"] | ||
| 3218 | pub const PWMMODE1: Self = Self(0x06); | ||
| 3219 | #[doc = "Inversely to PwmMode1"] | ||
| 3220 | pub const PWMMODE2: Self = Self(0x07); | ||
| 3221 | } | ||
| 3222 | #[repr(transparent)] | ||
| 3223 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 3224 | pub struct Tis(pub u8); | ||
| 3225 | impl Tis { | ||
| 3226 | #[doc = "The TIMx_CH1 pin is connected to TI1 input"] | ||
| 3227 | pub const NORMAL: Self = Self(0); | ||
| 3228 | #[doc = "The TIMx_CH1, CH2, CH3 pins are connected to TI1 input"] | ||
| 3229 | pub const XOR: Self = Self(0x01); | ||
| 3230 | } | ||
| 3231 | #[repr(transparent)] | ||
| 3232 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 3233 | pub struct Etp(pub u8); | ||
| 3234 | impl Etp { | ||
| 3235 | #[doc = "ETR is noninverted, active at high level or rising edge"] | ||
| 3236 | pub const NOTINVERTED: Self = Self(0); | ||
| 3237 | #[doc = "ETR is inverted, active at low level or falling edge"] | ||
| 3238 | pub const INVERTED: Self = Self(0x01); | ||
| 3239 | } | ||
| 3240 | #[repr(transparent)] | ||
| 3241 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 3242 | pub struct Ckd(pub u8); | ||
| 3243 | impl Ckd { | ||
| 3244 | #[doc = "t_DTS = t_CK_INT"] | ||
| 3245 | pub const DIV1: Self = Self(0); | ||
| 3246 | #[doc = "t_DTS = 2 × t_CK_INT"] | ||
| 3247 | pub const DIV2: Self = Self(0x01); | ||
| 3248 | #[doc = "t_DTS = 4 × t_CK_INT"] | ||
| 3249 | pub const DIV4: Self = Self(0x02); | ||
| 3250 | } | 6880 | } |
| 3251 | #[repr(transparent)] | 6881 | #[repr(transparent)] |
| 3252 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 6882 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| @@ -3271,45 +6901,129 @@ pub mod timer_v1 { | |||
| 3271 | } | 6901 | } |
| 3272 | #[repr(transparent)] | 6902 | #[repr(transparent)] |
| 3273 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 6903 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 3274 | pub struct Ossi(pub u8); | 6904 | pub struct Ts(pub u8); |
| 3275 | impl Ossi { | 6905 | impl Ts { |
| 6906 | #[doc = "Internal Trigger 0 (ITR0)"] | ||
| 6907 | pub const ITR0: Self = Self(0); | ||
| 6908 | #[doc = "Internal Trigger 1 (ITR1)"] | ||
| 6909 | pub const ITR1: Self = Self(0x01); | ||
| 6910 | #[doc = "Internal Trigger 2 (ITR2)"] | ||
| 6911 | pub const ITR2: Self = Self(0x02); | ||
| 6912 | #[doc = "TI1 Edge Detector (TI1F_ED)"] | ||
| 6913 | pub const TI1F_ED: Self = Self(0x04); | ||
| 6914 | #[doc = "Filtered Timer Input 1 (TI1FP1)"] | ||
| 6915 | pub const TI1FP1: Self = Self(0x05); | ||
| 6916 | #[doc = "Filtered Timer Input 2 (TI2FP2)"] | ||
| 6917 | pub const TI2FP2: Self = Self(0x06); | ||
| 6918 | #[doc = "External Trigger input (ETRF)"] | ||
| 6919 | pub const ETRF: Self = Self(0x07); | ||
| 6920 | } | ||
| 6921 | #[repr(transparent)] | ||
| 6922 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 6923 | pub struct Ossr(pub u8); | ||
| 6924 | impl Ossr { | ||
| 3276 | #[doc = "When inactive, OC/OCN outputs are disabled"] | 6925 | #[doc = "When inactive, OC/OCN outputs are disabled"] |
| 3277 | pub const DISABLED: Self = Self(0); | 6926 | pub const DISABLED: Self = Self(0); |
| 3278 | #[doc = "When inactive, OC/OCN outputs are forced to idle level"] | 6927 | #[doc = "When inactive, OC/OCN outputs are enabled with their inactive level"] |
| 3279 | pub const IDLELEVEL: Self = Self(0x01); | 6928 | pub const IDLELEVEL: Self = Self(0x01); |
| 3280 | } | 6929 | } |
| 6930 | #[repr(transparent)] | ||
| 6931 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 6932 | pub struct Mms(pub u8); | ||
| 6933 | impl Mms { | ||
| 6934 | #[doc = "The UG bit from the TIMx_EGR register is used as trigger output"] | ||
| 6935 | pub const RESET: Self = Self(0); | ||
| 6936 | #[doc = "The counter enable signal, CNT_EN, is used as trigger output"] | ||
| 6937 | pub const ENABLE: Self = Self(0x01); | ||
| 6938 | #[doc = "The update event is selected as trigger output"] | ||
| 6939 | pub const UPDATE: Self = Self(0x02); | ||
| 6940 | #[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"] | ||
| 6941 | pub const COMPAREPULSE: Self = Self(0x03); | ||
| 6942 | #[doc = "OC1REF signal is used as trigger output"] | ||
| 6943 | pub const COMPAREOC1: Self = Self(0x04); | ||
| 6944 | #[doc = "OC2REF signal is used as trigger output"] | ||
| 6945 | pub const COMPAREOC2: Self = Self(0x05); | ||
| 6946 | #[doc = "OC3REF signal is used as trigger output"] | ||
| 6947 | pub const COMPAREOC3: Self = Self(0x06); | ||
| 6948 | #[doc = "OC4REF signal is used as trigger output"] | ||
| 6949 | pub const COMPAREOC4: Self = Self(0x07); | ||
| 6950 | } | ||
| 6951 | #[repr(transparent)] | ||
| 6952 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 6953 | pub struct Ccds(pub u8); | ||
| 6954 | impl Ccds { | ||
| 6955 | #[doc = "CCx DMA request sent when CCx event occurs"] | ||
| 6956 | pub const ONCOMPARE: Self = Self(0); | ||
| 6957 | #[doc = "CCx DMA request sent when update event occurs"] | ||
| 6958 | pub const ONUPDATE: Self = Self(0x01); | ||
| 6959 | } | ||
| 3281 | } | 6960 | } |
| 3282 | } | 6961 | } |
| 3283 | pub mod exti_v1 { | 6962 | pub mod usart_v1 { |
| 3284 | use crate::generic::*; | 6963 | use crate::generic::*; |
| 3285 | #[doc = "External interrupt/event controller"] | 6964 | #[doc = "Universal synchronous asynchronous receiver transmitter"] |
| 3286 | #[derive(Copy, Clone)] | 6965 | #[derive(Copy, Clone)] |
| 3287 | pub struct Exti(pub *mut u8); | 6966 | pub struct Usart(pub *mut u8); |
| 3288 | unsafe impl Send for Exti {} | 6967 | unsafe impl Send for Usart {} |
| 3289 | unsafe impl Sync for Exti {} | 6968 | unsafe impl Sync for Usart {} |
| 3290 | impl Exti { | 6969 | impl Usart { |
| 3291 | #[doc = "Interrupt mask register (EXTI_IMR)"] | 6970 | #[doc = "Status register"] |
| 3292 | pub fn imr(self) -> Reg<regs::Imr, RW> { | 6971 | pub fn sr(self) -> Reg<regs::Sr, RW> { |
| 3293 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | 6972 | unsafe { Reg::from_ptr(self.0.add(0usize)) } |
| 3294 | } | 6973 | } |
| 3295 | #[doc = "Event mask register (EXTI_EMR)"] | 6974 | #[doc = "Data register"] |
| 3296 | pub fn emr(self) -> Reg<regs::Emr, RW> { | 6975 | pub fn dr(self) -> Reg<regs::Dr, RW> { |
| 3297 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | 6976 | unsafe { Reg::from_ptr(self.0.add(4usize)) } |
| 3298 | } | 6977 | } |
| 3299 | #[doc = "Rising Trigger selection register (EXTI_RTSR)"] | 6978 | #[doc = "Baud rate register"] |
| 3300 | pub fn rtsr(self) -> Reg<regs::Rtsr, RW> { | 6979 | pub fn brr(self) -> Reg<regs::Brr, RW> { |
| 3301 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | 6980 | unsafe { Reg::from_ptr(self.0.add(8usize)) } |
| 3302 | } | 6981 | } |
| 3303 | #[doc = "Falling Trigger selection register (EXTI_FTSR)"] | 6982 | #[doc = "Control register 1"] |
| 3304 | pub fn ftsr(self) -> Reg<regs::Ftsr, RW> { | 6983 | pub fn cr1(self) -> Reg<regs::Cr1, RW> { |
| 3305 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | 6984 | unsafe { Reg::from_ptr(self.0.add(12usize)) } |
| 3306 | } | 6985 | } |
| 3307 | #[doc = "Software interrupt event register (EXTI_SWIER)"] | 6986 | #[doc = "Control register 2"] |
| 3308 | pub fn swier(self) -> Reg<regs::Swier, RW> { | 6987 | pub fn cr2(self) -> Reg<regs::Cr2Usart, RW> { |
| 3309 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | 6988 | unsafe { Reg::from_ptr(self.0.add(16usize)) } |
| 3310 | } | 6989 | } |
| 3311 | #[doc = "Pending register (EXTI_PR)"] | 6990 | #[doc = "Control register 3"] |
| 3312 | pub fn pr(self) -> Reg<regs::Pr, RW> { | 6991 | pub fn cr3(self) -> Reg<regs::Cr3Usart, RW> { |
| 6992 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 6993 | } | ||
| 6994 | #[doc = "Guard time and prescaler register"] | ||
| 6995 | pub fn gtpr(self) -> Reg<regs::Gtpr, RW> { | ||
| 6996 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | ||
| 6997 | } | ||
| 6998 | } | ||
| 6999 | #[doc = "Universal asynchronous receiver transmitter"] | ||
| 7000 | #[derive(Copy, Clone)] | ||
| 7001 | pub struct Uart(pub *mut u8); | ||
| 7002 | unsafe impl Send for Uart {} | ||
| 7003 | unsafe impl Sync for Uart {} | ||
| 7004 | impl Uart { | ||
| 7005 | #[doc = "Status register"] | ||
| 7006 | pub fn sr(self) -> Reg<regs::Sr, RW> { | ||
| 7007 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 7008 | } | ||
| 7009 | #[doc = "Data register"] | ||
| 7010 | pub fn dr(self) -> Reg<regs::Dr, RW> { | ||
| 7011 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 7012 | } | ||
| 7013 | #[doc = "Baud rate register"] | ||
| 7014 | pub fn brr(self) -> Reg<regs::Brr, RW> { | ||
| 7015 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 7016 | } | ||
| 7017 | #[doc = "Control register 1"] | ||
| 7018 | pub fn cr1(self) -> Reg<regs::Cr1, RW> { | ||
| 7019 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 7020 | } | ||
| 7021 | #[doc = "Control register 2"] | ||
| 7022 | pub fn cr2(self) -> Reg<regs::Cr2, RW> { | ||
| 7023 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 7024 | } | ||
| 7025 | #[doc = "Control register 3"] | ||
| 7026 | pub fn cr3(self) -> Reg<regs::Cr3, RW> { | ||
| 3313 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | 7027 | unsafe { Reg::from_ptr(self.0.add(20usize)) } |
| 3314 | } | 7028 | } |
| 3315 | } | 7029 | } |
| @@ -3317,286 +7031,152 @@ pub mod exti_v1 { | |||
| 3317 | use crate::generic::*; | 7031 | use crate::generic::*; |
| 3318 | #[repr(transparent)] | 7032 | #[repr(transparent)] |
| 3319 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7033 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 3320 | pub struct Mr(pub u8); | 7034 | pub struct Lbdl(pub u8); |
| 3321 | impl Mr { | 7035 | impl Lbdl { |
| 3322 | #[doc = "Interrupt request line is masked"] | 7036 | #[doc = "10-bit break detection"] |
| 3323 | pub const MASKED: Self = Self(0); | 7037 | pub const LBDL10: Self = Self(0); |
| 3324 | #[doc = "Interrupt request line is unmasked"] | 7038 | #[doc = "11-bit break detection"] |
| 3325 | pub const UNMASKED: Self = Self(0x01); | 7039 | pub const LBDL11: Self = Self(0x01); |
| 3326 | } | 7040 | } |
| 3327 | #[repr(transparent)] | 7041 | #[repr(transparent)] |
| 3328 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7042 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 3329 | pub struct Prw(pub u8); | 7043 | pub struct Wake(pub u8); |
| 3330 | impl Prw { | 7044 | impl Wake { |
| 3331 | #[doc = "Clears pending bit"] | 7045 | #[doc = "USART wakeup on idle line"] |
| 3332 | pub const CLEAR: Self = Self(0x01); | 7046 | pub const IDLELINE: Self = Self(0); |
| 7047 | #[doc = "USART wakeup on address mark"] | ||
| 7048 | pub const ADDRESSMARK: Self = Self(0x01); | ||
| 3333 | } | 7049 | } |
| 3334 | #[repr(transparent)] | 7050 | #[repr(transparent)] |
| 3335 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7051 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 3336 | pub struct Tr(pub u8); | 7052 | pub struct Hdsel(pub u8); |
| 3337 | impl Tr { | 7053 | impl Hdsel { |
| 3338 | #[doc = "Falling edge trigger is disabled"] | 7054 | #[doc = "Half duplex mode is not selected"] |
| 3339 | pub const DISABLED: Self = Self(0); | 7055 | pub const FULLDUPLEX: Self = Self(0); |
| 3340 | #[doc = "Falling edge trigger is enabled"] | 7056 | #[doc = "Half duplex mode is selected"] |
| 3341 | pub const ENABLED: Self = Self(0x01); | 7057 | pub const HALFDUPLEX: Self = Self(0x01); |
| 3342 | } | 7058 | } |
| 3343 | #[repr(transparent)] | 7059 | #[repr(transparent)] |
| 3344 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7060 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 3345 | pub struct Prr(pub u8); | 7061 | pub struct Stop(pub u8); |
| 3346 | impl Prr { | 7062 | impl Stop { |
| 3347 | #[doc = "No trigger request occurred"] | 7063 | #[doc = "1 stop bit"] |
| 3348 | pub const NOTPENDING: Self = Self(0); | 7064 | pub const STOP1: Self = Self(0); |
| 3349 | #[doc = "Selected trigger request occurred"] | 7065 | #[doc = "0.5 stop bits"] |
| 3350 | pub const PENDING: Self = Self(0x01); | 7066 | pub const STOP0P5: Self = Self(0x01); |
| 7067 | #[doc = "2 stop bits"] | ||
| 7068 | pub const STOP2: Self = Self(0x02); | ||
| 7069 | #[doc = "1.5 stop bits"] | ||
| 7070 | pub const STOP1P5: Self = Self(0x03); | ||
| 3351 | } | 7071 | } |
| 3352 | #[repr(transparent)] | 7072 | #[repr(transparent)] |
| 3353 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7073 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 3354 | pub struct Swierw(pub u8); | 7074 | pub struct Rwu(pub u8); |
| 3355 | impl Swierw { | 7075 | impl Rwu { |
| 3356 | #[doc = "Generates an interrupt request"] | 7076 | #[doc = "Receiver in active mode"] |
| 3357 | pub const PEND: Self = Self(0x01); | 7077 | pub const ACTIVE: Self = Self(0); |
| 7078 | #[doc = "Receiver in mute mode"] | ||
| 7079 | pub const MUTE: Self = Self(0x01); | ||
| 3358 | } | 7080 | } |
| 3359 | } | ||
| 3360 | pub mod regs { | ||
| 3361 | use crate::generic::*; | ||
| 3362 | #[doc = "Falling Trigger selection register (EXTI_FTSR)"] | ||
| 3363 | #[repr(transparent)] | 7081 | #[repr(transparent)] |
| 3364 | #[derive(Copy, Clone, Eq, PartialEq)] | 7082 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 3365 | pub struct Ftsr(pub u32); | 7083 | pub struct Ps(pub u8); |
| 3366 | impl Ftsr { | 7084 | impl Ps { |
| 3367 | #[doc = "Falling trigger event configuration of line 0"] | 7085 | #[doc = "Even parity"] |
| 3368 | pub fn tr(&self, n: usize) -> super::vals::Tr { | 7086 | pub const EVEN: Self = Self(0); |
| 3369 | assert!(n < 23usize); | 7087 | #[doc = "Odd parity"] |
| 3370 | let offs = 0usize + n * 1usize; | 7088 | pub const ODD: Self = Self(0x01); |
| 3371 | let val = (self.0 >> offs) & 0x01; | ||
| 3372 | super::vals::Tr(val as u8) | ||
| 3373 | } | ||
| 3374 | #[doc = "Falling trigger event configuration of line 0"] | ||
| 3375 | pub fn set_tr(&mut self, n: usize, val: super::vals::Tr) { | ||
| 3376 | assert!(n < 23usize); | ||
| 3377 | let offs = 0usize + n * 1usize; | ||
| 3378 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 3379 | } | ||
| 3380 | } | ||
| 3381 | impl Default for Ftsr { | ||
| 3382 | fn default() -> Ftsr { | ||
| 3383 | Ftsr(0) | ||
| 3384 | } | ||
| 3385 | } | 7089 | } |
| 3386 | #[doc = "Rising Trigger selection register (EXTI_RTSR)"] | ||
| 3387 | #[repr(transparent)] | 7090 | #[repr(transparent)] |
| 3388 | #[derive(Copy, Clone, Eq, PartialEq)] | 7091 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 3389 | pub struct Rtsr(pub u32); | 7092 | pub struct Cpha(pub u8); |
| 3390 | impl Rtsr { | 7093 | impl Cpha { |
| 3391 | #[doc = "Rising trigger event configuration of line 0"] | 7094 | #[doc = "The first clock transition is the first data capture edge"] |
| 3392 | pub fn tr(&self, n: usize) -> super::vals::Tr { | 7095 | pub const FIRST: Self = Self(0); |
| 3393 | assert!(n < 23usize); | 7096 | #[doc = "The second clock transition is the first data capture edge"] |
| 3394 | let offs = 0usize + n * 1usize; | 7097 | pub const SECOND: Self = Self(0x01); |
| 3395 | let val = (self.0 >> offs) & 0x01; | ||
| 3396 | super::vals::Tr(val as u8) | ||
| 3397 | } | ||
| 3398 | #[doc = "Rising trigger event configuration of line 0"] | ||
| 3399 | pub fn set_tr(&mut self, n: usize, val: super::vals::Tr) { | ||
| 3400 | assert!(n < 23usize); | ||
| 3401 | let offs = 0usize + n * 1usize; | ||
| 3402 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 3403 | } | ||
| 3404 | } | ||
| 3405 | impl Default for Rtsr { | ||
| 3406 | fn default() -> Rtsr { | ||
| 3407 | Rtsr(0) | ||
| 3408 | } | ||
| 3409 | } | 7098 | } |
| 3410 | #[doc = "Software interrupt event register (EXTI_SWIER)"] | ||
| 3411 | #[repr(transparent)] | 7099 | #[repr(transparent)] |
| 3412 | #[derive(Copy, Clone, Eq, PartialEq)] | 7100 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 3413 | pub struct Swier(pub u32); | 7101 | pub struct Sbk(pub u8); |
| 3414 | impl Swier { | 7102 | impl Sbk { |
| 3415 | #[doc = "Software Interrupt on line 0"] | 7103 | #[doc = "No break character is transmitted"] |
| 3416 | pub fn swier(&self, n: usize) -> bool { | 7104 | pub const NOBREAK: Self = Self(0); |
| 3417 | assert!(n < 23usize); | 7105 | #[doc = "Break character transmitted"] |
| 3418 | let offs = 0usize + n * 1usize; | 7106 | pub const BREAK: Self = Self(0x01); |
| 3419 | let val = (self.0 >> offs) & 0x01; | ||
| 3420 | val != 0 | ||
| 3421 | } | ||
| 3422 | #[doc = "Software Interrupt on line 0"] | ||
| 3423 | pub fn set_swier(&mut self, n: usize, val: bool) { | ||
| 3424 | assert!(n < 23usize); | ||
| 3425 | let offs = 0usize + n * 1usize; | ||
| 3426 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 3427 | } | ||
| 3428 | } | ||
| 3429 | impl Default for Swier { | ||
| 3430 | fn default() -> Swier { | ||
| 3431 | Swier(0) | ||
| 3432 | } | ||
| 3433 | } | 7107 | } |
| 3434 | #[doc = "Event mask register (EXTI_EMR)"] | ||
| 3435 | #[repr(transparent)] | 7108 | #[repr(transparent)] |
| 3436 | #[derive(Copy, Clone, Eq, PartialEq)] | 7109 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 3437 | pub struct Emr(pub u32); | 7110 | pub struct M(pub u8); |
| 3438 | impl Emr { | 7111 | impl M { |
| 3439 | #[doc = "Event Mask on line 0"] | 7112 | #[doc = "8 data bits"] |
| 3440 | pub fn mr(&self, n: usize) -> super::vals::Mr { | 7113 | pub const M8: Self = Self(0); |
| 3441 | assert!(n < 23usize); | 7114 | #[doc = "9 data bits"] |
| 3442 | let offs = 0usize + n * 1usize; | 7115 | pub const M9: Self = Self(0x01); |
| 3443 | let val = (self.0 >> offs) & 0x01; | ||
| 3444 | super::vals::Mr(val as u8) | ||
| 3445 | } | ||
| 3446 | #[doc = "Event Mask on line 0"] | ||
| 3447 | pub fn set_mr(&mut self, n: usize, val: super::vals::Mr) { | ||
| 3448 | assert!(n < 23usize); | ||
| 3449 | let offs = 0usize + n * 1usize; | ||
| 3450 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 3451 | } | ||
| 3452 | } | ||
| 3453 | impl Default for Emr { | ||
| 3454 | fn default() -> Emr { | ||
| 3455 | Emr(0) | ||
| 3456 | } | ||
| 3457 | } | 7116 | } |
| 3458 | #[doc = "Interrupt mask register (EXTI_IMR)"] | ||
| 3459 | #[repr(transparent)] | 7117 | #[repr(transparent)] |
| 3460 | #[derive(Copy, Clone, Eq, PartialEq)] | 7118 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 3461 | pub struct Imr(pub u32); | 7119 | pub struct Cpol(pub u8); |
| 3462 | impl Imr { | 7120 | impl Cpol { |
| 3463 | #[doc = "Interrupt Mask on line 0"] | 7121 | #[doc = "Steady low value on CK pin outside transmission window"] |
| 3464 | pub fn mr(&self, n: usize) -> super::vals::Mr { | 7122 | pub const LOW: Self = Self(0); |
| 3465 | assert!(n < 23usize); | 7123 | #[doc = "Steady high value on CK pin outside transmission window"] |
| 3466 | let offs = 0usize + n * 1usize; | 7124 | pub const HIGH: Self = Self(0x01); |
| 3467 | let val = (self.0 >> offs) & 0x01; | ||
| 3468 | super::vals::Mr(val as u8) | ||
| 3469 | } | ||
| 3470 | #[doc = "Interrupt Mask on line 0"] | ||
| 3471 | pub fn set_mr(&mut self, n: usize, val: super::vals::Mr) { | ||
| 3472 | assert!(n < 23usize); | ||
| 3473 | let offs = 0usize + n * 1usize; | ||
| 3474 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 3475 | } | ||
| 3476 | } | ||
| 3477 | impl Default for Imr { | ||
| 3478 | fn default() -> Imr { | ||
| 3479 | Imr(0) | ||
| 3480 | } | ||
| 3481 | } | 7125 | } |
| 3482 | #[doc = "Pending register (EXTI_PR)"] | ||
| 3483 | #[repr(transparent)] | 7126 | #[repr(transparent)] |
| 3484 | #[derive(Copy, Clone, Eq, PartialEq)] | 7127 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 3485 | pub struct Pr(pub u32); | 7128 | pub struct Irlp(pub u8); |
| 3486 | impl Pr { | 7129 | impl Irlp { |
| 3487 | #[doc = "Pending bit 0"] | 7130 | #[doc = "Normal mode"] |
| 3488 | pub fn pr(&self, n: usize) -> bool { | 7131 | pub const NORMAL: Self = Self(0); |
| 3489 | assert!(n < 23usize); | 7132 | #[doc = "Low-power mode"] |
| 3490 | let offs = 0usize + n * 1usize; | 7133 | pub const LOWPOWER: Self = Self(0x01); |
| 3491 | let val = (self.0 >> offs) & 0x01; | ||
| 3492 | val != 0 | ||
| 3493 | } | ||
| 3494 | #[doc = "Pending bit 0"] | ||
| 3495 | pub fn set_pr(&mut self, n: usize, val: bool) { | ||
| 3496 | assert!(n < 23usize); | ||
| 3497 | let offs = 0usize + n * 1usize; | ||
| 3498 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 3499 | } | ||
| 3500 | } | ||
| 3501 | impl Default for Pr { | ||
| 3502 | fn default() -> Pr { | ||
| 3503 | Pr(0) | ||
| 3504 | } | ||
| 3505 | } | ||
| 3506 | } | ||
| 3507 | } | ||
| 3508 | pub mod spi_v2 { | ||
| 3509 | use crate::generic::*; | ||
| 3510 | #[doc = "Serial peripheral interface"] | ||
| 3511 | #[derive(Copy, Clone)] | ||
| 3512 | pub struct Spi(pub *mut u8); | ||
| 3513 | unsafe impl Send for Spi {} | ||
| 3514 | unsafe impl Sync for Spi {} | ||
| 3515 | impl Spi { | ||
| 3516 | #[doc = "control register 1"] | ||
| 3517 | pub fn cr1(self) -> Reg<regs::Cr1, RW> { | ||
| 3518 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 3519 | } | ||
| 3520 | #[doc = "control register 2"] | ||
| 3521 | pub fn cr2(self) -> Reg<regs::Cr2, RW> { | ||
| 3522 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 3523 | } | ||
| 3524 | #[doc = "status register"] | ||
| 3525 | pub fn sr(self) -> Reg<regs::Sr, RW> { | ||
| 3526 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 3527 | } | ||
| 3528 | #[doc = "data register"] | ||
| 3529 | pub fn dr(self) -> Reg<regs::Dr, RW> { | ||
| 3530 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 3531 | } | ||
| 3532 | #[doc = "CRC polynomial register"] | ||
| 3533 | pub fn crcpr(self) -> Reg<regs::Crcpr, RW> { | ||
| 3534 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 3535 | } | ||
| 3536 | #[doc = "RX CRC register"] | ||
| 3537 | pub fn rxcrcr(self) -> Reg<regs::Rxcrcr, R> { | ||
| 3538 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 3539 | } | ||
| 3540 | #[doc = "TX CRC register"] | ||
| 3541 | pub fn txcrcr(self) -> Reg<regs::Txcrcr, R> { | ||
| 3542 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | ||
| 3543 | } | 7134 | } |
| 3544 | } | 7135 | } |
| 3545 | pub mod regs { | 7136 | pub mod regs { |
| 3546 | use crate::generic::*; | 7137 | use crate::generic::*; |
| 3547 | #[doc = "RX CRC register"] | 7138 | #[doc = "Baud rate register"] |
| 3548 | #[repr(transparent)] | 7139 | #[repr(transparent)] |
| 3549 | #[derive(Copy, Clone, Eq, PartialEq)] | 7140 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 3550 | pub struct Rxcrcr(pub u32); | 7141 | pub struct Brr(pub u32); |
| 3551 | impl Rxcrcr { | 7142 | impl Brr { |
| 3552 | #[doc = "Rx CRC register"] | 7143 | #[doc = "fraction of USARTDIV"] |
| 3553 | pub const fn rx_crc(&self) -> u16 { | 7144 | pub const fn div_fraction(&self) -> u8 { |
| 3554 | let val = (self.0 >> 0usize) & 0xffff; | 7145 | let val = (self.0 >> 0usize) & 0x0f; |
| 3555 | val as u16 | 7146 | val as u8 |
| 3556 | } | ||
| 3557 | #[doc = "Rx CRC register"] | ||
| 3558 | pub fn set_rx_crc(&mut self, val: u16) { | ||
| 3559 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 3560 | } | 7147 | } |
| 3561 | } | 7148 | #[doc = "fraction of USARTDIV"] |
| 3562 | impl Default for Rxcrcr { | 7149 | pub fn set_div_fraction(&mut self, val: u8) { |
| 3563 | fn default() -> Rxcrcr { | 7150 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); |
| 3564 | Rxcrcr(0) | ||
| 3565 | } | 7151 | } |
| 3566 | } | 7152 | #[doc = "mantissa of USARTDIV"] |
| 3567 | #[doc = "TX CRC register"] | 7153 | pub const fn div_mantissa(&self) -> u16 { |
| 3568 | #[repr(transparent)] | 7154 | let val = (self.0 >> 4usize) & 0x0fff; |
| 3569 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3570 | pub struct Txcrcr(pub u32); | ||
| 3571 | impl Txcrcr { | ||
| 3572 | #[doc = "Tx CRC register"] | ||
| 3573 | pub const fn tx_crc(&self) -> u16 { | ||
| 3574 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 3575 | val as u16 | 7155 | val as u16 |
| 3576 | } | 7156 | } |
| 3577 | #[doc = "Tx CRC register"] | 7157 | #[doc = "mantissa of USARTDIV"] |
| 3578 | pub fn set_tx_crc(&mut self, val: u16) { | 7158 | pub fn set_div_mantissa(&mut self, val: u16) { |
| 3579 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | 7159 | self.0 = (self.0 & !(0x0fff << 4usize)) | (((val as u32) & 0x0fff) << 4usize); |
| 3580 | } | 7160 | } |
| 3581 | } | 7161 | } |
| 3582 | impl Default for Txcrcr { | 7162 | impl Default for Brr { |
| 3583 | fn default() -> Txcrcr { | 7163 | fn default() -> Brr { |
| 3584 | Txcrcr(0) | 7164 | Brr(0) |
| 3585 | } | 7165 | } |
| 3586 | } | 7166 | } |
| 3587 | #[doc = "data register"] | 7167 | #[doc = "Data register"] |
| 3588 | #[repr(transparent)] | 7168 | #[repr(transparent)] |
| 3589 | #[derive(Copy, Clone, Eq, PartialEq)] | 7169 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 3590 | pub struct Dr(pub u32); | 7170 | pub struct Dr(pub u32); |
| 3591 | impl Dr { | 7171 | impl Dr { |
| 3592 | #[doc = "Data register"] | 7172 | #[doc = "Data value"] |
| 3593 | pub const fn dr(&self) -> u16 { | 7173 | pub const fn dr(&self) -> u16 { |
| 3594 | let val = (self.0 >> 0usize) & 0xffff; | 7174 | let val = (self.0 >> 0usize) & 0x01ff; |
| 3595 | val as u16 | 7175 | val as u16 |
| 3596 | } | 7176 | } |
| 3597 | #[doc = "Data register"] | 7177 | #[doc = "Data value"] |
| 3598 | pub fn set_dr(&mut self, val: u16) { | 7178 | pub fn set_dr(&mut self, val: u16) { |
| 3599 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | 7179 | self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize); |
| 3600 | } | 7180 | } |
| 3601 | } | 7181 | } |
| 3602 | impl Default for Dr { | 7182 | impl Default for Dr { |
| @@ -3604,5147 +7184,3220 @@ pub mod spi_v2 { | |||
| 3604 | Dr(0) | 7184 | Dr(0) |
| 3605 | } | 7185 | } |
| 3606 | } | 7186 | } |
| 3607 | #[doc = "status register"] | 7187 | #[doc = "Control register 3"] |
| 3608 | #[repr(transparent)] | 7188 | #[repr(transparent)] |
| 3609 | #[derive(Copy, Clone, Eq, PartialEq)] | 7189 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 3610 | pub struct Sr(pub u32); | 7190 | pub struct Cr3Usart(pub u32); |
| 3611 | impl Sr { | 7191 | impl Cr3Usart { |
| 3612 | #[doc = "Receive buffer not empty"] | 7192 | #[doc = "Error interrupt enable"] |
| 3613 | pub const fn rxne(&self) -> bool { | 7193 | pub const fn eie(&self) -> bool { |
| 3614 | let val = (self.0 >> 0usize) & 0x01; | 7194 | let val = (self.0 >> 0usize) & 0x01; |
| 3615 | val != 0 | 7195 | val != 0 |
| 3616 | } | 7196 | } |
| 3617 | #[doc = "Receive buffer not empty"] | 7197 | #[doc = "Error interrupt enable"] |
| 3618 | pub fn set_rxne(&mut self, val: bool) { | 7198 | pub fn set_eie(&mut self, val: bool) { |
| 3619 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 7199 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 3620 | } | 7200 | } |
| 3621 | #[doc = "Transmit buffer empty"] | 7201 | #[doc = "IrDA mode enable"] |
| 3622 | pub const fn txe(&self) -> bool { | 7202 | pub const fn iren(&self) -> bool { |
| 3623 | let val = (self.0 >> 1usize) & 0x01; | 7203 | let val = (self.0 >> 1usize) & 0x01; |
| 3624 | val != 0 | 7204 | val != 0 |
| 3625 | } | 7205 | } |
| 3626 | #[doc = "Transmit buffer empty"] | 7206 | #[doc = "IrDA mode enable"] |
| 3627 | pub fn set_txe(&mut self, val: bool) { | 7207 | pub fn set_iren(&mut self, val: bool) { |
| 3628 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 7208 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 3629 | } | 7209 | } |
| 3630 | #[doc = "CRC error flag"] | 7210 | #[doc = "IrDA low-power"] |
| 3631 | pub const fn crcerr(&self) -> bool { | 7211 | pub const fn irlp(&self) -> super::vals::Irlp { |
| 7212 | let val = (self.0 >> 2usize) & 0x01; | ||
| 7213 | super::vals::Irlp(val as u8) | ||
| 7214 | } | ||
| 7215 | #[doc = "IrDA low-power"] | ||
| 7216 | pub fn set_irlp(&mut self, val: super::vals::Irlp) { | ||
| 7217 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 7218 | } | ||
| 7219 | #[doc = "Half-duplex selection"] | ||
| 7220 | pub const fn hdsel(&self) -> super::vals::Hdsel { | ||
| 7221 | let val = (self.0 >> 3usize) & 0x01; | ||
| 7222 | super::vals::Hdsel(val as u8) | ||
| 7223 | } | ||
| 7224 | #[doc = "Half-duplex selection"] | ||
| 7225 | pub fn set_hdsel(&mut self, val: super::vals::Hdsel) { | ||
| 7226 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 7227 | } | ||
| 7228 | #[doc = "Smartcard NACK enable"] | ||
| 7229 | pub const fn nack(&self) -> bool { | ||
| 3632 | let val = (self.0 >> 4usize) & 0x01; | 7230 | let val = (self.0 >> 4usize) & 0x01; |
| 3633 | val != 0 | 7231 | val != 0 |
| 3634 | } | 7232 | } |
| 3635 | #[doc = "CRC error flag"] | 7233 | #[doc = "Smartcard NACK enable"] |
| 3636 | pub fn set_crcerr(&mut self, val: bool) { | 7234 | pub fn set_nack(&mut self, val: bool) { |
| 3637 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 7235 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 3638 | } | 7236 | } |
| 3639 | #[doc = "Mode fault"] | 7237 | #[doc = "Smartcard mode enable"] |
| 3640 | pub const fn modf(&self) -> bool { | 7238 | pub const fn scen(&self) -> bool { |
| 3641 | let val = (self.0 >> 5usize) & 0x01; | 7239 | let val = (self.0 >> 5usize) & 0x01; |
| 3642 | val != 0 | 7240 | val != 0 |
| 3643 | } | 7241 | } |
| 3644 | #[doc = "Mode fault"] | 7242 | #[doc = "Smartcard mode enable"] |
| 3645 | pub fn set_modf(&mut self, val: bool) { | 7243 | pub fn set_scen(&mut self, val: bool) { |
| 3646 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 7244 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 3647 | } | 7245 | } |
| 3648 | #[doc = "Overrun flag"] | 7246 | #[doc = "DMA enable receiver"] |
| 3649 | pub const fn ovr(&self) -> bool { | 7247 | pub const fn dmar(&self) -> bool { |
| 3650 | let val = (self.0 >> 6usize) & 0x01; | 7248 | let val = (self.0 >> 6usize) & 0x01; |
| 3651 | val != 0 | 7249 | val != 0 |
| 3652 | } | 7250 | } |
| 3653 | #[doc = "Overrun flag"] | 7251 | #[doc = "DMA enable receiver"] |
| 3654 | pub fn set_ovr(&mut self, val: bool) { | 7252 | pub fn set_dmar(&mut self, val: bool) { |
| 3655 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 7253 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 3656 | } | 7254 | } |
| 3657 | #[doc = "Busy flag"] | 7255 | #[doc = "DMA enable transmitter"] |
| 3658 | pub const fn bsy(&self) -> bool { | 7256 | pub const fn dmat(&self) -> bool { |
| 3659 | let val = (self.0 >> 7usize) & 0x01; | 7257 | let val = (self.0 >> 7usize) & 0x01; |
| 3660 | val != 0 | 7258 | val != 0 |
| 3661 | } | 7259 | } |
| 3662 | #[doc = "Busy flag"] | 7260 | #[doc = "DMA enable transmitter"] |
| 3663 | pub fn set_bsy(&mut self, val: bool) { | 7261 | pub fn set_dmat(&mut self, val: bool) { |
| 3664 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 7262 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 3665 | } | 7263 | } |
| 3666 | #[doc = "Frame format error"] | 7264 | #[doc = "RTS enable"] |
| 3667 | pub const fn fre(&self) -> bool { | 7265 | pub const fn rtse(&self) -> bool { |
| 3668 | let val = (self.0 >> 8usize) & 0x01; | 7266 | let val = (self.0 >> 8usize) & 0x01; |
| 3669 | val != 0 | 7267 | val != 0 |
| 3670 | } | 7268 | } |
| 3671 | #[doc = "Frame format error"] | 7269 | #[doc = "RTS enable"] |
| 3672 | pub fn set_fre(&mut self, val: bool) { | 7270 | pub fn set_rtse(&mut self, val: bool) { |
| 3673 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 7271 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 3674 | } | 7272 | } |
| 3675 | #[doc = "FIFO reception level"] | 7273 | #[doc = "CTS enable"] |
| 3676 | pub const fn frlvl(&self) -> u8 { | 7274 | pub const fn ctse(&self) -> bool { |
| 3677 | let val = (self.0 >> 9usize) & 0x03; | 7275 | let val = (self.0 >> 9usize) & 0x01; |
| 3678 | val as u8 | 7276 | val != 0 |
| 3679 | } | 7277 | } |
| 3680 | #[doc = "FIFO reception level"] | 7278 | #[doc = "CTS enable"] |
| 3681 | pub fn set_frlvl(&mut self, val: u8) { | 7279 | pub fn set_ctse(&mut self, val: bool) { |
| 3682 | self.0 = (self.0 & !(0x03 << 9usize)) | (((val as u32) & 0x03) << 9usize); | 7280 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); |
| 3683 | } | 7281 | } |
| 3684 | #[doc = "FIFO Transmission Level"] | 7282 | #[doc = "CTS interrupt enable"] |
| 3685 | pub const fn ftlvl(&self) -> u8 { | 7283 | pub const fn ctsie(&self) -> bool { |
| 3686 | let val = (self.0 >> 11usize) & 0x03; | 7284 | let val = (self.0 >> 10usize) & 0x01; |
| 3687 | val as u8 | 7285 | val != 0 |
| 3688 | } | 7286 | } |
| 3689 | #[doc = "FIFO Transmission Level"] | 7287 | #[doc = "CTS interrupt enable"] |
| 3690 | pub fn set_ftlvl(&mut self, val: u8) { | 7288 | pub fn set_ctsie(&mut self, val: bool) { |
| 3691 | self.0 = (self.0 & !(0x03 << 11usize)) | (((val as u32) & 0x03) << 11usize); | 7289 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); |
| 3692 | } | 7290 | } |
| 3693 | } | 7291 | } |
| 3694 | impl Default for Sr { | 7292 | impl Default for Cr3Usart { |
| 3695 | fn default() -> Sr { | 7293 | fn default() -> Cr3Usart { |
| 3696 | Sr(0) | 7294 | Cr3Usart(0) |
| 3697 | } | 7295 | } |
| 3698 | } | 7296 | } |
| 3699 | #[doc = "control register 2"] | 7297 | #[doc = "Status register"] |
| 3700 | #[repr(transparent)] | 7298 | #[repr(transparent)] |
| 3701 | #[derive(Copy, Clone, Eq, PartialEq)] | 7299 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 3702 | pub struct Cr2(pub u32); | 7300 | pub struct Sr(pub u32); |
| 3703 | impl Cr2 { | 7301 | impl Sr { |
| 3704 | #[doc = "Rx buffer DMA enable"] | 7302 | #[doc = "Parity error"] |
| 3705 | pub const fn rxdmaen(&self) -> bool { | 7303 | pub const fn pe(&self) -> bool { |
| 3706 | let val = (self.0 >> 0usize) & 0x01; | 7304 | let val = (self.0 >> 0usize) & 0x01; |
| 3707 | val != 0 | 7305 | val != 0 |
| 3708 | } | 7306 | } |
| 3709 | #[doc = "Rx buffer DMA enable"] | 7307 | #[doc = "Parity error"] |
| 3710 | pub fn set_rxdmaen(&mut self, val: bool) { | 7308 | pub fn set_pe(&mut self, val: bool) { |
| 3711 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 7309 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 3712 | } | 7310 | } |
| 3713 | #[doc = "Tx buffer DMA enable"] | 7311 | #[doc = "Framing error"] |
| 3714 | pub const fn txdmaen(&self) -> bool { | 7312 | pub const fn fe(&self) -> bool { |
| 3715 | let val = (self.0 >> 1usize) & 0x01; | 7313 | let val = (self.0 >> 1usize) & 0x01; |
| 3716 | val != 0 | 7314 | val != 0 |
| 3717 | } | 7315 | } |
| 3718 | #[doc = "Tx buffer DMA enable"] | 7316 | #[doc = "Framing error"] |
| 3719 | pub fn set_txdmaen(&mut self, val: bool) { | 7317 | pub fn set_fe(&mut self, val: bool) { |
| 3720 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 7318 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 3721 | } | 7319 | } |
| 3722 | #[doc = "SS output enable"] | 7320 | #[doc = "Noise error flag"] |
| 3723 | pub const fn ssoe(&self) -> bool { | 7321 | pub const fn ne(&self) -> bool { |
| 3724 | let val = (self.0 >> 2usize) & 0x01; | 7322 | let val = (self.0 >> 2usize) & 0x01; |
| 3725 | val != 0 | 7323 | val != 0 |
| 3726 | } | 7324 | } |
| 3727 | #[doc = "SS output enable"] | 7325 | #[doc = "Noise error flag"] |
| 3728 | pub fn set_ssoe(&mut self, val: bool) { | 7326 | pub fn set_ne(&mut self, val: bool) { |
| 3729 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 7327 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 3730 | } | 7328 | } |
| 3731 | #[doc = "NSS pulse management"] | 7329 | #[doc = "Overrun error"] |
| 3732 | pub const fn nssp(&self) -> bool { | 7330 | pub const fn ore(&self) -> bool { |
| 3733 | let val = (self.0 >> 3usize) & 0x01; | 7331 | let val = (self.0 >> 3usize) & 0x01; |
| 3734 | val != 0 | 7332 | val != 0 |
| 3735 | } | 7333 | } |
| 3736 | #[doc = "NSS pulse management"] | 7334 | #[doc = "Overrun error"] |
| 3737 | pub fn set_nssp(&mut self, val: bool) { | 7335 | pub fn set_ore(&mut self, val: bool) { |
| 3738 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 7336 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); |
| 3739 | } | 7337 | } |
| 3740 | #[doc = "Frame format"] | 7338 | #[doc = "IDLE line detected"] |
| 3741 | pub const fn frf(&self) -> super::vals::Frf { | 7339 | pub const fn idle(&self) -> bool { |
| 3742 | let val = (self.0 >> 4usize) & 0x01; | 7340 | let val = (self.0 >> 4usize) & 0x01; |
| 3743 | super::vals::Frf(val as u8) | 7341 | val != 0 |
| 3744 | } | 7342 | } |
| 3745 | #[doc = "Frame format"] | 7343 | #[doc = "IDLE line detected"] |
| 3746 | pub fn set_frf(&mut self, val: super::vals::Frf) { | 7344 | pub fn set_idle(&mut self, val: bool) { |
| 3747 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | 7345 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 3748 | } | 7346 | } |
| 3749 | #[doc = "Error interrupt enable"] | 7347 | #[doc = "Read data register not empty"] |
| 3750 | pub const fn errie(&self) -> bool { | 7348 | pub const fn rxne(&self) -> bool { |
| 3751 | let val = (self.0 >> 5usize) & 0x01; | 7349 | let val = (self.0 >> 5usize) & 0x01; |
| 3752 | val != 0 | 7350 | val != 0 |
| 3753 | } | 7351 | } |
| 3754 | #[doc = "Error interrupt enable"] | 7352 | #[doc = "Read data register not empty"] |
| 3755 | pub fn set_errie(&mut self, val: bool) { | 7353 | pub fn set_rxne(&mut self, val: bool) { |
| 3756 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 7354 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 3757 | } | 7355 | } |
| 3758 | #[doc = "RX buffer not empty interrupt enable"] | 7356 | #[doc = "Transmission complete"] |
| 3759 | pub const fn rxneie(&self) -> bool { | 7357 | pub const fn tc(&self) -> bool { |
| 3760 | let val = (self.0 >> 6usize) & 0x01; | 7358 | let val = (self.0 >> 6usize) & 0x01; |
| 3761 | val != 0 | 7359 | val != 0 |
| 3762 | } | 7360 | } |
| 3763 | #[doc = "RX buffer not empty interrupt enable"] | 7361 | #[doc = "Transmission complete"] |
| 3764 | pub fn set_rxneie(&mut self, val: bool) { | 7362 | pub fn set_tc(&mut self, val: bool) { |
| 3765 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 7363 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 3766 | } | 7364 | } |
| 3767 | #[doc = "Tx buffer empty interrupt enable"] | 7365 | #[doc = "Transmit data register empty"] |
| 3768 | pub const fn txeie(&self) -> bool { | 7366 | pub const fn txe(&self) -> bool { |
| 3769 | let val = (self.0 >> 7usize) & 0x01; | 7367 | let val = (self.0 >> 7usize) & 0x01; |
| 3770 | val != 0 | 7368 | val != 0 |
| 3771 | } | 7369 | } |
| 3772 | #[doc = "Tx buffer empty interrupt enable"] | 7370 | #[doc = "Transmit data register empty"] |
| 3773 | pub fn set_txeie(&mut self, val: bool) { | 7371 | pub fn set_txe(&mut self, val: bool) { |
| 3774 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 7372 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 3775 | } | 7373 | } |
| 3776 | #[doc = "Data size"] | 7374 | #[doc = "LIN break detection flag"] |
| 3777 | pub const fn ds(&self) -> super::vals::Ds { | 7375 | pub const fn lbd(&self) -> bool { |
| 3778 | let val = (self.0 >> 8usize) & 0x0f; | 7376 | let val = (self.0 >> 8usize) & 0x01; |
| 3779 | super::vals::Ds(val as u8) | 7377 | val != 0 |
| 3780 | } | ||
| 3781 | #[doc = "Data size"] | ||
| 3782 | pub fn set_ds(&mut self, val: super::vals::Ds) { | ||
| 3783 | self.0 = (self.0 & !(0x0f << 8usize)) | (((val.0 as u32) & 0x0f) << 8usize); | ||
| 3784 | } | ||
| 3785 | #[doc = "FIFO reception threshold"] | ||
| 3786 | pub const fn frxth(&self) -> super::vals::Frxth { | ||
| 3787 | let val = (self.0 >> 12usize) & 0x01; | ||
| 3788 | super::vals::Frxth(val as u8) | ||
| 3789 | } | ||
| 3790 | #[doc = "FIFO reception threshold"] | ||
| 3791 | pub fn set_frxth(&mut self, val: super::vals::Frxth) { | ||
| 3792 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 3793 | } | ||
| 3794 | #[doc = "Last DMA transfer for reception"] | ||
| 3795 | pub const fn ldma_rx(&self) -> super::vals::LdmaRx { | ||
| 3796 | let val = (self.0 >> 13usize) & 0x01; | ||
| 3797 | super::vals::LdmaRx(val as u8) | ||
| 3798 | } | ||
| 3799 | #[doc = "Last DMA transfer for reception"] | ||
| 3800 | pub fn set_ldma_rx(&mut self, val: super::vals::LdmaRx) { | ||
| 3801 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize); | ||
| 3802 | } | ||
| 3803 | #[doc = "Last DMA transfer for transmission"] | ||
| 3804 | pub const fn ldma_tx(&self) -> super::vals::LdmaTx { | ||
| 3805 | let val = (self.0 >> 14usize) & 0x01; | ||
| 3806 | super::vals::LdmaTx(val as u8) | ||
| 3807 | } | ||
| 3808 | #[doc = "Last DMA transfer for transmission"] | ||
| 3809 | pub fn set_ldma_tx(&mut self, val: super::vals::LdmaTx) { | ||
| 3810 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | ||
| 3811 | } | ||
| 3812 | } | ||
| 3813 | impl Default for Cr2 { | ||
| 3814 | fn default() -> Cr2 { | ||
| 3815 | Cr2(0) | ||
| 3816 | } | ||
| 3817 | } | ||
| 3818 | #[doc = "CRC polynomial register"] | ||
| 3819 | #[repr(transparent)] | ||
| 3820 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 3821 | pub struct Crcpr(pub u32); | ||
| 3822 | impl Crcpr { | ||
| 3823 | #[doc = "CRC polynomial register"] | ||
| 3824 | pub const fn crcpoly(&self) -> u16 { | ||
| 3825 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 3826 | val as u16 | ||
| 3827 | } | 7378 | } |
| 3828 | #[doc = "CRC polynomial register"] | 7379 | #[doc = "LIN break detection flag"] |
| 3829 | pub fn set_crcpoly(&mut self, val: u16) { | 7380 | pub fn set_lbd(&mut self, val: bool) { |
| 3830 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | 7381 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 3831 | } | 7382 | } |
| 3832 | } | 7383 | } |
| 3833 | impl Default for Crcpr { | 7384 | impl Default for Sr { |
| 3834 | fn default() -> Crcpr { | 7385 | fn default() -> Sr { |
| 3835 | Crcpr(0) | 7386 | Sr(0) |
| 3836 | } | 7387 | } |
| 3837 | } | 7388 | } |
| 3838 | #[doc = "control register 1"] | 7389 | #[doc = "Control register 3"] |
| 3839 | #[repr(transparent)] | 7390 | #[repr(transparent)] |
| 3840 | #[derive(Copy, Clone, Eq, PartialEq)] | 7391 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 3841 | pub struct Cr1(pub u32); | 7392 | pub struct Cr3(pub u32); |
| 3842 | impl Cr1 { | 7393 | impl Cr3 { |
| 3843 | #[doc = "Clock phase"] | 7394 | #[doc = "Error interrupt enable"] |
| 3844 | pub const fn cpha(&self) -> super::vals::Cpha { | 7395 | pub const fn eie(&self) -> bool { |
| 3845 | let val = (self.0 >> 0usize) & 0x01; | 7396 | let val = (self.0 >> 0usize) & 0x01; |
| 3846 | super::vals::Cpha(val as u8) | 7397 | val != 0 |
| 3847 | } | 7398 | } |
| 3848 | #[doc = "Clock phase"] | 7399 | #[doc = "Error interrupt enable"] |
| 3849 | pub fn set_cpha(&mut self, val: super::vals::Cpha) { | 7400 | pub fn set_eie(&mut self, val: bool) { |
| 3850 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | 7401 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 3851 | } | 7402 | } |
| 3852 | #[doc = "Clock polarity"] | 7403 | #[doc = "IrDA mode enable"] |
| 3853 | pub const fn cpol(&self) -> super::vals::Cpol { | 7404 | pub const fn iren(&self) -> bool { |
| 3854 | let val = (self.0 >> 1usize) & 0x01; | 7405 | let val = (self.0 >> 1usize) & 0x01; |
| 3855 | super::vals::Cpol(val as u8) | 7406 | val != 0 |
| 3856 | } | 7407 | } |
| 3857 | #[doc = "Clock polarity"] | 7408 | #[doc = "IrDA mode enable"] |
| 3858 | pub fn set_cpol(&mut self, val: super::vals::Cpol) { | 7409 | pub fn set_iren(&mut self, val: bool) { |
| 3859 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | 7410 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 3860 | } | 7411 | } |
| 3861 | #[doc = "Master selection"] | 7412 | #[doc = "IrDA low-power"] |
| 3862 | pub const fn mstr(&self) -> super::vals::Mstr { | 7413 | pub const fn irlp(&self) -> super::vals::Irlp { |
| 3863 | let val = (self.0 >> 2usize) & 0x01; | 7414 | let val = (self.0 >> 2usize) & 0x01; |
| 3864 | super::vals::Mstr(val as u8) | 7415 | super::vals::Irlp(val as u8) |
| 3865 | } | 7416 | } |
| 3866 | #[doc = "Master selection"] | 7417 | #[doc = "IrDA low-power"] |
| 3867 | pub fn set_mstr(&mut self, val: super::vals::Mstr) { | 7418 | pub fn set_irlp(&mut self, val: super::vals::Irlp) { |
| 3868 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | 7419 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); |
| 3869 | } | 7420 | } |
| 3870 | #[doc = "Baud rate control"] | 7421 | #[doc = "Half-duplex selection"] |
| 3871 | pub const fn br(&self) -> super::vals::Br { | 7422 | pub const fn hdsel(&self) -> super::vals::Hdsel { |
| 3872 | let val = (self.0 >> 3usize) & 0x07; | 7423 | let val = (self.0 >> 3usize) & 0x01; |
| 3873 | super::vals::Br(val as u8) | 7424 | super::vals::Hdsel(val as u8) |
| 3874 | } | 7425 | } |
| 3875 | #[doc = "Baud rate control"] | 7426 | #[doc = "Half-duplex selection"] |
| 3876 | pub fn set_br(&mut self, val: super::vals::Br) { | 7427 | pub fn set_hdsel(&mut self, val: super::vals::Hdsel) { |
| 3877 | self.0 = (self.0 & !(0x07 << 3usize)) | (((val.0 as u32) & 0x07) << 3usize); | 7428 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); |
| 3878 | } | 7429 | } |
| 3879 | #[doc = "SPI enable"] | 7430 | #[doc = "DMA enable receiver"] |
| 3880 | pub const fn spe(&self) -> bool { | 7431 | pub const fn dmar(&self) -> bool { |
| 3881 | let val = (self.0 >> 6usize) & 0x01; | 7432 | let val = (self.0 >> 6usize) & 0x01; |
| 3882 | val != 0 | 7433 | val != 0 |
| 3883 | } | 7434 | } |
| 3884 | #[doc = "SPI enable"] | 7435 | #[doc = "DMA enable receiver"] |
| 3885 | pub fn set_spe(&mut self, val: bool) { | 7436 | pub fn set_dmar(&mut self, val: bool) { |
| 3886 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 7437 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 3887 | } | 7438 | } |
| 3888 | #[doc = "Frame format"] | 7439 | #[doc = "DMA enable transmitter"] |
| 3889 | pub const fn lsbfirst(&self) -> super::vals::Lsbfirst { | 7440 | pub const fn dmat(&self) -> bool { |
| 3890 | let val = (self.0 >> 7usize) & 0x01; | 7441 | let val = (self.0 >> 7usize) & 0x01; |
| 3891 | super::vals::Lsbfirst(val as u8) | 7442 | val != 0 |
| 3892 | } | 7443 | } |
| 3893 | #[doc = "Frame format"] | 7444 | #[doc = "DMA enable transmitter"] |
| 3894 | pub fn set_lsbfirst(&mut self, val: super::vals::Lsbfirst) { | 7445 | pub fn set_dmat(&mut self, val: bool) { |
| 3895 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | 7446 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 3896 | } | 7447 | } |
| 3897 | #[doc = "Internal slave select"] | 7448 | } |
| 3898 | pub const fn ssi(&self) -> bool { | 7449 | impl Default for Cr3 { |
| 7450 | fn default() -> Cr3 { | ||
| 7451 | Cr3(0) | ||
| 7452 | } | ||
| 7453 | } | ||
| 7454 | #[doc = "Control register 2"] | ||
| 7455 | #[repr(transparent)] | ||
| 7456 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 7457 | pub struct Cr2Usart(pub u32); | ||
| 7458 | impl Cr2Usart { | ||
| 7459 | #[doc = "Address of the USART node"] | ||
| 7460 | pub const fn add(&self) -> u8 { | ||
| 7461 | let val = (self.0 >> 0usize) & 0x0f; | ||
| 7462 | val as u8 | ||
| 7463 | } | ||
| 7464 | #[doc = "Address of the USART node"] | ||
| 7465 | pub fn set_add(&mut self, val: u8) { | ||
| 7466 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); | ||
| 7467 | } | ||
| 7468 | #[doc = "lin break detection length"] | ||
| 7469 | pub const fn lbdl(&self) -> super::vals::Lbdl { | ||
| 7470 | let val = (self.0 >> 5usize) & 0x01; | ||
| 7471 | super::vals::Lbdl(val as u8) | ||
| 7472 | } | ||
| 7473 | #[doc = "lin break detection length"] | ||
| 7474 | pub fn set_lbdl(&mut self, val: super::vals::Lbdl) { | ||
| 7475 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 7476 | } | ||
| 7477 | #[doc = "LIN break detection interrupt enable"] | ||
| 7478 | pub const fn lbdie(&self) -> bool { | ||
| 7479 | let val = (self.0 >> 6usize) & 0x01; | ||
| 7480 | val != 0 | ||
| 7481 | } | ||
| 7482 | #[doc = "LIN break detection interrupt enable"] | ||
| 7483 | pub fn set_lbdie(&mut self, val: bool) { | ||
| 7484 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 7485 | } | ||
| 7486 | #[doc = "Last bit clock pulse"] | ||
| 7487 | pub const fn lbcl(&self) -> bool { | ||
| 3899 | let val = (self.0 >> 8usize) & 0x01; | 7488 | let val = (self.0 >> 8usize) & 0x01; |
| 3900 | val != 0 | 7489 | val != 0 |
| 3901 | } | 7490 | } |
| 3902 | #[doc = "Internal slave select"] | 7491 | #[doc = "Last bit clock pulse"] |
| 3903 | pub fn set_ssi(&mut self, val: bool) { | 7492 | pub fn set_lbcl(&mut self, val: bool) { |
| 3904 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 7493 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 3905 | } | 7494 | } |
| 3906 | #[doc = "Software slave management"] | 7495 | #[doc = "Clock phase"] |
| 3907 | pub const fn ssm(&self) -> bool { | 7496 | pub const fn cpha(&self) -> super::vals::Cpha { |
| 3908 | let val = (self.0 >> 9usize) & 0x01; | 7497 | let val = (self.0 >> 9usize) & 0x01; |
| 3909 | val != 0 | 7498 | super::vals::Cpha(val as u8) |
| 3910 | } | 7499 | } |
| 3911 | #[doc = "Software slave management"] | 7500 | #[doc = "Clock phase"] |
| 3912 | pub fn set_ssm(&mut self, val: bool) { | 7501 | pub fn set_cpha(&mut self, val: super::vals::Cpha) { |
| 3913 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | 7502 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); |
| 3914 | } | 7503 | } |
| 3915 | #[doc = "Receive only"] | 7504 | #[doc = "Clock polarity"] |
| 3916 | pub const fn rxonly(&self) -> super::vals::Rxonly { | 7505 | pub const fn cpol(&self) -> super::vals::Cpol { |
| 3917 | let val = (self.0 >> 10usize) & 0x01; | 7506 | let val = (self.0 >> 10usize) & 0x01; |
| 3918 | super::vals::Rxonly(val as u8) | 7507 | super::vals::Cpol(val as u8) |
| 3919 | } | 7508 | } |
| 3920 | #[doc = "Receive only"] | 7509 | #[doc = "Clock polarity"] |
| 3921 | pub fn set_rxonly(&mut self, val: super::vals::Rxonly) { | 7510 | pub fn set_cpol(&mut self, val: super::vals::Cpol) { |
| 3922 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); | 7511 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); |
| 3923 | } | 7512 | } |
| 3924 | #[doc = "CRC length"] | 7513 | #[doc = "Clock enable"] |
| 3925 | pub const fn crcl(&self) -> super::vals::Crcl { | 7514 | pub const fn clken(&self) -> bool { |
| 3926 | let val = (self.0 >> 11usize) & 0x01; | 7515 | let val = (self.0 >> 11usize) & 0x01; |
| 3927 | super::vals::Crcl(val as u8) | ||
| 3928 | } | ||
| 3929 | #[doc = "CRC length"] | ||
| 3930 | pub fn set_crcl(&mut self, val: super::vals::Crcl) { | ||
| 3931 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); | ||
| 3932 | } | ||
| 3933 | #[doc = "CRC transfer next"] | ||
| 3934 | pub const fn crcnext(&self) -> super::vals::Crcnext { | ||
| 3935 | let val = (self.0 >> 12usize) & 0x01; | ||
| 3936 | super::vals::Crcnext(val as u8) | ||
| 3937 | } | ||
| 3938 | #[doc = "CRC transfer next"] | ||
| 3939 | pub fn set_crcnext(&mut self, val: super::vals::Crcnext) { | ||
| 3940 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 3941 | } | ||
| 3942 | #[doc = "Hardware CRC calculation enable"] | ||
| 3943 | pub const fn crcen(&self) -> bool { | ||
| 3944 | let val = (self.0 >> 13usize) & 0x01; | ||
| 3945 | val != 0 | 7516 | val != 0 |
| 3946 | } | 7517 | } |
| 3947 | #[doc = "Hardware CRC calculation enable"] | 7518 | #[doc = "Clock enable"] |
| 3948 | pub fn set_crcen(&mut self, val: bool) { | 7519 | pub fn set_clken(&mut self, val: bool) { |
| 3949 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | 7520 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); |
| 3950 | } | 7521 | } |
| 3951 | #[doc = "Output enable in bidirectional mode"] | 7522 | #[doc = "STOP bits"] |
| 3952 | pub const fn bidioe(&self) -> super::vals::Bidioe { | 7523 | pub const fn stop(&self) -> super::vals::Stop { |
| 3953 | let val = (self.0 >> 14usize) & 0x01; | 7524 | let val = (self.0 >> 12usize) & 0x03; |
| 3954 | super::vals::Bidioe(val as u8) | 7525 | super::vals::Stop(val as u8) |
| 3955 | } | 7526 | } |
| 3956 | #[doc = "Output enable in bidirectional mode"] | 7527 | #[doc = "STOP bits"] |
| 3957 | pub fn set_bidioe(&mut self, val: super::vals::Bidioe) { | 7528 | pub fn set_stop(&mut self, val: super::vals::Stop) { |
| 3958 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | 7529 | self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize); |
| 3959 | } | 7530 | } |
| 3960 | #[doc = "Bidirectional data mode enable"] | 7531 | #[doc = "LIN mode enable"] |
| 3961 | pub const fn bidimode(&self) -> super::vals::Bidimode { | 7532 | pub const fn linen(&self) -> bool { |
| 3962 | let val = (self.0 >> 15usize) & 0x01; | 7533 | let val = (self.0 >> 14usize) & 0x01; |
| 3963 | super::vals::Bidimode(val as u8) | 7534 | val != 0 |
| 3964 | } | 7535 | } |
| 3965 | #[doc = "Bidirectional data mode enable"] | 7536 | #[doc = "LIN mode enable"] |
| 3966 | pub fn set_bidimode(&mut self, val: super::vals::Bidimode) { | 7537 | pub fn set_linen(&mut self, val: bool) { |
| 3967 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | 7538 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); |
| 3968 | } | 7539 | } |
| 3969 | } | 7540 | } |
| 3970 | impl Default for Cr1 { | 7541 | impl Default for Cr2Usart { |
| 3971 | fn default() -> Cr1 { | 7542 | fn default() -> Cr2Usart { |
| 3972 | Cr1(0) | 7543 | Cr2Usart(0) |
| 3973 | } | 7544 | } |
| 3974 | } | 7545 | } |
| 3975 | } | 7546 | #[doc = "Status register"] |
| 3976 | pub mod vals { | ||
| 3977 | use crate::generic::*; | ||
| 3978 | #[repr(transparent)] | ||
| 3979 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 3980 | pub struct Br(pub u8); | ||
| 3981 | impl Br { | ||
| 3982 | #[doc = "f_PCLK / 2"] | ||
| 3983 | pub const DIV2: Self = Self(0); | ||
| 3984 | #[doc = "f_PCLK / 4"] | ||
| 3985 | pub const DIV4: Self = Self(0x01); | ||
| 3986 | #[doc = "f_PCLK / 8"] | ||
| 3987 | pub const DIV8: Self = Self(0x02); | ||
| 3988 | #[doc = "f_PCLK / 16"] | ||
| 3989 | pub const DIV16: Self = Self(0x03); | ||
| 3990 | #[doc = "f_PCLK / 32"] | ||
| 3991 | pub const DIV32: Self = Self(0x04); | ||
| 3992 | #[doc = "f_PCLK / 64"] | ||
| 3993 | pub const DIV64: Self = Self(0x05); | ||
| 3994 | #[doc = "f_PCLK / 128"] | ||
| 3995 | pub const DIV128: Self = Self(0x06); | ||
| 3996 | #[doc = "f_PCLK / 256"] | ||
| 3997 | pub const DIV256: Self = Self(0x07); | ||
| 3998 | } | ||
| 3999 | #[repr(transparent)] | ||
| 4000 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4001 | pub struct LdmaRx(pub u8); | ||
| 4002 | impl LdmaRx { | ||
| 4003 | #[doc = "Number of data to transfer for receive is even"] | ||
| 4004 | pub const EVEN: Self = Self(0); | ||
| 4005 | #[doc = "Number of data to transfer for receive is odd"] | ||
| 4006 | pub const ODD: Self = Self(0x01); | ||
| 4007 | } | ||
| 4008 | #[repr(transparent)] | ||
| 4009 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4010 | pub struct Cpol(pub u8); | ||
| 4011 | impl Cpol { | ||
| 4012 | #[doc = "CK to 0 when idle"] | ||
| 4013 | pub const IDLELOW: Self = Self(0); | ||
| 4014 | #[doc = "CK to 1 when idle"] | ||
| 4015 | pub const IDLEHIGH: Self = Self(0x01); | ||
| 4016 | } | ||
| 4017 | #[repr(transparent)] | ||
| 4018 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4019 | pub struct Ftlvlr(pub u8); | ||
| 4020 | impl Ftlvlr { | ||
| 4021 | #[doc = "Tx FIFO Empty"] | ||
| 4022 | pub const EMPTY: Self = Self(0); | ||
| 4023 | #[doc = "Tx 1/4 FIFO"] | ||
| 4024 | pub const QUARTER: Self = Self(0x01); | ||
| 4025 | #[doc = "Tx 1/2 FIFO"] | ||
| 4026 | pub const HALF: Self = Self(0x02); | ||
| 4027 | #[doc = "Tx FIFO full"] | ||
| 4028 | pub const FULL: Self = Self(0x03); | ||
| 4029 | } | ||
| 4030 | #[repr(transparent)] | ||
| 4031 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4032 | pub struct Bidioe(pub u8); | ||
| 4033 | impl Bidioe { | ||
| 4034 | #[doc = "Output disabled (receive-only mode)"] | ||
| 4035 | pub const OUTPUTDISABLED: Self = Self(0); | ||
| 4036 | #[doc = "Output enabled (transmit-only mode)"] | ||
| 4037 | pub const OUTPUTENABLED: Self = Self(0x01); | ||
| 4038 | } | ||
| 4039 | #[repr(transparent)] | ||
| 4040 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4041 | pub struct Bidimode(pub u8); | ||
| 4042 | impl Bidimode { | ||
| 4043 | #[doc = "2-line unidirectional data mode selected"] | ||
| 4044 | pub const UNIDIRECTIONAL: Self = Self(0); | ||
| 4045 | #[doc = "1-line bidirectional data mode selected"] | ||
| 4046 | pub const BIDIRECTIONAL: Self = Self(0x01); | ||
| 4047 | } | ||
| 4048 | #[repr(transparent)] | ||
| 4049 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4050 | pub struct LdmaTx(pub u8); | ||
| 4051 | impl LdmaTx { | ||
| 4052 | #[doc = "Number of data to transfer for transmit is even"] | ||
| 4053 | pub const EVEN: Self = Self(0); | ||
| 4054 | #[doc = "Number of data to transfer for transmit is odd"] | ||
| 4055 | pub const ODD: Self = Self(0x01); | ||
| 4056 | } | ||
| 4057 | #[repr(transparent)] | ||
| 4058 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4059 | pub struct Cpha(pub u8); | ||
| 4060 | impl Cpha { | ||
| 4061 | #[doc = "The first clock transition is the first data capture edge"] | ||
| 4062 | pub const FIRSTEDGE: Self = Self(0); | ||
| 4063 | #[doc = "The second clock transition is the first data capture edge"] | ||
| 4064 | pub const SECONDEDGE: Self = Self(0x01); | ||
| 4065 | } | ||
| 4066 | #[repr(transparent)] | ||
| 4067 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4068 | pub struct Frxth(pub u8); | ||
| 4069 | impl Frxth { | ||
| 4070 | #[doc = "RXNE event is generated if the FIFO level is greater than or equal to 1/2 (16-bit)"] | ||
| 4071 | pub const HALF: Self = Self(0); | ||
| 4072 | #[doc = "RXNE event is generated if the FIFO level is greater than or equal to 1/4 (8-bit)"] | ||
| 4073 | pub const QUARTER: Self = Self(0x01); | ||
| 4074 | } | ||
| 4075 | #[repr(transparent)] | ||
| 4076 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4077 | pub struct Frer(pub u8); | ||
| 4078 | impl Frer { | ||
| 4079 | #[doc = "No frame format error"] | ||
| 4080 | pub const NOERROR: Self = Self(0); | ||
| 4081 | #[doc = "A frame format error occurred"] | ||
| 4082 | pub const ERROR: Self = Self(0x01); | ||
| 4083 | } | ||
| 4084 | #[repr(transparent)] | ||
| 4085 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4086 | pub struct Ds(pub u8); | ||
| 4087 | impl Ds { | ||
| 4088 | #[doc = "4-bit"] | ||
| 4089 | pub const FOURBIT: Self = Self(0x03); | ||
| 4090 | #[doc = "5-bit"] | ||
| 4091 | pub const FIVEBIT: Self = Self(0x04); | ||
| 4092 | #[doc = "6-bit"] | ||
| 4093 | pub const SIXBIT: Self = Self(0x05); | ||
| 4094 | #[doc = "7-bit"] | ||
| 4095 | pub const SEVENBIT: Self = Self(0x06); | ||
| 4096 | #[doc = "8-bit"] | ||
| 4097 | pub const EIGHTBIT: Self = Self(0x07); | ||
| 4098 | #[doc = "9-bit"] | ||
| 4099 | pub const NINEBIT: Self = Self(0x08); | ||
| 4100 | #[doc = "10-bit"] | ||
| 4101 | pub const TENBIT: Self = Self(0x09); | ||
| 4102 | #[doc = "11-bit"] | ||
| 4103 | pub const ELEVENBIT: Self = Self(0x0a); | ||
| 4104 | #[doc = "12-bit"] | ||
| 4105 | pub const TWELVEBIT: Self = Self(0x0b); | ||
| 4106 | #[doc = "13-bit"] | ||
| 4107 | pub const THIRTEENBIT: Self = Self(0x0c); | ||
| 4108 | #[doc = "14-bit"] | ||
| 4109 | pub const FOURTEENBIT: Self = Self(0x0d); | ||
| 4110 | #[doc = "15-bit"] | ||
| 4111 | pub const FIFTEENBIT: Self = Self(0x0e); | ||
| 4112 | #[doc = "16-bit"] | ||
| 4113 | pub const SIXTEENBIT: Self = Self(0x0f); | ||
| 4114 | } | ||
| 4115 | #[repr(transparent)] | ||
| 4116 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4117 | pub struct Frf(pub u8); | ||
| 4118 | impl Frf { | ||
| 4119 | #[doc = "SPI Motorola mode"] | ||
| 4120 | pub const MOTOROLA: Self = Self(0); | ||
| 4121 | #[doc = "SPI TI mode"] | ||
| 4122 | pub const TI: Self = Self(0x01); | ||
| 4123 | } | ||
| 4124 | #[repr(transparent)] | ||
| 4125 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4126 | pub struct Lsbfirst(pub u8); | ||
| 4127 | impl Lsbfirst { | ||
| 4128 | #[doc = "Data is transmitted/received with the MSB first"] | ||
| 4129 | pub const MSBFIRST: Self = Self(0); | ||
| 4130 | #[doc = "Data is transmitted/received with the LSB first"] | ||
| 4131 | pub const LSBFIRST: Self = Self(0x01); | ||
| 4132 | } | ||
| 4133 | #[repr(transparent)] | ||
| 4134 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4135 | pub struct Crcl(pub u8); | ||
| 4136 | impl Crcl { | ||
| 4137 | #[doc = "8-bit CRC length"] | ||
| 4138 | pub const EIGHTBIT: Self = Self(0); | ||
| 4139 | #[doc = "16-bit CRC length"] | ||
| 4140 | pub const SIXTEENBIT: Self = Self(0x01); | ||
| 4141 | } | ||
| 4142 | #[repr(transparent)] | ||
| 4143 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4144 | pub struct Crcnext(pub u8); | ||
| 4145 | impl Crcnext { | ||
| 4146 | #[doc = "Next transmit value is from Tx buffer"] | ||
| 4147 | pub const TXBUFFER: Self = Self(0); | ||
| 4148 | #[doc = "Next transmit value is from Tx CRC register"] | ||
| 4149 | pub const CRC: Self = Self(0x01); | ||
| 4150 | } | ||
| 4151 | #[repr(transparent)] | ||
| 4152 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4153 | pub struct Frlvlr(pub u8); | ||
| 4154 | impl Frlvlr { | ||
| 4155 | #[doc = "Rx FIFO Empty"] | ||
| 4156 | pub const EMPTY: Self = Self(0); | ||
| 4157 | #[doc = "Rx 1/4 FIFO"] | ||
| 4158 | pub const QUARTER: Self = Self(0x01); | ||
| 4159 | #[doc = "Rx 1/2 FIFO"] | ||
| 4160 | pub const HALF: Self = Self(0x02); | ||
| 4161 | #[doc = "Rx FIFO full"] | ||
| 4162 | pub const FULL: Self = Self(0x03); | ||
| 4163 | } | ||
| 4164 | #[repr(transparent)] | ||
| 4165 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4166 | pub struct Rxonly(pub u8); | ||
| 4167 | impl Rxonly { | ||
| 4168 | #[doc = "Full duplex (Transmit and receive)"] | ||
| 4169 | pub const FULLDUPLEX: Self = Self(0); | ||
| 4170 | #[doc = "Output disabled (Receive-only mode)"] | ||
| 4171 | pub const OUTPUTDISABLED: Self = Self(0x01); | ||
| 4172 | } | ||
| 4173 | #[repr(transparent)] | ||
| 4174 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4175 | pub struct Mstr(pub u8); | ||
| 4176 | impl Mstr { | ||
| 4177 | #[doc = "Slave configuration"] | ||
| 4178 | pub const SLAVE: Self = Self(0); | ||
| 4179 | #[doc = "Master configuration"] | ||
| 4180 | pub const MASTER: Self = Self(0x01); | ||
| 4181 | } | ||
| 4182 | } | ||
| 4183 | } | ||
| 4184 | pub mod spi_v1 { | ||
| 4185 | use crate::generic::*; | ||
| 4186 | #[doc = "Serial peripheral interface"] | ||
| 4187 | #[derive(Copy, Clone)] | ||
| 4188 | pub struct Spi(pub *mut u8); | ||
| 4189 | unsafe impl Send for Spi {} | ||
| 4190 | unsafe impl Sync for Spi {} | ||
| 4191 | impl Spi { | ||
| 4192 | #[doc = "control register 1"] | ||
| 4193 | pub fn cr1(self) -> Reg<regs::Cr1, RW> { | ||
| 4194 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 4195 | } | ||
| 4196 | #[doc = "control register 2"] | ||
| 4197 | pub fn cr2(self) -> Reg<regs::Cr2, RW> { | ||
| 4198 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 4199 | } | ||
| 4200 | #[doc = "status register"] | ||
| 4201 | pub fn sr(self) -> Reg<regs::Sr, RW> { | ||
| 4202 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 4203 | } | ||
| 4204 | #[doc = "data register"] | ||
| 4205 | pub fn dr(self) -> Reg<regs::Dr, RW> { | ||
| 4206 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 4207 | } | ||
| 4208 | #[doc = "CRC polynomial register"] | ||
| 4209 | pub fn crcpr(self) -> Reg<regs::Crcpr, RW> { | ||
| 4210 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 4211 | } | ||
| 4212 | #[doc = "RX CRC register"] | ||
| 4213 | pub fn rxcrcr(self) -> Reg<regs::Rxcrcr, R> { | ||
| 4214 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 4215 | } | ||
| 4216 | #[doc = "TX CRC register"] | ||
| 4217 | pub fn txcrcr(self) -> Reg<regs::Txcrcr, R> { | ||
| 4218 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | ||
| 4219 | } | ||
| 4220 | } | ||
| 4221 | pub mod regs { | ||
| 4222 | use crate::generic::*; | ||
| 4223 | #[doc = "status register"] | ||
| 4224 | #[repr(transparent)] | 7547 | #[repr(transparent)] |
| 4225 | #[derive(Copy, Clone, Eq, PartialEq)] | 7548 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 4226 | pub struct Sr(pub u32); | 7549 | pub struct SrUsart(pub u32); |
| 4227 | impl Sr { | 7550 | impl SrUsart { |
| 4228 | #[doc = "Receive buffer not empty"] | 7551 | #[doc = "Parity error"] |
| 4229 | pub const fn rxne(&self) -> bool { | 7552 | pub const fn pe(&self) -> bool { |
| 4230 | let val = (self.0 >> 0usize) & 0x01; | 7553 | let val = (self.0 >> 0usize) & 0x01; |
| 4231 | val != 0 | 7554 | val != 0 |
| 4232 | } | 7555 | } |
| 4233 | #[doc = "Receive buffer not empty"] | 7556 | #[doc = "Parity error"] |
| 4234 | pub fn set_rxne(&mut self, val: bool) { | 7557 | pub fn set_pe(&mut self, val: bool) { |
| 4235 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 7558 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 4236 | } | 7559 | } |
| 4237 | #[doc = "Transmit buffer empty"] | 7560 | #[doc = "Framing error"] |
| 4238 | pub const fn txe(&self) -> bool { | 7561 | pub const fn fe(&self) -> bool { |
| 4239 | let val = (self.0 >> 1usize) & 0x01; | 7562 | let val = (self.0 >> 1usize) & 0x01; |
| 4240 | val != 0 | 7563 | val != 0 |
| 4241 | } | 7564 | } |
| 4242 | #[doc = "Transmit buffer empty"] | 7565 | #[doc = "Framing error"] |
| 4243 | pub fn set_txe(&mut self, val: bool) { | 7566 | pub fn set_fe(&mut self, val: bool) { |
| 4244 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 7567 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 4245 | } | 7568 | } |
| 4246 | #[doc = "CRC error flag"] | 7569 | #[doc = "Noise error flag"] |
| 4247 | pub const fn crcerr(&self) -> bool { | 7570 | pub const fn ne(&self) -> bool { |
| 7571 | let val = (self.0 >> 2usize) & 0x01; | ||
| 7572 | val != 0 | ||
| 7573 | } | ||
| 7574 | #[doc = "Noise error flag"] | ||
| 7575 | pub fn set_ne(&mut self, val: bool) { | ||
| 7576 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 7577 | } | ||
| 7578 | #[doc = "Overrun error"] | ||
| 7579 | pub const fn ore(&self) -> bool { | ||
| 7580 | let val = (self.0 >> 3usize) & 0x01; | ||
| 7581 | val != 0 | ||
| 7582 | } | ||
| 7583 | #[doc = "Overrun error"] | ||
| 7584 | pub fn set_ore(&mut self, val: bool) { | ||
| 7585 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | ||
| 7586 | } | ||
| 7587 | #[doc = "IDLE line detected"] | ||
| 7588 | pub const fn idle(&self) -> bool { | ||
| 4248 | let val = (self.0 >> 4usize) & 0x01; | 7589 | let val = (self.0 >> 4usize) & 0x01; |
| 4249 | val != 0 | 7590 | val != 0 |
| 4250 | } | 7591 | } |
| 4251 | #[doc = "CRC error flag"] | 7592 | #[doc = "IDLE line detected"] |
| 4252 | pub fn set_crcerr(&mut self, val: bool) { | 7593 | pub fn set_idle(&mut self, val: bool) { |
| 4253 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 7594 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 4254 | } | 7595 | } |
| 4255 | #[doc = "Mode fault"] | 7596 | #[doc = "Read data register not empty"] |
| 4256 | pub const fn modf(&self) -> bool { | 7597 | pub const fn rxne(&self) -> bool { |
| 4257 | let val = (self.0 >> 5usize) & 0x01; | 7598 | let val = (self.0 >> 5usize) & 0x01; |
| 4258 | val != 0 | 7599 | val != 0 |
| 4259 | } | 7600 | } |
| 4260 | #[doc = "Mode fault"] | 7601 | #[doc = "Read data register not empty"] |
| 4261 | pub fn set_modf(&mut self, val: bool) { | 7602 | pub fn set_rxne(&mut self, val: bool) { |
| 4262 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 7603 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 4263 | } | 7604 | } |
| 4264 | #[doc = "Overrun flag"] | 7605 | #[doc = "Transmission complete"] |
| 4265 | pub const fn ovr(&self) -> bool { | 7606 | pub const fn tc(&self) -> bool { |
| 4266 | let val = (self.0 >> 6usize) & 0x01; | 7607 | let val = (self.0 >> 6usize) & 0x01; |
| 4267 | val != 0 | 7608 | val != 0 |
| 4268 | } | 7609 | } |
| 4269 | #[doc = "Overrun flag"] | 7610 | #[doc = "Transmission complete"] |
| 4270 | pub fn set_ovr(&mut self, val: bool) { | 7611 | pub fn set_tc(&mut self, val: bool) { |
| 4271 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 7612 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 4272 | } | 7613 | } |
| 4273 | #[doc = "Busy flag"] | 7614 | #[doc = "Transmit data register empty"] |
| 4274 | pub const fn bsy(&self) -> bool { | 7615 | pub const fn txe(&self) -> bool { |
| 4275 | let val = (self.0 >> 7usize) & 0x01; | 7616 | let val = (self.0 >> 7usize) & 0x01; |
| 4276 | val != 0 | 7617 | val != 0 |
| 4277 | } | 7618 | } |
| 4278 | #[doc = "Busy flag"] | 7619 | #[doc = "Transmit data register empty"] |
| 4279 | pub fn set_bsy(&mut self, val: bool) { | 7620 | pub fn set_txe(&mut self, val: bool) { |
| 4280 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 7621 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 4281 | } | 7622 | } |
| 4282 | #[doc = "TI frame format error"] | 7623 | #[doc = "LIN break detection flag"] |
| 4283 | pub const fn fre(&self) -> bool { | 7624 | pub const fn lbd(&self) -> bool { |
| 4284 | let val = (self.0 >> 8usize) & 0x01; | 7625 | let val = (self.0 >> 8usize) & 0x01; |
| 4285 | val != 0 | 7626 | val != 0 |
| 4286 | } | 7627 | } |
| 4287 | #[doc = "TI frame format error"] | 7628 | #[doc = "LIN break detection flag"] |
| 4288 | pub fn set_fre(&mut self, val: bool) { | 7629 | pub fn set_lbd(&mut self, val: bool) { |
| 4289 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 7630 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 4290 | } | 7631 | } |
| 7632 | #[doc = "CTS flag"] | ||
| 7633 | pub const fn cts(&self) -> bool { | ||
| 7634 | let val = (self.0 >> 9usize) & 0x01; | ||
| 7635 | val != 0 | ||
| 7636 | } | ||
| 7637 | #[doc = "CTS flag"] | ||
| 7638 | pub fn set_cts(&mut self, val: bool) { | ||
| 7639 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | ||
| 7640 | } | ||
| 4291 | } | 7641 | } |
| 4292 | impl Default for Sr { | 7642 | impl Default for SrUsart { |
| 4293 | fn default() -> Sr { | 7643 | fn default() -> SrUsart { |
| 4294 | Sr(0) | 7644 | SrUsart(0) |
| 4295 | } | 7645 | } |
| 4296 | } | 7646 | } |
| 4297 | #[doc = "control register 2"] | 7647 | #[doc = "Control register 1"] |
| 4298 | #[repr(transparent)] | 7648 | #[repr(transparent)] |
| 4299 | #[derive(Copy, Clone, Eq, PartialEq)] | 7649 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 4300 | pub struct Cr2(pub u32); | 7650 | pub struct Cr1(pub u32); |
| 4301 | impl Cr2 { | 7651 | impl Cr1 { |
| 4302 | #[doc = "Rx buffer DMA enable"] | 7652 | #[doc = "Send break"] |
| 4303 | pub const fn rxdmaen(&self) -> bool { | 7653 | pub const fn sbk(&self) -> super::vals::Sbk { |
| 4304 | let val = (self.0 >> 0usize) & 0x01; | 7654 | let val = (self.0 >> 0usize) & 0x01; |
| 4305 | val != 0 | 7655 | super::vals::Sbk(val as u8) |
| 4306 | } | 7656 | } |
| 4307 | #[doc = "Rx buffer DMA enable"] | 7657 | #[doc = "Send break"] |
| 4308 | pub fn set_rxdmaen(&mut self, val: bool) { | 7658 | pub fn set_sbk(&mut self, val: super::vals::Sbk) { |
| 4309 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 7659 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 4310 | } | 7660 | } |
| 4311 | #[doc = "Tx buffer DMA enable"] | 7661 | #[doc = "Receiver wakeup"] |
| 4312 | pub const fn txdmaen(&self) -> bool { | 7662 | pub const fn rwu(&self) -> super::vals::Rwu { |
| 4313 | let val = (self.0 >> 1usize) & 0x01; | 7663 | let val = (self.0 >> 1usize) & 0x01; |
| 4314 | val != 0 | 7664 | super::vals::Rwu(val as u8) |
| 4315 | } | 7665 | } |
| 4316 | #[doc = "Tx buffer DMA enable"] | 7666 | #[doc = "Receiver wakeup"] |
| 4317 | pub fn set_txdmaen(&mut self, val: bool) { | 7667 | pub fn set_rwu(&mut self, val: super::vals::Rwu) { |
| 4318 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 7668 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); |
| 4319 | } | 7669 | } |
| 4320 | #[doc = "SS output enable"] | 7670 | #[doc = "Receiver enable"] |
| 4321 | pub const fn ssoe(&self) -> bool { | 7671 | pub const fn re(&self) -> bool { |
| 4322 | let val = (self.0 >> 2usize) & 0x01; | 7672 | let val = (self.0 >> 2usize) & 0x01; |
| 4323 | val != 0 | 7673 | val != 0 |
| 4324 | } | 7674 | } |
| 4325 | #[doc = "SS output enable"] | 7675 | #[doc = "Receiver enable"] |
| 4326 | pub fn set_ssoe(&mut self, val: bool) { | 7676 | pub fn set_re(&mut self, val: bool) { |
| 4327 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 7677 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 4328 | } | 7678 | } |
| 4329 | #[doc = "Frame format"] | 7679 | #[doc = "Transmitter enable"] |
| 4330 | pub const fn frf(&self) -> super::vals::Frf { | 7680 | pub const fn te(&self) -> bool { |
| 7681 | let val = (self.0 >> 3usize) & 0x01; | ||
| 7682 | val != 0 | ||
| 7683 | } | ||
| 7684 | #[doc = "Transmitter enable"] | ||
| 7685 | pub fn set_te(&mut self, val: bool) { | ||
| 7686 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | ||
| 7687 | } | ||
| 7688 | #[doc = "IDLE interrupt enable"] | ||
| 7689 | pub const fn idleie(&self) -> bool { | ||
| 4331 | let val = (self.0 >> 4usize) & 0x01; | 7690 | let val = (self.0 >> 4usize) & 0x01; |
| 4332 | super::vals::Frf(val as u8) | 7691 | val != 0 |
| 4333 | } | 7692 | } |
| 4334 | #[doc = "Frame format"] | 7693 | #[doc = "IDLE interrupt enable"] |
| 4335 | pub fn set_frf(&mut self, val: super::vals::Frf) { | 7694 | pub fn set_idleie(&mut self, val: bool) { |
| 4336 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | 7695 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 4337 | } | 7696 | } |
| 4338 | #[doc = "Error interrupt enable"] | 7697 | #[doc = "RXNE interrupt enable"] |
| 4339 | pub const fn errie(&self) -> bool { | 7698 | pub const fn rxneie(&self) -> bool { |
| 4340 | let val = (self.0 >> 5usize) & 0x01; | 7699 | let val = (self.0 >> 5usize) & 0x01; |
| 4341 | val != 0 | 7700 | val != 0 |
| 4342 | } | 7701 | } |
| 4343 | #[doc = "Error interrupt enable"] | 7702 | #[doc = "RXNE interrupt enable"] |
| 4344 | pub fn set_errie(&mut self, val: bool) { | 7703 | pub fn set_rxneie(&mut self, val: bool) { |
| 4345 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 7704 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 4346 | } | 7705 | } |
| 4347 | #[doc = "RX buffer not empty interrupt enable"] | 7706 | #[doc = "Transmission complete interrupt enable"] |
| 4348 | pub const fn rxneie(&self) -> bool { | 7707 | pub const fn tcie(&self) -> bool { |
| 4349 | let val = (self.0 >> 6usize) & 0x01; | 7708 | let val = (self.0 >> 6usize) & 0x01; |
| 4350 | val != 0 | 7709 | val != 0 |
| 4351 | } | 7710 | } |
| 4352 | #[doc = "RX buffer not empty interrupt enable"] | 7711 | #[doc = "Transmission complete interrupt enable"] |
| 4353 | pub fn set_rxneie(&mut self, val: bool) { | 7712 | pub fn set_tcie(&mut self, val: bool) { |
| 4354 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 7713 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 4355 | } | 7714 | } |
| 4356 | #[doc = "Tx buffer empty interrupt enable"] | 7715 | #[doc = "TXE interrupt enable"] |
| 4357 | pub const fn txeie(&self) -> bool { | 7716 | pub const fn txeie(&self) -> bool { |
| 4358 | let val = (self.0 >> 7usize) & 0x01; | 7717 | let val = (self.0 >> 7usize) & 0x01; |
| 4359 | val != 0 | 7718 | val != 0 |
| 4360 | } | 7719 | } |
| 4361 | #[doc = "Tx buffer empty interrupt enable"] | 7720 | #[doc = "TXE interrupt enable"] |
| 4362 | pub fn set_txeie(&mut self, val: bool) { | 7721 | pub fn set_txeie(&mut self, val: bool) { |
| 4363 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 7722 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 4364 | } | 7723 | } |
| 4365 | } | 7724 | #[doc = "PE interrupt enable"] |
| 4366 | impl Default for Cr2 { | 7725 | pub const fn peie(&self) -> bool { |
| 4367 | fn default() -> Cr2 { | ||
| 4368 | Cr2(0) | ||
| 4369 | } | ||
| 4370 | } | ||
| 4371 | #[doc = "data register"] | ||
| 4372 | #[repr(transparent)] | ||
| 4373 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4374 | pub struct Dr(pub u32); | ||
| 4375 | impl Dr { | ||
| 4376 | #[doc = "Data register"] | ||
| 4377 | pub const fn dr(&self) -> u16 { | ||
| 4378 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 4379 | val as u16 | ||
| 4380 | } | ||
| 4381 | #[doc = "Data register"] | ||
| 4382 | pub fn set_dr(&mut self, val: u16) { | ||
| 4383 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 4384 | } | ||
| 4385 | } | ||
| 4386 | impl Default for Dr { | ||
| 4387 | fn default() -> Dr { | ||
| 4388 | Dr(0) | ||
| 4389 | } | ||
| 4390 | } | ||
| 4391 | #[doc = "RX CRC register"] | ||
| 4392 | #[repr(transparent)] | ||
| 4393 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4394 | pub struct Rxcrcr(pub u32); | ||
| 4395 | impl Rxcrcr { | ||
| 4396 | #[doc = "Rx CRC register"] | ||
| 4397 | pub const fn rx_crc(&self) -> u16 { | ||
| 4398 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 4399 | val as u16 | ||
| 4400 | } | ||
| 4401 | #[doc = "Rx CRC register"] | ||
| 4402 | pub fn set_rx_crc(&mut self, val: u16) { | ||
| 4403 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 4404 | } | ||
| 4405 | } | ||
| 4406 | impl Default for Rxcrcr { | ||
| 4407 | fn default() -> Rxcrcr { | ||
| 4408 | Rxcrcr(0) | ||
| 4409 | } | ||
| 4410 | } | ||
| 4411 | #[doc = "CRC polynomial register"] | ||
| 4412 | #[repr(transparent)] | ||
| 4413 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4414 | pub struct Crcpr(pub u32); | ||
| 4415 | impl Crcpr { | ||
| 4416 | #[doc = "CRC polynomial register"] | ||
| 4417 | pub const fn crcpoly(&self) -> u16 { | ||
| 4418 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 4419 | val as u16 | ||
| 4420 | } | ||
| 4421 | #[doc = "CRC polynomial register"] | ||
| 4422 | pub fn set_crcpoly(&mut self, val: u16) { | ||
| 4423 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 4424 | } | ||
| 4425 | } | ||
| 4426 | impl Default for Crcpr { | ||
| 4427 | fn default() -> Crcpr { | ||
| 4428 | Crcpr(0) | ||
| 4429 | } | ||
| 4430 | } | ||
| 4431 | #[doc = "control register 1"] | ||
| 4432 | #[repr(transparent)] | ||
| 4433 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4434 | pub struct Cr1(pub u32); | ||
| 4435 | impl Cr1 { | ||
| 4436 | #[doc = "Clock phase"] | ||
| 4437 | pub const fn cpha(&self) -> super::vals::Cpha { | ||
| 4438 | let val = (self.0 >> 0usize) & 0x01; | ||
| 4439 | super::vals::Cpha(val as u8) | ||
| 4440 | } | ||
| 4441 | #[doc = "Clock phase"] | ||
| 4442 | pub fn set_cpha(&mut self, val: super::vals::Cpha) { | ||
| 4443 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 4444 | } | ||
| 4445 | #[doc = "Clock polarity"] | ||
| 4446 | pub const fn cpol(&self) -> super::vals::Cpol { | ||
| 4447 | let val = (self.0 >> 1usize) & 0x01; | ||
| 4448 | super::vals::Cpol(val as u8) | ||
| 4449 | } | ||
| 4450 | #[doc = "Clock polarity"] | ||
| 4451 | pub fn set_cpol(&mut self, val: super::vals::Cpol) { | ||
| 4452 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 4453 | } | ||
| 4454 | #[doc = "Master selection"] | ||
| 4455 | pub const fn mstr(&self) -> super::vals::Mstr { | ||
| 4456 | let val = (self.0 >> 2usize) & 0x01; | ||
| 4457 | super::vals::Mstr(val as u8) | ||
| 4458 | } | ||
| 4459 | #[doc = "Master selection"] | ||
| 4460 | pub fn set_mstr(&mut self, val: super::vals::Mstr) { | ||
| 4461 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 4462 | } | ||
| 4463 | #[doc = "Baud rate control"] | ||
| 4464 | pub const fn br(&self) -> super::vals::Br { | ||
| 4465 | let val = (self.0 >> 3usize) & 0x07; | ||
| 4466 | super::vals::Br(val as u8) | ||
| 4467 | } | ||
| 4468 | #[doc = "Baud rate control"] | ||
| 4469 | pub fn set_br(&mut self, val: super::vals::Br) { | ||
| 4470 | self.0 = (self.0 & !(0x07 << 3usize)) | (((val.0 as u32) & 0x07) << 3usize); | ||
| 4471 | } | ||
| 4472 | #[doc = "SPI enable"] | ||
| 4473 | pub const fn spe(&self) -> bool { | ||
| 4474 | let val = (self.0 >> 6usize) & 0x01; | ||
| 4475 | val != 0 | ||
| 4476 | } | ||
| 4477 | #[doc = "SPI enable"] | ||
| 4478 | pub fn set_spe(&mut self, val: bool) { | ||
| 4479 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 4480 | } | ||
| 4481 | #[doc = "Frame format"] | ||
| 4482 | pub const fn lsbfirst(&self) -> super::vals::Lsbfirst { | ||
| 4483 | let val = (self.0 >> 7usize) & 0x01; | ||
| 4484 | super::vals::Lsbfirst(val as u8) | ||
| 4485 | } | ||
| 4486 | #[doc = "Frame format"] | ||
| 4487 | pub fn set_lsbfirst(&mut self, val: super::vals::Lsbfirst) { | ||
| 4488 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 4489 | } | ||
| 4490 | #[doc = "Internal slave select"] | ||
| 4491 | pub const fn ssi(&self) -> bool { | ||
| 4492 | let val = (self.0 >> 8usize) & 0x01; | 7726 | let val = (self.0 >> 8usize) & 0x01; |
| 4493 | val != 0 | 7727 | val != 0 |
| 4494 | } | 7728 | } |
| 4495 | #[doc = "Internal slave select"] | 7729 | #[doc = "PE interrupt enable"] |
| 4496 | pub fn set_ssi(&mut self, val: bool) { | 7730 | pub fn set_peie(&mut self, val: bool) { |
| 4497 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 7731 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 4498 | } | 7732 | } |
| 4499 | #[doc = "Software slave management"] | 7733 | #[doc = "Parity selection"] |
| 4500 | pub const fn ssm(&self) -> bool { | 7734 | pub const fn ps(&self) -> super::vals::Ps { |
| 4501 | let val = (self.0 >> 9usize) & 0x01; | 7735 | let val = (self.0 >> 9usize) & 0x01; |
| 4502 | val != 0 | 7736 | super::vals::Ps(val as u8) |
| 4503 | } | 7737 | } |
| 4504 | #[doc = "Software slave management"] | 7738 | #[doc = "Parity selection"] |
| 4505 | pub fn set_ssm(&mut self, val: bool) { | 7739 | pub fn set_ps(&mut self, val: super::vals::Ps) { |
| 4506 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | 7740 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); |
| 4507 | } | 7741 | } |
| 4508 | #[doc = "Receive only"] | 7742 | #[doc = "Parity control enable"] |
| 4509 | pub const fn rxonly(&self) -> super::vals::Rxonly { | 7743 | pub const fn pce(&self) -> bool { |
| 4510 | let val = (self.0 >> 10usize) & 0x01; | 7744 | let val = (self.0 >> 10usize) & 0x01; |
| 4511 | super::vals::Rxonly(val as u8) | 7745 | val != 0 |
| 4512 | } | 7746 | } |
| 4513 | #[doc = "Receive only"] | 7747 | #[doc = "Parity control enable"] |
| 4514 | pub fn set_rxonly(&mut self, val: super::vals::Rxonly) { | 7748 | pub fn set_pce(&mut self, val: bool) { |
| 4515 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); | 7749 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); |
| 4516 | } | 7750 | } |
| 4517 | #[doc = "Data frame format"] | 7751 | #[doc = "Wakeup method"] |
| 4518 | pub const fn dff(&self) -> super::vals::Dff { | 7752 | pub const fn wake(&self) -> super::vals::Wake { |
| 4519 | let val = (self.0 >> 11usize) & 0x01; | 7753 | let val = (self.0 >> 11usize) & 0x01; |
| 4520 | super::vals::Dff(val as u8) | 7754 | super::vals::Wake(val as u8) |
| 4521 | } | 7755 | } |
| 4522 | #[doc = "Data frame format"] | 7756 | #[doc = "Wakeup method"] |
| 4523 | pub fn set_dff(&mut self, val: super::vals::Dff) { | 7757 | pub fn set_wake(&mut self, val: super::vals::Wake) { |
| 4524 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); | 7758 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); |
| 4525 | } | 7759 | } |
| 4526 | #[doc = "CRC transfer next"] | 7760 | #[doc = "Word length"] |
| 4527 | pub const fn crcnext(&self) -> super::vals::Crcnext { | 7761 | pub const fn m(&self) -> super::vals::M { |
| 4528 | let val = (self.0 >> 12usize) & 0x01; | 7762 | let val = (self.0 >> 12usize) & 0x01; |
| 4529 | super::vals::Crcnext(val as u8) | 7763 | super::vals::M(val as u8) |
| 4530 | } | 7764 | } |
| 4531 | #[doc = "CRC transfer next"] | 7765 | #[doc = "Word length"] |
| 4532 | pub fn set_crcnext(&mut self, val: super::vals::Crcnext) { | 7766 | pub fn set_m(&mut self, val: super::vals::M) { |
| 4533 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | 7767 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); |
| 4534 | } | 7768 | } |
| 4535 | #[doc = "Hardware CRC calculation enable"] | 7769 | #[doc = "USART enable"] |
| 4536 | pub const fn crcen(&self) -> bool { | 7770 | pub const fn ue(&self) -> bool { |
| 4537 | let val = (self.0 >> 13usize) & 0x01; | 7771 | let val = (self.0 >> 13usize) & 0x01; |
| 4538 | val != 0 | 7772 | val != 0 |
| 4539 | } | 7773 | } |
| 4540 | #[doc = "Hardware CRC calculation enable"] | 7774 | #[doc = "USART enable"] |
| 4541 | pub fn set_crcen(&mut self, val: bool) { | 7775 | pub fn set_ue(&mut self, val: bool) { |
| 4542 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | 7776 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); |
| 4543 | } | 7777 | } |
| 4544 | #[doc = "Output enable in bidirectional mode"] | ||
| 4545 | pub const fn bidioe(&self) -> super::vals::Bidioe { | ||
| 4546 | let val = (self.0 >> 14usize) & 0x01; | ||
| 4547 | super::vals::Bidioe(val as u8) | ||
| 4548 | } | ||
| 4549 | #[doc = "Output enable in bidirectional mode"] | ||
| 4550 | pub fn set_bidioe(&mut self, val: super::vals::Bidioe) { | ||
| 4551 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | ||
| 4552 | } | ||
| 4553 | #[doc = "Bidirectional data mode enable"] | ||
| 4554 | pub const fn bidimode(&self) -> super::vals::Bidimode { | ||
| 4555 | let val = (self.0 >> 15usize) & 0x01; | ||
| 4556 | super::vals::Bidimode(val as u8) | ||
| 4557 | } | ||
| 4558 | #[doc = "Bidirectional data mode enable"] | ||
| 4559 | pub fn set_bidimode(&mut self, val: super::vals::Bidimode) { | ||
| 4560 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 4561 | } | ||
| 4562 | } | 7778 | } |
| 4563 | impl Default for Cr1 { | 7779 | impl Default for Cr1 { |
| 4564 | fn default() -> Cr1 { | 7780 | fn default() -> Cr1 { |
| 4565 | Cr1(0) | 7781 | Cr1(0) |
| 4566 | } | 7782 | } |
| 4567 | } | 7783 | } |
| 4568 | #[doc = "TX CRC register"] | 7784 | #[doc = "Control register 2"] |
| 4569 | #[repr(transparent)] | 7785 | #[repr(transparent)] |
| 4570 | #[derive(Copy, Clone, Eq, PartialEq)] | 7786 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 4571 | pub struct Txcrcr(pub u32); | 7787 | pub struct Cr2(pub u32); |
| 4572 | impl Txcrcr { | 7788 | impl Cr2 { |
| 4573 | #[doc = "Tx CRC register"] | 7789 | #[doc = "Address of the USART node"] |
| 4574 | pub const fn tx_crc(&self) -> u16 { | 7790 | pub const fn add(&self) -> u8 { |
| 4575 | let val = (self.0 >> 0usize) & 0xffff; | 7791 | let val = (self.0 >> 0usize) & 0x0f; |
| 4576 | val as u16 | 7792 | val as u8 |
| 4577 | } | 7793 | } |
| 4578 | #[doc = "Tx CRC register"] | 7794 | #[doc = "Address of the USART node"] |
| 4579 | pub fn set_tx_crc(&mut self, val: u16) { | 7795 | pub fn set_add(&mut self, val: u8) { |
| 4580 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | 7796 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); |
| 4581 | } | 7797 | } |
| 4582 | } | 7798 | #[doc = "lin break detection length"] |
| 4583 | impl Default for Txcrcr { | 7799 | pub const fn lbdl(&self) -> super::vals::Lbdl { |
| 4584 | fn default() -> Txcrcr { | 7800 | let val = (self.0 >> 5usize) & 0x01; |
| 4585 | Txcrcr(0) | 7801 | super::vals::Lbdl(val as u8) |
| 7802 | } | ||
| 7803 | #[doc = "lin break detection length"] | ||
| 7804 | pub fn set_lbdl(&mut self, val: super::vals::Lbdl) { | ||
| 7805 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 7806 | } | ||
| 7807 | #[doc = "LIN break detection interrupt enable"] | ||
| 7808 | pub const fn lbdie(&self) -> bool { | ||
| 7809 | let val = (self.0 >> 6usize) & 0x01; | ||
| 7810 | val != 0 | ||
| 7811 | } | ||
| 7812 | #[doc = "LIN break detection interrupt enable"] | ||
| 7813 | pub fn set_lbdie(&mut self, val: bool) { | ||
| 7814 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 7815 | } | ||
| 7816 | #[doc = "STOP bits"] | ||
| 7817 | pub const fn stop(&self) -> super::vals::Stop { | ||
| 7818 | let val = (self.0 >> 12usize) & 0x03; | ||
| 7819 | super::vals::Stop(val as u8) | ||
| 7820 | } | ||
| 7821 | #[doc = "STOP bits"] | ||
| 7822 | pub fn set_stop(&mut self, val: super::vals::Stop) { | ||
| 7823 | self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize); | ||
| 7824 | } | ||
| 7825 | #[doc = "LIN mode enable"] | ||
| 7826 | pub const fn linen(&self) -> bool { | ||
| 7827 | let val = (self.0 >> 14usize) & 0x01; | ||
| 7828 | val != 0 | ||
| 7829 | } | ||
| 7830 | #[doc = "LIN mode enable"] | ||
| 7831 | pub fn set_linen(&mut self, val: bool) { | ||
| 7832 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | ||
| 4586 | } | 7833 | } |
| 4587 | } | 7834 | } |
| 4588 | } | 7835 | impl Default for Cr2 { |
| 4589 | pub mod vals { | 7836 | fn default() -> Cr2 { |
| 4590 | use crate::generic::*; | 7837 | Cr2(0) |
| 4591 | #[repr(transparent)] | 7838 | } |
| 4592 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4593 | pub struct Rxonly(pub u8); | ||
| 4594 | impl Rxonly { | ||
| 4595 | #[doc = "Full duplex (Transmit and receive)"] | ||
| 4596 | pub const FULLDUPLEX: Self = Self(0); | ||
| 4597 | #[doc = "Output disabled (Receive-only mode)"] | ||
| 4598 | pub const OUTPUTDISABLED: Self = Self(0x01); | ||
| 4599 | } | ||
| 4600 | #[repr(transparent)] | ||
| 4601 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4602 | pub struct Iscfg(pub u8); | ||
| 4603 | impl Iscfg { | ||
| 4604 | #[doc = "Slave - transmit"] | ||
| 4605 | pub const SLAVETX: Self = Self(0); | ||
| 4606 | #[doc = "Slave - receive"] | ||
| 4607 | pub const SLAVERX: Self = Self(0x01); | ||
| 4608 | #[doc = "Master - transmit"] | ||
| 4609 | pub const MASTERTX: Self = Self(0x02); | ||
| 4610 | #[doc = "Master - receive"] | ||
| 4611 | pub const MASTERRX: Self = Self(0x03); | ||
| 4612 | } | ||
| 4613 | #[repr(transparent)] | ||
| 4614 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4615 | pub struct Dff(pub u8); | ||
| 4616 | impl Dff { | ||
| 4617 | #[doc = "8-bit data frame format is selected for transmission/reception"] | ||
| 4618 | pub const EIGHTBIT: Self = Self(0); | ||
| 4619 | #[doc = "16-bit data frame format is selected for transmission/reception"] | ||
| 4620 | pub const SIXTEENBIT: Self = Self(0x01); | ||
| 4621 | } | ||
| 4622 | #[repr(transparent)] | ||
| 4623 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4624 | pub struct Bidioe(pub u8); | ||
| 4625 | impl Bidioe { | ||
| 4626 | #[doc = "Output disabled (receive-only mode)"] | ||
| 4627 | pub const OUTPUTDISABLED: Self = Self(0); | ||
| 4628 | #[doc = "Output enabled (transmit-only mode)"] | ||
| 4629 | pub const OUTPUTENABLED: Self = Self(0x01); | ||
| 4630 | } | 7839 | } |
| 7840 | #[doc = "Guard time and prescaler register"] | ||
| 4631 | #[repr(transparent)] | 7841 | #[repr(transparent)] |
| 4632 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7842 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 4633 | pub struct Cpha(pub u8); | 7843 | pub struct Gtpr(pub u32); |
| 4634 | impl Cpha { | 7844 | impl Gtpr { |
| 4635 | #[doc = "The first clock transition is the first data capture edge"] | 7845 | #[doc = "Prescaler value"] |
| 4636 | pub const FIRSTEDGE: Self = Self(0); | 7846 | pub const fn psc(&self) -> u8 { |
| 4637 | #[doc = "The second clock transition is the first data capture edge"] | 7847 | let val = (self.0 >> 0usize) & 0xff; |
| 4638 | pub const SECONDEDGE: Self = Self(0x01); | 7848 | val as u8 |
| 7849 | } | ||
| 7850 | #[doc = "Prescaler value"] | ||
| 7851 | pub fn set_psc(&mut self, val: u8) { | ||
| 7852 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | ||
| 7853 | } | ||
| 7854 | #[doc = "Guard time value"] | ||
| 7855 | pub const fn gt(&self) -> u8 { | ||
| 7856 | let val = (self.0 >> 8usize) & 0xff; | ||
| 7857 | val as u8 | ||
| 7858 | } | ||
| 7859 | #[doc = "Guard time value"] | ||
| 7860 | pub fn set_gt(&mut self, val: u8) { | ||
| 7861 | self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize); | ||
| 7862 | } | ||
| 4639 | } | 7863 | } |
| 4640 | #[repr(transparent)] | 7864 | impl Default for Gtpr { |
| 4641 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7865 | fn default() -> Gtpr { |
| 4642 | pub struct Crcnext(pub u8); | 7866 | Gtpr(0) |
| 4643 | impl Crcnext { | 7867 | } |
| 4644 | #[doc = "Next transmit value is from Tx buffer"] | ||
| 4645 | pub const TXBUFFER: Self = Self(0); | ||
| 4646 | #[doc = "Next transmit value is from Tx CRC register"] | ||
| 4647 | pub const CRC: Self = Self(0x01); | ||
| 4648 | } | 7868 | } |
| 4649 | #[repr(transparent)] | 7869 | } |
| 4650 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7870 | } |
| 4651 | pub struct Cpol(pub u8); | 7871 | pub mod rng_v1 { |
| 4652 | impl Cpol { | 7872 | use crate::generic::*; |
| 4653 | #[doc = "CK to 0 when idle"] | 7873 | #[doc = "Random number generator"] |
| 4654 | pub const IDLELOW: Self = Self(0); | 7874 | #[derive(Copy, Clone)] |
| 4655 | #[doc = "CK to 1 when idle"] | 7875 | pub struct Rng(pub *mut u8); |
| 4656 | pub const IDLEHIGH: Self = Self(0x01); | 7876 | unsafe impl Send for Rng {} |
| 7877 | unsafe impl Sync for Rng {} | ||
| 7878 | impl Rng { | ||
| 7879 | #[doc = "control register"] | ||
| 7880 | pub fn cr(self) -> Reg<regs::Cr, RW> { | ||
| 7881 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 4657 | } | 7882 | } |
| 4658 | #[repr(transparent)] | 7883 | #[doc = "status register"] |
| 4659 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7884 | pub fn sr(self) -> Reg<regs::Sr, RW> { |
| 4660 | pub struct Lsbfirst(pub u8); | 7885 | unsafe { Reg::from_ptr(self.0.add(4usize)) } |
| 4661 | impl Lsbfirst { | ||
| 4662 | #[doc = "Data is transmitted/received with the MSB first"] | ||
| 4663 | pub const MSBFIRST: Self = Self(0); | ||
| 4664 | #[doc = "Data is transmitted/received with the LSB first"] | ||
| 4665 | pub const LSBFIRST: Self = Self(0x01); | ||
| 4666 | } | 7886 | } |
| 4667 | #[repr(transparent)] | 7887 | #[doc = "data register"] |
| 4668 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7888 | pub fn dr(self) -> Reg<u32, R> { |
| 4669 | pub struct Br(pub u8); | 7889 | unsafe { Reg::from_ptr(self.0.add(8usize)) } |
| 4670 | impl Br { | ||
| 4671 | #[doc = "f_PCLK / 2"] | ||
| 4672 | pub const DIV2: Self = Self(0); | ||
| 4673 | #[doc = "f_PCLK / 4"] | ||
| 4674 | pub const DIV4: Self = Self(0x01); | ||
| 4675 | #[doc = "f_PCLK / 8"] | ||
| 4676 | pub const DIV8: Self = Self(0x02); | ||
| 4677 | #[doc = "f_PCLK / 16"] | ||
| 4678 | pub const DIV16: Self = Self(0x03); | ||
| 4679 | #[doc = "f_PCLK / 32"] | ||
| 4680 | pub const DIV32: Self = Self(0x04); | ||
| 4681 | #[doc = "f_PCLK / 64"] | ||
| 4682 | pub const DIV64: Self = Self(0x05); | ||
| 4683 | #[doc = "f_PCLK / 128"] | ||
| 4684 | pub const DIV128: Self = Self(0x06); | ||
| 4685 | #[doc = "f_PCLK / 256"] | ||
| 4686 | pub const DIV256: Self = Self(0x07); | ||
| 4687 | } | 7890 | } |
| 7891 | } | ||
| 7892 | pub mod regs { | ||
| 7893 | use crate::generic::*; | ||
| 7894 | #[doc = "control register"] | ||
| 4688 | #[repr(transparent)] | 7895 | #[repr(transparent)] |
| 4689 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7896 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 4690 | pub struct Bidimode(pub u8); | 7897 | pub struct Cr(pub u32); |
| 4691 | impl Bidimode { | 7898 | impl Cr { |
| 4692 | #[doc = "2-line unidirectional data mode selected"] | 7899 | #[doc = "Random number generator enable"] |
| 4693 | pub const UNIDIRECTIONAL: Self = Self(0); | 7900 | pub const fn rngen(&self) -> bool { |
| 4694 | #[doc = "1-line bidirectional data mode selected"] | 7901 | let val = (self.0 >> 2usize) & 0x01; |
| 4695 | pub const BIDIRECTIONAL: Self = Self(0x01); | 7902 | val != 0 |
| 7903 | } | ||
| 7904 | #[doc = "Random number generator enable"] | ||
| 7905 | pub fn set_rngen(&mut self, val: bool) { | ||
| 7906 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 7907 | } | ||
| 7908 | #[doc = "Interrupt enable"] | ||
| 7909 | pub const fn ie(&self) -> bool { | ||
| 7910 | let val = (self.0 >> 3usize) & 0x01; | ||
| 7911 | val != 0 | ||
| 7912 | } | ||
| 7913 | #[doc = "Interrupt enable"] | ||
| 7914 | pub fn set_ie(&mut self, val: bool) { | ||
| 7915 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | ||
| 7916 | } | ||
| 4696 | } | 7917 | } |
| 4697 | #[repr(transparent)] | 7918 | impl Default for Cr { |
| 4698 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7919 | fn default() -> Cr { |
| 4699 | pub struct Mstr(pub u8); | 7920 | Cr(0) |
| 4700 | impl Mstr { | 7921 | } |
| 4701 | #[doc = "Slave configuration"] | ||
| 4702 | pub const SLAVE: Self = Self(0); | ||
| 4703 | #[doc = "Master configuration"] | ||
| 4704 | pub const MASTER: Self = Self(0x01); | ||
| 4705 | } | 7922 | } |
| 7923 | #[doc = "status register"] | ||
| 4706 | #[repr(transparent)] | 7924 | #[repr(transparent)] |
| 4707 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7925 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 4708 | pub struct Frer(pub u8); | 7926 | pub struct Sr(pub u32); |
| 4709 | impl Frer { | 7927 | impl Sr { |
| 4710 | #[doc = "No frame format error"] | 7928 | #[doc = "Data ready"] |
| 4711 | pub const NOERROR: Self = Self(0); | 7929 | pub const fn drdy(&self) -> bool { |
| 4712 | #[doc = "A frame format error occurred"] | 7930 | let val = (self.0 >> 0usize) & 0x01; |
| 4713 | pub const ERROR: Self = Self(0x01); | 7931 | val != 0 |
| 7932 | } | ||
| 7933 | #[doc = "Data ready"] | ||
| 7934 | pub fn set_drdy(&mut self, val: bool) { | ||
| 7935 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 7936 | } | ||
| 7937 | #[doc = "Clock error current status"] | ||
| 7938 | pub const fn cecs(&self) -> bool { | ||
| 7939 | let val = (self.0 >> 1usize) & 0x01; | ||
| 7940 | val != 0 | ||
| 7941 | } | ||
| 7942 | #[doc = "Clock error current status"] | ||
| 7943 | pub fn set_cecs(&mut self, val: bool) { | ||
| 7944 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | ||
| 7945 | } | ||
| 7946 | #[doc = "Seed error current status"] | ||
| 7947 | pub const fn secs(&self) -> bool { | ||
| 7948 | let val = (self.0 >> 2usize) & 0x01; | ||
| 7949 | val != 0 | ||
| 7950 | } | ||
| 7951 | #[doc = "Seed error current status"] | ||
| 7952 | pub fn set_secs(&mut self, val: bool) { | ||
| 7953 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 7954 | } | ||
| 7955 | #[doc = "Clock error interrupt status"] | ||
| 7956 | pub const fn ceis(&self) -> bool { | ||
| 7957 | let val = (self.0 >> 5usize) & 0x01; | ||
| 7958 | val != 0 | ||
| 7959 | } | ||
| 7960 | #[doc = "Clock error interrupt status"] | ||
| 7961 | pub fn set_ceis(&mut self, val: bool) { | ||
| 7962 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 7963 | } | ||
| 7964 | #[doc = "Seed error interrupt status"] | ||
| 7965 | pub const fn seis(&self) -> bool { | ||
| 7966 | let val = (self.0 >> 6usize) & 0x01; | ||
| 7967 | val != 0 | ||
| 7968 | } | ||
| 7969 | #[doc = "Seed error interrupt status"] | ||
| 7970 | pub fn set_seis(&mut self, val: bool) { | ||
| 7971 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 7972 | } | ||
| 4714 | } | 7973 | } |
| 4715 | #[repr(transparent)] | 7974 | impl Default for Sr { |
| 4716 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 7975 | fn default() -> Sr { |
| 4717 | pub struct Frf(pub u8); | 7976 | Sr(0) |
| 4718 | impl Frf { | 7977 | } |
| 4719 | #[doc = "SPI Motorola mode"] | ||
| 4720 | pub const MOTOROLA: Self = Self(0); | ||
| 4721 | #[doc = "SPI TI mode"] | ||
| 4722 | pub const TI: Self = Self(0x01); | ||
| 4723 | } | 7978 | } |
| 4724 | } | 7979 | } |
| 4725 | } | 7980 | } |
| 4726 | pub mod i2c_v3 { | 7981 | pub mod sdmmc_v2 { |
| 4727 | use crate::generic::*; | 7982 | use crate::generic::*; |
| 4728 | #[doc = "I2C"] | 7983 | #[doc = "SDMMC"] |
| 4729 | #[derive(Copy, Clone)] | 7984 | #[derive(Copy, Clone)] |
| 4730 | pub struct I2c1(pub *mut u8); | 7985 | pub struct Sdmmc(pub *mut u8); |
| 4731 | unsafe impl Send for I2c1 {} | 7986 | unsafe impl Send for Sdmmc {} |
| 4732 | unsafe impl Sync for I2c1 {} | 7987 | unsafe impl Sync for Sdmmc {} |
| 4733 | impl I2c1 { | 7988 | impl Sdmmc { |
| 4734 | #[doc = "Access: No wait states, except if a write access occurs while a write access to this register is ongoing. In this case, wait states are inserted in the second write access until the previous one is completed. The latency of the second write access can be up to 2 x PCLK1 + 6 x I2CCLK."] | 7989 | #[doc = "SDMMC power control register"] |
| 4735 | pub fn cr1(self) -> Reg<regs::Cr1, RW> { | 7990 | pub fn power(self) -> Reg<regs::Power, RW> { |
| 4736 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | 7991 | unsafe { Reg::from_ptr(self.0.add(0usize)) } |
| 4737 | } | 7992 | } |
| 4738 | #[doc = "Access: No wait states, except if a write access occurs while a write access to this register is ongoing. In this case, wait states are inserted in the second write access until the previous one is completed. The latency of the second write access can be up to 2 x PCLK1 + 6 x I2CCLK."] | 7993 | #[doc = "The SDMMC_CLKCR register controls the SDMMC_CK output clock, the SDMMC_RX_CLK receive clock, and the bus width."] |
| 4739 | pub fn cr2(self) -> Reg<regs::Cr2, RW> { | 7994 | pub fn clkcr(self) -> Reg<regs::Clkcr, RW> { |
| 4740 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | 7995 | unsafe { Reg::from_ptr(self.0.add(4usize)) } |
| 4741 | } | 7996 | } |
| 4742 | #[doc = "Access: No wait states, except if a write access occurs while a write access to this register is ongoing. In this case, wait states are inserted in the second write access until the previous one is completed. The latency of the second write access can be up to 2 x PCLK1 + 6 x I2CCLK."] | 7997 | #[doc = "The SDMMC_ARGR register contains a 32-bit command argument, which is sent to a card as part of a command message."] |
| 4743 | pub fn oar1(self) -> Reg<regs::Oar1, RW> { | 7998 | pub fn argr(self) -> Reg<regs::Argr, RW> { |
| 4744 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | 7999 | unsafe { Reg::from_ptr(self.0.add(8usize)) } |
| 4745 | } | 8000 | } |
| 4746 | #[doc = "Access: No wait states, except if a write access occurs while a write access to this register is ongoing. In this case, wait states are inserted in the second write access until the previous one is completed. The latency of the second write access can be up to 2 x PCLK1 + 6 x I2CCLK."] | 8001 | #[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)."] |
| 4747 | pub fn oar2(self) -> Reg<regs::Oar2, RW> { | 8002 | pub fn cmdr(self) -> Reg<regs::Cmdr, RW> { |
| 4748 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | 8003 | unsafe { Reg::from_ptr(self.0.add(12usize)) } |
| 4749 | } | 8004 | } |
| 4750 | #[doc = "Access: No wait states"] | 8005 | #[doc = "SDMMC command response register"] |
| 4751 | pub fn timingr(self) -> Reg<regs::Timingr, RW> { | 8006 | pub fn respcmdr(self) -> Reg<regs::Respcmdr, R> { |
| 4752 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | 8007 | unsafe { Reg::from_ptr(self.0.add(16usize)) } |
| 4753 | } | 8008 | } |
| 4754 | #[doc = "Access: No wait states, except if a write access occurs while a write access to this register is ongoing. In this case, wait states are inserted in the second write access until the previous one is completed. The latency of the second write access can be up to 2 x PCLK1 + 6 x I2CCLK."] | 8009 | #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] |
| 4755 | pub fn timeoutr(self) -> Reg<regs::Timeoutr, RW> { | 8010 | pub fn respr(self, n: usize) -> Reg<regs::Resp1r, R> { |
| 4756 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | 8011 | assert!(n < 4usize); |
| 4757 | } | 8012 | unsafe { Reg::from_ptr(self.0.add(20usize + n * 4usize)) } |
| 4758 | #[doc = "Access: No wait states"] | ||
| 4759 | pub fn isr(self) -> Reg<regs::Isr, RW> { | ||
| 4760 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | ||
| 4761 | } | ||
| 4762 | #[doc = "Access: No wait states"] | ||
| 4763 | pub fn icr(self) -> Reg<regs::Icr, W> { | ||
| 4764 | unsafe { Reg::from_ptr(self.0.add(28usize)) } | ||
| 4765 | } | ||
| 4766 | #[doc = "Access: No wait states"] | ||
| 4767 | pub fn pecr(self) -> Reg<regs::Pecr, R> { | ||
| 4768 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | ||
| 4769 | } | 8013 | } |
| 4770 | #[doc = "Access: No wait states"] | 8014 | #[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."] |
| 4771 | pub fn rxdr(self) -> Reg<regs::Rxdr, R> { | 8015 | pub fn dtimer(self) -> Reg<regs::Dtimer, RW> { |
| 4772 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | 8016 | unsafe { Reg::from_ptr(self.0.add(36usize)) } |
| 4773 | } | 8017 | } |
| 4774 | #[doc = "Access: No wait states"] | 8018 | #[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."] |
| 4775 | pub fn txdr(self) -> Reg<regs::Txdr, RW> { | 8019 | pub fn dlenr(self) -> Reg<regs::Dlenr, RW> { |
| 4776 | unsafe { Reg::from_ptr(self.0.add(40usize)) } | 8020 | unsafe { Reg::from_ptr(self.0.add(40usize)) } |
| 4777 | } | 8021 | } |
| 4778 | } | 8022 | #[doc = "The SDMMC_DCTRL register control the data path state machine (DPSM)."] |
| 4779 | pub mod vals { | 8023 | pub fn dctrl(self) -> Reg<regs::Dctrl, RW> { |
| 4780 | use crate::generic::*; | 8024 | unsafe { Reg::from_ptr(self.0.add(44usize)) } |
| 4781 | #[repr(transparent)] | ||
| 4782 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4783 | pub struct Reload(pub u8); | ||
| 4784 | impl Reload { | ||
| 4785 | #[doc = "The transfer is completed after the NBYTES data transfer (STOP or RESTART will follow)"] | ||
| 4786 | pub const COMPLETED: Self = Self(0); | ||
| 4787 | #[doc = "The transfer is not completed after the NBYTES data transfer (NBYTES will be reloaded)"] | ||
| 4788 | pub const NOTCOMPLETED: Self = Self(0x01); | ||
| 4789 | } | ||
| 4790 | #[repr(transparent)] | ||
| 4791 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 4792 | pub struct Add(pub u8); | ||
| 4793 | impl Add { | ||
| 4794 | #[doc = "The master operates in 7-bit addressing mode"] | ||
| 4795 | pub const BIT7: Self = Self(0); | ||
| 4796 | #[doc = "The master operates in 10-bit addressing mode"] | ||
| 4797 | pub const BIT10: Self = Self(0x01); | ||
| 4798 | } | 8025 | } |
| 4799 | #[repr(transparent)] | 8026 | #[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."] |
| 4800 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8027 | pub fn dcntr(self) -> Reg<regs::Dcntr, R> { |
| 4801 | pub struct Oamsk(pub u8); | 8028 | unsafe { Reg::from_ptr(self.0.add(48usize)) } |
| 4802 | impl Oamsk { | ||
| 4803 | #[doc = "No mask"] | ||
| 4804 | pub const NOMASK: Self = Self(0); | ||
| 4805 | #[doc = "OA2[1] | ||
| 4806 | is masked and don’t care. Only OA2[7:2] | ||
| 4807 | are compared"] | ||
| 4808 | pub const MASK1: Self = Self(0x01); | ||
| 4809 | #[doc = "OA2[2:1] | ||
| 4810 | are masked and don’t care. Only OA2[7:3] | ||
| 4811 | are compared"] | ||
| 4812 | pub const MASK2: Self = Self(0x02); | ||
| 4813 | #[doc = "OA2[3:1] | ||
| 4814 | are masked and don’t care. Only OA2[7:4] | ||
| 4815 | are compared"] | ||
| 4816 | pub const MASK3: Self = Self(0x03); | ||
| 4817 | #[doc = "OA2[4:1] | ||
| 4818 | are masked and don’t care. Only OA2[7:5] | ||
| 4819 | are compared"] | ||
| 4820 | pub const MASK4: Self = Self(0x04); | ||
| 4821 | #[doc = "OA2[5:1] | ||
| 4822 | are masked and don’t care. Only OA2[7:6] | ||
| 4823 | are compared"] | ||
| 4824 | pub const MASK5: Self = Self(0x05); | ||
| 4825 | #[doc = "OA2[6:1] | ||
| 4826 | are masked and don’t care. Only OA2[7] | ||
| 4827 | is compared."] | ||
| 4828 | pub const MASK6: Self = Self(0x06); | ||
| 4829 | #[doc = "OA2[7:1] | ||
| 4830 | are masked and don’t care. No comparison is done, and all (except reserved) 7-bit received addresses are acknowledged"] | ||
| 4831 | pub const MASK7: Self = Self(0x07); | ||
| 4832 | } | 8029 | } |
| 4833 | #[repr(transparent)] | 8030 | #[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)"] |
| 4834 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8031 | pub fn star(self) -> Reg<regs::Star, R> { |
| 4835 | pub struct Nack(pub u8); | 8032 | unsafe { Reg::from_ptr(self.0.add(52usize)) } |
| 4836 | impl Nack { | ||
| 4837 | #[doc = "an ACK is sent after current received byte"] | ||
| 4838 | pub const ACK: Self = Self(0); | ||
| 4839 | #[doc = "a NACK is sent after current received byte"] | ||
| 4840 | pub const NACK: Self = Self(0x01); | ||
| 4841 | } | 8033 | } |
| 4842 | #[repr(transparent)] | 8034 | #[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."] |
| 4843 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8035 | pub fn icr(self) -> Reg<regs::Icr, RW> { |
| 4844 | pub struct Headr(pub u8); | 8036 | unsafe { Reg::from_ptr(self.0.add(56usize)) } |
| 4845 | impl Headr { | ||
| 4846 | #[doc = "The master sends the complete 10 bit slave address read sequence"] | ||
| 4847 | pub const COMPLETE: Self = Self(0); | ||
| 4848 | #[doc = "The master only sends the 1st 7 bits of the 10 bit address, followed by Read direction"] | ||
| 4849 | pub const PARTIAL: Self = Self(0x01); | ||
| 4850 | } | 8037 | } |
| 4851 | #[repr(transparent)] | 8038 | #[doc = "The interrupt mask register determines which status flags generate an interrupt request by setting the corresponding bit to 1."] |
| 4852 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8039 | pub fn maskr(self) -> Reg<regs::Maskr, RW> { |
| 4853 | pub struct RdWrn(pub u8); | 8040 | unsafe { Reg::from_ptr(self.0.add(60usize)) } |
| 4854 | impl RdWrn { | ||
| 4855 | #[doc = "Master requests a write transfer"] | ||
| 4856 | pub const WRITE: Self = Self(0); | ||
| 4857 | #[doc = "Master requests a read transfer"] | ||
| 4858 | pub const READ: Self = Self(0x01); | ||
| 4859 | } | 8041 | } |
| 4860 | #[repr(transparent)] | 8042 | #[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."] |
| 4861 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8043 | pub fn acktimer(self) -> Reg<regs::Acktimer, RW> { |
| 4862 | pub struct Pecerr(pub u8); | 8044 | unsafe { Reg::from_ptr(self.0.add(64usize)) } |
| 4863 | impl Pecerr { | ||
| 4864 | #[doc = "Received PEC does match with PEC register"] | ||
| 4865 | pub const MATCH: Self = Self(0); | ||
| 4866 | #[doc = "Received PEC does not match with PEC register"] | ||
| 4867 | pub const NOMATCH: Self = Self(0x01); | ||
| 4868 | } | 8045 | } |
| 4869 | #[repr(transparent)] | 8046 | #[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."] |
| 4870 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8047 | pub fn idmactrlr(self) -> Reg<regs::Idmactrlr, RW> { |
| 4871 | pub struct Dnf(pub u8); | 8048 | unsafe { Reg::from_ptr(self.0.add(80usize)) } |
| 4872 | impl Dnf { | ||
| 4873 | #[doc = "Digital filter disabled"] | ||
| 4874 | pub const NOFILTER: Self = Self(0); | ||
| 4875 | #[doc = "Digital filter enabled and filtering capability up to 1 tI2CCLK"] | ||
| 4876 | pub const FILTER1: Self = Self(0x01); | ||
| 4877 | #[doc = "Digital filter enabled and filtering capability up to 2 tI2CCLK"] | ||
| 4878 | pub const FILTER2: Self = Self(0x02); | ||
| 4879 | #[doc = "Digital filter enabled and filtering capability up to 3 tI2CCLK"] | ||
| 4880 | pub const FILTER3: Self = Self(0x03); | ||
| 4881 | #[doc = "Digital filter enabled and filtering capability up to 4 tI2CCLK"] | ||
| 4882 | pub const FILTER4: Self = Self(0x04); | ||
| 4883 | #[doc = "Digital filter enabled and filtering capability up to 5 tI2CCLK"] | ||
| 4884 | pub const FILTER5: Self = Self(0x05); | ||
| 4885 | #[doc = "Digital filter enabled and filtering capability up to 6 tI2CCLK"] | ||
| 4886 | pub const FILTER6: Self = Self(0x06); | ||
| 4887 | #[doc = "Digital filter enabled and filtering capability up to 7 tI2CCLK"] | ||
| 4888 | pub const FILTER7: Self = Self(0x07); | ||
| 4889 | #[doc = "Digital filter enabled and filtering capability up to 8 tI2CCLK"] | ||
| 4890 | pub const FILTER8: Self = Self(0x08); | ||
| 4891 | #[doc = "Digital filter enabled and filtering capability up to 9 tI2CCLK"] | ||
| 4892 | pub const FILTER9: Self = Self(0x09); | ||
| 4893 | #[doc = "Digital filter enabled and filtering capability up to 10 tI2CCLK"] | ||
| 4894 | pub const FILTER10: Self = Self(0x0a); | ||
| 4895 | #[doc = "Digital filter enabled and filtering capability up to 11 tI2CCLK"] | ||
| 4896 | pub const FILTER11: Self = Self(0x0b); | ||
| 4897 | #[doc = "Digital filter enabled and filtering capability up to 12 tI2CCLK"] | ||
| 4898 | pub const FILTER12: Self = Self(0x0c); | ||
| 4899 | #[doc = "Digital filter enabled and filtering capability up to 13 tI2CCLK"] | ||
| 4900 | pub const FILTER13: Self = Self(0x0d); | ||
| 4901 | #[doc = "Digital filter enabled and filtering capability up to 14 tI2CCLK"] | ||
| 4902 | pub const FILTER14: Self = Self(0x0e); | ||
| 4903 | #[doc = "Digital filter enabled and filtering capability up to 15 tI2CCLK"] | ||
| 4904 | pub const FILTER15: Self = Self(0x0f); | ||
| 4905 | } | 8049 | } |
| 4906 | #[repr(transparent)] | 8050 | #[doc = "The SDMMC_IDMABSIZER register contains the buffers size when in double buffer configuration."] |
| 4907 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8051 | pub fn idmabsizer(self) -> Reg<regs::Idmabsizer, RW> { |
| 4908 | pub struct Start(pub u8); | 8052 | unsafe { Reg::from_ptr(self.0.add(84usize)) } |
| 4909 | impl Start { | ||
| 4910 | #[doc = "No Start generation"] | ||
| 4911 | pub const NOSTART: Self = Self(0); | ||
| 4912 | #[doc = "Restart/Start generation"] | ||
| 4913 | pub const START: Self = Self(0x01); | ||
| 4914 | } | 8053 | } |
| 4915 | #[repr(transparent)] | 8054 | #[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."] |
| 4916 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8055 | pub fn idmabase0r(self) -> Reg<regs::Idmabase0r, RW> { |
| 4917 | pub struct Dir(pub u8); | 8056 | unsafe { Reg::from_ptr(self.0.add(88usize)) } |
| 4918 | impl Dir { | ||
| 4919 | #[doc = "Write transfer, slave enters receiver mode"] | ||
| 4920 | pub const WRITE: Self = Self(0); | ||
| 4921 | #[doc = "Read transfer, slave enters transmitter mode"] | ||
| 4922 | pub const READ: Self = Self(0x01); | ||
| 4923 | } | 8057 | } |
| 4924 | #[repr(transparent)] | 8058 | #[doc = "The SDMMC_IDMABASE1R register contains the double buffer configuration second buffer memory base address."] |
| 4925 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8059 | pub fn idmabase1r(self) -> Reg<regs::Idmabase1r, RW> { |
| 4926 | pub struct Oamode(pub u8); | 8060 | unsafe { Reg::from_ptr(self.0.add(92usize)) } |
| 4927 | impl Oamode { | ||
| 4928 | #[doc = "Own address 1 is a 7-bit address"] | ||
| 4929 | pub const BIT7: Self = Self(0); | ||
| 4930 | #[doc = "Own address 1 is a 10-bit address"] | ||
| 4931 | pub const BIT10: Self = Self(0x01); | ||
| 4932 | } | 8061 | } |
| 4933 | #[repr(transparent)] | 8062 | #[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."] |
| 4934 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8063 | pub fn fifor(self) -> Reg<regs::Fifor, RW> { |
| 4935 | pub struct Stop(pub u8); | 8064 | unsafe { Reg::from_ptr(self.0.add(128usize)) } |
| 4936 | impl Stop { | ||
| 4937 | #[doc = "No Stop generation"] | ||
| 4938 | pub const NOSTOP: Self = Self(0); | ||
| 4939 | #[doc = "Stop generation after current byte transfer"] | ||
| 4940 | pub const STOP: Self = Self(0x01); | ||
| 4941 | } | 8065 | } |
| 4942 | #[repr(transparent)] | 8066 | #[doc = "SDMMC IP version register"] |
| 4943 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8067 | pub fn ver(self) -> Reg<regs::Ver, R> { |
| 4944 | pub struct Autoend(pub u8); | 8068 | unsafe { Reg::from_ptr(self.0.add(1012usize)) } |
| 4945 | impl Autoend { | ||
| 4946 | #[doc = "Software end mode: TC flag is set when NBYTES data are transferred, stretching SCL low"] | ||
| 4947 | pub const SOFTWARE: Self = Self(0); | ||
| 4948 | #[doc = "Automatic end mode: a STOP condition is automatically sent when NBYTES data are transferred"] | ||
| 4949 | pub const AUTOMATIC: Self = Self(0x01); | ||
| 4950 | } | 8069 | } |
| 4951 | #[repr(transparent)] | 8070 | #[doc = "SDMMC IP identification register"] |
| 4952 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 8071 | pub fn id(self) -> Reg<regs::Id, R> { |
| 4953 | pub struct Pecbyte(pub u8); | 8072 | unsafe { Reg::from_ptr(self.0.add(1016usize)) } |
| 4954 | impl Pecbyte { | ||
| 4955 | #[doc = "No PEC transfer"] | ||
| 4956 | pub const NOPEC: Self = Self(0); | ||
| 4957 | #[doc = "PEC transmission/reception is requested"] | ||
| 4958 | pub const PEC: Self = Self(0x01); | ||
| 4959 | } | 8073 | } |
| 4960 | } | 8074 | } |
| 4961 | pub mod regs { | 8075 | pub mod regs { |
| 4962 | use crate::generic::*; | 8076 | use crate::generic::*; |
| 4963 | #[doc = "Access: No wait states, except if a write access occurs while a write access to this register is ongoing. In this case, wait states are inserted in the second write access until the previous one is completed. The latency of the second write access can be up to 2 x PCLK1 + 6 x I2CCLK."] | 8077 | #[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."] |
| 4964 | #[repr(transparent)] | ||
| 4965 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 4966 | pub struct Cr2(pub u32); | ||
| 4967 | impl Cr2 { | ||
| 4968 | #[doc = "Slave address bit 0 (master mode) In 7-bit addressing mode (ADD10 = 0): This bit is dont care In 10-bit addressing mode (ADD10 = 1): This bit should be written with bit 0 of the slave address to be sent Note: Changing these bits when the START bit is set is not allowed."] | ||
| 4969 | pub const fn sadd(&self) -> u16 { | ||
| 4970 | let val = (self.0 >> 0usize) & 0x03ff; | ||
| 4971 | val as u16 | ||
| 4972 | } | ||
| 4973 | #[doc = "Slave address bit 0 (master mode) In 7-bit addressing mode (ADD10 = 0): This bit is dont care In 10-bit addressing mode (ADD10 = 1): This bit should be written with bit 0 of the slave address to be sent Note: Changing these bits when the START bit is set is not allowed."] | ||
| 4974 | pub fn set_sadd(&mut self, val: u16) { | ||
| 4975 | self.0 = (self.0 & !(0x03ff << 0usize)) | (((val as u32) & 0x03ff) << 0usize); | ||
| 4976 | } | ||
| 4977 | #[doc = "Transfer direction (master mode) Note: Changing this bit when the START bit is set is not allowed."] | ||
| 4978 | pub const fn rd_wrn(&self) -> super::vals::RdWrn { | ||
| 4979 | let val = (self.0 >> 10usize) & 0x01; | ||
| 4980 | super::vals::RdWrn(val as u8) | ||
| 4981 | } | ||
| 4982 | #[doc = "Transfer direction (master mode) Note: Changing this bit when the START bit is set is not allowed."] | ||
| 4983 | pub fn set_rd_wrn(&mut self, val: super::vals::RdWrn) { | ||
| 4984 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); | ||
| 4985 | } | ||
| 4986 | #[doc = "10-bit addressing mode (master mode) Note: Changing this bit when the START bit is set is not allowed."] | ||
| 4987 | pub const fn add10(&self) -> super::vals::Add { | ||
| 4988 | let val = (self.0 >> 11usize) & 0x01; | ||
| 4989 | super::vals::Add(val as u8) | ||
| 4990 | } | ||
| 4991 | #[doc = "10-bit addressing mode (master mode) Note: Changing this bit when the START bit is set is not allowed."] | ||
| 4992 | pub fn set_add10(&mut self, val: super::vals::Add) { | ||
| 4993 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); | ||
| 4994 | } | ||
| 4995 | #[doc = "10-bit address header only read direction (master receiver mode) Note: Changing this bit when the START bit is set is not allowed."] | ||
| 4996 | pub const fn head10r(&self) -> super::vals::Headr { | ||
| 4997 | let val = (self.0 >> 12usize) & 0x01; | ||
| 4998 | super::vals::Headr(val as u8) | ||
| 4999 | } | ||
| 5000 | #[doc = "10-bit address header only read direction (master receiver mode) Note: Changing this bit when the START bit is set is not allowed."] | ||
| 5001 | pub fn set_head10r(&mut self, val: super::vals::Headr) { | ||
| 5002 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 5003 | } | ||
| 5004 | #[doc = "Start generation This bit is set by software, and cleared by hardware after the Start followed by the address sequence is sent, by an arbitration loss, by a timeout error detection, or when PE = 0. It can also be cleared by software by writing 1 to the ADDRCF bit in the I2C_ICR register. If the I2C is already in master mode with AUTOEND = 0, setting this bit generates a Repeated Start condition when RELOAD=0, after the end of the NBYTES transfer. Otherwise setting this bit will generate a START condition once the bus is free. Note: Writing 0 to this bit has no effect. The START bit can be set even if the bus is BUSY or I2C is in slave mode. This bit has no effect when RELOAD is set."] | ||
| 5005 | pub const fn start(&self) -> super::vals::Start { | ||
| 5006 | let val = (self.0 >> 13usize) & 0x01; | ||
| 5007 | super::vals::Start(val as u8) | ||
| 5008 | } | ||
| 5009 | #[doc = "Start generation This bit is set by software, and cleared by hardware after the Start followed by the address sequence is sent, by an arbitration loss, by a timeout error detection, or when PE = 0. It can also be cleared by software by writing 1 to the ADDRCF bit in the I2C_ICR register. If the I2C is already in master mode with AUTOEND = 0, setting this bit generates a Repeated Start condition when RELOAD=0, after the end of the NBYTES transfer. Otherwise setting this bit will generate a START condition once the bus is free. Note: Writing 0 to this bit has no effect. The START bit can be set even if the bus is BUSY or I2C is in slave mode. This bit has no effect when RELOAD is set."] | ||
| 5010 | pub fn set_start(&mut self, val: super::vals::Start) { | ||
| 5011 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize); | ||
| 5012 | } | ||
| 5013 | #[doc = "Stop generation (master mode) The bit is set by software, cleared by hardware when a Stop condition is detected, or when PE = 0. In Master Mode: Note: Writing 0 to this bit has no effect."] | ||
| 5014 | pub const fn stop(&self) -> super::vals::Stop { | ||
| 5015 | let val = (self.0 >> 14usize) & 0x01; | ||
| 5016 | super::vals::Stop(val as u8) | ||
| 5017 | } | ||
| 5018 | #[doc = "Stop generation (master mode) The bit is set by software, cleared by hardware when a Stop condition is detected, or when PE = 0. In Master Mode: Note: Writing 0 to this bit has no effect."] | ||
| 5019 | pub fn set_stop(&mut self, val: super::vals::Stop) { | ||
| 5020 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | ||
| 5021 | } | ||
| 5022 | #[doc = "NACK generation (slave mode) The bit is set by software, cleared by hardware when the NACK is sent, or when a STOP condition or an Address matched is received, or when PE=0. Note: Writing 0 to this bit has no effect. This bit is used in slave mode only: in master receiver mode, NACK is automatically generated after last byte preceding STOP or RESTART condition, whatever the NACK bit value. When an overrun occurs in slave receiver NOSTRETCH mode, a NACK is automatically generated whatever the NACK bit value. When hardware PEC checking is enabled (PECBYTE=1), the PEC acknowledge value does not depend on the NACK value."] | ||
| 5023 | pub const fn nack(&self) -> super::vals::Nack { | ||
| 5024 | let val = (self.0 >> 15usize) & 0x01; | ||
| 5025 | super::vals::Nack(val as u8) | ||
| 5026 | } | ||
| 5027 | #[doc = "NACK generation (slave mode) The bit is set by software, cleared by hardware when the NACK is sent, or when a STOP condition or an Address matched is received, or when PE=0. Note: Writing 0 to this bit has no effect. This bit is used in slave mode only: in master receiver mode, NACK is automatically generated after last byte preceding STOP or RESTART condition, whatever the NACK bit value. When an overrun occurs in slave receiver NOSTRETCH mode, a NACK is automatically generated whatever the NACK bit value. When hardware PEC checking is enabled (PECBYTE=1), the PEC acknowledge value does not depend on the NACK value."] | ||
| 5028 | pub fn set_nack(&mut self, val: super::vals::Nack) { | ||
| 5029 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 5030 | } | ||
| 5031 | #[doc = "Number of bytes The number of bytes to be transmitted/received is programmed there. This field is dont care in slave mode with SBC=0. Note: Changing these bits when the START bit is set is not allowed."] | ||
| 5032 | pub const fn nbytes(&self) -> u8 { | ||
| 5033 | let val = (self.0 >> 16usize) & 0xff; | ||
| 5034 | val as u8 | ||
| 5035 | } | ||
| 5036 | #[doc = "Number of bytes The number of bytes to be transmitted/received is programmed there. This field is dont care in slave mode with SBC=0. Note: Changing these bits when the START bit is set is not allowed."] | ||
| 5037 | pub fn set_nbytes(&mut self, val: u8) { | ||
| 5038 | self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize); | ||
| 5039 | } | ||
| 5040 | #[doc = "NBYTES reload mode This bit is set and cleared by software."] | ||
| 5041 | pub const fn reload(&self) -> super::vals::Reload { | ||
| 5042 | let val = (self.0 >> 24usize) & 0x01; | ||
| 5043 | super::vals::Reload(val as u8) | ||
| 5044 | } | ||
| 5045 | #[doc = "NBYTES reload mode This bit is set and cleared by software."] | ||
| 5046 | pub fn set_reload(&mut self, val: super::vals::Reload) { | ||
| 5047 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); | ||
| 5048 | } | ||
| 5049 | #[doc = "Automatic end mode (master mode) This bit is set and cleared by software. Note: This bit has no effect in slave mode or when the RELOAD bit is set."] | ||
| 5050 | pub const fn autoend(&self) -> super::vals::Autoend { | ||
| 5051 | let val = (self.0 >> 25usize) & 0x01; | ||
| 5052 | super::vals::Autoend(val as u8) | ||
| 5053 | } | ||
| 5054 | #[doc = "Automatic end mode (master mode) This bit is set and cleared by software. Note: This bit has no effect in slave mode or when the RELOAD bit is set."] | ||
| 5055 | pub fn set_autoend(&mut self, val: super::vals::Autoend) { | ||
| 5056 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize); | ||
| 5057 | } | ||
| 5058 | #[doc = "Packet error checking byte This bit is set by software, and cleared by hardware when the PEC is transferred, or when a STOP condition or an Address matched is received, also when PE=0. Note: Writing 0 to this bit has no effect. This bit has no effect when RELOAD is set. This bit has no effect is slave mode when SBC=0. If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."] | ||
| 5059 | pub const fn pecbyte(&self) -> super::vals::Pecbyte { | ||
| 5060 | let val = (self.0 >> 26usize) & 0x01; | ||
| 5061 | super::vals::Pecbyte(val as u8) | ||
| 5062 | } | ||
| 5063 | #[doc = "Packet error checking byte This bit is set by software, and cleared by hardware when the PEC is transferred, or when a STOP condition or an Address matched is received, also when PE=0. Note: Writing 0 to this bit has no effect. This bit has no effect when RELOAD is set. This bit has no effect is slave mode when SBC=0. If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."] | ||
| 5064 | pub fn set_pecbyte(&mut self, val: super::vals::Pecbyte) { | ||
| 5065 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val.0 as u32) & 0x01) << 26usize); | ||
| 5066 | } | ||
| 5067 | } | ||
| 5068 | impl Default for Cr2 { | ||
| 5069 | fn default() -> Cr2 { | ||
| 5070 | Cr2(0) | ||
| 5071 | } | ||
| 5072 | } | ||
| 5073 | #[doc = "Access: No wait states"] | ||
| 5074 | #[repr(transparent)] | 8078 | #[repr(transparent)] |
| 5075 | #[derive(Copy, Clone, Eq, PartialEq)] | 8079 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 5076 | pub struct Timingr(pub u32); | 8080 | pub struct Idmabase0r(pub u32); |
| 5077 | impl Timingr { | 8081 | impl Idmabase0r { |
| 5078 | #[doc = "SCL low period (master mode) This field is used to generate the SCL low period in master mode. tSCLL = (SCLL+1) x tPRESC Note: SCLL is also used to generate tBUF and tSU:STA timings."] | 8082 | #[doc = "Buffer 0 memory base address bits [31:2], shall be word aligned (bit [1:0] |
| 5079 | pub const fn scll(&self) -> u8 { | 8083 | 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)."] |
| 5080 | let val = (self.0 >> 0usize) & 0xff; | 8084 | pub const fn idmabase0(&self) -> u32 { |
| 5081 | val as u8 | 8085 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 5082 | } | 8086 | val as u32 |
| 5083 | #[doc = "SCL low period (master mode) This field is used to generate the SCL low period in master mode. tSCLL = (SCLL+1) x tPRESC Note: SCLL is also used to generate tBUF and tSU:STA timings."] | ||
| 5084 | pub fn set_scll(&mut self, val: u8) { | ||
| 5085 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | ||
| 5086 | } | ||
| 5087 | #[doc = "SCL high period (master mode) This field is used to generate the SCL high period in master mode. tSCLH = (SCLH+1) x tPRESC Note: SCLH is also used to generate tSU:STO and tHD:STA timing."] | ||
| 5088 | pub const fn sclh(&self) -> u8 { | ||
| 5089 | let val = (self.0 >> 8usize) & 0xff; | ||
| 5090 | val as u8 | ||
| 5091 | } | ||
| 5092 | #[doc = "SCL high period (master mode) This field is used to generate the SCL high period in master mode. tSCLH = (SCLH+1) x tPRESC Note: SCLH is also used to generate tSU:STO and tHD:STA timing."] | ||
| 5093 | pub fn set_sclh(&mut self, val: u8) { | ||
| 5094 | self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize); | ||
| 5095 | } | ||
| 5096 | #[doc = "Data hold time This field is used to generate the delay tSDADEL between SCL falling edge and SDA edge. In master mode and in slave mode with NOSTRETCH = 0, the SCL line is stretched low during tSDADEL. tSDADEL= SDADEL x tPRESC Note: SDADEL is used to generate tHD:DAT timing."] | ||
| 5097 | pub const fn sdadel(&self) -> u8 { | ||
| 5098 | let val = (self.0 >> 16usize) & 0x0f; | ||
| 5099 | val as u8 | ||
| 5100 | } | ||
| 5101 | #[doc = "Data hold time This field is used to generate the delay tSDADEL between SCL falling edge and SDA edge. In master mode and in slave mode with NOSTRETCH = 0, the SCL line is stretched low during tSDADEL. tSDADEL= SDADEL x tPRESC Note: SDADEL is used to generate tHD:DAT timing."] | ||
| 5102 | pub fn set_sdadel(&mut self, val: u8) { | ||
| 5103 | self.0 = (self.0 & !(0x0f << 16usize)) | (((val as u32) & 0x0f) << 16usize); | ||
| 5104 | } | ||
| 5105 | #[doc = "Data setup time This field is used to generate a delay tSCLDEL between SDA edge and SCL rising edge. In master mode and in slave mode with NOSTRETCH = 0, the SCL line is stretched low during tSCLDEL. tSCLDEL = (SCLDEL+1) x tPRESC Note: tSCLDEL is used to generate tSU:DAT timing."] | ||
| 5106 | pub const fn scldel(&self) -> u8 { | ||
| 5107 | let val = (self.0 >> 20usize) & 0x0f; | ||
| 5108 | val as u8 | ||
| 5109 | } | ||
| 5110 | #[doc = "Data setup time This field is used to generate a delay tSCLDEL between SDA edge and SCL rising edge. In master mode and in slave mode with NOSTRETCH = 0, the SCL line is stretched low during tSCLDEL. tSCLDEL = (SCLDEL+1) x tPRESC Note: tSCLDEL is used to generate tSU:DAT timing."] | ||
| 5111 | pub fn set_scldel(&mut self, val: u8) { | ||
| 5112 | self.0 = (self.0 & !(0x0f << 20usize)) | (((val as u32) & 0x0f) << 20usize); | ||
| 5113 | } | ||
| 5114 | #[doc = "Timing prescaler This field is used to prescale I2CCLK in order to generate the clock period tPRESC used for data setup and hold counters (refer to I2C timings on page9) and for SCL high and low level counters (refer to I2C master initialization on page24). tPRESC = (PRESC+1) x tI2CCLK"] | ||
| 5115 | pub const fn presc(&self) -> u8 { | ||
| 5116 | let val = (self.0 >> 28usize) & 0x0f; | ||
| 5117 | val as u8 | ||
| 5118 | } | 8087 | } |
| 5119 | #[doc = "Timing prescaler This field is used to prescale I2CCLK in order to generate the clock period tPRESC used for data setup and hold counters (refer to I2C timings on page9) and for SCL high and low level counters (refer to I2C master initialization on page24). tPRESC = (PRESC+1) x tI2CCLK"] | 8088 | #[doc = "Buffer 0 memory base address bits [31:2], shall be word aligned (bit [1:0] |
| 5120 | pub fn set_presc(&mut self, val: u8) { | 8089 | 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)."] |
| 5121 | self.0 = (self.0 & !(0x0f << 28usize)) | (((val as u32) & 0x0f) << 28usize); | 8090 | pub fn set_idmabase0(&mut self, val: u32) { |
| 8091 | self.0 = | ||
| 8092 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 5122 | } | 8093 | } |
| 5123 | } | 8094 | } |
| 5124 | impl Default for Timingr { | 8095 | impl Default for Idmabase0r { |
| 5125 | fn default() -> Timingr { | 8096 | fn default() -> Idmabase0r { |
| 5126 | Timingr(0) | 8097 | Idmabase0r(0) |
| 5127 | } | 8098 | } |
| 5128 | } | 8099 | } |
| 5129 | #[doc = "Access: No wait states, except if a write access occurs while a write access to this register is ongoing. In this case, wait states are inserted in the second write access until the previous one is completed. The latency of the second write access can be up to 2 x PCLK1 + 6 x I2CCLK."] | 8100 | #[doc = "The SDMMC_IDMABSIZER register contains the buffers size when in double buffer configuration."] |
| 5130 | #[repr(transparent)] | 8101 | #[repr(transparent)] |
| 5131 | #[derive(Copy, Clone, Eq, PartialEq)] | 8102 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 5132 | pub struct Oar2(pub u32); | 8103 | pub struct Idmabsizer(pub u32); |
| 5133 | impl Oar2 { | 8104 | impl Idmabsizer { |
| 5134 | #[doc = "Interface address bits 7:1 of address Note: These bits can be written only when OA2EN=0."] | 8105 | #[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)."] |
| 5135 | pub const fn oa2(&self) -> u8 { | 8106 | pub const fn idmabndt(&self) -> u8 { |
| 5136 | let val = (self.0 >> 1usize) & 0x7f; | 8107 | let val = (self.0 >> 5usize) & 0xff; |
| 5137 | val as u8 | 8108 | val as u8 |
| 5138 | } | 8109 | } |
| 5139 | #[doc = "Interface address bits 7:1 of address Note: These bits can be written only when OA2EN=0."] | 8110 | #[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)."] |
| 5140 | pub fn set_oa2(&mut self, val: u8) { | 8111 | pub fn set_idmabndt(&mut self, val: u8) { |
| 5141 | self.0 = (self.0 & !(0x7f << 1usize)) | (((val as u32) & 0x7f) << 1usize); | 8112 | self.0 = (self.0 & !(0xff << 5usize)) | (((val as u32) & 0xff) << 5usize); |
| 5142 | } | ||
| 5143 | #[doc = "Own Address 2 masks Note: These bits can be written only when OA2EN=0. As soon as OA2MSK is not equal to 0, the reserved I2C addresses (0b0000xxx and 0b1111xxx) are not acknowledged even if the comparison matches."] | ||
| 5144 | pub const fn oa2msk(&self) -> super::vals::Oamsk { | ||
| 5145 | let val = (self.0 >> 8usize) & 0x07; | ||
| 5146 | super::vals::Oamsk(val as u8) | ||
| 5147 | } | ||
| 5148 | #[doc = "Own Address 2 masks Note: These bits can be written only when OA2EN=0. As soon as OA2MSK is not equal to 0, the reserved I2C addresses (0b0000xxx and 0b1111xxx) are not acknowledged even if the comparison matches."] | ||
| 5149 | pub fn set_oa2msk(&mut self, val: super::vals::Oamsk) { | ||
| 5150 | self.0 = (self.0 & !(0x07 << 8usize)) | (((val.0 as u32) & 0x07) << 8usize); | ||
| 5151 | } | ||
| 5152 | #[doc = "Own Address 2 enable"] | ||
| 5153 | pub const fn oa2en(&self) -> bool { | ||
| 5154 | let val = (self.0 >> 15usize) & 0x01; | ||
| 5155 | val != 0 | ||
| 5156 | } | ||
| 5157 | #[doc = "Own Address 2 enable"] | ||
| 5158 | pub fn set_oa2en(&mut self, val: bool) { | ||
| 5159 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); | ||
| 5160 | } | 8113 | } |
| 5161 | } | 8114 | } |
| 5162 | impl Default for Oar2 { | 8115 | impl Default for Idmabsizer { |
| 5163 | fn default() -> Oar2 { | 8116 | fn default() -> Idmabsizer { |
| 5164 | Oar2(0) | 8117 | Idmabsizer(0) |
| 5165 | } | 8118 | } |
| 5166 | } | 8119 | } |
| 5167 | #[doc = "Access: No wait states"] | 8120 | #[doc = "The interrupt mask register determines which status flags generate an interrupt request by setting the corresponding bit to 1."] |
| 5168 | #[repr(transparent)] | 8121 | #[repr(transparent)] |
| 5169 | #[derive(Copy, Clone, Eq, PartialEq)] | 8122 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 5170 | pub struct Isr(pub u32); | 8123 | pub struct Maskr(pub u32); |
| 5171 | impl Isr { | 8124 | impl Maskr { |
| 5172 | #[doc = "Transmit data register empty (transmitters) This bit is set by hardware when the I2C_TXDR register is empty. It is cleared when the next data to be sent is written in the I2C_TXDR register. This bit can be written to 1 by software in order to flush the transmit data register I2C_TXDR. Note: This bit is set by hardware when PE=0."] | 8125 | #[doc = "Command CRC fail interrupt enable Set and cleared by software to enable/disable interrupt caused by command CRC failure."] |
| 5173 | pub const fn txe(&self) -> bool { | 8126 | pub const fn ccrcfailie(&self) -> bool { |
| 5174 | let val = (self.0 >> 0usize) & 0x01; | 8127 | let val = (self.0 >> 0usize) & 0x01; |
| 5175 | val != 0 | 8128 | val != 0 |
| 5176 | } | 8129 | } |
| 5177 | #[doc = "Transmit data register empty (transmitters) This bit is set by hardware when the I2C_TXDR register is empty. It is cleared when the next data to be sent is written in the I2C_TXDR register. This bit can be written to 1 by software in order to flush the transmit data register I2C_TXDR. Note: This bit is set by hardware when PE=0."] | 8130 | #[doc = "Command CRC fail interrupt enable Set and cleared by software to enable/disable interrupt caused by command CRC failure."] |
| 5178 | pub fn set_txe(&mut self, val: bool) { | 8131 | pub fn set_ccrcfailie(&mut self, val: bool) { |
| 5179 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 8132 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 5180 | } | 8133 | } |
| 5181 | #[doc = "Transmit interrupt status (transmitters) This bit is set by hardware when the I2C_TXDR register is empty and the data to be transmitted must be written in the I2C_TXDR register. It is cleared when the next data to be sent is written in the I2C_TXDR register. This bit can be written to 1 by software when NOSTRETCH=1 only, in order to generate a TXIS event (interrupt if TXIE=1 or DMA request if TXDMAEN=1). Note: This bit is cleared by hardware when PE=0."] | 8134 | #[doc = "Data CRC fail interrupt enable Set and cleared by software to enable/disable interrupt caused by data CRC failure."] |
| 5182 | pub const fn txis(&self) -> bool { | 8135 | pub const fn dcrcfailie(&self) -> bool { |
| 5183 | let val = (self.0 >> 1usize) & 0x01; | 8136 | let val = (self.0 >> 1usize) & 0x01; |
| 5184 | val != 0 | 8137 | val != 0 |
| 5185 | } | 8138 | } |
| 5186 | #[doc = "Transmit interrupt status (transmitters) This bit is set by hardware when the I2C_TXDR register is empty and the data to be transmitted must be written in the I2C_TXDR register. It is cleared when the next data to be sent is written in the I2C_TXDR register. This bit can be written to 1 by software when NOSTRETCH=1 only, in order to generate a TXIS event (interrupt if TXIE=1 or DMA request if TXDMAEN=1). Note: This bit is cleared by hardware when PE=0."] | 8139 | #[doc = "Data CRC fail interrupt enable Set and cleared by software to enable/disable interrupt caused by data CRC failure."] |
| 5187 | pub fn set_txis(&mut self, val: bool) { | 8140 | pub fn set_dcrcfailie(&mut self, val: bool) { |
| 5188 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 8141 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 5189 | } | 8142 | } |
| 5190 | #[doc = "Receive data register not empty (receivers) This bit is set by hardware when the received data is copied into the I2C_RXDR register, and is ready to be read. It is cleared when I2C_RXDR is read. Note: This bit is cleared by hardware when PE=0."] | 8143 | #[doc = "Command timeout interrupt enable Set and cleared by software to enable/disable interrupt caused by command timeout."] |
| 5191 | pub const fn rxne(&self) -> bool { | 8144 | pub const fn ctimeoutie(&self) -> bool { |
| 5192 | let val = (self.0 >> 2usize) & 0x01; | 8145 | let val = (self.0 >> 2usize) & 0x01; |
| 5193 | val != 0 | 8146 | val != 0 |
| 5194 | } | 8147 | } |
| 5195 | #[doc = "Receive data register not empty (receivers) This bit is set by hardware when the received data is copied into the I2C_RXDR register, and is ready to be read. It is cleared when I2C_RXDR is read. Note: This bit is cleared by hardware when PE=0."] | 8148 | #[doc = "Command timeout interrupt enable Set and cleared by software to enable/disable interrupt caused by command timeout."] |
| 5196 | pub fn set_rxne(&mut self, val: bool) { | 8149 | pub fn set_ctimeoutie(&mut self, val: bool) { |
| 5197 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 8150 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 5198 | } | 8151 | } |
| 5199 | #[doc = "Address matched (slave mode) This bit is set by hardware as soon as the received slave address matched with one of the enabled slave addresses. It is cleared by software by setting ADDRCF bit. Note: This bit is cleared by hardware when PE=0."] | 8152 | #[doc = "Data timeout interrupt enable Set and cleared by software to enable/disable interrupt caused by data timeout."] |
| 5200 | pub const fn addr(&self) -> bool { | 8153 | pub const fn dtimeoutie(&self) -> bool { |
| 5201 | let val = (self.0 >> 3usize) & 0x01; | 8154 | let val = (self.0 >> 3usize) & 0x01; |
| 5202 | val != 0 | 8155 | val != 0 |
| 5203 | } | 8156 | } |
| 5204 | #[doc = "Address matched (slave mode) This bit is set by hardware as soon as the received slave address matched with one of the enabled slave addresses. It is cleared by software by setting ADDRCF bit. Note: This bit is cleared by hardware when PE=0."] | 8157 | #[doc = "Data timeout interrupt enable Set and cleared by software to enable/disable interrupt caused by data timeout."] |
| 5205 | pub fn set_addr(&mut self, val: bool) { | 8158 | pub fn set_dtimeoutie(&mut self, val: bool) { |
| 5206 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 8159 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); |
| 5207 | } | 8160 | } |
| 5208 | #[doc = "Not Acknowledge received flag This flag is set by hardware when a NACK is received after a byte transmission. It is cleared by software by setting the NACKCF bit. Note: This bit is cleared by hardware when PE=0."] | 8161 | #[doc = "Tx FIFO underrun error interrupt enable Set and cleared by software to enable/disable interrupt caused by Tx FIFO underrun error."] |
| 5209 | pub const fn nackf(&self) -> bool { | 8162 | pub const fn txunderrie(&self) -> bool { |
| 5210 | let val = (self.0 >> 4usize) & 0x01; | 8163 | let val = (self.0 >> 4usize) & 0x01; |
| 5211 | val != 0 | 8164 | val != 0 |
| 5212 | } | 8165 | } |
| 5213 | #[doc = "Not Acknowledge received flag This flag is set by hardware when a NACK is received after a byte transmission. It is cleared by software by setting the NACKCF bit. Note: This bit is cleared by hardware when PE=0."] | 8166 | #[doc = "Tx FIFO underrun error interrupt enable Set and cleared by software to enable/disable interrupt caused by Tx FIFO underrun error."] |
| 5214 | pub fn set_nackf(&mut self, val: bool) { | 8167 | pub fn set_txunderrie(&mut self, val: bool) { |
| 5215 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 8168 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 5216 | } | 8169 | } |
| 5217 | #[doc = "Stop detection flag This flag is set by hardware when a Stop condition is detected on the bus and the peripheral is involved in this transfer: either as a master, provided that the STOP condition is generated by the peripheral. or as a slave, provided that the peripheral has been addressed previously during this transfer. It is cleared by software by setting the STOPCF bit. Note: This bit is cleared by hardware when PE=0."] | 8170 | #[doc = "Rx FIFO overrun error interrupt enable Set and cleared by software to enable/disable interrupt caused by Rx FIFO overrun error."] |
| 5218 | pub const fn stopf(&self) -> bool { | 8171 | pub const fn rxoverrie(&self) -> bool { |
| 5219 | let val = (self.0 >> 5usize) & 0x01; | 8172 | let val = (self.0 >> 5usize) & 0x01; |
| 5220 | val != 0 | 8173 | val != 0 |
| 5221 | } | 8174 | } |
| 5222 | #[doc = "Stop detection flag This flag is set by hardware when a Stop condition is detected on the bus and the peripheral is involved in this transfer: either as a master, provided that the STOP condition is generated by the peripheral. or as a slave, provided that the peripheral has been addressed previously during this transfer. It is cleared by software by setting the STOPCF bit. Note: This bit is cleared by hardware when PE=0."] | 8175 | #[doc = "Rx FIFO overrun error interrupt enable Set and cleared by software to enable/disable interrupt caused by Rx FIFO overrun error."] |
| 5223 | pub fn set_stopf(&mut self, val: bool) { | 8176 | pub fn set_rxoverrie(&mut self, val: bool) { |
| 5224 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 8177 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 5225 | } | 8178 | } |
| 5226 | #[doc = "Transfer Complete (master mode) This flag is set by hardware when RELOAD=0, AUTOEND=0 and NBYTES data have been transferred. It is cleared by software when START bit or STOP bit is set. Note: This bit is cleared by hardware when PE=0."] | 8179 | #[doc = "Command response received interrupt enable Set and cleared by software to enable/disable interrupt caused by receiving command response."] |
| 5227 | pub const fn tc(&self) -> bool { | 8180 | pub const fn cmdrendie(&self) -> bool { |
| 5228 | let val = (self.0 >> 6usize) & 0x01; | 8181 | let val = (self.0 >> 6usize) & 0x01; |
| 5229 | val != 0 | 8182 | val != 0 |
| 5230 | } | 8183 | } |
| 5231 | #[doc = "Transfer Complete (master mode) This flag is set by hardware when RELOAD=0, AUTOEND=0 and NBYTES data have been transferred. It is cleared by software when START bit or STOP bit is set. Note: This bit is cleared by hardware when PE=0."] | 8184 | #[doc = "Command response received interrupt enable Set and cleared by software to enable/disable interrupt caused by receiving command response."] |
| 5232 | pub fn set_tc(&mut self, val: bool) { | 8185 | pub fn set_cmdrendie(&mut self, val: bool) { |
| 5233 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 8186 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 5234 | } | 8187 | } |
| 5235 | #[doc = "Transfer Complete Reload This flag is set by hardware when RELOAD=1 and NBYTES data have been transferred. It is cleared by software when NBYTES is written to a non-zero value. Note: This bit is cleared by hardware when PE=0. This flag is only for master mode, or for slave mode when the SBC bit is set."] | 8188 | #[doc = "Command sent interrupt enable Set and cleared by software to enable/disable interrupt caused by sending command."] |
| 5236 | pub const fn tcr(&self) -> bool { | 8189 | pub const fn cmdsentie(&self) -> bool { |
| 5237 | let val = (self.0 >> 7usize) & 0x01; | 8190 | let val = (self.0 >> 7usize) & 0x01; |
| 5238 | val != 0 | 8191 | val != 0 |
| 5239 | } | 8192 | } |
| 5240 | #[doc = "Transfer Complete Reload This flag is set by hardware when RELOAD=1 and NBYTES data have been transferred. It is cleared by software when NBYTES is written to a non-zero value. Note: This bit is cleared by hardware when PE=0. This flag is only for master mode, or for slave mode when the SBC bit is set."] | 8193 | #[doc = "Command sent interrupt enable Set and cleared by software to enable/disable interrupt caused by sending command."] |
| 5241 | pub fn set_tcr(&mut self, val: bool) { | 8194 | pub fn set_cmdsentie(&mut self, val: bool) { |
| 5242 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 8195 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 5243 | } | 8196 | } |
| 5244 | #[doc = "Bus error This flag is set by hardware when a misplaced Start or Stop condition is detected whereas the peripheral is involved in the transfer. The flag is not set during the address phase in slave mode. It is cleared by software by setting BERRCF bit. Note: This bit is cleared by hardware when PE=0."] | 8197 | #[doc = "Data end interrupt enable Set and cleared by software to enable/disable interrupt caused by data end."] |
| 5245 | pub const fn berr(&self) -> bool { | 8198 | pub const fn dataendie(&self) -> bool { |
| 5246 | let val = (self.0 >> 8usize) & 0x01; | 8199 | let val = (self.0 >> 8usize) & 0x01; |
| 5247 | val != 0 | 8200 | val != 0 |
| 5248 | } | 8201 | } |
| 5249 | #[doc = "Bus error This flag is set by hardware when a misplaced Start or Stop condition is detected whereas the peripheral is involved in the transfer. The flag is not set during the address phase in slave mode. It is cleared by software by setting BERRCF bit. Note: This bit is cleared by hardware when PE=0."] | 8202 | #[doc = "Data end interrupt enable Set and cleared by software to enable/disable interrupt caused by data end."] |
| 5250 | pub fn set_berr(&mut self, val: bool) { | 8203 | pub fn set_dataendie(&mut self, val: bool) { |
| 5251 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 8204 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 5252 | } | 8205 | } |
| 5253 | #[doc = "Arbitration lost This flag is set by hardware in case of arbitration loss. It is cleared by software by setting the ARLOCF bit. Note: This bit is cleared by hardware when PE=0."] | 8206 | #[doc = "Data hold interrupt enable Set and cleared by software to enable/disable the interrupt generated when sending new data is hold in the DPSM Wait_S state."] |
| 5254 | pub const fn arlo(&self) -> bool { | 8207 | pub const fn dholdie(&self) -> bool { |
| 5255 | let val = (self.0 >> 9usize) & 0x01; | 8208 | let val = (self.0 >> 9usize) & 0x01; |
| 5256 | val != 0 | 8209 | val != 0 |
| 5257 | } | 8210 | } |
| 5258 | #[doc = "Arbitration lost This flag is set by hardware in case of arbitration loss. It is cleared by software by setting the ARLOCF bit. Note: This bit is cleared by hardware when PE=0."] | 8211 | #[doc = "Data hold interrupt enable Set and cleared by software to enable/disable the interrupt generated when sending new data is hold in the DPSM Wait_S state."] |
| 5259 | pub fn set_arlo(&mut self, val: bool) { | 8212 | pub fn set_dholdie(&mut self, val: bool) { |
| 5260 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | 8213 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); |
| 5261 | } | 8214 | } |
| 5262 | #[doc = "Overrun/Underrun (slave mode) This flag is set by hardware in slave mode with NOSTRETCH=1, when an overrun/underrun error occurs. It is cleared by software by setting the OVRCF bit. Note: This bit is cleared by hardware when PE=0."] | 8215 | #[doc = "Data block end interrupt enable Set and cleared by software to enable/disable interrupt caused by data block end."] |
| 5263 | pub const fn ovr(&self) -> bool { | 8216 | pub const fn dbckendie(&self) -> bool { |
| 5264 | let val = (self.0 >> 10usize) & 0x01; | 8217 | let val = (self.0 >> 10usize) & 0x01; |
| 5265 | val != 0 | 8218 | val != 0 |
| 5266 | } | 8219 | } |
| 5267 | #[doc = "Overrun/Underrun (slave mode) This flag is set by hardware in slave mode with NOSTRETCH=1, when an overrun/underrun error occurs. It is cleared by software by setting the OVRCF bit. Note: This bit is cleared by hardware when PE=0."] | 8220 | #[doc = "Data block end interrupt enable Set and cleared by software to enable/disable interrupt caused by data block end."] |
| 5268 | pub fn set_ovr(&mut self, val: bool) { | 8221 | pub fn set_dbckendie(&mut self, val: bool) { |
| 5269 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | 8222 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); |
| 5270 | } | 8223 | } |
| 5271 | #[doc = "PEC Error in reception This flag is set by hardware when the received PEC does not match with the PEC register content. A NACK is automatically sent after the wrong PEC reception. It is cleared by software by setting the PECCF bit. Note: This bit is cleared by hardware when PE=0. If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."] | 8224 | #[doc = "Data transfer aborted interrupt enable Set and cleared by software to enable/disable interrupt caused by a data transfer being aborted."] |
| 5272 | pub const fn pecerr(&self) -> super::vals::Pecerr { | 8225 | pub const fn dabortie(&self) -> bool { |
| 5273 | let val = (self.0 >> 11usize) & 0x01; | 8226 | let val = (self.0 >> 11usize) & 0x01; |
| 5274 | super::vals::Pecerr(val as u8) | ||
| 5275 | } | ||
| 5276 | #[doc = "PEC Error in reception This flag is set by hardware when the received PEC does not match with the PEC register content. A NACK is automatically sent after the wrong PEC reception. It is cleared by software by setting the PECCF bit. Note: This bit is cleared by hardware when PE=0. If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."] | ||
| 5277 | pub fn set_pecerr(&mut self, val: super::vals::Pecerr) { | ||
| 5278 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); | ||
| 5279 | } | ||
| 5280 | #[doc = "Timeout or tLOW detection flag This flag is set by hardware when a timeout or extended clock timeout occurred. It is cleared by software by setting the TIMEOUTCF bit. Note: This bit is cleared by hardware when PE=0. If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."] | ||
| 5281 | pub const fn timeout(&self) -> bool { | ||
| 5282 | let val = (self.0 >> 12usize) & 0x01; | ||
| 5283 | val != 0 | 8227 | val != 0 |
| 5284 | } | 8228 | } |
| 5285 | #[doc = "Timeout or tLOW detection flag This flag is set by hardware when a timeout or extended clock timeout occurred. It is cleared by software by setting the TIMEOUTCF bit. Note: This bit is cleared by hardware when PE=0. If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."] | 8229 | #[doc = "Data transfer aborted interrupt enable Set and cleared by software to enable/disable interrupt caused by a data transfer being aborted."] |
| 5286 | pub fn set_timeout(&mut self, val: bool) { | 8230 | pub fn set_dabortie(&mut self, val: bool) { |
| 5287 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); | 8231 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); |
| 5288 | } | 8232 | } |
| 5289 | #[doc = "SMBus alert This flag is set by hardware when SMBHEN=1 (SMBus host configuration), ALERTEN=1 and a SMBALERT event (falling edge) is detected on SMBA pin. It is cleared by software by setting the ALERTCF bit. Note: This bit is cleared by hardware when PE=0. If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."] | 8233 | #[doc = "Tx FIFO half empty interrupt enable Set and cleared by software to enable/disable interrupt caused by Tx FIFO half empty."] |
| 5290 | pub const fn alert(&self) -> bool { | 8234 | pub const fn txfifoheie(&self) -> bool { |
| 5291 | let val = (self.0 >> 13usize) & 0x01; | 8235 | let val = (self.0 >> 14usize) & 0x01; |
| 5292 | val != 0 | 8236 | val != 0 |
| 5293 | } | 8237 | } |
| 5294 | #[doc = "SMBus alert This flag is set by hardware when SMBHEN=1 (SMBus host configuration), ALERTEN=1 and a SMBALERT event (falling edge) is detected on SMBA pin. It is cleared by software by setting the ALERTCF bit. Note: This bit is cleared by hardware when PE=0. If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."] | 8238 | #[doc = "Tx FIFO half empty interrupt enable Set and cleared by software to enable/disable interrupt caused by Tx FIFO half empty."] |
| 5295 | pub fn set_alert(&mut self, val: bool) { | 8239 | pub fn set_txfifoheie(&mut self, val: bool) { |
| 5296 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | 8240 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); |
| 5297 | } | 8241 | } |
| 5298 | #[doc = "Bus busy This flag indicates that a communication is in progress on the bus. It is set by hardware when a START condition is detected. It is cleared by hardware when a Stop condition is detected, or when PE=0."] | 8242 | #[doc = "Rx FIFO half full interrupt enable Set and cleared by software to enable/disable interrupt caused by Rx FIFO half full."] |
| 5299 | pub const fn busy(&self) -> bool { | 8243 | pub const fn rxfifohfie(&self) -> bool { |
| 5300 | let val = (self.0 >> 15usize) & 0x01; | 8244 | let val = (self.0 >> 15usize) & 0x01; |
| 5301 | val != 0 | 8245 | val != 0 |
| 5302 | } | 8246 | } |
| 5303 | #[doc = "Bus busy This flag indicates that a communication is in progress on the bus. It is set by hardware when a START condition is detected. It is cleared by hardware when a Stop condition is detected, or when PE=0."] | 8247 | #[doc = "Rx FIFO half full interrupt enable Set and cleared by software to enable/disable interrupt caused by Rx FIFO half full."] |
| 5304 | pub fn set_busy(&mut self, val: bool) { | 8248 | pub fn set_rxfifohfie(&mut self, val: bool) { |
| 5305 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); | 8249 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); |
| 5306 | } | 8250 | } |
| 5307 | #[doc = "Transfer direction (Slave mode) This flag is updated when an address match event occurs (ADDR=1)."] | 8251 | #[doc = "Rx FIFO full interrupt enable Set and cleared by software to enable/disable interrupt caused by Rx FIFO full."] |
| 5308 | pub const fn dir(&self) -> super::vals::Dir { | 8252 | pub const fn rxfifofie(&self) -> bool { |
| 5309 | let val = (self.0 >> 16usize) & 0x01; | 8253 | let val = (self.0 >> 17usize) & 0x01; |
| 5310 | super::vals::Dir(val as u8) | ||
| 5311 | } | ||
| 5312 | #[doc = "Transfer direction (Slave mode) This flag is updated when an address match event occurs (ADDR=1)."] | ||
| 5313 | pub fn set_dir(&mut self, val: super::vals::Dir) { | ||
| 5314 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 5315 | } | ||
| 5316 | #[doc = "Address match code (Slave mode) These bits are updated with the received address when an address match event occurs (ADDR = 1). In the case of a 10-bit address, ADDCODE provides the 10-bit header followed by the 2 MSBs of the address."] | ||
| 5317 | pub const fn addcode(&self) -> u8 { | ||
| 5318 | let val = (self.0 >> 17usize) & 0x7f; | ||
| 5319 | val as u8 | ||
| 5320 | } | ||
| 5321 | #[doc = "Address match code (Slave mode) These bits are updated with the received address when an address match event occurs (ADDR = 1). In the case of a 10-bit address, ADDCODE provides the 10-bit header followed by the 2 MSBs of the address."] | ||
| 5322 | pub fn set_addcode(&mut self, val: u8) { | ||
| 5323 | self.0 = (self.0 & !(0x7f << 17usize)) | (((val as u32) & 0x7f) << 17usize); | ||
| 5324 | } | ||
| 5325 | } | ||
| 5326 | impl Default for Isr { | ||
| 5327 | fn default() -> Isr { | ||
| 5328 | Isr(0) | ||
| 5329 | } | ||
| 5330 | } | ||
| 5331 | #[doc = "Access: No wait states"] | ||
| 5332 | #[repr(transparent)] | ||
| 5333 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5334 | pub struct Txdr(pub u32); | ||
| 5335 | impl Txdr { | ||
| 5336 | #[doc = "8-bit transmit data Data byte to be transmitted to the I2C bus. Note: These bits can be written only when TXE=1."] | ||
| 5337 | pub const fn txdata(&self) -> u8 { | ||
| 5338 | let val = (self.0 >> 0usize) & 0xff; | ||
| 5339 | val as u8 | ||
| 5340 | } | ||
| 5341 | #[doc = "8-bit transmit data Data byte to be transmitted to the I2C bus. Note: These bits can be written only when TXE=1."] | ||
| 5342 | pub fn set_txdata(&mut self, val: u8) { | ||
| 5343 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | ||
| 5344 | } | ||
| 5345 | } | ||
| 5346 | impl Default for Txdr { | ||
| 5347 | fn default() -> Txdr { | ||
| 5348 | Txdr(0) | ||
| 5349 | } | ||
| 5350 | } | ||
| 5351 | #[doc = "Access: No wait states"] | ||
| 5352 | #[repr(transparent)] | ||
| 5353 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5354 | pub struct Icr(pub u32); | ||
| 5355 | impl Icr { | ||
| 5356 | #[doc = "Address matched flag clear Writing 1 to this bit clears the ADDR flag in the I2C_ISR register. Writing 1 to this bit also clears the START bit in the I2C_CR2 register."] | ||
| 5357 | pub const fn addrcf(&self) -> bool { | ||
| 5358 | let val = (self.0 >> 3usize) & 0x01; | ||
| 5359 | val != 0 | ||
| 5360 | } | ||
| 5361 | #[doc = "Address matched flag clear Writing 1 to this bit clears the ADDR flag in the I2C_ISR register. Writing 1 to this bit also clears the START bit in the I2C_CR2 register."] | ||
| 5362 | pub fn set_addrcf(&mut self, val: bool) { | ||
| 5363 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | ||
| 5364 | } | ||
| 5365 | #[doc = "Not Acknowledge flag clear Writing 1 to this bit clears the ACKF flag in I2C_ISR register."] | ||
| 5366 | pub const fn nackcf(&self) -> bool { | ||
| 5367 | let val = (self.0 >> 4usize) & 0x01; | ||
| 5368 | val != 0 | ||
| 5369 | } | ||
| 5370 | #[doc = "Not Acknowledge flag clear Writing 1 to this bit clears the ACKF flag in I2C_ISR register."] | ||
| 5371 | pub fn set_nackcf(&mut self, val: bool) { | ||
| 5372 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | ||
| 5373 | } | ||
| 5374 | #[doc = "Stop detection flag clear Writing 1 to this bit clears the STOPF flag in the I2C_ISR register."] | ||
| 5375 | pub const fn stopcf(&self) -> bool { | ||
| 5376 | let val = (self.0 >> 5usize) & 0x01; | ||
| 5377 | val != 0 | ||
| 5378 | } | ||
| 5379 | #[doc = "Stop detection flag clear Writing 1 to this bit clears the STOPF flag in the I2C_ISR register."] | ||
| 5380 | pub fn set_stopcf(&mut self, val: bool) { | ||
| 5381 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 5382 | } | ||
| 5383 | #[doc = "Bus error flag clear Writing 1 to this bit clears the BERRF flag in the I2C_ISR register."] | ||
| 5384 | pub const fn berrcf(&self) -> bool { | ||
| 5385 | let val = (self.0 >> 8usize) & 0x01; | ||
| 5386 | val != 0 | ||
| 5387 | } | ||
| 5388 | #[doc = "Bus error flag clear Writing 1 to this bit clears the BERRF flag in the I2C_ISR register."] | ||
| 5389 | pub fn set_berrcf(&mut self, val: bool) { | ||
| 5390 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 5391 | } | ||
| 5392 | #[doc = "Arbitration Lost flag clear Writing 1 to this bit clears the ARLO flag in the I2C_ISR register."] | ||
| 5393 | pub const fn arlocf(&self) -> bool { | ||
| 5394 | let val = (self.0 >> 9usize) & 0x01; | ||
| 5395 | val != 0 | 8254 | val != 0 |
| 5396 | } | 8255 | } |
| 5397 | #[doc = "Arbitration Lost flag clear Writing 1 to this bit clears the ARLO flag in the I2C_ISR register."] | 8256 | #[doc = "Rx FIFO full interrupt enable Set and cleared by software to enable/disable interrupt caused by Rx FIFO full."] |
| 5398 | pub fn set_arlocf(&mut self, val: bool) { | 8257 | pub fn set_rxfifofie(&mut self, val: bool) { |
| 5399 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | 8258 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); |
| 5400 | } | 8259 | } |
| 5401 | #[doc = "Overrun/Underrun flag clear Writing 1 to this bit clears the OVR flag in the I2C_ISR register."] | 8260 | #[doc = "Tx FIFO empty interrupt enable Set and cleared by software to enable/disable interrupt caused by Tx FIFO empty."] |
| 5402 | pub const fn ovrcf(&self) -> bool { | 8261 | pub const fn txfifoeie(&self) -> bool { |
| 5403 | let val = (self.0 >> 10usize) & 0x01; | 8262 | let val = (self.0 >> 18usize) & 0x01; |
| 5404 | val != 0 | 8263 | val != 0 |
| 5405 | } | 8264 | } |
| 5406 | #[doc = "Overrun/Underrun flag clear Writing 1 to this bit clears the OVR flag in the I2C_ISR register."] | 8265 | #[doc = "Tx FIFO empty interrupt enable Set and cleared by software to enable/disable interrupt caused by Tx FIFO empty."] |
| 5407 | pub fn set_ovrcf(&mut self, val: bool) { | 8266 | pub fn set_txfifoeie(&mut self, val: bool) { |
| 5408 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | 8267 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); |
| 5409 | } | 8268 | } |
| 5410 | #[doc = "PEC Error flag clear Writing 1 to this bit clears the PECERR flag in the I2C_ISR register. Note: If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."] | 8269 | #[doc = "BUSYD0END interrupt enable Set and cleared by software to enable/disable the interrupt generated when SDMMC_D0 signal changes from busy to NOT busy following a CMD response."] |
| 5411 | pub const fn peccf(&self) -> bool { | 8270 | pub const fn busyd0endie(&self) -> bool { |
| 5412 | let val = (self.0 >> 11usize) & 0x01; | 8271 | let val = (self.0 >> 21usize) & 0x01; |
| 5413 | val != 0 | 8272 | val != 0 |
| 5414 | } | 8273 | } |
| 5415 | #[doc = "PEC Error flag clear Writing 1 to this bit clears the PECERR flag in the I2C_ISR register. Note: If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."] | 8274 | #[doc = "BUSYD0END interrupt enable Set and cleared by software to enable/disable the interrupt generated when SDMMC_D0 signal changes from busy to NOT busy following a CMD response."] |
| 5416 | pub fn set_peccf(&mut self, val: bool) { | 8275 | pub fn set_busyd0endie(&mut self, val: bool) { |
| 5417 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); | 8276 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); |
| 5418 | } | 8277 | } |
| 5419 | #[doc = "Timeout detection flag clear Writing 1 to this bit clears the TIMEOUT flag in the I2C_ISR register. Note: If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."] | 8278 | #[doc = "SDIO mode interrupt received interrupt enable Set and cleared by software to enable/disable the interrupt generated when receiving the SDIO mode interrupt."] |
| 5420 | pub const fn timoutcf(&self) -> bool { | 8279 | pub const fn sdioitie(&self) -> bool { |
| 5421 | let val = (self.0 >> 12usize) & 0x01; | 8280 | let val = (self.0 >> 22usize) & 0x01; |
| 5422 | val != 0 | 8281 | val != 0 |
| 5423 | } | 8282 | } |
| 5424 | #[doc = "Timeout detection flag clear Writing 1 to this bit clears the TIMEOUT flag in the I2C_ISR register. Note: If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."] | 8283 | #[doc = "SDIO mode interrupt received interrupt enable Set and cleared by software to enable/disable the interrupt generated when receiving the SDIO mode interrupt."] |
| 5425 | pub fn set_timoutcf(&mut self, val: bool) { | 8284 | pub fn set_sdioitie(&mut self, val: bool) { |
| 5426 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); | 8285 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); |
| 5427 | } | 8286 | } |
| 5428 | #[doc = "Alert flag clear Writing 1 to this bit clears the ALERT flag in the I2C_ISR register. Note: If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."] | 8287 | #[doc = "Acknowledgment Fail interrupt enable Set and cleared by software to enable/disable interrupt caused by acknowledgment Fail."] |
| 5429 | pub const fn alertcf(&self) -> bool { | 8288 | pub const fn ackfailie(&self) -> bool { |
| 5430 | let val = (self.0 >> 13usize) & 0x01; | 8289 | let val = (self.0 >> 23usize) & 0x01; |
| 5431 | val != 0 | 8290 | val != 0 |
| 5432 | } | 8291 | } |
| 5433 | #[doc = "Alert flag clear Writing 1 to this bit clears the ALERT flag in the I2C_ISR register. Note: If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."] | 8292 | #[doc = "Acknowledgment Fail interrupt enable Set and cleared by software to enable/disable interrupt caused by acknowledgment Fail."] |
| 5434 | pub fn set_alertcf(&mut self, val: bool) { | 8293 | pub fn set_ackfailie(&mut self, val: bool) { |
| 5435 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | 8294 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); |
| 5436 | } | ||
| 5437 | } | ||
| 5438 | impl Default for Icr { | ||
| 5439 | fn default() -> Icr { | ||
| 5440 | Icr(0) | ||
| 5441 | } | ||
| 5442 | } | ||
| 5443 | #[doc = "Access: No wait states, except if a write access occurs while a write access to this register is ongoing. In this case, wait states are inserted in the second write access until the previous one is completed. The latency of the second write access can be up to 2 x PCLK1 + 6 x I2CCLK."] | ||
| 5444 | #[repr(transparent)] | ||
| 5445 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5446 | pub struct Timeoutr(pub u32); | ||
| 5447 | impl Timeoutr { | ||
| 5448 | #[doc = "Bus Timeout A This field is used to configure: The SCL low timeout condition tTIMEOUT when TIDLE=0 tTIMEOUT= (TIMEOUTA+1) x 2048 x tI2CCLK The bus idle condition (both SCL and SDA high) when TIDLE=1 tIDLE= (TIMEOUTA+1) x 4 x tI2CCLK Note: These bits can be written only when TIMOUTEN=0."] | ||
| 5449 | pub const fn timeouta(&self) -> u16 { | ||
| 5450 | let val = (self.0 >> 0usize) & 0x0fff; | ||
| 5451 | val as u16 | ||
| 5452 | } | ||
| 5453 | #[doc = "Bus Timeout A This field is used to configure: The SCL low timeout condition tTIMEOUT when TIDLE=0 tTIMEOUT= (TIMEOUTA+1) x 2048 x tI2CCLK The bus idle condition (both SCL and SDA high) when TIDLE=1 tIDLE= (TIMEOUTA+1) x 4 x tI2CCLK Note: These bits can be written only when TIMOUTEN=0."] | ||
| 5454 | pub fn set_timeouta(&mut self, val: u16) { | ||
| 5455 | self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); | ||
| 5456 | } | 8295 | } |
| 5457 | #[doc = "Idle clock timeout detection Note: This bit can be written only when TIMOUTEN=0."] | 8296 | #[doc = "Acknowledgment timeout interrupt enable Set and cleared by software to enable/disable interrupt caused by acknowledgment timeout."] |
| 5458 | pub const fn tidle(&self) -> bool { | 8297 | pub const fn acktimeoutie(&self) -> bool { |
| 5459 | let val = (self.0 >> 12usize) & 0x01; | 8298 | let val = (self.0 >> 24usize) & 0x01; |
| 5460 | val != 0 | 8299 | val != 0 |
| 5461 | } | 8300 | } |
| 5462 | #[doc = "Idle clock timeout detection Note: This bit can be written only when TIMOUTEN=0."] | 8301 | #[doc = "Acknowledgment timeout interrupt enable Set and cleared by software to enable/disable interrupt caused by acknowledgment timeout."] |
| 5463 | pub fn set_tidle(&mut self, val: bool) { | 8302 | pub fn set_acktimeoutie(&mut self, val: bool) { |
| 5464 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); | 8303 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize); |
| 5465 | } | 8304 | } |
| 5466 | #[doc = "Clock timeout enable"] | 8305 | #[doc = "Voltage switch critical timing section completion interrupt enable Set and cleared by software to enable/disable the interrupt generated when voltage switch critical timing section completion."] |
| 5467 | pub const fn timouten(&self) -> bool { | 8306 | pub const fn vswendie(&self) -> bool { |
| 5468 | let val = (self.0 >> 15usize) & 0x01; | 8307 | let val = (self.0 >> 25usize) & 0x01; |
| 5469 | val != 0 | 8308 | val != 0 |
| 5470 | } | 8309 | } |
| 5471 | #[doc = "Clock timeout enable"] | 8310 | #[doc = "Voltage switch critical timing section completion interrupt enable Set and cleared by software to enable/disable the interrupt generated when voltage switch critical timing section completion."] |
| 5472 | pub fn set_timouten(&mut self, val: bool) { | 8311 | pub fn set_vswendie(&mut self, val: bool) { |
| 5473 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); | 8312 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize); |
| 5474 | } | ||
| 5475 | #[doc = "Bus timeout B This field is used to configure the cumulative clock extension timeout: In master mode, the master cumulative clock low extend time (tLOW:MEXT) is detected In slave mode, the slave cumulative clock low extend time (tLOW:SEXT) is detected tLOW:EXT= (TIMEOUTB+1) x 2048 x tI2CCLK Note: These bits can be written only when TEXTEN=0."] | ||
| 5476 | pub const fn timeoutb(&self) -> u16 { | ||
| 5477 | let val = (self.0 >> 16usize) & 0x0fff; | ||
| 5478 | val as u16 | ||
| 5479 | } | ||
| 5480 | #[doc = "Bus timeout B This field is used to configure the cumulative clock extension timeout: In master mode, the master cumulative clock low extend time (tLOW:MEXT) is detected In slave mode, the slave cumulative clock low extend time (tLOW:SEXT) is detected tLOW:EXT= (TIMEOUTB+1) x 2048 x tI2CCLK Note: These bits can be written only when TEXTEN=0."] | ||
| 5481 | pub fn set_timeoutb(&mut self, val: u16) { | ||
| 5482 | self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); | ||
| 5483 | } | 8313 | } |
| 5484 | #[doc = "Extended clock timeout enable"] | 8314 | #[doc = "Voltage Switch clock stopped interrupt enable Set and cleared by software to enable/disable interrupt caused by Voltage Switch clock stopped."] |
| 5485 | pub const fn texten(&self) -> bool { | 8315 | pub const fn ckstopie(&self) -> bool { |
| 5486 | let val = (self.0 >> 31usize) & 0x01; | 8316 | let val = (self.0 >> 26usize) & 0x01; |
| 5487 | val != 0 | 8317 | val != 0 |
| 5488 | } | 8318 | } |
| 5489 | #[doc = "Extended clock timeout enable"] | 8319 | #[doc = "Voltage Switch clock stopped interrupt enable Set and cleared by software to enable/disable interrupt caused by Voltage Switch clock stopped."] |
| 5490 | pub fn set_texten(&mut self, val: bool) { | 8320 | pub fn set_ckstopie(&mut self, val: bool) { |
| 5491 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize); | 8321 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); |
| 5492 | } | ||
| 5493 | } | ||
| 5494 | impl Default for Timeoutr { | ||
| 5495 | fn default() -> Timeoutr { | ||
| 5496 | Timeoutr(0) | ||
| 5497 | } | ||
| 5498 | } | ||
| 5499 | #[doc = "Access: No wait states"] | ||
| 5500 | #[repr(transparent)] | ||
| 5501 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5502 | pub struct Rxdr(pub u32); | ||
| 5503 | impl Rxdr { | ||
| 5504 | #[doc = "8-bit receive data Data byte received from the I2C bus."] | ||
| 5505 | pub const fn rxdata(&self) -> u8 { | ||
| 5506 | let val = (self.0 >> 0usize) & 0xff; | ||
| 5507 | val as u8 | ||
| 5508 | } | ||
| 5509 | #[doc = "8-bit receive data Data byte received from the I2C bus."] | ||
| 5510 | pub fn set_rxdata(&mut self, val: u8) { | ||
| 5511 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | ||
| 5512 | } | ||
| 5513 | } | ||
| 5514 | impl Default for Rxdr { | ||
| 5515 | fn default() -> Rxdr { | ||
| 5516 | Rxdr(0) | ||
| 5517 | } | ||
| 5518 | } | ||
| 5519 | #[doc = "Access: No wait states"] | ||
| 5520 | #[repr(transparent)] | ||
| 5521 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5522 | pub struct Pecr(pub u32); | ||
| 5523 | impl Pecr { | ||
| 5524 | #[doc = "Packet error checking register This field contains the internal PEC when PECEN=1. The PEC is cleared by hardware when PE=0."] | ||
| 5525 | pub const fn pec(&self) -> u8 { | ||
| 5526 | let val = (self.0 >> 0usize) & 0xff; | ||
| 5527 | val as u8 | ||
| 5528 | } | ||
| 5529 | #[doc = "Packet error checking register This field contains the internal PEC when PECEN=1. The PEC is cleared by hardware when PE=0."] | ||
| 5530 | pub fn set_pec(&mut self, val: u8) { | ||
| 5531 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | ||
| 5532 | } | ||
| 5533 | } | ||
| 5534 | impl Default for Pecr { | ||
| 5535 | fn default() -> Pecr { | ||
| 5536 | Pecr(0) | ||
| 5537 | } | ||
| 5538 | } | ||
| 5539 | #[doc = "Access: No wait states, except if a write access occurs while a write access to this register is ongoing. In this case, wait states are inserted in the second write access until the previous one is completed. The latency of the second write access can be up to 2 x PCLK1 + 6 x I2CCLK."] | ||
| 5540 | #[repr(transparent)] | ||
| 5541 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5542 | pub struct Oar1(pub u32); | ||
| 5543 | impl Oar1 { | ||
| 5544 | #[doc = "Interface address 7-bit addressing mode: dont care 10-bit addressing mode: bits 9:8 of address Note: These bits can be written only when OA1EN=0. OA1[7:1]: Interface address Bits 7:1 of address Note: These bits can be written only when OA1EN=0. OA1[0]: Interface address 7-bit addressing mode: dont care 10-bit addressing mode: bit 0 of address Note: This bit can be written only when OA1EN=0."] | ||
| 5545 | pub const fn oa1(&self) -> u16 { | ||
| 5546 | let val = (self.0 >> 0usize) & 0x03ff; | ||
| 5547 | val as u16 | ||
| 5548 | } | ||
| 5549 | #[doc = "Interface address 7-bit addressing mode: dont care 10-bit addressing mode: bits 9:8 of address Note: These bits can be written only when OA1EN=0. OA1[7:1]: Interface address Bits 7:1 of address Note: These bits can be written only when OA1EN=0. OA1[0]: Interface address 7-bit addressing mode: dont care 10-bit addressing mode: bit 0 of address Note: This bit can be written only when OA1EN=0."] | ||
| 5550 | pub fn set_oa1(&mut self, val: u16) { | ||
| 5551 | self.0 = (self.0 & !(0x03ff << 0usize)) | (((val as u32) & 0x03ff) << 0usize); | ||
| 5552 | } | ||
| 5553 | #[doc = "Own Address 1 10-bit mode Note: This bit can be written only when OA1EN=0."] | ||
| 5554 | pub const fn oa1mode(&self) -> super::vals::Oamode { | ||
| 5555 | let val = (self.0 >> 10usize) & 0x01; | ||
| 5556 | super::vals::Oamode(val as u8) | ||
| 5557 | } | ||
| 5558 | #[doc = "Own Address 1 10-bit mode Note: This bit can be written only when OA1EN=0."] | ||
| 5559 | pub fn set_oa1mode(&mut self, val: super::vals::Oamode) { | ||
| 5560 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); | ||
| 5561 | } | 8322 | } |
| 5562 | #[doc = "Own Address 1 enable"] | 8323 | #[doc = "IDMA buffer transfer complete interrupt enable Set and cleared by software to enable/disable the interrupt generated when the IDMA has transferred all data belonging to a memory buffer."] |
| 5563 | pub const fn oa1en(&self) -> bool { | 8324 | pub const fn idmabtcie(&self) -> bool { |
| 5564 | let val = (self.0 >> 15usize) & 0x01; | 8325 | let val = (self.0 >> 28usize) & 0x01; |
| 5565 | val != 0 | 8326 | val != 0 |
| 5566 | } | 8327 | } |
| 5567 | #[doc = "Own Address 1 enable"] | 8328 | #[doc = "IDMA buffer transfer complete interrupt enable Set and cleared by software to enable/disable the interrupt generated when the IDMA has transferred all data belonging to a memory buffer."] |
| 5568 | pub fn set_oa1en(&mut self, val: bool) { | 8329 | pub fn set_idmabtcie(&mut self, val: bool) { |
| 5569 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); | 8330 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize); |
| 5570 | } | 8331 | } |
| 5571 | } | 8332 | } |
| 5572 | impl Default for Oar1 { | 8333 | impl Default for Maskr { |
| 5573 | fn default() -> Oar1 { | 8334 | fn default() -> Maskr { |
| 5574 | Oar1(0) | 8335 | Maskr(0) |
| 5575 | } | 8336 | } |
| 5576 | } | 8337 | } |
| 5577 | #[doc = "Access: No wait states, except if a write access occurs while a write access to this register is ongoing. In this case, wait states are inserted in the second write access until the previous one is completed. The latency of the second write access can be up to 2 x PCLK1 + 6 x I2CCLK."] | 8338 | #[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)"] |
| 5578 | #[repr(transparent)] | 8339 | #[repr(transparent)] |
| 5579 | #[derive(Copy, Clone, Eq, PartialEq)] | 8340 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 5580 | pub struct Cr1(pub u32); | 8341 | pub struct Star(pub u32); |
| 5581 | impl Cr1 { | 8342 | impl Star { |
| 5582 | #[doc = "Peripheral enable Note: When PE=0, the I2C SCL and SDA lines are released. Internal state machines and status bits are put back to their reset value. When cleared, PE must be kept low for at least 3 APB clock cycles."] | 8343 | #[doc = "Command response received (CRC check failed). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 5583 | pub const fn pe(&self) -> bool { | 8344 | pub const fn ccrcfail(&self) -> bool { |
| 5584 | let val = (self.0 >> 0usize) & 0x01; | 8345 | let val = (self.0 >> 0usize) & 0x01; |
| 5585 | val != 0 | 8346 | val != 0 |
| 5586 | } | 8347 | } |
| 5587 | #[doc = "Peripheral enable Note: When PE=0, the I2C SCL and SDA lines are released. Internal state machines and status bits are put back to their reset value. When cleared, PE must be kept low for at least 3 APB clock cycles."] | 8348 | #[doc = "Command response received (CRC check failed). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 5588 | pub fn set_pe(&mut self, val: bool) { | 8349 | pub fn set_ccrcfail(&mut self, val: bool) { |
| 5589 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 8350 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 5590 | } | 8351 | } |
| 5591 | #[doc = "TX Interrupt enable"] | 8352 | #[doc = "Data block sent/received (CRC check failed). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 5592 | pub const fn txie(&self) -> bool { | 8353 | pub const fn dcrcfail(&self) -> bool { |
| 5593 | let val = (self.0 >> 1usize) & 0x01; | 8354 | let val = (self.0 >> 1usize) & 0x01; |
| 5594 | val != 0 | 8355 | val != 0 |
| 5595 | } | 8356 | } |
| 5596 | #[doc = "TX Interrupt enable"] | 8357 | #[doc = "Data block sent/received (CRC check failed). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 5597 | pub fn set_txie(&mut self, val: bool) { | 8358 | pub fn set_dcrcfail(&mut self, val: bool) { |
| 5598 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 8359 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 5599 | } | 8360 | } |
| 5600 | #[doc = "RX Interrupt enable"] | 8361 | #[doc = "Command response timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR. The Command Timeout period has a fixed value of 64 SDMMC_CK clock periods."] |
| 5601 | pub const fn rxie(&self) -> bool { | 8362 | pub const fn ctimeout(&self) -> bool { |
| 5602 | let val = (self.0 >> 2usize) & 0x01; | 8363 | let val = (self.0 >> 2usize) & 0x01; |
| 5603 | val != 0 | 8364 | val != 0 |
| 5604 | } | 8365 | } |
| 5605 | #[doc = "RX Interrupt enable"] | 8366 | #[doc = "Command response timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR. The Command Timeout period has a fixed value of 64 SDMMC_CK clock periods."] |
| 5606 | pub fn set_rxie(&mut self, val: bool) { | 8367 | pub fn set_ctimeout(&mut self, val: bool) { |
| 5607 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 8368 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 5608 | } | 8369 | } |
| 5609 | #[doc = "Address match Interrupt enable (slave only)"] | 8370 | #[doc = "Data timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 5610 | pub const fn addrie(&self) -> bool { | 8371 | pub const fn dtimeout(&self) -> bool { |
| 5611 | let val = (self.0 >> 3usize) & 0x01; | 8372 | let val = (self.0 >> 3usize) & 0x01; |
| 5612 | val != 0 | 8373 | val != 0 |
| 5613 | } | 8374 | } |
| 5614 | #[doc = "Address match Interrupt enable (slave only)"] | 8375 | #[doc = "Data timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 5615 | pub fn set_addrie(&mut self, val: bool) { | 8376 | pub fn set_dtimeout(&mut self, val: bool) { |
| 5616 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 8377 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); |
| 5617 | } | 8378 | } |
| 5618 | #[doc = "Not acknowledge received Interrupt enable"] | 8379 | #[doc = "Transmit FIFO underrun error or IDMA read transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 5619 | pub const fn nackie(&self) -> bool { | 8380 | pub const fn txunderr(&self) -> bool { |
| 5620 | let val = (self.0 >> 4usize) & 0x01; | 8381 | let val = (self.0 >> 4usize) & 0x01; |
| 5621 | val != 0 | 8382 | val != 0 |
| 5622 | } | 8383 | } |
| 5623 | #[doc = "Not acknowledge received Interrupt enable"] | 8384 | #[doc = "Transmit FIFO underrun error or IDMA read transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 5624 | pub fn set_nackie(&mut self, val: bool) { | 8385 | pub fn set_txunderr(&mut self, val: bool) { |
| 5625 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 8386 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 5626 | } | 8387 | } |
| 5627 | #[doc = "STOP detection Interrupt enable"] | 8388 | #[doc = "Received FIFO overrun error or IDMA write transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 5628 | pub const fn stopie(&self) -> bool { | 8389 | pub const fn rxoverr(&self) -> bool { |
| 5629 | let val = (self.0 >> 5usize) & 0x01; | 8390 | let val = (self.0 >> 5usize) & 0x01; |
| 5630 | val != 0 | 8391 | val != 0 |
| 5631 | } | 8392 | } |
| 5632 | #[doc = "STOP detection Interrupt enable"] | 8393 | #[doc = "Received FIFO overrun error or IDMA write transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 5633 | pub fn set_stopie(&mut self, val: bool) { | 8394 | pub fn set_rxoverr(&mut self, val: bool) { |
| 5634 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 8395 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 5635 | } | 8396 | } |
| 5636 | #[doc = "Transfer Complete interrupt enable Note: Any of these events will generate an interrupt: Transfer Complete (TC) Transfer Complete Reload (TCR)"] | 8397 | #[doc = "Command response received (CRC check passed, or no CRC). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 5637 | pub const fn tcie(&self) -> bool { | 8398 | pub const fn cmdrend(&self) -> bool { |
| 5638 | let val = (self.0 >> 6usize) & 0x01; | 8399 | let val = (self.0 >> 6usize) & 0x01; |
| 5639 | val != 0 | 8400 | val != 0 |
| 5640 | } | 8401 | } |
| 5641 | #[doc = "Transfer Complete interrupt enable Note: Any of these events will generate an interrupt: Transfer Complete (TC) Transfer Complete Reload (TCR)"] | 8402 | #[doc = "Command response received (CRC check passed, or no CRC). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 5642 | pub fn set_tcie(&mut self, val: bool) { | 8403 | pub fn set_cmdrend(&mut self, val: bool) { |
| 5643 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 8404 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 5644 | } | 8405 | } |
| 5645 | #[doc = "Error interrupts enable Note: Any of these errors generate an interrupt: Arbitration Loss (ARLO) Bus Error detection (BERR) Overrun/Underrun (OVR) Timeout detection (TIMEOUT) PEC error detection (PECERR) Alert pin event detection (ALERT)"] | 8406 | #[doc = "Command sent (no response required). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 5646 | pub const fn errie(&self) -> bool { | 8407 | pub const fn cmdsent(&self) -> bool { |
| 5647 | let val = (self.0 >> 7usize) & 0x01; | 8408 | let val = (self.0 >> 7usize) & 0x01; |
| 5648 | val != 0 | 8409 | val != 0 |
| 5649 | } | 8410 | } |
| 5650 | #[doc = "Error interrupts enable Note: Any of these errors generate an interrupt: Arbitration Loss (ARLO) Bus Error detection (BERR) Overrun/Underrun (OVR) Timeout detection (TIMEOUT) PEC error detection (PECERR) Alert pin event detection (ALERT)"] | 8411 | #[doc = "Command sent (no response required). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 5651 | pub fn set_errie(&mut self, val: bool) { | 8412 | pub fn set_cmdsent(&mut self, val: bool) { |
| 5652 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 8413 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 5653 | } | 8414 | } |
| 5654 | #[doc = "Digital noise filter These bits are used to configure the digital noise filter on SDA and SCL input. The digital filter will filter spikes with a length of up to DNF[3:0] | 8415 | #[doc = "Data transfer ended correctly. (data counter, DATACOUNT is zero and no errors occur). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 5655 | * tI2CCLK ... Note: If the analog filter is also enabled, the digital filter is added to the analog filter. This filter can only be programmed when the I2C is disabled (PE = 0)."] | 8416 | pub const fn dataend(&self) -> bool { |
| 5656 | pub const fn dnf(&self) -> super::vals::Dnf { | 8417 | let val = (self.0 >> 8usize) & 0x01; |
| 5657 | let val = (self.0 >> 8usize) & 0x0f; | 8418 | val != 0 |
| 5658 | super::vals::Dnf(val as u8) | ||
| 5659 | } | 8419 | } |
| 5660 | #[doc = "Digital noise filter These bits are used to configure the digital noise filter on SDA and SCL input. The digital filter will filter spikes with a length of up to DNF[3:0] | 8420 | #[doc = "Data transfer ended correctly. (data counter, DATACOUNT is zero and no errors occur). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 5661 | * tI2CCLK ... Note: If the analog filter is also enabled, the digital filter is added to the analog filter. This filter can only be programmed when the I2C is disabled (PE = 0)."] | 8421 | pub fn set_dataend(&mut self, val: bool) { |
| 5662 | pub fn set_dnf(&mut self, val: super::vals::Dnf) { | 8422 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 5663 | self.0 = (self.0 & !(0x0f << 8usize)) | (((val.0 as u32) & 0x0f) << 8usize); | ||
| 5664 | } | 8423 | } |
| 5665 | #[doc = "Analog noise filter OFF Note: This bit can only be programmed when the I2C is disabled (PE = 0)."] | 8424 | #[doc = "Data transfer Hold. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 5666 | pub const fn anfoff(&self) -> bool { | 8425 | pub const fn dhold(&self) -> bool { |
| 8426 | let val = (self.0 >> 9usize) & 0x01; | ||
| 8427 | val != 0 | ||
| 8428 | } | ||
| 8429 | #[doc = "Data transfer Hold. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | ||
| 8430 | pub fn set_dhold(&mut self, val: bool) { | ||
| 8431 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | ||
| 8432 | } | ||
| 8433 | #[doc = "Data block sent/received. (CRC check passed) and DPSM moves to the READWAIT state. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | ||
| 8434 | pub const fn dbckend(&self) -> bool { | ||
| 8435 | let val = (self.0 >> 10usize) & 0x01; | ||
| 8436 | val != 0 | ||
| 8437 | } | ||
| 8438 | #[doc = "Data block sent/received. (CRC check passed) and DPSM moves to the READWAIT state. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | ||
| 8439 | pub fn set_dbckend(&mut self, val: bool) { | ||
| 8440 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | ||
| 8441 | } | ||
| 8442 | #[doc = "Data transfer aborted by CMD12. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | ||
| 8443 | pub const fn dabort(&self) -> bool { | ||
| 8444 | let val = (self.0 >> 11usize) & 0x01; | ||
| 8445 | val != 0 | ||
| 8446 | } | ||
| 8447 | #[doc = "Data transfer aborted by CMD12. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | ||
| 8448 | pub fn set_dabort(&mut self, val: bool) { | ||
| 8449 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); | ||
| 8450 | } | ||
| 8451 | #[doc = "Data path state machine active, i.e. not in Idle state. This is a hardware status flag only, does not generate an interrupt."] | ||
| 8452 | pub const fn dpsmact(&self) -> bool { | ||
| 5667 | let val = (self.0 >> 12usize) & 0x01; | 8453 | let val = (self.0 >> 12usize) & 0x01; |
| 5668 | val != 0 | 8454 | val != 0 |
| 5669 | } | 8455 | } |
| 5670 | #[doc = "Analog noise filter OFF Note: This bit can only be programmed when the I2C is disabled (PE = 0)."] | 8456 | #[doc = "Data path state machine active, i.e. not in Idle state. This is a hardware status flag only, does not generate an interrupt."] |
| 5671 | pub fn set_anfoff(&mut self, val: bool) { | 8457 | pub fn set_dpsmact(&mut self, val: bool) { |
| 5672 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); | 8458 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); |
| 5673 | } | 8459 | } |
| 5674 | #[doc = "DMA transmission requests enable"] | 8460 | #[doc = "Command path state machine active, i.e. not in Idle state. This is a hardware status flag only, does not generate an interrupt."] |
| 5675 | pub const fn txdmaen(&self) -> bool { | 8461 | pub const fn cpsmact(&self) -> bool { |
| 8462 | let val = (self.0 >> 13usize) & 0x01; | ||
| 8463 | val != 0 | ||
| 8464 | } | ||
| 8465 | #[doc = "Command path state machine active, i.e. not in Idle state. This is a hardware status flag only, does not generate an interrupt."] | ||
| 8466 | pub fn set_cpsmact(&mut self, val: bool) { | ||
| 8467 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | ||
| 8468 | } | ||
| 8469 | #[doc = "Transmit FIFO half empty At least half the number of words can be written into the FIFO. This bit is cleared when the FIFO becomes half+1 full."] | ||
| 8470 | pub const fn txfifohe(&self) -> bool { | ||
| 5676 | let val = (self.0 >> 14usize) & 0x01; | 8471 | let val = (self.0 >> 14usize) & 0x01; |
| 5677 | val != 0 | 8472 | val != 0 |
| 5678 | } | 8473 | } |
| 5679 | #[doc = "DMA transmission requests enable"] | 8474 | #[doc = "Transmit FIFO half empty At least half the number of words can be written into the FIFO. This bit is cleared when the FIFO becomes half+1 full."] |
| 5680 | pub fn set_txdmaen(&mut self, val: bool) { | 8475 | pub fn set_txfifohe(&mut self, val: bool) { |
| 5681 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | 8476 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); |
| 5682 | } | 8477 | } |
| 5683 | #[doc = "DMA reception requests enable"] | 8478 | #[doc = "Receive FIFO half full There are at least half the number of words in the FIFO. This bit is cleared when the FIFO becomes half+1 empty."] |
| 5684 | pub const fn rxdmaen(&self) -> bool { | 8479 | pub const fn rxfifohf(&self) -> bool { |
| 5685 | let val = (self.0 >> 15usize) & 0x01; | 8480 | let val = (self.0 >> 15usize) & 0x01; |
| 5686 | val != 0 | 8481 | val != 0 |
| 5687 | } | 8482 | } |
| 5688 | #[doc = "DMA reception requests enable"] | 8483 | #[doc = "Receive FIFO half full There are at least half the number of words in the FIFO. This bit is cleared when the FIFO becomes half+1 empty."] |
| 5689 | pub fn set_rxdmaen(&mut self, val: bool) { | 8484 | pub fn set_rxfifohf(&mut self, val: bool) { |
| 5690 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); | 8485 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); |
| 5691 | } | 8486 | } |
| 5692 | #[doc = "Slave byte control This bit is used to enable hardware byte control in slave mode."] | 8487 | #[doc = "Transmit FIFO full This is a hardware status flag only, does not generate an interrupt. This bit is cleared when one FIFO location becomes empty."] |
| 5693 | pub const fn sbc(&self) -> bool { | 8488 | pub const fn txfifof(&self) -> bool { |
| 5694 | let val = (self.0 >> 16usize) & 0x01; | 8489 | let val = (self.0 >> 16usize) & 0x01; |
| 5695 | val != 0 | 8490 | val != 0 |
| 5696 | } | 8491 | } |
| 5697 | #[doc = "Slave byte control This bit is used to enable hardware byte control in slave mode."] | 8492 | #[doc = "Transmit FIFO full This is a hardware status flag only, does not generate an interrupt. This bit is cleared when one FIFO location becomes empty."] |
| 5698 | pub fn set_sbc(&mut self, val: bool) { | 8493 | pub fn set_txfifof(&mut self, val: bool) { |
| 5699 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | 8494 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); |
| 5700 | } | 8495 | } |
| 5701 | #[doc = "Clock stretching disable This bit is used to disable clock stretching in slave mode. It must be kept cleared in master mode. Note: This bit can only be programmed when the I2C is disabled (PE = 0)."] | 8496 | #[doc = "Receive FIFO full This bit is cleared when one FIFO location becomes empty."] |
| 5702 | pub const fn nostretch(&self) -> bool { | 8497 | pub const fn rxfifof(&self) -> bool { |
| 5703 | let val = (self.0 >> 17usize) & 0x01; | 8498 | let val = (self.0 >> 17usize) & 0x01; |
| 5704 | val != 0 | 8499 | val != 0 |
| 5705 | } | 8500 | } |
| 5706 | #[doc = "Clock stretching disable This bit is used to disable clock stretching in slave mode. It must be kept cleared in master mode. Note: This bit can only be programmed when the I2C is disabled (PE = 0)."] | 8501 | #[doc = "Receive FIFO full This bit is cleared when one FIFO location becomes empty."] |
| 5707 | pub fn set_nostretch(&mut self, val: bool) { | 8502 | pub fn set_rxfifof(&mut self, val: bool) { |
| 5708 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); | 8503 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); |
| 5709 | } | 8504 | } |
| 5710 | #[doc = "Wakeup from Stop mode enable Note: If the Wakeup from Stop mode feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation. Note: WUPEN can be set only when DNF = 0000"] | 8505 | #[doc = "Transmit FIFO empty This bit is cleared when one FIFO location becomes full."] |
| 5711 | pub const fn wupen(&self) -> bool { | 8506 | pub const fn txfifoe(&self) -> bool { |
| 5712 | let val = (self.0 >> 18usize) & 0x01; | 8507 | let val = (self.0 >> 18usize) & 0x01; |
| 5713 | val != 0 | 8508 | val != 0 |
| 5714 | } | 8509 | } |
| 5715 | #[doc = "Wakeup from Stop mode enable Note: If the Wakeup from Stop mode feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation. Note: WUPEN can be set only when DNF = 0000"] | 8510 | #[doc = "Transmit FIFO empty This bit is cleared when one FIFO location becomes full."] |
| 5716 | pub fn set_wupen(&mut self, val: bool) { | 8511 | pub fn set_txfifoe(&mut self, val: bool) { |
| 5717 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); | 8512 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); |
| 5718 | } | 8513 | } |
| 5719 | #[doc = "General call enable"] | 8514 | #[doc = "Receive FIFO empty This is a hardware status flag only, does not generate an interrupt. This bit is cleared when one FIFO location becomes full."] |
| 5720 | pub const fn gcen(&self) -> bool { | 8515 | pub const fn rxfifoe(&self) -> bool { |
| 5721 | let val = (self.0 >> 19usize) & 0x01; | 8516 | let val = (self.0 >> 19usize) & 0x01; |
| 5722 | val != 0 | 8517 | val != 0 |
| 5723 | } | 8518 | } |
| 5724 | #[doc = "General call enable"] | 8519 | #[doc = "Receive FIFO empty This is a hardware status flag only, does not generate an interrupt. This bit is cleared when one FIFO location becomes full."] |
| 5725 | pub fn set_gcen(&mut self, val: bool) { | 8520 | pub fn set_rxfifoe(&mut self, val: bool) { |
| 5726 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); | 8521 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); |
| 5727 | } | 8522 | } |
| 5728 | #[doc = "SMBus Host address enable Note: If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."] | 8523 | #[doc = "Inverted value of SDMMC_D0 line (Busy), sampled at the end of a CMD response and a second time 2 SDMMC_CK cycles after the CMD response. This bit is reset to not busy when the SDMMCD0 line changes from busy to not busy. This bit does not signal busy due to data transfer. This is a hardware status flag only, it does not generate an interrupt."] |
| 5729 | pub const fn smbhen(&self) -> bool { | 8524 | pub const fn busyd0(&self) -> bool { |
| 5730 | let val = (self.0 >> 20usize) & 0x01; | 8525 | let val = (self.0 >> 20usize) & 0x01; |
| 5731 | val != 0 | 8526 | val != 0 |
| 5732 | } | 8527 | } |
| 5733 | #[doc = "SMBus Host address enable Note: If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."] | 8528 | #[doc = "Inverted value of SDMMC_D0 line (Busy), sampled at the end of a CMD response and a second time 2 SDMMC_CK cycles after the CMD response. This bit is reset to not busy when the SDMMCD0 line changes from busy to not busy. This bit does not signal busy due to data transfer. This is a hardware status flag only, it does not generate an interrupt."] |
| 5734 | pub fn set_smbhen(&mut self, val: bool) { | 8529 | pub fn set_busyd0(&mut self, val: bool) { |
| 5735 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); | 8530 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); |
| 5736 | } | 8531 | } |
| 5737 | #[doc = "SMBus Device Default address enable Note: If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."] | 8532 | #[doc = "end of SDMMC_D0 Busy following a CMD response detected. This indicates only end of busy following a CMD response. This bit does not signal busy due to data transfer. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 5738 | pub const fn smbden(&self) -> bool { | 8533 | pub const fn busyd0end(&self) -> bool { |
| 5739 | let val = (self.0 >> 21usize) & 0x01; | 8534 | let val = (self.0 >> 21usize) & 0x01; |
| 5740 | val != 0 | 8535 | val != 0 |
| 5741 | } | 8536 | } |
| 5742 | #[doc = "SMBus Device Default address enable Note: If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."] | 8537 | #[doc = "end of SDMMC_D0 Busy following a CMD response detected. This indicates only end of busy following a CMD response. This bit does not signal busy due to data transfer. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 5743 | pub fn set_smbden(&mut self, val: bool) { | 8538 | pub fn set_busyd0end(&mut self, val: bool) { |
| 5744 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); | 8539 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); |
| 5745 | } | 8540 | } |
| 5746 | #[doc = "SMBus alert enable Device mode (SMBHEN=0): Host mode (SMBHEN=1): Note: When ALERTEN=0, the SMBA pin can be used as a standard GPIO. If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."] | 8541 | #[doc = "SDIO interrupt received. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 5747 | pub const fn alerten(&self) -> bool { | 8542 | pub const fn sdioit(&self) -> bool { |
| 5748 | let val = (self.0 >> 22usize) & 0x01; | 8543 | let val = (self.0 >> 22usize) & 0x01; |
| 5749 | val != 0 | 8544 | val != 0 |
| 5750 | } | 8545 | } |
| 5751 | #[doc = "SMBus alert enable Device mode (SMBHEN=0): Host mode (SMBHEN=1): Note: When ALERTEN=0, the SMBA pin can be used as a standard GPIO. If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."] | 8546 | #[doc = "SDIO interrupt received. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 5752 | pub fn set_alerten(&mut self, val: bool) { | 8547 | pub fn set_sdioit(&mut self, val: bool) { |
| 5753 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); | 8548 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); |
| 5754 | } | 8549 | } |
| 5755 | #[doc = "PEC enable Note: If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."] | 8550 | #[doc = "Boot acknowledgment received (boot acknowledgment check fail). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 5756 | pub const fn pecen(&self) -> bool { | 8551 | pub const fn ackfail(&self) -> bool { |
| 5757 | let val = (self.0 >> 23usize) & 0x01; | 8552 | let val = (self.0 >> 23usize) & 0x01; |
| 5758 | val != 0 | 8553 | val != 0 |
| 5759 | } | 8554 | } |
| 5760 | #[doc = "PEC enable Note: If the SMBus feature is not supported, this bit is reserved and forced by hardware to 0. Please refer to Section25.3: I2C implementation."] | 8555 | #[doc = "Boot acknowledgment received (boot acknowledgment check fail). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 5761 | pub fn set_pecen(&mut self, val: bool) { | 8556 | pub fn set_ackfail(&mut self, val: bool) { |
| 5762 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); | 8557 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); |
| 5763 | } | 8558 | } |
| 5764 | } | 8559 | #[doc = "Boot acknowledgment timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 5765 | impl Default for Cr1 { | 8560 | pub const fn acktimeout(&self) -> bool { |
| 5766 | fn default() -> Cr1 { | 8561 | let val = (self.0 >> 24usize) & 0x01; |
| 5767 | Cr1(0) | ||
| 5768 | } | ||
| 5769 | } | ||
| 5770 | } | ||
| 5771 | } | ||
| 5772 | pub mod gpio_v2 { | ||
| 5773 | use crate::generic::*; | ||
| 5774 | #[doc = "General-purpose I/Os"] | ||
| 5775 | #[derive(Copy, Clone)] | ||
| 5776 | pub struct Gpio(pub *mut u8); | ||
| 5777 | unsafe impl Send for Gpio {} | ||
| 5778 | unsafe impl Sync for Gpio {} | ||
| 5779 | impl Gpio { | ||
| 5780 | #[doc = "GPIO port mode register"] | ||
| 5781 | pub fn moder(self) -> Reg<regs::Moder, RW> { | ||
| 5782 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 5783 | } | ||
| 5784 | #[doc = "GPIO port output type register"] | ||
| 5785 | pub fn otyper(self) -> Reg<regs::Otyper, RW> { | ||
| 5786 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 5787 | } | ||
| 5788 | #[doc = "GPIO port output speed register"] | ||
| 5789 | pub fn ospeedr(self) -> Reg<regs::Ospeedr, RW> { | ||
| 5790 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 5791 | } | ||
| 5792 | #[doc = "GPIO port pull-up/pull-down register"] | ||
| 5793 | pub fn pupdr(self) -> Reg<regs::Pupdr, RW> { | ||
| 5794 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 5795 | } | ||
| 5796 | #[doc = "GPIO port input data register"] | ||
| 5797 | pub fn idr(self) -> Reg<regs::Idr, R> { | ||
| 5798 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 5799 | } | ||
| 5800 | #[doc = "GPIO port output data register"] | ||
| 5801 | pub fn odr(self) -> Reg<regs::Odr, RW> { | ||
| 5802 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 5803 | } | ||
| 5804 | #[doc = "GPIO port bit set/reset register"] | ||
| 5805 | pub fn bsrr(self) -> Reg<regs::Bsrr, W> { | ||
| 5806 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | ||
| 5807 | } | ||
| 5808 | #[doc = "GPIO port configuration lock register"] | ||
| 5809 | pub fn lckr(self) -> Reg<regs::Lckr, RW> { | ||
| 5810 | unsafe { Reg::from_ptr(self.0.add(28usize)) } | ||
| 5811 | } | ||
| 5812 | #[doc = "GPIO alternate function register (low, high)"] | ||
| 5813 | pub fn afr(self, n: usize) -> Reg<regs::Afr, RW> { | ||
| 5814 | assert!(n < 2usize); | ||
| 5815 | unsafe { Reg::from_ptr(self.0.add(32usize + n * 4usize)) } | ||
| 5816 | } | ||
| 5817 | } | ||
| 5818 | pub mod vals { | ||
| 5819 | use crate::generic::*; | ||
| 5820 | #[repr(transparent)] | ||
| 5821 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5822 | pub struct Ospeedr(pub u8); | ||
| 5823 | impl Ospeedr { | ||
| 5824 | #[doc = "Low speed"] | ||
| 5825 | pub const LOWSPEED: Self = Self(0); | ||
| 5826 | #[doc = "Medium speed"] | ||
| 5827 | pub const MEDIUMSPEED: Self = Self(0x01); | ||
| 5828 | #[doc = "High speed"] | ||
| 5829 | pub const HIGHSPEED: Self = Self(0x02); | ||
| 5830 | #[doc = "Very high speed"] | ||
| 5831 | pub const VERYHIGHSPEED: Self = Self(0x03); | ||
| 5832 | } | ||
| 5833 | #[repr(transparent)] | ||
| 5834 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5835 | pub struct Pupdr(pub u8); | ||
| 5836 | impl Pupdr { | ||
| 5837 | #[doc = "No pull-up, pull-down"] | ||
| 5838 | pub const FLOATING: Self = Self(0); | ||
| 5839 | #[doc = "Pull-up"] | ||
| 5840 | pub const PULLUP: Self = Self(0x01); | ||
| 5841 | #[doc = "Pull-down"] | ||
| 5842 | pub const PULLDOWN: Self = Self(0x02); | ||
| 5843 | } | ||
| 5844 | #[repr(transparent)] | ||
| 5845 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5846 | pub struct Lck(pub u8); | ||
| 5847 | impl Lck { | ||
| 5848 | #[doc = "Port configuration not locked"] | ||
| 5849 | pub const UNLOCKED: Self = Self(0); | ||
| 5850 | #[doc = "Port configuration locked"] | ||
| 5851 | pub const LOCKED: Self = Self(0x01); | ||
| 5852 | } | ||
| 5853 | #[repr(transparent)] | ||
| 5854 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5855 | pub struct Odr(pub u8); | ||
| 5856 | impl Odr { | ||
| 5857 | #[doc = "Set output to logic low"] | ||
| 5858 | pub const LOW: Self = Self(0); | ||
| 5859 | #[doc = "Set output to logic high"] | ||
| 5860 | pub const HIGH: Self = Self(0x01); | ||
| 5861 | } | ||
| 5862 | #[repr(transparent)] | ||
| 5863 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5864 | pub struct Bsw(pub u8); | ||
| 5865 | impl Bsw { | ||
| 5866 | #[doc = "Sets the corresponding ODRx bit"] | ||
| 5867 | pub const SET: Self = Self(0x01); | ||
| 5868 | } | ||
| 5869 | #[repr(transparent)] | ||
| 5870 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5871 | pub struct Lckk(pub u8); | ||
| 5872 | impl Lckk { | ||
| 5873 | #[doc = "Port configuration lock key not active"] | ||
| 5874 | pub const NOTACTIVE: Self = Self(0); | ||
| 5875 | #[doc = "Port configuration lock key active"] | ||
| 5876 | pub const ACTIVE: Self = Self(0x01); | ||
| 5877 | } | ||
| 5878 | #[repr(transparent)] | ||
| 5879 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5880 | pub struct Brw(pub u8); | ||
| 5881 | impl Brw { | ||
| 5882 | #[doc = "Resets the corresponding ODRx bit"] | ||
| 5883 | pub const RESET: Self = Self(0x01); | ||
| 5884 | } | ||
| 5885 | #[repr(transparent)] | ||
| 5886 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5887 | pub struct Ot(pub u8); | ||
| 5888 | impl Ot { | ||
| 5889 | #[doc = "Output push-pull (reset state)"] | ||
| 5890 | pub const PUSHPULL: Self = Self(0); | ||
| 5891 | #[doc = "Output open-drain"] | ||
| 5892 | pub const OPENDRAIN: Self = Self(0x01); | ||
| 5893 | } | ||
| 5894 | #[repr(transparent)] | ||
| 5895 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5896 | pub struct Afr(pub u8); | ||
| 5897 | impl Afr { | ||
| 5898 | #[doc = "AF0"] | ||
| 5899 | pub const AF0: Self = Self(0); | ||
| 5900 | #[doc = "AF1"] | ||
| 5901 | pub const AF1: Self = Self(0x01); | ||
| 5902 | #[doc = "AF2"] | ||
| 5903 | pub const AF2: Self = Self(0x02); | ||
| 5904 | #[doc = "AF3"] | ||
| 5905 | pub const AF3: Self = Self(0x03); | ||
| 5906 | #[doc = "AF4"] | ||
| 5907 | pub const AF4: Self = Self(0x04); | ||
| 5908 | #[doc = "AF5"] | ||
| 5909 | pub const AF5: Self = Self(0x05); | ||
| 5910 | #[doc = "AF6"] | ||
| 5911 | pub const AF6: Self = Self(0x06); | ||
| 5912 | #[doc = "AF7"] | ||
| 5913 | pub const AF7: Self = Self(0x07); | ||
| 5914 | #[doc = "AF8"] | ||
| 5915 | pub const AF8: Self = Self(0x08); | ||
| 5916 | #[doc = "AF9"] | ||
| 5917 | pub const AF9: Self = Self(0x09); | ||
| 5918 | #[doc = "AF10"] | ||
| 5919 | pub const AF10: Self = Self(0x0a); | ||
| 5920 | #[doc = "AF11"] | ||
| 5921 | pub const AF11: Self = Self(0x0b); | ||
| 5922 | #[doc = "AF12"] | ||
| 5923 | pub const AF12: Self = Self(0x0c); | ||
| 5924 | #[doc = "AF13"] | ||
| 5925 | pub const AF13: Self = Self(0x0d); | ||
| 5926 | #[doc = "AF14"] | ||
| 5927 | pub const AF14: Self = Self(0x0e); | ||
| 5928 | #[doc = "AF15"] | ||
| 5929 | pub const AF15: Self = Self(0x0f); | ||
| 5930 | } | ||
| 5931 | #[repr(transparent)] | ||
| 5932 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5933 | pub struct Moder(pub u8); | ||
| 5934 | impl Moder { | ||
| 5935 | #[doc = "Input mode (reset state)"] | ||
| 5936 | pub const INPUT: Self = Self(0); | ||
| 5937 | #[doc = "General purpose output mode"] | ||
| 5938 | pub const OUTPUT: Self = Self(0x01); | ||
| 5939 | #[doc = "Alternate function mode"] | ||
| 5940 | pub const ALTERNATE: Self = Self(0x02); | ||
| 5941 | #[doc = "Analog mode"] | ||
| 5942 | pub const ANALOG: Self = Self(0x03); | ||
| 5943 | } | ||
| 5944 | #[repr(transparent)] | ||
| 5945 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 5946 | pub struct Idr(pub u8); | ||
| 5947 | impl Idr { | ||
| 5948 | #[doc = "Input is logic low"] | ||
| 5949 | pub const LOW: Self = Self(0); | ||
| 5950 | #[doc = "Input is logic high"] | ||
| 5951 | pub const HIGH: Self = Self(0x01); | ||
| 5952 | } | ||
| 5953 | } | ||
| 5954 | pub mod regs { | ||
| 5955 | use crate::generic::*; | ||
| 5956 | #[doc = "GPIO port output data register"] | ||
| 5957 | #[repr(transparent)] | ||
| 5958 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5959 | pub struct Odr(pub u32); | ||
| 5960 | impl Odr { | ||
| 5961 | #[doc = "Port output data (y = 0..15)"] | ||
| 5962 | pub fn odr(&self, n: usize) -> super::vals::Odr { | ||
| 5963 | assert!(n < 16usize); | ||
| 5964 | let offs = 0usize + n * 1usize; | ||
| 5965 | let val = (self.0 >> offs) & 0x01; | ||
| 5966 | super::vals::Odr(val as u8) | ||
| 5967 | } | ||
| 5968 | #[doc = "Port output data (y = 0..15)"] | ||
| 5969 | pub fn set_odr(&mut self, n: usize, val: super::vals::Odr) { | ||
| 5970 | assert!(n < 16usize); | ||
| 5971 | let offs = 0usize + n * 1usize; | ||
| 5972 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 5973 | } | ||
| 5974 | } | ||
| 5975 | impl Default for Odr { | ||
| 5976 | fn default() -> Odr { | ||
| 5977 | Odr(0) | ||
| 5978 | } | ||
| 5979 | } | ||
| 5980 | #[doc = "GPIO alternate function register"] | ||
| 5981 | #[repr(transparent)] | ||
| 5982 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 5983 | pub struct Afr(pub u32); | ||
| 5984 | impl Afr { | ||
| 5985 | #[doc = "Alternate function selection for port x bit y (y = 0..15)"] | ||
| 5986 | pub fn afr(&self, n: usize) -> super::vals::Afr { | ||
| 5987 | assert!(n < 8usize); | ||
| 5988 | let offs = 0usize + n * 4usize; | ||
| 5989 | let val = (self.0 >> offs) & 0x0f; | ||
| 5990 | super::vals::Afr(val as u8) | ||
| 5991 | } | ||
| 5992 | #[doc = "Alternate function selection for port x bit y (y = 0..15)"] | ||
| 5993 | pub fn set_afr(&mut self, n: usize, val: super::vals::Afr) { | ||
| 5994 | assert!(n < 8usize); | ||
| 5995 | let offs = 0usize + n * 4usize; | ||
| 5996 | self.0 = (self.0 & !(0x0f << offs)) | (((val.0 as u32) & 0x0f) << offs); | ||
| 5997 | } | ||
| 5998 | } | ||
| 5999 | impl Default for Afr { | ||
| 6000 | fn default() -> Afr { | ||
| 6001 | Afr(0) | ||
| 6002 | } | ||
| 6003 | } | ||
| 6004 | #[doc = "GPIO port bit set/reset register"] | ||
| 6005 | #[repr(transparent)] | ||
| 6006 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6007 | pub struct Bsrr(pub u32); | ||
| 6008 | impl Bsrr { | ||
| 6009 | #[doc = "Port x set bit y (y= 0..15)"] | ||
| 6010 | pub fn bs(&self, n: usize) -> bool { | ||
| 6011 | assert!(n < 16usize); | ||
| 6012 | let offs = 0usize + n * 1usize; | ||
| 6013 | let val = (self.0 >> offs) & 0x01; | ||
| 6014 | val != 0 | 8562 | val != 0 |
| 6015 | } | 8563 | } |
| 6016 | #[doc = "Port x set bit y (y= 0..15)"] | 8564 | #[doc = "Boot acknowledgment timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 6017 | pub fn set_bs(&mut self, n: usize, val: bool) { | 8565 | pub fn set_acktimeout(&mut self, val: bool) { |
| 6018 | assert!(n < 16usize); | 8566 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize); |
| 6019 | let offs = 0usize + n * 1usize; | ||
| 6020 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 6021 | } | 8567 | } |
| 6022 | #[doc = "Port x set bit y (y= 0..15)"] | 8568 | #[doc = "Voltage switch critical timing section completion. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 6023 | pub fn br(&self, n: usize) -> bool { | 8569 | pub const fn vswend(&self) -> bool { |
| 6024 | assert!(n < 16usize); | 8570 | let val = (self.0 >> 25usize) & 0x01; |
| 6025 | let offs = 16usize + n * 1usize; | ||
| 6026 | let val = (self.0 >> offs) & 0x01; | ||
| 6027 | val != 0 | 8571 | val != 0 |
| 6028 | } | 8572 | } |
| 6029 | #[doc = "Port x set bit y (y= 0..15)"] | 8573 | #[doc = "Voltage switch critical timing section completion. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 6030 | pub fn set_br(&mut self, n: usize, val: bool) { | 8574 | pub fn set_vswend(&mut self, val: bool) { |
| 6031 | assert!(n < 16usize); | 8575 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize); |
| 6032 | let offs = 16usize + n * 1usize; | ||
| 6033 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 6034 | } | ||
| 6035 | } | ||
| 6036 | impl Default for Bsrr { | ||
| 6037 | fn default() -> Bsrr { | ||
| 6038 | Bsrr(0) | ||
| 6039 | } | ||
| 6040 | } | ||
| 6041 | #[doc = "GPIO port output speed register"] | ||
| 6042 | #[repr(transparent)] | ||
| 6043 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6044 | pub struct Ospeedr(pub u32); | ||
| 6045 | impl Ospeedr { | ||
| 6046 | #[doc = "Port x configuration bits (y = 0..15)"] | ||
| 6047 | pub fn ospeedr(&self, n: usize) -> super::vals::Ospeedr { | ||
| 6048 | assert!(n < 16usize); | ||
| 6049 | let offs = 0usize + n * 2usize; | ||
| 6050 | let val = (self.0 >> offs) & 0x03; | ||
| 6051 | super::vals::Ospeedr(val as u8) | ||
| 6052 | } | ||
| 6053 | #[doc = "Port x configuration bits (y = 0..15)"] | ||
| 6054 | pub fn set_ospeedr(&mut self, n: usize, val: super::vals::Ospeedr) { | ||
| 6055 | assert!(n < 16usize); | ||
| 6056 | let offs = 0usize + n * 2usize; | ||
| 6057 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | ||
| 6058 | } | ||
| 6059 | } | ||
| 6060 | impl Default for Ospeedr { | ||
| 6061 | fn default() -> Ospeedr { | ||
| 6062 | Ospeedr(0) | ||
| 6063 | } | ||
| 6064 | } | ||
| 6065 | #[doc = "GPIO port mode register"] | ||
| 6066 | #[repr(transparent)] | ||
| 6067 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6068 | pub struct Moder(pub u32); | ||
| 6069 | impl Moder { | ||
| 6070 | #[doc = "Port x configuration bits (y = 0..15)"] | ||
| 6071 | pub fn moder(&self, n: usize) -> super::vals::Moder { | ||
| 6072 | assert!(n < 16usize); | ||
| 6073 | let offs = 0usize + n * 2usize; | ||
| 6074 | let val = (self.0 >> offs) & 0x03; | ||
| 6075 | super::vals::Moder(val as u8) | ||
| 6076 | } | ||
| 6077 | #[doc = "Port x configuration bits (y = 0..15)"] | ||
| 6078 | pub fn set_moder(&mut self, n: usize, val: super::vals::Moder) { | ||
| 6079 | assert!(n < 16usize); | ||
| 6080 | let offs = 0usize + n * 2usize; | ||
| 6081 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | ||
| 6082 | } | ||
| 6083 | } | ||
| 6084 | impl Default for Moder { | ||
| 6085 | fn default() -> Moder { | ||
| 6086 | Moder(0) | ||
| 6087 | } | ||
| 6088 | } | ||
| 6089 | #[doc = "GPIO port output type register"] | ||
| 6090 | #[repr(transparent)] | ||
| 6091 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6092 | pub struct Otyper(pub u32); | ||
| 6093 | impl Otyper { | ||
| 6094 | #[doc = "Port x configuration bits (y = 0..15)"] | ||
| 6095 | pub fn ot(&self, n: usize) -> super::vals::Ot { | ||
| 6096 | assert!(n < 16usize); | ||
| 6097 | let offs = 0usize + n * 1usize; | ||
| 6098 | let val = (self.0 >> offs) & 0x01; | ||
| 6099 | super::vals::Ot(val as u8) | ||
| 6100 | } | 8576 | } |
| 6101 | #[doc = "Port x configuration bits (y = 0..15)"] | 8577 | #[doc = "SDMMC_CK stopped in Voltage switch procedure. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 6102 | pub fn set_ot(&mut self, n: usize, val: super::vals::Ot) { | 8578 | pub const fn ckstop(&self) -> bool { |
| 6103 | assert!(n < 16usize); | 8579 | let val = (self.0 >> 26usize) & 0x01; |
| 6104 | let offs = 0usize + n * 1usize; | 8580 | val != 0 |
| 6105 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 6106 | } | 8581 | } |
| 6107 | } | 8582 | #[doc = "SDMMC_CK stopped in Voltage switch procedure. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 6108 | impl Default for Otyper { | 8583 | pub fn set_ckstop(&mut self, val: bool) { |
| 6109 | fn default() -> Otyper { | 8584 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); |
| 6110 | Otyper(0) | ||
| 6111 | } | 8585 | } |
| 6112 | } | 8586 | #[doc = "IDMA transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 6113 | #[doc = "GPIO port configuration lock register"] | 8587 | pub const fn idmate(&self) -> bool { |
| 6114 | #[repr(transparent)] | 8588 | let val = (self.0 >> 27usize) & 0x01; |
| 6115 | #[derive(Copy, Clone, Eq, PartialEq)] | 8589 | val != 0 |
| 6116 | pub struct Lckr(pub u32); | ||
| 6117 | impl Lckr { | ||
| 6118 | #[doc = "Port x lock bit y (y= 0..15)"] | ||
| 6119 | pub fn lck(&self, n: usize) -> super::vals::Lck { | ||
| 6120 | assert!(n < 16usize); | ||
| 6121 | let offs = 0usize + n * 1usize; | ||
| 6122 | let val = (self.0 >> offs) & 0x01; | ||
| 6123 | super::vals::Lck(val as u8) | ||
| 6124 | } | 8590 | } |
| 6125 | #[doc = "Port x lock bit y (y= 0..15)"] | 8591 | #[doc = "IDMA transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 6126 | pub fn set_lck(&mut self, n: usize, val: super::vals::Lck) { | 8592 | pub fn set_idmate(&mut self, val: bool) { |
| 6127 | assert!(n < 16usize); | 8593 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize); |
| 6128 | let offs = 0usize + n * 1usize; | ||
| 6129 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 6130 | } | 8594 | } |
| 6131 | #[doc = "Port x lock bit y (y= 0..15)"] | 8595 | #[doc = "IDMA buffer transfer complete. interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 6132 | pub const fn lckk(&self) -> super::vals::Lckk { | 8596 | pub const fn idmabtc(&self) -> bool { |
| 6133 | let val = (self.0 >> 16usize) & 0x01; | 8597 | let val = (self.0 >> 28usize) & 0x01; |
| 6134 | super::vals::Lckk(val as u8) | 8598 | val != 0 |
| 6135 | } | 8599 | } |
| 6136 | #[doc = "Port x lock bit y (y= 0..15)"] | 8600 | #[doc = "IDMA buffer transfer complete. interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] |
| 6137 | pub fn set_lckk(&mut self, val: super::vals::Lckk) { | 8601 | pub fn set_idmabtc(&mut self, val: bool) { |
| 6138 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | 8602 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize); |
| 6139 | } | 8603 | } |
| 6140 | } | 8604 | } |
| 6141 | impl Default for Lckr { | 8605 | impl Default for Star { |
| 6142 | fn default() -> Lckr { | 8606 | fn default() -> Star { |
| 6143 | Lckr(0) | 8607 | Star(0) |
| 6144 | } | 8608 | } |
| 6145 | } | 8609 | } |
| 6146 | #[doc = "GPIO port pull-up/pull-down register"] | 8610 | #[doc = "SDMMC IP identification register"] |
| 6147 | #[repr(transparent)] | 8611 | #[repr(transparent)] |
| 6148 | #[derive(Copy, Clone, Eq, PartialEq)] | 8612 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 6149 | pub struct Pupdr(pub u32); | 8613 | pub struct Id(pub u32); |
| 6150 | impl Pupdr { | 8614 | impl Id { |
| 6151 | #[doc = "Port x configuration bits (y = 0..15)"] | 8615 | #[doc = "SDMMC IP identification."] |
| 6152 | pub fn pupdr(&self, n: usize) -> super::vals::Pupdr { | 8616 | pub const fn ip_id(&self) -> u32 { |
| 6153 | assert!(n < 16usize); | 8617 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 6154 | let offs = 0usize + n * 2usize; | 8618 | val as u32 |
| 6155 | let val = (self.0 >> offs) & 0x03; | ||
| 6156 | super::vals::Pupdr(val as u8) | ||
| 6157 | } | 8619 | } |
| 6158 | #[doc = "Port x configuration bits (y = 0..15)"] | 8620 | #[doc = "SDMMC IP identification."] |
| 6159 | pub fn set_pupdr(&mut self, n: usize, val: super::vals::Pupdr) { | 8621 | pub fn set_ip_id(&mut self, val: u32) { |
| 6160 | assert!(n < 16usize); | 8622 | self.0 = |
| 6161 | let offs = 0usize + n * 2usize; | 8623 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); |
| 6162 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | ||
| 6163 | } | 8624 | } |
| 6164 | } | 8625 | } |
| 6165 | impl Default for Pupdr { | 8626 | impl Default for Id { |
| 6166 | fn default() -> Pupdr { | 8627 | fn default() -> Id { |
| 6167 | Pupdr(0) | 8628 | Id(0) |
| 6168 | } | 8629 | } |
| 6169 | } | 8630 | } |
| 6170 | #[doc = "GPIO port input data register"] | 8631 | #[doc = "The SDMMC_ARGR register contains a 32-bit command argument, which is sent to a card as part of a command message."] |
| 6171 | #[repr(transparent)] | 8632 | #[repr(transparent)] |
| 6172 | #[derive(Copy, Clone, Eq, PartialEq)] | 8633 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 6173 | pub struct Idr(pub u32); | 8634 | pub struct Argr(pub u32); |
| 6174 | impl Idr { | 8635 | impl Argr { |
| 6175 | #[doc = "Port input data (y = 0..15)"] | 8636 | #[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."] |
| 6176 | pub fn idr(&self, n: usize) -> super::vals::Idr { | 8637 | pub const fn cmdarg(&self) -> u32 { |
| 6177 | assert!(n < 16usize); | 8638 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 6178 | let offs = 0usize + n * 1usize; | 8639 | val as u32 |
| 6179 | let val = (self.0 >> offs) & 0x01; | ||
| 6180 | super::vals::Idr(val as u8) | ||
| 6181 | } | 8640 | } |
| 6182 | #[doc = "Port input data (y = 0..15)"] | 8641 | #[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."] |
| 6183 | pub fn set_idr(&mut self, n: usize, val: super::vals::Idr) { | 8642 | pub fn set_cmdarg(&mut self, val: u32) { |
| 6184 | assert!(n < 16usize); | 8643 | self.0 = |
| 6185 | let offs = 0usize + n * 1usize; | 8644 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); |
| 6186 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 6187 | } | 8645 | } |
| 6188 | } | 8646 | } |
| 6189 | impl Default for Idr { | 8647 | impl Default for Argr { |
| 6190 | fn default() -> Idr { | 8648 | fn default() -> Argr { |
| 6191 | Idr(0) | 8649 | Argr(0) |
| 6192 | } | 8650 | } |
| 6193 | } | 8651 | } |
| 6194 | } | 8652 | #[doc = "The SDMMC_DCTRL register control the data path state machine (DPSM)."] |
| 6195 | } | ||
| 6196 | pub mod syscfg_h7 { | ||
| 6197 | use crate::generic::*; | ||
| 6198 | #[doc = "System configuration controller"] | ||
| 6199 | #[derive(Copy, Clone)] | ||
| 6200 | pub struct Syscfg(pub *mut u8); | ||
| 6201 | unsafe impl Send for Syscfg {} | ||
| 6202 | unsafe impl Sync for Syscfg {} | ||
| 6203 | impl Syscfg { | ||
| 6204 | #[doc = "peripheral mode configuration register"] | ||
| 6205 | pub fn pmcr(self) -> Reg<regs::Pmcr, RW> { | ||
| 6206 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 6207 | } | ||
| 6208 | #[doc = "external interrupt configuration register 1"] | ||
| 6209 | pub fn exticr(self, n: usize) -> Reg<regs::Exticr, RW> { | ||
| 6210 | assert!(n < 4usize); | ||
| 6211 | unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) } | ||
| 6212 | } | ||
| 6213 | #[doc = "compensation cell control/status register"] | ||
| 6214 | pub fn cccsr(self) -> Reg<regs::Cccsr, RW> { | ||
| 6215 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | ||
| 6216 | } | ||
| 6217 | #[doc = "SYSCFG compensation cell value register"] | ||
| 6218 | pub fn ccvr(self) -> Reg<regs::Ccvr, R> { | ||
| 6219 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | ||
| 6220 | } | ||
| 6221 | #[doc = "SYSCFG compensation cell code register"] | ||
| 6222 | pub fn cccr(self) -> Reg<regs::Cccr, RW> { | ||
| 6223 | unsafe { Reg::from_ptr(self.0.add(40usize)) } | ||
| 6224 | } | ||
| 6225 | #[doc = "SYSCFG power control register"] | ||
| 6226 | pub fn pwrcr(self) -> Reg<regs::Pwrcr, RW> { | ||
| 6227 | unsafe { Reg::from_ptr(self.0.add(44usize)) } | ||
| 6228 | } | ||
| 6229 | #[doc = "SYSCFG package register"] | ||
| 6230 | pub fn pkgr(self) -> Reg<regs::Pkgr, R> { | ||
| 6231 | unsafe { Reg::from_ptr(self.0.add(292usize)) } | ||
| 6232 | } | ||
| 6233 | #[doc = "SYSCFG user register 0"] | ||
| 6234 | pub fn ur0(self) -> Reg<regs::Ur0, R> { | ||
| 6235 | unsafe { Reg::from_ptr(self.0.add(768usize)) } | ||
| 6236 | } | ||
| 6237 | #[doc = "SYSCFG user register 2"] | ||
| 6238 | pub fn ur2(self) -> Reg<regs::Ur2, RW> { | ||
| 6239 | unsafe { Reg::from_ptr(self.0.add(776usize)) } | ||
| 6240 | } | ||
| 6241 | #[doc = "SYSCFG user register 3"] | ||
| 6242 | pub fn ur3(self) -> Reg<regs::Ur3, RW> { | ||
| 6243 | unsafe { Reg::from_ptr(self.0.add(780usize)) } | ||
| 6244 | } | ||
| 6245 | #[doc = "SYSCFG user register 4"] | ||
| 6246 | pub fn ur4(self) -> Reg<regs::Ur4, R> { | ||
| 6247 | unsafe { Reg::from_ptr(self.0.add(784usize)) } | ||
| 6248 | } | ||
| 6249 | #[doc = "SYSCFG user register 5"] | ||
| 6250 | pub fn ur5(self) -> Reg<regs::Ur5, R> { | ||
| 6251 | unsafe { Reg::from_ptr(self.0.add(788usize)) } | ||
| 6252 | } | ||
| 6253 | #[doc = "SYSCFG user register 6"] | ||
| 6254 | pub fn ur6(self) -> Reg<regs::Ur6, R> { | ||
| 6255 | unsafe { Reg::from_ptr(self.0.add(792usize)) } | ||
| 6256 | } | ||
| 6257 | #[doc = "SYSCFG user register 7"] | ||
| 6258 | pub fn ur7(self) -> Reg<regs::Ur7, R> { | ||
| 6259 | unsafe { Reg::from_ptr(self.0.add(796usize)) } | ||
| 6260 | } | ||
| 6261 | #[doc = "SYSCFG user register 8"] | ||
| 6262 | pub fn ur8(self) -> Reg<regs::Ur8, R> { | ||
| 6263 | unsafe { Reg::from_ptr(self.0.add(800usize)) } | ||
| 6264 | } | ||
| 6265 | #[doc = "SYSCFG user register 9"] | ||
| 6266 | pub fn ur9(self) -> Reg<regs::Ur9, R> { | ||
| 6267 | unsafe { Reg::from_ptr(self.0.add(804usize)) } | ||
| 6268 | } | ||
| 6269 | #[doc = "SYSCFG user register 10"] | ||
| 6270 | pub fn ur10(self) -> Reg<regs::Ur10, R> { | ||
| 6271 | unsafe { Reg::from_ptr(self.0.add(808usize)) } | ||
| 6272 | } | ||
| 6273 | #[doc = "SYSCFG user register 11"] | ||
| 6274 | pub fn ur11(self) -> Reg<regs::Ur11, R> { | ||
| 6275 | unsafe { Reg::from_ptr(self.0.add(812usize)) } | ||
| 6276 | } | ||
| 6277 | #[doc = "SYSCFG user register 12"] | ||
| 6278 | pub fn ur12(self) -> Reg<regs::Ur12, R> { | ||
| 6279 | unsafe { Reg::from_ptr(self.0.add(816usize)) } | ||
| 6280 | } | ||
| 6281 | #[doc = "SYSCFG user register 13"] | ||
| 6282 | pub fn ur13(self) -> Reg<regs::Ur13, R> { | ||
| 6283 | unsafe { Reg::from_ptr(self.0.add(820usize)) } | ||
| 6284 | } | ||
| 6285 | #[doc = "SYSCFG user register 14"] | ||
| 6286 | pub fn ur14(self) -> Reg<regs::Ur14, RW> { | ||
| 6287 | unsafe { Reg::from_ptr(self.0.add(824usize)) } | ||
| 6288 | } | ||
| 6289 | #[doc = "SYSCFG user register 15"] | ||
| 6290 | pub fn ur15(self) -> Reg<regs::Ur15, R> { | ||
| 6291 | unsafe { Reg::from_ptr(self.0.add(828usize)) } | ||
| 6292 | } | ||
| 6293 | #[doc = "SYSCFG user register 16"] | ||
| 6294 | pub fn ur16(self) -> Reg<regs::Ur16, R> { | ||
| 6295 | unsafe { Reg::from_ptr(self.0.add(832usize)) } | ||
| 6296 | } | ||
| 6297 | #[doc = "SYSCFG user register 17"] | ||
| 6298 | pub fn ur17(self) -> Reg<regs::Ur17, R> { | ||
| 6299 | unsafe { Reg::from_ptr(self.0.add(836usize)) } | ||
| 6300 | } | ||
| 6301 | } | ||
| 6302 | pub mod regs { | ||
| 6303 | use crate::generic::*; | ||
| 6304 | #[doc = "SYSCFG user register 13"] | ||
| 6305 | #[repr(transparent)] | 8653 | #[repr(transparent)] |
| 6306 | #[derive(Copy, Clone, Eq, PartialEq)] | 8654 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 6307 | pub struct Ur13(pub u32); | 8655 | pub struct Dctrl(pub u32); |
| 6308 | impl Ur13 { | 8656 | impl Dctrl { |
| 6309 | #[doc = "Secured DTCM RAM Size"] | 8657 | #[doc = "Data transfer enable bit This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). This bit is cleared by Hardware when data transfer completes. This bit shall only be used to transfer data when no associated data transfer command is used, i.e. shall not be used with SD or eMMC cards."] |
| 6310 | pub const fn sdrs(&self) -> u8 { | 8658 | pub const fn dten(&self) -> bool { |
| 6311 | let val = (self.0 >> 0usize) & 0x03; | 8659 | let val = (self.0 >> 0usize) & 0x01; |
| 6312 | val as u8 | ||
| 6313 | } | ||
| 6314 | #[doc = "Secured DTCM RAM Size"] | ||
| 6315 | pub fn set_sdrs(&mut self, val: u8) { | ||
| 6316 | self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize); | ||
| 6317 | } | ||
| 6318 | #[doc = "D1 Standby reset"] | ||
| 6319 | pub const fn d1sbrst(&self) -> bool { | ||
| 6320 | let val = (self.0 >> 16usize) & 0x01; | ||
| 6321 | val != 0 | 8660 | val != 0 |
| 6322 | } | 8661 | } |
| 6323 | #[doc = "D1 Standby reset"] | 8662 | #[doc = "Data transfer enable bit This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). This bit is cleared by Hardware when data transfer completes. This bit shall only be used to transfer data when no associated data transfer command is used, i.e. shall not be used with SD or eMMC cards."] |
| 6324 | pub fn set_d1sbrst(&mut self, val: bool) { | 8663 | pub fn set_dten(&mut self, val: bool) { |
| 6325 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | 8664 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 6326 | } | ||
| 6327 | } | ||
| 6328 | impl Default for Ur13 { | ||
| 6329 | fn default() -> Ur13 { | ||
| 6330 | Ur13(0) | ||
| 6331 | } | ||
| 6332 | } | ||
| 6333 | #[doc = "SYSCFG user register 9"] | ||
| 6334 | #[repr(transparent)] | ||
| 6335 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6336 | pub struct Ur9(pub u32); | ||
| 6337 | impl Ur9 { | ||
| 6338 | #[doc = "Write protection for flash bank 2"] | ||
| 6339 | pub const fn wrpn_2(&self) -> u8 { | ||
| 6340 | let val = (self.0 >> 0usize) & 0xff; | ||
| 6341 | val as u8 | ||
| 6342 | } | ||
| 6343 | #[doc = "Write protection for flash bank 2"] | ||
| 6344 | pub fn set_wrpn_2(&mut self, val: u8) { | ||
| 6345 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | ||
| 6346 | } | ||
| 6347 | #[doc = "Protected area start address for bank 2"] | ||
| 6348 | pub const fn pa_beg_2(&self) -> u16 { | ||
| 6349 | let val = (self.0 >> 16usize) & 0x0fff; | ||
| 6350 | val as u16 | ||
| 6351 | } | ||
| 6352 | #[doc = "Protected area start address for bank 2"] | ||
| 6353 | pub fn set_pa_beg_2(&mut self, val: u16) { | ||
| 6354 | self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); | ||
| 6355 | } | ||
| 6356 | } | ||
| 6357 | impl Default for Ur9 { | ||
| 6358 | fn default() -> Ur9 { | ||
| 6359 | Ur9(0) | ||
| 6360 | } | ||
| 6361 | } | ||
| 6362 | #[doc = "SYSCFG compensation cell code register"] | ||
| 6363 | #[repr(transparent)] | ||
| 6364 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6365 | pub struct Cccr(pub u32); | ||
| 6366 | impl Cccr { | ||
| 6367 | #[doc = "NMOS compensation code"] | ||
| 6368 | pub const fn ncc(&self) -> u8 { | ||
| 6369 | let val = (self.0 >> 0usize) & 0x0f; | ||
| 6370 | val as u8 | ||
| 6371 | } | ||
| 6372 | #[doc = "NMOS compensation code"] | ||
| 6373 | pub fn set_ncc(&mut self, val: u8) { | ||
| 6374 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); | ||
| 6375 | } | ||
| 6376 | #[doc = "PMOS compensation code"] | ||
| 6377 | pub const fn pcc(&self) -> u8 { | ||
| 6378 | let val = (self.0 >> 4usize) & 0x0f; | ||
| 6379 | val as u8 | ||
| 6380 | } | 8665 | } |
| 6381 | #[doc = "PMOS compensation code"] | 8666 | #[doc = "Data transfer direction selection This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] |
| 6382 | pub fn set_pcc(&mut self, val: u8) { | 8667 | pub const fn dtdir(&self) -> bool { |
| 6383 | self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize); | 8668 | let val = (self.0 >> 1usize) & 0x01; |
| 8669 | val != 0 | ||
| 6384 | } | 8670 | } |
| 6385 | } | 8671 | #[doc = "Data transfer direction selection This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] |
| 6386 | impl Default for Cccr { | 8672 | pub fn set_dtdir(&mut self, val: bool) { |
| 6387 | fn default() -> Cccr { | 8673 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 6388 | Cccr(0) | ||
| 6389 | } | 8674 | } |
| 6390 | } | 8675 | #[doc = "Data transfer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] |
| 6391 | #[doc = "SYSCFG compensation cell value register"] | 8676 | pub const fn dtmode(&self) -> u8 { |
| 6392 | #[repr(transparent)] | 8677 | let val = (self.0 >> 2usize) & 0x03; |
| 6393 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6394 | pub struct Ccvr(pub u32); | ||
| 6395 | impl Ccvr { | ||
| 6396 | #[doc = "NMOS compensation value"] | ||
| 6397 | pub const fn ncv(&self) -> u8 { | ||
| 6398 | let val = (self.0 >> 0usize) & 0x0f; | ||
| 6399 | val as u8 | 8678 | val as u8 |
| 6400 | } | 8679 | } |
| 6401 | #[doc = "NMOS compensation value"] | 8680 | #[doc = "Data transfer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] |
| 6402 | pub fn set_ncv(&mut self, val: u8) { | 8681 | pub fn set_dtmode(&mut self, val: u8) { |
| 6403 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); | 8682 | self.0 = (self.0 & !(0x03 << 2usize)) | (((val as u32) & 0x03) << 2usize); |
| 6404 | } | 8683 | } |
| 6405 | #[doc = "PMOS compensation value"] | 8684 | #[doc = "Data block size This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). Define the data block length when the block data transfer mode is selected: When DATALENGTH is not a multiple of DBLOCKSIZE, the transfered data is truncated at a multiple of DBLOCKSIZE. (Any remain data will not be transfered.) When DDR = 1, DBLOCKSIZE = 0000 shall not be used. (No data will be transfered)"] |
| 6406 | pub const fn pcv(&self) -> u8 { | 8685 | pub const fn dblocksize(&self) -> u8 { |
| 6407 | let val = (self.0 >> 4usize) & 0x0f; | 8686 | let val = (self.0 >> 4usize) & 0x0f; |
| 6408 | val as u8 | 8687 | val as u8 |
| 6409 | } | 8688 | } |
| 6410 | #[doc = "PMOS compensation value"] | 8689 | #[doc = "Data block size This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). Define the data block length when the block data transfer mode is selected: When DATALENGTH is not a multiple of DBLOCKSIZE, the transfered data is truncated at a multiple of DBLOCKSIZE. (Any remain data will not be transfered.) When DDR = 1, DBLOCKSIZE = 0000 shall not be used. (No data will be transfered)"] |
| 6411 | pub fn set_pcv(&mut self, val: u8) { | 8690 | pub fn set_dblocksize(&mut self, val: u8) { |
| 6412 | self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize); | 8691 | self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize); |
| 6413 | } | 8692 | } |
| 6414 | } | 8693 | #[doc = "Read wait start. If this bit is set, read wait operation starts."] |
| 6415 | impl Default for Ccvr { | 8694 | pub const fn rwstart(&self) -> bool { |
| 6416 | fn default() -> Ccvr { | 8695 | let val = (self.0 >> 8usize) & 0x01; |
| 6417 | Ccvr(0) | ||
| 6418 | } | ||
| 6419 | } | ||
| 6420 | #[doc = "SYSCFG user register 10"] | ||
| 6421 | #[repr(transparent)] | ||
| 6422 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6423 | pub struct Ur10(pub u32); | ||
| 6424 | impl Ur10 { | ||
| 6425 | #[doc = "Protected area end address for bank 2"] | ||
| 6426 | pub const fn pa_end_2(&self) -> u16 { | ||
| 6427 | let val = (self.0 >> 0usize) & 0x0fff; | ||
| 6428 | val as u16 | ||
| 6429 | } | ||
| 6430 | #[doc = "Protected area end address for bank 2"] | ||
| 6431 | pub fn set_pa_end_2(&mut self, val: u16) { | ||
| 6432 | self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); | ||
| 6433 | } | ||
| 6434 | #[doc = "Secured area start address for bank 2"] | ||
| 6435 | pub const fn sa_beg_2(&self) -> u16 { | ||
| 6436 | let val = (self.0 >> 16usize) & 0x0fff; | ||
| 6437 | val as u16 | ||
| 6438 | } | ||
| 6439 | #[doc = "Secured area start address for bank 2"] | ||
| 6440 | pub fn set_sa_beg_2(&mut self, val: u16) { | ||
| 6441 | self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); | ||
| 6442 | } | ||
| 6443 | } | ||
| 6444 | impl Default for Ur10 { | ||
| 6445 | fn default() -> Ur10 { | ||
| 6446 | Ur10(0) | ||
| 6447 | } | ||
| 6448 | } | ||
| 6449 | #[doc = "SYSCFG user register 12"] | ||
| 6450 | #[repr(transparent)] | ||
| 6451 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6452 | pub struct Ur12(pub u32); | ||
| 6453 | impl Ur12 { | ||
| 6454 | #[doc = "Secure mode"] | ||
| 6455 | pub const fn secure(&self) -> bool { | ||
| 6456 | let val = (self.0 >> 16usize) & 0x01; | ||
| 6457 | val != 0 | 8696 | val != 0 |
| 6458 | } | 8697 | } |
| 6459 | #[doc = "Secure mode"] | 8698 | #[doc = "Read wait start. If this bit is set, read wait operation starts."] |
| 6460 | pub fn set_secure(&mut self, val: bool) { | 8699 | pub fn set_rwstart(&mut self, val: bool) { |
| 6461 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | 8700 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 6462 | } | ||
| 6463 | } | ||
| 6464 | impl Default for Ur12 { | ||
| 6465 | fn default() -> Ur12 { | ||
| 6466 | Ur12(0) | ||
| 6467 | } | 8701 | } |
| 6468 | } | 8702 | #[doc = "Read wait stop This bit is written by firmware and auto cleared by hardware when the DPSM moves from the READ_WAIT state to the WAIT_R or IDLE state."] |
| 6469 | #[doc = "SYSCFG user register 17"] | 8703 | pub const fn rwstop(&self) -> bool { |
| 6470 | #[repr(transparent)] | 8704 | let val = (self.0 >> 9usize) & 0x01; |
| 6471 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6472 | pub struct Ur17(pub u32); | ||
| 6473 | impl Ur17 { | ||
| 6474 | #[doc = "I/O high speed / low voltage"] | ||
| 6475 | pub const fn io_hslv(&self) -> bool { | ||
| 6476 | let val = (self.0 >> 0usize) & 0x01; | ||
| 6477 | val != 0 | 8705 | val != 0 |
| 6478 | } | 8706 | } |
| 6479 | #[doc = "I/O high speed / low voltage"] | 8707 | #[doc = "Read wait stop This bit is written by firmware and auto cleared by hardware when the DPSM moves from the READ_WAIT state to the WAIT_R or IDLE state."] |
| 6480 | pub fn set_io_hslv(&mut self, val: bool) { | 8708 | pub fn set_rwstop(&mut self, val: bool) { |
| 6481 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 8709 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); |
| 6482 | } | ||
| 6483 | } | ||
| 6484 | impl Default for Ur17 { | ||
| 6485 | fn default() -> Ur17 { | ||
| 6486 | Ur17(0) | ||
| 6487 | } | ||
| 6488 | } | ||
| 6489 | #[doc = "SYSCFG power control register"] | ||
| 6490 | #[repr(transparent)] | ||
| 6491 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6492 | pub struct Pwrcr(pub u32); | ||
| 6493 | impl Pwrcr { | ||
| 6494 | #[doc = "Overdrive enable"] | ||
| 6495 | pub const fn oden(&self) -> u8 { | ||
| 6496 | let val = (self.0 >> 0usize) & 0x0f; | ||
| 6497 | val as u8 | ||
| 6498 | } | ||
| 6499 | #[doc = "Overdrive enable"] | ||
| 6500 | pub fn set_oden(&mut self, val: u8) { | ||
| 6501 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); | ||
| 6502 | } | ||
| 6503 | } | ||
| 6504 | impl Default for Pwrcr { | ||
| 6505 | fn default() -> Pwrcr { | ||
| 6506 | Pwrcr(0) | ||
| 6507 | } | 8710 | } |
| 6508 | } | 8711 | #[doc = "Read wait mode. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] |
| 6509 | #[doc = "SYSCFG user register 5"] | 8712 | pub const fn rwmod(&self) -> bool { |
| 6510 | #[repr(transparent)] | 8713 | let val = (self.0 >> 10usize) & 0x01; |
| 6511 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6512 | pub struct Ur5(pub u32); | ||
| 6513 | impl Ur5 { | ||
| 6514 | #[doc = "Mass erase secured area disabled for bank 1"] | ||
| 6515 | pub const fn mesad_1(&self) -> bool { | ||
| 6516 | let val = (self.0 >> 0usize) & 0x01; | ||
| 6517 | val != 0 | 8714 | val != 0 |
| 6518 | } | 8715 | } |
| 6519 | #[doc = "Mass erase secured area disabled for bank 1"] | 8716 | #[doc = "Read wait mode. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] |
| 6520 | pub fn set_mesad_1(&mut self, val: bool) { | 8717 | pub fn set_rwmod(&mut self, val: bool) { |
| 6521 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 8718 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); |
| 6522 | } | ||
| 6523 | #[doc = "Write protection for flash bank 1"] | ||
| 6524 | pub const fn wrpn_1(&self) -> u8 { | ||
| 6525 | let val = (self.0 >> 16usize) & 0xff; | ||
| 6526 | val as u8 | ||
| 6527 | } | ||
| 6528 | #[doc = "Write protection for flash bank 1"] | ||
| 6529 | pub fn set_wrpn_1(&mut self, val: u8) { | ||
| 6530 | self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize); | ||
| 6531 | } | ||
| 6532 | } | ||
| 6533 | impl Default for Ur5 { | ||
| 6534 | fn default() -> Ur5 { | ||
| 6535 | Ur5(0) | ||
| 6536 | } | ||
| 6537 | } | ||
| 6538 | #[doc = "external interrupt configuration register 2"] | ||
| 6539 | #[repr(transparent)] | ||
| 6540 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6541 | pub struct Exticr(pub u32); | ||
| 6542 | impl Exticr { | ||
| 6543 | #[doc = "EXTI x configuration (x = 4 to 7)"] | ||
| 6544 | pub fn exti(&self, n: usize) -> u8 { | ||
| 6545 | assert!(n < 4usize); | ||
| 6546 | let offs = 0usize + n * 4usize; | ||
| 6547 | let val = (self.0 >> offs) & 0x0f; | ||
| 6548 | val as u8 | ||
| 6549 | } | ||
| 6550 | #[doc = "EXTI x configuration (x = 4 to 7)"] | ||
| 6551 | pub fn set_exti(&mut self, n: usize, val: u8) { | ||
| 6552 | assert!(n < 4usize); | ||
| 6553 | let offs = 0usize + n * 4usize; | ||
| 6554 | self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs); | ||
| 6555 | } | ||
| 6556 | } | ||
| 6557 | impl Default for Exticr { | ||
| 6558 | fn default() -> Exticr { | ||
| 6559 | Exticr(0) | ||
| 6560 | } | 8719 | } |
| 6561 | } | 8720 | #[doc = "SD I/O interrupt enable functions This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). If this bit is set, the DPSM enables the SD I/O card specific interrupt operation."] |
| 6562 | #[doc = "SYSCFG user register 4"] | 8721 | pub const fn sdioen(&self) -> bool { |
| 6563 | #[repr(transparent)] | 8722 | let val = (self.0 >> 11usize) & 0x01; |
| 6564 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6565 | pub struct Ur4(pub u32); | ||
| 6566 | impl Ur4 { | ||
| 6567 | #[doc = "Mass Erase Protected Area Disabled for bank 1"] | ||
| 6568 | pub const fn mepad_1(&self) -> bool { | ||
| 6569 | let val = (self.0 >> 16usize) & 0x01; | ||
| 6570 | val != 0 | 8723 | val != 0 |
| 6571 | } | 8724 | } |
| 6572 | #[doc = "Mass Erase Protected Area Disabled for bank 1"] | 8725 | #[doc = "SD I/O interrupt enable functions This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). If this bit is set, the DPSM enables the SD I/O card specific interrupt operation."] |
| 6573 | pub fn set_mepad_1(&mut self, val: bool) { | 8726 | pub fn set_sdioen(&mut self, val: bool) { |
| 6574 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | 8727 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); |
| 6575 | } | ||
| 6576 | } | ||
| 6577 | impl Default for Ur4 { | ||
| 6578 | fn default() -> Ur4 { | ||
| 6579 | Ur4(0) | ||
| 6580 | } | ||
| 6581 | } | ||
| 6582 | #[doc = "SYSCFG user register 7"] | ||
| 6583 | #[repr(transparent)] | ||
| 6584 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6585 | pub struct Ur7(pub u32); | ||
| 6586 | impl Ur7 { | ||
| 6587 | #[doc = "Secured area start address for bank 1"] | ||
| 6588 | pub const fn sa_beg_1(&self) -> u16 { | ||
| 6589 | let val = (self.0 >> 0usize) & 0x0fff; | ||
| 6590 | val as u16 | ||
| 6591 | } | ||
| 6592 | #[doc = "Secured area start address for bank 1"] | ||
| 6593 | pub fn set_sa_beg_1(&mut self, val: u16) { | ||
| 6594 | self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); | ||
| 6595 | } | ||
| 6596 | #[doc = "Secured area end address for bank 1"] | ||
| 6597 | pub const fn sa_end_1(&self) -> u16 { | ||
| 6598 | let val = (self.0 >> 16usize) & 0x0fff; | ||
| 6599 | val as u16 | ||
| 6600 | } | 8728 | } |
| 6601 | #[doc = "Secured area end address for bank 1"] | 8729 | #[doc = "Enable the reception of the boot acknowledgment. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] |
| 6602 | pub fn set_sa_end_1(&mut self, val: u16) { | 8730 | pub const fn bootacken(&self) -> bool { |
| 6603 | self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); | 8731 | let val = (self.0 >> 12usize) & 0x01; |
| 8732 | val != 0 | ||
| 6604 | } | 8733 | } |
| 6605 | } | 8734 | #[doc = "Enable the reception of the boot acknowledgment. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] |
| 6606 | impl Default for Ur7 { | 8735 | pub fn set_bootacken(&mut self, val: bool) { |
| 6607 | fn default() -> Ur7 { | 8736 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); |
| 6608 | Ur7(0) | ||
| 6609 | } | 8737 | } |
| 6610 | } | 8738 | #[doc = "FIFO reset, will flush any remaining data. This bit can only be written by firmware when IDMAEN= 0 and DPSM is active (DPSMACT = 1). This bit will only take effect when a transfer error or transfer hold occurs."] |
| 6611 | #[doc = "SYSCFG user register 14"] | 8739 | pub const fn fiforst(&self) -> bool { |
| 6612 | #[repr(transparent)] | 8740 | let val = (self.0 >> 13usize) & 0x01; |
| 6613 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6614 | pub struct Ur14(pub u32); | ||
| 6615 | impl Ur14 { | ||
| 6616 | #[doc = "D1 Stop Reset"] | ||
| 6617 | pub const fn d1stprst(&self) -> bool { | ||
| 6618 | let val = (self.0 >> 0usize) & 0x01; | ||
| 6619 | val != 0 | 8741 | val != 0 |
| 6620 | } | 8742 | } |
| 6621 | #[doc = "D1 Stop Reset"] | 8743 | #[doc = "FIFO reset, will flush any remaining data. This bit can only be written by firmware when IDMAEN= 0 and DPSM is active (DPSMACT = 1). This bit will only take effect when a transfer error or transfer hold occurs."] |
| 6622 | pub fn set_d1stprst(&mut self, val: bool) { | 8744 | pub fn set_fiforst(&mut self, val: bool) { |
| 6623 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 8745 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); |
| 6624 | } | 8746 | } |
| 6625 | } | 8747 | } |
| 6626 | impl Default for Ur14 { | 8748 | impl Default for Dctrl { |
| 6627 | fn default() -> Ur14 { | 8749 | fn default() -> Dctrl { |
| 6628 | Ur14(0) | 8750 | Dctrl(0) |
| 6629 | } | 8751 | } |
| 6630 | } | 8752 | } |
| 6631 | #[doc = "peripheral mode configuration register"] | 8753 | #[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."] |
| 6632 | #[repr(transparent)] | 8754 | #[repr(transparent)] |
| 6633 | #[derive(Copy, Clone, Eq, PartialEq)] | 8755 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 6634 | pub struct Pmcr(pub u32); | 8756 | pub struct Icr(pub u32); |
| 6635 | impl Pmcr { | 8757 | impl Icr { |
| 6636 | #[doc = "I2C1 Fm+"] | 8758 | #[doc = "CCRCFAIL flag clear bit Set by software to clear the CCRCFAIL flag."] |
| 6637 | pub const fn i2c1fmp(&self) -> bool { | 8759 | pub const fn ccrcfailc(&self) -> bool { |
| 6638 | let val = (self.0 >> 0usize) & 0x01; | 8760 | let val = (self.0 >> 0usize) & 0x01; |
| 6639 | val != 0 | 8761 | val != 0 |
| 6640 | } | 8762 | } |
| 6641 | #[doc = "I2C1 Fm+"] | 8763 | #[doc = "CCRCFAIL flag clear bit Set by software to clear the CCRCFAIL flag."] |
| 6642 | pub fn set_i2c1fmp(&mut self, val: bool) { | 8764 | pub fn set_ccrcfailc(&mut self, val: bool) { |
| 6643 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 8765 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 6644 | } | 8766 | } |
| 6645 | #[doc = "I2C2 Fm+"] | 8767 | #[doc = "DCRCFAIL flag clear bit Set by software to clear the DCRCFAIL flag."] |
| 6646 | pub const fn i2c2fmp(&self) -> bool { | 8768 | pub const fn dcrcfailc(&self) -> bool { |
| 6647 | let val = (self.0 >> 1usize) & 0x01; | 8769 | let val = (self.0 >> 1usize) & 0x01; |
| 6648 | val != 0 | 8770 | val != 0 |
| 6649 | } | 8771 | } |
| 6650 | #[doc = "I2C2 Fm+"] | 8772 | #[doc = "DCRCFAIL flag clear bit Set by software to clear the DCRCFAIL flag."] |
| 6651 | pub fn set_i2c2fmp(&mut self, val: bool) { | 8773 | pub fn set_dcrcfailc(&mut self, val: bool) { |
| 6652 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 8774 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 6653 | } | 8775 | } |
| 6654 | #[doc = "I2C3 Fm+"] | 8776 | #[doc = "CTIMEOUT flag clear bit Set by software to clear the CTIMEOUT flag."] |
| 6655 | pub const fn i2c3fmp(&self) -> bool { | 8777 | pub const fn ctimeoutc(&self) -> bool { |
| 6656 | let val = (self.0 >> 2usize) & 0x01; | 8778 | let val = (self.0 >> 2usize) & 0x01; |
| 6657 | val != 0 | 8779 | val != 0 |
| 6658 | } | 8780 | } |
| 6659 | #[doc = "I2C3 Fm+"] | 8781 | #[doc = "CTIMEOUT flag clear bit Set by software to clear the CTIMEOUT flag."] |
| 6660 | pub fn set_i2c3fmp(&mut self, val: bool) { | 8782 | pub fn set_ctimeoutc(&mut self, val: bool) { |
| 6661 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 8783 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 6662 | } | 8784 | } |
| 6663 | #[doc = "I2C4 Fm+"] | 8785 | #[doc = "DTIMEOUT flag clear bit Set by software to clear the DTIMEOUT flag."] |
| 6664 | pub const fn i2c4fmp(&self) -> bool { | 8786 | pub const fn dtimeoutc(&self) -> bool { |
| 6665 | let val = (self.0 >> 3usize) & 0x01; | 8787 | let val = (self.0 >> 3usize) & 0x01; |
| 6666 | val != 0 | 8788 | val != 0 |
| 6667 | } | 8789 | } |
| 6668 | #[doc = "I2C4 Fm+"] | 8790 | #[doc = "DTIMEOUT flag clear bit Set by software to clear the DTIMEOUT flag."] |
| 6669 | pub fn set_i2c4fmp(&mut self, val: bool) { | 8791 | pub fn set_dtimeoutc(&mut self, val: bool) { |
| 6670 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 8792 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); |
| 6671 | } | 8793 | } |
| 6672 | #[doc = "PB(6) Fm+"] | 8794 | #[doc = "TXUNDERR flag clear bit Set by software to clear TXUNDERR flag."] |
| 6673 | pub const fn pb6fmp(&self) -> bool { | 8795 | pub const fn txunderrc(&self) -> bool { |
| 6674 | let val = (self.0 >> 4usize) & 0x01; | 8796 | let val = (self.0 >> 4usize) & 0x01; |
| 6675 | val != 0 | 8797 | val != 0 |
| 6676 | } | 8798 | } |
| 6677 | #[doc = "PB(6) Fm+"] | 8799 | #[doc = "TXUNDERR flag clear bit Set by software to clear TXUNDERR flag."] |
| 6678 | pub fn set_pb6fmp(&mut self, val: bool) { | 8800 | pub fn set_txunderrc(&mut self, val: bool) { |
| 6679 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 8801 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 6680 | } | 8802 | } |
| 6681 | #[doc = "PB(7) Fast Mode Plus"] | 8803 | #[doc = "RXOVERR flag clear bit Set by software to clear the RXOVERR flag."] |
| 6682 | pub const fn pb7fmp(&self) -> bool { | 8804 | pub const fn rxoverrc(&self) -> bool { |
| 6683 | let val = (self.0 >> 5usize) & 0x01; | 8805 | let val = (self.0 >> 5usize) & 0x01; |
| 6684 | val != 0 | 8806 | val != 0 |
| 6685 | } | 8807 | } |
| 6686 | #[doc = "PB(7) Fast Mode Plus"] | 8808 | #[doc = "RXOVERR flag clear bit Set by software to clear the RXOVERR flag."] |
| 6687 | pub fn set_pb7fmp(&mut self, val: bool) { | 8809 | pub fn set_rxoverrc(&mut self, val: bool) { |
| 6688 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 8810 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 6689 | } | 8811 | } |
| 6690 | #[doc = "PB(8) Fast Mode Plus"] | 8812 | #[doc = "CMDREND flag clear bit Set by software to clear the CMDREND flag."] |
| 6691 | pub const fn pb8fmp(&self) -> bool { | 8813 | pub const fn cmdrendc(&self) -> bool { |
| 6692 | let val = (self.0 >> 6usize) & 0x01; | 8814 | let val = (self.0 >> 6usize) & 0x01; |
| 6693 | val != 0 | 8815 | val != 0 |
| 6694 | } | 8816 | } |
| 6695 | #[doc = "PB(8) Fast Mode Plus"] | 8817 | #[doc = "CMDREND flag clear bit Set by software to clear the CMDREND flag."] |
| 6696 | pub fn set_pb8fmp(&mut self, val: bool) { | 8818 | pub fn set_cmdrendc(&mut self, val: bool) { |
| 6697 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 8819 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 6698 | } | 8820 | } |
| 6699 | #[doc = "PB(9) Fm+"] | 8821 | #[doc = "CMDSENT flag clear bit Set by software to clear the CMDSENT flag."] |
| 6700 | pub const fn pb9fmp(&self) -> bool { | 8822 | pub const fn cmdsentc(&self) -> bool { |
| 6701 | let val = (self.0 >> 7usize) & 0x01; | 8823 | let val = (self.0 >> 7usize) & 0x01; |
| 6702 | val != 0 | 8824 | val != 0 |
| 6703 | } | 8825 | } |
| 6704 | #[doc = "PB(9) Fm+"] | 8826 | #[doc = "CMDSENT flag clear bit Set by software to clear the CMDSENT flag."] |
| 6705 | pub fn set_pb9fmp(&mut self, val: bool) { | 8827 | pub fn set_cmdsentc(&mut self, val: bool) { |
| 6706 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 8828 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 6707 | } | 8829 | } |
| 6708 | #[doc = "Booster Enable"] | 8830 | #[doc = "DATAEND flag clear bit Set by software to clear the DATAEND flag."] |
| 6709 | pub const fn booste(&self) -> bool { | 8831 | pub const fn dataendc(&self) -> bool { |
| 6710 | let val = (self.0 >> 8usize) & 0x01; | 8832 | let val = (self.0 >> 8usize) & 0x01; |
| 6711 | val != 0 | 8833 | val != 0 |
| 6712 | } | 8834 | } |
| 6713 | #[doc = "Booster Enable"] | 8835 | #[doc = "DATAEND flag clear bit Set by software to clear the DATAEND flag."] |
| 6714 | pub fn set_booste(&mut self, val: bool) { | 8836 | pub fn set_dataendc(&mut self, val: bool) { |
| 6715 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 8837 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 6716 | } | 8838 | } |
| 6717 | #[doc = "Analog switch supply voltage selection"] | 8839 | #[doc = "DHOLD flag clear bit Set by software to clear the DHOLD flag."] |
| 6718 | pub const fn boostvddsel(&self) -> bool { | 8840 | pub const fn dholdc(&self) -> bool { |
| 6719 | let val = (self.0 >> 9usize) & 0x01; | 8841 | let val = (self.0 >> 9usize) & 0x01; |
| 6720 | val != 0 | 8842 | val != 0 |
| 6721 | } | 8843 | } |
| 6722 | #[doc = "Analog switch supply voltage selection"] | 8844 | #[doc = "DHOLD flag clear bit Set by software to clear the DHOLD flag."] |
| 6723 | pub fn set_boostvddsel(&mut self, val: bool) { | 8845 | pub fn set_dholdc(&mut self, val: bool) { |
| 6724 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | 8846 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); |
| 6725 | } | 8847 | } |
| 6726 | #[doc = "Ethernet PHY Interface Selection"] | 8848 | #[doc = "DBCKEND flag clear bit Set by software to clear the DBCKEND flag."] |
| 6727 | pub const fn epis(&self) -> u8 { | 8849 | pub const fn dbckendc(&self) -> bool { |
| 6728 | let val = (self.0 >> 21usize) & 0x07; | 8850 | let val = (self.0 >> 10usize) & 0x01; |
| 6729 | val as u8 | 8851 | val != 0 |
| 6730 | } | 8852 | } |
| 6731 | #[doc = "Ethernet PHY Interface Selection"] | 8853 | #[doc = "DBCKEND flag clear bit Set by software to clear the DBCKEND flag."] |
| 6732 | pub fn set_epis(&mut self, val: u8) { | 8854 | pub fn set_dbckendc(&mut self, val: bool) { |
| 6733 | self.0 = (self.0 & !(0x07 << 21usize)) | (((val as u32) & 0x07) << 21usize); | 8855 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); |
| 6734 | } | 8856 | } |
| 6735 | #[doc = "PA0 Switch Open"] | 8857 | #[doc = "DABORT flag clear bit Set by software to clear the DABORT flag."] |
| 6736 | pub const fn pa0so(&self) -> bool { | 8858 | pub const fn dabortc(&self) -> bool { |
| 8859 | let val = (self.0 >> 11usize) & 0x01; | ||
| 8860 | val != 0 | ||
| 8861 | } | ||
| 8862 | #[doc = "DABORT flag clear bit Set by software to clear the DABORT flag."] | ||
| 8863 | pub fn set_dabortc(&mut self, val: bool) { | ||
| 8864 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); | ||
| 8865 | } | ||
| 8866 | #[doc = "BUSYD0END flag clear bit Set by software to clear the BUSYD0END flag."] | ||
| 8867 | pub const fn busyd0endc(&self) -> bool { | ||
| 8868 | let val = (self.0 >> 21usize) & 0x01; | ||
| 8869 | val != 0 | ||
| 8870 | } | ||
| 8871 | #[doc = "BUSYD0END flag clear bit Set by software to clear the BUSYD0END flag."] | ||
| 8872 | pub fn set_busyd0endc(&mut self, val: bool) { | ||
| 8873 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); | ||
| 8874 | } | ||
| 8875 | #[doc = "SDIOIT flag clear bit Set by software to clear the SDIOIT flag."] | ||
| 8876 | pub const fn sdioitc(&self) -> bool { | ||
| 8877 | let val = (self.0 >> 22usize) & 0x01; | ||
| 8878 | val != 0 | ||
| 8879 | } | ||
| 8880 | #[doc = "SDIOIT flag clear bit Set by software to clear the SDIOIT flag."] | ||
| 8881 | pub fn set_sdioitc(&mut self, val: bool) { | ||
| 8882 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); | ||
| 8883 | } | ||
| 8884 | #[doc = "ACKFAIL flag clear bit Set by software to clear the ACKFAIL flag."] | ||
| 8885 | pub const fn ackfailc(&self) -> bool { | ||
| 8886 | let val = (self.0 >> 23usize) & 0x01; | ||
| 8887 | val != 0 | ||
| 8888 | } | ||
| 8889 | #[doc = "ACKFAIL flag clear bit Set by software to clear the ACKFAIL flag."] | ||
| 8890 | pub fn set_ackfailc(&mut self, val: bool) { | ||
| 8891 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); | ||
| 8892 | } | ||
| 8893 | #[doc = "ACKTIMEOUT flag clear bit Set by software to clear the ACKTIMEOUT flag."] | ||
| 8894 | pub const fn acktimeoutc(&self) -> bool { | ||
| 6737 | let val = (self.0 >> 24usize) & 0x01; | 8895 | let val = (self.0 >> 24usize) & 0x01; |
| 6738 | val != 0 | 8896 | val != 0 |
| 6739 | } | 8897 | } |
| 6740 | #[doc = "PA0 Switch Open"] | 8898 | #[doc = "ACKTIMEOUT flag clear bit Set by software to clear the ACKTIMEOUT flag."] |
| 6741 | pub fn set_pa0so(&mut self, val: bool) { | 8899 | pub fn set_acktimeoutc(&mut self, val: bool) { |
| 6742 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize); | 8900 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize); |
| 6743 | } | 8901 | } |
| 6744 | #[doc = "PA1 Switch Open"] | 8902 | #[doc = "VSWEND flag clear bit Set by software to clear the VSWEND flag."] |
| 6745 | pub const fn pa1so(&self) -> bool { | 8903 | pub const fn vswendc(&self) -> bool { |
| 6746 | let val = (self.0 >> 25usize) & 0x01; | 8904 | let val = (self.0 >> 25usize) & 0x01; |
| 6747 | val != 0 | 8905 | val != 0 |
| 6748 | } | 8906 | } |
| 6749 | #[doc = "PA1 Switch Open"] | 8907 | #[doc = "VSWEND flag clear bit Set by software to clear the VSWEND flag."] |
| 6750 | pub fn set_pa1so(&mut self, val: bool) { | 8908 | pub fn set_vswendc(&mut self, val: bool) { |
| 6751 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize); | 8909 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize); |
| 6752 | } | 8910 | } |
| 6753 | #[doc = "PC2 Switch Open"] | 8911 | #[doc = "CKSTOP flag clear bit Set by software to clear the CKSTOP flag."] |
| 6754 | pub const fn pc2so(&self) -> bool { | 8912 | pub const fn ckstopc(&self) -> bool { |
| 6755 | let val = (self.0 >> 26usize) & 0x01; | 8913 | let val = (self.0 >> 26usize) & 0x01; |
| 6756 | val != 0 | 8914 | val != 0 |
| 6757 | } | 8915 | } |
| 6758 | #[doc = "PC2 Switch Open"] | 8916 | #[doc = "CKSTOP flag clear bit Set by software to clear the CKSTOP flag."] |
| 6759 | pub fn set_pc2so(&mut self, val: bool) { | 8917 | pub fn set_ckstopc(&mut self, val: bool) { |
| 6760 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); | 8918 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); |
| 6761 | } | 8919 | } |
| 6762 | #[doc = "PC3 Switch Open"] | 8920 | #[doc = "IDMA transfer error clear bit Set by software to clear the IDMATE flag."] |
| 6763 | pub const fn pc3so(&self) -> bool { | 8921 | pub const fn idmatec(&self) -> bool { |
| 6764 | let val = (self.0 >> 27usize) & 0x01; | 8922 | let val = (self.0 >> 27usize) & 0x01; |
| 6765 | val != 0 | 8923 | val != 0 |
| 6766 | } | 8924 | } |
| 6767 | #[doc = "PC3 Switch Open"] | 8925 | #[doc = "IDMA transfer error clear bit Set by software to clear the IDMATE flag."] |
| 6768 | pub fn set_pc3so(&mut self, val: bool) { | 8926 | pub fn set_idmatec(&mut self, val: bool) { |
| 6769 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize); | 8927 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize); |
| 6770 | } | 8928 | } |
| 8929 | #[doc = "IDMA buffer transfer complete clear bit Set by software to clear the IDMABTC flag."] | ||
| 8930 | pub const fn idmabtcc(&self) -> bool { | ||
| 8931 | let val = (self.0 >> 28usize) & 0x01; | ||
| 8932 | val != 0 | ||
| 8933 | } | ||
| 8934 | #[doc = "IDMA buffer transfer complete clear bit Set by software to clear the IDMABTC flag."] | ||
| 8935 | pub fn set_idmabtcc(&mut self, val: bool) { | ||
| 8936 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize); | ||
| 8937 | } | ||
| 6771 | } | 8938 | } |
| 6772 | impl Default for Pmcr { | 8939 | impl Default for Icr { |
| 6773 | fn default() -> Pmcr { | 8940 | fn default() -> Icr { |
| 6774 | Pmcr(0) | 8941 | Icr(0) |
| 6775 | } | 8942 | } |
| 6776 | } | 8943 | } |
| 6777 | #[doc = "SYSCFG user register 2"] | 8944 | #[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."] |
| 6778 | #[repr(transparent)] | 8945 | #[repr(transparent)] |
| 6779 | #[derive(Copy, Clone, Eq, PartialEq)] | 8946 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 6780 | pub struct Ur2(pub u32); | 8947 | pub struct Dlenr(pub u32); |
| 6781 | impl Ur2 { | 8948 | impl Dlenr { |
| 6782 | #[doc = "BOR_LVL Brownout Reset Threshold Level"] | 8949 | #[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."] |
| 6783 | pub const fn borh(&self) -> u8 { | 8950 | pub const fn datalength(&self) -> u32 { |
| 6784 | let val = (self.0 >> 0usize) & 0x03; | 8951 | let val = (self.0 >> 0usize) & 0x01ff_ffff; |
| 6785 | val as u8 | 8952 | val as u32 |
| 6786 | } | ||
| 6787 | #[doc = "BOR_LVL Brownout Reset Threshold Level"] | ||
| 6788 | pub fn set_borh(&mut self, val: u8) { | ||
| 6789 | self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize); | ||
| 6790 | } | ||
| 6791 | #[doc = "Boot Address 0"] | ||
| 6792 | pub const fn boot_add0(&self) -> u16 { | ||
| 6793 | let val = (self.0 >> 16usize) & 0xffff; | ||
| 6794 | val as u16 | ||
| 6795 | } | 8953 | } |
| 6796 | #[doc = "Boot Address 0"] | 8954 | #[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."] |
| 6797 | pub fn set_boot_add0(&mut self, val: u16) { | 8955 | pub fn set_datalength(&mut self, val: u32) { |
| 6798 | self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize); | 8956 | self.0 = |
| 8957 | (self.0 & !(0x01ff_ffff << 0usize)) | (((val as u32) & 0x01ff_ffff) << 0usize); | ||
| 6799 | } | 8958 | } |
| 6800 | } | 8959 | } |
| 6801 | impl Default for Ur2 { | 8960 | impl Default for Dlenr { |
| 6802 | fn default() -> Ur2 { | 8961 | fn default() -> Dlenr { |
| 6803 | Ur2(0) | 8962 | Dlenr(0) |
| 6804 | } | 8963 | } |
| 6805 | } | 8964 | } |
| 6806 | #[doc = "SYSCFG user register 0"] | 8965 | #[doc = "SDMMC command response register"] |
| 6807 | #[repr(transparent)] | 8966 | #[repr(transparent)] |
| 6808 | #[derive(Copy, Clone, Eq, PartialEq)] | 8967 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 6809 | pub struct Ur0(pub u32); | 8968 | pub struct Respcmdr(pub u32); |
| 6810 | impl Ur0 { | 8969 | impl Respcmdr { |
| 6811 | #[doc = "Bank Swap"] | 8970 | #[doc = "Response command index"] |
| 6812 | pub const fn bks(&self) -> bool { | 8971 | pub const fn respcmd(&self) -> u8 { |
| 6813 | let val = (self.0 >> 0usize) & 0x01; | 8972 | let val = (self.0 >> 0usize) & 0x3f; |
| 6814 | val != 0 | ||
| 6815 | } | ||
| 6816 | #[doc = "Bank Swap"] | ||
| 6817 | pub fn set_bks(&mut self, val: bool) { | ||
| 6818 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 6819 | } | ||
| 6820 | #[doc = "Readout protection"] | ||
| 6821 | pub const fn rdp(&self) -> u8 { | ||
| 6822 | let val = (self.0 >> 16usize) & 0xff; | ||
| 6823 | val as u8 | 8973 | val as u8 |
| 6824 | } | 8974 | } |
| 6825 | #[doc = "Readout protection"] | 8975 | #[doc = "Response command index"] |
| 6826 | pub fn set_rdp(&mut self, val: u8) { | 8976 | pub fn set_respcmd(&mut self, val: u8) { |
| 6827 | self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize); | 8977 | self.0 = (self.0 & !(0x3f << 0usize)) | (((val as u32) & 0x3f) << 0usize); |
| 6828 | } | 8978 | } |
| 6829 | } | 8979 | } |
| 6830 | impl Default for Ur0 { | 8980 | impl Default for Respcmdr { |
| 6831 | fn default() -> Ur0 { | 8981 | fn default() -> Respcmdr { |
| 6832 | Ur0(0) | 8982 | Respcmdr(0) |
| 6833 | } | 8983 | } |
| 6834 | } | 8984 | } |
| 6835 | #[doc = "SYSCFG user register 6"] | 8985 | #[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."] |
| 6836 | #[repr(transparent)] | 8986 | #[repr(transparent)] |
| 6837 | #[derive(Copy, Clone, Eq, PartialEq)] | 8987 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 6838 | pub struct Ur6(pub u32); | 8988 | pub struct Fifor(pub u32); |
| 6839 | impl Ur6 { | 8989 | impl Fifor { |
| 6840 | #[doc = "Protected area start address for bank 1"] | 8990 | #[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."] |
| 6841 | pub const fn pa_beg_1(&self) -> u16 { | 8991 | pub const fn fifodata(&self) -> u32 { |
| 6842 | let val = (self.0 >> 0usize) & 0x0fff; | 8992 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 6843 | val as u16 | 8993 | val as u32 |
| 6844 | } | ||
| 6845 | #[doc = "Protected area start address for bank 1"] | ||
| 6846 | pub fn set_pa_beg_1(&mut self, val: u16) { | ||
| 6847 | self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); | ||
| 6848 | } | ||
| 6849 | #[doc = "Protected area end address for bank 1"] | ||
| 6850 | pub const fn pa_end_1(&self) -> u16 { | ||
| 6851 | let val = (self.0 >> 16usize) & 0x0fff; | ||
| 6852 | val as u16 | ||
| 6853 | } | 8994 | } |
| 6854 | #[doc = "Protected area end address for bank 1"] | 8995 | #[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."] |
| 6855 | pub fn set_pa_end_1(&mut self, val: u16) { | 8996 | pub fn set_fifodata(&mut self, val: u32) { |
| 6856 | self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); | 8997 | self.0 = |
| 8998 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 6857 | } | 8999 | } |
| 6858 | } | 9000 | } |
| 6859 | impl Default for Ur6 { | 9001 | impl Default for Fifor { |
| 6860 | fn default() -> Ur6 { | 9002 | fn default() -> Fifor { |
| 6861 | Ur6(0) | 9003 | Fifor(0) |
| 6862 | } | 9004 | } |
| 6863 | } | 9005 | } |
| 6864 | #[doc = "SYSCFG user register 11"] | 9006 | #[doc = "SDMMC power control register"] |
| 6865 | #[repr(transparent)] | 9007 | #[repr(transparent)] |
| 6866 | #[derive(Copy, Clone, Eq, PartialEq)] | 9008 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 6867 | pub struct Ur11(pub u32); | 9009 | pub struct Power(pub u32); |
| 6868 | impl Ur11 { | 9010 | impl Power { |
| 6869 | #[doc = "Secured area end address for bank 2"] | 9011 | #[doc = "SDMMC state control bits. These bits can only be written when the SDMMC is not in the power-on state (PWRCTRL?11). These bits are used to define the functional state of the SDMMC signals: Any further write will be ignored, PWRCTRL value will keep 11."] |
| 6870 | pub const fn sa_end_2(&self) -> u16 { | 9012 | pub const fn pwrctrl(&self) -> u8 { |
| 6871 | let val = (self.0 >> 0usize) & 0x0fff; | 9013 | let val = (self.0 >> 0usize) & 0x03; |
| 6872 | val as u16 | 9014 | val as u8 |
| 6873 | } | 9015 | } |
| 6874 | #[doc = "Secured area end address for bank 2"] | 9016 | #[doc = "SDMMC state control bits. These bits can only be written when the SDMMC is not in the power-on state (PWRCTRL?11). These bits are used to define the functional state of the SDMMC signals: Any further write will be ignored, PWRCTRL value will keep 11."] |
| 6875 | pub fn set_sa_end_2(&mut self, val: u16) { | 9017 | pub fn set_pwrctrl(&mut self, val: u8) { |
| 6876 | self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); | 9018 | self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize); |
| 6877 | } | 9019 | } |
| 6878 | #[doc = "Independent Watchdog 1 mode"] | 9020 | #[doc = "Voltage switch sequence start. This bit is used to start the timing critical section of the voltage switch sequence:"] |
| 6879 | pub const fn iwdg1m(&self) -> bool { | 9021 | pub const fn vswitch(&self) -> bool { |
| 6880 | let val = (self.0 >> 16usize) & 0x01; | 9022 | let val = (self.0 >> 2usize) & 0x01; |
| 6881 | val != 0 | 9023 | val != 0 |
| 6882 | } | 9024 | } |
| 6883 | #[doc = "Independent Watchdog 1 mode"] | 9025 | #[doc = "Voltage switch sequence start. This bit is used to start the timing critical section of the voltage switch sequence:"] |
| 6884 | pub fn set_iwdg1m(&mut self, val: bool) { | 9026 | pub fn set_vswitch(&mut self, val: bool) { |
| 6885 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | 9027 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 6886 | } | ||
| 6887 | } | ||
| 6888 | impl Default for Ur11 { | ||
| 6889 | fn default() -> Ur11 { | ||
| 6890 | Ur11(0) | ||
| 6891 | } | 9028 | } |
| 6892 | } | 9029 | #[doc = "Voltage switch procedure enable. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). This bit is used to stop the SDMMC_CK after the voltage switch command response:"] |
| 6893 | #[doc = "SYSCFG user register 16"] | 9030 | pub const fn vswitchen(&self) -> bool { |
| 6894 | #[repr(transparent)] | 9031 | let val = (self.0 >> 3usize) & 0x01; |
| 6895 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 6896 | pub struct Ur16(pub u32); | ||
| 6897 | impl Ur16 { | ||
| 6898 | #[doc = "Freeze independent watchdog in Stop mode"] | ||
| 6899 | pub const fn fziwdgstp(&self) -> bool { | ||
| 6900 | let val = (self.0 >> 0usize) & 0x01; | ||
| 6901 | val != 0 | 9032 | val != 0 |
| 6902 | } | 9033 | } |
| 6903 | #[doc = "Freeze independent watchdog in Stop mode"] | 9034 | #[doc = "Voltage switch procedure enable. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). This bit is used to stop the SDMMC_CK after the voltage switch command response:"] |
| 6904 | pub fn set_fziwdgstp(&mut self, val: bool) { | 9035 | pub fn set_vswitchen(&mut self, val: bool) { |
| 6905 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 9036 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); |
| 6906 | } | 9037 | } |
| 6907 | #[doc = "Private key programmed"] | 9038 | #[doc = "Data and command direction signals polarity selection. This bit can only be written when the SDMMC is in the power-off state (PWRCTRL = 00)."] |
| 6908 | pub const fn pkp(&self) -> bool { | 9039 | pub const fn dirpol(&self) -> bool { |
| 6909 | let val = (self.0 >> 16usize) & 0x01; | 9040 | let val = (self.0 >> 4usize) & 0x01; |
| 6910 | val != 0 | 9041 | val != 0 |
| 6911 | } | 9042 | } |
| 6912 | #[doc = "Private key programmed"] | 9043 | #[doc = "Data and command direction signals polarity selection. This bit can only be written when the SDMMC is in the power-off state (PWRCTRL = 00)."] |
| 6913 | pub fn set_pkp(&mut self, val: bool) { | 9044 | pub fn set_dirpol(&mut self, val: bool) { |
| 6914 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | 9045 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 6915 | } | 9046 | } |
| 6916 | } | 9047 | } |
| 6917 | impl Default for Ur16 { | 9048 | impl Default for Power { |
| 6918 | fn default() -> Ur16 { | 9049 | fn default() -> Power { |
| 6919 | Ur16(0) | 9050 | Power(0) |
| 6920 | } | 9051 | } |
| 6921 | } | 9052 | } |
| 6922 | #[doc = "compensation cell control/status register"] | 9053 | #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] |
| 6923 | #[repr(transparent)] | 9054 | #[repr(transparent)] |
| 6924 | #[derive(Copy, Clone, Eq, PartialEq)] | 9055 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 6925 | pub struct Cccsr(pub u32); | 9056 | pub struct Resp4r(pub u32); |
| 6926 | impl Cccsr { | 9057 | impl Resp4r { |
| 6927 | #[doc = "enable"] | 9058 | #[doc = "see Table404."] |
| 6928 | pub const fn en(&self) -> bool { | 9059 | pub const fn cardstatus4(&self) -> u32 { |
| 6929 | let val = (self.0 >> 0usize) & 0x01; | 9060 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 6930 | val != 0 | 9061 | val as u32 |
| 6931 | } | ||
| 6932 | #[doc = "enable"] | ||
| 6933 | pub fn set_en(&mut self, val: bool) { | ||
| 6934 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 6935 | } | ||
| 6936 | #[doc = "Code selection"] | ||
| 6937 | pub const fn cs(&self) -> bool { | ||
| 6938 | let val = (self.0 >> 1usize) & 0x01; | ||
| 6939 | val != 0 | ||
| 6940 | } | ||
| 6941 | #[doc = "Code selection"] | ||
| 6942 | pub fn set_cs(&mut self, val: bool) { | ||
| 6943 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | ||
| 6944 | } | ||
| 6945 | #[doc = "Compensation cell ready flag"] | ||
| 6946 | pub const fn ready(&self) -> bool { | ||
| 6947 | let val = (self.0 >> 8usize) & 0x01; | ||
| 6948 | val != 0 | ||
| 6949 | } | ||
| 6950 | #[doc = "Compensation cell ready flag"] | ||
| 6951 | pub fn set_ready(&mut self, val: bool) { | ||
| 6952 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 6953 | } | ||
| 6954 | #[doc = "High-speed at low-voltage"] | ||
| 6955 | pub const fn hslv(&self) -> bool { | ||
| 6956 | let val = (self.0 >> 16usize) & 0x01; | ||
| 6957 | val != 0 | ||
| 6958 | } | 9062 | } |
| 6959 | #[doc = "High-speed at low-voltage"] | 9063 | #[doc = "see Table404."] |
| 6960 | pub fn set_hslv(&mut self, val: bool) { | 9064 | pub fn set_cardstatus4(&mut self, val: u32) { |
| 6961 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | 9065 | self.0 = |
| 9066 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 6962 | } | 9067 | } |
| 6963 | } | 9068 | } |
| 6964 | impl Default for Cccsr { | 9069 | impl Default for Resp4r { |
| 6965 | fn default() -> Cccsr { | 9070 | fn default() -> Resp4r { |
| 6966 | Cccsr(0) | 9071 | Resp4r(0) |
| 6967 | } | 9072 | } |
| 6968 | } | 9073 | } |
| 6969 | #[doc = "SYSCFG user register 15"] | 9074 | #[doc = "The SDMMC_IDMABASE1R register contains the double buffer configuration second buffer memory base address."] |
| 6970 | #[repr(transparent)] | 9075 | #[repr(transparent)] |
| 6971 | #[derive(Copy, Clone, Eq, PartialEq)] | 9076 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 6972 | pub struct Ur15(pub u32); | 9077 | pub struct Idmabase1r(pub u32); |
| 6973 | impl Ur15 { | 9078 | impl Idmabase1r { |
| 6974 | #[doc = "Freeze independent watchdog in Standby mode"] | 9079 | #[doc = "Buffer 1 memory base address, shall be word aligned (bit [1:0] |
| 6975 | pub const fn fziwdgstb(&self) -> bool { | 9080 | 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)."] |
| 6976 | let val = (self.0 >> 16usize) & 0x01; | 9081 | pub const fn idmabase1(&self) -> u32 { |
| 6977 | val != 0 | 9082 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 9083 | val as u32 | ||
| 6978 | } | 9084 | } |
| 6979 | #[doc = "Freeze independent watchdog in Standby mode"] | 9085 | #[doc = "Buffer 1 memory base address, shall be word aligned (bit [1:0] |
| 6980 | pub fn set_fziwdgstb(&mut self, val: bool) { | 9086 | 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)."] |
| 6981 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | 9087 | pub fn set_idmabase1(&mut self, val: u32) { |
| 9088 | self.0 = | ||
| 9089 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 6982 | } | 9090 | } |
| 6983 | } | 9091 | } |
| 6984 | impl Default for Ur15 { | 9092 | impl Default for Idmabase1r { |
| 6985 | fn default() -> Ur15 { | 9093 | fn default() -> Idmabase1r { |
| 6986 | Ur15(0) | 9094 | Idmabase1r(0) |
| 6987 | } | 9095 | } |
| 6988 | } | 9096 | } |
| 6989 | #[doc = "SYSCFG package register"] | 9097 | #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] |
| 6990 | #[repr(transparent)] | 9098 | #[repr(transparent)] |
| 6991 | #[derive(Copy, Clone, Eq, PartialEq)] | 9099 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 6992 | pub struct Pkgr(pub u32); | 9100 | pub struct Resp3r(pub u32); |
| 6993 | impl Pkgr { | 9101 | impl Resp3r { |
| 6994 | #[doc = "Package"] | 9102 | #[doc = "see Table404."] |
| 6995 | pub const fn pkg(&self) -> u8 { | 9103 | pub const fn cardstatus3(&self) -> u32 { |
| 6996 | let val = (self.0 >> 0usize) & 0x0f; | 9104 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 6997 | val as u8 | 9105 | val as u32 |
| 6998 | } | 9106 | } |
| 6999 | #[doc = "Package"] | 9107 | #[doc = "see Table404."] |
| 7000 | pub fn set_pkg(&mut self, val: u8) { | 9108 | pub fn set_cardstatus3(&mut self, val: u32) { |
| 7001 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); | 9109 | self.0 = |
| 9110 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 7002 | } | 9111 | } |
| 7003 | } | 9112 | } |
| 7004 | impl Default for Pkgr { | 9113 | impl Default for Resp3r { |
| 7005 | fn default() -> Pkgr { | 9114 | fn default() -> Resp3r { |
| 7006 | Pkgr(0) | 9115 | Resp3r(0) |
| 7007 | } | 9116 | } |
| 7008 | } | 9117 | } |
| 7009 | #[doc = "SYSCFG user register 3"] | 9118 | #[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."] |
| 7010 | #[repr(transparent)] | 9119 | #[repr(transparent)] |
| 7011 | #[derive(Copy, Clone, Eq, PartialEq)] | 9120 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 7012 | pub struct Ur3(pub u32); | 9121 | pub struct Dcntr(pub u32); |
| 7013 | impl Ur3 { | 9122 | impl Dcntr { |
| 7014 | #[doc = "Boot Address 1"] | 9123 | #[doc = "Data count value When read, the number of remaining data bytes to be transferred is returned. Write has no effect."] |
| 7015 | pub const fn boot_add1(&self) -> u16 { | 9124 | pub const fn datacount(&self) -> u32 { |
| 7016 | let val = (self.0 >> 16usize) & 0xffff; | 9125 | let val = (self.0 >> 0usize) & 0x01ff_ffff; |
| 7017 | val as u16 | 9126 | val as u32 |
| 7018 | } | 9127 | } |
| 7019 | #[doc = "Boot Address 1"] | 9128 | #[doc = "Data count value When read, the number of remaining data bytes to be transferred is returned. Write has no effect."] |
| 7020 | pub fn set_boot_add1(&mut self, val: u16) { | 9129 | pub fn set_datacount(&mut self, val: u32) { |
| 7021 | self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize); | 9130 | self.0 = |
| 9131 | (self.0 & !(0x01ff_ffff << 0usize)) | (((val as u32) & 0x01ff_ffff) << 0usize); | ||
| 7022 | } | 9132 | } |
| 7023 | } | 9133 | } |
| 7024 | impl Default for Ur3 { | 9134 | impl Default for Dcntr { |
| 7025 | fn default() -> Ur3 { | 9135 | fn default() -> Dcntr { |
| 7026 | Ur3(0) | 9136 | Dcntr(0) |
| 7027 | } | 9137 | } |
| 7028 | } | 9138 | } |
| 7029 | #[doc = "SYSCFG user register 8"] | 9139 | #[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)."] |
| 7030 | #[repr(transparent)] | 9140 | #[repr(transparent)] |
| 7031 | #[derive(Copy, Clone, Eq, PartialEq)] | 9141 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 7032 | pub struct Ur8(pub u32); | 9142 | pub struct Cmdr(pub u32); |
| 7033 | impl Ur8 { | 9143 | impl Cmdr { |
| 7034 | #[doc = "Mass erase protected area disabled for bank 2"] | 9144 | #[doc = "Command index. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). The command index is sent to the card as part of a command message."] |
| 7035 | pub const fn mepad_2(&self) -> bool { | 9145 | pub const fn cmdindex(&self) -> u8 { |
| 7036 | let val = (self.0 >> 0usize) & 0x01; | 9146 | let val = (self.0 >> 0usize) & 0x3f; |
| 9147 | val as u8 | ||
| 9148 | } | ||
| 9149 | #[doc = "Command index. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). The command index is sent to the card as part of a command message."] | ||
| 9150 | pub fn set_cmdindex(&mut self, val: u8) { | ||
| 9151 | self.0 = (self.0 & !(0x3f << 0usize)) | (((val as u32) & 0x3f) << 0usize); | ||
| 9152 | } | ||
| 9153 | #[doc = "The CPSM treats the command as a data transfer command, stops the interrupt period, and signals DataEnable to the DPSM This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). If this bit is set, the CPSM issues an end of interrupt period and issues DataEnable signal to the DPSM when the command is sent."] | ||
| 9154 | pub const fn cmdtrans(&self) -> bool { | ||
| 9155 | let val = (self.0 >> 6usize) & 0x01; | ||
| 7037 | val != 0 | 9156 | val != 0 |
| 7038 | } | 9157 | } |
| 7039 | #[doc = "Mass erase protected area disabled for bank 2"] | 9158 | #[doc = "The CPSM treats the command as a data transfer command, stops the interrupt period, and signals DataEnable to the DPSM This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). If this bit is set, the CPSM issues an end of interrupt period and issues DataEnable signal to the DPSM when the command is sent."] |
| 7040 | pub fn set_mepad_2(&mut self, val: bool) { | 9159 | pub fn set_cmdtrans(&mut self, val: bool) { |
| 7041 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 9160 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 7042 | } | 9161 | } |
| 7043 | #[doc = "Mass erase secured area disabled for bank 2"] | 9162 | #[doc = "The CPSM treats the command as a Stop Transmission command and signals Abort to the DPSM. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). If this bit is set, the CPSM issues the Abort signal to the DPSM when the command is sent."] |
| 7044 | pub const fn mesad_2(&self) -> bool { | 9163 | pub const fn cmdstop(&self) -> bool { |
| 7045 | let val = (self.0 >> 16usize) & 0x01; | 9164 | let val = (self.0 >> 7usize) & 0x01; |
| 7046 | val != 0 | 9165 | val != 0 |
| 7047 | } | 9166 | } |
| 7048 | #[doc = "Mass erase secured area disabled for bank 2"] | 9167 | #[doc = "The CPSM treats the command as a Stop Transmission command and signals Abort to the DPSM. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). If this bit is set, the CPSM issues the Abort signal to the DPSM when the command is sent."] |
| 7049 | pub fn set_mesad_2(&mut self, val: bool) { | 9168 | pub fn set_cmdstop(&mut self, val: bool) { |
| 7050 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | 9169 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 7051 | } | 9170 | } |
| 7052 | } | 9171 | #[doc = "Wait for response bits. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). They are used to configure whether the CPSM is to wait for a response, and if yes, which kind of response."] |
| 7053 | impl Default for Ur8 { | 9172 | pub const fn waitresp(&self) -> u8 { |
| 7054 | fn default() -> Ur8 { | 9173 | let val = (self.0 >> 8usize) & 0x03; |
| 7055 | Ur8(0) | 9174 | val as u8 |
| 7056 | } | 9175 | } |
| 7057 | } | 9176 | #[doc = "Wait for response bits. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). They are used to configure whether the CPSM is to wait for a response, and if yes, which kind of response."] |
| 7058 | } | 9177 | pub fn set_waitresp(&mut self, val: u8) { |
| 7059 | } | 9178 | self.0 = (self.0 & !(0x03 << 8usize)) | (((val as u32) & 0x03) << 8usize); |
| 7060 | pub mod rng_v1 { | 9179 | } |
| 7061 | use crate::generic::*; | 9180 | #[doc = "CPSM waits for interrupt request. If this bit is set, the CPSM disables command timeout and waits for an card interrupt request (Response). If this bit is cleared in the CPSM Wait state, will cause the abort of the interrupt mode."] |
| 7062 | #[doc = "Random number generator"] | 9181 | pub const fn waitint(&self) -> bool { |
| 7063 | #[derive(Copy, Clone)] | 9182 | let val = (self.0 >> 10usize) & 0x01; |
| 7064 | pub struct Rng(pub *mut u8); | ||
| 7065 | unsafe impl Send for Rng {} | ||
| 7066 | unsafe impl Sync for Rng {} | ||
| 7067 | impl Rng { | ||
| 7068 | #[doc = "control register"] | ||
| 7069 | pub fn cr(self) -> Reg<regs::Cr, RW> { | ||
| 7070 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 7071 | } | ||
| 7072 | #[doc = "status register"] | ||
| 7073 | pub fn sr(self) -> Reg<regs::Sr, RW> { | ||
| 7074 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 7075 | } | ||
| 7076 | #[doc = "data register"] | ||
| 7077 | pub fn dr(self) -> Reg<u32, R> { | ||
| 7078 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 7079 | } | ||
| 7080 | } | ||
| 7081 | pub mod regs { | ||
| 7082 | use crate::generic::*; | ||
| 7083 | #[doc = "control register"] | ||
| 7084 | #[repr(transparent)] | ||
| 7085 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 7086 | pub struct Cr(pub u32); | ||
| 7087 | impl Cr { | ||
| 7088 | #[doc = "Random number generator enable"] | ||
| 7089 | pub const fn rngen(&self) -> bool { | ||
| 7090 | let val = (self.0 >> 2usize) & 0x01; | ||
| 7091 | val != 0 | 9183 | val != 0 |
| 7092 | } | 9184 | } |
| 7093 | #[doc = "Random number generator enable"] | 9185 | #[doc = "CPSM waits for interrupt request. If this bit is set, the CPSM disables command timeout and waits for an card interrupt request (Response). If this bit is cleared in the CPSM Wait state, will cause the abort of the interrupt mode."] |
| 7094 | pub fn set_rngen(&mut self, val: bool) { | 9186 | pub fn set_waitint(&mut self, val: bool) { |
| 7095 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 9187 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); |
| 7096 | } | 9188 | } |
| 7097 | #[doc = "Interrupt enable"] | 9189 | #[doc = "CPSM Waits for end of data transfer (CmdPend internal signal) from DPSM. This bit when set, the CPSM waits for the end of data transfer trigger before it starts sending a command. WAITPEND is only taken into account when DTMODE = MMC stream data transfer, WIDBUS = 1-bit wide bus mode, DPSMACT = 1 and DTDIR = from host to card."] |
| 7098 | pub const fn ie(&self) -> bool { | 9190 | pub const fn waitpend(&self) -> bool { |
| 7099 | let val = (self.0 >> 3usize) & 0x01; | 9191 | let val = (self.0 >> 11usize) & 0x01; |
| 7100 | val != 0 | 9192 | val != 0 |
| 7101 | } | 9193 | } |
| 7102 | #[doc = "Interrupt enable"] | 9194 | #[doc = "CPSM Waits for end of data transfer (CmdPend internal signal) from DPSM. This bit when set, the CPSM waits for the end of data transfer trigger before it starts sending a command. WAITPEND is only taken into account when DTMODE = MMC stream data transfer, WIDBUS = 1-bit wide bus mode, DPSMACT = 1 and DTDIR = from host to card."] |
| 7103 | pub fn set_ie(&mut self, val: bool) { | 9195 | pub fn set_waitpend(&mut self, val: bool) { |
| 7104 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 9196 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); |
| 7105 | } | ||
| 7106 | } | ||
| 7107 | impl Default for Cr { | ||
| 7108 | fn default() -> Cr { | ||
| 7109 | Cr(0) | ||
| 7110 | } | 9197 | } |
| 7111 | } | 9198 | #[doc = "Command path state machine (CPSM) Enable bit This bit is written 1 by firmware, and cleared by hardware when the CPSM enters the Idle state. If this bit is set, the CPSM is enabled. When DTEN = 1, no command will be transfered nor boot procedure will be started. CPSMEN is cleared to 0."] |
| 7112 | #[doc = "status register"] | 9199 | pub const fn cpsmen(&self) -> bool { |
| 7113 | #[repr(transparent)] | 9200 | let val = (self.0 >> 12usize) & 0x01; |
| 7114 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 7115 | pub struct Sr(pub u32); | ||
| 7116 | impl Sr { | ||
| 7117 | #[doc = "Data ready"] | ||
| 7118 | pub const fn drdy(&self) -> bool { | ||
| 7119 | let val = (self.0 >> 0usize) & 0x01; | ||
| 7120 | val != 0 | 9201 | val != 0 |
| 7121 | } | 9202 | } |
| 7122 | #[doc = "Data ready"] | 9203 | #[doc = "Command path state machine (CPSM) Enable bit This bit is written 1 by firmware, and cleared by hardware when the CPSM enters the Idle state. If this bit is set, the CPSM is enabled. When DTEN = 1, no command will be transfered nor boot procedure will be started. CPSMEN is cleared to 0."] |
| 7123 | pub fn set_drdy(&mut self, val: bool) { | 9204 | pub fn set_cpsmen(&mut self, val: bool) { |
| 7124 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 9205 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); |
| 7125 | } | 9206 | } |
| 7126 | #[doc = "Clock error current status"] | 9207 | #[doc = "Hold new data block transmission and reception in the DPSM. If this bit is set, the DPSM will not move from the Wait_S state to the Send state or from the Wait_R state to the Receive state."] |
| 7127 | pub const fn cecs(&self) -> bool { | 9208 | pub const fn dthold(&self) -> bool { |
| 7128 | let val = (self.0 >> 1usize) & 0x01; | 9209 | let val = (self.0 >> 13usize) & 0x01; |
| 7129 | val != 0 | 9210 | val != 0 |
| 7130 | } | 9211 | } |
| 7131 | #[doc = "Clock error current status"] | 9212 | #[doc = "Hold new data block transmission and reception in the DPSM. If this bit is set, the DPSM will not move from the Wait_S state to the Send state or from the Wait_R state to the Receive state."] |
| 7132 | pub fn set_cecs(&mut self, val: bool) { | 9213 | pub fn set_dthold(&mut self, val: bool) { |
| 7133 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 9214 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); |
| 7134 | } | 9215 | } |
| 7135 | #[doc = "Seed error current status"] | 9216 | #[doc = "Select the boot mode procedure to be used. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0)"] |
| 7136 | pub const fn secs(&self) -> bool { | 9217 | pub const fn bootmode(&self) -> bool { |
| 7137 | let val = (self.0 >> 2usize) & 0x01; | 9218 | let val = (self.0 >> 14usize) & 0x01; |
| 7138 | val != 0 | 9219 | val != 0 |
| 7139 | } | 9220 | } |
| 7140 | #[doc = "Seed error current status"] | 9221 | #[doc = "Select the boot mode procedure to be used. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0)"] |
| 7141 | pub fn set_secs(&mut self, val: bool) { | 9222 | pub fn set_bootmode(&mut self, val: bool) { |
| 7142 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 9223 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); |
| 7143 | } | 9224 | } |
| 7144 | #[doc = "Clock error interrupt status"] | 9225 | #[doc = "Enable boot mode procedure."] |
| 7145 | pub const fn ceis(&self) -> bool { | 9226 | pub const fn booten(&self) -> bool { |
| 7146 | let val = (self.0 >> 5usize) & 0x01; | 9227 | let val = (self.0 >> 15usize) & 0x01; |
| 7147 | val != 0 | 9228 | val != 0 |
| 7148 | } | 9229 | } |
| 7149 | #[doc = "Clock error interrupt status"] | 9230 | #[doc = "Enable boot mode procedure."] |
| 7150 | pub fn set_ceis(&mut self, val: bool) { | 9231 | pub fn set_booten(&mut self, val: bool) { |
| 7151 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 9232 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); |
| 7152 | } | 9233 | } |
| 7153 | #[doc = "Seed error interrupt status"] | 9234 | #[doc = "The CPSM treats the command as a Suspend or Resume command and signals interrupt period start/end. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). CMDSUSPEND = 1 and CMDTRANS = 0 Suspend command, start interrupt period when response bit BS=0. CMDSUSPEND = 1 and CMDTRANS = 1 Resume command with data, end interrupt period when response bit DF=1."] |
| 7154 | pub const fn seis(&self) -> bool { | 9235 | pub const fn cmdsuspend(&self) -> bool { |
| 7155 | let val = (self.0 >> 6usize) & 0x01; | 9236 | let val = (self.0 >> 16usize) & 0x01; |
| 7156 | val != 0 | 9237 | val != 0 |
| 7157 | } | 9238 | } |
| 7158 | #[doc = "Seed error interrupt status"] | 9239 | #[doc = "The CPSM treats the command as a Suspend or Resume command and signals interrupt period start/end. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). CMDSUSPEND = 1 and CMDTRANS = 0 Suspend command, start interrupt period when response bit BS=0. CMDSUSPEND = 1 and CMDTRANS = 1 Resume command with data, end interrupt period when response bit DF=1."] |
| 7159 | pub fn set_seis(&mut self, val: bool) { | 9240 | pub fn set_cmdsuspend(&mut self, val: bool) { |
| 7160 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 9241 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); |
| 7161 | } | 9242 | } |
| 7162 | } | 9243 | } |
| 7163 | impl Default for Sr { | 9244 | impl Default for Cmdr { |
| 7164 | fn default() -> Sr { | 9245 | fn default() -> Cmdr { |
| 7165 | Sr(0) | 9246 | Cmdr(0) |
| 7166 | } | 9247 | } |
| 7167 | } | 9248 | } |
| 7168 | } | 9249 | #[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."] |
| 7169 | } | 9250 | #[repr(transparent)] |
| 7170 | pub mod syscfg_f4 { | 9251 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 7171 | use crate::generic::*; | 9252 | pub struct Dtimer(pub u32); |
| 7172 | #[doc = "System configuration controller"] | 9253 | impl Dtimer { |
| 7173 | #[derive(Copy, Clone)] | 9254 | #[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."] |
| 7174 | pub struct Syscfg(pub *mut u8); | 9255 | pub const fn datatime(&self) -> u32 { |
| 7175 | unsafe impl Send for Syscfg {} | 9256 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 7176 | unsafe impl Sync for Syscfg {} | 9257 | val as u32 |
| 7177 | impl Syscfg { | 9258 | } |
| 7178 | #[doc = "memory remap register"] | 9259 | #[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."] |
| 7179 | pub fn memrm(self) -> Reg<regs::Memrm, RW> { | 9260 | pub fn set_datatime(&mut self, val: u32) { |
| 7180 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | 9261 | self.0 = |
| 7181 | } | 9262 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); |
| 7182 | #[doc = "peripheral mode configuration register"] | 9263 | } |
| 7183 | pub fn pmc(self) -> Reg<regs::Pmc, RW> { | ||
| 7184 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 7185 | } | ||
| 7186 | #[doc = "external interrupt configuration register"] | ||
| 7187 | pub fn exticr(self, n: usize) -> Reg<regs::Exticr, RW> { | ||
| 7188 | assert!(n < 4usize); | ||
| 7189 | unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) } | ||
| 7190 | } | 9264 | } |
| 7191 | #[doc = "Compensation cell control register"] | 9265 | impl Default for Dtimer { |
| 7192 | pub fn cmpcr(self) -> Reg<regs::Cmpcr, R> { | 9266 | fn default() -> Dtimer { |
| 7193 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | 9267 | Dtimer(0) |
| 9268 | } | ||
| 7194 | } | 9269 | } |
| 7195 | } | 9270 | #[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."] |
| 7196 | pub mod regs { | ||
| 7197 | use crate::generic::*; | ||
| 7198 | #[doc = "memory remap register"] | ||
| 7199 | #[repr(transparent)] | 9271 | #[repr(transparent)] |
| 7200 | #[derive(Copy, Clone, Eq, PartialEq)] | 9272 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 7201 | pub struct Memrm(pub u32); | 9273 | pub struct Idmactrlr(pub u32); |
| 7202 | impl Memrm { | 9274 | impl Idmactrlr { |
| 7203 | #[doc = "Memory mapping selection"] | 9275 | #[doc = "IDMA enable This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] |
| 7204 | pub const fn mem_mode(&self) -> u8 { | 9276 | pub const fn idmaen(&self) -> bool { |
| 7205 | let val = (self.0 >> 0usize) & 0x07; | 9277 | let val = (self.0 >> 0usize) & 0x01; |
| 7206 | val as u8 | 9278 | val != 0 |
| 7207 | } | 9279 | } |
| 7208 | #[doc = "Memory mapping selection"] | 9280 | #[doc = "IDMA enable This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] |
| 7209 | pub fn set_mem_mode(&mut self, val: u8) { | 9281 | pub fn set_idmaen(&mut self, val: bool) { |
| 7210 | self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize); | 9282 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 7211 | } | 9283 | } |
| 7212 | #[doc = "Flash bank mode selection"] | 9284 | #[doc = "Buffer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] |
| 7213 | pub const fn fb_mode(&self) -> bool { | 9285 | pub const fn idmabmode(&self) -> bool { |
| 7214 | let val = (self.0 >> 8usize) & 0x01; | 9286 | let val = (self.0 >> 1usize) & 0x01; |
| 7215 | val != 0 | 9287 | val != 0 |
| 7216 | } | 9288 | } |
| 7217 | #[doc = "Flash bank mode selection"] | 9289 | #[doc = "Buffer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] |
| 7218 | pub fn set_fb_mode(&mut self, val: bool) { | 9290 | pub fn set_idmabmode(&mut self, val: bool) { |
| 7219 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 9291 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 7220 | } | 9292 | } |
| 7221 | #[doc = "FMC memory mapping swap"] | 9293 | #[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."] |
| 7222 | pub const fn swp_fmc(&self) -> u8 { | 9294 | pub const fn idmabact(&self) -> bool { |
| 7223 | let val = (self.0 >> 10usize) & 0x03; | 9295 | let val = (self.0 >> 2usize) & 0x01; |
| 7224 | val as u8 | 9296 | val != 0 |
| 7225 | } | 9297 | } |
| 7226 | #[doc = "FMC memory mapping swap"] | 9298 | #[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."] |
| 7227 | pub fn set_swp_fmc(&mut self, val: u8) { | 9299 | pub fn set_idmabact(&mut self, val: bool) { |
| 7228 | self.0 = (self.0 & !(0x03 << 10usize)) | (((val as u32) & 0x03) << 10usize); | 9300 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 7229 | } | 9301 | } |
| 7230 | } | 9302 | } |
| 7231 | impl Default for Memrm { | 9303 | impl Default for Idmactrlr { |
| 7232 | fn default() -> Memrm { | 9304 | fn default() -> Idmactrlr { |
| 7233 | Memrm(0) | 9305 | Idmactrlr(0) |
| 7234 | } | 9306 | } |
| 7235 | } | 9307 | } |
| 7236 | #[doc = "Compensation cell control register"] | 9308 | #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] |
| 7237 | #[repr(transparent)] | 9309 | #[repr(transparent)] |
| 7238 | #[derive(Copy, Clone, Eq, PartialEq)] | 9310 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 7239 | pub struct Cmpcr(pub u32); | 9311 | pub struct Resp1r(pub u32); |
| 7240 | impl Cmpcr { | 9312 | impl Resp1r { |
| 7241 | #[doc = "Compensation cell power-down"] | 9313 | #[doc = "see Table 432"] |
| 7242 | pub const fn cmp_pd(&self) -> bool { | 9314 | pub const fn cardstatus1(&self) -> u32 { |
| 7243 | let val = (self.0 >> 0usize) & 0x01; | 9315 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 7244 | val != 0 | 9316 | val as u32 |
| 7245 | } | 9317 | } |
| 7246 | #[doc = "Compensation cell power-down"] | 9318 | #[doc = "see Table 432"] |
| 7247 | pub fn set_cmp_pd(&mut self, val: bool) { | 9319 | pub fn set_cardstatus1(&mut self, val: u32) { |
| 7248 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 9320 | self.0 = |
| 9321 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 7249 | } | 9322 | } |
| 7250 | #[doc = "READY"] | 9323 | } |
| 7251 | pub const fn ready(&self) -> bool { | 9324 | impl Default for Resp1r { |
| 7252 | let val = (self.0 >> 8usize) & 0x01; | 9325 | fn default() -> Resp1r { |
| 7253 | val != 0 | 9326 | Resp1r(0) |
| 7254 | } | 9327 | } |
| 7255 | #[doc = "READY"] | 9328 | } |
| 7256 | pub fn set_ready(&mut self, val: bool) { | 9329 | #[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."] |
| 7257 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 9330 | #[repr(transparent)] |
| 9331 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 9332 | pub struct Acktimer(pub u32); | ||
| 9333 | impl Acktimer { | ||
| 9334 | #[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."] | ||
| 9335 | pub const fn acktime(&self) -> u32 { | ||
| 9336 | let val = (self.0 >> 0usize) & 0x01ff_ffff; | ||
| 9337 | val as u32 | ||
| 9338 | } | ||
| 9339 | #[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."] | ||
| 9340 | pub fn set_acktime(&mut self, val: u32) { | ||
| 9341 | self.0 = | ||
| 9342 | (self.0 & !(0x01ff_ffff << 0usize)) | (((val as u32) & 0x01ff_ffff) << 0usize); | ||
| 7258 | } | 9343 | } |
| 7259 | } | 9344 | } |
| 7260 | impl Default for Cmpcr { | 9345 | impl Default for Acktimer { |
| 7261 | fn default() -> Cmpcr { | 9346 | fn default() -> Acktimer { |
| 7262 | Cmpcr(0) | 9347 | Acktimer(0) |
| 7263 | } | 9348 | } |
| 7264 | } | 9349 | } |
| 7265 | #[doc = "peripheral mode configuration register"] | 9350 | #[doc = "The SDMMC_CLKCR register controls the SDMMC_CK output clock, the SDMMC_RX_CLK receive clock, and the bus width."] |
| 7266 | #[repr(transparent)] | 9351 | #[repr(transparent)] |
| 7267 | #[derive(Copy, Clone, Eq, PartialEq)] | 9352 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 7268 | pub struct Pmc(pub u32); | 9353 | pub struct Clkcr(pub u32); |
| 7269 | impl Pmc { | 9354 | impl Clkcr { |
| 7270 | #[doc = "ADC1DC2"] | 9355 | #[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.."] |
| 7271 | pub const fn adc1dc2(&self) -> bool { | 9356 | pub const fn clkdiv(&self) -> u16 { |
| 9357 | let val = (self.0 >> 0usize) & 0x03ff; | ||
| 9358 | val as u16 | ||
| 9359 | } | ||
| 9360 | #[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.."] | ||
| 9361 | pub fn set_clkdiv(&mut self, val: u16) { | ||
| 9362 | self.0 = (self.0 & !(0x03ff << 0usize)) | (((val as u32) & 0x03ff) << 0usize); | ||
| 9363 | } | ||
| 9364 | #[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:"] | ||
| 9365 | pub const fn pwrsav(&self) -> bool { | ||
| 9366 | let val = (self.0 >> 12usize) & 0x01; | ||
| 9367 | val != 0 | ||
| 9368 | } | ||
| 9369 | #[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:"] | ||
| 9370 | pub fn set_pwrsav(&mut self, val: bool) { | ||
| 9371 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); | ||
| 9372 | } | ||
| 9373 | #[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)"] | ||
| 9374 | pub const fn widbus(&self) -> u8 { | ||
| 9375 | let val = (self.0 >> 14usize) & 0x03; | ||
| 9376 | val as u8 | ||
| 9377 | } | ||
| 9378 | #[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)"] | ||
| 9379 | pub fn set_widbus(&mut self, val: u8) { | ||
| 9380 | self.0 = (self.0 & !(0x03 << 14usize)) | (((val as u32) & 0x03) << 14usize); | ||
| 9381 | } | ||
| 9382 | #[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."] | ||
| 9383 | pub const fn negedge(&self) -> bool { | ||
| 7272 | let val = (self.0 >> 16usize) & 0x01; | 9384 | let val = (self.0 >> 16usize) & 0x01; |
| 7273 | val != 0 | 9385 | val != 0 |
| 7274 | } | 9386 | } |
| 7275 | #[doc = "ADC1DC2"] | 9387 | #[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."] |
| 7276 | pub fn set_adc1dc2(&mut self, val: bool) { | 9388 | pub fn set_negedge(&mut self, val: bool) { |
| 7277 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | 9389 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); |
| 7278 | } | 9390 | } |
| 7279 | #[doc = "ADC2DC2"] | 9391 | #[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."] |
| 7280 | pub const fn adc2dc2(&self) -> bool { | 9392 | pub const fn hwfc_en(&self) -> bool { |
| 7281 | let val = (self.0 >> 17usize) & 0x01; | 9393 | let val = (self.0 >> 17usize) & 0x01; |
| 7282 | val != 0 | 9394 | val != 0 |
| 7283 | } | 9395 | } |
| 7284 | #[doc = "ADC2DC2"] | 9396 | #[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."] |
| 7285 | pub fn set_adc2dc2(&mut self, val: bool) { | 9397 | pub fn set_hwfc_en(&mut self, val: bool) { |
| 7286 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); | 9398 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); |
| 7287 | } | 9399 | } |
| 7288 | #[doc = "ADC3DC2"] | 9400 | #[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)"] |
| 7289 | pub const fn adc3dc2(&self) -> bool { | 9401 | pub const fn ddr(&self) -> bool { |
| 7290 | let val = (self.0 >> 18usize) & 0x01; | 9402 | let val = (self.0 >> 18usize) & 0x01; |
| 7291 | val != 0 | 9403 | val != 0 |
| 7292 | } | 9404 | } |
| 7293 | #[doc = "ADC3DC2"] | 9405 | #[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)"] |
| 7294 | pub fn set_adc3dc2(&mut self, val: bool) { | 9406 | pub fn set_ddr(&mut self, val: bool) { |
| 7295 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); | 9407 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); |
| 7296 | } | 9408 | } |
| 7297 | #[doc = "Ethernet PHY interface selection"] | 9409 | #[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)"] |
| 7298 | pub const fn mii_rmii_sel(&self) -> bool { | 9410 | pub const fn busspeed(&self) -> bool { |
| 7299 | let val = (self.0 >> 23usize) & 0x01; | 9411 | let val = (self.0 >> 19usize) & 0x01; |
| 7300 | val != 0 | 9412 | val != 0 |
| 7301 | } | 9413 | } |
| 7302 | #[doc = "Ethernet PHY interface selection"] | 9414 | #[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)"] |
| 7303 | pub fn set_mii_rmii_sel(&mut self, val: bool) { | 9415 | pub fn set_busspeed(&mut self, val: bool) { |
| 7304 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); | 9416 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); |
| 9417 | } | ||
| 9418 | #[doc = "Receive clock selection. These bits can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"] | ||
| 9419 | pub const fn selclkrx(&self) -> u8 { | ||
| 9420 | let val = (self.0 >> 20usize) & 0x03; | ||
| 9421 | val as u8 | ||
| 9422 | } | ||
| 9423 | #[doc = "Receive clock selection. These bits can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"] | ||
| 9424 | pub fn set_selclkrx(&mut self, val: u8) { | ||
| 9425 | self.0 = (self.0 & !(0x03 << 20usize)) | (((val as u32) & 0x03) << 20usize); | ||
| 7305 | } | 9426 | } |
| 7306 | } | 9427 | } |
| 7307 | impl Default for Pmc { | 9428 | impl Default for Clkcr { |
| 7308 | fn default() -> Pmc { | 9429 | fn default() -> Clkcr { |
| 7309 | Pmc(0) | 9430 | Clkcr(0) |
| 7310 | } | 9431 | } |
| 7311 | } | 9432 | } |
| 7312 | #[doc = "external interrupt configuration register"] | 9433 | #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] |
| 7313 | #[repr(transparent)] | 9434 | #[repr(transparent)] |
| 7314 | #[derive(Copy, Clone, Eq, PartialEq)] | 9435 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 7315 | pub struct Exticr(pub u32); | 9436 | pub struct Resp2r(pub u32); |
| 7316 | impl Exticr { | 9437 | impl Resp2r { |
| 7317 | #[doc = "EXTI x configuration"] | 9438 | #[doc = "see Table404."] |
| 7318 | pub fn exti(&self, n: usize) -> u8 { | 9439 | pub const fn cardstatus2(&self) -> u32 { |
| 7319 | assert!(n < 4usize); | 9440 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 7320 | let offs = 0usize + n * 4usize; | 9441 | val as u32 |
| 7321 | let val = (self.0 >> offs) & 0x0f; | 9442 | } |
| 9443 | #[doc = "see Table404."] | ||
| 9444 | pub fn set_cardstatus2(&mut self, val: u32) { | ||
| 9445 | self.0 = | ||
| 9446 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 9447 | } | ||
| 9448 | } | ||
| 9449 | impl Default for Resp2r { | ||
| 9450 | fn default() -> Resp2r { | ||
| 9451 | Resp2r(0) | ||
| 9452 | } | ||
| 9453 | } | ||
| 9454 | #[doc = "SDMMC IP version register"] | ||
| 9455 | #[repr(transparent)] | ||
| 9456 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 9457 | pub struct Ver(pub u32); | ||
| 9458 | impl Ver { | ||
| 9459 | #[doc = "IP minor revision number."] | ||
| 9460 | pub const fn minrev(&self) -> u8 { | ||
| 9461 | let val = (self.0 >> 0usize) & 0x0f; | ||
| 7322 | val as u8 | 9462 | val as u8 |
| 7323 | } | 9463 | } |
| 7324 | #[doc = "EXTI x configuration"] | 9464 | #[doc = "IP minor revision number."] |
| 7325 | pub fn set_exti(&mut self, n: usize, val: u8) { | 9465 | pub fn set_minrev(&mut self, val: u8) { |
| 7326 | assert!(n < 4usize); | 9466 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); |
| 7327 | let offs = 0usize + n * 4usize; | 9467 | } |
| 7328 | self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs); | 9468 | #[doc = "IP major revision number."] |
| 9469 | pub const fn majrev(&self) -> u8 { | ||
| 9470 | let val = (self.0 >> 4usize) & 0x0f; | ||
| 9471 | val as u8 | ||
| 9472 | } | ||
| 9473 | #[doc = "IP major revision number."] | ||
| 9474 | pub fn set_majrev(&mut self, val: u8) { | ||
| 9475 | self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize); | ||
| 7329 | } | 9476 | } |
| 7330 | } | 9477 | } |
| 7331 | impl Default for Exticr { | 9478 | impl Default for Ver { |
| 7332 | fn default() -> Exticr { | 9479 | fn default() -> Ver { |
| 7333 | Exticr(0) | 9480 | Ver(0) |
| 7334 | } | 9481 | } |
| 7335 | } | 9482 | } |
| 7336 | } | 9483 | } |
| 7337 | } | 9484 | } |
| 7338 | pub mod usart_v2 { | 9485 | pub mod spi_v3 { |
| 7339 | use crate::generic::*; | 9486 | use crate::generic::*; |
| 7340 | #[doc = "Universal synchronous asynchronous receiver transmitter"] | 9487 | #[doc = "Serial peripheral interface"] |
| 7341 | #[derive(Copy, Clone)] | 9488 | #[derive(Copy, Clone)] |
| 7342 | pub struct Usart(pub *mut u8); | 9489 | pub struct Spi(pub *mut u8); |
| 7343 | unsafe impl Send for Usart {} | 9490 | unsafe impl Send for Spi {} |
| 7344 | unsafe impl Sync for Usart {} | 9491 | unsafe impl Sync for Spi {} |
| 7345 | impl Usart { | 9492 | impl Spi { |
| 7346 | #[doc = "Control register 1"] | 9493 | #[doc = "control register 1"] |
| 7347 | pub fn cr1(self) -> Reg<regs::Cr1, RW> { | 9494 | pub fn cr1(self) -> Reg<regs::Cr1, RW> { |
| 7348 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | 9495 | unsafe { Reg::from_ptr(self.0.add(0usize)) } |
| 7349 | } | 9496 | } |
| 7350 | #[doc = "Control register 2"] | 9497 | #[doc = "control register 2"] |
| 7351 | pub fn cr2(self) -> Reg<regs::Cr2, RW> { | 9498 | pub fn cr2(self) -> Reg<regs::Cr2, RW> { |
| 7352 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | 9499 | unsafe { Reg::from_ptr(self.0.add(4usize)) } |
| 7353 | } | 9500 | } |
| 7354 | #[doc = "Control register 3"] | 9501 | #[doc = "configuration register 1"] |
| 7355 | pub fn cr3(self) -> Reg<regs::Cr3, RW> { | 9502 | pub fn cfg1(self) -> Reg<regs::Cfg1, RW> { |
| 7356 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | 9503 | unsafe { Reg::from_ptr(self.0.add(8usize)) } |
| 7357 | } | 9504 | } |
| 7358 | #[doc = "Baud rate register"] | 9505 | #[doc = "configuration register 2"] |
| 7359 | pub fn brr(self) -> Reg<regs::Brr, RW> { | 9506 | pub fn cfg2(self) -> Reg<regs::Cfg2, RW> { |
| 7360 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | 9507 | unsafe { Reg::from_ptr(self.0.add(12usize)) } |
| 7361 | } | 9508 | } |
| 7362 | #[doc = "Guard time and prescaler register"] | 9509 | #[doc = "Interrupt Enable Register"] |
| 7363 | pub fn gtpr(self) -> Reg<regs::Gtpr, RW> { | 9510 | pub fn ier(self) -> Reg<regs::Ier, RW> { |
| 7364 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | 9511 | unsafe { Reg::from_ptr(self.0.add(16usize)) } |
| 7365 | } | 9512 | } |
| 7366 | #[doc = "Receiver timeout register"] | 9513 | #[doc = "Status Register"] |
| 7367 | pub fn rtor(self) -> Reg<regs::Rtor, RW> { | 9514 | pub fn sr(self) -> Reg<regs::Sr, R> { |
| 7368 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | 9515 | unsafe { Reg::from_ptr(self.0.add(20usize)) } |
| 7369 | } | 9516 | } |
| 7370 | #[doc = "Request register"] | 9517 | #[doc = "Interrupt/Status Flags Clear Register"] |
| 7371 | pub fn rqr(self) -> Reg<regs::Rqr, W> { | 9518 | pub fn ifcr(self) -> Reg<regs::Ifcr, W> { |
| 7372 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | 9519 | unsafe { Reg::from_ptr(self.0.add(24usize)) } |
| 7373 | } | 9520 | } |
| 7374 | #[doc = "Interrupt & status register"] | 9521 | #[doc = "Transmit Data Register"] |
| 7375 | pub fn isr(self) -> Reg<regs::Ixr, R> { | 9522 | pub fn txdr(self) -> Reg<regs::Txdr, W> { |
| 7376 | unsafe { Reg::from_ptr(self.0.add(28usize)) } | ||
| 7377 | } | ||
| 7378 | #[doc = "Interrupt flag clear register"] | ||
| 7379 | pub fn icr(self) -> Reg<regs::Ixr, W> { | ||
| 7380 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | 9523 | unsafe { Reg::from_ptr(self.0.add(32usize)) } |
| 7381 | } | 9524 | } |
| 7382 | #[doc = "Receive data register"] | 9525 | #[doc = "Receive Data Register"] |
| 7383 | pub fn rdr(self) -> Reg<regs::Dr, R> { | 9526 | pub fn rxdr(self) -> Reg<regs::Rxdr, R> { |
| 7384 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | 9527 | unsafe { Reg::from_ptr(self.0.add(48usize)) } |
| 7385 | } | ||
| 7386 | #[doc = "Transmit data register"] | ||
| 7387 | pub fn tdr(self) -> Reg<regs::Dr, RW> { | ||
| 7388 | unsafe { Reg::from_ptr(self.0.add(40usize)) } | ||
| 7389 | } | ||
| 7390 | } | ||
| 7391 | pub mod vals { | ||
| 7392 | use crate::generic::*; | ||
| 7393 | #[repr(transparent)] | ||
| 7394 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7395 | pub struct Abrmod(pub u8); | ||
| 7396 | impl Abrmod { | ||
| 7397 | #[doc = "Measurement of the start bit is used to detect the baud rate"] | ||
| 7398 | pub const START: Self = Self(0); | ||
| 7399 | #[doc = "Falling edge to falling edge measurement"] | ||
| 7400 | pub const EDGE: Self = Self(0x01); | ||
| 7401 | #[doc = "0x7F frame detection"] | ||
| 7402 | pub const FRAME7F: Self = Self(0x02); | ||
| 7403 | #[doc = "0x55 frame detection"] | ||
| 7404 | pub const FRAME55: Self = Self(0x03); | ||
| 7405 | } | ||
| 7406 | #[repr(transparent)] | ||
| 7407 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7408 | pub struct Wake(pub u8); | ||
| 7409 | impl Wake { | ||
| 7410 | #[doc = "Idle line"] | ||
| 7411 | pub const IDLE: Self = Self(0); | ||
| 7412 | #[doc = "Address mask"] | ||
| 7413 | pub const ADDRESS: Self = Self(0x01); | ||
| 7414 | } | ||
| 7415 | #[repr(transparent)] | ||
| 7416 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7417 | pub struct Wus(pub u8); | ||
| 7418 | impl Wus { | ||
| 7419 | #[doc = "WUF active on address match"] | ||
| 7420 | pub const ADDRESS: Self = Self(0); | ||
| 7421 | #[doc = "WuF active on Start bit detection"] | ||
| 7422 | pub const START: Self = Self(0x02); | ||
| 7423 | #[doc = "WUF active on RXNE"] | ||
| 7424 | pub const RXNE: Self = Self(0x03); | ||
| 7425 | } | ||
| 7426 | #[repr(transparent)] | ||
| 7427 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7428 | pub struct Rxfrq(pub u8); | ||
| 7429 | impl Rxfrq { | ||
| 7430 | #[doc = "clears the RXNE flag. This allows to discard the received data without reading it, and avoid an overrun condition"] | ||
| 7431 | pub const DISCARD: Self = Self(0x01); | ||
| 7432 | } | ||
| 7433 | #[repr(transparent)] | ||
| 7434 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7435 | pub struct Lbdl(pub u8); | ||
| 7436 | impl Lbdl { | ||
| 7437 | #[doc = "10-bit break detection"] | ||
| 7438 | pub const BIT10: Self = Self(0); | ||
| 7439 | #[doc = "11-bit break detection"] | ||
| 7440 | pub const BIT11: Self = Self(0x01); | ||
| 7441 | } | ||
| 7442 | #[repr(transparent)] | ||
| 7443 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7444 | pub struct Sbkrq(pub u8); | ||
| 7445 | impl Sbkrq { | ||
| 7446 | #[doc = "sets the SBKF flag and request to send a BREAK on the line, as soon as the transmit machine is available"] | ||
| 7447 | pub const BREAK: Self = Self(0x01); | ||
| 7448 | } | ||
| 7449 | #[repr(transparent)] | ||
| 7450 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7451 | pub struct Cpha(pub u8); | ||
| 7452 | impl Cpha { | ||
| 7453 | #[doc = "The first clock transition is the first data capture edge"] | ||
| 7454 | pub const FIRST: Self = Self(0); | ||
| 7455 | #[doc = "The second clock transition is the first data capture edge"] | ||
| 7456 | pub const SECOND: Self = Self(0x01); | ||
| 7457 | } | ||
| 7458 | #[repr(transparent)] | ||
| 7459 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7460 | pub struct Onebit(pub u8); | ||
| 7461 | impl Onebit { | ||
| 7462 | #[doc = "Three sample bit method"] | ||
| 7463 | pub const SAMPLE3: Self = Self(0); | ||
| 7464 | #[doc = "One sample bit method"] | ||
| 7465 | pub const SAMPLE1: Self = Self(0x01); | ||
| 7466 | } | ||
| 7467 | #[repr(transparent)] | ||
| 7468 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7469 | pub struct Datainv(pub u8); | ||
| 7470 | impl Datainv { | ||
| 7471 | #[doc = "Logical data from the data register are send/received in positive/direct logic"] | ||
| 7472 | pub const POSITIVE: Self = Self(0); | ||
| 7473 | #[doc = "Logical data from the data register are send/received in negative/inverse logic"] | ||
| 7474 | pub const NEGATIVE: Self = Self(0x01); | ||
| 7475 | } | ||
| 7476 | #[repr(transparent)] | ||
| 7477 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7478 | pub struct Rxinv(pub u8); | ||
| 7479 | impl Rxinv { | ||
| 7480 | #[doc = "RX pin signal works using the standard logic levels"] | ||
| 7481 | pub const STANDARD: Self = Self(0); | ||
| 7482 | #[doc = "RX pin signal values are inverted"] | ||
| 7483 | pub const INVERTED: Self = Self(0x01); | ||
| 7484 | } | ||
| 7485 | #[repr(transparent)] | ||
| 7486 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7487 | pub struct Over(pub u8); | ||
| 7488 | impl Over { | ||
| 7489 | #[doc = "Oversampling by 16"] | ||
| 7490 | pub const OVERSAMPLING16: Self = Self(0); | ||
| 7491 | #[doc = "Oversampling by 8"] | ||
| 7492 | pub const OVERSAMPLING8: Self = Self(0x01); | ||
| 7493 | } | ||
| 7494 | #[repr(transparent)] | ||
| 7495 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7496 | pub struct Stop(pub u8); | ||
| 7497 | impl Stop { | ||
| 7498 | #[doc = "1 stop bit"] | ||
| 7499 | pub const STOP1: Self = Self(0); | ||
| 7500 | #[doc = "0.5 stop bit"] | ||
| 7501 | pub const STOP0P5: Self = Self(0x01); | ||
| 7502 | #[doc = "2 stop bit"] | ||
| 7503 | pub const STOP2: Self = Self(0x02); | ||
| 7504 | #[doc = "1.5 stop bit"] | ||
| 7505 | pub const STOP1P5: Self = Self(0x03); | ||
| 7506 | } | ||
| 7507 | #[repr(transparent)] | ||
| 7508 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7509 | pub struct Txinv(pub u8); | ||
| 7510 | impl Txinv { | ||
| 7511 | #[doc = "TX pin signal works using the standard logic levels"] | ||
| 7512 | pub const STANDARD: Self = Self(0); | ||
| 7513 | #[doc = "TX pin signal values are inverted"] | ||
| 7514 | pub const INVERTED: Self = Self(0x01); | ||
| 7515 | } | ||
| 7516 | #[repr(transparent)] | ||
| 7517 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7518 | pub struct Addm(pub u8); | ||
| 7519 | impl Addm { | ||
| 7520 | #[doc = "4-bit address detection"] | ||
| 7521 | pub const BIT4: Self = Self(0); | ||
| 7522 | #[doc = "7-bit address detection"] | ||
| 7523 | pub const BIT7: Self = Self(0x01); | ||
| 7524 | } | ||
| 7525 | #[repr(transparent)] | ||
| 7526 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7527 | pub struct Ddre(pub u8); | ||
| 7528 | impl Ddre { | ||
| 7529 | #[doc = "DMA is not disabled in case of reception error"] | ||
| 7530 | pub const NOTDISABLED: Self = Self(0); | ||
| 7531 | #[doc = "DMA is disabled following a reception error"] | ||
| 7532 | pub const DISABLED: Self = Self(0x01); | ||
| 7533 | } | ||
| 7534 | #[repr(transparent)] | ||
| 7535 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7536 | pub struct Ovrdis(pub u8); | ||
| 7537 | impl Ovrdis { | ||
| 7538 | #[doc = "Overrun Error Flag, ORE, is set when received data is not read before receiving new data"] | ||
| 7539 | pub const ENABLED: Self = Self(0); | ||
| 7540 | #[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"] | ||
| 7541 | pub const DISABLED: Self = Self(0x01); | ||
| 7542 | } | ||
| 7543 | #[repr(transparent)] | ||
| 7544 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7545 | pub struct M0(pub u8); | ||
| 7546 | impl M0 { | ||
| 7547 | #[doc = "1 start bit, 8 data bits, n stop bits"] | ||
| 7548 | pub const BIT8: Self = Self(0); | ||
| 7549 | #[doc = "1 start bit, 9 data bits, n stop bits"] | ||
| 7550 | pub const BIT9: Self = Self(0x01); | ||
| 7551 | } | ||
| 7552 | #[repr(transparent)] | ||
| 7553 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7554 | pub struct Dep(pub u8); | ||
| 7555 | impl Dep { | ||
| 7556 | #[doc = "DE signal is active high"] | ||
| 7557 | pub const HIGH: Self = Self(0); | ||
| 7558 | #[doc = "DE signal is active low"] | ||
| 7559 | pub const LOW: Self = Self(0x01); | ||
| 7560 | } | ||
| 7561 | #[repr(transparent)] | ||
| 7562 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7563 | pub struct Irlp(pub u8); | ||
| 7564 | impl Irlp { | ||
| 7565 | #[doc = "Normal mode"] | ||
| 7566 | pub const NORMAL: Self = Self(0); | ||
| 7567 | #[doc = "Low-power mode"] | ||
| 7568 | pub const LOWPOWER: Self = Self(0x01); | ||
| 7569 | } | ||
| 7570 | #[repr(transparent)] | ||
| 7571 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7572 | pub struct Hdsel(pub u8); | ||
| 7573 | impl Hdsel { | ||
| 7574 | #[doc = "Half duplex mode is not selected"] | ||
| 7575 | pub const NOTSELECTED: Self = Self(0); | ||
| 7576 | #[doc = "Half duplex mode is selected"] | ||
| 7577 | pub const SELECTED: Self = Self(0x01); | ||
| 7578 | } | ||
| 7579 | #[repr(transparent)] | ||
| 7580 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7581 | pub struct Msbfirst(pub u8); | ||
| 7582 | impl Msbfirst { | ||
| 7583 | #[doc = "data is transmitted/received with data bit 0 first, following the start bit"] | ||
| 7584 | pub const LSB: Self = Self(0); | ||
| 7585 | #[doc = "data is transmitted/received with MSB (bit 7/8/9) first, following the start bit"] | ||
| 7586 | pub const MSB: Self = Self(0x01); | ||
| 7587 | } | ||
| 7588 | #[repr(transparent)] | ||
| 7589 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7590 | pub struct Txfrq(pub u8); | ||
| 7591 | impl Txfrq { | ||
| 7592 | #[doc = "Set the TXE flags. This allows to discard the transmit data"] | ||
| 7593 | pub const DISCARD: Self = Self(0x01); | ||
| 7594 | } | ||
| 7595 | #[repr(transparent)] | ||
| 7596 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7597 | pub struct Ps(pub u8); | ||
| 7598 | impl Ps { | ||
| 7599 | #[doc = "Even parity"] | ||
| 7600 | pub const EVEN: Self = Self(0); | ||
| 7601 | #[doc = "Odd parity"] | ||
| 7602 | pub const ODD: Self = Self(0x01); | ||
| 7603 | } | ||
| 7604 | #[repr(transparent)] | ||
| 7605 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7606 | pub struct M1(pub u8); | ||
| 7607 | impl M1 { | ||
| 7608 | #[doc = "Use M0 to set the data bits"] | ||
| 7609 | pub const M0: Self = Self(0); | ||
| 7610 | #[doc = "1 start bit, 7 data bits, n stop bits"] | ||
| 7611 | pub const BIT7: Self = Self(0x01); | ||
| 7612 | } | ||
| 7613 | #[repr(transparent)] | ||
| 7614 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 7615 | pub struct Lbcl(pub u8); | ||
| 7616 | impl Lbcl { | ||
| 7617 | #[doc = "The clock pulse of the last data bit is not output to the CK pin"] | ||
| 7618 | pub const NOTOUTPUT: Self = Self(0); | ||
| 7619 | #[doc = "The clock pulse of the last data bit is output to the CK pin"] | ||
| 7620 | pub const OUTPUT: Self = Self(0x01); | ||
| 7621 | } | 9528 | } |
| 7622 | #[repr(transparent)] | 9529 | #[doc = "Polynomial Register"] |
| 7623 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 9530 | pub fn crcpoly(self) -> Reg<regs::Crcpoly, RW> { |
| 7624 | pub struct Cpol(pub u8); | 9531 | unsafe { Reg::from_ptr(self.0.add(64usize)) } |
| 7625 | impl Cpol { | ||
| 7626 | #[doc = "Steady low value on CK pin outside transmission window"] | ||
| 7627 | pub const LOW: Self = Self(0); | ||
| 7628 | #[doc = "Steady high value on CK pin outside transmission window"] | ||
| 7629 | pub const HIGH: Self = Self(0x01); | ||
| 7630 | } | 9532 | } |
| 7631 | #[repr(transparent)] | 9533 | #[doc = "Transmitter CRC Register"] |
| 7632 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 9534 | pub fn txcrc(self) -> Reg<regs::Txcrc, RW> { |
| 7633 | pub struct Swap(pub u8); | 9535 | unsafe { Reg::from_ptr(self.0.add(68usize)) } |
| 7634 | impl Swap { | ||
| 7635 | #[doc = "TX/RX pins are used as defined in standard pinout"] | ||
| 7636 | pub const STANDARD: Self = Self(0); | ||
| 7637 | #[doc = "The TX and RX pins functions are swapped"] | ||
| 7638 | pub const SWAPPED: Self = Self(0x01); | ||
| 7639 | } | 9536 | } |
| 7640 | #[repr(transparent)] | 9537 | #[doc = "Receiver CRC Register"] |
| 7641 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 9538 | pub fn rxcrc(self) -> Reg<regs::Rxcrc, RW> { |
| 7642 | pub struct Abrrq(pub u8); | 9539 | unsafe { Reg::from_ptr(self.0.add(72usize)) } |
| 7643 | impl Abrrq { | ||
| 7644 | #[doc = "resets the ABRF flag in the USART_ISR and request an automatic baud rate measurement on the next received data frame"] | ||
| 7645 | pub const REQUEST: Self = Self(0x01); | ||
| 7646 | } | 9540 | } |
| 7647 | #[repr(transparent)] | 9541 | #[doc = "Underrun Data Register"] |
| 7648 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 9542 | pub fn udrdr(self) -> Reg<regs::Udrdr, RW> { |
| 7649 | pub struct Mmrq(pub u8); | 9543 | unsafe { Reg::from_ptr(self.0.add(76usize)) } |
| 7650 | impl Mmrq { | ||
| 7651 | #[doc = "Puts the USART in mute mode and sets the RWU flag"] | ||
| 7652 | pub const MUTE: Self = Self(0x01); | ||
| 7653 | } | 9544 | } |
| 7654 | } | 9545 | } |
| 7655 | pub mod regs { | 9546 | pub mod regs { |
| 7656 | use crate::generic::*; | 9547 | use crate::generic::*; |
| 7657 | #[doc = "Request register"] | 9548 | #[doc = "Interrupt/Status Flags Clear Register"] |
| 7658 | #[repr(transparent)] | ||
| 7659 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 7660 | pub struct Rqr(pub u32); | ||
| 7661 | impl Rqr { | ||
| 7662 | #[doc = "Auto baud rate request"] | ||
| 7663 | pub const fn abrrq(&self) -> super::vals::Abrrq { | ||
| 7664 | let val = (self.0 >> 0usize) & 0x01; | ||
| 7665 | super::vals::Abrrq(val as u8) | ||
| 7666 | } | ||
| 7667 | #[doc = "Auto baud rate request"] | ||
| 7668 | pub fn set_abrrq(&mut self, val: super::vals::Abrrq) { | ||
| 7669 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 7670 | } | ||
| 7671 | #[doc = "Send break request"] | ||
| 7672 | pub const fn sbkrq(&self) -> super::vals::Sbkrq { | ||
| 7673 | let val = (self.0 >> 1usize) & 0x01; | ||
| 7674 | super::vals::Sbkrq(val as u8) | ||
| 7675 | } | ||
| 7676 | #[doc = "Send break request"] | ||
| 7677 | pub fn set_sbkrq(&mut self, val: super::vals::Sbkrq) { | ||
| 7678 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 7679 | } | ||
| 7680 | #[doc = "Mute mode request"] | ||
| 7681 | pub const fn mmrq(&self) -> super::vals::Mmrq { | ||
| 7682 | let val = (self.0 >> 2usize) & 0x01; | ||
| 7683 | super::vals::Mmrq(val as u8) | ||
| 7684 | } | ||
| 7685 | #[doc = "Mute mode request"] | ||
| 7686 | pub fn set_mmrq(&mut self, val: super::vals::Mmrq) { | ||
| 7687 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 7688 | } | ||
| 7689 | #[doc = "Receive data flush request"] | ||
| 7690 | pub const fn rxfrq(&self) -> super::vals::Rxfrq { | ||
| 7691 | let val = (self.0 >> 3usize) & 0x01; | ||
| 7692 | super::vals::Rxfrq(val as u8) | ||
| 7693 | } | ||
| 7694 | #[doc = "Receive data flush request"] | ||
| 7695 | pub fn set_rxfrq(&mut self, val: super::vals::Rxfrq) { | ||
| 7696 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 7697 | } | ||
| 7698 | #[doc = "Transmit data flush request"] | ||
| 7699 | pub const fn txfrq(&self) -> super::vals::Txfrq { | ||
| 7700 | let val = (self.0 >> 4usize) & 0x01; | ||
| 7701 | super::vals::Txfrq(val as u8) | ||
| 7702 | } | ||
| 7703 | #[doc = "Transmit data flush request"] | ||
| 7704 | pub fn set_txfrq(&mut self, val: super::vals::Txfrq) { | ||
| 7705 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 7706 | } | ||
| 7707 | } | ||
| 7708 | impl Default for Rqr { | ||
| 7709 | fn default() -> Rqr { | ||
| 7710 | Rqr(0) | ||
| 7711 | } | ||
| 7712 | } | ||
| 7713 | #[doc = "Receiver timeout register"] | ||
| 7714 | #[repr(transparent)] | ||
| 7715 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 7716 | pub struct Rtor(pub u32); | ||
| 7717 | impl Rtor { | ||
| 7718 | #[doc = "Receiver timeout value"] | ||
| 7719 | pub const fn rto(&self) -> u32 { | ||
| 7720 | let val = (self.0 >> 0usize) & 0x00ff_ffff; | ||
| 7721 | val as u32 | ||
| 7722 | } | ||
| 7723 | #[doc = "Receiver timeout value"] | ||
| 7724 | pub fn set_rto(&mut self, val: u32) { | ||
| 7725 | self.0 = | ||
| 7726 | (self.0 & !(0x00ff_ffff << 0usize)) | (((val as u32) & 0x00ff_ffff) << 0usize); | ||
| 7727 | } | ||
| 7728 | #[doc = "Block Length"] | ||
| 7729 | pub const fn blen(&self) -> u8 { | ||
| 7730 | let val = (self.0 >> 24usize) & 0xff; | ||
| 7731 | val as u8 | ||
| 7732 | } | ||
| 7733 | #[doc = "Block Length"] | ||
| 7734 | pub fn set_blen(&mut self, val: u8) { | ||
| 7735 | self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize); | ||
| 7736 | } | ||
| 7737 | } | ||
| 7738 | impl Default for Rtor { | ||
| 7739 | fn default() -> Rtor { | ||
| 7740 | Rtor(0) | ||
| 7741 | } | ||
| 7742 | } | ||
| 7743 | #[doc = "Control register 1"] | ||
| 7744 | #[repr(transparent)] | 9549 | #[repr(transparent)] |
| 7745 | #[derive(Copy, Clone, Eq, PartialEq)] | 9550 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 7746 | pub struct Cr1(pub u32); | 9551 | pub struct Ifcr(pub u32); |
| 7747 | impl Cr1 { | 9552 | impl Ifcr { |
| 7748 | #[doc = "USART enable"] | 9553 | #[doc = "End Of Transfer flag clear"] |
| 7749 | pub const fn ue(&self) -> bool { | 9554 | pub const fn eotc(&self) -> bool { |
| 7750 | let val = (self.0 >> 0usize) & 0x01; | ||
| 7751 | val != 0 | ||
| 7752 | } | ||
| 7753 | #[doc = "USART enable"] | ||
| 7754 | pub fn set_ue(&mut self, val: bool) { | ||
| 7755 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 7756 | } | ||
| 7757 | #[doc = "USART enable in Stop mode"] | ||
| 7758 | pub const fn uesm(&self) -> bool { | ||
| 7759 | let val = (self.0 >> 1usize) & 0x01; | ||
| 7760 | val != 0 | ||
| 7761 | } | ||
| 7762 | #[doc = "USART enable in Stop mode"] | ||
| 7763 | pub fn set_uesm(&mut self, val: bool) { | ||
| 7764 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | ||
| 7765 | } | ||
| 7766 | #[doc = "Receiver enable"] | ||
| 7767 | pub const fn re(&self) -> bool { | ||
| 7768 | let val = (self.0 >> 2usize) & 0x01; | ||
| 7769 | val != 0 | ||
| 7770 | } | ||
| 7771 | #[doc = "Receiver enable"] | ||
| 7772 | pub fn set_re(&mut self, val: bool) { | ||
| 7773 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 7774 | } | ||
| 7775 | #[doc = "Transmitter enable"] | ||
| 7776 | pub const fn te(&self) -> bool { | ||
| 7777 | let val = (self.0 >> 3usize) & 0x01; | 9555 | let val = (self.0 >> 3usize) & 0x01; |
| 7778 | val != 0 | 9556 | val != 0 |
| 7779 | } | 9557 | } |
| 7780 | #[doc = "Transmitter enable"] | 9558 | #[doc = "End Of Transfer flag clear"] |
| 7781 | pub fn set_te(&mut self, val: bool) { | 9559 | pub fn set_eotc(&mut self, val: bool) { |
| 7782 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 9560 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); |
| 7783 | } | 9561 | } |
| 7784 | #[doc = "IDLE interrupt enable"] | 9562 | #[doc = "Transmission Transfer Filled flag clear"] |
| 7785 | pub const fn idleie(&self) -> bool { | 9563 | pub const fn txtfc(&self) -> bool { |
| 7786 | let val = (self.0 >> 4usize) & 0x01; | 9564 | let val = (self.0 >> 4usize) & 0x01; |
| 7787 | val != 0 | 9565 | val != 0 |
| 7788 | } | 9566 | } |
| 7789 | #[doc = "IDLE interrupt enable"] | 9567 | #[doc = "Transmission Transfer Filled flag clear"] |
| 7790 | pub fn set_idleie(&mut self, val: bool) { | 9568 | pub fn set_txtfc(&mut self, val: bool) { |
| 7791 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 9569 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 7792 | } | 9570 | } |
| 7793 | #[doc = "RXNE interrupt enable"] | 9571 | #[doc = "Underrun flag clear"] |
| 7794 | pub const fn rxneie(&self) -> bool { | 9572 | pub const fn udrc(&self) -> bool { |
| 7795 | let val = (self.0 >> 5usize) & 0x01; | 9573 | let val = (self.0 >> 5usize) & 0x01; |
| 7796 | val != 0 | 9574 | val != 0 |
| 7797 | } | 9575 | } |
| 7798 | #[doc = "RXNE interrupt enable"] | 9576 | #[doc = "Underrun flag clear"] |
| 7799 | pub fn set_rxneie(&mut self, val: bool) { | 9577 | pub fn set_udrc(&mut self, val: bool) { |
| 7800 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 9578 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 7801 | } | 9579 | } |
| 7802 | #[doc = "Transmission complete interrupt enable"] | 9580 | #[doc = "Overrun flag clear"] |
| 7803 | pub const fn tcie(&self) -> bool { | 9581 | pub const fn ovrc(&self) -> bool { |
| 7804 | let val = (self.0 >> 6usize) & 0x01; | 9582 | let val = (self.0 >> 6usize) & 0x01; |
| 7805 | val != 0 | 9583 | val != 0 |
| 7806 | } | 9584 | } |
| 7807 | #[doc = "Transmission complete interrupt enable"] | 9585 | #[doc = "Overrun flag clear"] |
| 7808 | pub fn set_tcie(&mut self, val: bool) { | 9586 | pub fn set_ovrc(&mut self, val: bool) { |
| 7809 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 9587 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 7810 | } | 9588 | } |
| 7811 | #[doc = "interrupt enable"] | 9589 | #[doc = "CRC Error flag clear"] |
| 7812 | pub const fn txeie(&self) -> bool { | 9590 | pub const fn crcec(&self) -> bool { |
| 7813 | let val = (self.0 >> 7usize) & 0x01; | 9591 | let val = (self.0 >> 7usize) & 0x01; |
| 7814 | val != 0 | 9592 | val != 0 |
| 7815 | } | 9593 | } |
| 7816 | #[doc = "interrupt enable"] | 9594 | #[doc = "CRC Error flag clear"] |
| 7817 | pub fn set_txeie(&mut self, val: bool) { | 9595 | pub fn set_crcec(&mut self, val: bool) { |
| 7818 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 9596 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 7819 | } | 9597 | } |
| 7820 | #[doc = "PE interrupt enable"] | 9598 | #[doc = "TI frame format error flag clear"] |
| 7821 | pub const fn peie(&self) -> bool { | 9599 | pub const fn tifrec(&self) -> bool { |
| 7822 | let val = (self.0 >> 8usize) & 0x01; | 9600 | let val = (self.0 >> 8usize) & 0x01; |
| 7823 | val != 0 | 9601 | val != 0 |
| 7824 | } | 9602 | } |
| 7825 | #[doc = "PE interrupt enable"] | 9603 | #[doc = "TI frame format error flag clear"] |
| 7826 | pub fn set_peie(&mut self, val: bool) { | 9604 | pub fn set_tifrec(&mut self, val: bool) { |
| 7827 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 9605 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 7828 | } | 9606 | } |
| 7829 | #[doc = "Parity selection"] | 9607 | #[doc = "Mode Fault flag clear"] |
| 7830 | pub const fn ps(&self) -> super::vals::Ps { | 9608 | pub const fn modfc(&self) -> bool { |
| 7831 | let val = (self.0 >> 9usize) & 0x01; | 9609 | let val = (self.0 >> 9usize) & 0x01; |
| 7832 | super::vals::Ps(val as u8) | 9610 | val != 0 |
| 7833 | } | 9611 | } |
| 7834 | #[doc = "Parity selection"] | 9612 | #[doc = "Mode Fault flag clear"] |
| 7835 | pub fn set_ps(&mut self, val: super::vals::Ps) { | 9613 | pub fn set_modfc(&mut self, val: bool) { |
| 7836 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | 9614 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); |
| 7837 | } | 9615 | } |
| 7838 | #[doc = "Parity control enable"] | 9616 | #[doc = "TSERFC flag clear"] |
| 7839 | pub const fn pce(&self) -> bool { | 9617 | pub const fn tserfc(&self) -> bool { |
| 7840 | let val = (self.0 >> 10usize) & 0x01; | 9618 | let val = (self.0 >> 10usize) & 0x01; |
| 7841 | val != 0 | 9619 | val != 0 |
| 7842 | } | 9620 | } |
| 7843 | #[doc = "Parity control enable"] | 9621 | #[doc = "TSERFC flag clear"] |
| 7844 | pub fn set_pce(&mut self, val: bool) { | 9622 | pub fn set_tserfc(&mut self, val: bool) { |
| 7845 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | 9623 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); |
| 7846 | } | 9624 | } |
| 7847 | #[doc = "Receiver wakeup method"] | 9625 | #[doc = "SUSPend flag clear"] |
| 7848 | pub const fn wake(&self) -> bool { | 9626 | pub const fn suspc(&self) -> bool { |
| 7849 | let val = (self.0 >> 11usize) & 0x01; | 9627 | let val = (self.0 >> 11usize) & 0x01; |
| 7850 | val != 0 | 9628 | val != 0 |
| 7851 | } | 9629 | } |
| 7852 | #[doc = "Receiver wakeup method"] | 9630 | #[doc = "SUSPend flag clear"] |
| 7853 | pub fn set_wake(&mut self, val: bool) { | 9631 | pub fn set_suspc(&mut self, val: bool) { |
| 7854 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); | 9632 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); |
| 7855 | } | 9633 | } |
| 7856 | #[doc = "Word length"] | 9634 | } |
| 7857 | pub const fn m0(&self) -> super::vals::M0 { | 9635 | impl Default for Ifcr { |
| 7858 | let val = (self.0 >> 12usize) & 0x01; | 9636 | fn default() -> Ifcr { |
| 7859 | super::vals::M0(val as u8) | 9637 | Ifcr(0) |
| 7860 | } | ||
| 7861 | #[doc = "Word length"] | ||
| 7862 | pub fn set_m0(&mut self, val: super::vals::M0) { | ||
| 7863 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 7864 | } | ||
| 7865 | #[doc = "Word length"] | ||
| 7866 | pub const fn m1(&self) -> super::vals::M1 { | ||
| 7867 | let val = (self.0 >> 12usize) & 0x01; | ||
| 7868 | super::vals::M1(val as u8) | ||
| 7869 | } | ||
| 7870 | #[doc = "Word length"] | ||
| 7871 | pub fn set_m1(&mut self, val: super::vals::M1) { | ||
| 7872 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 7873 | } | ||
| 7874 | #[doc = "Mute mode enable"] | ||
| 7875 | pub const fn mme(&self) -> bool { | ||
| 7876 | let val = (self.0 >> 13usize) & 0x01; | ||
| 7877 | val != 0 | ||
| 7878 | } | ||
| 7879 | #[doc = "Mute mode enable"] | ||
| 7880 | pub fn set_mme(&mut self, val: bool) { | ||
| 7881 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | ||
| 7882 | } | ||
| 7883 | #[doc = "Character match interrupt enable"] | ||
| 7884 | pub const fn cmie(&self) -> bool { | ||
| 7885 | let val = (self.0 >> 14usize) & 0x01; | ||
| 7886 | val != 0 | ||
| 7887 | } | 9638 | } |
| 7888 | #[doc = "Character match interrupt enable"] | 9639 | } |
| 7889 | pub fn set_cmie(&mut self, val: bool) { | 9640 | #[doc = "Underrun Data Register"] |
| 7890 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | 9641 | #[repr(transparent)] |
| 9642 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 9643 | pub struct Udrdr(pub u32); | ||
| 9644 | impl Udrdr { | ||
| 9645 | #[doc = "Data at slave underrun condition"] | ||
| 9646 | pub const fn udrdr(&self) -> u32 { | ||
| 9647 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 9648 | val as u32 | ||
| 7891 | } | 9649 | } |
| 7892 | #[doc = "Oversampling mode"] | 9650 | #[doc = "Data at slave underrun condition"] |
| 7893 | pub fn over(&self, n: usize) -> super::vals::Over { | 9651 | pub fn set_udrdr(&mut self, val: u32) { |
| 7894 | assert!(n < 1usize); | 9652 | self.0 = |
| 7895 | let offs = 15usize + n * 0usize; | 9653 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); |
| 7896 | let val = (self.0 >> offs) & 0x01; | ||
| 7897 | super::vals::Over(val as u8) | ||
| 7898 | } | 9654 | } |
| 7899 | #[doc = "Oversampling mode"] | 9655 | } |
| 7900 | pub fn set_over(&mut self, n: usize, val: super::vals::Over) { | 9656 | impl Default for Udrdr { |
| 7901 | assert!(n < 1usize); | 9657 | fn default() -> Udrdr { |
| 7902 | let offs = 15usize + n * 0usize; | 9658 | Udrdr(0) |
| 7903 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 7904 | } | 9659 | } |
| 7905 | #[doc = "Driver Enable deassertion time"] | 9660 | } |
| 7906 | pub const fn dedt(&self) -> u8 { | 9661 | #[doc = "Receiver CRC Register"] |
| 7907 | let val = (self.0 >> 16usize) & 0x1f; | 9662 | #[repr(transparent)] |
| 7908 | val as u8 | 9663 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9664 | pub struct Rxcrc(pub u32); | ||
| 9665 | impl Rxcrc { | ||
| 9666 | #[doc = "CRC register for receiver"] | ||
| 9667 | pub const fn rxcrc(&self) -> u32 { | ||
| 9668 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 9669 | val as u32 | ||
| 7909 | } | 9670 | } |
| 7910 | #[doc = "Driver Enable deassertion time"] | 9671 | #[doc = "CRC register for receiver"] |
| 7911 | pub fn set_dedt(&mut self, val: u8) { | 9672 | pub fn set_rxcrc(&mut self, val: u32) { |
| 7912 | self.0 = (self.0 & !(0x1f << 16usize)) | (((val as u32) & 0x1f) << 16usize); | 9673 | self.0 = |
| 9674 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 7913 | } | 9675 | } |
| 7914 | #[doc = "Driver Enable assertion time"] | 9676 | } |
| 7915 | pub const fn deat(&self) -> u8 { | 9677 | impl Default for Rxcrc { |
| 7916 | let val = (self.0 >> 21usize) & 0x1f; | 9678 | fn default() -> Rxcrc { |
| 7917 | val as u8 | 9679 | Rxcrc(0) |
| 7918 | } | 9680 | } |
| 7919 | #[doc = "Driver Enable assertion time"] | 9681 | } |
| 7920 | pub fn set_deat(&mut self, val: u8) { | 9682 | #[doc = "Transmitter CRC Register"] |
| 7921 | self.0 = (self.0 & !(0x1f << 21usize)) | (((val as u32) & 0x1f) << 21usize); | 9683 | #[repr(transparent)] |
| 9684 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 9685 | pub struct Txcrc(pub u32); | ||
| 9686 | impl Txcrc { | ||
| 9687 | #[doc = "CRC register for transmitter"] | ||
| 9688 | pub const fn txcrc(&self) -> u32 { | ||
| 9689 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 9690 | val as u32 | ||
| 7922 | } | 9691 | } |
| 7923 | #[doc = "Receiver timeout interrupt enable"] | 9692 | #[doc = "CRC register for transmitter"] |
| 7924 | pub const fn rtoie(&self) -> bool { | 9693 | pub fn set_txcrc(&mut self, val: u32) { |
| 7925 | let val = (self.0 >> 26usize) & 0x01; | 9694 | self.0 = |
| 7926 | val != 0 | 9695 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); |
| 7927 | } | 9696 | } |
| 7928 | #[doc = "Receiver timeout interrupt enable"] | 9697 | } |
| 7929 | pub fn set_rtoie(&mut self, val: bool) { | 9698 | impl Default for Txcrc { |
| 7930 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); | 9699 | fn default() -> Txcrc { |
| 9700 | Txcrc(0) | ||
| 7931 | } | 9701 | } |
| 7932 | #[doc = "End of Block interrupt enable"] | 9702 | } |
| 7933 | pub const fn eobie(&self) -> bool { | 9703 | #[doc = "Transmit Data Register"] |
| 7934 | let val = (self.0 >> 27usize) & 0x01; | 9704 | #[repr(transparent)] |
| 7935 | val != 0 | 9705 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9706 | pub struct Txdr(pub u32); | ||
| 9707 | impl Txdr { | ||
| 9708 | #[doc = "Transmit data register"] | ||
| 9709 | pub const fn txdr(&self) -> u32 { | ||
| 9710 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 9711 | val as u32 | ||
| 7936 | } | 9712 | } |
| 7937 | #[doc = "End of Block interrupt enable"] | 9713 | #[doc = "Transmit data register"] |
| 7938 | pub fn set_eobie(&mut self, val: bool) { | 9714 | pub fn set_txdr(&mut self, val: u32) { |
| 7939 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize); | 9715 | self.0 = |
| 9716 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 7940 | } | 9717 | } |
| 7941 | } | 9718 | } |
| 7942 | impl Default for Cr1 { | 9719 | impl Default for Txdr { |
| 7943 | fn default() -> Cr1 { | 9720 | fn default() -> Txdr { |
| 7944 | Cr1(0) | 9721 | Txdr(0) |
| 7945 | } | 9722 | } |
| 7946 | } | 9723 | } |
| 7947 | #[doc = "Control register 3"] | 9724 | #[doc = "Interrupt Enable Register"] |
| 7948 | #[repr(transparent)] | 9725 | #[repr(transparent)] |
| 7949 | #[derive(Copy, Clone, Eq, PartialEq)] | 9726 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 7950 | pub struct Cr3(pub u32); | 9727 | pub struct Ier(pub u32); |
| 7951 | impl Cr3 { | 9728 | impl Ier { |
| 7952 | #[doc = "Error interrupt enable"] | 9729 | #[doc = "RXP Interrupt Enable"] |
| 7953 | pub const fn eie(&self) -> bool { | 9730 | pub const fn rxpie(&self) -> bool { |
| 7954 | let val = (self.0 >> 0usize) & 0x01; | 9731 | let val = (self.0 >> 0usize) & 0x01; |
| 7955 | val != 0 | 9732 | val != 0 |
| 7956 | } | 9733 | } |
| 7957 | #[doc = "Error interrupt enable"] | 9734 | #[doc = "RXP Interrupt Enable"] |
| 7958 | pub fn set_eie(&mut self, val: bool) { | 9735 | pub fn set_rxpie(&mut self, val: bool) { |
| 7959 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 9736 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 7960 | } | 9737 | } |
| 7961 | #[doc = "IrDA mode enable"] | 9738 | #[doc = "TXP interrupt enable"] |
| 7962 | pub const fn iren(&self) -> bool { | 9739 | pub const fn txpie(&self) -> bool { |
| 7963 | let val = (self.0 >> 1usize) & 0x01; | 9740 | let val = (self.0 >> 1usize) & 0x01; |
| 7964 | val != 0 | 9741 | val != 0 |
| 7965 | } | 9742 | } |
| 7966 | #[doc = "IrDA mode enable"] | 9743 | #[doc = "TXP interrupt enable"] |
| 7967 | pub fn set_iren(&mut self, val: bool) { | 9744 | pub fn set_txpie(&mut self, val: bool) { |
| 7968 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 9745 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 7969 | } | 9746 | } |
| 7970 | #[doc = "IrDA low-power"] | 9747 | #[doc = "DXP interrupt enabled"] |
| 7971 | pub const fn irlp(&self) -> super::vals::Irlp { | 9748 | pub const fn dxpie(&self) -> bool { |
| 7972 | let val = (self.0 >> 2usize) & 0x01; | 9749 | let val = (self.0 >> 2usize) & 0x01; |
| 7973 | super::vals::Irlp(val as u8) | 9750 | val != 0 |
| 7974 | } | 9751 | } |
| 7975 | #[doc = "IrDA low-power"] | 9752 | #[doc = "DXP interrupt enabled"] |
| 7976 | pub fn set_irlp(&mut self, val: super::vals::Irlp) { | 9753 | pub fn set_dxpie(&mut self, val: bool) { |
| 7977 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | 9754 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 7978 | } | 9755 | } |
| 7979 | #[doc = "Half-duplex selection"] | 9756 | #[doc = "EOT, SUSP and TXC interrupt enable"] |
| 7980 | pub const fn hdsel(&self) -> super::vals::Hdsel { | 9757 | pub const fn eotie(&self) -> bool { |
| 7981 | let val = (self.0 >> 3usize) & 0x01; | 9758 | let val = (self.0 >> 3usize) & 0x01; |
| 7982 | super::vals::Hdsel(val as u8) | 9759 | val != 0 |
| 7983 | } | 9760 | } |
| 7984 | #[doc = "Half-duplex selection"] | 9761 | #[doc = "EOT, SUSP and TXC interrupt enable"] |
| 7985 | pub fn set_hdsel(&mut self, val: super::vals::Hdsel) { | 9762 | pub fn set_eotie(&mut self, val: bool) { |
| 7986 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | 9763 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); |
| 7987 | } | 9764 | } |
| 7988 | #[doc = "Smartcard NACK enable"] | 9765 | #[doc = "TXTFIE interrupt enable"] |
| 7989 | pub const fn nack(&self) -> bool { | 9766 | pub const fn txtfie(&self) -> bool { |
| 7990 | let val = (self.0 >> 4usize) & 0x01; | 9767 | let val = (self.0 >> 4usize) & 0x01; |
| 7991 | val != 0 | 9768 | val != 0 |
| 7992 | } | 9769 | } |
| 7993 | #[doc = "Smartcard NACK enable"] | 9770 | #[doc = "TXTFIE interrupt enable"] |
| 7994 | pub fn set_nack(&mut self, val: bool) { | 9771 | pub fn set_txtfie(&mut self, val: bool) { |
| 7995 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 9772 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 7996 | } | 9773 | } |
| 7997 | #[doc = "Smartcard mode enable"] | 9774 | #[doc = "UDR interrupt enable"] |
| 7998 | pub const fn scen(&self) -> bool { | 9775 | pub const fn udrie(&self) -> bool { |
| 7999 | let val = (self.0 >> 5usize) & 0x01; | 9776 | let val = (self.0 >> 5usize) & 0x01; |
| 8000 | val != 0 | 9777 | val != 0 |
| 8001 | } | 9778 | } |
| 8002 | #[doc = "Smartcard mode enable"] | 9779 | #[doc = "UDR interrupt enable"] |
| 8003 | pub fn set_scen(&mut self, val: bool) { | 9780 | pub fn set_udrie(&mut self, val: bool) { |
| 8004 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 9781 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 8005 | } | 9782 | } |
| 8006 | #[doc = "DMA enable receiver"] | 9783 | #[doc = "OVR interrupt enable"] |
| 8007 | pub const fn dmar(&self) -> bool { | 9784 | pub const fn ovrie(&self) -> bool { |
| 8008 | let val = (self.0 >> 6usize) & 0x01; | 9785 | let val = (self.0 >> 6usize) & 0x01; |
| 8009 | val != 0 | 9786 | val != 0 |
| 8010 | } | 9787 | } |
| 8011 | #[doc = "DMA enable receiver"] | 9788 | #[doc = "OVR interrupt enable"] |
| 8012 | pub fn set_dmar(&mut self, val: bool) { | 9789 | pub fn set_ovrie(&mut self, val: bool) { |
| 8013 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 9790 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 8014 | } | 9791 | } |
| 8015 | #[doc = "DMA enable transmitter"] | 9792 | #[doc = "CRC Interrupt enable"] |
| 8016 | pub const fn dmat(&self) -> bool { | 9793 | pub const fn crceie(&self) -> bool { |
| 8017 | let val = (self.0 >> 7usize) & 0x01; | 9794 | let val = (self.0 >> 7usize) & 0x01; |
| 8018 | val != 0 | 9795 | val != 0 |
| 8019 | } | 9796 | } |
| 8020 | #[doc = "DMA enable transmitter"] | 9797 | #[doc = "CRC Interrupt enable"] |
| 8021 | pub fn set_dmat(&mut self, val: bool) { | 9798 | pub fn set_crceie(&mut self, val: bool) { |
| 8022 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 9799 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 8023 | } | 9800 | } |
| 8024 | #[doc = "RTS enable"] | 9801 | #[doc = "TIFRE interrupt enable"] |
| 8025 | pub const fn rtse(&self) -> bool { | 9802 | pub const fn tifreie(&self) -> bool { |
| 8026 | let val = (self.0 >> 8usize) & 0x01; | 9803 | let val = (self.0 >> 8usize) & 0x01; |
| 8027 | val != 0 | 9804 | val != 0 |
| 8028 | } | 9805 | } |
| 8029 | #[doc = "RTS enable"] | 9806 | #[doc = "TIFRE interrupt enable"] |
| 8030 | pub fn set_rtse(&mut self, val: bool) { | 9807 | pub fn set_tifreie(&mut self, val: bool) { |
| 8031 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 9808 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 8032 | } | 9809 | } |
| 8033 | #[doc = "CTS enable"] | 9810 | #[doc = "Mode Fault interrupt enable"] |
| 8034 | pub const fn ctse(&self) -> bool { | 9811 | pub const fn modfie(&self) -> bool { |
| 8035 | let val = (self.0 >> 9usize) & 0x01; | 9812 | let val = (self.0 >> 9usize) & 0x01; |
| 8036 | val != 0 | 9813 | val != 0 |
| 8037 | } | 9814 | } |
| 8038 | #[doc = "CTS enable"] | 9815 | #[doc = "Mode Fault interrupt enable"] |
| 8039 | pub fn set_ctse(&mut self, val: bool) { | 9816 | pub fn set_modfie(&mut self, val: bool) { |
| 8040 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | 9817 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); |
| 8041 | } | 9818 | } |
| 8042 | #[doc = "CTS interrupt enable"] | 9819 | #[doc = "Additional number of transactions reload interrupt enable"] |
| 8043 | pub const fn ctsie(&self) -> bool { | 9820 | pub const fn tserfie(&self) -> bool { |
| 8044 | let val = (self.0 >> 10usize) & 0x01; | 9821 | let val = (self.0 >> 10usize) & 0x01; |
| 8045 | val != 0 | 9822 | val != 0 |
| 8046 | } | 9823 | } |
| 8047 | #[doc = "CTS interrupt enable"] | 9824 | #[doc = "Additional number of transactions reload interrupt enable"] |
| 8048 | pub fn set_ctsie(&mut self, val: bool) { | 9825 | pub fn set_tserfie(&mut self, val: bool) { |
| 8049 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | 9826 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); |
| 8050 | } | 9827 | } |
| 8051 | #[doc = "One sample bit method enable"] | 9828 | } |
| 8052 | pub const fn onebit(&self) -> super::vals::Onebit { | 9829 | impl Default for Ier { |
| 8053 | let val = (self.0 >> 11usize) & 0x01; | 9830 | fn default() -> Ier { |
| 8054 | super::vals::Onebit(val as u8) | 9831 | Ier(0) |
| 8055 | } | 9832 | } |
| 8056 | #[doc = "One sample bit method enable"] | 9833 | } |
| 8057 | pub fn set_onebit(&mut self, val: super::vals::Onebit) { | 9834 | #[doc = "control register 2"] |
| 8058 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); | 9835 | #[repr(transparent)] |
| 9836 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 9837 | pub struct Cr2(pub u32); | ||
| 9838 | impl Cr2 { | ||
| 9839 | #[doc = "Number of data at current transfer"] | ||
| 9840 | pub const fn tsize(&self) -> u16 { | ||
| 9841 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 9842 | val as u16 | ||
| 8059 | } | 9843 | } |
| 8060 | #[doc = "Overrun Disable"] | 9844 | #[doc = "Number of data at current transfer"] |
| 8061 | pub const fn ovrdis(&self) -> super::vals::Ovrdis { | 9845 | pub fn set_tsize(&mut self, val: u16) { |
| 8062 | let val = (self.0 >> 12usize) & 0x01; | 9846 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); |
| 8063 | super::vals::Ovrdis(val as u8) | ||
| 8064 | } | 9847 | } |
| 8065 | #[doc = "Overrun Disable"] | 9848 | #[doc = "Number of data transfer extension to be reload into TSIZE just when a previous"] |
| 8066 | pub fn set_ovrdis(&mut self, val: super::vals::Ovrdis) { | 9849 | pub const fn tser(&self) -> u16 { |
| 8067 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | 9850 | let val = (self.0 >> 16usize) & 0xffff; |
| 9851 | val as u16 | ||
| 8068 | } | 9852 | } |
| 8069 | #[doc = "DMA Disable on Reception Error"] | 9853 | #[doc = "Number of data transfer extension to be reload into TSIZE just when a previous"] |
| 8070 | pub const fn ddre(&self) -> bool { | 9854 | pub fn set_tser(&mut self, val: u16) { |
| 8071 | let val = (self.0 >> 13usize) & 0x01; | 9855 | self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize); |
| 8072 | val != 0 | ||
| 8073 | } | 9856 | } |
| 8074 | #[doc = "DMA Disable on Reception Error"] | 9857 | } |
| 8075 | pub fn set_ddre(&mut self, val: bool) { | 9858 | impl Default for Cr2 { |
| 8076 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | 9859 | fn default() -> Cr2 { |
| 9860 | Cr2(0) | ||
| 8077 | } | 9861 | } |
| 8078 | #[doc = "Driver enable mode"] | 9862 | } |
| 8079 | pub const fn dem(&self) -> bool { | 9863 | #[doc = "configuration register 2"] |
| 8080 | let val = (self.0 >> 14usize) & 0x01; | 9864 | #[repr(transparent)] |
| 8081 | val != 0 | 9865 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9866 | pub struct Cfg2(pub u32); | ||
| 9867 | impl Cfg2 { | ||
| 9868 | #[doc = "Master SS Idleness"] | ||
| 9869 | pub const fn mssi(&self) -> u8 { | ||
| 9870 | let val = (self.0 >> 0usize) & 0x0f; | ||
| 9871 | val as u8 | ||
| 8082 | } | 9872 | } |
| 8083 | #[doc = "Driver enable mode"] | 9873 | #[doc = "Master SS Idleness"] |
| 8084 | pub fn set_dem(&mut self, val: bool) { | 9874 | pub fn set_mssi(&mut self, val: u8) { |
| 8085 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | 9875 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); |
| 8086 | } | 9876 | } |
| 8087 | #[doc = "Driver enable polarity selection"] | 9877 | #[doc = "Master Inter-Data Idleness"] |
| 8088 | pub const fn dep(&self) -> super::vals::Dep { | 9878 | pub const fn midi(&self) -> u8 { |
| 9879 | let val = (self.0 >> 4usize) & 0x0f; | ||
| 9880 | val as u8 | ||
| 9881 | } | ||
| 9882 | #[doc = "Master Inter-Data Idleness"] | ||
| 9883 | pub fn set_midi(&mut self, val: u8) { | ||
| 9884 | self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize); | ||
| 9885 | } | ||
| 9886 | #[doc = "Swap functionality of MISO and MOSI pins"] | ||
| 9887 | pub const fn ioswp(&self) -> bool { | ||
| 8089 | let val = (self.0 >> 15usize) & 0x01; | 9888 | let val = (self.0 >> 15usize) & 0x01; |
| 8090 | super::vals::Dep(val as u8) | 9889 | val != 0 |
| 8091 | } | 9890 | } |
| 8092 | #[doc = "Driver enable polarity selection"] | 9891 | #[doc = "Swap functionality of MISO and MOSI pins"] |
| 8093 | pub fn set_dep(&mut self, val: super::vals::Dep) { | 9892 | pub fn set_ioswp(&mut self, val: bool) { |
| 8094 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | 9893 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); |
| 8095 | } | 9894 | } |
| 8096 | #[doc = "Smartcard auto-retry count"] | 9895 | #[doc = "SPI Communication Mode"] |
| 8097 | pub const fn scarcnt(&self) -> u8 { | 9896 | pub const fn comm(&self) -> super::vals::Comm { |
| 8098 | let val = (self.0 >> 17usize) & 0x07; | 9897 | let val = (self.0 >> 17usize) & 0x03; |
| 8099 | val as u8 | 9898 | super::vals::Comm(val as u8) |
| 8100 | } | 9899 | } |
| 8101 | #[doc = "Smartcard auto-retry count"] | 9900 | #[doc = "SPI Communication Mode"] |
| 8102 | pub fn set_scarcnt(&mut self, val: u8) { | 9901 | pub fn set_comm(&mut self, val: super::vals::Comm) { |
| 8103 | self.0 = (self.0 & !(0x07 << 17usize)) | (((val as u32) & 0x07) << 17usize); | 9902 | self.0 = (self.0 & !(0x03 << 17usize)) | (((val.0 as u32) & 0x03) << 17usize); |
| 8104 | } | 9903 | } |
| 8105 | #[doc = "Wakeup from Stop mode interrupt flag selection"] | 9904 | #[doc = "Serial Protocol"] |
| 8106 | pub const fn wus(&self) -> super::vals::Wus { | 9905 | pub const fn sp(&self) -> super::vals::Sp { |
| 8107 | let val = (self.0 >> 20usize) & 0x03; | 9906 | let val = (self.0 >> 19usize) & 0x07; |
| 8108 | super::vals::Wus(val as u8) | 9907 | super::vals::Sp(val as u8) |
| 8109 | } | 9908 | } |
| 8110 | #[doc = "Wakeup from Stop mode interrupt flag selection"] | 9909 | #[doc = "Serial Protocol"] |
| 8111 | pub fn set_wus(&mut self, val: super::vals::Wus) { | 9910 | pub fn set_sp(&mut self, val: super::vals::Sp) { |
| 8112 | self.0 = (self.0 & !(0x03 << 20usize)) | (((val.0 as u32) & 0x03) << 20usize); | 9911 | self.0 = (self.0 & !(0x07 << 19usize)) | (((val.0 as u32) & 0x07) << 19usize); |
| 8113 | } | 9912 | } |
| 8114 | #[doc = "Wakeup from Stop mode interrupt enable"] | 9913 | #[doc = "SPI Master"] |
| 8115 | pub const fn wufie(&self) -> bool { | 9914 | pub const fn master(&self) -> super::vals::Master { |
| 8116 | let val = (self.0 >> 22usize) & 0x01; | 9915 | let val = (self.0 >> 22usize) & 0x01; |
| 9916 | super::vals::Master(val as u8) | ||
| 9917 | } | ||
| 9918 | #[doc = "SPI Master"] | ||
| 9919 | pub fn set_master(&mut self, val: super::vals::Master) { | ||
| 9920 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize); | ||
| 9921 | } | ||
| 9922 | #[doc = "Data frame format"] | ||
| 9923 | pub const fn lsbfrst(&self) -> super::vals::Lsbfrst { | ||
| 9924 | let val = (self.0 >> 23usize) & 0x01; | ||
| 9925 | super::vals::Lsbfrst(val as u8) | ||
| 9926 | } | ||
| 9927 | #[doc = "Data frame format"] | ||
| 9928 | pub fn set_lsbfrst(&mut self, val: super::vals::Lsbfrst) { | ||
| 9929 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize); | ||
| 9930 | } | ||
| 9931 | #[doc = "Clock phase"] | ||
| 9932 | pub const fn cpha(&self) -> super::vals::Cpha { | ||
| 9933 | let val = (self.0 >> 24usize) & 0x01; | ||
| 9934 | super::vals::Cpha(val as u8) | ||
| 9935 | } | ||
| 9936 | #[doc = "Clock phase"] | ||
| 9937 | pub fn set_cpha(&mut self, val: super::vals::Cpha) { | ||
| 9938 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); | ||
| 9939 | } | ||
| 9940 | #[doc = "Clock polarity"] | ||
| 9941 | pub const fn cpol(&self) -> super::vals::Cpol { | ||
| 9942 | let val = (self.0 >> 25usize) & 0x01; | ||
| 9943 | super::vals::Cpol(val as u8) | ||
| 9944 | } | ||
| 9945 | #[doc = "Clock polarity"] | ||
| 9946 | pub fn set_cpol(&mut self, val: super::vals::Cpol) { | ||
| 9947 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize); | ||
| 9948 | } | ||
| 9949 | #[doc = "Software management of SS signal input"] | ||
| 9950 | pub const fn ssm(&self) -> bool { | ||
| 9951 | let val = (self.0 >> 26usize) & 0x01; | ||
| 8117 | val != 0 | 9952 | val != 0 |
| 8118 | } | 9953 | } |
| 8119 | #[doc = "Wakeup from Stop mode interrupt enable"] | 9954 | #[doc = "Software management of SS signal input"] |
| 8120 | pub fn set_wufie(&mut self, val: bool) { | 9955 | pub fn set_ssm(&mut self, val: bool) { |
| 8121 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); | 9956 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); |
| 9957 | } | ||
| 9958 | #[doc = "SS input/output polarity"] | ||
| 9959 | pub const fn ssiop(&self) -> super::vals::Ssiop { | ||
| 9960 | let val = (self.0 >> 28usize) & 0x01; | ||
| 9961 | super::vals::Ssiop(val as u8) | ||
| 9962 | } | ||
| 9963 | #[doc = "SS input/output polarity"] | ||
| 9964 | pub fn set_ssiop(&mut self, val: super::vals::Ssiop) { | ||
| 9965 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); | ||
| 9966 | } | ||
| 9967 | #[doc = "SS output enable"] | ||
| 9968 | pub const fn ssoe(&self) -> bool { | ||
| 9969 | let val = (self.0 >> 29usize) & 0x01; | ||
| 9970 | val != 0 | ||
| 9971 | } | ||
| 9972 | #[doc = "SS output enable"] | ||
| 9973 | pub fn set_ssoe(&mut self, val: bool) { | ||
| 9974 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize); | ||
| 9975 | } | ||
| 9976 | #[doc = "SS output management in master mode"] | ||
| 9977 | pub const fn ssom(&self) -> super::vals::Ssom { | ||
| 9978 | let val = (self.0 >> 30usize) & 0x01; | ||
| 9979 | super::vals::Ssom(val as u8) | ||
| 9980 | } | ||
| 9981 | #[doc = "SS output management in master mode"] | ||
| 9982 | pub fn set_ssom(&mut self, val: super::vals::Ssom) { | ||
| 9983 | self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize); | ||
| 9984 | } | ||
| 9985 | #[doc = "Alternate function GPIOs control"] | ||
| 9986 | pub const fn afcntr(&self) -> super::vals::Afcntr { | ||
| 9987 | let val = (self.0 >> 31usize) & 0x01; | ||
| 9988 | super::vals::Afcntr(val as u8) | ||
| 9989 | } | ||
| 9990 | #[doc = "Alternate function GPIOs control"] | ||
| 9991 | pub fn set_afcntr(&mut self, val: super::vals::Afcntr) { | ||
| 9992 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize); | ||
| 8122 | } | 9993 | } |
| 8123 | } | 9994 | } |
| 8124 | impl Default for Cr3 { | 9995 | impl Default for Cfg2 { |
| 8125 | fn default() -> Cr3 { | 9996 | fn default() -> Cfg2 { |
| 8126 | Cr3(0) | 9997 | Cfg2(0) |
| 8127 | } | 9998 | } |
| 8128 | } | 9999 | } |
| 8129 | #[doc = "Interrupt & status register"] | 10000 | #[doc = "Status Register"] |
| 8130 | #[repr(transparent)] | 10001 | #[repr(transparent)] |
| 8131 | #[derive(Copy, Clone, Eq, PartialEq)] | 10002 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 8132 | pub struct Ixr(pub u32); | 10003 | pub struct Sr(pub u32); |
| 8133 | impl Ixr { | 10004 | impl Sr { |
| 8134 | #[doc = "Parity error"] | 10005 | #[doc = "Rx-Packet available"] |
| 8135 | pub const fn pe(&self) -> bool { | 10006 | pub const fn rxp(&self) -> bool { |
| 8136 | let val = (self.0 >> 0usize) & 0x01; | 10007 | let val = (self.0 >> 0usize) & 0x01; |
| 8137 | val != 0 | 10008 | val != 0 |
| 8138 | } | 10009 | } |
| 8139 | #[doc = "Parity error"] | 10010 | #[doc = "Rx-Packet available"] |
| 8140 | pub fn set_pe(&mut self, val: bool) { | 10011 | pub fn set_rxp(&mut self, val: bool) { |
| 8141 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 10012 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 8142 | } | 10013 | } |
| 8143 | #[doc = "Framing error"] | 10014 | #[doc = "Tx-Packet space available"] |
| 8144 | pub const fn fe(&self) -> bool { | 10015 | pub const fn txp(&self) -> bool { |
| 8145 | let val = (self.0 >> 1usize) & 0x01; | 10016 | let val = (self.0 >> 1usize) & 0x01; |
| 8146 | val != 0 | 10017 | val != 0 |
| 8147 | } | 10018 | } |
| 8148 | #[doc = "Framing error"] | 10019 | #[doc = "Tx-Packet space available"] |
| 8149 | pub fn set_fe(&mut self, val: bool) { | 10020 | pub fn set_txp(&mut self, val: bool) { |
| 8150 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 10021 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 8151 | } | 10022 | } |
| 8152 | #[doc = "Noise detected flag"] | 10023 | #[doc = "Duplex Packet"] |
| 8153 | pub const fn nf(&self) -> bool { | 10024 | pub const fn dxp(&self) -> bool { |
| 8154 | let val = (self.0 >> 2usize) & 0x01; | 10025 | let val = (self.0 >> 2usize) & 0x01; |
| 8155 | val != 0 | 10026 | val != 0 |
| 8156 | } | 10027 | } |
| 8157 | #[doc = "Noise detected flag"] | 10028 | #[doc = "Duplex Packet"] |
| 8158 | pub fn set_nf(&mut self, val: bool) { | 10029 | pub fn set_dxp(&mut self, val: bool) { |
| 8159 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 10030 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 8160 | } | 10031 | } |
| 8161 | #[doc = "Overrun error"] | 10032 | #[doc = "End Of Transfer"] |
| 8162 | pub const fn ore(&self) -> bool { | 10033 | pub const fn eot(&self) -> bool { |
| 8163 | let val = (self.0 >> 3usize) & 0x01; | 10034 | let val = (self.0 >> 3usize) & 0x01; |
| 8164 | val != 0 | 10035 | val != 0 |
| 8165 | } | 10036 | } |
| 8166 | #[doc = "Overrun error"] | 10037 | #[doc = "End Of Transfer"] |
| 8167 | pub fn set_ore(&mut self, val: bool) { | 10038 | pub fn set_eot(&mut self, val: bool) { |
| 8168 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 10039 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); |
| 8169 | } | 10040 | } |
| 8170 | #[doc = "Idle line detected"] | 10041 | #[doc = "Transmission Transfer Filled"] |
| 8171 | pub const fn idle(&self) -> bool { | 10042 | pub const fn txtf(&self) -> bool { |
| 8172 | let val = (self.0 >> 4usize) & 0x01; | 10043 | let val = (self.0 >> 4usize) & 0x01; |
| 8173 | val != 0 | 10044 | val != 0 |
| 8174 | } | 10045 | } |
| 8175 | #[doc = "Idle line detected"] | 10046 | #[doc = "Transmission Transfer Filled"] |
| 8176 | pub fn set_idle(&mut self, val: bool) { | 10047 | pub fn set_txtf(&mut self, val: bool) { |
| 8177 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 10048 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 8178 | } | 10049 | } |
| 8179 | #[doc = "Read data register not empty"] | 10050 | #[doc = "Underrun at slave transmission mode"] |
| 8180 | pub const fn rxne(&self) -> bool { | 10051 | pub const fn udr(&self) -> bool { |
| 8181 | let val = (self.0 >> 5usize) & 0x01; | 10052 | let val = (self.0 >> 5usize) & 0x01; |
| 8182 | val != 0 | 10053 | val != 0 |
| 8183 | } | 10054 | } |
| 8184 | #[doc = "Read data register not empty"] | 10055 | #[doc = "Underrun at slave transmission mode"] |
| 8185 | pub fn set_rxne(&mut self, val: bool) { | 10056 | pub fn set_udr(&mut self, val: bool) { |
| 8186 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 10057 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 8187 | } | 10058 | } |
| 8188 | #[doc = "Transmission complete"] | 10059 | #[doc = "Overrun"] |
| 8189 | pub const fn tc(&self) -> bool { | 10060 | pub const fn ovr(&self) -> bool { |
| 8190 | let val = (self.0 >> 6usize) & 0x01; | 10061 | let val = (self.0 >> 6usize) & 0x01; |
| 8191 | val != 0 | 10062 | val != 0 |
| 8192 | } | 10063 | } |
| 8193 | #[doc = "Transmission complete"] | 10064 | #[doc = "Overrun"] |
| 8194 | pub fn set_tc(&mut self, val: bool) { | 10065 | pub fn set_ovr(&mut self, val: bool) { |
| 8195 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 10066 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 8196 | } | 10067 | } |
| 8197 | #[doc = "Transmit data register empty"] | 10068 | #[doc = "CRC Error"] |
| 8198 | pub const fn txe(&self) -> bool { | 10069 | pub const fn crce(&self) -> bool { |
| 8199 | let val = (self.0 >> 7usize) & 0x01; | 10070 | let val = (self.0 >> 7usize) & 0x01; |
| 8200 | val != 0 | 10071 | val != 0 |
| 8201 | } | 10072 | } |
| 8202 | #[doc = "Transmit data register empty"] | 10073 | #[doc = "CRC Error"] |
| 8203 | pub fn set_txe(&mut self, val: bool) { | 10074 | pub fn set_crce(&mut self, val: bool) { |
| 8204 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 10075 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 8205 | } | 10076 | } |
| 8206 | #[doc = "LIN break detection flag"] | 10077 | #[doc = "TI frame format error"] |
| 8207 | pub const fn lbdf(&self) -> bool { | 10078 | pub const fn tifre(&self) -> bool { |
| 8208 | let val = (self.0 >> 8usize) & 0x01; | 10079 | let val = (self.0 >> 8usize) & 0x01; |
| 8209 | val != 0 | 10080 | val != 0 |
| 8210 | } | 10081 | } |
| 8211 | #[doc = "LIN break detection flag"] | 10082 | #[doc = "TI frame format error"] |
| 8212 | pub fn set_lbdf(&mut self, val: bool) { | 10083 | pub fn set_tifre(&mut self, val: bool) { |
| 8213 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 10084 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 8214 | } | 10085 | } |
| 8215 | #[doc = "CTS interrupt flag"] | 10086 | #[doc = "Mode Fault"] |
| 8216 | pub const fn ctsif(&self) -> bool { | 10087 | pub const fn modf(&self) -> bool { |
| 8217 | let val = (self.0 >> 9usize) & 0x01; | 10088 | let val = (self.0 >> 9usize) & 0x01; |
| 8218 | val != 0 | 10089 | val != 0 |
| 8219 | } | 10090 | } |
| 8220 | #[doc = "CTS interrupt flag"] | 10091 | #[doc = "Mode Fault"] |
| 8221 | pub fn set_ctsif(&mut self, val: bool) { | 10092 | pub fn set_modf(&mut self, val: bool) { |
| 8222 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | 10093 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); |
| 8223 | } | 10094 | } |
| 8224 | #[doc = "CTS flag"] | 10095 | #[doc = "Additional number of SPI data to be transacted was reload"] |
| 8225 | pub const fn cts(&self) -> bool { | 10096 | pub const fn tserf(&self) -> bool { |
| 8226 | let val = (self.0 >> 10usize) & 0x01; | 10097 | let val = (self.0 >> 10usize) & 0x01; |
| 8227 | val != 0 | 10098 | val != 0 |
| 8228 | } | 10099 | } |
| 8229 | #[doc = "CTS flag"] | 10100 | #[doc = "Additional number of SPI data to be transacted was reload"] |
| 8230 | pub fn set_cts(&mut self, val: bool) { | 10101 | pub fn set_tserf(&mut self, val: bool) { |
| 8231 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | 10102 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); |
| 8232 | } | 10103 | } |
| 8233 | #[doc = "Receiver timeout"] | 10104 | #[doc = "SUSPend"] |
| 8234 | pub const fn rtof(&self) -> bool { | 10105 | pub const fn susp(&self) -> bool { |
| 8235 | let val = (self.0 >> 11usize) & 0x01; | 10106 | let val = (self.0 >> 11usize) & 0x01; |
| 8236 | val != 0 | 10107 | val != 0 |
| 8237 | } | 10108 | } |
| 8238 | #[doc = "Receiver timeout"] | 10109 | #[doc = "SUSPend"] |
| 8239 | pub fn set_rtof(&mut self, val: bool) { | 10110 | pub fn set_susp(&mut self, val: bool) { |
| 8240 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); | 10111 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); |
| 8241 | } | 10112 | } |
| 8242 | #[doc = "End of block flag"] | 10113 | #[doc = "TxFIFO transmission complete"] |
| 8243 | pub const fn eobf(&self) -> bool { | 10114 | pub const fn txc(&self) -> bool { |
| 8244 | let val = (self.0 >> 12usize) & 0x01; | 10115 | let val = (self.0 >> 12usize) & 0x01; |
| 8245 | val != 0 | 10116 | val != 0 |
| 8246 | } | 10117 | } |
| 8247 | #[doc = "End of block flag"] | 10118 | #[doc = "TxFIFO transmission complete"] |
| 8248 | pub fn set_eobf(&mut self, val: bool) { | 10119 | pub fn set_txc(&mut self, val: bool) { |
| 8249 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); | 10120 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); |
| 8250 | } | 10121 | } |
| 8251 | #[doc = "Auto baud rate error"] | 10122 | #[doc = "RxFIFO Packing LeVeL"] |
| 8252 | pub const fn abre(&self) -> bool { | 10123 | pub const fn rxplvl(&self) -> super::vals::Rxplvl { |
| 8253 | let val = (self.0 >> 14usize) & 0x01; | 10124 | let val = (self.0 >> 13usize) & 0x03; |
| 8254 | val != 0 | 10125 | super::vals::Rxplvl(val as u8) |
| 8255 | } | 10126 | } |
| 8256 | #[doc = "Auto baud rate error"] | 10127 | #[doc = "RxFIFO Packing LeVeL"] |
| 8257 | pub fn set_abre(&mut self, val: bool) { | 10128 | pub fn set_rxplvl(&mut self, val: super::vals::Rxplvl) { |
| 8258 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | 10129 | self.0 = (self.0 & !(0x03 << 13usize)) | (((val.0 as u32) & 0x03) << 13usize); |
| 8259 | } | 10130 | } |
| 8260 | #[doc = "Auto baud rate flag"] | 10131 | #[doc = "RxFIFO Word Not Empty"] |
| 8261 | pub const fn abrf(&self) -> bool { | 10132 | pub const fn rxwne(&self) -> super::vals::Rxwne { |
| 8262 | let val = (self.0 >> 15usize) & 0x01; | 10133 | let val = (self.0 >> 15usize) & 0x01; |
| 8263 | val != 0 | 10134 | super::vals::Rxwne(val as u8) |
| 8264 | } | ||
| 8265 | #[doc = "Auto baud rate flag"] | ||
| 8266 | pub fn set_abrf(&mut self, val: bool) { | ||
| 8267 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); | ||
| 8268 | } | ||
| 8269 | #[doc = "Busy flag"] | ||
| 8270 | pub const fn busy(&self) -> bool { | ||
| 8271 | let val = (self.0 >> 16usize) & 0x01; | ||
| 8272 | val != 0 | ||
| 8273 | } | ||
| 8274 | #[doc = "Busy flag"] | ||
| 8275 | pub fn set_busy(&mut self, val: bool) { | ||
| 8276 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | ||
| 8277 | } | ||
| 8278 | #[doc = "character match flag"] | ||
| 8279 | pub const fn cmf(&self) -> bool { | ||
| 8280 | let val = (self.0 >> 17usize) & 0x01; | ||
| 8281 | val != 0 | ||
| 8282 | } | ||
| 8283 | #[doc = "character match flag"] | ||
| 8284 | pub fn set_cmf(&mut self, val: bool) { | ||
| 8285 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); | ||
| 8286 | } | ||
| 8287 | #[doc = "Send break flag"] | ||
| 8288 | pub const fn sbkf(&self) -> bool { | ||
| 8289 | let val = (self.0 >> 18usize) & 0x01; | ||
| 8290 | val != 0 | ||
| 8291 | } | ||
| 8292 | #[doc = "Send break flag"] | ||
| 8293 | pub fn set_sbkf(&mut self, val: bool) { | ||
| 8294 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); | ||
| 8295 | } | ||
| 8296 | #[doc = "Receiver wakeup from Mute mode"] | ||
| 8297 | pub const fn rwu(&self) -> bool { | ||
| 8298 | let val = (self.0 >> 19usize) & 0x01; | ||
| 8299 | val != 0 | ||
| 8300 | } | ||
| 8301 | #[doc = "Receiver wakeup from Mute mode"] | ||
| 8302 | pub fn set_rwu(&mut self, val: bool) { | ||
| 8303 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); | ||
| 8304 | } | ||
| 8305 | #[doc = "Wakeup from Stop mode flag"] | ||
| 8306 | pub const fn wuf(&self) -> bool { | ||
| 8307 | let val = (self.0 >> 20usize) & 0x01; | ||
| 8308 | val != 0 | ||
| 8309 | } | ||
| 8310 | #[doc = "Wakeup from Stop mode flag"] | ||
| 8311 | pub fn set_wuf(&mut self, val: bool) { | ||
| 8312 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); | ||
| 8313 | } | ||
| 8314 | #[doc = "Transmit enable acknowledge flag"] | ||
| 8315 | pub const fn teack(&self) -> bool { | ||
| 8316 | let val = (self.0 >> 21usize) & 0x01; | ||
| 8317 | val != 0 | ||
| 8318 | } | 10135 | } |
| 8319 | #[doc = "Transmit enable acknowledge flag"] | 10136 | #[doc = "RxFIFO Word Not Empty"] |
| 8320 | pub fn set_teack(&mut self, val: bool) { | 10137 | pub fn set_rxwne(&mut self, val: super::vals::Rxwne) { |
| 8321 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); | 10138 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); |
| 8322 | } | 10139 | } |
| 8323 | #[doc = "Receive enable acknowledge flag"] | 10140 | #[doc = "Number of data frames remaining in current TSIZE session"] |
| 8324 | pub const fn reack(&self) -> bool { | 10141 | pub const fn ctsize(&self) -> u16 { |
| 8325 | let val = (self.0 >> 22usize) & 0x01; | 10142 | let val = (self.0 >> 16usize) & 0xffff; |
| 8326 | val != 0 | 10143 | val as u16 |
| 8327 | } | 10144 | } |
| 8328 | #[doc = "Receive enable acknowledge flag"] | 10145 | #[doc = "Number of data frames remaining in current TSIZE session"] |
| 8329 | pub fn set_reack(&mut self, val: bool) { | 10146 | pub fn set_ctsize(&mut self, val: u16) { |
| 8330 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); | 10147 | self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize); |
| 8331 | } | 10148 | } |
| 8332 | } | 10149 | } |
| 8333 | impl Default for Ixr { | 10150 | impl Default for Sr { |
| 8334 | fn default() -> Ixr { | 10151 | fn default() -> Sr { |
| 8335 | Ixr(0) | 10152 | Sr(0) |
| 8336 | } | 10153 | } |
| 8337 | } | 10154 | } |
| 8338 | #[doc = "Control register 2"] | 10155 | #[doc = "control register 1"] |
| 8339 | #[repr(transparent)] | 10156 | #[repr(transparent)] |
| 8340 | #[derive(Copy, Clone, Eq, PartialEq)] | 10157 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 8341 | pub struct Cr2(pub u32); | 10158 | pub struct Cr1(pub u32); |
| 8342 | impl Cr2 { | 10159 | impl Cr1 { |
| 8343 | #[doc = "7-bit Address Detection/4-bit Address Detection"] | 10160 | #[doc = "Serial Peripheral Enable"] |
| 8344 | pub fn addm(&self, n: usize) -> super::vals::Addm { | 10161 | pub const fn spe(&self) -> bool { |
| 8345 | assert!(n < 1usize); | 10162 | let val = (self.0 >> 0usize) & 0x01; |
| 8346 | let offs = 4usize + n * 0usize; | ||
| 8347 | let val = (self.0 >> offs) & 0x01; | ||
| 8348 | super::vals::Addm(val as u8) | ||
| 8349 | } | ||
| 8350 | #[doc = "7-bit Address Detection/4-bit Address Detection"] | ||
| 8351 | pub fn set_addm(&mut self, n: usize, val: super::vals::Addm) { | ||
| 8352 | assert!(n < 1usize); | ||
| 8353 | let offs = 4usize + n * 0usize; | ||
| 8354 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 8355 | } | ||
| 8356 | #[doc = "LIN break detection length"] | ||
| 8357 | pub const fn lbdl(&self) -> super::vals::Lbdl { | ||
| 8358 | let val = (self.0 >> 5usize) & 0x01; | ||
| 8359 | super::vals::Lbdl(val as u8) | ||
| 8360 | } | ||
| 8361 | #[doc = "LIN break detection length"] | ||
| 8362 | pub fn set_lbdl(&mut self, val: super::vals::Lbdl) { | ||
| 8363 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 8364 | } | ||
| 8365 | #[doc = "LIN break detection interrupt enable"] | ||
| 8366 | pub const fn lbdie(&self) -> bool { | ||
| 8367 | let val = (self.0 >> 6usize) & 0x01; | ||
| 8368 | val != 0 | 10163 | val != 0 |
| 8369 | } | 10164 | } |
| 8370 | #[doc = "LIN break detection interrupt enable"] | 10165 | #[doc = "Serial Peripheral Enable"] |
| 8371 | pub fn set_lbdie(&mut self, val: bool) { | 10166 | pub fn set_spe(&mut self, val: bool) { |
| 8372 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 10167 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 8373 | } | 10168 | } |
| 8374 | #[doc = "Last bit clock pulse"] | 10169 | #[doc = "Master automatic SUSP in Receive mode"] |
| 8375 | pub const fn lbcl(&self) -> super::vals::Lbcl { | 10170 | pub const fn masrx(&self) -> bool { |
| 8376 | let val = (self.0 >> 8usize) & 0x01; | 10171 | let val = (self.0 >> 8usize) & 0x01; |
| 8377 | super::vals::Lbcl(val as u8) | 10172 | val != 0 |
| 8378 | } | 10173 | } |
| 8379 | #[doc = "Last bit clock pulse"] | 10174 | #[doc = "Master automatic SUSP in Receive mode"] |
| 8380 | pub fn set_lbcl(&mut self, val: super::vals::Lbcl) { | 10175 | pub fn set_masrx(&mut self, val: bool) { |
| 8381 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); | 10176 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 8382 | } | 10177 | } |
| 8383 | #[doc = "Clock phase"] | 10178 | #[doc = "Master transfer start"] |
| 8384 | pub const fn cpha(&self) -> super::vals::Cpha { | 10179 | pub const fn cstart(&self) -> bool { |
| 8385 | let val = (self.0 >> 9usize) & 0x01; | 10180 | let val = (self.0 >> 9usize) & 0x01; |
| 8386 | super::vals::Cpha(val as u8) | 10181 | val != 0 |
| 8387 | } | 10182 | } |
| 8388 | #[doc = "Clock phase"] | 10183 | #[doc = "Master transfer start"] |
| 8389 | pub fn set_cpha(&mut self, val: super::vals::Cpha) { | 10184 | pub fn set_cstart(&mut self, val: bool) { |
| 8390 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | 10185 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); |
| 8391 | } | 10186 | } |
| 8392 | #[doc = "Clock polarity"] | 10187 | #[doc = "Master SUSPend request"] |
| 8393 | pub const fn cpol(&self) -> super::vals::Cpol { | 10188 | pub const fn csusp(&self) -> bool { |
| 8394 | let val = (self.0 >> 10usize) & 0x01; | 10189 | let val = (self.0 >> 10usize) & 0x01; |
| 8395 | super::vals::Cpol(val as u8) | 10190 | val != 0 |
| 8396 | } | 10191 | } |
| 8397 | #[doc = "Clock polarity"] | 10192 | #[doc = "Master SUSPend request"] |
| 8398 | pub fn set_cpol(&mut self, val: super::vals::Cpol) { | 10193 | pub fn set_csusp(&mut self, val: bool) { |
| 8399 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); | 10194 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); |
| 8400 | } | 10195 | } |
| 8401 | #[doc = "Clock enable"] | 10196 | #[doc = "Rx/Tx direction at Half-duplex mode"] |
| 8402 | pub const fn clken(&self) -> bool { | 10197 | pub const fn hddir(&self) -> super::vals::Hddir { |
| 8403 | let val = (self.0 >> 11usize) & 0x01; | 10198 | let val = (self.0 >> 11usize) & 0x01; |
| 10199 | super::vals::Hddir(val as u8) | ||
| 10200 | } | ||
| 10201 | #[doc = "Rx/Tx direction at Half-duplex mode"] | ||
| 10202 | pub fn set_hddir(&mut self, val: super::vals::Hddir) { | ||
| 10203 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); | ||
| 10204 | } | ||
| 10205 | #[doc = "Internal SS signal input level"] | ||
| 10206 | pub const fn ssi(&self) -> bool { | ||
| 10207 | let val = (self.0 >> 12usize) & 0x01; | ||
| 8404 | val != 0 | 10208 | val != 0 |
| 8405 | } | 10209 | } |
| 8406 | #[doc = "Clock enable"] | 10210 | #[doc = "Internal SS signal input level"] |
| 8407 | pub fn set_clken(&mut self, val: bool) { | 10211 | pub fn set_ssi(&mut self, val: bool) { |
| 8408 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); | 10212 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); |
| 8409 | } | 10213 | } |
| 8410 | #[doc = "STOP bits"] | 10214 | #[doc = "32-bit CRC polynomial configuration"] |
| 8411 | pub const fn stop(&self) -> super::vals::Stop { | 10215 | pub const fn crc33_17(&self) -> super::vals::Crc { |
| 8412 | let val = (self.0 >> 12usize) & 0x03; | 10216 | let val = (self.0 >> 13usize) & 0x01; |
| 8413 | super::vals::Stop(val as u8) | 10217 | super::vals::Crc(val as u8) |
| 8414 | } | 10218 | } |
| 8415 | #[doc = "STOP bits"] | 10219 | #[doc = "32-bit CRC polynomial configuration"] |
| 8416 | pub fn set_stop(&mut self, val: super::vals::Stop) { | 10220 | pub fn set_crc33_17(&mut self, val: super::vals::Crc) { |
| 8417 | self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize); | 10221 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize); |
| 8418 | } | 10222 | } |
| 8419 | #[doc = "LIN mode enable"] | 10223 | #[doc = "CRC calculation initialization pattern control for receiver"] |
| 8420 | pub const fn linen(&self) -> bool { | 10224 | pub const fn rcrcini(&self) -> super::vals::Rcrcini { |
| 8421 | let val = (self.0 >> 14usize) & 0x01; | 10225 | let val = (self.0 >> 14usize) & 0x01; |
| 8422 | val != 0 | 10226 | super::vals::Rcrcini(val as u8) |
| 8423 | } | 10227 | } |
| 8424 | #[doc = "LIN mode enable"] | 10228 | #[doc = "CRC calculation initialization pattern control for receiver"] |
| 8425 | pub fn set_linen(&mut self, val: bool) { | 10229 | pub fn set_rcrcini(&mut self, val: super::vals::Rcrcini) { |
| 8426 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | 10230 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); |
| 8427 | } | 10231 | } |
| 8428 | #[doc = "Swap TX/RX pins"] | 10232 | #[doc = "CRC calculation initialization pattern control for transmitter"] |
| 8429 | pub const fn swap(&self) -> super::vals::Swap { | 10233 | pub const fn tcrcini(&self) -> super::vals::Tcrcini { |
| 8430 | let val = (self.0 >> 15usize) & 0x01; | 10234 | let val = (self.0 >> 15usize) & 0x01; |
| 8431 | super::vals::Swap(val as u8) | 10235 | super::vals::Tcrcini(val as u8) |
| 8432 | } | 10236 | } |
| 8433 | #[doc = "Swap TX/RX pins"] | 10237 | #[doc = "CRC calculation initialization pattern control for transmitter"] |
| 8434 | pub fn set_swap(&mut self, val: super::vals::Swap) { | 10238 | pub fn set_tcrcini(&mut self, val: super::vals::Tcrcini) { |
| 8435 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | 10239 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); |
| 8436 | } | 10240 | } |
| 8437 | #[doc = "RX pin active level inversion"] | 10241 | #[doc = "Locking the AF configuration of associated IOs"] |
| 8438 | pub const fn rxinv(&self) -> super::vals::Rxinv { | 10242 | pub const fn iolock(&self) -> bool { |
| 8439 | let val = (self.0 >> 16usize) & 0x01; | 10243 | let val = (self.0 >> 16usize) & 0x01; |
| 8440 | super::vals::Rxinv(val as u8) | ||
| 8441 | } | ||
| 8442 | #[doc = "RX pin active level inversion"] | ||
| 8443 | pub fn set_rxinv(&mut self, val: super::vals::Rxinv) { | ||
| 8444 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 8445 | } | ||
| 8446 | #[doc = "TX pin active level inversion"] | ||
| 8447 | pub const fn txinv(&self) -> super::vals::Txinv { | ||
| 8448 | let val = (self.0 >> 17usize) & 0x01; | ||
| 8449 | super::vals::Txinv(val as u8) | ||
| 8450 | } | ||
| 8451 | #[doc = "TX pin active level inversion"] | ||
| 8452 | pub fn set_txinv(&mut self, val: super::vals::Txinv) { | ||
| 8453 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize); | ||
| 8454 | } | ||
| 8455 | #[doc = "Binary data inversion"] | ||
| 8456 | pub const fn datainv(&self) -> super::vals::Datainv { | ||
| 8457 | let val = (self.0 >> 18usize) & 0x01; | ||
| 8458 | super::vals::Datainv(val as u8) | ||
| 8459 | } | ||
| 8460 | #[doc = "Binary data inversion"] | ||
| 8461 | pub fn set_datainv(&mut self, val: super::vals::Datainv) { | ||
| 8462 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize); | ||
| 8463 | } | ||
| 8464 | #[doc = "Most significant bit first"] | ||
| 8465 | pub const fn msbfirst(&self) -> super::vals::Msbfirst { | ||
| 8466 | let val = (self.0 >> 19usize) & 0x01; | ||
| 8467 | super::vals::Msbfirst(val as u8) | ||
| 8468 | } | ||
| 8469 | #[doc = "Most significant bit first"] | ||
| 8470 | pub fn set_msbfirst(&mut self, val: super::vals::Msbfirst) { | ||
| 8471 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); | ||
| 8472 | } | ||
| 8473 | #[doc = "Auto baud rate enable"] | ||
| 8474 | pub const fn abren(&self) -> bool { | ||
| 8475 | let val = (self.0 >> 20usize) & 0x01; | ||
| 8476 | val != 0 | ||
| 8477 | } | ||
| 8478 | #[doc = "Auto baud rate enable"] | ||
| 8479 | pub fn set_abren(&mut self, val: bool) { | ||
| 8480 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); | ||
| 8481 | } | ||
| 8482 | #[doc = "Auto baud rate mode"] | ||
| 8483 | pub const fn abrmod(&self) -> super::vals::Abrmod { | ||
| 8484 | let val = (self.0 >> 21usize) & 0x03; | ||
| 8485 | super::vals::Abrmod(val as u8) | ||
| 8486 | } | ||
| 8487 | #[doc = "Auto baud rate mode"] | ||
| 8488 | pub fn set_abrmod(&mut self, val: super::vals::Abrmod) { | ||
| 8489 | self.0 = (self.0 & !(0x03 << 21usize)) | (((val.0 as u32) & 0x03) << 21usize); | ||
| 8490 | } | ||
| 8491 | #[doc = "Receiver timeout enable"] | ||
| 8492 | pub const fn rtoen(&self) -> bool { | ||
| 8493 | let val = (self.0 >> 23usize) & 0x01; | ||
| 8494 | val != 0 | 10244 | val != 0 |
| 8495 | } | 10245 | } |
| 8496 | #[doc = "Receiver timeout enable"] | 10246 | #[doc = "Locking the AF configuration of associated IOs"] |
| 8497 | pub fn set_rtoen(&mut self, val: bool) { | 10247 | pub fn set_iolock(&mut self, val: bool) { |
| 8498 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); | 10248 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); |
| 8499 | } | ||
| 8500 | #[doc = "Address of the USART node"] | ||
| 8501 | pub const fn add(&self) -> u8 { | ||
| 8502 | let val = (self.0 >> 24usize) & 0xff; | ||
| 8503 | val as u8 | ||
| 8504 | } | ||
| 8505 | #[doc = "Address of the USART node"] | ||
| 8506 | pub fn set_add(&mut self, val: u8) { | ||
| 8507 | self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize); | ||
| 8508 | } | 10249 | } |
| 8509 | } | 10250 | } |
| 8510 | impl Default for Cr2 { | 10251 | impl Default for Cr1 { |
| 8511 | fn default() -> Cr2 { | 10252 | fn default() -> Cr1 { |
| 8512 | Cr2(0) | 10253 | Cr1(0) |
| 8513 | } | 10254 | } |
| 8514 | } | 10255 | } |
| 8515 | #[doc = "Data register"] | 10256 | #[doc = "Receive Data Register"] |
| 8516 | #[repr(transparent)] | 10257 | #[repr(transparent)] |
| 8517 | #[derive(Copy, Clone, Eq, PartialEq)] | 10258 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 8518 | pub struct Dr(pub u32); | 10259 | pub struct Rxdr(pub u32); |
| 8519 | impl Dr { | 10260 | impl Rxdr { |
| 8520 | #[doc = "data value"] | 10261 | #[doc = "Receive data register"] |
| 8521 | pub const fn dr(&self) -> u16 { | 10262 | pub const fn rxdr(&self) -> u32 { |
| 8522 | let val = (self.0 >> 0usize) & 0x01ff; | 10263 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 8523 | val as u16 | 10264 | val as u32 |
| 8524 | } | 10265 | } |
| 8525 | #[doc = "data value"] | 10266 | #[doc = "Receive data register"] |
| 8526 | pub fn set_dr(&mut self, val: u16) { | 10267 | pub fn set_rxdr(&mut self, val: u32) { |
| 8527 | self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize); | 10268 | self.0 = |
| 10269 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 8528 | } | 10270 | } |
| 8529 | } | 10271 | } |
| 8530 | impl Default for Dr { | 10272 | impl Default for Rxdr { |
| 8531 | fn default() -> Dr { | 10273 | fn default() -> Rxdr { |
| 8532 | Dr(0) | 10274 | Rxdr(0) |
| 8533 | } | 10275 | } |
| 8534 | } | 10276 | } |
| 8535 | #[doc = "Baud rate register"] | 10277 | #[doc = "Polynomial Register"] |
| 8536 | #[repr(transparent)] | 10278 | #[repr(transparent)] |
| 8537 | #[derive(Copy, Clone, Eq, PartialEq)] | 10279 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 8538 | pub struct Brr(pub u32); | 10280 | pub struct Crcpoly(pub u32); |
| 8539 | impl Brr { | 10281 | impl Crcpoly { |
| 8540 | #[doc = "mantissa of USARTDIV"] | 10282 | #[doc = "CRC polynomial register"] |
| 8541 | pub const fn brr(&self) -> u16 { | 10283 | pub const fn crcpoly(&self) -> u32 { |
| 8542 | let val = (self.0 >> 0usize) & 0xffff; | 10284 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 8543 | val as u16 | 10285 | val as u32 |
| 8544 | } | 10286 | } |
| 8545 | #[doc = "mantissa of USARTDIV"] | 10287 | #[doc = "CRC polynomial register"] |
| 8546 | pub fn set_brr(&mut self, val: u16) { | 10288 | pub fn set_crcpoly(&mut self, val: u32) { |
| 8547 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | 10289 | self.0 = |
| 10290 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 8548 | } | 10291 | } |
| 8549 | } | 10292 | } |
| 8550 | impl Default for Brr { | 10293 | impl Default for Crcpoly { |
| 8551 | fn default() -> Brr { | 10294 | fn default() -> Crcpoly { |
| 8552 | Brr(0) | 10295 | Crcpoly(0) |
| 8553 | } | 10296 | } |
| 8554 | } | 10297 | } |
| 8555 | #[doc = "Guard time and prescaler register"] | 10298 | #[doc = "configuration register 1"] |
| 8556 | #[repr(transparent)] | 10299 | #[repr(transparent)] |
| 8557 | #[derive(Copy, Clone, Eq, PartialEq)] | 10300 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 8558 | pub struct Gtpr(pub u32); | 10301 | pub struct Cfg1(pub u32); |
| 8559 | impl Gtpr { | 10302 | impl Cfg1 { |
| 8560 | #[doc = "Prescaler value"] | 10303 | #[doc = "Number of bits in at single SPI data frame"] |
| 8561 | pub const fn psc(&self) -> u8 { | 10304 | pub const fn dsize(&self) -> u8 { |
| 8562 | let val = (self.0 >> 0usize) & 0xff; | 10305 | let val = (self.0 >> 0usize) & 0x1f; |
| 8563 | val as u8 | 10306 | val as u8 |
| 8564 | } | 10307 | } |
| 8565 | #[doc = "Prescaler value"] | 10308 | #[doc = "Number of bits in at single SPI data frame"] |
| 8566 | pub fn set_psc(&mut self, val: u8) { | 10309 | pub fn set_dsize(&mut self, val: u8) { |
| 8567 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | 10310 | self.0 = (self.0 & !(0x1f << 0usize)) | (((val as u32) & 0x1f) << 0usize); |
| 8568 | } | 10311 | } |
| 8569 | #[doc = "Guard time value"] | 10312 | #[doc = "threshold level"] |
| 8570 | pub const fn gt(&self) -> u8 { | 10313 | pub const fn fthlv(&self) -> super::vals::Fthlv { |
| 8571 | let val = (self.0 >> 8usize) & 0xff; | 10314 | let val = (self.0 >> 5usize) & 0x0f; |
| 10315 | super::vals::Fthlv(val as u8) | ||
| 10316 | } | ||
| 10317 | #[doc = "threshold level"] | ||
| 10318 | pub fn set_fthlv(&mut self, val: super::vals::Fthlv) { | ||
| 10319 | self.0 = (self.0 & !(0x0f << 5usize)) | (((val.0 as u32) & 0x0f) << 5usize); | ||
| 10320 | } | ||
| 10321 | #[doc = "Behavior of slave transmitter at underrun condition"] | ||
| 10322 | pub const fn udrcfg(&self) -> super::vals::Udrcfg { | ||
| 10323 | let val = (self.0 >> 9usize) & 0x03; | ||
| 10324 | super::vals::Udrcfg(val as u8) | ||
| 10325 | } | ||
| 10326 | #[doc = "Behavior of slave transmitter at underrun condition"] | ||
| 10327 | pub fn set_udrcfg(&mut self, val: super::vals::Udrcfg) { | ||
| 10328 | self.0 = (self.0 & !(0x03 << 9usize)) | (((val.0 as u32) & 0x03) << 9usize); | ||
| 10329 | } | ||
| 10330 | #[doc = "Detection of underrun condition at slave transmitter"] | ||
| 10331 | pub const fn udrdet(&self) -> super::vals::Udrdet { | ||
| 10332 | let val = (self.0 >> 11usize) & 0x03; | ||
| 10333 | super::vals::Udrdet(val as u8) | ||
| 10334 | } | ||
| 10335 | #[doc = "Detection of underrun condition at slave transmitter"] | ||
| 10336 | pub fn set_udrdet(&mut self, val: super::vals::Udrdet) { | ||
| 10337 | self.0 = (self.0 & !(0x03 << 11usize)) | (((val.0 as u32) & 0x03) << 11usize); | ||
| 10338 | } | ||
| 10339 | #[doc = "Rx DMA stream enable"] | ||
| 10340 | pub const fn rxdmaen(&self) -> bool { | ||
| 10341 | let val = (self.0 >> 14usize) & 0x01; | ||
| 10342 | val != 0 | ||
| 10343 | } | ||
| 10344 | #[doc = "Rx DMA stream enable"] | ||
| 10345 | pub fn set_rxdmaen(&mut self, val: bool) { | ||
| 10346 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | ||
| 10347 | } | ||
| 10348 | #[doc = "Tx DMA stream enable"] | ||
| 10349 | pub const fn txdmaen(&self) -> bool { | ||
| 10350 | let val = (self.0 >> 15usize) & 0x01; | ||
| 10351 | val != 0 | ||
| 10352 | } | ||
| 10353 | #[doc = "Tx DMA stream enable"] | ||
| 10354 | pub fn set_txdmaen(&mut self, val: bool) { | ||
| 10355 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); | ||
| 10356 | } | ||
| 10357 | #[doc = "Length of CRC frame to be transacted and compared"] | ||
| 10358 | pub const fn crcsize(&self) -> u8 { | ||
| 10359 | let val = (self.0 >> 16usize) & 0x1f; | ||
| 8572 | val as u8 | 10360 | val as u8 |
| 8573 | } | 10361 | } |
| 8574 | #[doc = "Guard time value"] | 10362 | #[doc = "Length of CRC frame to be transacted and compared"] |
| 8575 | pub fn set_gt(&mut self, val: u8) { | 10363 | pub fn set_crcsize(&mut self, val: u8) { |
| 8576 | self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize); | 10364 | self.0 = (self.0 & !(0x1f << 16usize)) | (((val as u32) & 0x1f) << 16usize); |
| 8577 | } | 10365 | } |
| 8578 | } | 10366 | #[doc = "Hardware CRC computation enable"] |
| 8579 | impl Default for Gtpr { | 10367 | pub const fn crcen(&self) -> bool { |
| 8580 | fn default() -> Gtpr { | 10368 | let val = (self.0 >> 22usize) & 0x01; |
| 8581 | Gtpr(0) | 10369 | val != 0 |
| 8582 | } | 10370 | } |
| 8583 | } | 10371 | #[doc = "Hardware CRC computation enable"] |
| 8584 | } | 10372 | pub fn set_crcen(&mut self, val: bool) { |
| 8585 | } | 10373 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); |
| 8586 | pub mod generic { | 10374 | } |
| 8587 | use core::marker::PhantomData; | 10375 | #[doc = "Master baud rate"] |
| 8588 | #[derive(Copy, Clone)] | 10376 | pub const fn mbr(&self) -> super::vals::Mbr { |
| 8589 | pub struct RW; | 10377 | let val = (self.0 >> 28usize) & 0x07; |
| 8590 | #[derive(Copy, Clone)] | 10378 | super::vals::Mbr(val as u8) |
| 8591 | pub struct R; | 10379 | } |
| 8592 | #[derive(Copy, Clone)] | 10380 | #[doc = "Master baud rate"] |
| 8593 | pub struct W; | 10381 | pub fn set_mbr(&mut self, val: super::vals::Mbr) { |
| 8594 | mod sealed { | 10382 | self.0 = (self.0 & !(0x07 << 28usize)) | (((val.0 as u32) & 0x07) << 28usize); |
| 8595 | use super::*; | ||
| 8596 | pub trait Access {} | ||
| 8597 | impl Access for R {} | ||
| 8598 | impl Access for W {} | ||
| 8599 | impl Access for RW {} | ||
| 8600 | } | ||
| 8601 | pub trait Access: sealed::Access + Copy {} | ||
| 8602 | impl Access for R {} | ||
| 8603 | impl Access for W {} | ||
| 8604 | impl Access for RW {} | ||
| 8605 | pub trait Read: Access {} | ||
| 8606 | impl Read for RW {} | ||
| 8607 | impl Read for R {} | ||
| 8608 | pub trait Write: Access {} | ||
| 8609 | impl Write for RW {} | ||
| 8610 | impl Write for W {} | ||
| 8611 | #[derive(Copy, Clone)] | ||
| 8612 | pub struct Reg<T: Copy, A: Access> { | ||
| 8613 | ptr: *mut u8, | ||
| 8614 | phantom: PhantomData<*mut (T, A)>, | ||
| 8615 | } | ||
| 8616 | unsafe impl<T: Copy, A: Access> Send for Reg<T, A> {} | ||
| 8617 | unsafe impl<T: Copy, A: Access> Sync for Reg<T, A> {} | ||
| 8618 | impl<T: Copy, A: Access> Reg<T, A> { | ||
| 8619 | pub fn from_ptr(ptr: *mut u8) -> Self { | ||
| 8620 | Self { | ||
| 8621 | ptr, | ||
| 8622 | phantom: PhantomData, | ||
| 8623 | } | 10383 | } |
| 8624 | } | 10384 | } |
| 8625 | pub fn ptr(&self) -> *mut T { | 10385 | impl Default for Cfg1 { |
| 8626 | self.ptr as _ | 10386 | fn default() -> Cfg1 { |
| 8627 | } | 10387 | Cfg1(0) |
| 8628 | } | 10388 | } |
| 8629 | impl<T: Copy, A: Read> Reg<T, A> { | ||
| 8630 | pub unsafe fn read(&self) -> T { | ||
| 8631 | (self.ptr as *mut T).read_volatile() | ||
| 8632 | } | ||
| 8633 | } | ||
| 8634 | impl<T: Copy, A: Write> Reg<T, A> { | ||
| 8635 | pub unsafe fn write_value(&self, val: T) { | ||
| 8636 | (self.ptr as *mut T).write_volatile(val) | ||
| 8637 | } | ||
| 8638 | } | ||
| 8639 | impl<T: Default + Copy, A: Write> Reg<T, A> { | ||
| 8640 | pub unsafe fn write<R>(&self, f: impl FnOnce(&mut T) -> R) -> R { | ||
| 8641 | let mut val = Default::default(); | ||
| 8642 | let res = f(&mut val); | ||
| 8643 | self.write_value(val); | ||
| 8644 | res | ||
| 8645 | } | ||
| 8646 | } | ||
| 8647 | impl<T: Copy, A: Read + Write> Reg<T, A> { | ||
| 8648 | pub unsafe fn modify<R>(&self, f: impl FnOnce(&mut T) -> R) -> R { | ||
| 8649 | let mut val = self.read(); | ||
| 8650 | let res = f(&mut val); | ||
| 8651 | self.write_value(val); | ||
| 8652 | res | ||
| 8653 | } | ||
| 8654 | } | ||
| 8655 | } | ||
| 8656 | pub mod spi_v3 { | ||
| 8657 | use crate::generic::*; | ||
| 8658 | #[doc = "Serial peripheral interface"] | ||
| 8659 | #[derive(Copy, Clone)] | ||
| 8660 | pub struct Spi(pub *mut u8); | ||
| 8661 | unsafe impl Send for Spi {} | ||
| 8662 | unsafe impl Sync for Spi {} | ||
| 8663 | impl Spi { | ||
| 8664 | #[doc = "control register 1"] | ||
| 8665 | pub fn cr1(self) -> Reg<regs::Cr1, RW> { | ||
| 8666 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 8667 | } | ||
| 8668 | #[doc = "control register 2"] | ||
| 8669 | pub fn cr2(self) -> Reg<regs::Cr2, RW> { | ||
| 8670 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 8671 | } | ||
| 8672 | #[doc = "configuration register 1"] | ||
| 8673 | pub fn cfg1(self) -> Reg<regs::Cfg1, RW> { | ||
| 8674 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 8675 | } | ||
| 8676 | #[doc = "configuration register 2"] | ||
| 8677 | pub fn cfg2(self) -> Reg<regs::Cfg2, RW> { | ||
| 8678 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 8679 | } | ||
| 8680 | #[doc = "Interrupt Enable Register"] | ||
| 8681 | pub fn ier(self) -> Reg<regs::Ier, RW> { | ||
| 8682 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 8683 | } | ||
| 8684 | #[doc = "Status Register"] | ||
| 8685 | pub fn sr(self) -> Reg<regs::Sr, R> { | ||
| 8686 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 8687 | } | ||
| 8688 | #[doc = "Interrupt/Status Flags Clear Register"] | ||
| 8689 | pub fn ifcr(self) -> Reg<regs::Ifcr, W> { | ||
| 8690 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | ||
| 8691 | } | ||
| 8692 | #[doc = "Transmit Data Register"] | ||
| 8693 | pub fn txdr(self) -> Reg<regs::Txdr, W> { | ||
| 8694 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | ||
| 8695 | } | ||
| 8696 | #[doc = "Receive Data Register"] | ||
| 8697 | pub fn rxdr(self) -> Reg<regs::Rxdr, R> { | ||
| 8698 | unsafe { Reg::from_ptr(self.0.add(48usize)) } | ||
| 8699 | } | ||
| 8700 | #[doc = "Polynomial Register"] | ||
| 8701 | pub fn crcpoly(self) -> Reg<regs::Crcpoly, RW> { | ||
| 8702 | unsafe { Reg::from_ptr(self.0.add(64usize)) } | ||
| 8703 | } | ||
| 8704 | #[doc = "Transmitter CRC Register"] | ||
| 8705 | pub fn txcrc(self) -> Reg<regs::Txcrc, RW> { | ||
| 8706 | unsafe { Reg::from_ptr(self.0.add(68usize)) } | ||
| 8707 | } | ||
| 8708 | #[doc = "Receiver CRC Register"] | ||
| 8709 | pub fn rxcrc(self) -> Reg<regs::Rxcrc, RW> { | ||
| 8710 | unsafe { Reg::from_ptr(self.0.add(72usize)) } | ||
| 8711 | } | ||
| 8712 | #[doc = "Underrun Data Register"] | ||
| 8713 | pub fn udrdr(self) -> Reg<regs::Udrdr, RW> { | ||
| 8714 | unsafe { Reg::from_ptr(self.0.add(76usize)) } | ||
| 8715 | } | 10389 | } |
| 8716 | } | 10390 | } |
| 8717 | pub mod vals { | 10391 | pub mod vals { |
| 8718 | use crate::generic::*; | 10392 | use crate::generic::*; |
| 8719 | #[repr(transparent)] | 10393 | #[repr(transparent)] |
| 8720 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 10394 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8721 | pub struct Mbr(pub u8); | 10395 | pub struct Sp(pub u8); |
| 8722 | impl Mbr { | 10396 | impl Sp { |
| 8723 | #[doc = "f_spi_ker_ck / 2"] | 10397 | #[doc = "Motorola SPI protocol"] |
| 8724 | pub const DIV2: Self = Self(0); | 10398 | pub const MOTOROLA: Self = Self(0); |
| 8725 | #[doc = "f_spi_ker_ck / 4"] | 10399 | #[doc = "TI SPI protocol"] |
| 8726 | pub const DIV4: Self = Self(0x01); | 10400 | pub const TI: Self = Self(0x01); |
| 8727 | #[doc = "f_spi_ker_ck / 8"] | ||
| 8728 | pub const DIV8: Self = Self(0x02); | ||
| 8729 | #[doc = "f_spi_ker_ck / 16"] | ||
| 8730 | pub const DIV16: Self = Self(0x03); | ||
| 8731 | #[doc = "f_spi_ker_ck / 32"] | ||
| 8732 | pub const DIV32: Self = Self(0x04); | ||
| 8733 | #[doc = "f_spi_ker_ck / 64"] | ||
| 8734 | pub const DIV64: Self = Self(0x05); | ||
| 8735 | #[doc = "f_spi_ker_ck / 128"] | ||
| 8736 | pub const DIV128: Self = Self(0x06); | ||
| 8737 | #[doc = "f_spi_ker_ck / 256"] | ||
| 8738 | pub const DIV256: Self = Self(0x07); | ||
| 8739 | } | ||
| 8740 | #[repr(transparent)] | ||
| 8741 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 8742 | pub struct Master(pub u8); | ||
| 8743 | impl Master { | ||
| 8744 | #[doc = "Slave configuration"] | ||
| 8745 | pub const SLAVE: Self = Self(0); | ||
| 8746 | #[doc = "Master configuration"] | ||
| 8747 | pub const MASTER: Self = Self(0x01); | ||
| 8748 | } | 10401 | } |
| 8749 | #[repr(transparent)] | 10402 | #[repr(transparent)] |
| 8750 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 10403 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| @@ -8759,12 +10412,21 @@ pub mod spi_v3 { | |||
| 8759 | } | 10412 | } |
| 8760 | #[repr(transparent)] | 10413 | #[repr(transparent)] |
| 8761 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 10414 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8762 | pub struct Ssiop(pub u8); | 10415 | pub struct Master(pub u8); |
| 8763 | impl Ssiop { | 10416 | impl Master { |
| 8764 | #[doc = "Low level is active for SS signal"] | 10417 | #[doc = "Slave configuration"] |
| 8765 | pub const ACTIVELOW: Self = Self(0); | 10418 | pub const SLAVE: Self = Self(0); |
| 8766 | #[doc = "High level is active for SS signal"] | 10419 | #[doc = "Master configuration"] |
| 8767 | pub const ACTIVEHIGH: Self = Self(0x01); | 10420 | pub const MASTER: Self = Self(0x01); |
| 10421 | } | ||
| 10422 | #[repr(transparent)] | ||
| 10423 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 10424 | pub struct Rxwne(pub u8); | ||
| 10425 | impl Rxwne { | ||
| 10426 | #[doc = "Less than 32-bit data frame received"] | ||
| 10427 | pub const LESSTHAN32: Self = Self(0); | ||
| 10428 | #[doc = "At least 32-bit data frame received"] | ||
| 10429 | pub const ATLEAST32: Self = Self(0x01); | ||
| 8768 | } | 10430 | } |
| 8769 | #[repr(transparent)] | 10431 | #[repr(transparent)] |
| 8770 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 10432 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| @@ -8805,28 +10467,6 @@ pub mod spi_v3 { | |||
| 8805 | } | 10467 | } |
| 8806 | #[repr(transparent)] | 10468 | #[repr(transparent)] |
| 8807 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 10469 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8808 | pub struct Rxwne(pub u8); | ||
| 8809 | impl Rxwne { | ||
| 8810 | #[doc = "Less than 32-bit data frame received"] | ||
| 8811 | pub const LESSTHAN32: Self = Self(0); | ||
| 8812 | #[doc = "At least 32-bit data frame received"] | ||
| 8813 | pub const ATLEAST32: Self = Self(0x01); | ||
| 8814 | } | ||
| 8815 | #[repr(transparent)] | ||
| 8816 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 8817 | pub struct Comm(pub u8); | ||
| 8818 | impl Comm { | ||
| 8819 | #[doc = "Full duplex"] | ||
| 8820 | pub const FULLDUPLEX: Self = Self(0); | ||
| 8821 | #[doc = "Simplex transmitter only"] | ||
| 8822 | pub const TRANSMITTER: Self = Self(0x01); | ||
| 8823 | #[doc = "Simplex receiver only"] | ||
| 8824 | pub const RECEIVER: Self = Self(0x02); | ||
| 8825 | #[doc = "Half duplex"] | ||
| 8826 | pub const HALFDUPLEX: Self = Self(0x03); | ||
| 8827 | } | ||
| 8828 | #[repr(transparent)] | ||
| 8829 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 8830 | pub struct Hddir(pub u8); | 10470 | pub struct Hddir(pub u8); |
| 8831 | impl Hddir { | 10471 | impl Hddir { |
| 8832 | #[doc = "Receiver in half duplex mode"] | 10472 | #[doc = "Receiver in half duplex mode"] |
| @@ -8836,39 +10476,56 @@ pub mod spi_v3 { | |||
| 8836 | } | 10476 | } |
| 8837 | #[repr(transparent)] | 10477 | #[repr(transparent)] |
| 8838 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 10478 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8839 | pub struct Crc(pub u8); | 10479 | pub struct Rxplvl(pub u8); |
| 8840 | impl Crc { | 10480 | impl Rxplvl { |
| 8841 | #[doc = "Full size (33/17 bit) CRC polynomial is not used"] | 10481 | #[doc = "Zero frames beyond packing ratio available"] |
| 8842 | pub const DISABLED: Self = Self(0); | 10482 | pub const ZEROFRAMES: Self = Self(0); |
| 8843 | #[doc = "Full size (33/17 bit) CRC polynomial is used"] | 10483 | #[doc = "One frame beyond packing ratio available"] |
| 8844 | pub const ENABLED: Self = Self(0x01); | 10484 | pub const ONEFRAME: Self = Self(0x01); |
| 10485 | #[doc = "Two frame beyond packing ratio available"] | ||
| 10486 | pub const TWOFRAMES: Self = Self(0x02); | ||
| 10487 | #[doc = "Three frame beyond packing ratio available"] | ||
| 10488 | pub const THREEFRAMES: Self = Self(0x03); | ||
| 8845 | } | 10489 | } |
| 8846 | #[repr(transparent)] | 10490 | #[repr(transparent)] |
| 8847 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 10491 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8848 | pub struct Datfmt(pub u8); | 10492 | pub struct Lsbfrst(pub u8); |
| 8849 | impl Datfmt { | 10493 | impl Lsbfrst { |
| 8850 | #[doc = "The data inside RXDR and TXDR are right aligned"] | 10494 | #[doc = "Data is transmitted/received with the MSB first"] |
| 8851 | pub const RIGHTALIGNED: Self = Self(0); | 10495 | pub const MSBFIRST: Self = Self(0); |
| 8852 | #[doc = "The data inside RXDR and TXDR are left aligned"] | 10496 | #[doc = "Data is transmitted/received with the LSB first"] |
| 8853 | pub const LEFTALIGNED: Self = Self(0x01); | 10497 | pub const LSBFIRST: Self = Self(0x01); |
| 8854 | } | 10498 | } |
| 8855 | #[repr(transparent)] | 10499 | #[repr(transparent)] |
| 8856 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 10500 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8857 | pub struct Sp(pub u8); | 10501 | pub struct Udrcfg(pub u8); |
| 8858 | impl Sp { | 10502 | impl Udrcfg { |
| 8859 | #[doc = "Motorola SPI protocol"] | 10503 | #[doc = "Slave sends a constant underrun pattern"] |
| 8860 | pub const MOTOROLA: Self = Self(0); | 10504 | pub const CONSTANT: Self = Self(0); |
| 8861 | #[doc = "TI SPI protocol"] | 10505 | #[doc = "Slave repeats last received data frame from master"] |
| 8862 | pub const TI: Self = Self(0x01); | 10506 | pub const REPEATRECEIVED: Self = Self(0x01); |
| 10507 | #[doc = "Slave repeats last transmitted data frame"] | ||
| 10508 | pub const REPEATTRANSMITTED: Self = Self(0x02); | ||
| 8863 | } | 10509 | } |
| 8864 | #[repr(transparent)] | 10510 | #[repr(transparent)] |
| 8865 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 10511 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8866 | pub struct Afcntr(pub u8); | 10512 | pub struct Datlen(pub u8); |
| 8867 | impl Afcntr { | 10513 | impl Datlen { |
| 8868 | #[doc = "Peripheral takes no control of GPIOs while disabled"] | 10514 | #[doc = "16 bit data length"] |
| 8869 | pub const NOTCONTROLLED: Self = Self(0); | 10515 | pub const BITS16: Self = Self(0); |
| 8870 | #[doc = "Peripheral controls GPIOs while disabled"] | 10516 | #[doc = "24 bit data length"] |
| 8871 | pub const CONTROLLED: Self = Self(0x01); | 10517 | pub const BITS24: Self = Self(0x01); |
| 10518 | #[doc = "32 bit data length"] | ||
| 10519 | pub const BITS32: Self = Self(0x02); | ||
| 10520 | } | ||
| 10521 | #[repr(transparent)] | ||
| 10522 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 10523 | pub struct Cpol(pub u8); | ||
| 10524 | impl Cpol { | ||
| 10525 | #[doc = "CK to 0 when idle"] | ||
| 10526 | pub const IDLELOW: Self = Self(0); | ||
| 10527 | #[doc = "CK to 1 when idle"] | ||
| 10528 | pub const IDLEHIGH: Self = Self(0x01); | ||
| 8872 | } | 10529 | } |
| 8873 | #[repr(transparent)] | 10530 | #[repr(transparent)] |
| 8874 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 10531 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| @@ -8881,14 +10538,34 @@ pub mod spi_v3 { | |||
| 8881 | } | 10538 | } |
| 8882 | #[repr(transparent)] | 10539 | #[repr(transparent)] |
| 8883 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 10540 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8884 | pub struct Udrcfg(pub u8); | 10541 | pub struct Ssiop(pub u8); |
| 8885 | impl Udrcfg { | 10542 | impl Ssiop { |
| 8886 | #[doc = "Slave sends a constant underrun pattern"] | 10543 | #[doc = "Low level is active for SS signal"] |
| 8887 | pub const CONSTANT: Self = Self(0); | 10544 | pub const ACTIVELOW: Self = Self(0); |
| 8888 | #[doc = "Slave repeats last received data frame from master"] | 10545 | #[doc = "High level is active for SS signal"] |
| 8889 | pub const REPEATRECEIVED: Self = Self(0x01); | 10546 | pub const ACTIVEHIGH: Self = Self(0x01); |
| 8890 | #[doc = "Slave repeats last transmitted data frame"] | 10547 | } |
| 8891 | pub const REPEATTRANSMITTED: Self = Self(0x02); | 10548 | #[repr(transparent)] |
| 10549 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 10550 | pub struct Comm(pub u8); | ||
| 10551 | impl Comm { | ||
| 10552 | #[doc = "Full duplex"] | ||
| 10553 | pub const FULLDUPLEX: Self = Self(0); | ||
| 10554 | #[doc = "Simplex transmitter only"] | ||
| 10555 | pub const TRANSMITTER: Self = Self(0x01); | ||
| 10556 | #[doc = "Simplex receiver only"] | ||
| 10557 | pub const RECEIVER: Self = Self(0x02); | ||
| 10558 | #[doc = "Half duplex"] | ||
| 10559 | pub const HALFDUPLEX: Self = Self(0x03); | ||
| 10560 | } | ||
| 10561 | #[repr(transparent)] | ||
| 10562 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 10563 | pub struct Datfmt(pub u8); | ||
| 10564 | impl Datfmt { | ||
| 10565 | #[doc = "The data inside RXDR and TXDR are right aligned"] | ||
| 10566 | pub const RIGHTALIGNED: Self = Self(0); | ||
| 10567 | #[doc = "The data inside RXDR and TXDR are left aligned"] | ||
| 10568 | pub const LEFTALIGNED: Self = Self(0x01); | ||
| 8892 | } | 10569 | } |
| 8893 | #[repr(transparent)] | 10570 | #[repr(transparent)] |
| 8894 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 10571 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| @@ -8901,21 +10578,42 @@ pub mod spi_v3 { | |||
| 8901 | } | 10578 | } |
| 8902 | #[repr(transparent)] | 10579 | #[repr(transparent)] |
| 8903 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 10580 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8904 | pub struct Cpha(pub u8); | 10581 | pub struct Afcntr(pub u8); |
| 8905 | impl Cpha { | 10582 | impl Afcntr { |
| 8906 | #[doc = "The first clock transition is the first data capture edge"] | 10583 | #[doc = "Peripheral takes no control of GPIOs while disabled"] |
| 8907 | pub const FIRSTEDGE: Self = Self(0); | 10584 | pub const NOTCONTROLLED: Self = Self(0); |
| 8908 | #[doc = "The second clock transition is the first data capture edge"] | 10585 | #[doc = "Peripheral controls GPIOs while disabled"] |
| 8909 | pub const SECONDEDGE: Self = Self(0x01); | 10586 | pub const CONTROLLED: Self = Self(0x01); |
| 8910 | } | 10587 | } |
| 8911 | #[repr(transparent)] | 10588 | #[repr(transparent)] |
| 8912 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 10589 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8913 | pub struct Cpol(pub u8); | 10590 | pub struct Mbr(pub u8); |
| 8914 | impl Cpol { | 10591 | impl Mbr { |
| 8915 | #[doc = "CK to 0 when idle"] | 10592 | #[doc = "f_spi_ker_ck / 2"] |
| 8916 | pub const IDLELOW: Self = Self(0); | 10593 | pub const DIV2: Self = Self(0); |
| 8917 | #[doc = "CK to 1 when idle"] | 10594 | #[doc = "f_spi_ker_ck / 4"] |
| 8918 | pub const IDLEHIGH: Self = Self(0x01); | 10595 | pub const DIV4: Self = Self(0x01); |
| 10596 | #[doc = "f_spi_ker_ck / 8"] | ||
| 10597 | pub const DIV8: Self = Self(0x02); | ||
| 10598 | #[doc = "f_spi_ker_ck / 16"] | ||
| 10599 | pub const DIV16: Self = Self(0x03); | ||
| 10600 | #[doc = "f_spi_ker_ck / 32"] | ||
| 10601 | pub const DIV32: Self = Self(0x04); | ||
| 10602 | #[doc = "f_spi_ker_ck / 64"] | ||
| 10603 | pub const DIV64: Self = Self(0x05); | ||
| 10604 | #[doc = "f_spi_ker_ck / 128"] | ||
| 10605 | pub const DIV128: Self = Self(0x06); | ||
| 10606 | #[doc = "f_spi_ker_ck / 256"] | ||
| 10607 | pub const DIV256: Self = Self(0x07); | ||
| 10608 | } | ||
| 10609 | #[repr(transparent)] | ||
| 10610 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 10611 | pub struct Crc(pub u8); | ||
| 10612 | impl Crc { | ||
| 10613 | #[doc = "Full size (33/17 bit) CRC polynomial is not used"] | ||
| 10614 | pub const DISABLED: Self = Self(0); | ||
| 10615 | #[doc = "Full size (33/17 bit) CRC polynomial is used"] | ||
| 10616 | pub const ENABLED: Self = Self(0x01); | ||
| 8919 | } | 10617 | } |
| 8920 | #[repr(transparent)] | 10618 | #[repr(transparent)] |
| 8921 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 10619 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| @@ -8928,1138 +10626,2038 @@ pub mod spi_v3 { | |||
| 8928 | } | 10626 | } |
| 8929 | #[repr(transparent)] | 10627 | #[repr(transparent)] |
| 8930 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 10628 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 8931 | pub struct Datlen(pub u8); | 10629 | pub struct Cpha(pub u8); |
| 8932 | impl Datlen { | 10630 | impl Cpha { |
| 8933 | #[doc = "16 bit data length"] | 10631 | #[doc = "The first clock transition is the first data capture edge"] |
| 8934 | pub const BITS16: Self = Self(0); | 10632 | pub const FIRSTEDGE: Self = Self(0); |
| 8935 | #[doc = "24 bit data length"] | 10633 | #[doc = "The second clock transition is the first data capture edge"] |
| 8936 | pub const BITS24: Self = Self(0x01); | 10634 | pub const SECONDEDGE: Self = Self(0x01); |
| 8937 | #[doc = "32 bit data length"] | ||
| 8938 | pub const BITS32: Self = Self(0x02); | ||
| 8939 | } | 10635 | } |
| 8940 | #[repr(transparent)] | 10636 | } |
| 8941 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 10637 | } |
| 8942 | pub struct Rxplvl(pub u8); | 10638 | pub mod spi_v1 { |
| 8943 | impl Rxplvl { | 10639 | use crate::generic::*; |
| 8944 | #[doc = "Zero frames beyond packing ratio available"] | 10640 | #[doc = "Serial peripheral interface"] |
| 8945 | pub const ZEROFRAMES: Self = Self(0); | 10641 | #[derive(Copy, Clone)] |
| 8946 | #[doc = "One frame beyond packing ratio available"] | 10642 | pub struct Spi(pub *mut u8); |
| 8947 | pub const ONEFRAME: Self = Self(0x01); | 10643 | unsafe impl Send for Spi {} |
| 8948 | #[doc = "Two frame beyond packing ratio available"] | 10644 | unsafe impl Sync for Spi {} |
| 8949 | pub const TWOFRAMES: Self = Self(0x02); | 10645 | impl Spi { |
| 8950 | #[doc = "Three frame beyond packing ratio available"] | 10646 | #[doc = "control register 1"] |
| 8951 | pub const THREEFRAMES: Self = Self(0x03); | 10647 | pub fn cr1(self) -> Reg<regs::Cr1, RW> { |
| 10648 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 8952 | } | 10649 | } |
| 8953 | #[repr(transparent)] | 10650 | #[doc = "control register 2"] |
| 8954 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 10651 | pub fn cr2(self) -> Reg<regs::Cr2, RW> { |
| 8955 | pub struct Lsbfrst(pub u8); | 10652 | unsafe { Reg::from_ptr(self.0.add(4usize)) } |
| 8956 | impl Lsbfrst { | 10653 | } |
| 8957 | #[doc = "Data is transmitted/received with the MSB first"] | 10654 | #[doc = "status register"] |
| 8958 | pub const MSBFIRST: Self = Self(0); | 10655 | pub fn sr(self) -> Reg<regs::Sr, RW> { |
| 8959 | #[doc = "Data is transmitted/received with the LSB first"] | 10656 | unsafe { Reg::from_ptr(self.0.add(8usize)) } |
| 8960 | pub const LSBFIRST: Self = Self(0x01); | 10657 | } |
| 10658 | #[doc = "data register"] | ||
| 10659 | pub fn dr(self) -> Reg<regs::Dr, RW> { | ||
| 10660 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 10661 | } | ||
| 10662 | #[doc = "CRC polynomial register"] | ||
| 10663 | pub fn crcpr(self) -> Reg<regs::Crcpr, RW> { | ||
| 10664 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 10665 | } | ||
| 10666 | #[doc = "RX CRC register"] | ||
| 10667 | pub fn rxcrcr(self) -> Reg<regs::Rxcrcr, R> { | ||
| 10668 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 10669 | } | ||
| 10670 | #[doc = "TX CRC register"] | ||
| 10671 | pub fn txcrcr(self) -> Reg<regs::Txcrcr, R> { | ||
| 10672 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | ||
| 8961 | } | 10673 | } |
| 8962 | } | 10674 | } |
| 8963 | pub mod regs { | 10675 | pub mod regs { |
| 8964 | use crate::generic::*; | 10676 | use crate::generic::*; |
| 8965 | #[doc = "Underrun Data Register"] | 10677 | #[doc = "RX CRC register"] |
| 8966 | #[repr(transparent)] | ||
| 8967 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 8968 | pub struct Udrdr(pub u32); | ||
| 8969 | impl Udrdr { | ||
| 8970 | #[doc = "Data at slave underrun condition"] | ||
| 8971 | pub const fn udrdr(&self) -> u32 { | ||
| 8972 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 8973 | val as u32 | ||
| 8974 | } | ||
| 8975 | #[doc = "Data at slave underrun condition"] | ||
| 8976 | pub fn set_udrdr(&mut self, val: u32) { | ||
| 8977 | self.0 = | ||
| 8978 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 8979 | } | ||
| 8980 | } | ||
| 8981 | impl Default for Udrdr { | ||
| 8982 | fn default() -> Udrdr { | ||
| 8983 | Udrdr(0) | ||
| 8984 | } | ||
| 8985 | } | ||
| 8986 | #[doc = "Transmitter CRC Register"] | ||
| 8987 | #[repr(transparent)] | 10678 | #[repr(transparent)] |
| 8988 | #[derive(Copy, Clone, Eq, PartialEq)] | 10679 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 8989 | pub struct Txcrc(pub u32); | 10680 | pub struct Rxcrcr(pub u32); |
| 8990 | impl Txcrc { | 10681 | impl Rxcrcr { |
| 8991 | #[doc = "CRC register for transmitter"] | 10682 | #[doc = "Rx CRC register"] |
| 8992 | pub const fn txcrc(&self) -> u32 { | 10683 | pub const fn rx_crc(&self) -> u16 { |
| 8993 | let val = (self.0 >> 0usize) & 0xffff_ffff; | 10684 | let val = (self.0 >> 0usize) & 0xffff; |
| 8994 | val as u32 | 10685 | val as u16 |
| 8995 | } | 10686 | } |
| 8996 | #[doc = "CRC register for transmitter"] | 10687 | #[doc = "Rx CRC register"] |
| 8997 | pub fn set_txcrc(&mut self, val: u32) { | 10688 | pub fn set_rx_crc(&mut self, val: u16) { |
| 8998 | self.0 = | 10689 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); |
| 8999 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 9000 | } | 10690 | } |
| 9001 | } | 10691 | } |
| 9002 | impl Default for Txcrc { | 10692 | impl Default for Rxcrcr { |
| 9003 | fn default() -> Txcrc { | 10693 | fn default() -> Rxcrcr { |
| 9004 | Txcrc(0) | 10694 | Rxcrcr(0) |
| 9005 | } | 10695 | } |
| 9006 | } | 10696 | } |
| 9007 | #[doc = "Polynomial Register"] | 10697 | #[doc = "CRC polynomial register"] |
| 9008 | #[repr(transparent)] | 10698 | #[repr(transparent)] |
| 9009 | #[derive(Copy, Clone, Eq, PartialEq)] | 10699 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9010 | pub struct Crcpoly(pub u32); | 10700 | pub struct Crcpr(pub u32); |
| 9011 | impl Crcpoly { | 10701 | impl Crcpr { |
| 9012 | #[doc = "CRC polynomial register"] | 10702 | #[doc = "CRC polynomial register"] |
| 9013 | pub const fn crcpoly(&self) -> u32 { | 10703 | pub const fn crcpoly(&self) -> u16 { |
| 9014 | let val = (self.0 >> 0usize) & 0xffff_ffff; | 10704 | let val = (self.0 >> 0usize) & 0xffff; |
| 9015 | val as u32 | 10705 | val as u16 |
| 9016 | } | 10706 | } |
| 9017 | #[doc = "CRC polynomial register"] | 10707 | #[doc = "CRC polynomial register"] |
| 9018 | pub fn set_crcpoly(&mut self, val: u32) { | 10708 | pub fn set_crcpoly(&mut self, val: u16) { |
| 9019 | self.0 = | 10709 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); |
| 9020 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 9021 | } | 10710 | } |
| 9022 | } | 10711 | } |
| 9023 | impl Default for Crcpoly { | 10712 | impl Default for Crcpr { |
| 9024 | fn default() -> Crcpoly { | 10713 | fn default() -> Crcpr { |
| 9025 | Crcpoly(0) | 10714 | Crcpr(0) |
| 9026 | } | 10715 | } |
| 9027 | } | 10716 | } |
| 9028 | #[doc = "configuration register 1"] | 10717 | #[doc = "control register 2"] |
| 9029 | #[repr(transparent)] | 10718 | #[repr(transparent)] |
| 9030 | #[derive(Copy, Clone, Eq, PartialEq)] | 10719 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9031 | pub struct Cfg1(pub u32); | 10720 | pub struct Cr2(pub u32); |
| 9032 | impl Cfg1 { | 10721 | impl Cr2 { |
| 9033 | #[doc = "Number of bits in at single SPI data frame"] | 10722 | #[doc = "Rx buffer DMA enable"] |
| 9034 | pub const fn dsize(&self) -> u8 { | 10723 | pub const fn rxdmaen(&self) -> bool { |
| 9035 | let val = (self.0 >> 0usize) & 0x1f; | 10724 | let val = (self.0 >> 0usize) & 0x01; |
| 9036 | val as u8 | 10725 | val != 0 |
| 9037 | } | 10726 | } |
| 9038 | #[doc = "Number of bits in at single SPI data frame"] | 10727 | #[doc = "Rx buffer DMA enable"] |
| 9039 | pub fn set_dsize(&mut self, val: u8) { | 10728 | pub fn set_rxdmaen(&mut self, val: bool) { |
| 9040 | self.0 = (self.0 & !(0x1f << 0usize)) | (((val as u32) & 0x1f) << 0usize); | 10729 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 9041 | } | 10730 | } |
| 9042 | #[doc = "threshold level"] | 10731 | #[doc = "Tx buffer DMA enable"] |
| 9043 | pub const fn fthlv(&self) -> super::vals::Fthlv { | 10732 | pub const fn txdmaen(&self) -> bool { |
| 9044 | let val = (self.0 >> 5usize) & 0x0f; | 10733 | let val = (self.0 >> 1usize) & 0x01; |
| 9045 | super::vals::Fthlv(val as u8) | 10734 | val != 0 |
| 9046 | } | 10735 | } |
| 9047 | #[doc = "threshold level"] | 10736 | #[doc = "Tx buffer DMA enable"] |
| 9048 | pub fn set_fthlv(&mut self, val: super::vals::Fthlv) { | 10737 | pub fn set_txdmaen(&mut self, val: bool) { |
| 9049 | self.0 = (self.0 & !(0x0f << 5usize)) | (((val.0 as u32) & 0x0f) << 5usize); | 10738 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 9050 | } | 10739 | } |
| 9051 | #[doc = "Behavior of slave transmitter at underrun condition"] | 10740 | #[doc = "SS output enable"] |
| 9052 | pub const fn udrcfg(&self) -> super::vals::Udrcfg { | 10741 | pub const fn ssoe(&self) -> bool { |
| 9053 | let val = (self.0 >> 9usize) & 0x03; | 10742 | let val = (self.0 >> 2usize) & 0x01; |
| 9054 | super::vals::Udrcfg(val as u8) | 10743 | val != 0 |
| 9055 | } | 10744 | } |
| 9056 | #[doc = "Behavior of slave transmitter at underrun condition"] | 10745 | #[doc = "SS output enable"] |
| 9057 | pub fn set_udrcfg(&mut self, val: super::vals::Udrcfg) { | 10746 | pub fn set_ssoe(&mut self, val: bool) { |
| 9058 | self.0 = (self.0 & !(0x03 << 9usize)) | (((val.0 as u32) & 0x03) << 9usize); | 10747 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 9059 | } | 10748 | } |
| 9060 | #[doc = "Detection of underrun condition at slave transmitter"] | 10749 | #[doc = "Frame format"] |
| 9061 | pub const fn udrdet(&self) -> super::vals::Udrdet { | 10750 | pub const fn frf(&self) -> super::vals::Frf { |
| 9062 | let val = (self.0 >> 11usize) & 0x03; | 10751 | let val = (self.0 >> 4usize) & 0x01; |
| 9063 | super::vals::Udrdet(val as u8) | 10752 | super::vals::Frf(val as u8) |
| 9064 | } | 10753 | } |
| 9065 | #[doc = "Detection of underrun condition at slave transmitter"] | 10754 | #[doc = "Frame format"] |
| 9066 | pub fn set_udrdet(&mut self, val: super::vals::Udrdet) { | 10755 | pub fn set_frf(&mut self, val: super::vals::Frf) { |
| 9067 | self.0 = (self.0 & !(0x03 << 11usize)) | (((val.0 as u32) & 0x03) << 11usize); | 10756 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); |
| 9068 | } | 10757 | } |
| 9069 | #[doc = "Rx DMA stream enable"] | 10758 | #[doc = "Error interrupt enable"] |
| 9070 | pub const fn rxdmaen(&self) -> bool { | 10759 | pub const fn errie(&self) -> bool { |
| 9071 | let val = (self.0 >> 14usize) & 0x01; | 10760 | let val = (self.0 >> 5usize) & 0x01; |
| 9072 | val != 0 | 10761 | val != 0 |
| 9073 | } | 10762 | } |
| 9074 | #[doc = "Rx DMA stream enable"] | 10763 | #[doc = "Error interrupt enable"] |
| 9075 | pub fn set_rxdmaen(&mut self, val: bool) { | 10764 | pub fn set_errie(&mut self, val: bool) { |
| 9076 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | 10765 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 9077 | } | 10766 | } |
| 9078 | #[doc = "Tx DMA stream enable"] | 10767 | #[doc = "RX buffer not empty interrupt enable"] |
| 9079 | pub const fn txdmaen(&self) -> bool { | 10768 | pub const fn rxneie(&self) -> bool { |
| 9080 | let val = (self.0 >> 15usize) & 0x01; | 10769 | let val = (self.0 >> 6usize) & 0x01; |
| 9081 | val != 0 | 10770 | val != 0 |
| 9082 | } | 10771 | } |
| 9083 | #[doc = "Tx DMA stream enable"] | 10772 | #[doc = "RX buffer not empty interrupt enable"] |
| 9084 | pub fn set_txdmaen(&mut self, val: bool) { | 10773 | pub fn set_rxneie(&mut self, val: bool) { |
| 9085 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); | 10774 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 9086 | } | ||
| 9087 | #[doc = "Length of CRC frame to be transacted and compared"] | ||
| 9088 | pub const fn crcsize(&self) -> u8 { | ||
| 9089 | let val = (self.0 >> 16usize) & 0x1f; | ||
| 9090 | val as u8 | ||
| 9091 | } | ||
| 9092 | #[doc = "Length of CRC frame to be transacted and compared"] | ||
| 9093 | pub fn set_crcsize(&mut self, val: u8) { | ||
| 9094 | self.0 = (self.0 & !(0x1f << 16usize)) | (((val as u32) & 0x1f) << 16usize); | ||
| 9095 | } | 10775 | } |
| 9096 | #[doc = "Hardware CRC computation enable"] | 10776 | #[doc = "Tx buffer empty interrupt enable"] |
| 9097 | pub const fn crcen(&self) -> bool { | 10777 | pub const fn txeie(&self) -> bool { |
| 9098 | let val = (self.0 >> 22usize) & 0x01; | 10778 | let val = (self.0 >> 7usize) & 0x01; |
| 9099 | val != 0 | 10779 | val != 0 |
| 9100 | } | 10780 | } |
| 9101 | #[doc = "Hardware CRC computation enable"] | 10781 | #[doc = "Tx buffer empty interrupt enable"] |
| 9102 | pub fn set_crcen(&mut self, val: bool) { | 10782 | pub fn set_txeie(&mut self, val: bool) { |
| 9103 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); | 10783 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 9104 | } | 10784 | } |
| 9105 | #[doc = "Master baud rate"] | 10785 | } |
| 9106 | pub const fn mbr(&self) -> super::vals::Mbr { | 10786 | impl Default for Cr2 { |
| 9107 | let val = (self.0 >> 28usize) & 0x07; | 10787 | fn default() -> Cr2 { |
| 9108 | super::vals::Mbr(val as u8) | 10788 | Cr2(0) |
| 9109 | } | 10789 | } |
| 9110 | #[doc = "Master baud rate"] | 10790 | } |
| 9111 | pub fn set_mbr(&mut self, val: super::vals::Mbr) { | 10791 | #[doc = "TX CRC register"] |
| 9112 | self.0 = (self.0 & !(0x07 << 28usize)) | (((val.0 as u32) & 0x07) << 28usize); | 10792 | #[repr(transparent)] |
| 10793 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 10794 | pub struct Txcrcr(pub u32); | ||
| 10795 | impl Txcrcr { | ||
| 10796 | #[doc = "Tx CRC register"] | ||
| 10797 | pub const fn tx_crc(&self) -> u16 { | ||
| 10798 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 10799 | val as u16 | ||
| 10800 | } | ||
| 10801 | #[doc = "Tx CRC register"] | ||
| 10802 | pub fn set_tx_crc(&mut self, val: u16) { | ||
| 10803 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 9113 | } | 10804 | } |
| 9114 | } | 10805 | } |
| 9115 | impl Default for Cfg1 { | 10806 | impl Default for Txcrcr { |
| 9116 | fn default() -> Cfg1 { | 10807 | fn default() -> Txcrcr { |
| 9117 | Cfg1(0) | 10808 | Txcrcr(0) |
| 9118 | } | 10809 | } |
| 9119 | } | 10810 | } |
| 9120 | #[doc = "configuration register 2"] | 10811 | #[doc = "status register"] |
| 9121 | #[repr(transparent)] | 10812 | #[repr(transparent)] |
| 9122 | #[derive(Copy, Clone, Eq, PartialEq)] | 10813 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9123 | pub struct Cfg2(pub u32); | 10814 | pub struct Sr(pub u32); |
| 9124 | impl Cfg2 { | 10815 | impl Sr { |
| 9125 | #[doc = "Master SS Idleness"] | 10816 | #[doc = "Receive buffer not empty"] |
| 9126 | pub const fn mssi(&self) -> u8 { | 10817 | pub const fn rxne(&self) -> bool { |
| 9127 | let val = (self.0 >> 0usize) & 0x0f; | 10818 | let val = (self.0 >> 0usize) & 0x01; |
| 9128 | val as u8 | 10819 | val != 0 |
| 9129 | } | 10820 | } |
| 9130 | #[doc = "Master SS Idleness"] | 10821 | #[doc = "Receive buffer not empty"] |
| 9131 | pub fn set_mssi(&mut self, val: u8) { | 10822 | pub fn set_rxne(&mut self, val: bool) { |
| 9132 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); | 10823 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 9133 | } | 10824 | } |
| 9134 | #[doc = "Master Inter-Data Idleness"] | 10825 | #[doc = "Transmit buffer empty"] |
| 9135 | pub const fn midi(&self) -> u8 { | 10826 | pub const fn txe(&self) -> bool { |
| 9136 | let val = (self.0 >> 4usize) & 0x0f; | 10827 | let val = (self.0 >> 1usize) & 0x01; |
| 9137 | val as u8 | 10828 | val != 0 |
| 9138 | } | 10829 | } |
| 9139 | #[doc = "Master Inter-Data Idleness"] | 10830 | #[doc = "Transmit buffer empty"] |
| 9140 | pub fn set_midi(&mut self, val: u8) { | 10831 | pub fn set_txe(&mut self, val: bool) { |
| 9141 | self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize); | 10832 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 9142 | } | 10833 | } |
| 9143 | #[doc = "Swap functionality of MISO and MOSI pins"] | 10834 | #[doc = "CRC error flag"] |
| 9144 | pub const fn ioswp(&self) -> bool { | 10835 | pub const fn crcerr(&self) -> bool { |
| 9145 | let val = (self.0 >> 15usize) & 0x01; | 10836 | let val = (self.0 >> 4usize) & 0x01; |
| 9146 | val != 0 | 10837 | val != 0 |
| 9147 | } | 10838 | } |
| 9148 | #[doc = "Swap functionality of MISO and MOSI pins"] | 10839 | #[doc = "CRC error flag"] |
| 9149 | pub fn set_ioswp(&mut self, val: bool) { | 10840 | pub fn set_crcerr(&mut self, val: bool) { |
| 9150 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); | 10841 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 9151 | } | 10842 | } |
| 9152 | #[doc = "SPI Communication Mode"] | 10843 | #[doc = "Mode fault"] |
| 9153 | pub const fn comm(&self) -> super::vals::Comm { | 10844 | pub const fn modf(&self) -> bool { |
| 9154 | let val = (self.0 >> 17usize) & 0x03; | 10845 | let val = (self.0 >> 5usize) & 0x01; |
| 9155 | super::vals::Comm(val as u8) | 10846 | val != 0 |
| 9156 | } | 10847 | } |
| 9157 | #[doc = "SPI Communication Mode"] | 10848 | #[doc = "Mode fault"] |
| 9158 | pub fn set_comm(&mut self, val: super::vals::Comm) { | 10849 | pub fn set_modf(&mut self, val: bool) { |
| 9159 | self.0 = (self.0 & !(0x03 << 17usize)) | (((val.0 as u32) & 0x03) << 17usize); | 10850 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 9160 | } | 10851 | } |
| 9161 | #[doc = "Serial Protocol"] | 10852 | #[doc = "Overrun flag"] |
| 9162 | pub const fn sp(&self) -> super::vals::Sp { | 10853 | pub const fn ovr(&self) -> bool { |
| 9163 | let val = (self.0 >> 19usize) & 0x07; | 10854 | let val = (self.0 >> 6usize) & 0x01; |
| 9164 | super::vals::Sp(val as u8) | 10855 | val != 0 |
| 9165 | } | 10856 | } |
| 9166 | #[doc = "Serial Protocol"] | 10857 | #[doc = "Overrun flag"] |
| 9167 | pub fn set_sp(&mut self, val: super::vals::Sp) { | 10858 | pub fn set_ovr(&mut self, val: bool) { |
| 9168 | self.0 = (self.0 & !(0x07 << 19usize)) | (((val.0 as u32) & 0x07) << 19usize); | 10859 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 9169 | } | 10860 | } |
| 9170 | #[doc = "SPI Master"] | 10861 | #[doc = "Busy flag"] |
| 9171 | pub const fn master(&self) -> super::vals::Master { | 10862 | pub const fn bsy(&self) -> bool { |
| 9172 | let val = (self.0 >> 22usize) & 0x01; | 10863 | let val = (self.0 >> 7usize) & 0x01; |
| 9173 | super::vals::Master(val as u8) | 10864 | val != 0 |
| 9174 | } | 10865 | } |
| 9175 | #[doc = "SPI Master"] | 10866 | #[doc = "Busy flag"] |
| 9176 | pub fn set_master(&mut self, val: super::vals::Master) { | 10867 | pub fn set_bsy(&mut self, val: bool) { |
| 9177 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize); | 10868 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 9178 | } | 10869 | } |
| 9179 | #[doc = "Data frame format"] | 10870 | #[doc = "TI frame format error"] |
| 9180 | pub const fn lsbfrst(&self) -> super::vals::Lsbfrst { | 10871 | pub const fn fre(&self) -> bool { |
| 9181 | let val = (self.0 >> 23usize) & 0x01; | 10872 | let val = (self.0 >> 8usize) & 0x01; |
| 9182 | super::vals::Lsbfrst(val as u8) | 10873 | val != 0 |
| 9183 | } | 10874 | } |
| 9184 | #[doc = "Data frame format"] | 10875 | #[doc = "TI frame format error"] |
| 9185 | pub fn set_lsbfrst(&mut self, val: super::vals::Lsbfrst) { | 10876 | pub fn set_fre(&mut self, val: bool) { |
| 9186 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize); | 10877 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 9187 | } | 10878 | } |
| 10879 | } | ||
| 10880 | impl Default for Sr { | ||
| 10881 | fn default() -> Sr { | ||
| 10882 | Sr(0) | ||
| 10883 | } | ||
| 10884 | } | ||
| 10885 | #[doc = "control register 1"] | ||
| 10886 | #[repr(transparent)] | ||
| 10887 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 10888 | pub struct Cr1(pub u32); | ||
| 10889 | impl Cr1 { | ||
| 9188 | #[doc = "Clock phase"] | 10890 | #[doc = "Clock phase"] |
| 9189 | pub const fn cpha(&self) -> super::vals::Cpha { | 10891 | pub const fn cpha(&self) -> super::vals::Cpha { |
| 9190 | let val = (self.0 >> 24usize) & 0x01; | 10892 | let val = (self.0 >> 0usize) & 0x01; |
| 9191 | super::vals::Cpha(val as u8) | 10893 | super::vals::Cpha(val as u8) |
| 9192 | } | 10894 | } |
| 9193 | #[doc = "Clock phase"] | 10895 | #[doc = "Clock phase"] |
| 9194 | pub fn set_cpha(&mut self, val: super::vals::Cpha) { | 10896 | pub fn set_cpha(&mut self, val: super::vals::Cpha) { |
| 9195 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); | 10897 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 9196 | } | 10898 | } |
| 9197 | #[doc = "Clock polarity"] | 10899 | #[doc = "Clock polarity"] |
| 9198 | pub const fn cpol(&self) -> super::vals::Cpol { | 10900 | pub const fn cpol(&self) -> super::vals::Cpol { |
| 9199 | let val = (self.0 >> 25usize) & 0x01; | 10901 | let val = (self.0 >> 1usize) & 0x01; |
| 9200 | super::vals::Cpol(val as u8) | 10902 | super::vals::Cpol(val as u8) |
| 9201 | } | 10903 | } |
| 9202 | #[doc = "Clock polarity"] | 10904 | #[doc = "Clock polarity"] |
| 9203 | pub fn set_cpol(&mut self, val: super::vals::Cpol) { | 10905 | pub fn set_cpol(&mut self, val: super::vals::Cpol) { |
| 9204 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize); | 10906 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); |
| 9205 | } | 10907 | } |
| 9206 | #[doc = "Software management of SS signal input"] | 10908 | #[doc = "Master selection"] |
| 10909 | pub const fn mstr(&self) -> super::vals::Mstr { | ||
| 10910 | let val = (self.0 >> 2usize) & 0x01; | ||
| 10911 | super::vals::Mstr(val as u8) | ||
| 10912 | } | ||
| 10913 | #[doc = "Master selection"] | ||
| 10914 | pub fn set_mstr(&mut self, val: super::vals::Mstr) { | ||
| 10915 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 10916 | } | ||
| 10917 | #[doc = "Baud rate control"] | ||
| 10918 | pub const fn br(&self) -> super::vals::Br { | ||
| 10919 | let val = (self.0 >> 3usize) & 0x07; | ||
| 10920 | super::vals::Br(val as u8) | ||
| 10921 | } | ||
| 10922 | #[doc = "Baud rate control"] | ||
| 10923 | pub fn set_br(&mut self, val: super::vals::Br) { | ||
| 10924 | self.0 = (self.0 & !(0x07 << 3usize)) | (((val.0 as u32) & 0x07) << 3usize); | ||
| 10925 | } | ||
| 10926 | #[doc = "SPI enable"] | ||
| 10927 | pub const fn spe(&self) -> bool { | ||
| 10928 | let val = (self.0 >> 6usize) & 0x01; | ||
| 10929 | val != 0 | ||
| 10930 | } | ||
| 10931 | #[doc = "SPI enable"] | ||
| 10932 | pub fn set_spe(&mut self, val: bool) { | ||
| 10933 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 10934 | } | ||
| 10935 | #[doc = "Frame format"] | ||
| 10936 | pub const fn lsbfirst(&self) -> super::vals::Lsbfirst { | ||
| 10937 | let val = (self.0 >> 7usize) & 0x01; | ||
| 10938 | super::vals::Lsbfirst(val as u8) | ||
| 10939 | } | ||
| 10940 | #[doc = "Frame format"] | ||
| 10941 | pub fn set_lsbfirst(&mut self, val: super::vals::Lsbfirst) { | ||
| 10942 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 10943 | } | ||
| 10944 | #[doc = "Internal slave select"] | ||
| 10945 | pub const fn ssi(&self) -> bool { | ||
| 10946 | let val = (self.0 >> 8usize) & 0x01; | ||
| 10947 | val != 0 | ||
| 10948 | } | ||
| 10949 | #[doc = "Internal slave select"] | ||
| 10950 | pub fn set_ssi(&mut self, val: bool) { | ||
| 10951 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 10952 | } | ||
| 10953 | #[doc = "Software slave management"] | ||
| 9207 | pub const fn ssm(&self) -> bool { | 10954 | pub const fn ssm(&self) -> bool { |
| 9208 | let val = (self.0 >> 26usize) & 0x01; | 10955 | let val = (self.0 >> 9usize) & 0x01; |
| 9209 | val != 0 | 10956 | val != 0 |
| 9210 | } | 10957 | } |
| 9211 | #[doc = "Software management of SS signal input"] | 10958 | #[doc = "Software slave management"] |
| 9212 | pub fn set_ssm(&mut self, val: bool) { | 10959 | pub fn set_ssm(&mut self, val: bool) { |
| 9213 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); | 10960 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); |
| 9214 | } | 10961 | } |
| 9215 | #[doc = "SS input/output polarity"] | 10962 | #[doc = "Receive only"] |
| 9216 | pub const fn ssiop(&self) -> super::vals::Ssiop { | 10963 | pub const fn rxonly(&self) -> super::vals::Rxonly { |
| 9217 | let val = (self.0 >> 28usize) & 0x01; | 10964 | let val = (self.0 >> 10usize) & 0x01; |
| 9218 | super::vals::Ssiop(val as u8) | 10965 | super::vals::Rxonly(val as u8) |
| 9219 | } | 10966 | } |
| 9220 | #[doc = "SS input/output polarity"] | 10967 | #[doc = "Receive only"] |
| 9221 | pub fn set_ssiop(&mut self, val: super::vals::Ssiop) { | 10968 | pub fn set_rxonly(&mut self, val: super::vals::Rxonly) { |
| 9222 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); | 10969 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); |
| 9223 | } | 10970 | } |
| 9224 | #[doc = "SS output enable"] | 10971 | #[doc = "Data frame format"] |
| 9225 | pub const fn ssoe(&self) -> bool { | 10972 | pub const fn dff(&self) -> super::vals::Dff { |
| 9226 | let val = (self.0 >> 29usize) & 0x01; | 10973 | let val = (self.0 >> 11usize) & 0x01; |
| 10974 | super::vals::Dff(val as u8) | ||
| 10975 | } | ||
| 10976 | #[doc = "Data frame format"] | ||
| 10977 | pub fn set_dff(&mut self, val: super::vals::Dff) { | ||
| 10978 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); | ||
| 10979 | } | ||
| 10980 | #[doc = "CRC transfer next"] | ||
| 10981 | pub const fn crcnext(&self) -> super::vals::Crcnext { | ||
| 10982 | let val = (self.0 >> 12usize) & 0x01; | ||
| 10983 | super::vals::Crcnext(val as u8) | ||
| 10984 | } | ||
| 10985 | #[doc = "CRC transfer next"] | ||
| 10986 | pub fn set_crcnext(&mut self, val: super::vals::Crcnext) { | ||
| 10987 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 10988 | } | ||
| 10989 | #[doc = "Hardware CRC calculation enable"] | ||
| 10990 | pub const fn crcen(&self) -> bool { | ||
| 10991 | let val = (self.0 >> 13usize) & 0x01; | ||
| 9227 | val != 0 | 10992 | val != 0 |
| 9228 | } | 10993 | } |
| 9229 | #[doc = "SS output enable"] | 10994 | #[doc = "Hardware CRC calculation enable"] |
| 9230 | pub fn set_ssoe(&mut self, val: bool) { | 10995 | pub fn set_crcen(&mut self, val: bool) { |
| 9231 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize); | 10996 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); |
| 9232 | } | 10997 | } |
| 9233 | #[doc = "SS output management in master mode"] | 10998 | #[doc = "Output enable in bidirectional mode"] |
| 9234 | pub const fn ssom(&self) -> super::vals::Ssom { | 10999 | pub const fn bidioe(&self) -> super::vals::Bidioe { |
| 9235 | let val = (self.0 >> 30usize) & 0x01; | 11000 | let val = (self.0 >> 14usize) & 0x01; |
| 9236 | super::vals::Ssom(val as u8) | 11001 | super::vals::Bidioe(val as u8) |
| 9237 | } | 11002 | } |
| 9238 | #[doc = "SS output management in master mode"] | 11003 | #[doc = "Output enable in bidirectional mode"] |
| 9239 | pub fn set_ssom(&mut self, val: super::vals::Ssom) { | 11004 | pub fn set_bidioe(&mut self, val: super::vals::Bidioe) { |
| 9240 | self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize); | 11005 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); |
| 9241 | } | 11006 | } |
| 9242 | #[doc = "Alternate function GPIOs control"] | 11007 | #[doc = "Bidirectional data mode enable"] |
| 9243 | pub const fn afcntr(&self) -> super::vals::Afcntr { | 11008 | pub const fn bidimode(&self) -> super::vals::Bidimode { |
| 9244 | let val = (self.0 >> 31usize) & 0x01; | 11009 | let val = (self.0 >> 15usize) & 0x01; |
| 9245 | super::vals::Afcntr(val as u8) | 11010 | super::vals::Bidimode(val as u8) |
| 9246 | } | 11011 | } |
| 9247 | #[doc = "Alternate function GPIOs control"] | 11012 | #[doc = "Bidirectional data mode enable"] |
| 9248 | pub fn set_afcntr(&mut self, val: super::vals::Afcntr) { | 11013 | pub fn set_bidimode(&mut self, val: super::vals::Bidimode) { |
| 9249 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize); | 11014 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); |
| 9250 | } | 11015 | } |
| 9251 | } | 11016 | } |
| 9252 | impl Default for Cfg2 { | 11017 | impl Default for Cr1 { |
| 9253 | fn default() -> Cfg2 { | 11018 | fn default() -> Cr1 { |
| 9254 | Cfg2(0) | 11019 | Cr1(0) |
| 9255 | } | 11020 | } |
| 9256 | } | 11021 | } |
| 9257 | #[doc = "control register 2"] | 11022 | #[doc = "data register"] |
| 9258 | #[repr(transparent)] | 11023 | #[repr(transparent)] |
| 9259 | #[derive(Copy, Clone, Eq, PartialEq)] | 11024 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9260 | pub struct Cr2(pub u32); | 11025 | pub struct Dr(pub u32); |
| 9261 | impl Cr2 { | 11026 | impl Dr { |
| 9262 | #[doc = "Number of data at current transfer"] | 11027 | #[doc = "Data register"] |
| 9263 | pub const fn tsize(&self) -> u16 { | 11028 | pub const fn dr(&self) -> u16 { |
| 9264 | let val = (self.0 >> 0usize) & 0xffff; | 11029 | let val = (self.0 >> 0usize) & 0xffff; |
| 9265 | val as u16 | 11030 | val as u16 |
| 9266 | } | 11031 | } |
| 9267 | #[doc = "Number of data at current transfer"] | 11032 | #[doc = "Data register"] |
| 9268 | pub fn set_tsize(&mut self, val: u16) { | 11033 | pub fn set_dr(&mut self, val: u16) { |
| 9269 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | 11034 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); |
| 9270 | } | 11035 | } |
| 9271 | #[doc = "Number of data transfer extension to be reload into TSIZE just when a previous"] | 11036 | } |
| 9272 | pub const fn tser(&self) -> u16 { | 11037 | impl Default for Dr { |
| 9273 | let val = (self.0 >> 16usize) & 0xffff; | 11038 | fn default() -> Dr { |
| 9274 | val as u16 | 11039 | Dr(0) |
| 9275 | } | 11040 | } |
| 9276 | #[doc = "Number of data transfer extension to be reload into TSIZE just when a previous"] | 11041 | } |
| 9277 | pub fn set_tser(&mut self, val: u16) { | 11042 | } |
| 9278 | self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize); | 11043 | pub mod vals { |
| 11044 | use crate::generic::*; | ||
| 11045 | #[repr(transparent)] | ||
| 11046 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11047 | pub struct Dff(pub u8); | ||
| 11048 | impl Dff { | ||
| 11049 | #[doc = "8-bit data frame format is selected for transmission/reception"] | ||
| 11050 | pub const EIGHTBIT: Self = Self(0); | ||
| 11051 | #[doc = "16-bit data frame format is selected for transmission/reception"] | ||
| 11052 | pub const SIXTEENBIT: Self = Self(0x01); | ||
| 11053 | } | ||
| 11054 | #[repr(transparent)] | ||
| 11055 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11056 | pub struct Crcnext(pub u8); | ||
| 11057 | impl Crcnext { | ||
| 11058 | #[doc = "Next transmit value is from Tx buffer"] | ||
| 11059 | pub const TXBUFFER: Self = Self(0); | ||
| 11060 | #[doc = "Next transmit value is from Tx CRC register"] | ||
| 11061 | pub const CRC: Self = Self(0x01); | ||
| 11062 | } | ||
| 11063 | #[repr(transparent)] | ||
| 11064 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11065 | pub struct Bidioe(pub u8); | ||
| 11066 | impl Bidioe { | ||
| 11067 | #[doc = "Output disabled (receive-only mode)"] | ||
| 11068 | pub const OUTPUTDISABLED: Self = Self(0); | ||
| 11069 | #[doc = "Output enabled (transmit-only mode)"] | ||
| 11070 | pub const OUTPUTENABLED: Self = Self(0x01); | ||
| 11071 | } | ||
| 11072 | #[repr(transparent)] | ||
| 11073 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11074 | pub struct Frf(pub u8); | ||
| 11075 | impl Frf { | ||
| 11076 | #[doc = "SPI Motorola mode"] | ||
| 11077 | pub const MOTOROLA: Self = Self(0); | ||
| 11078 | #[doc = "SPI TI mode"] | ||
| 11079 | pub const TI: Self = Self(0x01); | ||
| 11080 | } | ||
| 11081 | #[repr(transparent)] | ||
| 11082 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11083 | pub struct Mstr(pub u8); | ||
| 11084 | impl Mstr { | ||
| 11085 | #[doc = "Slave configuration"] | ||
| 11086 | pub const SLAVE: Self = Self(0); | ||
| 11087 | #[doc = "Master configuration"] | ||
| 11088 | pub const MASTER: Self = Self(0x01); | ||
| 11089 | } | ||
| 11090 | #[repr(transparent)] | ||
| 11091 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11092 | pub struct Cpha(pub u8); | ||
| 11093 | impl Cpha { | ||
| 11094 | #[doc = "The first clock transition is the first data capture edge"] | ||
| 11095 | pub const FIRSTEDGE: Self = Self(0); | ||
| 11096 | #[doc = "The second clock transition is the first data capture edge"] | ||
| 11097 | pub const SECONDEDGE: Self = Self(0x01); | ||
| 11098 | } | ||
| 11099 | #[repr(transparent)] | ||
| 11100 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11101 | pub struct Iscfg(pub u8); | ||
| 11102 | impl Iscfg { | ||
| 11103 | #[doc = "Slave - transmit"] | ||
| 11104 | pub const SLAVETX: Self = Self(0); | ||
| 11105 | #[doc = "Slave - receive"] | ||
| 11106 | pub const SLAVERX: Self = Self(0x01); | ||
| 11107 | #[doc = "Master - transmit"] | ||
| 11108 | pub const MASTERTX: Self = Self(0x02); | ||
| 11109 | #[doc = "Master - receive"] | ||
| 11110 | pub const MASTERRX: Self = Self(0x03); | ||
| 11111 | } | ||
| 11112 | #[repr(transparent)] | ||
| 11113 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11114 | pub struct Lsbfirst(pub u8); | ||
| 11115 | impl Lsbfirst { | ||
| 11116 | #[doc = "Data is transmitted/received with the MSB first"] | ||
| 11117 | pub const MSBFIRST: Self = Self(0); | ||
| 11118 | #[doc = "Data is transmitted/received with the LSB first"] | ||
| 11119 | pub const LSBFIRST: Self = Self(0x01); | ||
| 11120 | } | ||
| 11121 | #[repr(transparent)] | ||
| 11122 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11123 | pub struct Cpol(pub u8); | ||
| 11124 | impl Cpol { | ||
| 11125 | #[doc = "CK to 0 when idle"] | ||
| 11126 | pub const IDLELOW: Self = Self(0); | ||
| 11127 | #[doc = "CK to 1 when idle"] | ||
| 11128 | pub const IDLEHIGH: Self = Self(0x01); | ||
| 11129 | } | ||
| 11130 | #[repr(transparent)] | ||
| 11131 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11132 | pub struct Rxonly(pub u8); | ||
| 11133 | impl Rxonly { | ||
| 11134 | #[doc = "Full duplex (Transmit and receive)"] | ||
| 11135 | pub const FULLDUPLEX: Self = Self(0); | ||
| 11136 | #[doc = "Output disabled (Receive-only mode)"] | ||
| 11137 | pub const OUTPUTDISABLED: Self = Self(0x01); | ||
| 11138 | } | ||
| 11139 | #[repr(transparent)] | ||
| 11140 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11141 | pub struct Br(pub u8); | ||
| 11142 | impl Br { | ||
| 11143 | #[doc = "f_PCLK / 2"] | ||
| 11144 | pub const DIV2: Self = Self(0); | ||
| 11145 | #[doc = "f_PCLK / 4"] | ||
| 11146 | pub const DIV4: Self = Self(0x01); | ||
| 11147 | #[doc = "f_PCLK / 8"] | ||
| 11148 | pub const DIV8: Self = Self(0x02); | ||
| 11149 | #[doc = "f_PCLK / 16"] | ||
| 11150 | pub const DIV16: Self = Self(0x03); | ||
| 11151 | #[doc = "f_PCLK / 32"] | ||
| 11152 | pub const DIV32: Self = Self(0x04); | ||
| 11153 | #[doc = "f_PCLK / 64"] | ||
| 11154 | pub const DIV64: Self = Self(0x05); | ||
| 11155 | #[doc = "f_PCLK / 128"] | ||
| 11156 | pub const DIV128: Self = Self(0x06); | ||
| 11157 | #[doc = "f_PCLK / 256"] | ||
| 11158 | pub const DIV256: Self = Self(0x07); | ||
| 11159 | } | ||
| 11160 | #[repr(transparent)] | ||
| 11161 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11162 | pub struct Bidimode(pub u8); | ||
| 11163 | impl Bidimode { | ||
| 11164 | #[doc = "2-line unidirectional data mode selected"] | ||
| 11165 | pub const UNIDIRECTIONAL: Self = Self(0); | ||
| 11166 | #[doc = "1-line bidirectional data mode selected"] | ||
| 11167 | pub const BIDIRECTIONAL: Self = Self(0x01); | ||
| 11168 | } | ||
| 11169 | #[repr(transparent)] | ||
| 11170 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11171 | pub struct Frer(pub u8); | ||
| 11172 | impl Frer { | ||
| 11173 | #[doc = "No frame format error"] | ||
| 11174 | pub const NOERROR: Self = Self(0); | ||
| 11175 | #[doc = "A frame format error occurred"] | ||
| 11176 | pub const ERROR: Self = Self(0x01); | ||
| 11177 | } | ||
| 11178 | } | ||
| 11179 | } | ||
| 11180 | pub mod gpio_v1 { | ||
| 11181 | use crate::generic::*; | ||
| 11182 | #[doc = "General purpose I/O"] | ||
| 11183 | #[derive(Copy, Clone)] | ||
| 11184 | pub struct Gpio(pub *mut u8); | ||
| 11185 | unsafe impl Send for Gpio {} | ||
| 11186 | unsafe impl Sync for Gpio {} | ||
| 11187 | impl Gpio { | ||
| 11188 | #[doc = "Port configuration register low (GPIOn_CRL)"] | ||
| 11189 | pub fn cr(self, n: usize) -> Reg<regs::Cr, RW> { | ||
| 11190 | assert!(n < 2usize); | ||
| 11191 | unsafe { Reg::from_ptr(self.0.add(0usize + n * 4usize)) } | ||
| 11192 | } | ||
| 11193 | #[doc = "Port input data register (GPIOn_IDR)"] | ||
| 11194 | pub fn idr(self) -> Reg<regs::Idr, R> { | ||
| 11195 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 11196 | } | ||
| 11197 | #[doc = "Port output data register (GPIOn_ODR)"] | ||
| 11198 | pub fn odr(self) -> Reg<regs::Odr, RW> { | ||
| 11199 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 11200 | } | ||
| 11201 | #[doc = "Port bit set/reset register (GPIOn_BSRR)"] | ||
| 11202 | pub fn bsrr(self) -> Reg<regs::Bsrr, W> { | ||
| 11203 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 11204 | } | ||
| 11205 | #[doc = "Port bit reset register (GPIOn_BRR)"] | ||
| 11206 | pub fn brr(self) -> Reg<regs::Brr, W> { | ||
| 11207 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 11208 | } | ||
| 11209 | #[doc = "Port configuration lock register"] | ||
| 11210 | pub fn lckr(self) -> Reg<regs::Lckr, RW> { | ||
| 11211 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | ||
| 11212 | } | ||
| 11213 | } | ||
| 11214 | pub mod regs { | ||
| 11215 | use crate::generic::*; | ||
| 11216 | #[doc = "Port bit set/reset register (GPIOn_BSRR)"] | ||
| 11217 | #[repr(transparent)] | ||
| 11218 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 11219 | pub struct Bsrr(pub u32); | ||
| 11220 | impl Bsrr { | ||
| 11221 | #[doc = "Set bit"] | ||
| 11222 | pub fn bs(&self, n: usize) -> bool { | ||
| 11223 | assert!(n < 16usize); | ||
| 11224 | let offs = 0usize + n * 1usize; | ||
| 11225 | let val = (self.0 >> offs) & 0x01; | ||
| 11226 | val != 0 | ||
| 11227 | } | ||
| 11228 | #[doc = "Set bit"] | ||
| 11229 | pub fn set_bs(&mut self, n: usize, val: bool) { | ||
| 11230 | assert!(n < 16usize); | ||
| 11231 | let offs = 0usize + n * 1usize; | ||
| 11232 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 11233 | } | ||
| 11234 | #[doc = "Reset bit"] | ||
| 11235 | pub fn br(&self, n: usize) -> bool { | ||
| 11236 | assert!(n < 16usize); | ||
| 11237 | let offs = 16usize + n * 1usize; | ||
| 11238 | let val = (self.0 >> offs) & 0x01; | ||
| 11239 | val != 0 | ||
| 11240 | } | ||
| 11241 | #[doc = "Reset bit"] | ||
| 11242 | pub fn set_br(&mut self, n: usize, val: bool) { | ||
| 11243 | assert!(n < 16usize); | ||
| 11244 | let offs = 16usize + n * 1usize; | ||
| 11245 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 9279 | } | 11246 | } |
| 9280 | } | 11247 | } |
| 9281 | impl Default for Cr2 { | 11248 | impl Default for Bsrr { |
| 9282 | fn default() -> Cr2 { | 11249 | fn default() -> Bsrr { |
| 9283 | Cr2(0) | 11250 | Bsrr(0) |
| 9284 | } | 11251 | } |
| 9285 | } | 11252 | } |
| 9286 | #[doc = "Receive Data Register"] | 11253 | #[doc = "Port output data register (GPIOn_ODR)"] |
| 9287 | #[repr(transparent)] | 11254 | #[repr(transparent)] |
| 9288 | #[derive(Copy, Clone, Eq, PartialEq)] | 11255 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9289 | pub struct Rxdr(pub u32); | 11256 | pub struct Odr(pub u32); |
| 9290 | impl Rxdr { | 11257 | impl Odr { |
| 9291 | #[doc = "Receive data register"] | 11258 | #[doc = "Port output data"] |
| 9292 | pub const fn rxdr(&self) -> u32 { | 11259 | pub fn odr(&self, n: usize) -> super::vals::Odr { |
| 9293 | let val = (self.0 >> 0usize) & 0xffff_ffff; | 11260 | assert!(n < 16usize); |
| 9294 | val as u32 | 11261 | let offs = 0usize + n * 1usize; |
| 11262 | let val = (self.0 >> offs) & 0x01; | ||
| 11263 | super::vals::Odr(val as u8) | ||
| 9295 | } | 11264 | } |
| 9296 | #[doc = "Receive data register"] | 11265 | #[doc = "Port output data"] |
| 9297 | pub fn set_rxdr(&mut self, val: u32) { | 11266 | pub fn set_odr(&mut self, n: usize, val: super::vals::Odr) { |
| 9298 | self.0 = | 11267 | assert!(n < 16usize); |
| 9299 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | 11268 | let offs = 0usize + n * 1usize; |
| 11269 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 9300 | } | 11270 | } |
| 9301 | } | 11271 | } |
| 9302 | impl Default for Rxdr { | 11272 | impl Default for Odr { |
| 9303 | fn default() -> Rxdr { | 11273 | fn default() -> Odr { |
| 9304 | Rxdr(0) | 11274 | Odr(0) |
| 9305 | } | 11275 | } |
| 9306 | } | 11276 | } |
| 9307 | #[doc = "Interrupt Enable Register"] | 11277 | #[doc = "Port bit reset register (GPIOn_BRR)"] |
| 9308 | #[repr(transparent)] | 11278 | #[repr(transparent)] |
| 9309 | #[derive(Copy, Clone, Eq, PartialEq)] | 11279 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9310 | pub struct Ier(pub u32); | 11280 | pub struct Brr(pub u32); |
| 9311 | impl Ier { | 11281 | impl Brr { |
| 9312 | #[doc = "RXP Interrupt Enable"] | 11282 | #[doc = "Reset bit"] |
| 9313 | pub const fn rxpie(&self) -> bool { | 11283 | pub fn br(&self, n: usize) -> bool { |
| 9314 | let val = (self.0 >> 0usize) & 0x01; | 11284 | assert!(n < 16usize); |
| 11285 | let offs = 0usize + n * 1usize; | ||
| 11286 | let val = (self.0 >> offs) & 0x01; | ||
| 9315 | val != 0 | 11287 | val != 0 |
| 9316 | } | 11288 | } |
| 9317 | #[doc = "RXP Interrupt Enable"] | 11289 | #[doc = "Reset bit"] |
| 9318 | pub fn set_rxpie(&mut self, val: bool) { | 11290 | pub fn set_br(&mut self, n: usize, val: bool) { |
| 9319 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 11291 | assert!(n < 16usize); |
| 11292 | let offs = 0usize + n * 1usize; | ||
| 11293 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 9320 | } | 11294 | } |
| 9321 | #[doc = "TXP interrupt enable"] | 11295 | } |
| 9322 | pub const fn txpie(&self) -> bool { | 11296 | impl Default for Brr { |
| 9323 | let val = (self.0 >> 1usize) & 0x01; | 11297 | fn default() -> Brr { |
| 9324 | val != 0 | 11298 | Brr(0) |
| 9325 | } | 11299 | } |
| 9326 | #[doc = "TXP interrupt enable"] | 11300 | } |
| 9327 | pub fn set_txpie(&mut self, val: bool) { | 11301 | #[doc = "Port configuration register (GPIOn_CRx)"] |
| 9328 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 11302 | #[repr(transparent)] |
| 11303 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 11304 | pub struct Cr(pub u32); | ||
| 11305 | impl Cr { | ||
| 11306 | #[doc = "Port n mode bits"] | ||
| 11307 | pub fn mode(&self, n: usize) -> super::vals::Mode { | ||
| 11308 | assert!(n < 8usize); | ||
| 11309 | let offs = 0usize + n * 4usize; | ||
| 11310 | let val = (self.0 >> offs) & 0x03; | ||
| 11311 | super::vals::Mode(val as u8) | ||
| 9329 | } | 11312 | } |
| 9330 | #[doc = "DXP interrupt enabled"] | 11313 | #[doc = "Port n mode bits"] |
| 9331 | pub const fn dxpie(&self) -> bool { | 11314 | pub fn set_mode(&mut self, n: usize, val: super::vals::Mode) { |
| 9332 | let val = (self.0 >> 2usize) & 0x01; | 11315 | assert!(n < 8usize); |
| 9333 | val != 0 | 11316 | let offs = 0usize + n * 4usize; |
| 11317 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | ||
| 9334 | } | 11318 | } |
| 9335 | #[doc = "DXP interrupt enabled"] | 11319 | #[doc = "Port n configuration bits"] |
| 9336 | pub fn set_dxpie(&mut self, val: bool) { | 11320 | pub fn cnf(&self, n: usize) -> super::vals::Cnf { |
| 9337 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 11321 | assert!(n < 8usize); |
| 11322 | let offs = 2usize + n * 4usize; | ||
| 11323 | let val = (self.0 >> offs) & 0x03; | ||
| 11324 | super::vals::Cnf(val as u8) | ||
| 9338 | } | 11325 | } |
| 9339 | #[doc = "EOT, SUSP and TXC interrupt enable"] | 11326 | #[doc = "Port n configuration bits"] |
| 9340 | pub const fn eotie(&self) -> bool { | 11327 | pub fn set_cnf(&mut self, n: usize, val: super::vals::Cnf) { |
| 9341 | let val = (self.0 >> 3usize) & 0x01; | 11328 | assert!(n < 8usize); |
| 9342 | val != 0 | 11329 | let offs = 2usize + n * 4usize; |
| 11330 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | ||
| 9343 | } | 11331 | } |
| 9344 | #[doc = "EOT, SUSP and TXC interrupt enable"] | 11332 | } |
| 9345 | pub fn set_eotie(&mut self, val: bool) { | 11333 | impl Default for Cr { |
| 9346 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 11334 | fn default() -> Cr { |
| 11335 | Cr(0) | ||
| 9347 | } | 11336 | } |
| 9348 | #[doc = "TXTFIE interrupt enable"] | 11337 | } |
| 9349 | pub const fn txtfie(&self) -> bool { | 11338 | #[doc = "Port configuration lock register"] |
| 9350 | let val = (self.0 >> 4usize) & 0x01; | 11339 | #[repr(transparent)] |
| 11340 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 11341 | pub struct Lckr(pub u32); | ||
| 11342 | impl Lckr { | ||
| 11343 | #[doc = "Port A Lock bit"] | ||
| 11344 | pub fn lck(&self, n: usize) -> super::vals::Lck { | ||
| 11345 | assert!(n < 16usize); | ||
| 11346 | let offs = 0usize + n * 1usize; | ||
| 11347 | let val = (self.0 >> offs) & 0x01; | ||
| 11348 | super::vals::Lck(val as u8) | ||
| 11349 | } | ||
| 11350 | #[doc = "Port A Lock bit"] | ||
| 11351 | pub fn set_lck(&mut self, n: usize, val: super::vals::Lck) { | ||
| 11352 | assert!(n < 16usize); | ||
| 11353 | let offs = 0usize + n * 1usize; | ||
| 11354 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 11355 | } | ||
| 11356 | #[doc = "Lock key"] | ||
| 11357 | pub const fn lckk(&self) -> super::vals::Lckk { | ||
| 11358 | let val = (self.0 >> 16usize) & 0x01; | ||
| 11359 | super::vals::Lckk(val as u8) | ||
| 11360 | } | ||
| 11361 | #[doc = "Lock key"] | ||
| 11362 | pub fn set_lckk(&mut self, val: super::vals::Lckk) { | ||
| 11363 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 11364 | } | ||
| 11365 | } | ||
| 11366 | impl Default for Lckr { | ||
| 11367 | fn default() -> Lckr { | ||
| 11368 | Lckr(0) | ||
| 11369 | } | ||
| 11370 | } | ||
| 11371 | #[doc = "Port input data register (GPIOn_IDR)"] | ||
| 11372 | #[repr(transparent)] | ||
| 11373 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 11374 | pub struct Idr(pub u32); | ||
| 11375 | impl Idr { | ||
| 11376 | #[doc = "Port input data"] | ||
| 11377 | pub fn idr(&self, n: usize) -> super::vals::Idr { | ||
| 11378 | assert!(n < 16usize); | ||
| 11379 | let offs = 0usize + n * 1usize; | ||
| 11380 | let val = (self.0 >> offs) & 0x01; | ||
| 11381 | super::vals::Idr(val as u8) | ||
| 11382 | } | ||
| 11383 | #[doc = "Port input data"] | ||
| 11384 | pub fn set_idr(&mut self, n: usize, val: super::vals::Idr) { | ||
| 11385 | assert!(n < 16usize); | ||
| 11386 | let offs = 0usize + n * 1usize; | ||
| 11387 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 11388 | } | ||
| 11389 | } | ||
| 11390 | impl Default for Idr { | ||
| 11391 | fn default() -> Idr { | ||
| 11392 | Idr(0) | ||
| 11393 | } | ||
| 11394 | } | ||
| 11395 | } | ||
| 11396 | pub mod vals { | ||
| 11397 | use crate::generic::*; | ||
| 11398 | #[repr(transparent)] | ||
| 11399 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11400 | pub struct Cnf(pub u8); | ||
| 11401 | impl Cnf { | ||
| 11402 | #[doc = "Analog mode / Push-Pull mode"] | ||
| 11403 | pub const PUSHPULL: Self = Self(0); | ||
| 11404 | #[doc = "Floating input (reset state) / Open Drain-Mode"] | ||
| 11405 | pub const OPENDRAIN: Self = Self(0x01); | ||
| 11406 | #[doc = "Input with pull-up/pull-down / Alternate Function Push-Pull Mode"] | ||
| 11407 | pub const ALTPUSHPULL: Self = Self(0x02); | ||
| 11408 | #[doc = "Alternate Function Open-Drain Mode"] | ||
| 11409 | pub const ALTOPENDRAIN: Self = Self(0x03); | ||
| 11410 | } | ||
| 11411 | #[repr(transparent)] | ||
| 11412 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11413 | pub struct Mode(pub u8); | ||
| 11414 | impl Mode { | ||
| 11415 | #[doc = "Input mode (reset state)"] | ||
| 11416 | pub const INPUT: Self = Self(0); | ||
| 11417 | #[doc = "Output mode 10 MHz"] | ||
| 11418 | pub const OUTPUT: Self = Self(0x01); | ||
| 11419 | #[doc = "Output mode 2 MHz"] | ||
| 11420 | pub const OUTPUT2: Self = Self(0x02); | ||
| 11421 | #[doc = "Output mode 50 MHz"] | ||
| 11422 | pub const OUTPUT50: Self = Self(0x03); | ||
| 11423 | } | ||
| 11424 | #[repr(transparent)] | ||
| 11425 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11426 | pub struct Brw(pub u8); | ||
| 11427 | impl Brw { | ||
| 11428 | #[doc = "No action on the corresponding ODx bit"] | ||
| 11429 | pub const NOACTION: Self = Self(0); | ||
| 11430 | #[doc = "Reset the ODx bit"] | ||
| 11431 | pub const RESET: Self = Self(0x01); | ||
| 11432 | } | ||
| 11433 | #[repr(transparent)] | ||
| 11434 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11435 | pub struct Idr(pub u8); | ||
| 11436 | impl Idr { | ||
| 11437 | #[doc = "Input is logic low"] | ||
| 11438 | pub const LOW: Self = Self(0); | ||
| 11439 | #[doc = "Input is logic high"] | ||
| 11440 | pub const HIGH: Self = Self(0x01); | ||
| 11441 | } | ||
| 11442 | #[repr(transparent)] | ||
| 11443 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11444 | pub struct Bsw(pub u8); | ||
| 11445 | impl Bsw { | ||
| 11446 | #[doc = "No action on the corresponding ODx bit"] | ||
| 11447 | pub const NOACTION: Self = Self(0); | ||
| 11448 | #[doc = "Sets the corresponding ODRx bit"] | ||
| 11449 | pub const SET: Self = Self(0x01); | ||
| 11450 | } | ||
| 11451 | #[repr(transparent)] | ||
| 11452 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11453 | pub struct Odr(pub u8); | ||
| 11454 | impl Odr { | ||
| 11455 | #[doc = "Set output to logic low"] | ||
| 11456 | pub const LOW: Self = Self(0); | ||
| 11457 | #[doc = "Set output to logic high"] | ||
| 11458 | pub const HIGH: Self = Self(0x01); | ||
| 11459 | } | ||
| 11460 | #[repr(transparent)] | ||
| 11461 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11462 | pub struct Lckk(pub u8); | ||
| 11463 | impl Lckk { | ||
| 11464 | #[doc = "Port configuration lock key not active"] | ||
| 11465 | pub const NOTACTIVE: Self = Self(0); | ||
| 11466 | #[doc = "Port configuration lock key active"] | ||
| 11467 | pub const ACTIVE: Self = Self(0x01); | ||
| 11468 | } | ||
| 11469 | #[repr(transparent)] | ||
| 11470 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11471 | pub struct Lck(pub u8); | ||
| 11472 | impl Lck { | ||
| 11473 | #[doc = "Port configuration not locked"] | ||
| 11474 | pub const UNLOCKED: Self = Self(0); | ||
| 11475 | #[doc = "Port configuration locked"] | ||
| 11476 | pub const LOCKED: Self = Self(0x01); | ||
| 11477 | } | ||
| 11478 | } | ||
| 11479 | } | ||
| 11480 | pub mod gpio_v2 { | ||
| 11481 | use crate::generic::*; | ||
| 11482 | #[doc = "General-purpose I/Os"] | ||
| 11483 | #[derive(Copy, Clone)] | ||
| 11484 | pub struct Gpio(pub *mut u8); | ||
| 11485 | unsafe impl Send for Gpio {} | ||
| 11486 | unsafe impl Sync for Gpio {} | ||
| 11487 | impl Gpio { | ||
| 11488 | #[doc = "GPIO port mode register"] | ||
| 11489 | pub fn moder(self) -> Reg<regs::Moder, RW> { | ||
| 11490 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 11491 | } | ||
| 11492 | #[doc = "GPIO port output type register"] | ||
| 11493 | pub fn otyper(self) -> Reg<regs::Otyper, RW> { | ||
| 11494 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 11495 | } | ||
| 11496 | #[doc = "GPIO port output speed register"] | ||
| 11497 | pub fn ospeedr(self) -> Reg<regs::Ospeedr, RW> { | ||
| 11498 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 11499 | } | ||
| 11500 | #[doc = "GPIO port pull-up/pull-down register"] | ||
| 11501 | pub fn pupdr(self) -> Reg<regs::Pupdr, RW> { | ||
| 11502 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 11503 | } | ||
| 11504 | #[doc = "GPIO port input data register"] | ||
| 11505 | pub fn idr(self) -> Reg<regs::Idr, R> { | ||
| 11506 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 11507 | } | ||
| 11508 | #[doc = "GPIO port output data register"] | ||
| 11509 | pub fn odr(self) -> Reg<regs::Odr, RW> { | ||
| 11510 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 11511 | } | ||
| 11512 | #[doc = "GPIO port bit set/reset register"] | ||
| 11513 | pub fn bsrr(self) -> Reg<regs::Bsrr, W> { | ||
| 11514 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | ||
| 11515 | } | ||
| 11516 | #[doc = "GPIO port configuration lock register"] | ||
| 11517 | pub fn lckr(self) -> Reg<regs::Lckr, RW> { | ||
| 11518 | unsafe { Reg::from_ptr(self.0.add(28usize)) } | ||
| 11519 | } | ||
| 11520 | #[doc = "GPIO alternate function register (low, high)"] | ||
| 11521 | pub fn afr(self, n: usize) -> Reg<regs::Afr, RW> { | ||
| 11522 | assert!(n < 2usize); | ||
| 11523 | unsafe { Reg::from_ptr(self.0.add(32usize + n * 4usize)) } | ||
| 11524 | } | ||
| 11525 | } | ||
| 11526 | pub mod vals { | ||
| 11527 | use crate::generic::*; | ||
| 11528 | #[repr(transparent)] | ||
| 11529 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11530 | pub struct Pupdr(pub u8); | ||
| 11531 | impl Pupdr { | ||
| 11532 | #[doc = "No pull-up, pull-down"] | ||
| 11533 | pub const FLOATING: Self = Self(0); | ||
| 11534 | #[doc = "Pull-up"] | ||
| 11535 | pub const PULLUP: Self = Self(0x01); | ||
| 11536 | #[doc = "Pull-down"] | ||
| 11537 | pub const PULLDOWN: Self = Self(0x02); | ||
| 11538 | } | ||
| 11539 | #[repr(transparent)] | ||
| 11540 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11541 | pub struct Ot(pub u8); | ||
| 11542 | impl Ot { | ||
| 11543 | #[doc = "Output push-pull (reset state)"] | ||
| 11544 | pub const PUSHPULL: Self = Self(0); | ||
| 11545 | #[doc = "Output open-drain"] | ||
| 11546 | pub const OPENDRAIN: Self = Self(0x01); | ||
| 11547 | } | ||
| 11548 | #[repr(transparent)] | ||
| 11549 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11550 | pub struct Afr(pub u8); | ||
| 11551 | impl Afr { | ||
| 11552 | #[doc = "AF0"] | ||
| 11553 | pub const AF0: Self = Self(0); | ||
| 11554 | #[doc = "AF1"] | ||
| 11555 | pub const AF1: Self = Self(0x01); | ||
| 11556 | #[doc = "AF2"] | ||
| 11557 | pub const AF2: Self = Self(0x02); | ||
| 11558 | #[doc = "AF3"] | ||
| 11559 | pub const AF3: Self = Self(0x03); | ||
| 11560 | #[doc = "AF4"] | ||
| 11561 | pub const AF4: Self = Self(0x04); | ||
| 11562 | #[doc = "AF5"] | ||
| 11563 | pub const AF5: Self = Self(0x05); | ||
| 11564 | #[doc = "AF6"] | ||
| 11565 | pub const AF6: Self = Self(0x06); | ||
| 11566 | #[doc = "AF7"] | ||
| 11567 | pub const AF7: Self = Self(0x07); | ||
| 11568 | #[doc = "AF8"] | ||
| 11569 | pub const AF8: Self = Self(0x08); | ||
| 11570 | #[doc = "AF9"] | ||
| 11571 | pub const AF9: Self = Self(0x09); | ||
| 11572 | #[doc = "AF10"] | ||
| 11573 | pub const AF10: Self = Self(0x0a); | ||
| 11574 | #[doc = "AF11"] | ||
| 11575 | pub const AF11: Self = Self(0x0b); | ||
| 11576 | #[doc = "AF12"] | ||
| 11577 | pub const AF12: Self = Self(0x0c); | ||
| 11578 | #[doc = "AF13"] | ||
| 11579 | pub const AF13: Self = Self(0x0d); | ||
| 11580 | #[doc = "AF14"] | ||
| 11581 | pub const AF14: Self = Self(0x0e); | ||
| 11582 | #[doc = "AF15"] | ||
| 11583 | pub const AF15: Self = Self(0x0f); | ||
| 11584 | } | ||
| 11585 | #[repr(transparent)] | ||
| 11586 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11587 | pub struct Ospeedr(pub u8); | ||
| 11588 | impl Ospeedr { | ||
| 11589 | #[doc = "Low speed"] | ||
| 11590 | pub const LOWSPEED: Self = Self(0); | ||
| 11591 | #[doc = "Medium speed"] | ||
| 11592 | pub const MEDIUMSPEED: Self = Self(0x01); | ||
| 11593 | #[doc = "High speed"] | ||
| 11594 | pub const HIGHSPEED: Self = Self(0x02); | ||
| 11595 | #[doc = "Very high speed"] | ||
| 11596 | pub const VERYHIGHSPEED: Self = Self(0x03); | ||
| 11597 | } | ||
| 11598 | #[repr(transparent)] | ||
| 11599 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11600 | pub struct Brw(pub u8); | ||
| 11601 | impl Brw { | ||
| 11602 | #[doc = "Resets the corresponding ODRx bit"] | ||
| 11603 | pub const RESET: Self = Self(0x01); | ||
| 11604 | } | ||
| 11605 | #[repr(transparent)] | ||
| 11606 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11607 | pub struct Lckk(pub u8); | ||
| 11608 | impl Lckk { | ||
| 11609 | #[doc = "Port configuration lock key not active"] | ||
| 11610 | pub const NOTACTIVE: Self = Self(0); | ||
| 11611 | #[doc = "Port configuration lock key active"] | ||
| 11612 | pub const ACTIVE: Self = Self(0x01); | ||
| 11613 | } | ||
| 11614 | #[repr(transparent)] | ||
| 11615 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11616 | pub struct Odr(pub u8); | ||
| 11617 | impl Odr { | ||
| 11618 | #[doc = "Set output to logic low"] | ||
| 11619 | pub const LOW: Self = Self(0); | ||
| 11620 | #[doc = "Set output to logic high"] | ||
| 11621 | pub const HIGH: Self = Self(0x01); | ||
| 11622 | } | ||
| 11623 | #[repr(transparent)] | ||
| 11624 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11625 | pub struct Moder(pub u8); | ||
| 11626 | impl Moder { | ||
| 11627 | #[doc = "Input mode (reset state)"] | ||
| 11628 | pub const INPUT: Self = Self(0); | ||
| 11629 | #[doc = "General purpose output mode"] | ||
| 11630 | pub const OUTPUT: Self = Self(0x01); | ||
| 11631 | #[doc = "Alternate function mode"] | ||
| 11632 | pub const ALTERNATE: Self = Self(0x02); | ||
| 11633 | #[doc = "Analog mode"] | ||
| 11634 | pub const ANALOG: Self = Self(0x03); | ||
| 11635 | } | ||
| 11636 | #[repr(transparent)] | ||
| 11637 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11638 | pub struct Lck(pub u8); | ||
| 11639 | impl Lck { | ||
| 11640 | #[doc = "Port configuration not locked"] | ||
| 11641 | pub const UNLOCKED: Self = Self(0); | ||
| 11642 | #[doc = "Port configuration locked"] | ||
| 11643 | pub const LOCKED: Self = Self(0x01); | ||
| 11644 | } | ||
| 11645 | #[repr(transparent)] | ||
| 11646 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11647 | pub struct Idr(pub u8); | ||
| 11648 | impl Idr { | ||
| 11649 | #[doc = "Input is logic low"] | ||
| 11650 | pub const LOW: Self = Self(0); | ||
| 11651 | #[doc = "Input is logic high"] | ||
| 11652 | pub const HIGH: Self = Self(0x01); | ||
| 11653 | } | ||
| 11654 | #[repr(transparent)] | ||
| 11655 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 11656 | pub struct Bsw(pub u8); | ||
| 11657 | impl Bsw { | ||
| 11658 | #[doc = "Sets the corresponding ODRx bit"] | ||
| 11659 | pub const SET: Self = Self(0x01); | ||
| 11660 | } | ||
| 11661 | } | ||
| 11662 | pub mod regs { | ||
| 11663 | use crate::generic::*; | ||
| 11664 | #[doc = "GPIO port output type register"] | ||
| 11665 | #[repr(transparent)] | ||
| 11666 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 11667 | pub struct Otyper(pub u32); | ||
| 11668 | impl Otyper { | ||
| 11669 | #[doc = "Port x configuration bits (y = 0..15)"] | ||
| 11670 | pub fn ot(&self, n: usize) -> super::vals::Ot { | ||
| 11671 | assert!(n < 16usize); | ||
| 11672 | let offs = 0usize + n * 1usize; | ||
| 11673 | let val = (self.0 >> offs) & 0x01; | ||
| 11674 | super::vals::Ot(val as u8) | ||
| 11675 | } | ||
| 11676 | #[doc = "Port x configuration bits (y = 0..15)"] | ||
| 11677 | pub fn set_ot(&mut self, n: usize, val: super::vals::Ot) { | ||
| 11678 | assert!(n < 16usize); | ||
| 11679 | let offs = 0usize + n * 1usize; | ||
| 11680 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 11681 | } | ||
| 11682 | } | ||
| 11683 | impl Default for Otyper { | ||
| 11684 | fn default() -> Otyper { | ||
| 11685 | Otyper(0) | ||
| 11686 | } | ||
| 11687 | } | ||
| 11688 | #[doc = "GPIO alternate function register"] | ||
| 11689 | #[repr(transparent)] | ||
| 11690 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 11691 | pub struct Afr(pub u32); | ||
| 11692 | impl Afr { | ||
| 11693 | #[doc = "Alternate function selection for port x bit y (y = 0..15)"] | ||
| 11694 | pub fn afr(&self, n: usize) -> super::vals::Afr { | ||
| 11695 | assert!(n < 8usize); | ||
| 11696 | let offs = 0usize + n * 4usize; | ||
| 11697 | let val = (self.0 >> offs) & 0x0f; | ||
| 11698 | super::vals::Afr(val as u8) | ||
| 11699 | } | ||
| 11700 | #[doc = "Alternate function selection for port x bit y (y = 0..15)"] | ||
| 11701 | pub fn set_afr(&mut self, n: usize, val: super::vals::Afr) { | ||
| 11702 | assert!(n < 8usize); | ||
| 11703 | let offs = 0usize + n * 4usize; | ||
| 11704 | self.0 = (self.0 & !(0x0f << offs)) | (((val.0 as u32) & 0x0f) << offs); | ||
| 11705 | } | ||
| 11706 | } | ||
| 11707 | impl Default for Afr { | ||
| 11708 | fn default() -> Afr { | ||
| 11709 | Afr(0) | ||
| 11710 | } | ||
| 11711 | } | ||
| 11712 | #[doc = "GPIO port output speed register"] | ||
| 11713 | #[repr(transparent)] | ||
| 11714 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 11715 | pub struct Ospeedr(pub u32); | ||
| 11716 | impl Ospeedr { | ||
| 11717 | #[doc = "Port x configuration bits (y = 0..15)"] | ||
| 11718 | pub fn ospeedr(&self, n: usize) -> super::vals::Ospeedr { | ||
| 11719 | assert!(n < 16usize); | ||
| 11720 | let offs = 0usize + n * 2usize; | ||
| 11721 | let val = (self.0 >> offs) & 0x03; | ||
| 11722 | super::vals::Ospeedr(val as u8) | ||
| 11723 | } | ||
| 11724 | #[doc = "Port x configuration bits (y = 0..15)"] | ||
| 11725 | pub fn set_ospeedr(&mut self, n: usize, val: super::vals::Ospeedr) { | ||
| 11726 | assert!(n < 16usize); | ||
| 11727 | let offs = 0usize + n * 2usize; | ||
| 11728 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | ||
| 11729 | } | ||
| 11730 | } | ||
| 11731 | impl Default for Ospeedr { | ||
| 11732 | fn default() -> Ospeedr { | ||
| 11733 | Ospeedr(0) | ||
| 11734 | } | ||
| 11735 | } | ||
| 11736 | #[doc = "GPIO port configuration lock register"] | ||
| 11737 | #[repr(transparent)] | ||
| 11738 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 11739 | pub struct Lckr(pub u32); | ||
| 11740 | impl Lckr { | ||
| 11741 | #[doc = "Port x lock bit y (y= 0..15)"] | ||
| 11742 | pub fn lck(&self, n: usize) -> super::vals::Lck { | ||
| 11743 | assert!(n < 16usize); | ||
| 11744 | let offs = 0usize + n * 1usize; | ||
| 11745 | let val = (self.0 >> offs) & 0x01; | ||
| 11746 | super::vals::Lck(val as u8) | ||
| 11747 | } | ||
| 11748 | #[doc = "Port x lock bit y (y= 0..15)"] | ||
| 11749 | pub fn set_lck(&mut self, n: usize, val: super::vals::Lck) { | ||
| 11750 | assert!(n < 16usize); | ||
| 11751 | let offs = 0usize + n * 1usize; | ||
| 11752 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 11753 | } | ||
| 11754 | #[doc = "Port x lock bit y (y= 0..15)"] | ||
| 11755 | pub const fn lckk(&self) -> super::vals::Lckk { | ||
| 11756 | let val = (self.0 >> 16usize) & 0x01; | ||
| 11757 | super::vals::Lckk(val as u8) | ||
| 11758 | } | ||
| 11759 | #[doc = "Port x lock bit y (y= 0..15)"] | ||
| 11760 | pub fn set_lckk(&mut self, val: super::vals::Lckk) { | ||
| 11761 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 11762 | } | ||
| 11763 | } | ||
| 11764 | impl Default for Lckr { | ||
| 11765 | fn default() -> Lckr { | ||
| 11766 | Lckr(0) | ||
| 11767 | } | ||
| 11768 | } | ||
| 11769 | #[doc = "GPIO port mode register"] | ||
| 11770 | #[repr(transparent)] | ||
| 11771 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 11772 | pub struct Moder(pub u32); | ||
| 11773 | impl Moder { | ||
| 11774 | #[doc = "Port x configuration bits (y = 0..15)"] | ||
| 11775 | pub fn moder(&self, n: usize) -> super::vals::Moder { | ||
| 11776 | assert!(n < 16usize); | ||
| 11777 | let offs = 0usize + n * 2usize; | ||
| 11778 | let val = (self.0 >> offs) & 0x03; | ||
| 11779 | super::vals::Moder(val as u8) | ||
| 11780 | } | ||
| 11781 | #[doc = "Port x configuration bits (y = 0..15)"] | ||
| 11782 | pub fn set_moder(&mut self, n: usize, val: super::vals::Moder) { | ||
| 11783 | assert!(n < 16usize); | ||
| 11784 | let offs = 0usize + n * 2usize; | ||
| 11785 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | ||
| 11786 | } | ||
| 11787 | } | ||
| 11788 | impl Default for Moder { | ||
| 11789 | fn default() -> Moder { | ||
| 11790 | Moder(0) | ||
| 11791 | } | ||
| 11792 | } | ||
| 11793 | #[doc = "GPIO port output data register"] | ||
| 11794 | #[repr(transparent)] | ||
| 11795 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 11796 | pub struct Odr(pub u32); | ||
| 11797 | impl Odr { | ||
| 11798 | #[doc = "Port output data (y = 0..15)"] | ||
| 11799 | pub fn odr(&self, n: usize) -> super::vals::Odr { | ||
| 11800 | assert!(n < 16usize); | ||
| 11801 | let offs = 0usize + n * 1usize; | ||
| 11802 | let val = (self.0 >> offs) & 0x01; | ||
| 11803 | super::vals::Odr(val as u8) | ||
| 11804 | } | ||
| 11805 | #[doc = "Port output data (y = 0..15)"] | ||
| 11806 | pub fn set_odr(&mut self, n: usize, val: super::vals::Odr) { | ||
| 11807 | assert!(n < 16usize); | ||
| 11808 | let offs = 0usize + n * 1usize; | ||
| 11809 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 11810 | } | ||
| 11811 | } | ||
| 11812 | impl Default for Odr { | ||
| 11813 | fn default() -> Odr { | ||
| 11814 | Odr(0) | ||
| 11815 | } | ||
| 11816 | } | ||
| 11817 | #[doc = "GPIO port pull-up/pull-down register"] | ||
| 11818 | #[repr(transparent)] | ||
| 11819 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 11820 | pub struct Pupdr(pub u32); | ||
| 11821 | impl Pupdr { | ||
| 11822 | #[doc = "Port x configuration bits (y = 0..15)"] | ||
| 11823 | pub fn pupdr(&self, n: usize) -> super::vals::Pupdr { | ||
| 11824 | assert!(n < 16usize); | ||
| 11825 | let offs = 0usize + n * 2usize; | ||
| 11826 | let val = (self.0 >> offs) & 0x03; | ||
| 11827 | super::vals::Pupdr(val as u8) | ||
| 11828 | } | ||
| 11829 | #[doc = "Port x configuration bits (y = 0..15)"] | ||
| 11830 | pub fn set_pupdr(&mut self, n: usize, val: super::vals::Pupdr) { | ||
| 11831 | assert!(n < 16usize); | ||
| 11832 | let offs = 0usize + n * 2usize; | ||
| 11833 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | ||
| 11834 | } | ||
| 11835 | } | ||
| 11836 | impl Default for Pupdr { | ||
| 11837 | fn default() -> Pupdr { | ||
| 11838 | Pupdr(0) | ||
| 11839 | } | ||
| 11840 | } | ||
| 11841 | #[doc = "GPIO port input data register"] | ||
| 11842 | #[repr(transparent)] | ||
| 11843 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 11844 | pub struct Idr(pub u32); | ||
| 11845 | impl Idr { | ||
| 11846 | #[doc = "Port input data (y = 0..15)"] | ||
| 11847 | pub fn idr(&self, n: usize) -> super::vals::Idr { | ||
| 11848 | assert!(n < 16usize); | ||
| 11849 | let offs = 0usize + n * 1usize; | ||
| 11850 | let val = (self.0 >> offs) & 0x01; | ||
| 11851 | super::vals::Idr(val as u8) | ||
| 11852 | } | ||
| 11853 | #[doc = "Port input data (y = 0..15)"] | ||
| 11854 | pub fn set_idr(&mut self, n: usize, val: super::vals::Idr) { | ||
| 11855 | assert!(n < 16usize); | ||
| 11856 | let offs = 0usize + n * 1usize; | ||
| 11857 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 11858 | } | ||
| 11859 | } | ||
| 11860 | impl Default for Idr { | ||
| 11861 | fn default() -> Idr { | ||
| 11862 | Idr(0) | ||
| 11863 | } | ||
| 11864 | } | ||
| 11865 | #[doc = "GPIO port bit set/reset register"] | ||
| 11866 | #[repr(transparent)] | ||
| 11867 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 11868 | pub struct Bsrr(pub u32); | ||
| 11869 | impl Bsrr { | ||
| 11870 | #[doc = "Port x set bit y (y= 0..15)"] | ||
| 11871 | pub fn bs(&self, n: usize) -> bool { | ||
| 11872 | assert!(n < 16usize); | ||
| 11873 | let offs = 0usize + n * 1usize; | ||
| 11874 | let val = (self.0 >> offs) & 0x01; | ||
| 9351 | val != 0 | 11875 | val != 0 |
| 9352 | } | 11876 | } |
| 9353 | #[doc = "TXTFIE interrupt enable"] | 11877 | #[doc = "Port x set bit y (y= 0..15)"] |
| 9354 | pub fn set_txtfie(&mut self, val: bool) { | 11878 | pub fn set_bs(&mut self, n: usize, val: bool) { |
| 9355 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 11879 | assert!(n < 16usize); |
| 11880 | let offs = 0usize + n * 1usize; | ||
| 11881 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 9356 | } | 11882 | } |
| 9357 | #[doc = "UDR interrupt enable"] | 11883 | #[doc = "Port x set bit y (y= 0..15)"] |
| 9358 | pub const fn udrie(&self) -> bool { | 11884 | pub fn br(&self, n: usize) -> bool { |
| 9359 | let val = (self.0 >> 5usize) & 0x01; | 11885 | assert!(n < 16usize); |
| 11886 | let offs = 16usize + n * 1usize; | ||
| 11887 | let val = (self.0 >> offs) & 0x01; | ||
| 9360 | val != 0 | 11888 | val != 0 |
| 9361 | } | 11889 | } |
| 9362 | #[doc = "UDR interrupt enable"] | 11890 | #[doc = "Port x set bit y (y= 0..15)"] |
| 9363 | pub fn set_udrie(&mut self, val: bool) { | 11891 | pub fn set_br(&mut self, n: usize, val: bool) { |
| 9364 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 11892 | assert!(n < 16usize); |
| 11893 | let offs = 16usize + n * 1usize; | ||
| 11894 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 9365 | } | 11895 | } |
| 9366 | #[doc = "OVR interrupt enable"] | 11896 | } |
| 9367 | pub const fn ovrie(&self) -> bool { | 11897 | impl Default for Bsrr { |
| 9368 | let val = (self.0 >> 6usize) & 0x01; | 11898 | fn default() -> Bsrr { |
| 11899 | Bsrr(0) | ||
| 11900 | } | ||
| 11901 | } | ||
| 11902 | } | ||
| 11903 | } | ||
| 11904 | pub mod syscfg_l4 { | ||
| 11905 | use crate::generic::*; | ||
| 11906 | #[doc = "System configuration controller"] | ||
| 11907 | #[derive(Copy, Clone)] | ||
| 11908 | pub struct Syscfg(pub *mut u8); | ||
| 11909 | unsafe impl Send for Syscfg {} | ||
| 11910 | unsafe impl Sync for Syscfg {} | ||
| 11911 | impl Syscfg { | ||
| 11912 | #[doc = "memory remap register"] | ||
| 11913 | pub fn memrmp(self) -> Reg<regs::Memrmp, RW> { | ||
| 11914 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 11915 | } | ||
| 11916 | #[doc = "configuration register 1"] | ||
| 11917 | pub fn cfgr1(self) -> Reg<regs::Cfgr1, RW> { | ||
| 11918 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 11919 | } | ||
| 11920 | #[doc = "external interrupt configuration register 1"] | ||
| 11921 | pub fn exticr(self, n: usize) -> Reg<regs::Exticr, RW> { | ||
| 11922 | assert!(n < 4usize); | ||
| 11923 | unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) } | ||
| 11924 | } | ||
| 11925 | #[doc = "SCSR"] | ||
| 11926 | pub fn scsr(self) -> Reg<regs::Scsr, RW> { | ||
| 11927 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | ||
| 11928 | } | ||
| 11929 | #[doc = "CFGR2"] | ||
| 11930 | pub fn cfgr2(self) -> Reg<regs::Cfgr2, RW> { | ||
| 11931 | unsafe { Reg::from_ptr(self.0.add(28usize)) } | ||
| 11932 | } | ||
| 11933 | #[doc = "SWPR"] | ||
| 11934 | pub fn swpr(self) -> Reg<regs::Swpr, W> { | ||
| 11935 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | ||
| 11936 | } | ||
| 11937 | #[doc = "SKR"] | ||
| 11938 | pub fn skr(self) -> Reg<regs::Skr, W> { | ||
| 11939 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | ||
| 11940 | } | ||
| 11941 | } | ||
| 11942 | pub mod regs { | ||
| 11943 | use crate::generic::*; | ||
| 11944 | #[doc = "CFGR2"] | ||
| 11945 | #[repr(transparent)] | ||
| 11946 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 11947 | pub struct Cfgr2(pub u32); | ||
| 11948 | impl Cfgr2 { | ||
| 11949 | #[doc = "Cortex LOCKUP (Hardfault) output enable bit"] | ||
| 11950 | pub const fn cll(&self) -> bool { | ||
| 11951 | let val = (self.0 >> 0usize) & 0x01; | ||
| 9369 | val != 0 | 11952 | val != 0 |
| 9370 | } | 11953 | } |
| 9371 | #[doc = "OVR interrupt enable"] | 11954 | #[doc = "Cortex LOCKUP (Hardfault) output enable bit"] |
| 9372 | pub fn set_ovrie(&mut self, val: bool) { | 11955 | pub fn set_cll(&mut self, val: bool) { |
| 9373 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 11956 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 9374 | } | 11957 | } |
| 9375 | #[doc = "CRC Interrupt enable"] | 11958 | #[doc = "SRAM2 parity lock bit"] |
| 9376 | pub const fn crceie(&self) -> bool { | 11959 | pub const fn spl(&self) -> bool { |
| 9377 | let val = (self.0 >> 7usize) & 0x01; | 11960 | let val = (self.0 >> 1usize) & 0x01; |
| 9378 | val != 0 | 11961 | val != 0 |
| 9379 | } | 11962 | } |
| 9380 | #[doc = "CRC Interrupt enable"] | 11963 | #[doc = "SRAM2 parity lock bit"] |
| 9381 | pub fn set_crceie(&mut self, val: bool) { | 11964 | pub fn set_spl(&mut self, val: bool) { |
| 9382 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 11965 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 9383 | } | 11966 | } |
| 9384 | #[doc = "TIFRE interrupt enable"] | 11967 | #[doc = "PVD lock enable bit"] |
| 9385 | pub const fn tifreie(&self) -> bool { | 11968 | pub const fn pvdl(&self) -> bool { |
| 9386 | let val = (self.0 >> 8usize) & 0x01; | 11969 | let val = (self.0 >> 2usize) & 0x01; |
| 9387 | val != 0 | 11970 | val != 0 |
| 9388 | } | 11971 | } |
| 9389 | #[doc = "TIFRE interrupt enable"] | 11972 | #[doc = "PVD lock enable bit"] |
| 9390 | pub fn set_tifreie(&mut self, val: bool) { | 11973 | pub fn set_pvdl(&mut self, val: bool) { |
| 9391 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 11974 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 9392 | } | 11975 | } |
| 9393 | #[doc = "Mode Fault interrupt enable"] | 11976 | #[doc = "ECC Lock"] |
| 9394 | pub const fn modfie(&self) -> bool { | 11977 | pub const fn eccl(&self) -> bool { |
| 9395 | let val = (self.0 >> 9usize) & 0x01; | 11978 | let val = (self.0 >> 3usize) & 0x01; |
| 9396 | val != 0 | 11979 | val != 0 |
| 9397 | } | 11980 | } |
| 9398 | #[doc = "Mode Fault interrupt enable"] | 11981 | #[doc = "ECC Lock"] |
| 9399 | pub fn set_modfie(&mut self, val: bool) { | 11982 | pub fn set_eccl(&mut self, val: bool) { |
| 9400 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | 11983 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); |
| 9401 | } | 11984 | } |
| 9402 | #[doc = "Additional number of transactions reload interrupt enable"] | 11985 | #[doc = "SRAM2 parity error flag"] |
| 9403 | pub const fn tserfie(&self) -> bool { | 11986 | pub const fn spf(&self) -> bool { |
| 9404 | let val = (self.0 >> 10usize) & 0x01; | 11987 | let val = (self.0 >> 8usize) & 0x01; |
| 9405 | val != 0 | 11988 | val != 0 |
| 9406 | } | 11989 | } |
| 9407 | #[doc = "Additional number of transactions reload interrupt enable"] | 11990 | #[doc = "SRAM2 parity error flag"] |
| 9408 | pub fn set_tserfie(&mut self, val: bool) { | 11991 | pub fn set_spf(&mut self, val: bool) { |
| 9409 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | 11992 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 9410 | } | 11993 | } |
| 9411 | } | 11994 | } |
| 9412 | impl Default for Ier { | 11995 | impl Default for Cfgr2 { |
| 9413 | fn default() -> Ier { | 11996 | fn default() -> Cfgr2 { |
| 9414 | Ier(0) | 11997 | Cfgr2(0) |
| 9415 | } | 11998 | } |
| 9416 | } | 11999 | } |
| 9417 | #[doc = "control register 1"] | 12000 | #[doc = "configuration register 1"] |
| 9418 | #[repr(transparent)] | 12001 | #[repr(transparent)] |
| 9419 | #[derive(Copy, Clone, Eq, PartialEq)] | 12002 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9420 | pub struct Cr1(pub u32); | 12003 | pub struct Cfgr1(pub u32); |
| 9421 | impl Cr1 { | 12004 | impl Cfgr1 { |
| 9422 | #[doc = "Serial Peripheral Enable"] | 12005 | #[doc = "Firewall disable"] |
| 9423 | pub const fn spe(&self) -> bool { | 12006 | pub const fn fwdis(&self) -> bool { |
| 9424 | let val = (self.0 >> 0usize) & 0x01; | 12007 | let val = (self.0 >> 0usize) & 0x01; |
| 9425 | val != 0 | 12008 | val != 0 |
| 9426 | } | 12009 | } |
| 9427 | #[doc = "Serial Peripheral Enable"] | 12010 | #[doc = "Firewall disable"] |
| 9428 | pub fn set_spe(&mut self, val: bool) { | 12011 | pub fn set_fwdis(&mut self, val: bool) { |
| 9429 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 12012 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 9430 | } | 12013 | } |
| 9431 | #[doc = "Master automatic SUSP in Receive mode"] | 12014 | #[doc = "I/O analog switch voltage booster enable"] |
| 9432 | pub const fn masrx(&self) -> bool { | 12015 | pub const fn boosten(&self) -> bool { |
| 9433 | let val = (self.0 >> 8usize) & 0x01; | 12016 | let val = (self.0 >> 8usize) & 0x01; |
| 9434 | val != 0 | 12017 | val != 0 |
| 9435 | } | 12018 | } |
| 9436 | #[doc = "Master automatic SUSP in Receive mode"] | 12019 | #[doc = "I/O analog switch voltage booster enable"] |
| 9437 | pub fn set_masrx(&mut self, val: bool) { | 12020 | pub fn set_boosten(&mut self, val: bool) { |
| 9438 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 12021 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 9439 | } | 12022 | } |
| 9440 | #[doc = "Master transfer start"] | 12023 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB6"] |
| 9441 | pub const fn cstart(&self) -> bool { | 12024 | pub const fn i2c_pb6_fmp(&self) -> bool { |
| 9442 | let val = (self.0 >> 9usize) & 0x01; | 12025 | let val = (self.0 >> 16usize) & 0x01; |
| 9443 | val != 0 | 12026 | val != 0 |
| 9444 | } | 12027 | } |
| 9445 | #[doc = "Master transfer start"] | 12028 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB6"] |
| 9446 | pub fn set_cstart(&mut self, val: bool) { | 12029 | pub fn set_i2c_pb6_fmp(&mut self, val: bool) { |
| 9447 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | 12030 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); |
| 9448 | } | 12031 | } |
| 9449 | #[doc = "Master SUSPend request"] | 12032 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB7"] |
| 9450 | pub const fn csusp(&self) -> bool { | 12033 | pub const fn i2c_pb7_fmp(&self) -> bool { |
| 9451 | let val = (self.0 >> 10usize) & 0x01; | 12034 | let val = (self.0 >> 17usize) & 0x01; |
| 9452 | val != 0 | 12035 | val != 0 |
| 9453 | } | 12036 | } |
| 9454 | #[doc = "Master SUSPend request"] | 12037 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB7"] |
| 9455 | pub fn set_csusp(&mut self, val: bool) { | 12038 | pub fn set_i2c_pb7_fmp(&mut self, val: bool) { |
| 9456 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | 12039 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); |
| 9457 | } | 12040 | } |
| 9458 | #[doc = "Rx/Tx direction at Half-duplex mode"] | 12041 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB8"] |
| 9459 | pub const fn hddir(&self) -> super::vals::Hddir { | 12042 | pub const fn i2c_pb8_fmp(&self) -> bool { |
| 9460 | let val = (self.0 >> 11usize) & 0x01; | 12043 | let val = (self.0 >> 18usize) & 0x01; |
| 9461 | super::vals::Hddir(val as u8) | 12044 | val != 0 |
| 9462 | } | 12045 | } |
| 9463 | #[doc = "Rx/Tx direction at Half-duplex mode"] | 12046 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB8"] |
| 9464 | pub fn set_hddir(&mut self, val: super::vals::Hddir) { | 12047 | pub fn set_i2c_pb8_fmp(&mut self, val: bool) { |
| 9465 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); | 12048 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); |
| 9466 | } | 12049 | } |
| 9467 | #[doc = "Internal SS signal input level"] | 12050 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB9"] |
| 9468 | pub const fn ssi(&self) -> bool { | 12051 | pub const fn i2c_pb9_fmp(&self) -> bool { |
| 9469 | let val = (self.0 >> 12usize) & 0x01; | 12052 | let val = (self.0 >> 19usize) & 0x01; |
| 9470 | val != 0 | 12053 | val != 0 |
| 9471 | } | 12054 | } |
| 9472 | #[doc = "Internal SS signal input level"] | 12055 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB9"] |
| 9473 | pub fn set_ssi(&mut self, val: bool) { | 12056 | pub fn set_i2c_pb9_fmp(&mut self, val: bool) { |
| 9474 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); | 12057 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); |
| 9475 | } | 12058 | } |
| 9476 | #[doc = "32-bit CRC polynomial configuration"] | 12059 | #[doc = "I2C1 Fast-mode Plus driving capability activation"] |
| 9477 | pub const fn crc33_17(&self) -> super::vals::Crc { | 12060 | pub const fn i2c1_fmp(&self) -> bool { |
| 9478 | let val = (self.0 >> 13usize) & 0x01; | 12061 | let val = (self.0 >> 20usize) & 0x01; |
| 9479 | super::vals::Crc(val as u8) | 12062 | val != 0 |
| 9480 | } | 12063 | } |
| 9481 | #[doc = "32-bit CRC polynomial configuration"] | 12064 | #[doc = "I2C1 Fast-mode Plus driving capability activation"] |
| 9482 | pub fn set_crc33_17(&mut self, val: super::vals::Crc) { | 12065 | pub fn set_i2c1_fmp(&mut self, val: bool) { |
| 9483 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize); | 12066 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); |
| 9484 | } | 12067 | } |
| 9485 | #[doc = "CRC calculation initialization pattern control for receiver"] | 12068 | #[doc = "I2C2 Fast-mode Plus driving capability activation"] |
| 9486 | pub const fn rcrcini(&self) -> super::vals::Rcrcini { | 12069 | pub const fn i2c2_fmp(&self) -> bool { |
| 9487 | let val = (self.0 >> 14usize) & 0x01; | 12070 | let val = (self.0 >> 21usize) & 0x01; |
| 9488 | super::vals::Rcrcini(val as u8) | 12071 | val != 0 |
| 9489 | } | 12072 | } |
| 9490 | #[doc = "CRC calculation initialization pattern control for receiver"] | 12073 | #[doc = "I2C2 Fast-mode Plus driving capability activation"] |
| 9491 | pub fn set_rcrcini(&mut self, val: super::vals::Rcrcini) { | 12074 | pub fn set_i2c2_fmp(&mut self, val: bool) { |
| 9492 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | 12075 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); |
| 9493 | } | 12076 | } |
| 9494 | #[doc = "CRC calculation initialization pattern control for transmitter"] | 12077 | #[doc = "I2C3 Fast-mode Plus driving capability activation"] |
| 9495 | pub const fn tcrcini(&self) -> super::vals::Tcrcini { | 12078 | pub const fn i2c3_fmp(&self) -> bool { |
| 9496 | let val = (self.0 >> 15usize) & 0x01; | 12079 | let val = (self.0 >> 22usize) & 0x01; |
| 9497 | super::vals::Tcrcini(val as u8) | 12080 | val != 0 |
| 9498 | } | 12081 | } |
| 9499 | #[doc = "CRC calculation initialization pattern control for transmitter"] | 12082 | #[doc = "I2C3 Fast-mode Plus driving capability activation"] |
| 9500 | pub fn set_tcrcini(&mut self, val: super::vals::Tcrcini) { | 12083 | pub fn set_i2c3_fmp(&mut self, val: bool) { |
| 9501 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | 12084 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); |
| 9502 | } | 12085 | } |
| 9503 | #[doc = "Locking the AF configuration of associated IOs"] | 12086 | #[doc = "Floating Point Unit interrupts enable bits"] |
| 9504 | pub const fn iolock(&self) -> bool { | 12087 | pub const fn fpu_ie(&self) -> u8 { |
| 9505 | let val = (self.0 >> 16usize) & 0x01; | 12088 | let val = (self.0 >> 26usize) & 0x3f; |
| 12089 | val as u8 | ||
| 12090 | } | ||
| 12091 | #[doc = "Floating Point Unit interrupts enable bits"] | ||
| 12092 | pub fn set_fpu_ie(&mut self, val: u8) { | ||
| 12093 | self.0 = (self.0 & !(0x3f << 26usize)) | (((val as u32) & 0x3f) << 26usize); | ||
| 12094 | } | ||
| 12095 | } | ||
| 12096 | impl Default for Cfgr1 { | ||
| 12097 | fn default() -> Cfgr1 { | ||
| 12098 | Cfgr1(0) | ||
| 12099 | } | ||
| 12100 | } | ||
| 12101 | #[doc = "SWPR"] | ||
| 12102 | #[repr(transparent)] | ||
| 12103 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 12104 | pub struct Swpr(pub u32); | ||
| 12105 | impl Swpr { | ||
| 12106 | #[doc = "SRAWM2 write protection."] | ||
| 12107 | pub fn pwp(&self, n: usize) -> bool { | ||
| 12108 | assert!(n < 32usize); | ||
| 12109 | let offs = 0usize + n * 1usize; | ||
| 12110 | let val = (self.0 >> offs) & 0x01; | ||
| 9506 | val != 0 | 12111 | val != 0 |
| 9507 | } | 12112 | } |
| 9508 | #[doc = "Locking the AF configuration of associated IOs"] | 12113 | #[doc = "SRAWM2 write protection."] |
| 9509 | pub fn set_iolock(&mut self, val: bool) { | 12114 | pub fn set_pwp(&mut self, n: usize, val: bool) { |
| 9510 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | 12115 | assert!(n < 32usize); |
| 12116 | let offs = 0usize + n * 1usize; | ||
| 12117 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 9511 | } | 12118 | } |
| 9512 | } | 12119 | } |
| 9513 | impl Default for Cr1 { | 12120 | impl Default for Swpr { |
| 9514 | fn default() -> Cr1 { | 12121 | fn default() -> Swpr { |
| 9515 | Cr1(0) | 12122 | Swpr(0) |
| 9516 | } | 12123 | } |
| 9517 | } | 12124 | } |
| 9518 | #[doc = "Receiver CRC Register"] | 12125 | #[doc = "memory remap register"] |
| 9519 | #[repr(transparent)] | 12126 | #[repr(transparent)] |
| 9520 | #[derive(Copy, Clone, Eq, PartialEq)] | 12127 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9521 | pub struct Rxcrc(pub u32); | 12128 | pub struct Memrmp(pub u32); |
| 9522 | impl Rxcrc { | 12129 | impl Memrmp { |
| 9523 | #[doc = "CRC register for receiver"] | 12130 | #[doc = "Memory mapping selection"] |
| 9524 | pub const fn rxcrc(&self) -> u32 { | 12131 | pub const fn mem_mode(&self) -> u8 { |
| 9525 | let val = (self.0 >> 0usize) & 0xffff_ffff; | 12132 | let val = (self.0 >> 0usize) & 0x07; |
| 9526 | val as u32 | 12133 | val as u8 |
| 9527 | } | 12134 | } |
| 9528 | #[doc = "CRC register for receiver"] | 12135 | #[doc = "Memory mapping selection"] |
| 9529 | pub fn set_rxcrc(&mut self, val: u32) { | 12136 | pub fn set_mem_mode(&mut self, val: u8) { |
| 9530 | self.0 = | 12137 | self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize); |
| 9531 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | 12138 | } |
| 12139 | #[doc = "QUADSPI memory mapping swap"] | ||
| 12140 | pub const fn qfs(&self) -> bool { | ||
| 12141 | let val = (self.0 >> 3usize) & 0x01; | ||
| 12142 | val != 0 | ||
| 12143 | } | ||
| 12144 | #[doc = "QUADSPI memory mapping swap"] | ||
| 12145 | pub fn set_qfs(&mut self, val: bool) { | ||
| 12146 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | ||
| 12147 | } | ||
| 12148 | #[doc = "Flash Bank mode selection"] | ||
| 12149 | pub const fn fb_mode(&self) -> bool { | ||
| 12150 | let val = (self.0 >> 8usize) & 0x01; | ||
| 12151 | val != 0 | ||
| 12152 | } | ||
| 12153 | #[doc = "Flash Bank mode selection"] | ||
| 12154 | pub fn set_fb_mode(&mut self, val: bool) { | ||
| 12155 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 9532 | } | 12156 | } |
| 9533 | } | 12157 | } |
| 9534 | impl Default for Rxcrc { | 12158 | impl Default for Memrmp { |
| 9535 | fn default() -> Rxcrc { | 12159 | fn default() -> Memrmp { |
| 9536 | Rxcrc(0) | 12160 | Memrmp(0) |
| 9537 | } | 12161 | } |
| 9538 | } | 12162 | } |
| 9539 | #[doc = "Transmit Data Register"] | 12163 | #[doc = "external interrupt configuration register 4"] |
| 9540 | #[repr(transparent)] | 12164 | #[repr(transparent)] |
| 9541 | #[derive(Copy, Clone, Eq, PartialEq)] | 12165 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9542 | pub struct Txdr(pub u32); | 12166 | pub struct Exticr(pub u32); |
| 9543 | impl Txdr { | 12167 | impl Exticr { |
| 9544 | #[doc = "Transmit data register"] | 12168 | #[doc = "EXTI12 configuration bits"] |
| 9545 | pub const fn txdr(&self) -> u32 { | 12169 | pub fn exti(&self, n: usize) -> u8 { |
| 9546 | let val = (self.0 >> 0usize) & 0xffff_ffff; | 12170 | assert!(n < 4usize); |
| 9547 | val as u32 | 12171 | let offs = 0usize + n * 4usize; |
| 12172 | let val = (self.0 >> offs) & 0x0f; | ||
| 12173 | val as u8 | ||
| 9548 | } | 12174 | } |
| 9549 | #[doc = "Transmit data register"] | 12175 | #[doc = "EXTI12 configuration bits"] |
| 9550 | pub fn set_txdr(&mut self, val: u32) { | 12176 | pub fn set_exti(&mut self, n: usize, val: u8) { |
| 9551 | self.0 = | 12177 | assert!(n < 4usize); |
| 9552 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | 12178 | let offs = 0usize + n * 4usize; |
| 12179 | self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs); | ||
| 9553 | } | 12180 | } |
| 9554 | } | 12181 | } |
| 9555 | impl Default for Txdr { | 12182 | impl Default for Exticr { |
| 9556 | fn default() -> Txdr { | 12183 | fn default() -> Exticr { |
| 9557 | Txdr(0) | 12184 | Exticr(0) |
| 9558 | } | 12185 | } |
| 9559 | } | 12186 | } |
| 9560 | #[doc = "Status Register"] | 12187 | #[doc = "SCSR"] |
| 9561 | #[repr(transparent)] | 12188 | #[repr(transparent)] |
| 9562 | #[derive(Copy, Clone, Eq, PartialEq)] | 12189 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9563 | pub struct Sr(pub u32); | 12190 | pub struct Scsr(pub u32); |
| 9564 | impl Sr { | 12191 | impl Scsr { |
| 9565 | #[doc = "Rx-Packet available"] | 12192 | #[doc = "SRAM2 Erase"] |
| 9566 | pub const fn rxp(&self) -> bool { | 12193 | pub const fn sram2er(&self) -> bool { |
| 9567 | let val = (self.0 >> 0usize) & 0x01; | 12194 | let val = (self.0 >> 0usize) & 0x01; |
| 9568 | val != 0 | 12195 | val != 0 |
| 9569 | } | 12196 | } |
| 9570 | #[doc = "Rx-Packet available"] | 12197 | #[doc = "SRAM2 Erase"] |
| 9571 | pub fn set_rxp(&mut self, val: bool) { | 12198 | pub fn set_sram2er(&mut self, val: bool) { |
| 9572 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 12199 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 9573 | } | 12200 | } |
| 9574 | #[doc = "Tx-Packet space available"] | 12201 | #[doc = "SRAM2 busy by erase operation"] |
| 9575 | pub const fn txp(&self) -> bool { | 12202 | pub const fn sram2bsy(&self) -> bool { |
| 9576 | let val = (self.0 >> 1usize) & 0x01; | 12203 | let val = (self.0 >> 1usize) & 0x01; |
| 9577 | val != 0 | 12204 | val != 0 |
| 9578 | } | 12205 | } |
| 9579 | #[doc = "Tx-Packet space available"] | 12206 | #[doc = "SRAM2 busy by erase operation"] |
| 9580 | pub fn set_txp(&mut self, val: bool) { | 12207 | pub fn set_sram2bsy(&mut self, val: bool) { |
| 9581 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 12208 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 9582 | } | 12209 | } |
| 9583 | #[doc = "Duplex Packet"] | 12210 | } |
| 9584 | pub const fn dxp(&self) -> bool { | 12211 | impl Default for Scsr { |
| 9585 | let val = (self.0 >> 2usize) & 0x01; | 12212 | fn default() -> Scsr { |
| 9586 | val != 0 | 12213 | Scsr(0) |
| 9587 | } | ||
| 9588 | #[doc = "Duplex Packet"] | ||
| 9589 | pub fn set_dxp(&mut self, val: bool) { | ||
| 9590 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 9591 | } | 12214 | } |
| 9592 | #[doc = "End Of Transfer"] | 12215 | } |
| 9593 | pub const fn eot(&self) -> bool { | 12216 | #[doc = "SKR"] |
| 9594 | let val = (self.0 >> 3usize) & 0x01; | 12217 | #[repr(transparent)] |
| 9595 | val != 0 | 12218 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 12219 | pub struct Skr(pub u32); | ||
| 12220 | impl Skr { | ||
| 12221 | #[doc = "SRAM2 write protection key for software erase"] | ||
| 12222 | pub const fn key(&self) -> u8 { | ||
| 12223 | let val = (self.0 >> 0usize) & 0xff; | ||
| 12224 | val as u8 | ||
| 9596 | } | 12225 | } |
| 9597 | #[doc = "End Of Transfer"] | 12226 | #[doc = "SRAM2 write protection key for software erase"] |
| 9598 | pub fn set_eot(&mut self, val: bool) { | 12227 | pub fn set_key(&mut self, val: u8) { |
| 9599 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 12228 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); |
| 9600 | } | 12229 | } |
| 9601 | #[doc = "Transmission Transfer Filled"] | 12230 | } |
| 9602 | pub const fn txtf(&self) -> bool { | 12231 | impl Default for Skr { |
| 9603 | let val = (self.0 >> 4usize) & 0x01; | 12232 | fn default() -> Skr { |
| 9604 | val != 0 | 12233 | Skr(0) |
| 9605 | } | 12234 | } |
| 9606 | #[doc = "Transmission Transfer Filled"] | 12235 | } |
| 9607 | pub fn set_txtf(&mut self, val: bool) { | 12236 | } |
| 9608 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 12237 | } |
| 12238 | pub mod dbgmcu_h7 { | ||
| 12239 | use crate::generic::*; | ||
| 12240 | #[doc = "Debug support"] | ||
| 12241 | #[derive(Copy, Clone)] | ||
| 12242 | pub struct Dbgmcu(pub *mut u8); | ||
| 12243 | unsafe impl Send for Dbgmcu {} | ||
| 12244 | unsafe impl Sync for Dbgmcu {} | ||
| 12245 | impl Dbgmcu { | ||
| 12246 | #[doc = "Identity code"] | ||
| 12247 | pub fn idc(self) -> Reg<regs::Idc, R> { | ||
| 12248 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 12249 | } | ||
| 12250 | #[doc = "Configuration register"] | ||
| 12251 | pub fn cr(self) -> Reg<regs::Cr, RW> { | ||
| 12252 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 12253 | } | ||
| 12254 | #[doc = "APB3 peripheral freeze register"] | ||
| 12255 | pub fn apb3fz1(self) -> Reg<regs::Apb3fz1, RW> { | ||
| 12256 | unsafe { Reg::from_ptr(self.0.add(52usize)) } | ||
| 12257 | } | ||
| 12258 | #[doc = "APB1L peripheral freeze register"] | ||
| 12259 | pub fn apb1lfz1(self) -> Reg<regs::Apb1lfz1, RW> { | ||
| 12260 | unsafe { Reg::from_ptr(self.0.add(60usize)) } | ||
| 12261 | } | ||
| 12262 | #[doc = "APB2 peripheral freeze register"] | ||
| 12263 | pub fn apb2fz1(self) -> Reg<regs::Apb2fz1, RW> { | ||
| 12264 | unsafe { Reg::from_ptr(self.0.add(76usize)) } | ||
| 12265 | } | ||
| 12266 | #[doc = "APB4 peripheral freeze register"] | ||
| 12267 | pub fn apb4fz1(self) -> Reg<regs::Apb4fz1, RW> { | ||
| 12268 | unsafe { Reg::from_ptr(self.0.add(84usize)) } | ||
| 12269 | } | ||
| 12270 | } | ||
| 12271 | pub mod regs { | ||
| 12272 | use crate::generic::*; | ||
| 12273 | #[doc = "Identity code"] | ||
| 12274 | #[repr(transparent)] | ||
| 12275 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 12276 | pub struct Idc(pub u32); | ||
| 12277 | impl Idc { | ||
| 12278 | #[doc = "Device ID"] | ||
| 12279 | pub const fn dev_id(&self) -> u16 { | ||
| 12280 | let val = (self.0 >> 0usize) & 0x0fff; | ||
| 12281 | val as u16 | ||
| 9609 | } | 12282 | } |
| 9610 | #[doc = "Underrun at slave transmission mode"] | 12283 | #[doc = "Device ID"] |
| 9611 | pub const fn udr(&self) -> bool { | 12284 | pub fn set_dev_id(&mut self, val: u16) { |
| 9612 | let val = (self.0 >> 5usize) & 0x01; | 12285 | self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); |
| 9613 | val != 0 | ||
| 9614 | } | 12286 | } |
| 9615 | #[doc = "Underrun at slave transmission mode"] | 12287 | #[doc = "Revision ID"] |
| 9616 | pub fn set_udr(&mut self, val: bool) { | 12288 | pub const fn rev_id(&self) -> u16 { |
| 9617 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 12289 | let val = (self.0 >> 16usize) & 0xffff; |
| 12290 | val as u16 | ||
| 9618 | } | 12291 | } |
| 9619 | #[doc = "Overrun"] | 12292 | #[doc = "Revision ID"] |
| 9620 | pub const fn ovr(&self) -> bool { | 12293 | pub fn set_rev_id(&mut self, val: u16) { |
| 9621 | let val = (self.0 >> 6usize) & 0x01; | 12294 | self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize); |
| 9622 | val != 0 | ||
| 9623 | } | 12295 | } |
| 9624 | #[doc = "Overrun"] | 12296 | } |
| 9625 | pub fn set_ovr(&mut self, val: bool) { | 12297 | impl Default for Idc { |
| 9626 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 12298 | fn default() -> Idc { |
| 12299 | Idc(0) | ||
| 9627 | } | 12300 | } |
| 9628 | #[doc = "CRC Error"] | 12301 | } |
| 9629 | pub const fn crce(&self) -> bool { | 12302 | #[doc = "APB4 peripheral freeze register"] |
| 12303 | #[repr(transparent)] | ||
| 12304 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 12305 | pub struct Apb4fz1(pub u32); | ||
| 12306 | impl Apb4fz1 { | ||
| 12307 | #[doc = "I2C4 SMBUS timeout stop in debug mode"] | ||
| 12308 | pub const fn i2c4(&self) -> bool { | ||
| 9630 | let val = (self.0 >> 7usize) & 0x01; | 12309 | let val = (self.0 >> 7usize) & 0x01; |
| 9631 | val != 0 | 12310 | val != 0 |
| 9632 | } | 12311 | } |
| 9633 | #[doc = "CRC Error"] | 12312 | #[doc = "I2C4 SMBUS timeout stop in debug mode"] |
| 9634 | pub fn set_crce(&mut self, val: bool) { | 12313 | pub fn set_i2c4(&mut self, val: bool) { |
| 9635 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 12314 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 9636 | } | 12315 | } |
| 9637 | #[doc = "TI frame format error"] | 12316 | #[doc = "LPTIM2 stop in debug mode"] |
| 9638 | pub const fn tifre(&self) -> bool { | 12317 | pub const fn lptim2(&self) -> bool { |
| 9639 | let val = (self.0 >> 8usize) & 0x01; | ||
| 9640 | val != 0 | ||
| 9641 | } | ||
| 9642 | #[doc = "TI frame format error"] | ||
| 9643 | pub fn set_tifre(&mut self, val: bool) { | ||
| 9644 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 9645 | } | ||
| 9646 | #[doc = "Mode Fault"] | ||
| 9647 | pub const fn modf(&self) -> bool { | ||
| 9648 | let val = (self.0 >> 9usize) & 0x01; | 12318 | let val = (self.0 >> 9usize) & 0x01; |
| 9649 | val != 0 | 12319 | val != 0 |
| 9650 | } | 12320 | } |
| 9651 | #[doc = "Mode Fault"] | 12321 | #[doc = "LPTIM2 stop in debug mode"] |
| 9652 | pub fn set_modf(&mut self, val: bool) { | 12322 | pub fn set_lptim2(&mut self, val: bool) { |
| 9653 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | 12323 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); |
| 9654 | } | 12324 | } |
| 9655 | #[doc = "Additional number of SPI data to be transacted was reload"] | 12325 | #[doc = "LPTIM3 stop in debug mode"] |
| 9656 | pub const fn tserf(&self) -> bool { | 12326 | pub const fn lptim3(&self) -> bool { |
| 9657 | let val = (self.0 >> 10usize) & 0x01; | 12327 | let val = (self.0 >> 10usize) & 0x01; |
| 9658 | val != 0 | 12328 | val != 0 |
| 9659 | } | 12329 | } |
| 9660 | #[doc = "Additional number of SPI data to be transacted was reload"] | 12330 | #[doc = "LPTIM3 stop in debug mode"] |
| 9661 | pub fn set_tserf(&mut self, val: bool) { | 12331 | pub fn set_lptim3(&mut self, val: bool) { |
| 9662 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | 12332 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); |
| 9663 | } | 12333 | } |
| 9664 | #[doc = "SUSPend"] | 12334 | #[doc = "LPTIM4 stop in debug mode"] |
| 9665 | pub const fn susp(&self) -> bool { | 12335 | pub const fn lptim4(&self) -> bool { |
| 9666 | let val = (self.0 >> 11usize) & 0x01; | 12336 | let val = (self.0 >> 11usize) & 0x01; |
| 9667 | val != 0 | 12337 | val != 0 |
| 9668 | } | 12338 | } |
| 9669 | #[doc = "SUSPend"] | 12339 | #[doc = "LPTIM4 stop in debug mode"] |
| 9670 | pub fn set_susp(&mut self, val: bool) { | 12340 | pub fn set_lptim4(&mut self, val: bool) { |
| 9671 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); | 12341 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); |
| 9672 | } | 12342 | } |
| 9673 | #[doc = "TxFIFO transmission complete"] | 12343 | #[doc = "LPTIM5 stop in debug mode"] |
| 9674 | pub const fn txc(&self) -> bool { | 12344 | pub const fn lptim5(&self) -> bool { |
| 9675 | let val = (self.0 >> 12usize) & 0x01; | 12345 | let val = (self.0 >> 12usize) & 0x01; |
| 9676 | val != 0 | 12346 | val != 0 |
| 9677 | } | 12347 | } |
| 9678 | #[doc = "TxFIFO transmission complete"] | 12348 | #[doc = "LPTIM5 stop in debug mode"] |
| 9679 | pub fn set_txc(&mut self, val: bool) { | 12349 | pub fn set_lptim5(&mut self, val: bool) { |
| 9680 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); | 12350 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); |
| 9681 | } | 12351 | } |
| 9682 | #[doc = "RxFIFO Packing LeVeL"] | 12352 | #[doc = "RTC stop in debug mode"] |
| 9683 | pub const fn rxplvl(&self) -> super::vals::Rxplvl { | 12353 | pub const fn rtc(&self) -> bool { |
| 9684 | let val = (self.0 >> 13usize) & 0x03; | 12354 | let val = (self.0 >> 16usize) & 0x01; |
| 9685 | super::vals::Rxplvl(val as u8) | 12355 | val != 0 |
| 9686 | } | ||
| 9687 | #[doc = "RxFIFO Packing LeVeL"] | ||
| 9688 | pub fn set_rxplvl(&mut self, val: super::vals::Rxplvl) { | ||
| 9689 | self.0 = (self.0 & !(0x03 << 13usize)) | (((val.0 as u32) & 0x03) << 13usize); | ||
| 9690 | } | ||
| 9691 | #[doc = "RxFIFO Word Not Empty"] | ||
| 9692 | pub const fn rxwne(&self) -> super::vals::Rxwne { | ||
| 9693 | let val = (self.0 >> 15usize) & 0x01; | ||
| 9694 | super::vals::Rxwne(val as u8) | ||
| 9695 | } | 12356 | } |
| 9696 | #[doc = "RxFIFO Word Not Empty"] | 12357 | #[doc = "RTC stop in debug mode"] |
| 9697 | pub fn set_rxwne(&mut self, val: super::vals::Rxwne) { | 12358 | pub fn set_rtc(&mut self, val: bool) { |
| 9698 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | 12359 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); |
| 9699 | } | 12360 | } |
| 9700 | #[doc = "Number of data frames remaining in current TSIZE session"] | 12361 | #[doc = "Independent watchdog for D1 stop in debug mode"] |
| 9701 | pub const fn ctsize(&self) -> u16 { | 12362 | pub const fn iwdg1(&self) -> bool { |
| 9702 | let val = (self.0 >> 16usize) & 0xffff; | 12363 | let val = (self.0 >> 18usize) & 0x01; |
| 9703 | val as u16 | 12364 | val != 0 |
| 9704 | } | 12365 | } |
| 9705 | #[doc = "Number of data frames remaining in current TSIZE session"] | 12366 | #[doc = "Independent watchdog for D1 stop in debug mode"] |
| 9706 | pub fn set_ctsize(&mut self, val: u16) { | 12367 | pub fn set_iwdg1(&mut self, val: bool) { |
| 9707 | self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize); | 12368 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); |
| 9708 | } | 12369 | } |
| 9709 | } | 12370 | } |
| 9710 | impl Default for Sr { | 12371 | impl Default for Apb4fz1 { |
| 9711 | fn default() -> Sr { | 12372 | fn default() -> Apb4fz1 { |
| 9712 | Sr(0) | 12373 | Apb4fz1(0) |
| 9713 | } | 12374 | } |
| 9714 | } | 12375 | } |
| 9715 | #[doc = "Interrupt/Status Flags Clear Register"] | 12376 | #[doc = "APB1L peripheral freeze register"] |
| 9716 | #[repr(transparent)] | 12377 | #[repr(transparent)] |
| 9717 | #[derive(Copy, Clone, Eq, PartialEq)] | 12378 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9718 | pub struct Ifcr(pub u32); | 12379 | pub struct Apb1lfz1(pub u32); |
| 9719 | impl Ifcr { | 12380 | impl Apb1lfz1 { |
| 9720 | #[doc = "End Of Transfer flag clear"] | 12381 | #[doc = "TIM2 stop in debug mode"] |
| 9721 | pub const fn eotc(&self) -> bool { | 12382 | pub const fn tim2(&self) -> bool { |
| 12383 | let val = (self.0 >> 0usize) & 0x01; | ||
| 12384 | val != 0 | ||
| 12385 | } | ||
| 12386 | #[doc = "TIM2 stop in debug mode"] | ||
| 12387 | pub fn set_tim2(&mut self, val: bool) { | ||
| 12388 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 12389 | } | ||
| 12390 | #[doc = "TIM3 stop in debug mode"] | ||
| 12391 | pub const fn tim3(&self) -> bool { | ||
| 12392 | let val = (self.0 >> 1usize) & 0x01; | ||
| 12393 | val != 0 | ||
| 12394 | } | ||
| 12395 | #[doc = "TIM3 stop in debug mode"] | ||
| 12396 | pub fn set_tim3(&mut self, val: bool) { | ||
| 12397 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | ||
| 12398 | } | ||
| 12399 | #[doc = "TIM4 stop in debug mode"] | ||
| 12400 | pub const fn tim4(&self) -> bool { | ||
| 12401 | let val = (self.0 >> 2usize) & 0x01; | ||
| 12402 | val != 0 | ||
| 12403 | } | ||
| 12404 | #[doc = "TIM4 stop in debug mode"] | ||
| 12405 | pub fn set_tim4(&mut self, val: bool) { | ||
| 12406 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 12407 | } | ||
| 12408 | #[doc = "TIM5 stop in debug mode"] | ||
| 12409 | pub const fn tim5(&self) -> bool { | ||
| 9722 | let val = (self.0 >> 3usize) & 0x01; | 12410 | let val = (self.0 >> 3usize) & 0x01; |
| 9723 | val != 0 | 12411 | val != 0 |
| 9724 | } | 12412 | } |
| 9725 | #[doc = "End Of Transfer flag clear"] | 12413 | #[doc = "TIM5 stop in debug mode"] |
| 9726 | pub fn set_eotc(&mut self, val: bool) { | 12414 | pub fn set_tim5(&mut self, val: bool) { |
| 9727 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 12415 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); |
| 9728 | } | 12416 | } |
| 9729 | #[doc = "Transmission Transfer Filled flag clear"] | 12417 | #[doc = "TIM6 stop in debug mode"] |
| 9730 | pub const fn txtfc(&self) -> bool { | 12418 | pub const fn tim6(&self) -> bool { |
| 9731 | let val = (self.0 >> 4usize) & 0x01; | 12419 | let val = (self.0 >> 4usize) & 0x01; |
| 9732 | val != 0 | 12420 | val != 0 |
| 9733 | } | 12421 | } |
| 9734 | #[doc = "Transmission Transfer Filled flag clear"] | 12422 | #[doc = "TIM6 stop in debug mode"] |
| 9735 | pub fn set_txtfc(&mut self, val: bool) { | 12423 | pub fn set_tim6(&mut self, val: bool) { |
| 9736 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 12424 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 9737 | } | 12425 | } |
| 9738 | #[doc = "Underrun flag clear"] | 12426 | #[doc = "TIM7 stop in debug mode"] |
| 9739 | pub const fn udrc(&self) -> bool { | 12427 | pub const fn tim7(&self) -> bool { |
| 9740 | let val = (self.0 >> 5usize) & 0x01; | 12428 | let val = (self.0 >> 5usize) & 0x01; |
| 9741 | val != 0 | 12429 | val != 0 |
| 9742 | } | 12430 | } |
| 9743 | #[doc = "Underrun flag clear"] | 12431 | #[doc = "TIM7 stop in debug mode"] |
| 9744 | pub fn set_udrc(&mut self, val: bool) { | 12432 | pub fn set_tim7(&mut self, val: bool) { |
| 9745 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 12433 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 9746 | } | 12434 | } |
| 9747 | #[doc = "Overrun flag clear"] | 12435 | #[doc = "TIM12 stop in debug mode"] |
| 9748 | pub const fn ovrc(&self) -> bool { | 12436 | pub const fn tim12(&self) -> bool { |
| 9749 | let val = (self.0 >> 6usize) & 0x01; | 12437 | let val = (self.0 >> 6usize) & 0x01; |
| 9750 | val != 0 | 12438 | val != 0 |
| 9751 | } | 12439 | } |
| 9752 | #[doc = "Overrun flag clear"] | 12440 | #[doc = "TIM12 stop in debug mode"] |
| 9753 | pub fn set_ovrc(&mut self, val: bool) { | 12441 | pub fn set_tim12(&mut self, val: bool) { |
| 9754 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 12442 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 9755 | } | 12443 | } |
| 9756 | #[doc = "CRC Error flag clear"] | 12444 | #[doc = "TIM13 stop in debug mode"] |
| 9757 | pub const fn crcec(&self) -> bool { | 12445 | pub const fn tim13(&self) -> bool { |
| 9758 | let val = (self.0 >> 7usize) & 0x01; | 12446 | let val = (self.0 >> 7usize) & 0x01; |
| 9759 | val != 0 | 12447 | val != 0 |
| 9760 | } | 12448 | } |
| 9761 | #[doc = "CRC Error flag clear"] | 12449 | #[doc = "TIM13 stop in debug mode"] |
| 9762 | pub fn set_crcec(&mut self, val: bool) { | 12450 | pub fn set_tim13(&mut self, val: bool) { |
| 9763 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 12451 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 9764 | } | 12452 | } |
| 9765 | #[doc = "TI frame format error flag clear"] | 12453 | #[doc = "TIM14 stop in debug mode"] |
| 9766 | pub const fn tifrec(&self) -> bool { | 12454 | pub const fn tim14(&self) -> bool { |
| 9767 | let val = (self.0 >> 8usize) & 0x01; | 12455 | let val = (self.0 >> 8usize) & 0x01; |
| 9768 | val != 0 | 12456 | val != 0 |
| 9769 | } | 12457 | } |
| 9770 | #[doc = "TI frame format error flag clear"] | 12458 | #[doc = "TIM14 stop in debug mode"] |
| 9771 | pub fn set_tifrec(&mut self, val: bool) { | 12459 | pub fn set_tim14(&mut self, val: bool) { |
| 9772 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 12460 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 9773 | } | 12461 | } |
| 9774 | #[doc = "Mode Fault flag clear"] | 12462 | #[doc = "LPTIM1 stop in debug mode"] |
| 9775 | pub const fn modfc(&self) -> bool { | 12463 | pub const fn lptim1(&self) -> bool { |
| 9776 | let val = (self.0 >> 9usize) & 0x01; | 12464 | let val = (self.0 >> 9usize) & 0x01; |
| 9777 | val != 0 | 12465 | val != 0 |
| 9778 | } | 12466 | } |
| 9779 | #[doc = "Mode Fault flag clear"] | 12467 | #[doc = "LPTIM1 stop in debug mode"] |
| 9780 | pub fn set_modfc(&mut self, val: bool) { | 12468 | pub fn set_lptim1(&mut self, val: bool) { |
| 9781 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | 12469 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); |
| 9782 | } | 12470 | } |
| 9783 | #[doc = "TSERFC flag clear"] | 12471 | #[doc = "I2C1 SMBUS timeout stop in debug mode"] |
| 9784 | pub const fn tserfc(&self) -> bool { | 12472 | pub const fn i2c1(&self) -> bool { |
| 9785 | let val = (self.0 >> 10usize) & 0x01; | 12473 | let val = (self.0 >> 21usize) & 0x01; |
| 9786 | val != 0 | 12474 | val != 0 |
| 9787 | } | 12475 | } |
| 9788 | #[doc = "TSERFC flag clear"] | 12476 | #[doc = "I2C1 SMBUS timeout stop in debug mode"] |
| 9789 | pub fn set_tserfc(&mut self, val: bool) { | 12477 | pub fn set_i2c1(&mut self, val: bool) { |
| 9790 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | 12478 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); |
| 9791 | } | 12479 | } |
| 9792 | #[doc = "SUSPend flag clear"] | 12480 | #[doc = "I2C2 SMBUS timeout stop in debug mode"] |
| 9793 | pub const fn suspc(&self) -> bool { | 12481 | pub const fn i2c2(&self) -> bool { |
| 9794 | let val = (self.0 >> 11usize) & 0x01; | 12482 | let val = (self.0 >> 22usize) & 0x01; |
| 9795 | val != 0 | 12483 | val != 0 |
| 9796 | } | 12484 | } |
| 9797 | #[doc = "SUSPend flag clear"] | 12485 | #[doc = "I2C2 SMBUS timeout stop in debug mode"] |
| 9798 | pub fn set_suspc(&mut self, val: bool) { | 12486 | pub fn set_i2c2(&mut self, val: bool) { |
| 9799 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); | 12487 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); |
| 9800 | } | ||
| 9801 | } | ||
| 9802 | impl Default for Ifcr { | ||
| 9803 | fn default() -> Ifcr { | ||
| 9804 | Ifcr(0) | ||
| 9805 | } | 12488 | } |
| 9806 | } | 12489 | #[doc = "I2C3 SMBUS timeout stop in debug mode"] |
| 9807 | } | 12490 | pub const fn i2c3(&self) -> bool { |
| 9808 | } | 12491 | let val = (self.0 >> 23usize) & 0x01; |
| 9809 | pub mod syscfg_l0 { | 12492 | val != 0 |
| 9810 | use crate::generic::*; | ||
| 9811 | #[doc = "System configuration controller"] | ||
| 9812 | #[derive(Copy, Clone)] | ||
| 9813 | pub struct Syscfg(pub *mut u8); | ||
| 9814 | unsafe impl Send for Syscfg {} | ||
| 9815 | unsafe impl Sync for Syscfg {} | ||
| 9816 | impl Syscfg { | ||
| 9817 | #[doc = "configuration register 1"] | ||
| 9818 | pub fn cfgr1(self) -> Reg<regs::Cfgr1, RW> { | ||
| 9819 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 9820 | } | ||
| 9821 | #[doc = "CFGR2"] | ||
| 9822 | pub fn cfgr2(self) -> Reg<regs::Cfgr2, RW> { | ||
| 9823 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 9824 | } | ||
| 9825 | #[doc = "external interrupt configuration register"] | ||
| 9826 | pub fn exticr(self, n: usize) -> Reg<regs::Exticr, RW> { | ||
| 9827 | assert!(n < 4usize); | ||
| 9828 | unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) } | ||
| 9829 | } | ||
| 9830 | #[doc = "CFGR3"] | ||
| 9831 | pub fn cfgr3(self) -> Reg<regs::Cfgr3, RW> { | ||
| 9832 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | ||
| 9833 | } | ||
| 9834 | } | ||
| 9835 | pub mod regs { | ||
| 9836 | use crate::generic::*; | ||
| 9837 | #[doc = "external interrupt configuration register 1-4"] | ||
| 9838 | #[repr(transparent)] | ||
| 9839 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 9840 | pub struct Exticr(pub u32); | ||
| 9841 | impl Exticr { | ||
| 9842 | #[doc = "EXTI configuration bits"] | ||
| 9843 | pub fn exti(&self, n: usize) -> u8 { | ||
| 9844 | assert!(n < 4usize); | ||
| 9845 | let offs = 0usize + n * 4usize; | ||
| 9846 | let val = (self.0 >> offs) & 0x0f; | ||
| 9847 | val as u8 | ||
| 9848 | } | 12493 | } |
| 9849 | #[doc = "EXTI configuration bits"] | 12494 | #[doc = "I2C3 SMBUS timeout stop in debug mode"] |
| 9850 | pub fn set_exti(&mut self, n: usize, val: u8) { | 12495 | pub fn set_i2c3(&mut self, val: bool) { |
| 9851 | assert!(n < 4usize); | 12496 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); |
| 9852 | let offs = 0usize + n * 4usize; | ||
| 9853 | self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs); | ||
| 9854 | } | 12497 | } |
| 9855 | } | 12498 | } |
| 9856 | impl Default for Exticr { | 12499 | impl Default for Apb1lfz1 { |
| 9857 | fn default() -> Exticr { | 12500 | fn default() -> Apb1lfz1 { |
| 9858 | Exticr(0) | 12501 | Apb1lfz1(0) |
| 9859 | } | 12502 | } |
| 9860 | } | 12503 | } |
| 9861 | #[doc = "CFGR2"] | 12504 | #[doc = "Configuration register"] |
| 9862 | #[repr(transparent)] | 12505 | #[repr(transparent)] |
| 9863 | #[derive(Copy, Clone, Eq, PartialEq)] | 12506 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9864 | pub struct Cfgr2(pub u32); | 12507 | pub struct Cr(pub u32); |
| 9865 | impl Cfgr2 { | 12508 | impl Cr { |
| 9866 | #[doc = "Firewall disable bit"] | 12509 | #[doc = "Allow debug in D1 Sleep mode"] |
| 9867 | pub const fn fwdis(&self) -> bool { | 12510 | pub const fn dbgsleep_d1(&self) -> bool { |
| 9868 | let val = (self.0 >> 0usize) & 0x01; | 12511 | let val = (self.0 >> 0usize) & 0x01; |
| 9869 | val != 0 | 12512 | val != 0 |
| 9870 | } | 12513 | } |
| 9871 | #[doc = "Firewall disable bit"] | 12514 | #[doc = "Allow debug in D1 Sleep mode"] |
| 9872 | pub fn set_fwdis(&mut self, val: bool) { | 12515 | pub fn set_dbgsleep_d1(&mut self, val: bool) { |
| 9873 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 12516 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 9874 | } | 12517 | } |
| 9875 | #[doc = "Fm+ drive capability on PB6 enable bit"] | 12518 | #[doc = "Allow debug in D1 Stop mode"] |
| 9876 | pub const fn i2c_pb6_fmp(&self) -> bool { | 12519 | pub const fn dbgstop_d1(&self) -> bool { |
| 9877 | let val = (self.0 >> 8usize) & 0x01; | 12520 | let val = (self.0 >> 1usize) & 0x01; |
| 9878 | val != 0 | ||
| 9879 | } | ||
| 9880 | #[doc = "Fm+ drive capability on PB6 enable bit"] | ||
| 9881 | pub fn set_i2c_pb6_fmp(&mut self, val: bool) { | ||
| 9882 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 9883 | } | ||
| 9884 | #[doc = "Fm+ drive capability on PB7 enable bit"] | ||
| 9885 | pub const fn i2c_pb7_fmp(&self) -> bool { | ||
| 9886 | let val = (self.0 >> 9usize) & 0x01; | ||
| 9887 | val != 0 | 12521 | val != 0 |
| 9888 | } | 12522 | } |
| 9889 | #[doc = "Fm+ drive capability on PB7 enable bit"] | 12523 | #[doc = "Allow debug in D1 Stop mode"] |
| 9890 | pub fn set_i2c_pb7_fmp(&mut self, val: bool) { | 12524 | pub fn set_dbgstop_d1(&mut self, val: bool) { |
| 9891 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | 12525 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 9892 | } | 12526 | } |
| 9893 | #[doc = "Fm+ drive capability on PB8 enable bit"] | 12527 | #[doc = "Allow debug in D1 Standby mode"] |
| 9894 | pub const fn i2c_pb8_fmp(&self) -> bool { | 12528 | pub const fn dbgstby_d1(&self) -> bool { |
| 9895 | let val = (self.0 >> 10usize) & 0x01; | 12529 | let val = (self.0 >> 2usize) & 0x01; |
| 9896 | val != 0 | 12530 | val != 0 |
| 9897 | } | 12531 | } |
| 9898 | #[doc = "Fm+ drive capability on PB8 enable bit"] | 12532 | #[doc = "Allow debug in D1 Standby mode"] |
| 9899 | pub fn set_i2c_pb8_fmp(&mut self, val: bool) { | 12533 | pub fn set_dbgstby_d1(&mut self, val: bool) { |
| 9900 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | 12534 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 9901 | } | 12535 | } |
| 9902 | #[doc = "Fm+ drive capability on PB9 enable bit"] | 12536 | #[doc = "Trace clock enable enable"] |
| 9903 | pub const fn i2c_pb9_fmp(&self) -> bool { | 12537 | pub const fn traceclken(&self) -> bool { |
| 9904 | let val = (self.0 >> 11usize) & 0x01; | 12538 | let val = (self.0 >> 20usize) & 0x01; |
| 9905 | val != 0 | 12539 | val != 0 |
| 9906 | } | 12540 | } |
| 9907 | #[doc = "Fm+ drive capability on PB9 enable bit"] | 12541 | #[doc = "Trace clock enable enable"] |
| 9908 | pub fn set_i2c_pb9_fmp(&mut self, val: bool) { | 12542 | pub fn set_traceclken(&mut self, val: bool) { |
| 9909 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); | 12543 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); |
| 9910 | } | 12544 | } |
| 9911 | #[doc = "I2C1 Fm+ drive capability enable bit"] | 12545 | #[doc = "D1 debug clock enable enable"] |
| 9912 | pub const fn i2c1_fmp(&self) -> bool { | 12546 | pub const fn d1dbgcken(&self) -> bool { |
| 9913 | let val = (self.0 >> 12usize) & 0x01; | 12547 | let val = (self.0 >> 21usize) & 0x01; |
| 9914 | val != 0 | 12548 | val != 0 |
| 9915 | } | 12549 | } |
| 9916 | #[doc = "I2C1 Fm+ drive capability enable bit"] | 12550 | #[doc = "D1 debug clock enable enable"] |
| 9917 | pub fn set_i2c1_fmp(&mut self, val: bool) { | 12551 | pub fn set_d1dbgcken(&mut self, val: bool) { |
| 9918 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); | 12552 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); |
| 9919 | } | 12553 | } |
| 9920 | #[doc = "I2C2 Fm+ drive capability enable bit"] | 12554 | #[doc = "D3 debug clock enable enable"] |
| 9921 | pub const fn i2c2_fmp(&self) -> bool { | 12555 | pub const fn d3dbgcken(&self) -> bool { |
| 9922 | let val = (self.0 >> 13usize) & 0x01; | 12556 | let val = (self.0 >> 22usize) & 0x01; |
| 9923 | val != 0 | 12557 | val != 0 |
| 9924 | } | 12558 | } |
| 9925 | #[doc = "I2C2 Fm+ drive capability enable bit"] | 12559 | #[doc = "D3 debug clock enable enable"] |
| 9926 | pub fn set_i2c2_fmp(&mut self, val: bool) { | 12560 | pub fn set_d3dbgcken(&mut self, val: bool) { |
| 9927 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | 12561 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); |
| 9928 | } | 12562 | } |
| 9929 | #[doc = "I2C3 Fm+ drive capability enable bit"] | 12563 | #[doc = "External trigger output enable"] |
| 9930 | pub const fn i2c3_fmp(&self) -> bool { | 12564 | pub const fn trgoen(&self) -> bool { |
| 9931 | let val = (self.0 >> 14usize) & 0x01; | 12565 | let val = (self.0 >> 28usize) & 0x01; |
| 9932 | val != 0 | 12566 | val != 0 |
| 9933 | } | 12567 | } |
| 9934 | #[doc = "I2C3 Fm+ drive capability enable bit"] | 12568 | #[doc = "External trigger output enable"] |
| 9935 | pub fn set_i2c3_fmp(&mut self, val: bool) { | 12569 | pub fn set_trgoen(&mut self, val: bool) { |
| 9936 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | 12570 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize); |
| 9937 | } | 12571 | } |
| 9938 | } | 12572 | } |
| 9939 | impl Default for Cfgr2 { | 12573 | impl Default for Cr { |
| 9940 | fn default() -> Cfgr2 { | 12574 | fn default() -> Cr { |
| 9941 | Cfgr2(0) | 12575 | Cr(0) |
| 9942 | } | 12576 | } |
| 9943 | } | 12577 | } |
| 9944 | #[doc = "configuration register 1"] | 12578 | #[doc = "APB3 peripheral freeze register"] |
| 9945 | #[repr(transparent)] | 12579 | #[repr(transparent)] |
| 9946 | #[derive(Copy, Clone, Eq, PartialEq)] | 12580 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9947 | pub struct Cfgr1(pub u32); | 12581 | pub struct Apb3fz1(pub u32); |
| 9948 | impl Cfgr1 { | 12582 | impl Apb3fz1 { |
| 9949 | #[doc = "Memory mapping selection bits"] | 12583 | #[doc = "WWDG1 stop in debug mode"] |
| 9950 | pub const fn mem_mode(&self) -> u8 { | 12584 | pub const fn wwdg1(&self) -> bool { |
| 9951 | let val = (self.0 >> 0usize) & 0x03; | 12585 | let val = (self.0 >> 6usize) & 0x01; |
| 9952 | val as u8 | ||
| 9953 | } | ||
| 9954 | #[doc = "Memory mapping selection bits"] | ||
| 9955 | pub fn set_mem_mode(&mut self, val: u8) { | ||
| 9956 | self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize); | ||
| 9957 | } | ||
| 9958 | #[doc = "User bank swapping"] | ||
| 9959 | pub const fn ufb(&self) -> bool { | ||
| 9960 | let val = (self.0 >> 3usize) & 0x01; | ||
| 9961 | val != 0 | 12586 | val != 0 |
| 9962 | } | 12587 | } |
| 9963 | #[doc = "User bank swapping"] | 12588 | #[doc = "WWDG1 stop in debug mode"] |
| 9964 | pub fn set_ufb(&mut self, val: bool) { | 12589 | pub fn set_wwdg1(&mut self, val: bool) { |
| 9965 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 12590 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 9966 | } | ||
| 9967 | #[doc = "Boot mode selected by the boot pins status bits"] | ||
| 9968 | pub const fn boot_mode(&self) -> u8 { | ||
| 9969 | let val = (self.0 >> 8usize) & 0x03; | ||
| 9970 | val as u8 | ||
| 9971 | } | ||
| 9972 | #[doc = "Boot mode selected by the boot pins status bits"] | ||
| 9973 | pub fn set_boot_mode(&mut self, val: u8) { | ||
| 9974 | self.0 = (self.0 & !(0x03 << 8usize)) | (((val as u32) & 0x03) << 8usize); | ||
| 9975 | } | 12591 | } |
| 9976 | } | 12592 | } |
| 9977 | impl Default for Cfgr1 { | 12593 | impl Default for Apb3fz1 { |
| 9978 | fn default() -> Cfgr1 { | 12594 | fn default() -> Apb3fz1 { |
| 9979 | Cfgr1(0) | 12595 | Apb3fz1(0) |
| 9980 | } | 12596 | } |
| 9981 | } | 12597 | } |
| 9982 | #[doc = "CFGR3"] | 12598 | #[doc = "APB2 peripheral freeze register"] |
| 9983 | #[repr(transparent)] | 12599 | #[repr(transparent)] |
| 9984 | #[derive(Copy, Clone, Eq, PartialEq)] | 12600 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 9985 | pub struct Cfgr3(pub u32); | 12601 | pub struct Apb2fz1(pub u32); |
| 9986 | impl Cfgr3 { | 12602 | impl Apb2fz1 { |
| 9987 | #[doc = "VREFINT enable and scaler control for COMP2 enable bit"] | 12603 | #[doc = "TIM1 stop in debug mode"] |
| 9988 | pub const fn en_vrefint(&self) -> bool { | 12604 | pub const fn tim1(&self) -> bool { |
| 9989 | let val = (self.0 >> 0usize) & 0x01; | 12605 | let val = (self.0 >> 0usize) & 0x01; |
| 9990 | val != 0 | 12606 | val != 0 |
| 9991 | } | 12607 | } |
| 9992 | #[doc = "VREFINT enable and scaler control for COMP2 enable bit"] | 12608 | #[doc = "TIM1 stop in debug mode"] |
| 9993 | pub fn set_en_vrefint(&mut self, val: bool) { | 12609 | pub fn set_tim1(&mut self, val: bool) { |
| 9994 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 12610 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 9995 | } | 12611 | } |
| 9996 | #[doc = "VREFINT_ADC connection bit"] | 12612 | #[doc = "TIM8 stop in debug mode"] |
| 9997 | pub const fn sel_vref_out(&self) -> u8 { | 12613 | pub const fn tim8(&self) -> bool { |
| 9998 | let val = (self.0 >> 4usize) & 0x03; | 12614 | let val = (self.0 >> 1usize) & 0x01; |
| 9999 | val as u8 | ||
| 10000 | } | ||
| 10001 | #[doc = "VREFINT_ADC connection bit"] | ||
| 10002 | pub fn set_sel_vref_out(&mut self, val: u8) { | ||
| 10003 | self.0 = (self.0 & !(0x03 << 4usize)) | (((val as u32) & 0x03) << 4usize); | ||
| 10004 | } | ||
| 10005 | #[doc = "VREFINT reference for ADC enable bit"] | ||
| 10006 | pub const fn enbuf_vrefint_adc(&self) -> bool { | ||
| 10007 | let val = (self.0 >> 8usize) & 0x01; | ||
| 10008 | val != 0 | ||
| 10009 | } | ||
| 10010 | #[doc = "VREFINT reference for ADC enable bit"] | ||
| 10011 | pub fn set_enbuf_vrefint_adc(&mut self, val: bool) { | ||
| 10012 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 10013 | } | ||
| 10014 | #[doc = "Temperature sensor reference for ADC enable bit"] | ||
| 10015 | pub const fn enbuf_sensor_adc(&self) -> bool { | ||
| 10016 | let val = (self.0 >> 9usize) & 0x01; | ||
| 10017 | val != 0 | 12615 | val != 0 |
| 10018 | } | 12616 | } |
| 10019 | #[doc = "Temperature sensor reference for ADC enable bit"] | 12617 | #[doc = "TIM8 stop in debug mode"] |
| 10020 | pub fn set_enbuf_sensor_adc(&mut self, val: bool) { | 12618 | pub fn set_tim8(&mut self, val: bool) { |
| 10021 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | 12619 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 10022 | } | 12620 | } |
| 10023 | #[doc = "VREFINT reference for COMP2 scaler enable bit"] | 12621 | #[doc = "TIM15 stop in debug mode"] |
| 10024 | pub const fn enbuf_vrefint_comp2(&self) -> bool { | 12622 | pub const fn tim15(&self) -> bool { |
| 10025 | let val = (self.0 >> 12usize) & 0x01; | 12623 | let val = (self.0 >> 16usize) & 0x01; |
| 10026 | val != 0 | 12624 | val != 0 |
| 10027 | } | 12625 | } |
| 10028 | #[doc = "VREFINT reference for COMP2 scaler enable bit"] | 12626 | #[doc = "TIM15 stop in debug mode"] |
| 10029 | pub fn set_enbuf_vrefint_comp2(&mut self, val: bool) { | 12627 | pub fn set_tim15(&mut self, val: bool) { |
| 10030 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); | 12628 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); |
| 10031 | } | 12629 | } |
| 10032 | #[doc = "VREFINT reference for HSI48 oscillator enable bit"] | 12630 | #[doc = "TIM16 stop in debug mode"] |
| 10033 | pub const fn enref_hsi48(&self) -> bool { | 12631 | pub const fn tim16(&self) -> bool { |
| 10034 | let val = (self.0 >> 13usize) & 0x01; | 12632 | let val = (self.0 >> 17usize) & 0x01; |
| 10035 | val != 0 | 12633 | val != 0 |
| 10036 | } | 12634 | } |
| 10037 | #[doc = "VREFINT reference for HSI48 oscillator enable bit"] | 12635 | #[doc = "TIM16 stop in debug mode"] |
| 10038 | pub fn set_enref_hsi48(&mut self, val: bool) { | 12636 | pub fn set_tim16(&mut self, val: bool) { |
| 10039 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | 12637 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); |
| 10040 | } | 12638 | } |
| 10041 | #[doc = "VREFINT ready flag"] | 12639 | #[doc = "TIM17 stop in debug mode"] |
| 10042 | pub const fn vrefint_rdyf(&self) -> bool { | 12640 | pub const fn tim17(&self) -> bool { |
| 10043 | let val = (self.0 >> 30usize) & 0x01; | 12641 | let val = (self.0 >> 18usize) & 0x01; |
| 10044 | val != 0 | 12642 | val != 0 |
| 10045 | } | 12643 | } |
| 10046 | #[doc = "VREFINT ready flag"] | 12644 | #[doc = "TIM17 stop in debug mode"] |
| 10047 | pub fn set_vrefint_rdyf(&mut self, val: bool) { | 12645 | pub fn set_tim17(&mut self, val: bool) { |
| 10048 | self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize); | 12646 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); |
| 10049 | } | 12647 | } |
| 10050 | #[doc = "SYSCFG_CFGR3 lock bit"] | 12648 | #[doc = "HRTIM stop in debug mode"] |
| 10051 | pub const fn ref_lock(&self) -> bool { | 12649 | pub const fn hrtim(&self) -> bool { |
| 10052 | let val = (self.0 >> 31usize) & 0x01; | 12650 | let val = (self.0 >> 29usize) & 0x01; |
| 10053 | val != 0 | 12651 | val != 0 |
| 10054 | } | 12652 | } |
| 10055 | #[doc = "SYSCFG_CFGR3 lock bit"] | 12653 | #[doc = "HRTIM stop in debug mode"] |
| 10056 | pub fn set_ref_lock(&mut self, val: bool) { | 12654 | pub fn set_hrtim(&mut self, val: bool) { |
| 10057 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize); | 12655 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize); |
| 10058 | } | 12656 | } |
| 10059 | } | 12657 | } |
| 10060 | impl Default for Cfgr3 { | 12658 | impl Default for Apb2fz1 { |
| 10061 | fn default() -> Cfgr3 { | 12659 | fn default() -> Apb2fz1 { |
| 10062 | Cfgr3(0) | 12660 | Apb2fz1(0) |
| 10063 | } | 12661 | } |
| 10064 | } | 12662 | } |
| 10065 | } | 12663 | } |
| @@ -10157,208 +12755,809 @@ pub mod rcc_l0 { | |||
| 10157 | unsafe { Reg::from_ptr(self.0.add(80usize)) } | 12755 | unsafe { Reg::from_ptr(self.0.add(80usize)) } |
| 10158 | } | 12756 | } |
| 10159 | } | 12757 | } |
| 12758 | pub mod vals { | ||
| 12759 | use crate::generic::*; | ||
| 12760 | #[repr(transparent)] | ||
| 12761 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12762 | pub struct Rtcpre(pub u8); | ||
| 12763 | impl Rtcpre { | ||
| 12764 | #[doc = "HSE divided by 2"] | ||
| 12765 | pub const DIV2: Self = Self(0); | ||
| 12766 | #[doc = "HSE divided by 4"] | ||
| 12767 | pub const DIV4: Self = Self(0x01); | ||
| 12768 | #[doc = "HSE divided by 8"] | ||
| 12769 | pub const DIV8: Self = Self(0x02); | ||
| 12770 | #[doc = "HSE divided by 16"] | ||
| 12771 | pub const DIV16: Self = Self(0x03); | ||
| 12772 | } | ||
| 12773 | #[repr(transparent)] | ||
| 12774 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12775 | pub struct Csshsecw(pub u8); | ||
| 12776 | impl Csshsecw { | ||
| 12777 | #[doc = "Clear interrupt flag"] | ||
| 12778 | pub const CLEAR: Self = Self(0x01); | ||
| 12779 | } | ||
| 12780 | #[repr(transparent)] | ||
| 12781 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12782 | pub struct Plldiv(pub u8); | ||
| 12783 | impl Plldiv { | ||
| 12784 | #[doc = "PLLVCO / 2"] | ||
| 12785 | pub const DIV2: Self = Self(0x01); | ||
| 12786 | #[doc = "PLLVCO / 3"] | ||
| 12787 | pub const DIV3: Self = Self(0x02); | ||
| 12788 | #[doc = "PLLVCO / 4"] | ||
| 12789 | pub const DIV4: Self = Self(0x03); | ||
| 12790 | } | ||
| 12791 | #[repr(transparent)] | ||
| 12792 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12793 | pub struct Crypsmen(pub u8); | ||
| 12794 | impl Crypsmen { | ||
| 12795 | #[doc = "Crypto clock disabled in Sleep mode"] | ||
| 12796 | pub const DISABLED: Self = Self(0); | ||
| 12797 | #[doc = "Crypto clock enabled in Sleep mode"] | ||
| 12798 | pub const ENABLED: Self = Self(0x01); | ||
| 12799 | } | ||
| 12800 | #[repr(transparent)] | ||
| 12801 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12802 | pub struct Rmvfw(pub u8); | ||
| 12803 | impl Rmvfw { | ||
| 12804 | #[doc = "Clears the reset flag"] | ||
| 12805 | pub const CLEAR: Self = Self(0x01); | ||
| 12806 | } | ||
| 12807 | #[repr(transparent)] | ||
| 12808 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12809 | pub struct Mifsmen(pub u8); | ||
| 12810 | impl Mifsmen { | ||
| 12811 | #[doc = "NVM interface clock disabled in Sleep mode"] | ||
| 12812 | pub const DISABLED: Self = Self(0); | ||
| 12813 | #[doc = "NVM interface clock enabled in Sleep mode"] | ||
| 12814 | pub const ENABLED: Self = Self(0x01); | ||
| 12815 | } | ||
| 12816 | #[repr(transparent)] | ||
| 12817 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12818 | pub struct Lptimsmen(pub u8); | ||
| 12819 | impl Lptimsmen { | ||
| 12820 | #[doc = "Clock disabled"] | ||
| 12821 | pub const DISABLED: Self = Self(0); | ||
| 12822 | #[doc = "Clock enabled"] | ||
| 12823 | pub const ENABLED: Self = Self(0x01); | ||
| 12824 | } | ||
| 12825 | #[repr(transparent)] | ||
| 12826 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12827 | pub struct Rtcen(pub u8); | ||
| 12828 | impl Rtcen { | ||
| 12829 | #[doc = "RTC clock disabled"] | ||
| 12830 | pub const DISABLED: Self = Self(0); | ||
| 12831 | #[doc = "RTC clock enabled"] | ||
| 12832 | pub const ENABLED: Self = Self(0x01); | ||
| 12833 | } | ||
| 12834 | #[repr(transparent)] | ||
| 12835 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12836 | pub struct Crcsmen(pub u8); | ||
| 12837 | impl Crcsmen { | ||
| 12838 | #[doc = "Test integration module clock disabled in Sleep mode"] | ||
| 12839 | pub const DISABLED: Self = Self(0); | ||
| 12840 | #[doc = "Test integration module clock enabled in Sleep mode (if enabled by CRCEN)"] | ||
| 12841 | pub const ENABLED: Self = Self(0x01); | ||
| 12842 | } | ||
| 12843 | #[repr(transparent)] | ||
| 12844 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12845 | pub struct Hsidiven(pub u8); | ||
| 12846 | impl Hsidiven { | ||
| 12847 | #[doc = "no 16 MHz HSI division requested"] | ||
| 12848 | pub const NOTDIVIDED: Self = Self(0); | ||
| 12849 | #[doc = "16 MHz HSI division by 4 requested"] | ||
| 12850 | pub const DIV4: Self = Self(0x01); | ||
| 12851 | } | ||
| 12852 | #[repr(transparent)] | ||
| 12853 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12854 | pub struct Pllrdyr(pub u8); | ||
| 12855 | impl Pllrdyr { | ||
| 12856 | #[doc = "PLL unlocked"] | ||
| 12857 | pub const UNLOCKED: Self = Self(0); | ||
| 12858 | #[doc = "PLL locked"] | ||
| 12859 | pub const LOCKED: Self = Self(0x01); | ||
| 12860 | } | ||
| 12861 | #[repr(transparent)] | ||
| 12862 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12863 | pub struct Dmasmen(pub u8); | ||
| 12864 | impl Dmasmen { | ||
| 12865 | #[doc = "DMA clock disabled in Sleep mode"] | ||
| 12866 | pub const DISABLED: Self = Self(0); | ||
| 12867 | #[doc = "DMA clock enabled in Sleep mode"] | ||
| 12868 | pub const ENABLED: Self = Self(0x01); | ||
| 12869 | } | ||
| 12870 | #[repr(transparent)] | ||
| 12871 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12872 | pub struct Csslsef(pub u8); | ||
| 12873 | impl Csslsef { | ||
| 12874 | #[doc = "No failure detected on LSE clock failure"] | ||
| 12875 | pub const NOFAILURE: Self = Self(0); | ||
| 12876 | #[doc = "Failure detected on LSE clock failure"] | ||
| 12877 | pub const FAILURE: Self = Self(0x01); | ||
| 12878 | } | ||
| 12879 | #[repr(transparent)] | ||
| 12880 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12881 | pub struct Lsedrv(pub u8); | ||
| 12882 | impl Lsedrv { | ||
| 12883 | #[doc = "Lowest drive"] | ||
| 12884 | pub const LOW: Self = Self(0); | ||
| 12885 | #[doc = "Medium low drive"] | ||
| 12886 | pub const MEDIUMLOW: Self = Self(0x01); | ||
| 12887 | #[doc = "Medium high drive"] | ||
| 12888 | pub const MEDIUMHIGH: Self = Self(0x02); | ||
| 12889 | #[doc = "Highest drive"] | ||
| 12890 | pub const HIGH: Self = Self(0x03); | ||
| 12891 | } | ||
| 12892 | #[repr(transparent)] | ||
| 12893 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12894 | pub struct Iophen(pub u8); | ||
| 12895 | impl Iophen { | ||
| 12896 | #[doc = "Port clock disabled"] | ||
| 12897 | pub const DISABLED: Self = Self(0); | ||
| 12898 | #[doc = "Port clock enabled"] | ||
| 12899 | pub const ENABLED: Self = Self(0x01); | ||
| 12900 | } | ||
| 12901 | #[repr(transparent)] | ||
| 12902 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12903 | pub struct Hserdyr(pub u8); | ||
| 12904 | impl Hserdyr { | ||
| 12905 | #[doc = "Oscillator is not stable"] | ||
| 12906 | pub const NOTREADY: Self = Self(0); | ||
| 12907 | #[doc = "Oscillator is stable"] | ||
| 12908 | pub const READY: Self = Self(0x01); | ||
| 12909 | } | ||
| 12910 | #[repr(transparent)] | ||
| 12911 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12912 | pub struct Pllsrc(pub u8); | ||
| 12913 | impl Pllsrc { | ||
| 12914 | #[doc = "HSI selected as PLL input clock"] | ||
| 12915 | pub const HSI16: Self = Self(0); | ||
| 12916 | #[doc = "HSE selected as PLL input clock"] | ||
| 12917 | pub const HSE: Self = Self(0x01); | ||
| 12918 | } | ||
| 12919 | #[repr(transparent)] | ||
| 12920 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12921 | pub struct Lserdy(pub u8); | ||
| 12922 | impl Lserdy { | ||
| 12923 | #[doc = "Oscillator not ready"] | ||
| 12924 | pub const NOTREADY: Self = Self(0); | ||
| 12925 | #[doc = "Oscillator ready"] | ||
| 12926 | pub const READY: Self = Self(0x01); | ||
| 12927 | } | ||
| 12928 | #[repr(transparent)] | ||
| 12929 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12930 | pub struct Csshsef(pub u8); | ||
| 12931 | impl Csshsef { | ||
| 12932 | #[doc = "No clock security interrupt caused by HSE clock failure"] | ||
| 12933 | pub const NOCLOCK: Self = Self(0); | ||
| 12934 | #[doc = "Clock security interrupt caused by HSE clock failure"] | ||
| 12935 | pub const CLOCK: Self = Self(0x01); | ||
| 12936 | } | ||
| 12937 | #[repr(transparent)] | ||
| 12938 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12939 | pub struct Dbgrstw(pub u8); | ||
| 12940 | impl Dbgrstw { | ||
| 12941 | #[doc = "Reset the module"] | ||
| 12942 | pub const RESET: Self = Self(0x01); | ||
| 12943 | } | ||
| 12944 | #[repr(transparent)] | ||
| 12945 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12946 | pub struct Lpwrrstfr(pub u8); | ||
| 12947 | impl Lpwrrstfr { | ||
| 12948 | #[doc = "No reset has occured"] | ||
| 12949 | pub const NORESET: Self = Self(0); | ||
| 12950 | #[doc = "A reset has occured"] | ||
| 12951 | pub const RESET: Self = Self(0x01); | ||
| 12952 | } | ||
| 12953 | #[repr(transparent)] | ||
| 12954 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12955 | pub struct Lsebyp(pub u8); | ||
| 12956 | impl Lsebyp { | ||
| 12957 | #[doc = "LSE oscillator not bypassed"] | ||
| 12958 | pub const NOTBYPASSED: Self = Self(0); | ||
| 12959 | #[doc = "LSE oscillator bypassed"] | ||
| 12960 | pub const BYPASSED: Self = Self(0x01); | ||
| 12961 | } | ||
| 12962 | #[repr(transparent)] | ||
| 12963 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12964 | pub struct Iophrst(pub u8); | ||
| 12965 | impl Iophrst { | ||
| 12966 | #[doc = "Reset I/O port"] | ||
| 12967 | pub const RESET: Self = Self(0x01); | ||
| 12968 | } | ||
| 12969 | #[repr(transparent)] | ||
| 12970 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12971 | pub struct Csslse(pub u8); | ||
| 12972 | impl Csslse { | ||
| 12973 | #[doc = "LSE CSS interrupt disabled"] | ||
| 12974 | pub const DISABLED: Self = Self(0); | ||
| 12975 | #[doc = "LSE CSS interrupt enabled"] | ||
| 12976 | pub const ENABLED: Self = Self(0x01); | ||
| 12977 | } | ||
| 12978 | #[repr(transparent)] | ||
| 12979 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12980 | pub struct Hsidivfr(pub u8); | ||
| 12981 | impl Hsidivfr { | ||
| 12982 | #[doc = "16 MHz HSI clock not divided"] | ||
| 12983 | pub const NOTDIVIDED: Self = Self(0); | ||
| 12984 | #[doc = "16 MHz HSI clock divided by 4"] | ||
| 12985 | pub const DIV4: Self = Self(0x01); | ||
| 12986 | } | ||
| 12987 | #[repr(transparent)] | ||
| 12988 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12989 | pub struct Cryprstw(pub u8); | ||
| 12990 | impl Cryprstw { | ||
| 12991 | #[doc = "Reset the module"] | ||
| 12992 | pub const RESET: Self = Self(0x01); | ||
| 12993 | } | ||
| 12994 | #[repr(transparent)] | ||
| 12995 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12996 | pub struct Iophsmen(pub u8); | ||
| 12997 | impl Iophsmen { | ||
| 12998 | #[doc = "Port x clock is disabled in Sleep mode"] | ||
| 12999 | pub const DISABLED: Self = Self(0); | ||
| 13000 | #[doc = "Port x clock is enabled in Sleep mode (if enabled by IOPHEN)"] | ||
| 13001 | pub const ENABLED: Self = Self(0x01); | ||
| 13002 | } | ||
| 13003 | #[repr(transparent)] | ||
| 13004 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13005 | pub struct Pllmul(pub u8); | ||
| 13006 | impl Pllmul { | ||
| 13007 | #[doc = "PLL clock entry x 3"] | ||
| 13008 | pub const MUL3: Self = Self(0); | ||
| 13009 | #[doc = "PLL clock entry x 4"] | ||
| 13010 | pub const MUL4: Self = Self(0x01); | ||
| 13011 | #[doc = "PLL clock entry x 6"] | ||
| 13012 | pub const MUL6: Self = Self(0x02); | ||
| 13013 | #[doc = "PLL clock entry x 8"] | ||
| 13014 | pub const MUL8: Self = Self(0x03); | ||
| 13015 | #[doc = "PLL clock entry x 12"] | ||
| 13016 | pub const MUL12: Self = Self(0x04); | ||
| 13017 | #[doc = "PLL clock entry x 16"] | ||
| 13018 | pub const MUL16: Self = Self(0x05); | ||
| 13019 | #[doc = "PLL clock entry x 24"] | ||
| 13020 | pub const MUL24: Self = Self(0x06); | ||
| 13021 | #[doc = "PLL clock entry x 32"] | ||
| 13022 | pub const MUL32: Self = Self(0x07); | ||
| 13023 | #[doc = "PLL clock entry x 48"] | ||
| 13024 | pub const MUL48: Self = Self(0x08); | ||
| 13025 | } | ||
| 13026 | #[repr(transparent)] | ||
| 13027 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13028 | pub struct Sramsmen(pub u8); | ||
| 13029 | impl Sramsmen { | ||
| 13030 | #[doc = "NVM interface clock disabled in Sleep mode"] | ||
| 13031 | pub const DISABLED: Self = Self(0); | ||
| 13032 | #[doc = "NVM interface clock enabled in Sleep mode"] | ||
| 13033 | pub const ENABLED: Self = Self(0x01); | ||
| 13034 | } | ||
| 13035 | #[repr(transparent)] | ||
| 13036 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13037 | pub struct Pllon(pub u8); | ||
| 13038 | impl Pllon { | ||
| 13039 | #[doc = "Clock disabled"] | ||
| 13040 | pub const DISABLED: Self = Self(0); | ||
| 13041 | #[doc = "Clock enabled"] | ||
| 13042 | pub const ENABLED: Self = Self(0x01); | ||
| 13043 | } | ||
| 13044 | #[repr(transparent)] | ||
| 13045 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13046 | pub struct Crypen(pub u8); | ||
| 13047 | impl Crypen { | ||
| 13048 | #[doc = "Clock disabled"] | ||
| 13049 | pub const DISABLED: Self = Self(0); | ||
| 13050 | #[doc = "Clock enabled"] | ||
| 13051 | pub const ENABLED: Self = Self(0x01); | ||
| 13052 | } | ||
| 13053 | #[repr(transparent)] | ||
| 13054 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13055 | pub struct Csslsed(pub u8); | ||
| 13056 | impl Csslsed { | ||
| 13057 | #[doc = "No failure detected on LSE (32 kHz oscillator)"] | ||
| 13058 | pub const NOFAILURE: Self = Self(0); | ||
| 13059 | #[doc = "Failure detected on LSE (32 kHz oscillator)"] | ||
| 13060 | pub const FAILURE: Self = Self(0x01); | ||
| 13061 | } | ||
| 13062 | #[repr(transparent)] | ||
| 13063 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13064 | pub struct Sw(pub u8); | ||
| 13065 | impl Sw { | ||
| 13066 | #[doc = "MSI oscillator used as system clock"] | ||
| 13067 | pub const MSI: Self = Self(0); | ||
| 13068 | #[doc = "HSI oscillator used as system clock"] | ||
| 13069 | pub const HSI16: Self = Self(0x01); | ||
| 13070 | #[doc = "HSE oscillator used as system clock"] | ||
| 13071 | pub const HSE: Self = Self(0x02); | ||
| 13072 | #[doc = "PLL used as system clock"] | ||
| 13073 | pub const PLL: Self = Self(0x03); | ||
| 13074 | } | ||
| 13075 | #[repr(transparent)] | ||
| 13076 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13077 | pub struct Hsebyp(pub u8); | ||
| 13078 | impl Hsebyp { | ||
| 13079 | #[doc = "HSE oscillator not bypassed"] | ||
| 13080 | pub const NOTBYPASSED: Self = Self(0); | ||
| 13081 | #[doc = "HSE oscillator bypassed"] | ||
| 13082 | pub const BYPASSED: Self = Self(0x01); | ||
| 13083 | } | ||
| 13084 | #[repr(transparent)] | ||
| 13085 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13086 | pub struct Csslseon(pub u8); | ||
| 13087 | impl Csslseon { | ||
| 13088 | #[doc = "Oscillator OFF"] | ||
| 13089 | pub const OFF: Self = Self(0); | ||
| 13090 | #[doc = "Oscillator ON"] | ||
| 13091 | pub const ON: Self = Self(0x01); | ||
| 13092 | } | ||
| 13093 | #[repr(transparent)] | ||
| 13094 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13095 | pub struct Ppre(pub u8); | ||
| 13096 | impl Ppre { | ||
| 13097 | #[doc = "HCLK not divided"] | ||
| 13098 | pub const DIV1: Self = Self(0); | ||
| 13099 | #[doc = "HCLK divided by 2"] | ||
| 13100 | pub const DIV2: Self = Self(0x04); | ||
| 13101 | #[doc = "HCLK divided by 4"] | ||
| 13102 | pub const DIV4: Self = Self(0x05); | ||
| 13103 | #[doc = "HCLK divided by 8"] | ||
| 13104 | pub const DIV8: Self = Self(0x06); | ||
| 13105 | #[doc = "HCLK divided by 16"] | ||
| 13106 | pub const DIV16: Self = Self(0x07); | ||
| 13107 | } | ||
| 13108 | #[repr(transparent)] | ||
| 13109 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13110 | pub struct Mcosel(pub u8); | ||
| 13111 | impl Mcosel { | ||
| 13112 | #[doc = "No clock"] | ||
| 13113 | pub const NOCLOCK: Self = Self(0); | ||
| 13114 | #[doc = "SYSCLK clock selected"] | ||
| 13115 | pub const SYSCLK: Self = Self(0x01); | ||
| 13116 | #[doc = "HSI oscillator clock selected"] | ||
| 13117 | pub const HSI16: Self = Self(0x02); | ||
| 13118 | #[doc = "MSI oscillator clock selected"] | ||
| 13119 | pub const MSI: Self = Self(0x03); | ||
| 13120 | #[doc = "HSE oscillator clock selected"] | ||
| 13121 | pub const HSE: Self = Self(0x04); | ||
| 13122 | #[doc = "PLL clock selected"] | ||
| 13123 | pub const PLL: Self = Self(0x05); | ||
| 13124 | #[doc = "LSI oscillator clock selected"] | ||
| 13125 | pub const LSI: Self = Self(0x06); | ||
| 13126 | #[doc = "LSE oscillator clock selected"] | ||
| 13127 | pub const LSE: Self = Self(0x07); | ||
| 13128 | } | ||
| 13129 | #[repr(transparent)] | ||
| 13130 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13131 | pub struct Dbgen(pub u8); | ||
| 13132 | impl Dbgen { | ||
| 13133 | #[doc = "Clock disabled"] | ||
| 13134 | pub const DISABLED: Self = Self(0); | ||
| 13135 | #[doc = "Clock enabled"] | ||
| 13136 | pub const ENABLED: Self = Self(0x01); | ||
| 13137 | } | ||
| 13138 | #[repr(transparent)] | ||
| 13139 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13140 | pub struct Lptimsel(pub u8); | ||
| 13141 | impl Lptimsel { | ||
| 13142 | #[doc = "APB clock selected as Timer clock"] | ||
| 13143 | pub const APB: Self = Self(0); | ||
| 13144 | #[doc = "LSI clock selected as Timer clock"] | ||
| 13145 | pub const LSI: Self = Self(0x01); | ||
| 13146 | #[doc = "HSI16 clock selected as Timer clock"] | ||
| 13147 | pub const HSI16: Self = Self(0x02); | ||
| 13148 | #[doc = "LSE clock selected as Timer clock"] | ||
| 13149 | pub const LSE: Self = Self(0x03); | ||
| 13150 | } | ||
| 13151 | #[repr(transparent)] | ||
| 13152 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13153 | pub struct Hsirdyie(pub u8); | ||
| 13154 | impl Hsirdyie { | ||
| 13155 | #[doc = "Ready interrupt disabled"] | ||
| 13156 | pub const DISABLED: Self = Self(0); | ||
| 13157 | #[doc = "Ready interrupt enabled"] | ||
| 13158 | pub const ENABLED: Self = Self(0x01); | ||
| 13159 | } | ||
| 13160 | #[repr(transparent)] | ||
| 13161 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13162 | pub struct Hpre(pub u8); | ||
| 13163 | impl Hpre { | ||
| 13164 | #[doc = "system clock not divided"] | ||
| 13165 | pub const DIV1: Self = Self(0); | ||
| 13166 | #[doc = "system clock divided by 2"] | ||
| 13167 | pub const DIV2: Self = Self(0x08); | ||
| 13168 | #[doc = "system clock divided by 4"] | ||
| 13169 | pub const DIV4: Self = Self(0x09); | ||
| 13170 | #[doc = "system clock divided by 8"] | ||
| 13171 | pub const DIV8: Self = Self(0x0a); | ||
| 13172 | #[doc = "system clock divided by 16"] | ||
| 13173 | pub const DIV16: Self = Self(0x0b); | ||
| 13174 | #[doc = "system clock divided by 64"] | ||
| 13175 | pub const DIV64: Self = Self(0x0c); | ||
| 13176 | #[doc = "system clock divided by 128"] | ||
| 13177 | pub const DIV128: Self = Self(0x0d); | ||
| 13178 | #[doc = "system clock divided by 256"] | ||
| 13179 | pub const DIV256: Self = Self(0x0e); | ||
| 13180 | #[doc = "system clock divided by 512"] | ||
| 13181 | pub const DIV512: Self = Self(0x0f); | ||
| 13182 | } | ||
| 13183 | #[repr(transparent)] | ||
| 13184 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13185 | pub struct Lpuartsel(pub u8); | ||
| 13186 | impl Lpuartsel { | ||
| 13187 | #[doc = "APB clock selected as peripheral clock"] | ||
| 13188 | pub const APB: Self = Self(0); | ||
| 13189 | #[doc = "System clock selected as peripheral clock"] | ||
| 13190 | pub const SYSTEM: Self = Self(0x01); | ||
| 13191 | #[doc = "HSI16 clock selected as peripheral clock"] | ||
| 13192 | pub const HSI16: Self = Self(0x02); | ||
| 13193 | #[doc = "LSE clock selected as peripheral clock"] | ||
| 13194 | pub const LSE: Self = Self(0x03); | ||
| 13195 | } | ||
| 13196 | #[repr(transparent)] | ||
| 13197 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13198 | pub struct Hsi48rdyfr(pub u8); | ||
| 13199 | impl Hsi48rdyfr { | ||
| 13200 | #[doc = "No clock ready interrupt"] | ||
| 13201 | pub const NOTINTERRUPTED: Self = Self(0); | ||
| 13202 | #[doc = "Clock ready interrupt"] | ||
| 13203 | pub const INTERRUPTED: Self = Self(0x01); | ||
| 13204 | } | ||
| 13205 | #[repr(transparent)] | ||
| 13206 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13207 | pub struct Sws(pub u8); | ||
| 13208 | impl Sws { | ||
| 13209 | #[doc = "MSI oscillator used as system clock"] | ||
| 13210 | pub const MSI: Self = Self(0); | ||
| 13211 | #[doc = "HSI oscillator used as system clock"] | ||
| 13212 | pub const HSI16: Self = Self(0x01); | ||
| 13213 | #[doc = "HSE oscillator used as system clock"] | ||
| 13214 | pub const HSE: Self = Self(0x02); | ||
| 13215 | #[doc = "PLL used as system clock"] | ||
| 13216 | pub const PLL: Self = Self(0x03); | ||
| 13217 | } | ||
| 13218 | #[repr(transparent)] | ||
| 13219 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13220 | pub struct Stopwuck(pub u8); | ||
| 13221 | impl Stopwuck { | ||
| 13222 | #[doc = "Internal 64 KHz to 4 MHz (MSI) oscillator selected as wake-up from Stop clock"] | ||
| 13223 | pub const MSI: Self = Self(0); | ||
| 13224 | #[doc = "Internal 16 MHz (HSI) oscillator selected as wake-up from Stop clock (or HSI16/4 if HSI16DIVEN=1)"] | ||
| 13225 | pub const HSI16: Self = Self(0x01); | ||
| 13226 | } | ||
| 13227 | #[repr(transparent)] | ||
| 13228 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13229 | pub struct Lptimrstw(pub u8); | ||
| 13230 | impl Lptimrstw { | ||
| 13231 | #[doc = "Reset the module"] | ||
| 13232 | pub const RESET: Self = Self(0x01); | ||
| 13233 | } | ||
| 13234 | #[repr(transparent)] | ||
| 13235 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13236 | pub struct Msirange(pub u8); | ||
| 13237 | impl Msirange { | ||
| 13238 | #[doc = "range 0 around 65.536 kHz"] | ||
| 13239 | pub const RANGE0: Self = Self(0); | ||
| 13240 | #[doc = "range 1 around 131.072 kHz"] | ||
| 13241 | pub const RANGE1: Self = Self(0x01); | ||
| 13242 | #[doc = "range 2 around 262.144 kHz"] | ||
| 13243 | pub const RANGE2: Self = Self(0x02); | ||
| 13244 | #[doc = "range 3 around 524.288 kHz"] | ||
| 13245 | pub const RANGE3: Self = Self(0x03); | ||
| 13246 | #[doc = "range 4 around 1.048 MHz"] | ||
| 13247 | pub const RANGE4: Self = Self(0x04); | ||
| 13248 | #[doc = "range 5 around 2.097 MHz (reset value)"] | ||
| 13249 | pub const RANGE5: Self = Self(0x05); | ||
| 13250 | #[doc = "range 6 around 4.194 MHz"] | ||
| 13251 | pub const RANGE6: Self = Self(0x06); | ||
| 13252 | #[doc = "not allowed"] | ||
| 13253 | pub const RANGE7: Self = Self(0x07); | ||
| 13254 | } | ||
| 13255 | #[repr(transparent)] | ||
| 13256 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13257 | pub struct Dbgsmen(pub u8); | ||
| 13258 | impl Dbgsmen { | ||
| 13259 | #[doc = "Clock disabled"] | ||
| 13260 | pub const DISABLED: Self = Self(0); | ||
| 13261 | #[doc = "Clock enabled"] | ||
| 13262 | pub const ENABLED: Self = Self(0x01); | ||
| 13263 | } | ||
| 13264 | #[repr(transparent)] | ||
| 13265 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13266 | pub struct Hsiouten(pub u8); | ||
| 13267 | impl Hsiouten { | ||
| 13268 | #[doc = "HSI output clock disabled"] | ||
| 13269 | pub const DISABLED: Self = Self(0); | ||
| 13270 | #[doc = "HSI output clock enabled"] | ||
| 13271 | pub const ENABLED: Self = Self(0x01); | ||
| 13272 | } | ||
| 13273 | #[repr(transparent)] | ||
| 13274 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13275 | pub struct Rtcrstw(pub u8); | ||
| 13276 | impl Rtcrstw { | ||
| 13277 | #[doc = "Resets the RTC peripheral"] | ||
| 13278 | pub const RESET: Self = Self(0x01); | ||
| 13279 | } | ||
| 13280 | #[repr(transparent)] | ||
| 13281 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13282 | pub struct Icsel(pub u8); | ||
| 13283 | impl Icsel { | ||
| 13284 | #[doc = "APB clock selected as peripheral clock"] | ||
| 13285 | pub const APB: Self = Self(0); | ||
| 13286 | #[doc = "System clock selected as peripheral clock"] | ||
| 13287 | pub const SYSTEM: Self = Self(0x01); | ||
| 13288 | #[doc = "HSI16 clock selected as peripheral clock"] | ||
| 13289 | pub const HSI16: Self = Self(0x02); | ||
| 13290 | } | ||
| 13291 | #[repr(transparent)] | ||
| 13292 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13293 | pub struct Hsi16rdyfr(pub u8); | ||
| 13294 | impl Hsi16rdyfr { | ||
| 13295 | #[doc = "HSI 16 MHz oscillator not ready"] | ||
| 13296 | pub const NOTREADY: Self = Self(0); | ||
| 13297 | #[doc = "HSI 16 MHz oscillator ready"] | ||
| 13298 | pub const READY: Self = Self(0x01); | ||
| 13299 | } | ||
| 13300 | #[repr(transparent)] | ||
| 13301 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13302 | pub struct Rtcsel(pub u8); | ||
| 13303 | impl Rtcsel { | ||
| 13304 | #[doc = "No clock"] | ||
| 13305 | pub const NOCLOCK: Self = Self(0); | ||
| 13306 | #[doc = "LSE oscillator clock used as RTC clock"] | ||
| 13307 | pub const LSE: Self = Self(0x01); | ||
| 13308 | #[doc = "LSI oscillator clock used as RTC clock"] | ||
| 13309 | pub const LSI: Self = Self(0x02); | ||
| 13310 | #[doc = "HSE oscillator clock divided by a programmable prescaler (selection through the RTCPRE[1:0] | ||
| 13311 | bits in the RCC clock control register (RCC_CR)) used as the RTC clock"] | ||
| 13312 | pub const HSE: Self = Self(0x03); | ||
| 13313 | } | ||
| 13314 | #[repr(transparent)] | ||
| 13315 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13316 | pub struct Lptimen(pub u8); | ||
| 13317 | impl Lptimen { | ||
| 13318 | #[doc = "Clock disabled"] | ||
| 13319 | pub const DISABLED: Self = Self(0); | ||
| 13320 | #[doc = "Clock enabled"] | ||
| 13321 | pub const ENABLED: Self = Self(0x01); | ||
| 13322 | } | ||
| 13323 | #[repr(transparent)] | ||
| 13324 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 13325 | pub struct Mcopre(pub u8); | ||
| 13326 | impl Mcopre { | ||
| 13327 | #[doc = "No division"] | ||
| 13328 | pub const DIV1: Self = Self(0); | ||
| 13329 | #[doc = "Division by 2"] | ||
| 13330 | pub const DIV2: Self = Self(0x01); | ||
| 13331 | #[doc = "Division by 4"] | ||
| 13332 | pub const DIV4: Self = Self(0x02); | ||
| 13333 | #[doc = "Division by 8"] | ||
| 13334 | pub const DIV8: Self = Self(0x03); | ||
| 13335 | #[doc = "Division by 16"] | ||
| 13336 | pub const DIV16: Self = Self(0x04); | ||
| 13337 | } | ||
| 13338 | } | ||
| 10160 | pub mod regs { | 13339 | pub mod regs { |
| 10161 | use crate::generic::*; | 13340 | use crate::generic::*; |
| 10162 | #[doc = "Clock control register"] | 13341 | #[doc = "AHB peripheral clock enable register"] |
| 10163 | #[repr(transparent)] | 13342 | #[repr(transparent)] |
| 10164 | #[derive(Copy, Clone, Eq, PartialEq)] | 13343 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 10165 | pub struct Cr(pub u32); | 13344 | pub struct Ahbenr(pub u32); |
| 10166 | impl Cr { | 13345 | impl Ahbenr { |
| 10167 | #[doc = "16 MHz high-speed internal clock enable"] | 13346 | #[doc = "DMA clock enable bit"] |
| 10168 | pub const fn hsi16on(&self) -> super::vals::Pllon { | 13347 | pub const fn dmaen(&self) -> super::vals::Crypen { |
| 10169 | let val = (self.0 >> 0usize) & 0x01; | 13348 | let val = (self.0 >> 0usize) & 0x01; |
| 10170 | super::vals::Pllon(val as u8) | 13349 | super::vals::Crypen(val as u8) |
| 10171 | } | 13350 | } |
| 10172 | #[doc = "16 MHz high-speed internal clock enable"] | 13351 | #[doc = "DMA clock enable bit"] |
| 10173 | pub fn set_hsi16on(&mut self, val: super::vals::Pllon) { | 13352 | pub fn set_dmaen(&mut self, val: super::vals::Crypen) { |
| 10174 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | 13353 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 10175 | } | 13354 | } |
| 10176 | #[doc = "High-speed internal clock enable bit for some IP kernels"] | 13355 | #[doc = "NVM interface clock enable bit"] |
| 10177 | pub const fn hsi16keron(&self) -> super::vals::Pllon { | 13356 | pub const fn mifen(&self) -> super::vals::Crypen { |
| 10178 | let val = (self.0 >> 1usize) & 0x01; | 13357 | let val = (self.0 >> 8usize) & 0x01; |
| 10179 | super::vals::Pllon(val as u8) | 13358 | super::vals::Crypen(val as u8) |
| 10180 | } | ||
| 10181 | #[doc = "High-speed internal clock enable bit for some IP kernels"] | ||
| 10182 | pub fn set_hsi16keron(&mut self, val: super::vals::Pllon) { | ||
| 10183 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 10184 | } | 13359 | } |
| 10185 | #[doc = "Internal high-speed clock ready flag"] | 13360 | #[doc = "NVM interface clock enable bit"] |
| 10186 | pub const fn hsi16rdyf(&self) -> bool { | 13361 | pub fn set_mifen(&mut self, val: super::vals::Crypen) { |
| 10187 | let val = (self.0 >> 2usize) & 0x01; | 13362 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); |
| 10188 | val != 0 | ||
| 10189 | } | 13363 | } |
| 10190 | #[doc = "Internal high-speed clock ready flag"] | 13364 | #[doc = "CRC clock enable bit"] |
| 10191 | pub fn set_hsi16rdyf(&mut self, val: bool) { | 13365 | pub const fn crcen(&self) -> super::vals::Crypen { |
| 10192 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 13366 | let val = (self.0 >> 12usize) & 0x01; |
| 13367 | super::vals::Crypen(val as u8) | ||
| 10193 | } | 13368 | } |
| 10194 | #[doc = "HSI16DIVEN"] | 13369 | #[doc = "CRC clock enable bit"] |
| 10195 | pub const fn hsi16diven(&self) -> super::vals::Hsidiven { | 13370 | pub fn set_crcen(&mut self, val: super::vals::Crypen) { |
| 10196 | let val = (self.0 >> 3usize) & 0x01; | 13371 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); |
| 10197 | super::vals::Hsidiven(val as u8) | ||
| 10198 | } | 13372 | } |
| 10199 | #[doc = "HSI16DIVEN"] | 13373 | #[doc = "Touch Sensing clock enable bit"] |
| 10200 | pub fn set_hsi16diven(&mut self, val: super::vals::Hsidiven) { | 13374 | pub const fn touchen(&self) -> super::vals::Crypen { |
| 10201 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | 13375 | let val = (self.0 >> 16usize) & 0x01; |
| 13376 | super::vals::Crypen(val as u8) | ||
| 10202 | } | 13377 | } |
| 10203 | #[doc = "HSI16DIVF"] | 13378 | #[doc = "Touch Sensing clock enable bit"] |
| 10204 | pub const fn hsi16divf(&self) -> bool { | 13379 | pub fn set_touchen(&mut self, val: super::vals::Crypen) { |
| 10205 | let val = (self.0 >> 4usize) & 0x01; | 13380 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); |
| 10206 | val != 0 | ||
| 10207 | } | 13381 | } |
| 10208 | #[doc = "HSI16DIVF"] | 13382 | #[doc = "Random Number Generator clock enable bit"] |
| 10209 | pub fn set_hsi16divf(&mut self, val: bool) { | 13383 | pub const fn rngen(&self) -> super::vals::Crypen { |
| 10210 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 13384 | let val = (self.0 >> 20usize) & 0x01; |
| 13385 | super::vals::Crypen(val as u8) | ||
| 10211 | } | 13386 | } |
| 10212 | #[doc = "16 MHz high-speed internal clock output enable"] | 13387 | #[doc = "Random Number Generator clock enable bit"] |
| 10213 | pub const fn hsi16outen(&self) -> super::vals::Hsiouten { | 13388 | pub fn set_rngen(&mut self, val: super::vals::Crypen) { |
| 10214 | let val = (self.0 >> 5usize) & 0x01; | 13389 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize); |
| 10215 | super::vals::Hsiouten(val as u8) | ||
| 10216 | } | 13390 | } |
| 10217 | #[doc = "16 MHz high-speed internal clock output enable"] | 13391 | #[doc = "Crypto clock enable bit"] |
| 10218 | pub fn set_hsi16outen(&mut self, val: super::vals::Hsiouten) { | 13392 | pub const fn crypen(&self) -> super::vals::Crypen { |
| 10219 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | 13393 | let val = (self.0 >> 24usize) & 0x01; |
| 13394 | super::vals::Crypen(val as u8) | ||
| 10220 | } | 13395 | } |
| 10221 | #[doc = "MSI clock enable bit"] | 13396 | #[doc = "Crypto clock enable bit"] |
| 10222 | pub const fn msion(&self) -> super::vals::Pllon { | 13397 | pub fn set_crypen(&mut self, val: super::vals::Crypen) { |
| 10223 | let val = (self.0 >> 8usize) & 0x01; | 13398 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); |
| 10224 | super::vals::Pllon(val as u8) | ||
| 10225 | } | 13399 | } |
| 10226 | #[doc = "MSI clock enable bit"] | 13400 | } |
| 10227 | pub fn set_msion(&mut self, val: super::vals::Pllon) { | 13401 | impl Default for Ahbenr { |
| 10228 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); | 13402 | fn default() -> Ahbenr { |
| 13403 | Ahbenr(0) | ||
| 10229 | } | 13404 | } |
| 10230 | #[doc = "MSI clock ready flag"] | 13405 | } |
| 10231 | pub const fn msirdy(&self) -> bool { | 13406 | #[doc = "Clock interrupt enable register"] |
| 10232 | let val = (self.0 >> 9usize) & 0x01; | 13407 | #[repr(transparent)] |
| 10233 | val != 0 | 13408 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 13409 | pub struct Cier(pub u32); | ||
| 13410 | impl Cier { | ||
| 13411 | #[doc = "LSI ready interrupt flag"] | ||
| 13412 | pub const fn lsirdyie(&self) -> super::vals::Hsirdyie { | ||
| 13413 | let val = (self.0 >> 0usize) & 0x01; | ||
| 13414 | super::vals::Hsirdyie(val as u8) | ||
| 10234 | } | 13415 | } |
| 10235 | #[doc = "MSI clock ready flag"] | 13416 | #[doc = "LSI ready interrupt flag"] |
| 10236 | pub fn set_msirdy(&mut self, val: bool) { | 13417 | pub fn set_lsirdyie(&mut self, val: super::vals::Hsirdyie) { |
| 10237 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | 13418 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 10238 | } | 13419 | } |
| 10239 | #[doc = "HSE clock enable bit"] | 13420 | #[doc = "LSE ready interrupt flag"] |
| 10240 | pub const fn hseon(&self) -> super::vals::Pllon { | 13421 | pub const fn lserdyie(&self) -> super::vals::Hsirdyie { |
| 10241 | let val = (self.0 >> 16usize) & 0x01; | 13422 | let val = (self.0 >> 1usize) & 0x01; |
| 10242 | super::vals::Pllon(val as u8) | 13423 | super::vals::Hsirdyie(val as u8) |
| 10243 | } | 13424 | } |
| 10244 | #[doc = "HSE clock enable bit"] | 13425 | #[doc = "LSE ready interrupt flag"] |
| 10245 | pub fn set_hseon(&mut self, val: super::vals::Pllon) { | 13426 | pub fn set_lserdyie(&mut self, val: super::vals::Hsirdyie) { |
| 10246 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | 13427 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); |
| 10247 | } | 13428 | } |
| 10248 | #[doc = "HSE clock ready flag"] | 13429 | #[doc = "HSI16 ready interrupt flag"] |
| 10249 | pub const fn hserdy(&self) -> bool { | 13430 | pub const fn hsi16rdyie(&self) -> super::vals::Hsirdyie { |
| 10250 | let val = (self.0 >> 17usize) & 0x01; | 13431 | let val = (self.0 >> 2usize) & 0x01; |
| 10251 | val != 0 | 13432 | super::vals::Hsirdyie(val as u8) |
| 10252 | } | 13433 | } |
| 10253 | #[doc = "HSE clock ready flag"] | 13434 | #[doc = "HSI16 ready interrupt flag"] |
| 10254 | pub fn set_hserdy(&mut self, val: bool) { | 13435 | pub fn set_hsi16rdyie(&mut self, val: super::vals::Hsirdyie) { |
| 10255 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); | 13436 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); |
| 10256 | } | 13437 | } |
| 10257 | #[doc = "HSE clock bypass bit"] | 13438 | #[doc = "HSE ready interrupt flag"] |
| 10258 | pub const fn hsebyp(&self) -> super::vals::Hsebyp { | 13439 | pub const fn hserdyie(&self) -> super::vals::Hsirdyie { |
| 10259 | let val = (self.0 >> 18usize) & 0x01; | 13440 | let val = (self.0 >> 3usize) & 0x01; |
| 10260 | super::vals::Hsebyp(val as u8) | 13441 | super::vals::Hsirdyie(val as u8) |
| 10261 | } | 13442 | } |
| 10262 | #[doc = "HSE clock bypass bit"] | 13443 | #[doc = "HSE ready interrupt flag"] |
| 10263 | pub fn set_hsebyp(&mut self, val: super::vals::Hsebyp) { | 13444 | pub fn set_hserdyie(&mut self, val: super::vals::Hsirdyie) { |
| 10264 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize); | 13445 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); |
| 10265 | } | 13446 | } |
| 10266 | #[doc = "Clock security system on HSE enable bit"] | 13447 | #[doc = "PLL ready interrupt flag"] |
| 10267 | pub const fn csshseon(&self) -> super::vals::Pllon { | 13448 | pub const fn pllrdyie(&self) -> super::vals::Hsirdyie { |
| 10268 | let val = (self.0 >> 19usize) & 0x01; | 13449 | let val = (self.0 >> 4usize) & 0x01; |
| 10269 | super::vals::Pllon(val as u8) | 13450 | super::vals::Hsirdyie(val as u8) |
| 10270 | } | 13451 | } |
| 10271 | #[doc = "Clock security system on HSE enable bit"] | 13452 | #[doc = "PLL ready interrupt flag"] |
| 10272 | pub fn set_csshseon(&mut self, val: super::vals::Pllon) { | 13453 | pub fn set_pllrdyie(&mut self, val: super::vals::Hsirdyie) { |
| 10273 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); | 13454 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); |
| 10274 | } | 13455 | } |
| 10275 | #[doc = "TC/LCD prescaler"] | 13456 | #[doc = "MSI ready interrupt flag"] |
| 10276 | pub const fn rtcpre(&self) -> super::vals::Rtcpre { | 13457 | pub const fn msirdyie(&self) -> super::vals::Hsirdyie { |
| 10277 | let val = (self.0 >> 20usize) & 0x03; | 13458 | let val = (self.0 >> 5usize) & 0x01; |
| 10278 | super::vals::Rtcpre(val as u8) | 13459 | super::vals::Hsirdyie(val as u8) |
| 10279 | } | 13460 | } |
| 10280 | #[doc = "TC/LCD prescaler"] | 13461 | #[doc = "MSI ready interrupt flag"] |
| 10281 | pub fn set_rtcpre(&mut self, val: super::vals::Rtcpre) { | 13462 | pub fn set_msirdyie(&mut self, val: super::vals::Hsirdyie) { |
| 10282 | self.0 = (self.0 & !(0x03 << 20usize)) | (((val.0 as u32) & 0x03) << 20usize); | 13463 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); |
| 10283 | } | 13464 | } |
| 10284 | #[doc = "PLL enable bit"] | 13465 | #[doc = "HSI48 ready interrupt flag"] |
| 10285 | pub const fn pllon(&self) -> super::vals::Pllon { | 13466 | pub const fn hsi48rdyie(&self) -> super::vals::Hsirdyie { |
| 10286 | let val = (self.0 >> 24usize) & 0x01; | 13467 | let val = (self.0 >> 6usize) & 0x01; |
| 10287 | super::vals::Pllon(val as u8) | 13468 | super::vals::Hsirdyie(val as u8) |
| 10288 | } | 13469 | } |
| 10289 | #[doc = "PLL enable bit"] | 13470 | #[doc = "HSI48 ready interrupt flag"] |
| 10290 | pub fn set_pllon(&mut self, val: super::vals::Pllon) { | 13471 | pub fn set_hsi48rdyie(&mut self, val: super::vals::Hsirdyie) { |
| 10291 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); | 13472 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); |
| 10292 | } | 13473 | } |
| 10293 | #[doc = "PLL clock ready flag"] | 13474 | #[doc = "LSE CSS interrupt flag"] |
| 10294 | pub const fn pllrdy(&self) -> bool { | 13475 | pub const fn csslse(&self) -> super::vals::Csslse { |
| 10295 | let val = (self.0 >> 25usize) & 0x01; | 13476 | let val = (self.0 >> 7usize) & 0x01; |
| 10296 | val != 0 | 13477 | super::vals::Csslse(val as u8) |
| 10297 | } | 13478 | } |
| 10298 | #[doc = "PLL clock ready flag"] | 13479 | #[doc = "LSE CSS interrupt flag"] |
| 10299 | pub fn set_pllrdy(&mut self, val: bool) { | 13480 | pub fn set_csslse(&mut self, val: super::vals::Csslse) { |
| 10300 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize); | 13481 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); |
| 10301 | } | 13482 | } |
| 10302 | } | 13483 | } |
| 10303 | impl Default for Cr { | 13484 | impl Default for Cier { |
| 10304 | fn default() -> Cr { | 13485 | fn default() -> Cier { |
| 10305 | Cr(0) | 13486 | Cier(0) |
| 10306 | } | 13487 | } |
| 10307 | } | 13488 | } |
| 10308 | #[doc = "Internal clock sources calibration register"] | 13489 | #[doc = "AHB peripheral clock enable in sleep mode register"] |
| 10309 | #[repr(transparent)] | 13490 | #[repr(transparent)] |
| 10310 | #[derive(Copy, Clone, Eq, PartialEq)] | 13491 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 10311 | pub struct Icscr(pub u32); | 13492 | pub struct Ahbsmenr(pub u32); |
| 10312 | impl Icscr { | 13493 | impl Ahbsmenr { |
| 10313 | #[doc = "nternal high speed clock calibration"] | 13494 | #[doc = "DMA clock enable during sleep mode bit"] |
| 10314 | pub const fn hsi16cal(&self) -> u8 { | 13495 | pub const fn dmasmen(&self) -> super::vals::Dmasmen { |
| 10315 | let val = (self.0 >> 0usize) & 0xff; | 13496 | let val = (self.0 >> 0usize) & 0x01; |
| 10316 | val as u8 | 13497 | super::vals::Dmasmen(val as u8) |
| 10317 | } | 13498 | } |
| 10318 | #[doc = "nternal high speed clock calibration"] | 13499 | #[doc = "DMA clock enable during sleep mode bit"] |
| 10319 | pub fn set_hsi16cal(&mut self, val: u8) { | 13500 | pub fn set_dmasmen(&mut self, val: super::vals::Dmasmen) { |
| 10320 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | 13501 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 10321 | } | 13502 | } |
| 10322 | #[doc = "High speed internal clock trimming"] | 13503 | #[doc = "NVM interface clock enable during sleep mode bit"] |
| 10323 | pub const fn hsi16trim(&self) -> u8 { | 13504 | pub const fn mifsmen(&self) -> super::vals::Mifsmen { |
| 10324 | let val = (self.0 >> 8usize) & 0x1f; | 13505 | let val = (self.0 >> 8usize) & 0x01; |
| 10325 | val as u8 | 13506 | super::vals::Mifsmen(val as u8) |
| 10326 | } | 13507 | } |
| 10327 | #[doc = "High speed internal clock trimming"] | 13508 | #[doc = "NVM interface clock enable during sleep mode bit"] |
| 10328 | pub fn set_hsi16trim(&mut self, val: u8) { | 13509 | pub fn set_mifsmen(&mut self, val: super::vals::Mifsmen) { |
| 10329 | self.0 = (self.0 & !(0x1f << 8usize)) | (((val as u32) & 0x1f) << 8usize); | 13510 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); |
| 10330 | } | 13511 | } |
| 10331 | #[doc = "MSI clock ranges"] | 13512 | #[doc = "SRAM interface clock enable during sleep mode bit"] |
| 10332 | pub const fn msirange(&self) -> super::vals::Msirange { | 13513 | pub const fn sramsmen(&self) -> super::vals::Sramsmen { |
| 10333 | let val = (self.0 >> 13usize) & 0x07; | 13514 | let val = (self.0 >> 9usize) & 0x01; |
| 10334 | super::vals::Msirange(val as u8) | 13515 | super::vals::Sramsmen(val as u8) |
| 10335 | } | 13516 | } |
| 10336 | #[doc = "MSI clock ranges"] | 13517 | #[doc = "SRAM interface clock enable during sleep mode bit"] |
| 10337 | pub fn set_msirange(&mut self, val: super::vals::Msirange) { | 13518 | pub fn set_sramsmen(&mut self, val: super::vals::Sramsmen) { |
| 10338 | self.0 = (self.0 & !(0x07 << 13usize)) | (((val.0 as u32) & 0x07) << 13usize); | 13519 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); |
| 10339 | } | 13520 | } |
| 10340 | #[doc = "MSI clock calibration"] | 13521 | #[doc = "CRC clock enable during sleep mode bit"] |
| 10341 | pub const fn msical(&self) -> u8 { | 13522 | pub const fn crcsmen(&self) -> super::vals::Crcsmen { |
| 10342 | let val = (self.0 >> 16usize) & 0xff; | 13523 | let val = (self.0 >> 12usize) & 0x01; |
| 10343 | val as u8 | 13524 | super::vals::Crcsmen(val as u8) |
| 10344 | } | 13525 | } |
| 10345 | #[doc = "MSI clock calibration"] | 13526 | #[doc = "CRC clock enable during sleep mode bit"] |
| 10346 | pub fn set_msical(&mut self, val: u8) { | 13527 | pub fn set_crcsmen(&mut self, val: super::vals::Crcsmen) { |
| 10347 | self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize); | 13528 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); |
| 10348 | } | 13529 | } |
| 10349 | #[doc = "MSI clock trimming"] | 13530 | #[doc = "Touch Sensing clock enable during sleep mode bit"] |
| 10350 | pub const fn msitrim(&self) -> u8 { | 13531 | pub const fn touchsmen(&self) -> bool { |
| 10351 | let val = (self.0 >> 24usize) & 0xff; | 13532 | let val = (self.0 >> 16usize) & 0x01; |
| 10352 | val as u8 | 13533 | val != 0 |
| 10353 | } | 13534 | } |
| 10354 | #[doc = "MSI clock trimming"] | 13535 | #[doc = "Touch Sensing clock enable during sleep mode bit"] |
| 10355 | pub fn set_msitrim(&mut self, val: u8) { | 13536 | pub fn set_touchsmen(&mut self, val: bool) { |
| 10356 | self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize); | 13537 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); |
| 13538 | } | ||
| 13539 | #[doc = "Random Number Generator clock enable during sleep mode bit"] | ||
| 13540 | pub const fn rngsmen(&self) -> bool { | ||
| 13541 | let val = (self.0 >> 20usize) & 0x01; | ||
| 13542 | val != 0 | ||
| 13543 | } | ||
| 13544 | #[doc = "Random Number Generator clock enable during sleep mode bit"] | ||
| 13545 | pub fn set_rngsmen(&mut self, val: bool) { | ||
| 13546 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); | ||
| 13547 | } | ||
| 13548 | #[doc = "Crypto clock enable during sleep mode bit"] | ||
| 13549 | pub const fn crypsmen(&self) -> super::vals::Crypsmen { | ||
| 13550 | let val = (self.0 >> 24usize) & 0x01; | ||
| 13551 | super::vals::Crypsmen(val as u8) | ||
| 13552 | } | ||
| 13553 | #[doc = "Crypto clock enable during sleep mode bit"] | ||
| 13554 | pub fn set_crypsmen(&mut self, val: super::vals::Crypsmen) { | ||
| 13555 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); | ||
| 10357 | } | 13556 | } |
| 10358 | } | 13557 | } |
| 10359 | impl Default for Icscr { | 13558 | impl Default for Ahbsmenr { |
| 10360 | fn default() -> Icscr { | 13559 | fn default() -> Ahbsmenr { |
| 10361 | Icscr(0) | 13560 | Ahbsmenr(0) |
| 10362 | } | 13561 | } |
| 10363 | } | 13562 | } |
| 10364 | #[doc = "Control and status register"] | 13563 | #[doc = "Control and status register"] |
| @@ -10543,223 +13742,6 @@ pub mod rcc_l0 { | |||
| 10543 | Csr(0) | 13742 | Csr(0) |
| 10544 | } | 13743 | } |
| 10545 | } | 13744 | } |
| 10546 | #[doc = "Clock configuration register"] | ||
| 10547 | #[repr(transparent)] | ||
| 10548 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 10549 | pub struct Cfgr(pub u32); | ||
| 10550 | impl Cfgr { | ||
| 10551 | #[doc = "System clock switch"] | ||
| 10552 | pub const fn sw(&self) -> super::vals::Sw { | ||
| 10553 | let val = (self.0 >> 0usize) & 0x03; | ||
| 10554 | super::vals::Sw(val as u8) | ||
| 10555 | } | ||
| 10556 | #[doc = "System clock switch"] | ||
| 10557 | pub fn set_sw(&mut self, val: super::vals::Sw) { | ||
| 10558 | self.0 = (self.0 & !(0x03 << 0usize)) | (((val.0 as u32) & 0x03) << 0usize); | ||
| 10559 | } | ||
| 10560 | #[doc = "System clock switch status"] | ||
| 10561 | pub const fn sws(&self) -> super::vals::Sws { | ||
| 10562 | let val = (self.0 >> 2usize) & 0x03; | ||
| 10563 | super::vals::Sws(val as u8) | ||
| 10564 | } | ||
| 10565 | #[doc = "System clock switch status"] | ||
| 10566 | pub fn set_sws(&mut self, val: super::vals::Sws) { | ||
| 10567 | self.0 = (self.0 & !(0x03 << 2usize)) | (((val.0 as u32) & 0x03) << 2usize); | ||
| 10568 | } | ||
| 10569 | #[doc = "AHB prescaler"] | ||
| 10570 | pub const fn hpre(&self) -> super::vals::Hpre { | ||
| 10571 | let val = (self.0 >> 4usize) & 0x0f; | ||
| 10572 | super::vals::Hpre(val as u8) | ||
| 10573 | } | ||
| 10574 | #[doc = "AHB prescaler"] | ||
| 10575 | pub fn set_hpre(&mut self, val: super::vals::Hpre) { | ||
| 10576 | self.0 = (self.0 & !(0x0f << 4usize)) | (((val.0 as u32) & 0x0f) << 4usize); | ||
| 10577 | } | ||
| 10578 | #[doc = "APB low-speed prescaler (APB1)"] | ||
| 10579 | pub fn ppre(&self, n: usize) -> super::vals::Ppre { | ||
| 10580 | assert!(n < 2usize); | ||
| 10581 | let offs = 8usize + n * 3usize; | ||
| 10582 | let val = (self.0 >> offs) & 0x07; | ||
| 10583 | super::vals::Ppre(val as u8) | ||
| 10584 | } | ||
| 10585 | #[doc = "APB low-speed prescaler (APB1)"] | ||
| 10586 | pub fn set_ppre(&mut self, n: usize, val: super::vals::Ppre) { | ||
| 10587 | assert!(n < 2usize); | ||
| 10588 | let offs = 8usize + n * 3usize; | ||
| 10589 | self.0 = (self.0 & !(0x07 << offs)) | (((val.0 as u32) & 0x07) << offs); | ||
| 10590 | } | ||
| 10591 | #[doc = "Wake-up from stop clock selection"] | ||
| 10592 | pub const fn stopwuck(&self) -> super::vals::Stopwuck { | ||
| 10593 | let val = (self.0 >> 15usize) & 0x01; | ||
| 10594 | super::vals::Stopwuck(val as u8) | ||
| 10595 | } | ||
| 10596 | #[doc = "Wake-up from stop clock selection"] | ||
| 10597 | pub fn set_stopwuck(&mut self, val: super::vals::Stopwuck) { | ||
| 10598 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 10599 | } | ||
| 10600 | #[doc = "PLL entry clock source"] | ||
| 10601 | pub const fn pllsrc(&self) -> super::vals::Pllsrc { | ||
| 10602 | let val = (self.0 >> 16usize) & 0x01; | ||
| 10603 | super::vals::Pllsrc(val as u8) | ||
| 10604 | } | ||
| 10605 | #[doc = "PLL entry clock source"] | ||
| 10606 | pub fn set_pllsrc(&mut self, val: super::vals::Pllsrc) { | ||
| 10607 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 10608 | } | ||
| 10609 | #[doc = "PLL multiplication factor"] | ||
| 10610 | pub const fn pllmul(&self) -> super::vals::Pllmul { | ||
| 10611 | let val = (self.0 >> 18usize) & 0x0f; | ||
| 10612 | super::vals::Pllmul(val as u8) | ||
| 10613 | } | ||
| 10614 | #[doc = "PLL multiplication factor"] | ||
| 10615 | pub fn set_pllmul(&mut self, val: super::vals::Pllmul) { | ||
| 10616 | self.0 = (self.0 & !(0x0f << 18usize)) | (((val.0 as u32) & 0x0f) << 18usize); | ||
| 10617 | } | ||
| 10618 | #[doc = "PLL output division"] | ||
| 10619 | pub const fn plldiv(&self) -> super::vals::Plldiv { | ||
| 10620 | let val = (self.0 >> 22usize) & 0x03; | ||
| 10621 | super::vals::Plldiv(val as u8) | ||
| 10622 | } | ||
| 10623 | #[doc = "PLL output division"] | ||
| 10624 | pub fn set_plldiv(&mut self, val: super::vals::Plldiv) { | ||
| 10625 | self.0 = (self.0 & !(0x03 << 22usize)) | (((val.0 as u32) & 0x03) << 22usize); | ||
| 10626 | } | ||
| 10627 | #[doc = "Microcontroller clock output selection"] | ||
| 10628 | pub const fn mcosel(&self) -> super::vals::Mcosel { | ||
| 10629 | let val = (self.0 >> 24usize) & 0x0f; | ||
| 10630 | super::vals::Mcosel(val as u8) | ||
| 10631 | } | ||
| 10632 | #[doc = "Microcontroller clock output selection"] | ||
| 10633 | pub fn set_mcosel(&mut self, val: super::vals::Mcosel) { | ||
| 10634 | self.0 = (self.0 & !(0x0f << 24usize)) | (((val.0 as u32) & 0x0f) << 24usize); | ||
| 10635 | } | ||
| 10636 | #[doc = "Microcontroller clock output prescaler"] | ||
| 10637 | pub const fn mcopre(&self) -> super::vals::Mcopre { | ||
| 10638 | let val = (self.0 >> 28usize) & 0x07; | ||
| 10639 | super::vals::Mcopre(val as u8) | ||
| 10640 | } | ||
| 10641 | #[doc = "Microcontroller clock output prescaler"] | ||
| 10642 | pub fn set_mcopre(&mut self, val: super::vals::Mcopre) { | ||
| 10643 | self.0 = (self.0 & !(0x07 << 28usize)) | (((val.0 as u32) & 0x07) << 28usize); | ||
| 10644 | } | ||
| 10645 | } | ||
| 10646 | impl Default for Cfgr { | ||
| 10647 | fn default() -> Cfgr { | ||
| 10648 | Cfgr(0) | ||
| 10649 | } | ||
| 10650 | } | ||
| 10651 | #[doc = "Clock recovery RC register"] | ||
| 10652 | #[repr(transparent)] | ||
| 10653 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 10654 | pub struct Crrcr(pub u32); | ||
| 10655 | impl Crrcr { | ||
| 10656 | #[doc = "48MHz HSI clock enable bit"] | ||
| 10657 | pub const fn hsi48on(&self) -> bool { | ||
| 10658 | let val = (self.0 >> 0usize) & 0x01; | ||
| 10659 | val != 0 | ||
| 10660 | } | ||
| 10661 | #[doc = "48MHz HSI clock enable bit"] | ||
| 10662 | pub fn set_hsi48on(&mut self, val: bool) { | ||
| 10663 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 10664 | } | ||
| 10665 | #[doc = "48MHz HSI clock ready flag"] | ||
| 10666 | pub const fn hsi48rdy(&self) -> bool { | ||
| 10667 | let val = (self.0 >> 1usize) & 0x01; | ||
| 10668 | val != 0 | ||
| 10669 | } | ||
| 10670 | #[doc = "48MHz HSI clock ready flag"] | ||
| 10671 | pub fn set_hsi48rdy(&mut self, val: bool) { | ||
| 10672 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | ||
| 10673 | } | ||
| 10674 | #[doc = "48 MHz HSI clock divided by 6 output enable"] | ||
| 10675 | pub const fn hsi48div6en(&self) -> bool { | ||
| 10676 | let val = (self.0 >> 2usize) & 0x01; | ||
| 10677 | val != 0 | ||
| 10678 | } | ||
| 10679 | #[doc = "48 MHz HSI clock divided by 6 output enable"] | ||
| 10680 | pub fn set_hsi48div6en(&mut self, val: bool) { | ||
| 10681 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 10682 | } | ||
| 10683 | #[doc = "48 MHz HSI clock calibration"] | ||
| 10684 | pub const fn hsi48cal(&self) -> u8 { | ||
| 10685 | let val = (self.0 >> 8usize) & 0xff; | ||
| 10686 | val as u8 | ||
| 10687 | } | ||
| 10688 | #[doc = "48 MHz HSI clock calibration"] | ||
| 10689 | pub fn set_hsi48cal(&mut self, val: u8) { | ||
| 10690 | self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize); | ||
| 10691 | } | ||
| 10692 | } | ||
| 10693 | impl Default for Crrcr { | ||
| 10694 | fn default() -> Crrcr { | ||
| 10695 | Crrcr(0) | ||
| 10696 | } | ||
| 10697 | } | ||
| 10698 | #[doc = "GPIO clock enable in sleep mode register"] | ||
| 10699 | #[repr(transparent)] | ||
| 10700 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 10701 | pub struct Iopsmen(pub u32); | ||
| 10702 | impl Iopsmen { | ||
| 10703 | #[doc = "IOPASMEN"] | ||
| 10704 | pub const fn iopasmen(&self) -> super::vals::Iophsmen { | ||
| 10705 | let val = (self.0 >> 0usize) & 0x01; | ||
| 10706 | super::vals::Iophsmen(val as u8) | ||
| 10707 | } | ||
| 10708 | #[doc = "IOPASMEN"] | ||
| 10709 | pub fn set_iopasmen(&mut self, val: super::vals::Iophsmen) { | ||
| 10710 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 10711 | } | ||
| 10712 | #[doc = "IOPBSMEN"] | ||
| 10713 | pub const fn iopbsmen(&self) -> super::vals::Iophsmen { | ||
| 10714 | let val = (self.0 >> 1usize) & 0x01; | ||
| 10715 | super::vals::Iophsmen(val as u8) | ||
| 10716 | } | ||
| 10717 | #[doc = "IOPBSMEN"] | ||
| 10718 | pub fn set_iopbsmen(&mut self, val: super::vals::Iophsmen) { | ||
| 10719 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 10720 | } | ||
| 10721 | #[doc = "IOPCSMEN"] | ||
| 10722 | pub const fn iopcsmen(&self) -> super::vals::Iophsmen { | ||
| 10723 | let val = (self.0 >> 2usize) & 0x01; | ||
| 10724 | super::vals::Iophsmen(val as u8) | ||
| 10725 | } | ||
| 10726 | #[doc = "IOPCSMEN"] | ||
| 10727 | pub fn set_iopcsmen(&mut self, val: super::vals::Iophsmen) { | ||
| 10728 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 10729 | } | ||
| 10730 | #[doc = "IOPDSMEN"] | ||
| 10731 | pub const fn iopdsmen(&self) -> super::vals::Iophsmen { | ||
| 10732 | let val = (self.0 >> 3usize) & 0x01; | ||
| 10733 | super::vals::Iophsmen(val as u8) | ||
| 10734 | } | ||
| 10735 | #[doc = "IOPDSMEN"] | ||
| 10736 | pub fn set_iopdsmen(&mut self, val: super::vals::Iophsmen) { | ||
| 10737 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 10738 | } | ||
| 10739 | #[doc = "Port E clock enable during Sleep mode bit"] | ||
| 10740 | pub const fn iopesmen(&self) -> super::vals::Iophsmen { | ||
| 10741 | let val = (self.0 >> 4usize) & 0x01; | ||
| 10742 | super::vals::Iophsmen(val as u8) | ||
| 10743 | } | ||
| 10744 | #[doc = "Port E clock enable during Sleep mode bit"] | ||
| 10745 | pub fn set_iopesmen(&mut self, val: super::vals::Iophsmen) { | ||
| 10746 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 10747 | } | ||
| 10748 | #[doc = "IOPHSMEN"] | ||
| 10749 | pub const fn iophsmen(&self) -> super::vals::Iophsmen { | ||
| 10750 | let val = (self.0 >> 7usize) & 0x01; | ||
| 10751 | super::vals::Iophsmen(val as u8) | ||
| 10752 | } | ||
| 10753 | #[doc = "IOPHSMEN"] | ||
| 10754 | pub fn set_iophsmen(&mut self, val: super::vals::Iophsmen) { | ||
| 10755 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 10756 | } | ||
| 10757 | } | ||
| 10758 | impl Default for Iopsmen { | ||
| 10759 | fn default() -> Iopsmen { | ||
| 10760 | Iopsmen(0) | ||
| 10761 | } | ||
| 10762 | } | ||
| 10763 | #[doc = "APB1 peripheral clock enable register"] | 13745 | #[doc = "APB1 peripheral clock enable register"] |
| 10764 | #[repr(transparent)] | 13746 | #[repr(transparent)] |
| 10765 | #[derive(Copy, Clone, Eq, PartialEq)] | 13747 | #[derive(Copy, Clone, Eq, PartialEq)] |
| @@ -10933,309 +13915,282 @@ pub mod rcc_l0 { | |||
| 10933 | Apb1enr(0) | 13915 | Apb1enr(0) |
| 10934 | } | 13916 | } |
| 10935 | } | 13917 | } |
| 10936 | #[doc = "AHB peripheral clock enable register"] | 13918 | #[doc = "Internal clock sources calibration register"] |
| 10937 | #[repr(transparent)] | 13919 | #[repr(transparent)] |
| 10938 | #[derive(Copy, Clone, Eq, PartialEq)] | 13920 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 10939 | pub struct Ahbenr(pub u32); | 13921 | pub struct Icscr(pub u32); |
| 10940 | impl Ahbenr { | 13922 | impl Icscr { |
| 10941 | #[doc = "DMA clock enable bit"] | 13923 | #[doc = "nternal high speed clock calibration"] |
| 10942 | pub const fn dmaen(&self) -> super::vals::Crypen { | 13924 | pub const fn hsi16cal(&self) -> u8 { |
| 10943 | let val = (self.0 >> 0usize) & 0x01; | 13925 | let val = (self.0 >> 0usize) & 0xff; |
| 10944 | super::vals::Crypen(val as u8) | 13926 | val as u8 |
| 10945 | } | ||
| 10946 | #[doc = "DMA clock enable bit"] | ||
| 10947 | pub fn set_dmaen(&mut self, val: super::vals::Crypen) { | ||
| 10948 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 10949 | } | ||
| 10950 | #[doc = "NVM interface clock enable bit"] | ||
| 10951 | pub const fn mifen(&self) -> super::vals::Crypen { | ||
| 10952 | let val = (self.0 >> 8usize) & 0x01; | ||
| 10953 | super::vals::Crypen(val as u8) | ||
| 10954 | } | 13927 | } |
| 10955 | #[doc = "NVM interface clock enable bit"] | 13928 | #[doc = "nternal high speed clock calibration"] |
| 10956 | pub fn set_mifen(&mut self, val: super::vals::Crypen) { | 13929 | pub fn set_hsi16cal(&mut self, val: u8) { |
| 10957 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); | 13930 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); |
| 10958 | } | 13931 | } |
| 10959 | #[doc = "CRC clock enable bit"] | 13932 | #[doc = "High speed internal clock trimming"] |
| 10960 | pub const fn crcen(&self) -> super::vals::Crypen { | 13933 | pub const fn hsi16trim(&self) -> u8 { |
| 10961 | let val = (self.0 >> 12usize) & 0x01; | 13934 | let val = (self.0 >> 8usize) & 0x1f; |
| 10962 | super::vals::Crypen(val as u8) | 13935 | val as u8 |
| 10963 | } | 13936 | } |
| 10964 | #[doc = "CRC clock enable bit"] | 13937 | #[doc = "High speed internal clock trimming"] |
| 10965 | pub fn set_crcen(&mut self, val: super::vals::Crypen) { | 13938 | pub fn set_hsi16trim(&mut self, val: u8) { |
| 10966 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | 13939 | self.0 = (self.0 & !(0x1f << 8usize)) | (((val as u32) & 0x1f) << 8usize); |
| 10967 | } | 13940 | } |
| 10968 | #[doc = "Touch Sensing clock enable bit"] | 13941 | #[doc = "MSI clock ranges"] |
| 10969 | pub const fn touchen(&self) -> super::vals::Crypen { | 13942 | pub const fn msirange(&self) -> super::vals::Msirange { |
| 10970 | let val = (self.0 >> 16usize) & 0x01; | 13943 | let val = (self.0 >> 13usize) & 0x07; |
| 10971 | super::vals::Crypen(val as u8) | 13944 | super::vals::Msirange(val as u8) |
| 10972 | } | 13945 | } |
| 10973 | #[doc = "Touch Sensing clock enable bit"] | 13946 | #[doc = "MSI clock ranges"] |
| 10974 | pub fn set_touchen(&mut self, val: super::vals::Crypen) { | 13947 | pub fn set_msirange(&mut self, val: super::vals::Msirange) { |
| 10975 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | 13948 | self.0 = (self.0 & !(0x07 << 13usize)) | (((val.0 as u32) & 0x07) << 13usize); |
| 10976 | } | 13949 | } |
| 10977 | #[doc = "Random Number Generator clock enable bit"] | 13950 | #[doc = "MSI clock calibration"] |
| 10978 | pub const fn rngen(&self) -> super::vals::Crypen { | 13951 | pub const fn msical(&self) -> u8 { |
| 10979 | let val = (self.0 >> 20usize) & 0x01; | 13952 | let val = (self.0 >> 16usize) & 0xff; |
| 10980 | super::vals::Crypen(val as u8) | 13953 | val as u8 |
| 10981 | } | 13954 | } |
| 10982 | #[doc = "Random Number Generator clock enable bit"] | 13955 | #[doc = "MSI clock calibration"] |
| 10983 | pub fn set_rngen(&mut self, val: super::vals::Crypen) { | 13956 | pub fn set_msical(&mut self, val: u8) { |
| 10984 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize); | 13957 | self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize); |
| 10985 | } | 13958 | } |
| 10986 | #[doc = "Crypto clock enable bit"] | 13959 | #[doc = "MSI clock trimming"] |
| 10987 | pub const fn crypen(&self) -> super::vals::Crypen { | 13960 | pub const fn msitrim(&self) -> u8 { |
| 10988 | let val = (self.0 >> 24usize) & 0x01; | 13961 | let val = (self.0 >> 24usize) & 0xff; |
| 10989 | super::vals::Crypen(val as u8) | 13962 | val as u8 |
| 10990 | } | 13963 | } |
| 10991 | #[doc = "Crypto clock enable bit"] | 13964 | #[doc = "MSI clock trimming"] |
| 10992 | pub fn set_crypen(&mut self, val: super::vals::Crypen) { | 13965 | pub fn set_msitrim(&mut self, val: u8) { |
| 10993 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); | 13966 | self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize); |
| 10994 | } | 13967 | } |
| 10995 | } | 13968 | } |
| 10996 | impl Default for Ahbenr { | 13969 | impl Default for Icscr { |
| 10997 | fn default() -> Ahbenr { | 13970 | fn default() -> Icscr { |
| 10998 | Ahbenr(0) | 13971 | Icscr(0) |
| 10999 | } | 13972 | } |
| 11000 | } | 13973 | } |
| 11001 | #[doc = "AHB peripheral clock enable in sleep mode register"] | 13974 | #[doc = "APB2 peripheral clock enable in sleep mode register"] |
| 11002 | #[repr(transparent)] | 13975 | #[repr(transparent)] |
| 11003 | #[derive(Copy, Clone, Eq, PartialEq)] | 13976 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 11004 | pub struct Ahbsmenr(pub u32); | 13977 | pub struct Apb2smenr(pub u32); |
| 11005 | impl Ahbsmenr { | 13978 | impl Apb2smenr { |
| 11006 | #[doc = "DMA clock enable during sleep mode bit"] | 13979 | #[doc = "System configuration controller clock enable during sleep mode bit"] |
| 11007 | pub const fn dmasmen(&self) -> super::vals::Dmasmen { | 13980 | pub const fn syscfgsmen(&self) -> super::vals::Dbgsmen { |
| 11008 | let val = (self.0 >> 0usize) & 0x01; | 13981 | let val = (self.0 >> 0usize) & 0x01; |
| 11009 | super::vals::Dmasmen(val as u8) | 13982 | super::vals::Dbgsmen(val as u8) |
| 11010 | } | 13983 | } |
| 11011 | #[doc = "DMA clock enable during sleep mode bit"] | 13984 | #[doc = "System configuration controller clock enable during sleep mode bit"] |
| 11012 | pub fn set_dmasmen(&mut self, val: super::vals::Dmasmen) { | 13985 | pub fn set_syscfgsmen(&mut self, val: super::vals::Dbgsmen) { |
| 11013 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | 13986 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 11014 | } | 13987 | } |
| 11015 | #[doc = "NVM interface clock enable during sleep mode bit"] | 13988 | #[doc = "TIM21 timer clock enable during sleep mode bit"] |
| 11016 | pub const fn mifsmen(&self) -> super::vals::Mifsmen { | 13989 | pub const fn tim21smen(&self) -> super::vals::Dbgsmen { |
| 11017 | let val = (self.0 >> 8usize) & 0x01; | 13990 | let val = (self.0 >> 2usize) & 0x01; |
| 11018 | super::vals::Mifsmen(val as u8) | 13991 | super::vals::Dbgsmen(val as u8) |
| 11019 | } | 13992 | } |
| 11020 | #[doc = "NVM interface clock enable during sleep mode bit"] | 13993 | #[doc = "TIM21 timer clock enable during sleep mode bit"] |
| 11021 | pub fn set_mifsmen(&mut self, val: super::vals::Mifsmen) { | 13994 | pub fn set_tim21smen(&mut self, val: super::vals::Dbgsmen) { |
| 11022 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); | 13995 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); |
| 11023 | } | 13996 | } |
| 11024 | #[doc = "SRAM interface clock enable during sleep mode bit"] | 13997 | #[doc = "TIM22 timer clock enable during sleep mode bit"] |
| 11025 | pub const fn sramsmen(&self) -> super::vals::Sramsmen { | 13998 | pub const fn tim22smen(&self) -> super::vals::Dbgsmen { |
| 13999 | let val = (self.0 >> 5usize) & 0x01; | ||
| 14000 | super::vals::Dbgsmen(val as u8) | ||
| 14001 | } | ||
| 14002 | #[doc = "TIM22 timer clock enable during sleep mode bit"] | ||
| 14003 | pub fn set_tim22smen(&mut self, val: super::vals::Dbgsmen) { | ||
| 14004 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 14005 | } | ||
| 14006 | #[doc = "ADC clock enable during sleep mode bit"] | ||
| 14007 | pub const fn adcsmen(&self) -> super::vals::Dbgsmen { | ||
| 11026 | let val = (self.0 >> 9usize) & 0x01; | 14008 | let val = (self.0 >> 9usize) & 0x01; |
| 11027 | super::vals::Sramsmen(val as u8) | 14009 | super::vals::Dbgsmen(val as u8) |
| 11028 | } | 14010 | } |
| 11029 | #[doc = "SRAM interface clock enable during sleep mode bit"] | 14011 | #[doc = "ADC clock enable during sleep mode bit"] |
| 11030 | pub fn set_sramsmen(&mut self, val: super::vals::Sramsmen) { | 14012 | pub fn set_adcsmen(&mut self, val: super::vals::Dbgsmen) { |
| 11031 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | 14013 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); |
| 11032 | } | 14014 | } |
| 11033 | #[doc = "CRC clock enable during sleep mode bit"] | 14015 | #[doc = "SPI1 clock enable during sleep mode bit"] |
| 11034 | pub const fn crcsmen(&self) -> super::vals::Crcsmen { | 14016 | pub const fn spi1smen(&self) -> super::vals::Dbgsmen { |
| 11035 | let val = (self.0 >> 12usize) & 0x01; | 14017 | let val = (self.0 >> 12usize) & 0x01; |
| 11036 | super::vals::Crcsmen(val as u8) | 14018 | super::vals::Dbgsmen(val as u8) |
| 11037 | } | 14019 | } |
| 11038 | #[doc = "CRC clock enable during sleep mode bit"] | 14020 | #[doc = "SPI1 clock enable during sleep mode bit"] |
| 11039 | pub fn set_crcsmen(&mut self, val: super::vals::Crcsmen) { | 14021 | pub fn set_spi1smen(&mut self, val: super::vals::Dbgsmen) { |
| 11040 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | 14022 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); |
| 11041 | } | 14023 | } |
| 11042 | #[doc = "Touch Sensing clock enable during sleep mode bit"] | 14024 | #[doc = "USART1 clock enable during sleep mode bit"] |
| 11043 | pub const fn touchsmen(&self) -> bool { | 14025 | pub const fn usart1smen(&self) -> super::vals::Dbgsmen { |
| 11044 | let val = (self.0 >> 16usize) & 0x01; | 14026 | let val = (self.0 >> 14usize) & 0x01; |
| 11045 | val != 0 | 14027 | super::vals::Dbgsmen(val as u8) |
| 11046 | } | ||
| 11047 | #[doc = "Touch Sensing clock enable during sleep mode bit"] | ||
| 11048 | pub fn set_touchsmen(&mut self, val: bool) { | ||
| 11049 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | ||
| 11050 | } | ||
| 11051 | #[doc = "Random Number Generator clock enable during sleep mode bit"] | ||
| 11052 | pub const fn rngsmen(&self) -> bool { | ||
| 11053 | let val = (self.0 >> 20usize) & 0x01; | ||
| 11054 | val != 0 | ||
| 11055 | } | 14028 | } |
| 11056 | #[doc = "Random Number Generator clock enable during sleep mode bit"] | 14029 | #[doc = "USART1 clock enable during sleep mode bit"] |
| 11057 | pub fn set_rngsmen(&mut self, val: bool) { | 14030 | pub fn set_usart1smen(&mut self, val: super::vals::Dbgsmen) { |
| 11058 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); | 14031 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); |
| 11059 | } | 14032 | } |
| 11060 | #[doc = "Crypto clock enable during sleep mode bit"] | 14033 | #[doc = "DBG clock enable during sleep mode bit"] |
| 11061 | pub const fn crypsmen(&self) -> super::vals::Crypsmen { | 14034 | pub const fn dbgsmen(&self) -> super::vals::Dbgsmen { |
| 11062 | let val = (self.0 >> 24usize) & 0x01; | 14035 | let val = (self.0 >> 22usize) & 0x01; |
| 11063 | super::vals::Crypsmen(val as u8) | 14036 | super::vals::Dbgsmen(val as u8) |
| 11064 | } | 14037 | } |
| 11065 | #[doc = "Crypto clock enable during sleep mode bit"] | 14038 | #[doc = "DBG clock enable during sleep mode bit"] |
| 11066 | pub fn set_crypsmen(&mut self, val: super::vals::Crypsmen) { | 14039 | pub fn set_dbgsmen(&mut self, val: super::vals::Dbgsmen) { |
| 11067 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); | 14040 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize); |
| 11068 | } | 14041 | } |
| 11069 | } | 14042 | } |
| 11070 | impl Default for Ahbsmenr { | 14043 | impl Default for Apb2smenr { |
| 11071 | fn default() -> Ahbsmenr { | 14044 | fn default() -> Apb2smenr { |
| 11072 | Ahbsmenr(0) | 14045 | Apb2smenr(0) |
| 11073 | } | 14046 | } |
| 11074 | } | 14047 | } |
| 11075 | #[doc = "Clock interrupt flag register"] | 14048 | #[doc = "GPIO clock enable register"] |
| 11076 | #[repr(transparent)] | 14049 | #[repr(transparent)] |
| 11077 | #[derive(Copy, Clone, Eq, PartialEq)] | 14050 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 11078 | pub struct Cifr(pub u32); | 14051 | pub struct Iopenr(pub u32); |
| 11079 | impl Cifr { | 14052 | impl Iopenr { |
| 11080 | #[doc = "LSI ready interrupt flag"] | 14053 | #[doc = "IO port A clock enable bit"] |
| 11081 | pub const fn lsirdyf(&self) -> bool { | 14054 | pub const fn iopaen(&self) -> super::vals::Iophen { |
| 11082 | let val = (self.0 >> 0usize) & 0x01; | 14055 | let val = (self.0 >> 0usize) & 0x01; |
| 11083 | val != 0 | 14056 | super::vals::Iophen(val as u8) |
| 11084 | } | 14057 | } |
| 11085 | #[doc = "LSI ready interrupt flag"] | 14058 | #[doc = "IO port A clock enable bit"] |
| 11086 | pub fn set_lsirdyf(&mut self, val: bool) { | 14059 | pub fn set_iopaen(&mut self, val: super::vals::Iophen) { |
| 11087 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 14060 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 11088 | } | 14061 | } |
| 11089 | #[doc = "LSE ready interrupt flag"] | 14062 | #[doc = "IO port B clock enable bit"] |
| 11090 | pub const fn lserdyf(&self) -> bool { | 14063 | pub const fn iopben(&self) -> super::vals::Iophen { |
| 11091 | let val = (self.0 >> 1usize) & 0x01; | 14064 | let val = (self.0 >> 1usize) & 0x01; |
| 11092 | val != 0 | 14065 | super::vals::Iophen(val as u8) |
| 11093 | } | 14066 | } |
| 11094 | #[doc = "LSE ready interrupt flag"] | 14067 | #[doc = "IO port B clock enable bit"] |
| 11095 | pub fn set_lserdyf(&mut self, val: bool) { | 14068 | pub fn set_iopben(&mut self, val: super::vals::Iophen) { |
| 11096 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 14069 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); |
| 11097 | } | 14070 | } |
| 11098 | #[doc = "HSI16 ready interrupt flag"] | 14071 | #[doc = "IO port A clock enable bit"] |
| 11099 | pub const fn hsi16rdyf(&self) -> bool { | 14072 | pub const fn iopcen(&self) -> super::vals::Iophen { |
| 11100 | let val = (self.0 >> 2usize) & 0x01; | 14073 | let val = (self.0 >> 2usize) & 0x01; |
| 11101 | val != 0 | 14074 | super::vals::Iophen(val as u8) |
| 11102 | } | 14075 | } |
| 11103 | #[doc = "HSI16 ready interrupt flag"] | 14076 | #[doc = "IO port A clock enable bit"] |
| 11104 | pub fn set_hsi16rdyf(&mut self, val: bool) { | 14077 | pub fn set_iopcen(&mut self, val: super::vals::Iophen) { |
| 11105 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 14078 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); |
| 11106 | } | 14079 | } |
| 11107 | #[doc = "HSE ready interrupt flag"] | 14080 | #[doc = "I/O port D clock enable bit"] |
| 11108 | pub const fn hserdyf(&self) -> bool { | 14081 | pub const fn iopden(&self) -> super::vals::Iophen { |
| 11109 | let val = (self.0 >> 3usize) & 0x01; | 14082 | let val = (self.0 >> 3usize) & 0x01; |
| 11110 | val != 0 | 14083 | super::vals::Iophen(val as u8) |
| 11111 | } | 14084 | } |
| 11112 | #[doc = "HSE ready interrupt flag"] | 14085 | #[doc = "I/O port D clock enable bit"] |
| 11113 | pub fn set_hserdyf(&mut self, val: bool) { | 14086 | pub fn set_iopden(&mut self, val: super::vals::Iophen) { |
| 11114 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 14087 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); |
| 11115 | } | 14088 | } |
| 11116 | #[doc = "PLL ready interrupt flag"] | 14089 | #[doc = "I/O port E clock enable bit"] |
| 11117 | pub const fn pllrdyf(&self) -> bool { | 14090 | pub const fn iopeen(&self) -> super::vals::Iophen { |
| 11118 | let val = (self.0 >> 4usize) & 0x01; | 14091 | let val = (self.0 >> 4usize) & 0x01; |
| 11119 | val != 0 | 14092 | super::vals::Iophen(val as u8) |
| 11120 | } | ||
| 11121 | #[doc = "PLL ready interrupt flag"] | ||
| 11122 | pub fn set_pllrdyf(&mut self, val: bool) { | ||
| 11123 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | ||
| 11124 | } | ||
| 11125 | #[doc = "MSI ready interrupt flag"] | ||
| 11126 | pub const fn msirdyf(&self) -> bool { | ||
| 11127 | let val = (self.0 >> 5usize) & 0x01; | ||
| 11128 | val != 0 | ||
| 11129 | } | ||
| 11130 | #[doc = "MSI ready interrupt flag"] | ||
| 11131 | pub fn set_msirdyf(&mut self, val: bool) { | ||
| 11132 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 11133 | } | ||
| 11134 | #[doc = "HSI48 ready interrupt flag"] | ||
| 11135 | pub const fn hsi48rdyf(&self) -> bool { | ||
| 11136 | let val = (self.0 >> 6usize) & 0x01; | ||
| 11137 | val != 0 | ||
| 11138 | } | 14093 | } |
| 11139 | #[doc = "HSI48 ready interrupt flag"] | 14094 | #[doc = "I/O port E clock enable bit"] |
| 11140 | pub fn set_hsi48rdyf(&mut self, val: bool) { | 14095 | pub fn set_iopeen(&mut self, val: super::vals::Iophen) { |
| 11141 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 14096 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); |
| 11142 | } | 14097 | } |
| 11143 | #[doc = "LSE Clock Security System Interrupt flag"] | 14098 | #[doc = "I/O port H clock enable bit"] |
| 11144 | pub const fn csslsef(&self) -> super::vals::Csslsef { | 14099 | pub const fn iophen(&self) -> super::vals::Iophen { |
| 11145 | let val = (self.0 >> 7usize) & 0x01; | 14100 | let val = (self.0 >> 7usize) & 0x01; |
| 11146 | super::vals::Csslsef(val as u8) | 14101 | super::vals::Iophen(val as u8) |
| 11147 | } | 14102 | } |
| 11148 | #[doc = "LSE Clock Security System Interrupt flag"] | 14103 | #[doc = "I/O port H clock enable bit"] |
| 11149 | pub fn set_csslsef(&mut self, val: super::vals::Csslsef) { | 14104 | pub fn set_iophen(&mut self, val: super::vals::Iophen) { |
| 11150 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | 14105 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); |
| 11151 | } | 14106 | } |
| 11152 | #[doc = "Clock Security System Interrupt flag"] | ||
| 11153 | pub const fn csshsef(&self) -> super::vals::Csshsef { | ||
| 11154 | let val = (self.0 >> 8usize) & 0x01; | ||
| 11155 | super::vals::Csshsef(val as u8) | ||
| 11156 | } | ||
| 11157 | #[doc = "Clock Security System Interrupt flag"] | ||
| 11158 | pub fn set_csshsef(&mut self, val: super::vals::Csshsef) { | ||
| 11159 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); | ||
| 11160 | } | ||
| 11161 | } | 14107 | } |
| 11162 | impl Default for Cifr { | 14108 | impl Default for Iopenr { |
| 11163 | fn default() -> Cifr { | 14109 | fn default() -> Iopenr { |
| 11164 | Cifr(0) | 14110 | Iopenr(0) |
| 11165 | } | 14111 | } |
| 11166 | } | 14112 | } |
| 11167 | #[doc = "APB2 peripheral clock enable in sleep mode register"] | 14113 | #[doc = "APB2 peripheral clock enable register"] |
| 11168 | #[repr(transparent)] | 14114 | #[repr(transparent)] |
| 11169 | #[derive(Copy, Clone, Eq, PartialEq)] | 14115 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 11170 | pub struct Apb2smenr(pub u32); | 14116 | pub struct Apb2enr(pub u32); |
| 11171 | impl Apb2smenr { | 14117 | impl Apb2enr { |
| 11172 | #[doc = "System configuration controller clock enable during sleep mode bit"] | 14118 | #[doc = "System configuration controller clock enable bit"] |
| 11173 | pub const fn syscfgsmen(&self) -> super::vals::Dbgsmen { | 14119 | pub const fn syscfgen(&self) -> super::vals::Dbgen { |
| 11174 | let val = (self.0 >> 0usize) & 0x01; | 14120 | let val = (self.0 >> 0usize) & 0x01; |
| 11175 | super::vals::Dbgsmen(val as u8) | 14121 | super::vals::Dbgen(val as u8) |
| 11176 | } | 14122 | } |
| 11177 | #[doc = "System configuration controller clock enable during sleep mode bit"] | 14123 | #[doc = "System configuration controller clock enable bit"] |
| 11178 | pub fn set_syscfgsmen(&mut self, val: super::vals::Dbgsmen) { | 14124 | pub fn set_syscfgen(&mut self, val: super::vals::Dbgen) { |
| 11179 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | 14125 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 11180 | } | 14126 | } |
| 11181 | #[doc = "TIM21 timer clock enable during sleep mode bit"] | 14127 | #[doc = "TIM21 timer clock enable bit"] |
| 11182 | pub const fn tim21smen(&self) -> super::vals::Dbgsmen { | 14128 | pub const fn tim21en(&self) -> super::vals::Dbgen { |
| 11183 | let val = (self.0 >> 2usize) & 0x01; | 14129 | let val = (self.0 >> 2usize) & 0x01; |
| 11184 | super::vals::Dbgsmen(val as u8) | 14130 | super::vals::Dbgen(val as u8) |
| 11185 | } | 14131 | } |
| 11186 | #[doc = "TIM21 timer clock enable during sleep mode bit"] | 14132 | #[doc = "TIM21 timer clock enable bit"] |
| 11187 | pub fn set_tim21smen(&mut self, val: super::vals::Dbgsmen) { | 14133 | pub fn set_tim21en(&mut self, val: super::vals::Dbgen) { |
| 11188 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | 14134 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); |
| 11189 | } | 14135 | } |
| 11190 | #[doc = "TIM22 timer clock enable during sleep mode bit"] | 14136 | #[doc = "TIM22 timer clock enable bit"] |
| 11191 | pub const fn tim22smen(&self) -> super::vals::Dbgsmen { | 14137 | pub const fn tim22en(&self) -> super::vals::Dbgen { |
| 11192 | let val = (self.0 >> 5usize) & 0x01; | 14138 | let val = (self.0 >> 5usize) & 0x01; |
| 11193 | super::vals::Dbgsmen(val as u8) | 14139 | super::vals::Dbgen(val as u8) |
| 11194 | } | 14140 | } |
| 11195 | #[doc = "TIM22 timer clock enable during sleep mode bit"] | 14141 | #[doc = "TIM22 timer clock enable bit"] |
| 11196 | pub fn set_tim22smen(&mut self, val: super::vals::Dbgsmen) { | 14142 | pub fn set_tim22en(&mut self, val: super::vals::Dbgen) { |
| 11197 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | 14143 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); |
| 11198 | } | 14144 | } |
| 11199 | #[doc = "ADC clock enable during sleep mode bit"] | 14145 | #[doc = "MiFaRe Firewall clock enable bit"] |
| 11200 | pub const fn adcsmen(&self) -> super::vals::Dbgsmen { | 14146 | pub const fn mifien(&self) -> super::vals::Dbgen { |
| 14147 | let val = (self.0 >> 7usize) & 0x01; | ||
| 14148 | super::vals::Dbgen(val as u8) | ||
| 14149 | } | ||
| 14150 | #[doc = "MiFaRe Firewall clock enable bit"] | ||
| 14151 | pub fn set_mifien(&mut self, val: super::vals::Dbgen) { | ||
| 14152 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 14153 | } | ||
| 14154 | #[doc = "ADC clock enable bit"] | ||
| 14155 | pub const fn adcen(&self) -> super::vals::Dbgen { | ||
| 11201 | let val = (self.0 >> 9usize) & 0x01; | 14156 | let val = (self.0 >> 9usize) & 0x01; |
| 11202 | super::vals::Dbgsmen(val as u8) | 14157 | super::vals::Dbgen(val as u8) |
| 11203 | } | 14158 | } |
| 11204 | #[doc = "ADC clock enable during sleep mode bit"] | 14159 | #[doc = "ADC clock enable bit"] |
| 11205 | pub fn set_adcsmen(&mut self, val: super::vals::Dbgsmen) { | 14160 | pub fn set_adcen(&mut self, val: super::vals::Dbgen) { |
| 11206 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | 14161 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); |
| 11207 | } | 14162 | } |
| 11208 | #[doc = "SPI1 clock enable during sleep mode bit"] | 14163 | #[doc = "SPI1 clock enable bit"] |
| 11209 | pub const fn spi1smen(&self) -> super::vals::Dbgsmen { | 14164 | pub const fn spi1en(&self) -> super::vals::Dbgen { |
| 11210 | let val = (self.0 >> 12usize) & 0x01; | 14165 | let val = (self.0 >> 12usize) & 0x01; |
| 11211 | super::vals::Dbgsmen(val as u8) | 14166 | super::vals::Dbgen(val as u8) |
| 11212 | } | 14167 | } |
| 11213 | #[doc = "SPI1 clock enable during sleep mode bit"] | 14168 | #[doc = "SPI1 clock enable bit"] |
| 11214 | pub fn set_spi1smen(&mut self, val: super::vals::Dbgsmen) { | 14169 | pub fn set_spi1en(&mut self, val: super::vals::Dbgen) { |
| 11215 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | 14170 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); |
| 11216 | } | 14171 | } |
| 11217 | #[doc = "USART1 clock enable during sleep mode bit"] | 14172 | #[doc = "USART1 clock enable bit"] |
| 11218 | pub const fn usart1smen(&self) -> super::vals::Dbgsmen { | 14173 | pub const fn usart1en(&self) -> super::vals::Dbgen { |
| 11219 | let val = (self.0 >> 14usize) & 0x01; | 14174 | let val = (self.0 >> 14usize) & 0x01; |
| 11220 | super::vals::Dbgsmen(val as u8) | 14175 | super::vals::Dbgen(val as u8) |
| 11221 | } | 14176 | } |
| 11222 | #[doc = "USART1 clock enable during sleep mode bit"] | 14177 | #[doc = "USART1 clock enable bit"] |
| 11223 | pub fn set_usart1smen(&mut self, val: super::vals::Dbgsmen) { | 14178 | pub fn set_usart1en(&mut self, val: super::vals::Dbgen) { |
| 11224 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | 14179 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); |
| 11225 | } | 14180 | } |
| 11226 | #[doc = "DBG clock enable during sleep mode bit"] | 14181 | #[doc = "DBG clock enable bit"] |
| 11227 | pub const fn dbgsmen(&self) -> super::vals::Dbgsmen { | 14182 | pub const fn dbgen(&self) -> super::vals::Dbgen { |
| 11228 | let val = (self.0 >> 22usize) & 0x01; | 14183 | let val = (self.0 >> 22usize) & 0x01; |
| 11229 | super::vals::Dbgsmen(val as u8) | 14184 | super::vals::Dbgen(val as u8) |
| 11230 | } | 14185 | } |
| 11231 | #[doc = "DBG clock enable during sleep mode bit"] | 14186 | #[doc = "DBG clock enable bit"] |
| 11232 | pub fn set_dbgsmen(&mut self, val: super::vals::Dbgsmen) { | 14187 | pub fn set_dbgen(&mut self, val: super::vals::Dbgen) { |
| 11233 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize); | 14188 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize); |
| 11234 | } | 14189 | } |
| 11235 | } | 14190 | } |
| 11236 | impl Default for Apb2smenr { | 14191 | impl Default for Apb2enr { |
| 11237 | fn default() -> Apb2smenr { | 14192 | fn default() -> Apb2enr { |
| 11238 | Apb2smenr(0) | 14193 | Apb2enr(0) |
| 11239 | } | 14194 | } |
| 11240 | } | 14195 | } |
| 11241 | #[doc = "APB2 peripheral reset register"] | 14196 | #[doc = "APB2 peripheral reset register"] |
| @@ -11312,179 +14267,289 @@ pub mod rcc_l0 { | |||
| 11312 | Apb2rstr(0) | 14267 | Apb2rstr(0) |
| 11313 | } | 14268 | } |
| 11314 | } | 14269 | } |
| 11315 | #[doc = "Clock interrupt clear register"] | 14270 | #[doc = "Clock control register"] |
| 11316 | #[repr(transparent)] | 14271 | #[repr(transparent)] |
| 11317 | #[derive(Copy, Clone, Eq, PartialEq)] | 14272 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 11318 | pub struct Cicr(pub u32); | 14273 | pub struct Cr(pub u32); |
| 11319 | impl Cicr { | 14274 | impl Cr { |
| 11320 | #[doc = "LSI ready Interrupt clear"] | 14275 | #[doc = "16 MHz high-speed internal clock enable"] |
| 11321 | pub const fn lsirdyc(&self) -> bool { | 14276 | pub const fn hsi16on(&self) -> super::vals::Pllon { |
| 11322 | let val = (self.0 >> 0usize) & 0x01; | 14277 | let val = (self.0 >> 0usize) & 0x01; |
| 11323 | val != 0 | 14278 | super::vals::Pllon(val as u8) |
| 11324 | } | 14279 | } |
| 11325 | #[doc = "LSI ready Interrupt clear"] | 14280 | #[doc = "16 MHz high-speed internal clock enable"] |
| 11326 | pub fn set_lsirdyc(&mut self, val: bool) { | 14281 | pub fn set_hsi16on(&mut self, val: super::vals::Pllon) { |
| 11327 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 14282 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 11328 | } | 14283 | } |
| 11329 | #[doc = "LSE ready Interrupt clear"] | 14284 | #[doc = "High-speed internal clock enable bit for some IP kernels"] |
| 11330 | pub const fn lserdyc(&self) -> bool { | 14285 | pub const fn hsi16keron(&self) -> super::vals::Pllon { |
| 11331 | let val = (self.0 >> 1usize) & 0x01; | 14286 | let val = (self.0 >> 1usize) & 0x01; |
| 11332 | val != 0 | 14287 | super::vals::Pllon(val as u8) |
| 11333 | } | 14288 | } |
| 11334 | #[doc = "LSE ready Interrupt clear"] | 14289 | #[doc = "High-speed internal clock enable bit for some IP kernels"] |
| 11335 | pub fn set_lserdyc(&mut self, val: bool) { | 14290 | pub fn set_hsi16keron(&mut self, val: super::vals::Pllon) { |
| 11336 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 14291 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); |
| 11337 | } | 14292 | } |
| 11338 | #[doc = "HSI16 ready Interrupt clear"] | 14293 | #[doc = "Internal high-speed clock ready flag"] |
| 11339 | pub const fn hsi16rdyc(&self) -> bool { | 14294 | pub const fn hsi16rdyf(&self) -> bool { |
| 11340 | let val = (self.0 >> 2usize) & 0x01; | 14295 | let val = (self.0 >> 2usize) & 0x01; |
| 11341 | val != 0 | 14296 | val != 0 |
| 11342 | } | 14297 | } |
| 11343 | #[doc = "HSI16 ready Interrupt clear"] | 14298 | #[doc = "Internal high-speed clock ready flag"] |
| 11344 | pub fn set_hsi16rdyc(&mut self, val: bool) { | 14299 | pub fn set_hsi16rdyf(&mut self, val: bool) { |
| 11345 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 14300 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 11346 | } | 14301 | } |
| 11347 | #[doc = "HSE ready Interrupt clear"] | 14302 | #[doc = "HSI16DIVEN"] |
| 11348 | pub const fn hserdyc(&self) -> bool { | 14303 | pub const fn hsi16diven(&self) -> super::vals::Hsidiven { |
| 11349 | let val = (self.0 >> 3usize) & 0x01; | 14304 | let val = (self.0 >> 3usize) & 0x01; |
| 11350 | val != 0 | 14305 | super::vals::Hsidiven(val as u8) |
| 11351 | } | 14306 | } |
| 11352 | #[doc = "HSE ready Interrupt clear"] | 14307 | #[doc = "HSI16DIVEN"] |
| 11353 | pub fn set_hserdyc(&mut self, val: bool) { | 14308 | pub fn set_hsi16diven(&mut self, val: super::vals::Hsidiven) { |
| 11354 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 14309 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); |
| 11355 | } | 14310 | } |
| 11356 | #[doc = "PLL ready Interrupt clear"] | 14311 | #[doc = "HSI16DIVF"] |
| 11357 | pub const fn pllrdyc(&self) -> bool { | 14312 | pub const fn hsi16divf(&self) -> bool { |
| 11358 | let val = (self.0 >> 4usize) & 0x01; | 14313 | let val = (self.0 >> 4usize) & 0x01; |
| 11359 | val != 0 | 14314 | val != 0 |
| 11360 | } | 14315 | } |
| 11361 | #[doc = "PLL ready Interrupt clear"] | 14316 | #[doc = "HSI16DIVF"] |
| 11362 | pub fn set_pllrdyc(&mut self, val: bool) { | 14317 | pub fn set_hsi16divf(&mut self, val: bool) { |
| 11363 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 14318 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 11364 | } | 14319 | } |
| 11365 | #[doc = "MSI ready Interrupt clear"] | 14320 | #[doc = "16 MHz high-speed internal clock output enable"] |
| 11366 | pub const fn msirdyc(&self) -> bool { | 14321 | pub const fn hsi16outen(&self) -> super::vals::Hsiouten { |
| 11367 | let val = (self.0 >> 5usize) & 0x01; | 14322 | let val = (self.0 >> 5usize) & 0x01; |
| 11368 | val != 0 | 14323 | super::vals::Hsiouten(val as u8) |
| 11369 | } | 14324 | } |
| 11370 | #[doc = "MSI ready Interrupt clear"] | 14325 | #[doc = "16 MHz high-speed internal clock output enable"] |
| 11371 | pub fn set_msirdyc(&mut self, val: bool) { | 14326 | pub fn set_hsi16outen(&mut self, val: super::vals::Hsiouten) { |
| 11372 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 14327 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); |
| 11373 | } | 14328 | } |
| 11374 | #[doc = "HSI48 ready Interrupt clear"] | 14329 | #[doc = "MSI clock enable bit"] |
| 11375 | pub const fn hsi48rdyc(&self) -> bool { | 14330 | pub const fn msion(&self) -> super::vals::Pllon { |
| 11376 | let val = (self.0 >> 6usize) & 0x01; | 14331 | let val = (self.0 >> 8usize) & 0x01; |
| 14332 | super::vals::Pllon(val as u8) | ||
| 14333 | } | ||
| 14334 | #[doc = "MSI clock enable bit"] | ||
| 14335 | pub fn set_msion(&mut self, val: super::vals::Pllon) { | ||
| 14336 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); | ||
| 14337 | } | ||
| 14338 | #[doc = "MSI clock ready flag"] | ||
| 14339 | pub const fn msirdy(&self) -> bool { | ||
| 14340 | let val = (self.0 >> 9usize) & 0x01; | ||
| 11377 | val != 0 | 14341 | val != 0 |
| 11378 | } | 14342 | } |
| 11379 | #[doc = "HSI48 ready Interrupt clear"] | 14343 | #[doc = "MSI clock ready flag"] |
| 11380 | pub fn set_hsi48rdyc(&mut self, val: bool) { | 14344 | pub fn set_msirdy(&mut self, val: bool) { |
| 11381 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 14345 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); |
| 11382 | } | 14346 | } |
| 11383 | #[doc = "LSE Clock Security System Interrupt clear"] | 14347 | #[doc = "HSE clock enable bit"] |
| 11384 | pub const fn csslsec(&self) -> bool { | 14348 | pub const fn hseon(&self) -> super::vals::Pllon { |
| 11385 | let val = (self.0 >> 7usize) & 0x01; | 14349 | let val = (self.0 >> 16usize) & 0x01; |
| 14350 | super::vals::Pllon(val as u8) | ||
| 14351 | } | ||
| 14352 | #[doc = "HSE clock enable bit"] | ||
| 14353 | pub fn set_hseon(&mut self, val: super::vals::Pllon) { | ||
| 14354 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 14355 | } | ||
| 14356 | #[doc = "HSE clock ready flag"] | ||
| 14357 | pub const fn hserdy(&self) -> bool { | ||
| 14358 | let val = (self.0 >> 17usize) & 0x01; | ||
| 11386 | val != 0 | 14359 | val != 0 |
| 11387 | } | 14360 | } |
| 11388 | #[doc = "LSE Clock Security System Interrupt clear"] | 14361 | #[doc = "HSE clock ready flag"] |
| 11389 | pub fn set_csslsec(&mut self, val: bool) { | 14362 | pub fn set_hserdy(&mut self, val: bool) { |
| 11390 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 14363 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); |
| 11391 | } | 14364 | } |
| 11392 | #[doc = "Clock Security System Interrupt clear"] | 14365 | #[doc = "HSE clock bypass bit"] |
| 11393 | pub const fn csshsec(&self) -> bool { | 14366 | pub const fn hsebyp(&self) -> super::vals::Hsebyp { |
| 11394 | let val = (self.0 >> 8usize) & 0x01; | 14367 | let val = (self.0 >> 18usize) & 0x01; |
| 14368 | super::vals::Hsebyp(val as u8) | ||
| 14369 | } | ||
| 14370 | #[doc = "HSE clock bypass bit"] | ||
| 14371 | pub fn set_hsebyp(&mut self, val: super::vals::Hsebyp) { | ||
| 14372 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize); | ||
| 14373 | } | ||
| 14374 | #[doc = "Clock security system on HSE enable bit"] | ||
| 14375 | pub const fn csshseon(&self) -> super::vals::Pllon { | ||
| 14376 | let val = (self.0 >> 19usize) & 0x01; | ||
| 14377 | super::vals::Pllon(val as u8) | ||
| 14378 | } | ||
| 14379 | #[doc = "Clock security system on HSE enable bit"] | ||
| 14380 | pub fn set_csshseon(&mut self, val: super::vals::Pllon) { | ||
| 14381 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); | ||
| 14382 | } | ||
| 14383 | #[doc = "TC/LCD prescaler"] | ||
| 14384 | pub const fn rtcpre(&self) -> super::vals::Rtcpre { | ||
| 14385 | let val = (self.0 >> 20usize) & 0x03; | ||
| 14386 | super::vals::Rtcpre(val as u8) | ||
| 14387 | } | ||
| 14388 | #[doc = "TC/LCD prescaler"] | ||
| 14389 | pub fn set_rtcpre(&mut self, val: super::vals::Rtcpre) { | ||
| 14390 | self.0 = (self.0 & !(0x03 << 20usize)) | (((val.0 as u32) & 0x03) << 20usize); | ||
| 14391 | } | ||
| 14392 | #[doc = "PLL enable bit"] | ||
| 14393 | pub const fn pllon(&self) -> super::vals::Pllon { | ||
| 14394 | let val = (self.0 >> 24usize) & 0x01; | ||
| 14395 | super::vals::Pllon(val as u8) | ||
| 14396 | } | ||
| 14397 | #[doc = "PLL enable bit"] | ||
| 14398 | pub fn set_pllon(&mut self, val: super::vals::Pllon) { | ||
| 14399 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); | ||
| 14400 | } | ||
| 14401 | #[doc = "PLL clock ready flag"] | ||
| 14402 | pub const fn pllrdy(&self) -> bool { | ||
| 14403 | let val = (self.0 >> 25usize) & 0x01; | ||
| 11395 | val != 0 | 14404 | val != 0 |
| 11396 | } | 14405 | } |
| 11397 | #[doc = "Clock Security System Interrupt clear"] | 14406 | #[doc = "PLL clock ready flag"] |
| 11398 | pub fn set_csshsec(&mut self, val: bool) { | 14407 | pub fn set_pllrdy(&mut self, val: bool) { |
| 11399 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 14408 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize); |
| 11400 | } | 14409 | } |
| 11401 | } | 14410 | } |
| 11402 | impl Default for Cicr { | 14411 | impl Default for Cr { |
| 11403 | fn default() -> Cicr { | 14412 | fn default() -> Cr { |
| 11404 | Cicr(0) | 14413 | Cr(0) |
| 11405 | } | 14414 | } |
| 11406 | } | 14415 | } |
| 11407 | #[doc = "APB2 peripheral clock enable register"] | 14416 | #[doc = "Clock configuration register"] |
| 11408 | #[repr(transparent)] | 14417 | #[repr(transparent)] |
| 11409 | #[derive(Copy, Clone, Eq, PartialEq)] | 14418 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 11410 | pub struct Apb2enr(pub u32); | 14419 | pub struct Ccipr(pub u32); |
| 11411 | impl Apb2enr { | 14420 | impl Ccipr { |
| 11412 | #[doc = "System configuration controller clock enable bit"] | 14421 | #[doc = "USART1 clock source selection bits"] |
| 11413 | pub const fn syscfgen(&self) -> super::vals::Dbgen { | 14422 | pub const fn usart1sel(&self) -> super::vals::Lpuartsel { |
| 11414 | let val = (self.0 >> 0usize) & 0x01; | 14423 | let val = (self.0 >> 0usize) & 0x03; |
| 11415 | super::vals::Dbgen(val as u8) | 14424 | super::vals::Lpuartsel(val as u8) |
| 11416 | } | 14425 | } |
| 11417 | #[doc = "System configuration controller clock enable bit"] | 14426 | #[doc = "USART1 clock source selection bits"] |
| 11418 | pub fn set_syscfgen(&mut self, val: super::vals::Dbgen) { | 14427 | pub fn set_usart1sel(&mut self, val: super::vals::Lpuartsel) { |
| 11419 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | 14428 | self.0 = (self.0 & !(0x03 << 0usize)) | (((val.0 as u32) & 0x03) << 0usize); |
| 11420 | } | 14429 | } |
| 11421 | #[doc = "TIM21 timer clock enable bit"] | 14430 | #[doc = "USART2 clock source selection bits"] |
| 11422 | pub const fn tim21en(&self) -> super::vals::Dbgen { | 14431 | pub const fn usart2sel(&self) -> super::vals::Lpuartsel { |
| 11423 | let val = (self.0 >> 2usize) & 0x01; | 14432 | let val = (self.0 >> 2usize) & 0x03; |
| 11424 | super::vals::Dbgen(val as u8) | 14433 | super::vals::Lpuartsel(val as u8) |
| 11425 | } | 14434 | } |
| 11426 | #[doc = "TIM21 timer clock enable bit"] | 14435 | #[doc = "USART2 clock source selection bits"] |
| 11427 | pub fn set_tim21en(&mut self, val: super::vals::Dbgen) { | 14436 | pub fn set_usart2sel(&mut self, val: super::vals::Lpuartsel) { |
| 11428 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | 14437 | self.0 = (self.0 & !(0x03 << 2usize)) | (((val.0 as u32) & 0x03) << 2usize); |
| 11429 | } | 14438 | } |
| 11430 | #[doc = "TIM22 timer clock enable bit"] | 14439 | #[doc = "LPUART1 clock source selection bits"] |
| 11431 | pub const fn tim22en(&self) -> super::vals::Dbgen { | 14440 | pub const fn lpuart1sel(&self) -> super::vals::Lpuartsel { |
| 11432 | let val = (self.0 >> 5usize) & 0x01; | 14441 | let val = (self.0 >> 10usize) & 0x03; |
| 11433 | super::vals::Dbgen(val as u8) | 14442 | super::vals::Lpuartsel(val as u8) |
| 11434 | } | 14443 | } |
| 11435 | #[doc = "TIM22 timer clock enable bit"] | 14444 | #[doc = "LPUART1 clock source selection bits"] |
| 11436 | pub fn set_tim22en(&mut self, val: super::vals::Dbgen) { | 14445 | pub fn set_lpuart1sel(&mut self, val: super::vals::Lpuartsel) { |
| 11437 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | 14446 | self.0 = (self.0 & !(0x03 << 10usize)) | (((val.0 as u32) & 0x03) << 10usize); |
| 11438 | } | 14447 | } |
| 11439 | #[doc = "MiFaRe Firewall clock enable bit"] | 14448 | #[doc = "I2C1 clock source selection bits"] |
| 11440 | pub const fn mifien(&self) -> super::vals::Dbgen { | 14449 | pub const fn i2c1sel(&self) -> super::vals::Icsel { |
| 11441 | let val = (self.0 >> 7usize) & 0x01; | 14450 | let val = (self.0 >> 12usize) & 0x03; |
| 11442 | super::vals::Dbgen(val as u8) | 14451 | super::vals::Icsel(val as u8) |
| 11443 | } | 14452 | } |
| 11444 | #[doc = "MiFaRe Firewall clock enable bit"] | 14453 | #[doc = "I2C1 clock source selection bits"] |
| 11445 | pub fn set_mifien(&mut self, val: super::vals::Dbgen) { | 14454 | pub fn set_i2c1sel(&mut self, val: super::vals::Icsel) { |
| 11446 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | 14455 | self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize); |
| 11447 | } | 14456 | } |
| 11448 | #[doc = "ADC clock enable bit"] | 14457 | #[doc = "I2C3 clock source selection bits"] |
| 11449 | pub const fn adcen(&self) -> super::vals::Dbgen { | 14458 | pub const fn i2c3sel(&self) -> super::vals::Icsel { |
| 11450 | let val = (self.0 >> 9usize) & 0x01; | 14459 | let val = (self.0 >> 16usize) & 0x03; |
| 11451 | super::vals::Dbgen(val as u8) | 14460 | super::vals::Icsel(val as u8) |
| 11452 | } | 14461 | } |
| 11453 | #[doc = "ADC clock enable bit"] | 14462 | #[doc = "I2C3 clock source selection bits"] |
| 11454 | pub fn set_adcen(&mut self, val: super::vals::Dbgen) { | 14463 | pub fn set_i2c3sel(&mut self, val: super::vals::Icsel) { |
| 11455 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | 14464 | self.0 = (self.0 & !(0x03 << 16usize)) | (((val.0 as u32) & 0x03) << 16usize); |
| 11456 | } | 14465 | } |
| 11457 | #[doc = "SPI1 clock enable bit"] | 14466 | #[doc = "Low Power Timer clock source selection bits"] |
| 11458 | pub const fn spi1en(&self) -> super::vals::Dbgen { | 14467 | pub const fn lptim1sel(&self) -> super::vals::Lptimsel { |
| 11459 | let val = (self.0 >> 12usize) & 0x01; | 14468 | let val = (self.0 >> 18usize) & 0x03; |
| 11460 | super::vals::Dbgen(val as u8) | 14469 | super::vals::Lptimsel(val as u8) |
| 11461 | } | 14470 | } |
| 11462 | #[doc = "SPI1 clock enable bit"] | 14471 | #[doc = "Low Power Timer clock source selection bits"] |
| 11463 | pub fn set_spi1en(&mut self, val: super::vals::Dbgen) { | 14472 | pub fn set_lptim1sel(&mut self, val: super::vals::Lptimsel) { |
| 11464 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | 14473 | self.0 = (self.0 & !(0x03 << 18usize)) | (((val.0 as u32) & 0x03) << 18usize); |
| 11465 | } | 14474 | } |
| 11466 | #[doc = "USART1 clock enable bit"] | 14475 | #[doc = "48 MHz HSI48 clock source selection bit"] |
| 11467 | pub const fn usart1en(&self) -> super::vals::Dbgen { | 14476 | pub const fn hsi48msel(&self) -> bool { |
| 11468 | let val = (self.0 >> 14usize) & 0x01; | 14477 | let val = (self.0 >> 26usize) & 0x01; |
| 11469 | super::vals::Dbgen(val as u8) | 14478 | val != 0 |
| 11470 | } | 14479 | } |
| 11471 | #[doc = "USART1 clock enable bit"] | 14480 | #[doc = "48 MHz HSI48 clock source selection bit"] |
| 11472 | pub fn set_usart1en(&mut self, val: super::vals::Dbgen) { | 14481 | pub fn set_hsi48msel(&mut self, val: bool) { |
| 11473 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | 14482 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); |
| 11474 | } | 14483 | } |
| 11475 | #[doc = "DBG clock enable bit"] | 14484 | } |
| 11476 | pub const fn dbgen(&self) -> super::vals::Dbgen { | 14485 | impl Default for Ccipr { |
| 11477 | let val = (self.0 >> 22usize) & 0x01; | 14486 | fn default() -> Ccipr { |
| 11478 | super::vals::Dbgen(val as u8) | 14487 | Ccipr(0) |
| 11479 | } | 14488 | } |
| 11480 | #[doc = "DBG clock enable bit"] | 14489 | } |
| 11481 | pub fn set_dbgen(&mut self, val: super::vals::Dbgen) { | 14490 | #[doc = "GPIO reset register"] |
| 11482 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize); | 14491 | #[repr(transparent)] |
| 14492 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 14493 | pub struct Ioprstr(pub u32); | ||
| 14494 | impl Ioprstr { | ||
| 14495 | #[doc = "I/O port A reset"] | ||
| 14496 | pub const fn ioparst(&self) -> super::vals::Iophrst { | ||
| 14497 | let val = (self.0 >> 0usize) & 0x01; | ||
| 14498 | super::vals::Iophrst(val as u8) | ||
| 14499 | } | ||
| 14500 | #[doc = "I/O port A reset"] | ||
| 14501 | pub fn set_ioparst(&mut self, val: super::vals::Iophrst) { | ||
| 14502 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 14503 | } | ||
| 14504 | #[doc = "I/O port B reset"] | ||
| 14505 | pub const fn iopbrst(&self) -> super::vals::Iophrst { | ||
| 14506 | let val = (self.0 >> 1usize) & 0x01; | ||
| 14507 | super::vals::Iophrst(val as u8) | ||
| 14508 | } | ||
| 14509 | #[doc = "I/O port B reset"] | ||
| 14510 | pub fn set_iopbrst(&mut self, val: super::vals::Iophrst) { | ||
| 14511 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 14512 | } | ||
| 14513 | #[doc = "I/O port A reset"] | ||
| 14514 | pub const fn iopcrst(&self) -> super::vals::Iophrst { | ||
| 14515 | let val = (self.0 >> 2usize) & 0x01; | ||
| 14516 | super::vals::Iophrst(val as u8) | ||
| 14517 | } | ||
| 14518 | #[doc = "I/O port A reset"] | ||
| 14519 | pub fn set_iopcrst(&mut self, val: super::vals::Iophrst) { | ||
| 14520 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 14521 | } | ||
| 14522 | #[doc = "I/O port D reset"] | ||
| 14523 | pub const fn iopdrst(&self) -> super::vals::Iophrst { | ||
| 14524 | let val = (self.0 >> 3usize) & 0x01; | ||
| 14525 | super::vals::Iophrst(val as u8) | ||
| 14526 | } | ||
| 14527 | #[doc = "I/O port D reset"] | ||
| 14528 | pub fn set_iopdrst(&mut self, val: super::vals::Iophrst) { | ||
| 14529 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 14530 | } | ||
| 14531 | #[doc = "I/O port E reset"] | ||
| 14532 | pub const fn ioperst(&self) -> super::vals::Iophrst { | ||
| 14533 | let val = (self.0 >> 4usize) & 0x01; | ||
| 14534 | super::vals::Iophrst(val as u8) | ||
| 14535 | } | ||
| 14536 | #[doc = "I/O port E reset"] | ||
| 14537 | pub fn set_ioperst(&mut self, val: super::vals::Iophrst) { | ||
| 14538 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 14539 | } | ||
| 14540 | #[doc = "I/O port H reset"] | ||
| 14541 | pub const fn iophrst(&self) -> super::vals::Iophrst { | ||
| 14542 | let val = (self.0 >> 7usize) & 0x01; | ||
| 14543 | super::vals::Iophrst(val as u8) | ||
| 14544 | } | ||
| 14545 | #[doc = "I/O port H reset"] | ||
| 14546 | pub fn set_iophrst(&mut self, val: super::vals::Iophrst) { | ||
| 14547 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 11483 | } | 14548 | } |
| 11484 | } | 14549 | } |
| 11485 | impl Default for Apb2enr { | 14550 | impl Default for Ioprstr { |
| 11486 | fn default() -> Apb2enr { | 14551 | fn default() -> Ioprstr { |
| 11487 | Apb2enr(0) | 14552 | Ioprstr(0) |
| 11488 | } | 14553 | } |
| 11489 | } | 14554 | } |
| 11490 | #[doc = "APB1 peripheral clock enable in sleep mode register"] | 14555 | #[doc = "APB1 peripheral clock enable in sleep mode register"] |
| @@ -11660,69 +14725,143 @@ pub mod rcc_l0 { | |||
| 11660 | Apb1smenr(0) | 14725 | Apb1smenr(0) |
| 11661 | } | 14726 | } |
| 11662 | } | 14727 | } |
| 11663 | #[doc = "GPIO clock enable register"] | 14728 | #[doc = "Clock recovery RC register"] |
| 11664 | #[repr(transparent)] | 14729 | #[repr(transparent)] |
| 11665 | #[derive(Copy, Clone, Eq, PartialEq)] | 14730 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 11666 | pub struct Iopenr(pub u32); | 14731 | pub struct Crrcr(pub u32); |
| 11667 | impl Iopenr { | 14732 | impl Crrcr { |
| 11668 | #[doc = "IO port A clock enable bit"] | 14733 | #[doc = "48MHz HSI clock enable bit"] |
| 11669 | pub const fn iopaen(&self) -> super::vals::Iophen { | 14734 | pub const fn hsi48on(&self) -> bool { |
| 11670 | let val = (self.0 >> 0usize) & 0x01; | 14735 | let val = (self.0 >> 0usize) & 0x01; |
| 11671 | super::vals::Iophen(val as u8) | 14736 | val != 0 |
| 11672 | } | 14737 | } |
| 11673 | #[doc = "IO port A clock enable bit"] | 14738 | #[doc = "48MHz HSI clock enable bit"] |
| 11674 | pub fn set_iopaen(&mut self, val: super::vals::Iophen) { | 14739 | pub fn set_hsi48on(&mut self, val: bool) { |
| 11675 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | 14740 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 11676 | } | 14741 | } |
| 11677 | #[doc = "IO port B clock enable bit"] | 14742 | #[doc = "48MHz HSI clock ready flag"] |
| 11678 | pub const fn iopben(&self) -> super::vals::Iophen { | 14743 | pub const fn hsi48rdy(&self) -> bool { |
| 11679 | let val = (self.0 >> 1usize) & 0x01; | 14744 | let val = (self.0 >> 1usize) & 0x01; |
| 11680 | super::vals::Iophen(val as u8) | 14745 | val != 0 |
| 11681 | } | 14746 | } |
| 11682 | #[doc = "IO port B clock enable bit"] | 14747 | #[doc = "48MHz HSI clock ready flag"] |
| 11683 | pub fn set_iopben(&mut self, val: super::vals::Iophen) { | 14748 | pub fn set_hsi48rdy(&mut self, val: bool) { |
| 11684 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | 14749 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 11685 | } | 14750 | } |
| 11686 | #[doc = "IO port A clock enable bit"] | 14751 | #[doc = "48 MHz HSI clock divided by 6 output enable"] |
| 11687 | pub const fn iopcen(&self) -> super::vals::Iophen { | 14752 | pub const fn hsi48div6en(&self) -> bool { |
| 11688 | let val = (self.0 >> 2usize) & 0x01; | 14753 | let val = (self.0 >> 2usize) & 0x01; |
| 11689 | super::vals::Iophen(val as u8) | 14754 | val != 0 |
| 11690 | } | 14755 | } |
| 11691 | #[doc = "IO port A clock enable bit"] | 14756 | #[doc = "48 MHz HSI clock divided by 6 output enable"] |
| 11692 | pub fn set_iopcen(&mut self, val: super::vals::Iophen) { | 14757 | pub fn set_hsi48div6en(&mut self, val: bool) { |
| 11693 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | 14758 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 11694 | } | 14759 | } |
| 11695 | #[doc = "I/O port D clock enable bit"] | 14760 | #[doc = "48 MHz HSI clock calibration"] |
| 11696 | pub const fn iopden(&self) -> super::vals::Iophen { | 14761 | pub const fn hsi48cal(&self) -> u8 { |
| 14762 | let val = (self.0 >> 8usize) & 0xff; | ||
| 14763 | val as u8 | ||
| 14764 | } | ||
| 14765 | #[doc = "48 MHz HSI clock calibration"] | ||
| 14766 | pub fn set_hsi48cal(&mut self, val: u8) { | ||
| 14767 | self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize); | ||
| 14768 | } | ||
| 14769 | } | ||
| 14770 | impl Default for Crrcr { | ||
| 14771 | fn default() -> Crrcr { | ||
| 14772 | Crrcr(0) | ||
| 14773 | } | ||
| 14774 | } | ||
| 14775 | #[doc = "Clock interrupt flag register"] | ||
| 14776 | #[repr(transparent)] | ||
| 14777 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 14778 | pub struct Cifr(pub u32); | ||
| 14779 | impl Cifr { | ||
| 14780 | #[doc = "LSI ready interrupt flag"] | ||
| 14781 | pub const fn lsirdyf(&self) -> bool { | ||
| 14782 | let val = (self.0 >> 0usize) & 0x01; | ||
| 14783 | val != 0 | ||
| 14784 | } | ||
| 14785 | #[doc = "LSI ready interrupt flag"] | ||
| 14786 | pub fn set_lsirdyf(&mut self, val: bool) { | ||
| 14787 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 14788 | } | ||
| 14789 | #[doc = "LSE ready interrupt flag"] | ||
| 14790 | pub const fn lserdyf(&self) -> bool { | ||
| 14791 | let val = (self.0 >> 1usize) & 0x01; | ||
| 14792 | val != 0 | ||
| 14793 | } | ||
| 14794 | #[doc = "LSE ready interrupt flag"] | ||
| 14795 | pub fn set_lserdyf(&mut self, val: bool) { | ||
| 14796 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | ||
| 14797 | } | ||
| 14798 | #[doc = "HSI16 ready interrupt flag"] | ||
| 14799 | pub const fn hsi16rdyf(&self) -> bool { | ||
| 14800 | let val = (self.0 >> 2usize) & 0x01; | ||
| 14801 | val != 0 | ||
| 14802 | } | ||
| 14803 | #[doc = "HSI16 ready interrupt flag"] | ||
| 14804 | pub fn set_hsi16rdyf(&mut self, val: bool) { | ||
| 14805 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 14806 | } | ||
| 14807 | #[doc = "HSE ready interrupt flag"] | ||
| 14808 | pub const fn hserdyf(&self) -> bool { | ||
| 11697 | let val = (self.0 >> 3usize) & 0x01; | 14809 | let val = (self.0 >> 3usize) & 0x01; |
| 11698 | super::vals::Iophen(val as u8) | 14810 | val != 0 |
| 11699 | } | 14811 | } |
| 11700 | #[doc = "I/O port D clock enable bit"] | 14812 | #[doc = "HSE ready interrupt flag"] |
| 11701 | pub fn set_iopden(&mut self, val: super::vals::Iophen) { | 14813 | pub fn set_hserdyf(&mut self, val: bool) { |
| 11702 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | 14814 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); |
| 11703 | } | 14815 | } |
| 11704 | #[doc = "I/O port E clock enable bit"] | 14816 | #[doc = "PLL ready interrupt flag"] |
| 11705 | pub const fn iopeen(&self) -> super::vals::Iophen { | 14817 | pub const fn pllrdyf(&self) -> bool { |
| 11706 | let val = (self.0 >> 4usize) & 0x01; | 14818 | let val = (self.0 >> 4usize) & 0x01; |
| 11707 | super::vals::Iophen(val as u8) | 14819 | val != 0 |
| 11708 | } | 14820 | } |
| 11709 | #[doc = "I/O port E clock enable bit"] | 14821 | #[doc = "PLL ready interrupt flag"] |
| 11710 | pub fn set_iopeen(&mut self, val: super::vals::Iophen) { | 14822 | pub fn set_pllrdyf(&mut self, val: bool) { |
| 11711 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | 14823 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 11712 | } | 14824 | } |
| 11713 | #[doc = "I/O port H clock enable bit"] | 14825 | #[doc = "MSI ready interrupt flag"] |
| 11714 | pub const fn iophen(&self) -> super::vals::Iophen { | 14826 | pub const fn msirdyf(&self) -> bool { |
| 14827 | let val = (self.0 >> 5usize) & 0x01; | ||
| 14828 | val != 0 | ||
| 14829 | } | ||
| 14830 | #[doc = "MSI ready interrupt flag"] | ||
| 14831 | pub fn set_msirdyf(&mut self, val: bool) { | ||
| 14832 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 14833 | } | ||
| 14834 | #[doc = "HSI48 ready interrupt flag"] | ||
| 14835 | pub const fn hsi48rdyf(&self) -> bool { | ||
| 14836 | let val = (self.0 >> 6usize) & 0x01; | ||
| 14837 | val != 0 | ||
| 14838 | } | ||
| 14839 | #[doc = "HSI48 ready interrupt flag"] | ||
| 14840 | pub fn set_hsi48rdyf(&mut self, val: bool) { | ||
| 14841 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 14842 | } | ||
| 14843 | #[doc = "LSE Clock Security System Interrupt flag"] | ||
| 14844 | pub const fn csslsef(&self) -> super::vals::Csslsef { | ||
| 11715 | let val = (self.0 >> 7usize) & 0x01; | 14845 | let val = (self.0 >> 7usize) & 0x01; |
| 11716 | super::vals::Iophen(val as u8) | 14846 | super::vals::Csslsef(val as u8) |
| 11717 | } | 14847 | } |
| 11718 | #[doc = "I/O port H clock enable bit"] | 14848 | #[doc = "LSE Clock Security System Interrupt flag"] |
| 11719 | pub fn set_iophen(&mut self, val: super::vals::Iophen) { | 14849 | pub fn set_csslsef(&mut self, val: super::vals::Csslsef) { |
| 11720 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | 14850 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); |
| 11721 | } | 14851 | } |
| 14852 | #[doc = "Clock Security System Interrupt flag"] | ||
| 14853 | pub const fn csshsef(&self) -> super::vals::Csshsef { | ||
| 14854 | let val = (self.0 >> 8usize) & 0x01; | ||
| 14855 | super::vals::Csshsef(val as u8) | ||
| 14856 | } | ||
| 14857 | #[doc = "Clock Security System Interrupt flag"] | ||
| 14858 | pub fn set_csshsef(&mut self, val: super::vals::Csshsef) { | ||
| 14859 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); | ||
| 14860 | } | ||
| 11722 | } | 14861 | } |
| 11723 | impl Default for Iopenr { | 14862 | impl Default for Cifr { |
| 11724 | fn default() -> Iopenr { | 14863 | fn default() -> Cifr { |
| 11725 | Iopenr(0) | 14864 | Cifr(0) |
| 11726 | } | 14865 | } |
| 11727 | } | 14866 | } |
| 11728 | #[doc = "APB1 peripheral reset register"] | 14867 | #[doc = "APB1 peripheral reset register"] |
| @@ -11898,434 +15037,1922 @@ pub mod rcc_l0 { | |||
| 11898 | Apb1rstr(0) | 15037 | Apb1rstr(0) |
| 11899 | } | 15038 | } |
| 11900 | } | 15039 | } |
| 11901 | #[doc = "GPIO reset register"] | 15040 | #[doc = "GPIO clock enable in sleep mode register"] |
| 11902 | #[repr(transparent)] | 15041 | #[repr(transparent)] |
| 11903 | #[derive(Copy, Clone, Eq, PartialEq)] | 15042 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 11904 | pub struct Ioprstr(pub u32); | 15043 | pub struct Iopsmen(pub u32); |
| 11905 | impl Ioprstr { | 15044 | impl Iopsmen { |
| 11906 | #[doc = "I/O port A reset"] | 15045 | #[doc = "IOPASMEN"] |
| 11907 | pub const fn ioparst(&self) -> super::vals::Iophrst { | 15046 | pub const fn iopasmen(&self) -> super::vals::Iophsmen { |
| 11908 | let val = (self.0 >> 0usize) & 0x01; | 15047 | let val = (self.0 >> 0usize) & 0x01; |
| 11909 | super::vals::Iophrst(val as u8) | 15048 | super::vals::Iophsmen(val as u8) |
| 11910 | } | 15049 | } |
| 11911 | #[doc = "I/O port A reset"] | 15050 | #[doc = "IOPASMEN"] |
| 11912 | pub fn set_ioparst(&mut self, val: super::vals::Iophrst) { | 15051 | pub fn set_iopasmen(&mut self, val: super::vals::Iophsmen) { |
| 11913 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | 15052 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 11914 | } | 15053 | } |
| 11915 | #[doc = "I/O port B reset"] | 15054 | #[doc = "IOPBSMEN"] |
| 11916 | pub const fn iopbrst(&self) -> super::vals::Iophrst { | 15055 | pub const fn iopbsmen(&self) -> super::vals::Iophsmen { |
| 11917 | let val = (self.0 >> 1usize) & 0x01; | 15056 | let val = (self.0 >> 1usize) & 0x01; |
| 11918 | super::vals::Iophrst(val as u8) | 15057 | super::vals::Iophsmen(val as u8) |
| 11919 | } | 15058 | } |
| 11920 | #[doc = "I/O port B reset"] | 15059 | #[doc = "IOPBSMEN"] |
| 11921 | pub fn set_iopbrst(&mut self, val: super::vals::Iophrst) { | 15060 | pub fn set_iopbsmen(&mut self, val: super::vals::Iophsmen) { |
| 11922 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | 15061 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); |
| 11923 | } | 15062 | } |
| 11924 | #[doc = "I/O port A reset"] | 15063 | #[doc = "IOPCSMEN"] |
| 11925 | pub const fn iopcrst(&self) -> super::vals::Iophrst { | 15064 | pub const fn iopcsmen(&self) -> super::vals::Iophsmen { |
| 11926 | let val = (self.0 >> 2usize) & 0x01; | 15065 | let val = (self.0 >> 2usize) & 0x01; |
| 11927 | super::vals::Iophrst(val as u8) | 15066 | super::vals::Iophsmen(val as u8) |
| 11928 | } | 15067 | } |
| 11929 | #[doc = "I/O port A reset"] | 15068 | #[doc = "IOPCSMEN"] |
| 11930 | pub fn set_iopcrst(&mut self, val: super::vals::Iophrst) { | 15069 | pub fn set_iopcsmen(&mut self, val: super::vals::Iophsmen) { |
| 11931 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | 15070 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); |
| 11932 | } | 15071 | } |
| 11933 | #[doc = "I/O port D reset"] | 15072 | #[doc = "IOPDSMEN"] |
| 11934 | pub const fn iopdrst(&self) -> super::vals::Iophrst { | 15073 | pub const fn iopdsmen(&self) -> super::vals::Iophsmen { |
| 11935 | let val = (self.0 >> 3usize) & 0x01; | 15074 | let val = (self.0 >> 3usize) & 0x01; |
| 11936 | super::vals::Iophrst(val as u8) | 15075 | super::vals::Iophsmen(val as u8) |
| 11937 | } | 15076 | } |
| 11938 | #[doc = "I/O port D reset"] | 15077 | #[doc = "IOPDSMEN"] |
| 11939 | pub fn set_iopdrst(&mut self, val: super::vals::Iophrst) { | 15078 | pub fn set_iopdsmen(&mut self, val: super::vals::Iophsmen) { |
| 11940 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | 15079 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); |
| 11941 | } | 15080 | } |
| 11942 | #[doc = "I/O port E reset"] | 15081 | #[doc = "Port E clock enable during Sleep mode bit"] |
| 11943 | pub const fn ioperst(&self) -> super::vals::Iophrst { | 15082 | pub const fn iopesmen(&self) -> super::vals::Iophsmen { |
| 11944 | let val = (self.0 >> 4usize) & 0x01; | 15083 | let val = (self.0 >> 4usize) & 0x01; |
| 11945 | super::vals::Iophrst(val as u8) | 15084 | super::vals::Iophsmen(val as u8) |
| 11946 | } | 15085 | } |
| 11947 | #[doc = "I/O port E reset"] | 15086 | #[doc = "Port E clock enable during Sleep mode bit"] |
| 11948 | pub fn set_ioperst(&mut self, val: super::vals::Iophrst) { | 15087 | pub fn set_iopesmen(&mut self, val: super::vals::Iophsmen) { |
| 11949 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | 15088 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); |
| 11950 | } | 15089 | } |
| 11951 | #[doc = "I/O port H reset"] | 15090 | #[doc = "IOPHSMEN"] |
| 11952 | pub const fn iophrst(&self) -> super::vals::Iophrst { | 15091 | pub const fn iophsmen(&self) -> super::vals::Iophsmen { |
| 11953 | let val = (self.0 >> 7usize) & 0x01; | 15092 | let val = (self.0 >> 7usize) & 0x01; |
| 11954 | super::vals::Iophrst(val as u8) | 15093 | super::vals::Iophsmen(val as u8) |
| 11955 | } | 15094 | } |
| 11956 | #[doc = "I/O port H reset"] | 15095 | #[doc = "IOPHSMEN"] |
| 11957 | pub fn set_iophrst(&mut self, val: super::vals::Iophrst) { | 15096 | pub fn set_iophsmen(&mut self, val: super::vals::Iophsmen) { |
| 11958 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | 15097 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); |
| 11959 | } | 15098 | } |
| 11960 | } | 15099 | } |
| 11961 | impl Default for Ioprstr { | 15100 | impl Default for Iopsmen { |
| 11962 | fn default() -> Ioprstr { | 15101 | fn default() -> Iopsmen { |
| 11963 | Ioprstr(0) | 15102 | Iopsmen(0) |
| 11964 | } | 15103 | } |
| 11965 | } | 15104 | } |
| 11966 | #[doc = "Clock interrupt enable register"] | 15105 | #[doc = "AHB peripheral reset register"] |
| 11967 | #[repr(transparent)] | 15106 | #[repr(transparent)] |
| 11968 | #[derive(Copy, Clone, Eq, PartialEq)] | 15107 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 11969 | pub struct Cier(pub u32); | 15108 | pub struct Ahbrstr(pub u32); |
| 11970 | impl Cier { | 15109 | impl Ahbrstr { |
| 11971 | #[doc = "LSI ready interrupt flag"] | 15110 | #[doc = "DMA reset"] |
| 11972 | pub const fn lsirdyie(&self) -> super::vals::Hsirdyie { | 15111 | pub const fn dmarst(&self) -> bool { |
| 11973 | let val = (self.0 >> 0usize) & 0x01; | 15112 | let val = (self.0 >> 0usize) & 0x01; |
| 11974 | super::vals::Hsirdyie(val as u8) | 15113 | val != 0 |
| 11975 | } | 15114 | } |
| 11976 | #[doc = "LSI ready interrupt flag"] | 15115 | #[doc = "DMA reset"] |
| 11977 | pub fn set_lsirdyie(&mut self, val: super::vals::Hsirdyie) { | 15116 | pub fn set_dmarst(&mut self, val: bool) { |
| 11978 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | 15117 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 11979 | } | 15118 | } |
| 11980 | #[doc = "LSE ready interrupt flag"] | 15119 | #[doc = "Memory interface reset"] |
| 11981 | pub const fn lserdyie(&self) -> super::vals::Hsirdyie { | 15120 | pub const fn mifrst(&self) -> bool { |
| 15121 | let val = (self.0 >> 8usize) & 0x01; | ||
| 15122 | val != 0 | ||
| 15123 | } | ||
| 15124 | #[doc = "Memory interface reset"] | ||
| 15125 | pub fn set_mifrst(&mut self, val: bool) { | ||
| 15126 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 15127 | } | ||
| 15128 | #[doc = "Test integration module reset"] | ||
| 15129 | pub const fn crcrst(&self) -> bool { | ||
| 15130 | let val = (self.0 >> 12usize) & 0x01; | ||
| 15131 | val != 0 | ||
| 15132 | } | ||
| 15133 | #[doc = "Test integration module reset"] | ||
| 15134 | pub fn set_crcrst(&mut self, val: bool) { | ||
| 15135 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); | ||
| 15136 | } | ||
| 15137 | #[doc = "Touch Sensing reset"] | ||
| 15138 | pub const fn touchrst(&self) -> bool { | ||
| 15139 | let val = (self.0 >> 16usize) & 0x01; | ||
| 15140 | val != 0 | ||
| 15141 | } | ||
| 15142 | #[doc = "Touch Sensing reset"] | ||
| 15143 | pub fn set_touchrst(&mut self, val: bool) { | ||
| 15144 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | ||
| 15145 | } | ||
| 15146 | #[doc = "Random Number Generator module reset"] | ||
| 15147 | pub const fn rngrst(&self) -> bool { | ||
| 15148 | let val = (self.0 >> 20usize) & 0x01; | ||
| 15149 | val != 0 | ||
| 15150 | } | ||
| 15151 | #[doc = "Random Number Generator module reset"] | ||
| 15152 | pub fn set_rngrst(&mut self, val: bool) { | ||
| 15153 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); | ||
| 15154 | } | ||
| 15155 | #[doc = "Crypto module reset"] | ||
| 15156 | pub const fn cryprst(&self) -> bool { | ||
| 15157 | let val = (self.0 >> 24usize) & 0x01; | ||
| 15158 | val != 0 | ||
| 15159 | } | ||
| 15160 | #[doc = "Crypto module reset"] | ||
| 15161 | pub fn set_cryprst(&mut self, val: bool) { | ||
| 15162 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize); | ||
| 15163 | } | ||
| 15164 | } | ||
| 15165 | impl Default for Ahbrstr { | ||
| 15166 | fn default() -> Ahbrstr { | ||
| 15167 | Ahbrstr(0) | ||
| 15168 | } | ||
| 15169 | } | ||
| 15170 | #[doc = "Clock interrupt clear register"] | ||
| 15171 | #[repr(transparent)] | ||
| 15172 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 15173 | pub struct Cicr(pub u32); | ||
| 15174 | impl Cicr { | ||
| 15175 | #[doc = "LSI ready Interrupt clear"] | ||
| 15176 | pub const fn lsirdyc(&self) -> bool { | ||
| 15177 | let val = (self.0 >> 0usize) & 0x01; | ||
| 15178 | val != 0 | ||
| 15179 | } | ||
| 15180 | #[doc = "LSI ready Interrupt clear"] | ||
| 15181 | pub fn set_lsirdyc(&mut self, val: bool) { | ||
| 15182 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 15183 | } | ||
| 15184 | #[doc = "LSE ready Interrupt clear"] | ||
| 15185 | pub const fn lserdyc(&self) -> bool { | ||
| 11982 | let val = (self.0 >> 1usize) & 0x01; | 15186 | let val = (self.0 >> 1usize) & 0x01; |
| 11983 | super::vals::Hsirdyie(val as u8) | 15187 | val != 0 |
| 11984 | } | 15188 | } |
| 11985 | #[doc = "LSE ready interrupt flag"] | 15189 | #[doc = "LSE ready Interrupt clear"] |
| 11986 | pub fn set_lserdyie(&mut self, val: super::vals::Hsirdyie) { | 15190 | pub fn set_lserdyc(&mut self, val: bool) { |
| 11987 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | 15191 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 11988 | } | 15192 | } |
| 11989 | #[doc = "HSI16 ready interrupt flag"] | 15193 | #[doc = "HSI16 ready Interrupt clear"] |
| 11990 | pub const fn hsi16rdyie(&self) -> super::vals::Hsirdyie { | 15194 | pub const fn hsi16rdyc(&self) -> bool { |
| 11991 | let val = (self.0 >> 2usize) & 0x01; | 15195 | let val = (self.0 >> 2usize) & 0x01; |
| 11992 | super::vals::Hsirdyie(val as u8) | 15196 | val != 0 |
| 11993 | } | 15197 | } |
| 11994 | #[doc = "HSI16 ready interrupt flag"] | 15198 | #[doc = "HSI16 ready Interrupt clear"] |
| 11995 | pub fn set_hsi16rdyie(&mut self, val: super::vals::Hsirdyie) { | 15199 | pub fn set_hsi16rdyc(&mut self, val: bool) { |
| 11996 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | 15200 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 11997 | } | 15201 | } |
| 11998 | #[doc = "HSE ready interrupt flag"] | 15202 | #[doc = "HSE ready Interrupt clear"] |
| 11999 | pub const fn hserdyie(&self) -> super::vals::Hsirdyie { | 15203 | pub const fn hserdyc(&self) -> bool { |
| 12000 | let val = (self.0 >> 3usize) & 0x01; | 15204 | let val = (self.0 >> 3usize) & 0x01; |
| 12001 | super::vals::Hsirdyie(val as u8) | 15205 | val != 0 |
| 12002 | } | 15206 | } |
| 12003 | #[doc = "HSE ready interrupt flag"] | 15207 | #[doc = "HSE ready Interrupt clear"] |
| 12004 | pub fn set_hserdyie(&mut self, val: super::vals::Hsirdyie) { | 15208 | pub fn set_hserdyc(&mut self, val: bool) { |
| 12005 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | 15209 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); |
| 12006 | } | 15210 | } |
| 12007 | #[doc = "PLL ready interrupt flag"] | 15211 | #[doc = "PLL ready Interrupt clear"] |
| 12008 | pub const fn pllrdyie(&self) -> super::vals::Hsirdyie { | 15212 | pub const fn pllrdyc(&self) -> bool { |
| 12009 | let val = (self.0 >> 4usize) & 0x01; | 15213 | let val = (self.0 >> 4usize) & 0x01; |
| 12010 | super::vals::Hsirdyie(val as u8) | 15214 | val != 0 |
| 12011 | } | 15215 | } |
| 12012 | #[doc = "PLL ready interrupt flag"] | 15216 | #[doc = "PLL ready Interrupt clear"] |
| 12013 | pub fn set_pllrdyie(&mut self, val: super::vals::Hsirdyie) { | 15217 | pub fn set_pllrdyc(&mut self, val: bool) { |
| 12014 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | 15218 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 12015 | } | 15219 | } |
| 12016 | #[doc = "MSI ready interrupt flag"] | 15220 | #[doc = "MSI ready Interrupt clear"] |
| 12017 | pub const fn msirdyie(&self) -> super::vals::Hsirdyie { | 15221 | pub const fn msirdyc(&self) -> bool { |
| 12018 | let val = (self.0 >> 5usize) & 0x01; | 15222 | let val = (self.0 >> 5usize) & 0x01; |
| 12019 | super::vals::Hsirdyie(val as u8) | 15223 | val != 0 |
| 12020 | } | 15224 | } |
| 12021 | #[doc = "MSI ready interrupt flag"] | 15225 | #[doc = "MSI ready Interrupt clear"] |
| 12022 | pub fn set_msirdyie(&mut self, val: super::vals::Hsirdyie) { | 15226 | pub fn set_msirdyc(&mut self, val: bool) { |
| 12023 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | 15227 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 12024 | } | 15228 | } |
| 12025 | #[doc = "HSI48 ready interrupt flag"] | 15229 | #[doc = "HSI48 ready Interrupt clear"] |
| 12026 | pub const fn hsi48rdyie(&self) -> super::vals::Hsirdyie { | 15230 | pub const fn hsi48rdyc(&self) -> bool { |
| 12027 | let val = (self.0 >> 6usize) & 0x01; | 15231 | let val = (self.0 >> 6usize) & 0x01; |
| 12028 | super::vals::Hsirdyie(val as u8) | 15232 | val != 0 |
| 12029 | } | 15233 | } |
| 12030 | #[doc = "HSI48 ready interrupt flag"] | 15234 | #[doc = "HSI48 ready Interrupt clear"] |
| 12031 | pub fn set_hsi48rdyie(&mut self, val: super::vals::Hsirdyie) { | 15235 | pub fn set_hsi48rdyc(&mut self, val: bool) { |
| 12032 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); | 15236 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 12033 | } | 15237 | } |
| 12034 | #[doc = "LSE CSS interrupt flag"] | 15238 | #[doc = "LSE Clock Security System Interrupt clear"] |
| 12035 | pub const fn csslse(&self) -> super::vals::Csslse { | 15239 | pub const fn csslsec(&self) -> bool { |
| 12036 | let val = (self.0 >> 7usize) & 0x01; | 15240 | let val = (self.0 >> 7usize) & 0x01; |
| 12037 | super::vals::Csslse(val as u8) | 15241 | val != 0 |
| 12038 | } | 15242 | } |
| 12039 | #[doc = "LSE CSS interrupt flag"] | 15243 | #[doc = "LSE Clock Security System Interrupt clear"] |
| 12040 | pub fn set_csslse(&mut self, val: super::vals::Csslse) { | 15244 | pub fn set_csslsec(&mut self, val: bool) { |
| 12041 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | 15245 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); |
| 15246 | } | ||
| 15247 | #[doc = "Clock Security System Interrupt clear"] | ||
| 15248 | pub const fn csshsec(&self) -> bool { | ||
| 15249 | let val = (self.0 >> 8usize) & 0x01; | ||
| 15250 | val != 0 | ||
| 15251 | } | ||
| 15252 | #[doc = "Clock Security System Interrupt clear"] | ||
| 15253 | pub fn set_csshsec(&mut self, val: bool) { | ||
| 15254 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 12042 | } | 15255 | } |
| 12043 | } | 15256 | } |
| 12044 | impl Default for Cier { | 15257 | impl Default for Cicr { |
| 12045 | fn default() -> Cier { | 15258 | fn default() -> Cicr { |
| 12046 | Cier(0) | 15259 | Cicr(0) |
| 12047 | } | 15260 | } |
| 12048 | } | 15261 | } |
| 12049 | #[doc = "Clock configuration register"] | 15262 | #[doc = "Clock configuration register"] |
| 12050 | #[repr(transparent)] | 15263 | #[repr(transparent)] |
| 12051 | #[derive(Copy, Clone, Eq, PartialEq)] | 15264 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 12052 | pub struct Ccipr(pub u32); | 15265 | pub struct Cfgr(pub u32); |
| 12053 | impl Ccipr { | 15266 | impl Cfgr { |
| 12054 | #[doc = "USART1 clock source selection bits"] | 15267 | #[doc = "System clock switch"] |
| 12055 | pub const fn usart1sel(&self) -> super::vals::Lpuartsel { | 15268 | pub const fn sw(&self) -> super::vals::Sw { |
| 12056 | let val = (self.0 >> 0usize) & 0x03; | 15269 | let val = (self.0 >> 0usize) & 0x03; |
| 12057 | super::vals::Lpuartsel(val as u8) | 15270 | super::vals::Sw(val as u8) |
| 12058 | } | 15271 | } |
| 12059 | #[doc = "USART1 clock source selection bits"] | 15272 | #[doc = "System clock switch"] |
| 12060 | pub fn set_usart1sel(&mut self, val: super::vals::Lpuartsel) { | 15273 | pub fn set_sw(&mut self, val: super::vals::Sw) { |
| 12061 | self.0 = (self.0 & !(0x03 << 0usize)) | (((val.0 as u32) & 0x03) << 0usize); | 15274 | self.0 = (self.0 & !(0x03 << 0usize)) | (((val.0 as u32) & 0x03) << 0usize); |
| 12062 | } | 15275 | } |
| 12063 | #[doc = "USART2 clock source selection bits"] | 15276 | #[doc = "System clock switch status"] |
| 12064 | pub const fn usart2sel(&self) -> super::vals::Lpuartsel { | 15277 | pub const fn sws(&self) -> super::vals::Sws { |
| 12065 | let val = (self.0 >> 2usize) & 0x03; | 15278 | let val = (self.0 >> 2usize) & 0x03; |
| 12066 | super::vals::Lpuartsel(val as u8) | 15279 | super::vals::Sws(val as u8) |
| 12067 | } | 15280 | } |
| 12068 | #[doc = "USART2 clock source selection bits"] | 15281 | #[doc = "System clock switch status"] |
| 12069 | pub fn set_usart2sel(&mut self, val: super::vals::Lpuartsel) { | 15282 | pub fn set_sws(&mut self, val: super::vals::Sws) { |
| 12070 | self.0 = (self.0 & !(0x03 << 2usize)) | (((val.0 as u32) & 0x03) << 2usize); | 15283 | self.0 = (self.0 & !(0x03 << 2usize)) | (((val.0 as u32) & 0x03) << 2usize); |
| 12071 | } | 15284 | } |
| 12072 | #[doc = "LPUART1 clock source selection bits"] | 15285 | #[doc = "AHB prescaler"] |
| 12073 | pub const fn lpuart1sel(&self) -> super::vals::Lpuartsel { | 15286 | pub const fn hpre(&self) -> super::vals::Hpre { |
| 12074 | let val = (self.0 >> 10usize) & 0x03; | 15287 | let val = (self.0 >> 4usize) & 0x0f; |
| 12075 | super::vals::Lpuartsel(val as u8) | 15288 | super::vals::Hpre(val as u8) |
| 12076 | } | 15289 | } |
| 12077 | #[doc = "LPUART1 clock source selection bits"] | 15290 | #[doc = "AHB prescaler"] |
| 12078 | pub fn set_lpuart1sel(&mut self, val: super::vals::Lpuartsel) { | 15291 | pub fn set_hpre(&mut self, val: super::vals::Hpre) { |
| 12079 | self.0 = (self.0 & !(0x03 << 10usize)) | (((val.0 as u32) & 0x03) << 10usize); | 15292 | self.0 = (self.0 & !(0x0f << 4usize)) | (((val.0 as u32) & 0x0f) << 4usize); |
| 12080 | } | 15293 | } |
| 12081 | #[doc = "I2C1 clock source selection bits"] | 15294 | #[doc = "APB low-speed prescaler (APB1)"] |
| 12082 | pub const fn i2c1sel(&self) -> super::vals::Icsel { | 15295 | pub fn ppre(&self, n: usize) -> super::vals::Ppre { |
| 12083 | let val = (self.0 >> 12usize) & 0x03; | 15296 | assert!(n < 2usize); |
| 12084 | super::vals::Icsel(val as u8) | 15297 | let offs = 8usize + n * 3usize; |
| 15298 | let val = (self.0 >> offs) & 0x07; | ||
| 15299 | super::vals::Ppre(val as u8) | ||
| 12085 | } | 15300 | } |
| 12086 | #[doc = "I2C1 clock source selection bits"] | 15301 | #[doc = "APB low-speed prescaler (APB1)"] |
| 12087 | pub fn set_i2c1sel(&mut self, val: super::vals::Icsel) { | 15302 | pub fn set_ppre(&mut self, n: usize, val: super::vals::Ppre) { |
| 12088 | self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize); | 15303 | assert!(n < 2usize); |
| 15304 | let offs = 8usize + n * 3usize; | ||
| 15305 | self.0 = (self.0 & !(0x07 << offs)) | (((val.0 as u32) & 0x07) << offs); | ||
| 12089 | } | 15306 | } |
| 12090 | #[doc = "I2C3 clock source selection bits"] | 15307 | #[doc = "Wake-up from stop clock selection"] |
| 12091 | pub const fn i2c3sel(&self) -> super::vals::Icsel { | 15308 | pub const fn stopwuck(&self) -> super::vals::Stopwuck { |
| 12092 | let val = (self.0 >> 16usize) & 0x03; | 15309 | let val = (self.0 >> 15usize) & 0x01; |
| 12093 | super::vals::Icsel(val as u8) | 15310 | super::vals::Stopwuck(val as u8) |
| 12094 | } | 15311 | } |
| 12095 | #[doc = "I2C3 clock source selection bits"] | 15312 | #[doc = "Wake-up from stop clock selection"] |
| 12096 | pub fn set_i2c3sel(&mut self, val: super::vals::Icsel) { | 15313 | pub fn set_stopwuck(&mut self, val: super::vals::Stopwuck) { |
| 12097 | self.0 = (self.0 & !(0x03 << 16usize)) | (((val.0 as u32) & 0x03) << 16usize); | 15314 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); |
| 12098 | } | 15315 | } |
| 12099 | #[doc = "Low Power Timer clock source selection bits"] | 15316 | #[doc = "PLL entry clock source"] |
| 12100 | pub const fn lptim1sel(&self) -> super::vals::Lptimsel { | 15317 | pub const fn pllsrc(&self) -> super::vals::Pllsrc { |
| 12101 | let val = (self.0 >> 18usize) & 0x03; | 15318 | let val = (self.0 >> 16usize) & 0x01; |
| 12102 | super::vals::Lptimsel(val as u8) | 15319 | super::vals::Pllsrc(val as u8) |
| 12103 | } | 15320 | } |
| 12104 | #[doc = "Low Power Timer clock source selection bits"] | 15321 | #[doc = "PLL entry clock source"] |
| 12105 | pub fn set_lptim1sel(&mut self, val: super::vals::Lptimsel) { | 15322 | pub fn set_pllsrc(&mut self, val: super::vals::Pllsrc) { |
| 12106 | self.0 = (self.0 & !(0x03 << 18usize)) | (((val.0 as u32) & 0x03) << 18usize); | 15323 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); |
| 12107 | } | 15324 | } |
| 12108 | #[doc = "48 MHz HSI48 clock source selection bit"] | 15325 | #[doc = "PLL multiplication factor"] |
| 12109 | pub const fn hsi48msel(&self) -> bool { | 15326 | pub const fn pllmul(&self) -> super::vals::Pllmul { |
| 12110 | let val = (self.0 >> 26usize) & 0x01; | 15327 | let val = (self.0 >> 18usize) & 0x0f; |
| 12111 | val != 0 | 15328 | super::vals::Pllmul(val as u8) |
| 12112 | } | 15329 | } |
| 12113 | #[doc = "48 MHz HSI48 clock source selection bit"] | 15330 | #[doc = "PLL multiplication factor"] |
| 12114 | pub fn set_hsi48msel(&mut self, val: bool) { | 15331 | pub fn set_pllmul(&mut self, val: super::vals::Pllmul) { |
| 12115 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); | 15332 | self.0 = (self.0 & !(0x0f << 18usize)) | (((val.0 as u32) & 0x0f) << 18usize); |
| 15333 | } | ||
| 15334 | #[doc = "PLL output division"] | ||
| 15335 | pub const fn plldiv(&self) -> super::vals::Plldiv { | ||
| 15336 | let val = (self.0 >> 22usize) & 0x03; | ||
| 15337 | super::vals::Plldiv(val as u8) | ||
| 15338 | } | ||
| 15339 | #[doc = "PLL output division"] | ||
| 15340 | pub fn set_plldiv(&mut self, val: super::vals::Plldiv) { | ||
| 15341 | self.0 = (self.0 & !(0x03 << 22usize)) | (((val.0 as u32) & 0x03) << 22usize); | ||
| 15342 | } | ||
| 15343 | #[doc = "Microcontroller clock output selection"] | ||
| 15344 | pub const fn mcosel(&self) -> super::vals::Mcosel { | ||
| 15345 | let val = (self.0 >> 24usize) & 0x0f; | ||
| 15346 | super::vals::Mcosel(val as u8) | ||
| 15347 | } | ||
| 15348 | #[doc = "Microcontroller clock output selection"] | ||
| 15349 | pub fn set_mcosel(&mut self, val: super::vals::Mcosel) { | ||
| 15350 | self.0 = (self.0 & !(0x0f << 24usize)) | (((val.0 as u32) & 0x0f) << 24usize); | ||
| 15351 | } | ||
| 15352 | #[doc = "Microcontroller clock output prescaler"] | ||
| 15353 | pub const fn mcopre(&self) -> super::vals::Mcopre { | ||
| 15354 | let val = (self.0 >> 28usize) & 0x07; | ||
| 15355 | super::vals::Mcopre(val as u8) | ||
| 15356 | } | ||
| 15357 | #[doc = "Microcontroller clock output prescaler"] | ||
| 15358 | pub fn set_mcopre(&mut self, val: super::vals::Mcopre) { | ||
| 15359 | self.0 = (self.0 & !(0x07 << 28usize)) | (((val.0 as u32) & 0x07) << 28usize); | ||
| 12116 | } | 15360 | } |
| 12117 | } | 15361 | } |
| 12118 | impl Default for Ccipr { | 15362 | impl Default for Cfgr { |
| 12119 | fn default() -> Ccipr { | 15363 | fn default() -> Cfgr { |
| 12120 | Ccipr(0) | 15364 | Cfgr(0) |
| 12121 | } | 15365 | } |
| 12122 | } | 15366 | } |
| 12123 | #[doc = "AHB peripheral reset register"] | 15367 | } |
| 15368 | } | ||
| 15369 | pub mod i2c_v2 { | ||
| 15370 | use crate::generic::*; | ||
| 15371 | #[doc = "Inter-integrated circuit"] | ||
| 15372 | #[derive(Copy, Clone)] | ||
| 15373 | pub struct I2c(pub *mut u8); | ||
| 15374 | unsafe impl Send for I2c {} | ||
| 15375 | unsafe impl Sync for I2c {} | ||
| 15376 | impl I2c { | ||
| 15377 | #[doc = "Control register 1"] | ||
| 15378 | pub fn cr1(self) -> Reg<regs::Cr1, RW> { | ||
| 15379 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 15380 | } | ||
| 15381 | #[doc = "Control register 2"] | ||
| 15382 | pub fn cr2(self) -> Reg<regs::Cr2, RW> { | ||
| 15383 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 15384 | } | ||
| 15385 | #[doc = "Own address register 1"] | ||
| 15386 | pub fn oar1(self) -> Reg<regs::Oar1, RW> { | ||
| 15387 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 15388 | } | ||
| 15389 | #[doc = "Own address register 2"] | ||
| 15390 | pub fn oar2(self) -> Reg<regs::Oar2, RW> { | ||
| 15391 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 15392 | } | ||
| 15393 | #[doc = "Timing register"] | ||
| 15394 | pub fn timingr(self) -> Reg<regs::Timingr, RW> { | ||
| 15395 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 15396 | } | ||
| 15397 | #[doc = "Status register 1"] | ||
| 15398 | pub fn timeoutr(self) -> Reg<regs::Timeoutr, RW> { | ||
| 15399 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | ||
| 15400 | } | ||
| 15401 | #[doc = "Interrupt and Status register"] | ||
| 15402 | pub fn isr(self) -> Reg<regs::Isr, RW> { | ||
| 15403 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | ||
| 15404 | } | ||
| 15405 | #[doc = "Interrupt clear register"] | ||
| 15406 | pub fn icr(self) -> Reg<regs::Icr, W> { | ||
| 15407 | unsafe { Reg::from_ptr(self.0.add(28usize)) } | ||
| 15408 | } | ||
| 15409 | #[doc = "PEC register"] | ||
| 15410 | pub fn pecr(self) -> Reg<regs::Pecr, R> { | ||
| 15411 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | ||
| 15412 | } | ||
| 15413 | #[doc = "Receive data register"] | ||
| 15414 | pub fn rxdr(self) -> Reg<regs::Rxdr, R> { | ||
| 15415 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | ||
| 15416 | } | ||
| 15417 | #[doc = "Transmit data register"] | ||
| 15418 | pub fn txdr(self) -> Reg<regs::Txdr, RW> { | ||
| 15419 | unsafe { Reg::from_ptr(self.0.add(40usize)) } | ||
| 15420 | } | ||
| 15421 | } | ||
| 15422 | pub mod vals { | ||
| 15423 | use crate::generic::*; | ||
| 15424 | #[repr(transparent)] | ||
| 15425 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 15426 | pub struct Nack(pub u8); | ||
| 15427 | impl Nack { | ||
| 15428 | #[doc = "an ACK is sent after current received byte"] | ||
| 15429 | pub const ACK: Self = Self(0); | ||
| 15430 | #[doc = "a NACK is sent after current received byte"] | ||
| 15431 | pub const NACK: Self = Self(0x01); | ||
| 15432 | } | ||
| 15433 | #[repr(transparent)] | ||
| 15434 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 15435 | pub struct Autoend(pub u8); | ||
| 15436 | impl Autoend { | ||
| 15437 | #[doc = "Software end mode: TC flag is set when NBYTES data are transferred, stretching SCL low"] | ||
| 15438 | pub const SOFTWARE: Self = Self(0); | ||
| 15439 | #[doc = "Automatic end mode: a STOP condition is automatically sent when NBYTES data are transferred"] | ||
| 15440 | pub const AUTOMATIC: Self = Self(0x01); | ||
| 15441 | } | ||
| 15442 | #[repr(transparent)] | ||
| 15443 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 15444 | pub struct RdWrn(pub u8); | ||
| 15445 | impl RdWrn { | ||
| 15446 | #[doc = "Master requests a write transfer"] | ||
| 15447 | pub const WRITE: Self = Self(0); | ||
| 15448 | #[doc = "Master requests a read transfer"] | ||
| 15449 | pub const READ: Self = Self(0x01); | ||
| 15450 | } | ||
| 15451 | #[repr(transparent)] | ||
| 15452 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 15453 | pub struct Pecerr(pub u8); | ||
| 15454 | impl Pecerr { | ||
| 15455 | #[doc = "Received PEC does match with PEC register"] | ||
| 15456 | pub const MATCH: Self = Self(0); | ||
| 15457 | #[doc = "Received PEC does not match with PEC register"] | ||
| 15458 | pub const NOMATCH: Self = Self(0x01); | ||
| 15459 | } | ||
| 15460 | #[repr(transparent)] | ||
| 15461 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 15462 | pub struct Reload(pub u8); | ||
| 15463 | impl Reload { | ||
| 15464 | #[doc = "The transfer is completed after the NBYTES data transfer (STOP or RESTART will follow)"] | ||
| 15465 | pub const COMPLETED: Self = Self(0); | ||
| 15466 | #[doc = "The transfer is not completed after the NBYTES data transfer (NBYTES will be reloaded)"] | ||
| 15467 | pub const NOTCOMPLETED: Self = Self(0x01); | ||
| 15468 | } | ||
| 15469 | #[repr(transparent)] | ||
| 15470 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 15471 | pub struct Headr(pub u8); | ||
| 15472 | impl Headr { | ||
| 15473 | #[doc = "The master sends the complete 10 bit slave address read sequence"] | ||
| 15474 | pub const COMPLETE: Self = Self(0); | ||
| 15475 | #[doc = "The master only sends the 1st 7 bits of the 10 bit address, followed by Read direction"] | ||
| 15476 | pub const PARTIAL: Self = Self(0x01); | ||
| 15477 | } | ||
| 15478 | #[repr(transparent)] | ||
| 15479 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 15480 | pub struct Dir(pub u8); | ||
| 15481 | impl Dir { | ||
| 15482 | #[doc = "Write transfer, slave enters receiver mode"] | ||
| 15483 | pub const WRITE: Self = Self(0); | ||
| 15484 | #[doc = "Read transfer, slave enters transmitter mode"] | ||
| 15485 | pub const READ: Self = Self(0x01); | ||
| 15486 | } | ||
| 15487 | #[repr(transparent)] | ||
| 15488 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 15489 | pub struct Dnf(pub u8); | ||
| 15490 | impl Dnf { | ||
| 15491 | #[doc = "Digital filter disabled"] | ||
| 15492 | pub const NOFILTER: Self = Self(0); | ||
| 15493 | #[doc = "Digital filter enabled and filtering capability up to 1 tI2CCLK"] | ||
| 15494 | pub const FILTER1: Self = Self(0x01); | ||
| 15495 | #[doc = "Digital filter enabled and filtering capability up to 2 tI2CCLK"] | ||
| 15496 | pub const FILTER2: Self = Self(0x02); | ||
| 15497 | #[doc = "Digital filter enabled and filtering capability up to 3 tI2CCLK"] | ||
| 15498 | pub const FILTER3: Self = Self(0x03); | ||
| 15499 | #[doc = "Digital filter enabled and filtering capability up to 4 tI2CCLK"] | ||
| 15500 | pub const FILTER4: Self = Self(0x04); | ||
| 15501 | #[doc = "Digital filter enabled and filtering capability up to 5 tI2CCLK"] | ||
| 15502 | pub const FILTER5: Self = Self(0x05); | ||
| 15503 | #[doc = "Digital filter enabled and filtering capability up to 6 tI2CCLK"] | ||
| 15504 | pub const FILTER6: Self = Self(0x06); | ||
| 15505 | #[doc = "Digital filter enabled and filtering capability up to 7 tI2CCLK"] | ||
| 15506 | pub const FILTER7: Self = Self(0x07); | ||
| 15507 | #[doc = "Digital filter enabled and filtering capability up to 8 tI2CCLK"] | ||
| 15508 | pub const FILTER8: Self = Self(0x08); | ||
| 15509 | #[doc = "Digital filter enabled and filtering capability up to 9 tI2CCLK"] | ||
| 15510 | pub const FILTER9: Self = Self(0x09); | ||
| 15511 | #[doc = "Digital filter enabled and filtering capability up to 10 tI2CCLK"] | ||
| 15512 | pub const FILTER10: Self = Self(0x0a); | ||
| 15513 | #[doc = "Digital filter enabled and filtering capability up to 11 tI2CCLK"] | ||
| 15514 | pub const FILTER11: Self = Self(0x0b); | ||
| 15515 | #[doc = "Digital filter enabled and filtering capability up to 12 tI2CCLK"] | ||
| 15516 | pub const FILTER12: Self = Self(0x0c); | ||
| 15517 | #[doc = "Digital filter enabled and filtering capability up to 13 tI2CCLK"] | ||
| 15518 | pub const FILTER13: Self = Self(0x0d); | ||
| 15519 | #[doc = "Digital filter enabled and filtering capability up to 14 tI2CCLK"] | ||
| 15520 | pub const FILTER14: Self = Self(0x0e); | ||
| 15521 | #[doc = "Digital filter enabled and filtering capability up to 15 tI2CCLK"] | ||
| 15522 | pub const FILTER15: Self = Self(0x0f); | ||
| 15523 | } | ||
| 15524 | #[repr(transparent)] | ||
| 15525 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 15526 | pub struct Oamsk(pub u8); | ||
| 15527 | impl Oamsk { | ||
| 15528 | #[doc = "No mask"] | ||
| 15529 | pub const NOMASK: Self = Self(0); | ||
| 15530 | #[doc = "OA2[1] | ||
| 15531 | is masked and don’t care. Only OA2[7:2] | ||
| 15532 | are compared"] | ||
| 15533 | pub const MASK1: Self = Self(0x01); | ||
| 15534 | #[doc = "OA2[2:1] | ||
| 15535 | are masked and don’t care. Only OA2[7:3] | ||
| 15536 | are compared"] | ||
| 15537 | pub const MASK2: Self = Self(0x02); | ||
| 15538 | #[doc = "OA2[3:1] | ||
| 15539 | are masked and don’t care. Only OA2[7:4] | ||
| 15540 | are compared"] | ||
| 15541 | pub const MASK3: Self = Self(0x03); | ||
| 15542 | #[doc = "OA2[4:1] | ||
| 15543 | are masked and don’t care. Only OA2[7:5] | ||
| 15544 | are compared"] | ||
| 15545 | pub const MASK4: Self = Self(0x04); | ||
| 15546 | #[doc = "OA2[5:1] | ||
| 15547 | are masked and don’t care. Only OA2[7:6] | ||
| 15548 | are compared"] | ||
| 15549 | pub const MASK5: Self = Self(0x05); | ||
| 15550 | #[doc = "OA2[6:1] | ||
| 15551 | are masked and don’t care. Only OA2[7] | ||
| 15552 | is compared."] | ||
| 15553 | pub const MASK6: Self = Self(0x06); | ||
| 15554 | #[doc = "OA2[7:1] | ||
| 15555 | are masked and don’t care. No comparison is done, and all (except reserved) 7-bit received addresses are acknowledged"] | ||
| 15556 | pub const MASK7: Self = Self(0x07); | ||
| 15557 | } | ||
| 15558 | #[repr(transparent)] | ||
| 15559 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 15560 | pub struct Start(pub u8); | ||
| 15561 | impl Start { | ||
| 15562 | #[doc = "No Start generation"] | ||
| 15563 | pub const NOSTART: Self = Self(0); | ||
| 15564 | #[doc = "Restart/Start generation"] | ||
| 15565 | pub const START: Self = Self(0x01); | ||
| 15566 | } | ||
| 15567 | #[repr(transparent)] | ||
| 15568 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 15569 | pub struct Add(pub u8); | ||
| 15570 | impl Add { | ||
| 15571 | #[doc = "The master operates in 7-bit addressing mode"] | ||
| 15572 | pub const BIT7: Self = Self(0); | ||
| 15573 | #[doc = "The master operates in 10-bit addressing mode"] | ||
| 15574 | pub const BIT10: Self = Self(0x01); | ||
| 15575 | } | ||
| 15576 | #[repr(transparent)] | ||
| 15577 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 15578 | pub struct Oamode(pub u8); | ||
| 15579 | impl Oamode { | ||
| 15580 | #[doc = "Own address 1 is a 7-bit address"] | ||
| 15581 | pub const BIT7: Self = Self(0); | ||
| 15582 | #[doc = "Own address 1 is a 10-bit address"] | ||
| 15583 | pub const BIT10: Self = Self(0x01); | ||
| 15584 | } | ||
| 15585 | #[repr(transparent)] | ||
| 15586 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 15587 | pub struct Stop(pub u8); | ||
| 15588 | impl Stop { | ||
| 15589 | #[doc = "No Stop generation"] | ||
| 15590 | pub const NOSTOP: Self = Self(0); | ||
| 15591 | #[doc = "Stop generation after current byte transfer"] | ||
| 15592 | pub const STOP: Self = Self(0x01); | ||
| 15593 | } | ||
| 15594 | #[repr(transparent)] | ||
| 15595 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 15596 | pub struct Pecbyte(pub u8); | ||
| 15597 | impl Pecbyte { | ||
| 15598 | #[doc = "No PEC transfer"] | ||
| 15599 | pub const NOPEC: Self = Self(0); | ||
| 15600 | #[doc = "PEC transmission/reception is requested"] | ||
| 15601 | pub const PEC: Self = Self(0x01); | ||
| 15602 | } | ||
| 15603 | } | ||
| 15604 | pub mod regs { | ||
| 15605 | use crate::generic::*; | ||
| 15606 | #[doc = "Control register 1"] | ||
| 12124 | #[repr(transparent)] | 15607 | #[repr(transparent)] |
| 12125 | #[derive(Copy, Clone, Eq, PartialEq)] | 15608 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 12126 | pub struct Ahbrstr(pub u32); | 15609 | pub struct Cr1(pub u32); |
| 12127 | impl Ahbrstr { | 15610 | impl Cr1 { |
| 12128 | #[doc = "DMA reset"] | 15611 | #[doc = "Peripheral enable"] |
| 12129 | pub const fn dmarst(&self) -> bool { | 15612 | pub const fn pe(&self) -> bool { |
| 12130 | let val = (self.0 >> 0usize) & 0x01; | 15613 | let val = (self.0 >> 0usize) & 0x01; |
| 12131 | val != 0 | 15614 | val != 0 |
| 12132 | } | 15615 | } |
| 12133 | #[doc = "DMA reset"] | 15616 | #[doc = "Peripheral enable"] |
| 12134 | pub fn set_dmarst(&mut self, val: bool) { | 15617 | pub fn set_pe(&mut self, val: bool) { |
| 12135 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 15618 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 12136 | } | 15619 | } |
| 12137 | #[doc = "Memory interface reset"] | 15620 | #[doc = "TX Interrupt enable"] |
| 12138 | pub const fn mifrst(&self) -> bool { | 15621 | pub const fn txie(&self) -> bool { |
| 12139 | let val = (self.0 >> 8usize) & 0x01; | 15622 | let val = (self.0 >> 1usize) & 0x01; |
| 12140 | val != 0 | 15623 | val != 0 |
| 12141 | } | 15624 | } |
| 12142 | #[doc = "Memory interface reset"] | 15625 | #[doc = "TX Interrupt enable"] |
| 12143 | pub fn set_mifrst(&mut self, val: bool) { | 15626 | pub fn set_txie(&mut self, val: bool) { |
| 12144 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 15627 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 12145 | } | 15628 | } |
| 12146 | #[doc = "Test integration module reset"] | 15629 | #[doc = "RX Interrupt enable"] |
| 12147 | pub const fn crcrst(&self) -> bool { | 15630 | pub const fn rxie(&self) -> bool { |
| 15631 | let val = (self.0 >> 2usize) & 0x01; | ||
| 15632 | val != 0 | ||
| 15633 | } | ||
| 15634 | #[doc = "RX Interrupt enable"] | ||
| 15635 | pub fn set_rxie(&mut self, val: bool) { | ||
| 15636 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 15637 | } | ||
| 15638 | #[doc = "Address match interrupt enable (slave only)"] | ||
| 15639 | pub const fn addrie(&self) -> bool { | ||
| 15640 | let val = (self.0 >> 3usize) & 0x01; | ||
| 15641 | val != 0 | ||
| 15642 | } | ||
| 15643 | #[doc = "Address match interrupt enable (slave only)"] | ||
| 15644 | pub fn set_addrie(&mut self, val: bool) { | ||
| 15645 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | ||
| 15646 | } | ||
| 15647 | #[doc = "Not acknowledge received interrupt enable"] | ||
| 15648 | pub const fn nackie(&self) -> bool { | ||
| 15649 | let val = (self.0 >> 4usize) & 0x01; | ||
| 15650 | val != 0 | ||
| 15651 | } | ||
| 15652 | #[doc = "Not acknowledge received interrupt enable"] | ||
| 15653 | pub fn set_nackie(&mut self, val: bool) { | ||
| 15654 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | ||
| 15655 | } | ||
| 15656 | #[doc = "STOP detection Interrupt enable"] | ||
| 15657 | pub const fn stopie(&self) -> bool { | ||
| 15658 | let val = (self.0 >> 5usize) & 0x01; | ||
| 15659 | val != 0 | ||
| 15660 | } | ||
| 15661 | #[doc = "STOP detection Interrupt enable"] | ||
| 15662 | pub fn set_stopie(&mut self, val: bool) { | ||
| 15663 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 15664 | } | ||
| 15665 | #[doc = "Transfer Complete interrupt enable"] | ||
| 15666 | pub const fn tcie(&self) -> bool { | ||
| 15667 | let val = (self.0 >> 6usize) & 0x01; | ||
| 15668 | val != 0 | ||
| 15669 | } | ||
| 15670 | #[doc = "Transfer Complete interrupt enable"] | ||
| 15671 | pub fn set_tcie(&mut self, val: bool) { | ||
| 15672 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 15673 | } | ||
| 15674 | #[doc = "Error interrupts enable"] | ||
| 15675 | pub const fn errie(&self) -> bool { | ||
| 15676 | let val = (self.0 >> 7usize) & 0x01; | ||
| 15677 | val != 0 | ||
| 15678 | } | ||
| 15679 | #[doc = "Error interrupts enable"] | ||
| 15680 | pub fn set_errie(&mut self, val: bool) { | ||
| 15681 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 15682 | } | ||
| 15683 | #[doc = "Digital noise filter"] | ||
| 15684 | pub const fn dnf(&self) -> super::vals::Dnf { | ||
| 15685 | let val = (self.0 >> 8usize) & 0x0f; | ||
| 15686 | super::vals::Dnf(val as u8) | ||
| 15687 | } | ||
| 15688 | #[doc = "Digital noise filter"] | ||
| 15689 | pub fn set_dnf(&mut self, val: super::vals::Dnf) { | ||
| 15690 | self.0 = (self.0 & !(0x0f << 8usize)) | (((val.0 as u32) & 0x0f) << 8usize); | ||
| 15691 | } | ||
| 15692 | #[doc = "Analog noise filter OFF"] | ||
| 15693 | pub const fn anfoff(&self) -> bool { | ||
| 12148 | let val = (self.0 >> 12usize) & 0x01; | 15694 | let val = (self.0 >> 12usize) & 0x01; |
| 12149 | val != 0 | 15695 | val != 0 |
| 12150 | } | 15696 | } |
| 12151 | #[doc = "Test integration module reset"] | 15697 | #[doc = "Analog noise filter OFF"] |
| 12152 | pub fn set_crcrst(&mut self, val: bool) { | 15698 | pub fn set_anfoff(&mut self, val: bool) { |
| 12153 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); | 15699 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); |
| 12154 | } | 15700 | } |
| 12155 | #[doc = "Touch Sensing reset"] | 15701 | #[doc = "DMA transmission requests enable"] |
| 12156 | pub const fn touchrst(&self) -> bool { | 15702 | pub const fn txdmaen(&self) -> bool { |
| 15703 | let val = (self.0 >> 14usize) & 0x01; | ||
| 15704 | val != 0 | ||
| 15705 | } | ||
| 15706 | #[doc = "DMA transmission requests enable"] | ||
| 15707 | pub fn set_txdmaen(&mut self, val: bool) { | ||
| 15708 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | ||
| 15709 | } | ||
| 15710 | #[doc = "DMA reception requests enable"] | ||
| 15711 | pub const fn rxdmaen(&self) -> bool { | ||
| 15712 | let val = (self.0 >> 15usize) & 0x01; | ||
| 15713 | val != 0 | ||
| 15714 | } | ||
| 15715 | #[doc = "DMA reception requests enable"] | ||
| 15716 | pub fn set_rxdmaen(&mut self, val: bool) { | ||
| 15717 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); | ||
| 15718 | } | ||
| 15719 | #[doc = "Slave byte control"] | ||
| 15720 | pub const fn sbc(&self) -> bool { | ||
| 12157 | let val = (self.0 >> 16usize) & 0x01; | 15721 | let val = (self.0 >> 16usize) & 0x01; |
| 12158 | val != 0 | 15722 | val != 0 |
| 12159 | } | 15723 | } |
| 12160 | #[doc = "Touch Sensing reset"] | 15724 | #[doc = "Slave byte control"] |
| 12161 | pub fn set_touchrst(&mut self, val: bool) { | 15725 | pub fn set_sbc(&mut self, val: bool) { |
| 12162 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | 15726 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); |
| 12163 | } | 15727 | } |
| 12164 | #[doc = "Random Number Generator module reset"] | 15728 | #[doc = "Clock stretching disable"] |
| 12165 | pub const fn rngrst(&self) -> bool { | 15729 | pub const fn nostretch(&self) -> bool { |
| 15730 | let val = (self.0 >> 17usize) & 0x01; | ||
| 15731 | val != 0 | ||
| 15732 | } | ||
| 15733 | #[doc = "Clock stretching disable"] | ||
| 15734 | pub fn set_nostretch(&mut self, val: bool) { | ||
| 15735 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); | ||
| 15736 | } | ||
| 15737 | #[doc = "General call enable"] | ||
| 15738 | pub const fn gcen(&self) -> bool { | ||
| 15739 | let val = (self.0 >> 19usize) & 0x01; | ||
| 15740 | val != 0 | ||
| 15741 | } | ||
| 15742 | #[doc = "General call enable"] | ||
| 15743 | pub fn set_gcen(&mut self, val: bool) { | ||
| 15744 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); | ||
| 15745 | } | ||
| 15746 | #[doc = "SMBus Host address enable"] | ||
| 15747 | pub const fn smbhen(&self) -> bool { | ||
| 12166 | let val = (self.0 >> 20usize) & 0x01; | 15748 | let val = (self.0 >> 20usize) & 0x01; |
| 12167 | val != 0 | 15749 | val != 0 |
| 12168 | } | 15750 | } |
| 12169 | #[doc = "Random Number Generator module reset"] | 15751 | #[doc = "SMBus Host address enable"] |
| 12170 | pub fn set_rngrst(&mut self, val: bool) { | 15752 | pub fn set_smbhen(&mut self, val: bool) { |
| 12171 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); | 15753 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); |
| 12172 | } | 15754 | } |
| 12173 | #[doc = "Crypto module reset"] | 15755 | #[doc = "SMBus Device Default address enable"] |
| 12174 | pub const fn cryprst(&self) -> bool { | 15756 | pub const fn smbden(&self) -> bool { |
| 12175 | let val = (self.0 >> 24usize) & 0x01; | 15757 | let val = (self.0 >> 21usize) & 0x01; |
| 12176 | val != 0 | 15758 | val != 0 |
| 12177 | } | 15759 | } |
| 12178 | #[doc = "Crypto module reset"] | 15760 | #[doc = "SMBus Device Default address enable"] |
| 12179 | pub fn set_cryprst(&mut self, val: bool) { | 15761 | pub fn set_smbden(&mut self, val: bool) { |
| 12180 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize); | 15762 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); |
| 15763 | } | ||
| 15764 | #[doc = "SMBUS alert enable"] | ||
| 15765 | pub const fn alerten(&self) -> bool { | ||
| 15766 | let val = (self.0 >> 22usize) & 0x01; | ||
| 15767 | val != 0 | ||
| 15768 | } | ||
| 15769 | #[doc = "SMBUS alert enable"] | ||
| 15770 | pub fn set_alerten(&mut self, val: bool) { | ||
| 15771 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); | ||
| 15772 | } | ||
| 15773 | #[doc = "PEC enable"] | ||
| 15774 | pub const fn pecen(&self) -> bool { | ||
| 15775 | let val = (self.0 >> 23usize) & 0x01; | ||
| 15776 | val != 0 | ||
| 15777 | } | ||
| 15778 | #[doc = "PEC enable"] | ||
| 15779 | pub fn set_pecen(&mut self, val: bool) { | ||
| 15780 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); | ||
| 12181 | } | 15781 | } |
| 12182 | } | 15782 | } |
| 12183 | impl Default for Ahbrstr { | 15783 | impl Default for Cr1 { |
| 12184 | fn default() -> Ahbrstr { | 15784 | fn default() -> Cr1 { |
| 12185 | Ahbrstr(0) | 15785 | Cr1(0) |
| 15786 | } | ||
| 15787 | } | ||
| 15788 | #[doc = "Timing register"] | ||
| 15789 | #[repr(transparent)] | ||
| 15790 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 15791 | pub struct Timingr(pub u32); | ||
| 15792 | impl Timingr { | ||
| 15793 | #[doc = "SCL low period (master mode)"] | ||
| 15794 | pub const fn scll(&self) -> u8 { | ||
| 15795 | let val = (self.0 >> 0usize) & 0xff; | ||
| 15796 | val as u8 | ||
| 15797 | } | ||
| 15798 | #[doc = "SCL low period (master mode)"] | ||
| 15799 | pub fn set_scll(&mut self, val: u8) { | ||
| 15800 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | ||
| 15801 | } | ||
| 15802 | #[doc = "SCL high period (master mode)"] | ||
| 15803 | pub const fn sclh(&self) -> u8 { | ||
| 15804 | let val = (self.0 >> 8usize) & 0xff; | ||
| 15805 | val as u8 | ||
| 15806 | } | ||
| 15807 | #[doc = "SCL high period (master mode)"] | ||
| 15808 | pub fn set_sclh(&mut self, val: u8) { | ||
| 15809 | self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize); | ||
| 15810 | } | ||
| 15811 | #[doc = "Data hold time"] | ||
| 15812 | pub const fn sdadel(&self) -> u8 { | ||
| 15813 | let val = (self.0 >> 16usize) & 0x0f; | ||
| 15814 | val as u8 | ||
| 15815 | } | ||
| 15816 | #[doc = "Data hold time"] | ||
| 15817 | pub fn set_sdadel(&mut self, val: u8) { | ||
| 15818 | self.0 = (self.0 & !(0x0f << 16usize)) | (((val as u32) & 0x0f) << 16usize); | ||
| 15819 | } | ||
| 15820 | #[doc = "Data setup time"] | ||
| 15821 | pub const fn scldel(&self) -> u8 { | ||
| 15822 | let val = (self.0 >> 20usize) & 0x0f; | ||
| 15823 | val as u8 | ||
| 15824 | } | ||
| 15825 | #[doc = "Data setup time"] | ||
| 15826 | pub fn set_scldel(&mut self, val: u8) { | ||
| 15827 | self.0 = (self.0 & !(0x0f << 20usize)) | (((val as u32) & 0x0f) << 20usize); | ||
| 15828 | } | ||
| 15829 | #[doc = "Timing prescaler"] | ||
| 15830 | pub const fn presc(&self) -> u8 { | ||
| 15831 | let val = (self.0 >> 28usize) & 0x0f; | ||
| 15832 | val as u8 | ||
| 15833 | } | ||
| 15834 | #[doc = "Timing prescaler"] | ||
| 15835 | pub fn set_presc(&mut self, val: u8) { | ||
| 15836 | self.0 = (self.0 & !(0x0f << 28usize)) | (((val as u32) & 0x0f) << 28usize); | ||
| 15837 | } | ||
| 15838 | } | ||
| 15839 | impl Default for Timingr { | ||
| 15840 | fn default() -> Timingr { | ||
| 15841 | Timingr(0) | ||
| 15842 | } | ||
| 15843 | } | ||
| 15844 | #[doc = "Transmit data register"] | ||
| 15845 | #[repr(transparent)] | ||
| 15846 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 15847 | pub struct Txdr(pub u32); | ||
| 15848 | impl Txdr { | ||
| 15849 | #[doc = "8-bit transmit data"] | ||
| 15850 | pub const fn txdata(&self) -> u8 { | ||
| 15851 | let val = (self.0 >> 0usize) & 0xff; | ||
| 15852 | val as u8 | ||
| 15853 | } | ||
| 15854 | #[doc = "8-bit transmit data"] | ||
| 15855 | pub fn set_txdata(&mut self, val: u8) { | ||
| 15856 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | ||
| 15857 | } | ||
| 15858 | } | ||
| 15859 | impl Default for Txdr { | ||
| 15860 | fn default() -> Txdr { | ||
| 15861 | Txdr(0) | ||
| 15862 | } | ||
| 15863 | } | ||
| 15864 | #[doc = "Interrupt clear register"] | ||
| 15865 | #[repr(transparent)] | ||
| 15866 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 15867 | pub struct Icr(pub u32); | ||
| 15868 | impl Icr { | ||
| 15869 | #[doc = "Address Matched flag clear"] | ||
| 15870 | pub const fn addrcf(&self) -> bool { | ||
| 15871 | let val = (self.0 >> 3usize) & 0x01; | ||
| 15872 | val != 0 | ||
| 15873 | } | ||
| 15874 | #[doc = "Address Matched flag clear"] | ||
| 15875 | pub fn set_addrcf(&mut self, val: bool) { | ||
| 15876 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | ||
| 15877 | } | ||
| 15878 | #[doc = "Not Acknowledge flag clear"] | ||
| 15879 | pub const fn nackcf(&self) -> bool { | ||
| 15880 | let val = (self.0 >> 4usize) & 0x01; | ||
| 15881 | val != 0 | ||
| 15882 | } | ||
| 15883 | #[doc = "Not Acknowledge flag clear"] | ||
| 15884 | pub fn set_nackcf(&mut self, val: bool) { | ||
| 15885 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | ||
| 15886 | } | ||
| 15887 | #[doc = "Stop detection flag clear"] | ||
| 15888 | pub const fn stopcf(&self) -> bool { | ||
| 15889 | let val = (self.0 >> 5usize) & 0x01; | ||
| 15890 | val != 0 | ||
| 15891 | } | ||
| 15892 | #[doc = "Stop detection flag clear"] | ||
| 15893 | pub fn set_stopcf(&mut self, val: bool) { | ||
| 15894 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 15895 | } | ||
| 15896 | #[doc = "Bus error flag clear"] | ||
| 15897 | pub const fn berrcf(&self) -> bool { | ||
| 15898 | let val = (self.0 >> 8usize) & 0x01; | ||
| 15899 | val != 0 | ||
| 15900 | } | ||
| 15901 | #[doc = "Bus error flag clear"] | ||
| 15902 | pub fn set_berrcf(&mut self, val: bool) { | ||
| 15903 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 15904 | } | ||
| 15905 | #[doc = "Arbitration lost flag clear"] | ||
| 15906 | pub const fn arlocf(&self) -> bool { | ||
| 15907 | let val = (self.0 >> 9usize) & 0x01; | ||
| 15908 | val != 0 | ||
| 15909 | } | ||
| 15910 | #[doc = "Arbitration lost flag clear"] | ||
| 15911 | pub fn set_arlocf(&mut self, val: bool) { | ||
| 15912 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | ||
| 15913 | } | ||
| 15914 | #[doc = "Overrun/Underrun flag clear"] | ||
| 15915 | pub const fn ovrcf(&self) -> bool { | ||
| 15916 | let val = (self.0 >> 10usize) & 0x01; | ||
| 15917 | val != 0 | ||
| 15918 | } | ||
| 15919 | #[doc = "Overrun/Underrun flag clear"] | ||
| 15920 | pub fn set_ovrcf(&mut self, val: bool) { | ||
| 15921 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | ||
| 15922 | } | ||
| 15923 | #[doc = "PEC Error flag clear"] | ||
| 15924 | pub const fn peccf(&self) -> bool { | ||
| 15925 | let val = (self.0 >> 11usize) & 0x01; | ||
| 15926 | val != 0 | ||
| 15927 | } | ||
| 15928 | #[doc = "PEC Error flag clear"] | ||
| 15929 | pub fn set_peccf(&mut self, val: bool) { | ||
| 15930 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); | ||
| 15931 | } | ||
| 15932 | #[doc = "Timeout detection flag clear"] | ||
| 15933 | pub const fn timoutcf(&self) -> bool { | ||
| 15934 | let val = (self.0 >> 12usize) & 0x01; | ||
| 15935 | val != 0 | ||
| 15936 | } | ||
| 15937 | #[doc = "Timeout detection flag clear"] | ||
| 15938 | pub fn set_timoutcf(&mut self, val: bool) { | ||
| 15939 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); | ||
| 15940 | } | ||
| 15941 | #[doc = "Alert flag clear"] | ||
| 15942 | pub const fn alertcf(&self) -> bool { | ||
| 15943 | let val = (self.0 >> 13usize) & 0x01; | ||
| 15944 | val != 0 | ||
| 15945 | } | ||
| 15946 | #[doc = "Alert flag clear"] | ||
| 15947 | pub fn set_alertcf(&mut self, val: bool) { | ||
| 15948 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | ||
| 15949 | } | ||
| 15950 | } | ||
| 15951 | impl Default for Icr { | ||
| 15952 | fn default() -> Icr { | ||
| 15953 | Icr(0) | ||
| 15954 | } | ||
| 15955 | } | ||
| 15956 | #[doc = "PEC register"] | ||
| 15957 | #[repr(transparent)] | ||
| 15958 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 15959 | pub struct Pecr(pub u32); | ||
| 15960 | impl Pecr { | ||
| 15961 | #[doc = "Packet error checking register"] | ||
| 15962 | pub const fn pec(&self) -> u8 { | ||
| 15963 | let val = (self.0 >> 0usize) & 0xff; | ||
| 15964 | val as u8 | ||
| 15965 | } | ||
| 15966 | #[doc = "Packet error checking register"] | ||
| 15967 | pub fn set_pec(&mut self, val: u8) { | ||
| 15968 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | ||
| 15969 | } | ||
| 15970 | } | ||
| 15971 | impl Default for Pecr { | ||
| 15972 | fn default() -> Pecr { | ||
| 15973 | Pecr(0) | ||
| 15974 | } | ||
| 15975 | } | ||
| 15976 | #[doc = "Status register 1"] | ||
| 15977 | #[repr(transparent)] | ||
| 15978 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 15979 | pub struct Timeoutr(pub u32); | ||
| 15980 | impl Timeoutr { | ||
| 15981 | #[doc = "Bus timeout A"] | ||
| 15982 | pub const fn timeouta(&self) -> u16 { | ||
| 15983 | let val = (self.0 >> 0usize) & 0x0fff; | ||
| 15984 | val as u16 | ||
| 15985 | } | ||
| 15986 | #[doc = "Bus timeout A"] | ||
| 15987 | pub fn set_timeouta(&mut self, val: u16) { | ||
| 15988 | self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); | ||
| 15989 | } | ||
| 15990 | #[doc = "Idle clock timeout detection"] | ||
| 15991 | pub const fn tidle(&self) -> bool { | ||
| 15992 | let val = (self.0 >> 12usize) & 0x01; | ||
| 15993 | val != 0 | ||
| 15994 | } | ||
| 15995 | #[doc = "Idle clock timeout detection"] | ||
| 15996 | pub fn set_tidle(&mut self, val: bool) { | ||
| 15997 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); | ||
| 15998 | } | ||
| 15999 | #[doc = "Clock timeout enable"] | ||
| 16000 | pub const fn timouten(&self) -> bool { | ||
| 16001 | let val = (self.0 >> 15usize) & 0x01; | ||
| 16002 | val != 0 | ||
| 16003 | } | ||
| 16004 | #[doc = "Clock timeout enable"] | ||
| 16005 | pub fn set_timouten(&mut self, val: bool) { | ||
| 16006 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); | ||
| 16007 | } | ||
| 16008 | #[doc = "Bus timeout B"] | ||
| 16009 | pub const fn timeoutb(&self) -> u16 { | ||
| 16010 | let val = (self.0 >> 16usize) & 0x0fff; | ||
| 16011 | val as u16 | ||
| 16012 | } | ||
| 16013 | #[doc = "Bus timeout B"] | ||
| 16014 | pub fn set_timeoutb(&mut self, val: u16) { | ||
| 16015 | self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); | ||
| 16016 | } | ||
| 16017 | #[doc = "Extended clock timeout enable"] | ||
| 16018 | pub const fn texten(&self) -> bool { | ||
| 16019 | let val = (self.0 >> 31usize) & 0x01; | ||
| 16020 | val != 0 | ||
| 16021 | } | ||
| 16022 | #[doc = "Extended clock timeout enable"] | ||
| 16023 | pub fn set_texten(&mut self, val: bool) { | ||
| 16024 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize); | ||
| 16025 | } | ||
| 16026 | } | ||
| 16027 | impl Default for Timeoutr { | ||
| 16028 | fn default() -> Timeoutr { | ||
| 16029 | Timeoutr(0) | ||
| 16030 | } | ||
| 16031 | } | ||
| 16032 | #[doc = "Own address register 2"] | ||
| 16033 | #[repr(transparent)] | ||
| 16034 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 16035 | pub struct Oar2(pub u32); | ||
| 16036 | impl Oar2 { | ||
| 16037 | #[doc = "Interface address"] | ||
| 16038 | pub const fn oa2(&self) -> u8 { | ||
| 16039 | let val = (self.0 >> 1usize) & 0x7f; | ||
| 16040 | val as u8 | ||
| 16041 | } | ||
| 16042 | #[doc = "Interface address"] | ||
| 16043 | pub fn set_oa2(&mut self, val: u8) { | ||
| 16044 | self.0 = (self.0 & !(0x7f << 1usize)) | (((val as u32) & 0x7f) << 1usize); | ||
| 16045 | } | ||
| 16046 | #[doc = "Own Address 2 masks"] | ||
| 16047 | pub const fn oa2msk(&self) -> super::vals::Oamsk { | ||
| 16048 | let val = (self.0 >> 8usize) & 0x07; | ||
| 16049 | super::vals::Oamsk(val as u8) | ||
| 16050 | } | ||
| 16051 | #[doc = "Own Address 2 masks"] | ||
| 16052 | pub fn set_oa2msk(&mut self, val: super::vals::Oamsk) { | ||
| 16053 | self.0 = (self.0 & !(0x07 << 8usize)) | (((val.0 as u32) & 0x07) << 8usize); | ||
| 16054 | } | ||
| 16055 | #[doc = "Own Address 2 enable"] | ||
| 16056 | pub const fn oa2en(&self) -> bool { | ||
| 16057 | let val = (self.0 >> 15usize) & 0x01; | ||
| 16058 | val != 0 | ||
| 16059 | } | ||
| 16060 | #[doc = "Own Address 2 enable"] | ||
| 16061 | pub fn set_oa2en(&mut self, val: bool) { | ||
| 16062 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); | ||
| 16063 | } | ||
| 16064 | } | ||
| 16065 | impl Default for Oar2 { | ||
| 16066 | fn default() -> Oar2 { | ||
| 16067 | Oar2(0) | ||
| 16068 | } | ||
| 16069 | } | ||
| 16070 | #[doc = "Own address register 1"] | ||
| 16071 | #[repr(transparent)] | ||
| 16072 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 16073 | pub struct Oar1(pub u32); | ||
| 16074 | impl Oar1 { | ||
| 16075 | #[doc = "Interface address"] | ||
| 16076 | pub const fn oa1(&self) -> u16 { | ||
| 16077 | let val = (self.0 >> 0usize) & 0x03ff; | ||
| 16078 | val as u16 | ||
| 16079 | } | ||
| 16080 | #[doc = "Interface address"] | ||
| 16081 | pub fn set_oa1(&mut self, val: u16) { | ||
| 16082 | self.0 = (self.0 & !(0x03ff << 0usize)) | (((val as u32) & 0x03ff) << 0usize); | ||
| 16083 | } | ||
| 16084 | #[doc = "Own Address 1 10-bit mode"] | ||
| 16085 | pub const fn oa1mode(&self) -> super::vals::Oamode { | ||
| 16086 | let val = (self.0 >> 10usize) & 0x01; | ||
| 16087 | super::vals::Oamode(val as u8) | ||
| 16088 | } | ||
| 16089 | #[doc = "Own Address 1 10-bit mode"] | ||
| 16090 | pub fn set_oa1mode(&mut self, val: super::vals::Oamode) { | ||
| 16091 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); | ||
| 16092 | } | ||
| 16093 | #[doc = "Own Address 1 enable"] | ||
| 16094 | pub const fn oa1en(&self) -> bool { | ||
| 16095 | let val = (self.0 >> 15usize) & 0x01; | ||
| 16096 | val != 0 | ||
| 16097 | } | ||
| 16098 | #[doc = "Own Address 1 enable"] | ||
| 16099 | pub fn set_oa1en(&mut self, val: bool) { | ||
| 16100 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); | ||
| 16101 | } | ||
| 16102 | } | ||
| 16103 | impl Default for Oar1 { | ||
| 16104 | fn default() -> Oar1 { | ||
| 16105 | Oar1(0) | ||
| 16106 | } | ||
| 16107 | } | ||
| 16108 | #[doc = "Interrupt and Status register"] | ||
| 16109 | #[repr(transparent)] | ||
| 16110 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 16111 | pub struct Isr(pub u32); | ||
| 16112 | impl Isr { | ||
| 16113 | #[doc = "Transmit data register empty (transmitters)"] | ||
| 16114 | pub const fn txe(&self) -> bool { | ||
| 16115 | let val = (self.0 >> 0usize) & 0x01; | ||
| 16116 | val != 0 | ||
| 16117 | } | ||
| 16118 | #[doc = "Transmit data register empty (transmitters)"] | ||
| 16119 | pub fn set_txe(&mut self, val: bool) { | ||
| 16120 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 16121 | } | ||
| 16122 | #[doc = "Transmit interrupt status (transmitters)"] | ||
| 16123 | pub const fn txis(&self) -> bool { | ||
| 16124 | let val = (self.0 >> 1usize) & 0x01; | ||
| 16125 | val != 0 | ||
| 16126 | } | ||
| 16127 | #[doc = "Transmit interrupt status (transmitters)"] | ||
| 16128 | pub fn set_txis(&mut self, val: bool) { | ||
| 16129 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | ||
| 16130 | } | ||
| 16131 | #[doc = "Receive data register not empty (receivers)"] | ||
| 16132 | pub const fn rxne(&self) -> bool { | ||
| 16133 | let val = (self.0 >> 2usize) & 0x01; | ||
| 16134 | val != 0 | ||
| 16135 | } | ||
| 16136 | #[doc = "Receive data register not empty (receivers)"] | ||
| 16137 | pub fn set_rxne(&mut self, val: bool) { | ||
| 16138 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 16139 | } | ||
| 16140 | #[doc = "Address matched (slave mode)"] | ||
| 16141 | pub const fn addr(&self) -> bool { | ||
| 16142 | let val = (self.0 >> 3usize) & 0x01; | ||
| 16143 | val != 0 | ||
| 16144 | } | ||
| 16145 | #[doc = "Address matched (slave mode)"] | ||
| 16146 | pub fn set_addr(&mut self, val: bool) { | ||
| 16147 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | ||
| 16148 | } | ||
| 16149 | #[doc = "Not acknowledge received flag"] | ||
| 16150 | pub const fn nackf(&self) -> bool { | ||
| 16151 | let val = (self.0 >> 4usize) & 0x01; | ||
| 16152 | val != 0 | ||
| 16153 | } | ||
| 16154 | #[doc = "Not acknowledge received flag"] | ||
| 16155 | pub fn set_nackf(&mut self, val: bool) { | ||
| 16156 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | ||
| 16157 | } | ||
| 16158 | #[doc = "Stop detection flag"] | ||
| 16159 | pub const fn stopf(&self) -> bool { | ||
| 16160 | let val = (self.0 >> 5usize) & 0x01; | ||
| 16161 | val != 0 | ||
| 16162 | } | ||
| 16163 | #[doc = "Stop detection flag"] | ||
| 16164 | pub fn set_stopf(&mut self, val: bool) { | ||
| 16165 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 16166 | } | ||
| 16167 | #[doc = "Transfer Complete (master mode)"] | ||
| 16168 | pub const fn tc(&self) -> bool { | ||
| 16169 | let val = (self.0 >> 6usize) & 0x01; | ||
| 16170 | val != 0 | ||
| 16171 | } | ||
| 16172 | #[doc = "Transfer Complete (master mode)"] | ||
| 16173 | pub fn set_tc(&mut self, val: bool) { | ||
| 16174 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 16175 | } | ||
| 16176 | #[doc = "Transfer Complete Reload"] | ||
| 16177 | pub const fn tcr(&self) -> bool { | ||
| 16178 | let val = (self.0 >> 7usize) & 0x01; | ||
| 16179 | val != 0 | ||
| 16180 | } | ||
| 16181 | #[doc = "Transfer Complete Reload"] | ||
| 16182 | pub fn set_tcr(&mut self, val: bool) { | ||
| 16183 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 16184 | } | ||
| 16185 | #[doc = "Bus error"] | ||
| 16186 | pub const fn berr(&self) -> bool { | ||
| 16187 | let val = (self.0 >> 8usize) & 0x01; | ||
| 16188 | val != 0 | ||
| 16189 | } | ||
| 16190 | #[doc = "Bus error"] | ||
| 16191 | pub fn set_berr(&mut self, val: bool) { | ||
| 16192 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 16193 | } | ||
| 16194 | #[doc = "Arbitration lost"] | ||
| 16195 | pub const fn arlo(&self) -> bool { | ||
| 16196 | let val = (self.0 >> 9usize) & 0x01; | ||
| 16197 | val != 0 | ||
| 16198 | } | ||
| 16199 | #[doc = "Arbitration lost"] | ||
| 16200 | pub fn set_arlo(&mut self, val: bool) { | ||
| 16201 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | ||
| 16202 | } | ||
| 16203 | #[doc = "Overrun/Underrun (slave mode)"] | ||
| 16204 | pub const fn ovr(&self) -> bool { | ||
| 16205 | let val = (self.0 >> 10usize) & 0x01; | ||
| 16206 | val != 0 | ||
| 16207 | } | ||
| 16208 | #[doc = "Overrun/Underrun (slave mode)"] | ||
| 16209 | pub fn set_ovr(&mut self, val: bool) { | ||
| 16210 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | ||
| 16211 | } | ||
| 16212 | #[doc = "PEC Error in reception"] | ||
| 16213 | pub const fn pecerr(&self) -> super::vals::Pecerr { | ||
| 16214 | let val = (self.0 >> 11usize) & 0x01; | ||
| 16215 | super::vals::Pecerr(val as u8) | ||
| 16216 | } | ||
| 16217 | #[doc = "PEC Error in reception"] | ||
| 16218 | pub fn set_pecerr(&mut self, val: super::vals::Pecerr) { | ||
| 16219 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); | ||
| 16220 | } | ||
| 16221 | #[doc = "Timeout or t_low detection flag"] | ||
| 16222 | pub const fn timeout(&self) -> bool { | ||
| 16223 | let val = (self.0 >> 12usize) & 0x01; | ||
| 16224 | val != 0 | ||
| 16225 | } | ||
| 16226 | #[doc = "Timeout or t_low detection flag"] | ||
| 16227 | pub fn set_timeout(&mut self, val: bool) { | ||
| 16228 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); | ||
| 16229 | } | ||
| 16230 | #[doc = "SMBus alert"] | ||
| 16231 | pub const fn alert(&self) -> bool { | ||
| 16232 | let val = (self.0 >> 13usize) & 0x01; | ||
| 16233 | val != 0 | ||
| 16234 | } | ||
| 16235 | #[doc = "SMBus alert"] | ||
| 16236 | pub fn set_alert(&mut self, val: bool) { | ||
| 16237 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | ||
| 16238 | } | ||
| 16239 | #[doc = "Bus busy"] | ||
| 16240 | pub const fn busy(&self) -> bool { | ||
| 16241 | let val = (self.0 >> 15usize) & 0x01; | ||
| 16242 | val != 0 | ||
| 16243 | } | ||
| 16244 | #[doc = "Bus busy"] | ||
| 16245 | pub fn set_busy(&mut self, val: bool) { | ||
| 16246 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); | ||
| 16247 | } | ||
| 16248 | #[doc = "Transfer direction (Slave mode)"] | ||
| 16249 | pub const fn dir(&self) -> super::vals::Dir { | ||
| 16250 | let val = (self.0 >> 16usize) & 0x01; | ||
| 16251 | super::vals::Dir(val as u8) | ||
| 16252 | } | ||
| 16253 | #[doc = "Transfer direction (Slave mode)"] | ||
| 16254 | pub fn set_dir(&mut self, val: super::vals::Dir) { | ||
| 16255 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 16256 | } | ||
| 16257 | #[doc = "Address match code (Slave mode)"] | ||
| 16258 | pub const fn addcode(&self) -> u8 { | ||
| 16259 | let val = (self.0 >> 17usize) & 0x7f; | ||
| 16260 | val as u8 | ||
| 16261 | } | ||
| 16262 | #[doc = "Address match code (Slave mode)"] | ||
| 16263 | pub fn set_addcode(&mut self, val: u8) { | ||
| 16264 | self.0 = (self.0 & !(0x7f << 17usize)) | (((val as u32) & 0x7f) << 17usize); | ||
| 16265 | } | ||
| 16266 | } | ||
| 16267 | impl Default for Isr { | ||
| 16268 | fn default() -> Isr { | ||
| 16269 | Isr(0) | ||
| 16270 | } | ||
| 16271 | } | ||
| 16272 | #[doc = "Control register 2"] | ||
| 16273 | #[repr(transparent)] | ||
| 16274 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 16275 | pub struct Cr2(pub u32); | ||
| 16276 | impl Cr2 { | ||
| 16277 | #[doc = "Slave address bit (master mode)"] | ||
| 16278 | pub const fn sadd(&self) -> u16 { | ||
| 16279 | let val = (self.0 >> 0usize) & 0x03ff; | ||
| 16280 | val as u16 | ||
| 16281 | } | ||
| 16282 | #[doc = "Slave address bit (master mode)"] | ||
| 16283 | pub fn set_sadd(&mut self, val: u16) { | ||
| 16284 | self.0 = (self.0 & !(0x03ff << 0usize)) | (((val as u32) & 0x03ff) << 0usize); | ||
| 16285 | } | ||
| 16286 | #[doc = "Transfer direction (master mode)"] | ||
| 16287 | pub const fn rd_wrn(&self) -> super::vals::RdWrn { | ||
| 16288 | let val = (self.0 >> 10usize) & 0x01; | ||
| 16289 | super::vals::RdWrn(val as u8) | ||
| 16290 | } | ||
| 16291 | #[doc = "Transfer direction (master mode)"] | ||
| 16292 | pub fn set_rd_wrn(&mut self, val: super::vals::RdWrn) { | ||
| 16293 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); | ||
| 16294 | } | ||
| 16295 | #[doc = "10-bit addressing mode (master mode)"] | ||
| 16296 | pub const fn add10(&self) -> super::vals::Add { | ||
| 16297 | let val = (self.0 >> 11usize) & 0x01; | ||
| 16298 | super::vals::Add(val as u8) | ||
| 16299 | } | ||
| 16300 | #[doc = "10-bit addressing mode (master mode)"] | ||
| 16301 | pub fn set_add10(&mut self, val: super::vals::Add) { | ||
| 16302 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); | ||
| 16303 | } | ||
| 16304 | #[doc = "10-bit address header only read direction (master receiver mode)"] | ||
| 16305 | pub const fn head10r(&self) -> super::vals::Headr { | ||
| 16306 | let val = (self.0 >> 12usize) & 0x01; | ||
| 16307 | super::vals::Headr(val as u8) | ||
| 16308 | } | ||
| 16309 | #[doc = "10-bit address header only read direction (master receiver mode)"] | ||
| 16310 | pub fn set_head10r(&mut self, val: super::vals::Headr) { | ||
| 16311 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 16312 | } | ||
| 16313 | #[doc = "Start generation"] | ||
| 16314 | pub const fn start(&self) -> super::vals::Start { | ||
| 16315 | let val = (self.0 >> 13usize) & 0x01; | ||
| 16316 | super::vals::Start(val as u8) | ||
| 16317 | } | ||
| 16318 | #[doc = "Start generation"] | ||
| 16319 | pub fn set_start(&mut self, val: super::vals::Start) { | ||
| 16320 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize); | ||
| 16321 | } | ||
| 16322 | #[doc = "Stop generation (master mode)"] | ||
| 16323 | pub const fn stop(&self) -> super::vals::Stop { | ||
| 16324 | let val = (self.0 >> 14usize) & 0x01; | ||
| 16325 | super::vals::Stop(val as u8) | ||
| 16326 | } | ||
| 16327 | #[doc = "Stop generation (master mode)"] | ||
| 16328 | pub fn set_stop(&mut self, val: super::vals::Stop) { | ||
| 16329 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | ||
| 16330 | } | ||
| 16331 | #[doc = "NACK generation (slave mode)"] | ||
| 16332 | pub const fn nack(&self) -> super::vals::Nack { | ||
| 16333 | let val = (self.0 >> 15usize) & 0x01; | ||
| 16334 | super::vals::Nack(val as u8) | ||
| 16335 | } | ||
| 16336 | #[doc = "NACK generation (slave mode)"] | ||
| 16337 | pub fn set_nack(&mut self, val: super::vals::Nack) { | ||
| 16338 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 16339 | } | ||
| 16340 | #[doc = "Number of bytes"] | ||
| 16341 | pub const fn nbytes(&self) -> u8 { | ||
| 16342 | let val = (self.0 >> 16usize) & 0xff; | ||
| 16343 | val as u8 | ||
| 16344 | } | ||
| 16345 | #[doc = "Number of bytes"] | ||
| 16346 | pub fn set_nbytes(&mut self, val: u8) { | ||
| 16347 | self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize); | ||
| 16348 | } | ||
| 16349 | #[doc = "NBYTES reload mode"] | ||
| 16350 | pub const fn reload(&self) -> super::vals::Reload { | ||
| 16351 | let val = (self.0 >> 24usize) & 0x01; | ||
| 16352 | super::vals::Reload(val as u8) | ||
| 12186 | } | 16353 | } |
| 16354 | #[doc = "NBYTES reload mode"] | ||
| 16355 | pub fn set_reload(&mut self, val: super::vals::Reload) { | ||
| 16356 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); | ||
| 16357 | } | ||
| 16358 | #[doc = "Automatic end mode (master mode)"] | ||
| 16359 | pub const fn autoend(&self) -> super::vals::Autoend { | ||
| 16360 | let val = (self.0 >> 25usize) & 0x01; | ||
| 16361 | super::vals::Autoend(val as u8) | ||
| 16362 | } | ||
| 16363 | #[doc = "Automatic end mode (master mode)"] | ||
| 16364 | pub fn set_autoend(&mut self, val: super::vals::Autoend) { | ||
| 16365 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize); | ||
| 16366 | } | ||
| 16367 | #[doc = "Packet error checking byte"] | ||
| 16368 | pub const fn pecbyte(&self) -> super::vals::Pecbyte { | ||
| 16369 | let val = (self.0 >> 26usize) & 0x01; | ||
| 16370 | super::vals::Pecbyte(val as u8) | ||
| 16371 | } | ||
| 16372 | #[doc = "Packet error checking byte"] | ||
| 16373 | pub fn set_pecbyte(&mut self, val: super::vals::Pecbyte) { | ||
| 16374 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val.0 as u32) & 0x01) << 26usize); | ||
| 16375 | } | ||
| 16376 | } | ||
| 16377 | impl Default for Cr2 { | ||
| 16378 | fn default() -> Cr2 { | ||
| 16379 | Cr2(0) | ||
| 16380 | } | ||
| 16381 | } | ||
| 16382 | #[doc = "Receive data register"] | ||
| 16383 | #[repr(transparent)] | ||
| 16384 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 16385 | pub struct Rxdr(pub u32); | ||
| 16386 | impl Rxdr { | ||
| 16387 | #[doc = "8-bit receive data"] | ||
| 16388 | pub const fn rxdata(&self) -> u8 { | ||
| 16389 | let val = (self.0 >> 0usize) & 0xff; | ||
| 16390 | val as u8 | ||
| 16391 | } | ||
| 16392 | #[doc = "8-bit receive data"] | ||
| 16393 | pub fn set_rxdata(&mut self, val: u8) { | ||
| 16394 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | ||
| 16395 | } | ||
| 16396 | } | ||
| 16397 | impl Default for Rxdr { | ||
| 16398 | fn default() -> Rxdr { | ||
| 16399 | Rxdr(0) | ||
| 16400 | } | ||
| 16401 | } | ||
| 16402 | } | ||
| 16403 | } | ||
| 16404 | pub mod rcc_h7 { | ||
| 16405 | use crate::generic::*; | ||
| 16406 | #[doc = "Reset and clock control"] | ||
| 16407 | #[derive(Copy, Clone)] | ||
| 16408 | pub struct Rcc(pub *mut u8); | ||
| 16409 | unsafe impl Send for Rcc {} | ||
| 16410 | unsafe impl Sync for Rcc {} | ||
| 16411 | impl Rcc { | ||
| 16412 | #[doc = "clock control register"] | ||
| 16413 | pub fn cr(self) -> Reg<regs::Cr, RW> { | ||
| 16414 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 16415 | } | ||
| 16416 | #[doc = "RCC HSI configuration register"] | ||
| 16417 | pub fn hsicfgr(self) -> Reg<regs::Hsicfgr, RW> { | ||
| 16418 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 16419 | } | ||
| 16420 | #[doc = "RCC Internal Clock Source Calibration Register"] | ||
| 16421 | pub fn icscr(self) -> Reg<regs::Icscr, RW> { | ||
| 16422 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 16423 | } | ||
| 16424 | #[doc = "RCC Clock Recovery RC Register"] | ||
| 16425 | pub fn crrcr(self) -> Reg<regs::Crrcr, R> { | ||
| 16426 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 16427 | } | ||
| 16428 | #[doc = "RCC CSI configuration register"] | ||
| 16429 | pub fn csicfgr(self) -> Reg<regs::Csicfgr, RW> { | ||
| 16430 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 16431 | } | ||
| 16432 | #[doc = "RCC Clock Configuration Register"] | ||
| 16433 | pub fn cfgr(self) -> Reg<regs::Cfgr, RW> { | ||
| 16434 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 16435 | } | ||
| 16436 | #[doc = "RCC Domain 1 Clock Configuration Register"] | ||
| 16437 | pub fn d1cfgr(self) -> Reg<regs::D1cfgr, RW> { | ||
| 16438 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | ||
| 16439 | } | ||
| 16440 | #[doc = "RCC Domain 2 Clock Configuration Register"] | ||
| 16441 | pub fn d2cfgr(self) -> Reg<regs::D2cfgr, RW> { | ||
| 16442 | unsafe { Reg::from_ptr(self.0.add(28usize)) } | ||
| 16443 | } | ||
| 16444 | #[doc = "RCC Domain 3 Clock Configuration Register"] | ||
| 16445 | pub fn d3cfgr(self) -> Reg<regs::D3cfgr, RW> { | ||
| 16446 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | ||
| 16447 | } | ||
| 16448 | #[doc = "RCC PLLs Clock Source Selection Register"] | ||
| 16449 | pub fn pllckselr(self) -> Reg<regs::Pllckselr, RW> { | ||
| 16450 | unsafe { Reg::from_ptr(self.0.add(40usize)) } | ||
| 16451 | } | ||
| 16452 | #[doc = "RCC PLLs Configuration Register"] | ||
| 16453 | pub fn pllcfgr(self) -> Reg<regs::Pllcfgr, RW> { | ||
| 16454 | unsafe { Reg::from_ptr(self.0.add(44usize)) } | ||
| 16455 | } | ||
| 16456 | #[doc = "RCC PLL1 Dividers Configuration Register"] | ||
| 16457 | pub fn plldivr(self, n: usize) -> Reg<regs::Pll1divr, RW> { | ||
| 16458 | assert!(n < 3usize); | ||
| 16459 | unsafe { Reg::from_ptr(self.0.add(48usize + n * 8usize)) } | ||
| 16460 | } | ||
| 16461 | #[doc = "RCC PLL1 Fractional Divider Register"] | ||
| 16462 | pub fn pllfracr(self, n: usize) -> Reg<regs::Pll1fracr, RW> { | ||
| 16463 | assert!(n < 3usize); | ||
| 16464 | unsafe { Reg::from_ptr(self.0.add(52usize + n * 8usize)) } | ||
| 16465 | } | ||
| 16466 | #[doc = "RCC Domain 1 Kernel Clock Configuration Register"] | ||
| 16467 | pub fn d1ccipr(self) -> Reg<regs::D1ccipr, RW> { | ||
| 16468 | unsafe { Reg::from_ptr(self.0.add(76usize)) } | ||
| 16469 | } | ||
| 16470 | #[doc = "RCC Domain 2 Kernel Clock Configuration Register"] | ||
| 16471 | pub fn d2ccip1r(self) -> Reg<regs::D2ccip1r, RW> { | ||
| 16472 | unsafe { Reg::from_ptr(self.0.add(80usize)) } | ||
| 16473 | } | ||
| 16474 | #[doc = "RCC Domain 2 Kernel Clock Configuration Register"] | ||
| 16475 | pub fn d2ccip2r(self) -> Reg<regs::D2ccip2r, RW> { | ||
| 16476 | unsafe { Reg::from_ptr(self.0.add(84usize)) } | ||
| 16477 | } | ||
| 16478 | #[doc = "RCC Domain 3 Kernel Clock Configuration Register"] | ||
| 16479 | pub fn d3ccipr(self) -> Reg<regs::D3ccipr, RW> { | ||
| 16480 | unsafe { Reg::from_ptr(self.0.add(88usize)) } | ||
| 16481 | } | ||
| 16482 | #[doc = "RCC Clock Source Interrupt Enable Register"] | ||
| 16483 | pub fn cier(self) -> Reg<regs::Cier, RW> { | ||
| 16484 | unsafe { Reg::from_ptr(self.0.add(96usize)) } | ||
| 16485 | } | ||
| 16486 | #[doc = "RCC Clock Source Interrupt Flag Register"] | ||
| 16487 | pub fn cifr(self) -> Reg<regs::Cifr, R> { | ||
| 16488 | unsafe { Reg::from_ptr(self.0.add(100usize)) } | ||
| 16489 | } | ||
| 16490 | #[doc = "RCC Clock Source Interrupt Clear Register"] | ||
| 16491 | pub fn cicr(self) -> Reg<regs::Cicr, RW> { | ||
| 16492 | unsafe { Reg::from_ptr(self.0.add(104usize)) } | ||
| 16493 | } | ||
| 16494 | #[doc = "RCC Backup Domain Control Register"] | ||
| 16495 | pub fn bdcr(self) -> Reg<regs::Bdcr, RW> { | ||
| 16496 | unsafe { Reg::from_ptr(self.0.add(112usize)) } | ||
| 16497 | } | ||
| 16498 | #[doc = "RCC Clock Control and Status Register"] | ||
| 16499 | pub fn csr(self) -> Reg<regs::Csr, RW> { | ||
| 16500 | unsafe { Reg::from_ptr(self.0.add(116usize)) } | ||
| 16501 | } | ||
| 16502 | #[doc = "RCC AHB3 Reset Register"] | ||
| 16503 | pub fn ahb3rstr(self) -> Reg<regs::Ahb3rstr, RW> { | ||
| 16504 | unsafe { Reg::from_ptr(self.0.add(124usize)) } | ||
| 16505 | } | ||
| 16506 | #[doc = "RCC AHB1 Peripheral Reset Register"] | ||
| 16507 | pub fn ahb1rstr(self) -> Reg<regs::Ahb1rstr, RW> { | ||
| 16508 | unsafe { Reg::from_ptr(self.0.add(128usize)) } | ||
| 16509 | } | ||
| 16510 | #[doc = "RCC AHB2 Peripheral Reset Register"] | ||
| 16511 | pub fn ahb2rstr(self) -> Reg<regs::Ahb2rstr, RW> { | ||
| 16512 | unsafe { Reg::from_ptr(self.0.add(132usize)) } | ||
| 16513 | } | ||
| 16514 | #[doc = "RCC AHB4 Peripheral Reset Register"] | ||
| 16515 | pub fn ahb4rstr(self) -> Reg<regs::Ahb4rstr, RW> { | ||
| 16516 | unsafe { Reg::from_ptr(self.0.add(136usize)) } | ||
| 16517 | } | ||
| 16518 | #[doc = "RCC APB3 Peripheral Reset Register"] | ||
| 16519 | pub fn apb3rstr(self) -> Reg<regs::Apb3rstr, RW> { | ||
| 16520 | unsafe { Reg::from_ptr(self.0.add(140usize)) } | ||
| 16521 | } | ||
| 16522 | #[doc = "RCC APB1 Peripheral Reset Register"] | ||
| 16523 | pub fn apb1lrstr(self) -> Reg<regs::Apb1lrstr, RW> { | ||
| 16524 | unsafe { Reg::from_ptr(self.0.add(144usize)) } | ||
| 16525 | } | ||
| 16526 | #[doc = "RCC APB1 Peripheral Reset Register"] | ||
| 16527 | pub fn apb1hrstr(self) -> Reg<regs::Apb1hrstr, RW> { | ||
| 16528 | unsafe { Reg::from_ptr(self.0.add(148usize)) } | ||
| 16529 | } | ||
| 16530 | #[doc = "RCC APB2 Peripheral Reset Register"] | ||
| 16531 | pub fn apb2rstr(self) -> Reg<regs::Apb2rstr, RW> { | ||
| 16532 | unsafe { Reg::from_ptr(self.0.add(152usize)) } | ||
| 16533 | } | ||
| 16534 | #[doc = "RCC APB4 Peripheral Reset Register"] | ||
| 16535 | pub fn apb4rstr(self) -> Reg<regs::Apb4rstr, RW> { | ||
| 16536 | unsafe { Reg::from_ptr(self.0.add(156usize)) } | ||
| 16537 | } | ||
| 16538 | #[doc = "RCC Global Control Register"] | ||
| 16539 | pub fn gcr(self) -> Reg<regs::Gcr, RW> { | ||
| 16540 | unsafe { Reg::from_ptr(self.0.add(160usize)) } | ||
| 16541 | } | ||
| 16542 | #[doc = "RCC D3 Autonomous mode Register"] | ||
| 16543 | pub fn d3amr(self) -> Reg<regs::D3amr, RW> { | ||
| 16544 | unsafe { Reg::from_ptr(self.0.add(168usize)) } | ||
| 16545 | } | ||
| 16546 | #[doc = "RCC Reset Status Register"] | ||
| 16547 | pub fn rsr(self) -> Reg<regs::Rsr, RW> { | ||
| 16548 | unsafe { Reg::from_ptr(self.0.add(208usize)) } | ||
| 16549 | } | ||
| 16550 | #[doc = "RCC AHB3 Clock Register"] | ||
| 16551 | pub fn ahb3enr(self) -> Reg<regs::Ahb3enr, RW> { | ||
| 16552 | unsafe { Reg::from_ptr(self.0.add(212usize)) } | ||
| 16553 | } | ||
| 16554 | #[doc = "RCC AHB1 Clock Register"] | ||
| 16555 | pub fn ahb1enr(self) -> Reg<regs::Ahb1enr, RW> { | ||
| 16556 | unsafe { Reg::from_ptr(self.0.add(216usize)) } | ||
| 16557 | } | ||
| 16558 | #[doc = "RCC AHB2 Clock Register"] | ||
| 16559 | pub fn ahb2enr(self) -> Reg<regs::Ahb2enr, RW> { | ||
| 16560 | unsafe { Reg::from_ptr(self.0.add(220usize)) } | ||
| 16561 | } | ||
| 16562 | #[doc = "RCC AHB4 Clock Register"] | ||
| 16563 | pub fn ahb4enr(self) -> Reg<regs::Ahb4enr, RW> { | ||
| 16564 | unsafe { Reg::from_ptr(self.0.add(224usize)) } | ||
| 16565 | } | ||
| 16566 | #[doc = "RCC APB3 Clock Register"] | ||
| 16567 | pub fn apb3enr(self) -> Reg<regs::Apb3enr, RW> { | ||
| 16568 | unsafe { Reg::from_ptr(self.0.add(228usize)) } | ||
| 16569 | } | ||
| 16570 | #[doc = "RCC APB1 Clock Register"] | ||
| 16571 | pub fn apb1lenr(self) -> Reg<regs::Apb1lenr, RW> { | ||
| 16572 | unsafe { Reg::from_ptr(self.0.add(232usize)) } | ||
| 16573 | } | ||
| 16574 | #[doc = "RCC APB1 Clock Register"] | ||
| 16575 | pub fn apb1henr(self) -> Reg<regs::Apb1henr, RW> { | ||
| 16576 | unsafe { Reg::from_ptr(self.0.add(236usize)) } | ||
| 16577 | } | ||
| 16578 | #[doc = "RCC APB2 Clock Register"] | ||
| 16579 | pub fn apb2enr(self) -> Reg<regs::Apb2enr, RW> { | ||
| 16580 | unsafe { Reg::from_ptr(self.0.add(240usize)) } | ||
| 16581 | } | ||
| 16582 | #[doc = "RCC APB4 Clock Register"] | ||
| 16583 | pub fn apb4enr(self) -> Reg<regs::Apb4enr, RW> { | ||
| 16584 | unsafe { Reg::from_ptr(self.0.add(244usize)) } | ||
| 16585 | } | ||
| 16586 | #[doc = "RCC AHB3 Sleep Clock Register"] | ||
| 16587 | pub fn ahb3lpenr(self) -> Reg<regs::Ahb3lpenr, RW> { | ||
| 16588 | unsafe { Reg::from_ptr(self.0.add(252usize)) } | ||
| 16589 | } | ||
| 16590 | #[doc = "RCC AHB1 Sleep Clock Register"] | ||
| 16591 | pub fn ahb1lpenr(self) -> Reg<regs::Ahb1lpenr, RW> { | ||
| 16592 | unsafe { Reg::from_ptr(self.0.add(256usize)) } | ||
| 16593 | } | ||
| 16594 | #[doc = "RCC AHB2 Sleep Clock Register"] | ||
| 16595 | pub fn ahb2lpenr(self) -> Reg<regs::Ahb2lpenr, RW> { | ||
| 16596 | unsafe { Reg::from_ptr(self.0.add(260usize)) } | ||
| 16597 | } | ||
| 16598 | #[doc = "RCC AHB4 Sleep Clock Register"] | ||
| 16599 | pub fn ahb4lpenr(self) -> Reg<regs::Ahb4lpenr, RW> { | ||
| 16600 | unsafe { Reg::from_ptr(self.0.add(264usize)) } | ||
| 16601 | } | ||
| 16602 | #[doc = "RCC APB3 Sleep Clock Register"] | ||
| 16603 | pub fn apb3lpenr(self) -> Reg<regs::Apb3lpenr, RW> { | ||
| 16604 | unsafe { Reg::from_ptr(self.0.add(268usize)) } | ||
| 16605 | } | ||
| 16606 | #[doc = "RCC APB1 Low Sleep Clock Register"] | ||
| 16607 | pub fn apb1llpenr(self) -> Reg<regs::Apb1llpenr, RW> { | ||
| 16608 | unsafe { Reg::from_ptr(self.0.add(272usize)) } | ||
| 16609 | } | ||
| 16610 | #[doc = "RCC APB1 High Sleep Clock Register"] | ||
| 16611 | pub fn apb1hlpenr(self) -> Reg<regs::Apb1hlpenr, RW> { | ||
| 16612 | unsafe { Reg::from_ptr(self.0.add(276usize)) } | ||
| 16613 | } | ||
| 16614 | #[doc = "RCC APB2 Sleep Clock Register"] | ||
| 16615 | pub fn apb2lpenr(self) -> Reg<regs::Apb2lpenr, RW> { | ||
| 16616 | unsafe { Reg::from_ptr(self.0.add(280usize)) } | ||
| 16617 | } | ||
| 16618 | #[doc = "RCC APB4 Sleep Clock Register"] | ||
| 16619 | pub fn apb4lpenr(self) -> Reg<regs::Apb4lpenr, RW> { | ||
| 16620 | unsafe { Reg::from_ptr(self.0.add(284usize)) } | ||
| 16621 | } | ||
| 16622 | #[doc = "RCC Reset Status Register"] | ||
| 16623 | pub fn c1_rsr(self) -> Reg<regs::C1Rsr, RW> { | ||
| 16624 | unsafe { Reg::from_ptr(self.0.add(304usize)) } | ||
| 16625 | } | ||
| 16626 | #[doc = "RCC AHB3 Clock Register"] | ||
| 16627 | pub fn c1_ahb3enr(self) -> Reg<regs::C1Ahb3enr, RW> { | ||
| 16628 | unsafe { Reg::from_ptr(self.0.add(308usize)) } | ||
| 16629 | } | ||
| 16630 | #[doc = "RCC AHB1 Clock Register"] | ||
| 16631 | pub fn c1_ahb1enr(self) -> Reg<regs::C1Ahb1enr, RW> { | ||
| 16632 | unsafe { Reg::from_ptr(self.0.add(312usize)) } | ||
| 16633 | } | ||
| 16634 | #[doc = "RCC AHB2 Clock Register"] | ||
| 16635 | pub fn c1_ahb2enr(self) -> Reg<regs::C1Ahb2enr, RW> { | ||
| 16636 | unsafe { Reg::from_ptr(self.0.add(316usize)) } | ||
| 16637 | } | ||
| 16638 | #[doc = "RCC AHB4 Clock Register"] | ||
| 16639 | pub fn c1_ahb4enr(self) -> Reg<regs::C1Ahb4enr, RW> { | ||
| 16640 | unsafe { Reg::from_ptr(self.0.add(320usize)) } | ||
| 16641 | } | ||
| 16642 | #[doc = "RCC APB3 Clock Register"] | ||
| 16643 | pub fn c1_apb3enr(self) -> Reg<regs::C1Apb3enr, RW> { | ||
| 16644 | unsafe { Reg::from_ptr(self.0.add(324usize)) } | ||
| 16645 | } | ||
| 16646 | #[doc = "RCC APB1 Clock Register"] | ||
| 16647 | pub fn c1_apb1lenr(self) -> Reg<regs::C1Apb1lenr, RW> { | ||
| 16648 | unsafe { Reg::from_ptr(self.0.add(328usize)) } | ||
| 16649 | } | ||
| 16650 | #[doc = "RCC APB1 Clock Register"] | ||
| 16651 | pub fn c1_apb1henr(self) -> Reg<regs::C1Apb1henr, RW> { | ||
| 16652 | unsafe { Reg::from_ptr(self.0.add(332usize)) } | ||
| 16653 | } | ||
| 16654 | #[doc = "RCC APB2 Clock Register"] | ||
| 16655 | pub fn c1_apb2enr(self) -> Reg<regs::C1Apb2enr, RW> { | ||
| 16656 | unsafe { Reg::from_ptr(self.0.add(336usize)) } | ||
| 16657 | } | ||
| 16658 | #[doc = "RCC APB4 Clock Register"] | ||
| 16659 | pub fn c1_apb4enr(self) -> Reg<regs::C1Apb4enr, RW> { | ||
| 16660 | unsafe { Reg::from_ptr(self.0.add(340usize)) } | ||
| 16661 | } | ||
| 16662 | #[doc = "RCC AHB3 Sleep Clock Register"] | ||
| 16663 | pub fn c1_ahb3lpenr(self) -> Reg<regs::C1Ahb3lpenr, RW> { | ||
| 16664 | unsafe { Reg::from_ptr(self.0.add(348usize)) } | ||
| 16665 | } | ||
| 16666 | #[doc = "RCC AHB1 Sleep Clock Register"] | ||
| 16667 | pub fn c1_ahb1lpenr(self) -> Reg<regs::C1Ahb1lpenr, RW> { | ||
| 16668 | unsafe { Reg::from_ptr(self.0.add(352usize)) } | ||
| 16669 | } | ||
| 16670 | #[doc = "RCC AHB2 Sleep Clock Register"] | ||
| 16671 | pub fn c1_ahb2lpenr(self) -> Reg<regs::C1Ahb2lpenr, RW> { | ||
| 16672 | unsafe { Reg::from_ptr(self.0.add(356usize)) } | ||
| 16673 | } | ||
| 16674 | #[doc = "RCC AHB4 Sleep Clock Register"] | ||
| 16675 | pub fn c1_ahb4lpenr(self) -> Reg<regs::C1Ahb4lpenr, RW> { | ||
| 16676 | unsafe { Reg::from_ptr(self.0.add(360usize)) } | ||
| 16677 | } | ||
| 16678 | #[doc = "RCC APB3 Sleep Clock Register"] | ||
| 16679 | pub fn c1_apb3lpenr(self) -> Reg<regs::C1Apb3lpenr, RW> { | ||
| 16680 | unsafe { Reg::from_ptr(self.0.add(364usize)) } | ||
| 16681 | } | ||
| 16682 | #[doc = "RCC APB1 Low Sleep Clock Register"] | ||
| 16683 | pub fn c1_apb1llpenr(self) -> Reg<regs::C1Apb1llpenr, RW> { | ||
| 16684 | unsafe { Reg::from_ptr(self.0.add(368usize)) } | ||
| 16685 | } | ||
| 16686 | #[doc = "RCC APB1 High Sleep Clock Register"] | ||
| 16687 | pub fn c1_apb1hlpenr(self) -> Reg<regs::C1Apb1hlpenr, RW> { | ||
| 16688 | unsafe { Reg::from_ptr(self.0.add(372usize)) } | ||
| 16689 | } | ||
| 16690 | #[doc = "RCC APB2 Sleep Clock Register"] | ||
| 16691 | pub fn c1_apb2lpenr(self) -> Reg<regs::C1Apb2lpenr, RW> { | ||
| 16692 | unsafe { Reg::from_ptr(self.0.add(376usize)) } | ||
| 16693 | } | ||
| 16694 | #[doc = "RCC APB4 Sleep Clock Register"] | ||
| 16695 | pub fn c1_apb4lpenr(self) -> Reg<regs::C1Apb4lpenr, RW> { | ||
| 16696 | unsafe { Reg::from_ptr(self.0.add(380usize)) } | ||
| 12187 | } | 16697 | } |
| 12188 | } | 16698 | } |
| 12189 | pub mod vals { | 16699 | pub mod vals { |
| 12190 | use crate::generic::*; | 16700 | use crate::generic::*; |
| 12191 | #[repr(transparent)] | 16701 | #[repr(transparent)] |
| 12192 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 16702 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12193 | pub struct Msirange(pub u8); | 16703 | pub struct Ahb2enrDcmien(pub u8); |
| 12194 | impl Msirange { | 16704 | impl Ahb2enrDcmien { |
| 12195 | #[doc = "range 0 around 65.536 kHz"] | 16705 | #[doc = "The selected clock is disabled"] |
| 12196 | pub const RANGE0: Self = Self(0); | 16706 | pub const DISABLED: Self = Self(0); |
| 12197 | #[doc = "range 1 around 131.072 kHz"] | 16707 | #[doc = "The selected clock is enabled"] |
| 12198 | pub const RANGE1: Self = Self(0x01); | 16708 | pub const ENABLED: Self = Self(0x01); |
| 12199 | #[doc = "range 2 around 262.144 kHz"] | ||
| 12200 | pub const RANGE2: Self = Self(0x02); | ||
| 12201 | #[doc = "range 3 around 524.288 kHz"] | ||
| 12202 | pub const RANGE3: Self = Self(0x03); | ||
| 12203 | #[doc = "range 4 around 1.048 MHz"] | ||
| 12204 | pub const RANGE4: Self = Self(0x04); | ||
| 12205 | #[doc = "range 5 around 2.097 MHz (reset value)"] | ||
| 12206 | pub const RANGE5: Self = Self(0x05); | ||
| 12207 | #[doc = "range 6 around 4.194 MHz"] | ||
| 12208 | pub const RANGE6: Self = Self(0x06); | ||
| 12209 | #[doc = "not allowed"] | ||
| 12210 | pub const RANGE7: Self = Self(0x07); | ||
| 12211 | } | 16709 | } |
| 12212 | #[repr(transparent)] | 16710 | #[repr(transparent)] |
| 12213 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 16711 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12214 | pub struct Hserdyr(pub u8); | 16712 | pub struct Fdcansel(pub u8); |
| 12215 | impl Hserdyr { | 16713 | impl Fdcansel { |
| 12216 | #[doc = "Oscillator is not stable"] | 16714 | #[doc = "HSE selected as peripheral clock"] |
| 12217 | pub const NOTREADY: Self = Self(0); | 16715 | pub const HSE: Self = Self(0); |
| 12218 | #[doc = "Oscillator is stable"] | 16716 | #[doc = "pll1_q selected as peripheral clock"] |
| 12219 | pub const READY: Self = Self(0x01); | 16717 | pub const PLL1_Q: Self = Self(0x01); |
| 16718 | #[doc = "pll2_q selected as peripheral clock"] | ||
| 16719 | pub const PLL2_Q: Self = Self(0x02); | ||
| 12220 | } | 16720 | } |
| 12221 | #[repr(transparent)] | 16721 | #[repr(transparent)] |
| 12222 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 16722 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12223 | pub struct Crcsmen(pub u8); | 16723 | pub struct Lsirdyie(pub u8); |
| 12224 | impl Crcsmen { | 16724 | impl Lsirdyie { |
| 12225 | #[doc = "Test integration module clock disabled in Sleep mode"] | 16725 | #[doc = "Interrupt disabled"] |
| 12226 | pub const DISABLED: Self = Self(0); | 16726 | pub const DISABLED: Self = Self(0); |
| 12227 | #[doc = "Test integration module clock enabled in Sleep mode (if enabled by CRCEN)"] | 16727 | #[doc = "Interrupt enabled"] |
| 12228 | pub const ENABLED: Self = Self(0x01); | 16728 | pub const ENABLED: Self = Self(0x01); |
| 12229 | } | 16729 | } |
| 12230 | #[repr(transparent)] | 16730 | #[repr(transparent)] |
| 12231 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 16731 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12232 | pub struct Cryprstw(pub u8); | 16732 | pub struct Sw(pub u8); |
| 12233 | impl Cryprstw { | 16733 | impl Sw { |
| 12234 | #[doc = "Reset the module"] | 16734 | #[doc = "HSI selected as system clock"] |
| 12235 | pub const RESET: Self = Self(0x01); | 16735 | pub const HSI: Self = Self(0); |
| 16736 | #[doc = "CSI selected as system clock"] | ||
| 16737 | pub const CSI: Self = Self(0x01); | ||
| 16738 | #[doc = "HSE selected as system clock"] | ||
| 16739 | pub const HSE: Self = Self(0x02); | ||
| 16740 | #[doc = "PLL1 selected as system clock"] | ||
| 16741 | pub const PLL1: Self = Self(0x03); | ||
| 12236 | } | 16742 | } |
| 12237 | #[repr(transparent)] | 16743 | #[repr(transparent)] |
| 12238 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 16744 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12239 | pub struct Dbgrstw(pub u8); | 16745 | pub struct I2c123sel(pub u8); |
| 12240 | impl Dbgrstw { | 16746 | impl I2c123sel { |
| 12241 | #[doc = "Reset the module"] | 16747 | #[doc = "rcc_pclk1 selected as peripheral clock"] |
| 12242 | pub const RESET: Self = Self(0x01); | 16748 | pub const RCC_PCLK1: Self = Self(0); |
| 16749 | #[doc = "pll3_r selected as peripheral clock"] | ||
| 16750 | pub const PLL3_R: Self = Self(0x01); | ||
| 16751 | #[doc = "hsi_ker selected as peripheral clock"] | ||
| 16752 | pub const HSI_KER: Self = Self(0x02); | ||
| 16753 | #[doc = "csi_ker selected as peripheral clock"] | ||
| 16754 | pub const CSI_KER: Self = Self(0x03); | ||
| 12243 | } | 16755 | } |
| 12244 | #[repr(transparent)] | 16756 | #[repr(transparent)] |
| 12245 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 16757 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12246 | pub struct Hsirdyie(pub u8); | 16758 | pub struct C1Ahb4lpenrGpioalpen(pub u8); |
| 12247 | impl Hsirdyie { | 16759 | impl C1Ahb4lpenrGpioalpen { |
| 12248 | #[doc = "Ready interrupt disabled"] | 16760 | #[doc = "The selected clock is disabled during csleep mode"] |
| 12249 | pub const DISABLED: Self = Self(0); | 16761 | pub const DISABLED: Self = Self(0); |
| 12250 | #[doc = "Ready interrupt enabled"] | 16762 | #[doc = "The selected clock is enabled during csleep mode"] |
| 12251 | pub const ENABLED: Self = Self(0x01); | 16763 | pub const ENABLED: Self = Self(0x01); |
| 12252 | } | 16764 | } |
| 12253 | #[repr(transparent)] | 16765 | #[repr(transparent)] |
| 12254 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 16766 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12255 | pub struct Hsidivfr(pub u8); | 16767 | pub struct C1Ahb2enrDcmien(pub u8); |
| 12256 | impl Hsidivfr { | 16768 | impl C1Ahb2enrDcmien { |
| 12257 | #[doc = "16 MHz HSI clock not divided"] | 16769 | #[doc = "The selected clock is disabled"] |
| 12258 | pub const NOTDIVIDED: Self = Self(0); | 16770 | pub const DISABLED: Self = Self(0); |
| 12259 | #[doc = "16 MHz HSI clock divided by 4"] | 16771 | #[doc = "The selected clock is enabled"] |
| 12260 | pub const DIV4: Self = Self(0x01); | 16772 | pub const ENABLED: Self = Self(0x01); |
| 12261 | } | 16773 | } |
| 12262 | #[repr(transparent)] | 16774 | #[repr(transparent)] |
| 12263 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 16775 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12264 | pub struct Stopwuck(pub u8); | 16776 | pub struct C1Ahb1enrDma1en(pub u8); |
| 12265 | impl Stopwuck { | 16777 | impl C1Ahb1enrDma1en { |
| 12266 | #[doc = "Internal 64 KHz to 4 MHz (MSI) oscillator selected as wake-up from Stop clock"] | 16778 | #[doc = "The selected clock is disabled"] |
| 12267 | pub const MSI: Self = Self(0); | 16779 | pub const DISABLED: Self = Self(0); |
| 12268 | #[doc = "Internal 16 MHz (HSI) oscillator selected as wake-up from Stop clock (or HSI16/4 if HSI16DIVEN=1)"] | 16780 | #[doc = "The selected clock is enabled"] |
| 12269 | pub const HSI16: Self = Self(0x01); | 16781 | pub const ENABLED: Self = Self(0x01); |
| 12270 | } | 16782 | } |
| 12271 | #[repr(transparent)] | 16783 | #[repr(transparent)] |
| 12272 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 16784 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12273 | pub struct Hsi48rdyfr(pub u8); | 16785 | pub struct C1Apb4lpenrSyscfglpen(pub u8); |
| 12274 | impl Hsi48rdyfr { | 16786 | impl C1Apb4lpenrSyscfglpen { |
| 12275 | #[doc = "No clock ready interrupt"] | 16787 | #[doc = "The selected clock is disabled during csleep mode"] |
| 12276 | pub const NOTINTERRUPTED: Self = Self(0); | 16788 | pub const DISABLED: Self = Self(0); |
| 12277 | #[doc = "Clock ready interrupt"] | 16789 | #[doc = "The selected clock is enabled during csleep mode"] |
| 12278 | pub const INTERRUPTED: Self = Self(0x01); | 16790 | pub const ENABLED: Self = Self(0x01); |
| 12279 | } | 16791 | } |
| 12280 | #[repr(transparent)] | 16792 | #[repr(transparent)] |
| 12281 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 16793 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12282 | pub struct Rtcpre(pub u8); | 16794 | pub struct Mco1(pub u8); |
| 12283 | impl Rtcpre { | 16795 | impl Mco1 { |
| 12284 | #[doc = "HSE divided by 2"] | 16796 | #[doc = "HSI selected for micro-controller clock output"] |
| 12285 | pub const DIV2: Self = Self(0); | 16797 | pub const HSI: Self = Self(0); |
| 12286 | #[doc = "HSE divided by 4"] | 16798 | #[doc = "LSE selected for micro-controller clock output"] |
| 12287 | pub const DIV4: Self = Self(0x01); | 16799 | pub const LSE: Self = Self(0x01); |
| 12288 | #[doc = "HSE divided by 8"] | 16800 | #[doc = "HSE selected for micro-controller clock output"] |
| 12289 | pub const DIV8: Self = Self(0x02); | 16801 | pub const HSE: Self = Self(0x02); |
| 12290 | #[doc = "HSE divided by 16"] | 16802 | #[doc = "pll1_q selected for micro-controller clock output"] |
| 12291 | pub const DIV16: Self = Self(0x03); | 16803 | pub const PLL1_Q: Self = Self(0x03); |
| 16804 | #[doc = "HSI48 selected for micro-controller clock output"] | ||
| 16805 | pub const HSI48: Self = Self(0x04); | ||
| 12292 | } | 16806 | } |
| 12293 | #[repr(transparent)] | 16807 | #[repr(transparent)] |
| 12294 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 16808 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12295 | pub struct Csshsecw(pub u8); | 16809 | pub struct Crsrst(pub u8); |
| 12296 | impl Csshsecw { | 16810 | impl Crsrst { |
| 12297 | #[doc = "Clear interrupt flag"] | 16811 | #[doc = "Reset the selected module"] |
| 12298 | pub const CLEAR: Self = Self(0x01); | 16812 | pub const RESET: Self = Self(0x01); |
| 12299 | } | 16813 | } |
| 12300 | #[repr(transparent)] | 16814 | #[repr(transparent)] |
| 12301 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 16815 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12302 | pub struct Csslsef(pub u8); | 16816 | pub struct Lpuart1sel(pub u8); |
| 12303 | impl Csslsef { | 16817 | impl Lpuart1sel { |
| 12304 | #[doc = "No failure detected on LSE clock failure"] | 16818 | #[doc = "rcc_pclk_d3 selected as peripheral clock"] |
| 12305 | pub const NOFAILURE: Self = Self(0); | 16819 | pub const RCC_PCLK_D3: Self = Self(0); |
| 12306 | #[doc = "Failure detected on LSE clock failure"] | 16820 | #[doc = "pll2_q selected as peripheral clock"] |
| 12307 | pub const FAILURE: Self = Self(0x01); | 16821 | pub const PLL2_Q: Self = Self(0x01); |
| 16822 | #[doc = "pll3_q selected as peripheral clock"] | ||
| 16823 | pub const PLL3_Q: Self = Self(0x02); | ||
| 16824 | #[doc = "hsi_ker selected as peripheral clock"] | ||
| 16825 | pub const HSI_KER: Self = Self(0x03); | ||
| 16826 | #[doc = "csi_ker selected as peripheral clock"] | ||
| 16827 | pub const CSI_KER: Self = Self(0x04); | ||
| 16828 | #[doc = "LSE selected as peripheral clock"] | ||
| 16829 | pub const LSE: Self = Self(0x05); | ||
| 12308 | } | 16830 | } |
| 12309 | #[repr(transparent)] | 16831 | #[repr(transparent)] |
| 12310 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 16832 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12311 | pub struct Csslsed(pub u8); | 16833 | pub struct Lserdyr(pub u8); |
| 12312 | impl Csslsed { | 16834 | impl Lserdyr { |
| 12313 | #[doc = "No failure detected on LSE (32 kHz oscillator)"] | 16835 | #[doc = "LSE oscillator not ready"] |
| 12314 | pub const NOFAILURE: Self = Self(0); | 16836 | pub const NOTREADY: Self = Self(0); |
| 12315 | #[doc = "Failure detected on LSE (32 kHz oscillator)"] | 16837 | #[doc = "LSE oscillator ready"] |
| 12316 | pub const FAILURE: Self = Self(0x01); | 16838 | pub const READY: Self = Self(0x01); |
| 12317 | } | 16839 | } |
| 12318 | #[repr(transparent)] | 16840 | #[repr(transparent)] |
| 12319 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 16841 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12320 | pub struct Lptimen(pub u8); | 16842 | pub struct D1ppre(pub u8); |
| 12321 | impl Lptimen { | 16843 | impl D1ppre { |
| 12322 | #[doc = "Clock disabled"] | 16844 | #[doc = "rcc_hclk not divided"] |
| 16845 | pub const DIV1: Self = Self(0); | ||
| 16846 | #[doc = "rcc_hclk divided by 2"] | ||
| 16847 | pub const DIV2: Self = Self(0x04); | ||
| 16848 | #[doc = "rcc_hclk divided by 4"] | ||
| 16849 | pub const DIV4: Self = Self(0x05); | ||
| 16850 | #[doc = "rcc_hclk divided by 8"] | ||
| 16851 | pub const DIV8: Self = Self(0x06); | ||
| 16852 | #[doc = "rcc_hclk divided by 16"] | ||
| 16853 | pub const DIV16: Self = Self(0x07); | ||
| 16854 | } | ||
| 16855 | #[repr(transparent)] | ||
| 16856 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 16857 | pub struct Ww1rsc(pub u8); | ||
| 16858 | impl Ww1rsc { | ||
| 16859 | #[doc = "Clear WWDG1 scope control"] | ||
| 16860 | pub const CLEAR: Self = Self(0); | ||
| 16861 | #[doc = "Set WWDG1 scope control"] | ||
| 16862 | pub const SET: Self = Self(0x01); | ||
| 16863 | } | ||
| 16864 | #[repr(transparent)] | ||
| 16865 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 16866 | pub struct Ahb1lpenrDma1lpen(pub u8); | ||
| 16867 | impl Ahb1lpenrDma1lpen { | ||
| 16868 | #[doc = "The selected clock is disabled during csleep mode"] | ||
| 12323 | pub const DISABLED: Self = Self(0); | 16869 | pub const DISABLED: Self = Self(0); |
| 12324 | #[doc = "Clock enabled"] | 16870 | #[doc = "The selected clock is enabled during csleep mode"] |
| 16871 | pub const ENABLED: Self = Self(0x01); | ||
| 16872 | } | ||
| 16873 | #[repr(transparent)] | ||
| 16874 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 16875 | pub struct Usart234578sel(pub u8); | ||
| 16876 | impl Usart234578sel { | ||
| 16877 | #[doc = "rcc_pclk1 selected as peripheral clock"] | ||
| 16878 | pub const RCC_PCLK1: Self = Self(0); | ||
| 16879 | #[doc = "pll2_q selected as peripheral clock"] | ||
| 16880 | pub const PLL2_Q: Self = Self(0x01); | ||
| 16881 | #[doc = "pll3_q selected as peripheral clock"] | ||
| 16882 | pub const PLL3_Q: Self = Self(0x02); | ||
| 16883 | #[doc = "hsi_ker selected as peripheral clock"] | ||
| 16884 | pub const HSI_KER: Self = Self(0x03); | ||
| 16885 | #[doc = "csi_ker selected as peripheral clock"] | ||
| 16886 | pub const CSI_KER: Self = Self(0x04); | ||
| 16887 | #[doc = "LSE selected as peripheral clock"] | ||
| 16888 | pub const LSE: Self = Self(0x05); | ||
| 16889 | } | ||
| 16890 | #[repr(transparent)] | ||
| 16891 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 16892 | pub struct Adcsel(pub u8); | ||
| 16893 | impl Adcsel { | ||
| 16894 | #[doc = "pll2_p selected as peripheral clock"] | ||
| 16895 | pub const PLL2_P: Self = Self(0); | ||
| 16896 | #[doc = "pll3_r selected as peripheral clock"] | ||
| 16897 | pub const PLL3_R: Self = Self(0x01); | ||
| 16898 | #[doc = "PER selected as peripheral clock"] | ||
| 16899 | pub const PER: Self = Self(0x02); | ||
| 16900 | } | ||
| 16901 | #[repr(transparent)] | ||
| 16902 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 16903 | pub struct Apb1henrCrsen(pub u8); | ||
| 16904 | impl Apb1henrCrsen { | ||
| 16905 | #[doc = "The selected clock is disabled"] | ||
| 16906 | pub const DISABLED: Self = Self(0); | ||
| 16907 | #[doc = "The selected clock is enabled"] | ||
| 16908 | pub const ENABLED: Self = Self(0x01); | ||
| 16909 | } | ||
| 16910 | #[repr(transparent)] | ||
| 16911 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 16912 | pub struct Dfsdm1sel(pub u8); | ||
| 16913 | impl Dfsdm1sel { | ||
| 16914 | #[doc = "rcc_pclk2 selected as peripheral clock"] | ||
| 16915 | pub const RCC_PCLK2: Self = Self(0); | ||
| 16916 | #[doc = "System clock selected as peripheral clock"] | ||
| 16917 | pub const SYS: Self = Self(0x01); | ||
| 16918 | } | ||
| 16919 | #[repr(transparent)] | ||
| 16920 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 16921 | pub struct C1Apb4enrSyscfgen(pub u8); | ||
| 16922 | impl C1Apb4enrSyscfgen { | ||
| 16923 | #[doc = "The selected clock is disabled"] | ||
| 16924 | pub const DISABLED: Self = Self(0); | ||
| 16925 | #[doc = "The selected clock is enabled"] | ||
| 12325 | pub const ENABLED: Self = Self(0x01); | 16926 | pub const ENABLED: Self = Self(0x01); |
| 12326 | } | 16927 | } |
| 12327 | #[repr(transparent)] | 16928 | #[repr(transparent)] |
| 12328 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 16929 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 16930 | pub struct Pll1vcosel(pub u8); | ||
| 16931 | impl Pll1vcosel { | ||
| 16932 | #[doc = "VCO frequency range 192 to 836 MHz"] | ||
| 16933 | pub const WIDEVCO: Self = Self(0); | ||
| 16934 | #[doc = "VCO frequency range 150 to 420 MHz"] | ||
| 16935 | pub const MEDIUMVCO: Self = Self(0x01); | ||
| 16936 | } | ||
| 16937 | #[repr(transparent)] | ||
| 16938 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 16939 | pub struct Lptim1sel(pub u8); | ||
| 16940 | impl Lptim1sel { | ||
| 16941 | #[doc = "rcc_pclk1 selected as peripheral clock"] | ||
| 16942 | pub const RCC_PCLK1: Self = Self(0); | ||
| 16943 | #[doc = "pll2_p selected as peripheral clock"] | ||
| 16944 | pub const PLL2_P: Self = Self(0x01); | ||
| 16945 | #[doc = "pll3_r selected as peripheral clock"] | ||
| 16946 | pub const PLL3_R: Self = Self(0x02); | ||
| 16947 | #[doc = "LSE selected as peripheral clock"] | ||
| 16948 | pub const LSE: Self = Self(0x03); | ||
| 16949 | #[doc = "LSI selected as peripheral clock"] | ||
| 16950 | pub const LSI: Self = Self(0x04); | ||
| 16951 | #[doc = "PER selected as peripheral clock"] | ||
| 16952 | pub const PER: Self = Self(0x05); | ||
| 16953 | } | ||
| 16954 | #[repr(transparent)] | ||
| 16955 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12329 | pub struct Rtcsel(pub u8); | 16956 | pub struct Rtcsel(pub u8); |
| 12330 | impl Rtcsel { | 16957 | impl Rtcsel { |
| 12331 | #[doc = "No clock"] | 16958 | #[doc = "No clock"] |
| @@ -12334,394 +16961,788 @@ pub mod rcc_l0 { | |||
| 12334 | pub const LSE: Self = Self(0x01); | 16961 | pub const LSE: Self = Self(0x01); |
| 12335 | #[doc = "LSI oscillator clock used as RTC clock"] | 16962 | #[doc = "LSI oscillator clock used as RTC clock"] |
| 12336 | pub const LSI: Self = Self(0x02); | 16963 | pub const LSI: Self = Self(0x02); |
| 12337 | #[doc = "HSE oscillator clock divided by a programmable prescaler (selection through the RTCPRE[1:0] | 16964 | #[doc = "HSE oscillator clock divided by a prescaler used as RTC clock"] |
| 12338 | bits in the RCC clock control register (RCC_CR)) used as the RTC clock"] | ||
| 12339 | pub const HSE: Self = Self(0x03); | 16965 | pub const HSE: Self = Self(0x03); |
| 12340 | } | 16966 | } |
| 12341 | #[repr(transparent)] | 16967 | #[repr(transparent)] |
| 12342 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 16968 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12343 | pub struct Lptimsel(pub u8); | 16969 | pub struct C1Ahb1lpenrDma1lpen(pub u8); |
| 12344 | impl Lptimsel { | 16970 | impl C1Ahb1lpenrDma1lpen { |
| 12345 | #[doc = "APB clock selected as Timer clock"] | 16971 | #[doc = "The selected clock is disabled during csleep mode"] |
| 12346 | pub const APB: Self = Self(0); | 16972 | pub const DISABLED: Self = Self(0); |
| 12347 | #[doc = "LSI clock selected as Timer clock"] | 16973 | #[doc = "The selected clock is enabled during csleep mode"] |
| 12348 | pub const LSI: Self = Self(0x01); | 16974 | pub const ENABLED: Self = Self(0x01); |
| 12349 | #[doc = "HSI16 clock selected as Timer clock"] | ||
| 12350 | pub const HSI16: Self = Self(0x02); | ||
| 12351 | #[doc = "LSE clock selected as Timer clock"] | ||
| 12352 | pub const LSE: Self = Self(0x03); | ||
| 12353 | } | 16975 | } |
| 12354 | #[repr(transparent)] | 16976 | #[repr(transparent)] |
| 12355 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 16977 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12356 | pub struct Csslseon(pub u8); | 16978 | pub struct Dma1rst(pub u8); |
| 12357 | impl Csslseon { | 16979 | impl Dma1rst { |
| 12358 | #[doc = "Oscillator OFF"] | 16980 | #[doc = "Reset the selected module"] |
| 12359 | pub const OFF: Self = Self(0); | 16981 | pub const RESET: Self = Self(0x01); |
| 12360 | #[doc = "Oscillator ON"] | ||
| 12361 | pub const ON: Self = Self(0x01); | ||
| 12362 | } | 16982 | } |
| 12363 | #[repr(transparent)] | 16983 | #[repr(transparent)] |
| 12364 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 16984 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12365 | pub struct Dmasmen(pub u8); | 16985 | pub struct C1Apb3lpenrLtdclpen(pub u8); |
| 12366 | impl Dmasmen { | 16986 | impl C1Apb3lpenrLtdclpen { |
| 12367 | #[doc = "DMA clock disabled in Sleep mode"] | 16987 | #[doc = "The selected clock is disabled during csleep mode"] |
| 12368 | pub const DISABLED: Self = Self(0); | 16988 | pub const DISABLED: Self = Self(0); |
| 12369 | #[doc = "DMA clock enabled in Sleep mode"] | 16989 | #[doc = "The selected clock is enabled during csleep mode"] |
| 12370 | pub const ENABLED: Self = Self(0x01); | 16990 | pub const ENABLED: Self = Self(0x01); |
| 12371 | } | 16991 | } |
| 12372 | #[repr(transparent)] | 16992 | #[repr(transparent)] |
| 12373 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 16993 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12374 | pub struct Lpwrrstfr(pub u8); | 16994 | pub struct Timpre(pub u8); |
| 12375 | impl Lpwrrstfr { | 16995 | impl Timpre { |
| 12376 | #[doc = "No reset has occured"] | 16996 | #[doc = "Timer kernel clock equal to 2x pclk by default"] |
| 12377 | pub const NORESET: Self = Self(0); | 16997 | pub const DEFAULTX2: Self = Self(0); |
| 12378 | #[doc = "A reset has occured"] | 16998 | #[doc = "Timer kernel clock equal to 4x pclk by default"] |
| 12379 | pub const RESET: Self = Self(0x01); | 16999 | pub const DEFAULTX4: Self = Self(0x01); |
| 12380 | } | 17000 | } |
| 12381 | #[repr(transparent)] | 17001 | #[repr(transparent)] |
| 12382 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17002 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12383 | pub struct Mcosel(pub u8); | 17003 | pub struct C1Ahb2lpenrDcmilpen(pub u8); |
| 12384 | impl Mcosel { | 17004 | impl C1Ahb2lpenrDcmilpen { |
| 12385 | #[doc = "No clock"] | 17005 | #[doc = "The selected clock is disabled during csleep mode"] |
| 12386 | pub const NOCLOCK: Self = Self(0); | 17006 | pub const DISABLED: Self = Self(0); |
| 12387 | #[doc = "SYSCLK clock selected"] | 17007 | #[doc = "The selected clock is enabled during csleep mode"] |
| 12388 | pub const SYSCLK: Self = Self(0x01); | 17008 | pub const ENABLED: Self = Self(0x01); |
| 12389 | #[doc = "HSI oscillator clock selected"] | ||
| 12390 | pub const HSI16: Self = Self(0x02); | ||
| 12391 | #[doc = "MSI oscillator clock selected"] | ||
| 12392 | pub const MSI: Self = Self(0x03); | ||
| 12393 | #[doc = "HSE oscillator clock selected"] | ||
| 12394 | pub const HSE: Self = Self(0x04); | ||
| 12395 | #[doc = "PLL clock selected"] | ||
| 12396 | pub const PLL: Self = Self(0x05); | ||
| 12397 | #[doc = "LSI oscillator clock selected"] | ||
| 12398 | pub const LSI: Self = Self(0x06); | ||
| 12399 | #[doc = "LSE oscillator clock selected"] | ||
| 12400 | pub const LSE: Self = Self(0x07); | ||
| 12401 | } | 17009 | } |
| 12402 | #[repr(transparent)] | 17010 | #[repr(transparent)] |
| 12403 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17011 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12404 | pub struct Rmvfw(pub u8); | 17012 | pub struct Lsirdyc(pub u8); |
| 12405 | impl Rmvfw { | 17013 | impl Lsirdyc { |
| 12406 | #[doc = "Clears the reset flag"] | 17014 | #[doc = "Clear interrupt flag"] |
| 12407 | pub const CLEAR: Self = Self(0x01); | 17015 | pub const CLEAR: Self = Self(0x01); |
| 12408 | } | 17016 | } |
| 12409 | #[repr(transparent)] | 17017 | #[repr(transparent)] |
| 12410 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17018 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12411 | pub struct Iophrst(pub u8); | 17019 | pub struct Pll1rge(pub u8); |
| 12412 | impl Iophrst { | 17020 | impl Pll1rge { |
| 12413 | #[doc = "Reset I/O port"] | 17021 | #[doc = "Frequency is between 1 and 2 MHz"] |
| 17022 | pub const RANGE1: Self = Self(0); | ||
| 17023 | #[doc = "Frequency is between 2 and 4 MHz"] | ||
| 17024 | pub const RANGE2: Self = Self(0x01); | ||
| 17025 | #[doc = "Frequency is between 4 and 8 MHz"] | ||
| 17026 | pub const RANGE4: Self = Self(0x02); | ||
| 17027 | #[doc = "Frequency is between 8 and 16 MHz"] | ||
| 17028 | pub const RANGE8: Self = Self(0x03); | ||
| 17029 | } | ||
| 17030 | #[repr(transparent)] | ||
| 17031 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17032 | pub struct Lsion(pub u8); | ||
| 17033 | impl Lsion { | ||
| 17034 | #[doc = "LSI oscillator Off"] | ||
| 17035 | pub const OFF: Self = Self(0); | ||
| 17036 | #[doc = "LSI oscillator On"] | ||
| 17037 | pub const ON: Self = Self(0x01); | ||
| 17038 | } | ||
| 17039 | #[repr(transparent)] | ||
| 17040 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17041 | pub struct Usart16sel(pub u8); | ||
| 17042 | impl Usart16sel { | ||
| 17043 | #[doc = "rcc_pclk2 selected as peripheral clock"] | ||
| 17044 | pub const RCC_PCLK2: Self = Self(0); | ||
| 17045 | #[doc = "pll2_q selected as peripheral clock"] | ||
| 17046 | pub const PLL2_Q: Self = Self(0x01); | ||
| 17047 | #[doc = "pll3_q selected as peripheral clock"] | ||
| 17048 | pub const PLL3_Q: Self = Self(0x02); | ||
| 17049 | #[doc = "hsi_ker selected as peripheral clock"] | ||
| 17050 | pub const HSI_KER: Self = Self(0x03); | ||
| 17051 | #[doc = "csi_ker selected as peripheral clock"] | ||
| 17052 | pub const CSI_KER: Self = Self(0x04); | ||
| 17053 | #[doc = "LSE selected as peripheral clock"] | ||
| 17054 | pub const LSE: Self = Self(0x05); | ||
| 17055 | } | ||
| 17056 | #[repr(transparent)] | ||
| 17057 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17058 | pub struct Sai4asel(pub u8); | ||
| 17059 | impl Sai4asel { | ||
| 17060 | #[doc = "pll1_q selected as peripheral clock"] | ||
| 17061 | pub const PLL1_Q: Self = Self(0); | ||
| 17062 | #[doc = "pll2_p selected as peripheral clock"] | ||
| 17063 | pub const PLL2_P: Self = Self(0x01); | ||
| 17064 | #[doc = "pll3_p selected as peripheral clock"] | ||
| 17065 | pub const PLL3_P: Self = Self(0x02); | ||
| 17066 | #[doc = "i2s_ckin selected as peripheral clock"] | ||
| 17067 | pub const I2S_CKIN: Self = Self(0x03); | ||
| 17068 | #[doc = "PER selected as peripheral clock"] | ||
| 17069 | pub const PER: Self = Self(0x04); | ||
| 17070 | } | ||
| 17071 | #[repr(transparent)] | ||
| 17072 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17073 | pub struct Gpioarst(pub u8); | ||
| 17074 | impl Gpioarst { | ||
| 17075 | #[doc = "Reset the selected module"] | ||
| 12414 | pub const RESET: Self = Self(0x01); | 17076 | pub const RESET: Self = Self(0x01); |
| 12415 | } | 17077 | } |
| 12416 | #[repr(transparent)] | 17078 | #[repr(transparent)] |
| 12417 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17079 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 17080 | pub struct Lseon(pub u8); | ||
| 17081 | impl Lseon { | ||
| 17082 | #[doc = "LSE oscillator Off"] | ||
| 17083 | pub const OFF: Self = Self(0); | ||
| 17084 | #[doc = "LSE oscillator On"] | ||
| 17085 | pub const ON: Self = Self(0x01); | ||
| 17086 | } | ||
| 17087 | #[repr(transparent)] | ||
| 17088 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17089 | pub struct D2ppre1(pub u8); | ||
| 17090 | impl D2ppre1 { | ||
| 17091 | #[doc = "rcc_hclk not divided"] | ||
| 17092 | pub const DIV1: Self = Self(0); | ||
| 17093 | #[doc = "rcc_hclk divided by 2"] | ||
| 17094 | pub const DIV2: Self = Self(0x04); | ||
| 17095 | #[doc = "rcc_hclk divided by 4"] | ||
| 17096 | pub const DIV4: Self = Self(0x05); | ||
| 17097 | #[doc = "rcc_hclk divided by 8"] | ||
| 17098 | pub const DIV8: Self = Self(0x06); | ||
| 17099 | #[doc = "rcc_hclk divided by 16"] | ||
| 17100 | pub const DIV16: Self = Self(0x07); | ||
| 17101 | } | ||
| 17102 | #[repr(transparent)] | ||
| 17103 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17104 | pub struct Ckpersel(pub u8); | ||
| 17105 | impl Ckpersel { | ||
| 17106 | #[doc = "HSI selected as peripheral clock"] | ||
| 17107 | pub const HSI: Self = Self(0); | ||
| 17108 | #[doc = "CSI selected as peripheral clock"] | ||
| 17109 | pub const CSI: Self = Self(0x01); | ||
| 17110 | #[doc = "HSE selected as peripheral clock"] | ||
| 17111 | pub const HSE: Self = Self(0x02); | ||
| 17112 | } | ||
| 17113 | #[repr(transparent)] | ||
| 17114 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 12418 | pub struct Lsebyp(pub u8); | 17115 | pub struct Lsebyp(pub u8); |
| 12419 | impl Lsebyp { | 17116 | impl Lsebyp { |
| 12420 | #[doc = "LSE oscillator not bypassed"] | 17117 | #[doc = "LSE crystal oscillator not bypassed"] |
| 12421 | pub const NOTBYPASSED: Self = Self(0); | 17118 | pub const NOTBYPASSED: Self = Self(0); |
| 12422 | #[doc = "LSE oscillator bypassed"] | 17119 | #[doc = "LSE crystal oscillator bypassed with external clock"] |
| 12423 | pub const BYPASSED: Self = Self(0x01); | 17120 | pub const BYPASSED: Self = Self(0x01); |
| 12424 | } | 17121 | } |
| 12425 | #[repr(transparent)] | 17122 | #[repr(transparent)] |
| 12426 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17123 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12427 | pub struct Sramsmen(pub u8); | 17124 | pub struct C1Apb1lenrTim2en(pub u8); |
| 12428 | impl Sramsmen { | 17125 | impl C1Apb1lenrTim2en { |
| 12429 | #[doc = "NVM interface clock disabled in Sleep mode"] | 17126 | #[doc = "The selected clock is disabled"] |
| 12430 | pub const DISABLED: Self = Self(0); | 17127 | pub const DISABLED: Self = Self(0); |
| 12431 | #[doc = "NVM interface clock enabled in Sleep mode"] | 17128 | #[doc = "The selected clock is enabled"] |
| 12432 | pub const ENABLED: Self = Self(0x01); | 17129 | pub const ENABLED: Self = Self(0x01); |
| 12433 | } | 17130 | } |
| 12434 | #[repr(transparent)] | 17131 | #[repr(transparent)] |
| 12435 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17132 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12436 | pub struct Icsel(pub u8); | 17133 | pub struct C1Ahb3lpenrMdmalpen(pub u8); |
| 12437 | impl Icsel { | 17134 | impl C1Ahb3lpenrMdmalpen { |
| 12438 | #[doc = "APB clock selected as peripheral clock"] | 17135 | #[doc = "The selected clock is disabled during csleep mode"] |
| 12439 | pub const APB: Self = Self(0); | 17136 | pub const DISABLED: Self = Self(0); |
| 12440 | #[doc = "System clock selected as peripheral clock"] | 17137 | #[doc = "The selected clock is enabled during csleep mode"] |
| 12441 | pub const SYSTEM: Self = Self(0x01); | 17138 | pub const ENABLED: Self = Self(0x01); |
| 12442 | #[doc = "HSI16 clock selected as peripheral clock"] | ||
| 12443 | pub const HSI16: Self = Self(0x02); | ||
| 12444 | } | 17139 | } |
| 12445 | #[repr(transparent)] | 17140 | #[repr(transparent)] |
| 12446 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17141 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12447 | pub struct Crypen(pub u8); | 17142 | pub struct Sdmmcsel(pub u8); |
| 12448 | impl Crypen { | 17143 | impl Sdmmcsel { |
| 12449 | #[doc = "Clock disabled"] | 17144 | #[doc = "pll1_q selected as peripheral clock"] |
| 17145 | pub const PLL1_Q: Self = Self(0); | ||
| 17146 | #[doc = "pll2_r selected as peripheral clock"] | ||
| 17147 | pub const PLL2_R: Self = Self(0x01); | ||
| 17148 | } | ||
| 17149 | #[repr(transparent)] | ||
| 17150 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17151 | pub struct Swsr(pub u8); | ||
| 17152 | impl Swsr { | ||
| 17153 | #[doc = "HSI oscillator used as system clock"] | ||
| 17154 | pub const HSI: Self = Self(0); | ||
| 17155 | #[doc = "CSI oscillator used as system clock"] | ||
| 17156 | pub const CSI: Self = Self(0x01); | ||
| 17157 | #[doc = "HSE oscillator used as system clock"] | ||
| 17158 | pub const HSE: Self = Self(0x02); | ||
| 17159 | #[doc = "PLL1 used as system clock"] | ||
| 17160 | pub const PLL1: Self = Self(0x03); | ||
| 17161 | } | ||
| 17162 | #[repr(transparent)] | ||
| 17163 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17164 | pub struct Apb4enrSyscfgen(pub u8); | ||
| 17165 | impl Apb4enrSyscfgen { | ||
| 17166 | #[doc = "The selected clock is disabled"] | ||
| 12450 | pub const DISABLED: Self = Self(0); | 17167 | pub const DISABLED: Self = Self(0); |
| 12451 | #[doc = "Clock enabled"] | 17168 | #[doc = "The selected clock is enabled"] |
| 12452 | pub const ENABLED: Self = Self(0x01); | 17169 | pub const ENABLED: Self = Self(0x01); |
| 12453 | } | 17170 | } |
| 12454 | #[repr(transparent)] | 17171 | #[repr(transparent)] |
| 12455 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17172 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12456 | pub struct Pllrdyr(pub u8); | 17173 | pub struct D3ppre(pub u8); |
| 12457 | impl Pllrdyr { | 17174 | impl D3ppre { |
| 12458 | #[doc = "PLL unlocked"] | 17175 | #[doc = "rcc_hclk not divided"] |
| 12459 | pub const UNLOCKED: Self = Self(0); | 17176 | pub const DIV1: Self = Self(0); |
| 12460 | #[doc = "PLL locked"] | 17177 | #[doc = "rcc_hclk divided by 2"] |
| 12461 | pub const LOCKED: Self = Self(0x01); | 17178 | pub const DIV2: Self = Self(0x04); |
| 17179 | #[doc = "rcc_hclk divided by 4"] | ||
| 17180 | pub const DIV4: Self = Self(0x05); | ||
| 17181 | #[doc = "rcc_hclk divided by 8"] | ||
| 17182 | pub const DIV8: Self = Self(0x06); | ||
| 17183 | #[doc = "rcc_hclk divided by 16"] | ||
| 17184 | pub const DIV16: Self = Self(0x07); | ||
| 12462 | } | 17185 | } |
| 12463 | #[repr(transparent)] | 17186 | #[repr(transparent)] |
| 12464 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17187 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12465 | pub struct Lptimrstw(pub u8); | 17188 | pub struct C1Apb1llpenrTim2lpen(pub u8); |
| 12466 | impl Lptimrstw { | 17189 | impl C1Apb1llpenrTim2lpen { |
| 12467 | #[doc = "Reset the module"] | 17190 | #[doc = "The selected clock is disabled during csleep mode"] |
| 12468 | pub const RESET: Self = Self(0x01); | 17191 | pub const DISABLED: Self = Self(0); |
| 17192 | #[doc = "The selected clock is enabled during csleep mode"] | ||
| 17193 | pub const ENABLED: Self = Self(0x01); | ||
| 12469 | } | 17194 | } |
| 12470 | #[repr(transparent)] | 17195 | #[repr(transparent)] |
| 12471 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17196 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12472 | pub struct Lsedrv(pub u8); | 17197 | pub struct C1RsrCpurstfr(pub u8); |
| 12473 | impl Lsedrv { | 17198 | impl C1RsrCpurstfr { |
| 12474 | #[doc = "Lowest drive"] | 17199 | #[doc = "No reset occoured for block"] |
| 12475 | pub const LOW: Self = Self(0); | 17200 | pub const NORESETOCCOURED: Self = Self(0); |
| 12476 | #[doc = "Medium low drive"] | 17201 | #[doc = "Reset occoured for block"] |
| 12477 | pub const MEDIUMLOW: Self = Self(0x01); | 17202 | pub const RESETOCCOURRED: Self = Self(0x01); |
| 12478 | #[doc = "Medium high drive"] | ||
| 12479 | pub const MEDIUMHIGH: Self = Self(0x02); | ||
| 12480 | #[doc = "Highest drive"] | ||
| 12481 | pub const HIGH: Self = Self(0x03); | ||
| 12482 | } | 17203 | } |
| 12483 | #[repr(transparent)] | 17204 | #[repr(transparent)] |
| 12484 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17205 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12485 | pub struct Lpuartsel(pub u8); | 17206 | pub struct Hsidiv(pub u8); |
| 12486 | impl Lpuartsel { | 17207 | impl Hsidiv { |
| 12487 | #[doc = "APB clock selected as peripheral clock"] | 17208 | #[doc = "No division"] |
| 12488 | pub const APB: Self = Self(0); | 17209 | pub const DIV1: Self = Self(0); |
| 12489 | #[doc = "System clock selected as peripheral clock"] | 17210 | #[doc = "Division by 2"] |
| 12490 | pub const SYSTEM: Self = Self(0x01); | 17211 | pub const DIV2: Self = Self(0x01); |
| 12491 | #[doc = "HSI16 clock selected as peripheral clock"] | 17212 | #[doc = "Division by 4"] |
| 12492 | pub const HSI16: Self = Self(0x02); | 17213 | pub const DIV4: Self = Self(0x02); |
| 12493 | #[doc = "LSE clock selected as peripheral clock"] | 17214 | #[doc = "Division by 8"] |
| 12494 | pub const LSE: Self = Self(0x03); | 17215 | pub const DIV8: Self = Self(0x03); |
| 12495 | } | 17216 | } |
| 12496 | #[repr(transparent)] | 17217 | #[repr(transparent)] |
| 12497 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17218 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12498 | pub struct Mifsmen(pub u8); | 17219 | pub struct Bdmaamen(pub u8); |
| 12499 | impl Mifsmen { | 17220 | impl Bdmaamen { |
| 12500 | #[doc = "NVM interface clock disabled in Sleep mode"] | 17221 | #[doc = "Clock disabled in autonomous mode"] |
| 12501 | pub const DISABLED: Self = Self(0); | 17222 | pub const DISABLED: Self = Self(0); |
| 12502 | #[doc = "NVM interface clock enabled in Sleep mode"] | 17223 | #[doc = "Clock enabled in autonomous mode"] |
| 12503 | pub const ENABLED: Self = Self(0x01); | 17224 | pub const ENABLED: Self = Self(0x01); |
| 12504 | } | 17225 | } |
| 12505 | #[repr(transparent)] | 17226 | #[repr(transparent)] |
| 12506 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17227 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12507 | pub struct Dbgsmen(pub u8); | 17228 | pub struct Bdrst(pub u8); |
| 12508 | impl Dbgsmen { | 17229 | impl Bdrst { |
| 12509 | #[doc = "Clock disabled"] | 17230 | #[doc = "Resets the entire VSW domain"] |
| 12510 | pub const DISABLED: Self = Self(0); | 17231 | pub const RESET: Self = Self(0x01); |
| 12511 | #[doc = "Clock enabled"] | ||
| 12512 | pub const ENABLED: Self = Self(0x01); | ||
| 12513 | } | 17232 | } |
| 12514 | #[repr(transparent)] | 17233 | #[repr(transparent)] |
| 12515 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17234 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12516 | pub struct Hpre(pub u8); | 17235 | pub struct Hpre(pub u8); |
| 12517 | impl Hpre { | 17236 | impl Hpre { |
| 12518 | #[doc = "system clock not divided"] | 17237 | #[doc = "sys_ck not divided"] |
| 12519 | pub const DIV1: Self = Self(0); | 17238 | pub const DIV1: Self = Self(0); |
| 12520 | #[doc = "system clock divided by 2"] | 17239 | #[doc = "sys_ck divided by 2"] |
| 12521 | pub const DIV2: Self = Self(0x08); | 17240 | pub const DIV2: Self = Self(0x08); |
| 12522 | #[doc = "system clock divided by 4"] | 17241 | #[doc = "sys_ck divided by 4"] |
| 12523 | pub const DIV4: Self = Self(0x09); | 17242 | pub const DIV4: Self = Self(0x09); |
| 12524 | #[doc = "system clock divided by 8"] | 17243 | #[doc = "sys_ck divided by 8"] |
| 12525 | pub const DIV8: Self = Self(0x0a); | 17244 | pub const DIV8: Self = Self(0x0a); |
| 12526 | #[doc = "system clock divided by 16"] | 17245 | #[doc = "sys_ck divided by 16"] |
| 12527 | pub const DIV16: Self = Self(0x0b); | 17246 | pub const DIV16: Self = Self(0x0b); |
| 12528 | #[doc = "system clock divided by 64"] | 17247 | #[doc = "sys_ck divided by 64"] |
| 12529 | pub const DIV64: Self = Self(0x0c); | 17248 | pub const DIV64: Self = Self(0x0c); |
| 12530 | #[doc = "system clock divided by 128"] | 17249 | #[doc = "sys_ck divided by 128"] |
| 12531 | pub const DIV128: Self = Self(0x0d); | 17250 | pub const DIV128: Self = Self(0x0d); |
| 12532 | #[doc = "system clock divided by 256"] | 17251 | #[doc = "sys_ck divided by 256"] |
| 12533 | pub const DIV256: Self = Self(0x0e); | 17252 | pub const DIV256: Self = Self(0x0e); |
| 12534 | #[doc = "system clock divided by 512"] | 17253 | #[doc = "sys_ck divided by 512"] |
| 12535 | pub const DIV512: Self = Self(0x0f); | 17254 | pub const DIV512: Self = Self(0x0f); |
| 12536 | } | 17255 | } |
| 12537 | #[repr(transparent)] | 17256 | #[repr(transparent)] |
| 12538 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17257 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12539 | pub struct Csshsef(pub u8); | 17258 | pub struct Pll1fracen(pub u8); |
| 12540 | impl Csshsef { | 17259 | impl Pll1fracen { |
| 12541 | #[doc = "No clock security interrupt caused by HSE clock failure"] | 17260 | #[doc = "Reset latch to tranfer FRACN to the Sigma-Delta modulator"] |
| 12542 | pub const NOCLOCK: Self = Self(0); | 17261 | pub const RESET: Self = Self(0); |
| 12543 | #[doc = "Clock security interrupt caused by HSE clock failure"] | 17262 | #[doc = "Set latch to tranfer FRACN to the Sigma-Delta modulator"] |
| 12544 | pub const CLOCK: Self = Self(0x01); | 17263 | pub const SET: Self = Self(0x01); |
| 12545 | } | 17264 | } |
| 12546 | #[repr(transparent)] | 17265 | #[repr(transparent)] |
| 12547 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17266 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12548 | pub struct Sws(pub u8); | 17267 | pub struct Rngsel(pub u8); |
| 12549 | impl Sws { | 17268 | impl Rngsel { |
| 12550 | #[doc = "MSI oscillator used as system clock"] | 17269 | #[doc = "HSI48 selected as peripheral clock"] |
| 12551 | pub const MSI: Self = Self(0); | 17270 | pub const HSI48: Self = Self(0); |
| 12552 | #[doc = "HSI oscillator used as system clock"] | 17271 | #[doc = "pll1_q selected as peripheral clock"] |
| 12553 | pub const HSI16: Self = Self(0x01); | 17272 | pub const PLL1_Q: Self = Self(0x01); |
| 12554 | #[doc = "HSE oscillator used as system clock"] | 17273 | #[doc = "LSE selected as peripheral clock"] |
| 17274 | pub const LSE: Self = Self(0x02); | ||
| 17275 | #[doc = "LSI selected as peripheral clock"] | ||
| 17276 | pub const LSI: Self = Self(0x03); | ||
| 17277 | } | ||
| 17278 | #[repr(transparent)] | ||
| 17279 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17280 | pub struct Mdmarst(pub u8); | ||
| 17281 | impl Mdmarst { | ||
| 17282 | #[doc = "Reset the selected module"] | ||
| 17283 | pub const RESET: Self = Self(0x01); | ||
| 17284 | } | ||
| 17285 | #[repr(transparent)] | ||
| 17286 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17287 | pub struct C1Ahb3enrMdmaen(pub u8); | ||
| 17288 | impl C1Ahb3enrMdmaen { | ||
| 17289 | #[doc = "The selected clock is disabled"] | ||
| 17290 | pub const DISABLED: Self = Self(0); | ||
| 17291 | #[doc = "The selected clock is enabled"] | ||
| 17292 | pub const ENABLED: Self = Self(0x01); | ||
| 17293 | } | ||
| 17294 | #[repr(transparent)] | ||
| 17295 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17296 | pub struct Lsirdyr(pub u8); | ||
| 17297 | impl Lsirdyr { | ||
| 17298 | #[doc = "LSI oscillator not ready"] | ||
| 17299 | pub const NOTREADY: Self = Self(0); | ||
| 17300 | #[doc = "LSI oscillator ready"] | ||
| 17301 | pub const READY: Self = Self(0x01); | ||
| 17302 | } | ||
| 17303 | #[repr(transparent)] | ||
| 17304 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17305 | pub struct Spi6sel(pub u8); | ||
| 17306 | impl Spi6sel { | ||
| 17307 | #[doc = "rcc_pclk4 selected as peripheral clock"] | ||
| 17308 | pub const RCC_PCLK4: Self = Self(0); | ||
| 17309 | #[doc = "pll2_q selected as peripheral clock"] | ||
| 17310 | pub const PLL2_Q: Self = Self(0x01); | ||
| 17311 | #[doc = "pll3_q selected as peripheral clock"] | ||
| 17312 | pub const PLL3_Q: Self = Self(0x02); | ||
| 17313 | #[doc = "hsi_ker selected as peripheral clock"] | ||
| 17314 | pub const HSI_KER: Self = Self(0x03); | ||
| 17315 | #[doc = "csi_ker selected as peripheral clock"] | ||
| 17316 | pub const CSI_KER: Self = Self(0x04); | ||
| 17317 | #[doc = "HSE selected as peripheral clock"] | ||
| 17318 | pub const HSE: Self = Self(0x05); | ||
| 17319 | } | ||
| 17320 | #[repr(transparent)] | ||
| 17321 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17322 | pub struct Apb1hlpenrCrslpen(pub u8); | ||
| 17323 | impl Apb1hlpenrCrslpen { | ||
| 17324 | #[doc = "The selected clock is disabled during csleep mode"] | ||
| 17325 | pub const DISABLED: Self = Self(0); | ||
| 17326 | #[doc = "The selected clock is enabled during csleep mode"] | ||
| 17327 | pub const ENABLED: Self = Self(0x01); | ||
| 17328 | } | ||
| 17329 | #[repr(transparent)] | ||
| 17330 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17331 | pub struct C1Apb1henrCrsen(pub u8); | ||
| 17332 | impl C1Apb1henrCrsen { | ||
| 17333 | #[doc = "The selected clock is disabled"] | ||
| 17334 | pub const DISABLED: Self = Self(0); | ||
| 17335 | #[doc = "The selected clock is enabled"] | ||
| 17336 | pub const ENABLED: Self = Self(0x01); | ||
| 17337 | } | ||
| 17338 | #[repr(transparent)] | ||
| 17339 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17340 | pub struct Tim1rst(pub u8); | ||
| 17341 | impl Tim1rst { | ||
| 17342 | #[doc = "Reset the selected module"] | ||
| 17343 | pub const RESET: Self = Self(0x01); | ||
| 17344 | } | ||
| 17345 | #[repr(transparent)] | ||
| 17346 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17347 | pub struct Tim2rst(pub u8); | ||
| 17348 | impl Tim2rst { | ||
| 17349 | #[doc = "Reset the selected module"] | ||
| 17350 | pub const RESET: Self = Self(0x01); | ||
| 17351 | } | ||
| 17352 | #[repr(transparent)] | ||
| 17353 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17354 | pub struct C1Apb2enrTim1en(pub u8); | ||
| 17355 | impl C1Apb2enrTim1en { | ||
| 17356 | #[doc = "The selected clock is disabled"] | ||
| 17357 | pub const DISABLED: Self = Self(0); | ||
| 17358 | #[doc = "The selected clock is enabled"] | ||
| 17359 | pub const ENABLED: Self = Self(0x01); | ||
| 17360 | } | ||
| 17361 | #[repr(transparent)] | ||
| 17362 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17363 | pub struct Pllsrc(pub u8); | ||
| 17364 | impl Pllsrc { | ||
| 17365 | #[doc = "HSI selected as PLL clock"] | ||
| 17366 | pub const HSI: Self = Self(0); | ||
| 17367 | #[doc = "CSI selected as PLL clock"] | ||
| 17368 | pub const CSI: Self = Self(0x01); | ||
| 17369 | #[doc = "HSE selected as PLL clock"] | ||
| 12555 | pub const HSE: Self = Self(0x02); | 17370 | pub const HSE: Self = Self(0x02); |
| 12556 | #[doc = "PLL used as system clock"] | 17371 | #[doc = "No clock sent to DIVMx dividers and PLLs"] |
| 12557 | pub const PLL: Self = Self(0x03); | 17372 | pub const NONE: Self = Self(0x03); |
| 12558 | } | 17373 | } |
| 12559 | #[repr(transparent)] | 17374 | #[repr(transparent)] |
| 12560 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17375 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12561 | pub struct Pllon(pub u8); | 17376 | pub struct Ahb3lpenrMdmalpen(pub u8); |
| 12562 | impl Pllon { | 17377 | impl Ahb3lpenrMdmalpen { |
| 12563 | #[doc = "Clock disabled"] | 17378 | #[doc = "The selected clock is disabled during csleep mode"] |
| 12564 | pub const DISABLED: Self = Self(0); | 17379 | pub const DISABLED: Self = Self(0); |
| 12565 | #[doc = "Clock enabled"] | 17380 | #[doc = "The selected clock is enabled during csleep mode"] |
| 12566 | pub const ENABLED: Self = Self(0x01); | 17381 | pub const ENABLED: Self = Self(0x01); |
| 12567 | } | 17382 | } |
| 12568 | #[repr(transparent)] | 17383 | #[repr(transparent)] |
| 12569 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17384 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12570 | pub struct Lptimsmen(pub u8); | 17385 | pub struct Apb4lpenrSyscfglpen(pub u8); |
| 12571 | impl Lptimsmen { | 17386 | impl Apb4lpenrSyscfglpen { |
| 12572 | #[doc = "Clock disabled"] | 17387 | #[doc = "The selected clock is disabled during csleep mode"] |
| 12573 | pub const DISABLED: Self = Self(0); | 17388 | pub const DISABLED: Self = Self(0); |
| 12574 | #[doc = "Clock enabled"] | 17389 | #[doc = "The selected clock is enabled during csleep mode"] |
| 12575 | pub const ENABLED: Self = Self(0x01); | 17390 | pub const ENABLED: Self = Self(0x01); |
| 12576 | } | 17391 | } |
| 12577 | #[repr(transparent)] | 17392 | #[repr(transparent)] |
| 12578 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17393 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12579 | pub struct Dbgen(pub u8); | 17394 | pub struct Sai1sel(pub u8); |
| 12580 | impl Dbgen { | 17395 | impl Sai1sel { |
| 12581 | #[doc = "Clock disabled"] | 17396 | #[doc = "pll1_q selected as peripheral clock"] |
| 17397 | pub const PLL1_Q: Self = Self(0); | ||
| 17398 | #[doc = "pll2_p selected as peripheral clock"] | ||
| 17399 | pub const PLL2_P: Self = Self(0x01); | ||
| 17400 | #[doc = "pll3_p selected as peripheral clock"] | ||
| 17401 | pub const PLL3_P: Self = Self(0x02); | ||
| 17402 | #[doc = "I2S_CKIN selected as peripheral clock"] | ||
| 17403 | pub const I2S_CKIN: Self = Self(0x03); | ||
| 17404 | #[doc = "PER selected as peripheral clock"] | ||
| 17405 | pub const PER: Self = Self(0x04); | ||
| 17406 | } | ||
| 17407 | #[repr(transparent)] | ||
| 17408 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17409 | pub struct C1Apb3enrLtdcen(pub u8); | ||
| 17410 | impl C1Apb3enrLtdcen { | ||
| 17411 | #[doc = "The selected clock is disabled"] | ||
| 12582 | pub const DISABLED: Self = Self(0); | 17412 | pub const DISABLED: Self = Self(0); |
| 12583 | #[doc = "Clock enabled"] | 17413 | #[doc = "The selected clock is enabled"] |
| 12584 | pub const ENABLED: Self = Self(0x01); | 17414 | pub const ENABLED: Self = Self(0x01); |
| 12585 | } | 17415 | } |
| 12586 | #[repr(transparent)] | 17416 | #[repr(transparent)] |
| 12587 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17417 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12588 | pub struct Hsiouten(pub u8); | 17418 | pub struct Ahb3enrMdmaen(pub u8); |
| 12589 | impl Hsiouten { | 17419 | impl Ahb3enrMdmaen { |
| 12590 | #[doc = "HSI output clock disabled"] | 17420 | #[doc = "The selected clock is disabled"] |
| 12591 | pub const DISABLED: Self = Self(0); | 17421 | pub const DISABLED: Self = Self(0); |
| 12592 | #[doc = "HSI output clock enabled"] | 17422 | #[doc = "The selected clock is enabled"] |
| 12593 | pub const ENABLED: Self = Self(0x01); | 17423 | pub const ENABLED: Self = Self(0x01); |
| 12594 | } | 17424 | } |
| 12595 | #[repr(transparent)] | 17425 | #[repr(transparent)] |
| 12596 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17426 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12597 | pub struct Mcopre(pub u8); | 17427 | pub struct Fmcsel(pub u8); |
| 12598 | impl Mcopre { | 17428 | impl Fmcsel { |
| 12599 | #[doc = "No division"] | 17429 | #[doc = "rcc_hclk3 selected as peripheral clock"] |
| 17430 | pub const RCC_HCLK3: Self = Self(0); | ||
| 17431 | #[doc = "pll1_q selected as peripheral clock"] | ||
| 17432 | pub const PLL1_Q: Self = Self(0x01); | ||
| 17433 | #[doc = "pll2_r selected as peripheral clock"] | ||
| 17434 | pub const PLL2_R: Self = Self(0x02); | ||
| 17435 | #[doc = "PER selected as peripheral clock"] | ||
| 17436 | pub const PER: Self = Self(0x03); | ||
| 17437 | } | ||
| 17438 | #[repr(transparent)] | ||
| 17439 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17440 | pub struct Spi45sel(pub u8); | ||
| 17441 | impl Spi45sel { | ||
| 17442 | #[doc = "APB clock selected as peripheral clock"] | ||
| 17443 | pub const APB: Self = Self(0); | ||
| 17444 | #[doc = "pll2_q selected as peripheral clock"] | ||
| 17445 | pub const PLL2_Q: Self = Self(0x01); | ||
| 17446 | #[doc = "pll3_q selected as peripheral clock"] | ||
| 17447 | pub const PLL3_Q: Self = Self(0x02); | ||
| 17448 | #[doc = "hsi_ker selected as peripheral clock"] | ||
| 17449 | pub const HSI_KER: Self = Self(0x03); | ||
| 17450 | #[doc = "csi_ker selected as peripheral clock"] | ||
| 17451 | pub const CSI_KER: Self = Self(0x04); | ||
| 17452 | #[doc = "HSE selected as peripheral clock"] | ||
| 17453 | pub const HSE: Self = Self(0x05); | ||
| 17454 | } | ||
| 17455 | #[repr(transparent)] | ||
| 17456 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17457 | pub struct Divp1(pub u8); | ||
| 17458 | impl Divp1 { | ||
| 17459 | #[doc = "pll_p_ck = vco_ck"] | ||
| 12600 | pub const DIV1: Self = Self(0); | 17460 | pub const DIV1: Self = Self(0); |
| 12601 | #[doc = "Division by 2"] | 17461 | #[doc = "pll_p_ck = vco_ck / 2"] |
| 12602 | pub const DIV2: Self = Self(0x01); | 17462 | pub const DIV2: Self = Self(0x01); |
| 12603 | #[doc = "Division by 4"] | 17463 | #[doc = "pll_p_ck = vco_ck / 4"] |
| 12604 | pub const DIV4: Self = Self(0x02); | 17464 | pub const DIV4: Self = Self(0x03); |
| 12605 | #[doc = "Division by 8"] | 17465 | #[doc = "pll_p_ck = vco_ck / 6"] |
| 12606 | pub const DIV8: Self = Self(0x03); | 17466 | pub const DIV6: Self = Self(0x05); |
| 12607 | #[doc = "Division by 16"] | 17467 | #[doc = "pll_p_ck = vco_ck / 8"] |
| 12608 | pub const DIV16: Self = Self(0x04); | 17468 | pub const DIV8: Self = Self(0x07); |
| 17469 | #[doc = "pll_p_ck = vco_ck / 10"] | ||
| 17470 | pub const DIV10: Self = Self(0x09); | ||
| 17471 | #[doc = "pll_p_ck = vco_ck / 12"] | ||
| 17472 | pub const DIV12: Self = Self(0x0b); | ||
| 17473 | #[doc = "pll_p_ck = vco_ck / 14"] | ||
| 17474 | pub const DIV14: Self = Self(0x0d); | ||
| 17475 | #[doc = "pll_p_ck = vco_ck / 16"] | ||
| 17476 | pub const DIV16: Self = Self(0x0f); | ||
| 17477 | #[doc = "pll_p_ck = vco_ck / 18"] | ||
| 17478 | pub const DIV18: Self = Self(0x11); | ||
| 17479 | #[doc = "pll_p_ck = vco_ck / 20"] | ||
| 17480 | pub const DIV20: Self = Self(0x13); | ||
| 17481 | #[doc = "pll_p_ck = vco_ck / 22"] | ||
| 17482 | pub const DIV22: Self = Self(0x15); | ||
| 17483 | #[doc = "pll_p_ck = vco_ck / 24"] | ||
| 17484 | pub const DIV24: Self = Self(0x17); | ||
| 17485 | #[doc = "pll_p_ck = vco_ck / 26"] | ||
| 17486 | pub const DIV26: Self = Self(0x19); | ||
| 17487 | #[doc = "pll_p_ck = vco_ck / 28"] | ||
| 17488 | pub const DIV28: Self = Self(0x1b); | ||
| 17489 | #[doc = "pll_p_ck = vco_ck / 30"] | ||
| 17490 | pub const DIV30: Self = Self(0x1d); | ||
| 17491 | #[doc = "pll_p_ck = vco_ck / 32"] | ||
| 17492 | pub const DIV32: Self = Self(0x1f); | ||
| 17493 | #[doc = "pll_p_ck = vco_ck / 34"] | ||
| 17494 | pub const DIV34: Self = Self(0x21); | ||
| 17495 | #[doc = "pll_p_ck = vco_ck / 36"] | ||
| 17496 | pub const DIV36: Self = Self(0x23); | ||
| 17497 | #[doc = "pll_p_ck = vco_ck / 38"] | ||
| 17498 | pub const DIV38: Self = Self(0x25); | ||
| 17499 | #[doc = "pll_p_ck = vco_ck / 40"] | ||
| 17500 | pub const DIV40: Self = Self(0x27); | ||
| 17501 | #[doc = "pll_p_ck = vco_ck / 42"] | ||
| 17502 | pub const DIV42: Self = Self(0x29); | ||
| 17503 | #[doc = "pll_p_ck = vco_ck / 44"] | ||
| 17504 | pub const DIV44: Self = Self(0x2b); | ||
| 17505 | #[doc = "pll_p_ck = vco_ck / 46"] | ||
| 17506 | pub const DIV46: Self = Self(0x2d); | ||
| 17507 | #[doc = "pll_p_ck = vco_ck / 48"] | ||
| 17508 | pub const DIV48: Self = Self(0x2f); | ||
| 17509 | #[doc = "pll_p_ck = vco_ck / 50"] | ||
| 17510 | pub const DIV50: Self = Self(0x31); | ||
| 17511 | #[doc = "pll_p_ck = vco_ck / 52"] | ||
| 17512 | pub const DIV52: Self = Self(0x33); | ||
| 17513 | #[doc = "pll_p_ck = vco_ck / 54"] | ||
| 17514 | pub const DIV54: Self = Self(0x35); | ||
| 17515 | #[doc = "pll_p_ck = vco_ck / 56"] | ||
| 17516 | pub const DIV56: Self = Self(0x37); | ||
| 17517 | #[doc = "pll_p_ck = vco_ck / 58"] | ||
| 17518 | pub const DIV58: Self = Self(0x39); | ||
| 17519 | #[doc = "pll_p_ck = vco_ck / 60"] | ||
| 17520 | pub const DIV60: Self = Self(0x3b); | ||
| 17521 | #[doc = "pll_p_ck = vco_ck / 62"] | ||
| 17522 | pub const DIV62: Self = Self(0x3d); | ||
| 17523 | #[doc = "pll_p_ck = vco_ck / 64"] | ||
| 17524 | pub const DIV64: Self = Self(0x3f); | ||
| 17525 | #[doc = "pll_p_ck = vco_ck / 66"] | ||
| 17526 | pub const DIV66: Self = Self(0x41); | ||
| 17527 | #[doc = "pll_p_ck = vco_ck / 68"] | ||
| 17528 | pub const DIV68: Self = Self(0x43); | ||
| 17529 | #[doc = "pll_p_ck = vco_ck / 70"] | ||
| 17530 | pub const DIV70: Self = Self(0x45); | ||
| 17531 | #[doc = "pll_p_ck = vco_ck / 72"] | ||
| 17532 | pub const DIV72: Self = Self(0x47); | ||
| 17533 | #[doc = "pll_p_ck = vco_ck / 74"] | ||
| 17534 | pub const DIV74: Self = Self(0x49); | ||
| 17535 | #[doc = "pll_p_ck = vco_ck / 76"] | ||
| 17536 | pub const DIV76: Self = Self(0x4b); | ||
| 17537 | #[doc = "pll_p_ck = vco_ck / 78"] | ||
| 17538 | pub const DIV78: Self = Self(0x4d); | ||
| 17539 | #[doc = "pll_p_ck = vco_ck / 80"] | ||
| 17540 | pub const DIV80: Self = Self(0x4f); | ||
| 17541 | #[doc = "pll_p_ck = vco_ck / 82"] | ||
| 17542 | pub const DIV82: Self = Self(0x51); | ||
| 17543 | #[doc = "pll_p_ck = vco_ck / 84"] | ||
| 17544 | pub const DIV84: Self = Self(0x53); | ||
| 17545 | #[doc = "pll_p_ck = vco_ck / 86"] | ||
| 17546 | pub const DIV86: Self = Self(0x55); | ||
| 17547 | #[doc = "pll_p_ck = vco_ck / 88"] | ||
| 17548 | pub const DIV88: Self = Self(0x57); | ||
| 17549 | #[doc = "pll_p_ck = vco_ck / 90"] | ||
| 17550 | pub const DIV90: Self = Self(0x59); | ||
| 17551 | #[doc = "pll_p_ck = vco_ck / 92"] | ||
| 17552 | pub const DIV92: Self = Self(0x5b); | ||
| 17553 | #[doc = "pll_p_ck = vco_ck / 94"] | ||
| 17554 | pub const DIV94: Self = Self(0x5d); | ||
| 17555 | #[doc = "pll_p_ck = vco_ck / 96"] | ||
| 17556 | pub const DIV96: Self = Self(0x5f); | ||
| 17557 | #[doc = "pll_p_ck = vco_ck / 98"] | ||
| 17558 | pub const DIV98: Self = Self(0x61); | ||
| 17559 | #[doc = "pll_p_ck = vco_ck / 100"] | ||
| 17560 | pub const DIV100: Self = Self(0x63); | ||
| 17561 | #[doc = "pll_p_ck = vco_ck / 102"] | ||
| 17562 | pub const DIV102: Self = Self(0x65); | ||
| 17563 | #[doc = "pll_p_ck = vco_ck / 104"] | ||
| 17564 | pub const DIV104: Self = Self(0x67); | ||
| 17565 | #[doc = "pll_p_ck = vco_ck / 106"] | ||
| 17566 | pub const DIV106: Self = Self(0x69); | ||
| 17567 | #[doc = "pll_p_ck = vco_ck / 108"] | ||
| 17568 | pub const DIV108: Self = Self(0x6b); | ||
| 17569 | #[doc = "pll_p_ck = vco_ck / 110"] | ||
| 17570 | pub const DIV110: Self = Self(0x6d); | ||
| 17571 | #[doc = "pll_p_ck = vco_ck / 112"] | ||
| 17572 | pub const DIV112: Self = Self(0x6f); | ||
| 17573 | #[doc = "pll_p_ck = vco_ck / 114"] | ||
| 17574 | pub const DIV114: Self = Self(0x71); | ||
| 17575 | #[doc = "pll_p_ck = vco_ck / 116"] | ||
| 17576 | pub const DIV116: Self = Self(0x73); | ||
| 17577 | #[doc = "pll_p_ck = vco_ck / 118"] | ||
| 17578 | pub const DIV118: Self = Self(0x75); | ||
| 17579 | #[doc = "pll_p_ck = vco_ck / 120"] | ||
| 17580 | pub const DIV120: Self = Self(0x77); | ||
| 17581 | #[doc = "pll_p_ck = vco_ck / 122"] | ||
| 17582 | pub const DIV122: Self = Self(0x79); | ||
| 17583 | #[doc = "pll_p_ck = vco_ck / 124"] | ||
| 17584 | pub const DIV124: Self = Self(0x7b); | ||
| 17585 | #[doc = "pll_p_ck = vco_ck / 126"] | ||
| 17586 | pub const DIV126: Self = Self(0x7d); | ||
| 17587 | #[doc = "pll_p_ck = vco_ck / 128"] | ||
| 17588 | pub const DIV128: Self = Self(0x7f); | ||
| 12609 | } | 17589 | } |
| 12610 | #[repr(transparent)] | 17590 | #[repr(transparent)] |
| 12611 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17591 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12612 | pub struct Csslse(pub u8); | 17592 | pub struct Lptim2sel(pub u8); |
| 12613 | impl Csslse { | 17593 | impl Lptim2sel { |
| 12614 | #[doc = "LSE CSS interrupt disabled"] | 17594 | #[doc = "rcc_pclk4 selected as peripheral clock"] |
| 12615 | pub const DISABLED: Self = Self(0); | 17595 | pub const RCC_PCLK4: Self = Self(0); |
| 12616 | #[doc = "LSE CSS interrupt enabled"] | 17596 | #[doc = "pll2_p selected as peripheral clock"] |
| 12617 | pub const ENABLED: Self = Self(0x01); | 17597 | pub const PLL2_P: Self = Self(0x01); |
| 17598 | #[doc = "pll3_r selected as peripheral clock"] | ||
| 17599 | pub const PLL3_R: Self = Self(0x02); | ||
| 17600 | #[doc = "LSE selected as peripheral clock"] | ||
| 17601 | pub const LSE: Self = Self(0x03); | ||
| 17602 | #[doc = "LSI selected as peripheral clock"] | ||
| 17603 | pub const LSI: Self = Self(0x04); | ||
| 17604 | #[doc = "PER selected as peripheral clock"] | ||
| 17605 | pub const PER: Self = Self(0x05); | ||
| 12618 | } | 17606 | } |
| 12619 | #[repr(transparent)] | 17607 | #[repr(transparent)] |
| 12620 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17608 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12621 | pub struct Hsi16rdyfr(pub u8); | 17609 | pub struct Apb3enrLtdcen(pub u8); |
| 12622 | impl Hsi16rdyfr { | 17610 | impl Apb3enrLtdcen { |
| 12623 | #[doc = "HSI 16 MHz oscillator not ready"] | 17611 | #[doc = "The selected clock is disabled"] |
| 12624 | pub const NOTREADY: Self = Self(0); | 17612 | pub const DISABLED: Self = Self(0); |
| 12625 | #[doc = "HSI 16 MHz oscillator ready"] | 17613 | #[doc = "The selected clock is enabled"] |
| 12626 | pub const READY: Self = Self(0x01); | 17614 | pub const ENABLED: Self = Self(0x01); |
| 12627 | } | 17615 | } |
| 12628 | #[repr(transparent)] | 17616 | #[repr(transparent)] |
| 12629 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17617 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12630 | pub struct Rtcrstw(pub u8); | 17618 | pub struct C1Apb1hlpenrCrslpen(pub u8); |
| 12631 | impl Rtcrstw { | 17619 | impl C1Apb1hlpenrCrslpen { |
| 12632 | #[doc = "Resets the RTC peripheral"] | 17620 | #[doc = "The selected clock is disabled during csleep mode"] |
| 12633 | pub const RESET: Self = Self(0x01); | 17621 | pub const DISABLED: Self = Self(0); |
| 17622 | #[doc = "The selected clock is enabled during csleep mode"] | ||
| 17623 | pub const ENABLED: Self = Self(0x01); | ||
| 12634 | } | 17624 | } |
| 12635 | #[repr(transparent)] | 17625 | #[repr(transparent)] |
| 12636 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17626 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12637 | pub struct Pllmul(pub u8); | 17627 | pub struct Usbsel(pub u8); |
| 12638 | impl Pllmul { | 17628 | impl Usbsel { |
| 12639 | #[doc = "PLL clock entry x 3"] | 17629 | #[doc = "Disable the kernel clock"] |
| 12640 | pub const MUL3: Self = Self(0); | 17630 | pub const DISABLE: Self = Self(0); |
| 12641 | #[doc = "PLL clock entry x 4"] | 17631 | #[doc = "pll1_q selected as peripheral clock"] |
| 12642 | pub const MUL4: Self = Self(0x01); | 17632 | pub const PLL1_Q: Self = Self(0x01); |
| 12643 | #[doc = "PLL clock entry x 6"] | 17633 | #[doc = "pll3_q selected as peripheral clock"] |
| 12644 | pub const MUL6: Self = Self(0x02); | 17634 | pub const PLL3_Q: Self = Self(0x02); |
| 12645 | #[doc = "PLL clock entry x 8"] | 17635 | #[doc = "HSI48 selected as peripheral clock"] |
| 12646 | pub const MUL8: Self = Self(0x03); | 17636 | pub const HSI48: Self = Self(0x03); |
| 12647 | #[doc = "PLL clock entry x 12"] | ||
| 12648 | pub const MUL12: Self = Self(0x04); | ||
| 12649 | #[doc = "PLL clock entry x 16"] | ||
| 12650 | pub const MUL16: Self = Self(0x05); | ||
| 12651 | #[doc = "PLL clock entry x 24"] | ||
| 12652 | pub const MUL24: Self = Self(0x06); | ||
| 12653 | #[doc = "PLL clock entry x 32"] | ||
| 12654 | pub const MUL32: Self = Self(0x07); | ||
| 12655 | #[doc = "PLL clock entry x 48"] | ||
| 12656 | pub const MUL48: Self = Self(0x08); | ||
| 12657 | } | 17637 | } |
| 12658 | #[repr(transparent)] | 17638 | #[repr(transparent)] |
| 12659 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17639 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12660 | pub struct Hsidiven(pub u8); | 17640 | pub struct Ltdcrst(pub u8); |
| 12661 | impl Hsidiven { | 17641 | impl Ltdcrst { |
| 12662 | #[doc = "no 16 MHz HSI division requested"] | 17642 | #[doc = "Reset the selected module"] |
| 12663 | pub const NOTDIVIDED: Self = Self(0); | 17643 | pub const RESET: Self = Self(0x01); |
| 12664 | #[doc = "16 MHz HSI division by 4 requested"] | ||
| 12665 | pub const DIV4: Self = Self(0x01); | ||
| 12666 | } | 17644 | } |
| 12667 | #[repr(transparent)] | 17645 | #[repr(transparent)] |
| 12668 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17646 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12669 | pub struct Iophsmen(pub u8); | 17647 | pub struct C1Ahb4enrGpioaen(pub u8); |
| 12670 | impl Iophsmen { | 17648 | impl C1Ahb4enrGpioaen { |
| 12671 | #[doc = "Port x clock is disabled in Sleep mode"] | 17649 | #[doc = "The selected clock is disabled"] |
| 12672 | pub const DISABLED: Self = Self(0); | 17650 | pub const DISABLED: Self = Self(0); |
| 12673 | #[doc = "Port x clock is enabled in Sleep mode (if enabled by IOPHEN)"] | 17651 | #[doc = "The selected clock is enabled"] |
| 12674 | pub const ENABLED: Self = Self(0x01); | 17652 | pub const ENABLED: Self = Self(0x01); |
| 12675 | } | 17653 | } |
| 12676 | #[repr(transparent)] | 17654 | #[repr(transparent)] |
| 12677 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17655 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12678 | pub struct Pllsrc(pub u8); | 17656 | pub struct Spdifsel(pub u8); |
| 12679 | impl Pllsrc { | 17657 | impl Spdifsel { |
| 12680 | #[doc = "HSI selected as PLL input clock"] | 17658 | #[doc = "pll1_q selected as peripheral clock"] |
| 12681 | pub const HSI16: Self = Self(0); | 17659 | pub const PLL1_Q: Self = Self(0); |
| 12682 | #[doc = "HSE selected as PLL input clock"] | 17660 | #[doc = "pll2_r selected as peripheral clock"] |
| 12683 | pub const HSE: Self = Self(0x01); | 17661 | pub const PLL2_R: Self = Self(0x01); |
| 17662 | #[doc = "pll3_r selected as peripheral clock"] | ||
| 17663 | pub const PLL3_R: Self = Self(0x02); | ||
| 17664 | #[doc = "hsi_ker selected as peripheral clock"] | ||
| 17665 | pub const HSI_KER: Self = Self(0x03); | ||
| 17666 | } | ||
| 17667 | #[repr(transparent)] | ||
| 17668 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17669 | pub struct Apb1lenrTim2en(pub u8); | ||
| 17670 | impl Apb1lenrTim2en { | ||
| 17671 | #[doc = "The selected clock is disabled"] | ||
| 17672 | pub const DISABLED: Self = Self(0); | ||
| 17673 | #[doc = "The selected clock is enabled"] | ||
| 17674 | pub const ENABLED: Self = Self(0x01); | ||
| 12684 | } | 17675 | } |
| 12685 | #[repr(transparent)] | 17676 | #[repr(transparent)] |
| 12686 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17677 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12687 | pub struct Hsebyp(pub u8); | 17678 | pub struct Hsebyp(pub u8); |
| 12688 | impl Hsebyp { | 17679 | impl Hsebyp { |
| 12689 | #[doc = "HSE oscillator not bypassed"] | 17680 | #[doc = "HSE crystal oscillator not bypassed"] |
| 12690 | pub const NOTBYPASSED: Self = Self(0); | 17681 | pub const NOTBYPASSED: Self = Self(0); |
| 12691 | #[doc = "HSE oscillator bypassed"] | 17682 | #[doc = "HSE crystal oscillator bypassed with external clock"] |
| 12692 | pub const BYPASSED: Self = Self(0x01); | 17683 | pub const BYPASSED: Self = Self(0x01); |
| 12693 | } | 17684 | } |
| 12694 | #[repr(transparent)] | 17685 | #[repr(transparent)] |
| 12695 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17686 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12696 | pub struct Plldiv(pub u8); | 17687 | pub struct C1RsrRmvf(pub u8); |
| 12697 | impl Plldiv { | 17688 | impl C1RsrRmvf { |
| 12698 | #[doc = "PLLVCO / 2"] | 17689 | #[doc = "Not clearing the the reset flags"] |
| 12699 | pub const DIV2: Self = Self(0x01); | 17690 | pub const NOTACTIVE: Self = Self(0); |
| 12700 | #[doc = "PLLVCO / 3"] | 17691 | #[doc = "Clear the reset flags"] |
| 12701 | pub const DIV3: Self = Self(0x02); | 17692 | pub const CLEAR: Self = Self(0x01); |
| 12702 | #[doc = "PLLVCO / 4"] | ||
| 12703 | pub const DIV4: Self = Self(0x03); | ||
| 12704 | } | 17693 | } |
| 12705 | #[repr(transparent)] | 17694 | #[repr(transparent)] |
| 12706 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17695 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12707 | pub struct Sw(pub u8); | 17696 | pub struct Apb3lpenrLtdclpen(pub u8); |
| 12708 | impl Sw { | 17697 | impl Apb3lpenrLtdclpen { |
| 12709 | #[doc = "MSI oscillator used as system clock"] | 17698 | #[doc = "The selected clock is disabled during csleep mode"] |
| 12710 | pub const MSI: Self = Self(0); | 17699 | pub const DISABLED: Self = Self(0); |
| 12711 | #[doc = "HSI oscillator used as system clock"] | 17700 | #[doc = "The selected clock is enabled during csleep mode"] |
| 12712 | pub const HSI16: Self = Self(0x01); | 17701 | pub const ENABLED: Self = Self(0x01); |
| 12713 | #[doc = "HSE oscillator used as system clock"] | ||
| 12714 | pub const HSE: Self = Self(0x02); | ||
| 12715 | #[doc = "PLL used as system clock"] | ||
| 12716 | pub const PLL: Self = Self(0x03); | ||
| 12717 | } | 17702 | } |
| 12718 | #[repr(transparent)] | 17703 | #[repr(transparent)] |
| 12719 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17704 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12720 | pub struct Crypsmen(pub u8); | 17705 | pub struct Lsecsson(pub u8); |
| 12721 | impl Crypsmen { | 17706 | impl Lsecsson { |
| 12722 | #[doc = "Crypto clock disabled in Sleep mode"] | 17707 | #[doc = "Clock security system on 32 kHz oscillator off"] |
| 17708 | pub const SECURITYOFF: Self = Self(0); | ||
| 17709 | #[doc = "Clock security system on 32 kHz oscillator on"] | ||
| 17710 | pub const SECURITYON: Self = Self(0x01); | ||
| 17711 | } | ||
| 17712 | #[repr(transparent)] | ||
| 17713 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17714 | pub struct Ahb1enrDma1en(pub u8); | ||
| 17715 | impl Ahb1enrDma1en { | ||
| 17716 | #[doc = "The selected clock is disabled"] | ||
| 12723 | pub const DISABLED: Self = Self(0); | 17717 | pub const DISABLED: Self = Self(0); |
| 12724 | #[doc = "Crypto clock enabled in Sleep mode"] | 17718 | #[doc = "The selected clock is enabled"] |
| 17719 | pub const ENABLED: Self = Self(0x01); | ||
| 17720 | } | ||
| 17721 | #[repr(transparent)] | ||
| 17722 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17723 | pub struct Hsion(pub u8); | ||
| 17724 | impl Hsion { | ||
| 17725 | #[doc = "Clock Off"] | ||
| 17726 | pub const OFF: Self = Self(0); | ||
| 17727 | #[doc = "Clock On"] | ||
| 17728 | pub const ON: Self = Self(0x01); | ||
| 17729 | } | ||
| 17730 | #[repr(transparent)] | ||
| 17731 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17732 | pub struct Swpsel(pub u8); | ||
| 17733 | impl Swpsel { | ||
| 17734 | #[doc = "pclk selected as peripheral clock"] | ||
| 17735 | pub const PCLK: Self = Self(0); | ||
| 17736 | #[doc = "hsi_ker selected as peripheral clock"] | ||
| 17737 | pub const HSI_KER: Self = Self(0x01); | ||
| 17738 | } | ||
| 17739 | #[repr(transparent)] | ||
| 17740 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | ||
| 17741 | pub struct Divp1en(pub u8); | ||
| 17742 | impl Divp1en { | ||
| 17743 | #[doc = "Clock ouput is disabled"] | ||
| 17744 | pub const DISABLED: Self = Self(0); | ||
| 17745 | #[doc = "Clock output is enabled"] | ||
| 12725 | pub const ENABLED: Self = Self(0x01); | 17746 | pub const ENABLED: Self = Self(0x01); |
| 12726 | } | 17747 | } |
| 12727 | #[repr(transparent)] | 17748 | #[repr(transparent)] |
| @@ -12735,2701 +17756,8459 @@ bits in the RCC clock control register (RCC_CR)) used as the RTC clock"] | |||
| 12735 | } | 17756 | } |
| 12736 | #[repr(transparent)] | 17757 | #[repr(transparent)] |
| 12737 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17758 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12738 | pub struct Lserdy(pub u8); | 17759 | pub struct RsrRmvf(pub u8); |
| 12739 | impl Lserdy { | 17760 | impl RsrRmvf { |
| 12740 | #[doc = "Oscillator not ready"] | 17761 | #[doc = "Not clearing the the reset flags"] |
| 12741 | pub const NOTREADY: Self = Self(0); | 17762 | pub const NOTACTIVE: Self = Self(0); |
| 12742 | #[doc = "Oscillator ready"] | 17763 | #[doc = "Clear the reset flags"] |
| 12743 | pub const READY: Self = Self(0x01); | 17764 | pub const CLEAR: Self = Self(0x01); |
| 12744 | } | 17765 | } |
| 12745 | #[repr(transparent)] | 17766 | #[repr(transparent)] |
| 12746 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17767 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12747 | pub struct Iophen(pub u8); | 17768 | pub struct I2c4sel(pub u8); |
| 12748 | impl Iophen { | 17769 | impl I2c4sel { |
| 12749 | #[doc = "Port clock disabled"] | 17770 | #[doc = "rcc_pclk4 selected as peripheral clock"] |
| 12750 | pub const DISABLED: Self = Self(0); | 17771 | pub const RCC_PCLK4: Self = Self(0); |
| 12751 | #[doc = "Port clock enabled"] | 17772 | #[doc = "pll3_r selected as peripheral clock"] |
| 12752 | pub const ENABLED: Self = Self(0x01); | 17773 | pub const PLL3_R: Self = Self(0x01); |
| 17774 | #[doc = "hsi_ker selected as peripheral clock"] | ||
| 17775 | pub const HSI_KER: Self = Self(0x02); | ||
| 17776 | #[doc = "csi_ker selected as peripheral clock"] | ||
| 17777 | pub const CSI_KER: Self = Self(0x03); | ||
| 12753 | } | 17778 | } |
| 12754 | #[repr(transparent)] | 17779 | #[repr(transparent)] |
| 12755 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17780 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12756 | pub struct Ppre(pub u8); | 17781 | pub struct Cecsel(pub u8); |
| 12757 | impl Ppre { | 17782 | impl Cecsel { |
| 12758 | #[doc = "HCLK not divided"] | 17783 | #[doc = "LSE selected as peripheral clock"] |
| 12759 | pub const DIV1: Self = Self(0); | 17784 | pub const LSE: Self = Self(0); |
| 12760 | #[doc = "HCLK divided by 2"] | 17785 | #[doc = "LSI selected as peripheral clock"] |
| 12761 | pub const DIV2: Self = Self(0x04); | 17786 | pub const LSI: Self = Self(0x01); |
| 12762 | #[doc = "HCLK divided by 4"] | 17787 | #[doc = "csi_ker selected as peripheral clock"] |
| 12763 | pub const DIV4: Self = Self(0x05); | 17788 | pub const CSI_KER: Self = Self(0x02); |
| 12764 | #[doc = "HCLK divided by 8"] | ||
| 12765 | pub const DIV8: Self = Self(0x06); | ||
| 12766 | #[doc = "HCLK divided by 16"] | ||
| 12767 | pub const DIV16: Self = Self(0x07); | ||
| 12768 | } | ||
| 12769 | } | ||
| 12770 | } | ||
| 12771 | pub mod dma_v2 { | ||
| 12772 | use crate::generic::*; | ||
| 12773 | #[doc = "Stream cluster: S?CR, S?NDTR, S?M0AR, S?M1AR and S?FCR registers"] | ||
| 12774 | #[derive(Copy, Clone)] | ||
| 12775 | pub struct St(pub *mut u8); | ||
| 12776 | unsafe impl Send for St {} | ||
| 12777 | unsafe impl Sync for St {} | ||
| 12778 | impl St { | ||
| 12779 | #[doc = "stream x configuration register"] | ||
| 12780 | pub fn cr(self) -> Reg<regs::Cr, RW> { | ||
| 12781 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 12782 | } | ||
| 12783 | #[doc = "stream x number of data register"] | ||
| 12784 | pub fn ndtr(self) -> Reg<regs::Ndtr, RW> { | ||
| 12785 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | ||
| 12786 | } | ||
| 12787 | #[doc = "stream x peripheral address register"] | ||
| 12788 | pub fn par(self) -> Reg<u32, RW> { | ||
| 12789 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 12790 | } | ||
| 12791 | #[doc = "stream x memory 0 address register"] | ||
| 12792 | pub fn m0ar(self) -> Reg<u32, RW> { | ||
| 12793 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 12794 | } | ||
| 12795 | #[doc = "stream x memory 1 address register"] | ||
| 12796 | pub fn m1ar(self) -> Reg<u32, RW> { | ||
| 12797 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 12798 | } | 17789 | } |
| 12799 | #[doc = "stream x FIFO control register"] | 17790 | #[repr(transparent)] |
| 12800 | pub fn fcr(self) -> Reg<regs::Fcr, RW> { | 17791 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12801 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | 17792 | pub struct Mco2(pub u8); |
| 17793 | impl Mco2 { | ||
| 17794 | #[doc = "System clock selected for micro-controller clock output"] | ||
| 17795 | pub const SYSCLK: Self = Self(0); | ||
| 17796 | #[doc = "pll2_p selected for micro-controller clock output"] | ||
| 17797 | pub const PLL2_P: Self = Self(0x01); | ||
| 17798 | #[doc = "HSE selected for micro-controller clock output"] | ||
| 17799 | pub const HSE: Self = Self(0x02); | ||
| 17800 | #[doc = "pll1_p selected for micro-controller clock output"] | ||
| 17801 | pub const PLL1_P: Self = Self(0x03); | ||
| 17802 | #[doc = "CSI selected for micro-controller clock output"] | ||
| 17803 | pub const CSI: Self = Self(0x04); | ||
| 17804 | #[doc = "LSI selected for micro-controller clock output"] | ||
| 17805 | pub const LSI: Self = Self(0x05); | ||
| 12802 | } | 17806 | } |
| 12803 | } | 17807 | #[repr(transparent)] |
| 12804 | #[doc = "DMA controller"] | 17808 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12805 | #[derive(Copy, Clone)] | 17809 | pub struct Ahb4enrGpioaen(pub u8); |
| 12806 | pub struct Dma(pub *mut u8); | 17810 | impl Ahb4enrGpioaen { |
| 12807 | unsafe impl Send for Dma {} | 17811 | #[doc = "The selected clock is disabled"] |
| 12808 | unsafe impl Sync for Dma {} | 17812 | pub const DISABLED: Self = Self(0); |
| 12809 | impl Dma { | 17813 | #[doc = "The selected clock is enabled"] |
| 12810 | #[doc = "low interrupt status register"] | 17814 | pub const ENABLED: Self = Self(0x01); |
| 12811 | pub fn isr(self, n: usize) -> Reg<regs::Ixr, R> { | ||
| 12812 | assert!(n < 2usize); | ||
| 12813 | unsafe { Reg::from_ptr(self.0.add(0usize + n * 4usize)) } | ||
| 12814 | } | 17815 | } |
| 12815 | #[doc = "low interrupt flag clear register"] | 17816 | #[repr(transparent)] |
| 12816 | pub fn ifcr(self, n: usize) -> Reg<regs::Ixr, W> { | 17817 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12817 | assert!(n < 2usize); | 17818 | pub struct Camitfrst(pub u8); |
| 12818 | unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) } | 17819 | impl Camitfrst { |
| 17820 | #[doc = "Reset the selected module"] | ||
| 17821 | pub const RESET: Self = Self(0x01); | ||
| 12819 | } | 17822 | } |
| 12820 | #[doc = "Stream cluster: S?CR, S?NDTR, S?M0AR, S?M1AR and S?FCR registers"] | 17823 | #[repr(transparent)] |
| 12821 | pub fn st(self, n: usize) -> St { | 17824 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12822 | assert!(n < 8usize); | 17825 | pub struct Hsirdyr(pub u8); |
| 12823 | unsafe { St(self.0.add(16usize + n * 24usize)) } | 17826 | impl Hsirdyr { |
| 17827 | #[doc = "Clock not ready"] | ||
| 17828 | pub const NOTREADY: Self = Self(0); | ||
| 17829 | #[doc = "Clock ready"] | ||
| 17830 | pub const READY: Self = Self(0x01); | ||
| 12824 | } | 17831 | } |
| 12825 | } | ||
| 12826 | pub mod vals { | ||
| 12827 | use crate::generic::*; | ||
| 12828 | #[repr(transparent)] | 17832 | #[repr(transparent)] |
| 12829 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17833 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12830 | pub struct Dmdis(pub u8); | 17834 | pub struct Ahb4lpenrGpioalpen(pub u8); |
| 12831 | impl Dmdis { | 17835 | impl Ahb4lpenrGpioalpen { |
| 12832 | #[doc = "Direct mode is enabled"] | 17836 | #[doc = "The selected clock is disabled during csleep mode"] |
| 12833 | pub const ENABLED: Self = Self(0); | 17837 | pub const DISABLED: Self = Self(0); |
| 12834 | #[doc = "Direct mode is disabled"] | 17838 | #[doc = "The selected clock is enabled during csleep mode"] |
| 12835 | pub const DISABLED: Self = Self(0x01); | 17839 | pub const ENABLED: Self = Self(0x01); |
| 12836 | } | 17840 | } |
| 12837 | #[repr(transparent)] | 17841 | #[repr(transparent)] |
| 12838 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17842 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12839 | pub struct Dbm(pub u8); | 17843 | pub struct Apb1llpenrTim2lpen(pub u8); |
| 12840 | impl Dbm { | 17844 | impl Apb1llpenrTim2lpen { |
| 12841 | #[doc = "No buffer switching at the end of transfer"] | 17845 | #[doc = "The selected clock is disabled during csleep mode"] |
| 12842 | pub const DISABLED: Self = Self(0); | 17846 | pub const DISABLED: Self = Self(0); |
| 12843 | #[doc = "Memory target switched at the end of the DMA transfer"] | 17847 | #[doc = "The selected clock is enabled during csleep mode"] |
| 12844 | pub const ENABLED: Self = Self(0x01); | 17848 | pub const ENABLED: Self = Self(0x01); |
| 12845 | } | 17849 | } |
| 12846 | #[repr(transparent)] | 17850 | #[repr(transparent)] |
| 12847 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17851 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12848 | pub struct Ct(pub u8); | 17852 | pub struct RsrCpurstfr(pub u8); |
| 12849 | impl Ct { | 17853 | impl RsrCpurstfr { |
| 12850 | #[doc = "The current target memory is Memory 0"] | 17854 | #[doc = "No reset occoured for block"] |
| 12851 | pub const MEMORY0: Self = Self(0); | 17855 | pub const NORESETOCCOURED: Self = Self(0); |
| 12852 | #[doc = "The current target memory is Memory 1"] | 17856 | #[doc = "Reset occoured for block"] |
| 12853 | pub const MEMORY1: Self = Self(0x01); | 17857 | pub const RESETOCCOURRED: Self = Self(0x01); |
| 12854 | } | 17858 | } |
| 12855 | #[repr(transparent)] | 17859 | #[repr(transparent)] |
| 12856 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17860 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12857 | pub struct Dir(pub u8); | 17861 | pub struct Hrtimsel(pub u8); |
| 12858 | impl Dir { | 17862 | impl Hrtimsel { |
| 12859 | #[doc = "Peripheral-to-memory"] | 17863 | #[doc = "The HRTIM prescaler clock source is the same as other timers (rcc_timy_ker_ck)"] |
| 12860 | pub const PERIPHERALTOMEMORY: Self = Self(0); | 17864 | pub const TIMY_KER: Self = Self(0); |
| 12861 | #[doc = "Memory-to-peripheral"] | 17865 | #[doc = "The HRTIM prescaler clock source is the CPU clock (c_ck)"] |
| 12862 | pub const MEMORYTOPERIPHERAL: Self = Self(0x01); | 17866 | pub const C_CK: Self = Self(0x01); |
| 12863 | #[doc = "Memory-to-memory"] | ||
| 12864 | pub const MEMORYTOMEMORY: Self = Self(0x02); | ||
| 12865 | } | 17867 | } |
| 12866 | #[repr(transparent)] | 17868 | #[repr(transparent)] |
| 12867 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17869 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12868 | pub struct Inc(pub u8); | 17870 | pub struct Stopwuck(pub u8); |
| 12869 | impl Inc { | 17871 | impl Stopwuck { |
| 12870 | #[doc = "Address pointer is fixed"] | 17872 | #[doc = "HSI selected as wake up clock from system Stop"] |
| 12871 | pub const FIXED: Self = Self(0); | 17873 | pub const HSI: Self = Self(0); |
| 12872 | #[doc = "Address pointer is incremented after each data transfer"] | 17874 | #[doc = "CSI selected as wake up clock from system Stop"] |
| 12873 | pub const INCREMENTED: Self = Self(0x01); | 17875 | pub const CSI: Self = Self(0x01); |
| 12874 | } | 17876 | } |
| 12875 | #[repr(transparent)] | 17877 | #[repr(transparent)] |
| 12876 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17878 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12877 | pub struct Pincos(pub u8); | 17879 | pub struct C1Apb2lpenrTim1lpen(pub u8); |
| 12878 | impl Pincos { | 17880 | impl C1Apb2lpenrTim1lpen { |
| 12879 | #[doc = "The offset size for the peripheral address calculation is linked to the PSIZE"] | 17881 | #[doc = "The selected clock is disabled during csleep mode"] |
| 12880 | pub const PSIZE: Self = Self(0); | 17882 | pub const DISABLED: Self = Self(0); |
| 12881 | #[doc = "The offset size for the peripheral address calculation is fixed to 4 (32-bit alignment)"] | 17883 | #[doc = "The selected clock is enabled during csleep mode"] |
| 12882 | pub const FIXED4: Self = Self(0x01); | 17884 | pub const ENABLED: Self = Self(0x01); |
| 12883 | } | 17885 | } |
| 12884 | #[repr(transparent)] | 17886 | #[repr(transparent)] |
| 12885 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17887 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12886 | pub struct Pl(pub u8); | 17888 | pub struct Lsedrv(pub u8); |
| 12887 | impl Pl { | 17889 | impl Lsedrv { |
| 12888 | #[doc = "Low"] | 17890 | #[doc = "Lowest LSE oscillator driving capability"] |
| 12889 | pub const LOW: Self = Self(0); | 17891 | pub const LOWEST: Self = Self(0); |
| 12890 | #[doc = "Medium"] | 17892 | #[doc = "Medium low LSE oscillator driving capability"] |
| 12891 | pub const MEDIUM: Self = Self(0x01); | 17893 | pub const MEDIUMLOW: Self = Self(0x01); |
| 12892 | #[doc = "High"] | 17894 | #[doc = "Medium high LSE oscillator driving capability"] |
| 12893 | pub const HIGH: Self = Self(0x02); | 17895 | pub const MEDIUMHIGH: Self = Self(0x02); |
| 12894 | #[doc = "Very high"] | 17896 | #[doc = "Highest LSE oscillator driving capability"] |
| 12895 | pub const VERYHIGH: Self = Self(0x03); | 17897 | pub const HIGHEST: Self = Self(0x03); |
| 12896 | } | 17898 | } |
| 12897 | #[repr(transparent)] | 17899 | #[repr(transparent)] |
| 12898 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17900 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12899 | pub struct Fth(pub u8); | 17901 | pub struct Ahb2lpenrDcmilpen(pub u8); |
| 12900 | impl Fth { | 17902 | impl Ahb2lpenrDcmilpen { |
| 12901 | #[doc = "1/4 full FIFO"] | 17903 | #[doc = "The selected clock is disabled during csleep mode"] |
| 12902 | pub const QUARTER: Self = Self(0); | 17904 | pub const DISABLED: Self = Self(0); |
| 12903 | #[doc = "1/2 full FIFO"] | 17905 | #[doc = "The selected clock is enabled during csleep mode"] |
| 12904 | pub const HALF: Self = Self(0x01); | 17906 | pub const ENABLED: Self = Self(0x01); |
| 12905 | #[doc = "3/4 full FIFO"] | ||
| 12906 | pub const THREEQUARTERS: Self = Self(0x02); | ||
| 12907 | #[doc = "Full FIFO"] | ||
| 12908 | pub const FULL: Self = Self(0x03); | ||
| 12909 | } | 17907 | } |
| 12910 | #[repr(transparent)] | 17908 | #[repr(transparent)] |
| 12911 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17909 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12912 | pub struct Pfctrl(pub u8); | 17910 | pub struct Apb2lpenrTim1lpen(pub u8); |
| 12913 | impl Pfctrl { | 17911 | impl Apb2lpenrTim1lpen { |
| 12914 | #[doc = "The DMA is the flow controller"] | 17912 | #[doc = "The selected clock is disabled during csleep mode"] |
| 12915 | pub const DMA: Self = Self(0); | 17913 | pub const DISABLED: Self = Self(0); |
| 12916 | #[doc = "The peripheral is the flow controller"] | 17914 | #[doc = "The selected clock is enabled during csleep mode"] |
| 12917 | pub const PERIPHERAL: Self = Self(0x01); | 17915 | pub const ENABLED: Self = Self(0x01); |
| 12918 | } | 17916 | } |
| 12919 | #[repr(transparent)] | 17917 | #[repr(transparent)] |
| 12920 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17918 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12921 | pub struct Circ(pub u8); | 17919 | pub struct Apb2enrTim1en(pub u8); |
| 12922 | impl Circ { | 17920 | impl Apb2enrTim1en { |
| 12923 | #[doc = "Circular mode disabled"] | 17921 | #[doc = "The selected clock is disabled"] |
| 12924 | pub const DISABLED: Self = Self(0); | 17922 | pub const DISABLED: Self = Self(0); |
| 12925 | #[doc = "Circular mode enabled"] | 17923 | #[doc = "The selected clock is enabled"] |
| 12926 | pub const ENABLED: Self = Self(0x01); | 17924 | pub const ENABLED: Self = Self(0x01); |
| 12927 | } | 17925 | } |
| 12928 | #[repr(transparent)] | 17926 | #[repr(transparent)] |
| 12929 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17927 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12930 | pub struct Fs(pub u8); | 17928 | pub struct Syscfgrst(pub u8); |
| 12931 | impl Fs { | 17929 | impl Syscfgrst { |
| 12932 | #[doc = "0 < fifo_level < 1/4"] | 17930 | #[doc = "Reset the selected module"] |
| 12933 | pub const QUARTER1: Self = Self(0); | 17931 | pub const RESET: Self = Self(0x01); |
| 12934 | #[doc = "1/4 <= fifo_level < 1/2"] | ||
| 12935 | pub const QUARTER2: Self = Self(0x01); | ||
| 12936 | #[doc = "1/2 <= fifo_level < 3/4"] | ||
| 12937 | pub const QUARTER3: Self = Self(0x02); | ||
| 12938 | #[doc = "3/4 <= fifo_level < full"] | ||
| 12939 | pub const QUARTER4: Self = Self(0x03); | ||
| 12940 | #[doc = "FIFO is empty"] | ||
| 12941 | pub const EMPTY: Self = Self(0x04); | ||
| 12942 | #[doc = "FIFO is full"] | ||
| 12943 | pub const FULL: Self = Self(0x05); | ||
| 12944 | } | 17932 | } |
| 12945 | #[repr(transparent)] | 17933 | #[repr(transparent)] |
| 12946 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17934 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12947 | pub struct Size(pub u8); | 17935 | pub struct Lsecssdr(pub u8); |
| 12948 | impl Size { | 17936 | impl Lsecssdr { |
| 12949 | #[doc = "Byte (8-bit)"] | 17937 | #[doc = "No failure detected on 32 kHz oscillator"] |
| 12950 | pub const BITS8: Self = Self(0); | 17938 | pub const NOFAILURE: Self = Self(0); |
| 12951 | #[doc = "Half-word (16-bit)"] | 17939 | #[doc = "Failure detected on 32 kHz oscillator"] |
| 12952 | pub const BITS16: Self = Self(0x01); | 17940 | pub const FAILURE: Self = Self(0x01); |
| 12953 | #[doc = "Word (32-bit)"] | ||
| 12954 | pub const BITS32: Self = Self(0x02); | ||
| 12955 | } | 17941 | } |
| 12956 | #[repr(transparent)] | 17942 | #[repr(transparent)] |
| 12957 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 17943 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] |
| 12958 | pub struct Burst(pub u8); | 17944 | pub struct Hsidivfr(pub u8); |
| 12959 | impl Burst { | 17945 | impl Hsidivfr { |
| 12960 | #[doc = "Single transfer"] | 17946 | #[doc = "New HSIDIV ratio has not yet propagated to hsi_ck"] |
| 12961 | pub const SINGLE: Self = Self(0); | 17947 | pub const NOTPROPAGATED: Self = Self(0); |
| 12962 | #[doc = "Incremental burst of 4 beats"] | 17948 | #[doc = "HSIDIV ratio has propagated to hsi_ck"] |
| 12963 | pub const INCR4: Self = Self(0x01); | 17949 | pub const PROPAGATED: Self = Self(0x01); |
| 12964 | #[doc = "Incremental burst of 8 beats"] | ||
| 12965 | pub const INCR8: Self = Self(0x02); | ||
| 12966 | #[doc = "Incremental burst of 16 beats"] | ||
| 12967 | pub const INCR16: Self = Self(0x03); | ||
| 12968 | } | 17950 | } |
| 12969 | } | 17951 | } |
| 12970 | pub mod regs { | 17952 | pub mod regs { |
| 12971 | use crate::generic::*; | 17953 | use crate::generic::*; |
| 12972 | #[doc = "stream x FIFO control register"] | 17954 | #[doc = "RCC PLL1 Fractional Divider Register"] |
| 12973 | #[repr(transparent)] | 17955 | #[repr(transparent)] |
| 12974 | #[derive(Copy, Clone, Eq, PartialEq)] | 17956 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 12975 | pub struct Fcr(pub u32); | 17957 | pub struct Pll1fracr(pub u32); |
| 12976 | impl Fcr { | 17958 | impl Pll1fracr { |
| 12977 | #[doc = "FIFO threshold selection"] | 17959 | #[doc = "Fractional part of the multiplication factor for PLL1 VCO"] |
| 12978 | pub const fn fth(&self) -> super::vals::Fth { | 17960 | pub const fn fracn1(&self) -> u16 { |
| 12979 | let val = (self.0 >> 0usize) & 0x03; | 17961 | let val = (self.0 >> 3usize) & 0x1fff; |
| 12980 | super::vals::Fth(val as u8) | 17962 | val as u16 |
| 12981 | } | 17963 | } |
| 12982 | #[doc = "FIFO threshold selection"] | 17964 | #[doc = "Fractional part of the multiplication factor for PLL1 VCO"] |
| 12983 | pub fn set_fth(&mut self, val: super::vals::Fth) { | 17965 | pub fn set_fracn1(&mut self, val: u16) { |
| 12984 | self.0 = (self.0 & !(0x03 << 0usize)) | (((val.0 as u32) & 0x03) << 0usize); | 17966 | self.0 = (self.0 & !(0x1fff << 3usize)) | (((val as u32) & 0x1fff) << 3usize); |
| 12985 | } | 17967 | } |
| 12986 | #[doc = "Direct mode disable"] | 17968 | } |
| 12987 | pub const fn dmdis(&self) -> super::vals::Dmdis { | 17969 | impl Default for Pll1fracr { |
| 12988 | let val = (self.0 >> 2usize) & 0x01; | 17970 | fn default() -> Pll1fracr { |
| 12989 | super::vals::Dmdis(val as u8) | 17971 | Pll1fracr(0) |
| 12990 | } | ||
| 12991 | #[doc = "Direct mode disable"] | ||
| 12992 | pub fn set_dmdis(&mut self, val: super::vals::Dmdis) { | ||
| 12993 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 12994 | } | 17972 | } |
| 12995 | #[doc = "FIFO status"] | 17973 | } |
| 12996 | pub const fn fs(&self) -> super::vals::Fs { | 17974 | #[doc = "RCC HSI configuration register"] |
| 12997 | let val = (self.0 >> 3usize) & 0x07; | 17975 | #[repr(transparent)] |
| 12998 | super::vals::Fs(val as u8) | 17976 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 17977 | pub struct Hsicfgr(pub u32); | ||
| 17978 | impl Hsicfgr { | ||
| 17979 | #[doc = "HSI clock calibration"] | ||
| 17980 | pub const fn hsical(&self) -> u16 { | ||
| 17981 | let val = (self.0 >> 0usize) & 0x0fff; | ||
| 17982 | val as u16 | ||
| 12999 | } | 17983 | } |
| 13000 | #[doc = "FIFO status"] | 17984 | #[doc = "HSI clock calibration"] |
| 13001 | pub fn set_fs(&mut self, val: super::vals::Fs) { | 17985 | pub fn set_hsical(&mut self, val: u16) { |
| 13002 | self.0 = (self.0 & !(0x07 << 3usize)) | (((val.0 as u32) & 0x07) << 3usize); | 17986 | self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); |
| 13003 | } | 17987 | } |
| 13004 | #[doc = "FIFO error interrupt enable"] | 17988 | #[doc = "HSI clock trimming"] |
| 13005 | pub const fn feie(&self) -> bool { | 17989 | pub const fn hsitrim(&self) -> u8 { |
| 13006 | let val = (self.0 >> 7usize) & 0x01; | 17990 | let val = (self.0 >> 24usize) & 0x7f; |
| 13007 | val != 0 | 17991 | val as u8 |
| 13008 | } | 17992 | } |
| 13009 | #[doc = "FIFO error interrupt enable"] | 17993 | #[doc = "HSI clock trimming"] |
| 13010 | pub fn set_feie(&mut self, val: bool) { | 17994 | pub fn set_hsitrim(&mut self, val: u8) { |
| 13011 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 17995 | self.0 = (self.0 & !(0x7f << 24usize)) | (((val as u32) & 0x7f) << 24usize); |
| 13012 | } | 17996 | } |
| 13013 | } | 17997 | } |
| 13014 | impl Default for Fcr { | 17998 | impl Default for Hsicfgr { |
| 13015 | fn default() -> Fcr { | 17999 | fn default() -> Hsicfgr { |
| 13016 | Fcr(0) | 18000 | Hsicfgr(0) |
| 13017 | } | 18001 | } |
| 13018 | } | 18002 | } |
| 13019 | #[doc = "interrupt register"] | 18003 | #[doc = "RCC PLLs Configuration Register"] |
| 13020 | #[repr(transparent)] | 18004 | #[repr(transparent)] |
| 13021 | #[derive(Copy, Clone, Eq, PartialEq)] | 18005 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 13022 | pub struct Ixr(pub u32); | 18006 | pub struct Pllcfgr(pub u32); |
| 13023 | impl Ixr { | 18007 | impl Pllcfgr { |
| 13024 | #[doc = "Stream x FIFO error interrupt flag (x=3..0)"] | 18008 | #[doc = "PLL1 fractional latch enable"] |
| 13025 | pub fn feif(&self, n: usize) -> bool { | 18009 | pub fn pllfracen(&self, n: usize) -> super::vals::Pll1fracen { |
| 13026 | assert!(n < 4usize); | 18010 | assert!(n < 3usize); |
| 13027 | let offs = 0usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | 18011 | let offs = 0usize + n * 4usize; |
| 13028 | let val = (self.0 >> offs) & 0x01; | 18012 | let val = (self.0 >> offs) & 0x01; |
| 13029 | val != 0 | 18013 | super::vals::Pll1fracen(val as u8) |
| 13030 | } | 18014 | } |
| 13031 | #[doc = "Stream x FIFO error interrupt flag (x=3..0)"] | 18015 | #[doc = "PLL1 fractional latch enable"] |
| 13032 | pub fn set_feif(&mut self, n: usize, val: bool) { | 18016 | pub fn set_pllfracen(&mut self, n: usize, val: super::vals::Pll1fracen) { |
| 13033 | assert!(n < 4usize); | 18017 | assert!(n < 3usize); |
| 13034 | let offs = 0usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | 18018 | let offs = 0usize + n * 4usize; |
| 13035 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | 18019 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); |
| 13036 | } | 18020 | } |
| 13037 | #[doc = "Stream x direct mode error interrupt flag (x=3..0)"] | 18021 | #[doc = "PLL1 VCO selection"] |
| 13038 | pub fn dmeif(&self, n: usize) -> bool { | 18022 | pub fn pllvcosel(&self, n: usize) -> super::vals::Pll1vcosel { |
| 13039 | assert!(n < 4usize); | 18023 | assert!(n < 3usize); |
| 13040 | let offs = 2usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | 18024 | let offs = 1usize + n * 4usize; |
| 13041 | let val = (self.0 >> offs) & 0x01; | 18025 | let val = (self.0 >> offs) & 0x01; |
| 13042 | val != 0 | 18026 | super::vals::Pll1vcosel(val as u8) |
| 13043 | } | 18027 | } |
| 13044 | #[doc = "Stream x direct mode error interrupt flag (x=3..0)"] | 18028 | #[doc = "PLL1 VCO selection"] |
| 13045 | pub fn set_dmeif(&mut self, n: usize, val: bool) { | 18029 | pub fn set_pllvcosel(&mut self, n: usize, val: super::vals::Pll1vcosel) { |
| 13046 | assert!(n < 4usize); | 18030 | assert!(n < 3usize); |
| 13047 | let offs = 2usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | 18031 | let offs = 1usize + n * 4usize; |
| 13048 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | 18032 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); |
| 13049 | } | 18033 | } |
| 13050 | #[doc = "Stream x transfer error interrupt flag (x=3..0)"] | 18034 | #[doc = "PLL1 input frequency range"] |
| 13051 | pub fn teif(&self, n: usize) -> bool { | 18035 | pub fn pllrge(&self, n: usize) -> super::vals::Pll1rge { |
| 13052 | assert!(n < 4usize); | 18036 | assert!(n < 3usize); |
| 13053 | let offs = 3usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | 18037 | let offs = 2usize + n * 4usize; |
| 18038 | let val = (self.0 >> offs) & 0x03; | ||
| 18039 | super::vals::Pll1rge(val as u8) | ||
| 18040 | } | ||
| 18041 | #[doc = "PLL1 input frequency range"] | ||
| 18042 | pub fn set_pllrge(&mut self, n: usize, val: super::vals::Pll1rge) { | ||
| 18043 | assert!(n < 3usize); | ||
| 18044 | let offs = 2usize + n * 4usize; | ||
| 18045 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | ||
| 18046 | } | ||
| 18047 | #[doc = "PLL1 DIVP divider output enable"] | ||
| 18048 | pub fn divpen(&self, n: usize) -> super::vals::Divp1en { | ||
| 18049 | assert!(n < 3usize); | ||
| 18050 | let offs = 16usize + n * 3usize; | ||
| 13054 | let val = (self.0 >> offs) & 0x01; | 18051 | let val = (self.0 >> offs) & 0x01; |
| 13055 | val != 0 | 18052 | super::vals::Divp1en(val as u8) |
| 13056 | } | 18053 | } |
| 13057 | #[doc = "Stream x transfer error interrupt flag (x=3..0)"] | 18054 | #[doc = "PLL1 DIVP divider output enable"] |
| 13058 | pub fn set_teif(&mut self, n: usize, val: bool) { | 18055 | pub fn set_divpen(&mut self, n: usize, val: super::vals::Divp1en) { |
| 13059 | assert!(n < 4usize); | 18056 | assert!(n < 3usize); |
| 13060 | let offs = 3usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | 18057 | let offs = 16usize + n * 3usize; |
| 13061 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | 18058 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); |
| 13062 | } | 18059 | } |
| 13063 | #[doc = "Stream x half transfer interrupt flag (x=3..0)"] | 18060 | #[doc = "PLL1 DIVQ divider output enable"] |
| 13064 | pub fn htif(&self, n: usize) -> bool { | 18061 | pub fn divqen(&self, n: usize) -> super::vals::Divp1en { |
| 13065 | assert!(n < 4usize); | 18062 | assert!(n < 3usize); |
| 13066 | let offs = 4usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | 18063 | let offs = 17usize + n * 3usize; |
| 13067 | let val = (self.0 >> offs) & 0x01; | 18064 | let val = (self.0 >> offs) & 0x01; |
| 13068 | val != 0 | 18065 | super::vals::Divp1en(val as u8) |
| 13069 | } | 18066 | } |
| 13070 | #[doc = "Stream x half transfer interrupt flag (x=3..0)"] | 18067 | #[doc = "PLL1 DIVQ divider output enable"] |
| 13071 | pub fn set_htif(&mut self, n: usize, val: bool) { | 18068 | pub fn set_divqen(&mut self, n: usize, val: super::vals::Divp1en) { |
| 13072 | assert!(n < 4usize); | 18069 | assert!(n < 3usize); |
| 13073 | let offs = 4usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | 18070 | let offs = 17usize + n * 3usize; |
| 13074 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | 18071 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); |
| 13075 | } | 18072 | } |
| 13076 | #[doc = "Stream x transfer complete interrupt flag (x = 3..0)"] | 18073 | #[doc = "PLL1 DIVR divider output enable"] |
| 13077 | pub fn tcif(&self, n: usize) -> bool { | 18074 | pub fn divren(&self, n: usize) -> super::vals::Divp1en { |
| 13078 | assert!(n < 4usize); | 18075 | assert!(n < 3usize); |
| 13079 | let offs = 5usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | 18076 | let offs = 18usize + n * 3usize; |
| 13080 | let val = (self.0 >> offs) & 0x01; | 18077 | let val = (self.0 >> offs) & 0x01; |
| 13081 | val != 0 | 18078 | super::vals::Divp1en(val as u8) |
| 13082 | } | 18079 | } |
| 13083 | #[doc = "Stream x transfer complete interrupt flag (x = 3..0)"] | 18080 | #[doc = "PLL1 DIVR divider output enable"] |
| 13084 | pub fn set_tcif(&mut self, n: usize, val: bool) { | 18081 | pub fn set_divren(&mut self, n: usize, val: super::vals::Divp1en) { |
| 13085 | assert!(n < 4usize); | 18082 | assert!(n < 3usize); |
| 13086 | let offs = 5usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); | 18083 | let offs = 18usize + n * 3usize; |
| 13087 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | 18084 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); |
| 13088 | } | 18085 | } |
| 13089 | } | 18086 | } |
| 13090 | impl Default for Ixr { | 18087 | impl Default for Pllcfgr { |
| 13091 | fn default() -> Ixr { | 18088 | fn default() -> Pllcfgr { |
| 13092 | Ixr(0) | 18089 | Pllcfgr(0) |
| 13093 | } | 18090 | } |
| 13094 | } | 18091 | } |
| 13095 | #[doc = "stream x configuration register"] | 18092 | #[doc = "RCC APB1 Clock Register"] |
| 13096 | #[repr(transparent)] | 18093 | #[repr(transparent)] |
| 13097 | #[derive(Copy, Clone, Eq, PartialEq)] | 18094 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 13098 | pub struct Cr(pub u32); | 18095 | pub struct Apb1lenr(pub u32); |
| 13099 | impl Cr { | 18096 | impl Apb1lenr { |
| 13100 | #[doc = "Stream enable / flag stream ready when read low"] | 18097 | #[doc = "TIM peripheral clock enable"] |
| 13101 | pub const fn en(&self) -> bool { | 18098 | pub const fn tim2en(&self) -> super::vals::Apb1lenrTim2en { |
| 13102 | let val = (self.0 >> 0usize) & 0x01; | 18099 | let val = (self.0 >> 0usize) & 0x01; |
| 13103 | val != 0 | 18100 | super::vals::Apb1lenrTim2en(val as u8) |
| 13104 | } | 18101 | } |
| 13105 | #[doc = "Stream enable / flag stream ready when read low"] | 18102 | #[doc = "TIM peripheral clock enable"] |
| 13106 | pub fn set_en(&mut self, val: bool) { | 18103 | pub fn set_tim2en(&mut self, val: super::vals::Apb1lenrTim2en) { |
| 13107 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 18104 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 13108 | } | 18105 | } |
| 13109 | #[doc = "Direct mode error interrupt enable"] | 18106 | #[doc = "TIM peripheral clock enable"] |
| 13110 | pub const fn dmeie(&self) -> bool { | 18107 | pub const fn tim3en(&self) -> super::vals::Apb1lenrTim2en { |
| 13111 | let val = (self.0 >> 1usize) & 0x01; | 18108 | let val = (self.0 >> 1usize) & 0x01; |
| 13112 | val != 0 | 18109 | super::vals::Apb1lenrTim2en(val as u8) |
| 13113 | } | 18110 | } |
| 13114 | #[doc = "Direct mode error interrupt enable"] | 18111 | #[doc = "TIM peripheral clock enable"] |
| 13115 | pub fn set_dmeie(&mut self, val: bool) { | 18112 | pub fn set_tim3en(&mut self, val: super::vals::Apb1lenrTim2en) { |
| 13116 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 18113 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); |
| 13117 | } | 18114 | } |
| 13118 | #[doc = "Transfer error interrupt enable"] | 18115 | #[doc = "TIM peripheral clock enable"] |
| 13119 | pub const fn teie(&self) -> bool { | 18116 | pub const fn tim4en(&self) -> super::vals::Apb1lenrTim2en { |
| 13120 | let val = (self.0 >> 2usize) & 0x01; | 18117 | let val = (self.0 >> 2usize) & 0x01; |
| 13121 | val != 0 | 18118 | super::vals::Apb1lenrTim2en(val as u8) |
| 13122 | } | 18119 | } |
| 13123 | #[doc = "Transfer error interrupt enable"] | 18120 | #[doc = "TIM peripheral clock enable"] |
| 13124 | pub fn set_teie(&mut self, val: bool) { | 18121 | pub fn set_tim4en(&mut self, val: super::vals::Apb1lenrTim2en) { |
| 13125 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 18122 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); |
| 13126 | } | 18123 | } |
| 13127 | #[doc = "Half transfer interrupt enable"] | 18124 | #[doc = "TIM peripheral clock enable"] |
| 13128 | pub const fn htie(&self) -> bool { | 18125 | pub const fn tim5en(&self) -> super::vals::Apb1lenrTim2en { |
| 13129 | let val = (self.0 >> 3usize) & 0x01; | 18126 | let val = (self.0 >> 3usize) & 0x01; |
| 13130 | val != 0 | 18127 | super::vals::Apb1lenrTim2en(val as u8) |
| 13131 | } | 18128 | } |
| 13132 | #[doc = "Half transfer interrupt enable"] | 18129 | #[doc = "TIM peripheral clock enable"] |
| 13133 | pub fn set_htie(&mut self, val: bool) { | 18130 | pub fn set_tim5en(&mut self, val: super::vals::Apb1lenrTim2en) { |
| 13134 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 18131 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); |
| 13135 | } | 18132 | } |
| 13136 | #[doc = "Transfer complete interrupt enable"] | 18133 | #[doc = "TIM peripheral clock enable"] |
| 13137 | pub const fn tcie(&self) -> bool { | 18134 | pub const fn tim6en(&self) -> super::vals::Apb1lenrTim2en { |
| 13138 | let val = (self.0 >> 4usize) & 0x01; | 18135 | let val = (self.0 >> 4usize) & 0x01; |
| 13139 | val != 0 | 18136 | super::vals::Apb1lenrTim2en(val as u8) |
| 13140 | } | 18137 | } |
| 13141 | #[doc = "Transfer complete interrupt enable"] | 18138 | #[doc = "TIM peripheral clock enable"] |
| 13142 | pub fn set_tcie(&mut self, val: bool) { | 18139 | pub fn set_tim6en(&mut self, val: super::vals::Apb1lenrTim2en) { |
| 13143 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 18140 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); |
| 13144 | } | 18141 | } |
| 13145 | #[doc = "Peripheral flow controller"] | 18142 | #[doc = "TIM peripheral clock enable"] |
| 13146 | pub const fn pfctrl(&self) -> super::vals::Pfctrl { | 18143 | pub const fn tim7en(&self) -> super::vals::Apb1lenrTim2en { |
| 13147 | let val = (self.0 >> 5usize) & 0x01; | 18144 | let val = (self.0 >> 5usize) & 0x01; |
| 13148 | super::vals::Pfctrl(val as u8) | 18145 | super::vals::Apb1lenrTim2en(val as u8) |
| 13149 | } | 18146 | } |
| 13150 | #[doc = "Peripheral flow controller"] | 18147 | #[doc = "TIM peripheral clock enable"] |
| 13151 | pub fn set_pfctrl(&mut self, val: super::vals::Pfctrl) { | 18148 | pub fn set_tim7en(&mut self, val: super::vals::Apb1lenrTim2en) { |
| 13152 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | 18149 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); |
| 13153 | } | 18150 | } |
| 13154 | #[doc = "Data transfer direction"] | 18151 | #[doc = "TIM peripheral clock enable"] |
| 13155 | pub const fn dir(&self) -> super::vals::Dir { | 18152 | pub const fn tim12en(&self) -> super::vals::Apb1lenrTim2en { |
| 13156 | let val = (self.0 >> 6usize) & 0x03; | 18153 | let val = (self.0 >> 6usize) & 0x01; |
| 13157 | super::vals::Dir(val as u8) | 18154 | super::vals::Apb1lenrTim2en(val as u8) |
| 13158 | } | 18155 | } |
| 13159 | #[doc = "Data transfer direction"] | 18156 | #[doc = "TIM peripheral clock enable"] |
| 13160 | pub fn set_dir(&mut self, val: super::vals::Dir) { | 18157 | pub fn set_tim12en(&mut self, val: super::vals::Apb1lenrTim2en) { |
| 13161 | self.0 = (self.0 & !(0x03 << 6usize)) | (((val.0 as u32) & 0x03) << 6usize); | 18158 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); |
| 13162 | } | 18159 | } |
| 13163 | #[doc = "Circular mode"] | 18160 | #[doc = "TIM peripheral clock enable"] |
| 13164 | pub const fn circ(&self) -> super::vals::Circ { | 18161 | pub const fn tim13en(&self) -> super::vals::Apb1lenrTim2en { |
| 18162 | let val = (self.0 >> 7usize) & 0x01; | ||
| 18163 | super::vals::Apb1lenrTim2en(val as u8) | ||
| 18164 | } | ||
| 18165 | #[doc = "TIM peripheral clock enable"] | ||
| 18166 | pub fn set_tim13en(&mut self, val: super::vals::Apb1lenrTim2en) { | ||
| 18167 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 18168 | } | ||
| 18169 | #[doc = "TIM peripheral clock enable"] | ||
| 18170 | pub const fn tim14en(&self) -> super::vals::Apb1lenrTim2en { | ||
| 13165 | let val = (self.0 >> 8usize) & 0x01; | 18171 | let val = (self.0 >> 8usize) & 0x01; |
| 13166 | super::vals::Circ(val as u8) | 18172 | super::vals::Apb1lenrTim2en(val as u8) |
| 13167 | } | 18173 | } |
| 13168 | #[doc = "Circular mode"] | 18174 | #[doc = "TIM peripheral clock enable"] |
| 13169 | pub fn set_circ(&mut self, val: super::vals::Circ) { | 18175 | pub fn set_tim14en(&mut self, val: super::vals::Apb1lenrTim2en) { |
| 13170 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); | 18176 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); |
| 13171 | } | 18177 | } |
| 13172 | #[doc = "Peripheral increment mode"] | 18178 | #[doc = "LPTIM1 Peripheral Clocks Enable"] |
| 13173 | pub const fn pinc(&self) -> super::vals::Inc { | 18179 | pub const fn lptim1en(&self) -> super::vals::Apb1lenrTim2en { |
| 13174 | let val = (self.0 >> 9usize) & 0x01; | 18180 | let val = (self.0 >> 9usize) & 0x01; |
| 13175 | super::vals::Inc(val as u8) | 18181 | super::vals::Apb1lenrTim2en(val as u8) |
| 13176 | } | 18182 | } |
| 13177 | #[doc = "Peripheral increment mode"] | 18183 | #[doc = "LPTIM1 Peripheral Clocks Enable"] |
| 13178 | pub fn set_pinc(&mut self, val: super::vals::Inc) { | 18184 | pub fn set_lptim1en(&mut self, val: super::vals::Apb1lenrTim2en) { |
| 13179 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | 18185 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); |
| 13180 | } | 18186 | } |
| 13181 | #[doc = "Memory increment mode"] | 18187 | #[doc = "SPI2 Peripheral Clocks Enable"] |
| 13182 | pub const fn minc(&self) -> super::vals::Inc { | 18188 | pub const fn spi2en(&self) -> super::vals::Apb1lenrTim2en { |
| 13183 | let val = (self.0 >> 10usize) & 0x01; | 18189 | let val = (self.0 >> 14usize) & 0x01; |
| 13184 | super::vals::Inc(val as u8) | 18190 | super::vals::Apb1lenrTim2en(val as u8) |
| 13185 | } | ||
| 13186 | #[doc = "Memory increment mode"] | ||
| 13187 | pub fn set_minc(&mut self, val: super::vals::Inc) { | ||
| 13188 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); | ||
| 13189 | } | ||
| 13190 | #[doc = "Peripheral data size"] | ||
| 13191 | pub const fn psize(&self) -> super::vals::Size { | ||
| 13192 | let val = (self.0 >> 11usize) & 0x03; | ||
| 13193 | super::vals::Size(val as u8) | ||
| 13194 | } | ||
| 13195 | #[doc = "Peripheral data size"] | ||
| 13196 | pub fn set_psize(&mut self, val: super::vals::Size) { | ||
| 13197 | self.0 = (self.0 & !(0x03 << 11usize)) | (((val.0 as u32) & 0x03) << 11usize); | ||
| 13198 | } | ||
| 13199 | #[doc = "Memory data size"] | ||
| 13200 | pub const fn msize(&self) -> super::vals::Size { | ||
| 13201 | let val = (self.0 >> 13usize) & 0x03; | ||
| 13202 | super::vals::Size(val as u8) | ||
| 13203 | } | 18191 | } |
| 13204 | #[doc = "Memory data size"] | 18192 | #[doc = "SPI2 Peripheral Clocks Enable"] |
| 13205 | pub fn set_msize(&mut self, val: super::vals::Size) { | 18193 | pub fn set_spi2en(&mut self, val: super::vals::Apb1lenrTim2en) { |
| 13206 | self.0 = (self.0 & !(0x03 << 13usize)) | (((val.0 as u32) & 0x03) << 13usize); | 18194 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); |
| 13207 | } | 18195 | } |
| 13208 | #[doc = "Peripheral increment offset size"] | 18196 | #[doc = "SPI3 Peripheral Clocks Enable"] |
| 13209 | pub const fn pincos(&self) -> super::vals::Pincos { | 18197 | pub const fn spi3en(&self) -> super::vals::Apb1lenrTim2en { |
| 13210 | let val = (self.0 >> 15usize) & 0x01; | 18198 | let val = (self.0 >> 15usize) & 0x01; |
| 13211 | super::vals::Pincos(val as u8) | 18199 | super::vals::Apb1lenrTim2en(val as u8) |
| 13212 | } | 18200 | } |
| 13213 | #[doc = "Peripheral increment offset size"] | 18201 | #[doc = "SPI3 Peripheral Clocks Enable"] |
| 13214 | pub fn set_pincos(&mut self, val: super::vals::Pincos) { | 18202 | pub fn set_spi3en(&mut self, val: super::vals::Apb1lenrTim2en) { |
| 13215 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | 18203 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); |
| 13216 | } | 18204 | } |
| 13217 | #[doc = "Priority level"] | 18205 | #[doc = "SPDIFRX Peripheral Clocks Enable"] |
| 13218 | pub const fn pl(&self) -> super::vals::Pl { | 18206 | pub const fn spdifrxen(&self) -> super::vals::Apb1lenrTim2en { |
| 13219 | let val = (self.0 >> 16usize) & 0x03; | 18207 | let val = (self.0 >> 16usize) & 0x01; |
| 13220 | super::vals::Pl(val as u8) | 18208 | super::vals::Apb1lenrTim2en(val as u8) |
| 13221 | } | 18209 | } |
| 13222 | #[doc = "Priority level"] | 18210 | #[doc = "SPDIFRX Peripheral Clocks Enable"] |
| 13223 | pub fn set_pl(&mut self, val: super::vals::Pl) { | 18211 | pub fn set_spdifrxen(&mut self, val: super::vals::Apb1lenrTim2en) { |
| 13224 | self.0 = (self.0 & !(0x03 << 16usize)) | (((val.0 as u32) & 0x03) << 16usize); | 18212 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); |
| 13225 | } | 18213 | } |
| 13226 | #[doc = "Double buffer mode"] | 18214 | #[doc = "USART2 Peripheral Clocks Enable"] |
| 13227 | pub const fn dbm(&self) -> super::vals::Dbm { | 18215 | pub const fn usart2en(&self) -> super::vals::Apb1lenrTim2en { |
| 18216 | let val = (self.0 >> 17usize) & 0x01; | ||
| 18217 | super::vals::Apb1lenrTim2en(val as u8) | ||
| 18218 | } | ||
| 18219 | #[doc = "USART2 Peripheral Clocks Enable"] | ||
| 18220 | pub fn set_usart2en(&mut self, val: super::vals::Apb1lenrTim2en) { | ||
| 18221 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize); | ||
| 18222 | } | ||
| 18223 | #[doc = "USART3 Peripheral Clocks Enable"] | ||
| 18224 | pub const fn usart3en(&self) -> super::vals::Apb1lenrTim2en { | ||
| 13228 | let val = (self.0 >> 18usize) & 0x01; | 18225 | let val = (self.0 >> 18usize) & 0x01; |
| 13229 | super::vals::Dbm(val as u8) | 18226 | super::vals::Apb1lenrTim2en(val as u8) |
| 13230 | } | 18227 | } |
| 13231 | #[doc = "Double buffer mode"] | 18228 | #[doc = "USART3 Peripheral Clocks Enable"] |
| 13232 | pub fn set_dbm(&mut self, val: super::vals::Dbm) { | 18229 | pub fn set_usart3en(&mut self, val: super::vals::Apb1lenrTim2en) { |
| 13233 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize); | 18230 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize); |
| 13234 | } | 18231 | } |
| 13235 | #[doc = "Current target (only in double buffer mode)"] | 18232 | #[doc = "UART4 Peripheral Clocks Enable"] |
| 13236 | pub const fn ct(&self) -> super::vals::Ct { | 18233 | pub const fn uart4en(&self) -> super::vals::Apb1lenrTim2en { |
| 13237 | let val = (self.0 >> 19usize) & 0x01; | 18234 | let val = (self.0 >> 19usize) & 0x01; |
| 13238 | super::vals::Ct(val as u8) | 18235 | super::vals::Apb1lenrTim2en(val as u8) |
| 13239 | } | 18236 | } |
| 13240 | #[doc = "Current target (only in double buffer mode)"] | 18237 | #[doc = "UART4 Peripheral Clocks Enable"] |
| 13241 | pub fn set_ct(&mut self, val: super::vals::Ct) { | 18238 | pub fn set_uart4en(&mut self, val: super::vals::Apb1lenrTim2en) { |
| 13242 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); | 18239 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); |
| 13243 | } | 18240 | } |
| 13244 | #[doc = "Peripheral burst transfer configuration"] | 18241 | #[doc = "UART5 Peripheral Clocks Enable"] |
| 13245 | pub const fn pburst(&self) -> super::vals::Burst { | 18242 | pub const fn uart5en(&self) -> super::vals::Apb1lenrTim2en { |
| 13246 | let val = (self.0 >> 21usize) & 0x03; | 18243 | let val = (self.0 >> 20usize) & 0x01; |
| 13247 | super::vals::Burst(val as u8) | 18244 | super::vals::Apb1lenrTim2en(val as u8) |
| 13248 | } | 18245 | } |
| 13249 | #[doc = "Peripheral burst transfer configuration"] | 18246 | #[doc = "UART5 Peripheral Clocks Enable"] |
| 13250 | pub fn set_pburst(&mut self, val: super::vals::Burst) { | 18247 | pub fn set_uart5en(&mut self, val: super::vals::Apb1lenrTim2en) { |
| 13251 | self.0 = (self.0 & !(0x03 << 21usize)) | (((val.0 as u32) & 0x03) << 21usize); | 18248 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize); |
| 13252 | } | 18249 | } |
| 13253 | #[doc = "Memory burst transfer configuration"] | 18250 | #[doc = "I2C1 Peripheral Clocks Enable"] |
| 13254 | pub const fn mburst(&self) -> super::vals::Burst { | 18251 | pub const fn i2c1en(&self) -> super::vals::Apb1lenrTim2en { |
| 13255 | let val = (self.0 >> 23usize) & 0x03; | 18252 | let val = (self.0 >> 21usize) & 0x01; |
| 13256 | super::vals::Burst(val as u8) | 18253 | super::vals::Apb1lenrTim2en(val as u8) |
| 13257 | } | 18254 | } |
| 13258 | #[doc = "Memory burst transfer configuration"] | 18255 | #[doc = "I2C1 Peripheral Clocks Enable"] |
| 13259 | pub fn set_mburst(&mut self, val: super::vals::Burst) { | 18256 | pub fn set_i2c1en(&mut self, val: super::vals::Apb1lenrTim2en) { |
| 13260 | self.0 = (self.0 & !(0x03 << 23usize)) | (((val.0 as u32) & 0x03) << 23usize); | 18257 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize); |
| 13261 | } | 18258 | } |
| 13262 | #[doc = "Channel selection"] | 18259 | #[doc = "I2C2 Peripheral Clocks Enable"] |
| 13263 | pub const fn chsel(&self) -> u8 { | 18260 | pub const fn i2c2en(&self) -> super::vals::Apb1lenrTim2en { |
| 13264 | let val = (self.0 >> 25usize) & 0x0f; | 18261 | let val = (self.0 >> 22usize) & 0x01; |
| 13265 | val as u8 | 18262 | super::vals::Apb1lenrTim2en(val as u8) |
| 13266 | } | 18263 | } |
| 13267 | #[doc = "Channel selection"] | 18264 | #[doc = "I2C2 Peripheral Clocks Enable"] |
| 13268 | pub fn set_chsel(&mut self, val: u8) { | 18265 | pub fn set_i2c2en(&mut self, val: super::vals::Apb1lenrTim2en) { |
| 13269 | self.0 = (self.0 & !(0x0f << 25usize)) | (((val as u32) & 0x0f) << 25usize); | 18266 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize); |
| 18267 | } | ||
| 18268 | #[doc = "I2C3 Peripheral Clocks Enable"] | ||
| 18269 | pub const fn i2c3en(&self) -> super::vals::Apb1lenrTim2en { | ||
| 18270 | let val = (self.0 >> 23usize) & 0x01; | ||
| 18271 | super::vals::Apb1lenrTim2en(val as u8) | ||
| 18272 | } | ||
| 18273 | #[doc = "I2C3 Peripheral Clocks Enable"] | ||
| 18274 | pub fn set_i2c3en(&mut self, val: super::vals::Apb1lenrTim2en) { | ||
| 18275 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize); | ||
| 18276 | } | ||
| 18277 | #[doc = "HDMI-CEC peripheral clock enable"] | ||
| 18278 | pub const fn cecen(&self) -> super::vals::Apb1lenrTim2en { | ||
| 18279 | let val = (self.0 >> 27usize) & 0x01; | ||
| 18280 | super::vals::Apb1lenrTim2en(val as u8) | ||
| 18281 | } | ||
| 18282 | #[doc = "HDMI-CEC peripheral clock enable"] | ||
| 18283 | pub fn set_cecen(&mut self, val: super::vals::Apb1lenrTim2en) { | ||
| 18284 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize); | ||
| 18285 | } | ||
| 18286 | #[doc = "DAC1&2 peripheral clock enable"] | ||
| 18287 | pub const fn dac12en(&self) -> super::vals::Apb1lenrTim2en { | ||
| 18288 | let val = (self.0 >> 29usize) & 0x01; | ||
| 18289 | super::vals::Apb1lenrTim2en(val as u8) | ||
| 18290 | } | ||
| 18291 | #[doc = "DAC1&2 peripheral clock enable"] | ||
| 18292 | pub fn set_dac12en(&mut self, val: super::vals::Apb1lenrTim2en) { | ||
| 18293 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); | ||
| 18294 | } | ||
| 18295 | #[doc = "UART7 Peripheral Clocks Enable"] | ||
| 18296 | pub const fn uart7en(&self) -> super::vals::Apb1lenrTim2en { | ||
| 18297 | let val = (self.0 >> 30usize) & 0x01; | ||
| 18298 | super::vals::Apb1lenrTim2en(val as u8) | ||
| 18299 | } | ||
| 18300 | #[doc = "UART7 Peripheral Clocks Enable"] | ||
| 18301 | pub fn set_uart7en(&mut self, val: super::vals::Apb1lenrTim2en) { | ||
| 18302 | self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize); | ||
| 18303 | } | ||
| 18304 | #[doc = "UART8 Peripheral Clocks Enable"] | ||
| 18305 | pub const fn uart8en(&self) -> super::vals::Apb1lenrTim2en { | ||
| 18306 | let val = (self.0 >> 31usize) & 0x01; | ||
| 18307 | super::vals::Apb1lenrTim2en(val as u8) | ||
| 18308 | } | ||
| 18309 | #[doc = "UART8 Peripheral Clocks Enable"] | ||
| 18310 | pub fn set_uart8en(&mut self, val: super::vals::Apb1lenrTim2en) { | ||
| 18311 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize); | ||
| 13270 | } | 18312 | } |
| 13271 | } | 18313 | } |
| 13272 | impl Default for Cr { | 18314 | impl Default for Apb1lenr { |
| 13273 | fn default() -> Cr { | 18315 | fn default() -> Apb1lenr { |
| 13274 | Cr(0) | 18316 | Apb1lenr(0) |
| 13275 | } | 18317 | } |
| 13276 | } | 18318 | } |
| 13277 | #[doc = "stream x number of data register"] | 18319 | #[doc = "RCC AHB2 Peripheral Reset Register"] |
| 13278 | #[repr(transparent)] | 18320 | #[repr(transparent)] |
| 13279 | #[derive(Copy, Clone, Eq, PartialEq)] | 18321 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 13280 | pub struct Ndtr(pub u32); | 18322 | pub struct Ahb2rstr(pub u32); |
| 13281 | impl Ndtr { | 18323 | impl Ahb2rstr { |
| 13282 | #[doc = "Number of data items to transfer"] | 18324 | #[doc = "CAMITF block reset"] |
| 13283 | pub const fn ndt(&self) -> u16 { | 18325 | pub const fn camitfrst(&self) -> super::vals::Camitfrst { |
| 13284 | let val = (self.0 >> 0usize) & 0xffff; | 18326 | let val = (self.0 >> 0usize) & 0x01; |
| 13285 | val as u16 | 18327 | super::vals::Camitfrst(val as u8) |
| 13286 | } | 18328 | } |
| 13287 | #[doc = "Number of data items to transfer"] | 18329 | #[doc = "CAMITF block reset"] |
| 13288 | pub fn set_ndt(&mut self, val: u16) { | 18330 | pub fn set_camitfrst(&mut self, val: super::vals::Camitfrst) { |
| 13289 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | 18331 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 13290 | } | 18332 | } |
| 13291 | } | 18333 | #[doc = "Cryptography block reset"] |
| 13292 | impl Default for Ndtr { | 18334 | pub const fn cryptrst(&self) -> super::vals::Camitfrst { |
| 13293 | fn default() -> Ndtr { | 18335 | let val = (self.0 >> 4usize) & 0x01; |
| 13294 | Ndtr(0) | 18336 | super::vals::Camitfrst(val as u8) |
| 18337 | } | ||
| 18338 | #[doc = "Cryptography block reset"] | ||
| 18339 | pub fn set_cryptrst(&mut self, val: super::vals::Camitfrst) { | ||
| 18340 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 18341 | } | ||
| 18342 | #[doc = "Hash block reset"] | ||
| 18343 | pub const fn hashrst(&self) -> super::vals::Camitfrst { | ||
| 18344 | let val = (self.0 >> 5usize) & 0x01; | ||
| 18345 | super::vals::Camitfrst(val as u8) | ||
| 18346 | } | ||
| 18347 | #[doc = "Hash block reset"] | ||
| 18348 | pub fn set_hashrst(&mut self, val: super::vals::Camitfrst) { | ||
| 18349 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 18350 | } | ||
| 18351 | #[doc = "Random Number Generator block reset"] | ||
| 18352 | pub const fn rngrst(&self) -> super::vals::Camitfrst { | ||
| 18353 | let val = (self.0 >> 6usize) & 0x01; | ||
| 18354 | super::vals::Camitfrst(val as u8) | ||
| 18355 | } | ||
| 18356 | #[doc = "Random Number Generator block reset"] | ||
| 18357 | pub fn set_rngrst(&mut self, val: super::vals::Camitfrst) { | ||
| 18358 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); | ||
| 18359 | } | ||
| 18360 | #[doc = "SDMMC2 and SDMMC2 Delay block reset"] | ||
| 18361 | pub const fn sdmmc2rst(&self) -> super::vals::Camitfrst { | ||
| 18362 | let val = (self.0 >> 9usize) & 0x01; | ||
| 18363 | super::vals::Camitfrst(val as u8) | ||
| 18364 | } | ||
| 18365 | #[doc = "SDMMC2 and SDMMC2 Delay block reset"] | ||
| 18366 | pub fn set_sdmmc2rst(&mut self, val: super::vals::Camitfrst) { | ||
| 18367 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | ||
| 13295 | } | 18368 | } |
| 13296 | } | 18369 | } |
| 13297 | } | 18370 | impl Default for Ahb2rstr { |
| 13298 | } | 18371 | fn default() -> Ahb2rstr { |
| 13299 | pub mod sdmmc_v2 { | 18372 | Ahb2rstr(0) |
| 13300 | use crate::generic::*; | 18373 | } |
| 13301 | #[doc = "SDMMC"] | ||
| 13302 | #[derive(Copy, Clone)] | ||
| 13303 | pub struct Sdmmc(pub *mut u8); | ||
| 13304 | unsafe impl Send for Sdmmc {} | ||
| 13305 | unsafe impl Sync for Sdmmc {} | ||
| 13306 | impl Sdmmc { | ||
| 13307 | #[doc = "SDMMC power control register"] | ||
| 13308 | pub fn power(self) -> Reg<regs::Power, RW> { | ||
| 13309 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 13310 | } | 18374 | } |
| 13311 | #[doc = "The SDMMC_CLKCR register controls the SDMMC_CK output clock, the SDMMC_RX_CLK receive clock, and the bus width."] | 18375 | #[doc = "RCC AHB2 Sleep Clock Register"] |
| 13312 | pub fn clkcr(self) -> Reg<regs::Clkcr, RW> { | 18376 | #[repr(transparent)] |
| 13313 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | 18377 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 18378 | pub struct Ahb2lpenr(pub u32); | ||
| 18379 | impl Ahb2lpenr { | ||
| 18380 | #[doc = "DCMI peripheral clock enable during csleep mode"] | ||
| 18381 | pub const fn dcmilpen(&self) -> super::vals::Ahb2lpenrDcmilpen { | ||
| 18382 | let val = (self.0 >> 0usize) & 0x01; | ||
| 18383 | super::vals::Ahb2lpenrDcmilpen(val as u8) | ||
| 18384 | } | ||
| 18385 | #[doc = "DCMI peripheral clock enable during csleep mode"] | ||
| 18386 | pub fn set_dcmilpen(&mut self, val: super::vals::Ahb2lpenrDcmilpen) { | ||
| 18387 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 18388 | } | ||
| 18389 | #[doc = "CRYPT peripheral clock enable during CSleep mode"] | ||
| 18390 | pub const fn cryptlpen(&self) -> super::vals::Ahb2lpenrDcmilpen { | ||
| 18391 | let val = (self.0 >> 4usize) & 0x01; | ||
| 18392 | super::vals::Ahb2lpenrDcmilpen(val as u8) | ||
| 18393 | } | ||
| 18394 | #[doc = "CRYPT peripheral clock enable during CSleep mode"] | ||
| 18395 | pub fn set_cryptlpen(&mut self, val: super::vals::Ahb2lpenrDcmilpen) { | ||
| 18396 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 18397 | } | ||
| 18398 | #[doc = "HASH peripheral clock enable during CSleep mode"] | ||
| 18399 | pub const fn hashlpen(&self) -> super::vals::Ahb2lpenrDcmilpen { | ||
| 18400 | let val = (self.0 >> 5usize) & 0x01; | ||
| 18401 | super::vals::Ahb2lpenrDcmilpen(val as u8) | ||
| 18402 | } | ||
| 18403 | #[doc = "HASH peripheral clock enable during CSleep mode"] | ||
| 18404 | pub fn set_hashlpen(&mut self, val: super::vals::Ahb2lpenrDcmilpen) { | ||
| 18405 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 18406 | } | ||
| 18407 | #[doc = "RNG peripheral clock enable during CSleep mode"] | ||
| 18408 | pub const fn rnglpen(&self) -> super::vals::Ahb2lpenrDcmilpen { | ||
| 18409 | let val = (self.0 >> 6usize) & 0x01; | ||
| 18410 | super::vals::Ahb2lpenrDcmilpen(val as u8) | ||
| 18411 | } | ||
| 18412 | #[doc = "RNG peripheral clock enable during CSleep mode"] | ||
| 18413 | pub fn set_rnglpen(&mut self, val: super::vals::Ahb2lpenrDcmilpen) { | ||
| 18414 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); | ||
| 18415 | } | ||
| 18416 | #[doc = "SDMMC2 and SDMMC2 Delay Clock Enable During CSleep Mode"] | ||
| 18417 | pub const fn sdmmc2lpen(&self) -> super::vals::Ahb2lpenrDcmilpen { | ||
| 18418 | let val = (self.0 >> 9usize) & 0x01; | ||
| 18419 | super::vals::Ahb2lpenrDcmilpen(val as u8) | ||
| 18420 | } | ||
| 18421 | #[doc = "SDMMC2 and SDMMC2 Delay Clock Enable During CSleep Mode"] | ||
| 18422 | pub fn set_sdmmc2lpen(&mut self, val: super::vals::Ahb2lpenrDcmilpen) { | ||
| 18423 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | ||
| 18424 | } | ||
| 18425 | #[doc = "SRAM1 Clock Enable During CSleep Mode"] | ||
| 18426 | pub const fn sram1lpen(&self) -> super::vals::Ahb2lpenrDcmilpen { | ||
| 18427 | let val = (self.0 >> 29usize) & 0x01; | ||
| 18428 | super::vals::Ahb2lpenrDcmilpen(val as u8) | ||
| 18429 | } | ||
| 18430 | #[doc = "SRAM1 Clock Enable During CSleep Mode"] | ||
| 18431 | pub fn set_sram1lpen(&mut self, val: super::vals::Ahb2lpenrDcmilpen) { | ||
| 18432 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); | ||
| 18433 | } | ||
| 18434 | #[doc = "SRAM2 Clock Enable During CSleep Mode"] | ||
| 18435 | pub const fn sram2lpen(&self) -> super::vals::Ahb2lpenrDcmilpen { | ||
| 18436 | let val = (self.0 >> 30usize) & 0x01; | ||
| 18437 | super::vals::Ahb2lpenrDcmilpen(val as u8) | ||
| 18438 | } | ||
| 18439 | #[doc = "SRAM2 Clock Enable During CSleep Mode"] | ||
| 18440 | pub fn set_sram2lpen(&mut self, val: super::vals::Ahb2lpenrDcmilpen) { | ||
| 18441 | self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize); | ||
| 18442 | } | ||
| 18443 | #[doc = "SRAM3 Clock Enable During CSleep Mode"] | ||
| 18444 | pub const fn sram3lpen(&self) -> super::vals::Ahb2lpenrDcmilpen { | ||
| 18445 | let val = (self.0 >> 31usize) & 0x01; | ||
| 18446 | super::vals::Ahb2lpenrDcmilpen(val as u8) | ||
| 18447 | } | ||
| 18448 | #[doc = "SRAM3 Clock Enable During CSleep Mode"] | ||
| 18449 | pub fn set_sram3lpen(&mut self, val: super::vals::Ahb2lpenrDcmilpen) { | ||
| 18450 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize); | ||
| 18451 | } | ||
| 13314 | } | 18452 | } |
| 13315 | #[doc = "The SDMMC_ARGR register contains a 32-bit command argument, which is sent to a card as part of a command message."] | 18453 | impl Default for Ahb2lpenr { |
| 13316 | pub fn argr(self) -> Reg<regs::Argr, RW> { | 18454 | fn default() -> Ahb2lpenr { |
| 13317 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | 18455 | Ahb2lpenr(0) |
| 18456 | } | ||
| 13318 | } | 18457 | } |
| 13319 | #[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)."] | 18458 | #[doc = "RCC APB1 Clock Register"] |
| 13320 | pub fn cmdr(self) -> Reg<regs::Cmdr, RW> { | 18459 | #[repr(transparent)] |
| 13321 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | 18460 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 18461 | pub struct C1Apb1henr(pub u32); | ||
| 18462 | impl C1Apb1henr { | ||
| 18463 | #[doc = "Clock Recovery System peripheral clock enable"] | ||
| 18464 | pub const fn crsen(&self) -> super::vals::C1Apb1henrCrsen { | ||
| 18465 | let val = (self.0 >> 1usize) & 0x01; | ||
| 18466 | super::vals::C1Apb1henrCrsen(val as u8) | ||
| 18467 | } | ||
| 18468 | #[doc = "Clock Recovery System peripheral clock enable"] | ||
| 18469 | pub fn set_crsen(&mut self, val: super::vals::C1Apb1henrCrsen) { | ||
| 18470 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 18471 | } | ||
| 18472 | #[doc = "SWPMI Peripheral Clocks Enable"] | ||
| 18473 | pub const fn swpen(&self) -> super::vals::C1Apb1henrCrsen { | ||
| 18474 | let val = (self.0 >> 2usize) & 0x01; | ||
| 18475 | super::vals::C1Apb1henrCrsen(val as u8) | ||
| 18476 | } | ||
| 18477 | #[doc = "SWPMI Peripheral Clocks Enable"] | ||
| 18478 | pub fn set_swpen(&mut self, val: super::vals::C1Apb1henrCrsen) { | ||
| 18479 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 18480 | } | ||
| 18481 | #[doc = "OPAMP peripheral clock enable"] | ||
| 18482 | pub const fn opampen(&self) -> super::vals::C1Apb1henrCrsen { | ||
| 18483 | let val = (self.0 >> 4usize) & 0x01; | ||
| 18484 | super::vals::C1Apb1henrCrsen(val as u8) | ||
| 18485 | } | ||
| 18486 | #[doc = "OPAMP peripheral clock enable"] | ||
| 18487 | pub fn set_opampen(&mut self, val: super::vals::C1Apb1henrCrsen) { | ||
| 18488 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 18489 | } | ||
| 18490 | #[doc = "MDIOS peripheral clock enable"] | ||
| 18491 | pub const fn mdiosen(&self) -> super::vals::C1Apb1henrCrsen { | ||
| 18492 | let val = (self.0 >> 5usize) & 0x01; | ||
| 18493 | super::vals::C1Apb1henrCrsen(val as u8) | ||
| 18494 | } | ||
| 18495 | #[doc = "MDIOS peripheral clock enable"] | ||
| 18496 | pub fn set_mdiosen(&mut self, val: super::vals::C1Apb1henrCrsen) { | ||
| 18497 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 18498 | } | ||
| 18499 | #[doc = "FDCAN Peripheral Clocks Enable"] | ||
| 18500 | pub const fn fdcanen(&self) -> super::vals::C1Apb1henrCrsen { | ||
| 18501 | let val = (self.0 >> 8usize) & 0x01; | ||
| 18502 | super::vals::C1Apb1henrCrsen(val as u8) | ||
| 18503 | } | ||
| 18504 | #[doc = "FDCAN Peripheral Clocks Enable"] | ||
| 18505 | pub fn set_fdcanen(&mut self, val: super::vals::C1Apb1henrCrsen) { | ||
| 18506 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); | ||
| 18507 | } | ||
| 13322 | } | 18508 | } |
| 13323 | #[doc = "SDMMC command response register"] | 18509 | impl Default for C1Apb1henr { |
| 13324 | pub fn respcmdr(self) -> Reg<regs::Respcmdr, R> { | 18510 | fn default() -> C1Apb1henr { |
| 13325 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | 18511 | C1Apb1henr(0) |
| 18512 | } | ||
| 13326 | } | 18513 | } |
| 13327 | #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] | 18514 | #[doc = "RCC AHB3 Sleep Clock Register"] |
| 13328 | pub fn respr(self, n: usize) -> Reg<regs::Resp1r, R> { | 18515 | #[repr(transparent)] |
| 13329 | assert!(n < 4usize); | 18516 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 13330 | unsafe { Reg::from_ptr(self.0.add(20usize + n * 4usize)) } | 18517 | pub struct Ahb3lpenr(pub u32); |
| 18518 | impl Ahb3lpenr { | ||
| 18519 | #[doc = "MDMA Clock Enable During CSleep Mode"] | ||
| 18520 | pub const fn mdmalpen(&self) -> super::vals::Ahb3lpenrMdmalpen { | ||
| 18521 | let val = (self.0 >> 0usize) & 0x01; | ||
| 18522 | super::vals::Ahb3lpenrMdmalpen(val as u8) | ||
| 18523 | } | ||
| 18524 | #[doc = "MDMA Clock Enable During CSleep Mode"] | ||
| 18525 | pub fn set_mdmalpen(&mut self, val: super::vals::Ahb3lpenrMdmalpen) { | ||
| 18526 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 18527 | } | ||
| 18528 | #[doc = "DMA2D Clock Enable During CSleep Mode"] | ||
| 18529 | pub const fn dma2dlpen(&self) -> super::vals::Ahb3lpenrMdmalpen { | ||
| 18530 | let val = (self.0 >> 4usize) & 0x01; | ||
| 18531 | super::vals::Ahb3lpenrMdmalpen(val as u8) | ||
| 18532 | } | ||
| 18533 | #[doc = "DMA2D Clock Enable During CSleep Mode"] | ||
| 18534 | pub fn set_dma2dlpen(&mut self, val: super::vals::Ahb3lpenrMdmalpen) { | ||
| 18535 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 18536 | } | ||
| 18537 | #[doc = "JPGDEC Clock Enable During CSleep Mode"] | ||
| 18538 | pub const fn jpgdeclpen(&self) -> super::vals::Ahb3lpenrMdmalpen { | ||
| 18539 | let val = (self.0 >> 5usize) & 0x01; | ||
| 18540 | super::vals::Ahb3lpenrMdmalpen(val as u8) | ||
| 18541 | } | ||
| 18542 | #[doc = "JPGDEC Clock Enable During CSleep Mode"] | ||
| 18543 | pub fn set_jpgdeclpen(&mut self, val: super::vals::Ahb3lpenrMdmalpen) { | ||
| 18544 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 18545 | } | ||
| 18546 | #[doc = "FLITF Clock Enable During CSleep Mode"] | ||
| 18547 | pub const fn flashlpen(&self) -> super::vals::Ahb3lpenrMdmalpen { | ||
| 18548 | let val = (self.0 >> 8usize) & 0x01; | ||
| 18549 | super::vals::Ahb3lpenrMdmalpen(val as u8) | ||
| 18550 | } | ||
| 18551 | #[doc = "FLITF Clock Enable During CSleep Mode"] | ||
| 18552 | pub fn set_flashlpen(&mut self, val: super::vals::Ahb3lpenrMdmalpen) { | ||
| 18553 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); | ||
| 18554 | } | ||
| 18555 | #[doc = "FMC Peripheral Clocks Enable During CSleep Mode"] | ||
| 18556 | pub const fn fmclpen(&self) -> super::vals::Ahb3lpenrMdmalpen { | ||
| 18557 | let val = (self.0 >> 12usize) & 0x01; | ||
| 18558 | super::vals::Ahb3lpenrMdmalpen(val as u8) | ||
| 18559 | } | ||
| 18560 | #[doc = "FMC Peripheral Clocks Enable During CSleep Mode"] | ||
| 18561 | pub fn set_fmclpen(&mut self, val: super::vals::Ahb3lpenrMdmalpen) { | ||
| 18562 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 18563 | } | ||
| 18564 | #[doc = "QUADSPI and QUADSPI Delay Clock Enable During CSleep Mode"] | ||
| 18565 | pub const fn qspilpen(&self) -> super::vals::Ahb3lpenrMdmalpen { | ||
| 18566 | let val = (self.0 >> 14usize) & 0x01; | ||
| 18567 | super::vals::Ahb3lpenrMdmalpen(val as u8) | ||
| 18568 | } | ||
| 18569 | #[doc = "QUADSPI and QUADSPI Delay Clock Enable During CSleep Mode"] | ||
| 18570 | pub fn set_qspilpen(&mut self, val: super::vals::Ahb3lpenrMdmalpen) { | ||
| 18571 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | ||
| 18572 | } | ||
| 18573 | #[doc = "SDMMC1 and SDMMC1 Delay Clock Enable During CSleep Mode"] | ||
| 18574 | pub const fn sdmmc1lpen(&self) -> super::vals::Ahb3lpenrMdmalpen { | ||
| 18575 | let val = (self.0 >> 16usize) & 0x01; | ||
| 18576 | super::vals::Ahb3lpenrMdmalpen(val as u8) | ||
| 18577 | } | ||
| 18578 | #[doc = "SDMMC1 and SDMMC1 Delay Clock Enable During CSleep Mode"] | ||
| 18579 | pub fn set_sdmmc1lpen(&mut self, val: super::vals::Ahb3lpenrMdmalpen) { | ||
| 18580 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 18581 | } | ||
| 18582 | #[doc = "D1DTCM1 Block Clock Enable During CSleep mode"] | ||
| 18583 | pub const fn d1dtcm1lpen(&self) -> super::vals::Ahb3lpenrMdmalpen { | ||
| 18584 | let val = (self.0 >> 28usize) & 0x01; | ||
| 18585 | super::vals::Ahb3lpenrMdmalpen(val as u8) | ||
| 18586 | } | ||
| 18587 | #[doc = "D1DTCM1 Block Clock Enable During CSleep mode"] | ||
| 18588 | pub fn set_d1dtcm1lpen(&mut self, val: super::vals::Ahb3lpenrMdmalpen) { | ||
| 18589 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); | ||
| 18590 | } | ||
| 18591 | #[doc = "D1 DTCM2 Block Clock Enable During CSleep mode"] | ||
| 18592 | pub const fn dtcm2lpen(&self) -> super::vals::Ahb3lpenrMdmalpen { | ||
| 18593 | let val = (self.0 >> 29usize) & 0x01; | ||
| 18594 | super::vals::Ahb3lpenrMdmalpen(val as u8) | ||
| 18595 | } | ||
| 18596 | #[doc = "D1 DTCM2 Block Clock Enable During CSleep mode"] | ||
| 18597 | pub fn set_dtcm2lpen(&mut self, val: super::vals::Ahb3lpenrMdmalpen) { | ||
| 18598 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); | ||
| 18599 | } | ||
| 18600 | #[doc = "D1ITCM Block Clock Enable During CSleep mode"] | ||
| 18601 | pub const fn itcmlpen(&self) -> super::vals::Ahb3lpenrMdmalpen { | ||
| 18602 | let val = (self.0 >> 30usize) & 0x01; | ||
| 18603 | super::vals::Ahb3lpenrMdmalpen(val as u8) | ||
| 18604 | } | ||
| 18605 | #[doc = "D1ITCM Block Clock Enable During CSleep mode"] | ||
| 18606 | pub fn set_itcmlpen(&mut self, val: super::vals::Ahb3lpenrMdmalpen) { | ||
| 18607 | self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize); | ||
| 18608 | } | ||
| 18609 | #[doc = "AXISRAM Block Clock Enable During CSleep mode"] | ||
| 18610 | pub const fn axisramlpen(&self) -> super::vals::Ahb3lpenrMdmalpen { | ||
| 18611 | let val = (self.0 >> 31usize) & 0x01; | ||
| 18612 | super::vals::Ahb3lpenrMdmalpen(val as u8) | ||
| 18613 | } | ||
| 18614 | #[doc = "AXISRAM Block Clock Enable During CSleep mode"] | ||
| 18615 | pub fn set_axisramlpen(&mut self, val: super::vals::Ahb3lpenrMdmalpen) { | ||
| 18616 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize); | ||
| 18617 | } | ||
| 13331 | } | 18618 | } |
| 13332 | #[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."] | 18619 | impl Default for Ahb3lpenr { |
| 13333 | pub fn dtimer(self) -> Reg<regs::Dtimer, RW> { | 18620 | fn default() -> Ahb3lpenr { |
| 13334 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | 18621 | Ahb3lpenr(0) |
| 18622 | } | ||
| 13335 | } | 18623 | } |
| 13336 | #[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."] | 18624 | #[doc = "RCC PLLs Clock Source Selection Register"] |
| 13337 | pub fn dlenr(self) -> Reg<regs::Dlenr, RW> { | 18625 | #[repr(transparent)] |
| 13338 | unsafe { Reg::from_ptr(self.0.add(40usize)) } | 18626 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 18627 | pub struct Pllckselr(pub u32); | ||
| 18628 | impl Pllckselr { | ||
| 18629 | #[doc = "DIVMx and PLLs clock source selection"] | ||
| 18630 | pub const fn pllsrc(&self) -> super::vals::Pllsrc { | ||
| 18631 | let val = (self.0 >> 0usize) & 0x03; | ||
| 18632 | super::vals::Pllsrc(val as u8) | ||
| 18633 | } | ||
| 18634 | #[doc = "DIVMx and PLLs clock source selection"] | ||
| 18635 | pub fn set_pllsrc(&mut self, val: super::vals::Pllsrc) { | ||
| 18636 | self.0 = (self.0 & !(0x03 << 0usize)) | (((val.0 as u32) & 0x03) << 0usize); | ||
| 18637 | } | ||
| 18638 | #[doc = "Prescaler for PLL1"] | ||
| 18639 | pub fn divm(&self, n: usize) -> u8 { | ||
| 18640 | assert!(n < 3usize); | ||
| 18641 | let offs = 4usize + n * 8usize; | ||
| 18642 | let val = (self.0 >> offs) & 0x3f; | ||
| 18643 | val as u8 | ||
| 18644 | } | ||
| 18645 | #[doc = "Prescaler for PLL1"] | ||
| 18646 | pub fn set_divm(&mut self, n: usize, val: u8) { | ||
| 18647 | assert!(n < 3usize); | ||
| 18648 | let offs = 4usize + n * 8usize; | ||
| 18649 | self.0 = (self.0 & !(0x3f << offs)) | (((val as u32) & 0x3f) << offs); | ||
| 18650 | } | ||
| 13339 | } | 18651 | } |
| 13340 | #[doc = "The SDMMC_DCTRL register control the data path state machine (DPSM)."] | 18652 | impl Default for Pllckselr { |
| 13341 | pub fn dctrl(self) -> Reg<regs::Dctrl, RW> { | 18653 | fn default() -> Pllckselr { |
| 13342 | unsafe { Reg::from_ptr(self.0.add(44usize)) } | 18654 | Pllckselr(0) |
| 18655 | } | ||
| 13343 | } | 18656 | } |
| 13344 | #[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."] | 18657 | #[doc = "RCC APB2 Peripheral Reset Register"] |
| 13345 | pub fn dcntr(self) -> Reg<regs::Dcntr, R> { | 18658 | #[repr(transparent)] |
| 13346 | unsafe { Reg::from_ptr(self.0.add(48usize)) } | 18659 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 18660 | pub struct Apb2rstr(pub u32); | ||
| 18661 | impl Apb2rstr { | ||
| 18662 | #[doc = "TIM1 block reset"] | ||
| 18663 | pub const fn tim1rst(&self) -> super::vals::Tim1rst { | ||
| 18664 | let val = (self.0 >> 0usize) & 0x01; | ||
| 18665 | super::vals::Tim1rst(val as u8) | ||
| 18666 | } | ||
| 18667 | #[doc = "TIM1 block reset"] | ||
| 18668 | pub fn set_tim1rst(&mut self, val: super::vals::Tim1rst) { | ||
| 18669 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 18670 | } | ||
| 18671 | #[doc = "TIM8 block reset"] | ||
| 18672 | pub const fn tim8rst(&self) -> super::vals::Tim1rst { | ||
| 18673 | let val = (self.0 >> 1usize) & 0x01; | ||
| 18674 | super::vals::Tim1rst(val as u8) | ||
| 18675 | } | ||
| 18676 | #[doc = "TIM8 block reset"] | ||
| 18677 | pub fn set_tim8rst(&mut self, val: super::vals::Tim1rst) { | ||
| 18678 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 18679 | } | ||
| 18680 | #[doc = "USART1 block reset"] | ||
| 18681 | pub const fn usart1rst(&self) -> super::vals::Tim1rst { | ||
| 18682 | let val = (self.0 >> 4usize) & 0x01; | ||
| 18683 | super::vals::Tim1rst(val as u8) | ||
| 18684 | } | ||
| 18685 | #[doc = "USART1 block reset"] | ||
| 18686 | pub fn set_usart1rst(&mut self, val: super::vals::Tim1rst) { | ||
| 18687 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 18688 | } | ||
| 18689 | #[doc = "USART6 block reset"] | ||
| 18690 | pub const fn usart6rst(&self) -> super::vals::Tim1rst { | ||
| 18691 | let val = (self.0 >> 5usize) & 0x01; | ||
| 18692 | super::vals::Tim1rst(val as u8) | ||
| 18693 | } | ||
| 18694 | #[doc = "USART6 block reset"] | ||
| 18695 | pub fn set_usart6rst(&mut self, val: super::vals::Tim1rst) { | ||
| 18696 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 18697 | } | ||
| 18698 | #[doc = "SPI1 block reset"] | ||
| 18699 | pub const fn spi1rst(&self) -> super::vals::Tim1rst { | ||
| 18700 | let val = (self.0 >> 12usize) & 0x01; | ||
| 18701 | super::vals::Tim1rst(val as u8) | ||
| 18702 | } | ||
| 18703 | #[doc = "SPI1 block reset"] | ||
| 18704 | pub fn set_spi1rst(&mut self, val: super::vals::Tim1rst) { | ||
| 18705 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 18706 | } | ||
| 18707 | #[doc = "SPI4 block reset"] | ||
| 18708 | pub const fn spi4rst(&self) -> super::vals::Tim1rst { | ||
| 18709 | let val = (self.0 >> 13usize) & 0x01; | ||
| 18710 | super::vals::Tim1rst(val as u8) | ||
| 18711 | } | ||
| 18712 | #[doc = "SPI4 block reset"] | ||
| 18713 | pub fn set_spi4rst(&mut self, val: super::vals::Tim1rst) { | ||
| 18714 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize); | ||
| 18715 | } | ||
| 18716 | #[doc = "TIM15 block reset"] | ||
| 18717 | pub const fn tim15rst(&self) -> super::vals::Tim1rst { | ||
| 18718 | let val = (self.0 >> 16usize) & 0x01; | ||
| 18719 | super::vals::Tim1rst(val as u8) | ||
| 18720 | } | ||
| 18721 | #[doc = "TIM15 block reset"] | ||
| 18722 | pub fn set_tim15rst(&mut self, val: super::vals::Tim1rst) { | ||
| 18723 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 18724 | } | ||
| 18725 | #[doc = "TIM16 block reset"] | ||
| 18726 | pub const fn tim16rst(&self) -> super::vals::Tim1rst { | ||
| 18727 | let val = (self.0 >> 17usize) & 0x01; | ||
| 18728 | super::vals::Tim1rst(val as u8) | ||
| 18729 | } | ||
| 18730 | #[doc = "TIM16 block reset"] | ||
| 18731 | pub fn set_tim16rst(&mut self, val: super::vals::Tim1rst) { | ||
| 18732 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize); | ||
| 18733 | } | ||
| 18734 | #[doc = "TIM17 block reset"] | ||
| 18735 | pub const fn tim17rst(&self) -> super::vals::Tim1rst { | ||
| 18736 | let val = (self.0 >> 18usize) & 0x01; | ||
| 18737 | super::vals::Tim1rst(val as u8) | ||
| 18738 | } | ||
| 18739 | #[doc = "TIM17 block reset"] | ||
| 18740 | pub fn set_tim17rst(&mut self, val: super::vals::Tim1rst) { | ||
| 18741 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize); | ||
| 18742 | } | ||
| 18743 | #[doc = "SPI5 block reset"] | ||
| 18744 | pub const fn spi5rst(&self) -> super::vals::Tim1rst { | ||
| 18745 | let val = (self.0 >> 20usize) & 0x01; | ||
| 18746 | super::vals::Tim1rst(val as u8) | ||
| 18747 | } | ||
| 18748 | #[doc = "SPI5 block reset"] | ||
| 18749 | pub fn set_spi5rst(&mut self, val: super::vals::Tim1rst) { | ||
| 18750 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize); | ||
| 18751 | } | ||
| 18752 | #[doc = "SAI1 block reset"] | ||
| 18753 | pub const fn sai1rst(&self) -> super::vals::Tim1rst { | ||
| 18754 | let val = (self.0 >> 22usize) & 0x01; | ||
| 18755 | super::vals::Tim1rst(val as u8) | ||
| 18756 | } | ||
| 18757 | #[doc = "SAI1 block reset"] | ||
| 18758 | pub fn set_sai1rst(&mut self, val: super::vals::Tim1rst) { | ||
| 18759 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize); | ||
| 18760 | } | ||
| 18761 | #[doc = "SAI2 block reset"] | ||
| 18762 | pub const fn sai2rst(&self) -> super::vals::Tim1rst { | ||
| 18763 | let val = (self.0 >> 23usize) & 0x01; | ||
| 18764 | super::vals::Tim1rst(val as u8) | ||
| 18765 | } | ||
| 18766 | #[doc = "SAI2 block reset"] | ||
| 18767 | pub fn set_sai2rst(&mut self, val: super::vals::Tim1rst) { | ||
| 18768 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize); | ||
| 18769 | } | ||
| 18770 | #[doc = "SAI3 block reset"] | ||
| 18771 | pub const fn sai3rst(&self) -> super::vals::Tim1rst { | ||
| 18772 | let val = (self.0 >> 24usize) & 0x01; | ||
| 18773 | super::vals::Tim1rst(val as u8) | ||
| 18774 | } | ||
| 18775 | #[doc = "SAI3 block reset"] | ||
| 18776 | pub fn set_sai3rst(&mut self, val: super::vals::Tim1rst) { | ||
| 18777 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); | ||
| 18778 | } | ||
| 18779 | #[doc = "DFSDM1 block reset"] | ||
| 18780 | pub const fn dfsdm1rst(&self) -> super::vals::Tim1rst { | ||
| 18781 | let val = (self.0 >> 28usize) & 0x01; | ||
| 18782 | super::vals::Tim1rst(val as u8) | ||
| 18783 | } | ||
| 18784 | #[doc = "DFSDM1 block reset"] | ||
| 18785 | pub fn set_dfsdm1rst(&mut self, val: super::vals::Tim1rst) { | ||
| 18786 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); | ||
| 18787 | } | ||
| 18788 | #[doc = "HRTIM block reset"] | ||
| 18789 | pub const fn hrtimrst(&self) -> super::vals::Tim1rst { | ||
| 18790 | let val = (self.0 >> 29usize) & 0x01; | ||
| 18791 | super::vals::Tim1rst(val as u8) | ||
| 18792 | } | ||
| 18793 | #[doc = "HRTIM block reset"] | ||
| 18794 | pub fn set_hrtimrst(&mut self, val: super::vals::Tim1rst) { | ||
| 18795 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); | ||
| 18796 | } | ||
| 13347 | } | 18797 | } |
| 13348 | #[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)"] | 18798 | impl Default for Apb2rstr { |
| 13349 | pub fn star(self) -> Reg<regs::Star, R> { | 18799 | fn default() -> Apb2rstr { |
| 13350 | unsafe { Reg::from_ptr(self.0.add(52usize)) } | 18800 | Apb2rstr(0) |
| 18801 | } | ||
| 13351 | } | 18802 | } |
| 13352 | #[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."] | 18803 | #[doc = "RCC AHB4 Clock Register"] |
| 13353 | pub fn icr(self) -> Reg<regs::Icr, RW> { | 18804 | #[repr(transparent)] |
| 13354 | unsafe { Reg::from_ptr(self.0.add(56usize)) } | 18805 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 18806 | pub struct Ahb4enr(pub u32); | ||
| 18807 | impl Ahb4enr { | ||
| 18808 | #[doc = "0GPIO peripheral clock enable"] | ||
| 18809 | pub const fn gpioaen(&self) -> super::vals::Ahb4enrGpioaen { | ||
| 18810 | let val = (self.0 >> 0usize) & 0x01; | ||
| 18811 | super::vals::Ahb4enrGpioaen(val as u8) | ||
| 18812 | } | ||
| 18813 | #[doc = "0GPIO peripheral clock enable"] | ||
| 18814 | pub fn set_gpioaen(&mut self, val: super::vals::Ahb4enrGpioaen) { | ||
| 18815 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 18816 | } | ||
| 18817 | #[doc = "0GPIO peripheral clock enable"] | ||
| 18818 | pub const fn gpioben(&self) -> super::vals::Ahb4enrGpioaen { | ||
| 18819 | let val = (self.0 >> 1usize) & 0x01; | ||
| 18820 | super::vals::Ahb4enrGpioaen(val as u8) | ||
| 18821 | } | ||
| 18822 | #[doc = "0GPIO peripheral clock enable"] | ||
| 18823 | pub fn set_gpioben(&mut self, val: super::vals::Ahb4enrGpioaen) { | ||
| 18824 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 18825 | } | ||
| 18826 | #[doc = "0GPIO peripheral clock enable"] | ||
| 18827 | pub const fn gpiocen(&self) -> super::vals::Ahb4enrGpioaen { | ||
| 18828 | let val = (self.0 >> 2usize) & 0x01; | ||
| 18829 | super::vals::Ahb4enrGpioaen(val as u8) | ||
| 18830 | } | ||
| 18831 | #[doc = "0GPIO peripheral clock enable"] | ||
| 18832 | pub fn set_gpiocen(&mut self, val: super::vals::Ahb4enrGpioaen) { | ||
| 18833 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 18834 | } | ||
| 18835 | #[doc = "0GPIO peripheral clock enable"] | ||
| 18836 | pub const fn gpioden(&self) -> super::vals::Ahb4enrGpioaen { | ||
| 18837 | let val = (self.0 >> 3usize) & 0x01; | ||
| 18838 | super::vals::Ahb4enrGpioaen(val as u8) | ||
| 18839 | } | ||
| 18840 | #[doc = "0GPIO peripheral clock enable"] | ||
| 18841 | pub fn set_gpioden(&mut self, val: super::vals::Ahb4enrGpioaen) { | ||
| 18842 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 18843 | } | ||
| 18844 | #[doc = "0GPIO peripheral clock enable"] | ||
| 18845 | pub const fn gpioeen(&self) -> super::vals::Ahb4enrGpioaen { | ||
| 18846 | let val = (self.0 >> 4usize) & 0x01; | ||
| 18847 | super::vals::Ahb4enrGpioaen(val as u8) | ||
| 18848 | } | ||
| 18849 | #[doc = "0GPIO peripheral clock enable"] | ||
| 18850 | pub fn set_gpioeen(&mut self, val: super::vals::Ahb4enrGpioaen) { | ||
| 18851 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 18852 | } | ||
| 18853 | #[doc = "0GPIO peripheral clock enable"] | ||
| 18854 | pub const fn gpiofen(&self) -> super::vals::Ahb4enrGpioaen { | ||
| 18855 | let val = (self.0 >> 5usize) & 0x01; | ||
| 18856 | super::vals::Ahb4enrGpioaen(val as u8) | ||
| 18857 | } | ||
| 18858 | #[doc = "0GPIO peripheral clock enable"] | ||
| 18859 | pub fn set_gpiofen(&mut self, val: super::vals::Ahb4enrGpioaen) { | ||
| 18860 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 18861 | } | ||
| 18862 | #[doc = "0GPIO peripheral clock enable"] | ||
| 18863 | pub const fn gpiogen(&self) -> super::vals::Ahb4enrGpioaen { | ||
| 18864 | let val = (self.0 >> 6usize) & 0x01; | ||
| 18865 | super::vals::Ahb4enrGpioaen(val as u8) | ||
| 18866 | } | ||
| 18867 | #[doc = "0GPIO peripheral clock enable"] | ||
| 18868 | pub fn set_gpiogen(&mut self, val: super::vals::Ahb4enrGpioaen) { | ||
| 18869 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); | ||
| 18870 | } | ||
| 18871 | #[doc = "0GPIO peripheral clock enable"] | ||
| 18872 | pub const fn gpiohen(&self) -> super::vals::Ahb4enrGpioaen { | ||
| 18873 | let val = (self.0 >> 7usize) & 0x01; | ||
| 18874 | super::vals::Ahb4enrGpioaen(val as u8) | ||
| 18875 | } | ||
| 18876 | #[doc = "0GPIO peripheral clock enable"] | ||
| 18877 | pub fn set_gpiohen(&mut self, val: super::vals::Ahb4enrGpioaen) { | ||
| 18878 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 18879 | } | ||
| 18880 | #[doc = "0GPIO peripheral clock enable"] | ||
| 18881 | pub const fn gpioien(&self) -> super::vals::Ahb4enrGpioaen { | ||
| 18882 | let val = (self.0 >> 8usize) & 0x01; | ||
| 18883 | super::vals::Ahb4enrGpioaen(val as u8) | ||
| 18884 | } | ||
| 18885 | #[doc = "0GPIO peripheral clock enable"] | ||
| 18886 | pub fn set_gpioien(&mut self, val: super::vals::Ahb4enrGpioaen) { | ||
| 18887 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); | ||
| 18888 | } | ||
| 18889 | #[doc = "0GPIO peripheral clock enable"] | ||
| 18890 | pub const fn gpiojen(&self) -> super::vals::Ahb4enrGpioaen { | ||
| 18891 | let val = (self.0 >> 9usize) & 0x01; | ||
| 18892 | super::vals::Ahb4enrGpioaen(val as u8) | ||
| 18893 | } | ||
| 18894 | #[doc = "0GPIO peripheral clock enable"] | ||
| 18895 | pub fn set_gpiojen(&mut self, val: super::vals::Ahb4enrGpioaen) { | ||
| 18896 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | ||
| 18897 | } | ||
| 18898 | #[doc = "0GPIO peripheral clock enable"] | ||
| 18899 | pub const fn gpioken(&self) -> super::vals::Ahb4enrGpioaen { | ||
| 18900 | let val = (self.0 >> 10usize) & 0x01; | ||
| 18901 | super::vals::Ahb4enrGpioaen(val as u8) | ||
| 18902 | } | ||
| 18903 | #[doc = "0GPIO peripheral clock enable"] | ||
| 18904 | pub fn set_gpioken(&mut self, val: super::vals::Ahb4enrGpioaen) { | ||
| 18905 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); | ||
| 18906 | } | ||
| 18907 | #[doc = "CRC peripheral clock enable"] | ||
| 18908 | pub const fn crcen(&self) -> super::vals::Ahb4enrGpioaen { | ||
| 18909 | let val = (self.0 >> 19usize) & 0x01; | ||
| 18910 | super::vals::Ahb4enrGpioaen(val as u8) | ||
| 18911 | } | ||
| 18912 | #[doc = "CRC peripheral clock enable"] | ||
| 18913 | pub fn set_crcen(&mut self, val: super::vals::Ahb4enrGpioaen) { | ||
| 18914 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); | ||
| 18915 | } | ||
| 18916 | #[doc = "BDMA and DMAMUX2 Clock Enable"] | ||
| 18917 | pub const fn bdmaen(&self) -> super::vals::Ahb4enrGpioaen { | ||
| 18918 | let val = (self.0 >> 21usize) & 0x01; | ||
| 18919 | super::vals::Ahb4enrGpioaen(val as u8) | ||
| 18920 | } | ||
| 18921 | #[doc = "BDMA and DMAMUX2 Clock Enable"] | ||
| 18922 | pub fn set_bdmaen(&mut self, val: super::vals::Ahb4enrGpioaen) { | ||
| 18923 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize); | ||
| 18924 | } | ||
| 18925 | #[doc = "ADC3 Peripheral Clocks Enable"] | ||
| 18926 | pub const fn adc3en(&self) -> super::vals::Ahb4enrGpioaen { | ||
| 18927 | let val = (self.0 >> 24usize) & 0x01; | ||
| 18928 | super::vals::Ahb4enrGpioaen(val as u8) | ||
| 18929 | } | ||
| 18930 | #[doc = "ADC3 Peripheral Clocks Enable"] | ||
| 18931 | pub fn set_adc3en(&mut self, val: super::vals::Ahb4enrGpioaen) { | ||
| 18932 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); | ||
| 18933 | } | ||
| 18934 | #[doc = "HSEM peripheral clock enable"] | ||
| 18935 | pub const fn hsemen(&self) -> super::vals::Ahb4enrGpioaen { | ||
| 18936 | let val = (self.0 >> 25usize) & 0x01; | ||
| 18937 | super::vals::Ahb4enrGpioaen(val as u8) | ||
| 18938 | } | ||
| 18939 | #[doc = "HSEM peripheral clock enable"] | ||
| 18940 | pub fn set_hsemen(&mut self, val: super::vals::Ahb4enrGpioaen) { | ||
| 18941 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize); | ||
| 18942 | } | ||
| 18943 | #[doc = "Backup RAM Clock Enable"] | ||
| 18944 | pub const fn bkpramen(&self) -> super::vals::Ahb4enrGpioaen { | ||
| 18945 | let val = (self.0 >> 28usize) & 0x01; | ||
| 18946 | super::vals::Ahb4enrGpioaen(val as u8) | ||
| 18947 | } | ||
| 18948 | #[doc = "Backup RAM Clock Enable"] | ||
| 18949 | pub fn set_bkpramen(&mut self, val: super::vals::Ahb4enrGpioaen) { | ||
| 18950 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); | ||
| 18951 | } | ||
| 13355 | } | 18952 | } |
| 13356 | #[doc = "The interrupt mask register determines which status flags generate an interrupt request by setting the corresponding bit to 1."] | 18953 | impl Default for Ahb4enr { |
| 13357 | pub fn maskr(self) -> Reg<regs::Maskr, RW> { | 18954 | fn default() -> Ahb4enr { |
| 13358 | unsafe { Reg::from_ptr(self.0.add(60usize)) } | 18955 | Ahb4enr(0) |
| 18956 | } | ||
| 13359 | } | 18957 | } |
| 13360 | #[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."] | 18958 | #[doc = "RCC APB3 Sleep Clock Register"] |
| 13361 | pub fn acktimer(self) -> Reg<regs::Acktimer, RW> { | 18959 | #[repr(transparent)] |
| 13362 | unsafe { Reg::from_ptr(self.0.add(64usize)) } | 18960 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 18961 | pub struct Apb3lpenr(pub u32); | ||
| 18962 | impl Apb3lpenr { | ||
| 18963 | #[doc = "LTDC peripheral clock enable during CSleep mode"] | ||
| 18964 | pub const fn ltdclpen(&self) -> super::vals::Apb3lpenrLtdclpen { | ||
| 18965 | let val = (self.0 >> 3usize) & 0x01; | ||
| 18966 | super::vals::Apb3lpenrLtdclpen(val as u8) | ||
| 18967 | } | ||
| 18968 | #[doc = "LTDC peripheral clock enable during CSleep mode"] | ||
| 18969 | pub fn set_ltdclpen(&mut self, val: super::vals::Apb3lpenrLtdclpen) { | ||
| 18970 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 18971 | } | ||
| 18972 | #[doc = "WWDG1 Clock Enable During CSleep Mode"] | ||
| 18973 | pub const fn wwdg1lpen(&self) -> super::vals::Apb3lpenrLtdclpen { | ||
| 18974 | let val = (self.0 >> 6usize) & 0x01; | ||
| 18975 | super::vals::Apb3lpenrLtdclpen(val as u8) | ||
| 18976 | } | ||
| 18977 | #[doc = "WWDG1 Clock Enable During CSleep Mode"] | ||
| 18978 | pub fn set_wwdg1lpen(&mut self, val: super::vals::Apb3lpenrLtdclpen) { | ||
| 18979 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); | ||
| 18980 | } | ||
| 13363 | } | 18981 | } |
| 13364 | #[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."] | 18982 | impl Default for Apb3lpenr { |
| 13365 | pub fn idmactrlr(self) -> Reg<regs::Idmactrlr, RW> { | 18983 | fn default() -> Apb3lpenr { |
| 13366 | unsafe { Reg::from_ptr(self.0.add(80usize)) } | 18984 | Apb3lpenr(0) |
| 18985 | } | ||
| 13367 | } | 18986 | } |
| 13368 | #[doc = "The SDMMC_IDMABSIZER register contains the buffers size when in double buffer configuration."] | 18987 | #[doc = "RCC AHB2 Clock Register"] |
| 13369 | pub fn idmabsizer(self) -> Reg<regs::Idmabsizer, RW> { | 18988 | #[repr(transparent)] |
| 13370 | unsafe { Reg::from_ptr(self.0.add(84usize)) } | 18989 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 18990 | pub struct Ahb2enr(pub u32); | ||
| 18991 | impl Ahb2enr { | ||
| 18992 | #[doc = "DCMI peripheral clock"] | ||
| 18993 | pub const fn dcmien(&self) -> super::vals::Ahb2enrDcmien { | ||
| 18994 | let val = (self.0 >> 0usize) & 0x01; | ||
| 18995 | super::vals::Ahb2enrDcmien(val as u8) | ||
| 18996 | } | ||
| 18997 | #[doc = "DCMI peripheral clock"] | ||
| 18998 | pub fn set_dcmien(&mut self, val: super::vals::Ahb2enrDcmien) { | ||
| 18999 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 19000 | } | ||
| 19001 | #[doc = "CRYPT peripheral clock enable"] | ||
| 19002 | pub const fn crypten(&self) -> super::vals::Ahb2enrDcmien { | ||
| 19003 | let val = (self.0 >> 4usize) & 0x01; | ||
| 19004 | super::vals::Ahb2enrDcmien(val as u8) | ||
| 19005 | } | ||
| 19006 | #[doc = "CRYPT peripheral clock enable"] | ||
| 19007 | pub fn set_crypten(&mut self, val: super::vals::Ahb2enrDcmien) { | ||
| 19008 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 19009 | } | ||
| 19010 | #[doc = "HASH peripheral clock enable"] | ||
| 19011 | pub const fn hashen(&self) -> super::vals::Ahb2enrDcmien { | ||
| 19012 | let val = (self.0 >> 5usize) & 0x01; | ||
| 19013 | super::vals::Ahb2enrDcmien(val as u8) | ||
| 19014 | } | ||
| 19015 | #[doc = "HASH peripheral clock enable"] | ||
| 19016 | pub fn set_hashen(&mut self, val: super::vals::Ahb2enrDcmien) { | ||
| 19017 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 19018 | } | ||
| 19019 | #[doc = "RNG peripheral clocks enable"] | ||
| 19020 | pub const fn rngen(&self) -> super::vals::Ahb2enrDcmien { | ||
| 19021 | let val = (self.0 >> 6usize) & 0x01; | ||
| 19022 | super::vals::Ahb2enrDcmien(val as u8) | ||
| 19023 | } | ||
| 19024 | #[doc = "RNG peripheral clocks enable"] | ||
| 19025 | pub fn set_rngen(&mut self, val: super::vals::Ahb2enrDcmien) { | ||
| 19026 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); | ||
| 19027 | } | ||
| 19028 | #[doc = "SDMMC2 and SDMMC2 delay clock enable"] | ||
| 19029 | pub const fn sdmmc2en(&self) -> super::vals::Ahb2enrDcmien { | ||
| 19030 | let val = (self.0 >> 9usize) & 0x01; | ||
| 19031 | super::vals::Ahb2enrDcmien(val as u8) | ||
| 19032 | } | ||
| 19033 | #[doc = "SDMMC2 and SDMMC2 delay clock enable"] | ||
| 19034 | pub fn set_sdmmc2en(&mut self, val: super::vals::Ahb2enrDcmien) { | ||
| 19035 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | ||
| 19036 | } | ||
| 19037 | #[doc = "SRAM1 block enable"] | ||
| 19038 | pub const fn sram1en(&self) -> super::vals::Ahb2enrDcmien { | ||
| 19039 | let val = (self.0 >> 29usize) & 0x01; | ||
| 19040 | super::vals::Ahb2enrDcmien(val as u8) | ||
| 19041 | } | ||
| 19042 | #[doc = "SRAM1 block enable"] | ||
| 19043 | pub fn set_sram1en(&mut self, val: super::vals::Ahb2enrDcmien) { | ||
| 19044 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); | ||
| 19045 | } | ||
| 19046 | #[doc = "SRAM2 block enable"] | ||
| 19047 | pub const fn sram2en(&self) -> super::vals::Ahb2enrDcmien { | ||
| 19048 | let val = (self.0 >> 30usize) & 0x01; | ||
| 19049 | super::vals::Ahb2enrDcmien(val as u8) | ||
| 19050 | } | ||
| 19051 | #[doc = "SRAM2 block enable"] | ||
| 19052 | pub fn set_sram2en(&mut self, val: super::vals::Ahb2enrDcmien) { | ||
| 19053 | self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize); | ||
| 19054 | } | ||
| 19055 | #[doc = "SRAM3 block enable"] | ||
| 19056 | pub const fn sram3en(&self) -> super::vals::Ahb2enrDcmien { | ||
| 19057 | let val = (self.0 >> 31usize) & 0x01; | ||
| 19058 | super::vals::Ahb2enrDcmien(val as u8) | ||
| 19059 | } | ||
| 19060 | #[doc = "SRAM3 block enable"] | ||
| 19061 | pub fn set_sram3en(&mut self, val: super::vals::Ahb2enrDcmien) { | ||
| 19062 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize); | ||
| 19063 | } | ||
| 13371 | } | 19064 | } |
| 13372 | #[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."] | 19065 | impl Default for Ahb2enr { |
| 13373 | pub fn idmabase0r(self) -> Reg<regs::Idmabase0r, RW> { | 19066 | fn default() -> Ahb2enr { |
| 13374 | unsafe { Reg::from_ptr(self.0.add(88usize)) } | 19067 | Ahb2enr(0) |
| 19068 | } | ||
| 13375 | } | 19069 | } |
| 13376 | #[doc = "The SDMMC_IDMABASE1R register contains the double buffer configuration second buffer memory base address."] | 19070 | #[doc = "RCC AHB2 Sleep Clock Register"] |
| 13377 | pub fn idmabase1r(self) -> Reg<regs::Idmabase1r, RW> { | 19071 | #[repr(transparent)] |
| 13378 | unsafe { Reg::from_ptr(self.0.add(92usize)) } | 19072 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 19073 | pub struct C1Ahb2lpenr(pub u32); | ||
| 19074 | impl C1Ahb2lpenr { | ||
| 19075 | #[doc = "DCMI peripheral clock enable during csleep mode"] | ||
| 19076 | pub const fn dcmilpen(&self) -> super::vals::C1Ahb2lpenrDcmilpen { | ||
| 19077 | let val = (self.0 >> 0usize) & 0x01; | ||
| 19078 | super::vals::C1Ahb2lpenrDcmilpen(val as u8) | ||
| 19079 | } | ||
| 19080 | #[doc = "DCMI peripheral clock enable during csleep mode"] | ||
| 19081 | pub fn set_dcmilpen(&mut self, val: super::vals::C1Ahb2lpenrDcmilpen) { | ||
| 19082 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 19083 | } | ||
| 19084 | #[doc = "CRYPT peripheral clock enable during CSleep mode"] | ||
| 19085 | pub const fn cryptlpen(&self) -> super::vals::C1Ahb2lpenrDcmilpen { | ||
| 19086 | let val = (self.0 >> 4usize) & 0x01; | ||
| 19087 | super::vals::C1Ahb2lpenrDcmilpen(val as u8) | ||
| 19088 | } | ||
| 19089 | #[doc = "CRYPT peripheral clock enable during CSleep mode"] | ||
| 19090 | pub fn set_cryptlpen(&mut self, val: super::vals::C1Ahb2lpenrDcmilpen) { | ||
| 19091 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 19092 | } | ||
| 19093 | #[doc = "HASH peripheral clock enable during CSleep mode"] | ||
| 19094 | pub const fn hashlpen(&self) -> super::vals::C1Ahb2lpenrDcmilpen { | ||
| 19095 | let val = (self.0 >> 5usize) & 0x01; | ||
| 19096 | super::vals::C1Ahb2lpenrDcmilpen(val as u8) | ||
| 19097 | } | ||
| 19098 | #[doc = "HASH peripheral clock enable during CSleep mode"] | ||
| 19099 | pub fn set_hashlpen(&mut self, val: super::vals::C1Ahb2lpenrDcmilpen) { | ||
| 19100 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 19101 | } | ||
| 19102 | #[doc = "RNG peripheral clock enable during CSleep mode"] | ||
| 19103 | pub const fn rnglpen(&self) -> super::vals::C1Ahb2lpenrDcmilpen { | ||
| 19104 | let val = (self.0 >> 6usize) & 0x01; | ||
| 19105 | super::vals::C1Ahb2lpenrDcmilpen(val as u8) | ||
| 19106 | } | ||
| 19107 | #[doc = "RNG peripheral clock enable during CSleep mode"] | ||
| 19108 | pub fn set_rnglpen(&mut self, val: super::vals::C1Ahb2lpenrDcmilpen) { | ||
| 19109 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); | ||
| 19110 | } | ||
| 19111 | #[doc = "SDMMC2 and SDMMC2 Delay Clock Enable During CSleep Mode"] | ||
| 19112 | pub const fn sdmmc2lpen(&self) -> super::vals::C1Ahb2lpenrDcmilpen { | ||
| 19113 | let val = (self.0 >> 9usize) & 0x01; | ||
| 19114 | super::vals::C1Ahb2lpenrDcmilpen(val as u8) | ||
| 19115 | } | ||
| 19116 | #[doc = "SDMMC2 and SDMMC2 Delay Clock Enable During CSleep Mode"] | ||
| 19117 | pub fn set_sdmmc2lpen(&mut self, val: super::vals::C1Ahb2lpenrDcmilpen) { | ||
| 19118 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | ||
| 19119 | } | ||
| 19120 | #[doc = "SRAM1 Clock Enable During CSleep Mode"] | ||
| 19121 | pub const fn sram1lpen(&self) -> super::vals::C1Ahb2lpenrDcmilpen { | ||
| 19122 | let val = (self.0 >> 29usize) & 0x01; | ||
| 19123 | super::vals::C1Ahb2lpenrDcmilpen(val as u8) | ||
| 19124 | } | ||
| 19125 | #[doc = "SRAM1 Clock Enable During CSleep Mode"] | ||
| 19126 | pub fn set_sram1lpen(&mut self, val: super::vals::C1Ahb2lpenrDcmilpen) { | ||
| 19127 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); | ||
| 19128 | } | ||
| 19129 | #[doc = "SRAM2 Clock Enable During CSleep Mode"] | ||
| 19130 | pub const fn sram2lpen(&self) -> super::vals::C1Ahb2lpenrDcmilpen { | ||
| 19131 | let val = (self.0 >> 30usize) & 0x01; | ||
| 19132 | super::vals::C1Ahb2lpenrDcmilpen(val as u8) | ||
| 19133 | } | ||
| 19134 | #[doc = "SRAM2 Clock Enable During CSleep Mode"] | ||
| 19135 | pub fn set_sram2lpen(&mut self, val: super::vals::C1Ahb2lpenrDcmilpen) { | ||
| 19136 | self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize); | ||
| 19137 | } | ||
| 19138 | #[doc = "SRAM3 Clock Enable During CSleep Mode"] | ||
| 19139 | pub const fn sram3lpen(&self) -> super::vals::C1Ahb2lpenrDcmilpen { | ||
| 19140 | let val = (self.0 >> 31usize) & 0x01; | ||
| 19141 | super::vals::C1Ahb2lpenrDcmilpen(val as u8) | ||
| 19142 | } | ||
| 19143 | #[doc = "SRAM3 Clock Enable During CSleep Mode"] | ||
| 19144 | pub fn set_sram3lpen(&mut self, val: super::vals::C1Ahb2lpenrDcmilpen) { | ||
| 19145 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize); | ||
| 19146 | } | ||
| 13379 | } | 19147 | } |
| 13380 | #[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."] | 19148 | impl Default for C1Ahb2lpenr { |
| 13381 | pub fn fifor(self) -> Reg<regs::Fifor, RW> { | 19149 | fn default() -> C1Ahb2lpenr { |
| 13382 | unsafe { Reg::from_ptr(self.0.add(128usize)) } | 19150 | C1Ahb2lpenr(0) |
| 19151 | } | ||
| 13383 | } | 19152 | } |
| 13384 | #[doc = "SDMMC IP version register"] | 19153 | #[doc = "RCC PLL1 Dividers Configuration Register"] |
| 13385 | pub fn ver(self) -> Reg<regs::Ver, R> { | 19154 | #[repr(transparent)] |
| 13386 | unsafe { Reg::from_ptr(self.0.add(1012usize)) } | 19155 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 19156 | pub struct Pll1divr(pub u32); | ||
| 19157 | impl Pll1divr { | ||
| 19158 | #[doc = "Multiplication factor for PLL1 VCO"] | ||
| 19159 | pub const fn divn1(&self) -> u16 { | ||
| 19160 | let val = (self.0 >> 0usize) & 0x01ff; | ||
| 19161 | val as u16 | ||
| 19162 | } | ||
| 19163 | #[doc = "Multiplication factor for PLL1 VCO"] | ||
| 19164 | pub fn set_divn1(&mut self, val: u16) { | ||
| 19165 | self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize); | ||
| 19166 | } | ||
| 19167 | #[doc = "PLL1 DIVP division factor"] | ||
| 19168 | pub const fn divp1(&self) -> super::vals::Divp1 { | ||
| 19169 | let val = (self.0 >> 9usize) & 0x7f; | ||
| 19170 | super::vals::Divp1(val as u8) | ||
| 19171 | } | ||
| 19172 | #[doc = "PLL1 DIVP division factor"] | ||
| 19173 | pub fn set_divp1(&mut self, val: super::vals::Divp1) { | ||
| 19174 | self.0 = (self.0 & !(0x7f << 9usize)) | (((val.0 as u32) & 0x7f) << 9usize); | ||
| 19175 | } | ||
| 19176 | #[doc = "PLL1 DIVQ division factor"] | ||
| 19177 | pub const fn divq1(&self) -> u8 { | ||
| 19178 | let val = (self.0 >> 16usize) & 0x7f; | ||
| 19179 | val as u8 | ||
| 19180 | } | ||
| 19181 | #[doc = "PLL1 DIVQ division factor"] | ||
| 19182 | pub fn set_divq1(&mut self, val: u8) { | ||
| 19183 | self.0 = (self.0 & !(0x7f << 16usize)) | (((val as u32) & 0x7f) << 16usize); | ||
| 19184 | } | ||
| 19185 | #[doc = "PLL1 DIVR division factor"] | ||
| 19186 | pub const fn divr1(&self) -> u8 { | ||
| 19187 | let val = (self.0 >> 24usize) & 0x7f; | ||
| 19188 | val as u8 | ||
| 19189 | } | ||
| 19190 | #[doc = "PLL1 DIVR division factor"] | ||
| 19191 | pub fn set_divr1(&mut self, val: u8) { | ||
| 19192 | self.0 = (self.0 & !(0x7f << 24usize)) | (((val as u32) & 0x7f) << 24usize); | ||
| 19193 | } | ||
| 13387 | } | 19194 | } |
| 13388 | #[doc = "SDMMC IP identification register"] | 19195 | impl Default for Pll1divr { |
| 13389 | pub fn id(self) -> Reg<regs::Id, R> { | 19196 | fn default() -> Pll1divr { |
| 13390 | unsafe { Reg::from_ptr(self.0.add(1016usize)) } | 19197 | Pll1divr(0) |
| 19198 | } | ||
| 13391 | } | 19199 | } |
| 13392 | } | 19200 | #[doc = "RCC AHB3 Reset Register"] |
| 13393 | pub mod regs { | ||
| 13394 | use crate::generic::*; | ||
| 13395 | #[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."] | ||
| 13396 | #[repr(transparent)] | 19201 | #[repr(transparent)] |
| 13397 | #[derive(Copy, Clone, Eq, PartialEq)] | 19202 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 13398 | pub struct Idmactrlr(pub u32); | 19203 | pub struct Ahb3rstr(pub u32); |
| 13399 | impl Idmactrlr { | 19204 | impl Ahb3rstr { |
| 13400 | #[doc = "IDMA enable This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] | 19205 | #[doc = "MDMA block reset"] |
| 13401 | pub const fn idmaen(&self) -> bool { | 19206 | pub const fn mdmarst(&self) -> super::vals::Mdmarst { |
| 13402 | let val = (self.0 >> 0usize) & 0x01; | 19207 | let val = (self.0 >> 0usize) & 0x01; |
| 13403 | val != 0 | 19208 | super::vals::Mdmarst(val as u8) |
| 13404 | } | 19209 | } |
| 13405 | #[doc = "IDMA enable This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] | 19210 | #[doc = "MDMA block reset"] |
| 13406 | pub fn set_idmaen(&mut self, val: bool) { | 19211 | pub fn set_mdmarst(&mut self, val: super::vals::Mdmarst) { |
| 13407 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 19212 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 13408 | } | 19213 | } |
| 13409 | #[doc = "Buffer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] | 19214 | #[doc = "DMA2D block reset"] |
| 13410 | pub const fn idmabmode(&self) -> bool { | 19215 | pub const fn dma2drst(&self) -> super::vals::Mdmarst { |
| 19216 | let val = (self.0 >> 4usize) & 0x01; | ||
| 19217 | super::vals::Mdmarst(val as u8) | ||
| 19218 | } | ||
| 19219 | #[doc = "DMA2D block reset"] | ||
| 19220 | pub fn set_dma2drst(&mut self, val: super::vals::Mdmarst) { | ||
| 19221 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 19222 | } | ||
| 19223 | #[doc = "JPGDEC block reset"] | ||
| 19224 | pub const fn jpgdecrst(&self) -> super::vals::Mdmarst { | ||
| 19225 | let val = (self.0 >> 5usize) & 0x01; | ||
| 19226 | super::vals::Mdmarst(val as u8) | ||
| 19227 | } | ||
| 19228 | #[doc = "JPGDEC block reset"] | ||
| 19229 | pub fn set_jpgdecrst(&mut self, val: super::vals::Mdmarst) { | ||
| 19230 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 19231 | } | ||
| 19232 | #[doc = "FMC block reset"] | ||
| 19233 | pub const fn fmcrst(&self) -> super::vals::Mdmarst { | ||
| 19234 | let val = (self.0 >> 12usize) & 0x01; | ||
| 19235 | super::vals::Mdmarst(val as u8) | ||
| 19236 | } | ||
| 19237 | #[doc = "FMC block reset"] | ||
| 19238 | pub fn set_fmcrst(&mut self, val: super::vals::Mdmarst) { | ||
| 19239 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 19240 | } | ||
| 19241 | #[doc = "QUADSPI and QUADSPI delay block reset"] | ||
| 19242 | pub const fn qspirst(&self) -> super::vals::Mdmarst { | ||
| 19243 | let val = (self.0 >> 14usize) & 0x01; | ||
| 19244 | super::vals::Mdmarst(val as u8) | ||
| 19245 | } | ||
| 19246 | #[doc = "QUADSPI and QUADSPI delay block reset"] | ||
| 19247 | pub fn set_qspirst(&mut self, val: super::vals::Mdmarst) { | ||
| 19248 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | ||
| 19249 | } | ||
| 19250 | #[doc = "SDMMC1 and SDMMC1 delay block reset"] | ||
| 19251 | pub const fn sdmmc1rst(&self) -> super::vals::Mdmarst { | ||
| 19252 | let val = (self.0 >> 16usize) & 0x01; | ||
| 19253 | super::vals::Mdmarst(val as u8) | ||
| 19254 | } | ||
| 19255 | #[doc = "SDMMC1 and SDMMC1 delay block reset"] | ||
| 19256 | pub fn set_sdmmc1rst(&mut self, val: super::vals::Mdmarst) { | ||
| 19257 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 19258 | } | ||
| 19259 | #[doc = "CPU reset"] | ||
| 19260 | pub const fn cpurst(&self) -> super::vals::Mdmarst { | ||
| 19261 | let val = (self.0 >> 31usize) & 0x01; | ||
| 19262 | super::vals::Mdmarst(val as u8) | ||
| 19263 | } | ||
| 19264 | #[doc = "CPU reset"] | ||
| 19265 | pub fn set_cpurst(&mut self, val: super::vals::Mdmarst) { | ||
| 19266 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize); | ||
| 19267 | } | ||
| 19268 | } | ||
| 19269 | impl Default for Ahb3rstr { | ||
| 19270 | fn default() -> Ahb3rstr { | ||
| 19271 | Ahb3rstr(0) | ||
| 19272 | } | ||
| 19273 | } | ||
| 19274 | #[doc = "RCC PLL2 Dividers Configuration Register"] | ||
| 19275 | #[repr(transparent)] | ||
| 19276 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 19277 | pub struct Pll2divr(pub u32); | ||
| 19278 | impl Pll2divr { | ||
| 19279 | #[doc = "Multiplication factor for PLL1 VCO"] | ||
| 19280 | pub const fn divn2(&self) -> u16 { | ||
| 19281 | let val = (self.0 >> 0usize) & 0x01ff; | ||
| 19282 | val as u16 | ||
| 19283 | } | ||
| 19284 | #[doc = "Multiplication factor for PLL1 VCO"] | ||
| 19285 | pub fn set_divn2(&mut self, val: u16) { | ||
| 19286 | self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize); | ||
| 19287 | } | ||
| 19288 | #[doc = "PLL1 DIVP division factor"] | ||
| 19289 | pub const fn divp2(&self) -> u8 { | ||
| 19290 | let val = (self.0 >> 9usize) & 0x7f; | ||
| 19291 | val as u8 | ||
| 19292 | } | ||
| 19293 | #[doc = "PLL1 DIVP division factor"] | ||
| 19294 | pub fn set_divp2(&mut self, val: u8) { | ||
| 19295 | self.0 = (self.0 & !(0x7f << 9usize)) | (((val as u32) & 0x7f) << 9usize); | ||
| 19296 | } | ||
| 19297 | #[doc = "PLL1 DIVQ division factor"] | ||
| 19298 | pub const fn divq2(&self) -> u8 { | ||
| 19299 | let val = (self.0 >> 16usize) & 0x7f; | ||
| 19300 | val as u8 | ||
| 19301 | } | ||
| 19302 | #[doc = "PLL1 DIVQ division factor"] | ||
| 19303 | pub fn set_divq2(&mut self, val: u8) { | ||
| 19304 | self.0 = (self.0 & !(0x7f << 16usize)) | (((val as u32) & 0x7f) << 16usize); | ||
| 19305 | } | ||
| 19306 | #[doc = "PLL1 DIVR division factor"] | ||
| 19307 | pub const fn divr2(&self) -> u8 { | ||
| 19308 | let val = (self.0 >> 24usize) & 0x7f; | ||
| 19309 | val as u8 | ||
| 19310 | } | ||
| 19311 | #[doc = "PLL1 DIVR division factor"] | ||
| 19312 | pub fn set_divr2(&mut self, val: u8) { | ||
| 19313 | self.0 = (self.0 & !(0x7f << 24usize)) | (((val as u32) & 0x7f) << 24usize); | ||
| 19314 | } | ||
| 19315 | } | ||
| 19316 | impl Default for Pll2divr { | ||
| 19317 | fn default() -> Pll2divr { | ||
| 19318 | Pll2divr(0) | ||
| 19319 | } | ||
| 19320 | } | ||
| 19321 | #[doc = "RCC Domain 3 Kernel Clock Configuration Register"] | ||
| 19322 | #[repr(transparent)] | ||
| 19323 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 19324 | pub struct D3ccipr(pub u32); | ||
| 19325 | impl D3ccipr { | ||
| 19326 | #[doc = "LPUART1 kernel clock source selection"] | ||
| 19327 | pub const fn lpuart1sel(&self) -> super::vals::Lpuart1sel { | ||
| 19328 | let val = (self.0 >> 0usize) & 0x07; | ||
| 19329 | super::vals::Lpuart1sel(val as u8) | ||
| 19330 | } | ||
| 19331 | #[doc = "LPUART1 kernel clock source selection"] | ||
| 19332 | pub fn set_lpuart1sel(&mut self, val: super::vals::Lpuart1sel) { | ||
| 19333 | self.0 = (self.0 & !(0x07 << 0usize)) | (((val.0 as u32) & 0x07) << 0usize); | ||
| 19334 | } | ||
| 19335 | #[doc = "I2C4 kernel clock source selection"] | ||
| 19336 | pub const fn i2c4sel(&self) -> super::vals::I2c4sel { | ||
| 19337 | let val = (self.0 >> 8usize) & 0x03; | ||
| 19338 | super::vals::I2c4sel(val as u8) | ||
| 19339 | } | ||
| 19340 | #[doc = "I2C4 kernel clock source selection"] | ||
| 19341 | pub fn set_i2c4sel(&mut self, val: super::vals::I2c4sel) { | ||
| 19342 | self.0 = (self.0 & !(0x03 << 8usize)) | (((val.0 as u32) & 0x03) << 8usize); | ||
| 19343 | } | ||
| 19344 | #[doc = "LPTIM2 kernel clock source selection"] | ||
| 19345 | pub const fn lptim2sel(&self) -> super::vals::Lptim2sel { | ||
| 19346 | let val = (self.0 >> 10usize) & 0x07; | ||
| 19347 | super::vals::Lptim2sel(val as u8) | ||
| 19348 | } | ||
| 19349 | #[doc = "LPTIM2 kernel clock source selection"] | ||
| 19350 | pub fn set_lptim2sel(&mut self, val: super::vals::Lptim2sel) { | ||
| 19351 | self.0 = (self.0 & !(0x07 << 10usize)) | (((val.0 as u32) & 0x07) << 10usize); | ||
| 19352 | } | ||
| 19353 | #[doc = "LPTIM3,4,5 kernel clock source selection"] | ||
| 19354 | pub const fn lptim345sel(&self) -> super::vals::Lptim2sel { | ||
| 19355 | let val = (self.0 >> 13usize) & 0x07; | ||
| 19356 | super::vals::Lptim2sel(val as u8) | ||
| 19357 | } | ||
| 19358 | #[doc = "LPTIM3,4,5 kernel clock source selection"] | ||
| 19359 | pub fn set_lptim345sel(&mut self, val: super::vals::Lptim2sel) { | ||
| 19360 | self.0 = (self.0 & !(0x07 << 13usize)) | (((val.0 as u32) & 0x07) << 13usize); | ||
| 19361 | } | ||
| 19362 | #[doc = "SAR ADC kernel clock source selection"] | ||
| 19363 | pub const fn adcsel(&self) -> super::vals::Adcsel { | ||
| 19364 | let val = (self.0 >> 16usize) & 0x03; | ||
| 19365 | super::vals::Adcsel(val as u8) | ||
| 19366 | } | ||
| 19367 | #[doc = "SAR ADC kernel clock source selection"] | ||
| 19368 | pub fn set_adcsel(&mut self, val: super::vals::Adcsel) { | ||
| 19369 | self.0 = (self.0 & !(0x03 << 16usize)) | (((val.0 as u32) & 0x03) << 16usize); | ||
| 19370 | } | ||
| 19371 | #[doc = "Sub-Block A of SAI4 kernel clock source selection"] | ||
| 19372 | pub const fn sai4asel(&self) -> super::vals::Sai4asel { | ||
| 19373 | let val = (self.0 >> 21usize) & 0x07; | ||
| 19374 | super::vals::Sai4asel(val as u8) | ||
| 19375 | } | ||
| 19376 | #[doc = "Sub-Block A of SAI4 kernel clock source selection"] | ||
| 19377 | pub fn set_sai4asel(&mut self, val: super::vals::Sai4asel) { | ||
| 19378 | self.0 = (self.0 & !(0x07 << 21usize)) | (((val.0 as u32) & 0x07) << 21usize); | ||
| 19379 | } | ||
| 19380 | #[doc = "Sub-Block B of SAI4 kernel clock source selection"] | ||
| 19381 | pub const fn sai4bsel(&self) -> super::vals::Sai4asel { | ||
| 19382 | let val = (self.0 >> 24usize) & 0x07; | ||
| 19383 | super::vals::Sai4asel(val as u8) | ||
| 19384 | } | ||
| 19385 | #[doc = "Sub-Block B of SAI4 kernel clock source selection"] | ||
| 19386 | pub fn set_sai4bsel(&mut self, val: super::vals::Sai4asel) { | ||
| 19387 | self.0 = (self.0 & !(0x07 << 24usize)) | (((val.0 as u32) & 0x07) << 24usize); | ||
| 19388 | } | ||
| 19389 | #[doc = "SPI6 kernel clock source selection"] | ||
| 19390 | pub const fn spi6sel(&self) -> super::vals::Spi6sel { | ||
| 19391 | let val = (self.0 >> 28usize) & 0x07; | ||
| 19392 | super::vals::Spi6sel(val as u8) | ||
| 19393 | } | ||
| 19394 | #[doc = "SPI6 kernel clock source selection"] | ||
| 19395 | pub fn set_spi6sel(&mut self, val: super::vals::Spi6sel) { | ||
| 19396 | self.0 = (self.0 & !(0x07 << 28usize)) | (((val.0 as u32) & 0x07) << 28usize); | ||
| 19397 | } | ||
| 19398 | } | ||
| 19399 | impl Default for D3ccipr { | ||
| 19400 | fn default() -> D3ccipr { | ||
| 19401 | D3ccipr(0) | ||
| 19402 | } | ||
| 19403 | } | ||
| 19404 | #[doc = "RCC APB1 Peripheral Reset Register"] | ||
| 19405 | #[repr(transparent)] | ||
| 19406 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 19407 | pub struct Apb1hrstr(pub u32); | ||
| 19408 | impl Apb1hrstr { | ||
| 19409 | #[doc = "Clock Recovery System reset"] | ||
| 19410 | pub const fn crsrst(&self) -> super::vals::Crsrst { | ||
| 13411 | let val = (self.0 >> 1usize) & 0x01; | 19411 | let val = (self.0 >> 1usize) & 0x01; |
| 13412 | val != 0 | 19412 | super::vals::Crsrst(val as u8) |
| 13413 | } | 19413 | } |
| 13414 | #[doc = "Buffer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] | 19414 | #[doc = "Clock Recovery System reset"] |
| 13415 | pub fn set_idmabmode(&mut self, val: bool) { | 19415 | pub fn set_crsrst(&mut self, val: super::vals::Crsrst) { |
| 13416 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 19416 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); |
| 13417 | } | 19417 | } |
| 13418 | #[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."] | 19418 | #[doc = "SWPMI block reset"] |
| 13419 | pub const fn idmabact(&self) -> bool { | 19419 | pub const fn swprst(&self) -> super::vals::Crsrst { |
| 13420 | let val = (self.0 >> 2usize) & 0x01; | 19420 | let val = (self.0 >> 2usize) & 0x01; |
| 13421 | val != 0 | 19421 | super::vals::Crsrst(val as u8) |
| 13422 | } | 19422 | } |
| 13423 | #[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."] | 19423 | #[doc = "SWPMI block reset"] |
| 13424 | pub fn set_idmabact(&mut self, val: bool) { | 19424 | pub fn set_swprst(&mut self, val: super::vals::Crsrst) { |
| 13425 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 19425 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); |
| 19426 | } | ||
| 19427 | #[doc = "OPAMP block reset"] | ||
| 19428 | pub const fn opamprst(&self) -> super::vals::Crsrst { | ||
| 19429 | let val = (self.0 >> 4usize) & 0x01; | ||
| 19430 | super::vals::Crsrst(val as u8) | ||
| 19431 | } | ||
| 19432 | #[doc = "OPAMP block reset"] | ||
| 19433 | pub fn set_opamprst(&mut self, val: super::vals::Crsrst) { | ||
| 19434 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 19435 | } | ||
| 19436 | #[doc = "MDIOS block reset"] | ||
| 19437 | pub const fn mdiosrst(&self) -> super::vals::Crsrst { | ||
| 19438 | let val = (self.0 >> 5usize) & 0x01; | ||
| 19439 | super::vals::Crsrst(val as u8) | ||
| 19440 | } | ||
| 19441 | #[doc = "MDIOS block reset"] | ||
| 19442 | pub fn set_mdiosrst(&mut self, val: super::vals::Crsrst) { | ||
| 19443 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 19444 | } | ||
| 19445 | #[doc = "FDCAN block reset"] | ||
| 19446 | pub const fn fdcanrst(&self) -> super::vals::Crsrst { | ||
| 19447 | let val = (self.0 >> 8usize) & 0x01; | ||
| 19448 | super::vals::Crsrst(val as u8) | ||
| 19449 | } | ||
| 19450 | #[doc = "FDCAN block reset"] | ||
| 19451 | pub fn set_fdcanrst(&mut self, val: super::vals::Crsrst) { | ||
| 19452 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); | ||
| 13426 | } | 19453 | } |
| 13427 | } | 19454 | } |
| 13428 | impl Default for Idmactrlr { | 19455 | impl Default for Apb1hrstr { |
| 13429 | fn default() -> Idmactrlr { | 19456 | fn default() -> Apb1hrstr { |
| 13430 | Idmactrlr(0) | 19457 | Apb1hrstr(0) |
| 13431 | } | 19458 | } |
| 13432 | } | 19459 | } |
| 13433 | #[doc = "SDMMC command response register"] | 19460 | #[doc = "RCC Domain 2 Clock Configuration Register"] |
| 13434 | #[repr(transparent)] | 19461 | #[repr(transparent)] |
| 13435 | #[derive(Copy, Clone, Eq, PartialEq)] | 19462 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 13436 | pub struct Respcmdr(pub u32); | 19463 | pub struct D2cfgr(pub u32); |
| 13437 | impl Respcmdr { | 19464 | impl D2cfgr { |
| 13438 | #[doc = "Response command index"] | 19465 | #[doc = "D2 domain APB1 prescaler"] |
| 13439 | pub const fn respcmd(&self) -> u8 { | 19466 | pub const fn d2ppre1(&self) -> super::vals::D2ppre1 { |
| 13440 | let val = (self.0 >> 0usize) & 0x3f; | 19467 | let val = (self.0 >> 4usize) & 0x07; |
| 13441 | val as u8 | 19468 | super::vals::D2ppre1(val as u8) |
| 13442 | } | 19469 | } |
| 13443 | #[doc = "Response command index"] | 19470 | #[doc = "D2 domain APB1 prescaler"] |
| 13444 | pub fn set_respcmd(&mut self, val: u8) { | 19471 | pub fn set_d2ppre1(&mut self, val: super::vals::D2ppre1) { |
| 13445 | self.0 = (self.0 & !(0x3f << 0usize)) | (((val as u32) & 0x3f) << 0usize); | 19472 | self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize); |
| 19473 | } | ||
| 19474 | #[doc = "D2 domain APB2 prescaler"] | ||
| 19475 | pub const fn d2ppre2(&self) -> super::vals::D2ppre1 { | ||
| 19476 | let val = (self.0 >> 8usize) & 0x07; | ||
| 19477 | super::vals::D2ppre1(val as u8) | ||
| 19478 | } | ||
| 19479 | #[doc = "D2 domain APB2 prescaler"] | ||
| 19480 | pub fn set_d2ppre2(&mut self, val: super::vals::D2ppre1) { | ||
| 19481 | self.0 = (self.0 & !(0x07 << 8usize)) | (((val.0 as u32) & 0x07) << 8usize); | ||
| 13446 | } | 19482 | } |
| 13447 | } | 19483 | } |
| 13448 | impl Default for Respcmdr { | 19484 | impl Default for D2cfgr { |
| 13449 | fn default() -> Respcmdr { | 19485 | fn default() -> D2cfgr { |
| 13450 | Respcmdr(0) | 19486 | D2cfgr(0) |
| 13451 | } | 19487 | } |
| 13452 | } | 19488 | } |
| 13453 | #[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."] | 19489 | #[doc = "RCC APB1 Low Sleep Clock Register"] |
| 13454 | #[repr(transparent)] | 19490 | #[repr(transparent)] |
| 13455 | #[derive(Copy, Clone, Eq, PartialEq)] | 19491 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 13456 | pub struct Fifor(pub u32); | 19492 | pub struct Apb1llpenr(pub u32); |
| 13457 | impl Fifor { | 19493 | impl Apb1llpenr { |
| 13458 | #[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."] | 19494 | #[doc = "TIM2 peripheral clock enable during CSleep mode"] |
| 13459 | pub const fn fifodata(&self) -> u32 { | 19495 | pub const fn tim2lpen(&self) -> super::vals::Apb1llpenrTim2lpen { |
| 13460 | let val = (self.0 >> 0usize) & 0xffff_ffff; | 19496 | let val = (self.0 >> 0usize) & 0x01; |
| 13461 | val as u32 | 19497 | super::vals::Apb1llpenrTim2lpen(val as u8) |
| 13462 | } | 19498 | } |
| 13463 | #[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."] | 19499 | #[doc = "TIM2 peripheral clock enable during CSleep mode"] |
| 13464 | pub fn set_fifodata(&mut self, val: u32) { | 19500 | pub fn set_tim2lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) { |
| 13465 | self.0 = | 19501 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 13466 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | 19502 | } |
| 19503 | #[doc = "TIM3 peripheral clock enable during CSleep mode"] | ||
| 19504 | pub const fn tim3lpen(&self) -> super::vals::Apb1llpenrTim2lpen { | ||
| 19505 | let val = (self.0 >> 1usize) & 0x01; | ||
| 19506 | super::vals::Apb1llpenrTim2lpen(val as u8) | ||
| 19507 | } | ||
| 19508 | #[doc = "TIM3 peripheral clock enable during CSleep mode"] | ||
| 19509 | pub fn set_tim3lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) { | ||
| 19510 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 19511 | } | ||
| 19512 | #[doc = "TIM4 peripheral clock enable during CSleep mode"] | ||
| 19513 | pub const fn tim4lpen(&self) -> super::vals::Apb1llpenrTim2lpen { | ||
| 19514 | let val = (self.0 >> 2usize) & 0x01; | ||
| 19515 | super::vals::Apb1llpenrTim2lpen(val as u8) | ||
| 19516 | } | ||
| 19517 | #[doc = "TIM4 peripheral clock enable during CSleep mode"] | ||
| 19518 | pub fn set_tim4lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) { | ||
| 19519 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 19520 | } | ||
| 19521 | #[doc = "TIM5 peripheral clock enable during CSleep mode"] | ||
| 19522 | pub const fn tim5lpen(&self) -> super::vals::Apb1llpenrTim2lpen { | ||
| 19523 | let val = (self.0 >> 3usize) & 0x01; | ||
| 19524 | super::vals::Apb1llpenrTim2lpen(val as u8) | ||
| 19525 | } | ||
| 19526 | #[doc = "TIM5 peripheral clock enable during CSleep mode"] | ||
| 19527 | pub fn set_tim5lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) { | ||
| 19528 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 19529 | } | ||
| 19530 | #[doc = "TIM6 peripheral clock enable during CSleep mode"] | ||
| 19531 | pub const fn tim6lpen(&self) -> super::vals::Apb1llpenrTim2lpen { | ||
| 19532 | let val = (self.0 >> 4usize) & 0x01; | ||
| 19533 | super::vals::Apb1llpenrTim2lpen(val as u8) | ||
| 19534 | } | ||
| 19535 | #[doc = "TIM6 peripheral clock enable during CSleep mode"] | ||
| 19536 | pub fn set_tim6lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) { | ||
| 19537 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 19538 | } | ||
| 19539 | #[doc = "TIM7 peripheral clock enable during CSleep mode"] | ||
| 19540 | pub const fn tim7lpen(&self) -> super::vals::Apb1llpenrTim2lpen { | ||
| 19541 | let val = (self.0 >> 5usize) & 0x01; | ||
| 19542 | super::vals::Apb1llpenrTim2lpen(val as u8) | ||
| 19543 | } | ||
| 19544 | #[doc = "TIM7 peripheral clock enable during CSleep mode"] | ||
| 19545 | pub fn set_tim7lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) { | ||
| 19546 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 19547 | } | ||
| 19548 | #[doc = "TIM12 peripheral clock enable during CSleep mode"] | ||
| 19549 | pub const fn tim12lpen(&self) -> super::vals::Apb1llpenrTim2lpen { | ||
| 19550 | let val = (self.0 >> 6usize) & 0x01; | ||
| 19551 | super::vals::Apb1llpenrTim2lpen(val as u8) | ||
| 19552 | } | ||
| 19553 | #[doc = "TIM12 peripheral clock enable during CSleep mode"] | ||
| 19554 | pub fn set_tim12lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) { | ||
| 19555 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); | ||
| 19556 | } | ||
| 19557 | #[doc = "TIM13 peripheral clock enable during CSleep mode"] | ||
| 19558 | pub const fn tim13lpen(&self) -> super::vals::Apb1llpenrTim2lpen { | ||
| 19559 | let val = (self.0 >> 7usize) & 0x01; | ||
| 19560 | super::vals::Apb1llpenrTim2lpen(val as u8) | ||
| 19561 | } | ||
| 19562 | #[doc = "TIM13 peripheral clock enable during CSleep mode"] | ||
| 19563 | pub fn set_tim13lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) { | ||
| 19564 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 19565 | } | ||
| 19566 | #[doc = "TIM14 peripheral clock enable during CSleep mode"] | ||
| 19567 | pub const fn tim14lpen(&self) -> super::vals::Apb1llpenrTim2lpen { | ||
| 19568 | let val = (self.0 >> 8usize) & 0x01; | ||
| 19569 | super::vals::Apb1llpenrTim2lpen(val as u8) | ||
| 19570 | } | ||
| 19571 | #[doc = "TIM14 peripheral clock enable during CSleep mode"] | ||
| 19572 | pub fn set_tim14lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) { | ||
| 19573 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); | ||
| 19574 | } | ||
| 19575 | #[doc = "LPTIM1 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19576 | pub const fn lptim1lpen(&self) -> super::vals::Apb1llpenrTim2lpen { | ||
| 19577 | let val = (self.0 >> 9usize) & 0x01; | ||
| 19578 | super::vals::Apb1llpenrTim2lpen(val as u8) | ||
| 19579 | } | ||
| 19580 | #[doc = "LPTIM1 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19581 | pub fn set_lptim1lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) { | ||
| 19582 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | ||
| 19583 | } | ||
| 19584 | #[doc = "SPI2 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19585 | pub const fn spi2lpen(&self) -> super::vals::Apb1llpenrTim2lpen { | ||
| 19586 | let val = (self.0 >> 14usize) & 0x01; | ||
| 19587 | super::vals::Apb1llpenrTim2lpen(val as u8) | ||
| 19588 | } | ||
| 19589 | #[doc = "SPI2 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19590 | pub fn set_spi2lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) { | ||
| 19591 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | ||
| 19592 | } | ||
| 19593 | #[doc = "SPI3 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19594 | pub const fn spi3lpen(&self) -> super::vals::Apb1llpenrTim2lpen { | ||
| 19595 | let val = (self.0 >> 15usize) & 0x01; | ||
| 19596 | super::vals::Apb1llpenrTim2lpen(val as u8) | ||
| 19597 | } | ||
| 19598 | #[doc = "SPI3 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19599 | pub fn set_spi3lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) { | ||
| 19600 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 19601 | } | ||
| 19602 | #[doc = "SPDIFRX Peripheral Clocks Enable During CSleep Mode"] | ||
| 19603 | pub const fn spdifrxlpen(&self) -> super::vals::Apb1llpenrTim2lpen { | ||
| 19604 | let val = (self.0 >> 16usize) & 0x01; | ||
| 19605 | super::vals::Apb1llpenrTim2lpen(val as u8) | ||
| 19606 | } | ||
| 19607 | #[doc = "SPDIFRX Peripheral Clocks Enable During CSleep Mode"] | ||
| 19608 | pub fn set_spdifrxlpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) { | ||
| 19609 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 19610 | } | ||
| 19611 | #[doc = "USART2 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19612 | pub const fn usart2lpen(&self) -> super::vals::Apb1llpenrTim2lpen { | ||
| 19613 | let val = (self.0 >> 17usize) & 0x01; | ||
| 19614 | super::vals::Apb1llpenrTim2lpen(val as u8) | ||
| 19615 | } | ||
| 19616 | #[doc = "USART2 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19617 | pub fn set_usart2lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) { | ||
| 19618 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize); | ||
| 19619 | } | ||
| 19620 | #[doc = "USART3 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19621 | pub const fn usart3lpen(&self) -> super::vals::Apb1llpenrTim2lpen { | ||
| 19622 | let val = (self.0 >> 18usize) & 0x01; | ||
| 19623 | super::vals::Apb1llpenrTim2lpen(val as u8) | ||
| 19624 | } | ||
| 19625 | #[doc = "USART3 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19626 | pub fn set_usart3lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) { | ||
| 19627 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize); | ||
| 19628 | } | ||
| 19629 | #[doc = "UART4 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19630 | pub const fn uart4lpen(&self) -> super::vals::Apb1llpenrTim2lpen { | ||
| 19631 | let val = (self.0 >> 19usize) & 0x01; | ||
| 19632 | super::vals::Apb1llpenrTim2lpen(val as u8) | ||
| 19633 | } | ||
| 19634 | #[doc = "UART4 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19635 | pub fn set_uart4lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) { | ||
| 19636 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); | ||
| 19637 | } | ||
| 19638 | #[doc = "UART5 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19639 | pub const fn uart5lpen(&self) -> super::vals::Apb1llpenrTim2lpen { | ||
| 19640 | let val = (self.0 >> 20usize) & 0x01; | ||
| 19641 | super::vals::Apb1llpenrTim2lpen(val as u8) | ||
| 19642 | } | ||
| 19643 | #[doc = "UART5 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19644 | pub fn set_uart5lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) { | ||
| 19645 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize); | ||
| 19646 | } | ||
| 19647 | #[doc = "I2C1 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19648 | pub const fn i2c1lpen(&self) -> super::vals::Apb1llpenrTim2lpen { | ||
| 19649 | let val = (self.0 >> 21usize) & 0x01; | ||
| 19650 | super::vals::Apb1llpenrTim2lpen(val as u8) | ||
| 19651 | } | ||
| 19652 | #[doc = "I2C1 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19653 | pub fn set_i2c1lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) { | ||
| 19654 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize); | ||
| 19655 | } | ||
| 19656 | #[doc = "I2C2 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19657 | pub const fn i2c2lpen(&self) -> super::vals::Apb1llpenrTim2lpen { | ||
| 19658 | let val = (self.0 >> 22usize) & 0x01; | ||
| 19659 | super::vals::Apb1llpenrTim2lpen(val as u8) | ||
| 19660 | } | ||
| 19661 | #[doc = "I2C2 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19662 | pub fn set_i2c2lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) { | ||
| 19663 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize); | ||
| 19664 | } | ||
| 19665 | #[doc = "I2C3 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19666 | pub const fn i2c3lpen(&self) -> super::vals::Apb1llpenrTim2lpen { | ||
| 19667 | let val = (self.0 >> 23usize) & 0x01; | ||
| 19668 | super::vals::Apb1llpenrTim2lpen(val as u8) | ||
| 19669 | } | ||
| 19670 | #[doc = "I2C3 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19671 | pub fn set_i2c3lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) { | ||
| 19672 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize); | ||
| 19673 | } | ||
| 19674 | #[doc = "HDMI-CEC Peripheral Clocks Enable During CSleep Mode"] | ||
| 19675 | pub const fn ceclpen(&self) -> super::vals::Apb1llpenrTim2lpen { | ||
| 19676 | let val = (self.0 >> 27usize) & 0x01; | ||
| 19677 | super::vals::Apb1llpenrTim2lpen(val as u8) | ||
| 19678 | } | ||
| 19679 | #[doc = "HDMI-CEC Peripheral Clocks Enable During CSleep Mode"] | ||
| 19680 | pub fn set_ceclpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) { | ||
| 19681 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize); | ||
| 19682 | } | ||
| 19683 | #[doc = "DAC1/2 peripheral clock enable during CSleep mode"] | ||
| 19684 | pub const fn dac12lpen(&self) -> super::vals::Apb1llpenrTim2lpen { | ||
| 19685 | let val = (self.0 >> 29usize) & 0x01; | ||
| 19686 | super::vals::Apb1llpenrTim2lpen(val as u8) | ||
| 19687 | } | ||
| 19688 | #[doc = "DAC1/2 peripheral clock enable during CSleep mode"] | ||
| 19689 | pub fn set_dac12lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) { | ||
| 19690 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); | ||
| 19691 | } | ||
| 19692 | #[doc = "UART7 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19693 | pub const fn uart7lpen(&self) -> super::vals::Apb1llpenrTim2lpen { | ||
| 19694 | let val = (self.0 >> 30usize) & 0x01; | ||
| 19695 | super::vals::Apb1llpenrTim2lpen(val as u8) | ||
| 19696 | } | ||
| 19697 | #[doc = "UART7 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19698 | pub fn set_uart7lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) { | ||
| 19699 | self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize); | ||
| 19700 | } | ||
| 19701 | #[doc = "UART8 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19702 | pub const fn uart8lpen(&self) -> super::vals::Apb1llpenrTim2lpen { | ||
| 19703 | let val = (self.0 >> 31usize) & 0x01; | ||
| 19704 | super::vals::Apb1llpenrTim2lpen(val as u8) | ||
| 19705 | } | ||
| 19706 | #[doc = "UART8 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19707 | pub fn set_uart8lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) { | ||
| 19708 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize); | ||
| 13467 | } | 19709 | } |
| 13468 | } | 19710 | } |
| 13469 | impl Default for Fifor { | 19711 | impl Default for Apb1llpenr { |
| 13470 | fn default() -> Fifor { | 19712 | fn default() -> Apb1llpenr { |
| 13471 | Fifor(0) | 19713 | Apb1llpenr(0) |
| 13472 | } | 19714 | } |
| 13473 | } | 19715 | } |
| 13474 | #[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."] | 19716 | #[doc = "RCC AHB4 Peripheral Reset Register"] |
| 13475 | #[repr(transparent)] | 19717 | #[repr(transparent)] |
| 13476 | #[derive(Copy, Clone, Eq, PartialEq)] | 19718 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 13477 | pub struct Icr(pub u32); | 19719 | pub struct Ahb4rstr(pub u32); |
| 13478 | impl Icr { | 19720 | impl Ahb4rstr { |
| 13479 | #[doc = "CCRCFAIL flag clear bit Set by software to clear the CCRCFAIL flag."] | 19721 | #[doc = "GPIO block reset"] |
| 13480 | pub const fn ccrcfailc(&self) -> bool { | 19722 | pub const fn gpioarst(&self) -> super::vals::Gpioarst { |
| 19723 | let val = (self.0 >> 0usize) & 0x01; | ||
| 19724 | super::vals::Gpioarst(val as u8) | ||
| 19725 | } | ||
| 19726 | #[doc = "GPIO block reset"] | ||
| 19727 | pub fn set_gpioarst(&mut self, val: super::vals::Gpioarst) { | ||
| 19728 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 19729 | } | ||
| 19730 | #[doc = "GPIO block reset"] | ||
| 19731 | pub const fn gpiobrst(&self) -> super::vals::Gpioarst { | ||
| 19732 | let val = (self.0 >> 1usize) & 0x01; | ||
| 19733 | super::vals::Gpioarst(val as u8) | ||
| 19734 | } | ||
| 19735 | #[doc = "GPIO block reset"] | ||
| 19736 | pub fn set_gpiobrst(&mut self, val: super::vals::Gpioarst) { | ||
| 19737 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 19738 | } | ||
| 19739 | #[doc = "GPIO block reset"] | ||
| 19740 | pub const fn gpiocrst(&self) -> super::vals::Gpioarst { | ||
| 19741 | let val = (self.0 >> 2usize) & 0x01; | ||
| 19742 | super::vals::Gpioarst(val as u8) | ||
| 19743 | } | ||
| 19744 | #[doc = "GPIO block reset"] | ||
| 19745 | pub fn set_gpiocrst(&mut self, val: super::vals::Gpioarst) { | ||
| 19746 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 19747 | } | ||
| 19748 | #[doc = "GPIO block reset"] | ||
| 19749 | pub const fn gpiodrst(&self) -> super::vals::Gpioarst { | ||
| 19750 | let val = (self.0 >> 3usize) & 0x01; | ||
| 19751 | super::vals::Gpioarst(val as u8) | ||
| 19752 | } | ||
| 19753 | #[doc = "GPIO block reset"] | ||
| 19754 | pub fn set_gpiodrst(&mut self, val: super::vals::Gpioarst) { | ||
| 19755 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 19756 | } | ||
| 19757 | #[doc = "GPIO block reset"] | ||
| 19758 | pub const fn gpioerst(&self) -> super::vals::Gpioarst { | ||
| 19759 | let val = (self.0 >> 4usize) & 0x01; | ||
| 19760 | super::vals::Gpioarst(val as u8) | ||
| 19761 | } | ||
| 19762 | #[doc = "GPIO block reset"] | ||
| 19763 | pub fn set_gpioerst(&mut self, val: super::vals::Gpioarst) { | ||
| 19764 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 19765 | } | ||
| 19766 | #[doc = "GPIO block reset"] | ||
| 19767 | pub const fn gpiofrst(&self) -> super::vals::Gpioarst { | ||
| 19768 | let val = (self.0 >> 5usize) & 0x01; | ||
| 19769 | super::vals::Gpioarst(val as u8) | ||
| 19770 | } | ||
| 19771 | #[doc = "GPIO block reset"] | ||
| 19772 | pub fn set_gpiofrst(&mut self, val: super::vals::Gpioarst) { | ||
| 19773 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 19774 | } | ||
| 19775 | #[doc = "GPIO block reset"] | ||
| 19776 | pub const fn gpiogrst(&self) -> super::vals::Gpioarst { | ||
| 19777 | let val = (self.0 >> 6usize) & 0x01; | ||
| 19778 | super::vals::Gpioarst(val as u8) | ||
| 19779 | } | ||
| 19780 | #[doc = "GPIO block reset"] | ||
| 19781 | pub fn set_gpiogrst(&mut self, val: super::vals::Gpioarst) { | ||
| 19782 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); | ||
| 19783 | } | ||
| 19784 | #[doc = "GPIO block reset"] | ||
| 19785 | pub const fn gpiohrst(&self) -> super::vals::Gpioarst { | ||
| 19786 | let val = (self.0 >> 7usize) & 0x01; | ||
| 19787 | super::vals::Gpioarst(val as u8) | ||
| 19788 | } | ||
| 19789 | #[doc = "GPIO block reset"] | ||
| 19790 | pub fn set_gpiohrst(&mut self, val: super::vals::Gpioarst) { | ||
| 19791 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 19792 | } | ||
| 19793 | #[doc = "GPIO block reset"] | ||
| 19794 | pub const fn gpioirst(&self) -> super::vals::Gpioarst { | ||
| 19795 | let val = (self.0 >> 8usize) & 0x01; | ||
| 19796 | super::vals::Gpioarst(val as u8) | ||
| 19797 | } | ||
| 19798 | #[doc = "GPIO block reset"] | ||
| 19799 | pub fn set_gpioirst(&mut self, val: super::vals::Gpioarst) { | ||
| 19800 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); | ||
| 19801 | } | ||
| 19802 | #[doc = "GPIO block reset"] | ||
| 19803 | pub const fn gpiojrst(&self) -> super::vals::Gpioarst { | ||
| 19804 | let val = (self.0 >> 9usize) & 0x01; | ||
| 19805 | super::vals::Gpioarst(val as u8) | ||
| 19806 | } | ||
| 19807 | #[doc = "GPIO block reset"] | ||
| 19808 | pub fn set_gpiojrst(&mut self, val: super::vals::Gpioarst) { | ||
| 19809 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | ||
| 19810 | } | ||
| 19811 | #[doc = "GPIO block reset"] | ||
| 19812 | pub const fn gpiokrst(&self) -> super::vals::Gpioarst { | ||
| 19813 | let val = (self.0 >> 10usize) & 0x01; | ||
| 19814 | super::vals::Gpioarst(val as u8) | ||
| 19815 | } | ||
| 19816 | #[doc = "GPIO block reset"] | ||
| 19817 | pub fn set_gpiokrst(&mut self, val: super::vals::Gpioarst) { | ||
| 19818 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); | ||
| 19819 | } | ||
| 19820 | #[doc = "CRC block reset"] | ||
| 19821 | pub const fn crcrst(&self) -> super::vals::Gpioarst { | ||
| 19822 | let val = (self.0 >> 19usize) & 0x01; | ||
| 19823 | super::vals::Gpioarst(val as u8) | ||
| 19824 | } | ||
| 19825 | #[doc = "CRC block reset"] | ||
| 19826 | pub fn set_crcrst(&mut self, val: super::vals::Gpioarst) { | ||
| 19827 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); | ||
| 19828 | } | ||
| 19829 | #[doc = "BDMA block reset"] | ||
| 19830 | pub const fn bdmarst(&self) -> super::vals::Gpioarst { | ||
| 19831 | let val = (self.0 >> 21usize) & 0x01; | ||
| 19832 | super::vals::Gpioarst(val as u8) | ||
| 19833 | } | ||
| 19834 | #[doc = "BDMA block reset"] | ||
| 19835 | pub fn set_bdmarst(&mut self, val: super::vals::Gpioarst) { | ||
| 19836 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize); | ||
| 19837 | } | ||
| 19838 | #[doc = "ADC3 block reset"] | ||
| 19839 | pub const fn adc3rst(&self) -> super::vals::Gpioarst { | ||
| 19840 | let val = (self.0 >> 24usize) & 0x01; | ||
| 19841 | super::vals::Gpioarst(val as u8) | ||
| 19842 | } | ||
| 19843 | #[doc = "ADC3 block reset"] | ||
| 19844 | pub fn set_adc3rst(&mut self, val: super::vals::Gpioarst) { | ||
| 19845 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); | ||
| 19846 | } | ||
| 19847 | #[doc = "HSEM block reset"] | ||
| 19848 | pub const fn hsemrst(&self) -> super::vals::Gpioarst { | ||
| 19849 | let val = (self.0 >> 25usize) & 0x01; | ||
| 19850 | super::vals::Gpioarst(val as u8) | ||
| 19851 | } | ||
| 19852 | #[doc = "HSEM block reset"] | ||
| 19853 | pub fn set_hsemrst(&mut self, val: super::vals::Gpioarst) { | ||
| 19854 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize); | ||
| 19855 | } | ||
| 19856 | } | ||
| 19857 | impl Default for Ahb4rstr { | ||
| 19858 | fn default() -> Ahb4rstr { | ||
| 19859 | Ahb4rstr(0) | ||
| 19860 | } | ||
| 19861 | } | ||
| 19862 | #[doc = "RCC Clock Source Interrupt Flag Register"] | ||
| 19863 | #[repr(transparent)] | ||
| 19864 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 19865 | pub struct Cifr(pub u32); | ||
| 19866 | impl Cifr { | ||
| 19867 | #[doc = "LSI ready Interrupt Flag"] | ||
| 19868 | pub const fn lsirdyf(&self) -> bool { | ||
| 13481 | let val = (self.0 >> 0usize) & 0x01; | 19869 | let val = (self.0 >> 0usize) & 0x01; |
| 13482 | val != 0 | 19870 | val != 0 |
| 13483 | } | 19871 | } |
| 13484 | #[doc = "CCRCFAIL flag clear bit Set by software to clear the CCRCFAIL flag."] | 19872 | #[doc = "LSI ready Interrupt Flag"] |
| 13485 | pub fn set_ccrcfailc(&mut self, val: bool) { | 19873 | pub fn set_lsirdyf(&mut self, val: bool) { |
| 13486 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 19874 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 13487 | } | 19875 | } |
| 13488 | #[doc = "DCRCFAIL flag clear bit Set by software to clear the DCRCFAIL flag."] | 19876 | #[doc = "LSE ready Interrupt Flag"] |
| 13489 | pub const fn dcrcfailc(&self) -> bool { | 19877 | pub const fn lserdyf(&self) -> bool { |
| 13490 | let val = (self.0 >> 1usize) & 0x01; | 19878 | let val = (self.0 >> 1usize) & 0x01; |
| 13491 | val != 0 | 19879 | val != 0 |
| 13492 | } | 19880 | } |
| 13493 | #[doc = "DCRCFAIL flag clear bit Set by software to clear the DCRCFAIL flag."] | 19881 | #[doc = "LSE ready Interrupt Flag"] |
| 13494 | pub fn set_dcrcfailc(&mut self, val: bool) { | 19882 | pub fn set_lserdyf(&mut self, val: bool) { |
| 13495 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 19883 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 13496 | } | 19884 | } |
| 13497 | #[doc = "CTIMEOUT flag clear bit Set by software to clear the CTIMEOUT flag."] | 19885 | #[doc = "HSI ready Interrupt Flag"] |
| 13498 | pub const fn ctimeoutc(&self) -> bool { | 19886 | pub const fn hsirdyf(&self) -> bool { |
| 13499 | let val = (self.0 >> 2usize) & 0x01; | 19887 | let val = (self.0 >> 2usize) & 0x01; |
| 13500 | val != 0 | 19888 | val != 0 |
| 13501 | } | 19889 | } |
| 13502 | #[doc = "CTIMEOUT flag clear bit Set by software to clear the CTIMEOUT flag."] | 19890 | #[doc = "HSI ready Interrupt Flag"] |
| 13503 | pub fn set_ctimeoutc(&mut self, val: bool) { | 19891 | pub fn set_hsirdyf(&mut self, val: bool) { |
| 13504 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 19892 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 13505 | } | 19893 | } |
| 13506 | #[doc = "DTIMEOUT flag clear bit Set by software to clear the DTIMEOUT flag."] | 19894 | #[doc = "HSE ready Interrupt Flag"] |
| 13507 | pub const fn dtimeoutc(&self) -> bool { | 19895 | pub const fn hserdyf(&self) -> bool { |
| 13508 | let val = (self.0 >> 3usize) & 0x01; | 19896 | let val = (self.0 >> 3usize) & 0x01; |
| 13509 | val != 0 | 19897 | val != 0 |
| 13510 | } | 19898 | } |
| 13511 | #[doc = "DTIMEOUT flag clear bit Set by software to clear the DTIMEOUT flag."] | 19899 | #[doc = "HSE ready Interrupt Flag"] |
| 13512 | pub fn set_dtimeoutc(&mut self, val: bool) { | 19900 | pub fn set_hserdyf(&mut self, val: bool) { |
| 13513 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 19901 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); |
| 13514 | } | 19902 | } |
| 13515 | #[doc = "TXUNDERR flag clear bit Set by software to clear TXUNDERR flag."] | 19903 | #[doc = "CSI ready Interrupt Flag"] |
| 13516 | pub const fn txunderrc(&self) -> bool { | 19904 | pub const fn csirdy(&self) -> bool { |
| 13517 | let val = (self.0 >> 4usize) & 0x01; | 19905 | let val = (self.0 >> 4usize) & 0x01; |
| 13518 | val != 0 | 19906 | val != 0 |
| 13519 | } | 19907 | } |
| 13520 | #[doc = "TXUNDERR flag clear bit Set by software to clear TXUNDERR flag."] | 19908 | #[doc = "CSI ready Interrupt Flag"] |
| 13521 | pub fn set_txunderrc(&mut self, val: bool) { | 19909 | pub fn set_csirdy(&mut self, val: bool) { |
| 13522 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 19910 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 13523 | } | 19911 | } |
| 13524 | #[doc = "RXOVERR flag clear bit Set by software to clear the RXOVERR flag."] | 19912 | #[doc = "RC48 ready Interrupt Flag"] |
| 13525 | pub const fn rxoverrc(&self) -> bool { | 19913 | pub const fn hsi48rdyf(&self) -> bool { |
| 13526 | let val = (self.0 >> 5usize) & 0x01; | 19914 | let val = (self.0 >> 5usize) & 0x01; |
| 13527 | val != 0 | 19915 | val != 0 |
| 13528 | } | 19916 | } |
| 13529 | #[doc = "RXOVERR flag clear bit Set by software to clear the RXOVERR flag."] | 19917 | #[doc = "RC48 ready Interrupt Flag"] |
| 13530 | pub fn set_rxoverrc(&mut self, val: bool) { | 19918 | pub fn set_hsi48rdyf(&mut self, val: bool) { |
| 13531 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 19919 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); |
| 13532 | } | 19920 | } |
| 13533 | #[doc = "CMDREND flag clear bit Set by software to clear the CMDREND flag."] | 19921 | #[doc = "PLL1 ready Interrupt Flag"] |
| 13534 | pub const fn cmdrendc(&self) -> bool { | 19922 | pub fn pllrdyf(&self, n: usize) -> bool { |
| 13535 | let val = (self.0 >> 6usize) & 0x01; | 19923 | assert!(n < 3usize); |
| 19924 | let offs = 6usize + n * 1usize; | ||
| 19925 | let val = (self.0 >> offs) & 0x01; | ||
| 13536 | val != 0 | 19926 | val != 0 |
| 13537 | } | 19927 | } |
| 13538 | #[doc = "CMDREND flag clear bit Set by software to clear the CMDREND flag."] | 19928 | #[doc = "PLL1 ready Interrupt Flag"] |
| 13539 | pub fn set_cmdrendc(&mut self, val: bool) { | 19929 | pub fn set_pllrdyf(&mut self, n: usize, val: bool) { |
| 13540 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 19930 | assert!(n < 3usize); |
| 19931 | let offs = 6usize + n * 1usize; | ||
| 19932 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 13541 | } | 19933 | } |
| 13542 | #[doc = "CMDSENT flag clear bit Set by software to clear the CMDSENT flag."] | 19934 | #[doc = "LSE clock security system Interrupt Flag"] |
| 13543 | pub const fn cmdsentc(&self) -> bool { | 19935 | pub const fn lsecssf(&self) -> bool { |
| 13544 | let val = (self.0 >> 7usize) & 0x01; | 19936 | let val = (self.0 >> 9usize) & 0x01; |
| 13545 | val != 0 | 19937 | val != 0 |
| 13546 | } | 19938 | } |
| 13547 | #[doc = "CMDSENT flag clear bit Set by software to clear the CMDSENT flag."] | 19939 | #[doc = "LSE clock security system Interrupt Flag"] |
| 13548 | pub fn set_cmdsentc(&mut self, val: bool) { | 19940 | pub fn set_lsecssf(&mut self, val: bool) { |
| 13549 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 19941 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); |
| 13550 | } | 19942 | } |
| 13551 | #[doc = "DATAEND flag clear bit Set by software to clear the DATAEND flag."] | 19943 | #[doc = "HSE clock security system Interrupt Flag"] |
| 13552 | pub const fn dataendc(&self) -> bool { | 19944 | pub const fn hsecssf(&self) -> bool { |
| 13553 | let val = (self.0 >> 8usize) & 0x01; | 19945 | let val = (self.0 >> 10usize) & 0x01; |
| 13554 | val != 0 | 19946 | val != 0 |
| 13555 | } | 19947 | } |
| 13556 | #[doc = "DATAEND flag clear bit Set by software to clear the DATAEND flag."] | 19948 | #[doc = "HSE clock security system Interrupt Flag"] |
| 13557 | pub fn set_dataendc(&mut self, val: bool) { | 19949 | pub fn set_hsecssf(&mut self, val: bool) { |
| 13558 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 19950 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); |
| 13559 | } | 19951 | } |
| 13560 | #[doc = "DHOLD flag clear bit Set by software to clear the DHOLD flag."] | 19952 | } |
| 13561 | pub const fn dholdc(&self) -> bool { | 19953 | impl Default for Cifr { |
| 19954 | fn default() -> Cifr { | ||
| 19955 | Cifr(0) | ||
| 19956 | } | ||
| 19957 | } | ||
| 19958 | #[doc = "RCC APB4 Sleep Clock Register"] | ||
| 19959 | #[repr(transparent)] | ||
| 19960 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 19961 | pub struct C1Apb4lpenr(pub u32); | ||
| 19962 | impl C1Apb4lpenr { | ||
| 19963 | #[doc = "SYSCFG peripheral clock enable during CSleep mode"] | ||
| 19964 | pub const fn syscfglpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen { | ||
| 19965 | let val = (self.0 >> 1usize) & 0x01; | ||
| 19966 | super::vals::C1Apb4lpenrSyscfglpen(val as u8) | ||
| 19967 | } | ||
| 19968 | #[doc = "SYSCFG peripheral clock enable during CSleep mode"] | ||
| 19969 | pub fn set_syscfglpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) { | ||
| 19970 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 19971 | } | ||
| 19972 | #[doc = "LPUART1 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19973 | pub const fn lpuart1lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen { | ||
| 19974 | let val = (self.0 >> 3usize) & 0x01; | ||
| 19975 | super::vals::C1Apb4lpenrSyscfglpen(val as u8) | ||
| 19976 | } | ||
| 19977 | #[doc = "LPUART1 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19978 | pub fn set_lpuart1lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) { | ||
| 19979 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 19980 | } | ||
| 19981 | #[doc = "SPI6 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19982 | pub const fn spi6lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen { | ||
| 19983 | let val = (self.0 >> 5usize) & 0x01; | ||
| 19984 | super::vals::C1Apb4lpenrSyscfglpen(val as u8) | ||
| 19985 | } | ||
| 19986 | #[doc = "SPI6 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19987 | pub fn set_spi6lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) { | ||
| 19988 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 19989 | } | ||
| 19990 | #[doc = "I2C4 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19991 | pub const fn i2c4lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen { | ||
| 19992 | let val = (self.0 >> 7usize) & 0x01; | ||
| 19993 | super::vals::C1Apb4lpenrSyscfglpen(val as u8) | ||
| 19994 | } | ||
| 19995 | #[doc = "I2C4 Peripheral Clocks Enable During CSleep Mode"] | ||
| 19996 | pub fn set_i2c4lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) { | ||
| 19997 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 19998 | } | ||
| 19999 | #[doc = "LPTIM2 Peripheral Clocks Enable During CSleep Mode"] | ||
| 20000 | pub const fn lptim2lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen { | ||
| 13562 | let val = (self.0 >> 9usize) & 0x01; | 20001 | let val = (self.0 >> 9usize) & 0x01; |
| 13563 | val != 0 | 20002 | super::vals::C1Apb4lpenrSyscfglpen(val as u8) |
| 13564 | } | 20003 | } |
| 13565 | #[doc = "DHOLD flag clear bit Set by software to clear the DHOLD flag."] | 20004 | #[doc = "LPTIM2 Peripheral Clocks Enable During CSleep Mode"] |
| 13566 | pub fn set_dholdc(&mut self, val: bool) { | 20005 | pub fn set_lptim2lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) { |
| 13567 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | 20006 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); |
| 13568 | } | 20007 | } |
| 13569 | #[doc = "DBCKEND flag clear bit Set by software to clear the DBCKEND flag."] | 20008 | #[doc = "LPTIM3 Peripheral Clocks Enable During CSleep Mode"] |
| 13570 | pub const fn dbckendc(&self) -> bool { | 20009 | pub const fn lptim3lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen { |
| 13571 | let val = (self.0 >> 10usize) & 0x01; | 20010 | let val = (self.0 >> 10usize) & 0x01; |
| 13572 | val != 0 | 20011 | super::vals::C1Apb4lpenrSyscfglpen(val as u8) |
| 13573 | } | 20012 | } |
| 13574 | #[doc = "DBCKEND flag clear bit Set by software to clear the DBCKEND flag."] | 20013 | #[doc = "LPTIM3 Peripheral Clocks Enable During CSleep Mode"] |
| 13575 | pub fn set_dbckendc(&mut self, val: bool) { | 20014 | pub fn set_lptim3lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) { |
| 13576 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | 20015 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); |
| 13577 | } | 20016 | } |
| 13578 | #[doc = "DABORT flag clear bit Set by software to clear the DABORT flag."] | 20017 | #[doc = "LPTIM4 Peripheral Clocks Enable During CSleep Mode"] |
| 13579 | pub const fn dabortc(&self) -> bool { | 20018 | pub const fn lptim4lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen { |
| 13580 | let val = (self.0 >> 11usize) & 0x01; | 20019 | let val = (self.0 >> 11usize) & 0x01; |
| 13581 | val != 0 | 20020 | super::vals::C1Apb4lpenrSyscfglpen(val as u8) |
| 13582 | } | 20021 | } |
| 13583 | #[doc = "DABORT flag clear bit Set by software to clear the DABORT flag."] | 20022 | #[doc = "LPTIM4 Peripheral Clocks Enable During CSleep Mode"] |
| 13584 | pub fn set_dabortc(&mut self, val: bool) { | 20023 | pub fn set_lptim4lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) { |
| 13585 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); | 20024 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); |
| 13586 | } | 20025 | } |
| 13587 | #[doc = "BUSYD0END flag clear bit Set by software to clear the BUSYD0END flag."] | 20026 | #[doc = "LPTIM5 Peripheral Clocks Enable During CSleep Mode"] |
| 13588 | pub const fn busyd0endc(&self) -> bool { | 20027 | pub const fn lptim5lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen { |
| 20028 | let val = (self.0 >> 12usize) & 0x01; | ||
| 20029 | super::vals::C1Apb4lpenrSyscfglpen(val as u8) | ||
| 20030 | } | ||
| 20031 | #[doc = "LPTIM5 Peripheral Clocks Enable During CSleep Mode"] | ||
| 20032 | pub fn set_lptim5lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) { | ||
| 20033 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 20034 | } | ||
| 20035 | #[doc = "COMP1/2 peripheral clock enable during CSleep mode"] | ||
| 20036 | pub const fn comp12lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen { | ||
| 20037 | let val = (self.0 >> 14usize) & 0x01; | ||
| 20038 | super::vals::C1Apb4lpenrSyscfglpen(val as u8) | ||
| 20039 | } | ||
| 20040 | #[doc = "COMP1/2 peripheral clock enable during CSleep mode"] | ||
| 20041 | pub fn set_comp12lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) { | ||
| 20042 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | ||
| 20043 | } | ||
| 20044 | #[doc = "VREF peripheral clock enable during CSleep mode"] | ||
| 20045 | pub const fn vreflpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen { | ||
| 20046 | let val = (self.0 >> 15usize) & 0x01; | ||
| 20047 | super::vals::C1Apb4lpenrSyscfglpen(val as u8) | ||
| 20048 | } | ||
| 20049 | #[doc = "VREF peripheral clock enable during CSleep mode"] | ||
| 20050 | pub fn set_vreflpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) { | ||
| 20051 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 20052 | } | ||
| 20053 | #[doc = "RTC APB Clock Enable During CSleep Mode"] | ||
| 20054 | pub const fn rtcapblpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen { | ||
| 20055 | let val = (self.0 >> 16usize) & 0x01; | ||
| 20056 | super::vals::C1Apb4lpenrSyscfglpen(val as u8) | ||
| 20057 | } | ||
| 20058 | #[doc = "RTC APB Clock Enable During CSleep Mode"] | ||
| 20059 | pub fn set_rtcapblpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) { | ||
| 20060 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 20061 | } | ||
| 20062 | #[doc = "SAI4 Peripheral Clocks Enable During CSleep Mode"] | ||
| 20063 | pub const fn sai4lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen { | ||
| 13589 | let val = (self.0 >> 21usize) & 0x01; | 20064 | let val = (self.0 >> 21usize) & 0x01; |
| 13590 | val != 0 | 20065 | super::vals::C1Apb4lpenrSyscfglpen(val as u8) |
| 13591 | } | 20066 | } |
| 13592 | #[doc = "BUSYD0END flag clear bit Set by software to clear the BUSYD0END flag."] | 20067 | #[doc = "SAI4 Peripheral Clocks Enable During CSleep Mode"] |
| 13593 | pub fn set_busyd0endc(&mut self, val: bool) { | 20068 | pub fn set_sai4lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) { |
| 13594 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); | 20069 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize); |
| 13595 | } | 20070 | } |
| 13596 | #[doc = "SDIOIT flag clear bit Set by software to clear the SDIOIT flag."] | 20071 | } |
| 13597 | pub const fn sdioitc(&self) -> bool { | 20072 | impl Default for C1Apb4lpenr { |
| 20073 | fn default() -> C1Apb4lpenr { | ||
| 20074 | C1Apb4lpenr(0) | ||
| 20075 | } | ||
| 20076 | } | ||
| 20077 | #[doc = "RCC AHB4 Sleep Clock Register"] | ||
| 20078 | #[repr(transparent)] | ||
| 20079 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 20080 | pub struct C1Ahb4lpenr(pub u32); | ||
| 20081 | impl C1Ahb4lpenr { | ||
| 20082 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20083 | pub const fn gpioalpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { | ||
| 20084 | let val = (self.0 >> 0usize) & 0x01; | ||
| 20085 | super::vals::C1Ahb4lpenrGpioalpen(val as u8) | ||
| 20086 | } | ||
| 20087 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20088 | pub fn set_gpioalpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { | ||
| 20089 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 20090 | } | ||
| 20091 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20092 | pub const fn gpioblpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { | ||
| 20093 | let val = (self.0 >> 1usize) & 0x01; | ||
| 20094 | super::vals::C1Ahb4lpenrGpioalpen(val as u8) | ||
| 20095 | } | ||
| 20096 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20097 | pub fn set_gpioblpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { | ||
| 20098 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 20099 | } | ||
| 20100 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20101 | pub const fn gpioclpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { | ||
| 20102 | let val = (self.0 >> 2usize) & 0x01; | ||
| 20103 | super::vals::C1Ahb4lpenrGpioalpen(val as u8) | ||
| 20104 | } | ||
| 20105 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20106 | pub fn set_gpioclpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { | ||
| 20107 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 20108 | } | ||
| 20109 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20110 | pub const fn gpiodlpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { | ||
| 20111 | let val = (self.0 >> 3usize) & 0x01; | ||
| 20112 | super::vals::C1Ahb4lpenrGpioalpen(val as u8) | ||
| 20113 | } | ||
| 20114 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20115 | pub fn set_gpiodlpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { | ||
| 20116 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 20117 | } | ||
| 20118 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20119 | pub const fn gpioelpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { | ||
| 20120 | let val = (self.0 >> 4usize) & 0x01; | ||
| 20121 | super::vals::C1Ahb4lpenrGpioalpen(val as u8) | ||
| 20122 | } | ||
| 20123 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20124 | pub fn set_gpioelpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { | ||
| 20125 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 20126 | } | ||
| 20127 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20128 | pub const fn gpioflpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { | ||
| 20129 | let val = (self.0 >> 5usize) & 0x01; | ||
| 20130 | super::vals::C1Ahb4lpenrGpioalpen(val as u8) | ||
| 20131 | } | ||
| 20132 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20133 | pub fn set_gpioflpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { | ||
| 20134 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 20135 | } | ||
| 20136 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20137 | pub const fn gpioglpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { | ||
| 20138 | let val = (self.0 >> 6usize) & 0x01; | ||
| 20139 | super::vals::C1Ahb4lpenrGpioalpen(val as u8) | ||
| 20140 | } | ||
| 20141 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20142 | pub fn set_gpioglpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { | ||
| 20143 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); | ||
| 20144 | } | ||
| 20145 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20146 | pub const fn gpiohlpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { | ||
| 20147 | let val = (self.0 >> 7usize) & 0x01; | ||
| 20148 | super::vals::C1Ahb4lpenrGpioalpen(val as u8) | ||
| 20149 | } | ||
| 20150 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20151 | pub fn set_gpiohlpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { | ||
| 20152 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 20153 | } | ||
| 20154 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20155 | pub const fn gpioilpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { | ||
| 20156 | let val = (self.0 >> 8usize) & 0x01; | ||
| 20157 | super::vals::C1Ahb4lpenrGpioalpen(val as u8) | ||
| 20158 | } | ||
| 20159 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20160 | pub fn set_gpioilpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { | ||
| 20161 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); | ||
| 20162 | } | ||
| 20163 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20164 | pub const fn gpiojlpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { | ||
| 20165 | let val = (self.0 >> 9usize) & 0x01; | ||
| 20166 | super::vals::C1Ahb4lpenrGpioalpen(val as u8) | ||
| 20167 | } | ||
| 20168 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20169 | pub fn set_gpiojlpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { | ||
| 20170 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | ||
| 20171 | } | ||
| 20172 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20173 | pub const fn gpioklpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { | ||
| 20174 | let val = (self.0 >> 10usize) & 0x01; | ||
| 20175 | super::vals::C1Ahb4lpenrGpioalpen(val as u8) | ||
| 20176 | } | ||
| 20177 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20178 | pub fn set_gpioklpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { | ||
| 20179 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); | ||
| 20180 | } | ||
| 20181 | #[doc = "CRC peripheral clock enable during CSleep mode"] | ||
| 20182 | pub const fn crclpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { | ||
| 20183 | let val = (self.0 >> 19usize) & 0x01; | ||
| 20184 | super::vals::C1Ahb4lpenrGpioalpen(val as u8) | ||
| 20185 | } | ||
| 20186 | #[doc = "CRC peripheral clock enable during CSleep mode"] | ||
| 20187 | pub fn set_crclpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { | ||
| 20188 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); | ||
| 20189 | } | ||
| 20190 | #[doc = "BDMA Clock Enable During CSleep Mode"] | ||
| 20191 | pub const fn bdmalpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { | ||
| 20192 | let val = (self.0 >> 21usize) & 0x01; | ||
| 20193 | super::vals::C1Ahb4lpenrGpioalpen(val as u8) | ||
| 20194 | } | ||
| 20195 | #[doc = "BDMA Clock Enable During CSleep Mode"] | ||
| 20196 | pub fn set_bdmalpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { | ||
| 20197 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize); | ||
| 20198 | } | ||
| 20199 | #[doc = "ADC3 Peripheral Clocks Enable During CSleep Mode"] | ||
| 20200 | pub const fn adc3lpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { | ||
| 20201 | let val = (self.0 >> 24usize) & 0x01; | ||
| 20202 | super::vals::C1Ahb4lpenrGpioalpen(val as u8) | ||
| 20203 | } | ||
| 20204 | #[doc = "ADC3 Peripheral Clocks Enable During CSleep Mode"] | ||
| 20205 | pub fn set_adc3lpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { | ||
| 20206 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); | ||
| 20207 | } | ||
| 20208 | #[doc = "Backup RAM Clock Enable During CSleep Mode"] | ||
| 20209 | pub const fn bkpramlpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { | ||
| 20210 | let val = (self.0 >> 28usize) & 0x01; | ||
| 20211 | super::vals::C1Ahb4lpenrGpioalpen(val as u8) | ||
| 20212 | } | ||
| 20213 | #[doc = "Backup RAM Clock Enable During CSleep Mode"] | ||
| 20214 | pub fn set_bkpramlpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { | ||
| 20215 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); | ||
| 20216 | } | ||
| 20217 | #[doc = "SRAM4 Clock Enable During CSleep Mode"] | ||
| 20218 | pub const fn sram4lpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { | ||
| 20219 | let val = (self.0 >> 29usize) & 0x01; | ||
| 20220 | super::vals::C1Ahb4lpenrGpioalpen(val as u8) | ||
| 20221 | } | ||
| 20222 | #[doc = "SRAM4 Clock Enable During CSleep Mode"] | ||
| 20223 | pub fn set_sram4lpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { | ||
| 20224 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); | ||
| 20225 | } | ||
| 20226 | } | ||
| 20227 | impl Default for C1Ahb4lpenr { | ||
| 20228 | fn default() -> C1Ahb4lpenr { | ||
| 20229 | C1Ahb4lpenr(0) | ||
| 20230 | } | ||
| 20231 | } | ||
| 20232 | #[doc = "RCC APB3 Peripheral Reset Register"] | ||
| 20233 | #[repr(transparent)] | ||
| 20234 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 20235 | pub struct Apb3rstr(pub u32); | ||
| 20236 | impl Apb3rstr { | ||
| 20237 | #[doc = "LTDC block reset"] | ||
| 20238 | pub const fn ltdcrst(&self) -> super::vals::Ltdcrst { | ||
| 20239 | let val = (self.0 >> 3usize) & 0x01; | ||
| 20240 | super::vals::Ltdcrst(val as u8) | ||
| 20241 | } | ||
| 20242 | #[doc = "LTDC block reset"] | ||
| 20243 | pub fn set_ltdcrst(&mut self, val: super::vals::Ltdcrst) { | ||
| 20244 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 20245 | } | ||
| 20246 | } | ||
| 20247 | impl Default for Apb3rstr { | ||
| 20248 | fn default() -> Apb3rstr { | ||
| 20249 | Apb3rstr(0) | ||
| 20250 | } | ||
| 20251 | } | ||
| 20252 | #[doc = "RCC APB2 Clock Register"] | ||
| 20253 | #[repr(transparent)] | ||
| 20254 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 20255 | pub struct C1Apb2enr(pub u32); | ||
| 20256 | impl C1Apb2enr { | ||
| 20257 | #[doc = "TIM1 peripheral clock enable"] | ||
| 20258 | pub const fn tim1en(&self) -> super::vals::C1Apb2enrTim1en { | ||
| 20259 | let val = (self.0 >> 0usize) & 0x01; | ||
| 20260 | super::vals::C1Apb2enrTim1en(val as u8) | ||
| 20261 | } | ||
| 20262 | #[doc = "TIM1 peripheral clock enable"] | ||
| 20263 | pub fn set_tim1en(&mut self, val: super::vals::C1Apb2enrTim1en) { | ||
| 20264 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 20265 | } | ||
| 20266 | #[doc = "TIM8 peripheral clock enable"] | ||
| 20267 | pub const fn tim8en(&self) -> super::vals::C1Apb2enrTim1en { | ||
| 20268 | let val = (self.0 >> 1usize) & 0x01; | ||
| 20269 | super::vals::C1Apb2enrTim1en(val as u8) | ||
| 20270 | } | ||
| 20271 | #[doc = "TIM8 peripheral clock enable"] | ||
| 20272 | pub fn set_tim8en(&mut self, val: super::vals::C1Apb2enrTim1en) { | ||
| 20273 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 20274 | } | ||
| 20275 | #[doc = "USART1 Peripheral Clocks Enable"] | ||
| 20276 | pub const fn usart1en(&self) -> super::vals::C1Apb2enrTim1en { | ||
| 20277 | let val = (self.0 >> 4usize) & 0x01; | ||
| 20278 | super::vals::C1Apb2enrTim1en(val as u8) | ||
| 20279 | } | ||
| 20280 | #[doc = "USART1 Peripheral Clocks Enable"] | ||
| 20281 | pub fn set_usart1en(&mut self, val: super::vals::C1Apb2enrTim1en) { | ||
| 20282 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 20283 | } | ||
| 20284 | #[doc = "USART6 Peripheral Clocks Enable"] | ||
| 20285 | pub const fn usart6en(&self) -> super::vals::C1Apb2enrTim1en { | ||
| 20286 | let val = (self.0 >> 5usize) & 0x01; | ||
| 20287 | super::vals::C1Apb2enrTim1en(val as u8) | ||
| 20288 | } | ||
| 20289 | #[doc = "USART6 Peripheral Clocks Enable"] | ||
| 20290 | pub fn set_usart6en(&mut self, val: super::vals::C1Apb2enrTim1en) { | ||
| 20291 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 20292 | } | ||
| 20293 | #[doc = "SPI1 Peripheral Clocks Enable"] | ||
| 20294 | pub const fn spi1en(&self) -> super::vals::C1Apb2enrTim1en { | ||
| 20295 | let val = (self.0 >> 12usize) & 0x01; | ||
| 20296 | super::vals::C1Apb2enrTim1en(val as u8) | ||
| 20297 | } | ||
| 20298 | #[doc = "SPI1 Peripheral Clocks Enable"] | ||
| 20299 | pub fn set_spi1en(&mut self, val: super::vals::C1Apb2enrTim1en) { | ||
| 20300 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 20301 | } | ||
| 20302 | #[doc = "SPI4 Peripheral Clocks Enable"] | ||
| 20303 | pub const fn spi4en(&self) -> super::vals::C1Apb2enrTim1en { | ||
| 20304 | let val = (self.0 >> 13usize) & 0x01; | ||
| 20305 | super::vals::C1Apb2enrTim1en(val as u8) | ||
| 20306 | } | ||
| 20307 | #[doc = "SPI4 Peripheral Clocks Enable"] | ||
| 20308 | pub fn set_spi4en(&mut self, val: super::vals::C1Apb2enrTim1en) { | ||
| 20309 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize); | ||
| 20310 | } | ||
| 20311 | #[doc = "TIM15 peripheral clock enable"] | ||
| 20312 | pub const fn tim15en(&self) -> super::vals::C1Apb2enrTim1en { | ||
| 20313 | let val = (self.0 >> 16usize) & 0x01; | ||
| 20314 | super::vals::C1Apb2enrTim1en(val as u8) | ||
| 20315 | } | ||
| 20316 | #[doc = "TIM15 peripheral clock enable"] | ||
| 20317 | pub fn set_tim15en(&mut self, val: super::vals::C1Apb2enrTim1en) { | ||
| 20318 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 20319 | } | ||
| 20320 | #[doc = "TIM16 peripheral clock enable"] | ||
| 20321 | pub const fn tim16en(&self) -> super::vals::C1Apb2enrTim1en { | ||
| 20322 | let val = (self.0 >> 17usize) & 0x01; | ||
| 20323 | super::vals::C1Apb2enrTim1en(val as u8) | ||
| 20324 | } | ||
| 20325 | #[doc = "TIM16 peripheral clock enable"] | ||
| 20326 | pub fn set_tim16en(&mut self, val: super::vals::C1Apb2enrTim1en) { | ||
| 20327 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize); | ||
| 20328 | } | ||
| 20329 | #[doc = "TIM17 peripheral clock enable"] | ||
| 20330 | pub const fn tim17en(&self) -> super::vals::C1Apb2enrTim1en { | ||
| 20331 | let val = (self.0 >> 18usize) & 0x01; | ||
| 20332 | super::vals::C1Apb2enrTim1en(val as u8) | ||
| 20333 | } | ||
| 20334 | #[doc = "TIM17 peripheral clock enable"] | ||
| 20335 | pub fn set_tim17en(&mut self, val: super::vals::C1Apb2enrTim1en) { | ||
| 20336 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize); | ||
| 20337 | } | ||
| 20338 | #[doc = "SPI5 Peripheral Clocks Enable"] | ||
| 20339 | pub const fn spi5en(&self) -> super::vals::C1Apb2enrTim1en { | ||
| 20340 | let val = (self.0 >> 20usize) & 0x01; | ||
| 20341 | super::vals::C1Apb2enrTim1en(val as u8) | ||
| 20342 | } | ||
| 20343 | #[doc = "SPI5 Peripheral Clocks Enable"] | ||
| 20344 | pub fn set_spi5en(&mut self, val: super::vals::C1Apb2enrTim1en) { | ||
| 20345 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize); | ||
| 20346 | } | ||
| 20347 | #[doc = "SAI1 Peripheral Clocks Enable"] | ||
| 20348 | pub const fn sai1en(&self) -> super::vals::C1Apb2enrTim1en { | ||
| 13598 | let val = (self.0 >> 22usize) & 0x01; | 20349 | let val = (self.0 >> 22usize) & 0x01; |
| 13599 | val != 0 | 20350 | super::vals::C1Apb2enrTim1en(val as u8) |
| 13600 | } | 20351 | } |
| 13601 | #[doc = "SDIOIT flag clear bit Set by software to clear the SDIOIT flag."] | 20352 | #[doc = "SAI1 Peripheral Clocks Enable"] |
| 13602 | pub fn set_sdioitc(&mut self, val: bool) { | 20353 | pub fn set_sai1en(&mut self, val: super::vals::C1Apb2enrTim1en) { |
| 13603 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); | 20354 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize); |
| 13604 | } | 20355 | } |
| 13605 | #[doc = "ACKFAIL flag clear bit Set by software to clear the ACKFAIL flag."] | 20356 | #[doc = "SAI2 Peripheral Clocks Enable"] |
| 13606 | pub const fn ackfailc(&self) -> bool { | 20357 | pub const fn sai2en(&self) -> super::vals::C1Apb2enrTim1en { |
| 13607 | let val = (self.0 >> 23usize) & 0x01; | 20358 | let val = (self.0 >> 23usize) & 0x01; |
| 13608 | val != 0 | 20359 | super::vals::C1Apb2enrTim1en(val as u8) |
| 13609 | } | 20360 | } |
| 13610 | #[doc = "ACKFAIL flag clear bit Set by software to clear the ACKFAIL flag."] | 20361 | #[doc = "SAI2 Peripheral Clocks Enable"] |
| 13611 | pub fn set_ackfailc(&mut self, val: bool) { | 20362 | pub fn set_sai2en(&mut self, val: super::vals::C1Apb2enrTim1en) { |
| 13612 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); | 20363 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize); |
| 13613 | } | 20364 | } |
| 13614 | #[doc = "ACKTIMEOUT flag clear bit Set by software to clear the ACKTIMEOUT flag."] | 20365 | #[doc = "SAI3 Peripheral Clocks Enable"] |
| 13615 | pub const fn acktimeoutc(&self) -> bool { | 20366 | pub const fn sai3en(&self) -> super::vals::C1Apb2enrTim1en { |
| 13616 | let val = (self.0 >> 24usize) & 0x01; | 20367 | let val = (self.0 >> 24usize) & 0x01; |
| 13617 | val != 0 | 20368 | super::vals::C1Apb2enrTim1en(val as u8) |
| 13618 | } | 20369 | } |
| 13619 | #[doc = "ACKTIMEOUT flag clear bit Set by software to clear the ACKTIMEOUT flag."] | 20370 | #[doc = "SAI3 Peripheral Clocks Enable"] |
| 13620 | pub fn set_acktimeoutc(&mut self, val: bool) { | 20371 | pub fn set_sai3en(&mut self, val: super::vals::C1Apb2enrTim1en) { |
| 13621 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize); | 20372 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); |
| 13622 | } | 20373 | } |
| 13623 | #[doc = "VSWEND flag clear bit Set by software to clear the VSWEND flag."] | 20374 | #[doc = "DFSDM1 Peripheral Clocks Enable"] |
| 13624 | pub const fn vswendc(&self) -> bool { | 20375 | pub const fn dfsdm1en(&self) -> super::vals::C1Apb2enrTim1en { |
| 13625 | let val = (self.0 >> 25usize) & 0x01; | 20376 | let val = (self.0 >> 28usize) & 0x01; |
| 13626 | val != 0 | 20377 | super::vals::C1Apb2enrTim1en(val as u8) |
| 13627 | } | 20378 | } |
| 13628 | #[doc = "VSWEND flag clear bit Set by software to clear the VSWEND flag."] | 20379 | #[doc = "DFSDM1 Peripheral Clocks Enable"] |
| 13629 | pub fn set_vswendc(&mut self, val: bool) { | 20380 | pub fn set_dfsdm1en(&mut self, val: super::vals::C1Apb2enrTim1en) { |
| 13630 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize); | 20381 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); |
| 13631 | } | 20382 | } |
| 13632 | #[doc = "CKSTOP flag clear bit Set by software to clear the CKSTOP flag."] | 20383 | #[doc = "HRTIM peripheral clock enable"] |
| 13633 | pub const fn ckstopc(&self) -> bool { | 20384 | pub const fn hrtimen(&self) -> super::vals::C1Apb2enrTim1en { |
| 13634 | let val = (self.0 >> 26usize) & 0x01; | 20385 | let val = (self.0 >> 29usize) & 0x01; |
| 13635 | val != 0 | 20386 | super::vals::C1Apb2enrTim1en(val as u8) |
| 13636 | } | 20387 | } |
| 13637 | #[doc = "CKSTOP flag clear bit Set by software to clear the CKSTOP flag."] | 20388 | #[doc = "HRTIM peripheral clock enable"] |
| 13638 | pub fn set_ckstopc(&mut self, val: bool) { | 20389 | pub fn set_hrtimen(&mut self, val: super::vals::C1Apb2enrTim1en) { |
| 13639 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); | 20390 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); |
| 13640 | } | 20391 | } |
| 13641 | #[doc = "IDMA transfer error clear bit Set by software to clear the IDMATE flag."] | 20392 | } |
| 13642 | pub const fn idmatec(&self) -> bool { | 20393 | impl Default for C1Apb2enr { |
| 13643 | let val = (self.0 >> 27usize) & 0x01; | 20394 | fn default() -> C1Apb2enr { |
| 13644 | val != 0 | 20395 | C1Apb2enr(0) |
| 13645 | } | 20396 | } |
| 13646 | #[doc = "IDMA transfer error clear bit Set by software to clear the IDMATE flag."] | 20397 | } |
| 13647 | pub fn set_idmatec(&mut self, val: bool) { | 20398 | #[doc = "RCC AHB4 Sleep Clock Register"] |
| 13648 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize); | 20399 | #[repr(transparent)] |
| 20400 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 20401 | pub struct Ahb4lpenr(pub u32); | ||
| 20402 | impl Ahb4lpenr { | ||
| 20403 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20404 | pub const fn gpioalpen(&self) -> super::vals::Ahb4lpenrGpioalpen { | ||
| 20405 | let val = (self.0 >> 0usize) & 0x01; | ||
| 20406 | super::vals::Ahb4lpenrGpioalpen(val as u8) | ||
| 13649 | } | 20407 | } |
| 13650 | #[doc = "IDMA buffer transfer complete clear bit Set by software to clear the IDMABTC flag."] | 20408 | #[doc = "GPIO peripheral clock enable during CSleep mode"] |
| 13651 | pub const fn idmabtcc(&self) -> bool { | 20409 | pub fn set_gpioalpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { |
| 20410 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 20411 | } | ||
| 20412 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20413 | pub const fn gpioblpen(&self) -> super::vals::Ahb4lpenrGpioalpen { | ||
| 20414 | let val = (self.0 >> 1usize) & 0x01; | ||
| 20415 | super::vals::Ahb4lpenrGpioalpen(val as u8) | ||
| 20416 | } | ||
| 20417 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20418 | pub fn set_gpioblpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { | ||
| 20419 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 20420 | } | ||
| 20421 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20422 | pub const fn gpioclpen(&self) -> super::vals::Ahb4lpenrGpioalpen { | ||
| 20423 | let val = (self.0 >> 2usize) & 0x01; | ||
| 20424 | super::vals::Ahb4lpenrGpioalpen(val as u8) | ||
| 20425 | } | ||
| 20426 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20427 | pub fn set_gpioclpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { | ||
| 20428 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 20429 | } | ||
| 20430 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20431 | pub const fn gpiodlpen(&self) -> super::vals::Ahb4lpenrGpioalpen { | ||
| 20432 | let val = (self.0 >> 3usize) & 0x01; | ||
| 20433 | super::vals::Ahb4lpenrGpioalpen(val as u8) | ||
| 20434 | } | ||
| 20435 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20436 | pub fn set_gpiodlpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { | ||
| 20437 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 20438 | } | ||
| 20439 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20440 | pub const fn gpioelpen(&self) -> super::vals::Ahb4lpenrGpioalpen { | ||
| 20441 | let val = (self.0 >> 4usize) & 0x01; | ||
| 20442 | super::vals::Ahb4lpenrGpioalpen(val as u8) | ||
| 20443 | } | ||
| 20444 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20445 | pub fn set_gpioelpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { | ||
| 20446 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 20447 | } | ||
| 20448 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20449 | pub const fn gpioflpen(&self) -> super::vals::Ahb4lpenrGpioalpen { | ||
| 20450 | let val = (self.0 >> 5usize) & 0x01; | ||
| 20451 | super::vals::Ahb4lpenrGpioalpen(val as u8) | ||
| 20452 | } | ||
| 20453 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20454 | pub fn set_gpioflpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { | ||
| 20455 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 20456 | } | ||
| 20457 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20458 | pub const fn gpioglpen(&self) -> super::vals::Ahb4lpenrGpioalpen { | ||
| 20459 | let val = (self.0 >> 6usize) & 0x01; | ||
| 20460 | super::vals::Ahb4lpenrGpioalpen(val as u8) | ||
| 20461 | } | ||
| 20462 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20463 | pub fn set_gpioglpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { | ||
| 20464 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); | ||
| 20465 | } | ||
| 20466 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20467 | pub const fn gpiohlpen(&self) -> super::vals::Ahb4lpenrGpioalpen { | ||
| 20468 | let val = (self.0 >> 7usize) & 0x01; | ||
| 20469 | super::vals::Ahb4lpenrGpioalpen(val as u8) | ||
| 20470 | } | ||
| 20471 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20472 | pub fn set_gpiohlpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { | ||
| 20473 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 20474 | } | ||
| 20475 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20476 | pub const fn gpioilpen(&self) -> super::vals::Ahb4lpenrGpioalpen { | ||
| 20477 | let val = (self.0 >> 8usize) & 0x01; | ||
| 20478 | super::vals::Ahb4lpenrGpioalpen(val as u8) | ||
| 20479 | } | ||
| 20480 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20481 | pub fn set_gpioilpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { | ||
| 20482 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); | ||
| 20483 | } | ||
| 20484 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20485 | pub const fn gpiojlpen(&self) -> super::vals::Ahb4lpenrGpioalpen { | ||
| 20486 | let val = (self.0 >> 9usize) & 0x01; | ||
| 20487 | super::vals::Ahb4lpenrGpioalpen(val as u8) | ||
| 20488 | } | ||
| 20489 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20490 | pub fn set_gpiojlpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { | ||
| 20491 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | ||
| 20492 | } | ||
| 20493 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20494 | pub const fn gpioklpen(&self) -> super::vals::Ahb4lpenrGpioalpen { | ||
| 20495 | let val = (self.0 >> 10usize) & 0x01; | ||
| 20496 | super::vals::Ahb4lpenrGpioalpen(val as u8) | ||
| 20497 | } | ||
| 20498 | #[doc = "GPIO peripheral clock enable during CSleep mode"] | ||
| 20499 | pub fn set_gpioklpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { | ||
| 20500 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); | ||
| 20501 | } | ||
| 20502 | #[doc = "CRC peripheral clock enable during CSleep mode"] | ||
| 20503 | pub const fn crclpen(&self) -> super::vals::Ahb4lpenrGpioalpen { | ||
| 20504 | let val = (self.0 >> 19usize) & 0x01; | ||
| 20505 | super::vals::Ahb4lpenrGpioalpen(val as u8) | ||
| 20506 | } | ||
| 20507 | #[doc = "CRC peripheral clock enable during CSleep mode"] | ||
| 20508 | pub fn set_crclpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { | ||
| 20509 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); | ||
| 20510 | } | ||
| 20511 | #[doc = "BDMA Clock Enable During CSleep Mode"] | ||
| 20512 | pub const fn bdmalpen(&self) -> super::vals::Ahb4lpenrGpioalpen { | ||
| 20513 | let val = (self.0 >> 21usize) & 0x01; | ||
| 20514 | super::vals::Ahb4lpenrGpioalpen(val as u8) | ||
| 20515 | } | ||
| 20516 | #[doc = "BDMA Clock Enable During CSleep Mode"] | ||
| 20517 | pub fn set_bdmalpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { | ||
| 20518 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize); | ||
| 20519 | } | ||
| 20520 | #[doc = "ADC3 Peripheral Clocks Enable During CSleep Mode"] | ||
| 20521 | pub const fn adc3lpen(&self) -> super::vals::Ahb4lpenrGpioalpen { | ||
| 20522 | let val = (self.0 >> 24usize) & 0x01; | ||
| 20523 | super::vals::Ahb4lpenrGpioalpen(val as u8) | ||
| 20524 | } | ||
| 20525 | #[doc = "ADC3 Peripheral Clocks Enable During CSleep Mode"] | ||
| 20526 | pub fn set_adc3lpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { | ||
| 20527 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); | ||
| 20528 | } | ||
| 20529 | #[doc = "Backup RAM Clock Enable During CSleep Mode"] | ||
| 20530 | pub const fn bkpramlpen(&self) -> super::vals::Ahb4lpenrGpioalpen { | ||
| 13652 | let val = (self.0 >> 28usize) & 0x01; | 20531 | let val = (self.0 >> 28usize) & 0x01; |
| 13653 | val != 0 | 20532 | super::vals::Ahb4lpenrGpioalpen(val as u8) |
| 13654 | } | 20533 | } |
| 13655 | #[doc = "IDMA buffer transfer complete clear bit Set by software to clear the IDMABTC flag."] | 20534 | #[doc = "Backup RAM Clock Enable During CSleep Mode"] |
| 13656 | pub fn set_idmabtcc(&mut self, val: bool) { | 20535 | pub fn set_bkpramlpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { |
| 13657 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize); | 20536 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); |
| 20537 | } | ||
| 20538 | #[doc = "SRAM4 Clock Enable During CSleep Mode"] | ||
| 20539 | pub const fn sram4lpen(&self) -> super::vals::Ahb4lpenrGpioalpen { | ||
| 20540 | let val = (self.0 >> 29usize) & 0x01; | ||
| 20541 | super::vals::Ahb4lpenrGpioalpen(val as u8) | ||
| 20542 | } | ||
| 20543 | #[doc = "SRAM4 Clock Enable During CSleep Mode"] | ||
| 20544 | pub fn set_sram4lpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { | ||
| 20545 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); | ||
| 13658 | } | 20546 | } |
| 13659 | } | 20547 | } |
| 13660 | impl Default for Icr { | 20548 | impl Default for Ahb4lpenr { |
| 13661 | fn default() -> Icr { | 20549 | fn default() -> Ahb4lpenr { |
| 13662 | Icr(0) | 20550 | Ahb4lpenr(0) |
| 13663 | } | 20551 | } |
| 13664 | } | 20552 | } |
| 13665 | #[doc = "The SDMMC_IDMABSIZER register contains the buffers size when in double buffer configuration."] | 20553 | #[doc = "RCC APB1 High Sleep Clock Register"] |
| 13666 | #[repr(transparent)] | 20554 | #[repr(transparent)] |
| 13667 | #[derive(Copy, Clone, Eq, PartialEq)] | 20555 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 13668 | pub struct Idmabsizer(pub u32); | 20556 | pub struct C1Apb1hlpenr(pub u32); |
| 13669 | impl Idmabsizer { | 20557 | impl C1Apb1hlpenr { |
| 13670 | #[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)."] | 20558 | #[doc = "Clock Recovery System peripheral clock enable during CSleep mode"] |
| 13671 | pub const fn idmabndt(&self) -> u8 { | 20559 | pub const fn crslpen(&self) -> super::vals::C1Apb1hlpenrCrslpen { |
| 13672 | let val = (self.0 >> 5usize) & 0xff; | 20560 | let val = (self.0 >> 1usize) & 0x01; |
| 13673 | val as u8 | 20561 | super::vals::C1Apb1hlpenrCrslpen(val as u8) |
| 13674 | } | 20562 | } |
| 13675 | #[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)."] | 20563 | #[doc = "Clock Recovery System peripheral clock enable during CSleep mode"] |
| 13676 | pub fn set_idmabndt(&mut self, val: u8) { | 20564 | pub fn set_crslpen(&mut self, val: super::vals::C1Apb1hlpenrCrslpen) { |
| 13677 | self.0 = (self.0 & !(0xff << 5usize)) | (((val as u32) & 0xff) << 5usize); | 20565 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); |
| 20566 | } | ||
| 20567 | #[doc = "SWPMI Peripheral Clocks Enable During CSleep Mode"] | ||
| 20568 | pub const fn swplpen(&self) -> super::vals::C1Apb1hlpenrCrslpen { | ||
| 20569 | let val = (self.0 >> 2usize) & 0x01; | ||
| 20570 | super::vals::C1Apb1hlpenrCrslpen(val as u8) | ||
| 20571 | } | ||
| 20572 | #[doc = "SWPMI Peripheral Clocks Enable During CSleep Mode"] | ||
| 20573 | pub fn set_swplpen(&mut self, val: super::vals::C1Apb1hlpenrCrslpen) { | ||
| 20574 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 20575 | } | ||
| 20576 | #[doc = "OPAMP peripheral clock enable during CSleep mode"] | ||
| 20577 | pub const fn opamplpen(&self) -> super::vals::C1Apb1hlpenrCrslpen { | ||
| 20578 | let val = (self.0 >> 4usize) & 0x01; | ||
| 20579 | super::vals::C1Apb1hlpenrCrslpen(val as u8) | ||
| 20580 | } | ||
| 20581 | #[doc = "OPAMP peripheral clock enable during CSleep mode"] | ||
| 20582 | pub fn set_opamplpen(&mut self, val: super::vals::C1Apb1hlpenrCrslpen) { | ||
| 20583 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 20584 | } | ||
| 20585 | #[doc = "MDIOS peripheral clock enable during CSleep mode"] | ||
| 20586 | pub const fn mdioslpen(&self) -> super::vals::C1Apb1hlpenrCrslpen { | ||
| 20587 | let val = (self.0 >> 5usize) & 0x01; | ||
| 20588 | super::vals::C1Apb1hlpenrCrslpen(val as u8) | ||
| 20589 | } | ||
| 20590 | #[doc = "MDIOS peripheral clock enable during CSleep mode"] | ||
| 20591 | pub fn set_mdioslpen(&mut self, val: super::vals::C1Apb1hlpenrCrslpen) { | ||
| 20592 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 20593 | } | ||
| 20594 | #[doc = "FDCAN Peripheral Clocks Enable During CSleep Mode"] | ||
| 20595 | pub const fn fdcanlpen(&self) -> super::vals::C1Apb1hlpenrCrslpen { | ||
| 20596 | let val = (self.0 >> 8usize) & 0x01; | ||
| 20597 | super::vals::C1Apb1hlpenrCrslpen(val as u8) | ||
| 20598 | } | ||
| 20599 | #[doc = "FDCAN Peripheral Clocks Enable During CSleep Mode"] | ||
| 20600 | pub fn set_fdcanlpen(&mut self, val: super::vals::C1Apb1hlpenrCrslpen) { | ||
| 20601 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); | ||
| 13678 | } | 20602 | } |
| 13679 | } | 20603 | } |
| 13680 | impl Default for Idmabsizer { | 20604 | impl Default for C1Apb1hlpenr { |
| 13681 | fn default() -> Idmabsizer { | 20605 | fn default() -> C1Apb1hlpenr { |
| 13682 | Idmabsizer(0) | 20606 | C1Apb1hlpenr(0) |
| 13683 | } | 20607 | } |
| 13684 | } | 20608 | } |
| 13685 | #[doc = "The SDMMC_CLKCR register controls the SDMMC_CK output clock, the SDMMC_RX_CLK receive clock, and the bus width."] | 20609 | #[doc = "RCC Clock Recovery RC Register"] |
| 13686 | #[repr(transparent)] | 20610 | #[repr(transparent)] |
| 13687 | #[derive(Copy, Clone, Eq, PartialEq)] | 20611 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 13688 | pub struct Clkcr(pub u32); | 20612 | pub struct Crrcr(pub u32); |
| 13689 | impl Clkcr { | 20613 | impl Crrcr { |
| 13690 | #[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.."] | 20614 | #[doc = "Internal RC 48 MHz clock calibration"] |
| 13691 | pub const fn clkdiv(&self) -> u16 { | 20615 | pub const fn hsi48cal(&self) -> u16 { |
| 13692 | let val = (self.0 >> 0usize) & 0x03ff; | 20616 | let val = (self.0 >> 0usize) & 0x03ff; |
| 13693 | val as u16 | 20617 | val as u16 |
| 13694 | } | 20618 | } |
| 13695 | #[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.."] | 20619 | #[doc = "Internal RC 48 MHz clock calibration"] |
| 13696 | pub fn set_clkdiv(&mut self, val: u16) { | 20620 | pub fn set_hsi48cal(&mut self, val: u16) { |
| 13697 | self.0 = (self.0 & !(0x03ff << 0usize)) | (((val as u32) & 0x03ff) << 0usize); | 20621 | self.0 = (self.0 & !(0x03ff << 0usize)) | (((val as u32) & 0x03ff) << 0usize); |
| 13698 | } | 20622 | } |
| 13699 | #[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:"] | 20623 | } |
| 13700 | pub const fn pwrsav(&self) -> bool { | 20624 | impl Default for Crrcr { |
| 13701 | let val = (self.0 >> 12usize) & 0x01; | 20625 | fn default() -> Crrcr { |
| 13702 | val != 0 | 20626 | Crrcr(0) |
| 13703 | } | 20627 | } |
| 13704 | #[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:"] | 20628 | } |
| 13705 | pub fn set_pwrsav(&mut self, val: bool) { | 20629 | #[doc = "RCC Clock Source Interrupt Enable Register"] |
| 13706 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); | 20630 | #[repr(transparent)] |
| 20631 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 20632 | pub struct Cier(pub u32); | ||
| 20633 | impl Cier { | ||
| 20634 | #[doc = "LSI ready Interrupt Enable"] | ||
| 20635 | pub const fn lsirdyie(&self) -> super::vals::Lsirdyie { | ||
| 20636 | let val = (self.0 >> 0usize) & 0x01; | ||
| 20637 | super::vals::Lsirdyie(val as u8) | ||
| 13707 | } | 20638 | } |
| 13708 | #[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)"] | 20639 | #[doc = "LSI ready Interrupt Enable"] |
| 13709 | pub const fn widbus(&self) -> u8 { | 20640 | pub fn set_lsirdyie(&mut self, val: super::vals::Lsirdyie) { |
| 13710 | let val = (self.0 >> 14usize) & 0x03; | 20641 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 13711 | val as u8 | ||
| 13712 | } | 20642 | } |
| 13713 | #[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)"] | 20643 | #[doc = "LSE ready Interrupt Enable"] |
| 13714 | pub fn set_widbus(&mut self, val: u8) { | 20644 | pub const fn lserdyie(&self) -> super::vals::Lsirdyie { |
| 13715 | self.0 = (self.0 & !(0x03 << 14usize)) | (((val as u32) & 0x03) << 14usize); | 20645 | let val = (self.0 >> 1usize) & 0x01; |
| 20646 | super::vals::Lsirdyie(val as u8) | ||
| 13716 | } | 20647 | } |
| 13717 | #[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."] | 20648 | #[doc = "LSE ready Interrupt Enable"] |
| 13718 | pub const fn negedge(&self) -> bool { | 20649 | pub fn set_lserdyie(&mut self, val: super::vals::Lsirdyie) { |
| 13719 | let val = (self.0 >> 16usize) & 0x01; | 20650 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); |
| 13720 | val != 0 | ||
| 13721 | } | 20651 | } |
| 13722 | #[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."] | 20652 | #[doc = "HSI ready Interrupt Enable"] |
| 13723 | pub fn set_negedge(&mut self, val: bool) { | 20653 | pub const fn hsirdyie(&self) -> super::vals::Lsirdyie { |
| 13724 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | 20654 | let val = (self.0 >> 2usize) & 0x01; |
| 20655 | super::vals::Lsirdyie(val as u8) | ||
| 13725 | } | 20656 | } |
| 13726 | #[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."] | 20657 | #[doc = "HSI ready Interrupt Enable"] |
| 13727 | pub const fn hwfc_en(&self) -> bool { | 20658 | pub fn set_hsirdyie(&mut self, val: super::vals::Lsirdyie) { |
| 13728 | let val = (self.0 >> 17usize) & 0x01; | 20659 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); |
| 13729 | val != 0 | ||
| 13730 | } | 20660 | } |
| 13731 | #[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."] | 20661 | #[doc = "HSE ready Interrupt Enable"] |
| 13732 | pub fn set_hwfc_en(&mut self, val: bool) { | 20662 | pub const fn hserdyie(&self) -> super::vals::Lsirdyie { |
| 13733 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); | 20663 | let val = (self.0 >> 3usize) & 0x01; |
| 20664 | super::vals::Lsirdyie(val as u8) | ||
| 13734 | } | 20665 | } |
| 13735 | #[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)"] | 20666 | #[doc = "HSE ready Interrupt Enable"] |
| 13736 | pub const fn ddr(&self) -> bool { | 20667 | pub fn set_hserdyie(&mut self, val: super::vals::Lsirdyie) { |
| 13737 | let val = (self.0 >> 18usize) & 0x01; | 20668 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); |
| 13738 | val != 0 | ||
| 13739 | } | 20669 | } |
| 13740 | #[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)"] | 20670 | #[doc = "CSI ready Interrupt Enable"] |
| 13741 | pub fn set_ddr(&mut self, val: bool) { | 20671 | pub const fn csirdyie(&self) -> super::vals::Lsirdyie { |
| 13742 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); | 20672 | let val = (self.0 >> 4usize) & 0x01; |
| 20673 | super::vals::Lsirdyie(val as u8) | ||
| 13743 | } | 20674 | } |
| 13744 | #[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)"] | 20675 | #[doc = "CSI ready Interrupt Enable"] |
| 13745 | pub const fn busspeed(&self) -> bool { | 20676 | pub fn set_csirdyie(&mut self, val: super::vals::Lsirdyie) { |
| 13746 | let val = (self.0 >> 19usize) & 0x01; | 20677 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); |
| 13747 | val != 0 | ||
| 13748 | } | 20678 | } |
| 13749 | #[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)"] | 20679 | #[doc = "RC48 ready Interrupt Enable"] |
| 13750 | pub fn set_busspeed(&mut self, val: bool) { | 20680 | pub const fn hsi48rdyie(&self) -> super::vals::Lsirdyie { |
| 13751 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); | 20681 | let val = (self.0 >> 5usize) & 0x01; |
| 20682 | super::vals::Lsirdyie(val as u8) | ||
| 13752 | } | 20683 | } |
| 13753 | #[doc = "Receive clock selection. These bits can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"] | 20684 | #[doc = "RC48 ready Interrupt Enable"] |
| 13754 | pub const fn selclkrx(&self) -> u8 { | 20685 | pub fn set_hsi48rdyie(&mut self, val: super::vals::Lsirdyie) { |
| 13755 | let val = (self.0 >> 20usize) & 0x03; | 20686 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); |
| 13756 | val as u8 | ||
| 13757 | } | 20687 | } |
| 13758 | #[doc = "Receive clock selection. These bits can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"] | 20688 | #[doc = "PLL1 ready Interrupt Enable"] |
| 13759 | pub fn set_selclkrx(&mut self, val: u8) { | 20689 | pub fn pllrdyie(&self, n: usize) -> super::vals::Lsirdyie { |
| 13760 | self.0 = (self.0 & !(0x03 << 20usize)) | (((val as u32) & 0x03) << 20usize); | 20690 | assert!(n < 3usize); |
| 20691 | let offs = 6usize + n * 1usize; | ||
| 20692 | let val = (self.0 >> offs) & 0x01; | ||
| 20693 | super::vals::Lsirdyie(val as u8) | ||
| 20694 | } | ||
| 20695 | #[doc = "PLL1 ready Interrupt Enable"] | ||
| 20696 | pub fn set_pllrdyie(&mut self, n: usize, val: super::vals::Lsirdyie) { | ||
| 20697 | assert!(n < 3usize); | ||
| 20698 | let offs = 6usize + n * 1usize; | ||
| 20699 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 20700 | } | ||
| 20701 | #[doc = "LSE clock security system Interrupt Enable"] | ||
| 20702 | pub const fn lsecssie(&self) -> super::vals::Lsirdyie { | ||
| 20703 | let val = (self.0 >> 9usize) & 0x01; | ||
| 20704 | super::vals::Lsirdyie(val as u8) | ||
| 20705 | } | ||
| 20706 | #[doc = "LSE clock security system Interrupt Enable"] | ||
| 20707 | pub fn set_lsecssie(&mut self, val: super::vals::Lsirdyie) { | ||
| 20708 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | ||
| 13761 | } | 20709 | } |
| 13762 | } | 20710 | } |
| 13763 | impl Default for Clkcr { | 20711 | impl Default for Cier { |
| 13764 | fn default() -> Clkcr { | 20712 | fn default() -> Cier { |
| 13765 | Clkcr(0) | 20713 | Cier(0) |
| 13766 | } | 20714 | } |
| 13767 | } | 20715 | } |
| 13768 | #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] | 20716 | #[doc = "RCC Domain 1 Kernel Clock Configuration Register"] |
| 13769 | #[repr(transparent)] | 20717 | #[repr(transparent)] |
| 13770 | #[derive(Copy, Clone, Eq, PartialEq)] | 20718 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 13771 | pub struct Resp2r(pub u32); | 20719 | pub struct D1ccipr(pub u32); |
| 13772 | impl Resp2r { | 20720 | impl D1ccipr { |
| 13773 | #[doc = "see Table404."] | 20721 | #[doc = "FMC kernel clock source selection"] |
| 13774 | pub const fn cardstatus2(&self) -> u32 { | 20722 | pub const fn fmcsel(&self) -> super::vals::Fmcsel { |
| 13775 | let val = (self.0 >> 0usize) & 0xffff_ffff; | 20723 | let val = (self.0 >> 0usize) & 0x03; |
| 13776 | val as u32 | 20724 | super::vals::Fmcsel(val as u8) |
| 13777 | } | 20725 | } |
| 13778 | #[doc = "see Table404."] | 20726 | #[doc = "FMC kernel clock source selection"] |
| 13779 | pub fn set_cardstatus2(&mut self, val: u32) { | 20727 | pub fn set_fmcsel(&mut self, val: super::vals::Fmcsel) { |
| 13780 | self.0 = | 20728 | self.0 = (self.0 & !(0x03 << 0usize)) | (((val.0 as u32) & 0x03) << 0usize); |
| 13781 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | 20729 | } |
| 20730 | #[doc = "QUADSPI kernel clock source selection"] | ||
| 20731 | pub const fn qspisel(&self) -> super::vals::Fmcsel { | ||
| 20732 | let val = (self.0 >> 4usize) & 0x03; | ||
| 20733 | super::vals::Fmcsel(val as u8) | ||
| 20734 | } | ||
| 20735 | #[doc = "QUADSPI kernel clock source selection"] | ||
| 20736 | pub fn set_qspisel(&mut self, val: super::vals::Fmcsel) { | ||
| 20737 | self.0 = (self.0 & !(0x03 << 4usize)) | (((val.0 as u32) & 0x03) << 4usize); | ||
| 20738 | } | ||
| 20739 | #[doc = "SDMMC kernel clock source selection"] | ||
| 20740 | pub const fn sdmmcsel(&self) -> super::vals::Sdmmcsel { | ||
| 20741 | let val = (self.0 >> 16usize) & 0x01; | ||
| 20742 | super::vals::Sdmmcsel(val as u8) | ||
| 20743 | } | ||
| 20744 | #[doc = "SDMMC kernel clock source selection"] | ||
| 20745 | pub fn set_sdmmcsel(&mut self, val: super::vals::Sdmmcsel) { | ||
| 20746 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 20747 | } | ||
| 20748 | #[doc = "per_ck clock source selection"] | ||
| 20749 | pub const fn ckpersel(&self) -> super::vals::Ckpersel { | ||
| 20750 | let val = (self.0 >> 28usize) & 0x03; | ||
| 20751 | super::vals::Ckpersel(val as u8) | ||
| 20752 | } | ||
| 20753 | #[doc = "per_ck clock source selection"] | ||
| 20754 | pub fn set_ckpersel(&mut self, val: super::vals::Ckpersel) { | ||
| 20755 | self.0 = (self.0 & !(0x03 << 28usize)) | (((val.0 as u32) & 0x03) << 28usize); | ||
| 13782 | } | 20756 | } |
| 13783 | } | 20757 | } |
| 13784 | impl Default for Resp2r { | 20758 | impl Default for D1ccipr { |
| 13785 | fn default() -> Resp2r { | 20759 | fn default() -> D1ccipr { |
| 13786 | Resp2r(0) | 20760 | D1ccipr(0) |
| 13787 | } | 20761 | } |
| 13788 | } | 20762 | } |
| 13789 | #[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)"] | 20763 | #[doc = "RCC APB1 Peripheral Reset Register"] |
| 13790 | #[repr(transparent)] | 20764 | #[repr(transparent)] |
| 13791 | #[derive(Copy, Clone, Eq, PartialEq)] | 20765 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 13792 | pub struct Star(pub u32); | 20766 | pub struct Apb1lrstr(pub u32); |
| 13793 | impl Star { | 20767 | impl Apb1lrstr { |
| 13794 | #[doc = "Command response received (CRC check failed). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 20768 | #[doc = "TIM block reset"] |
| 13795 | pub const fn ccrcfail(&self) -> bool { | 20769 | pub const fn tim2rst(&self) -> super::vals::Tim2rst { |
| 13796 | let val = (self.0 >> 0usize) & 0x01; | 20770 | let val = (self.0 >> 0usize) & 0x01; |
| 13797 | val != 0 | 20771 | super::vals::Tim2rst(val as u8) |
| 13798 | } | 20772 | } |
| 13799 | #[doc = "Command response received (CRC check failed). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 20773 | #[doc = "TIM block reset"] |
| 13800 | pub fn set_ccrcfail(&mut self, val: bool) { | 20774 | pub fn set_tim2rst(&mut self, val: super::vals::Tim2rst) { |
| 13801 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 20775 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 13802 | } | 20776 | } |
| 13803 | #[doc = "Data block sent/received (CRC check failed). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 20777 | #[doc = "TIM block reset"] |
| 13804 | pub const fn dcrcfail(&self) -> bool { | 20778 | pub const fn tim3rst(&self) -> super::vals::Tim2rst { |
| 13805 | let val = (self.0 >> 1usize) & 0x01; | 20779 | let val = (self.0 >> 1usize) & 0x01; |
| 13806 | val != 0 | 20780 | super::vals::Tim2rst(val as u8) |
| 13807 | } | 20781 | } |
| 13808 | #[doc = "Data block sent/received (CRC check failed). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 20782 | #[doc = "TIM block reset"] |
| 13809 | pub fn set_dcrcfail(&mut self, val: bool) { | 20783 | pub fn set_tim3rst(&mut self, val: super::vals::Tim2rst) { |
| 13810 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 20784 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); |
| 13811 | } | 20785 | } |
| 13812 | #[doc = "Command response timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR. The Command Timeout period has a fixed value of 64 SDMMC_CK clock periods."] | 20786 | #[doc = "TIM block reset"] |
| 13813 | pub const fn ctimeout(&self) -> bool { | 20787 | pub const fn tim4rst(&self) -> super::vals::Tim2rst { |
| 13814 | let val = (self.0 >> 2usize) & 0x01; | 20788 | let val = (self.0 >> 2usize) & 0x01; |
| 13815 | val != 0 | 20789 | super::vals::Tim2rst(val as u8) |
| 13816 | } | 20790 | } |
| 13817 | #[doc = "Command response timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR. The Command Timeout period has a fixed value of 64 SDMMC_CK clock periods."] | 20791 | #[doc = "TIM block reset"] |
| 13818 | pub fn set_ctimeout(&mut self, val: bool) { | 20792 | pub fn set_tim4rst(&mut self, val: super::vals::Tim2rst) { |
| 13819 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 20793 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); |
| 13820 | } | 20794 | } |
| 13821 | #[doc = "Data timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 20795 | #[doc = "TIM block reset"] |
| 13822 | pub const fn dtimeout(&self) -> bool { | 20796 | pub const fn tim5rst(&self) -> super::vals::Tim2rst { |
| 13823 | let val = (self.0 >> 3usize) & 0x01; | 20797 | let val = (self.0 >> 3usize) & 0x01; |
| 13824 | val != 0 | 20798 | super::vals::Tim2rst(val as u8) |
| 13825 | } | 20799 | } |
| 13826 | #[doc = "Data timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 20800 | #[doc = "TIM block reset"] |
| 13827 | pub fn set_dtimeout(&mut self, val: bool) { | 20801 | pub fn set_tim5rst(&mut self, val: super::vals::Tim2rst) { |
| 13828 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 20802 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); |
| 13829 | } | 20803 | } |
| 13830 | #[doc = "Transmit FIFO underrun error or IDMA read transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 20804 | #[doc = "TIM block reset"] |
| 13831 | pub const fn txunderr(&self) -> bool { | 20805 | pub const fn tim6rst(&self) -> super::vals::Tim2rst { |
| 13832 | let val = (self.0 >> 4usize) & 0x01; | 20806 | let val = (self.0 >> 4usize) & 0x01; |
| 13833 | val != 0 | 20807 | super::vals::Tim2rst(val as u8) |
| 13834 | } | 20808 | } |
| 13835 | #[doc = "Transmit FIFO underrun error or IDMA read transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 20809 | #[doc = "TIM block reset"] |
| 13836 | pub fn set_txunderr(&mut self, val: bool) { | 20810 | pub fn set_tim6rst(&mut self, val: super::vals::Tim2rst) { |
| 13837 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 20811 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); |
| 13838 | } | 20812 | } |
| 13839 | #[doc = "Received FIFO overrun error or IDMA write transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 20813 | #[doc = "TIM block reset"] |
| 13840 | pub const fn rxoverr(&self) -> bool { | 20814 | pub const fn tim7rst(&self) -> super::vals::Tim2rst { |
| 13841 | let val = (self.0 >> 5usize) & 0x01; | 20815 | let val = (self.0 >> 5usize) & 0x01; |
| 13842 | val != 0 | 20816 | super::vals::Tim2rst(val as u8) |
| 13843 | } | 20817 | } |
| 13844 | #[doc = "Received FIFO overrun error or IDMA write transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 20818 | #[doc = "TIM block reset"] |
| 13845 | pub fn set_rxoverr(&mut self, val: bool) { | 20819 | pub fn set_tim7rst(&mut self, val: super::vals::Tim2rst) { |
| 13846 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 20820 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); |
| 13847 | } | 20821 | } |
| 13848 | #[doc = "Command response received (CRC check passed, or no CRC). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 20822 | #[doc = "TIM block reset"] |
| 13849 | pub const fn cmdrend(&self) -> bool { | 20823 | pub const fn tim12rst(&self) -> super::vals::Tim2rst { |
| 13850 | let val = (self.0 >> 6usize) & 0x01; | 20824 | let val = (self.0 >> 6usize) & 0x01; |
| 13851 | val != 0 | 20825 | super::vals::Tim2rst(val as u8) |
| 13852 | } | 20826 | } |
| 13853 | #[doc = "Command response received (CRC check passed, or no CRC). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 20827 | #[doc = "TIM block reset"] |
| 13854 | pub fn set_cmdrend(&mut self, val: bool) { | 20828 | pub fn set_tim12rst(&mut self, val: super::vals::Tim2rst) { |
| 13855 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 20829 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); |
| 13856 | } | 20830 | } |
| 13857 | #[doc = "Command sent (no response required). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 20831 | #[doc = "TIM block reset"] |
| 13858 | pub const fn cmdsent(&self) -> bool { | 20832 | pub const fn tim13rst(&self) -> super::vals::Tim2rst { |
| 13859 | let val = (self.0 >> 7usize) & 0x01; | 20833 | let val = (self.0 >> 7usize) & 0x01; |
| 13860 | val != 0 | 20834 | super::vals::Tim2rst(val as u8) |
| 13861 | } | 20835 | } |
| 13862 | #[doc = "Command sent (no response required). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 20836 | #[doc = "TIM block reset"] |
| 13863 | pub fn set_cmdsent(&mut self, val: bool) { | 20837 | pub fn set_tim13rst(&mut self, val: super::vals::Tim2rst) { |
| 13864 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 20838 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); |
| 13865 | } | 20839 | } |
| 13866 | #[doc = "Data transfer ended correctly. (data counter, DATACOUNT is zero and no errors occur). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 20840 | #[doc = "TIM block reset"] |
| 13867 | pub const fn dataend(&self) -> bool { | 20841 | pub const fn tim14rst(&self) -> super::vals::Tim2rst { |
| 13868 | let val = (self.0 >> 8usize) & 0x01; | 20842 | let val = (self.0 >> 8usize) & 0x01; |
| 13869 | val != 0 | 20843 | super::vals::Tim2rst(val as u8) |
| 13870 | } | 20844 | } |
| 13871 | #[doc = "Data transfer ended correctly. (data counter, DATACOUNT is zero and no errors occur). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 20845 | #[doc = "TIM block reset"] |
| 13872 | pub fn set_dataend(&mut self, val: bool) { | 20846 | pub fn set_tim14rst(&mut self, val: super::vals::Tim2rst) { |
| 13873 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 20847 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); |
| 13874 | } | 20848 | } |
| 13875 | #[doc = "Data transfer Hold. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 20849 | #[doc = "TIM block reset"] |
| 13876 | pub const fn dhold(&self) -> bool { | 20850 | pub const fn lptim1rst(&self) -> super::vals::Tim2rst { |
| 13877 | let val = (self.0 >> 9usize) & 0x01; | 20851 | let val = (self.0 >> 9usize) & 0x01; |
| 13878 | val != 0 | 20852 | super::vals::Tim2rst(val as u8) |
| 13879 | } | 20853 | } |
| 13880 | #[doc = "Data transfer Hold. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 20854 | #[doc = "TIM block reset"] |
| 13881 | pub fn set_dhold(&mut self, val: bool) { | 20855 | pub fn set_lptim1rst(&mut self, val: super::vals::Tim2rst) { |
| 13882 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | 20856 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); |
| 13883 | } | 20857 | } |
| 13884 | #[doc = "Data block sent/received. (CRC check passed) and DPSM moves to the READWAIT state. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 20858 | #[doc = "SPI2 block reset"] |
| 13885 | pub const fn dbckend(&self) -> bool { | 20859 | pub const fn spi2rst(&self) -> super::vals::Tim2rst { |
| 13886 | let val = (self.0 >> 10usize) & 0x01; | 20860 | let val = (self.0 >> 14usize) & 0x01; |
| 13887 | val != 0 | 20861 | super::vals::Tim2rst(val as u8) |
| 13888 | } | 20862 | } |
| 13889 | #[doc = "Data block sent/received. (CRC check passed) and DPSM moves to the READWAIT state. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 20863 | #[doc = "SPI2 block reset"] |
| 13890 | pub fn set_dbckend(&mut self, val: bool) { | 20864 | pub fn set_spi2rst(&mut self, val: super::vals::Tim2rst) { |
| 13891 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | 20865 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); |
| 13892 | } | 20866 | } |
| 13893 | #[doc = "Data transfer aborted by CMD12. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 20867 | #[doc = "SPI3 block reset"] |
| 13894 | pub const fn dabort(&self) -> bool { | 20868 | pub const fn spi3rst(&self) -> super::vals::Tim2rst { |
| 13895 | let val = (self.0 >> 11usize) & 0x01; | 20869 | let val = (self.0 >> 15usize) & 0x01; |
| 13896 | val != 0 | 20870 | super::vals::Tim2rst(val as u8) |
| 13897 | } | 20871 | } |
| 13898 | #[doc = "Data transfer aborted by CMD12. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 20872 | #[doc = "SPI3 block reset"] |
| 13899 | pub fn set_dabort(&mut self, val: bool) { | 20873 | pub fn set_spi3rst(&mut self, val: super::vals::Tim2rst) { |
| 13900 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); | 20874 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); |
| 13901 | } | 20875 | } |
| 13902 | #[doc = "Data path state machine active, i.e. not in Idle state. This is a hardware status flag only, does not generate an interrupt."] | 20876 | #[doc = "SPDIFRX block reset"] |
| 13903 | pub const fn dpsmact(&self) -> bool { | 20877 | pub const fn spdifrxrst(&self) -> super::vals::Tim2rst { |
| 13904 | let val = (self.0 >> 12usize) & 0x01; | 20878 | let val = (self.0 >> 16usize) & 0x01; |
| 13905 | val != 0 | 20879 | super::vals::Tim2rst(val as u8) |
| 13906 | } | 20880 | } |
| 13907 | #[doc = "Data path state machine active, i.e. not in Idle state. This is a hardware status flag only, does not generate an interrupt."] | 20881 | #[doc = "SPDIFRX block reset"] |
| 13908 | pub fn set_dpsmact(&mut self, val: bool) { | 20882 | pub fn set_spdifrxrst(&mut self, val: super::vals::Tim2rst) { |
| 13909 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); | 20883 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); |
| 13910 | } | 20884 | } |
| 13911 | #[doc = "Command path state machine active, i.e. not in Idle state. This is a hardware status flag only, does not generate an interrupt."] | 20885 | #[doc = "USART2 block reset"] |
| 13912 | pub const fn cpsmact(&self) -> bool { | 20886 | pub const fn usart2rst(&self) -> super::vals::Tim2rst { |
| 13913 | let val = (self.0 >> 13usize) & 0x01; | 20887 | let val = (self.0 >> 17usize) & 0x01; |
| 13914 | val != 0 | 20888 | super::vals::Tim2rst(val as u8) |
| 13915 | } | 20889 | } |
| 13916 | #[doc = "Command path state machine active, i.e. not in Idle state. This is a hardware status flag only, does not generate an interrupt."] | 20890 | #[doc = "USART2 block reset"] |
| 13917 | pub fn set_cpsmact(&mut self, val: bool) { | 20891 | pub fn set_usart2rst(&mut self, val: super::vals::Tim2rst) { |
| 13918 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | 20892 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize); |
| 13919 | } | 20893 | } |
| 13920 | #[doc = "Transmit FIFO half empty At least half the number of words can be written into the FIFO. This bit is cleared when the FIFO becomes half+1 full."] | 20894 | #[doc = "USART3 block reset"] |
| 13921 | pub const fn txfifohe(&self) -> bool { | 20895 | pub const fn usart3rst(&self) -> super::vals::Tim2rst { |
| 13922 | let val = (self.0 >> 14usize) & 0x01; | 20896 | let val = (self.0 >> 18usize) & 0x01; |
| 13923 | val != 0 | 20897 | super::vals::Tim2rst(val as u8) |
| 13924 | } | 20898 | } |
| 13925 | #[doc = "Transmit FIFO half empty At least half the number of words can be written into the FIFO. This bit is cleared when the FIFO becomes half+1 full."] | 20899 | #[doc = "USART3 block reset"] |
| 13926 | pub fn set_txfifohe(&mut self, val: bool) { | 20900 | pub fn set_usart3rst(&mut self, val: super::vals::Tim2rst) { |
| 13927 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | 20901 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize); |
| 13928 | } | 20902 | } |
| 13929 | #[doc = "Receive FIFO half full There are at least half the number of words in the FIFO. This bit is cleared when the FIFO becomes half+1 empty."] | 20903 | #[doc = "UART4 block reset"] |
| 13930 | pub const fn rxfifohf(&self) -> bool { | 20904 | pub const fn uart4rst(&self) -> super::vals::Tim2rst { |
| 13931 | let val = (self.0 >> 15usize) & 0x01; | 20905 | let val = (self.0 >> 19usize) & 0x01; |
| 13932 | val != 0 | 20906 | super::vals::Tim2rst(val as u8) |
| 13933 | } | 20907 | } |
| 13934 | #[doc = "Receive FIFO half full There are at least half the number of words in the FIFO. This bit is cleared when the FIFO becomes half+1 empty."] | 20908 | #[doc = "UART4 block reset"] |
| 13935 | pub fn set_rxfifohf(&mut self, val: bool) { | 20909 | pub fn set_uart4rst(&mut self, val: super::vals::Tim2rst) { |
| 13936 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); | 20910 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); |
| 13937 | } | 20911 | } |
| 13938 | #[doc = "Transmit FIFO full This is a hardware status flag only, does not generate an interrupt. This bit is cleared when one FIFO location becomes empty."] | 20912 | #[doc = "UART5 block reset"] |
| 13939 | pub const fn txfifof(&self) -> bool { | 20913 | pub const fn uart5rst(&self) -> super::vals::Tim2rst { |
| 20914 | let val = (self.0 >> 20usize) & 0x01; | ||
| 20915 | super::vals::Tim2rst(val as u8) | ||
| 20916 | } | ||
| 20917 | #[doc = "UART5 block reset"] | ||
| 20918 | pub fn set_uart5rst(&mut self, val: super::vals::Tim2rst) { | ||
| 20919 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize); | ||
| 20920 | } | ||
| 20921 | #[doc = "I2C1 block reset"] | ||
| 20922 | pub const fn i2c1rst(&self) -> super::vals::Tim2rst { | ||
| 20923 | let val = (self.0 >> 21usize) & 0x01; | ||
| 20924 | super::vals::Tim2rst(val as u8) | ||
| 20925 | } | ||
| 20926 | #[doc = "I2C1 block reset"] | ||
| 20927 | pub fn set_i2c1rst(&mut self, val: super::vals::Tim2rst) { | ||
| 20928 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize); | ||
| 20929 | } | ||
| 20930 | #[doc = "I2C2 block reset"] | ||
| 20931 | pub const fn i2c2rst(&self) -> super::vals::Tim2rst { | ||
| 20932 | let val = (self.0 >> 22usize) & 0x01; | ||
| 20933 | super::vals::Tim2rst(val as u8) | ||
| 20934 | } | ||
| 20935 | #[doc = "I2C2 block reset"] | ||
| 20936 | pub fn set_i2c2rst(&mut self, val: super::vals::Tim2rst) { | ||
| 20937 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize); | ||
| 20938 | } | ||
| 20939 | #[doc = "I2C3 block reset"] | ||
| 20940 | pub const fn i2c3rst(&self) -> super::vals::Tim2rst { | ||
| 20941 | let val = (self.0 >> 23usize) & 0x01; | ||
| 20942 | super::vals::Tim2rst(val as u8) | ||
| 20943 | } | ||
| 20944 | #[doc = "I2C3 block reset"] | ||
| 20945 | pub fn set_i2c3rst(&mut self, val: super::vals::Tim2rst) { | ||
| 20946 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize); | ||
| 20947 | } | ||
| 20948 | #[doc = "HDMI-CEC block reset"] | ||
| 20949 | pub const fn cecrst(&self) -> super::vals::Tim2rst { | ||
| 20950 | let val = (self.0 >> 27usize) & 0x01; | ||
| 20951 | super::vals::Tim2rst(val as u8) | ||
| 20952 | } | ||
| 20953 | #[doc = "HDMI-CEC block reset"] | ||
| 20954 | pub fn set_cecrst(&mut self, val: super::vals::Tim2rst) { | ||
| 20955 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize); | ||
| 20956 | } | ||
| 20957 | #[doc = "DAC1 and 2 Blocks Reset"] | ||
| 20958 | pub const fn dac12rst(&self) -> super::vals::Tim2rst { | ||
| 20959 | let val = (self.0 >> 29usize) & 0x01; | ||
| 20960 | super::vals::Tim2rst(val as u8) | ||
| 20961 | } | ||
| 20962 | #[doc = "DAC1 and 2 Blocks Reset"] | ||
| 20963 | pub fn set_dac12rst(&mut self, val: super::vals::Tim2rst) { | ||
| 20964 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); | ||
| 20965 | } | ||
| 20966 | #[doc = "UART7 block reset"] | ||
| 20967 | pub const fn uart7rst(&self) -> super::vals::Tim2rst { | ||
| 20968 | let val = (self.0 >> 30usize) & 0x01; | ||
| 20969 | super::vals::Tim2rst(val as u8) | ||
| 20970 | } | ||
| 20971 | #[doc = "UART7 block reset"] | ||
| 20972 | pub fn set_uart7rst(&mut self, val: super::vals::Tim2rst) { | ||
| 20973 | self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize); | ||
| 20974 | } | ||
| 20975 | #[doc = "UART8 block reset"] | ||
| 20976 | pub const fn uart8rst(&self) -> super::vals::Tim2rst { | ||
| 20977 | let val = (self.0 >> 31usize) & 0x01; | ||
| 20978 | super::vals::Tim2rst(val as u8) | ||
| 20979 | } | ||
| 20980 | #[doc = "UART8 block reset"] | ||
| 20981 | pub fn set_uart8rst(&mut self, val: super::vals::Tim2rst) { | ||
| 20982 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize); | ||
| 20983 | } | ||
| 20984 | } | ||
| 20985 | impl Default for Apb1lrstr { | ||
| 20986 | fn default() -> Apb1lrstr { | ||
| 20987 | Apb1lrstr(0) | ||
| 20988 | } | ||
| 20989 | } | ||
| 20990 | #[doc = "RCC Reset Status Register"] | ||
| 20991 | #[repr(transparent)] | ||
| 20992 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 20993 | pub struct Rsr(pub u32); | ||
| 20994 | impl Rsr { | ||
| 20995 | #[doc = "Remove reset flag"] | ||
| 20996 | pub const fn rmvf(&self) -> super::vals::RsrRmvf { | ||
| 13940 | let val = (self.0 >> 16usize) & 0x01; | 20997 | let val = (self.0 >> 16usize) & 0x01; |
| 13941 | val != 0 | 20998 | super::vals::RsrRmvf(val as u8) |
| 13942 | } | 20999 | } |
| 13943 | #[doc = "Transmit FIFO full This is a hardware status flag only, does not generate an interrupt. This bit is cleared when one FIFO location becomes empty."] | 21000 | #[doc = "Remove reset flag"] |
| 13944 | pub fn set_txfifof(&mut self, val: bool) { | 21001 | pub fn set_rmvf(&mut self, val: super::vals::RsrRmvf) { |
| 13945 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | 21002 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); |
| 13946 | } | 21003 | } |
| 13947 | #[doc = "Receive FIFO full This bit is cleared when one FIFO location becomes empty."] | 21004 | #[doc = "CPU reset flag"] |
| 13948 | pub const fn rxfifof(&self) -> bool { | 21005 | pub const fn cpurstf(&self) -> bool { |
| 13949 | let val = (self.0 >> 17usize) & 0x01; | 21006 | let val = (self.0 >> 17usize) & 0x01; |
| 13950 | val != 0 | 21007 | val != 0 |
| 13951 | } | 21008 | } |
| 13952 | #[doc = "Receive FIFO full This bit is cleared when one FIFO location becomes empty."] | 21009 | #[doc = "CPU reset flag"] |
| 13953 | pub fn set_rxfifof(&mut self, val: bool) { | 21010 | pub fn set_cpurstf(&mut self, val: bool) { |
| 13954 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); | 21011 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); |
| 13955 | } | 21012 | } |
| 13956 | #[doc = "Transmit FIFO empty This bit is cleared when one FIFO location becomes full."] | 21013 | #[doc = "D1 domain power switch reset flag"] |
| 13957 | pub const fn txfifoe(&self) -> bool { | 21014 | pub const fn d1rstf(&self) -> bool { |
| 13958 | let val = (self.0 >> 18usize) & 0x01; | ||
| 13959 | val != 0 | ||
| 13960 | } | ||
| 13961 | #[doc = "Transmit FIFO empty This bit is cleared when one FIFO location becomes full."] | ||
| 13962 | pub fn set_txfifoe(&mut self, val: bool) { | ||
| 13963 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); | ||
| 13964 | } | ||
| 13965 | #[doc = "Receive FIFO empty This is a hardware status flag only, does not generate an interrupt. This bit is cleared when one FIFO location becomes full."] | ||
| 13966 | pub const fn rxfifoe(&self) -> bool { | ||
| 13967 | let val = (self.0 >> 19usize) & 0x01; | 21015 | let val = (self.0 >> 19usize) & 0x01; |
| 13968 | val != 0 | 21016 | val != 0 |
| 13969 | } | 21017 | } |
| 13970 | #[doc = "Receive FIFO empty This is a hardware status flag only, does not generate an interrupt. This bit is cleared when one FIFO location becomes full."] | 21018 | #[doc = "D1 domain power switch reset flag"] |
| 13971 | pub fn set_rxfifoe(&mut self, val: bool) { | 21019 | pub fn set_d1rstf(&mut self, val: bool) { |
| 13972 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); | 21020 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); |
| 13973 | } | 21021 | } |
| 13974 | #[doc = "Inverted value of SDMMC_D0 line (Busy), sampled at the end of a CMD response and a second time 2 SDMMC_CK cycles after the CMD response. This bit is reset to not busy when the SDMMCD0 line changes from busy to not busy. This bit does not signal busy due to data transfer. This is a hardware status flag only, it does not generate an interrupt."] | 21022 | #[doc = "D2 domain power switch reset flag"] |
| 13975 | pub const fn busyd0(&self) -> bool { | 21023 | pub const fn d2rstf(&self) -> bool { |
| 13976 | let val = (self.0 >> 20usize) & 0x01; | 21024 | let val = (self.0 >> 20usize) & 0x01; |
| 13977 | val != 0 | 21025 | val != 0 |
| 13978 | } | 21026 | } |
| 13979 | #[doc = "Inverted value of SDMMC_D0 line (Busy), sampled at the end of a CMD response and a second time 2 SDMMC_CK cycles after the CMD response. This bit is reset to not busy when the SDMMCD0 line changes from busy to not busy. This bit does not signal busy due to data transfer. This is a hardware status flag only, it does not generate an interrupt."] | 21027 | #[doc = "D2 domain power switch reset flag"] |
| 13980 | pub fn set_busyd0(&mut self, val: bool) { | 21028 | pub fn set_d2rstf(&mut self, val: bool) { |
| 13981 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); | 21029 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); |
| 13982 | } | 21030 | } |
| 13983 | #[doc = "end of SDMMC_D0 Busy following a CMD response detected. This indicates only end of busy following a CMD response. This bit does not signal busy due to data transfer. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 21031 | #[doc = "BOR reset flag"] |
| 13984 | pub const fn busyd0end(&self) -> bool { | 21032 | pub const fn borrstf(&self) -> bool { |
| 13985 | let val = (self.0 >> 21usize) & 0x01; | 21033 | let val = (self.0 >> 21usize) & 0x01; |
| 13986 | val != 0 | 21034 | val != 0 |
| 13987 | } | 21035 | } |
| 13988 | #[doc = "end of SDMMC_D0 Busy following a CMD response detected. This indicates only end of busy following a CMD response. This bit does not signal busy due to data transfer. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 21036 | #[doc = "BOR reset flag"] |
| 13989 | pub fn set_busyd0end(&mut self, val: bool) { | 21037 | pub fn set_borrstf(&mut self, val: bool) { |
| 13990 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); | 21038 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); |
| 13991 | } | 21039 | } |
| 13992 | #[doc = "SDIO interrupt received. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 21040 | #[doc = "Pin reset flag (NRST)"] |
| 13993 | pub const fn sdioit(&self) -> bool { | 21041 | pub const fn pinrstf(&self) -> bool { |
| 13994 | let val = (self.0 >> 22usize) & 0x01; | 21042 | let val = (self.0 >> 22usize) & 0x01; |
| 13995 | val != 0 | 21043 | val != 0 |
| 13996 | } | 21044 | } |
| 13997 | #[doc = "SDIO interrupt received. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 21045 | #[doc = "Pin reset flag (NRST)"] |
| 13998 | pub fn set_sdioit(&mut self, val: bool) { | 21046 | pub fn set_pinrstf(&mut self, val: bool) { |
| 13999 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); | 21047 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); |
| 14000 | } | 21048 | } |
| 14001 | #[doc = "Boot acknowledgment received (boot acknowledgment check fail). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 21049 | #[doc = "POR/PDR reset flag"] |
| 14002 | pub const fn ackfail(&self) -> bool { | 21050 | pub const fn porrstf(&self) -> bool { |
| 14003 | let val = (self.0 >> 23usize) & 0x01; | 21051 | let val = (self.0 >> 23usize) & 0x01; |
| 14004 | val != 0 | 21052 | val != 0 |
| 14005 | } | 21053 | } |
| 14006 | #[doc = "Boot acknowledgment received (boot acknowledgment check fail). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 21054 | #[doc = "POR/PDR reset flag"] |
| 14007 | pub fn set_ackfail(&mut self, val: bool) { | 21055 | pub fn set_porrstf(&mut self, val: bool) { |
| 14008 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); | 21056 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); |
| 14009 | } | 21057 | } |
| 14010 | #[doc = "Boot acknowledgment timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 21058 | #[doc = "System reset from CPU reset flag"] |
| 14011 | pub const fn acktimeout(&self) -> bool { | 21059 | pub const fn sftrstf(&self) -> bool { |
| 14012 | let val = (self.0 >> 24usize) & 0x01; | 21060 | let val = (self.0 >> 24usize) & 0x01; |
| 14013 | val != 0 | 21061 | val != 0 |
| 14014 | } | 21062 | } |
| 14015 | #[doc = "Boot acknowledgment timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 21063 | #[doc = "System reset from CPU reset flag"] |
| 14016 | pub fn set_acktimeout(&mut self, val: bool) { | 21064 | pub fn set_sftrstf(&mut self, val: bool) { |
| 14017 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize); | 21065 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize); |
| 14018 | } | 21066 | } |
| 14019 | #[doc = "Voltage switch critical timing section completion. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 21067 | #[doc = "Independent Watchdog reset flag"] |
| 14020 | pub const fn vswend(&self) -> bool { | 21068 | pub const fn iwdg1rstf(&self) -> bool { |
| 14021 | let val = (self.0 >> 25usize) & 0x01; | ||
| 14022 | val != 0 | ||
| 14023 | } | ||
| 14024 | #[doc = "Voltage switch critical timing section completion. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | ||
| 14025 | pub fn set_vswend(&mut self, val: bool) { | ||
| 14026 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize); | ||
| 14027 | } | ||
| 14028 | #[doc = "SDMMC_CK stopped in Voltage switch procedure. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | ||
| 14029 | pub const fn ckstop(&self) -> bool { | ||
| 14030 | let val = (self.0 >> 26usize) & 0x01; | 21069 | let val = (self.0 >> 26usize) & 0x01; |
| 14031 | val != 0 | 21070 | val != 0 |
| 14032 | } | 21071 | } |
| 14033 | #[doc = "SDMMC_CK stopped in Voltage switch procedure. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 21072 | #[doc = "Independent Watchdog reset flag"] |
| 14034 | pub fn set_ckstop(&mut self, val: bool) { | 21073 | pub fn set_iwdg1rstf(&mut self, val: bool) { |
| 14035 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); | 21074 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); |
| 14036 | } | 21075 | } |
| 14037 | #[doc = "IDMA transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 21076 | #[doc = "Window Watchdog reset flag"] |
| 14038 | pub const fn idmate(&self) -> bool { | 21077 | pub const fn wwdg1rstf(&self) -> bool { |
| 14039 | let val = (self.0 >> 27usize) & 0x01; | 21078 | let val = (self.0 >> 28usize) & 0x01; |
| 14040 | val != 0 | 21079 | val != 0 |
| 14041 | } | 21080 | } |
| 14042 | #[doc = "IDMA transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 21081 | #[doc = "Window Watchdog reset flag"] |
| 14043 | pub fn set_idmate(&mut self, val: bool) { | 21082 | pub fn set_wwdg1rstf(&mut self, val: bool) { |
| 14044 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize); | 21083 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize); |
| 14045 | } | 21084 | } |
| 14046 | #[doc = "IDMA buffer transfer complete. interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 21085 | #[doc = "Reset due to illegal D1 DStandby or CPU CStop flag"] |
| 14047 | pub const fn idmabtc(&self) -> bool { | 21086 | pub const fn lpwrrstf(&self) -> bool { |
| 14048 | let val = (self.0 >> 28usize) & 0x01; | 21087 | let val = (self.0 >> 30usize) & 0x01; |
| 14049 | val != 0 | 21088 | val != 0 |
| 14050 | } | 21089 | } |
| 14051 | #[doc = "IDMA buffer transfer complete. interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] | 21090 | #[doc = "Reset due to illegal D1 DStandby or CPU CStop flag"] |
| 14052 | pub fn set_idmabtc(&mut self, val: bool) { | 21091 | pub fn set_lpwrrstf(&mut self, val: bool) { |
| 14053 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize); | 21092 | self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize); |
| 14054 | } | 21093 | } |
| 14055 | } | 21094 | } |
| 14056 | impl Default for Star { | 21095 | impl Default for Rsr { |
| 14057 | fn default() -> Star { | 21096 | fn default() -> Rsr { |
| 14058 | Star(0) | 21097 | Rsr(0) |
| 14059 | } | 21098 | } |
| 14060 | } | 21099 | } |
| 14061 | #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] | 21100 | #[doc = "RCC AHB3 Clock Register"] |
| 14062 | #[repr(transparent)] | 21101 | #[repr(transparent)] |
| 14063 | #[derive(Copy, Clone, Eq, PartialEq)] | 21102 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 14064 | pub struct Resp3r(pub u32); | 21103 | pub struct C1Ahb3enr(pub u32); |
| 14065 | impl Resp3r { | 21104 | impl C1Ahb3enr { |
| 14066 | #[doc = "see Table404."] | 21105 | #[doc = "MDMA Peripheral Clock Enable"] |
| 14067 | pub const fn cardstatus3(&self) -> u32 { | 21106 | pub const fn mdmaen(&self) -> super::vals::C1Ahb3enrMdmaen { |
| 14068 | let val = (self.0 >> 0usize) & 0xffff_ffff; | 21107 | let val = (self.0 >> 0usize) & 0x01; |
| 14069 | val as u32 | 21108 | super::vals::C1Ahb3enrMdmaen(val as u8) |
| 14070 | } | 21109 | } |
| 14071 | #[doc = "see Table404."] | 21110 | #[doc = "MDMA Peripheral Clock Enable"] |
| 14072 | pub fn set_cardstatus3(&mut self, val: u32) { | 21111 | pub fn set_mdmaen(&mut self, val: super::vals::C1Ahb3enrMdmaen) { |
| 14073 | self.0 = | 21112 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 14074 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | 21113 | } |
| 21114 | #[doc = "DMA2D Peripheral Clock Enable"] | ||
| 21115 | pub const fn dma2den(&self) -> super::vals::C1Ahb3enrMdmaen { | ||
| 21116 | let val = (self.0 >> 4usize) & 0x01; | ||
| 21117 | super::vals::C1Ahb3enrMdmaen(val as u8) | ||
| 21118 | } | ||
| 21119 | #[doc = "DMA2D Peripheral Clock Enable"] | ||
| 21120 | pub fn set_dma2den(&mut self, val: super::vals::C1Ahb3enrMdmaen) { | ||
| 21121 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 21122 | } | ||
| 21123 | #[doc = "JPGDEC Peripheral Clock Enable"] | ||
| 21124 | pub const fn jpgdecen(&self) -> super::vals::C1Ahb3enrMdmaen { | ||
| 21125 | let val = (self.0 >> 5usize) & 0x01; | ||
| 21126 | super::vals::C1Ahb3enrMdmaen(val as u8) | ||
| 21127 | } | ||
| 21128 | #[doc = "JPGDEC Peripheral Clock Enable"] | ||
| 21129 | pub fn set_jpgdecen(&mut self, val: super::vals::C1Ahb3enrMdmaen) { | ||
| 21130 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 21131 | } | ||
| 21132 | #[doc = "FMC Peripheral Clocks Enable"] | ||
| 21133 | pub const fn fmcen(&self) -> super::vals::C1Ahb3enrMdmaen { | ||
| 21134 | let val = (self.0 >> 12usize) & 0x01; | ||
| 21135 | super::vals::C1Ahb3enrMdmaen(val as u8) | ||
| 21136 | } | ||
| 21137 | #[doc = "FMC Peripheral Clocks Enable"] | ||
| 21138 | pub fn set_fmcen(&mut self, val: super::vals::C1Ahb3enrMdmaen) { | ||
| 21139 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 21140 | } | ||
| 21141 | #[doc = "QUADSPI and QUADSPI Delay Clock Enable"] | ||
| 21142 | pub const fn qspien(&self) -> super::vals::C1Ahb3enrMdmaen { | ||
| 21143 | let val = (self.0 >> 14usize) & 0x01; | ||
| 21144 | super::vals::C1Ahb3enrMdmaen(val as u8) | ||
| 21145 | } | ||
| 21146 | #[doc = "QUADSPI and QUADSPI Delay Clock Enable"] | ||
| 21147 | pub fn set_qspien(&mut self, val: super::vals::C1Ahb3enrMdmaen) { | ||
| 21148 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | ||
| 21149 | } | ||
| 21150 | #[doc = "SDMMC1 and SDMMC1 Delay Clock Enable"] | ||
| 21151 | pub const fn sdmmc1en(&self) -> super::vals::C1Ahb3enrMdmaen { | ||
| 21152 | let val = (self.0 >> 16usize) & 0x01; | ||
| 21153 | super::vals::C1Ahb3enrMdmaen(val as u8) | ||
| 21154 | } | ||
| 21155 | #[doc = "SDMMC1 and SDMMC1 Delay Clock Enable"] | ||
| 21156 | pub fn set_sdmmc1en(&mut self, val: super::vals::C1Ahb3enrMdmaen) { | ||
| 21157 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 14075 | } | 21158 | } |
| 14076 | } | 21159 | } |
| 14077 | impl Default for Resp3r { | 21160 | impl Default for C1Ahb3enr { |
| 14078 | fn default() -> Resp3r { | 21161 | fn default() -> C1Ahb3enr { |
| 14079 | Resp3r(0) | 21162 | C1Ahb3enr(0) |
| 14080 | } | 21163 | } |
| 14081 | } | 21164 | } |
| 14082 | #[doc = "SDMMC power control register"] | 21165 | #[doc = "RCC AHB3 Sleep Clock Register"] |
| 14083 | #[repr(transparent)] | 21166 | #[repr(transparent)] |
| 14084 | #[derive(Copy, Clone, Eq, PartialEq)] | 21167 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 14085 | pub struct Power(pub u32); | 21168 | pub struct C1Ahb3lpenr(pub u32); |
| 14086 | impl Power { | 21169 | impl C1Ahb3lpenr { |
| 14087 | #[doc = "SDMMC state control bits. These bits can only be written when the SDMMC is not in the power-on state (PWRCTRL?11). These bits are used to define the functional state of the SDMMC signals: Any further write will be ignored, PWRCTRL value will keep 11."] | 21170 | #[doc = "MDMA Clock Enable During CSleep Mode"] |
| 14088 | pub const fn pwrctrl(&self) -> u8 { | 21171 | pub const fn mdmalpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen { |
| 14089 | let val = (self.0 >> 0usize) & 0x03; | 21172 | let val = (self.0 >> 0usize) & 0x01; |
| 14090 | val as u8 | 21173 | super::vals::C1Ahb3lpenrMdmalpen(val as u8) |
| 14091 | } | 21174 | } |
| 14092 | #[doc = "SDMMC state control bits. These bits can only be written when the SDMMC is not in the power-on state (PWRCTRL?11). These bits are used to define the functional state of the SDMMC signals: Any further write will be ignored, PWRCTRL value will keep 11."] | 21175 | #[doc = "MDMA Clock Enable During CSleep Mode"] |
| 14093 | pub fn set_pwrctrl(&mut self, val: u8) { | 21176 | pub fn set_mdmalpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) { |
| 14094 | self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize); | 21177 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 14095 | } | 21178 | } |
| 14096 | #[doc = "Voltage switch sequence start. This bit is used to start the timing critical section of the voltage switch sequence:"] | 21179 | #[doc = "DMA2D Clock Enable During CSleep Mode"] |
| 14097 | pub const fn vswitch(&self) -> bool { | 21180 | pub const fn dma2dlpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen { |
| 14098 | let val = (self.0 >> 2usize) & 0x01; | 21181 | let val = (self.0 >> 4usize) & 0x01; |
| 21182 | super::vals::C1Ahb3lpenrMdmalpen(val as u8) | ||
| 21183 | } | ||
| 21184 | #[doc = "DMA2D Clock Enable During CSleep Mode"] | ||
| 21185 | pub fn set_dma2dlpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) { | ||
| 21186 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 21187 | } | ||
| 21188 | #[doc = "JPGDEC Clock Enable During CSleep Mode"] | ||
| 21189 | pub const fn jpgdeclpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen { | ||
| 21190 | let val = (self.0 >> 5usize) & 0x01; | ||
| 21191 | super::vals::C1Ahb3lpenrMdmalpen(val as u8) | ||
| 21192 | } | ||
| 21193 | #[doc = "JPGDEC Clock Enable During CSleep Mode"] | ||
| 21194 | pub fn set_jpgdeclpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) { | ||
| 21195 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 21196 | } | ||
| 21197 | #[doc = "Flash interface clock enable during csleep mode"] | ||
| 21198 | pub const fn flashpren(&self) -> bool { | ||
| 21199 | let val = (self.0 >> 8usize) & 0x01; | ||
| 14099 | val != 0 | 21200 | val != 0 |
| 14100 | } | 21201 | } |
| 14101 | #[doc = "Voltage switch sequence start. This bit is used to start the timing critical section of the voltage switch sequence:"] | 21202 | #[doc = "Flash interface clock enable during csleep mode"] |
| 14102 | pub fn set_vswitch(&mut self, val: bool) { | 21203 | pub fn set_flashpren(&mut self, val: bool) { |
| 14103 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 21204 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 14104 | } | 21205 | } |
| 14105 | #[doc = "Voltage switch procedure enable. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). This bit is used to stop the SDMMC_CK after the voltage switch command response:"] | 21206 | #[doc = "FMC Peripheral Clocks Enable During CSleep Mode"] |
| 14106 | pub const fn vswitchen(&self) -> bool { | 21207 | pub const fn fmclpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen { |
| 21208 | let val = (self.0 >> 12usize) & 0x01; | ||
| 21209 | super::vals::C1Ahb3lpenrMdmalpen(val as u8) | ||
| 21210 | } | ||
| 21211 | #[doc = "FMC Peripheral Clocks Enable During CSleep Mode"] | ||
| 21212 | pub fn set_fmclpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) { | ||
| 21213 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 21214 | } | ||
| 21215 | #[doc = "QUADSPI and QUADSPI Delay Clock Enable During CSleep Mode"] | ||
| 21216 | pub const fn qspilpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen { | ||
| 21217 | let val = (self.0 >> 14usize) & 0x01; | ||
| 21218 | super::vals::C1Ahb3lpenrMdmalpen(val as u8) | ||
| 21219 | } | ||
| 21220 | #[doc = "QUADSPI and QUADSPI Delay Clock Enable During CSleep Mode"] | ||
| 21221 | pub fn set_qspilpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) { | ||
| 21222 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | ||
| 21223 | } | ||
| 21224 | #[doc = "SDMMC1 and SDMMC1 Delay Clock Enable During CSleep Mode"] | ||
| 21225 | pub const fn sdmmc1lpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen { | ||
| 21226 | let val = (self.0 >> 16usize) & 0x01; | ||
| 21227 | super::vals::C1Ahb3lpenrMdmalpen(val as u8) | ||
| 21228 | } | ||
| 21229 | #[doc = "SDMMC1 and SDMMC1 Delay Clock Enable During CSleep Mode"] | ||
| 21230 | pub fn set_sdmmc1lpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) { | ||
| 21231 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 21232 | } | ||
| 21233 | #[doc = "D1DTCM1 Block Clock Enable During CSleep mode"] | ||
| 21234 | pub const fn d1dtcm1lpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen { | ||
| 21235 | let val = (self.0 >> 28usize) & 0x01; | ||
| 21236 | super::vals::C1Ahb3lpenrMdmalpen(val as u8) | ||
| 21237 | } | ||
| 21238 | #[doc = "D1DTCM1 Block Clock Enable During CSleep mode"] | ||
| 21239 | pub fn set_d1dtcm1lpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) { | ||
| 21240 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); | ||
| 21241 | } | ||
| 21242 | #[doc = "D1 DTCM2 Block Clock Enable During CSleep mode"] | ||
| 21243 | pub const fn dtcm2lpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen { | ||
| 21244 | let val = (self.0 >> 29usize) & 0x01; | ||
| 21245 | super::vals::C1Ahb3lpenrMdmalpen(val as u8) | ||
| 21246 | } | ||
| 21247 | #[doc = "D1 DTCM2 Block Clock Enable During CSleep mode"] | ||
| 21248 | pub fn set_dtcm2lpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) { | ||
| 21249 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); | ||
| 21250 | } | ||
| 21251 | #[doc = "D1ITCM Block Clock Enable During CSleep mode"] | ||
| 21252 | pub const fn itcmlpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen { | ||
| 21253 | let val = (self.0 >> 30usize) & 0x01; | ||
| 21254 | super::vals::C1Ahb3lpenrMdmalpen(val as u8) | ||
| 21255 | } | ||
| 21256 | #[doc = "D1ITCM Block Clock Enable During CSleep mode"] | ||
| 21257 | pub fn set_itcmlpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) { | ||
| 21258 | self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize); | ||
| 21259 | } | ||
| 21260 | #[doc = "AXISRAM Block Clock Enable During CSleep mode"] | ||
| 21261 | pub const fn axisramlpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen { | ||
| 21262 | let val = (self.0 >> 31usize) & 0x01; | ||
| 21263 | super::vals::C1Ahb3lpenrMdmalpen(val as u8) | ||
| 21264 | } | ||
| 21265 | #[doc = "AXISRAM Block Clock Enable During CSleep mode"] | ||
| 21266 | pub fn set_axisramlpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) { | ||
| 21267 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize); | ||
| 21268 | } | ||
| 21269 | } | ||
| 21270 | impl Default for C1Ahb3lpenr { | ||
| 21271 | fn default() -> C1Ahb3lpenr { | ||
| 21272 | C1Ahb3lpenr(0) | ||
| 21273 | } | ||
| 21274 | } | ||
| 21275 | #[doc = "RCC AHB1 Clock Register"] | ||
| 21276 | #[repr(transparent)] | ||
| 21277 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 21278 | pub struct C1Ahb1enr(pub u32); | ||
| 21279 | impl C1Ahb1enr { | ||
| 21280 | #[doc = "DMA1 Clock Enable"] | ||
| 21281 | pub const fn dma1en(&self) -> super::vals::C1Ahb1enrDma1en { | ||
| 21282 | let val = (self.0 >> 0usize) & 0x01; | ||
| 21283 | super::vals::C1Ahb1enrDma1en(val as u8) | ||
| 21284 | } | ||
| 21285 | #[doc = "DMA1 Clock Enable"] | ||
| 21286 | pub fn set_dma1en(&mut self, val: super::vals::C1Ahb1enrDma1en) { | ||
| 21287 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 21288 | } | ||
| 21289 | #[doc = "DMA2 Clock Enable"] | ||
| 21290 | pub const fn dma2en(&self) -> super::vals::C1Ahb1enrDma1en { | ||
| 21291 | let val = (self.0 >> 1usize) & 0x01; | ||
| 21292 | super::vals::C1Ahb1enrDma1en(val as u8) | ||
| 21293 | } | ||
| 21294 | #[doc = "DMA2 Clock Enable"] | ||
| 21295 | pub fn set_dma2en(&mut self, val: super::vals::C1Ahb1enrDma1en) { | ||
| 21296 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 21297 | } | ||
| 21298 | #[doc = "ADC1/2 Peripheral Clocks Enable"] | ||
| 21299 | pub const fn adc12en(&self) -> super::vals::C1Ahb1enrDma1en { | ||
| 21300 | let val = (self.0 >> 5usize) & 0x01; | ||
| 21301 | super::vals::C1Ahb1enrDma1en(val as u8) | ||
| 21302 | } | ||
| 21303 | #[doc = "ADC1/2 Peripheral Clocks Enable"] | ||
| 21304 | pub fn set_adc12en(&mut self, val: super::vals::C1Ahb1enrDma1en) { | ||
| 21305 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 21306 | } | ||
| 21307 | #[doc = "Ethernet MAC bus interface Clock Enable"] | ||
| 21308 | pub const fn eth1macen(&self) -> super::vals::C1Ahb1enrDma1en { | ||
| 21309 | let val = (self.0 >> 15usize) & 0x01; | ||
| 21310 | super::vals::C1Ahb1enrDma1en(val as u8) | ||
| 21311 | } | ||
| 21312 | #[doc = "Ethernet MAC bus interface Clock Enable"] | ||
| 21313 | pub fn set_eth1macen(&mut self, val: super::vals::C1Ahb1enrDma1en) { | ||
| 21314 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 21315 | } | ||
| 21316 | #[doc = "Ethernet Transmission Clock Enable"] | ||
| 21317 | pub const fn eth1txen(&self) -> super::vals::C1Ahb1enrDma1en { | ||
| 21318 | let val = (self.0 >> 16usize) & 0x01; | ||
| 21319 | super::vals::C1Ahb1enrDma1en(val as u8) | ||
| 21320 | } | ||
| 21321 | #[doc = "Ethernet Transmission Clock Enable"] | ||
| 21322 | pub fn set_eth1txen(&mut self, val: super::vals::C1Ahb1enrDma1en) { | ||
| 21323 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 21324 | } | ||
| 21325 | #[doc = "Ethernet Reception Clock Enable"] | ||
| 21326 | pub const fn eth1rxen(&self) -> super::vals::C1Ahb1enrDma1en { | ||
| 21327 | let val = (self.0 >> 17usize) & 0x01; | ||
| 21328 | super::vals::C1Ahb1enrDma1en(val as u8) | ||
| 21329 | } | ||
| 21330 | #[doc = "Ethernet Reception Clock Enable"] | ||
| 21331 | pub fn set_eth1rxen(&mut self, val: super::vals::C1Ahb1enrDma1en) { | ||
| 21332 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize); | ||
| 21333 | } | ||
| 21334 | #[doc = "USB1OTG Peripheral Clocks Enable"] | ||
| 21335 | pub const fn usb1otgen(&self) -> super::vals::C1Ahb1enrDma1en { | ||
| 21336 | let val = (self.0 >> 25usize) & 0x01; | ||
| 21337 | super::vals::C1Ahb1enrDma1en(val as u8) | ||
| 21338 | } | ||
| 21339 | #[doc = "USB1OTG Peripheral Clocks Enable"] | ||
| 21340 | pub fn set_usb1otgen(&mut self, val: super::vals::C1Ahb1enrDma1en) { | ||
| 21341 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize); | ||
| 21342 | } | ||
| 21343 | #[doc = "USB_PHY1 Clocks Enable"] | ||
| 21344 | pub const fn usb1ulpien(&self) -> super::vals::C1Ahb1enrDma1en { | ||
| 21345 | let val = (self.0 >> 26usize) & 0x01; | ||
| 21346 | super::vals::C1Ahb1enrDma1en(val as u8) | ||
| 21347 | } | ||
| 21348 | #[doc = "USB_PHY1 Clocks Enable"] | ||
| 21349 | pub fn set_usb1ulpien(&mut self, val: super::vals::C1Ahb1enrDma1en) { | ||
| 21350 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val.0 as u32) & 0x01) << 26usize); | ||
| 21351 | } | ||
| 21352 | #[doc = "USB2OTG Peripheral Clocks Enable"] | ||
| 21353 | pub const fn usb2otgen(&self) -> super::vals::C1Ahb1enrDma1en { | ||
| 21354 | let val = (self.0 >> 27usize) & 0x01; | ||
| 21355 | super::vals::C1Ahb1enrDma1en(val as u8) | ||
| 21356 | } | ||
| 21357 | #[doc = "USB2OTG Peripheral Clocks Enable"] | ||
| 21358 | pub fn set_usb2otgen(&mut self, val: super::vals::C1Ahb1enrDma1en) { | ||
| 21359 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize); | ||
| 21360 | } | ||
| 21361 | #[doc = "USB_PHY2 Clocks Enable"] | ||
| 21362 | pub const fn usb2ulpien(&self) -> super::vals::C1Ahb1enrDma1en { | ||
| 21363 | let val = (self.0 >> 28usize) & 0x01; | ||
| 21364 | super::vals::C1Ahb1enrDma1en(val as u8) | ||
| 21365 | } | ||
| 21366 | #[doc = "USB_PHY2 Clocks Enable"] | ||
| 21367 | pub fn set_usb2ulpien(&mut self, val: super::vals::C1Ahb1enrDma1en) { | ||
| 21368 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); | ||
| 21369 | } | ||
| 21370 | } | ||
| 21371 | impl Default for C1Ahb1enr { | ||
| 21372 | fn default() -> C1Ahb1enr { | ||
| 21373 | C1Ahb1enr(0) | ||
| 21374 | } | ||
| 21375 | } | ||
| 21376 | #[doc = "RCC APB3 Clock Register"] | ||
| 21377 | #[repr(transparent)] | ||
| 21378 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 21379 | pub struct C1Apb3enr(pub u32); | ||
| 21380 | impl C1Apb3enr { | ||
| 21381 | #[doc = "LTDC peripheral clock enable"] | ||
| 21382 | pub const fn ltdcen(&self) -> super::vals::C1Apb3enrLtdcen { | ||
| 14107 | let val = (self.0 >> 3usize) & 0x01; | 21383 | let val = (self.0 >> 3usize) & 0x01; |
| 14108 | val != 0 | 21384 | super::vals::C1Apb3enrLtdcen(val as u8) |
| 14109 | } | 21385 | } |
| 14110 | #[doc = "Voltage switch procedure enable. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). This bit is used to stop the SDMMC_CK after the voltage switch command response:"] | 21386 | #[doc = "LTDC peripheral clock enable"] |
| 14111 | pub fn set_vswitchen(&mut self, val: bool) { | 21387 | pub fn set_ltdcen(&mut self, val: super::vals::C1Apb3enrLtdcen) { |
| 14112 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 21388 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); |
| 14113 | } | 21389 | } |
| 14114 | #[doc = "Data and command direction signals polarity selection. This bit can only be written when the SDMMC is in the power-off state (PWRCTRL = 00)."] | 21390 | #[doc = "WWDG1 Clock Enable"] |
| 14115 | pub const fn dirpol(&self) -> bool { | 21391 | pub const fn wwdg1en(&self) -> super::vals::C1Apb3enrLtdcen { |
| 21392 | let val = (self.0 >> 6usize) & 0x01; | ||
| 21393 | super::vals::C1Apb3enrLtdcen(val as u8) | ||
| 21394 | } | ||
| 21395 | #[doc = "WWDG1 Clock Enable"] | ||
| 21396 | pub fn set_wwdg1en(&mut self, val: super::vals::C1Apb3enrLtdcen) { | ||
| 21397 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); | ||
| 21398 | } | ||
| 21399 | } | ||
| 21400 | impl Default for C1Apb3enr { | ||
| 21401 | fn default() -> C1Apb3enr { | ||
| 21402 | C1Apb3enr(0) | ||
| 21403 | } | ||
| 21404 | } | ||
| 21405 | #[doc = "RCC APB2 Sleep Clock Register"] | ||
| 21406 | #[repr(transparent)] | ||
| 21407 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 21408 | pub struct C1Apb2lpenr(pub u32); | ||
| 21409 | impl C1Apb2lpenr { | ||
| 21410 | #[doc = "TIM1 peripheral clock enable during CSleep mode"] | ||
| 21411 | pub const fn tim1lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen { | ||
| 21412 | let val = (self.0 >> 0usize) & 0x01; | ||
| 21413 | super::vals::C1Apb2lpenrTim1lpen(val as u8) | ||
| 21414 | } | ||
| 21415 | #[doc = "TIM1 peripheral clock enable during CSleep mode"] | ||
| 21416 | pub fn set_tim1lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) { | ||
| 21417 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 21418 | } | ||
| 21419 | #[doc = "TIM8 peripheral clock enable during CSleep mode"] | ||
| 21420 | pub const fn tim8lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen { | ||
| 21421 | let val = (self.0 >> 1usize) & 0x01; | ||
| 21422 | super::vals::C1Apb2lpenrTim1lpen(val as u8) | ||
| 21423 | } | ||
| 21424 | #[doc = "TIM8 peripheral clock enable during CSleep mode"] | ||
| 21425 | pub fn set_tim8lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) { | ||
| 21426 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 21427 | } | ||
| 21428 | #[doc = "USART1 Peripheral Clocks Enable During CSleep Mode"] | ||
| 21429 | pub const fn usart1lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen { | ||
| 14116 | let val = (self.0 >> 4usize) & 0x01; | 21430 | let val = (self.0 >> 4usize) & 0x01; |
| 14117 | val != 0 | 21431 | super::vals::C1Apb2lpenrTim1lpen(val as u8) |
| 14118 | } | 21432 | } |
| 14119 | #[doc = "Data and command direction signals polarity selection. This bit can only be written when the SDMMC is in the power-off state (PWRCTRL = 00)."] | 21433 | #[doc = "USART1 Peripheral Clocks Enable During CSleep Mode"] |
| 14120 | pub fn set_dirpol(&mut self, val: bool) { | 21434 | pub fn set_usart1lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) { |
| 14121 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 21435 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); |
| 21436 | } | ||
| 21437 | #[doc = "USART6 Peripheral Clocks Enable During CSleep Mode"] | ||
| 21438 | pub const fn usart6lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen { | ||
| 21439 | let val = (self.0 >> 5usize) & 0x01; | ||
| 21440 | super::vals::C1Apb2lpenrTim1lpen(val as u8) | ||
| 21441 | } | ||
| 21442 | #[doc = "USART6 Peripheral Clocks Enable During CSleep Mode"] | ||
| 21443 | pub fn set_usart6lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) { | ||
| 21444 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 21445 | } | ||
| 21446 | #[doc = "SPI1 Peripheral Clocks Enable During CSleep Mode"] | ||
| 21447 | pub const fn spi1lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen { | ||
| 21448 | let val = (self.0 >> 12usize) & 0x01; | ||
| 21449 | super::vals::C1Apb2lpenrTim1lpen(val as u8) | ||
| 21450 | } | ||
| 21451 | #[doc = "SPI1 Peripheral Clocks Enable During CSleep Mode"] | ||
| 21452 | pub fn set_spi1lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) { | ||
| 21453 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 21454 | } | ||
| 21455 | #[doc = "SPI4 Peripheral Clocks Enable During CSleep Mode"] | ||
| 21456 | pub const fn spi4lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen { | ||
| 21457 | let val = (self.0 >> 13usize) & 0x01; | ||
| 21458 | super::vals::C1Apb2lpenrTim1lpen(val as u8) | ||
| 21459 | } | ||
| 21460 | #[doc = "SPI4 Peripheral Clocks Enable During CSleep Mode"] | ||
| 21461 | pub fn set_spi4lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) { | ||
| 21462 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize); | ||
| 21463 | } | ||
| 21464 | #[doc = "TIM15 peripheral clock enable during CSleep mode"] | ||
| 21465 | pub const fn tim15lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen { | ||
| 21466 | let val = (self.0 >> 16usize) & 0x01; | ||
| 21467 | super::vals::C1Apb2lpenrTim1lpen(val as u8) | ||
| 21468 | } | ||
| 21469 | #[doc = "TIM15 peripheral clock enable during CSleep mode"] | ||
| 21470 | pub fn set_tim15lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) { | ||
| 21471 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 21472 | } | ||
| 21473 | #[doc = "TIM16 peripheral clock enable during CSleep mode"] | ||
| 21474 | pub const fn tim16lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen { | ||
| 21475 | let val = (self.0 >> 17usize) & 0x01; | ||
| 21476 | super::vals::C1Apb2lpenrTim1lpen(val as u8) | ||
| 21477 | } | ||
| 21478 | #[doc = "TIM16 peripheral clock enable during CSleep mode"] | ||
| 21479 | pub fn set_tim16lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) { | ||
| 21480 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize); | ||
| 21481 | } | ||
| 21482 | #[doc = "TIM17 peripheral clock enable during CSleep mode"] | ||
| 21483 | pub const fn tim17lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen { | ||
| 21484 | let val = (self.0 >> 18usize) & 0x01; | ||
| 21485 | super::vals::C1Apb2lpenrTim1lpen(val as u8) | ||
| 21486 | } | ||
| 21487 | #[doc = "TIM17 peripheral clock enable during CSleep mode"] | ||
| 21488 | pub fn set_tim17lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) { | ||
| 21489 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize); | ||
| 21490 | } | ||
| 21491 | #[doc = "SPI5 Peripheral Clocks Enable During CSleep Mode"] | ||
| 21492 | pub const fn spi5lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen { | ||
| 21493 | let val = (self.0 >> 20usize) & 0x01; | ||
| 21494 | super::vals::C1Apb2lpenrTim1lpen(val as u8) | ||
| 21495 | } | ||
| 21496 | #[doc = "SPI5 Peripheral Clocks Enable During CSleep Mode"] | ||
| 21497 | pub fn set_spi5lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) { | ||
| 21498 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize); | ||
| 21499 | } | ||
| 21500 | #[doc = "SAI1 Peripheral Clocks Enable During CSleep Mode"] | ||
| 21501 | pub const fn sai1lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen { | ||
| 21502 | let val = (self.0 >> 22usize) & 0x01; | ||
| 21503 | super::vals::C1Apb2lpenrTim1lpen(val as u8) | ||
| 21504 | } | ||
| 21505 | #[doc = "SAI1 Peripheral Clocks Enable During CSleep Mode"] | ||
| 21506 | pub fn set_sai1lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) { | ||
| 21507 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize); | ||
| 21508 | } | ||
| 21509 | #[doc = "SAI2 Peripheral Clocks Enable During CSleep Mode"] | ||
| 21510 | pub const fn sai2lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen { | ||
| 21511 | let val = (self.0 >> 23usize) & 0x01; | ||
| 21512 | super::vals::C1Apb2lpenrTim1lpen(val as u8) | ||
| 21513 | } | ||
| 21514 | #[doc = "SAI2 Peripheral Clocks Enable During CSleep Mode"] | ||
| 21515 | pub fn set_sai2lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) { | ||
| 21516 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize); | ||
| 21517 | } | ||
| 21518 | #[doc = "SAI3 Peripheral Clocks Enable During CSleep Mode"] | ||
| 21519 | pub const fn sai3lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen { | ||
| 21520 | let val = (self.0 >> 24usize) & 0x01; | ||
| 21521 | super::vals::C1Apb2lpenrTim1lpen(val as u8) | ||
| 21522 | } | ||
| 21523 | #[doc = "SAI3 Peripheral Clocks Enable During CSleep Mode"] | ||
| 21524 | pub fn set_sai3lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) { | ||
| 21525 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); | ||
| 21526 | } | ||
| 21527 | #[doc = "DFSDM1 Peripheral Clocks Enable During CSleep Mode"] | ||
| 21528 | pub const fn dfsdm1lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen { | ||
| 21529 | let val = (self.0 >> 28usize) & 0x01; | ||
| 21530 | super::vals::C1Apb2lpenrTim1lpen(val as u8) | ||
| 21531 | } | ||
| 21532 | #[doc = "DFSDM1 Peripheral Clocks Enable During CSleep Mode"] | ||
| 21533 | pub fn set_dfsdm1lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) { | ||
| 21534 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); | ||
| 21535 | } | ||
| 21536 | #[doc = "HRTIM peripheral clock enable during CSleep mode"] | ||
| 21537 | pub const fn hrtimlpen(&self) -> super::vals::C1Apb2lpenrTim1lpen { | ||
| 21538 | let val = (self.0 >> 29usize) & 0x01; | ||
| 21539 | super::vals::C1Apb2lpenrTim1lpen(val as u8) | ||
| 21540 | } | ||
| 21541 | #[doc = "HRTIM peripheral clock enable during CSleep mode"] | ||
| 21542 | pub fn set_hrtimlpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) { | ||
| 21543 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); | ||
| 14122 | } | 21544 | } |
| 14123 | } | 21545 | } |
| 14124 | impl Default for Power { | 21546 | impl Default for C1Apb2lpenr { |
| 14125 | fn default() -> Power { | 21547 | fn default() -> C1Apb2lpenr { |
| 14126 | Power(0) | 21548 | C1Apb2lpenr(0) |
| 14127 | } | 21549 | } |
| 14128 | } | 21550 | } |
| 14129 | #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] | 21551 | #[doc = "RCC Domain 2 Kernel Clock Configuration Register"] |
| 14130 | #[repr(transparent)] | 21552 | #[repr(transparent)] |
| 14131 | #[derive(Copy, Clone, Eq, PartialEq)] | 21553 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 14132 | pub struct Resp1r(pub u32); | 21554 | pub struct D2ccip1r(pub u32); |
| 14133 | impl Resp1r { | 21555 | impl D2ccip1r { |
| 14134 | #[doc = "see Table 432"] | 21556 | #[doc = "SAI1 and DFSDM1 kernel Aclk clock source selection"] |
| 14135 | pub const fn cardstatus1(&self) -> u32 { | 21557 | pub const fn sai1sel(&self) -> super::vals::Sai1sel { |
| 14136 | let val = (self.0 >> 0usize) & 0xffff_ffff; | 21558 | let val = (self.0 >> 0usize) & 0x07; |
| 14137 | val as u32 | 21559 | super::vals::Sai1sel(val as u8) |
| 14138 | } | 21560 | } |
| 14139 | #[doc = "see Table 432"] | 21561 | #[doc = "SAI1 and DFSDM1 kernel Aclk clock source selection"] |
| 14140 | pub fn set_cardstatus1(&mut self, val: u32) { | 21562 | pub fn set_sai1sel(&mut self, val: super::vals::Sai1sel) { |
| 14141 | self.0 = | 21563 | self.0 = (self.0 & !(0x07 << 0usize)) | (((val.0 as u32) & 0x07) << 0usize); |
| 14142 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | 21564 | } |
| 21565 | #[doc = "SAI2 and SAI3 kernel clock source selection"] | ||
| 21566 | pub const fn sai23sel(&self) -> super::vals::Sai1sel { | ||
| 21567 | let val = (self.0 >> 6usize) & 0x07; | ||
| 21568 | super::vals::Sai1sel(val as u8) | ||
| 21569 | } | ||
| 21570 | #[doc = "SAI2 and SAI3 kernel clock source selection"] | ||
| 21571 | pub fn set_sai23sel(&mut self, val: super::vals::Sai1sel) { | ||
| 21572 | self.0 = (self.0 & !(0x07 << 6usize)) | (((val.0 as u32) & 0x07) << 6usize); | ||
| 21573 | } | ||
| 21574 | #[doc = "SPI/I2S1,2 and 3 kernel clock source selection"] | ||
| 21575 | pub const fn spi123sel(&self) -> super::vals::Sai1sel { | ||
| 21576 | let val = (self.0 >> 12usize) & 0x07; | ||
| 21577 | super::vals::Sai1sel(val as u8) | ||
| 21578 | } | ||
| 21579 | #[doc = "SPI/I2S1,2 and 3 kernel clock source selection"] | ||
| 21580 | pub fn set_spi123sel(&mut self, val: super::vals::Sai1sel) { | ||
| 21581 | self.0 = (self.0 & !(0x07 << 12usize)) | (((val.0 as u32) & 0x07) << 12usize); | ||
| 21582 | } | ||
| 21583 | #[doc = "SPI4 and 5 kernel clock source selection"] | ||
| 21584 | pub const fn spi45sel(&self) -> super::vals::Spi45sel { | ||
| 21585 | let val = (self.0 >> 16usize) & 0x07; | ||
| 21586 | super::vals::Spi45sel(val as u8) | ||
| 21587 | } | ||
| 21588 | #[doc = "SPI4 and 5 kernel clock source selection"] | ||
| 21589 | pub fn set_spi45sel(&mut self, val: super::vals::Spi45sel) { | ||
| 21590 | self.0 = (self.0 & !(0x07 << 16usize)) | (((val.0 as u32) & 0x07) << 16usize); | ||
| 21591 | } | ||
| 21592 | #[doc = "SPDIFRX kernel clock source selection"] | ||
| 21593 | pub const fn spdifsel(&self) -> super::vals::Spdifsel { | ||
| 21594 | let val = (self.0 >> 20usize) & 0x03; | ||
| 21595 | super::vals::Spdifsel(val as u8) | ||
| 21596 | } | ||
| 21597 | #[doc = "SPDIFRX kernel clock source selection"] | ||
| 21598 | pub fn set_spdifsel(&mut self, val: super::vals::Spdifsel) { | ||
| 21599 | self.0 = (self.0 & !(0x03 << 20usize)) | (((val.0 as u32) & 0x03) << 20usize); | ||
| 21600 | } | ||
| 21601 | #[doc = "DFSDM1 kernel Clk clock source selection"] | ||
| 21602 | pub const fn dfsdm1sel(&self) -> super::vals::Dfsdm1sel { | ||
| 21603 | let val = (self.0 >> 24usize) & 0x01; | ||
| 21604 | super::vals::Dfsdm1sel(val as u8) | ||
| 21605 | } | ||
| 21606 | #[doc = "DFSDM1 kernel Clk clock source selection"] | ||
| 21607 | pub fn set_dfsdm1sel(&mut self, val: super::vals::Dfsdm1sel) { | ||
| 21608 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); | ||
| 21609 | } | ||
| 21610 | #[doc = "FDCAN kernel clock source selection"] | ||
| 21611 | pub const fn fdcansel(&self) -> super::vals::Fdcansel { | ||
| 21612 | let val = (self.0 >> 28usize) & 0x03; | ||
| 21613 | super::vals::Fdcansel(val as u8) | ||
| 21614 | } | ||
| 21615 | #[doc = "FDCAN kernel clock source selection"] | ||
| 21616 | pub fn set_fdcansel(&mut self, val: super::vals::Fdcansel) { | ||
| 21617 | self.0 = (self.0 & !(0x03 << 28usize)) | (((val.0 as u32) & 0x03) << 28usize); | ||
| 21618 | } | ||
| 21619 | #[doc = "SWPMI kernel clock source selection"] | ||
| 21620 | pub const fn swpsel(&self) -> super::vals::Swpsel { | ||
| 21621 | let val = (self.0 >> 31usize) & 0x01; | ||
| 21622 | super::vals::Swpsel(val as u8) | ||
| 21623 | } | ||
| 21624 | #[doc = "SWPMI kernel clock source selection"] | ||
| 21625 | pub fn set_swpsel(&mut self, val: super::vals::Swpsel) { | ||
| 21626 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize); | ||
| 14143 | } | 21627 | } |
| 14144 | } | 21628 | } |
| 14145 | impl Default for Resp1r { | 21629 | impl Default for D2ccip1r { |
| 14146 | fn default() -> Resp1r { | 21630 | fn default() -> D2ccip1r { |
| 14147 | Resp1r(0) | 21631 | D2ccip1r(0) |
| 14148 | } | 21632 | } |
| 14149 | } | 21633 | } |
| 14150 | #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] | 21634 | #[doc = "clock control register"] |
| 14151 | #[repr(transparent)] | 21635 | #[repr(transparent)] |
| 14152 | #[derive(Copy, Clone, Eq, PartialEq)] | 21636 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 14153 | pub struct Resp4r(pub u32); | 21637 | pub struct Cr(pub u32); |
| 14154 | impl Resp4r { | 21638 | impl Cr { |
| 14155 | #[doc = "see Table404."] | 21639 | #[doc = "Internal high-speed clock enable"] |
| 14156 | pub const fn cardstatus4(&self) -> u32 { | 21640 | pub const fn hsion(&self) -> super::vals::Hsion { |
| 14157 | let val = (self.0 >> 0usize) & 0xffff_ffff; | 21641 | let val = (self.0 >> 0usize) & 0x01; |
| 14158 | val as u32 | 21642 | super::vals::Hsion(val as u8) |
| 14159 | } | 21643 | } |
| 14160 | #[doc = "see Table404."] | 21644 | #[doc = "Internal high-speed clock enable"] |
| 14161 | pub fn set_cardstatus4(&mut self, val: u32) { | 21645 | pub fn set_hsion(&mut self, val: super::vals::Hsion) { |
| 14162 | self.0 = | 21646 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 14163 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | 21647 | } |
| 21648 | #[doc = "High Speed Internal clock enable in Stop mode"] | ||
| 21649 | pub const fn hsikeron(&self) -> super::vals::Hsion { | ||
| 21650 | let val = (self.0 >> 1usize) & 0x01; | ||
| 21651 | super::vals::Hsion(val as u8) | ||
| 21652 | } | ||
| 21653 | #[doc = "High Speed Internal clock enable in Stop mode"] | ||
| 21654 | pub fn set_hsikeron(&mut self, val: super::vals::Hsion) { | ||
| 21655 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 21656 | } | ||
| 21657 | #[doc = "HSI clock ready flag"] | ||
| 21658 | pub const fn hsirdy(&self) -> bool { | ||
| 21659 | let val = (self.0 >> 2usize) & 0x01; | ||
| 21660 | val != 0 | ||
| 21661 | } | ||
| 21662 | #[doc = "HSI clock ready flag"] | ||
| 21663 | pub fn set_hsirdy(&mut self, val: bool) { | ||
| 21664 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 21665 | } | ||
| 21666 | #[doc = "HSI clock divider"] | ||
| 21667 | pub const fn hsidiv(&self) -> super::vals::Hsidiv { | ||
| 21668 | let val = (self.0 >> 3usize) & 0x03; | ||
| 21669 | super::vals::Hsidiv(val as u8) | ||
| 21670 | } | ||
| 21671 | #[doc = "HSI clock divider"] | ||
| 21672 | pub fn set_hsidiv(&mut self, val: super::vals::Hsidiv) { | ||
| 21673 | self.0 = (self.0 & !(0x03 << 3usize)) | (((val.0 as u32) & 0x03) << 3usize); | ||
| 21674 | } | ||
| 21675 | #[doc = "HSI divider flag"] | ||
| 21676 | pub const fn hsidivf(&self) -> bool { | ||
| 21677 | let val = (self.0 >> 5usize) & 0x01; | ||
| 21678 | val != 0 | ||
| 21679 | } | ||
| 21680 | #[doc = "HSI divider flag"] | ||
| 21681 | pub fn set_hsidivf(&mut self, val: bool) { | ||
| 21682 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | ||
| 21683 | } | ||
| 21684 | #[doc = "CSI clock enable"] | ||
| 21685 | pub const fn csion(&self) -> super::vals::Hsion { | ||
| 21686 | let val = (self.0 >> 7usize) & 0x01; | ||
| 21687 | super::vals::Hsion(val as u8) | ||
| 21688 | } | ||
| 21689 | #[doc = "CSI clock enable"] | ||
| 21690 | pub fn set_csion(&mut self, val: super::vals::Hsion) { | ||
| 21691 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 21692 | } | ||
| 21693 | #[doc = "CSI clock ready flag"] | ||
| 21694 | pub const fn csirdy(&self) -> bool { | ||
| 21695 | let val = (self.0 >> 8usize) & 0x01; | ||
| 21696 | val != 0 | ||
| 21697 | } | ||
| 21698 | #[doc = "CSI clock ready flag"] | ||
| 21699 | pub fn set_csirdy(&mut self, val: bool) { | ||
| 21700 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | ||
| 21701 | } | ||
| 21702 | #[doc = "CSI clock enable in Stop mode"] | ||
| 21703 | pub const fn csikeron(&self) -> super::vals::Hsion { | ||
| 21704 | let val = (self.0 >> 9usize) & 0x01; | ||
| 21705 | super::vals::Hsion(val as u8) | ||
| 21706 | } | ||
| 21707 | #[doc = "CSI clock enable in Stop mode"] | ||
| 21708 | pub fn set_csikeron(&mut self, val: super::vals::Hsion) { | ||
| 21709 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | ||
| 21710 | } | ||
| 21711 | #[doc = "RC48 clock enable"] | ||
| 21712 | pub const fn hsi48on(&self) -> super::vals::Hsion { | ||
| 21713 | let val = (self.0 >> 12usize) & 0x01; | ||
| 21714 | super::vals::Hsion(val as u8) | ||
| 21715 | } | ||
| 21716 | #[doc = "RC48 clock enable"] | ||
| 21717 | pub fn set_hsi48on(&mut self, val: super::vals::Hsion) { | ||
| 21718 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 21719 | } | ||
| 21720 | #[doc = "RC48 clock ready flag"] | ||
| 21721 | pub const fn hsi48rdy(&self) -> bool { | ||
| 21722 | let val = (self.0 >> 13usize) & 0x01; | ||
| 21723 | val != 0 | ||
| 21724 | } | ||
| 21725 | #[doc = "RC48 clock ready flag"] | ||
| 21726 | pub fn set_hsi48rdy(&mut self, val: bool) { | ||
| 21727 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | ||
| 21728 | } | ||
| 21729 | #[doc = "D1 domain clocks ready flag"] | ||
| 21730 | pub const fn d1ckrdy(&self) -> bool { | ||
| 21731 | let val = (self.0 >> 14usize) & 0x01; | ||
| 21732 | val != 0 | ||
| 21733 | } | ||
| 21734 | #[doc = "D1 domain clocks ready flag"] | ||
| 21735 | pub fn set_d1ckrdy(&mut self, val: bool) { | ||
| 21736 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | ||
| 21737 | } | ||
| 21738 | #[doc = "D2 domain clocks ready flag"] | ||
| 21739 | pub const fn d2ckrdy(&self) -> bool { | ||
| 21740 | let val = (self.0 >> 15usize) & 0x01; | ||
| 21741 | val != 0 | ||
| 21742 | } | ||
| 21743 | #[doc = "D2 domain clocks ready flag"] | ||
| 21744 | pub fn set_d2ckrdy(&mut self, val: bool) { | ||
| 21745 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); | ||
| 21746 | } | ||
| 21747 | #[doc = "HSE clock enable"] | ||
| 21748 | pub const fn hseon(&self) -> super::vals::Hsion { | ||
| 21749 | let val = (self.0 >> 16usize) & 0x01; | ||
| 21750 | super::vals::Hsion(val as u8) | ||
| 21751 | } | ||
| 21752 | #[doc = "HSE clock enable"] | ||
| 21753 | pub fn set_hseon(&mut self, val: super::vals::Hsion) { | ||
| 21754 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 21755 | } | ||
| 21756 | #[doc = "HSE clock ready flag"] | ||
| 21757 | pub const fn hserdy(&self) -> bool { | ||
| 21758 | let val = (self.0 >> 17usize) & 0x01; | ||
| 21759 | val != 0 | ||
| 21760 | } | ||
| 21761 | #[doc = "HSE clock ready flag"] | ||
| 21762 | pub fn set_hserdy(&mut self, val: bool) { | ||
| 21763 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); | ||
| 21764 | } | ||
| 21765 | #[doc = "HSE clock bypass"] | ||
| 21766 | pub const fn hsebyp(&self) -> super::vals::Hsebyp { | ||
| 21767 | let val = (self.0 >> 18usize) & 0x01; | ||
| 21768 | super::vals::Hsebyp(val as u8) | ||
| 21769 | } | ||
| 21770 | #[doc = "HSE clock bypass"] | ||
| 21771 | pub fn set_hsebyp(&mut self, val: super::vals::Hsebyp) { | ||
| 21772 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize); | ||
| 21773 | } | ||
| 21774 | #[doc = "HSE Clock Security System enable"] | ||
| 21775 | pub const fn hsecsson(&self) -> super::vals::Hsion { | ||
| 21776 | let val = (self.0 >> 19usize) & 0x01; | ||
| 21777 | super::vals::Hsion(val as u8) | ||
| 21778 | } | ||
| 21779 | #[doc = "HSE Clock Security System enable"] | ||
| 21780 | pub fn set_hsecsson(&mut self, val: super::vals::Hsion) { | ||
| 21781 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); | ||
| 21782 | } | ||
| 21783 | #[doc = "PLL1 enable"] | ||
| 21784 | pub const fn pll1on(&self) -> super::vals::Hsion { | ||
| 21785 | let val = (self.0 >> 24usize) & 0x01; | ||
| 21786 | super::vals::Hsion(val as u8) | ||
| 21787 | } | ||
| 21788 | #[doc = "PLL1 enable"] | ||
| 21789 | pub fn set_pll1on(&mut self, val: super::vals::Hsion) { | ||
| 21790 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); | ||
| 21791 | } | ||
| 21792 | #[doc = "PLL1 clock ready flag"] | ||
| 21793 | pub const fn pll1rdy(&self) -> bool { | ||
| 21794 | let val = (self.0 >> 25usize) & 0x01; | ||
| 21795 | val != 0 | ||
| 21796 | } | ||
| 21797 | #[doc = "PLL1 clock ready flag"] | ||
| 21798 | pub fn set_pll1rdy(&mut self, val: bool) { | ||
| 21799 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize); | ||
| 21800 | } | ||
| 21801 | #[doc = "PLL2 enable"] | ||
| 21802 | pub const fn pll2on(&self) -> super::vals::Hsion { | ||
| 21803 | let val = (self.0 >> 26usize) & 0x01; | ||
| 21804 | super::vals::Hsion(val as u8) | ||
| 21805 | } | ||
| 21806 | #[doc = "PLL2 enable"] | ||
| 21807 | pub fn set_pll2on(&mut self, val: super::vals::Hsion) { | ||
| 21808 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val.0 as u32) & 0x01) << 26usize); | ||
| 21809 | } | ||
| 21810 | #[doc = "PLL2 clock ready flag"] | ||
| 21811 | pub const fn pll2rdy(&self) -> bool { | ||
| 21812 | let val = (self.0 >> 27usize) & 0x01; | ||
| 21813 | val != 0 | ||
| 21814 | } | ||
| 21815 | #[doc = "PLL2 clock ready flag"] | ||
| 21816 | pub fn set_pll2rdy(&mut self, val: bool) { | ||
| 21817 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize); | ||
| 21818 | } | ||
| 21819 | #[doc = "PLL3 enable"] | ||
| 21820 | pub const fn pll3on(&self) -> super::vals::Hsion { | ||
| 21821 | let val = (self.0 >> 28usize) & 0x01; | ||
| 21822 | super::vals::Hsion(val as u8) | ||
| 21823 | } | ||
| 21824 | #[doc = "PLL3 enable"] | ||
| 21825 | pub fn set_pll3on(&mut self, val: super::vals::Hsion) { | ||
| 21826 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); | ||
| 21827 | } | ||
| 21828 | #[doc = "PLL3 clock ready flag"] | ||
| 21829 | pub const fn pll3rdy(&self) -> bool { | ||
| 21830 | let val = (self.0 >> 29usize) & 0x01; | ||
| 21831 | val != 0 | ||
| 21832 | } | ||
| 21833 | #[doc = "PLL3 clock ready flag"] | ||
| 21834 | pub fn set_pll3rdy(&mut self, val: bool) { | ||
| 21835 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize); | ||
| 14164 | } | 21836 | } |
| 14165 | } | 21837 | } |
| 14166 | impl Default for Resp4r { | 21838 | impl Default for Cr { |
| 14167 | fn default() -> Resp4r { | 21839 | fn default() -> Cr { |
| 14168 | Resp4r(0) | 21840 | Cr(0) |
| 14169 | } | 21841 | } |
| 14170 | } | 21842 | } |
| 14171 | #[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."] | 21843 | #[doc = "RCC PLL2 Fractional Divider Register"] |
| 14172 | #[repr(transparent)] | 21844 | #[repr(transparent)] |
| 14173 | #[derive(Copy, Clone, Eq, PartialEq)] | 21845 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 14174 | pub struct Acktimer(pub u32); | 21846 | pub struct Pll2fracr(pub u32); |
| 14175 | impl Acktimer { | 21847 | impl Pll2fracr { |
| 14176 | #[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."] | 21848 | #[doc = "Fractional part of the multiplication factor for PLL VCO"] |
| 14177 | pub const fn acktime(&self) -> u32 { | 21849 | pub const fn fracn2(&self) -> u16 { |
| 14178 | let val = (self.0 >> 0usize) & 0x01ff_ffff; | 21850 | let val = (self.0 >> 3usize) & 0x1fff; |
| 14179 | val as u32 | 21851 | val as u16 |
| 14180 | } | 21852 | } |
| 14181 | #[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."] | 21853 | #[doc = "Fractional part of the multiplication factor for PLL VCO"] |
| 14182 | pub fn set_acktime(&mut self, val: u32) { | 21854 | pub fn set_fracn2(&mut self, val: u16) { |
| 14183 | self.0 = | 21855 | self.0 = (self.0 & !(0x1fff << 3usize)) | (((val as u32) & 0x1fff) << 3usize); |
| 14184 | (self.0 & !(0x01ff_ffff << 0usize)) | (((val as u32) & 0x01ff_ffff) << 0usize); | ||
| 14185 | } | 21856 | } |
| 14186 | } | 21857 | } |
| 14187 | impl Default for Acktimer { | 21858 | impl Default for Pll2fracr { |
| 14188 | fn default() -> Acktimer { | 21859 | fn default() -> Pll2fracr { |
| 14189 | Acktimer(0) | 21860 | Pll2fracr(0) |
| 14190 | } | 21861 | } |
| 14191 | } | 21862 | } |
| 14192 | #[doc = "The SDMMC_ARGR register contains a 32-bit command argument, which is sent to a card as part of a command message."] | 21863 | #[doc = "RCC AHB1 Clock Register"] |
| 14193 | #[repr(transparent)] | 21864 | #[repr(transparent)] |
| 14194 | #[derive(Copy, Clone, Eq, PartialEq)] | 21865 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 14195 | pub struct Argr(pub u32); | 21866 | pub struct Ahb1enr(pub u32); |
| 14196 | impl Argr { | 21867 | impl Ahb1enr { |
| 14197 | #[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."] | 21868 | #[doc = "DMA1 Clock Enable"] |
| 14198 | pub const fn cmdarg(&self) -> u32 { | 21869 | pub const fn dma1en(&self) -> super::vals::Ahb1enrDma1en { |
| 14199 | let val = (self.0 >> 0usize) & 0xffff_ffff; | 21870 | let val = (self.0 >> 0usize) & 0x01; |
| 14200 | val as u32 | 21871 | super::vals::Ahb1enrDma1en(val as u8) |
| 14201 | } | 21872 | } |
| 14202 | #[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."] | 21873 | #[doc = "DMA1 Clock Enable"] |
| 14203 | pub fn set_cmdarg(&mut self, val: u32) { | 21874 | pub fn set_dma1en(&mut self, val: super::vals::Ahb1enrDma1en) { |
| 14204 | self.0 = | 21875 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 14205 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | 21876 | } |
| 21877 | #[doc = "DMA2 Clock Enable"] | ||
| 21878 | pub const fn dma2en(&self) -> super::vals::Ahb1enrDma1en { | ||
| 21879 | let val = (self.0 >> 1usize) & 0x01; | ||
| 21880 | super::vals::Ahb1enrDma1en(val as u8) | ||
| 21881 | } | ||
| 21882 | #[doc = "DMA2 Clock Enable"] | ||
| 21883 | pub fn set_dma2en(&mut self, val: super::vals::Ahb1enrDma1en) { | ||
| 21884 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 21885 | } | ||
| 21886 | #[doc = "ADC1/2 Peripheral Clocks Enable"] | ||
| 21887 | pub const fn adc12en(&self) -> super::vals::Ahb1enrDma1en { | ||
| 21888 | let val = (self.0 >> 5usize) & 0x01; | ||
| 21889 | super::vals::Ahb1enrDma1en(val as u8) | ||
| 21890 | } | ||
| 21891 | #[doc = "ADC1/2 Peripheral Clocks Enable"] | ||
| 21892 | pub fn set_adc12en(&mut self, val: super::vals::Ahb1enrDma1en) { | ||
| 21893 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 21894 | } | ||
| 21895 | #[doc = "Ethernet MAC bus interface Clock Enable"] | ||
| 21896 | pub const fn eth1macen(&self) -> super::vals::Ahb1enrDma1en { | ||
| 21897 | let val = (self.0 >> 15usize) & 0x01; | ||
| 21898 | super::vals::Ahb1enrDma1en(val as u8) | ||
| 21899 | } | ||
| 21900 | #[doc = "Ethernet MAC bus interface Clock Enable"] | ||
| 21901 | pub fn set_eth1macen(&mut self, val: super::vals::Ahb1enrDma1en) { | ||
| 21902 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 21903 | } | ||
| 21904 | #[doc = "Ethernet Transmission Clock Enable"] | ||
| 21905 | pub const fn eth1txen(&self) -> super::vals::Ahb1enrDma1en { | ||
| 21906 | let val = (self.0 >> 16usize) & 0x01; | ||
| 21907 | super::vals::Ahb1enrDma1en(val as u8) | ||
| 21908 | } | ||
| 21909 | #[doc = "Ethernet Transmission Clock Enable"] | ||
| 21910 | pub fn set_eth1txen(&mut self, val: super::vals::Ahb1enrDma1en) { | ||
| 21911 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 21912 | } | ||
| 21913 | #[doc = "Ethernet Reception Clock Enable"] | ||
| 21914 | pub const fn eth1rxen(&self) -> super::vals::Ahb1enrDma1en { | ||
| 21915 | let val = (self.0 >> 17usize) & 0x01; | ||
| 21916 | super::vals::Ahb1enrDma1en(val as u8) | ||
| 21917 | } | ||
| 21918 | #[doc = "Ethernet Reception Clock Enable"] | ||
| 21919 | pub fn set_eth1rxen(&mut self, val: super::vals::Ahb1enrDma1en) { | ||
| 21920 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize); | ||
| 21921 | } | ||
| 21922 | #[doc = "Enable USB_PHY2 clocks"] | ||
| 21923 | pub const fn usb2otghsulpien(&self) -> super::vals::Ahb1enrDma1en { | ||
| 21924 | let val = (self.0 >> 18usize) & 0x01; | ||
| 21925 | super::vals::Ahb1enrDma1en(val as u8) | ||
| 21926 | } | ||
| 21927 | #[doc = "Enable USB_PHY2 clocks"] | ||
| 21928 | pub fn set_usb2otghsulpien(&mut self, val: super::vals::Ahb1enrDma1en) { | ||
| 21929 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize); | ||
| 21930 | } | ||
| 21931 | #[doc = "USB1OTG Peripheral Clocks Enable"] | ||
| 21932 | pub const fn usb1otgen(&self) -> super::vals::Ahb1enrDma1en { | ||
| 21933 | let val = (self.0 >> 25usize) & 0x01; | ||
| 21934 | super::vals::Ahb1enrDma1en(val as u8) | ||
| 21935 | } | ||
| 21936 | #[doc = "USB1OTG Peripheral Clocks Enable"] | ||
| 21937 | pub fn set_usb1otgen(&mut self, val: super::vals::Ahb1enrDma1en) { | ||
| 21938 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize); | ||
| 21939 | } | ||
| 21940 | #[doc = "USB_PHY1 Clocks Enable"] | ||
| 21941 | pub const fn usb1ulpien(&self) -> super::vals::Ahb1enrDma1en { | ||
| 21942 | let val = (self.0 >> 26usize) & 0x01; | ||
| 21943 | super::vals::Ahb1enrDma1en(val as u8) | ||
| 21944 | } | ||
| 21945 | #[doc = "USB_PHY1 Clocks Enable"] | ||
| 21946 | pub fn set_usb1ulpien(&mut self, val: super::vals::Ahb1enrDma1en) { | ||
| 21947 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val.0 as u32) & 0x01) << 26usize); | ||
| 21948 | } | ||
| 21949 | #[doc = "USB2OTG Peripheral Clocks Enable"] | ||
| 21950 | pub const fn usb2otgen(&self) -> super::vals::Ahb1enrDma1en { | ||
| 21951 | let val = (self.0 >> 27usize) & 0x01; | ||
| 21952 | super::vals::Ahb1enrDma1en(val as u8) | ||
| 21953 | } | ||
| 21954 | #[doc = "USB2OTG Peripheral Clocks Enable"] | ||
| 21955 | pub fn set_usb2otgen(&mut self, val: super::vals::Ahb1enrDma1en) { | ||
| 21956 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize); | ||
| 21957 | } | ||
| 21958 | #[doc = "USB_PHY2 Clocks Enable"] | ||
| 21959 | pub const fn usb2ulpien(&self) -> super::vals::Ahb1enrDma1en { | ||
| 21960 | let val = (self.0 >> 28usize) & 0x01; | ||
| 21961 | super::vals::Ahb1enrDma1en(val as u8) | ||
| 21962 | } | ||
| 21963 | #[doc = "USB_PHY2 Clocks Enable"] | ||
| 21964 | pub fn set_usb2ulpien(&mut self, val: super::vals::Ahb1enrDma1en) { | ||
| 21965 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); | ||
| 14206 | } | 21966 | } |
| 14207 | } | 21967 | } |
| 14208 | impl Default for Argr { | 21968 | impl Default for Ahb1enr { |
| 14209 | fn default() -> Argr { | 21969 | fn default() -> Ahb1enr { |
| 14210 | Argr(0) | 21970 | Ahb1enr(0) |
| 14211 | } | 21971 | } |
| 14212 | } | 21972 | } |
| 14213 | #[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."] | 21973 | #[doc = "RCC APB4 Clock Register"] |
| 14214 | #[repr(transparent)] | 21974 | #[repr(transparent)] |
| 14215 | #[derive(Copy, Clone, Eq, PartialEq)] | 21975 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 14216 | pub struct Dlenr(pub u32); | 21976 | pub struct Apb4enr(pub u32); |
| 14217 | impl Dlenr { | 21977 | impl Apb4enr { |
| 14218 | #[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."] | 21978 | #[doc = "SYSCFG peripheral clock enable"] |
| 14219 | pub const fn datalength(&self) -> u32 { | 21979 | pub const fn syscfgen(&self) -> super::vals::Apb4enrSyscfgen { |
| 14220 | let val = (self.0 >> 0usize) & 0x01ff_ffff; | 21980 | let val = (self.0 >> 1usize) & 0x01; |
| 14221 | val as u32 | 21981 | super::vals::Apb4enrSyscfgen(val as u8) |
| 14222 | } | 21982 | } |
| 14223 | #[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."] | 21983 | #[doc = "SYSCFG peripheral clock enable"] |
| 14224 | pub fn set_datalength(&mut self, val: u32) { | 21984 | pub fn set_syscfgen(&mut self, val: super::vals::Apb4enrSyscfgen) { |
| 14225 | self.0 = | 21985 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); |
| 14226 | (self.0 & !(0x01ff_ffff << 0usize)) | (((val as u32) & 0x01ff_ffff) << 0usize); | 21986 | } |
| 21987 | #[doc = "LPUART1 Peripheral Clocks Enable"] | ||
| 21988 | pub const fn lpuart1en(&self) -> super::vals::Apb4enrSyscfgen { | ||
| 21989 | let val = (self.0 >> 3usize) & 0x01; | ||
| 21990 | super::vals::Apb4enrSyscfgen(val as u8) | ||
| 21991 | } | ||
| 21992 | #[doc = "LPUART1 Peripheral Clocks Enable"] | ||
| 21993 | pub fn set_lpuart1en(&mut self, val: super::vals::Apb4enrSyscfgen) { | ||
| 21994 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 21995 | } | ||
| 21996 | #[doc = "SPI6 Peripheral Clocks Enable"] | ||
| 21997 | pub const fn spi6en(&self) -> super::vals::Apb4enrSyscfgen { | ||
| 21998 | let val = (self.0 >> 5usize) & 0x01; | ||
| 21999 | super::vals::Apb4enrSyscfgen(val as u8) | ||
| 22000 | } | ||
| 22001 | #[doc = "SPI6 Peripheral Clocks Enable"] | ||
| 22002 | pub fn set_spi6en(&mut self, val: super::vals::Apb4enrSyscfgen) { | ||
| 22003 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 22004 | } | ||
| 22005 | #[doc = "I2C4 Peripheral Clocks Enable"] | ||
| 22006 | pub const fn i2c4en(&self) -> super::vals::Apb4enrSyscfgen { | ||
| 22007 | let val = (self.0 >> 7usize) & 0x01; | ||
| 22008 | super::vals::Apb4enrSyscfgen(val as u8) | ||
| 22009 | } | ||
| 22010 | #[doc = "I2C4 Peripheral Clocks Enable"] | ||
| 22011 | pub fn set_i2c4en(&mut self, val: super::vals::Apb4enrSyscfgen) { | ||
| 22012 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 22013 | } | ||
| 22014 | #[doc = "LPTIM2 Peripheral Clocks Enable"] | ||
| 22015 | pub const fn lptim2en(&self) -> super::vals::Apb4enrSyscfgen { | ||
| 22016 | let val = (self.0 >> 9usize) & 0x01; | ||
| 22017 | super::vals::Apb4enrSyscfgen(val as u8) | ||
| 22018 | } | ||
| 22019 | #[doc = "LPTIM2 Peripheral Clocks Enable"] | ||
| 22020 | pub fn set_lptim2en(&mut self, val: super::vals::Apb4enrSyscfgen) { | ||
| 22021 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | ||
| 22022 | } | ||
| 22023 | #[doc = "LPTIM3 Peripheral Clocks Enable"] | ||
| 22024 | pub const fn lptim3en(&self) -> super::vals::Apb4enrSyscfgen { | ||
| 22025 | let val = (self.0 >> 10usize) & 0x01; | ||
| 22026 | super::vals::Apb4enrSyscfgen(val as u8) | ||
| 22027 | } | ||
| 22028 | #[doc = "LPTIM3 Peripheral Clocks Enable"] | ||
| 22029 | pub fn set_lptim3en(&mut self, val: super::vals::Apb4enrSyscfgen) { | ||
| 22030 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); | ||
| 22031 | } | ||
| 22032 | #[doc = "LPTIM4 Peripheral Clocks Enable"] | ||
| 22033 | pub const fn lptim4en(&self) -> super::vals::Apb4enrSyscfgen { | ||
| 22034 | let val = (self.0 >> 11usize) & 0x01; | ||
| 22035 | super::vals::Apb4enrSyscfgen(val as u8) | ||
| 22036 | } | ||
| 22037 | #[doc = "LPTIM4 Peripheral Clocks Enable"] | ||
| 22038 | pub fn set_lptim4en(&mut self, val: super::vals::Apb4enrSyscfgen) { | ||
| 22039 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); | ||
| 22040 | } | ||
| 22041 | #[doc = "LPTIM5 Peripheral Clocks Enable"] | ||
| 22042 | pub const fn lptim5en(&self) -> super::vals::Apb4enrSyscfgen { | ||
| 22043 | let val = (self.0 >> 12usize) & 0x01; | ||
| 22044 | super::vals::Apb4enrSyscfgen(val as u8) | ||
| 22045 | } | ||
| 22046 | #[doc = "LPTIM5 Peripheral Clocks Enable"] | ||
| 22047 | pub fn set_lptim5en(&mut self, val: super::vals::Apb4enrSyscfgen) { | ||
| 22048 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 22049 | } | ||
| 22050 | #[doc = "COMP1/2 peripheral clock enable"] | ||
| 22051 | pub const fn comp12en(&self) -> super::vals::Apb4enrSyscfgen { | ||
| 22052 | let val = (self.0 >> 14usize) & 0x01; | ||
| 22053 | super::vals::Apb4enrSyscfgen(val as u8) | ||
| 22054 | } | ||
| 22055 | #[doc = "COMP1/2 peripheral clock enable"] | ||
| 22056 | pub fn set_comp12en(&mut self, val: super::vals::Apb4enrSyscfgen) { | ||
| 22057 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | ||
| 22058 | } | ||
| 22059 | #[doc = "VREF peripheral clock enable"] | ||
| 22060 | pub const fn vrefen(&self) -> super::vals::Apb4enrSyscfgen { | ||
| 22061 | let val = (self.0 >> 15usize) & 0x01; | ||
| 22062 | super::vals::Apb4enrSyscfgen(val as u8) | ||
| 22063 | } | ||
| 22064 | #[doc = "VREF peripheral clock enable"] | ||
| 22065 | pub fn set_vrefen(&mut self, val: super::vals::Apb4enrSyscfgen) { | ||
| 22066 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 22067 | } | ||
| 22068 | #[doc = "RTC APB Clock Enable"] | ||
| 22069 | pub const fn rtcapben(&self) -> super::vals::Apb4enrSyscfgen { | ||
| 22070 | let val = (self.0 >> 16usize) & 0x01; | ||
| 22071 | super::vals::Apb4enrSyscfgen(val as u8) | ||
| 22072 | } | ||
| 22073 | #[doc = "RTC APB Clock Enable"] | ||
| 22074 | pub fn set_rtcapben(&mut self, val: super::vals::Apb4enrSyscfgen) { | ||
| 22075 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 22076 | } | ||
| 22077 | #[doc = "SAI4 Peripheral Clocks Enable"] | ||
| 22078 | pub const fn sai4en(&self) -> super::vals::Apb4enrSyscfgen { | ||
| 22079 | let val = (self.0 >> 21usize) & 0x01; | ||
| 22080 | super::vals::Apb4enrSyscfgen(val as u8) | ||
| 22081 | } | ||
| 22082 | #[doc = "SAI4 Peripheral Clocks Enable"] | ||
| 22083 | pub fn set_sai4en(&mut self, val: super::vals::Apb4enrSyscfgen) { | ||
| 22084 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize); | ||
| 14227 | } | 22085 | } |
| 14228 | } | 22086 | } |
| 14229 | impl Default for Dlenr { | 22087 | impl Default for Apb4enr { |
| 14230 | fn default() -> Dlenr { | 22088 | fn default() -> Apb4enr { |
| 14231 | Dlenr(0) | 22089 | Apb4enr(0) |
| 14232 | } | 22090 | } |
| 14233 | } | 22091 | } |
| 14234 | #[doc = "SDMMC IP version register"] | 22092 | #[doc = "RCC AHB1 Peripheral Reset Register"] |
| 14235 | #[repr(transparent)] | 22093 | #[repr(transparent)] |
| 14236 | #[derive(Copy, Clone, Eq, PartialEq)] | 22094 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 14237 | pub struct Ver(pub u32); | 22095 | pub struct Ahb1rstr(pub u32); |
| 14238 | impl Ver { | 22096 | impl Ahb1rstr { |
| 14239 | #[doc = "IP minor revision number."] | 22097 | #[doc = "DMA1 block reset"] |
| 14240 | pub const fn minrev(&self) -> u8 { | 22098 | pub const fn dma1rst(&self) -> super::vals::Dma1rst { |
| 14241 | let val = (self.0 >> 0usize) & 0x0f; | 22099 | let val = (self.0 >> 0usize) & 0x01; |
| 14242 | val as u8 | 22100 | super::vals::Dma1rst(val as u8) |
| 14243 | } | 22101 | } |
| 14244 | #[doc = "IP minor revision number."] | 22102 | #[doc = "DMA1 block reset"] |
| 14245 | pub fn set_minrev(&mut self, val: u8) { | 22103 | pub fn set_dma1rst(&mut self, val: super::vals::Dma1rst) { |
| 14246 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); | 22104 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 14247 | } | 22105 | } |
| 14248 | #[doc = "IP major revision number."] | 22106 | #[doc = "DMA2 block reset"] |
| 14249 | pub const fn majrev(&self) -> u8 { | 22107 | pub const fn dma2rst(&self) -> super::vals::Dma1rst { |
| 14250 | let val = (self.0 >> 4usize) & 0x0f; | 22108 | let val = (self.0 >> 1usize) & 0x01; |
| 14251 | val as u8 | 22109 | super::vals::Dma1rst(val as u8) |
| 14252 | } | 22110 | } |
| 14253 | #[doc = "IP major revision number."] | 22111 | #[doc = "DMA2 block reset"] |
| 14254 | pub fn set_majrev(&mut self, val: u8) { | 22112 | pub fn set_dma2rst(&mut self, val: super::vals::Dma1rst) { |
| 14255 | self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize); | 22113 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); |
| 22114 | } | ||
| 22115 | #[doc = "ADC1&2 block reset"] | ||
| 22116 | pub const fn adc12rst(&self) -> super::vals::Dma1rst { | ||
| 22117 | let val = (self.0 >> 5usize) & 0x01; | ||
| 22118 | super::vals::Dma1rst(val as u8) | ||
| 22119 | } | ||
| 22120 | #[doc = "ADC1&2 block reset"] | ||
| 22121 | pub fn set_adc12rst(&mut self, val: super::vals::Dma1rst) { | ||
| 22122 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 22123 | } | ||
| 22124 | #[doc = "ETH1MAC block reset"] | ||
| 22125 | pub const fn eth1macrst(&self) -> super::vals::Dma1rst { | ||
| 22126 | let val = (self.0 >> 15usize) & 0x01; | ||
| 22127 | super::vals::Dma1rst(val as u8) | ||
| 22128 | } | ||
| 22129 | #[doc = "ETH1MAC block reset"] | ||
| 22130 | pub fn set_eth1macrst(&mut self, val: super::vals::Dma1rst) { | ||
| 22131 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 22132 | } | ||
| 22133 | #[doc = "USB1OTG block reset"] | ||
| 22134 | pub const fn usb1otgrst(&self) -> super::vals::Dma1rst { | ||
| 22135 | let val = (self.0 >> 25usize) & 0x01; | ||
| 22136 | super::vals::Dma1rst(val as u8) | ||
| 22137 | } | ||
| 22138 | #[doc = "USB1OTG block reset"] | ||
| 22139 | pub fn set_usb1otgrst(&mut self, val: super::vals::Dma1rst) { | ||
| 22140 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize); | ||
| 22141 | } | ||
| 22142 | #[doc = "USB2OTG block reset"] | ||
| 22143 | pub const fn usb2otgrst(&self) -> super::vals::Dma1rst { | ||
| 22144 | let val = (self.0 >> 27usize) & 0x01; | ||
| 22145 | super::vals::Dma1rst(val as u8) | ||
| 22146 | } | ||
| 22147 | #[doc = "USB2OTG block reset"] | ||
| 22148 | pub fn set_usb2otgrst(&mut self, val: super::vals::Dma1rst) { | ||
| 22149 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize); | ||
| 14256 | } | 22150 | } |
| 14257 | } | 22151 | } |
| 14258 | impl Default for Ver { | 22152 | impl Default for Ahb1rstr { |
| 14259 | fn default() -> Ver { | 22153 | fn default() -> Ahb1rstr { |
| 14260 | Ver(0) | 22154 | Ahb1rstr(0) |
| 14261 | } | 22155 | } |
| 14262 | } | 22156 | } |
| 14263 | #[doc = "The interrupt mask register determines which status flags generate an interrupt request by setting the corresponding bit to 1."] | 22157 | #[doc = "RCC APB3 Clock Register"] |
| 14264 | #[repr(transparent)] | 22158 | #[repr(transparent)] |
| 14265 | #[derive(Copy, Clone, Eq, PartialEq)] | 22159 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 14266 | pub struct Maskr(pub u32); | 22160 | pub struct Apb3enr(pub u32); |
| 14267 | impl Maskr { | 22161 | impl Apb3enr { |
| 14268 | #[doc = "Command CRC fail interrupt enable Set and cleared by software to enable/disable interrupt caused by command CRC failure."] | 22162 | #[doc = "LTDC peripheral clock enable"] |
| 14269 | pub const fn ccrcfailie(&self) -> bool { | 22163 | pub const fn ltdcen(&self) -> super::vals::Apb3enrLtdcen { |
| 22164 | let val = (self.0 >> 3usize) & 0x01; | ||
| 22165 | super::vals::Apb3enrLtdcen(val as u8) | ||
| 22166 | } | ||
| 22167 | #[doc = "LTDC peripheral clock enable"] | ||
| 22168 | pub fn set_ltdcen(&mut self, val: super::vals::Apb3enrLtdcen) { | ||
| 22169 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 22170 | } | ||
| 22171 | #[doc = "WWDG1 Clock Enable"] | ||
| 22172 | pub const fn wwdg1en(&self) -> super::vals::Apb3enrLtdcen { | ||
| 22173 | let val = (self.0 >> 6usize) & 0x01; | ||
| 22174 | super::vals::Apb3enrLtdcen(val as u8) | ||
| 22175 | } | ||
| 22176 | #[doc = "WWDG1 Clock Enable"] | ||
| 22177 | pub fn set_wwdg1en(&mut self, val: super::vals::Apb3enrLtdcen) { | ||
| 22178 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); | ||
| 22179 | } | ||
| 22180 | } | ||
| 22181 | impl Default for Apb3enr { | ||
| 22182 | fn default() -> Apb3enr { | ||
| 22183 | Apb3enr(0) | ||
| 22184 | } | ||
| 22185 | } | ||
| 22186 | #[doc = "RCC APB1 Low Sleep Clock Register"] | ||
| 22187 | #[repr(transparent)] | ||
| 22188 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 22189 | pub struct C1Apb1llpenr(pub u32); | ||
| 22190 | impl C1Apb1llpenr { | ||
| 22191 | #[doc = "TIM2 peripheral clock enable during CSleep mode"] | ||
| 22192 | pub const fn tim2lpen(&self) -> super::vals::C1Apb1llpenrTim2lpen { | ||
| 14270 | let val = (self.0 >> 0usize) & 0x01; | 22193 | let val = (self.0 >> 0usize) & 0x01; |
| 14271 | val != 0 | 22194 | super::vals::C1Apb1llpenrTim2lpen(val as u8) |
| 14272 | } | 22195 | } |
| 14273 | #[doc = "Command CRC fail interrupt enable Set and cleared by software to enable/disable interrupt caused by command CRC failure."] | 22196 | #[doc = "TIM2 peripheral clock enable during CSleep mode"] |
| 14274 | pub fn set_ccrcfailie(&mut self, val: bool) { | 22197 | pub fn set_tim2lpen(&mut self, val: super::vals::C1Apb1llpenrTim2lpen) { |
| 14275 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 22198 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 14276 | } | 22199 | } |
| 14277 | #[doc = "Data CRC fail interrupt enable Set and cleared by software to enable/disable interrupt caused by data CRC failure."] | 22200 | #[doc = "TIM3 peripheral clock enable during CSleep mode"] |
| 14278 | pub const fn dcrcfailie(&self) -> bool { | 22201 | pub const fn tim3lpen(&self) -> super::vals::C1Apb1llpenrTim2lpen { |
| 14279 | let val = (self.0 >> 1usize) & 0x01; | 22202 | let val = (self.0 >> 1usize) & 0x01; |
| 14280 | val != 0 | 22203 | super::vals::C1Apb1llpenrTim2lpen(val as u8) |
| 14281 | } | 22204 | } |
| 14282 | #[doc = "Data CRC fail interrupt enable Set and cleared by software to enable/disable interrupt caused by data CRC failure."] | 22205 | #[doc = "TIM3 peripheral clock enable during CSleep mode"] |
| 14283 | pub fn set_dcrcfailie(&mut self, val: bool) { | 22206 | pub fn set_tim3lpen(&mut self, val: super::vals::C1Apb1llpenrTim2lpen) { |
| 14284 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 22207 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); |
| 14285 | } | 22208 | } |
| 14286 | #[doc = "Command timeout interrupt enable Set and cleared by software to enable/disable interrupt caused by command timeout."] | 22209 | #[doc = "TIM4 peripheral clock enable during CSleep mode"] |
| 14287 | pub const fn ctimeoutie(&self) -> bool { | 22210 | pub const fn tim4lpen(&self) -> super::vals::C1Apb1llpenrTim2lpen { |
| 14288 | let val = (self.0 >> 2usize) & 0x01; | 22211 | let val = (self.0 >> 2usize) & 0x01; |
| 14289 | val != 0 | 22212 | super::vals::C1Apb1llpenrTim2lpen(val as u8) |
| 14290 | } | 22213 | } |
| 14291 | #[doc = "Command timeout interrupt enable Set and cleared by software to enable/disable interrupt caused by command timeout."] | 22214 | #[doc = "TIM4 peripheral clock enable during CSleep mode"] |
| 14292 | pub fn set_ctimeoutie(&mut self, val: bool) { | 22215 | pub fn set_tim4lpen(&mut self, val: super::vals::C1Apb1llpenrTim2lpen) { |
| 14293 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 22216 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); |
| 14294 | } | 22217 | } |
| 14295 | #[doc = "Data timeout interrupt enable Set and cleared by software to enable/disable interrupt caused by data timeout."] | 22218 | #[doc = "TIM5 peripheral clock enable during CSleep mode"] |
| 14296 | pub const fn dtimeoutie(&self) -> bool { | 22219 | pub const fn tim5lpen(&self) -> super::vals::C1Apb1llpenrTim2lpen { |
| 14297 | let val = (self.0 >> 3usize) & 0x01; | 22220 | let val = (self.0 >> 3usize) & 0x01; |
| 14298 | val != 0 | 22221 | super::vals::C1Apb1llpenrTim2lpen(val as u8) |
| 14299 | } | 22222 | } |
| 14300 | #[doc = "Data timeout interrupt enable Set and cleared by software to enable/disable interrupt caused by data timeout."] | 22223 | #[doc = "TIM5 peripheral clock enable during CSleep mode"] |
| 14301 | pub fn set_dtimeoutie(&mut self, val: bool) { | 22224 | pub fn set_tim5lpen(&mut self, val: super::vals::C1Apb1llpenrTim2lpen) { |
| 14302 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 22225 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); |
| 14303 | } | 22226 | } |
| 14304 | #[doc = "Tx FIFO underrun error interrupt enable Set and cleared by software to enable/disable interrupt caused by Tx FIFO underrun error."] | 22227 | #[doc = "TIM6 peripheral clock enable during CSleep mode"] |
| 14305 | pub const fn txunderrie(&self) -> bool { | 22228 | pub const fn tim6lpen(&self) -> super::vals::C1Apb1llpenrTim2lpen { |
| 14306 | let val = (self.0 >> 4usize) & 0x01; | 22229 | let val = (self.0 >> 4usize) & 0x01; |
| 14307 | val != 0 | 22230 | super::vals::C1Apb1llpenrTim2lpen(val as u8) |
| 14308 | } | 22231 | } |
| 14309 | #[doc = "Tx FIFO underrun error interrupt enable Set and cleared by software to enable/disable interrupt caused by Tx FIFO underrun error."] | 22232 | #[doc = "TIM6 peripheral clock enable during CSleep mode"] |
| 14310 | pub fn set_txunderrie(&mut self, val: bool) { | 22233 | pub fn set_tim6lpen(&mut self, val: super::vals::C1Apb1llpenrTim2lpen) { |
| 14311 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | 22234 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); |
| 14312 | } | 22235 | } |
| 14313 | #[doc = "Rx FIFO overrun error interrupt enable Set and cleared by software to enable/disable interrupt caused by Rx FIFO overrun error."] | 22236 | #[doc = "TIM7 peripheral clock enable during CSleep mode"] |
| 14314 | pub const fn rxoverrie(&self) -> bool { | 22237 | pub const fn tim7lpen(&self) -> super::vals::C1Apb1llpenrTim2lpen { |
| 14315 | let val = (self.0 >> 5usize) & 0x01; | 22238 | let val = (self.0 >> 5usize) & 0x01; |
| 14316 | val != 0 | 22239 | super::vals::C1Apb1llpenrTim2lpen(val as u8) |
| 14317 | } | 22240 | } |
| 14318 | #[doc = "Rx FIFO overrun error interrupt enable Set and cleared by software to enable/disable interrupt caused by Rx FIFO overrun error."] | 22241 | #[doc = "TIM7 peripheral clock enable during CSleep mode"] |
| 14319 | pub fn set_rxoverrie(&mut self, val: bool) { | 22242 | pub fn set_tim7lpen(&mut self, val: super::vals::C1Apb1llpenrTim2lpen) { |
| 14320 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); | 22243 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); |
| 14321 | } | 22244 | } |
| 14322 | #[doc = "Command response received interrupt enable Set and cleared by software to enable/disable interrupt caused by receiving command response."] | 22245 | #[doc = "TIM12 peripheral clock enable during CSleep mode"] |
| 14323 | pub const fn cmdrendie(&self) -> bool { | 22246 | pub const fn tim12lpen(&self) -> super::vals::C1Apb1llpenrTim2lpen { |
| 14324 | let val = (self.0 >> 6usize) & 0x01; | 22247 | let val = (self.0 >> 6usize) & 0x01; |
| 14325 | val != 0 | 22248 | super::vals::C1Apb1llpenrTim2lpen(val as u8) |
| 14326 | } | 22249 | } |
| 14327 | #[doc = "Command response received interrupt enable Set and cleared by software to enable/disable interrupt caused by receiving command response."] | 22250 | #[doc = "TIM12 peripheral clock enable during CSleep mode"] |
| 14328 | pub fn set_cmdrendie(&mut self, val: bool) { | 22251 | pub fn set_tim12lpen(&mut self, val: super::vals::C1Apb1llpenrTim2lpen) { |
| 14329 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 22252 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); |
| 14330 | } | 22253 | } |
| 14331 | #[doc = "Command sent interrupt enable Set and cleared by software to enable/disable interrupt caused by sending command."] | 22254 | #[doc = "TIM13 peripheral clock enable during CSleep mode"] |
| 14332 | pub const fn cmdsentie(&self) -> bool { | 22255 | pub const fn tim13lpen(&self) -> super::vals::C1Apb1llpenrTim2lpen { |
| 14333 | let val = (self.0 >> 7usize) & 0x01; | 22256 | let val = (self.0 >> 7usize) & 0x01; |
| 14334 | val != 0 | 22257 | super::vals::C1Apb1llpenrTim2lpen(val as u8) |
| 14335 | } | 22258 | } |
| 14336 | #[doc = "Command sent interrupt enable Set and cleared by software to enable/disable interrupt caused by sending command."] | 22259 | #[doc = "TIM13 peripheral clock enable during CSleep mode"] |
| 14337 | pub fn set_cmdsentie(&mut self, val: bool) { | 22260 | pub fn set_tim13lpen(&mut self, val: super::vals::C1Apb1llpenrTim2lpen) { |
| 14338 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 22261 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); |
| 14339 | } | 22262 | } |
| 14340 | #[doc = "Data end interrupt enable Set and cleared by software to enable/disable interrupt caused by data end."] | 22263 | #[doc = "TIM14 peripheral clock enable during CSleep mode"] |
| 14341 | pub const fn dataendie(&self) -> bool { | 22264 | pub const fn tim14lpen(&self) -> super::vals::C1Apb1llpenrTim2lpen { |
| 14342 | let val = (self.0 >> 8usize) & 0x01; | 22265 | let val = (self.0 >> 8usize) & 0x01; |
| 14343 | val != 0 | 22266 | super::vals::C1Apb1llpenrTim2lpen(val as u8) |
| 14344 | } | 22267 | } |
| 14345 | #[doc = "Data end interrupt enable Set and cleared by software to enable/disable interrupt caused by data end."] | 22268 | #[doc = "TIM14 peripheral clock enable during CSleep mode"] |
| 14346 | pub fn set_dataendie(&mut self, val: bool) { | 22269 | pub fn set_tim14lpen(&mut self, val: super::vals::C1Apb1llpenrTim2lpen) { |
| 14347 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 22270 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); |
| 14348 | } | 22271 | } |
| 14349 | #[doc = "Data hold interrupt enable Set and cleared by software to enable/disable the interrupt generated when sending new data is hold in the DPSM Wait_S state."] | 22272 | #[doc = "LPTIM1 Peripheral Clocks Enable During CSleep Mode"] |
| 14350 | pub const fn dholdie(&self) -> bool { | 22273 | pub const fn lptim1lpen(&self) -> super::vals::C1Apb1llpenrTim2lpen { |
| 14351 | let val = (self.0 >> 9usize) & 0x01; | 22274 | let val = (self.0 >> 9usize) & 0x01; |
| 14352 | val != 0 | 22275 | super::vals::C1Apb1llpenrTim2lpen(val as u8) |
| 14353 | } | 22276 | } |
| 14354 | #[doc = "Data hold interrupt enable Set and cleared by software to enable/disable the interrupt generated when sending new data is hold in the DPSM Wait_S state."] | 22277 | #[doc = "LPTIM1 Peripheral Clocks Enable During CSleep Mode"] |
| 14355 | pub fn set_dholdie(&mut self, val: bool) { | 22278 | pub fn set_lptim1lpen(&mut self, val: super::vals::C1Apb1llpenrTim2lpen) { |
| 14356 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | 22279 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); |
| 14357 | } | 22280 | } |
| 14358 | #[doc = "Data block end interrupt enable Set and cleared by software to enable/disable interrupt caused by data block end."] | 22281 | #[doc = "SPI2 Peripheral Clocks Enable During CSleep Mode"] |
| 14359 | pub const fn dbckendie(&self) -> bool { | 22282 | pub const fn spi2lpen(&self) -> super::vals::C1Apb1llpenrTim2lpen { |
| 22283 | let val = (self.0 >> 14usize) & 0x01; | ||
| 22284 | super::vals::C1Apb1llpenrTim2lpen(val as u8) | ||
| 22285 | } | ||
| 22286 | #[doc = "SPI2 Peripheral Clocks Enable During CSleep Mode"] | ||
| 22287 | pub fn set_spi2lpen(&mut self, val: super::vals::C1Apb1llpenrTim2lpen) { | ||
| 22288 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | ||
| 22289 | } | ||
| 22290 | #[doc = "SPI3 Peripheral Clocks Enable During CSleep Mode"] | ||
| 22291 | pub const fn spi3lpen(&self) -> super::vals::C1Apb1llpenrTim2lpen { | ||
| 22292 | let val = (self.0 >> 15usize) & 0x01; | ||
| 22293 | super::vals::C1Apb1llpenrTim2lpen(val as u8) | ||
| 22294 | } | ||
| 22295 | #[doc = "SPI3 Peripheral Clocks Enable During CSleep Mode"] | ||
| 22296 | pub fn set_spi3lpen(&mut self, val: super::vals::C1Apb1llpenrTim2lpen) { | ||
| 22297 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 22298 | } | ||
| 22299 | #[doc = "SPDIFRX Peripheral Clocks Enable During CSleep Mode"] | ||
| 22300 | pub const fn spdifrxlpen(&self) -> super::vals::C1Apb1llpenrTim2lpen { | ||
| 22301 | let val = (self.0 >> 16usize) & 0x01; | ||
| 22302 | super::vals::C1Apb1llpenrTim2lpen(val as u8) | ||
| 22303 | } | ||
| 22304 | #[doc = "SPDIFRX Peripheral Clocks Enable During CSleep Mode"] | ||
| 22305 | pub fn set_spdifrxlpen(&mut self, val: super::vals::C1Apb1llpenrTim2lpen) { | ||
| 22306 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 22307 | } | ||
| 22308 | #[doc = "USART2 Peripheral Clocks Enable During CSleep Mode"] | ||
| 22309 | pub const fn usart2lpen(&self) -> super::vals::C1Apb1llpenrTim2lpen { | ||
| 22310 | let val = (self.0 >> 17usize) & 0x01; | ||
| 22311 | super::vals::C1Apb1llpenrTim2lpen(val as u8) | ||
| 22312 | } | ||
| 22313 | #[doc = "USART2 Peripheral Clocks Enable During CSleep Mode"] | ||
| 22314 | pub fn set_usart2lpen(&mut self, val: super::vals::C1Apb1llpenrTim2lpen) { | ||
| 22315 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize); | ||
| 22316 | } | ||
| 22317 | #[doc = "USART3 Peripheral Clocks Enable During CSleep Mode"] | ||
| 22318 | pub const fn usart3lpen(&self) -> super::vals::C1Apb1llpenrTim2lpen { | ||
| 22319 | let val = (self.0 >> 18usize) & 0x01; | ||
| 22320 | super::vals::C1Apb1llpenrTim2lpen(val as u8) | ||
| 22321 | } | ||
| 22322 | #[doc = "USART3 Peripheral Clocks Enable During CSleep Mode"] | ||
| 22323 | pub fn set_usart3lpen(&mut self, val: super::vals::C1Apb1llpenrTim2lpen) { | ||
| 22324 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize); | ||
| 22325 | } | ||
| 22326 | #[doc = "UART4 Peripheral Clocks Enable During CSleep Mode"] | ||
| 22327 | pub const fn uart4lpen(&self) -> super::vals::C1Apb1llpenrTim2lpen { | ||
| 22328 | let val = (self.0 >> 19usize) & 0x01; | ||
| 22329 | super::vals::C1Apb1llpenrTim2lpen(val as u8) | ||
| 22330 | } | ||
| 22331 | #[doc = "UART4 Peripheral Clocks Enable During CSleep Mode"] | ||
| 22332 | pub fn set_uart4lpen(&mut self, val: super::vals::C1Apb1llpenrTim2lpen) { | ||
| 22333 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); | ||
| 22334 | } | ||
| 22335 | #[doc = "UART5 Peripheral Clocks Enable During CSleep Mode"] | ||
| 22336 | pub const fn uart5lpen(&self) -> super::vals::C1Apb1llpenrTim2lpen { | ||
| 22337 | let val = (self.0 >> 20usize) & 0x01; | ||
| 22338 | super::vals::C1Apb1llpenrTim2lpen(val as u8) | ||
| 22339 | } | ||
| 22340 | #[doc = "UART5 Peripheral Clocks Enable During CSleep Mode"] | ||
| 22341 | pub fn set_uart5lpen(&mut self, val: super::vals::C1Apb1llpenrTim2lpen) { | ||
| 22342 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize); | ||
| 22343 | } | ||
| 22344 | #[doc = "I2C1 Peripheral Clocks Enable During CSleep Mode"] | ||
| 22345 | pub const fn i2c1lpen(&self) -> super::vals::C1Apb1llpenrTim2lpen { | ||
| 22346 | let val = (self.0 >> 21usize) & 0x01; | ||
| 22347 | super::vals::C1Apb1llpenrTim2lpen(val as u8) | ||
| 22348 | } | ||
| 22349 | #[doc = "I2C1 Peripheral Clocks Enable During CSleep Mode"] | ||
| 22350 | pub fn set_i2c1lpen(&mut self, val: super::vals::C1Apb1llpenrTim2lpen) { | ||
| 22351 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize); | ||
| 22352 | } | ||
| 22353 | #[doc = "I2C2 Peripheral Clocks Enable During CSleep Mode"] | ||
| 22354 | pub const fn i2c2lpen(&self) -> super::vals::C1Apb1llpenrTim2lpen { | ||
| 22355 | let val = (self.0 >> 22usize) & 0x01; | ||
| 22356 | super::vals::C1Apb1llpenrTim2lpen(val as u8) | ||
| 22357 | } | ||
| 22358 | #[doc = "I2C2 Peripheral Clocks Enable During CSleep Mode"] | ||
| 22359 | pub fn set_i2c2lpen(&mut self, val: super::vals::C1Apb1llpenrTim2lpen) { | ||
| 22360 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize); | ||
| 22361 | } | ||
| 22362 | #[doc = "I2C3 Peripheral Clocks Enable During CSleep Mode"] | ||
| 22363 | pub const fn i2c3lpen(&self) -> super::vals::C1Apb1llpenrTim2lpen { | ||
| 22364 | let val = (self.0 >> 23usize) & 0x01; | ||
| 22365 | super::vals::C1Apb1llpenrTim2lpen(val as u8) | ||
| 22366 | } | ||
| 22367 | #[doc = "I2C3 Peripheral Clocks Enable During CSleep Mode"] | ||
| 22368 | pub fn set_i2c3lpen(&mut self, val: super::vals::C1Apb1llpenrTim2lpen) { | ||
| 22369 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize); | ||
| 22370 | } | ||
| 22371 | #[doc = "HDMI-CEC Peripheral Clocks Enable During CSleep Mode"] | ||
| 22372 | pub const fn ceclpen(&self) -> super::vals::C1Apb1llpenrTim2lpen { | ||
| 22373 | let val = (self.0 >> 27usize) & 0x01; | ||
| 22374 | super::vals::C1Apb1llpenrTim2lpen(val as u8) | ||
| 22375 | } | ||
| 22376 | #[doc = "HDMI-CEC Peripheral Clocks Enable During CSleep Mode"] | ||
| 22377 | pub fn set_ceclpen(&mut self, val: super::vals::C1Apb1llpenrTim2lpen) { | ||
| 22378 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize); | ||
| 22379 | } | ||
| 22380 | #[doc = "DAC1/2 peripheral clock enable during CSleep mode"] | ||
| 22381 | pub const fn dac12lpen(&self) -> super::vals::C1Apb1llpenrTim2lpen { | ||
| 22382 | let val = (self.0 >> 29usize) & 0x01; | ||
| 22383 | super::vals::C1Apb1llpenrTim2lpen(val as u8) | ||
| 22384 | } | ||
| 22385 | #[doc = "DAC1/2 peripheral clock enable during CSleep mode"] | ||
| 22386 | pub fn set_dac12lpen(&mut self, val: super::vals::C1Apb1llpenrTim2lpen) { | ||
| 22387 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); | ||
| 22388 | } | ||
| 22389 | #[doc = "UART7 Peripheral Clocks Enable During CSleep Mode"] | ||
| 22390 | pub const fn uart7lpen(&self) -> super::vals::C1Apb1llpenrTim2lpen { | ||
| 22391 | let val = (self.0 >> 30usize) & 0x01; | ||
| 22392 | super::vals::C1Apb1llpenrTim2lpen(val as u8) | ||
| 22393 | } | ||
| 22394 | #[doc = "UART7 Peripheral Clocks Enable During CSleep Mode"] | ||
| 22395 | pub fn set_uart7lpen(&mut self, val: super::vals::C1Apb1llpenrTim2lpen) { | ||
| 22396 | self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize); | ||
| 22397 | } | ||
| 22398 | #[doc = "UART8 Peripheral Clocks Enable During CSleep Mode"] | ||
| 22399 | pub const fn uart8lpen(&self) -> super::vals::C1Apb1llpenrTim2lpen { | ||
| 22400 | let val = (self.0 >> 31usize) & 0x01; | ||
| 22401 | super::vals::C1Apb1llpenrTim2lpen(val as u8) | ||
| 22402 | } | ||
| 22403 | #[doc = "UART8 Peripheral Clocks Enable During CSleep Mode"] | ||
| 22404 | pub fn set_uart8lpen(&mut self, val: super::vals::C1Apb1llpenrTim2lpen) { | ||
| 22405 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize); | ||
| 22406 | } | ||
| 22407 | } | ||
| 22408 | impl Default for C1Apb1llpenr { | ||
| 22409 | fn default() -> C1Apb1llpenr { | ||
| 22410 | C1Apb1llpenr(0) | ||
| 22411 | } | ||
| 22412 | } | ||
| 22413 | #[doc = "RCC APB2 Clock Register"] | ||
| 22414 | #[repr(transparent)] | ||
| 22415 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 22416 | pub struct Apb2enr(pub u32); | ||
| 22417 | impl Apb2enr { | ||
| 22418 | #[doc = "TIM1 peripheral clock enable"] | ||
| 22419 | pub const fn tim1en(&self) -> super::vals::Apb2enrTim1en { | ||
| 22420 | let val = (self.0 >> 0usize) & 0x01; | ||
| 22421 | super::vals::Apb2enrTim1en(val as u8) | ||
| 22422 | } | ||
| 22423 | #[doc = "TIM1 peripheral clock enable"] | ||
| 22424 | pub fn set_tim1en(&mut self, val: super::vals::Apb2enrTim1en) { | ||
| 22425 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 22426 | } | ||
| 22427 | #[doc = "TIM8 peripheral clock enable"] | ||
| 22428 | pub const fn tim8en(&self) -> super::vals::Apb2enrTim1en { | ||
| 22429 | let val = (self.0 >> 1usize) & 0x01; | ||
| 22430 | super::vals::Apb2enrTim1en(val as u8) | ||
| 22431 | } | ||
| 22432 | #[doc = "TIM8 peripheral clock enable"] | ||
| 22433 | pub fn set_tim8en(&mut self, val: super::vals::Apb2enrTim1en) { | ||
| 22434 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 22435 | } | ||
| 22436 | #[doc = "USART1 Peripheral Clocks Enable"] | ||
| 22437 | pub const fn usart1en(&self) -> super::vals::Apb2enrTim1en { | ||
| 22438 | let val = (self.0 >> 4usize) & 0x01; | ||
| 22439 | super::vals::Apb2enrTim1en(val as u8) | ||
| 22440 | } | ||
| 22441 | #[doc = "USART1 Peripheral Clocks Enable"] | ||
| 22442 | pub fn set_usart1en(&mut self, val: super::vals::Apb2enrTim1en) { | ||
| 22443 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 22444 | } | ||
| 22445 | #[doc = "USART6 Peripheral Clocks Enable"] | ||
| 22446 | pub const fn usart6en(&self) -> super::vals::Apb2enrTim1en { | ||
| 22447 | let val = (self.0 >> 5usize) & 0x01; | ||
| 22448 | super::vals::Apb2enrTim1en(val as u8) | ||
| 22449 | } | ||
| 22450 | #[doc = "USART6 Peripheral Clocks Enable"] | ||
| 22451 | pub fn set_usart6en(&mut self, val: super::vals::Apb2enrTim1en) { | ||
| 22452 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 22453 | } | ||
| 22454 | #[doc = "SPI1 Peripheral Clocks Enable"] | ||
| 22455 | pub const fn spi1en(&self) -> super::vals::Apb2enrTim1en { | ||
| 22456 | let val = (self.0 >> 12usize) & 0x01; | ||
| 22457 | super::vals::Apb2enrTim1en(val as u8) | ||
| 22458 | } | ||
| 22459 | #[doc = "SPI1 Peripheral Clocks Enable"] | ||
| 22460 | pub fn set_spi1en(&mut self, val: super::vals::Apb2enrTim1en) { | ||
| 22461 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 22462 | } | ||
| 22463 | #[doc = "SPI4 Peripheral Clocks Enable"] | ||
| 22464 | pub const fn spi4en(&self) -> super::vals::Apb2enrTim1en { | ||
| 22465 | let val = (self.0 >> 13usize) & 0x01; | ||
| 22466 | super::vals::Apb2enrTim1en(val as u8) | ||
| 22467 | } | ||
| 22468 | #[doc = "SPI4 Peripheral Clocks Enable"] | ||
| 22469 | pub fn set_spi4en(&mut self, val: super::vals::Apb2enrTim1en) { | ||
| 22470 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize); | ||
| 22471 | } | ||
| 22472 | #[doc = "TIM15 peripheral clock enable"] | ||
| 22473 | pub const fn tim15en(&self) -> super::vals::Apb2enrTim1en { | ||
| 22474 | let val = (self.0 >> 16usize) & 0x01; | ||
| 22475 | super::vals::Apb2enrTim1en(val as u8) | ||
| 22476 | } | ||
| 22477 | #[doc = "TIM15 peripheral clock enable"] | ||
| 22478 | pub fn set_tim15en(&mut self, val: super::vals::Apb2enrTim1en) { | ||
| 22479 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 22480 | } | ||
| 22481 | #[doc = "TIM16 peripheral clock enable"] | ||
| 22482 | pub const fn tim16en(&self) -> super::vals::Apb2enrTim1en { | ||
| 22483 | let val = (self.0 >> 17usize) & 0x01; | ||
| 22484 | super::vals::Apb2enrTim1en(val as u8) | ||
| 22485 | } | ||
| 22486 | #[doc = "TIM16 peripheral clock enable"] | ||
| 22487 | pub fn set_tim16en(&mut self, val: super::vals::Apb2enrTim1en) { | ||
| 22488 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize); | ||
| 22489 | } | ||
| 22490 | #[doc = "TIM17 peripheral clock enable"] | ||
| 22491 | pub const fn tim17en(&self) -> super::vals::Apb2enrTim1en { | ||
| 22492 | let val = (self.0 >> 18usize) & 0x01; | ||
| 22493 | super::vals::Apb2enrTim1en(val as u8) | ||
| 22494 | } | ||
| 22495 | #[doc = "TIM17 peripheral clock enable"] | ||
| 22496 | pub fn set_tim17en(&mut self, val: super::vals::Apb2enrTim1en) { | ||
| 22497 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize); | ||
| 22498 | } | ||
| 22499 | #[doc = "SPI5 Peripheral Clocks Enable"] | ||
| 22500 | pub const fn spi5en(&self) -> super::vals::Apb2enrTim1en { | ||
| 22501 | let val = (self.0 >> 20usize) & 0x01; | ||
| 22502 | super::vals::Apb2enrTim1en(val as u8) | ||
| 22503 | } | ||
| 22504 | #[doc = "SPI5 Peripheral Clocks Enable"] | ||
| 22505 | pub fn set_spi5en(&mut self, val: super::vals::Apb2enrTim1en) { | ||
| 22506 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize); | ||
| 22507 | } | ||
| 22508 | #[doc = "SAI1 Peripheral Clocks Enable"] | ||
| 22509 | pub const fn sai1en(&self) -> super::vals::Apb2enrTim1en { | ||
| 22510 | let val = (self.0 >> 22usize) & 0x01; | ||
| 22511 | super::vals::Apb2enrTim1en(val as u8) | ||
| 22512 | } | ||
| 22513 | #[doc = "SAI1 Peripheral Clocks Enable"] | ||
| 22514 | pub fn set_sai1en(&mut self, val: super::vals::Apb2enrTim1en) { | ||
| 22515 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize); | ||
| 22516 | } | ||
| 22517 | #[doc = "SAI2 Peripheral Clocks Enable"] | ||
| 22518 | pub const fn sai2en(&self) -> super::vals::Apb2enrTim1en { | ||
| 22519 | let val = (self.0 >> 23usize) & 0x01; | ||
| 22520 | super::vals::Apb2enrTim1en(val as u8) | ||
| 22521 | } | ||
| 22522 | #[doc = "SAI2 Peripheral Clocks Enable"] | ||
| 22523 | pub fn set_sai2en(&mut self, val: super::vals::Apb2enrTim1en) { | ||
| 22524 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize); | ||
| 22525 | } | ||
| 22526 | #[doc = "SAI3 Peripheral Clocks Enable"] | ||
| 22527 | pub const fn sai3en(&self) -> super::vals::Apb2enrTim1en { | ||
| 22528 | let val = (self.0 >> 24usize) & 0x01; | ||
| 22529 | super::vals::Apb2enrTim1en(val as u8) | ||
| 22530 | } | ||
| 22531 | #[doc = "SAI3 Peripheral Clocks Enable"] | ||
| 22532 | pub fn set_sai3en(&mut self, val: super::vals::Apb2enrTim1en) { | ||
| 22533 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); | ||
| 22534 | } | ||
| 22535 | #[doc = "DFSDM1 Peripheral Clocks Enable"] | ||
| 22536 | pub const fn dfsdm1en(&self) -> super::vals::Apb2enrTim1en { | ||
| 22537 | let val = (self.0 >> 28usize) & 0x01; | ||
| 22538 | super::vals::Apb2enrTim1en(val as u8) | ||
| 22539 | } | ||
| 22540 | #[doc = "DFSDM1 Peripheral Clocks Enable"] | ||
| 22541 | pub fn set_dfsdm1en(&mut self, val: super::vals::Apb2enrTim1en) { | ||
| 22542 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); | ||
| 22543 | } | ||
| 22544 | #[doc = "HRTIM peripheral clock enable"] | ||
| 22545 | pub const fn hrtimen(&self) -> super::vals::Apb2enrTim1en { | ||
| 22546 | let val = (self.0 >> 29usize) & 0x01; | ||
| 22547 | super::vals::Apb2enrTim1en(val as u8) | ||
| 22548 | } | ||
| 22549 | #[doc = "HRTIM peripheral clock enable"] | ||
| 22550 | pub fn set_hrtimen(&mut self, val: super::vals::Apb2enrTim1en) { | ||
| 22551 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); | ||
| 22552 | } | ||
| 22553 | } | ||
| 22554 | impl Default for Apb2enr { | ||
| 22555 | fn default() -> Apb2enr { | ||
| 22556 | Apb2enr(0) | ||
| 22557 | } | ||
| 22558 | } | ||
| 22559 | #[doc = "RCC APB4 Peripheral Reset Register"] | ||
| 22560 | #[repr(transparent)] | ||
| 22561 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 22562 | pub struct Apb4rstr(pub u32); | ||
| 22563 | impl Apb4rstr { | ||
| 22564 | #[doc = "SYSCFG block reset"] | ||
| 22565 | pub const fn syscfgrst(&self) -> super::vals::Syscfgrst { | ||
| 22566 | let val = (self.0 >> 1usize) & 0x01; | ||
| 22567 | super::vals::Syscfgrst(val as u8) | ||
| 22568 | } | ||
| 22569 | #[doc = "SYSCFG block reset"] | ||
| 22570 | pub fn set_syscfgrst(&mut self, val: super::vals::Syscfgrst) { | ||
| 22571 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 22572 | } | ||
| 22573 | #[doc = "LPUART1 block reset"] | ||
| 22574 | pub const fn lpuart1rst(&self) -> super::vals::Syscfgrst { | ||
| 22575 | let val = (self.0 >> 3usize) & 0x01; | ||
| 22576 | super::vals::Syscfgrst(val as u8) | ||
| 22577 | } | ||
| 22578 | #[doc = "LPUART1 block reset"] | ||
| 22579 | pub fn set_lpuart1rst(&mut self, val: super::vals::Syscfgrst) { | ||
| 22580 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 22581 | } | ||
| 22582 | #[doc = "SPI6 block reset"] | ||
| 22583 | pub const fn spi6rst(&self) -> super::vals::Syscfgrst { | ||
| 22584 | let val = (self.0 >> 5usize) & 0x01; | ||
| 22585 | super::vals::Syscfgrst(val as u8) | ||
| 22586 | } | ||
| 22587 | #[doc = "SPI6 block reset"] | ||
| 22588 | pub fn set_spi6rst(&mut self, val: super::vals::Syscfgrst) { | ||
| 22589 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 22590 | } | ||
| 22591 | #[doc = "I2C4 block reset"] | ||
| 22592 | pub const fn i2c4rst(&self) -> super::vals::Syscfgrst { | ||
| 22593 | let val = (self.0 >> 7usize) & 0x01; | ||
| 22594 | super::vals::Syscfgrst(val as u8) | ||
| 22595 | } | ||
| 22596 | #[doc = "I2C4 block reset"] | ||
| 22597 | pub fn set_i2c4rst(&mut self, val: super::vals::Syscfgrst) { | ||
| 22598 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 22599 | } | ||
| 22600 | #[doc = "LPTIM2 block reset"] | ||
| 22601 | pub const fn lptim2rst(&self) -> super::vals::Syscfgrst { | ||
| 22602 | let val = (self.0 >> 9usize) & 0x01; | ||
| 22603 | super::vals::Syscfgrst(val as u8) | ||
| 22604 | } | ||
| 22605 | #[doc = "LPTIM2 block reset"] | ||
| 22606 | pub fn set_lptim2rst(&mut self, val: super::vals::Syscfgrst) { | ||
| 22607 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | ||
| 22608 | } | ||
| 22609 | #[doc = "LPTIM3 block reset"] | ||
| 22610 | pub const fn lptim3rst(&self) -> super::vals::Syscfgrst { | ||
| 14360 | let val = (self.0 >> 10usize) & 0x01; | 22611 | let val = (self.0 >> 10usize) & 0x01; |
| 14361 | val != 0 | 22612 | super::vals::Syscfgrst(val as u8) |
| 14362 | } | 22613 | } |
| 14363 | #[doc = "Data block end interrupt enable Set and cleared by software to enable/disable interrupt caused by data block end."] | 22614 | #[doc = "LPTIM3 block reset"] |
| 14364 | pub fn set_dbckendie(&mut self, val: bool) { | 22615 | pub fn set_lptim3rst(&mut self, val: super::vals::Syscfgrst) { |
| 14365 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | 22616 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); |
| 14366 | } | 22617 | } |
| 14367 | #[doc = "Data transfer aborted interrupt enable Set and cleared by software to enable/disable interrupt caused by a data transfer being aborted."] | 22618 | #[doc = "LPTIM4 block reset"] |
| 14368 | pub const fn dabortie(&self) -> bool { | 22619 | pub const fn lptim4rst(&self) -> super::vals::Syscfgrst { |
| 14369 | let val = (self.0 >> 11usize) & 0x01; | 22620 | let val = (self.0 >> 11usize) & 0x01; |
| 14370 | val != 0 | 22621 | super::vals::Syscfgrst(val as u8) |
| 14371 | } | 22622 | } |
| 14372 | #[doc = "Data transfer aborted interrupt enable Set and cleared by software to enable/disable interrupt caused by a data transfer being aborted."] | 22623 | #[doc = "LPTIM4 block reset"] |
| 14373 | pub fn set_dabortie(&mut self, val: bool) { | 22624 | pub fn set_lptim4rst(&mut self, val: super::vals::Syscfgrst) { |
| 14374 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); | 22625 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); |
| 14375 | } | 22626 | } |
| 14376 | #[doc = "Tx FIFO half empty interrupt enable Set and cleared by software to enable/disable interrupt caused by Tx FIFO half empty."] | 22627 | #[doc = "LPTIM5 block reset"] |
| 14377 | pub const fn txfifoheie(&self) -> bool { | 22628 | pub const fn lptim5rst(&self) -> super::vals::Syscfgrst { |
| 22629 | let val = (self.0 >> 12usize) & 0x01; | ||
| 22630 | super::vals::Syscfgrst(val as u8) | ||
| 22631 | } | ||
| 22632 | #[doc = "LPTIM5 block reset"] | ||
| 22633 | pub fn set_lptim5rst(&mut self, val: super::vals::Syscfgrst) { | ||
| 22634 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 22635 | } | ||
| 22636 | #[doc = "COMP12 Blocks Reset"] | ||
| 22637 | pub const fn comp12rst(&self) -> super::vals::Syscfgrst { | ||
| 14378 | let val = (self.0 >> 14usize) & 0x01; | 22638 | let val = (self.0 >> 14usize) & 0x01; |
| 14379 | val != 0 | 22639 | super::vals::Syscfgrst(val as u8) |
| 14380 | } | 22640 | } |
| 14381 | #[doc = "Tx FIFO half empty interrupt enable Set and cleared by software to enable/disable interrupt caused by Tx FIFO half empty."] | 22641 | #[doc = "COMP12 Blocks Reset"] |
| 14382 | pub fn set_txfifoheie(&mut self, val: bool) { | 22642 | pub fn set_comp12rst(&mut self, val: super::vals::Syscfgrst) { |
| 14383 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | 22643 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); |
| 14384 | } | 22644 | } |
| 14385 | #[doc = "Rx FIFO half full interrupt enable Set and cleared by software to enable/disable interrupt caused by Rx FIFO half full."] | 22645 | #[doc = "VREF block reset"] |
| 14386 | pub const fn rxfifohfie(&self) -> bool { | 22646 | pub const fn vrefrst(&self) -> super::vals::Syscfgrst { |
| 14387 | let val = (self.0 >> 15usize) & 0x01; | 22647 | let val = (self.0 >> 15usize) & 0x01; |
| 14388 | val != 0 | 22648 | super::vals::Syscfgrst(val as u8) |
| 14389 | } | 22649 | } |
| 14390 | #[doc = "Rx FIFO half full interrupt enable Set and cleared by software to enable/disable interrupt caused by Rx FIFO half full."] | 22650 | #[doc = "VREF block reset"] |
| 14391 | pub fn set_rxfifohfie(&mut self, val: bool) { | 22651 | pub fn set_vrefrst(&mut self, val: super::vals::Syscfgrst) { |
| 14392 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); | 22652 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); |
| 14393 | } | 22653 | } |
| 14394 | #[doc = "Rx FIFO full interrupt enable Set and cleared by software to enable/disable interrupt caused by Rx FIFO full."] | 22654 | #[doc = "SAI4 block reset"] |
| 14395 | pub const fn rxfifofie(&self) -> bool { | 22655 | pub const fn sai4rst(&self) -> super::vals::Syscfgrst { |
| 22656 | let val = (self.0 >> 21usize) & 0x01; | ||
| 22657 | super::vals::Syscfgrst(val as u8) | ||
| 22658 | } | ||
| 22659 | #[doc = "SAI4 block reset"] | ||
| 22660 | pub fn set_sai4rst(&mut self, val: super::vals::Syscfgrst) { | ||
| 22661 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize); | ||
| 22662 | } | ||
| 22663 | } | ||
| 22664 | impl Default for Apb4rstr { | ||
| 22665 | fn default() -> Apb4rstr { | ||
| 22666 | Apb4rstr(0) | ||
| 22667 | } | ||
| 22668 | } | ||
| 22669 | #[doc = "RCC Domain 3 Clock Configuration Register"] | ||
| 22670 | #[repr(transparent)] | ||
| 22671 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 22672 | pub struct D3cfgr(pub u32); | ||
| 22673 | impl D3cfgr { | ||
| 22674 | #[doc = "D3 domain APB4 prescaler"] | ||
| 22675 | pub const fn d3ppre(&self) -> super::vals::D3ppre { | ||
| 22676 | let val = (self.0 >> 4usize) & 0x07; | ||
| 22677 | super::vals::D3ppre(val as u8) | ||
| 22678 | } | ||
| 22679 | #[doc = "D3 domain APB4 prescaler"] | ||
| 22680 | pub fn set_d3ppre(&mut self, val: super::vals::D3ppre) { | ||
| 22681 | self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize); | ||
| 22682 | } | ||
| 22683 | } | ||
| 22684 | impl Default for D3cfgr { | ||
| 22685 | fn default() -> D3cfgr { | ||
| 22686 | D3cfgr(0) | ||
| 22687 | } | ||
| 22688 | } | ||
| 22689 | #[doc = "RCC PLL3 Fractional Divider Register"] | ||
| 22690 | #[repr(transparent)] | ||
| 22691 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 22692 | pub struct Pll3fracr(pub u32); | ||
| 22693 | impl Pll3fracr { | ||
| 22694 | #[doc = "Fractional part of the multiplication factor for PLL3 VCO"] | ||
| 22695 | pub const fn fracn3(&self) -> u16 { | ||
| 22696 | let val = (self.0 >> 3usize) & 0x1fff; | ||
| 22697 | val as u16 | ||
| 22698 | } | ||
| 22699 | #[doc = "Fractional part of the multiplication factor for PLL3 VCO"] | ||
| 22700 | pub fn set_fracn3(&mut self, val: u16) { | ||
| 22701 | self.0 = (self.0 & !(0x1fff << 3usize)) | (((val as u32) & 0x1fff) << 3usize); | ||
| 22702 | } | ||
| 22703 | } | ||
| 22704 | impl Default for Pll3fracr { | ||
| 22705 | fn default() -> Pll3fracr { | ||
| 22706 | Pll3fracr(0) | ||
| 22707 | } | ||
| 22708 | } | ||
| 22709 | #[doc = "RCC AHB3 Clock Register"] | ||
| 22710 | #[repr(transparent)] | ||
| 22711 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 22712 | pub struct Ahb3enr(pub u32); | ||
| 22713 | impl Ahb3enr { | ||
| 22714 | #[doc = "MDMA Peripheral Clock Enable"] | ||
| 22715 | pub const fn mdmaen(&self) -> super::vals::Ahb3enrMdmaen { | ||
| 22716 | let val = (self.0 >> 0usize) & 0x01; | ||
| 22717 | super::vals::Ahb3enrMdmaen(val as u8) | ||
| 22718 | } | ||
| 22719 | #[doc = "MDMA Peripheral Clock Enable"] | ||
| 22720 | pub fn set_mdmaen(&mut self, val: super::vals::Ahb3enrMdmaen) { | ||
| 22721 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 22722 | } | ||
| 22723 | #[doc = "DMA2D Peripheral Clock Enable"] | ||
| 22724 | pub const fn dma2den(&self) -> super::vals::Ahb3enrMdmaen { | ||
| 22725 | let val = (self.0 >> 4usize) & 0x01; | ||
| 22726 | super::vals::Ahb3enrMdmaen(val as u8) | ||
| 22727 | } | ||
| 22728 | #[doc = "DMA2D Peripheral Clock Enable"] | ||
| 22729 | pub fn set_dma2den(&mut self, val: super::vals::Ahb3enrMdmaen) { | ||
| 22730 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 22731 | } | ||
| 22732 | #[doc = "JPGDEC Peripheral Clock Enable"] | ||
| 22733 | pub const fn jpgdecen(&self) -> super::vals::Ahb3enrMdmaen { | ||
| 22734 | let val = (self.0 >> 5usize) & 0x01; | ||
| 22735 | super::vals::Ahb3enrMdmaen(val as u8) | ||
| 22736 | } | ||
| 22737 | #[doc = "JPGDEC Peripheral Clock Enable"] | ||
| 22738 | pub fn set_jpgdecen(&mut self, val: super::vals::Ahb3enrMdmaen) { | ||
| 22739 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 22740 | } | ||
| 22741 | #[doc = "FMC Peripheral Clocks Enable"] | ||
| 22742 | pub const fn fmcen(&self) -> super::vals::Ahb3enrMdmaen { | ||
| 22743 | let val = (self.0 >> 12usize) & 0x01; | ||
| 22744 | super::vals::Ahb3enrMdmaen(val as u8) | ||
| 22745 | } | ||
| 22746 | #[doc = "FMC Peripheral Clocks Enable"] | ||
| 22747 | pub fn set_fmcen(&mut self, val: super::vals::Ahb3enrMdmaen) { | ||
| 22748 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 22749 | } | ||
| 22750 | #[doc = "QUADSPI and QUADSPI Delay Clock Enable"] | ||
| 22751 | pub const fn qspien(&self) -> super::vals::Ahb3enrMdmaen { | ||
| 22752 | let val = (self.0 >> 14usize) & 0x01; | ||
| 22753 | super::vals::Ahb3enrMdmaen(val as u8) | ||
| 22754 | } | ||
| 22755 | #[doc = "QUADSPI and QUADSPI Delay Clock Enable"] | ||
| 22756 | pub fn set_qspien(&mut self, val: super::vals::Ahb3enrMdmaen) { | ||
| 22757 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | ||
| 22758 | } | ||
| 22759 | #[doc = "SDMMC1 and SDMMC1 Delay Clock Enable"] | ||
| 22760 | pub const fn sdmmc1en(&self) -> super::vals::Ahb3enrMdmaen { | ||
| 22761 | let val = (self.0 >> 16usize) & 0x01; | ||
| 22762 | super::vals::Ahb3enrMdmaen(val as u8) | ||
| 22763 | } | ||
| 22764 | #[doc = "SDMMC1 and SDMMC1 Delay Clock Enable"] | ||
| 22765 | pub fn set_sdmmc1en(&mut self, val: super::vals::Ahb3enrMdmaen) { | ||
| 22766 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 22767 | } | ||
| 22768 | } | ||
| 22769 | impl Default for Ahb3enr { | ||
| 22770 | fn default() -> Ahb3enr { | ||
| 22771 | Ahb3enr(0) | ||
| 22772 | } | ||
| 22773 | } | ||
| 22774 | #[doc = "RCC Reset Status Register"] | ||
| 22775 | #[repr(transparent)] | ||
| 22776 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 22777 | pub struct C1Rsr(pub u32); | ||
| 22778 | impl C1Rsr { | ||
| 22779 | #[doc = "Remove reset flag"] | ||
| 22780 | pub const fn rmvf(&self) -> super::vals::C1RsrRmvf { | ||
| 22781 | let val = (self.0 >> 16usize) & 0x01; | ||
| 22782 | super::vals::C1RsrRmvf(val as u8) | ||
| 22783 | } | ||
| 22784 | #[doc = "Remove reset flag"] | ||
| 22785 | pub fn set_rmvf(&mut self, val: super::vals::C1RsrRmvf) { | ||
| 22786 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 22787 | } | ||
| 22788 | #[doc = "CPU reset flag"] | ||
| 22789 | pub const fn cpurstf(&self) -> bool { | ||
| 14396 | let val = (self.0 >> 17usize) & 0x01; | 22790 | let val = (self.0 >> 17usize) & 0x01; |
| 14397 | val != 0 | 22791 | val != 0 |
| 14398 | } | 22792 | } |
| 14399 | #[doc = "Rx FIFO full interrupt enable Set and cleared by software to enable/disable interrupt caused by Rx FIFO full."] | 22793 | #[doc = "CPU reset flag"] |
| 14400 | pub fn set_rxfifofie(&mut self, val: bool) { | 22794 | pub fn set_cpurstf(&mut self, val: bool) { |
| 14401 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); | 22795 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); |
| 14402 | } | 22796 | } |
| 14403 | #[doc = "Tx FIFO empty interrupt enable Set and cleared by software to enable/disable interrupt caused by Tx FIFO empty."] | 22797 | #[doc = "D1 domain power switch reset flag"] |
| 14404 | pub const fn txfifoeie(&self) -> bool { | 22798 | pub const fn d1rstf(&self) -> bool { |
| 14405 | let val = (self.0 >> 18usize) & 0x01; | 22799 | let val = (self.0 >> 19usize) & 0x01; |
| 14406 | val != 0 | 22800 | val != 0 |
| 14407 | } | 22801 | } |
| 14408 | #[doc = "Tx FIFO empty interrupt enable Set and cleared by software to enable/disable interrupt caused by Tx FIFO empty."] | 22802 | #[doc = "D1 domain power switch reset flag"] |
| 14409 | pub fn set_txfifoeie(&mut self, val: bool) { | 22803 | pub fn set_d1rstf(&mut self, val: bool) { |
| 14410 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); | 22804 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); |
| 14411 | } | 22805 | } |
| 14412 | #[doc = "BUSYD0END interrupt enable Set and cleared by software to enable/disable the interrupt generated when SDMMC_D0 signal changes from busy to NOT busy following a CMD response."] | 22806 | #[doc = "D2 domain power switch reset flag"] |
| 14413 | pub const fn busyd0endie(&self) -> bool { | 22807 | pub const fn d2rstf(&self) -> bool { |
| 22808 | let val = (self.0 >> 20usize) & 0x01; | ||
| 22809 | val != 0 | ||
| 22810 | } | ||
| 22811 | #[doc = "D2 domain power switch reset flag"] | ||
| 22812 | pub fn set_d2rstf(&mut self, val: bool) { | ||
| 22813 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); | ||
| 22814 | } | ||
| 22815 | #[doc = "BOR reset flag"] | ||
| 22816 | pub const fn borrstf(&self) -> bool { | ||
| 14414 | let val = (self.0 >> 21usize) & 0x01; | 22817 | let val = (self.0 >> 21usize) & 0x01; |
| 14415 | val != 0 | 22818 | val != 0 |
| 14416 | } | 22819 | } |
| 14417 | #[doc = "BUSYD0END interrupt enable Set and cleared by software to enable/disable the interrupt generated when SDMMC_D0 signal changes from busy to NOT busy following a CMD response."] | 22820 | #[doc = "BOR reset flag"] |
| 14418 | pub fn set_busyd0endie(&mut self, val: bool) { | 22821 | pub fn set_borrstf(&mut self, val: bool) { |
| 14419 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); | 22822 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); |
| 14420 | } | 22823 | } |
| 14421 | #[doc = "SDIO mode interrupt received interrupt enable Set and cleared by software to enable/disable the interrupt generated when receiving the SDIO mode interrupt."] | 22824 | #[doc = "Pin reset flag (NRST)"] |
| 14422 | pub const fn sdioitie(&self) -> bool { | 22825 | pub const fn pinrstf(&self) -> bool { |
| 14423 | let val = (self.0 >> 22usize) & 0x01; | 22826 | let val = (self.0 >> 22usize) & 0x01; |
| 14424 | val != 0 | 22827 | val != 0 |
| 14425 | } | 22828 | } |
| 14426 | #[doc = "SDIO mode interrupt received interrupt enable Set and cleared by software to enable/disable the interrupt generated when receiving the SDIO mode interrupt."] | 22829 | #[doc = "Pin reset flag (NRST)"] |
| 14427 | pub fn set_sdioitie(&mut self, val: bool) { | 22830 | pub fn set_pinrstf(&mut self, val: bool) { |
| 14428 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); | 22831 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); |
| 14429 | } | 22832 | } |
| 14430 | #[doc = "Acknowledgment Fail interrupt enable Set and cleared by software to enable/disable interrupt caused by acknowledgment Fail."] | 22833 | #[doc = "POR/PDR reset flag"] |
| 14431 | pub const fn ackfailie(&self) -> bool { | 22834 | pub const fn porrstf(&self) -> bool { |
| 14432 | let val = (self.0 >> 23usize) & 0x01; | 22835 | let val = (self.0 >> 23usize) & 0x01; |
| 14433 | val != 0 | 22836 | val != 0 |
| 14434 | } | 22837 | } |
| 14435 | #[doc = "Acknowledgment Fail interrupt enable Set and cleared by software to enable/disable interrupt caused by acknowledgment Fail."] | 22838 | #[doc = "POR/PDR reset flag"] |
| 14436 | pub fn set_ackfailie(&mut self, val: bool) { | 22839 | pub fn set_porrstf(&mut self, val: bool) { |
| 14437 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); | 22840 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); |
| 14438 | } | 22841 | } |
| 14439 | #[doc = "Acknowledgment timeout interrupt enable Set and cleared by software to enable/disable interrupt caused by acknowledgment timeout."] | 22842 | #[doc = "System reset from CPU reset flag"] |
| 14440 | pub const fn acktimeoutie(&self) -> bool { | 22843 | pub const fn sftrstf(&self) -> bool { |
| 14441 | let val = (self.0 >> 24usize) & 0x01; | 22844 | let val = (self.0 >> 24usize) & 0x01; |
| 14442 | val != 0 | 22845 | val != 0 |
| 14443 | } | 22846 | } |
| 14444 | #[doc = "Acknowledgment timeout interrupt enable Set and cleared by software to enable/disable interrupt caused by acknowledgment timeout."] | 22847 | #[doc = "System reset from CPU reset flag"] |
| 14445 | pub fn set_acktimeoutie(&mut self, val: bool) { | 22848 | pub fn set_sftrstf(&mut self, val: bool) { |
| 14446 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize); | 22849 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize); |
| 14447 | } | 22850 | } |
| 14448 | #[doc = "Voltage switch critical timing section completion interrupt enable Set and cleared by software to enable/disable the interrupt generated when voltage switch critical timing section completion."] | 22851 | #[doc = "Independent Watchdog reset flag"] |
| 14449 | pub const fn vswendie(&self) -> bool { | 22852 | pub const fn iwdg1rstf(&self) -> bool { |
| 14450 | let val = (self.0 >> 25usize) & 0x01; | ||
| 14451 | val != 0 | ||
| 14452 | } | ||
| 14453 | #[doc = "Voltage switch critical timing section completion interrupt enable Set and cleared by software to enable/disable the interrupt generated when voltage switch critical timing section completion."] | ||
| 14454 | pub fn set_vswendie(&mut self, val: bool) { | ||
| 14455 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize); | ||
| 14456 | } | ||
| 14457 | #[doc = "Voltage Switch clock stopped interrupt enable Set and cleared by software to enable/disable interrupt caused by Voltage Switch clock stopped."] | ||
| 14458 | pub const fn ckstopie(&self) -> bool { | ||
| 14459 | let val = (self.0 >> 26usize) & 0x01; | 22853 | let val = (self.0 >> 26usize) & 0x01; |
| 14460 | val != 0 | 22854 | val != 0 |
| 14461 | } | 22855 | } |
| 14462 | #[doc = "Voltage Switch clock stopped interrupt enable Set and cleared by software to enable/disable interrupt caused by Voltage Switch clock stopped."] | 22856 | #[doc = "Independent Watchdog reset flag"] |
| 14463 | pub fn set_ckstopie(&mut self, val: bool) { | 22857 | pub fn set_iwdg1rstf(&mut self, val: bool) { |
| 14464 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); | 22858 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); |
| 14465 | } | 22859 | } |
| 14466 | #[doc = "IDMA buffer transfer complete interrupt enable Set and cleared by software to enable/disable the interrupt generated when the IDMA has transferred all data belonging to a memory buffer."] | 22860 | #[doc = "Window Watchdog reset flag"] |
| 14467 | pub const fn idmabtcie(&self) -> bool { | 22861 | pub const fn wwdg1rstf(&self) -> bool { |
| 14468 | let val = (self.0 >> 28usize) & 0x01; | 22862 | let val = (self.0 >> 28usize) & 0x01; |
| 14469 | val != 0 | 22863 | val != 0 |
| 14470 | } | 22864 | } |
| 14471 | #[doc = "IDMA buffer transfer complete interrupt enable Set and cleared by software to enable/disable the interrupt generated when the IDMA has transferred all data belonging to a memory buffer."] | 22865 | #[doc = "Window Watchdog reset flag"] |
| 14472 | pub fn set_idmabtcie(&mut self, val: bool) { | 22866 | pub fn set_wwdg1rstf(&mut self, val: bool) { |
| 14473 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize); | 22867 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize); |
| 14474 | } | 22868 | } |
| 22869 | #[doc = "Reset due to illegal D1 DStandby or CPU CStop flag"] | ||
| 22870 | pub const fn lpwrrstf(&self) -> bool { | ||
| 22871 | let val = (self.0 >> 30usize) & 0x01; | ||
| 22872 | val != 0 | ||
| 22873 | } | ||
| 22874 | #[doc = "Reset due to illegal D1 DStandby or CPU CStop flag"] | ||
| 22875 | pub fn set_lpwrrstf(&mut self, val: bool) { | ||
| 22876 | self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize); | ||
| 22877 | } | ||
| 14475 | } | 22878 | } |
| 14476 | impl Default for Maskr { | 22879 | impl Default for C1Rsr { |
| 14477 | fn default() -> Maskr { | 22880 | fn default() -> C1Rsr { |
| 14478 | Maskr(0) | 22881 | C1Rsr(0) |
| 14479 | } | 22882 | } |
| 14480 | } | 22883 | } |
| 14481 | #[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)."] | 22884 | #[doc = "RCC APB4 Sleep Clock Register"] |
| 14482 | #[repr(transparent)] | 22885 | #[repr(transparent)] |
| 14483 | #[derive(Copy, Clone, Eq, PartialEq)] | 22886 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 14484 | pub struct Cmdr(pub u32); | 22887 | pub struct Apb4lpenr(pub u32); |
| 14485 | impl Cmdr { | 22888 | impl Apb4lpenr { |
| 14486 | #[doc = "Command index. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). The command index is sent to the card as part of a command message."] | 22889 | #[doc = "SYSCFG peripheral clock enable during CSleep mode"] |
| 14487 | pub const fn cmdindex(&self) -> u8 { | 22890 | pub const fn syscfglpen(&self) -> super::vals::Apb4lpenrSyscfglpen { |
| 14488 | let val = (self.0 >> 0usize) & 0x3f; | 22891 | let val = (self.0 >> 1usize) & 0x01; |
| 14489 | val as u8 | 22892 | super::vals::Apb4lpenrSyscfglpen(val as u8) |
| 14490 | } | 22893 | } |
| 14491 | #[doc = "Command index. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). The command index is sent to the card as part of a command message."] | 22894 | #[doc = "SYSCFG peripheral clock enable during CSleep mode"] |
| 14492 | pub fn set_cmdindex(&mut self, val: u8) { | 22895 | pub fn set_syscfglpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) { |
| 14493 | self.0 = (self.0 & !(0x3f << 0usize)) | (((val as u32) & 0x3f) << 0usize); | 22896 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); |
| 14494 | } | 22897 | } |
| 14495 | #[doc = "The CPSM treats the command as a data transfer command, stops the interrupt period, and signals DataEnable to the DPSM This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). If this bit is set, the CPSM issues an end of interrupt period and issues DataEnable signal to the DPSM when the command is sent."] | 22898 | #[doc = "LPUART1 Peripheral Clocks Enable During CSleep Mode"] |
| 14496 | pub const fn cmdtrans(&self) -> bool { | 22899 | pub const fn lpuart1lpen(&self) -> super::vals::Apb4lpenrSyscfglpen { |
| 14497 | let val = (self.0 >> 6usize) & 0x01; | 22900 | let val = (self.0 >> 3usize) & 0x01; |
| 14498 | val != 0 | 22901 | super::vals::Apb4lpenrSyscfglpen(val as u8) |
| 14499 | } | 22902 | } |
| 14500 | #[doc = "The CPSM treats the command as a data transfer command, stops the interrupt period, and signals DataEnable to the DPSM This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). If this bit is set, the CPSM issues an end of interrupt period and issues DataEnable signal to the DPSM when the command is sent."] | 22903 | #[doc = "LPUART1 Peripheral Clocks Enable During CSleep Mode"] |
| 14501 | pub fn set_cmdtrans(&mut self, val: bool) { | 22904 | pub fn set_lpuart1lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) { |
| 14502 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | 22905 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); |
| 14503 | } | 22906 | } |
| 14504 | #[doc = "The CPSM treats the command as a Stop Transmission command and signals Abort to the DPSM. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). If this bit is set, the CPSM issues the Abort signal to the DPSM when the command is sent."] | 22907 | #[doc = "SPI6 Peripheral Clocks Enable During CSleep Mode"] |
| 14505 | pub const fn cmdstop(&self) -> bool { | 22908 | pub const fn spi6lpen(&self) -> super::vals::Apb4lpenrSyscfglpen { |
| 22909 | let val = (self.0 >> 5usize) & 0x01; | ||
| 22910 | super::vals::Apb4lpenrSyscfglpen(val as u8) | ||
| 22911 | } | ||
| 22912 | #[doc = "SPI6 Peripheral Clocks Enable During CSleep Mode"] | ||
| 22913 | pub fn set_spi6lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) { | ||
| 22914 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 22915 | } | ||
| 22916 | #[doc = "I2C4 Peripheral Clocks Enable During CSleep Mode"] | ||
| 22917 | pub const fn i2c4lpen(&self) -> super::vals::Apb4lpenrSyscfglpen { | ||
| 14506 | let val = (self.0 >> 7usize) & 0x01; | 22918 | let val = (self.0 >> 7usize) & 0x01; |
| 14507 | val != 0 | 22919 | super::vals::Apb4lpenrSyscfglpen(val as u8) |
| 14508 | } | 22920 | } |
| 14509 | #[doc = "The CPSM treats the command as a Stop Transmission command and signals Abort to the DPSM. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). If this bit is set, the CPSM issues the Abort signal to the DPSM when the command is sent."] | 22921 | #[doc = "I2C4 Peripheral Clocks Enable During CSleep Mode"] |
| 14510 | pub fn set_cmdstop(&mut self, val: bool) { | 22922 | pub fn set_i2c4lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) { |
| 14511 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | 22923 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); |
| 14512 | } | 22924 | } |
| 14513 | #[doc = "Wait for response bits. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). They are used to configure whether the CPSM is to wait for a response, and if yes, which kind of response."] | 22925 | #[doc = "LPTIM2 Peripheral Clocks Enable During CSleep Mode"] |
| 14514 | pub const fn waitresp(&self) -> u8 { | 22926 | pub const fn lptim2lpen(&self) -> super::vals::Apb4lpenrSyscfglpen { |
| 14515 | let val = (self.0 >> 8usize) & 0x03; | 22927 | let val = (self.0 >> 9usize) & 0x01; |
| 14516 | val as u8 | 22928 | super::vals::Apb4lpenrSyscfglpen(val as u8) |
| 14517 | } | 22929 | } |
| 14518 | #[doc = "Wait for response bits. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). They are used to configure whether the CPSM is to wait for a response, and if yes, which kind of response."] | 22930 | #[doc = "LPTIM2 Peripheral Clocks Enable During CSleep Mode"] |
| 14519 | pub fn set_waitresp(&mut self, val: u8) { | 22931 | pub fn set_lptim2lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) { |
| 14520 | self.0 = (self.0 & !(0x03 << 8usize)) | (((val as u32) & 0x03) << 8usize); | 22932 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); |
| 14521 | } | 22933 | } |
| 14522 | #[doc = "CPSM waits for interrupt request. If this bit is set, the CPSM disables command timeout and waits for an card interrupt request (Response). If this bit is cleared in the CPSM Wait state, will cause the abort of the interrupt mode."] | 22934 | #[doc = "LPTIM3 Peripheral Clocks Enable During CSleep Mode"] |
| 14523 | pub const fn waitint(&self) -> bool { | 22935 | pub const fn lptim3lpen(&self) -> super::vals::Apb4lpenrSyscfglpen { |
| 14524 | let val = (self.0 >> 10usize) & 0x01; | 22936 | let val = (self.0 >> 10usize) & 0x01; |
| 14525 | val != 0 | 22937 | super::vals::Apb4lpenrSyscfglpen(val as u8) |
| 14526 | } | 22938 | } |
| 14527 | #[doc = "CPSM waits for interrupt request. If this bit is set, the CPSM disables command timeout and waits for an card interrupt request (Response). If this bit is cleared in the CPSM Wait state, will cause the abort of the interrupt mode."] | 22939 | #[doc = "LPTIM3 Peripheral Clocks Enable During CSleep Mode"] |
| 14528 | pub fn set_waitint(&mut self, val: bool) { | 22940 | pub fn set_lptim3lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) { |
| 14529 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | 22941 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); |
| 14530 | } | 22942 | } |
| 14531 | #[doc = "CPSM Waits for end of data transfer (CmdPend internal signal) from DPSM. This bit when set, the CPSM waits for the end of data transfer trigger before it starts sending a command. WAITPEND is only taken into account when DTMODE = MMC stream data transfer, WIDBUS = 1-bit wide bus mode, DPSMACT = 1 and DTDIR = from host to card."] | 22943 | #[doc = "LPTIM4 Peripheral Clocks Enable During CSleep Mode"] |
| 14532 | pub const fn waitpend(&self) -> bool { | 22944 | pub const fn lptim4lpen(&self) -> super::vals::Apb4lpenrSyscfglpen { |
| 14533 | let val = (self.0 >> 11usize) & 0x01; | 22945 | let val = (self.0 >> 11usize) & 0x01; |
| 14534 | val != 0 | 22946 | super::vals::Apb4lpenrSyscfglpen(val as u8) |
| 14535 | } | 22947 | } |
| 14536 | #[doc = "CPSM Waits for end of data transfer (CmdPend internal signal) from DPSM. This bit when set, the CPSM waits for the end of data transfer trigger before it starts sending a command. WAITPEND is only taken into account when DTMODE = MMC stream data transfer, WIDBUS = 1-bit wide bus mode, DPSMACT = 1 and DTDIR = from host to card."] | 22948 | #[doc = "LPTIM4 Peripheral Clocks Enable During CSleep Mode"] |
| 14537 | pub fn set_waitpend(&mut self, val: bool) { | 22949 | pub fn set_lptim4lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) { |
| 14538 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); | 22950 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); |
| 14539 | } | 22951 | } |
| 14540 | #[doc = "Command path state machine (CPSM) Enable bit This bit is written 1 by firmware, and cleared by hardware when the CPSM enters the Idle state. If this bit is set, the CPSM is enabled. When DTEN = 1, no command will be transfered nor boot procedure will be started. CPSMEN is cleared to 0."] | 22952 | #[doc = "LPTIM5 Peripheral Clocks Enable During CSleep Mode"] |
| 14541 | pub const fn cpsmen(&self) -> bool { | 22953 | pub const fn lptim5lpen(&self) -> super::vals::Apb4lpenrSyscfglpen { |
| 14542 | let val = (self.0 >> 12usize) & 0x01; | 22954 | let val = (self.0 >> 12usize) & 0x01; |
| 14543 | val != 0 | 22955 | super::vals::Apb4lpenrSyscfglpen(val as u8) |
| 14544 | } | 22956 | } |
| 14545 | #[doc = "Command path state machine (CPSM) Enable bit This bit is written 1 by firmware, and cleared by hardware when the CPSM enters the Idle state. If this bit is set, the CPSM is enabled. When DTEN = 1, no command will be transfered nor boot procedure will be started. CPSMEN is cleared to 0."] | 22957 | #[doc = "LPTIM5 Peripheral Clocks Enable During CSleep Mode"] |
| 14546 | pub fn set_cpsmen(&mut self, val: bool) { | 22958 | pub fn set_lptim5lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) { |
| 14547 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); | 22959 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); |
| 14548 | } | ||
| 14549 | #[doc = "Hold new data block transmission and reception in the DPSM. If this bit is set, the DPSM will not move from the Wait_S state to the Send state or from the Wait_R state to the Receive state."] | ||
| 14550 | pub const fn dthold(&self) -> bool { | ||
| 14551 | let val = (self.0 >> 13usize) & 0x01; | ||
| 14552 | val != 0 | ||
| 14553 | } | ||
| 14554 | #[doc = "Hold new data block transmission and reception in the DPSM. If this bit is set, the DPSM will not move from the Wait_S state to the Send state or from the Wait_R state to the Receive state."] | ||
| 14555 | pub fn set_dthold(&mut self, val: bool) { | ||
| 14556 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | ||
| 14557 | } | 22960 | } |
| 14558 | #[doc = "Select the boot mode procedure to be used. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0)"] | 22961 | #[doc = "COMP1/2 peripheral clock enable during CSleep mode"] |
| 14559 | pub const fn bootmode(&self) -> bool { | 22962 | pub const fn comp12lpen(&self) -> super::vals::Apb4lpenrSyscfglpen { |
| 14560 | let val = (self.0 >> 14usize) & 0x01; | 22963 | let val = (self.0 >> 14usize) & 0x01; |
| 14561 | val != 0 | 22964 | super::vals::Apb4lpenrSyscfglpen(val as u8) |
| 14562 | } | 22965 | } |
| 14563 | #[doc = "Select the boot mode procedure to be used. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0)"] | 22966 | #[doc = "COMP1/2 peripheral clock enable during CSleep mode"] |
| 14564 | pub fn set_bootmode(&mut self, val: bool) { | 22967 | pub fn set_comp12lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) { |
| 14565 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); | 22968 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); |
| 14566 | } | 22969 | } |
| 14567 | #[doc = "Enable boot mode procedure."] | 22970 | #[doc = "VREF peripheral clock enable during CSleep mode"] |
| 14568 | pub const fn booten(&self) -> bool { | 22971 | pub const fn vreflpen(&self) -> super::vals::Apb4lpenrSyscfglpen { |
| 14569 | let val = (self.0 >> 15usize) & 0x01; | 22972 | let val = (self.0 >> 15usize) & 0x01; |
| 14570 | val != 0 | 22973 | super::vals::Apb4lpenrSyscfglpen(val as u8) |
| 14571 | } | 22974 | } |
| 14572 | #[doc = "Enable boot mode procedure."] | 22975 | #[doc = "VREF peripheral clock enable during CSleep mode"] |
| 14573 | pub fn set_booten(&mut self, val: bool) { | 22976 | pub fn set_vreflpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) { |
| 14574 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); | 22977 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); |
| 14575 | } | 22978 | } |
| 14576 | #[doc = "The CPSM treats the command as a Suspend or Resume command and signals interrupt period start/end. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). CMDSUSPEND = 1 and CMDTRANS = 0 Suspend command, start interrupt period when response bit BS=0. CMDSUSPEND = 1 and CMDTRANS = 1 Resume command with data, end interrupt period when response bit DF=1."] | 22979 | #[doc = "RTC APB Clock Enable During CSleep Mode"] |
| 14577 | pub const fn cmdsuspend(&self) -> bool { | 22980 | pub const fn rtcapblpen(&self) -> super::vals::Apb4lpenrSyscfglpen { |
| 14578 | let val = (self.0 >> 16usize) & 0x01; | 22981 | let val = (self.0 >> 16usize) & 0x01; |
| 14579 | val != 0 | 22982 | super::vals::Apb4lpenrSyscfglpen(val as u8) |
| 14580 | } | 22983 | } |
| 14581 | #[doc = "The CPSM treats the command as a Suspend or Resume command and signals interrupt period start/end. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). CMDSUSPEND = 1 and CMDTRANS = 0 Suspend command, start interrupt period when response bit BS=0. CMDSUSPEND = 1 and CMDTRANS = 1 Resume command with data, end interrupt period when response bit DF=1."] | 22984 | #[doc = "RTC APB Clock Enable During CSleep Mode"] |
| 14582 | pub fn set_cmdsuspend(&mut self, val: bool) { | 22985 | pub fn set_rtcapblpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) { |
| 14583 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | 22986 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); |
| 22987 | } | ||
| 22988 | #[doc = "SAI4 Peripheral Clocks Enable During CSleep Mode"] | ||
| 22989 | pub const fn sai4lpen(&self) -> super::vals::Apb4lpenrSyscfglpen { | ||
| 22990 | let val = (self.0 >> 21usize) & 0x01; | ||
| 22991 | super::vals::Apb4lpenrSyscfglpen(val as u8) | ||
| 22992 | } | ||
| 22993 | #[doc = "SAI4 Peripheral Clocks Enable During CSleep Mode"] | ||
| 22994 | pub fn set_sai4lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) { | ||
| 22995 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize); | ||
| 14584 | } | 22996 | } |
| 14585 | } | 22997 | } |
| 14586 | impl Default for Cmdr { | 22998 | impl Default for Apb4lpenr { |
| 14587 | fn default() -> Cmdr { | 22999 | fn default() -> Apb4lpenr { |
| 14588 | Cmdr(0) | 23000 | Apb4lpenr(0) |
| 14589 | } | 23001 | } |
| 14590 | } | 23002 | } |
| 14591 | #[doc = "The SDMMC_DCTRL register control the data path state machine (DPSM)."] | 23003 | #[doc = "RCC Clock Source Interrupt Clear Register"] |
| 14592 | #[repr(transparent)] | 23004 | #[repr(transparent)] |
| 14593 | #[derive(Copy, Clone, Eq, PartialEq)] | 23005 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 14594 | pub struct Dctrl(pub u32); | 23006 | pub struct Cicr(pub u32); |
| 14595 | impl Dctrl { | 23007 | impl Cicr { |
| 14596 | #[doc = "Data transfer enable bit This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). This bit is cleared by Hardware when data transfer completes. This bit shall only be used to transfer data when no associated data transfer command is used, i.e. shall not be used with SD or eMMC cards."] | 23008 | #[doc = "LSI ready Interrupt Clear"] |
| 14597 | pub const fn dten(&self) -> bool { | 23009 | pub const fn lsirdyc(&self) -> super::vals::Lsirdyc { |
| 14598 | let val = (self.0 >> 0usize) & 0x01; | 23010 | let val = (self.0 >> 0usize) & 0x01; |
| 14599 | val != 0 | 23011 | super::vals::Lsirdyc(val as u8) |
| 14600 | } | 23012 | } |
| 14601 | #[doc = "Data transfer enable bit This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). This bit is cleared by Hardware when data transfer completes. This bit shall only be used to transfer data when no associated data transfer command is used, i.e. shall not be used with SD or eMMC cards."] | 23013 | #[doc = "LSI ready Interrupt Clear"] |
| 14602 | pub fn set_dten(&mut self, val: bool) { | 23014 | pub fn set_lsirdyc(&mut self, val: super::vals::Lsirdyc) { |
| 14603 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 23015 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 14604 | } | 23016 | } |
| 14605 | #[doc = "Data transfer direction selection This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] | 23017 | #[doc = "LSE ready Interrupt Clear"] |
| 14606 | pub const fn dtdir(&self) -> bool { | 23018 | pub const fn lserdyc(&self) -> super::vals::Lsirdyc { |
| 14607 | let val = (self.0 >> 1usize) & 0x01; | 23019 | let val = (self.0 >> 1usize) & 0x01; |
| 14608 | val != 0 | 23020 | super::vals::Lsirdyc(val as u8) |
| 14609 | } | 23021 | } |
| 14610 | #[doc = "Data transfer direction selection This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] | 23022 | #[doc = "LSE ready Interrupt Clear"] |
| 14611 | pub fn set_dtdir(&mut self, val: bool) { | 23023 | pub fn set_lserdyc(&mut self, val: super::vals::Lsirdyc) { |
| 14612 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 23024 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); |
| 14613 | } | 23025 | } |
| 14614 | #[doc = "Data transfer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] | 23026 | #[doc = "HSI ready Interrupt Clear"] |
| 14615 | pub const fn dtmode(&self) -> u8 { | 23027 | pub const fn hsirdyc(&self) -> super::vals::Lsirdyc { |
| 14616 | let val = (self.0 >> 2usize) & 0x03; | 23028 | let val = (self.0 >> 2usize) & 0x01; |
| 14617 | val as u8 | 23029 | super::vals::Lsirdyc(val as u8) |
| 14618 | } | 23030 | } |
| 14619 | #[doc = "Data transfer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] | 23031 | #[doc = "HSI ready Interrupt Clear"] |
| 14620 | pub fn set_dtmode(&mut self, val: u8) { | 23032 | pub fn set_hsirdyc(&mut self, val: super::vals::Lsirdyc) { |
| 14621 | self.0 = (self.0 & !(0x03 << 2usize)) | (((val as u32) & 0x03) << 2usize); | 23033 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); |
| 14622 | } | 23034 | } |
| 14623 | #[doc = "Data block size This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). Define the data block length when the block data transfer mode is selected: When DATALENGTH is not a multiple of DBLOCKSIZE, the transfered data is truncated at a multiple of DBLOCKSIZE. (Any remain data will not be transfered.) When DDR = 1, DBLOCKSIZE = 0000 shall not be used. (No data will be transfered)"] | 23035 | #[doc = "HSE ready Interrupt Clear"] |
| 14624 | pub const fn dblocksize(&self) -> u8 { | 23036 | pub const fn hserdyc(&self) -> super::vals::Lsirdyc { |
| 14625 | let val = (self.0 >> 4usize) & 0x0f; | 23037 | let val = (self.0 >> 3usize) & 0x01; |
| 14626 | val as u8 | 23038 | super::vals::Lsirdyc(val as u8) |
| 14627 | } | 23039 | } |
| 14628 | #[doc = "Data block size This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). Define the data block length when the block data transfer mode is selected: When DATALENGTH is not a multiple of DBLOCKSIZE, the transfered data is truncated at a multiple of DBLOCKSIZE. (Any remain data will not be transfered.) When DDR = 1, DBLOCKSIZE = 0000 shall not be used. (No data will be transfered)"] | 23040 | #[doc = "HSE ready Interrupt Clear"] |
| 14629 | pub fn set_dblocksize(&mut self, val: u8) { | 23041 | pub fn set_hserdyc(&mut self, val: super::vals::Lsirdyc) { |
| 14630 | self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize); | 23042 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); |
| 14631 | } | 23043 | } |
| 14632 | #[doc = "Read wait start. If this bit is set, read wait operation starts."] | 23044 | #[doc = "CSI ready Interrupt Clear"] |
| 14633 | pub const fn rwstart(&self) -> bool { | 23045 | pub const fn hse_ready_interrupt_clear(&self) -> bool { |
| 14634 | let val = (self.0 >> 8usize) & 0x01; | 23046 | let val = (self.0 >> 4usize) & 0x01; |
| 14635 | val != 0 | 23047 | val != 0 |
| 14636 | } | 23048 | } |
| 14637 | #[doc = "Read wait start. If this bit is set, read wait operation starts."] | 23049 | #[doc = "CSI ready Interrupt Clear"] |
| 14638 | pub fn set_rwstart(&mut self, val: bool) { | 23050 | pub fn set_hse_ready_interrupt_clear(&mut self, val: bool) { |
| 14639 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 23051 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 14640 | } | 23052 | } |
| 14641 | #[doc = "Read wait stop This bit is written by firmware and auto cleared by hardware when the DPSM moves from the READ_WAIT state to the WAIT_R or IDLE state."] | 23053 | #[doc = "RC48 ready Interrupt Clear"] |
| 14642 | pub const fn rwstop(&self) -> bool { | 23054 | pub const fn hsi48rdyc(&self) -> super::vals::Lsirdyc { |
| 23055 | let val = (self.0 >> 5usize) & 0x01; | ||
| 23056 | super::vals::Lsirdyc(val as u8) | ||
| 23057 | } | ||
| 23058 | #[doc = "RC48 ready Interrupt Clear"] | ||
| 23059 | pub fn set_hsi48rdyc(&mut self, val: super::vals::Lsirdyc) { | ||
| 23060 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 23061 | } | ||
| 23062 | #[doc = "PLL1 ready Interrupt Clear"] | ||
| 23063 | pub fn pllrdyc(&self, n: usize) -> super::vals::Lsirdyc { | ||
| 23064 | assert!(n < 3usize); | ||
| 23065 | let offs = 6usize + n * 1usize; | ||
| 23066 | let val = (self.0 >> offs) & 0x01; | ||
| 23067 | super::vals::Lsirdyc(val as u8) | ||
| 23068 | } | ||
| 23069 | #[doc = "PLL1 ready Interrupt Clear"] | ||
| 23070 | pub fn set_pllrdyc(&mut self, n: usize, val: super::vals::Lsirdyc) { | ||
| 23071 | assert!(n < 3usize); | ||
| 23072 | let offs = 6usize + n * 1usize; | ||
| 23073 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 23074 | } | ||
| 23075 | #[doc = "LSE clock security system Interrupt Clear"] | ||
| 23076 | pub const fn lsecssc(&self) -> super::vals::Lsirdyc { | ||
| 14643 | let val = (self.0 >> 9usize) & 0x01; | 23077 | let val = (self.0 >> 9usize) & 0x01; |
| 14644 | val != 0 | 23078 | super::vals::Lsirdyc(val as u8) |
| 14645 | } | 23079 | } |
| 14646 | #[doc = "Read wait stop This bit is written by firmware and auto cleared by hardware when the DPSM moves from the READ_WAIT state to the WAIT_R or IDLE state."] | 23080 | #[doc = "LSE clock security system Interrupt Clear"] |
| 14647 | pub fn set_rwstop(&mut self, val: bool) { | 23081 | pub fn set_lsecssc(&mut self, val: super::vals::Lsirdyc) { |
| 14648 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | 23082 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); |
| 14649 | } | 23083 | } |
| 14650 | #[doc = "Read wait mode. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] | 23084 | #[doc = "HSE clock security system Interrupt Clear"] |
| 14651 | pub const fn rwmod(&self) -> bool { | 23085 | pub const fn hsecssc(&self) -> super::vals::Lsirdyc { |
| 14652 | let val = (self.0 >> 10usize) & 0x01; | 23086 | let val = (self.0 >> 10usize) & 0x01; |
| 14653 | val != 0 | 23087 | super::vals::Lsirdyc(val as u8) |
| 14654 | } | 23088 | } |
| 14655 | #[doc = "Read wait mode. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] | 23089 | #[doc = "HSE clock security system Interrupt Clear"] |
| 14656 | pub fn set_rwmod(&mut self, val: bool) { | 23090 | pub fn set_hsecssc(&mut self, val: super::vals::Lsirdyc) { |
| 14657 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | 23091 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); |
| 14658 | } | 23092 | } |
| 14659 | #[doc = "SD I/O interrupt enable functions This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). If this bit is set, the DPSM enables the SD I/O card specific interrupt operation."] | 23093 | } |
| 14660 | pub const fn sdioen(&self) -> bool { | 23094 | impl Default for Cicr { |
| 14661 | let val = (self.0 >> 11usize) & 0x01; | 23095 | fn default() -> Cicr { |
| 14662 | val != 0 | 23096 | Cicr(0) |
| 14663 | } | 23097 | } |
| 14664 | #[doc = "SD I/O interrupt enable functions This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). If this bit is set, the DPSM enables the SD I/O card specific interrupt operation."] | 23098 | } |
| 14665 | pub fn set_sdioen(&mut self, val: bool) { | 23099 | #[doc = "RCC Clock Configuration Register"] |
| 14666 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); | 23100 | #[repr(transparent)] |
| 23101 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 23102 | pub struct Cfgr(pub u32); | ||
| 23103 | impl Cfgr { | ||
| 23104 | #[doc = "System clock switch"] | ||
| 23105 | pub const fn sw(&self) -> super::vals::Sw { | ||
| 23106 | let val = (self.0 >> 0usize) & 0x07; | ||
| 23107 | super::vals::Sw(val as u8) | ||
| 14667 | } | 23108 | } |
| 14668 | #[doc = "Enable the reception of the boot acknowledgment. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] | 23109 | #[doc = "System clock switch"] |
| 14669 | pub const fn bootacken(&self) -> bool { | 23110 | pub fn set_sw(&mut self, val: super::vals::Sw) { |
| 14670 | let val = (self.0 >> 12usize) & 0x01; | 23111 | self.0 = (self.0 & !(0x07 << 0usize)) | (((val.0 as u32) & 0x07) << 0usize); |
| 14671 | val != 0 | ||
| 14672 | } | 23112 | } |
| 14673 | #[doc = "Enable the reception of the boot acknowledgment. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] | 23113 | #[doc = "System clock switch status"] |
| 14674 | pub fn set_bootacken(&mut self, val: bool) { | 23114 | pub const fn sws(&self) -> u8 { |
| 14675 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); | 23115 | let val = (self.0 >> 3usize) & 0x07; |
| 23116 | val as u8 | ||
| 14676 | } | 23117 | } |
| 14677 | #[doc = "FIFO reset, will flush any remaining data. This bit can only be written by firmware when IDMAEN= 0 and DPSM is active (DPSMACT = 1). This bit will only take effect when a transfer error or transfer hold occurs."] | 23118 | #[doc = "System clock switch status"] |
| 14678 | pub const fn fiforst(&self) -> bool { | 23119 | pub fn set_sws(&mut self, val: u8) { |
| 14679 | let val = (self.0 >> 13usize) & 0x01; | 23120 | self.0 = (self.0 & !(0x07 << 3usize)) | (((val as u32) & 0x07) << 3usize); |
| 14680 | val != 0 | ||
| 14681 | } | 23121 | } |
| 14682 | #[doc = "FIFO reset, will flush any remaining data. This bit can only be written by firmware when IDMAEN= 0 and DPSM is active (DPSMACT = 1). This bit will only take effect when a transfer error or transfer hold occurs."] | 23122 | #[doc = "System clock selection after a wake up from system Stop"] |
| 14683 | pub fn set_fiforst(&mut self, val: bool) { | 23123 | pub const fn stopwuck(&self) -> super::vals::Stopwuck { |
| 14684 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); | 23124 | let val = (self.0 >> 6usize) & 0x01; |
| 23125 | super::vals::Stopwuck(val as u8) | ||
| 23126 | } | ||
| 23127 | #[doc = "System clock selection after a wake up from system Stop"] | ||
| 23128 | pub fn set_stopwuck(&mut self, val: super::vals::Stopwuck) { | ||
| 23129 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); | ||
| 23130 | } | ||
| 23131 | #[doc = "Kernel clock selection after a wake up from system Stop"] | ||
| 23132 | pub const fn stopkerwuck(&self) -> super::vals::Stopwuck { | ||
| 23133 | let val = (self.0 >> 7usize) & 0x01; | ||
| 23134 | super::vals::Stopwuck(val as u8) | ||
| 23135 | } | ||
| 23136 | #[doc = "Kernel clock selection after a wake up from system Stop"] | ||
| 23137 | pub fn set_stopkerwuck(&mut self, val: super::vals::Stopwuck) { | ||
| 23138 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 23139 | } | ||
| 23140 | #[doc = "HSE division factor for RTC clock"] | ||
| 23141 | pub const fn rtcpre(&self) -> u8 { | ||
| 23142 | let val = (self.0 >> 8usize) & 0x3f; | ||
| 23143 | val as u8 | ||
| 23144 | } | ||
| 23145 | #[doc = "HSE division factor for RTC clock"] | ||
| 23146 | pub fn set_rtcpre(&mut self, val: u8) { | ||
| 23147 | self.0 = (self.0 & !(0x3f << 8usize)) | (((val as u32) & 0x3f) << 8usize); | ||
| 23148 | } | ||
| 23149 | #[doc = "High Resolution Timer clock prescaler selection"] | ||
| 23150 | pub const fn hrtimsel(&self) -> super::vals::Hrtimsel { | ||
| 23151 | let val = (self.0 >> 14usize) & 0x01; | ||
| 23152 | super::vals::Hrtimsel(val as u8) | ||
| 23153 | } | ||
| 23154 | #[doc = "High Resolution Timer clock prescaler selection"] | ||
| 23155 | pub fn set_hrtimsel(&mut self, val: super::vals::Hrtimsel) { | ||
| 23156 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | ||
| 23157 | } | ||
| 23158 | #[doc = "Timers clocks prescaler selection"] | ||
| 23159 | pub const fn timpre(&self) -> super::vals::Timpre { | ||
| 23160 | let val = (self.0 >> 15usize) & 0x01; | ||
| 23161 | super::vals::Timpre(val as u8) | ||
| 23162 | } | ||
| 23163 | #[doc = "Timers clocks prescaler selection"] | ||
| 23164 | pub fn set_timpre(&mut self, val: super::vals::Timpre) { | ||
| 23165 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 23166 | } | ||
| 23167 | #[doc = "MCO1 prescaler"] | ||
| 23168 | pub const fn mco1pre(&self) -> u8 { | ||
| 23169 | let val = (self.0 >> 18usize) & 0x0f; | ||
| 23170 | val as u8 | ||
| 23171 | } | ||
| 23172 | #[doc = "MCO1 prescaler"] | ||
| 23173 | pub fn set_mco1pre(&mut self, val: u8) { | ||
| 23174 | self.0 = (self.0 & !(0x0f << 18usize)) | (((val as u32) & 0x0f) << 18usize); | ||
| 23175 | } | ||
| 23176 | #[doc = "Micro-controller clock output 1"] | ||
| 23177 | pub const fn mco1(&self) -> super::vals::Mco1 { | ||
| 23178 | let val = (self.0 >> 22usize) & 0x07; | ||
| 23179 | super::vals::Mco1(val as u8) | ||
| 23180 | } | ||
| 23181 | #[doc = "Micro-controller clock output 1"] | ||
| 23182 | pub fn set_mco1(&mut self, val: super::vals::Mco1) { | ||
| 23183 | self.0 = (self.0 & !(0x07 << 22usize)) | (((val.0 as u32) & 0x07) << 22usize); | ||
| 23184 | } | ||
| 23185 | #[doc = "MCO2 prescaler"] | ||
| 23186 | pub const fn mco2pre(&self) -> u8 { | ||
| 23187 | let val = (self.0 >> 25usize) & 0x0f; | ||
| 23188 | val as u8 | ||
| 23189 | } | ||
| 23190 | #[doc = "MCO2 prescaler"] | ||
| 23191 | pub fn set_mco2pre(&mut self, val: u8) { | ||
| 23192 | self.0 = (self.0 & !(0x0f << 25usize)) | (((val as u32) & 0x0f) << 25usize); | ||
| 23193 | } | ||
| 23194 | #[doc = "Micro-controller clock output 2"] | ||
| 23195 | pub const fn mco2(&self) -> super::vals::Mco2 { | ||
| 23196 | let val = (self.0 >> 29usize) & 0x07; | ||
| 23197 | super::vals::Mco2(val as u8) | ||
| 23198 | } | ||
| 23199 | #[doc = "Micro-controller clock output 2"] | ||
| 23200 | pub fn set_mco2(&mut self, val: super::vals::Mco2) { | ||
| 23201 | self.0 = (self.0 & !(0x07 << 29usize)) | (((val.0 as u32) & 0x07) << 29usize); | ||
| 14685 | } | 23202 | } |
| 14686 | } | 23203 | } |
| 14687 | impl Default for Dctrl { | 23204 | impl Default for Cfgr { |
| 14688 | fn default() -> Dctrl { | 23205 | fn default() -> Cfgr { |
| 14689 | Dctrl(0) | 23206 | Cfgr(0) |
| 14690 | } | 23207 | } |
| 14691 | } | 23208 | } |
| 14692 | #[doc = "The SDMMC_IDMABASE1R register contains the double buffer configuration second buffer memory base address."] | 23209 | #[doc = "RCC APB1 High Sleep Clock Register"] |
| 14693 | #[repr(transparent)] | 23210 | #[repr(transparent)] |
| 14694 | #[derive(Copy, Clone, Eq, PartialEq)] | 23211 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 14695 | pub struct Idmabase1r(pub u32); | 23212 | pub struct Apb1hlpenr(pub u32); |
| 14696 | impl Idmabase1r { | 23213 | impl Apb1hlpenr { |
| 14697 | #[doc = "Buffer 1 memory base address, shall be word aligned (bit [1:0] | 23214 | #[doc = "Clock Recovery System peripheral clock enable during CSleep mode"] |
| 14698 | 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)."] | 23215 | pub const fn crslpen(&self) -> super::vals::Apb1hlpenrCrslpen { |
| 14699 | pub const fn idmabase1(&self) -> u32 { | 23216 | let val = (self.0 >> 1usize) & 0x01; |
| 14700 | let val = (self.0 >> 0usize) & 0xffff_ffff; | 23217 | super::vals::Apb1hlpenrCrslpen(val as u8) |
| 14701 | val as u32 | ||
| 14702 | } | 23218 | } |
| 14703 | #[doc = "Buffer 1 memory base address, shall be word aligned (bit [1:0] | 23219 | #[doc = "Clock Recovery System peripheral clock enable during CSleep mode"] |
| 14704 | 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)."] | 23220 | pub fn set_crslpen(&mut self, val: super::vals::Apb1hlpenrCrslpen) { |
| 14705 | pub fn set_idmabase1(&mut self, val: u32) { | 23221 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); |
| 14706 | self.0 = | 23222 | } |
| 14707 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | 23223 | #[doc = "SWPMI Peripheral Clocks Enable During CSleep Mode"] |
| 23224 | pub const fn swplpen(&self) -> super::vals::Apb1hlpenrCrslpen { | ||
| 23225 | let val = (self.0 >> 2usize) & 0x01; | ||
| 23226 | super::vals::Apb1hlpenrCrslpen(val as u8) | ||
| 23227 | } | ||
| 23228 | #[doc = "SWPMI Peripheral Clocks Enable During CSleep Mode"] | ||
| 23229 | pub fn set_swplpen(&mut self, val: super::vals::Apb1hlpenrCrslpen) { | ||
| 23230 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 23231 | } | ||
| 23232 | #[doc = "OPAMP peripheral clock enable during CSleep mode"] | ||
| 23233 | pub const fn opamplpen(&self) -> super::vals::Apb1hlpenrCrslpen { | ||
| 23234 | let val = (self.0 >> 4usize) & 0x01; | ||
| 23235 | super::vals::Apb1hlpenrCrslpen(val as u8) | ||
| 23236 | } | ||
| 23237 | #[doc = "OPAMP peripheral clock enable during CSleep mode"] | ||
| 23238 | pub fn set_opamplpen(&mut self, val: super::vals::Apb1hlpenrCrslpen) { | ||
| 23239 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 23240 | } | ||
| 23241 | #[doc = "MDIOS peripheral clock enable during CSleep mode"] | ||
| 23242 | pub const fn mdioslpen(&self) -> super::vals::Apb1hlpenrCrslpen { | ||
| 23243 | let val = (self.0 >> 5usize) & 0x01; | ||
| 23244 | super::vals::Apb1hlpenrCrslpen(val as u8) | ||
| 23245 | } | ||
| 23246 | #[doc = "MDIOS peripheral clock enable during CSleep mode"] | ||
| 23247 | pub fn set_mdioslpen(&mut self, val: super::vals::Apb1hlpenrCrslpen) { | ||
| 23248 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 23249 | } | ||
| 23250 | #[doc = "FDCAN Peripheral Clocks Enable During CSleep Mode"] | ||
| 23251 | pub const fn fdcanlpen(&self) -> super::vals::Apb1hlpenrCrslpen { | ||
| 23252 | let val = (self.0 >> 8usize) & 0x01; | ||
| 23253 | super::vals::Apb1hlpenrCrslpen(val as u8) | ||
| 23254 | } | ||
| 23255 | #[doc = "FDCAN Peripheral Clocks Enable During CSleep Mode"] | ||
| 23256 | pub fn set_fdcanlpen(&mut self, val: super::vals::Apb1hlpenrCrslpen) { | ||
| 23257 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); | ||
| 14708 | } | 23258 | } |
| 14709 | } | 23259 | } |
| 14710 | impl Default for Idmabase1r { | 23260 | impl Default for Apb1hlpenr { |
| 14711 | fn default() -> Idmabase1r { | 23261 | fn default() -> Apb1hlpenr { |
| 14712 | Idmabase1r(0) | 23262 | Apb1hlpenr(0) |
| 14713 | } | 23263 | } |
| 14714 | } | 23264 | } |
| 14715 | #[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."] | 23265 | #[doc = "RCC PLL3 Dividers Configuration Register"] |
| 14716 | #[repr(transparent)] | 23266 | #[repr(transparent)] |
| 14717 | #[derive(Copy, Clone, Eq, PartialEq)] | 23267 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 14718 | pub struct Dcntr(pub u32); | 23268 | pub struct Pll3divr(pub u32); |
| 14719 | impl Dcntr { | 23269 | impl Pll3divr { |
| 14720 | #[doc = "Data count value When read, the number of remaining data bytes to be transferred is returned. Write has no effect."] | 23270 | #[doc = "Multiplication factor for PLL1 VCO"] |
| 14721 | pub const fn datacount(&self) -> u32 { | 23271 | pub const fn divn3(&self) -> u16 { |
| 14722 | let val = (self.0 >> 0usize) & 0x01ff_ffff; | 23272 | let val = (self.0 >> 0usize) & 0x01ff; |
| 14723 | val as u32 | 23273 | val as u16 |
| 14724 | } | 23274 | } |
| 14725 | #[doc = "Data count value When read, the number of remaining data bytes to be transferred is returned. Write has no effect."] | 23275 | #[doc = "Multiplication factor for PLL1 VCO"] |
| 14726 | pub fn set_datacount(&mut self, val: u32) { | 23276 | pub fn set_divn3(&mut self, val: u16) { |
| 14727 | self.0 = | 23277 | self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize); |
| 14728 | (self.0 & !(0x01ff_ffff << 0usize)) | (((val as u32) & 0x01ff_ffff) << 0usize); | 23278 | } |
| 23279 | #[doc = "PLL DIVP division factor"] | ||
| 23280 | pub const fn divp3(&self) -> u8 { | ||
| 23281 | let val = (self.0 >> 9usize) & 0x7f; | ||
| 23282 | val as u8 | ||
| 23283 | } | ||
| 23284 | #[doc = "PLL DIVP division factor"] | ||
| 23285 | pub fn set_divp3(&mut self, val: u8) { | ||
| 23286 | self.0 = (self.0 & !(0x7f << 9usize)) | (((val as u32) & 0x7f) << 9usize); | ||
| 23287 | } | ||
| 23288 | #[doc = "PLL DIVQ division factor"] | ||
| 23289 | pub const fn divq3(&self) -> u8 { | ||
| 23290 | let val = (self.0 >> 16usize) & 0x7f; | ||
| 23291 | val as u8 | ||
| 23292 | } | ||
| 23293 | #[doc = "PLL DIVQ division factor"] | ||
| 23294 | pub fn set_divq3(&mut self, val: u8) { | ||
| 23295 | self.0 = (self.0 & !(0x7f << 16usize)) | (((val as u32) & 0x7f) << 16usize); | ||
| 23296 | } | ||
| 23297 | #[doc = "PLL DIVR division factor"] | ||
| 23298 | pub const fn divr3(&self) -> u8 { | ||
| 23299 | let val = (self.0 >> 24usize) & 0x7f; | ||
| 23300 | val as u8 | ||
| 23301 | } | ||
| 23302 | #[doc = "PLL DIVR division factor"] | ||
| 23303 | pub fn set_divr3(&mut self, val: u8) { | ||
| 23304 | self.0 = (self.0 & !(0x7f << 24usize)) | (((val as u32) & 0x7f) << 24usize); | ||
| 14729 | } | 23305 | } |
| 14730 | } | 23306 | } |
| 14731 | impl Default for Dcntr { | 23307 | impl Default for Pll3divr { |
| 14732 | fn default() -> Dcntr { | 23308 | fn default() -> Pll3divr { |
| 14733 | Dcntr(0) | 23309 | Pll3divr(0) |
| 14734 | } | 23310 | } |
| 14735 | } | 23311 | } |
| 14736 | #[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."] | 23312 | #[doc = "RCC AHB4 Clock Register"] |
| 14737 | #[repr(transparent)] | 23313 | #[repr(transparent)] |
| 14738 | #[derive(Copy, Clone, Eq, PartialEq)] | 23314 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 14739 | pub struct Dtimer(pub u32); | 23315 | pub struct C1Ahb4enr(pub u32); |
| 14740 | impl Dtimer { | 23316 | impl C1Ahb4enr { |
| 14741 | #[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."] | 23317 | #[doc = "0GPIO peripheral clock enable"] |
| 14742 | pub const fn datatime(&self) -> u32 { | 23318 | pub const fn gpioaen(&self) -> super::vals::C1Ahb4enrGpioaen { |
| 14743 | let val = (self.0 >> 0usize) & 0xffff_ffff; | 23319 | let val = (self.0 >> 0usize) & 0x01; |
| 14744 | val as u32 | 23320 | super::vals::C1Ahb4enrGpioaen(val as u8) |
| 14745 | } | 23321 | } |
| 14746 | #[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."] | 23322 | #[doc = "0GPIO peripheral clock enable"] |
| 14747 | pub fn set_datatime(&mut self, val: u32) { | 23323 | pub fn set_gpioaen(&mut self, val: super::vals::C1Ahb4enrGpioaen) { |
| 14748 | self.0 = | 23324 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 14749 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | 23325 | } |
| 23326 | #[doc = "0GPIO peripheral clock enable"] | ||
| 23327 | pub const fn gpioben(&self) -> super::vals::C1Ahb4enrGpioaen { | ||
| 23328 | let val = (self.0 >> 1usize) & 0x01; | ||
| 23329 | super::vals::C1Ahb4enrGpioaen(val as u8) | ||
| 23330 | } | ||
| 23331 | #[doc = "0GPIO peripheral clock enable"] | ||
| 23332 | pub fn set_gpioben(&mut self, val: super::vals::C1Ahb4enrGpioaen) { | ||
| 23333 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 23334 | } | ||
| 23335 | #[doc = "0GPIO peripheral clock enable"] | ||
| 23336 | pub const fn gpiocen(&self) -> super::vals::C1Ahb4enrGpioaen { | ||
| 23337 | let val = (self.0 >> 2usize) & 0x01; | ||
| 23338 | super::vals::C1Ahb4enrGpioaen(val as u8) | ||
| 23339 | } | ||
| 23340 | #[doc = "0GPIO peripheral clock enable"] | ||
| 23341 | pub fn set_gpiocen(&mut self, val: super::vals::C1Ahb4enrGpioaen) { | ||
| 23342 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 23343 | } | ||
| 23344 | #[doc = "0GPIO peripheral clock enable"] | ||
| 23345 | pub const fn gpioden(&self) -> super::vals::C1Ahb4enrGpioaen { | ||
| 23346 | let val = (self.0 >> 3usize) & 0x01; | ||
| 23347 | super::vals::C1Ahb4enrGpioaen(val as u8) | ||
| 23348 | } | ||
| 23349 | #[doc = "0GPIO peripheral clock enable"] | ||
| 23350 | pub fn set_gpioden(&mut self, val: super::vals::C1Ahb4enrGpioaen) { | ||
| 23351 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 23352 | } | ||
| 23353 | #[doc = "0GPIO peripheral clock enable"] | ||
| 23354 | pub const fn gpioeen(&self) -> super::vals::C1Ahb4enrGpioaen { | ||
| 23355 | let val = (self.0 >> 4usize) & 0x01; | ||
| 23356 | super::vals::C1Ahb4enrGpioaen(val as u8) | ||
| 23357 | } | ||
| 23358 | #[doc = "0GPIO peripheral clock enable"] | ||
| 23359 | pub fn set_gpioeen(&mut self, val: super::vals::C1Ahb4enrGpioaen) { | ||
| 23360 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 23361 | } | ||
| 23362 | #[doc = "0GPIO peripheral clock enable"] | ||
| 23363 | pub const fn gpiofen(&self) -> super::vals::C1Ahb4enrGpioaen { | ||
| 23364 | let val = (self.0 >> 5usize) & 0x01; | ||
| 23365 | super::vals::C1Ahb4enrGpioaen(val as u8) | ||
| 23366 | } | ||
| 23367 | #[doc = "0GPIO peripheral clock enable"] | ||
| 23368 | pub fn set_gpiofen(&mut self, val: super::vals::C1Ahb4enrGpioaen) { | ||
| 23369 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 23370 | } | ||
| 23371 | #[doc = "0GPIO peripheral clock enable"] | ||
| 23372 | pub const fn gpiogen(&self) -> super::vals::C1Ahb4enrGpioaen { | ||
| 23373 | let val = (self.0 >> 6usize) & 0x01; | ||
| 23374 | super::vals::C1Ahb4enrGpioaen(val as u8) | ||
| 23375 | } | ||
| 23376 | #[doc = "0GPIO peripheral clock enable"] | ||
| 23377 | pub fn set_gpiogen(&mut self, val: super::vals::C1Ahb4enrGpioaen) { | ||
| 23378 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); | ||
| 23379 | } | ||
| 23380 | #[doc = "0GPIO peripheral clock enable"] | ||
| 23381 | pub const fn gpiohen(&self) -> super::vals::C1Ahb4enrGpioaen { | ||
| 23382 | let val = (self.0 >> 7usize) & 0x01; | ||
| 23383 | super::vals::C1Ahb4enrGpioaen(val as u8) | ||
| 23384 | } | ||
| 23385 | #[doc = "0GPIO peripheral clock enable"] | ||
| 23386 | pub fn set_gpiohen(&mut self, val: super::vals::C1Ahb4enrGpioaen) { | ||
| 23387 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 23388 | } | ||
| 23389 | #[doc = "0GPIO peripheral clock enable"] | ||
| 23390 | pub const fn gpioien(&self) -> super::vals::C1Ahb4enrGpioaen { | ||
| 23391 | let val = (self.0 >> 8usize) & 0x01; | ||
| 23392 | super::vals::C1Ahb4enrGpioaen(val as u8) | ||
| 23393 | } | ||
| 23394 | #[doc = "0GPIO peripheral clock enable"] | ||
| 23395 | pub fn set_gpioien(&mut self, val: super::vals::C1Ahb4enrGpioaen) { | ||
| 23396 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); | ||
| 23397 | } | ||
| 23398 | #[doc = "0GPIO peripheral clock enable"] | ||
| 23399 | pub const fn gpiojen(&self) -> super::vals::C1Ahb4enrGpioaen { | ||
| 23400 | let val = (self.0 >> 9usize) & 0x01; | ||
| 23401 | super::vals::C1Ahb4enrGpioaen(val as u8) | ||
| 23402 | } | ||
| 23403 | #[doc = "0GPIO peripheral clock enable"] | ||
| 23404 | pub fn set_gpiojen(&mut self, val: super::vals::C1Ahb4enrGpioaen) { | ||
| 23405 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | ||
| 23406 | } | ||
| 23407 | #[doc = "0GPIO peripheral clock enable"] | ||
| 23408 | pub const fn gpioken(&self) -> super::vals::C1Ahb4enrGpioaen { | ||
| 23409 | let val = (self.0 >> 10usize) & 0x01; | ||
| 23410 | super::vals::C1Ahb4enrGpioaen(val as u8) | ||
| 23411 | } | ||
| 23412 | #[doc = "0GPIO peripheral clock enable"] | ||
| 23413 | pub fn set_gpioken(&mut self, val: super::vals::C1Ahb4enrGpioaen) { | ||
| 23414 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); | ||
| 23415 | } | ||
| 23416 | #[doc = "CRC peripheral clock enable"] | ||
| 23417 | pub const fn crcen(&self) -> super::vals::C1Ahb4enrGpioaen { | ||
| 23418 | let val = (self.0 >> 19usize) & 0x01; | ||
| 23419 | super::vals::C1Ahb4enrGpioaen(val as u8) | ||
| 23420 | } | ||
| 23421 | #[doc = "CRC peripheral clock enable"] | ||
| 23422 | pub fn set_crcen(&mut self, val: super::vals::C1Ahb4enrGpioaen) { | ||
| 23423 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); | ||
| 23424 | } | ||
| 23425 | #[doc = "BDMA and DMAMUX2 Clock Enable"] | ||
| 23426 | pub const fn bdmaen(&self) -> super::vals::C1Ahb4enrGpioaen { | ||
| 23427 | let val = (self.0 >> 21usize) & 0x01; | ||
| 23428 | super::vals::C1Ahb4enrGpioaen(val as u8) | ||
| 23429 | } | ||
| 23430 | #[doc = "BDMA and DMAMUX2 Clock Enable"] | ||
| 23431 | pub fn set_bdmaen(&mut self, val: super::vals::C1Ahb4enrGpioaen) { | ||
| 23432 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize); | ||
| 23433 | } | ||
| 23434 | #[doc = "ADC3 Peripheral Clocks Enable"] | ||
| 23435 | pub const fn adc3en(&self) -> super::vals::C1Ahb4enrGpioaen { | ||
| 23436 | let val = (self.0 >> 24usize) & 0x01; | ||
| 23437 | super::vals::C1Ahb4enrGpioaen(val as u8) | ||
| 23438 | } | ||
| 23439 | #[doc = "ADC3 Peripheral Clocks Enable"] | ||
| 23440 | pub fn set_adc3en(&mut self, val: super::vals::C1Ahb4enrGpioaen) { | ||
| 23441 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); | ||
| 23442 | } | ||
| 23443 | #[doc = "HSEM peripheral clock enable"] | ||
| 23444 | pub const fn hsemen(&self) -> super::vals::C1Ahb4enrGpioaen { | ||
| 23445 | let val = (self.0 >> 25usize) & 0x01; | ||
| 23446 | super::vals::C1Ahb4enrGpioaen(val as u8) | ||
| 23447 | } | ||
| 23448 | #[doc = "HSEM peripheral clock enable"] | ||
| 23449 | pub fn set_hsemen(&mut self, val: super::vals::C1Ahb4enrGpioaen) { | ||
| 23450 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize); | ||
| 23451 | } | ||
| 23452 | #[doc = "Backup RAM Clock Enable"] | ||
| 23453 | pub const fn bkpramen(&self) -> super::vals::C1Ahb4enrGpioaen { | ||
| 23454 | let val = (self.0 >> 28usize) & 0x01; | ||
| 23455 | super::vals::C1Ahb4enrGpioaen(val as u8) | ||
| 23456 | } | ||
| 23457 | #[doc = "Backup RAM Clock Enable"] | ||
| 23458 | pub fn set_bkpramen(&mut self, val: super::vals::C1Ahb4enrGpioaen) { | ||
| 23459 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); | ||
| 14750 | } | 23460 | } |
| 14751 | } | 23461 | } |
| 14752 | impl Default for Dtimer { | 23462 | impl Default for C1Ahb4enr { |
| 14753 | fn default() -> Dtimer { | 23463 | fn default() -> C1Ahb4enr { |
| 14754 | Dtimer(0) | 23464 | C1Ahb4enr(0) |
| 14755 | } | 23465 | } |
| 14756 | } | 23466 | } |
| 14757 | #[doc = "SDMMC IP identification register"] | 23467 | #[doc = "RCC Internal Clock Source Calibration Register"] |
| 14758 | #[repr(transparent)] | 23468 | #[repr(transparent)] |
| 14759 | #[derive(Copy, Clone, Eq, PartialEq)] | 23469 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 14760 | pub struct Id(pub u32); | 23470 | pub struct Icscr(pub u32); |
| 14761 | impl Id { | 23471 | impl Icscr { |
| 14762 | #[doc = "SDMMC IP identification."] | 23472 | #[doc = "HSI clock calibration"] |
| 14763 | pub const fn ip_id(&self) -> u32 { | 23473 | pub const fn hsical(&self) -> u16 { |
| 14764 | let val = (self.0 >> 0usize) & 0xffff_ffff; | 23474 | let val = (self.0 >> 0usize) & 0x0fff; |
| 14765 | val as u32 | 23475 | val as u16 |
| 14766 | } | 23476 | } |
| 14767 | #[doc = "SDMMC IP identification."] | 23477 | #[doc = "HSI clock calibration"] |
| 14768 | pub fn set_ip_id(&mut self, val: u32) { | 23478 | pub fn set_hsical(&mut self, val: u16) { |
| 14769 | self.0 = | 23479 | self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); |
| 14770 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | 23480 | } |
| 23481 | #[doc = "HSI clock trimming"] | ||
| 23482 | pub const fn hsitrim(&self) -> u8 { | ||
| 23483 | let val = (self.0 >> 12usize) & 0x3f; | ||
| 23484 | val as u8 | ||
| 23485 | } | ||
| 23486 | #[doc = "HSI clock trimming"] | ||
| 23487 | pub fn set_hsitrim(&mut self, val: u8) { | ||
| 23488 | self.0 = (self.0 & !(0x3f << 12usize)) | (((val as u32) & 0x3f) << 12usize); | ||
| 23489 | } | ||
| 23490 | #[doc = "CSI clock calibration"] | ||
| 23491 | pub const fn csical(&self) -> u8 { | ||
| 23492 | let val = (self.0 >> 18usize) & 0xff; | ||
| 23493 | val as u8 | ||
| 23494 | } | ||
| 23495 | #[doc = "CSI clock calibration"] | ||
| 23496 | pub fn set_csical(&mut self, val: u8) { | ||
| 23497 | self.0 = (self.0 & !(0xff << 18usize)) | (((val as u32) & 0xff) << 18usize); | ||
| 23498 | } | ||
| 23499 | #[doc = "CSI clock trimming"] | ||
| 23500 | pub const fn csitrim(&self) -> u8 { | ||
| 23501 | let val = (self.0 >> 26usize) & 0x1f; | ||
| 23502 | val as u8 | ||
| 23503 | } | ||
| 23504 | #[doc = "CSI clock trimming"] | ||
| 23505 | pub fn set_csitrim(&mut self, val: u8) { | ||
| 23506 | self.0 = (self.0 & !(0x1f << 26usize)) | (((val as u32) & 0x1f) << 26usize); | ||
| 14771 | } | 23507 | } |
| 14772 | } | 23508 | } |
| 14773 | impl Default for Id { | 23509 | impl Default for Icscr { |
| 14774 | fn default() -> Id { | 23510 | fn default() -> Icscr { |
| 14775 | Id(0) | 23511 | Icscr(0) |
| 14776 | } | 23512 | } |
| 14777 | } | 23513 | } |
| 14778 | #[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."] | 23514 | #[doc = "RCC Global Control Register"] |
| 14779 | #[repr(transparent)] | 23515 | #[repr(transparent)] |
| 14780 | #[derive(Copy, Clone, Eq, PartialEq)] | 23516 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 14781 | pub struct Idmabase0r(pub u32); | 23517 | pub struct Gcr(pub u32); |
| 14782 | impl Idmabase0r { | 23518 | impl Gcr { |
| 14783 | #[doc = "Buffer 0 memory base address bits [31:2], shall be word aligned (bit [1:0] | 23519 | #[doc = "WWDG1 reset scope control"] |
| 14784 | 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)."] | 23520 | pub const fn ww1rsc(&self) -> super::vals::Ww1rsc { |
| 14785 | pub const fn idmabase0(&self) -> u32 { | 23521 | let val = (self.0 >> 0usize) & 0x01; |
| 14786 | let val = (self.0 >> 0usize) & 0xffff_ffff; | 23522 | super::vals::Ww1rsc(val as u8) |
| 14787 | val as u32 | ||
| 14788 | } | 23523 | } |
| 14789 | #[doc = "Buffer 0 memory base address bits [31:2], shall be word aligned (bit [1:0] | 23524 | #[doc = "WWDG1 reset scope control"] |
| 14790 | 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)."] | 23525 | pub fn set_ww1rsc(&mut self, val: super::vals::Ww1rsc) { |
| 14791 | pub fn set_idmabase0(&mut self, val: u32) { | 23526 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 14792 | self.0 = | ||
| 14793 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 14794 | } | 23527 | } |
| 14795 | } | 23528 | } |
| 14796 | impl Default for Idmabase0r { | 23529 | impl Default for Gcr { |
| 14797 | fn default() -> Idmabase0r { | 23530 | fn default() -> Gcr { |
| 14798 | Idmabase0r(0) | 23531 | Gcr(0) |
| 14799 | } | 23532 | } |
| 14800 | } | 23533 | } |
| 14801 | } | 23534 | #[doc = "RCC APB3 Sleep Clock Register"] |
| 14802 | } | 23535 | #[repr(transparent)] |
| 14803 | pub mod gpio_v1 { | 23536 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 14804 | use crate::generic::*; | 23537 | pub struct C1Apb3lpenr(pub u32); |
| 14805 | #[doc = "General purpose I/O"] | 23538 | impl C1Apb3lpenr { |
| 14806 | #[derive(Copy, Clone)] | 23539 | #[doc = "LTDC peripheral clock enable during CSleep mode"] |
| 14807 | pub struct Gpio(pub *mut u8); | 23540 | pub const fn ltdclpen(&self) -> super::vals::C1Apb3lpenrLtdclpen { |
| 14808 | unsafe impl Send for Gpio {} | 23541 | let val = (self.0 >> 3usize) & 0x01; |
| 14809 | unsafe impl Sync for Gpio {} | 23542 | super::vals::C1Apb3lpenrLtdclpen(val as u8) |
| 14810 | impl Gpio { | 23543 | } |
| 14811 | #[doc = "Port configuration register low (GPIOn_CRL)"] | 23544 | #[doc = "LTDC peripheral clock enable during CSleep mode"] |
| 14812 | pub fn cr(self, n: usize) -> Reg<regs::Cr, RW> { | 23545 | pub fn set_ltdclpen(&mut self, val: super::vals::C1Apb3lpenrLtdclpen) { |
| 14813 | assert!(n < 2usize); | 23546 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); |
| 14814 | unsafe { Reg::from_ptr(self.0.add(0usize + n * 4usize)) } | 23547 | } |
| 23548 | #[doc = "WWDG1 Clock Enable During CSleep Mode"] | ||
| 23549 | pub const fn wwdg1lpen(&self) -> super::vals::C1Apb3lpenrLtdclpen { | ||
| 23550 | let val = (self.0 >> 6usize) & 0x01; | ||
| 23551 | super::vals::C1Apb3lpenrLtdclpen(val as u8) | ||
| 23552 | } | ||
| 23553 | #[doc = "WWDG1 Clock Enable During CSleep Mode"] | ||
| 23554 | pub fn set_wwdg1lpen(&mut self, val: super::vals::C1Apb3lpenrLtdclpen) { | ||
| 23555 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); | ||
| 23556 | } | ||
| 14815 | } | 23557 | } |
| 14816 | #[doc = "Port input data register (GPIOn_IDR)"] | 23558 | impl Default for C1Apb3lpenr { |
| 14817 | pub fn idr(self) -> Reg<regs::Idr, R> { | 23559 | fn default() -> C1Apb3lpenr { |
| 14818 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | 23560 | C1Apb3lpenr(0) |
| 23561 | } | ||
| 14819 | } | 23562 | } |
| 14820 | #[doc = "Port output data register (GPIOn_ODR)"] | 23563 | #[doc = "RCC APB2 Sleep Clock Register"] |
| 14821 | pub fn odr(self) -> Reg<regs::Odr, RW> { | 23564 | #[repr(transparent)] |
| 14822 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | 23565 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 23566 | pub struct Apb2lpenr(pub u32); | ||
| 23567 | impl Apb2lpenr { | ||
| 23568 | #[doc = "TIM1 peripheral clock enable during CSleep mode"] | ||
| 23569 | pub const fn tim1lpen(&self) -> super::vals::Apb2lpenrTim1lpen { | ||
| 23570 | let val = (self.0 >> 0usize) & 0x01; | ||
| 23571 | super::vals::Apb2lpenrTim1lpen(val as u8) | ||
| 23572 | } | ||
| 23573 | #[doc = "TIM1 peripheral clock enable during CSleep mode"] | ||
| 23574 | pub fn set_tim1lpen(&mut self, val: super::vals::Apb2lpenrTim1lpen) { | ||
| 23575 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 23576 | } | ||
| 23577 | #[doc = "TIM8 peripheral clock enable during CSleep mode"] | ||
| 23578 | pub const fn tim8lpen(&self) -> super::vals::Apb2lpenrTim1lpen { | ||
| 23579 | let val = (self.0 >> 1usize) & 0x01; | ||
| 23580 | super::vals::Apb2lpenrTim1lpen(val as u8) | ||
| 23581 | } | ||
| 23582 | #[doc = "TIM8 peripheral clock enable during CSleep mode"] | ||
| 23583 | pub fn set_tim8lpen(&mut self, val: super::vals::Apb2lpenrTim1lpen) { | ||
| 23584 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 23585 | } | ||
| 23586 | #[doc = "USART1 Peripheral Clocks Enable During CSleep Mode"] | ||
| 23587 | pub const fn usart1lpen(&self) -> super::vals::Apb2lpenrTim1lpen { | ||
| 23588 | let val = (self.0 >> 4usize) & 0x01; | ||
| 23589 | super::vals::Apb2lpenrTim1lpen(val as u8) | ||
| 23590 | } | ||
| 23591 | #[doc = "USART1 Peripheral Clocks Enable During CSleep Mode"] | ||
| 23592 | pub fn set_usart1lpen(&mut self, val: super::vals::Apb2lpenrTim1lpen) { | ||
| 23593 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 23594 | } | ||
| 23595 | #[doc = "USART6 Peripheral Clocks Enable During CSleep Mode"] | ||
| 23596 | pub const fn usart6lpen(&self) -> super::vals::Apb2lpenrTim1lpen { | ||
| 23597 | let val = (self.0 >> 5usize) & 0x01; | ||
| 23598 | super::vals::Apb2lpenrTim1lpen(val as u8) | ||
| 23599 | } | ||
| 23600 | #[doc = "USART6 Peripheral Clocks Enable During CSleep Mode"] | ||
| 23601 | pub fn set_usart6lpen(&mut self, val: super::vals::Apb2lpenrTim1lpen) { | ||
| 23602 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 23603 | } | ||
| 23604 | #[doc = "SPI1 Peripheral Clocks Enable During CSleep Mode"] | ||
| 23605 | pub const fn spi1lpen(&self) -> super::vals::Apb2lpenrTim1lpen { | ||
| 23606 | let val = (self.0 >> 12usize) & 0x01; | ||
| 23607 | super::vals::Apb2lpenrTim1lpen(val as u8) | ||
| 23608 | } | ||
| 23609 | #[doc = "SPI1 Peripheral Clocks Enable During CSleep Mode"] | ||
| 23610 | pub fn set_spi1lpen(&mut self, val: super::vals::Apb2lpenrTim1lpen) { | ||
| 23611 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 23612 | } | ||
| 23613 | #[doc = "SPI4 Peripheral Clocks Enable During CSleep Mode"] | ||
| 23614 | pub const fn spi4lpen(&self) -> super::vals::Apb2lpenrTim1lpen { | ||
| 23615 | let val = (self.0 >> 13usize) & 0x01; | ||
| 23616 | super::vals::Apb2lpenrTim1lpen(val as u8) | ||
| 23617 | } | ||
| 23618 | #[doc = "SPI4 Peripheral Clocks Enable During CSleep Mode"] | ||
| 23619 | pub fn set_spi4lpen(&mut self, val: super::vals::Apb2lpenrTim1lpen) { | ||
| 23620 | self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize); | ||
| 23621 | } | ||
| 23622 | #[doc = "TIM15 peripheral clock enable during CSleep mode"] | ||
| 23623 | pub const fn tim15lpen(&self) -> super::vals::Apb2lpenrTim1lpen { | ||
| 23624 | let val = (self.0 >> 16usize) & 0x01; | ||
| 23625 | super::vals::Apb2lpenrTim1lpen(val as u8) | ||
| 23626 | } | ||
| 23627 | #[doc = "TIM15 peripheral clock enable during CSleep mode"] | ||
| 23628 | pub fn set_tim15lpen(&mut self, val: super::vals::Apb2lpenrTim1lpen) { | ||
| 23629 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 23630 | } | ||
| 23631 | #[doc = "TIM16 peripheral clock enable during CSleep mode"] | ||
| 23632 | pub const fn tim16lpen(&self) -> super::vals::Apb2lpenrTim1lpen { | ||
| 23633 | let val = (self.0 >> 17usize) & 0x01; | ||
| 23634 | super::vals::Apb2lpenrTim1lpen(val as u8) | ||
| 23635 | } | ||
| 23636 | #[doc = "TIM16 peripheral clock enable during CSleep mode"] | ||
| 23637 | pub fn set_tim16lpen(&mut self, val: super::vals::Apb2lpenrTim1lpen) { | ||
| 23638 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize); | ||
| 23639 | } | ||
| 23640 | #[doc = "TIM17 peripheral clock enable during CSleep mode"] | ||
| 23641 | pub const fn tim17lpen(&self) -> super::vals::Apb2lpenrTim1lpen { | ||
| 23642 | let val = (self.0 >> 18usize) & 0x01; | ||
| 23643 | super::vals::Apb2lpenrTim1lpen(val as u8) | ||
| 23644 | } | ||
| 23645 | #[doc = "TIM17 peripheral clock enable during CSleep mode"] | ||
| 23646 | pub fn set_tim17lpen(&mut self, val: super::vals::Apb2lpenrTim1lpen) { | ||
| 23647 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize); | ||
| 23648 | } | ||
| 23649 | #[doc = "SPI5 Peripheral Clocks Enable During CSleep Mode"] | ||
| 23650 | pub const fn spi5lpen(&self) -> super::vals::Apb2lpenrTim1lpen { | ||
| 23651 | let val = (self.0 >> 20usize) & 0x01; | ||
| 23652 | super::vals::Apb2lpenrTim1lpen(val as u8) | ||
| 23653 | } | ||
| 23654 | #[doc = "SPI5 Peripheral Clocks Enable During CSleep Mode"] | ||
| 23655 | pub fn set_spi5lpen(&mut self, val: super::vals::Apb2lpenrTim1lpen) { | ||
| 23656 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize); | ||
| 23657 | } | ||
| 23658 | #[doc = "SAI1 Peripheral Clocks Enable During CSleep Mode"] | ||
| 23659 | pub const fn sai1lpen(&self) -> super::vals::Apb2lpenrTim1lpen { | ||
| 23660 | let val = (self.0 >> 22usize) & 0x01; | ||
| 23661 | super::vals::Apb2lpenrTim1lpen(val as u8) | ||
| 23662 | } | ||
| 23663 | #[doc = "SAI1 Peripheral Clocks Enable During CSleep Mode"] | ||
| 23664 | pub fn set_sai1lpen(&mut self, val: super::vals::Apb2lpenrTim1lpen) { | ||
| 23665 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize); | ||
| 23666 | } | ||
| 23667 | #[doc = "SAI2 Peripheral Clocks Enable During CSleep Mode"] | ||
| 23668 | pub const fn sai2lpen(&self) -> super::vals::Apb2lpenrTim1lpen { | ||
| 23669 | let val = (self.0 >> 23usize) & 0x01; | ||
| 23670 | super::vals::Apb2lpenrTim1lpen(val as u8) | ||
| 23671 | } | ||
| 23672 | #[doc = "SAI2 Peripheral Clocks Enable During CSleep Mode"] | ||
| 23673 | pub fn set_sai2lpen(&mut self, val: super::vals::Apb2lpenrTim1lpen) { | ||
| 23674 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize); | ||
| 23675 | } | ||
| 23676 | #[doc = "SAI3 Peripheral Clocks Enable During CSleep Mode"] | ||
| 23677 | pub const fn sai3lpen(&self) -> super::vals::Apb2lpenrTim1lpen { | ||
| 23678 | let val = (self.0 >> 24usize) & 0x01; | ||
| 23679 | super::vals::Apb2lpenrTim1lpen(val as u8) | ||
| 23680 | } | ||
| 23681 | #[doc = "SAI3 Peripheral Clocks Enable During CSleep Mode"] | ||
| 23682 | pub fn set_sai3lpen(&mut self, val: super::vals::Apb2lpenrTim1lpen) { | ||
| 23683 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); | ||
| 23684 | } | ||
| 23685 | #[doc = "DFSDM1 Peripheral Clocks Enable During CSleep Mode"] | ||
| 23686 | pub const fn dfsdm1lpen(&self) -> super::vals::Apb2lpenrTim1lpen { | ||
| 23687 | let val = (self.0 >> 28usize) & 0x01; | ||
| 23688 | super::vals::Apb2lpenrTim1lpen(val as u8) | ||
| 23689 | } | ||
| 23690 | #[doc = "DFSDM1 Peripheral Clocks Enable During CSleep Mode"] | ||
| 23691 | pub fn set_dfsdm1lpen(&mut self, val: super::vals::Apb2lpenrTim1lpen) { | ||
| 23692 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); | ||
| 23693 | } | ||
| 23694 | #[doc = "HRTIM peripheral clock enable during CSleep mode"] | ||
| 23695 | pub const fn hrtimlpen(&self) -> super::vals::Apb2lpenrTim1lpen { | ||
| 23696 | let val = (self.0 >> 29usize) & 0x01; | ||
| 23697 | super::vals::Apb2lpenrTim1lpen(val as u8) | ||
| 23698 | } | ||
| 23699 | #[doc = "HRTIM peripheral clock enable during CSleep mode"] | ||
| 23700 | pub fn set_hrtimlpen(&mut self, val: super::vals::Apb2lpenrTim1lpen) { | ||
| 23701 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); | ||
| 23702 | } | ||
| 14823 | } | 23703 | } |
| 14824 | #[doc = "Port bit set/reset register (GPIOn_BSRR)"] | 23704 | impl Default for Apb2lpenr { |
| 14825 | pub fn bsrr(self) -> Reg<regs::Bsrr, W> { | 23705 | fn default() -> Apb2lpenr { |
| 14826 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | 23706 | Apb2lpenr(0) |
| 23707 | } | ||
| 14827 | } | 23708 | } |
| 14828 | #[doc = "Port bit reset register (GPIOn_BRR)"] | 23709 | #[doc = "RCC CSI configuration register"] |
| 14829 | pub fn brr(self) -> Reg<regs::Brr, W> { | 23710 | #[repr(transparent)] |
| 14830 | unsafe { Reg::from_ptr(self.0.add(20usize)) } | 23711 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 23712 | pub struct Csicfgr(pub u32); | ||
| 23713 | impl Csicfgr { | ||
| 23714 | #[doc = "CSI clock calibration"] | ||
| 23715 | pub const fn csical(&self) -> u16 { | ||
| 23716 | let val = (self.0 >> 0usize) & 0x01ff; | ||
| 23717 | val as u16 | ||
| 23718 | } | ||
| 23719 | #[doc = "CSI clock calibration"] | ||
| 23720 | pub fn set_csical(&mut self, val: u16) { | ||
| 23721 | self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize); | ||
| 23722 | } | ||
| 23723 | #[doc = "CSI clock trimming"] | ||
| 23724 | pub const fn csitrim(&self) -> u8 { | ||
| 23725 | let val = (self.0 >> 24usize) & 0x3f; | ||
| 23726 | val as u8 | ||
| 23727 | } | ||
| 23728 | #[doc = "CSI clock trimming"] | ||
| 23729 | pub fn set_csitrim(&mut self, val: u8) { | ||
| 23730 | self.0 = (self.0 & !(0x3f << 24usize)) | (((val as u32) & 0x3f) << 24usize); | ||
| 23731 | } | ||
| 14831 | } | 23732 | } |
| 14832 | #[doc = "Port configuration lock register"] | 23733 | impl Default for Csicfgr { |
| 14833 | pub fn lckr(self) -> Reg<regs::Lckr, RW> { | 23734 | fn default() -> Csicfgr { |
| 14834 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | 23735 | Csicfgr(0) |
| 23736 | } | ||
| 14835 | } | 23737 | } |
| 14836 | } | 23738 | #[doc = "RCC AHB1 Sleep Clock Register"] |
| 14837 | pub mod vals { | ||
| 14838 | use crate::generic::*; | ||
| 14839 | #[repr(transparent)] | 23739 | #[repr(transparent)] |
| 14840 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 23740 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 14841 | pub struct Cnf(pub u8); | 23741 | pub struct Ahb1lpenr(pub u32); |
| 14842 | impl Cnf { | 23742 | impl Ahb1lpenr { |
| 14843 | #[doc = "Analog mode / Push-Pull mode"] | 23743 | #[doc = "DMA1 Clock Enable During CSleep Mode"] |
| 14844 | pub const PUSHPULL: Self = Self(0); | 23744 | pub const fn dma1lpen(&self) -> super::vals::Ahb1lpenrDma1lpen { |
| 14845 | #[doc = "Floating input (reset state) / Open Drain-Mode"] | 23745 | let val = (self.0 >> 0usize) & 0x01; |
| 14846 | pub const OPENDRAIN: Self = Self(0x01); | 23746 | super::vals::Ahb1lpenrDma1lpen(val as u8) |
| 14847 | #[doc = "Input with pull-up/pull-down / Alternate Function Push-Pull Mode"] | 23747 | } |
| 14848 | pub const ALTPUSHPULL: Self = Self(0x02); | 23748 | #[doc = "DMA1 Clock Enable During CSleep Mode"] |
| 14849 | #[doc = "Alternate Function Open-Drain Mode"] | 23749 | pub fn set_dma1lpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) { |
| 14850 | pub const ALTOPENDRAIN: Self = Self(0x03); | 23750 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 23751 | } | ||
| 23752 | #[doc = "DMA2 Clock Enable During CSleep Mode"] | ||
| 23753 | pub const fn dma2lpen(&self) -> super::vals::Ahb1lpenrDma1lpen { | ||
| 23754 | let val = (self.0 >> 1usize) & 0x01; | ||
| 23755 | super::vals::Ahb1lpenrDma1lpen(val as u8) | ||
| 23756 | } | ||
| 23757 | #[doc = "DMA2 Clock Enable During CSleep Mode"] | ||
| 23758 | pub fn set_dma2lpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) { | ||
| 23759 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 23760 | } | ||
| 23761 | #[doc = "ADC1/2 Peripheral Clocks Enable During CSleep Mode"] | ||
| 23762 | pub const fn adc12lpen(&self) -> super::vals::Ahb1lpenrDma1lpen { | ||
| 23763 | let val = (self.0 >> 5usize) & 0x01; | ||
| 23764 | super::vals::Ahb1lpenrDma1lpen(val as u8) | ||
| 23765 | } | ||
| 23766 | #[doc = "ADC1/2 Peripheral Clocks Enable During CSleep Mode"] | ||
| 23767 | pub fn set_adc12lpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) { | ||
| 23768 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 23769 | } | ||
| 23770 | #[doc = "Ethernet MAC bus interface Clock Enable During CSleep Mode"] | ||
| 23771 | pub const fn eth1maclpen(&self) -> super::vals::Ahb1lpenrDma1lpen { | ||
| 23772 | let val = (self.0 >> 15usize) & 0x01; | ||
| 23773 | super::vals::Ahb1lpenrDma1lpen(val as u8) | ||
| 23774 | } | ||
| 23775 | #[doc = "Ethernet MAC bus interface Clock Enable During CSleep Mode"] | ||
| 23776 | pub fn set_eth1maclpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) { | ||
| 23777 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 23778 | } | ||
| 23779 | #[doc = "Ethernet Transmission Clock Enable During CSleep Mode"] | ||
| 23780 | pub const fn eth1txlpen(&self) -> super::vals::Ahb1lpenrDma1lpen { | ||
| 23781 | let val = (self.0 >> 16usize) & 0x01; | ||
| 23782 | super::vals::Ahb1lpenrDma1lpen(val as u8) | ||
| 23783 | } | ||
| 23784 | #[doc = "Ethernet Transmission Clock Enable During CSleep Mode"] | ||
| 23785 | pub fn set_eth1txlpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) { | ||
| 23786 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 23787 | } | ||
| 23788 | #[doc = "Ethernet Reception Clock Enable During CSleep Mode"] | ||
| 23789 | pub const fn eth1rxlpen(&self) -> super::vals::Ahb1lpenrDma1lpen { | ||
| 23790 | let val = (self.0 >> 17usize) & 0x01; | ||
| 23791 | super::vals::Ahb1lpenrDma1lpen(val as u8) | ||
| 23792 | } | ||
| 23793 | #[doc = "Ethernet Reception Clock Enable During CSleep Mode"] | ||
| 23794 | pub fn set_eth1rxlpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) { | ||
| 23795 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize); | ||
| 23796 | } | ||
| 23797 | #[doc = "USB1OTG peripheral clock enable during CSleep mode"] | ||
| 23798 | pub const fn usb1otglpen(&self) -> super::vals::Ahb1lpenrDma1lpen { | ||
| 23799 | let val = (self.0 >> 25usize) & 0x01; | ||
| 23800 | super::vals::Ahb1lpenrDma1lpen(val as u8) | ||
| 23801 | } | ||
| 23802 | #[doc = "USB1OTG peripheral clock enable during CSleep mode"] | ||
| 23803 | pub fn set_usb1otglpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) { | ||
| 23804 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize); | ||
| 23805 | } | ||
| 23806 | #[doc = "USB_PHY1 clock enable during CSleep mode"] | ||
| 23807 | pub const fn usb1otghsulpilpen(&self) -> super::vals::Ahb1lpenrDma1lpen { | ||
| 23808 | let val = (self.0 >> 26usize) & 0x01; | ||
| 23809 | super::vals::Ahb1lpenrDma1lpen(val as u8) | ||
| 23810 | } | ||
| 23811 | #[doc = "USB_PHY1 clock enable during CSleep mode"] | ||
| 23812 | pub fn set_usb1otghsulpilpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) { | ||
| 23813 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val.0 as u32) & 0x01) << 26usize); | ||
| 23814 | } | ||
| 23815 | #[doc = "USB2OTG peripheral clock enable during CSleep mode"] | ||
| 23816 | pub const fn usb2otglpen(&self) -> super::vals::Ahb1lpenrDma1lpen { | ||
| 23817 | let val = (self.0 >> 27usize) & 0x01; | ||
| 23818 | super::vals::Ahb1lpenrDma1lpen(val as u8) | ||
| 23819 | } | ||
| 23820 | #[doc = "USB2OTG peripheral clock enable during CSleep mode"] | ||
| 23821 | pub fn set_usb2otglpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) { | ||
| 23822 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize); | ||
| 23823 | } | ||
| 23824 | #[doc = "USB_PHY2 clocks enable during CSleep mode"] | ||
| 23825 | pub const fn usb2otghsulpilpen(&self) -> super::vals::Ahb1lpenrDma1lpen { | ||
| 23826 | let val = (self.0 >> 28usize) & 0x01; | ||
| 23827 | super::vals::Ahb1lpenrDma1lpen(val as u8) | ||
| 23828 | } | ||
| 23829 | #[doc = "USB_PHY2 clocks enable during CSleep mode"] | ||
| 23830 | pub fn set_usb2otghsulpilpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) { | ||
| 23831 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); | ||
| 23832 | } | ||
| 14851 | } | 23833 | } |
| 14852 | #[repr(transparent)] | 23834 | impl Default for Ahb1lpenr { |
| 14853 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 23835 | fn default() -> Ahb1lpenr { |
| 14854 | pub struct Brw(pub u8); | 23836 | Ahb1lpenr(0) |
| 14855 | impl Brw { | 23837 | } |
| 14856 | #[doc = "No action on the corresponding ODx bit"] | ||
| 14857 | pub const NOACTION: Self = Self(0); | ||
| 14858 | #[doc = "Reset the ODx bit"] | ||
| 14859 | pub const RESET: Self = Self(0x01); | ||
| 14860 | } | 23838 | } |
| 23839 | #[doc = "RCC APB1 Clock Register"] | ||
| 14861 | #[repr(transparent)] | 23840 | #[repr(transparent)] |
| 14862 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 23841 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 14863 | pub struct Bsw(pub u8); | 23842 | pub struct C1Apb1lenr(pub u32); |
| 14864 | impl Bsw { | 23843 | impl C1Apb1lenr { |
| 14865 | #[doc = "No action on the corresponding ODx bit"] | 23844 | #[doc = "TIM peripheral clock enable"] |
| 14866 | pub const NOACTION: Self = Self(0); | 23845 | pub const fn tim2en(&self) -> super::vals::C1Apb1lenrTim2en { |
| 14867 | #[doc = "Sets the corresponding ODRx bit"] | 23846 | let val = (self.0 >> 0usize) & 0x01; |
| 14868 | pub const SET: Self = Self(0x01); | 23847 | super::vals::C1Apb1lenrTim2en(val as u8) |
| 23848 | } | ||
| 23849 | #[doc = "TIM peripheral clock enable"] | ||
| 23850 | pub fn set_tim2en(&mut self, val: super::vals::C1Apb1lenrTim2en) { | ||
| 23851 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 23852 | } | ||
| 23853 | #[doc = "TIM peripheral clock enable"] | ||
| 23854 | pub const fn tim3en(&self) -> super::vals::C1Apb1lenrTim2en { | ||
| 23855 | let val = (self.0 >> 1usize) & 0x01; | ||
| 23856 | super::vals::C1Apb1lenrTim2en(val as u8) | ||
| 23857 | } | ||
| 23858 | #[doc = "TIM peripheral clock enable"] | ||
| 23859 | pub fn set_tim3en(&mut self, val: super::vals::C1Apb1lenrTim2en) { | ||
| 23860 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); | ||
| 23861 | } | ||
| 23862 | #[doc = "TIM peripheral clock enable"] | ||
| 23863 | pub const fn tim4en(&self) -> super::vals::C1Apb1lenrTim2en { | ||
| 23864 | let val = (self.0 >> 2usize) & 0x01; | ||
| 23865 | super::vals::C1Apb1lenrTim2en(val as u8) | ||
| 23866 | } | ||
| 23867 | #[doc = "TIM peripheral clock enable"] | ||
| 23868 | pub fn set_tim4en(&mut self, val: super::vals::C1Apb1lenrTim2en) { | ||
| 23869 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 23870 | } | ||
| 23871 | #[doc = "TIM peripheral clock enable"] | ||
| 23872 | pub const fn tim5en(&self) -> super::vals::C1Apb1lenrTim2en { | ||
| 23873 | let val = (self.0 >> 3usize) & 0x01; | ||
| 23874 | super::vals::C1Apb1lenrTim2en(val as u8) | ||
| 23875 | } | ||
| 23876 | #[doc = "TIM peripheral clock enable"] | ||
| 23877 | pub fn set_tim5en(&mut self, val: super::vals::C1Apb1lenrTim2en) { | ||
| 23878 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 23879 | } | ||
| 23880 | #[doc = "TIM peripheral clock enable"] | ||
| 23881 | pub const fn tim6en(&self) -> super::vals::C1Apb1lenrTim2en { | ||
| 23882 | let val = (self.0 >> 4usize) & 0x01; | ||
| 23883 | super::vals::C1Apb1lenrTim2en(val as u8) | ||
| 23884 | } | ||
| 23885 | #[doc = "TIM peripheral clock enable"] | ||
| 23886 | pub fn set_tim6en(&mut self, val: super::vals::C1Apb1lenrTim2en) { | ||
| 23887 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 23888 | } | ||
| 23889 | #[doc = "TIM peripheral clock enable"] | ||
| 23890 | pub const fn tim7en(&self) -> super::vals::C1Apb1lenrTim2en { | ||
| 23891 | let val = (self.0 >> 5usize) & 0x01; | ||
| 23892 | super::vals::C1Apb1lenrTim2en(val as u8) | ||
| 23893 | } | ||
| 23894 | #[doc = "TIM peripheral clock enable"] | ||
| 23895 | pub fn set_tim7en(&mut self, val: super::vals::C1Apb1lenrTim2en) { | ||
| 23896 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 23897 | } | ||
| 23898 | #[doc = "TIM peripheral clock enable"] | ||
| 23899 | pub const fn tim12en(&self) -> super::vals::C1Apb1lenrTim2en { | ||
| 23900 | let val = (self.0 >> 6usize) & 0x01; | ||
| 23901 | super::vals::C1Apb1lenrTim2en(val as u8) | ||
| 23902 | } | ||
| 23903 | #[doc = "TIM peripheral clock enable"] | ||
| 23904 | pub fn set_tim12en(&mut self, val: super::vals::C1Apb1lenrTim2en) { | ||
| 23905 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); | ||
| 23906 | } | ||
| 23907 | #[doc = "TIM peripheral clock enable"] | ||
| 23908 | pub const fn tim13en(&self) -> super::vals::C1Apb1lenrTim2en { | ||
| 23909 | let val = (self.0 >> 7usize) & 0x01; | ||
| 23910 | super::vals::C1Apb1lenrTim2en(val as u8) | ||
| 23911 | } | ||
| 23912 | #[doc = "TIM peripheral clock enable"] | ||
| 23913 | pub fn set_tim13en(&mut self, val: super::vals::C1Apb1lenrTim2en) { | ||
| 23914 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 23915 | } | ||
| 23916 | #[doc = "TIM peripheral clock enable"] | ||
| 23917 | pub const fn tim14en(&self) -> super::vals::C1Apb1lenrTim2en { | ||
| 23918 | let val = (self.0 >> 8usize) & 0x01; | ||
| 23919 | super::vals::C1Apb1lenrTim2en(val as u8) | ||
| 23920 | } | ||
| 23921 | #[doc = "TIM peripheral clock enable"] | ||
| 23922 | pub fn set_tim14en(&mut self, val: super::vals::C1Apb1lenrTim2en) { | ||
| 23923 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); | ||
| 23924 | } | ||
| 23925 | #[doc = "LPTIM1 Peripheral Clocks Enable"] | ||
| 23926 | pub const fn lptim1en(&self) -> super::vals::C1Apb1lenrTim2en { | ||
| 23927 | let val = (self.0 >> 9usize) & 0x01; | ||
| 23928 | super::vals::C1Apb1lenrTim2en(val as u8) | ||
| 23929 | } | ||
| 23930 | #[doc = "LPTIM1 Peripheral Clocks Enable"] | ||
| 23931 | pub fn set_lptim1en(&mut self, val: super::vals::C1Apb1lenrTim2en) { | ||
| 23932 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | ||
| 23933 | } | ||
| 23934 | #[doc = "SPI2 Peripheral Clocks Enable"] | ||
| 23935 | pub const fn spi2en(&self) -> super::vals::C1Apb1lenrTim2en { | ||
| 23936 | let val = (self.0 >> 14usize) & 0x01; | ||
| 23937 | super::vals::C1Apb1lenrTim2en(val as u8) | ||
| 23938 | } | ||
| 23939 | #[doc = "SPI2 Peripheral Clocks Enable"] | ||
| 23940 | pub fn set_spi2en(&mut self, val: super::vals::C1Apb1lenrTim2en) { | ||
| 23941 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | ||
| 23942 | } | ||
| 23943 | #[doc = "SPI3 Peripheral Clocks Enable"] | ||
| 23944 | pub const fn spi3en(&self) -> super::vals::C1Apb1lenrTim2en { | ||
| 23945 | let val = (self.0 >> 15usize) & 0x01; | ||
| 23946 | super::vals::C1Apb1lenrTim2en(val as u8) | ||
| 23947 | } | ||
| 23948 | #[doc = "SPI3 Peripheral Clocks Enable"] | ||
| 23949 | pub fn set_spi3en(&mut self, val: super::vals::C1Apb1lenrTim2en) { | ||
| 23950 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 23951 | } | ||
| 23952 | #[doc = "SPDIFRX Peripheral Clocks Enable"] | ||
| 23953 | pub const fn spdifrxen(&self) -> super::vals::C1Apb1lenrTim2en { | ||
| 23954 | let val = (self.0 >> 16usize) & 0x01; | ||
| 23955 | super::vals::C1Apb1lenrTim2en(val as u8) | ||
| 23956 | } | ||
| 23957 | #[doc = "SPDIFRX Peripheral Clocks Enable"] | ||
| 23958 | pub fn set_spdifrxen(&mut self, val: super::vals::C1Apb1lenrTim2en) { | ||
| 23959 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 23960 | } | ||
| 23961 | #[doc = "USART2 Peripheral Clocks Enable"] | ||
| 23962 | pub const fn usart2en(&self) -> super::vals::C1Apb1lenrTim2en { | ||
| 23963 | let val = (self.0 >> 17usize) & 0x01; | ||
| 23964 | super::vals::C1Apb1lenrTim2en(val as u8) | ||
| 23965 | } | ||
| 23966 | #[doc = "USART2 Peripheral Clocks Enable"] | ||
| 23967 | pub fn set_usart2en(&mut self, val: super::vals::C1Apb1lenrTim2en) { | ||
| 23968 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize); | ||
| 23969 | } | ||
| 23970 | #[doc = "USART3 Peripheral Clocks Enable"] | ||
| 23971 | pub const fn usart3en(&self) -> super::vals::C1Apb1lenrTim2en { | ||
| 23972 | let val = (self.0 >> 18usize) & 0x01; | ||
| 23973 | super::vals::C1Apb1lenrTim2en(val as u8) | ||
| 23974 | } | ||
| 23975 | #[doc = "USART3 Peripheral Clocks Enable"] | ||
| 23976 | pub fn set_usart3en(&mut self, val: super::vals::C1Apb1lenrTim2en) { | ||
| 23977 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize); | ||
| 23978 | } | ||
| 23979 | #[doc = "UART4 Peripheral Clocks Enable"] | ||
| 23980 | pub const fn uart4en(&self) -> super::vals::C1Apb1lenrTim2en { | ||
| 23981 | let val = (self.0 >> 19usize) & 0x01; | ||
| 23982 | super::vals::C1Apb1lenrTim2en(val as u8) | ||
| 23983 | } | ||
| 23984 | #[doc = "UART4 Peripheral Clocks Enable"] | ||
| 23985 | pub fn set_uart4en(&mut self, val: super::vals::C1Apb1lenrTim2en) { | ||
| 23986 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); | ||
| 23987 | } | ||
| 23988 | #[doc = "UART5 Peripheral Clocks Enable"] | ||
| 23989 | pub const fn uart5en(&self) -> super::vals::C1Apb1lenrTim2en { | ||
| 23990 | let val = (self.0 >> 20usize) & 0x01; | ||
| 23991 | super::vals::C1Apb1lenrTim2en(val as u8) | ||
| 23992 | } | ||
| 23993 | #[doc = "UART5 Peripheral Clocks Enable"] | ||
| 23994 | pub fn set_uart5en(&mut self, val: super::vals::C1Apb1lenrTim2en) { | ||
| 23995 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize); | ||
| 23996 | } | ||
| 23997 | #[doc = "I2C1 Peripheral Clocks Enable"] | ||
| 23998 | pub const fn i2c1en(&self) -> super::vals::C1Apb1lenrTim2en { | ||
| 23999 | let val = (self.0 >> 21usize) & 0x01; | ||
| 24000 | super::vals::C1Apb1lenrTim2en(val as u8) | ||
| 24001 | } | ||
| 24002 | #[doc = "I2C1 Peripheral Clocks Enable"] | ||
| 24003 | pub fn set_i2c1en(&mut self, val: super::vals::C1Apb1lenrTim2en) { | ||
| 24004 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize); | ||
| 24005 | } | ||
| 24006 | #[doc = "I2C2 Peripheral Clocks Enable"] | ||
| 24007 | pub const fn i2c2en(&self) -> super::vals::C1Apb1lenrTim2en { | ||
| 24008 | let val = (self.0 >> 22usize) & 0x01; | ||
| 24009 | super::vals::C1Apb1lenrTim2en(val as u8) | ||
| 24010 | } | ||
| 24011 | #[doc = "I2C2 Peripheral Clocks Enable"] | ||
| 24012 | pub fn set_i2c2en(&mut self, val: super::vals::C1Apb1lenrTim2en) { | ||
| 24013 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize); | ||
| 24014 | } | ||
| 24015 | #[doc = "I2C3 Peripheral Clocks Enable"] | ||
| 24016 | pub const fn i2c3en(&self) -> super::vals::C1Apb1lenrTim2en { | ||
| 24017 | let val = (self.0 >> 23usize) & 0x01; | ||
| 24018 | super::vals::C1Apb1lenrTim2en(val as u8) | ||
| 24019 | } | ||
| 24020 | #[doc = "I2C3 Peripheral Clocks Enable"] | ||
| 24021 | pub fn set_i2c3en(&mut self, val: super::vals::C1Apb1lenrTim2en) { | ||
| 24022 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize); | ||
| 24023 | } | ||
| 24024 | #[doc = "HDMI-CEC peripheral clock enable"] | ||
| 24025 | pub const fn cecen(&self) -> super::vals::C1Apb1lenrTim2en { | ||
| 24026 | let val = (self.0 >> 27usize) & 0x01; | ||
| 24027 | super::vals::C1Apb1lenrTim2en(val as u8) | ||
| 24028 | } | ||
| 24029 | #[doc = "HDMI-CEC peripheral clock enable"] | ||
| 24030 | pub fn set_cecen(&mut self, val: super::vals::C1Apb1lenrTim2en) { | ||
| 24031 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize); | ||
| 24032 | } | ||
| 24033 | #[doc = "DAC1&2 peripheral clock enable"] | ||
| 24034 | pub const fn dac12en(&self) -> super::vals::C1Apb1lenrTim2en { | ||
| 24035 | let val = (self.0 >> 29usize) & 0x01; | ||
| 24036 | super::vals::C1Apb1lenrTim2en(val as u8) | ||
| 24037 | } | ||
| 24038 | #[doc = "DAC1&2 peripheral clock enable"] | ||
| 24039 | pub fn set_dac12en(&mut self, val: super::vals::C1Apb1lenrTim2en) { | ||
| 24040 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); | ||
| 24041 | } | ||
| 24042 | #[doc = "UART7 Peripheral Clocks Enable"] | ||
| 24043 | pub const fn uart7en(&self) -> super::vals::C1Apb1lenrTim2en { | ||
| 24044 | let val = (self.0 >> 30usize) & 0x01; | ||
| 24045 | super::vals::C1Apb1lenrTim2en(val as u8) | ||
| 24046 | } | ||
| 24047 | #[doc = "UART7 Peripheral Clocks Enable"] | ||
| 24048 | pub fn set_uart7en(&mut self, val: super::vals::C1Apb1lenrTim2en) { | ||
| 24049 | self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize); | ||
| 24050 | } | ||
| 24051 | #[doc = "UART8 Peripheral Clocks Enable"] | ||
| 24052 | pub const fn uart8en(&self) -> super::vals::C1Apb1lenrTim2en { | ||
| 24053 | let val = (self.0 >> 31usize) & 0x01; | ||
| 24054 | super::vals::C1Apb1lenrTim2en(val as u8) | ||
| 24055 | } | ||
| 24056 | #[doc = "UART8 Peripheral Clocks Enable"] | ||
| 24057 | pub fn set_uart8en(&mut self, val: super::vals::C1Apb1lenrTim2en) { | ||
| 24058 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize); | ||
| 24059 | } | ||
| 14869 | } | 24060 | } |
| 14870 | #[repr(transparent)] | 24061 | impl Default for C1Apb1lenr { |
| 14871 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 24062 | fn default() -> C1Apb1lenr { |
| 14872 | pub struct Odr(pub u8); | 24063 | C1Apb1lenr(0) |
| 14873 | impl Odr { | 24064 | } |
| 14874 | #[doc = "Set output to logic low"] | ||
| 14875 | pub const LOW: Self = Self(0); | ||
| 14876 | #[doc = "Set output to logic high"] | ||
| 14877 | pub const HIGH: Self = Self(0x01); | ||
| 14878 | } | 24065 | } |
| 24066 | #[doc = "RCC Domain 2 Kernel Clock Configuration Register"] | ||
| 14879 | #[repr(transparent)] | 24067 | #[repr(transparent)] |
| 14880 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 24068 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 14881 | pub struct Idr(pub u8); | 24069 | pub struct D2ccip2r(pub u32); |
| 14882 | impl Idr { | 24070 | impl D2ccip2r { |
| 14883 | #[doc = "Input is logic low"] | 24071 | #[doc = "USART2/3, UART4,5, 7/8 (APB1) kernel clock source selection"] |
| 14884 | pub const LOW: Self = Self(0); | 24072 | pub const fn usart234578sel(&self) -> super::vals::Usart234578sel { |
| 14885 | #[doc = "Input is logic high"] | 24073 | let val = (self.0 >> 0usize) & 0x07; |
| 14886 | pub const HIGH: Self = Self(0x01); | 24074 | super::vals::Usart234578sel(val as u8) |
| 24075 | } | ||
| 24076 | #[doc = "USART2/3, UART4,5, 7/8 (APB1) kernel clock source selection"] | ||
| 24077 | pub fn set_usart234578sel(&mut self, val: super::vals::Usart234578sel) { | ||
| 24078 | self.0 = (self.0 & !(0x07 << 0usize)) | (((val.0 as u32) & 0x07) << 0usize); | ||
| 24079 | } | ||
| 24080 | #[doc = "USART1 and 6 kernel clock source selection"] | ||
| 24081 | pub const fn usart16sel(&self) -> super::vals::Usart16sel { | ||
| 24082 | let val = (self.0 >> 3usize) & 0x07; | ||
| 24083 | super::vals::Usart16sel(val as u8) | ||
| 24084 | } | ||
| 24085 | #[doc = "USART1 and 6 kernel clock source selection"] | ||
| 24086 | pub fn set_usart16sel(&mut self, val: super::vals::Usart16sel) { | ||
| 24087 | self.0 = (self.0 & !(0x07 << 3usize)) | (((val.0 as u32) & 0x07) << 3usize); | ||
| 24088 | } | ||
| 24089 | #[doc = "RNG kernel clock source selection"] | ||
| 24090 | pub const fn rngsel(&self) -> super::vals::Rngsel { | ||
| 24091 | let val = (self.0 >> 8usize) & 0x03; | ||
| 24092 | super::vals::Rngsel(val as u8) | ||
| 24093 | } | ||
| 24094 | #[doc = "RNG kernel clock source selection"] | ||
| 24095 | pub fn set_rngsel(&mut self, val: super::vals::Rngsel) { | ||
| 24096 | self.0 = (self.0 & !(0x03 << 8usize)) | (((val.0 as u32) & 0x03) << 8usize); | ||
| 24097 | } | ||
| 24098 | #[doc = "I2C1,2,3 kernel clock source selection"] | ||
| 24099 | pub const fn i2c123sel(&self) -> super::vals::I2c123sel { | ||
| 24100 | let val = (self.0 >> 12usize) & 0x03; | ||
| 24101 | super::vals::I2c123sel(val as u8) | ||
| 24102 | } | ||
| 24103 | #[doc = "I2C1,2,3 kernel clock source selection"] | ||
| 24104 | pub fn set_i2c123sel(&mut self, val: super::vals::I2c123sel) { | ||
| 24105 | self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize); | ||
| 24106 | } | ||
| 24107 | #[doc = "USBOTG 1 and 2 kernel clock source selection"] | ||
| 24108 | pub const fn usbsel(&self) -> super::vals::Usbsel { | ||
| 24109 | let val = (self.0 >> 20usize) & 0x03; | ||
| 24110 | super::vals::Usbsel(val as u8) | ||
| 24111 | } | ||
| 24112 | #[doc = "USBOTG 1 and 2 kernel clock source selection"] | ||
| 24113 | pub fn set_usbsel(&mut self, val: super::vals::Usbsel) { | ||
| 24114 | self.0 = (self.0 & !(0x03 << 20usize)) | (((val.0 as u32) & 0x03) << 20usize); | ||
| 24115 | } | ||
| 24116 | #[doc = "HDMI-CEC kernel clock source selection"] | ||
| 24117 | pub const fn cecsel(&self) -> super::vals::Cecsel { | ||
| 24118 | let val = (self.0 >> 22usize) & 0x03; | ||
| 24119 | super::vals::Cecsel(val as u8) | ||
| 24120 | } | ||
| 24121 | #[doc = "HDMI-CEC kernel clock source selection"] | ||
| 24122 | pub fn set_cecsel(&mut self, val: super::vals::Cecsel) { | ||
| 24123 | self.0 = (self.0 & !(0x03 << 22usize)) | (((val.0 as u32) & 0x03) << 22usize); | ||
| 24124 | } | ||
| 24125 | #[doc = "LPTIM1 kernel clock source selection"] | ||
| 24126 | pub const fn lptim1sel(&self) -> super::vals::Lptim1sel { | ||
| 24127 | let val = (self.0 >> 28usize) & 0x07; | ||
| 24128 | super::vals::Lptim1sel(val as u8) | ||
| 24129 | } | ||
| 24130 | #[doc = "LPTIM1 kernel clock source selection"] | ||
| 24131 | pub fn set_lptim1sel(&mut self, val: super::vals::Lptim1sel) { | ||
| 24132 | self.0 = (self.0 & !(0x07 << 28usize)) | (((val.0 as u32) & 0x07) << 28usize); | ||
| 24133 | } | ||
| 14887 | } | 24134 | } |
| 14888 | #[repr(transparent)] | 24135 | impl Default for D2ccip2r { |
| 14889 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 24136 | fn default() -> D2ccip2r { |
| 14890 | pub struct Lckk(pub u8); | 24137 | D2ccip2r(0) |
| 14891 | impl Lckk { | 24138 | } |
| 14892 | #[doc = "Port configuration lock key not active"] | ||
| 14893 | pub const NOTACTIVE: Self = Self(0); | ||
| 14894 | #[doc = "Port configuration lock key active"] | ||
| 14895 | pub const ACTIVE: Self = Self(0x01); | ||
| 14896 | } | 24139 | } |
| 24140 | #[doc = "RCC AHB2 Clock Register"] | ||
| 14897 | #[repr(transparent)] | 24141 | #[repr(transparent)] |
| 14898 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 24142 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 14899 | pub struct Mode(pub u8); | 24143 | pub struct C1Ahb2enr(pub u32); |
| 14900 | impl Mode { | 24144 | impl C1Ahb2enr { |
| 14901 | #[doc = "Input mode (reset state)"] | 24145 | #[doc = "DCMI peripheral clock"] |
| 14902 | pub const INPUT: Self = Self(0); | 24146 | pub const fn dcmien(&self) -> super::vals::C1Ahb2enrDcmien { |
| 14903 | #[doc = "Output mode 10 MHz"] | 24147 | let val = (self.0 >> 0usize) & 0x01; |
| 14904 | pub const OUTPUT: Self = Self(0x01); | 24148 | super::vals::C1Ahb2enrDcmien(val as u8) |
| 14905 | #[doc = "Output mode 2 MHz"] | 24149 | } |
| 14906 | pub const OUTPUT2: Self = Self(0x02); | 24150 | #[doc = "DCMI peripheral clock"] |
| 14907 | #[doc = "Output mode 50 MHz"] | 24151 | pub fn set_dcmien(&mut self, val: super::vals::C1Ahb2enrDcmien) { |
| 14908 | pub const OUTPUT50: Self = Self(0x03); | 24152 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 24153 | } | ||
| 24154 | #[doc = "CRYPT peripheral clock enable"] | ||
| 24155 | pub const fn crypten(&self) -> super::vals::C1Ahb2enrDcmien { | ||
| 24156 | let val = (self.0 >> 4usize) & 0x01; | ||
| 24157 | super::vals::C1Ahb2enrDcmien(val as u8) | ||
| 24158 | } | ||
| 24159 | #[doc = "CRYPT peripheral clock enable"] | ||
| 24160 | pub fn set_crypten(&mut self, val: super::vals::C1Ahb2enrDcmien) { | ||
| 24161 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 24162 | } | ||
| 24163 | #[doc = "HASH peripheral clock enable"] | ||
| 24164 | pub const fn hashen(&self) -> super::vals::C1Ahb2enrDcmien { | ||
| 24165 | let val = (self.0 >> 5usize) & 0x01; | ||
| 24166 | super::vals::C1Ahb2enrDcmien(val as u8) | ||
| 24167 | } | ||
| 24168 | #[doc = "HASH peripheral clock enable"] | ||
| 24169 | pub fn set_hashen(&mut self, val: super::vals::C1Ahb2enrDcmien) { | ||
| 24170 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 24171 | } | ||
| 24172 | #[doc = "RNG peripheral clocks enable"] | ||
| 24173 | pub const fn rngen(&self) -> super::vals::C1Ahb2enrDcmien { | ||
| 24174 | let val = (self.0 >> 6usize) & 0x01; | ||
| 24175 | super::vals::C1Ahb2enrDcmien(val as u8) | ||
| 24176 | } | ||
| 24177 | #[doc = "RNG peripheral clocks enable"] | ||
| 24178 | pub fn set_rngen(&mut self, val: super::vals::C1Ahb2enrDcmien) { | ||
| 24179 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); | ||
| 24180 | } | ||
| 24181 | #[doc = "SDMMC2 and SDMMC2 delay clock enable"] | ||
| 24182 | pub const fn sdmmc2en(&self) -> super::vals::C1Ahb2enrDcmien { | ||
| 24183 | let val = (self.0 >> 9usize) & 0x01; | ||
| 24184 | super::vals::C1Ahb2enrDcmien(val as u8) | ||
| 24185 | } | ||
| 24186 | #[doc = "SDMMC2 and SDMMC2 delay clock enable"] | ||
| 24187 | pub fn set_sdmmc2en(&mut self, val: super::vals::C1Ahb2enrDcmien) { | ||
| 24188 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | ||
| 24189 | } | ||
| 24190 | #[doc = "SRAM1 block enable"] | ||
| 24191 | pub const fn sram1en(&self) -> super::vals::C1Ahb2enrDcmien { | ||
| 24192 | let val = (self.0 >> 29usize) & 0x01; | ||
| 24193 | super::vals::C1Ahb2enrDcmien(val as u8) | ||
| 24194 | } | ||
| 24195 | #[doc = "SRAM1 block enable"] | ||
| 24196 | pub fn set_sram1en(&mut self, val: super::vals::C1Ahb2enrDcmien) { | ||
| 24197 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); | ||
| 24198 | } | ||
| 24199 | #[doc = "SRAM2 block enable"] | ||
| 24200 | pub const fn sram2en(&self) -> super::vals::C1Ahb2enrDcmien { | ||
| 24201 | let val = (self.0 >> 30usize) & 0x01; | ||
| 24202 | super::vals::C1Ahb2enrDcmien(val as u8) | ||
| 24203 | } | ||
| 24204 | #[doc = "SRAM2 block enable"] | ||
| 24205 | pub fn set_sram2en(&mut self, val: super::vals::C1Ahb2enrDcmien) { | ||
| 24206 | self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize); | ||
| 24207 | } | ||
| 24208 | #[doc = "SRAM3 block enable"] | ||
| 24209 | pub const fn sram3en(&self) -> super::vals::C1Ahb2enrDcmien { | ||
| 24210 | let val = (self.0 >> 31usize) & 0x01; | ||
| 24211 | super::vals::C1Ahb2enrDcmien(val as u8) | ||
| 24212 | } | ||
| 24213 | #[doc = "SRAM3 block enable"] | ||
| 24214 | pub fn set_sram3en(&mut self, val: super::vals::C1Ahb2enrDcmien) { | ||
| 24215 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize); | ||
| 24216 | } | ||
| 24217 | } | ||
| 24218 | impl Default for C1Ahb2enr { | ||
| 24219 | fn default() -> C1Ahb2enr { | ||
| 24220 | C1Ahb2enr(0) | ||
| 24221 | } | ||
| 14909 | } | 24222 | } |
| 24223 | #[doc = "RCC Backup Domain Control Register"] | ||
| 14910 | #[repr(transparent)] | 24224 | #[repr(transparent)] |
| 14911 | #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] | 24225 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 14912 | pub struct Lck(pub u8); | 24226 | pub struct Bdcr(pub u32); |
| 14913 | impl Lck { | 24227 | impl Bdcr { |
| 14914 | #[doc = "Port configuration not locked"] | 24228 | #[doc = "LSE oscillator enabled"] |
| 14915 | pub const UNLOCKED: Self = Self(0); | 24229 | pub const fn lseon(&self) -> super::vals::Lseon { |
| 14916 | #[doc = "Port configuration locked"] | 24230 | let val = (self.0 >> 0usize) & 0x01; |
| 14917 | pub const LOCKED: Self = Self(0x01); | 24231 | super::vals::Lseon(val as u8) |
| 24232 | } | ||
| 24233 | #[doc = "LSE oscillator enabled"] | ||
| 24234 | pub fn set_lseon(&mut self, val: super::vals::Lseon) { | ||
| 24235 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 24236 | } | ||
| 24237 | #[doc = "LSE oscillator ready"] | ||
| 24238 | pub const fn lserdy(&self) -> bool { | ||
| 24239 | let val = (self.0 >> 1usize) & 0x01; | ||
| 24240 | val != 0 | ||
| 24241 | } | ||
| 24242 | #[doc = "LSE oscillator ready"] | ||
| 24243 | pub fn set_lserdy(&mut self, val: bool) { | ||
| 24244 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | ||
| 24245 | } | ||
| 24246 | #[doc = "LSE oscillator bypass"] | ||
| 24247 | pub const fn lsebyp(&self) -> super::vals::Lsebyp { | ||
| 24248 | let val = (self.0 >> 2usize) & 0x01; | ||
| 24249 | super::vals::Lsebyp(val as u8) | ||
| 24250 | } | ||
| 24251 | #[doc = "LSE oscillator bypass"] | ||
| 24252 | pub fn set_lsebyp(&mut self, val: super::vals::Lsebyp) { | ||
| 24253 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 24254 | } | ||
| 24255 | #[doc = "LSE oscillator driving capability"] | ||
| 24256 | pub const fn lsedrv(&self) -> super::vals::Lsedrv { | ||
| 24257 | let val = (self.0 >> 3usize) & 0x03; | ||
| 24258 | super::vals::Lsedrv(val as u8) | ||
| 24259 | } | ||
| 24260 | #[doc = "LSE oscillator driving capability"] | ||
| 24261 | pub fn set_lsedrv(&mut self, val: super::vals::Lsedrv) { | ||
| 24262 | self.0 = (self.0 & !(0x03 << 3usize)) | (((val.0 as u32) & 0x03) << 3usize); | ||
| 24263 | } | ||
| 24264 | #[doc = "LSE clock security system enable"] | ||
| 24265 | pub const fn lsecsson(&self) -> super::vals::Lsecsson { | ||
| 24266 | let val = (self.0 >> 5usize) & 0x01; | ||
| 24267 | super::vals::Lsecsson(val as u8) | ||
| 24268 | } | ||
| 24269 | #[doc = "LSE clock security system enable"] | ||
| 24270 | pub fn set_lsecsson(&mut self, val: super::vals::Lsecsson) { | ||
| 24271 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 24272 | } | ||
| 24273 | #[doc = "LSE clock security system failure detection"] | ||
| 24274 | pub const fn lsecssd(&self) -> bool { | ||
| 24275 | let val = (self.0 >> 6usize) & 0x01; | ||
| 24276 | val != 0 | ||
| 24277 | } | ||
| 24278 | #[doc = "LSE clock security system failure detection"] | ||
| 24279 | pub fn set_lsecssd(&mut self, val: bool) { | ||
| 24280 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 24281 | } | ||
| 24282 | #[doc = "RTC clock source selection"] | ||
| 24283 | pub const fn rtcsel(&self) -> super::vals::Rtcsel { | ||
| 24284 | let val = (self.0 >> 8usize) & 0x03; | ||
| 24285 | super::vals::Rtcsel(val as u8) | ||
| 24286 | } | ||
| 24287 | #[doc = "RTC clock source selection"] | ||
| 24288 | pub fn set_rtcsel(&mut self, val: super::vals::Rtcsel) { | ||
| 24289 | self.0 = (self.0 & !(0x03 << 8usize)) | (((val.0 as u32) & 0x03) << 8usize); | ||
| 24290 | } | ||
| 24291 | #[doc = "RTC clock enable"] | ||
| 24292 | pub const fn rtcen(&self) -> super::vals::Rtcen { | ||
| 24293 | let val = (self.0 >> 15usize) & 0x01; | ||
| 24294 | super::vals::Rtcen(val as u8) | ||
| 24295 | } | ||
| 24296 | #[doc = "RTC clock enable"] | ||
| 24297 | pub fn set_rtcen(&mut self, val: super::vals::Rtcen) { | ||
| 24298 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 24299 | } | ||
| 24300 | #[doc = "VSwitch domain software reset"] | ||
| 24301 | pub const fn bdrst(&self) -> super::vals::Bdrst { | ||
| 24302 | let val = (self.0 >> 16usize) & 0x01; | ||
| 24303 | super::vals::Bdrst(val as u8) | ||
| 24304 | } | ||
| 24305 | #[doc = "VSwitch domain software reset"] | ||
| 24306 | pub fn set_bdrst(&mut self, val: super::vals::Bdrst) { | ||
| 24307 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 24308 | } | ||
| 14918 | } | 24309 | } |
| 14919 | } | 24310 | impl Default for Bdcr { |
| 14920 | pub mod regs { | 24311 | fn default() -> Bdcr { |
| 14921 | use crate::generic::*; | 24312 | Bdcr(0) |
| 14922 | #[doc = "Port configuration lock register"] | 24313 | } |
| 24314 | } | ||
| 24315 | #[doc = "RCC APB4 Clock Register"] | ||
| 14923 | #[repr(transparent)] | 24316 | #[repr(transparent)] |
| 14924 | #[derive(Copy, Clone, Eq, PartialEq)] | 24317 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 14925 | pub struct Lckr(pub u32); | 24318 | pub struct C1Apb4enr(pub u32); |
| 14926 | impl Lckr { | 24319 | impl C1Apb4enr { |
| 14927 | #[doc = "Port A Lock bit"] | 24320 | #[doc = "SYSCFG peripheral clock enable"] |
| 14928 | pub fn lck(&self, n: usize) -> super::vals::Lck { | 24321 | pub const fn syscfgen(&self) -> super::vals::C1Apb4enrSyscfgen { |
| 14929 | assert!(n < 16usize); | 24322 | let val = (self.0 >> 1usize) & 0x01; |
| 14930 | let offs = 0usize + n * 1usize; | 24323 | super::vals::C1Apb4enrSyscfgen(val as u8) |
| 14931 | let val = (self.0 >> offs) & 0x01; | ||
| 14932 | super::vals::Lck(val as u8) | ||
| 14933 | } | 24324 | } |
| 14934 | #[doc = "Port A Lock bit"] | 24325 | #[doc = "SYSCFG peripheral clock enable"] |
| 14935 | pub fn set_lck(&mut self, n: usize, val: super::vals::Lck) { | 24326 | pub fn set_syscfgen(&mut self, val: super::vals::C1Apb4enrSyscfgen) { |
| 14936 | assert!(n < 16usize); | 24327 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); |
| 14937 | let offs = 0usize + n * 1usize; | ||
| 14938 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | ||
| 14939 | } | 24328 | } |
| 14940 | #[doc = "Lock key"] | 24329 | #[doc = "LPUART1 Peripheral Clocks Enable"] |
| 14941 | pub const fn lckk(&self) -> super::vals::Lckk { | 24330 | pub const fn lpuart1en(&self) -> super::vals::C1Apb4enrSyscfgen { |
| 24331 | let val = (self.0 >> 3usize) & 0x01; | ||
| 24332 | super::vals::C1Apb4enrSyscfgen(val as u8) | ||
| 24333 | } | ||
| 24334 | #[doc = "LPUART1 Peripheral Clocks Enable"] | ||
| 24335 | pub fn set_lpuart1en(&mut self, val: super::vals::C1Apb4enrSyscfgen) { | ||
| 24336 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); | ||
| 24337 | } | ||
| 24338 | #[doc = "SPI6 Peripheral Clocks Enable"] | ||
| 24339 | pub const fn spi6en(&self) -> super::vals::C1Apb4enrSyscfgen { | ||
| 24340 | let val = (self.0 >> 5usize) & 0x01; | ||
| 24341 | super::vals::C1Apb4enrSyscfgen(val as u8) | ||
| 24342 | } | ||
| 24343 | #[doc = "SPI6 Peripheral Clocks Enable"] | ||
| 24344 | pub fn set_spi6en(&mut self, val: super::vals::C1Apb4enrSyscfgen) { | ||
| 24345 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 24346 | } | ||
| 24347 | #[doc = "I2C4 Peripheral Clocks Enable"] | ||
| 24348 | pub const fn i2c4en(&self) -> super::vals::C1Apb4enrSyscfgen { | ||
| 24349 | let val = (self.0 >> 7usize) & 0x01; | ||
| 24350 | super::vals::C1Apb4enrSyscfgen(val as u8) | ||
| 24351 | } | ||
| 24352 | #[doc = "I2C4 Peripheral Clocks Enable"] | ||
| 24353 | pub fn set_i2c4en(&mut self, val: super::vals::C1Apb4enrSyscfgen) { | ||
| 24354 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 24355 | } | ||
| 24356 | #[doc = "LPTIM2 Peripheral Clocks Enable"] | ||
| 24357 | pub const fn lptim2en(&self) -> super::vals::C1Apb4enrSyscfgen { | ||
| 24358 | let val = (self.0 >> 9usize) & 0x01; | ||
| 24359 | super::vals::C1Apb4enrSyscfgen(val as u8) | ||
| 24360 | } | ||
| 24361 | #[doc = "LPTIM2 Peripheral Clocks Enable"] | ||
| 24362 | pub fn set_lptim2en(&mut self, val: super::vals::C1Apb4enrSyscfgen) { | ||
| 24363 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | ||
| 24364 | } | ||
| 24365 | #[doc = "LPTIM3 Peripheral Clocks Enable"] | ||
| 24366 | pub const fn lptim3en(&self) -> super::vals::C1Apb4enrSyscfgen { | ||
| 24367 | let val = (self.0 >> 10usize) & 0x01; | ||
| 24368 | super::vals::C1Apb4enrSyscfgen(val as u8) | ||
| 24369 | } | ||
| 24370 | #[doc = "LPTIM3 Peripheral Clocks Enable"] | ||
| 24371 | pub fn set_lptim3en(&mut self, val: super::vals::C1Apb4enrSyscfgen) { | ||
| 24372 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); | ||
| 24373 | } | ||
| 24374 | #[doc = "LPTIM4 Peripheral Clocks Enable"] | ||
| 24375 | pub const fn lptim4en(&self) -> super::vals::C1Apb4enrSyscfgen { | ||
| 24376 | let val = (self.0 >> 11usize) & 0x01; | ||
| 24377 | super::vals::C1Apb4enrSyscfgen(val as u8) | ||
| 24378 | } | ||
| 24379 | #[doc = "LPTIM4 Peripheral Clocks Enable"] | ||
| 24380 | pub fn set_lptim4en(&mut self, val: super::vals::C1Apb4enrSyscfgen) { | ||
| 24381 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); | ||
| 24382 | } | ||
| 24383 | #[doc = "LPTIM5 Peripheral Clocks Enable"] | ||
| 24384 | pub const fn lptim5en(&self) -> super::vals::C1Apb4enrSyscfgen { | ||
| 24385 | let val = (self.0 >> 12usize) & 0x01; | ||
| 24386 | super::vals::C1Apb4enrSyscfgen(val as u8) | ||
| 24387 | } | ||
| 24388 | #[doc = "LPTIM5 Peripheral Clocks Enable"] | ||
| 24389 | pub fn set_lptim5en(&mut self, val: super::vals::C1Apb4enrSyscfgen) { | ||
| 24390 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 24391 | } | ||
| 24392 | #[doc = "COMP1/2 peripheral clock enable"] | ||
| 24393 | pub const fn comp12en(&self) -> super::vals::C1Apb4enrSyscfgen { | ||
| 24394 | let val = (self.0 >> 14usize) & 0x01; | ||
| 24395 | super::vals::C1Apb4enrSyscfgen(val as u8) | ||
| 24396 | } | ||
| 24397 | #[doc = "COMP1/2 peripheral clock enable"] | ||
| 24398 | pub fn set_comp12en(&mut self, val: super::vals::C1Apb4enrSyscfgen) { | ||
| 24399 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | ||
| 24400 | } | ||
| 24401 | #[doc = "VREF peripheral clock enable"] | ||
| 24402 | pub const fn vrefen(&self) -> super::vals::C1Apb4enrSyscfgen { | ||
| 24403 | let val = (self.0 >> 15usize) & 0x01; | ||
| 24404 | super::vals::C1Apb4enrSyscfgen(val as u8) | ||
| 24405 | } | ||
| 24406 | #[doc = "VREF peripheral clock enable"] | ||
| 24407 | pub fn set_vrefen(&mut self, val: super::vals::C1Apb4enrSyscfgen) { | ||
| 24408 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 24409 | } | ||
| 24410 | #[doc = "RTC APB Clock Enable"] | ||
| 24411 | pub const fn rtcapben(&self) -> super::vals::C1Apb4enrSyscfgen { | ||
| 14942 | let val = (self.0 >> 16usize) & 0x01; | 24412 | let val = (self.0 >> 16usize) & 0x01; |
| 14943 | super::vals::Lckk(val as u8) | 24413 | super::vals::C1Apb4enrSyscfgen(val as u8) |
| 14944 | } | 24414 | } |
| 14945 | #[doc = "Lock key"] | 24415 | #[doc = "RTC APB Clock Enable"] |
| 14946 | pub fn set_lckk(&mut self, val: super::vals::Lckk) { | 24416 | pub fn set_rtcapben(&mut self, val: super::vals::C1Apb4enrSyscfgen) { |
| 14947 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | 24417 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); |
| 14948 | } | 24418 | } |
| 24419 | #[doc = "SAI4 Peripheral Clocks Enable"] | ||
| 24420 | pub const fn sai4en(&self) -> super::vals::C1Apb4enrSyscfgen { | ||
| 24421 | let val = (self.0 >> 21usize) & 0x01; | ||
| 24422 | super::vals::C1Apb4enrSyscfgen(val as u8) | ||
| 24423 | } | ||
| 24424 | #[doc = "SAI4 Peripheral Clocks Enable"] | ||
| 24425 | pub fn set_sai4en(&mut self, val: super::vals::C1Apb4enrSyscfgen) { | ||
| 24426 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize); | ||
| 24427 | } | ||
| 14949 | } | 24428 | } |
| 14950 | impl Default for Lckr { | 24429 | impl Default for C1Apb4enr { |
| 14951 | fn default() -> Lckr { | 24430 | fn default() -> C1Apb4enr { |
| 14952 | Lckr(0) | 24431 | C1Apb4enr(0) |
| 14953 | } | 24432 | } |
| 14954 | } | 24433 | } |
| 14955 | #[doc = "Port input data register (GPIOn_IDR)"] | 24434 | #[doc = "RCC Domain 1 Clock Configuration Register"] |
| 14956 | #[repr(transparent)] | 24435 | #[repr(transparent)] |
| 14957 | #[derive(Copy, Clone, Eq, PartialEq)] | 24436 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 14958 | pub struct Idr(pub u32); | 24437 | pub struct D1cfgr(pub u32); |
| 14959 | impl Idr { | 24438 | impl D1cfgr { |
| 14960 | #[doc = "Port input data"] | 24439 | #[doc = "D1 domain AHB prescaler"] |
| 14961 | pub fn idr(&self, n: usize) -> super::vals::Idr { | 24440 | pub const fn hpre(&self) -> super::vals::Hpre { |
| 14962 | assert!(n < 16usize); | 24441 | let val = (self.0 >> 0usize) & 0x0f; |
| 14963 | let offs = 0usize + n * 1usize; | 24442 | super::vals::Hpre(val as u8) |
| 14964 | let val = (self.0 >> offs) & 0x01; | ||
| 14965 | super::vals::Idr(val as u8) | ||
| 14966 | } | 24443 | } |
| 14967 | #[doc = "Port input data"] | 24444 | #[doc = "D1 domain AHB prescaler"] |
| 14968 | pub fn set_idr(&mut self, n: usize, val: super::vals::Idr) { | 24445 | pub fn set_hpre(&mut self, val: super::vals::Hpre) { |
| 14969 | assert!(n < 16usize); | 24446 | self.0 = (self.0 & !(0x0f << 0usize)) | (((val.0 as u32) & 0x0f) << 0usize); |
| 14970 | let offs = 0usize + n * 1usize; | 24447 | } |
| 14971 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | 24448 | #[doc = "D1 domain APB3 prescaler"] |
| 24449 | pub const fn d1ppre(&self) -> super::vals::D1ppre { | ||
| 24450 | let val = (self.0 >> 4usize) & 0x07; | ||
| 24451 | super::vals::D1ppre(val as u8) | ||
| 24452 | } | ||
| 24453 | #[doc = "D1 domain APB3 prescaler"] | ||
| 24454 | pub fn set_d1ppre(&mut self, val: super::vals::D1ppre) { | ||
| 24455 | self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize); | ||
| 24456 | } | ||
| 24457 | #[doc = "D1 domain Core prescaler"] | ||
| 24458 | pub const fn d1cpre(&self) -> super::vals::Hpre { | ||
| 24459 | let val = (self.0 >> 8usize) & 0x0f; | ||
| 24460 | super::vals::Hpre(val as u8) | ||
| 24461 | } | ||
| 24462 | #[doc = "D1 domain Core prescaler"] | ||
| 24463 | pub fn set_d1cpre(&mut self, val: super::vals::Hpre) { | ||
| 24464 | self.0 = (self.0 & !(0x0f << 8usize)) | (((val.0 as u32) & 0x0f) << 8usize); | ||
| 14972 | } | 24465 | } |
| 14973 | } | 24466 | } |
| 14974 | impl Default for Idr { | 24467 | impl Default for D1cfgr { |
| 14975 | fn default() -> Idr { | 24468 | fn default() -> D1cfgr { |
| 14976 | Idr(0) | 24469 | D1cfgr(0) |
| 14977 | } | 24470 | } |
| 14978 | } | 24471 | } |
| 14979 | #[doc = "Port bit set/reset register (GPIOn_BSRR)"] | 24472 | #[doc = "RCC AHB1 Sleep Clock Register"] |
| 14980 | #[repr(transparent)] | 24473 | #[repr(transparent)] |
| 14981 | #[derive(Copy, Clone, Eq, PartialEq)] | 24474 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 14982 | pub struct Bsrr(pub u32); | 24475 | pub struct C1Ahb1lpenr(pub u32); |
| 14983 | impl Bsrr { | 24476 | impl C1Ahb1lpenr { |
| 14984 | #[doc = "Set bit"] | 24477 | #[doc = "DMA1 Clock Enable During CSleep Mode"] |
| 14985 | pub fn bs(&self, n: usize) -> bool { | 24478 | pub const fn dma1lpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen { |
| 14986 | assert!(n < 16usize); | 24479 | let val = (self.0 >> 0usize) & 0x01; |
| 14987 | let offs = 0usize + n * 1usize; | 24480 | super::vals::C1Ahb1lpenrDma1lpen(val as u8) |
| 14988 | let val = (self.0 >> offs) & 0x01; | ||
| 14989 | val != 0 | ||
| 14990 | } | 24481 | } |
| 14991 | #[doc = "Set bit"] | 24482 | #[doc = "DMA1 Clock Enable During CSleep Mode"] |
| 14992 | pub fn set_bs(&mut self, n: usize, val: bool) { | 24483 | pub fn set_dma1lpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) { |
| 14993 | assert!(n < 16usize); | 24484 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 14994 | let offs = 0usize + n * 1usize; | ||
| 14995 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 14996 | } | 24485 | } |
| 14997 | #[doc = "Reset bit"] | 24486 | #[doc = "DMA2 Clock Enable During CSleep Mode"] |
| 14998 | pub fn br(&self, n: usize) -> bool { | 24487 | pub const fn dma2lpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen { |
| 14999 | assert!(n < 16usize); | 24488 | let val = (self.0 >> 1usize) & 0x01; |
| 15000 | let offs = 16usize + n * 1usize; | 24489 | super::vals::C1Ahb1lpenrDma1lpen(val as u8) |
| 15001 | let val = (self.0 >> offs) & 0x01; | ||
| 15002 | val != 0 | ||
| 15003 | } | 24490 | } |
| 15004 | #[doc = "Reset bit"] | 24491 | #[doc = "DMA2 Clock Enable During CSleep Mode"] |
| 15005 | pub fn set_br(&mut self, n: usize, val: bool) { | 24492 | pub fn set_dma2lpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) { |
| 15006 | assert!(n < 16usize); | 24493 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); |
| 15007 | let offs = 16usize + n * 1usize; | 24494 | } |
| 15008 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | 24495 | #[doc = "ADC1/2 Peripheral Clocks Enable During CSleep Mode"] |
| 24496 | pub const fn adc12lpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen { | ||
| 24497 | let val = (self.0 >> 5usize) & 0x01; | ||
| 24498 | super::vals::C1Ahb1lpenrDma1lpen(val as u8) | ||
| 24499 | } | ||
| 24500 | #[doc = "ADC1/2 Peripheral Clocks Enable During CSleep Mode"] | ||
| 24501 | pub fn set_adc12lpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) { | ||
| 24502 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 24503 | } | ||
| 24504 | #[doc = "Ethernet MAC bus interface Clock Enable During CSleep Mode"] | ||
| 24505 | pub const fn eth1maclpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen { | ||
| 24506 | let val = (self.0 >> 15usize) & 0x01; | ||
| 24507 | super::vals::C1Ahb1lpenrDma1lpen(val as u8) | ||
| 24508 | } | ||
| 24509 | #[doc = "Ethernet MAC bus interface Clock Enable During CSleep Mode"] | ||
| 24510 | pub fn set_eth1maclpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) { | ||
| 24511 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 24512 | } | ||
| 24513 | #[doc = "Ethernet Transmission Clock Enable During CSleep Mode"] | ||
| 24514 | pub const fn eth1txlpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen { | ||
| 24515 | let val = (self.0 >> 16usize) & 0x01; | ||
| 24516 | super::vals::C1Ahb1lpenrDma1lpen(val as u8) | ||
| 24517 | } | ||
| 24518 | #[doc = "Ethernet Transmission Clock Enable During CSleep Mode"] | ||
| 24519 | pub fn set_eth1txlpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) { | ||
| 24520 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 24521 | } | ||
| 24522 | #[doc = "Ethernet Reception Clock Enable During CSleep Mode"] | ||
| 24523 | pub const fn eth1rxlpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen { | ||
| 24524 | let val = (self.0 >> 17usize) & 0x01; | ||
| 24525 | super::vals::C1Ahb1lpenrDma1lpen(val as u8) | ||
| 24526 | } | ||
| 24527 | #[doc = "Ethernet Reception Clock Enable During CSleep Mode"] | ||
| 24528 | pub fn set_eth1rxlpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) { | ||
| 24529 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize); | ||
| 24530 | } | ||
| 24531 | #[doc = "USB1OTG peripheral clock enable during CSleep mode"] | ||
| 24532 | pub const fn usb1otglpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen { | ||
| 24533 | let val = (self.0 >> 25usize) & 0x01; | ||
| 24534 | super::vals::C1Ahb1lpenrDma1lpen(val as u8) | ||
| 24535 | } | ||
| 24536 | #[doc = "USB1OTG peripheral clock enable during CSleep mode"] | ||
| 24537 | pub fn set_usb1otglpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) { | ||
| 24538 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize); | ||
| 24539 | } | ||
| 24540 | #[doc = "USB_PHY1 clock enable during CSleep mode"] | ||
| 24541 | pub const fn usb1ulpilpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen { | ||
| 24542 | let val = (self.0 >> 26usize) & 0x01; | ||
| 24543 | super::vals::C1Ahb1lpenrDma1lpen(val as u8) | ||
| 24544 | } | ||
| 24545 | #[doc = "USB_PHY1 clock enable during CSleep mode"] | ||
| 24546 | pub fn set_usb1ulpilpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) { | ||
| 24547 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val.0 as u32) & 0x01) << 26usize); | ||
| 24548 | } | ||
| 24549 | #[doc = "USB2OTG peripheral clock enable during CSleep mode"] | ||
| 24550 | pub const fn usb2otglpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen { | ||
| 24551 | let val = (self.0 >> 27usize) & 0x01; | ||
| 24552 | super::vals::C1Ahb1lpenrDma1lpen(val as u8) | ||
| 24553 | } | ||
| 24554 | #[doc = "USB2OTG peripheral clock enable during CSleep mode"] | ||
| 24555 | pub fn set_usb2otglpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) { | ||
| 24556 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize); | ||
| 24557 | } | ||
| 24558 | #[doc = "USB_PHY2 clocks enable during CSleep mode"] | ||
| 24559 | pub const fn usb2ulpilpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen { | ||
| 24560 | let val = (self.0 >> 28usize) & 0x01; | ||
| 24561 | super::vals::C1Ahb1lpenrDma1lpen(val as u8) | ||
| 24562 | } | ||
| 24563 | #[doc = "USB_PHY2 clocks enable during CSleep mode"] | ||
| 24564 | pub fn set_usb2ulpilpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) { | ||
| 24565 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); | ||
| 15009 | } | 24566 | } |
| 15010 | } | 24567 | } |
| 15011 | impl Default for Bsrr { | 24568 | impl Default for C1Ahb1lpenr { |
| 15012 | fn default() -> Bsrr { | 24569 | fn default() -> C1Ahb1lpenr { |
| 15013 | Bsrr(0) | 24570 | C1Ahb1lpenr(0) |
| 15014 | } | 24571 | } |
| 15015 | } | 24572 | } |
| 15016 | #[doc = "Port configuration register (GPIOn_CRx)"] | 24573 | #[doc = "RCC D3 Autonomous mode Register"] |
| 15017 | #[repr(transparent)] | 24574 | #[repr(transparent)] |
| 15018 | #[derive(Copy, Clone, Eq, PartialEq)] | 24575 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 15019 | pub struct Cr(pub u32); | 24576 | pub struct D3amr(pub u32); |
| 15020 | impl Cr { | 24577 | impl D3amr { |
| 15021 | #[doc = "Port n mode bits"] | 24578 | #[doc = "BDMA and DMAMUX Autonomous mode enable"] |
| 15022 | pub fn mode(&self, n: usize) -> super::vals::Mode { | 24579 | pub const fn bdmaamen(&self) -> super::vals::Bdmaamen { |
| 15023 | assert!(n < 8usize); | 24580 | let val = (self.0 >> 0usize) & 0x01; |
| 15024 | let offs = 0usize + n * 4usize; | 24581 | super::vals::Bdmaamen(val as u8) |
| 15025 | let val = (self.0 >> offs) & 0x03; | ||
| 15026 | super::vals::Mode(val as u8) | ||
| 15027 | } | 24582 | } |
| 15028 | #[doc = "Port n mode bits"] | 24583 | #[doc = "BDMA and DMAMUX Autonomous mode enable"] |
| 15029 | pub fn set_mode(&mut self, n: usize, val: super::vals::Mode) { | 24584 | pub fn set_bdmaamen(&mut self, val: super::vals::Bdmaamen) { |
| 15030 | assert!(n < 8usize); | 24585 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); |
| 15031 | let offs = 0usize + n * 4usize; | ||
| 15032 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | ||
| 15033 | } | 24586 | } |
| 15034 | #[doc = "Port n configuration bits"] | 24587 | #[doc = "LPUART1 Autonomous mode enable"] |
| 15035 | pub fn cnf(&self, n: usize) -> super::vals::Cnf { | 24588 | pub const fn lpuart1amen(&self) -> super::vals::Bdmaamen { |
| 15036 | assert!(n < 8usize); | 24589 | let val = (self.0 >> 3usize) & 0x01; |
| 15037 | let offs = 2usize + n * 4usize; | 24590 | super::vals::Bdmaamen(val as u8) |
| 15038 | let val = (self.0 >> offs) & 0x03; | ||
| 15039 | super::vals::Cnf(val as u8) | ||
| 15040 | } | 24591 | } |
| 15041 | #[doc = "Port n configuration bits"] | 24592 | #[doc = "LPUART1 Autonomous mode enable"] |
| 15042 | pub fn set_cnf(&mut self, n: usize, val: super::vals::Cnf) { | 24593 | pub fn set_lpuart1amen(&mut self, val: super::vals::Bdmaamen) { |
| 15043 | assert!(n < 8usize); | 24594 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); |
| 15044 | let offs = 2usize + n * 4usize; | 24595 | } |
| 15045 | self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs); | 24596 | #[doc = "SPI6 Autonomous mode enable"] |
| 24597 | pub const fn spi6amen(&self) -> super::vals::Bdmaamen { | ||
| 24598 | let val = (self.0 >> 5usize) & 0x01; | ||
| 24599 | super::vals::Bdmaamen(val as u8) | ||
| 24600 | } | ||
| 24601 | #[doc = "SPI6 Autonomous mode enable"] | ||
| 24602 | pub fn set_spi6amen(&mut self, val: super::vals::Bdmaamen) { | ||
| 24603 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 24604 | } | ||
| 24605 | #[doc = "I2C4 Autonomous mode enable"] | ||
| 24606 | pub const fn i2c4amen(&self) -> super::vals::Bdmaamen { | ||
| 24607 | let val = (self.0 >> 7usize) & 0x01; | ||
| 24608 | super::vals::Bdmaamen(val as u8) | ||
| 24609 | } | ||
| 24610 | #[doc = "I2C4 Autonomous mode enable"] | ||
| 24611 | pub fn set_i2c4amen(&mut self, val: super::vals::Bdmaamen) { | ||
| 24612 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); | ||
| 24613 | } | ||
| 24614 | #[doc = "LPTIM2 Autonomous mode enable"] | ||
| 24615 | pub const fn lptim2amen(&self) -> super::vals::Bdmaamen { | ||
| 24616 | let val = (self.0 >> 9usize) & 0x01; | ||
| 24617 | super::vals::Bdmaamen(val as u8) | ||
| 24618 | } | ||
| 24619 | #[doc = "LPTIM2 Autonomous mode enable"] | ||
| 24620 | pub fn set_lptim2amen(&mut self, val: super::vals::Bdmaamen) { | ||
| 24621 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); | ||
| 24622 | } | ||
| 24623 | #[doc = "LPTIM3 Autonomous mode enable"] | ||
| 24624 | pub const fn lptim3amen(&self) -> super::vals::Bdmaamen { | ||
| 24625 | let val = (self.0 >> 10usize) & 0x01; | ||
| 24626 | super::vals::Bdmaamen(val as u8) | ||
| 24627 | } | ||
| 24628 | #[doc = "LPTIM3 Autonomous mode enable"] | ||
| 24629 | pub fn set_lptim3amen(&mut self, val: super::vals::Bdmaamen) { | ||
| 24630 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); | ||
| 24631 | } | ||
| 24632 | #[doc = "LPTIM4 Autonomous mode enable"] | ||
| 24633 | pub const fn lptim4amen(&self) -> super::vals::Bdmaamen { | ||
| 24634 | let val = (self.0 >> 11usize) & 0x01; | ||
| 24635 | super::vals::Bdmaamen(val as u8) | ||
| 24636 | } | ||
| 24637 | #[doc = "LPTIM4 Autonomous mode enable"] | ||
| 24638 | pub fn set_lptim4amen(&mut self, val: super::vals::Bdmaamen) { | ||
| 24639 | self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); | ||
| 24640 | } | ||
| 24641 | #[doc = "LPTIM5 Autonomous mode enable"] | ||
| 24642 | pub const fn lptim5amen(&self) -> super::vals::Bdmaamen { | ||
| 24643 | let val = (self.0 >> 12usize) & 0x01; | ||
| 24644 | super::vals::Bdmaamen(val as u8) | ||
| 24645 | } | ||
| 24646 | #[doc = "LPTIM5 Autonomous mode enable"] | ||
| 24647 | pub fn set_lptim5amen(&mut self, val: super::vals::Bdmaamen) { | ||
| 24648 | self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); | ||
| 24649 | } | ||
| 24650 | #[doc = "COMP12 Autonomous mode enable"] | ||
| 24651 | pub const fn comp12amen(&self) -> super::vals::Bdmaamen { | ||
| 24652 | let val = (self.0 >> 14usize) & 0x01; | ||
| 24653 | super::vals::Bdmaamen(val as u8) | ||
| 24654 | } | ||
| 24655 | #[doc = "COMP12 Autonomous mode enable"] | ||
| 24656 | pub fn set_comp12amen(&mut self, val: super::vals::Bdmaamen) { | ||
| 24657 | self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); | ||
| 24658 | } | ||
| 24659 | #[doc = "VREF Autonomous mode enable"] | ||
| 24660 | pub const fn vrefamen(&self) -> super::vals::Bdmaamen { | ||
| 24661 | let val = (self.0 >> 15usize) & 0x01; | ||
| 24662 | super::vals::Bdmaamen(val as u8) | ||
| 24663 | } | ||
| 24664 | #[doc = "VREF Autonomous mode enable"] | ||
| 24665 | pub fn set_vrefamen(&mut self, val: super::vals::Bdmaamen) { | ||
| 24666 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); | ||
| 24667 | } | ||
| 24668 | #[doc = "RTC Autonomous mode enable"] | ||
| 24669 | pub const fn rtcamen(&self) -> super::vals::Bdmaamen { | ||
| 24670 | let val = (self.0 >> 16usize) & 0x01; | ||
| 24671 | super::vals::Bdmaamen(val as u8) | ||
| 24672 | } | ||
| 24673 | #[doc = "RTC Autonomous mode enable"] | ||
| 24674 | pub fn set_rtcamen(&mut self, val: super::vals::Bdmaamen) { | ||
| 24675 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); | ||
| 24676 | } | ||
| 24677 | #[doc = "CRC Autonomous mode enable"] | ||
| 24678 | pub const fn crcamen(&self) -> super::vals::Bdmaamen { | ||
| 24679 | let val = (self.0 >> 19usize) & 0x01; | ||
| 24680 | super::vals::Bdmaamen(val as u8) | ||
| 24681 | } | ||
| 24682 | #[doc = "CRC Autonomous mode enable"] | ||
| 24683 | pub fn set_crcamen(&mut self, val: super::vals::Bdmaamen) { | ||
| 24684 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); | ||
| 24685 | } | ||
| 24686 | #[doc = "SAI4 Autonomous mode enable"] | ||
| 24687 | pub const fn sai4amen(&self) -> super::vals::Bdmaamen { | ||
| 24688 | let val = (self.0 >> 21usize) & 0x01; | ||
| 24689 | super::vals::Bdmaamen(val as u8) | ||
| 24690 | } | ||
| 24691 | #[doc = "SAI4 Autonomous mode enable"] | ||
| 24692 | pub fn set_sai4amen(&mut self, val: super::vals::Bdmaamen) { | ||
| 24693 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize); | ||
| 24694 | } | ||
| 24695 | #[doc = "ADC3 Autonomous mode enable"] | ||
| 24696 | pub const fn adc3amen(&self) -> super::vals::Bdmaamen { | ||
| 24697 | let val = (self.0 >> 24usize) & 0x01; | ||
| 24698 | super::vals::Bdmaamen(val as u8) | ||
| 24699 | } | ||
| 24700 | #[doc = "ADC3 Autonomous mode enable"] | ||
| 24701 | pub fn set_adc3amen(&mut self, val: super::vals::Bdmaamen) { | ||
| 24702 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); | ||
| 24703 | } | ||
| 24704 | #[doc = "Backup RAM Autonomous mode enable"] | ||
| 24705 | pub const fn bkpramamen(&self) -> super::vals::Bdmaamen { | ||
| 24706 | let val = (self.0 >> 28usize) & 0x01; | ||
| 24707 | super::vals::Bdmaamen(val as u8) | ||
| 24708 | } | ||
| 24709 | #[doc = "Backup RAM Autonomous mode enable"] | ||
| 24710 | pub fn set_bkpramamen(&mut self, val: super::vals::Bdmaamen) { | ||
| 24711 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); | ||
| 24712 | } | ||
| 24713 | #[doc = "SRAM4 Autonomous mode enable"] | ||
| 24714 | pub const fn sram4amen(&self) -> super::vals::Bdmaamen { | ||
| 24715 | let val = (self.0 >> 29usize) & 0x01; | ||
| 24716 | super::vals::Bdmaamen(val as u8) | ||
| 24717 | } | ||
| 24718 | #[doc = "SRAM4 Autonomous mode enable"] | ||
| 24719 | pub fn set_sram4amen(&mut self, val: super::vals::Bdmaamen) { | ||
| 24720 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); | ||
| 15046 | } | 24721 | } |
| 15047 | } | 24722 | } |
| 15048 | impl Default for Cr { | 24723 | impl Default for D3amr { |
| 15049 | fn default() -> Cr { | 24724 | fn default() -> D3amr { |
| 15050 | Cr(0) | 24725 | D3amr(0) |
| 15051 | } | 24726 | } |
| 15052 | } | 24727 | } |
| 15053 | #[doc = "Port bit reset register (GPIOn_BRR)"] | 24728 | #[doc = "RCC Clock Control and Status Register"] |
| 15054 | #[repr(transparent)] | 24729 | #[repr(transparent)] |
| 15055 | #[derive(Copy, Clone, Eq, PartialEq)] | 24730 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 15056 | pub struct Brr(pub u32); | 24731 | pub struct Csr(pub u32); |
| 15057 | impl Brr { | 24732 | impl Csr { |
| 15058 | #[doc = "Reset bit"] | 24733 | #[doc = "LSI oscillator enable"] |
| 15059 | pub fn br(&self, n: usize) -> bool { | 24734 | pub const fn lsion(&self) -> super::vals::Lsion { |
| 15060 | assert!(n < 16usize); | 24735 | let val = (self.0 >> 0usize) & 0x01; |
| 15061 | let offs = 0usize + n * 1usize; | 24736 | super::vals::Lsion(val as u8) |
| 15062 | let val = (self.0 >> offs) & 0x01; | 24737 | } |
| 24738 | #[doc = "LSI oscillator enable"] | ||
| 24739 | pub fn set_lsion(&mut self, val: super::vals::Lsion) { | ||
| 24740 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); | ||
| 24741 | } | ||
| 24742 | #[doc = "LSI oscillator ready"] | ||
| 24743 | pub const fn lsirdy(&self) -> bool { | ||
| 24744 | let val = (self.0 >> 1usize) & 0x01; | ||
| 15063 | val != 0 | 24745 | val != 0 |
| 15064 | } | 24746 | } |
| 15065 | #[doc = "Reset bit"] | 24747 | #[doc = "LSI oscillator ready"] |
| 15066 | pub fn set_br(&mut self, n: usize, val: bool) { | 24748 | pub fn set_lsirdy(&mut self, val: bool) { |
| 15067 | assert!(n < 16usize); | 24749 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 15068 | let offs = 0usize + n * 1usize; | ||
| 15069 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 15070 | } | 24750 | } |
| 15071 | } | 24751 | } |
| 15072 | impl Default for Brr { | 24752 | impl Default for Csr { |
| 15073 | fn default() -> Brr { | 24753 | fn default() -> Csr { |
| 15074 | Brr(0) | 24754 | Csr(0) |
| 15075 | } | 24755 | } |
| 15076 | } | 24756 | } |
| 15077 | #[doc = "Port output data register (GPIOn_ODR)"] | 24757 | #[doc = "RCC APB1 Clock Register"] |
| 15078 | #[repr(transparent)] | 24758 | #[repr(transparent)] |
| 15079 | #[derive(Copy, Clone, Eq, PartialEq)] | 24759 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 15080 | pub struct Odr(pub u32); | 24760 | pub struct Apb1henr(pub u32); |
| 15081 | impl Odr { | 24761 | impl Apb1henr { |
| 15082 | #[doc = "Port output data"] | 24762 | #[doc = "Clock Recovery System peripheral clock enable"] |
| 15083 | pub fn odr(&self, n: usize) -> super::vals::Odr { | 24763 | pub const fn crsen(&self) -> super::vals::Apb1henrCrsen { |
| 15084 | assert!(n < 16usize); | 24764 | let val = (self.0 >> 1usize) & 0x01; |
| 15085 | let offs = 0usize + n * 1usize; | 24765 | super::vals::Apb1henrCrsen(val as u8) |
| 15086 | let val = (self.0 >> offs) & 0x01; | ||
| 15087 | super::vals::Odr(val as u8) | ||
| 15088 | } | 24766 | } |
| 15089 | #[doc = "Port output data"] | 24767 | #[doc = "Clock Recovery System peripheral clock enable"] |
| 15090 | pub fn set_odr(&mut self, n: usize, val: super::vals::Odr) { | 24768 | pub fn set_crsen(&mut self, val: super::vals::Apb1henrCrsen) { |
| 15091 | assert!(n < 16usize); | 24769 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); |
| 15092 | let offs = 0usize + n * 1usize; | 24770 | } |
| 15093 | self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); | 24771 | #[doc = "SWPMI Peripheral Clocks Enable"] |
| 24772 | pub const fn swpen(&self) -> super::vals::Apb1henrCrsen { | ||
| 24773 | let val = (self.0 >> 2usize) & 0x01; | ||
| 24774 | super::vals::Apb1henrCrsen(val as u8) | ||
| 24775 | } | ||
| 24776 | #[doc = "SWPMI Peripheral Clocks Enable"] | ||
| 24777 | pub fn set_swpen(&mut self, val: super::vals::Apb1henrCrsen) { | ||
| 24778 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); | ||
| 24779 | } | ||
| 24780 | #[doc = "OPAMP peripheral clock enable"] | ||
| 24781 | pub const fn opampen(&self) -> super::vals::Apb1henrCrsen { | ||
| 24782 | let val = (self.0 >> 4usize) & 0x01; | ||
| 24783 | super::vals::Apb1henrCrsen(val as u8) | ||
| 24784 | } | ||
| 24785 | #[doc = "OPAMP peripheral clock enable"] | ||
| 24786 | pub fn set_opampen(&mut self, val: super::vals::Apb1henrCrsen) { | ||
| 24787 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); | ||
| 24788 | } | ||
| 24789 | #[doc = "MDIOS peripheral clock enable"] | ||
| 24790 | pub const fn mdiosen(&self) -> super::vals::Apb1henrCrsen { | ||
| 24791 | let val = (self.0 >> 5usize) & 0x01; | ||
| 24792 | super::vals::Apb1henrCrsen(val as u8) | ||
| 24793 | } | ||
| 24794 | #[doc = "MDIOS peripheral clock enable"] | ||
| 24795 | pub fn set_mdiosen(&mut self, val: super::vals::Apb1henrCrsen) { | ||
| 24796 | self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); | ||
| 24797 | } | ||
| 24798 | #[doc = "FDCAN Peripheral Clocks Enable"] | ||
| 24799 | pub const fn fdcanen(&self) -> super::vals::Apb1henrCrsen { | ||
| 24800 | let val = (self.0 >> 8usize) & 0x01; | ||
| 24801 | super::vals::Apb1henrCrsen(val as u8) | ||
| 24802 | } | ||
| 24803 | #[doc = "FDCAN Peripheral Clocks Enable"] | ||
| 24804 | pub fn set_fdcanen(&mut self, val: super::vals::Apb1henrCrsen) { | ||
| 24805 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); | ||
| 15094 | } | 24806 | } |
| 15095 | } | 24807 | } |
| 15096 | impl Default for Odr { | 24808 | impl Default for Apb1henr { |
| 15097 | fn default() -> Odr { | 24809 | fn default() -> Apb1henr { |
| 15098 | Odr(0) | 24810 | Apb1henr(0) |
| 15099 | } | 24811 | } |
| 15100 | } | 24812 | } |
| 15101 | } | 24813 | } |
| 15102 | } | 24814 | } |
| 15103 | pub mod syscfg_l4 { | 24815 | pub mod flash_h7 { |
| 15104 | use crate::generic::*; | 24816 | use crate::generic::*; |
| 15105 | #[doc = "System configuration controller"] | 24817 | #[doc = "Flash"] |
| 15106 | #[derive(Copy, Clone)] | 24818 | #[derive(Copy, Clone)] |
| 15107 | pub struct Syscfg(pub *mut u8); | 24819 | pub struct Flash(pub *mut u8); |
| 15108 | unsafe impl Send for Syscfg {} | 24820 | unsafe impl Send for Flash {} |
| 15109 | unsafe impl Sync for Syscfg {} | 24821 | unsafe impl Sync for Flash {} |
| 15110 | impl Syscfg { | 24822 | impl Flash { |
| 15111 | #[doc = "memory remap register"] | 24823 | #[doc = "Access control register"] |
| 15112 | pub fn memrmp(self) -> Reg<regs::Memrmp, RW> { | 24824 | pub fn acr(self) -> Reg<regs::Acr, RW> { |
| 15113 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | 24825 | unsafe { Reg::from_ptr(self.0.add(0usize)) } |
| 15114 | } | 24826 | } |
| 15115 | #[doc = "configuration register 1"] | 24827 | #[doc = "Cluster BANK%s, containing KEYR?, CR?, SR?, CCR?, PRAR_CUR?, PRAR_PRG?, SCAR_CUR?, SCAR_PRG?, WPSN_CUR?R, WPSN_PRG?R, CRCCR?, CRCSADD?R, CRCEADD?R, ECC_FA?R"] |
| 15116 | pub fn cfgr1(self) -> Reg<regs::Cfgr1, RW> { | 24828 | pub fn bank(self, n: usize) -> Bank { |
| 15117 | unsafe { Reg::from_ptr(self.0.add(4usize)) } | 24829 | assert!(n < 2usize); |
| 24830 | unsafe { Bank(self.0.add(4usize + n * 256usize)) } | ||
| 15118 | } | 24831 | } |
| 15119 | #[doc = "external interrupt configuration register 1"] | 24832 | #[doc = "FLASH option key register"] |
| 15120 | pub fn exticr(self, n: usize) -> Reg<regs::Exticr, RW> { | 24833 | pub fn optkeyr(self) -> Reg<regs::Optkeyr, RW> { |
| 15121 | assert!(n < 4usize); | 24834 | unsafe { Reg::from_ptr(self.0.add(8usize)) } |
| 15122 | unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) } | ||
| 15123 | } | 24835 | } |
| 15124 | #[doc = "SCSR"] | 24836 | #[doc = "FLASH option control register"] |
| 15125 | pub fn scsr(self) -> Reg<regs::Scsr, RW> { | 24837 | pub fn optcr(self) -> Reg<regs::Optcr, RW> { |
| 15126 | unsafe { Reg::from_ptr(self.0.add(24usize)) } | 24838 | unsafe { Reg::from_ptr(self.0.add(24usize)) } |
| 15127 | } | 24839 | } |
| 15128 | #[doc = "CFGR2"] | 24840 | #[doc = "FLASH option status register"] |
| 15129 | pub fn cfgr2(self) -> Reg<regs::Cfgr2, RW> { | 24841 | pub fn optsr_cur(self) -> Reg<regs::OptsrCur, RW> { |
| 15130 | unsafe { Reg::from_ptr(self.0.add(28usize)) } | 24842 | unsafe { Reg::from_ptr(self.0.add(28usize)) } |
| 15131 | } | 24843 | } |
| 15132 | #[doc = "SWPR"] | 24844 | #[doc = "FLASH option status register"] |
| 15133 | pub fn swpr(self) -> Reg<regs::Swpr, W> { | 24845 | pub fn optsr_prg(self) -> Reg<regs::OptsrPrg, RW> { |
| 15134 | unsafe { Reg::from_ptr(self.0.add(32usize)) } | 24846 | unsafe { Reg::from_ptr(self.0.add(32usize)) } |
| 15135 | } | 24847 | } |
| 15136 | #[doc = "SKR"] | 24848 | #[doc = "FLASH option clear control register"] |
| 15137 | pub fn skr(self) -> Reg<regs::Skr, W> { | 24849 | pub fn optccr(self) -> Reg<regs::Optccr, W> { |
| 15138 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | 24850 | unsafe { Reg::from_ptr(self.0.add(36usize)) } |
| 15139 | } | 24851 | } |
| 24852 | #[doc = "FLASH register with boot address"] | ||
| 24853 | pub fn boot_curr(self) -> Reg<regs::BootCurr, R> { | ||
| 24854 | unsafe { Reg::from_ptr(self.0.add(64usize)) } | ||
| 24855 | } | ||
| 24856 | #[doc = "FLASH register with boot address"] | ||
| 24857 | pub fn boot_prgr(self) -> Reg<regs::BootPrgr, RW> { | ||
| 24858 | unsafe { Reg::from_ptr(self.0.add(68usize)) } | ||
| 24859 | } | ||
| 24860 | #[doc = "FLASH CRC data register"] | ||
| 24861 | pub fn crcdatar(self) -> Reg<regs::Crcdatar, RW> { | ||
| 24862 | unsafe { Reg::from_ptr(self.0.add(92usize)) } | ||
| 24863 | } | ||
| 24864 | } | ||
| 24865 | #[doc = "Cluster BANK%s, containing KEYR?, CR?, SR?, CCR?, PRAR_CUR?, PRAR_PRG?, SCAR_CUR?, SCAR_PRG?, WPSN_CUR?R, WPSN_PRG?R, CRCCR?, CRCSADD?R, CRCEADD?R, ECC_FA?R"] | ||
| 24866 | #[derive(Copy, Clone)] | ||
| 24867 | pub struct Bank(pub *mut u8); | ||
| 24868 | unsafe impl Send for Bank {} | ||
| 24869 | unsafe impl Sync for Bank {} | ||
| 24870 | impl Bank { | ||
| 24871 | #[doc = "FLASH key register for bank 1"] | ||
| 24872 | pub fn keyr(self) -> Reg<regs::Keyr, W> { | ||
| 24873 | unsafe { Reg::from_ptr(self.0.add(0usize)) } | ||
| 24874 | } | ||
| 24875 | #[doc = "FLASH control register for bank 1"] | ||
| 24876 | pub fn cr(self) -> Reg<regs::Cr, RW> { | ||
| 24877 | unsafe { Reg::from_ptr(self.0.add(8usize)) } | ||
| 24878 | } | ||
| 24879 | #[doc = "FLASH status register for bank 1"] | ||
| 24880 | pub fn sr(self) -> Reg<regs::Sr, RW> { | ||
| 24881 | unsafe { Reg::from_ptr(self.0.add(12usize)) } | ||
| 24882 | } | ||
| 24883 | #[doc = "FLASH clear control register for bank 1"] | ||
| 24884 | pub fn ccr(self) -> Reg<regs::Ccr, RW> { | ||
| 24885 | unsafe { Reg::from_ptr(self.0.add(16usize)) } | ||
| 24886 | } | ||
| 24887 | #[doc = "FLASH protection address for bank 1"] | ||
| 24888 | pub fn prar_cur(self) -> Reg<regs::PrarCur, R> { | ||
| 24889 | unsafe { Reg::from_ptr(self.0.add(36usize)) } | ||
| 24890 | } | ||
| 24891 | #[doc = "FLASH protection address for bank 1"] | ||
| 24892 | pub fn prar_prg(self) -> Reg<regs::PrarPrg, RW> { | ||
| 24893 | unsafe { Reg::from_ptr(self.0.add(40usize)) } | ||
| 24894 | } | ||
| 24895 | #[doc = "FLASH secure address for bank 1"] | ||
| 24896 | pub fn scar_cur(self) -> Reg<regs::ScarCur, RW> { | ||
| 24897 | unsafe { Reg::from_ptr(self.0.add(44usize)) } | ||
| 24898 | } | ||
| 24899 | #[doc = "FLASH secure address for bank 1"] | ||
| 24900 | pub fn scar_prg(self) -> Reg<regs::ScarPrg, RW> { | ||
| 24901 | unsafe { Reg::from_ptr(self.0.add(48usize)) } | ||
| 24902 | } | ||
| 24903 | #[doc = "FLASH write sector protection for bank 1"] | ||
| 24904 | pub fn wpsn_curr(self) -> Reg<regs::WpsnCurr, R> { | ||
| 24905 | unsafe { Reg::from_ptr(self.0.add(52usize)) } | ||
| 24906 | } | ||
| 24907 | #[doc = "FLASH write sector protection for bank 1"] | ||
| 24908 | pub fn wpsn_prgr(self) -> Reg<regs::WpsnPrgr, RW> { | ||
| 24909 | unsafe { Reg::from_ptr(self.0.add(56usize)) } | ||
| 24910 | } | ||
| 24911 | #[doc = "FLASH CRC control register for bank 1"] | ||
| 24912 | pub fn crccr(self) -> Reg<regs::Crccr, RW> { | ||
| 24913 | unsafe { Reg::from_ptr(self.0.add(76usize)) } | ||
| 24914 | } | ||
| 24915 | #[doc = "FLASH CRC start address register for bank 1"] | ||
| 24916 | pub fn crcsaddr(self) -> Reg<regs::Crcsaddr, RW> { | ||
| 24917 | unsafe { Reg::from_ptr(self.0.add(80usize)) } | ||
| 24918 | } | ||
| 24919 | #[doc = "FLASH CRC end address register for bank 1"] | ||
| 24920 | pub fn crceaddr(self) -> Reg<regs::Crceaddr, RW> { | ||
| 24921 | unsafe { Reg::from_ptr(self.0.add(84usize)) } | ||
| 24922 | } | ||
| 24923 | #[doc = "FLASH ECC fail address for bank 1"] | ||
| 24924 | pub fn far(self) -> Reg<regs::Far, R> { | ||
| 24925 | unsafe { Reg::from_ptr(self.0.add(92usize)) } | ||
| 24926 | } | ||
| 15140 | } | 24927 | } |
| 15141 | pub mod regs { | 24928 | pub mod regs { |
| 15142 | use crate::generic::*; | 24929 | use crate::generic::*; |
| 15143 | #[doc = "CFGR2"] | 24930 | #[doc = "FLASH option clear control register"] |
| 15144 | #[repr(transparent)] | 24931 | #[repr(transparent)] |
| 15145 | #[derive(Copy, Clone, Eq, PartialEq)] | 24932 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 15146 | pub struct Cfgr2(pub u32); | 24933 | pub struct Optccr(pub u32); |
| 15147 | impl Cfgr2 { | 24934 | impl Optccr { |
| 15148 | #[doc = "Cortex LOCKUP (Hardfault) output enable bit"] | 24935 | #[doc = "OPTCHANGEERR reset bit"] |
| 15149 | pub const fn cll(&self) -> bool { | 24936 | pub const fn clr_optchangeerr(&self) -> bool { |
| 24937 | let val = (self.0 >> 30usize) & 0x01; | ||
| 24938 | val != 0 | ||
| 24939 | } | ||
| 24940 | #[doc = "OPTCHANGEERR reset bit"] | ||
| 24941 | pub fn set_clr_optchangeerr(&mut self, val: bool) { | ||
| 24942 | self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize); | ||
| 24943 | } | ||
| 24944 | } | ||
| 24945 | impl Default for Optccr { | ||
| 24946 | fn default() -> Optccr { | ||
| 24947 | Optccr(0) | ||
| 24948 | } | ||
| 24949 | } | ||
| 24950 | #[doc = "Access control register"] | ||
| 24951 | #[repr(transparent)] | ||
| 24952 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 24953 | pub struct Acr(pub u32); | ||
| 24954 | impl Acr { | ||
| 24955 | #[doc = "Read latency"] | ||
| 24956 | pub const fn latency(&self) -> u8 { | ||
| 24957 | let val = (self.0 >> 0usize) & 0x07; | ||
| 24958 | val as u8 | ||
| 24959 | } | ||
| 24960 | #[doc = "Read latency"] | ||
| 24961 | pub fn set_latency(&mut self, val: u8) { | ||
| 24962 | self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize); | ||
| 24963 | } | ||
| 24964 | #[doc = "Flash signal delay"] | ||
| 24965 | pub const fn wrhighfreq(&self) -> u8 { | ||
| 24966 | let val = (self.0 >> 4usize) & 0x03; | ||
| 24967 | val as u8 | ||
| 24968 | } | ||
| 24969 | #[doc = "Flash signal delay"] | ||
| 24970 | pub fn set_wrhighfreq(&mut self, val: u8) { | ||
| 24971 | self.0 = (self.0 & !(0x03 << 4usize)) | (((val as u32) & 0x03) << 4usize); | ||
| 24972 | } | ||
| 24973 | } | ||
| 24974 | impl Default for Acr { | ||
| 24975 | fn default() -> Acr { | ||
| 24976 | Acr(0) | ||
| 24977 | } | ||
| 24978 | } | ||
| 24979 | #[doc = "FLASH register with boot address"] | ||
| 24980 | #[repr(transparent)] | ||
| 24981 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 24982 | pub struct BootCurr(pub u32); | ||
| 24983 | impl BootCurr { | ||
| 24984 | #[doc = "Boot address 0"] | ||
| 24985 | pub const fn boot_add0(&self) -> u16 { | ||
| 24986 | let val = (self.0 >> 0usize) & 0xffff; | ||
| 24987 | val as u16 | ||
| 24988 | } | ||
| 24989 | #[doc = "Boot address 0"] | ||
| 24990 | pub fn set_boot_add0(&mut self, val: u16) { | ||
| 24991 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 24992 | } | ||
| 24993 | #[doc = "Boot address 1"] | ||
| 24994 | pub const fn boot_add1(&self) -> u16 { | ||
| 24995 | let val = (self.0 >> 16usize) & 0xffff; | ||
| 24996 | val as u16 | ||
| 24997 | } | ||
| 24998 | #[doc = "Boot address 1"] | ||
| 24999 | pub fn set_boot_add1(&mut self, val: u16) { | ||
| 25000 | self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize); | ||
| 25001 | } | ||
| 25002 | } | ||
| 25003 | impl Default for BootCurr { | ||
| 25004 | fn default() -> BootCurr { | ||
| 25005 | BootCurr(0) | ||
| 25006 | } | ||
| 25007 | } | ||
| 25008 | #[doc = "FLASH status register for bank 1"] | ||
| 25009 | #[repr(transparent)] | ||
| 25010 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 25011 | pub struct Sr(pub u32); | ||
| 25012 | impl Sr { | ||
| 25013 | #[doc = "Bank 1 ongoing program flag"] | ||
| 25014 | pub const fn bsy(&self) -> bool { | ||
| 15150 | let val = (self.0 >> 0usize) & 0x01; | 25015 | let val = (self.0 >> 0usize) & 0x01; |
| 15151 | val != 0 | 25016 | val != 0 |
| 15152 | } | 25017 | } |
| 15153 | #[doc = "Cortex LOCKUP (Hardfault) output enable bit"] | 25018 | #[doc = "Bank 1 ongoing program flag"] |
| 15154 | pub fn set_cll(&mut self, val: bool) { | 25019 | pub fn set_bsy(&mut self, val: bool) { |
| 15155 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 25020 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 15156 | } | 25021 | } |
| 15157 | #[doc = "SRAM2 parity lock bit"] | 25022 | #[doc = "Bank 1 write buffer not empty flag"] |
| 15158 | pub const fn spl(&self) -> bool { | 25023 | pub const fn wbne(&self) -> bool { |
| 15159 | let val = (self.0 >> 1usize) & 0x01; | 25024 | let val = (self.0 >> 1usize) & 0x01; |
| 15160 | val != 0 | 25025 | val != 0 |
| 15161 | } | 25026 | } |
| 15162 | #[doc = "SRAM2 parity lock bit"] | 25027 | #[doc = "Bank 1 write buffer not empty flag"] |
| 15163 | pub fn set_spl(&mut self, val: bool) { | 25028 | pub fn set_wbne(&mut self, val: bool) { |
| 15164 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 25029 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 15165 | } | 25030 | } |
| 15166 | #[doc = "PVD lock enable bit"] | 25031 | #[doc = "Bank 1 wait queue flag"] |
| 15167 | pub const fn pvdl(&self) -> bool { | 25032 | pub const fn qw(&self) -> bool { |
| 15168 | let val = (self.0 >> 2usize) & 0x01; | 25033 | let val = (self.0 >> 2usize) & 0x01; |
| 15169 | val != 0 | 25034 | val != 0 |
| 15170 | } | 25035 | } |
| 15171 | #[doc = "PVD lock enable bit"] | 25036 | #[doc = "Bank 1 wait queue flag"] |
| 15172 | pub fn set_pvdl(&mut self, val: bool) { | 25037 | pub fn set_qw(&mut self, val: bool) { |
| 15173 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | 25038 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); |
| 15174 | } | 25039 | } |
| 15175 | #[doc = "ECC Lock"] | 25040 | #[doc = "Bank 1 CRC busy flag"] |
| 15176 | pub const fn eccl(&self) -> bool { | 25041 | pub const fn crc_busy(&self) -> bool { |
| 15177 | let val = (self.0 >> 3usize) & 0x01; | 25042 | let val = (self.0 >> 3usize) & 0x01; |
| 15178 | val != 0 | 25043 | val != 0 |
| 15179 | } | 25044 | } |
| 15180 | #[doc = "ECC Lock"] | 25045 | #[doc = "Bank 1 CRC busy flag"] |
| 15181 | pub fn set_eccl(&mut self, val: bool) { | 25046 | pub fn set_crc_busy(&mut self, val: bool) { |
| 15182 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 25047 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); |
| 15183 | } | 25048 | } |
| 15184 | #[doc = "SRAM2 parity error flag"] | 25049 | #[doc = "Bank 1 end-of-program flag"] |
| 15185 | pub const fn spf(&self) -> bool { | 25050 | pub const fn eop(&self) -> bool { |
| 15186 | let val = (self.0 >> 8usize) & 0x01; | 25051 | let val = (self.0 >> 16usize) & 0x01; |
| 15187 | val != 0 | 25052 | val != 0 |
| 15188 | } | 25053 | } |
| 15189 | #[doc = "SRAM2 parity error flag"] | 25054 | #[doc = "Bank 1 end-of-program flag"] |
| 15190 | pub fn set_spf(&mut self, val: bool) { | 25055 | pub fn set_eop(&mut self, val: bool) { |
| 15191 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 25056 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); |
| 25057 | } | ||
| 25058 | #[doc = "Bank 1 write protection error flag"] | ||
| 25059 | pub const fn wrperr(&self) -> bool { | ||
| 25060 | let val = (self.0 >> 17usize) & 0x01; | ||
| 25061 | val != 0 | ||
| 25062 | } | ||
| 25063 | #[doc = "Bank 1 write protection error flag"] | ||
| 25064 | pub fn set_wrperr(&mut self, val: bool) { | ||
| 25065 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); | ||
| 25066 | } | ||
| 25067 | #[doc = "Bank 1 programming sequence error flag"] | ||
| 25068 | pub const fn pgserr(&self) -> bool { | ||
| 25069 | let val = (self.0 >> 18usize) & 0x01; | ||
| 25070 | val != 0 | ||
| 25071 | } | ||
| 25072 | #[doc = "Bank 1 programming sequence error flag"] | ||
| 25073 | pub fn set_pgserr(&mut self, val: bool) { | ||
| 25074 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); | ||
| 25075 | } | ||
| 25076 | #[doc = "Bank 1 strobe error flag"] | ||
| 25077 | pub const fn strberr(&self) -> bool { | ||
| 25078 | let val = (self.0 >> 19usize) & 0x01; | ||
| 25079 | val != 0 | ||
| 25080 | } | ||
| 25081 | #[doc = "Bank 1 strobe error flag"] | ||
| 25082 | pub fn set_strberr(&mut self, val: bool) { | ||
| 25083 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); | ||
| 25084 | } | ||
| 25085 | #[doc = "Bank 1 inconsistency error flag"] | ||
| 25086 | pub const fn incerr(&self) -> bool { | ||
| 25087 | let val = (self.0 >> 21usize) & 0x01; | ||
| 25088 | val != 0 | ||
| 25089 | } | ||
| 25090 | #[doc = "Bank 1 inconsistency error flag"] | ||
| 25091 | pub fn set_incerr(&mut self, val: bool) { | ||
| 25092 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); | ||
| 25093 | } | ||
| 25094 | #[doc = "Bank 1 write/erase error flag"] | ||
| 25095 | pub const fn operr(&self) -> bool { | ||
| 25096 | let val = (self.0 >> 22usize) & 0x01; | ||
| 25097 | val != 0 | ||
| 25098 | } | ||
| 25099 | #[doc = "Bank 1 write/erase error flag"] | ||
| 25100 | pub fn set_operr(&mut self, val: bool) { | ||
| 25101 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); | ||
| 25102 | } | ||
| 25103 | #[doc = "Bank 1 read protection error flag"] | ||
| 25104 | pub const fn rdperr(&self) -> bool { | ||
| 25105 | let val = (self.0 >> 23usize) & 0x01; | ||
| 25106 | val != 0 | ||
| 25107 | } | ||
| 25108 | #[doc = "Bank 1 read protection error flag"] | ||
| 25109 | pub fn set_rdperr(&mut self, val: bool) { | ||
| 25110 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); | ||
| 25111 | } | ||
| 25112 | #[doc = "Bank 1 secure error flag"] | ||
| 25113 | pub const fn rdserr(&self) -> bool { | ||
| 25114 | let val = (self.0 >> 24usize) & 0x01; | ||
| 25115 | val != 0 | ||
| 25116 | } | ||
| 25117 | #[doc = "Bank 1 secure error flag"] | ||
| 25118 | pub fn set_rdserr(&mut self, val: bool) { | ||
| 25119 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize); | ||
| 25120 | } | ||
| 25121 | #[doc = "Bank 1 single correction error flag"] | ||
| 25122 | pub const fn sneccerr1(&self) -> bool { | ||
| 25123 | let val = (self.0 >> 25usize) & 0x01; | ||
| 25124 | val != 0 | ||
| 25125 | } | ||
| 25126 | #[doc = "Bank 1 single correction error flag"] | ||
| 25127 | pub fn set_sneccerr1(&mut self, val: bool) { | ||
| 25128 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize); | ||
| 25129 | } | ||
| 25130 | #[doc = "Bank 1 ECC double detection error flag"] | ||
| 25131 | pub const fn dbeccerr(&self) -> bool { | ||
| 25132 | let val = (self.0 >> 26usize) & 0x01; | ||
| 25133 | val != 0 | ||
| 25134 | } | ||
| 25135 | #[doc = "Bank 1 ECC double detection error flag"] | ||
| 25136 | pub fn set_dbeccerr(&mut self, val: bool) { | ||
| 25137 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); | ||
| 25138 | } | ||
| 25139 | #[doc = "Bank 1 CRC-complete flag"] | ||
| 25140 | pub const fn crcend(&self) -> bool { | ||
| 25141 | let val = (self.0 >> 27usize) & 0x01; | ||
| 25142 | val != 0 | ||
| 25143 | } | ||
| 25144 | #[doc = "Bank 1 CRC-complete flag"] | ||
| 25145 | pub fn set_crcend(&mut self, val: bool) { | ||
| 25146 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize); | ||
| 15192 | } | 25147 | } |
| 15193 | } | 25148 | } |
| 15194 | impl Default for Cfgr2 { | 25149 | impl Default for Sr { |
| 15195 | fn default() -> Cfgr2 { | 25150 | fn default() -> Sr { |
| 15196 | Cfgr2(0) | 25151 | Sr(0) |
| 15197 | } | 25152 | } |
| 15198 | } | 25153 | } |
| 15199 | #[doc = "SKR"] | 25154 | #[doc = "FLASH CRC data register"] |
| 15200 | #[repr(transparent)] | 25155 | #[repr(transparent)] |
| 15201 | #[derive(Copy, Clone, Eq, PartialEq)] | 25156 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 15202 | pub struct Skr(pub u32); | 25157 | pub struct Crcdatar(pub u32); |
| 15203 | impl Skr { | 25158 | impl Crcdatar { |
| 15204 | #[doc = "SRAM2 write protection key for software erase"] | 25159 | #[doc = "CRC result"] |
| 15205 | pub const fn key(&self) -> u8 { | 25160 | pub const fn crc_data(&self) -> u32 { |
| 15206 | let val = (self.0 >> 0usize) & 0xff; | 25161 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 15207 | val as u8 | 25162 | val as u32 |
| 15208 | } | 25163 | } |
| 15209 | #[doc = "SRAM2 write protection key for software erase"] | 25164 | #[doc = "CRC result"] |
| 15210 | pub fn set_key(&mut self, val: u8) { | 25165 | pub fn set_crc_data(&mut self, val: u32) { |
| 15211 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | 25166 | self.0 = |
| 25167 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 15212 | } | 25168 | } |
| 15213 | } | 25169 | } |
| 15214 | impl Default for Skr { | 25170 | impl Default for Crcdatar { |
| 15215 | fn default() -> Skr { | 25171 | fn default() -> Crcdatar { |
| 15216 | Skr(0) | 25172 | Crcdatar(0) |
| 15217 | } | 25173 | } |
| 15218 | } | 25174 | } |
| 15219 | #[doc = "configuration register 1"] | 25175 | #[doc = "FLASH option status register"] |
| 15220 | #[repr(transparent)] | 25176 | #[repr(transparent)] |
| 15221 | #[derive(Copy, Clone, Eq, PartialEq)] | 25177 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 15222 | pub struct Cfgr1(pub u32); | 25178 | pub struct OptsrCur(pub u32); |
| 15223 | impl Cfgr1 { | 25179 | impl OptsrCur { |
| 15224 | #[doc = "Firewall disable"] | 25180 | #[doc = "Option byte change ongoing flag"] |
| 15225 | pub const fn fwdis(&self) -> bool { | 25181 | pub const fn opt_busy(&self) -> bool { |
| 15226 | let val = (self.0 >> 0usize) & 0x01; | 25182 | let val = (self.0 >> 0usize) & 0x01; |
| 15227 | val != 0 | 25183 | val != 0 |
| 15228 | } | 25184 | } |
| 15229 | #[doc = "Firewall disable"] | 25185 | #[doc = "Option byte change ongoing flag"] |
| 15230 | pub fn set_fwdis(&mut self, val: bool) { | 25186 | pub fn set_opt_busy(&mut self, val: bool) { |
| 15231 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 25187 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 15232 | } | 25188 | } |
| 15233 | #[doc = "I/O analog switch voltage booster enable"] | 25189 | #[doc = "Brownout level option status bit"] |
| 15234 | pub const fn boosten(&self) -> bool { | 25190 | pub const fn bor_lev(&self) -> u8 { |
| 15235 | let val = (self.0 >> 8usize) & 0x01; | 25191 | let val = (self.0 >> 2usize) & 0x03; |
| 25192 | val as u8 | ||
| 25193 | } | ||
| 25194 | #[doc = "Brownout level option status bit"] | ||
| 25195 | pub fn set_bor_lev(&mut self, val: u8) { | ||
| 25196 | self.0 = (self.0 & !(0x03 << 2usize)) | (((val as u32) & 0x03) << 2usize); | ||
| 25197 | } | ||
| 25198 | #[doc = "IWDG1 control option status bit"] | ||
| 25199 | pub const fn iwdg1_hw(&self) -> bool { | ||
| 25200 | let val = (self.0 >> 4usize) & 0x01; | ||
| 15236 | val != 0 | 25201 | val != 0 |
| 15237 | } | 25202 | } |
| 15238 | #[doc = "I/O analog switch voltage booster enable"] | 25203 | #[doc = "IWDG1 control option status bit"] |
| 15239 | pub fn set_boosten(&mut self, val: bool) { | 25204 | pub fn set_iwdg1_hw(&mut self, val: bool) { |
| 15240 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 25205 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); |
| 15241 | } | 25206 | } |
| 15242 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB6"] | 25207 | #[doc = "D1 DStop entry reset option status bit"] |
| 15243 | pub const fn i2c_pb6_fmp(&self) -> bool { | 25208 | pub const fn n_rst_stop_d1(&self) -> bool { |
| 15244 | let val = (self.0 >> 16usize) & 0x01; | 25209 | let val = (self.0 >> 6usize) & 0x01; |
| 15245 | val != 0 | 25210 | val != 0 |
| 15246 | } | 25211 | } |
| 15247 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB6"] | 25212 | #[doc = "D1 DStop entry reset option status bit"] |
| 15248 | pub fn set_i2c_pb6_fmp(&mut self, val: bool) { | 25213 | pub fn set_n_rst_stop_d1(&mut self, val: bool) { |
| 15249 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | 25214 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); |
| 15250 | } | 25215 | } |
| 15251 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB7"] | 25216 | #[doc = "D1 DStandby entry reset option status bit"] |
| 15252 | pub const fn i2c_pb7_fmp(&self) -> bool { | 25217 | pub const fn n_rst_stby_d1(&self) -> bool { |
| 25218 | let val = (self.0 >> 7usize) & 0x01; | ||
| 25219 | val != 0 | ||
| 25220 | } | ||
| 25221 | #[doc = "D1 DStandby entry reset option status bit"] | ||
| 25222 | pub fn set_n_rst_stby_d1(&mut self, val: bool) { | ||
| 25223 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 25224 | } | ||
| 25225 | #[doc = "Readout protection level option status byte"] | ||
| 25226 | pub const fn rdp(&self) -> u8 { | ||
| 25227 | let val = (self.0 >> 8usize) & 0xff; | ||
| 25228 | val as u8 | ||
| 25229 | } | ||
| 25230 | #[doc = "Readout protection level option status byte"] | ||
| 25231 | pub fn set_rdp(&mut self, val: u8) { | ||
| 25232 | self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize); | ||
| 25233 | } | ||
| 25234 | #[doc = "IWDG Stop mode freeze option status bit"] | ||
| 25235 | pub const fn fz_iwdg_stop(&self) -> bool { | ||
| 15253 | let val = (self.0 >> 17usize) & 0x01; | 25236 | let val = (self.0 >> 17usize) & 0x01; |
| 15254 | val != 0 | 25237 | val != 0 |
| 15255 | } | 25238 | } |
| 15256 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB7"] | 25239 | #[doc = "IWDG Stop mode freeze option status bit"] |
| 15257 | pub fn set_i2c_pb7_fmp(&mut self, val: bool) { | 25240 | pub fn set_fz_iwdg_stop(&mut self, val: bool) { |
| 15258 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); | 25241 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); |
| 15259 | } | 25242 | } |
| 15260 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB8"] | 25243 | #[doc = "IWDG Standby mode freeze option status bit"] |
| 15261 | pub const fn i2c_pb8_fmp(&self) -> bool { | 25244 | pub const fn fz_iwdg_sdby(&self) -> bool { |
| 15262 | let val = (self.0 >> 18usize) & 0x01; | 25245 | let val = (self.0 >> 18usize) & 0x01; |
| 15263 | val != 0 | 25246 | val != 0 |
| 15264 | } | 25247 | } |
| 15265 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB8"] | 25248 | #[doc = "IWDG Standby mode freeze option status bit"] |
| 15266 | pub fn set_i2c_pb8_fmp(&mut self, val: bool) { | 25249 | pub fn set_fz_iwdg_sdby(&mut self, val: bool) { |
| 15267 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); | 25250 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); |
| 15268 | } | 25251 | } |
| 15269 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB9"] | 25252 | #[doc = "DTCM RAM size option status"] |
| 15270 | pub const fn i2c_pb9_fmp(&self) -> bool { | 25253 | pub const fn st_ram_size(&self) -> u8 { |
| 15271 | let val = (self.0 >> 19usize) & 0x01; | 25254 | let val = (self.0 >> 19usize) & 0x03; |
| 25255 | val as u8 | ||
| 25256 | } | ||
| 25257 | #[doc = "DTCM RAM size option status"] | ||
| 25258 | pub fn set_st_ram_size(&mut self, val: u8) { | ||
| 25259 | self.0 = (self.0 & !(0x03 << 19usize)) | (((val as u32) & 0x03) << 19usize); | ||
| 25260 | } | ||
| 25261 | #[doc = "Security enable option status bit"] | ||
| 25262 | pub const fn security(&self) -> bool { | ||
| 25263 | let val = (self.0 >> 21usize) & 0x01; | ||
| 15272 | val != 0 | 25264 | val != 0 |
| 15273 | } | 25265 | } |
| 15274 | #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB9"] | 25266 | #[doc = "Security enable option status bit"] |
| 15275 | pub fn set_i2c_pb9_fmp(&mut self, val: bool) { | 25267 | pub fn set_security(&mut self, val: bool) { |
| 15276 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); | 25268 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); |
| 15277 | } | 25269 | } |
| 15278 | #[doc = "I2C1 Fast-mode Plus driving capability activation"] | 25270 | #[doc = "User option bit 1"] |
| 15279 | pub const fn i2c1_fmp(&self) -> bool { | 25271 | pub const fn rss1(&self) -> bool { |
| 15280 | let val = (self.0 >> 20usize) & 0x01; | 25272 | let val = (self.0 >> 26usize) & 0x01; |
| 15281 | val != 0 | 25273 | val != 0 |
| 15282 | } | 25274 | } |
| 15283 | #[doc = "I2C1 Fast-mode Plus driving capability activation"] | 25275 | #[doc = "User option bit 1"] |
| 15284 | pub fn set_i2c1_fmp(&mut self, val: bool) { | 25276 | pub fn set_rss1(&mut self, val: bool) { |
| 15285 | self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); | 25277 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); |
| 15286 | } | 25278 | } |
| 15287 | #[doc = "I2C2 Fast-mode Plus driving capability activation"] | 25279 | #[doc = "Device personalization status bit"] |
| 15288 | pub const fn i2c2_fmp(&self) -> bool { | 25280 | pub const fn perso_ok(&self) -> bool { |
| 15289 | let val = (self.0 >> 21usize) & 0x01; | 25281 | let val = (self.0 >> 28usize) & 0x01; |
| 15290 | val != 0 | 25282 | val != 0 |
| 15291 | } | 25283 | } |
| 15292 | #[doc = "I2C2 Fast-mode Plus driving capability activation"] | 25284 | #[doc = "Device personalization status bit"] |
| 15293 | pub fn set_i2c2_fmp(&mut self, val: bool) { | 25285 | pub fn set_perso_ok(&mut self, val: bool) { |
| 15294 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); | 25286 | self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize); |
| 15295 | } | 25287 | } |
| 15296 | #[doc = "I2C3 Fast-mode Plus driving capability activation"] | 25288 | #[doc = "I/O high-speed at low-voltage status bit (PRODUCT_BELOW_25V)"] |
| 15297 | pub const fn i2c3_fmp(&self) -> bool { | 25289 | pub const fn io_hslv(&self) -> bool { |
| 15298 | let val = (self.0 >> 22usize) & 0x01; | 25290 | let val = (self.0 >> 29usize) & 0x01; |
| 15299 | val != 0 | 25291 | val != 0 |
| 15300 | } | 25292 | } |
| 15301 | #[doc = "I2C3 Fast-mode Plus driving capability activation"] | 25293 | #[doc = "I/O high-speed at low-voltage status bit (PRODUCT_BELOW_25V)"] |
| 15302 | pub fn set_i2c3_fmp(&mut self, val: bool) { | 25294 | pub fn set_io_hslv(&mut self, val: bool) { |
| 15303 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); | 25295 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize); |
| 15304 | } | 25296 | } |
| 15305 | #[doc = "Floating Point Unit interrupts enable bits"] | 25297 | #[doc = "Option byte change error flag"] |
| 15306 | pub const fn fpu_ie(&self) -> u8 { | 25298 | pub const fn optchangeerr(&self) -> bool { |
| 15307 | let val = (self.0 >> 26usize) & 0x3f; | 25299 | let val = (self.0 >> 30usize) & 0x01; |
| 15308 | val as u8 | 25300 | val != 0 |
| 15309 | } | 25301 | } |
| 15310 | #[doc = "Floating Point Unit interrupts enable bits"] | 25302 | #[doc = "Option byte change error flag"] |
| 15311 | pub fn set_fpu_ie(&mut self, val: u8) { | 25303 | pub fn set_optchangeerr(&mut self, val: bool) { |
| 15312 | self.0 = (self.0 & !(0x3f << 26usize)) | (((val as u32) & 0x3f) << 26usize); | 25304 | self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize); |
| 25305 | } | ||
| 25306 | #[doc = "Bank swapping option status bit"] | ||
| 25307 | pub const fn swap_bank_opt(&self) -> bool { | ||
| 25308 | let val = (self.0 >> 31usize) & 0x01; | ||
| 25309 | val != 0 | ||
| 25310 | } | ||
| 25311 | #[doc = "Bank swapping option status bit"] | ||
| 25312 | pub fn set_swap_bank_opt(&mut self, val: bool) { | ||
| 25313 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize); | ||
| 15313 | } | 25314 | } |
| 15314 | } | 25315 | } |
| 15315 | impl Default for Cfgr1 { | 25316 | impl Default for OptsrCur { |
| 15316 | fn default() -> Cfgr1 { | 25317 | fn default() -> OptsrCur { |
| 15317 | Cfgr1(0) | 25318 | OptsrCur(0) |
| 15318 | } | 25319 | } |
| 15319 | } | 25320 | } |
| 15320 | #[doc = "SWPR"] | 25321 | #[doc = "FLASH secure address for bank 1"] |
| 15321 | #[repr(transparent)] | 25322 | #[repr(transparent)] |
| 15322 | #[derive(Copy, Clone, Eq, PartialEq)] | 25323 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 15323 | pub struct Swpr(pub u32); | 25324 | pub struct ScarCur(pub u32); |
| 15324 | impl Swpr { | 25325 | impl ScarCur { |
| 15325 | #[doc = "SRAWM2 write protection."] | 25326 | #[doc = "Bank 1 lowest secure protected address"] |
| 15326 | pub fn pwp(&self, n: usize) -> bool { | 25327 | pub const fn sec_area_start(&self) -> u16 { |
| 15327 | assert!(n < 32usize); | 25328 | let val = (self.0 >> 0usize) & 0x0fff; |
| 15328 | let offs = 0usize + n * 1usize; | 25329 | val as u16 |
| 15329 | let val = (self.0 >> offs) & 0x01; | 25330 | } |
| 25331 | #[doc = "Bank 1 lowest secure protected address"] | ||
| 25332 | pub fn set_sec_area_start(&mut self, val: u16) { | ||
| 25333 | self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); | ||
| 25334 | } | ||
| 25335 | #[doc = "Bank 1 highest secure protected address"] | ||
| 25336 | pub const fn sec_area_end(&self) -> u16 { | ||
| 25337 | let val = (self.0 >> 16usize) & 0x0fff; | ||
| 25338 | val as u16 | ||
| 25339 | } | ||
| 25340 | #[doc = "Bank 1 highest secure protected address"] | ||
| 25341 | pub fn set_sec_area_end(&mut self, val: u16) { | ||
| 25342 | self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); | ||
| 25343 | } | ||
| 25344 | #[doc = "Bank 1 secure protected erase enable option status bit"] | ||
| 25345 | pub const fn dmes(&self) -> bool { | ||
| 25346 | let val = (self.0 >> 31usize) & 0x01; | ||
| 15330 | val != 0 | 25347 | val != 0 |
| 15331 | } | 25348 | } |
| 15332 | #[doc = "SRAWM2 write protection."] | 25349 | #[doc = "Bank 1 secure protected erase enable option status bit"] |
| 15333 | pub fn set_pwp(&mut self, n: usize, val: bool) { | 25350 | pub fn set_dmes(&mut self, val: bool) { |
| 15334 | assert!(n < 32usize); | 25351 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize); |
| 15335 | let offs = 0usize + n * 1usize; | ||
| 15336 | self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); | ||
| 15337 | } | 25352 | } |
| 15338 | } | 25353 | } |
| 15339 | impl Default for Swpr { | 25354 | impl Default for ScarCur { |
| 15340 | fn default() -> Swpr { | 25355 | fn default() -> ScarCur { |
| 15341 | Swpr(0) | 25356 | ScarCur(0) |
| 15342 | } | 25357 | } |
| 15343 | } | 25358 | } |
| 15344 | #[doc = "SCSR"] | 25359 | #[doc = "FLASH CRC end address register for bank 1"] |
| 15345 | #[repr(transparent)] | 25360 | #[repr(transparent)] |
| 15346 | #[derive(Copy, Clone, Eq, PartialEq)] | 25361 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 15347 | pub struct Scsr(pub u32); | 25362 | pub struct Crceaddr(pub u32); |
| 15348 | impl Scsr { | 25363 | impl Crceaddr { |
| 15349 | #[doc = "SRAM2 Erase"] | 25364 | #[doc = "CRC end address on bank 1"] |
| 15350 | pub const fn sram2er(&self) -> bool { | 25365 | pub const fn crc_end_addr(&self) -> u32 { |
| 25366 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 25367 | val as u32 | ||
| 25368 | } | ||
| 25369 | #[doc = "CRC end address on bank 1"] | ||
| 25370 | pub fn set_crc_end_addr(&mut self, val: u32) { | ||
| 25371 | self.0 = | ||
| 25372 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 25373 | } | ||
| 25374 | } | ||
| 25375 | impl Default for Crceaddr { | ||
| 25376 | fn default() -> Crceaddr { | ||
| 25377 | Crceaddr(0) | ||
| 25378 | } | ||
| 25379 | } | ||
| 25380 | #[doc = "FLASH write sector protection for bank 1"] | ||
| 25381 | #[repr(transparent)] | ||
| 25382 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 25383 | pub struct WpsnCurr(pub u32); | ||
| 25384 | impl WpsnCurr { | ||
| 25385 | #[doc = "Bank 1 sector write protection option status byte"] | ||
| 25386 | pub const fn wrpsn(&self) -> u8 { | ||
| 25387 | let val = (self.0 >> 0usize) & 0xff; | ||
| 25388 | val as u8 | ||
| 25389 | } | ||
| 25390 | #[doc = "Bank 1 sector write protection option status byte"] | ||
| 25391 | pub fn set_wrpsn(&mut self, val: u8) { | ||
| 25392 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); | ||
| 25393 | } | ||
| 25394 | } | ||
| 25395 | impl Default for WpsnCurr { | ||
| 25396 | fn default() -> WpsnCurr { | ||
| 25397 | WpsnCurr(0) | ||
| 25398 | } | ||
| 25399 | } | ||
| 25400 | #[doc = "FLASH ECC fail address for bank 1"] | ||
| 25401 | #[repr(transparent)] | ||
| 25402 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 25403 | pub struct Far(pub u32); | ||
| 25404 | impl Far { | ||
| 25405 | #[doc = "Bank 1 ECC error address"] | ||
| 25406 | pub const fn fail_ecc_addr(&self) -> u16 { | ||
| 25407 | let val = (self.0 >> 0usize) & 0x7fff; | ||
| 25408 | val as u16 | ||
| 25409 | } | ||
| 25410 | #[doc = "Bank 1 ECC error address"] | ||
| 25411 | pub fn set_fail_ecc_addr(&mut self, val: u16) { | ||
| 25412 | self.0 = (self.0 & !(0x7fff << 0usize)) | (((val as u32) & 0x7fff) << 0usize); | ||
| 25413 | } | ||
| 25414 | } | ||
| 25415 | impl Default for Far { | ||
| 25416 | fn default() -> Far { | ||
| 25417 | Far(0) | ||
| 25418 | } | ||
| 25419 | } | ||
| 25420 | #[doc = "FLASH option control register"] | ||
| 25421 | #[repr(transparent)] | ||
| 25422 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 25423 | pub struct Optcr(pub u32); | ||
| 25424 | impl Optcr { | ||
| 25425 | #[doc = "FLASH_OPTCR lock option configuration bit"] | ||
| 25426 | pub const fn optlock(&self) -> bool { | ||
| 15351 | let val = (self.0 >> 0usize) & 0x01; | 25427 | let val = (self.0 >> 0usize) & 0x01; |
| 15352 | val != 0 | 25428 | val != 0 |
| 15353 | } | 25429 | } |
| 15354 | #[doc = "SRAM2 Erase"] | 25430 | #[doc = "FLASH_OPTCR lock option configuration bit"] |
| 15355 | pub fn set_sram2er(&mut self, val: bool) { | 25431 | pub fn set_optlock(&mut self, val: bool) { |
| 15356 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | 25432 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); |
| 15357 | } | 25433 | } |
| 15358 | #[doc = "SRAM2 busy by erase operation"] | 25434 | #[doc = "Option byte start change option configuration bit"] |
| 15359 | pub const fn sram2bsy(&self) -> bool { | 25435 | pub const fn optstart(&self) -> bool { |
| 15360 | let val = (self.0 >> 1usize) & 0x01; | 25436 | let val = (self.0 >> 1usize) & 0x01; |
| 15361 | val != 0 | 25437 | val != 0 |
| 15362 | } | 25438 | } |
| 15363 | #[doc = "SRAM2 busy by erase operation"] | 25439 | #[doc = "Option byte start change option configuration bit"] |
| 15364 | pub fn set_sram2bsy(&mut self, val: bool) { | 25440 | pub fn set_optstart(&mut self, val: bool) { |
| 15365 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | 25441 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); |
| 15366 | } | 25442 | } |
| 25443 | #[doc = "Flash mass erase enable bit"] | ||
| 25444 | pub const fn mer(&self) -> bool { | ||
| 25445 | let val = (self.0 >> 4usize) & 0x01; | ||
| 25446 | val != 0 | ||
| 25447 | } | ||
| 25448 | #[doc = "Flash mass erase enable bit"] | ||
| 25449 | pub fn set_mer(&mut self, val: bool) { | ||
| 25450 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | ||
| 25451 | } | ||
| 25452 | #[doc = "Option byte change error interrupt enable bit"] | ||
| 25453 | pub const fn optchangeerrie(&self) -> bool { | ||
| 25454 | let val = (self.0 >> 30usize) & 0x01; | ||
| 25455 | val != 0 | ||
| 25456 | } | ||
| 25457 | #[doc = "Option byte change error interrupt enable bit"] | ||
| 25458 | pub fn set_optchangeerrie(&mut self, val: bool) { | ||
| 25459 | self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize); | ||
| 25460 | } | ||
| 25461 | #[doc = "Bank swapping configuration bit"] | ||
| 25462 | pub const fn swap_bank(&self) -> bool { | ||
| 25463 | let val = (self.0 >> 31usize) & 0x01; | ||
| 25464 | val != 0 | ||
| 25465 | } | ||
| 25466 | #[doc = "Bank swapping configuration bit"] | ||
| 25467 | pub fn set_swap_bank(&mut self, val: bool) { | ||
| 25468 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize); | ||
| 25469 | } | ||
| 15367 | } | 25470 | } |
| 15368 | impl Default for Scsr { | 25471 | impl Default for Optcr { |
| 15369 | fn default() -> Scsr { | 25472 | fn default() -> Optcr { |
| 15370 | Scsr(0) | 25473 | Optcr(0) |
| 15371 | } | 25474 | } |
| 15372 | } | 25475 | } |
| 15373 | #[doc = "external interrupt configuration register 4"] | 25476 | #[doc = "FLASH register with boot address"] |
| 15374 | #[repr(transparent)] | 25477 | #[repr(transparent)] |
| 15375 | #[derive(Copy, Clone, Eq, PartialEq)] | 25478 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 15376 | pub struct Exticr(pub u32); | 25479 | pub struct BootPrgr(pub u32); |
| 15377 | impl Exticr { | 25480 | impl BootPrgr { |
| 15378 | #[doc = "EXTI12 configuration bits"] | 25481 | #[doc = "Boot address 0"] |
| 15379 | pub fn exti(&self, n: usize) -> u8 { | 25482 | pub const fn boot_add0(&self) -> u16 { |
| 15380 | assert!(n < 4usize); | 25483 | let val = (self.0 >> 0usize) & 0xffff; |
| 15381 | let offs = 0usize + n * 4usize; | 25484 | val as u16 |
| 15382 | let val = (self.0 >> offs) & 0x0f; | 25485 | } |
| 25486 | #[doc = "Boot address 0"] | ||
| 25487 | pub fn set_boot_add0(&mut self, val: u16) { | ||
| 25488 | self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); | ||
| 25489 | } | ||
| 25490 | #[doc = "Boot address 1"] | ||
| 25491 | pub const fn boot_add1(&self) -> u16 { | ||
| 25492 | let val = (self.0 >> 16usize) & 0xffff; | ||
| 25493 | val as u16 | ||
| 25494 | } | ||
| 25495 | #[doc = "Boot address 1"] | ||
| 25496 | pub fn set_boot_add1(&mut self, val: u16) { | ||
| 25497 | self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize); | ||
| 25498 | } | ||
| 25499 | } | ||
| 25500 | impl Default for BootPrgr { | ||
| 25501 | fn default() -> BootPrgr { | ||
| 25502 | BootPrgr(0) | ||
| 25503 | } | ||
| 25504 | } | ||
| 25505 | #[doc = "FLASH protection address for bank 1"] | ||
| 25506 | #[repr(transparent)] | ||
| 25507 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 25508 | pub struct PrarCur(pub u32); | ||
| 25509 | impl PrarCur { | ||
| 25510 | #[doc = "Bank 1 lowest PCROP protected address"] | ||
| 25511 | pub const fn prot_area_start(&self) -> u16 { | ||
| 25512 | let val = (self.0 >> 0usize) & 0x0fff; | ||
| 25513 | val as u16 | ||
| 25514 | } | ||
| 25515 | #[doc = "Bank 1 lowest PCROP protected address"] | ||
| 25516 | pub fn set_prot_area_start(&mut self, val: u16) { | ||
| 25517 | self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); | ||
| 25518 | } | ||
| 25519 | #[doc = "Bank 1 highest PCROP protected address"] | ||
| 25520 | pub const fn prot_area_end(&self) -> u16 { | ||
| 25521 | let val = (self.0 >> 16usize) & 0x0fff; | ||
| 25522 | val as u16 | ||
| 25523 | } | ||
| 25524 | #[doc = "Bank 1 highest PCROP protected address"] | ||
| 25525 | pub fn set_prot_area_end(&mut self, val: u16) { | ||
| 25526 | self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); | ||
| 25527 | } | ||
| 25528 | #[doc = "Bank 1 PCROP protected erase enable option status bit"] | ||
| 25529 | pub const fn dmep(&self) -> bool { | ||
| 25530 | let val = (self.0 >> 31usize) & 0x01; | ||
| 25531 | val != 0 | ||
| 25532 | } | ||
| 25533 | #[doc = "Bank 1 PCROP protected erase enable option status bit"] | ||
| 25534 | pub fn set_dmep(&mut self, val: bool) { | ||
| 25535 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize); | ||
| 25536 | } | ||
| 25537 | } | ||
| 25538 | impl Default for PrarCur { | ||
| 25539 | fn default() -> PrarCur { | ||
| 25540 | PrarCur(0) | ||
| 25541 | } | ||
| 25542 | } | ||
| 25543 | #[doc = "FLASH CRC start address register for bank 1"] | ||
| 25544 | #[repr(transparent)] | ||
| 25545 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 25546 | pub struct Crcsaddr(pub u32); | ||
| 25547 | impl Crcsaddr { | ||
| 25548 | #[doc = "CRC start address on bank 1"] | ||
| 25549 | pub const fn crc_start_addr(&self) -> u32 { | ||
| 25550 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 25551 | val as u32 | ||
| 25552 | } | ||
| 25553 | #[doc = "CRC start address on bank 1"] | ||
| 25554 | pub fn set_crc_start_addr(&mut self, val: u32) { | ||
| 25555 | self.0 = | ||
| 25556 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 25557 | } | ||
| 25558 | } | ||
| 25559 | impl Default for Crcsaddr { | ||
| 25560 | fn default() -> Crcsaddr { | ||
| 25561 | Crcsaddr(0) | ||
| 25562 | } | ||
| 25563 | } | ||
| 25564 | #[doc = "FLASH write sector protection for bank 1"] | ||
| 25565 | #[repr(transparent)] | ||
| 25566 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 25567 | pub struct WpsnPrgr(pub u32); | ||
| 25568 | impl WpsnPrgr { | ||
| 25569 | #[doc = "Bank 1 sector write protection configuration byte"] | ||
| 25570 | pub const fn wrpsn(&self) -> u8 { | ||
| 25571 | let val = (self.0 >> 0usize) & 0xff; | ||
| 15383 | val as u8 | 25572 | val as u8 |
| 15384 | } | 25573 | } |
| 15385 | #[doc = "EXTI12 configuration bits"] | 25574 | #[doc = "Bank 1 sector write protection configuration byte"] |
| 15386 | pub fn set_exti(&mut self, n: usize, val: u8) { | 25575 | pub fn set_wrpsn(&mut self, val: u8) { |
| 15387 | assert!(n < 4usize); | 25576 | self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); |
| 15388 | let offs = 0usize + n * 4usize; | ||
| 15389 | self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs); | ||
| 15390 | } | 25577 | } |
| 15391 | } | 25578 | } |
| 15392 | impl Default for Exticr { | 25579 | impl Default for WpsnPrgr { |
| 15393 | fn default() -> Exticr { | 25580 | fn default() -> WpsnPrgr { |
| 15394 | Exticr(0) | 25581 | WpsnPrgr(0) |
| 15395 | } | 25582 | } |
| 15396 | } | 25583 | } |
| 15397 | #[doc = "memory remap register"] | 25584 | #[doc = "FLASH option key register"] |
| 15398 | #[repr(transparent)] | 25585 | #[repr(transparent)] |
| 15399 | #[derive(Copy, Clone, Eq, PartialEq)] | 25586 | #[derive(Copy, Clone, Eq, PartialEq)] |
| 15400 | pub struct Memrmp(pub u32); | 25587 | pub struct Optkeyr(pub u32); |
| 15401 | impl Memrmp { | 25588 | impl Optkeyr { |
| 15402 | #[doc = "Memory mapping selection"] | 25589 | #[doc = "Unlock key option bytes"] |
| 15403 | pub const fn mem_mode(&self) -> u8 { | 25590 | pub const fn optkeyr(&self) -> u32 { |
| 15404 | let val = (self.0 >> 0usize) & 0x07; | 25591 | let val = (self.0 >> 0usize) & 0xffff_ffff; |
| 25592 | val as u32 | ||
| 25593 | } | ||
| 25594 | #[doc = "Unlock key option bytes"] | ||
| 25595 | pub fn set_optkeyr(&mut self, val: u32) { | ||
| 25596 | self.0 = | ||
| 25597 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 25598 | } | ||
| 25599 | } | ||
| 25600 | impl Default for Optkeyr { | ||
| 25601 | fn default() -> Optkeyr { | ||
| 25602 | Optkeyr(0) | ||
| 25603 | } | ||
| 25604 | } | ||
| 25605 | #[doc = "FLASH secure address for bank 1"] | ||
| 25606 | #[repr(transparent)] | ||
| 25607 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 25608 | pub struct ScarPrg(pub u32); | ||
| 25609 | impl ScarPrg { | ||
| 25610 | #[doc = "Bank 1 lowest secure protected address configuration"] | ||
| 25611 | pub const fn sec_area_start(&self) -> u16 { | ||
| 25612 | let val = (self.0 >> 0usize) & 0x0fff; | ||
| 25613 | val as u16 | ||
| 25614 | } | ||
| 25615 | #[doc = "Bank 1 lowest secure protected address configuration"] | ||
| 25616 | pub fn set_sec_area_start(&mut self, val: u16) { | ||
| 25617 | self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); | ||
| 25618 | } | ||
| 25619 | #[doc = "Bank 1 highest secure protected address configuration"] | ||
| 25620 | pub const fn sec_area_end(&self) -> u16 { | ||
| 25621 | let val = (self.0 >> 16usize) & 0x0fff; | ||
| 25622 | val as u16 | ||
| 25623 | } | ||
| 25624 | #[doc = "Bank 1 highest secure protected address configuration"] | ||
| 25625 | pub fn set_sec_area_end(&mut self, val: u16) { | ||
| 25626 | self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); | ||
| 25627 | } | ||
| 25628 | #[doc = "Bank 1 secure protected erase enable option configuration bit"] | ||
| 25629 | pub const fn dmes(&self) -> bool { | ||
| 25630 | let val = (self.0 >> 31usize) & 0x01; | ||
| 25631 | val != 0 | ||
| 25632 | } | ||
| 25633 | #[doc = "Bank 1 secure protected erase enable option configuration bit"] | ||
| 25634 | pub fn set_dmes(&mut self, val: bool) { | ||
| 25635 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize); | ||
| 25636 | } | ||
| 25637 | } | ||
| 25638 | impl Default for ScarPrg { | ||
| 25639 | fn default() -> ScarPrg { | ||
| 25640 | ScarPrg(0) | ||
| 25641 | } | ||
| 25642 | } | ||
| 25643 | #[doc = "FLASH option status register"] | ||
| 25644 | #[repr(transparent)] | ||
| 25645 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 25646 | pub struct OptsrPrg(pub u32); | ||
| 25647 | impl OptsrPrg { | ||
| 25648 | #[doc = "BOR reset level option configuration bits"] | ||
| 25649 | pub const fn bor_lev(&self) -> u8 { | ||
| 25650 | let val = (self.0 >> 2usize) & 0x03; | ||
| 15405 | val as u8 | 25651 | val as u8 |
| 15406 | } | 25652 | } |
| 15407 | #[doc = "Memory mapping selection"] | 25653 | #[doc = "BOR reset level option configuration bits"] |
| 15408 | pub fn set_mem_mode(&mut self, val: u8) { | 25654 | pub fn set_bor_lev(&mut self, val: u8) { |
| 15409 | self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize); | 25655 | self.0 = (self.0 & !(0x03 << 2usize)) | (((val as u32) & 0x03) << 2usize); |
| 15410 | } | 25656 | } |
| 15411 | #[doc = "QUADSPI memory mapping swap"] | 25657 | #[doc = "IWDG1 option configuration bit"] |
| 15412 | pub const fn qfs(&self) -> bool { | 25658 | pub const fn iwdg1_hw(&self) -> bool { |
| 25659 | let val = (self.0 >> 4usize) & 0x01; | ||
| 25660 | val != 0 | ||
| 25661 | } | ||
| 25662 | #[doc = "IWDG1 option configuration bit"] | ||
| 25663 | pub fn set_iwdg1_hw(&mut self, val: bool) { | ||
| 25664 | self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); | ||
| 25665 | } | ||
| 25666 | #[doc = "Option byte erase after D1 DStop option configuration bit"] | ||
| 25667 | pub const fn n_rst_stop_d1(&self) -> bool { | ||
| 25668 | let val = (self.0 >> 6usize) & 0x01; | ||
| 25669 | val != 0 | ||
| 25670 | } | ||
| 25671 | #[doc = "Option byte erase after D1 DStop option configuration bit"] | ||
| 25672 | pub fn set_n_rst_stop_d1(&mut self, val: bool) { | ||
| 25673 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 25674 | } | ||
| 25675 | #[doc = "Option byte erase after D1 DStandby option configuration bit"] | ||
| 25676 | pub const fn n_rst_stby_d1(&self) -> bool { | ||
| 25677 | let val = (self.0 >> 7usize) & 0x01; | ||
| 25678 | val != 0 | ||
| 25679 | } | ||
| 25680 | #[doc = "Option byte erase after D1 DStandby option configuration bit"] | ||
| 25681 | pub fn set_n_rst_stby_d1(&mut self, val: bool) { | ||
| 25682 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 25683 | } | ||
| 25684 | #[doc = "Readout protection level option configuration byte"] | ||
| 25685 | pub const fn rdp(&self) -> u8 { | ||
| 25686 | let val = (self.0 >> 8usize) & 0xff; | ||
| 25687 | val as u8 | ||
| 25688 | } | ||
| 25689 | #[doc = "Readout protection level option configuration byte"] | ||
| 25690 | pub fn set_rdp(&mut self, val: u8) { | ||
| 25691 | self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize); | ||
| 25692 | } | ||
| 25693 | #[doc = "IWDG Stop mode freeze option configuration bit"] | ||
| 25694 | pub const fn fz_iwdg_stop(&self) -> bool { | ||
| 25695 | let val = (self.0 >> 17usize) & 0x01; | ||
| 25696 | val != 0 | ||
| 25697 | } | ||
| 25698 | #[doc = "IWDG Stop mode freeze option configuration bit"] | ||
| 25699 | pub fn set_fz_iwdg_stop(&mut self, val: bool) { | ||
| 25700 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); | ||
| 25701 | } | ||
| 25702 | #[doc = "IWDG Standby mode freeze option configuration bit"] | ||
| 25703 | pub const fn fz_iwdg_sdby(&self) -> bool { | ||
| 25704 | let val = (self.0 >> 18usize) & 0x01; | ||
| 25705 | val != 0 | ||
| 25706 | } | ||
| 25707 | #[doc = "IWDG Standby mode freeze option configuration bit"] | ||
| 25708 | pub fn set_fz_iwdg_sdby(&mut self, val: bool) { | ||
| 25709 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); | ||
| 25710 | } | ||
| 25711 | #[doc = "DTCM size select option configuration bits"] | ||
| 25712 | pub const fn st_ram_size(&self) -> u8 { | ||
| 25713 | let val = (self.0 >> 19usize) & 0x03; | ||
| 25714 | val as u8 | ||
| 25715 | } | ||
| 25716 | #[doc = "DTCM size select option configuration bits"] | ||
| 25717 | pub fn set_st_ram_size(&mut self, val: u8) { | ||
| 25718 | self.0 = (self.0 & !(0x03 << 19usize)) | (((val as u32) & 0x03) << 19usize); | ||
| 25719 | } | ||
| 25720 | #[doc = "Security option configuration bit"] | ||
| 25721 | pub const fn security(&self) -> bool { | ||
| 25722 | let val = (self.0 >> 21usize) & 0x01; | ||
| 25723 | val != 0 | ||
| 25724 | } | ||
| 25725 | #[doc = "Security option configuration bit"] | ||
| 25726 | pub fn set_security(&mut self, val: bool) { | ||
| 25727 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); | ||
| 25728 | } | ||
| 25729 | #[doc = "User option configuration bit 1"] | ||
| 25730 | pub const fn rss1(&self) -> bool { | ||
| 25731 | let val = (self.0 >> 26usize) & 0x01; | ||
| 25732 | val != 0 | ||
| 25733 | } | ||
| 25734 | #[doc = "User option configuration bit 1"] | ||
| 25735 | pub fn set_rss1(&mut self, val: bool) { | ||
| 25736 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); | ||
| 25737 | } | ||
| 25738 | #[doc = "User option configuration bit 2"] | ||
| 25739 | pub const fn rss2(&self) -> bool { | ||
| 25740 | let val = (self.0 >> 27usize) & 0x01; | ||
| 25741 | val != 0 | ||
| 25742 | } | ||
| 25743 | #[doc = "User option configuration bit 2"] | ||
| 25744 | pub fn set_rss2(&mut self, val: bool) { | ||
| 25745 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize); | ||
| 25746 | } | ||
| 25747 | #[doc = "I/O high-speed at low-voltage (PRODUCT_BELOW_25V)"] | ||
| 25748 | pub const fn io_hslv(&self) -> bool { | ||
| 25749 | let val = (self.0 >> 29usize) & 0x01; | ||
| 25750 | val != 0 | ||
| 25751 | } | ||
| 25752 | #[doc = "I/O high-speed at low-voltage (PRODUCT_BELOW_25V)"] | ||
| 25753 | pub fn set_io_hslv(&mut self, val: bool) { | ||
| 25754 | self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize); | ||
| 25755 | } | ||
| 25756 | #[doc = "Bank swapping option configuration bit"] | ||
| 25757 | pub const fn swap_bank_opt(&self) -> bool { | ||
| 25758 | let val = (self.0 >> 31usize) & 0x01; | ||
| 25759 | val != 0 | ||
| 25760 | } | ||
| 25761 | #[doc = "Bank swapping option configuration bit"] | ||
| 25762 | pub fn set_swap_bank_opt(&mut self, val: bool) { | ||
| 25763 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize); | ||
| 25764 | } | ||
| 25765 | } | ||
| 25766 | impl Default for OptsrPrg { | ||
| 25767 | fn default() -> OptsrPrg { | ||
| 25768 | OptsrPrg(0) | ||
| 25769 | } | ||
| 25770 | } | ||
| 25771 | #[doc = "FLASH control register for bank 1"] | ||
| 25772 | #[repr(transparent)] | ||
| 25773 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 25774 | pub struct Cr(pub u32); | ||
| 25775 | impl Cr { | ||
| 25776 | #[doc = "Bank 1 configuration lock bit"] | ||
| 25777 | pub const fn lock(&self) -> bool { | ||
| 25778 | let val = (self.0 >> 0usize) & 0x01; | ||
| 25779 | val != 0 | ||
| 25780 | } | ||
| 25781 | #[doc = "Bank 1 configuration lock bit"] | ||
| 25782 | pub fn set_lock(&mut self, val: bool) { | ||
| 25783 | self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); | ||
| 25784 | } | ||
| 25785 | #[doc = "Bank 1 program enable bit"] | ||
| 25786 | pub const fn pg(&self) -> bool { | ||
| 25787 | let val = (self.0 >> 1usize) & 0x01; | ||
| 25788 | val != 0 | ||
| 25789 | } | ||
| 25790 | #[doc = "Bank 1 program enable bit"] | ||
| 25791 | pub fn set_pg(&mut self, val: bool) { | ||
| 25792 | self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); | ||
| 25793 | } | ||
| 25794 | #[doc = "Bank 1 sector erase request"] | ||
| 25795 | pub const fn ser(&self) -> bool { | ||
| 25796 | let val = (self.0 >> 2usize) & 0x01; | ||
| 25797 | val != 0 | ||
| 25798 | } | ||
| 25799 | #[doc = "Bank 1 sector erase request"] | ||
| 25800 | pub fn set_ser(&mut self, val: bool) { | ||
| 25801 | self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); | ||
| 25802 | } | ||
| 25803 | #[doc = "Bank 1 erase request"] | ||
| 25804 | pub const fn ber(&self) -> bool { | ||
| 15413 | let val = (self.0 >> 3usize) & 0x01; | 25805 | let val = (self.0 >> 3usize) & 0x01; |
| 15414 | val != 0 | 25806 | val != 0 |
| 15415 | } | 25807 | } |
| 15416 | #[doc = "QUADSPI memory mapping swap"] | 25808 | #[doc = "Bank 1 erase request"] |
| 15417 | pub fn set_qfs(&mut self, val: bool) { | 25809 | pub fn set_ber(&mut self, val: bool) { |
| 15418 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); | 25810 | self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); |
| 15419 | } | 25811 | } |
| 15420 | #[doc = "Flash Bank mode selection"] | 25812 | #[doc = "Bank 1 program size"] |
| 15421 | pub const fn fb_mode(&self) -> bool { | 25813 | pub const fn psize(&self) -> u8 { |
| 25814 | let val = (self.0 >> 4usize) & 0x03; | ||
| 25815 | val as u8 | ||
| 25816 | } | ||
| 25817 | #[doc = "Bank 1 program size"] | ||
| 25818 | pub fn set_psize(&mut self, val: u8) { | ||
| 25819 | self.0 = (self.0 & !(0x03 << 4usize)) | (((val as u32) & 0x03) << 4usize); | ||
| 25820 | } | ||
| 25821 | #[doc = "Bank 1 write forcing control bit"] | ||
| 25822 | pub const fn fw(&self) -> bool { | ||
| 25823 | let val = (self.0 >> 6usize) & 0x01; | ||
| 25824 | val != 0 | ||
| 25825 | } | ||
| 25826 | #[doc = "Bank 1 write forcing control bit"] | ||
| 25827 | pub fn set_fw(&mut self, val: bool) { | ||
| 25828 | self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); | ||
| 25829 | } | ||
| 25830 | #[doc = "Bank 1 bank or sector erase start control bit"] | ||
| 25831 | pub const fn start(&self) -> bool { | ||
| 25832 | let val = (self.0 >> 7usize) & 0x01; | ||
| 25833 | val != 0 | ||
| 25834 | } | ||
| 25835 | #[doc = "Bank 1 bank or sector erase start control bit"] | ||
| 25836 | pub fn set_start(&mut self, val: bool) { | ||
| 25837 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 25838 | } | ||
| 25839 | #[doc = "Bank 1 sector erase selection number"] | ||
| 25840 | pub const fn snb(&self) -> u8 { | ||
| 25841 | let val = (self.0 >> 8usize) & 0x07; | ||
| 25842 | val as u8 | ||
| 25843 | } | ||
| 25844 | #[doc = "Bank 1 sector erase selection number"] | ||
| 25845 | pub fn set_snb(&mut self, val: u8) { | ||
| 25846 | self.0 = (self.0 & !(0x07 << 8usize)) | (((val as u32) & 0x07) << 8usize); | ||
| 25847 | } | ||
| 25848 | #[doc = "Bank 1 CRC control bit"] | ||
| 25849 | pub const fn crc_en(&self) -> bool { | ||
| 25850 | let val = (self.0 >> 15usize) & 0x01; | ||
| 25851 | val != 0 | ||
| 25852 | } | ||
| 25853 | #[doc = "Bank 1 CRC control bit"] | ||
| 25854 | pub fn set_crc_en(&mut self, val: bool) { | ||
| 25855 | self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); | ||
| 25856 | } | ||
| 25857 | #[doc = "Bank 1 end-of-program interrupt control bit"] | ||
| 25858 | pub const fn eopie(&self) -> bool { | ||
| 25859 | let val = (self.0 >> 16usize) & 0x01; | ||
| 25860 | val != 0 | ||
| 25861 | } | ||
| 25862 | #[doc = "Bank 1 end-of-program interrupt control bit"] | ||
| 25863 | pub fn set_eopie(&mut self, val: bool) { | ||
| 25864 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | ||
| 25865 | } | ||
| 25866 | #[doc = "Bank 1 write protection error interrupt enable bit"] | ||
| 25867 | pub const fn wrperrie(&self) -> bool { | ||
| 25868 | let val = (self.0 >> 17usize) & 0x01; | ||
| 25869 | val != 0 | ||
| 25870 | } | ||
| 25871 | #[doc = "Bank 1 write protection error interrupt enable bit"] | ||
| 25872 | pub fn set_wrperrie(&mut self, val: bool) { | ||
| 25873 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); | ||
| 25874 | } | ||
| 25875 | #[doc = "Bank 1 programming sequence error interrupt enable bit"] | ||
| 25876 | pub const fn pgserrie(&self) -> bool { | ||
| 25877 | let val = (self.0 >> 18usize) & 0x01; | ||
| 25878 | val != 0 | ||
| 25879 | } | ||
| 25880 | #[doc = "Bank 1 programming sequence error interrupt enable bit"] | ||
| 25881 | pub fn set_pgserrie(&mut self, val: bool) { | ||
| 25882 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); | ||
| 25883 | } | ||
| 25884 | #[doc = "Bank 1 strobe error interrupt enable bit"] | ||
| 25885 | pub const fn strberrie(&self) -> bool { | ||
| 25886 | let val = (self.0 >> 19usize) & 0x01; | ||
| 25887 | val != 0 | ||
| 25888 | } | ||
| 25889 | #[doc = "Bank 1 strobe error interrupt enable bit"] | ||
| 25890 | pub fn set_strberrie(&mut self, val: bool) { | ||
| 25891 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); | ||
| 25892 | } | ||
| 25893 | #[doc = "Bank 1 inconsistency error interrupt enable bit"] | ||
| 25894 | pub const fn incerrie(&self) -> bool { | ||
| 25895 | let val = (self.0 >> 21usize) & 0x01; | ||
| 25896 | val != 0 | ||
| 25897 | } | ||
| 25898 | #[doc = "Bank 1 inconsistency error interrupt enable bit"] | ||
| 25899 | pub fn set_incerrie(&mut self, val: bool) { | ||
| 25900 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); | ||
| 25901 | } | ||
| 25902 | #[doc = "Bank 1 write/erase error interrupt enable bit"] | ||
| 25903 | pub const fn operrie(&self) -> bool { | ||
| 25904 | let val = (self.0 >> 22usize) & 0x01; | ||
| 25905 | val != 0 | ||
| 25906 | } | ||
| 25907 | #[doc = "Bank 1 write/erase error interrupt enable bit"] | ||
| 25908 | pub fn set_operrie(&mut self, val: bool) { | ||
| 25909 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); | ||
| 25910 | } | ||
| 25911 | #[doc = "Bank 1 read protection error interrupt enable bit"] | ||
| 25912 | pub const fn rdperrie(&self) -> bool { | ||
| 25913 | let val = (self.0 >> 23usize) & 0x01; | ||
| 25914 | val != 0 | ||
| 25915 | } | ||
| 25916 | #[doc = "Bank 1 read protection error interrupt enable bit"] | ||
| 25917 | pub fn set_rdperrie(&mut self, val: bool) { | ||
| 25918 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); | ||
| 25919 | } | ||
| 25920 | #[doc = "Bank 1 secure error interrupt enable bit"] | ||
| 25921 | pub const fn rdserrie(&self) -> bool { | ||
| 25922 | let val = (self.0 >> 24usize) & 0x01; | ||
| 25923 | val != 0 | ||
| 25924 | } | ||
| 25925 | #[doc = "Bank 1 secure error interrupt enable bit"] | ||
| 25926 | pub fn set_rdserrie(&mut self, val: bool) { | ||
| 25927 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize); | ||
| 25928 | } | ||
| 25929 | #[doc = "Bank 1 ECC single correction error interrupt enable bit"] | ||
| 25930 | pub const fn sneccerrie(&self) -> bool { | ||
| 25931 | let val = (self.0 >> 25usize) & 0x01; | ||
| 25932 | val != 0 | ||
| 25933 | } | ||
| 25934 | #[doc = "Bank 1 ECC single correction error interrupt enable bit"] | ||
| 25935 | pub fn set_sneccerrie(&mut self, val: bool) { | ||
| 25936 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize); | ||
| 25937 | } | ||
| 25938 | #[doc = "Bank 1 ECC double detection error interrupt enable bit"] | ||
| 25939 | pub const fn dbeccerrie(&self) -> bool { | ||
| 25940 | let val = (self.0 >> 26usize) & 0x01; | ||
| 25941 | val != 0 | ||
| 25942 | } | ||
| 25943 | #[doc = "Bank 1 ECC double detection error interrupt enable bit"] | ||
| 25944 | pub fn set_dbeccerrie(&mut self, val: bool) { | ||
| 25945 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); | ||
| 25946 | } | ||
| 25947 | #[doc = "Bank 1 end of CRC calculation interrupt enable bit"] | ||
| 25948 | pub const fn crcendie(&self) -> bool { | ||
| 25949 | let val = (self.0 >> 27usize) & 0x01; | ||
| 25950 | val != 0 | ||
| 25951 | } | ||
| 25952 | #[doc = "Bank 1 end of CRC calculation interrupt enable bit"] | ||
| 25953 | pub fn set_crcendie(&mut self, val: bool) { | ||
| 25954 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize); | ||
| 25955 | } | ||
| 25956 | } | ||
| 25957 | impl Default for Cr { | ||
| 25958 | fn default() -> Cr { | ||
| 25959 | Cr(0) | ||
| 25960 | } | ||
| 25961 | } | ||
| 25962 | #[doc = "FLASH CRC control register for bank 1"] | ||
| 25963 | #[repr(transparent)] | ||
| 25964 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 25965 | pub struct Crccr(pub u32); | ||
| 25966 | impl Crccr { | ||
| 25967 | #[doc = "Bank 1 CRC sector number"] | ||
| 25968 | pub const fn crc_sect(&self) -> u8 { | ||
| 25969 | let val = (self.0 >> 0usize) & 0x07; | ||
| 25970 | val as u8 | ||
| 25971 | } | ||
| 25972 | #[doc = "Bank 1 CRC sector number"] | ||
| 25973 | pub fn set_crc_sect(&mut self, val: u8) { | ||
| 25974 | self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize); | ||
| 25975 | } | ||
| 25976 | #[doc = "Bank 1 CRC select bit"] | ||
| 25977 | pub const fn all_bank(&self) -> bool { | ||
| 25978 | let val = (self.0 >> 7usize) & 0x01; | ||
| 25979 | val != 0 | ||
| 25980 | } | ||
| 25981 | #[doc = "Bank 1 CRC select bit"] | ||
| 25982 | pub fn set_all_bank(&mut self, val: bool) { | ||
| 25983 | self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); | ||
| 25984 | } | ||
| 25985 | #[doc = "Bank 1 CRC sector mode select bit"] | ||
| 25986 | pub const fn crc_by_sect(&self) -> bool { | ||
| 15422 | let val = (self.0 >> 8usize) & 0x01; | 25987 | let val = (self.0 >> 8usize) & 0x01; |
| 15423 | val != 0 | 25988 | val != 0 |
| 15424 | } | 25989 | } |
| 15425 | #[doc = "Flash Bank mode selection"] | 25990 | #[doc = "Bank 1 CRC sector mode select bit"] |
| 15426 | pub fn set_fb_mode(&mut self, val: bool) { | 25991 | pub fn set_crc_by_sect(&mut self, val: bool) { |
| 15427 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); | 25992 | self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); |
| 15428 | } | 25993 | } |
| 25994 | #[doc = "Bank 1 CRC sector select bit"] | ||
| 25995 | pub const fn add_sect(&self) -> bool { | ||
| 25996 | let val = (self.0 >> 9usize) & 0x01; | ||
| 25997 | val != 0 | ||
| 25998 | } | ||
| 25999 | #[doc = "Bank 1 CRC sector select bit"] | ||
| 26000 | pub fn set_add_sect(&mut self, val: bool) { | ||
| 26001 | self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); | ||
| 26002 | } | ||
| 26003 | #[doc = "Bank 1 CRC sector list clear bit"] | ||
| 26004 | pub const fn clean_sect(&self) -> bool { | ||
| 26005 | let val = (self.0 >> 10usize) & 0x01; | ||
| 26006 | val != 0 | ||
| 26007 | } | ||
| 26008 | #[doc = "Bank 1 CRC sector list clear bit"] | ||
| 26009 | pub fn set_clean_sect(&mut self, val: bool) { | ||
| 26010 | self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); | ||
| 26011 | } | ||
| 26012 | #[doc = "Bank 1 CRC start bit"] | ||
| 26013 | pub const fn start_crc(&self) -> bool { | ||
| 26014 | let val = (self.0 >> 16usize) & 0x01; | ||
| 26015 | val != 0 | ||
| 26016 | } | ||
| 26017 | #[doc = "Bank 1 CRC start bit"] | ||
| 26018 | pub fn set_start_crc(&mut self, val: bool) { | ||
| 26019 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | ||
| 26020 | } | ||
| 26021 | #[doc = "Bank 1 CRC clear bit"] | ||
| 26022 | pub const fn clean_crc(&self) -> bool { | ||
| 26023 | let val = (self.0 >> 17usize) & 0x01; | ||
| 26024 | val != 0 | ||
| 26025 | } | ||
| 26026 | #[doc = "Bank 1 CRC clear bit"] | ||
| 26027 | pub fn set_clean_crc(&mut self, val: bool) { | ||
| 26028 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); | ||
| 26029 | } | ||
| 26030 | #[doc = "Bank 1 CRC burst size"] | ||
| 26031 | pub const fn crc_burst(&self) -> u8 { | ||
| 26032 | let val = (self.0 >> 20usize) & 0x03; | ||
| 26033 | val as u8 | ||
| 26034 | } | ||
| 26035 | #[doc = "Bank 1 CRC burst size"] | ||
| 26036 | pub fn set_crc_burst(&mut self, val: u8) { | ||
| 26037 | self.0 = (self.0 & !(0x03 << 20usize)) | (((val as u32) & 0x03) << 20usize); | ||
| 26038 | } | ||
| 15429 | } | 26039 | } |
| 15430 | impl Default for Memrmp { | 26040 | impl Default for Crccr { |
| 15431 | fn default() -> Memrmp { | 26041 | fn default() -> Crccr { |
| 15432 | Memrmp(0) | 26042 | Crccr(0) |
| 26043 | } | ||
| 26044 | } | ||
| 26045 | #[doc = "FLASH key register for bank 1"] | ||
| 26046 | #[repr(transparent)] | ||
| 26047 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 26048 | pub struct Keyr(pub u32); | ||
| 26049 | impl Keyr { | ||
| 26050 | #[doc = "Bank 1 access configuration unlock key"] | ||
| 26051 | pub const fn keyr(&self) -> u32 { | ||
| 26052 | let val = (self.0 >> 0usize) & 0xffff_ffff; | ||
| 26053 | val as u32 | ||
| 26054 | } | ||
| 26055 | #[doc = "Bank 1 access configuration unlock key"] | ||
| 26056 | pub fn set_keyr(&mut self, val: u32) { | ||
| 26057 | self.0 = | ||
| 26058 | (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); | ||
| 26059 | } | ||
| 26060 | } | ||
| 26061 | impl Default for Keyr { | ||
| 26062 | fn default() -> Keyr { | ||
| 26063 | Keyr(0) | ||
| 26064 | } | ||
| 26065 | } | ||
| 26066 | #[doc = "FLASH clear control register for bank 1"] | ||
| 26067 | #[repr(transparent)] | ||
| 26068 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 26069 | pub struct Ccr(pub u32); | ||
| 26070 | impl Ccr { | ||
| 26071 | #[doc = "Bank 1 EOP1 flag clear bit"] | ||
| 26072 | pub const fn clr_eop(&self) -> bool { | ||
| 26073 | let val = (self.0 >> 16usize) & 0x01; | ||
| 26074 | val != 0 | ||
| 26075 | } | ||
| 26076 | #[doc = "Bank 1 EOP1 flag clear bit"] | ||
| 26077 | pub fn set_clr_eop(&mut self, val: bool) { | ||
| 26078 | self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); | ||
| 26079 | } | ||
| 26080 | #[doc = "Bank 1 WRPERR1 flag clear bit"] | ||
| 26081 | pub const fn clr_wrperr(&self) -> bool { | ||
| 26082 | let val = (self.0 >> 17usize) & 0x01; | ||
| 26083 | val != 0 | ||
| 26084 | } | ||
| 26085 | #[doc = "Bank 1 WRPERR1 flag clear bit"] | ||
| 26086 | pub fn set_clr_wrperr(&mut self, val: bool) { | ||
| 26087 | self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); | ||
| 26088 | } | ||
| 26089 | #[doc = "Bank 1 PGSERR1 flag clear bi"] | ||
| 26090 | pub const fn clr_pgserr(&self) -> bool { | ||
| 26091 | let val = (self.0 >> 18usize) & 0x01; | ||
| 26092 | val != 0 | ||
| 26093 | } | ||
| 26094 | #[doc = "Bank 1 PGSERR1 flag clear bi"] | ||
| 26095 | pub fn set_clr_pgserr(&mut self, val: bool) { | ||
| 26096 | self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); | ||
| 26097 | } | ||
| 26098 | #[doc = "Bank 1 STRBERR1 flag clear bit"] | ||
| 26099 | pub const fn clr_strberr(&self) -> bool { | ||
| 26100 | let val = (self.0 >> 19usize) & 0x01; | ||
| 26101 | val != 0 | ||
| 26102 | } | ||
| 26103 | #[doc = "Bank 1 STRBERR1 flag clear bit"] | ||
| 26104 | pub fn set_clr_strberr(&mut self, val: bool) { | ||
| 26105 | self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); | ||
| 26106 | } | ||
| 26107 | #[doc = "Bank 1 INCERR1 flag clear bit"] | ||
| 26108 | pub const fn clr_incerr(&self) -> bool { | ||
| 26109 | let val = (self.0 >> 21usize) & 0x01; | ||
| 26110 | val != 0 | ||
| 26111 | } | ||
| 26112 | #[doc = "Bank 1 INCERR1 flag clear bit"] | ||
| 26113 | pub fn set_clr_incerr(&mut self, val: bool) { | ||
| 26114 | self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); | ||
| 26115 | } | ||
| 26116 | #[doc = "Bank 1 OPERR1 flag clear bit"] | ||
| 26117 | pub const fn clr_operr(&self) -> bool { | ||
| 26118 | let val = (self.0 >> 22usize) & 0x01; | ||
| 26119 | val != 0 | ||
| 26120 | } | ||
| 26121 | #[doc = "Bank 1 OPERR1 flag clear bit"] | ||
| 26122 | pub fn set_clr_operr(&mut self, val: bool) { | ||
| 26123 | self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); | ||
| 26124 | } | ||
| 26125 | #[doc = "Bank 1 RDPERR1 flag clear bit"] | ||
| 26126 | pub const fn clr_rdperr(&self) -> bool { | ||
| 26127 | let val = (self.0 >> 23usize) & 0x01; | ||
| 26128 | val != 0 | ||
| 26129 | } | ||
| 26130 | #[doc = "Bank 1 RDPERR1 flag clear bit"] | ||
| 26131 | pub fn set_clr_rdperr(&mut self, val: bool) { | ||
| 26132 | self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); | ||
| 26133 | } | ||
| 26134 | #[doc = "Bank 1 RDSERR1 flag clear bit"] | ||
| 26135 | pub const fn clr_rdserr(&self) -> bool { | ||
| 26136 | let val = (self.0 >> 24usize) & 0x01; | ||
| 26137 | val != 0 | ||
| 26138 | } | ||
| 26139 | #[doc = "Bank 1 RDSERR1 flag clear bit"] | ||
| 26140 | pub fn set_clr_rdserr(&mut self, val: bool) { | ||
| 26141 | self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize); | ||
| 26142 | } | ||
| 26143 | #[doc = "Bank 1 SNECCERR1 flag clear bit"] | ||
| 26144 | pub const fn clr_sneccerr(&self) -> bool { | ||
| 26145 | let val = (self.0 >> 25usize) & 0x01; | ||
| 26146 | val != 0 | ||
| 26147 | } | ||
| 26148 | #[doc = "Bank 1 SNECCERR1 flag clear bit"] | ||
| 26149 | pub fn set_clr_sneccerr(&mut self, val: bool) { | ||
| 26150 | self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize); | ||
| 26151 | } | ||
| 26152 | #[doc = "Bank 1 DBECCERR1 flag clear bit"] | ||
| 26153 | pub const fn clr_dbeccerr(&self) -> bool { | ||
| 26154 | let val = (self.0 >> 26usize) & 0x01; | ||
| 26155 | val != 0 | ||
| 26156 | } | ||
| 26157 | #[doc = "Bank 1 DBECCERR1 flag clear bit"] | ||
| 26158 | pub fn set_clr_dbeccerr(&mut self, val: bool) { | ||
| 26159 | self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); | ||
| 26160 | } | ||
| 26161 | #[doc = "Bank 1 CRCEND1 flag clear bit"] | ||
| 26162 | pub const fn clr_crcend(&self) -> bool { | ||
| 26163 | let val = (self.0 >> 27usize) & 0x01; | ||
| 26164 | val != 0 | ||
| 26165 | } | ||
| 26166 | #[doc = "Bank 1 CRCEND1 flag clear bit"] | ||
| 26167 | pub fn set_clr_crcend(&mut self, val: bool) { | ||
| 26168 | self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize); | ||
| 26169 | } | ||
| 26170 | } | ||
| 26171 | impl Default for Ccr { | ||
| 26172 | fn default() -> Ccr { | ||
| 26173 | Ccr(0) | ||
| 26174 | } | ||
| 26175 | } | ||
| 26176 | #[doc = "FLASH protection address for bank 1"] | ||
| 26177 | #[repr(transparent)] | ||
| 26178 | #[derive(Copy, Clone, Eq, PartialEq)] | ||
| 26179 | pub struct PrarPrg(pub u32); | ||
| 26180 | impl PrarPrg { | ||
| 26181 | #[doc = "Bank 1 lowest PCROP protected address configuration"] | ||
| 26182 | pub const fn prot_area_start(&self) -> u16 { | ||
| 26183 | let val = (self.0 >> 0usize) & 0x0fff; | ||
| 26184 | val as u16 | ||
| 26185 | } | ||
| 26186 | #[doc = "Bank 1 lowest PCROP protected address configuration"] | ||
| 26187 | pub fn set_prot_area_start(&mut self, val: u16) { | ||
| 26188 | self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); | ||
| 26189 | } | ||
| 26190 | #[doc = "Bank 1 highest PCROP protected address configuration"] | ||
| 26191 | pub const fn prot_area_end(&self) -> u16 { | ||
| 26192 | let val = (self.0 >> 16usize) & 0x0fff; | ||
| 26193 | val as u16 | ||
| 26194 | } | ||
| 26195 | #[doc = "Bank 1 highest PCROP protected address configuration"] | ||
| 26196 | pub fn set_prot_area_end(&mut self, val: u16) { | ||
| 26197 | self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); | ||
| 26198 | } | ||
| 26199 | #[doc = "Bank 1 PCROP protected erase enable option configuration bit"] | ||
| 26200 | pub const fn dmep(&self) -> bool { | ||
| 26201 | let val = (self.0 >> 31usize) & 0x01; | ||
| 26202 | val != 0 | ||
| 26203 | } | ||
| 26204 | #[doc = "Bank 1 PCROP protected erase enable option configuration bit"] | ||
| 26205 | pub fn set_dmep(&mut self, val: bool) { | ||
| 26206 | self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize); | ||
| 26207 | } | ||
| 26208 | } | ||
| 26209 | impl Default for PrarPrg { | ||
| 26210 | fn default() -> PrarPrg { | ||
| 26211 | PrarPrg(0) | ||
| 15433 | } | 26212 | } |
| 15434 | } | 26213 | } |
| 15435 | } | 26214 | } |
diff --git a/embassy-stm32/src/pac/stm32h723ve.rs b/embassy-stm32/src/pac/stm32h723ve.rs index 6461aca12..43e5fc3c7 100644 --- a/embassy-stm32/src/pac/stm32h723ve.rs +++ b/embassy-stm32/src/pac/stm32h723ve.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -194,6 +196,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 194 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 196 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 195 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 197 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 196 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 198 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 199 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 200 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 201 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 202 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 203 | pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); | ||
| 204 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 197 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 205 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 198 | impl_rng!(RNG, RNG); | 206 | impl_rng!(RNG, RNG); |
| 199 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 207 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -283,27 +291,32 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 283 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 291 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 284 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 292 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 285 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 293 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 294 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 286 | pub use super::regs::dma_v2 as dma; | 295 | pub use super::regs::dma_v2 as dma; |
| 287 | pub use super::regs::exti_v1 as exti; | 296 | pub use super::regs::exti_v1 as exti; |
| 297 | pub use super::regs::flash_h7 as flash; | ||
| 288 | pub use super::regs::gpio_v2 as gpio; | 298 | pub use super::regs::gpio_v2 as gpio; |
| 299 | pub use super::regs::i2c_v2 as i2c; | ||
| 300 | pub use super::regs::pwr_h7 as pwr; | ||
| 289 | pub use super::regs::rng_v1 as rng; | 301 | pub use super::regs::rng_v1 as rng; |
| 290 | pub use super::regs::sdmmc_v2 as sdmmc; | 302 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 291 | pub use super::regs::spi_v3 as spi; | 303 | pub use super::regs::spi_v3 as spi; |
| 292 | pub use super::regs::syscfg_h7 as syscfg; | 304 | pub use super::regs::syscfg_h7 as syscfg; |
| 293 | embassy_extras::peripherals!( | 305 | embassy_extras::peripherals!( |
| 294 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 306 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 295 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 307 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 296 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 308 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 297 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 309 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 298 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 310 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 299 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 311 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 300 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 312 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 301 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 313 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 302 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 314 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 303 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 315 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 304 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 316 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, |
| 305 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 317 | PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, |
| 306 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | 318 | PK10, PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, I2C5, PWR, RNG, SDMMC1, SDMMC2, |
| 319 | SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | ||
| 307 | ); | 320 | ); |
| 308 | pub fn DMA(n: u8) -> dma::Dma { | 321 | pub fn DMA(n: u8) -> dma::Dma { |
| 309 | match n { | 322 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h723vg.rs b/embassy-stm32/src/pac/stm32h723vg.rs index 6461aca12..43e5fc3c7 100644 --- a/embassy-stm32/src/pac/stm32h723vg.rs +++ b/embassy-stm32/src/pac/stm32h723vg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -194,6 +196,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 194 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 196 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 195 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 197 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 196 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 198 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 199 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 200 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 201 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 202 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 203 | pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); | ||
| 204 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 197 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 205 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 198 | impl_rng!(RNG, RNG); | 206 | impl_rng!(RNG, RNG); |
| 199 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 207 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -283,27 +291,32 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 283 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 291 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 284 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 292 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 285 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 293 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 294 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 286 | pub use super::regs::dma_v2 as dma; | 295 | pub use super::regs::dma_v2 as dma; |
| 287 | pub use super::regs::exti_v1 as exti; | 296 | pub use super::regs::exti_v1 as exti; |
| 297 | pub use super::regs::flash_h7 as flash; | ||
| 288 | pub use super::regs::gpio_v2 as gpio; | 298 | pub use super::regs::gpio_v2 as gpio; |
| 299 | pub use super::regs::i2c_v2 as i2c; | ||
| 300 | pub use super::regs::pwr_h7 as pwr; | ||
| 289 | pub use super::regs::rng_v1 as rng; | 301 | pub use super::regs::rng_v1 as rng; |
| 290 | pub use super::regs::sdmmc_v2 as sdmmc; | 302 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 291 | pub use super::regs::spi_v3 as spi; | 303 | pub use super::regs::spi_v3 as spi; |
| 292 | pub use super::regs::syscfg_h7 as syscfg; | 304 | pub use super::regs::syscfg_h7 as syscfg; |
| 293 | embassy_extras::peripherals!( | 305 | embassy_extras::peripherals!( |
| 294 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 306 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 295 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 307 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 296 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 308 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 297 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 309 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 298 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 310 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 299 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 311 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 300 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 312 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 301 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 313 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 302 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 314 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 303 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 315 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 304 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 316 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, |
| 305 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 317 | PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, |
| 306 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | 318 | PK10, PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, I2C5, PWR, RNG, SDMMC1, SDMMC2, |
| 319 | SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | ||
| 307 | ); | 320 | ); |
| 308 | pub fn DMA(n: u8) -> dma::Dma { | 321 | pub fn DMA(n: u8) -> dma::Dma { |
| 309 | match n { | 322 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h723ze.rs b/embassy-stm32/src/pac/stm32h723ze.rs index e49e375ba..34c260b21 100644 --- a/embassy-stm32/src/pac/stm32h723ze.rs +++ b/embassy-stm32/src/pac/stm32h723ze.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -194,6 +196,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 194 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 196 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 195 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 197 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 196 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 198 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 199 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 200 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 201 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 202 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 203 | pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); | ||
| 204 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 197 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 205 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 198 | impl_rng!(RNG, RNG); | 206 | impl_rng!(RNG, RNG); |
| 199 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 207 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -294,27 +302,32 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 302 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 303 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 304 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 305 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 297 | pub use super::regs::dma_v2 as dma; | 306 | pub use super::regs::dma_v2 as dma; |
| 298 | pub use super::regs::exti_v1 as exti; | 307 | pub use super::regs::exti_v1 as exti; |
| 308 | pub use super::regs::flash_h7 as flash; | ||
| 299 | pub use super::regs::gpio_v2 as gpio; | 309 | pub use super::regs::gpio_v2 as gpio; |
| 310 | pub use super::regs::i2c_v2 as i2c; | ||
| 311 | pub use super::regs::pwr_h7 as pwr; | ||
| 300 | pub use super::regs::rng_v1 as rng; | 312 | pub use super::regs::rng_v1 as rng; |
| 301 | pub use super::regs::sdmmc_v2 as sdmmc; | 313 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 302 | pub use super::regs::spi_v3 as spi; | 314 | pub use super::regs::spi_v3 as spi; |
| 303 | pub use super::regs::syscfg_h7 as syscfg; | 315 | pub use super::regs::syscfg_h7 as syscfg; |
| 304 | embassy_extras::peripherals!( | 316 | embassy_extras::peripherals!( |
| 305 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 317 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 306 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 318 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 307 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 319 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 308 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 320 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 309 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 321 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 310 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 322 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 311 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 323 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 312 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 324 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 313 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 325 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 314 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 326 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 315 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 327 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, |
| 316 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 328 | PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, |
| 317 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 329 | PK10, PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, I2C5, PWR, RNG, SDMMC1, SDMMC2, |
| 330 | SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 318 | ); | 331 | ); |
| 319 | pub fn DMA(n: u8) -> dma::Dma { | 332 | pub fn DMA(n: u8) -> dma::Dma { |
| 320 | match n { | 333 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h723zg.rs b/embassy-stm32/src/pac/stm32h723zg.rs index e49e375ba..34c260b21 100644 --- a/embassy-stm32/src/pac/stm32h723zg.rs +++ b/embassy-stm32/src/pac/stm32h723zg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -194,6 +196,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 194 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 196 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 195 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 197 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 196 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 198 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 199 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 200 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 201 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 202 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 203 | pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); | ||
| 204 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 197 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 205 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 198 | impl_rng!(RNG, RNG); | 206 | impl_rng!(RNG, RNG); |
| 199 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 207 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -294,27 +302,32 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 302 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 303 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 304 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 305 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 297 | pub use super::regs::dma_v2 as dma; | 306 | pub use super::regs::dma_v2 as dma; |
| 298 | pub use super::regs::exti_v1 as exti; | 307 | pub use super::regs::exti_v1 as exti; |
| 308 | pub use super::regs::flash_h7 as flash; | ||
| 299 | pub use super::regs::gpio_v2 as gpio; | 309 | pub use super::regs::gpio_v2 as gpio; |
| 310 | pub use super::regs::i2c_v2 as i2c; | ||
| 311 | pub use super::regs::pwr_h7 as pwr; | ||
| 300 | pub use super::regs::rng_v1 as rng; | 312 | pub use super::regs::rng_v1 as rng; |
| 301 | pub use super::regs::sdmmc_v2 as sdmmc; | 313 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 302 | pub use super::regs::spi_v3 as spi; | 314 | pub use super::regs::spi_v3 as spi; |
| 303 | pub use super::regs::syscfg_h7 as syscfg; | 315 | pub use super::regs::syscfg_h7 as syscfg; |
| 304 | embassy_extras::peripherals!( | 316 | embassy_extras::peripherals!( |
| 305 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 317 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 306 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 318 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 307 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 319 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 308 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 320 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 309 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 321 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 310 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 322 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 311 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 323 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 312 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 324 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 313 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 325 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 314 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 326 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 315 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 327 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, |
| 316 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 328 | PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, |
| 317 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 329 | PK10, PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, I2C5, PWR, RNG, SDMMC1, SDMMC2, |
| 330 | SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 318 | ); | 331 | ); |
| 319 | pub fn DMA(n: u8) -> dma::Dma { | 332 | pub fn DMA(n: u8) -> dma::Dma { |
| 320 | match n { | 333 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h725ae.rs b/embassy-stm32/src/pac/stm32h725ae.rs index e49e375ba..34c260b21 100644 --- a/embassy-stm32/src/pac/stm32h725ae.rs +++ b/embassy-stm32/src/pac/stm32h725ae.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -194,6 +196,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 194 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 196 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 195 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 197 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 196 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 198 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 199 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 200 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 201 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 202 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 203 | pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); | ||
| 204 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 197 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 205 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 198 | impl_rng!(RNG, RNG); | 206 | impl_rng!(RNG, RNG); |
| 199 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 207 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -294,27 +302,32 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 302 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 303 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 304 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 305 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 297 | pub use super::regs::dma_v2 as dma; | 306 | pub use super::regs::dma_v2 as dma; |
| 298 | pub use super::regs::exti_v1 as exti; | 307 | pub use super::regs::exti_v1 as exti; |
| 308 | pub use super::regs::flash_h7 as flash; | ||
| 299 | pub use super::regs::gpio_v2 as gpio; | 309 | pub use super::regs::gpio_v2 as gpio; |
| 310 | pub use super::regs::i2c_v2 as i2c; | ||
| 311 | pub use super::regs::pwr_h7 as pwr; | ||
| 300 | pub use super::regs::rng_v1 as rng; | 312 | pub use super::regs::rng_v1 as rng; |
| 301 | pub use super::regs::sdmmc_v2 as sdmmc; | 313 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 302 | pub use super::regs::spi_v3 as spi; | 314 | pub use super::regs::spi_v3 as spi; |
| 303 | pub use super::regs::syscfg_h7 as syscfg; | 315 | pub use super::regs::syscfg_h7 as syscfg; |
| 304 | embassy_extras::peripherals!( | 316 | embassy_extras::peripherals!( |
| 305 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 317 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 306 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 318 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 307 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 319 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 308 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 320 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 309 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 321 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 310 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 322 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 311 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 323 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 312 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 324 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 313 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 325 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 314 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 326 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 315 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 327 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, |
| 316 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 328 | PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, |
| 317 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 329 | PK10, PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, I2C5, PWR, RNG, SDMMC1, SDMMC2, |
| 330 | SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 318 | ); | 331 | ); |
| 319 | pub fn DMA(n: u8) -> dma::Dma { | 332 | pub fn DMA(n: u8) -> dma::Dma { |
| 320 | match n { | 333 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h725ag.rs b/embassy-stm32/src/pac/stm32h725ag.rs index e49e375ba..34c260b21 100644 --- a/embassy-stm32/src/pac/stm32h725ag.rs +++ b/embassy-stm32/src/pac/stm32h725ag.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -194,6 +196,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 194 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 196 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 195 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 197 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 196 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 198 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 199 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 200 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 201 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 202 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 203 | pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); | ||
| 204 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 197 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 205 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 198 | impl_rng!(RNG, RNG); | 206 | impl_rng!(RNG, RNG); |
| 199 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 207 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -294,27 +302,32 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 302 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 303 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 304 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 305 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 297 | pub use super::regs::dma_v2 as dma; | 306 | pub use super::regs::dma_v2 as dma; |
| 298 | pub use super::regs::exti_v1 as exti; | 307 | pub use super::regs::exti_v1 as exti; |
| 308 | pub use super::regs::flash_h7 as flash; | ||
| 299 | pub use super::regs::gpio_v2 as gpio; | 309 | pub use super::regs::gpio_v2 as gpio; |
| 310 | pub use super::regs::i2c_v2 as i2c; | ||
| 311 | pub use super::regs::pwr_h7 as pwr; | ||
| 300 | pub use super::regs::rng_v1 as rng; | 312 | pub use super::regs::rng_v1 as rng; |
| 301 | pub use super::regs::sdmmc_v2 as sdmmc; | 313 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 302 | pub use super::regs::spi_v3 as spi; | 314 | pub use super::regs::spi_v3 as spi; |
| 303 | pub use super::regs::syscfg_h7 as syscfg; | 315 | pub use super::regs::syscfg_h7 as syscfg; |
| 304 | embassy_extras::peripherals!( | 316 | embassy_extras::peripherals!( |
| 305 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 317 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 306 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 318 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 307 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 319 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 308 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 320 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 309 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 321 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 310 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 322 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 311 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 323 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 312 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 324 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 313 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 325 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 314 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 326 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 315 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 327 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, |
| 316 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 328 | PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, |
| 317 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 329 | PK10, PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, I2C5, PWR, RNG, SDMMC1, SDMMC2, |
| 330 | SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 318 | ); | 331 | ); |
| 319 | pub fn DMA(n: u8) -> dma::Dma { | 332 | pub fn DMA(n: u8) -> dma::Dma { |
| 320 | match n { | 333 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h725ie.rs b/embassy-stm32/src/pac/stm32h725ie.rs index e49e375ba..34c260b21 100644 --- a/embassy-stm32/src/pac/stm32h725ie.rs +++ b/embassy-stm32/src/pac/stm32h725ie.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -194,6 +196,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 194 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 196 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 195 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 197 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 196 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 198 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 199 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 200 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 201 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 202 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 203 | pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); | ||
| 204 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 197 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 205 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 198 | impl_rng!(RNG, RNG); | 206 | impl_rng!(RNG, RNG); |
| 199 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 207 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -294,27 +302,32 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 302 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 303 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 304 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 305 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 297 | pub use super::regs::dma_v2 as dma; | 306 | pub use super::regs::dma_v2 as dma; |
| 298 | pub use super::regs::exti_v1 as exti; | 307 | pub use super::regs::exti_v1 as exti; |
| 308 | pub use super::regs::flash_h7 as flash; | ||
| 299 | pub use super::regs::gpio_v2 as gpio; | 309 | pub use super::regs::gpio_v2 as gpio; |
| 310 | pub use super::regs::i2c_v2 as i2c; | ||
| 311 | pub use super::regs::pwr_h7 as pwr; | ||
| 300 | pub use super::regs::rng_v1 as rng; | 312 | pub use super::regs::rng_v1 as rng; |
| 301 | pub use super::regs::sdmmc_v2 as sdmmc; | 313 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 302 | pub use super::regs::spi_v3 as spi; | 314 | pub use super::regs::spi_v3 as spi; |
| 303 | pub use super::regs::syscfg_h7 as syscfg; | 315 | pub use super::regs::syscfg_h7 as syscfg; |
| 304 | embassy_extras::peripherals!( | 316 | embassy_extras::peripherals!( |
| 305 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 317 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 306 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 318 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 307 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 319 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 308 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 320 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 309 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 321 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 310 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 322 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 311 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 323 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 312 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 324 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 313 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 325 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 314 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 326 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 315 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 327 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, |
| 316 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 328 | PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, |
| 317 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 329 | PK10, PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, I2C5, PWR, RNG, SDMMC1, SDMMC2, |
| 330 | SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 318 | ); | 331 | ); |
| 319 | pub fn DMA(n: u8) -> dma::Dma { | 332 | pub fn DMA(n: u8) -> dma::Dma { |
| 320 | match n { | 333 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h725ig.rs b/embassy-stm32/src/pac/stm32h725ig.rs index e49e375ba..34c260b21 100644 --- a/embassy-stm32/src/pac/stm32h725ig.rs +++ b/embassy-stm32/src/pac/stm32h725ig.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -194,6 +196,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 194 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 196 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 195 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 197 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 196 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 198 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 199 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 200 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 201 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 202 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 203 | pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); | ||
| 204 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 197 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 205 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 198 | impl_rng!(RNG, RNG); | 206 | impl_rng!(RNG, RNG); |
| 199 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 207 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -294,27 +302,32 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 302 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 303 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 304 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 305 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 297 | pub use super::regs::dma_v2 as dma; | 306 | pub use super::regs::dma_v2 as dma; |
| 298 | pub use super::regs::exti_v1 as exti; | 307 | pub use super::regs::exti_v1 as exti; |
| 308 | pub use super::regs::flash_h7 as flash; | ||
| 299 | pub use super::regs::gpio_v2 as gpio; | 309 | pub use super::regs::gpio_v2 as gpio; |
| 310 | pub use super::regs::i2c_v2 as i2c; | ||
| 311 | pub use super::regs::pwr_h7 as pwr; | ||
| 300 | pub use super::regs::rng_v1 as rng; | 312 | pub use super::regs::rng_v1 as rng; |
| 301 | pub use super::regs::sdmmc_v2 as sdmmc; | 313 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 302 | pub use super::regs::spi_v3 as spi; | 314 | pub use super::regs::spi_v3 as spi; |
| 303 | pub use super::regs::syscfg_h7 as syscfg; | 315 | pub use super::regs::syscfg_h7 as syscfg; |
| 304 | embassy_extras::peripherals!( | 316 | embassy_extras::peripherals!( |
| 305 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 317 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 306 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 318 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 307 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 319 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 308 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 320 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 309 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 321 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 310 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 322 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 311 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 323 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 312 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 324 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 313 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 325 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 314 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 326 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 315 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 327 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, |
| 316 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 328 | PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, |
| 317 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 329 | PK10, PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, I2C5, PWR, RNG, SDMMC1, SDMMC2, |
| 330 | SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 318 | ); | 331 | ); |
| 319 | pub fn DMA(n: u8) -> dma::Dma { | 332 | pub fn DMA(n: u8) -> dma::Dma { |
| 320 | match n { | 333 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h725re.rs b/embassy-stm32/src/pac/stm32h725re.rs index e45bc1fde..28b16c90b 100644 --- a/embassy-stm32/src/pac/stm32h725re.rs +++ b/embassy-stm32/src/pac/stm32h725re.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -194,6 +196,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 194 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 196 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 195 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 197 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 196 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 198 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 199 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 200 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 201 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 202 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 203 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 197 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 204 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 198 | impl_rng!(RNG, RNG); | 205 | impl_rng!(RNG, RNG); |
| 199 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 206 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -275,27 +282,32 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 275 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 282 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 276 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 283 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 277 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 284 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 285 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 278 | pub use super::regs::dma_v2 as dma; | 286 | pub use super::regs::dma_v2 as dma; |
| 279 | pub use super::regs::exti_v1 as exti; | 287 | pub use super::regs::exti_v1 as exti; |
| 288 | pub use super::regs::flash_h7 as flash; | ||
| 280 | pub use super::regs::gpio_v2 as gpio; | 289 | pub use super::regs::gpio_v2 as gpio; |
| 290 | pub use super::regs::i2c_v2 as i2c; | ||
| 291 | pub use super::regs::pwr_h7 as pwr; | ||
| 281 | pub use super::regs::rng_v1 as rng; | 292 | pub use super::regs::rng_v1 as rng; |
| 282 | pub use super::regs::sdmmc_v2 as sdmmc; | 293 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 283 | pub use super::regs::spi_v3 as spi; | 294 | pub use super::regs::spi_v3 as spi; |
| 284 | pub use super::regs::syscfg_h7 as syscfg; | 295 | pub use super::regs::syscfg_h7 as syscfg; |
| 285 | embassy_extras::peripherals!( | 296 | embassy_extras::peripherals!( |
| 286 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 297 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 287 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 298 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 288 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 299 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 289 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 300 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 290 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 301 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 291 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 302 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 292 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 303 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 293 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 304 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 294 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 305 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 295 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 306 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 296 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 307 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, |
| 297 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 308 | PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, |
| 298 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI6, SYSCFG | 309 | PK10, PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, |
| 310 | SPI2, SPI3, SPI6, SYSCFG | ||
| 299 | ); | 311 | ); |
| 300 | pub fn DMA(n: u8) -> dma::Dma { | 312 | pub fn DMA(n: u8) -> dma::Dma { |
| 301 | match n { | 313 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h725rg.rs b/embassy-stm32/src/pac/stm32h725rg.rs index e45bc1fde..28b16c90b 100644 --- a/embassy-stm32/src/pac/stm32h725rg.rs +++ b/embassy-stm32/src/pac/stm32h725rg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -194,6 +196,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 194 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 196 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 195 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 197 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 196 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 198 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 199 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 200 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 201 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 202 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 203 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 197 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 204 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 198 | impl_rng!(RNG, RNG); | 205 | impl_rng!(RNG, RNG); |
| 199 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 206 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -275,27 +282,32 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 275 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 282 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 276 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 283 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 277 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 284 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 285 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 278 | pub use super::regs::dma_v2 as dma; | 286 | pub use super::regs::dma_v2 as dma; |
| 279 | pub use super::regs::exti_v1 as exti; | 287 | pub use super::regs::exti_v1 as exti; |
| 288 | pub use super::regs::flash_h7 as flash; | ||
| 280 | pub use super::regs::gpio_v2 as gpio; | 289 | pub use super::regs::gpio_v2 as gpio; |
| 290 | pub use super::regs::i2c_v2 as i2c; | ||
| 291 | pub use super::regs::pwr_h7 as pwr; | ||
| 281 | pub use super::regs::rng_v1 as rng; | 292 | pub use super::regs::rng_v1 as rng; |
| 282 | pub use super::regs::sdmmc_v2 as sdmmc; | 293 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 283 | pub use super::regs::spi_v3 as spi; | 294 | pub use super::regs::spi_v3 as spi; |
| 284 | pub use super::regs::syscfg_h7 as syscfg; | 295 | pub use super::regs::syscfg_h7 as syscfg; |
| 285 | embassy_extras::peripherals!( | 296 | embassy_extras::peripherals!( |
| 286 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 297 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 287 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 298 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 288 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 299 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 289 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 300 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 290 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 301 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 291 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 302 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 292 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 303 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 293 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 304 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 294 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 305 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 295 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 306 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 296 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 307 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, |
| 297 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 308 | PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, |
| 298 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI6, SYSCFG | 309 | PK10, PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, |
| 310 | SPI2, SPI3, SPI6, SYSCFG | ||
| 299 | ); | 311 | ); |
| 300 | pub fn DMA(n: u8) -> dma::Dma { | 312 | pub fn DMA(n: u8) -> dma::Dma { |
| 301 | match n { | 313 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h725ve.rs b/embassy-stm32/src/pac/stm32h725ve.rs index 6461aca12..43e5fc3c7 100644 --- a/embassy-stm32/src/pac/stm32h725ve.rs +++ b/embassy-stm32/src/pac/stm32h725ve.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -194,6 +196,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 194 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 196 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 195 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 197 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 196 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 198 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 199 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 200 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 201 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 202 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 203 | pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); | ||
| 204 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 197 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 205 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 198 | impl_rng!(RNG, RNG); | 206 | impl_rng!(RNG, RNG); |
| 199 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 207 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -283,27 +291,32 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 283 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 291 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 284 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 292 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 285 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 293 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 294 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 286 | pub use super::regs::dma_v2 as dma; | 295 | pub use super::regs::dma_v2 as dma; |
| 287 | pub use super::regs::exti_v1 as exti; | 296 | pub use super::regs::exti_v1 as exti; |
| 297 | pub use super::regs::flash_h7 as flash; | ||
| 288 | pub use super::regs::gpio_v2 as gpio; | 298 | pub use super::regs::gpio_v2 as gpio; |
| 299 | pub use super::regs::i2c_v2 as i2c; | ||
| 300 | pub use super::regs::pwr_h7 as pwr; | ||
| 289 | pub use super::regs::rng_v1 as rng; | 301 | pub use super::regs::rng_v1 as rng; |
| 290 | pub use super::regs::sdmmc_v2 as sdmmc; | 302 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 291 | pub use super::regs::spi_v3 as spi; | 303 | pub use super::regs::spi_v3 as spi; |
| 292 | pub use super::regs::syscfg_h7 as syscfg; | 304 | pub use super::regs::syscfg_h7 as syscfg; |
| 293 | embassy_extras::peripherals!( | 305 | embassy_extras::peripherals!( |
| 294 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 306 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 295 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 307 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 296 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 308 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 297 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 309 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 298 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 310 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 299 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 311 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 300 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 312 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 301 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 313 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 302 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 314 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 303 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 315 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 304 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 316 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, |
| 305 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 317 | PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, |
| 306 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | 318 | PK10, PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, I2C5, PWR, RNG, SDMMC1, SDMMC2, |
| 319 | SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | ||
| 307 | ); | 320 | ); |
| 308 | pub fn DMA(n: u8) -> dma::Dma { | 321 | pub fn DMA(n: u8) -> dma::Dma { |
| 309 | match n { | 322 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h725vg.rs b/embassy-stm32/src/pac/stm32h725vg.rs index 6461aca12..43e5fc3c7 100644 --- a/embassy-stm32/src/pac/stm32h725vg.rs +++ b/embassy-stm32/src/pac/stm32h725vg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -194,6 +196,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 194 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 196 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 195 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 197 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 196 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 198 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 199 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 200 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 201 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 202 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 203 | pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); | ||
| 204 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 197 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 205 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 198 | impl_rng!(RNG, RNG); | 206 | impl_rng!(RNG, RNG); |
| 199 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 207 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -283,27 +291,32 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 283 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 291 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 284 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 292 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 285 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 293 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 294 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 286 | pub use super::regs::dma_v2 as dma; | 295 | pub use super::regs::dma_v2 as dma; |
| 287 | pub use super::regs::exti_v1 as exti; | 296 | pub use super::regs::exti_v1 as exti; |
| 297 | pub use super::regs::flash_h7 as flash; | ||
| 288 | pub use super::regs::gpio_v2 as gpio; | 298 | pub use super::regs::gpio_v2 as gpio; |
| 299 | pub use super::regs::i2c_v2 as i2c; | ||
| 300 | pub use super::regs::pwr_h7 as pwr; | ||
| 289 | pub use super::regs::rng_v1 as rng; | 301 | pub use super::regs::rng_v1 as rng; |
| 290 | pub use super::regs::sdmmc_v2 as sdmmc; | 302 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 291 | pub use super::regs::spi_v3 as spi; | 303 | pub use super::regs::spi_v3 as spi; |
| 292 | pub use super::regs::syscfg_h7 as syscfg; | 304 | pub use super::regs::syscfg_h7 as syscfg; |
| 293 | embassy_extras::peripherals!( | 305 | embassy_extras::peripherals!( |
| 294 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 306 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 295 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 307 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 296 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 308 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 297 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 309 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 298 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 310 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 299 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 311 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 300 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 312 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 301 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 313 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 302 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 314 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 303 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 315 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 304 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 316 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, |
| 305 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 317 | PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, |
| 306 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | 318 | PK10, PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, I2C5, PWR, RNG, SDMMC1, SDMMC2, |
| 319 | SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | ||
| 307 | ); | 320 | ); |
| 308 | pub fn DMA(n: u8) -> dma::Dma { | 321 | pub fn DMA(n: u8) -> dma::Dma { |
| 309 | match n { | 322 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h725ze.rs b/embassy-stm32/src/pac/stm32h725ze.rs index e49e375ba..34c260b21 100644 --- a/embassy-stm32/src/pac/stm32h725ze.rs +++ b/embassy-stm32/src/pac/stm32h725ze.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -194,6 +196,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 194 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 196 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 195 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 197 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 196 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 198 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 199 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 200 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 201 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 202 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 203 | pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); | ||
| 204 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 197 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 205 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 198 | impl_rng!(RNG, RNG); | 206 | impl_rng!(RNG, RNG); |
| 199 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 207 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -294,27 +302,32 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 302 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 303 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 304 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 305 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 297 | pub use super::regs::dma_v2 as dma; | 306 | pub use super::regs::dma_v2 as dma; |
| 298 | pub use super::regs::exti_v1 as exti; | 307 | pub use super::regs::exti_v1 as exti; |
| 308 | pub use super::regs::flash_h7 as flash; | ||
| 299 | pub use super::regs::gpio_v2 as gpio; | 309 | pub use super::regs::gpio_v2 as gpio; |
| 310 | pub use super::regs::i2c_v2 as i2c; | ||
| 311 | pub use super::regs::pwr_h7 as pwr; | ||
| 300 | pub use super::regs::rng_v1 as rng; | 312 | pub use super::regs::rng_v1 as rng; |
| 301 | pub use super::regs::sdmmc_v2 as sdmmc; | 313 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 302 | pub use super::regs::spi_v3 as spi; | 314 | pub use super::regs::spi_v3 as spi; |
| 303 | pub use super::regs::syscfg_h7 as syscfg; | 315 | pub use super::regs::syscfg_h7 as syscfg; |
| 304 | embassy_extras::peripherals!( | 316 | embassy_extras::peripherals!( |
| 305 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 317 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 306 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 318 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 307 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 319 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 308 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 320 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 309 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 321 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 310 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 322 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 311 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 323 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 312 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 324 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 313 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 325 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 314 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 326 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 315 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 327 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, |
| 316 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 328 | PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, |
| 317 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 329 | PK10, PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, I2C5, PWR, RNG, SDMMC1, SDMMC2, |
| 330 | SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 318 | ); | 331 | ); |
| 319 | pub fn DMA(n: u8) -> dma::Dma { | 332 | pub fn DMA(n: u8) -> dma::Dma { |
| 320 | match n { | 333 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h725zg.rs b/embassy-stm32/src/pac/stm32h725zg.rs index e49e375ba..34c260b21 100644 --- a/embassy-stm32/src/pac/stm32h725zg.rs +++ b/embassy-stm32/src/pac/stm32h725zg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -194,6 +196,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 194 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 196 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 195 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 197 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 196 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 198 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 199 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 200 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 201 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 202 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 203 | pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); | ||
| 204 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 197 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 205 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 198 | impl_rng!(RNG, RNG); | 206 | impl_rng!(RNG, RNG); |
| 199 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 207 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -294,27 +302,32 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 302 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 303 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 304 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 305 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 297 | pub use super::regs::dma_v2 as dma; | 306 | pub use super::regs::dma_v2 as dma; |
| 298 | pub use super::regs::exti_v1 as exti; | 307 | pub use super::regs::exti_v1 as exti; |
| 308 | pub use super::regs::flash_h7 as flash; | ||
| 299 | pub use super::regs::gpio_v2 as gpio; | 309 | pub use super::regs::gpio_v2 as gpio; |
| 310 | pub use super::regs::i2c_v2 as i2c; | ||
| 311 | pub use super::regs::pwr_h7 as pwr; | ||
| 300 | pub use super::regs::rng_v1 as rng; | 312 | pub use super::regs::rng_v1 as rng; |
| 301 | pub use super::regs::sdmmc_v2 as sdmmc; | 313 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 302 | pub use super::regs::spi_v3 as spi; | 314 | pub use super::regs::spi_v3 as spi; |
| 303 | pub use super::regs::syscfg_h7 as syscfg; | 315 | pub use super::regs::syscfg_h7 as syscfg; |
| 304 | embassy_extras::peripherals!( | 316 | embassy_extras::peripherals!( |
| 305 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 317 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 306 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 318 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 307 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 319 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 308 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 320 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 309 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 321 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 310 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 322 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 311 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 323 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 312 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 324 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 313 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 325 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 314 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 326 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 315 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 327 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, |
| 316 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 328 | PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, |
| 317 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 329 | PK10, PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, I2C5, PWR, RNG, SDMMC1, SDMMC2, |
| 330 | SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 318 | ); | 331 | ); |
| 319 | pub fn DMA(n: u8) -> dma::Dma { | 332 | pub fn DMA(n: u8) -> dma::Dma { |
| 320 | match n { | 333 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h730ab.rs b/embassy-stm32/src/pac/stm32h730ab.rs index 876f64442..77a7f9999 100644 --- a/embassy-stm32/src/pac/stm32h730ab.rs +++ b/embassy-stm32/src/pac/stm32h730ab.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -194,6 +196,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 194 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 196 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 195 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 197 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 196 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 198 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 199 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 200 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 201 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 202 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 203 | pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); | ||
| 204 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 197 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 205 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 198 | impl_rng!(RNG, HASH_RNG); | 206 | impl_rng!(RNG, HASH_RNG); |
| 199 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 207 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -294,27 +302,32 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 302 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 303 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 304 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 305 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 297 | pub use super::regs::dma_v2 as dma; | 306 | pub use super::regs::dma_v2 as dma; |
| 298 | pub use super::regs::exti_v1 as exti; | 307 | pub use super::regs::exti_v1 as exti; |
| 308 | pub use super::regs::flash_h7 as flash; | ||
| 299 | pub use super::regs::gpio_v2 as gpio; | 309 | pub use super::regs::gpio_v2 as gpio; |
| 310 | pub use super::regs::i2c_v2 as i2c; | ||
| 311 | pub use super::regs::pwr_h7 as pwr; | ||
| 300 | pub use super::regs::rng_v1 as rng; | 312 | pub use super::regs::rng_v1 as rng; |
| 301 | pub use super::regs::sdmmc_v2 as sdmmc; | 313 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 302 | pub use super::regs::spi_v3 as spi; | 314 | pub use super::regs::spi_v3 as spi; |
| 303 | pub use super::regs::syscfg_h7 as syscfg; | 315 | pub use super::regs::syscfg_h7 as syscfg; |
| 304 | embassy_extras::peripherals!( | 316 | embassy_extras::peripherals!( |
| 305 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 317 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 306 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 318 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 307 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 319 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 308 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 320 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 309 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 321 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 310 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 322 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 311 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 323 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 312 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 324 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 313 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 325 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 314 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 326 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 315 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 327 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, |
| 316 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 328 | PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, |
| 317 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 329 | PK10, PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, I2C5, PWR, RNG, SDMMC1, SDMMC2, |
| 330 | SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 318 | ); | 331 | ); |
| 319 | pub fn DMA(n: u8) -> dma::Dma { | 332 | pub fn DMA(n: u8) -> dma::Dma { |
| 320 | match n { | 333 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h730ib.rs b/embassy-stm32/src/pac/stm32h730ib.rs index 876f64442..77a7f9999 100644 --- a/embassy-stm32/src/pac/stm32h730ib.rs +++ b/embassy-stm32/src/pac/stm32h730ib.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -194,6 +196,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 194 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 196 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 195 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 197 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 196 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 198 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 199 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 200 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 201 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 202 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 203 | pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); | ||
| 204 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 197 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 205 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 198 | impl_rng!(RNG, HASH_RNG); | 206 | impl_rng!(RNG, HASH_RNG); |
| 199 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 207 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -294,27 +302,32 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 302 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 303 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 304 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 305 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 297 | pub use super::regs::dma_v2 as dma; | 306 | pub use super::regs::dma_v2 as dma; |
| 298 | pub use super::regs::exti_v1 as exti; | 307 | pub use super::regs::exti_v1 as exti; |
| 308 | pub use super::regs::flash_h7 as flash; | ||
| 299 | pub use super::regs::gpio_v2 as gpio; | 309 | pub use super::regs::gpio_v2 as gpio; |
| 310 | pub use super::regs::i2c_v2 as i2c; | ||
| 311 | pub use super::regs::pwr_h7 as pwr; | ||
| 300 | pub use super::regs::rng_v1 as rng; | 312 | pub use super::regs::rng_v1 as rng; |
| 301 | pub use super::regs::sdmmc_v2 as sdmmc; | 313 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 302 | pub use super::regs::spi_v3 as spi; | 314 | pub use super::regs::spi_v3 as spi; |
| 303 | pub use super::regs::syscfg_h7 as syscfg; | 315 | pub use super::regs::syscfg_h7 as syscfg; |
| 304 | embassy_extras::peripherals!( | 316 | embassy_extras::peripherals!( |
| 305 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 317 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 306 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 318 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 307 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 319 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 308 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 320 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 309 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 321 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 310 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 322 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 311 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 323 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 312 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 324 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 313 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 325 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 314 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 326 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 315 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 327 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, |
| 316 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 328 | PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, |
| 317 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 329 | PK10, PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, I2C5, PWR, RNG, SDMMC1, SDMMC2, |
| 330 | SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 318 | ); | 331 | ); |
| 319 | pub fn DMA(n: u8) -> dma::Dma { | 332 | pub fn DMA(n: u8) -> dma::Dma { |
| 320 | match n { | 333 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h730vb.rs b/embassy-stm32/src/pac/stm32h730vb.rs index e18404732..fa07dfafa 100644 --- a/embassy-stm32/src/pac/stm32h730vb.rs +++ b/embassy-stm32/src/pac/stm32h730vb.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -194,6 +196,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 194 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 196 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 195 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 197 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 196 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 198 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 199 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 200 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 201 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 202 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 203 | pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); | ||
| 204 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 197 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 205 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 198 | impl_rng!(RNG, HASH_RNG); | 206 | impl_rng!(RNG, HASH_RNG); |
| 199 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 207 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -283,27 +291,32 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 283 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 291 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 284 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 292 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 285 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 293 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 294 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 286 | pub use super::regs::dma_v2 as dma; | 295 | pub use super::regs::dma_v2 as dma; |
| 287 | pub use super::regs::exti_v1 as exti; | 296 | pub use super::regs::exti_v1 as exti; |
| 297 | pub use super::regs::flash_h7 as flash; | ||
| 288 | pub use super::regs::gpio_v2 as gpio; | 298 | pub use super::regs::gpio_v2 as gpio; |
| 299 | pub use super::regs::i2c_v2 as i2c; | ||
| 300 | pub use super::regs::pwr_h7 as pwr; | ||
| 289 | pub use super::regs::rng_v1 as rng; | 301 | pub use super::regs::rng_v1 as rng; |
| 290 | pub use super::regs::sdmmc_v2 as sdmmc; | 302 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 291 | pub use super::regs::spi_v3 as spi; | 303 | pub use super::regs::spi_v3 as spi; |
| 292 | pub use super::regs::syscfg_h7 as syscfg; | 304 | pub use super::regs::syscfg_h7 as syscfg; |
| 293 | embassy_extras::peripherals!( | 305 | embassy_extras::peripherals!( |
| 294 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 306 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 295 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 307 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 296 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 308 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 297 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 309 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 298 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 310 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 299 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 311 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 300 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 312 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 301 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 313 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 302 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 314 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 303 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 315 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 304 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 316 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, |
| 305 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 317 | PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, |
| 306 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | 318 | PK10, PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, I2C5, PWR, RNG, SDMMC1, SDMMC2, |
| 319 | SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | ||
| 307 | ); | 320 | ); |
| 308 | pub fn DMA(n: u8) -> dma::Dma { | 321 | pub fn DMA(n: u8) -> dma::Dma { |
| 309 | match n { | 322 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h730zb.rs b/embassy-stm32/src/pac/stm32h730zb.rs index 876f64442..77a7f9999 100644 --- a/embassy-stm32/src/pac/stm32h730zb.rs +++ b/embassy-stm32/src/pac/stm32h730zb.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -194,6 +196,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 194 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 196 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 195 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 197 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 196 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 198 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 199 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 200 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 201 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 202 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 203 | pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); | ||
| 204 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 197 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 205 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 198 | impl_rng!(RNG, HASH_RNG); | 206 | impl_rng!(RNG, HASH_RNG); |
| 199 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 207 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -294,27 +302,32 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 302 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 303 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 304 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 305 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 297 | pub use super::regs::dma_v2 as dma; | 306 | pub use super::regs::dma_v2 as dma; |
| 298 | pub use super::regs::exti_v1 as exti; | 307 | pub use super::regs::exti_v1 as exti; |
| 308 | pub use super::regs::flash_h7 as flash; | ||
| 299 | pub use super::regs::gpio_v2 as gpio; | 309 | pub use super::regs::gpio_v2 as gpio; |
| 310 | pub use super::regs::i2c_v2 as i2c; | ||
| 311 | pub use super::regs::pwr_h7 as pwr; | ||
| 300 | pub use super::regs::rng_v1 as rng; | 312 | pub use super::regs::rng_v1 as rng; |
| 301 | pub use super::regs::sdmmc_v2 as sdmmc; | 313 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 302 | pub use super::regs::spi_v3 as spi; | 314 | pub use super::regs::spi_v3 as spi; |
| 303 | pub use super::regs::syscfg_h7 as syscfg; | 315 | pub use super::regs::syscfg_h7 as syscfg; |
| 304 | embassy_extras::peripherals!( | 316 | embassy_extras::peripherals!( |
| 305 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 317 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 306 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 318 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 307 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 319 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 308 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 320 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 309 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 321 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 310 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 322 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 311 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 323 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 312 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 324 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 313 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 325 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 314 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 326 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 315 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 327 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, |
| 316 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 328 | PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, |
| 317 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 329 | PK10, PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, I2C5, PWR, RNG, SDMMC1, SDMMC2, |
| 330 | SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 318 | ); | 331 | ); |
| 319 | pub fn DMA(n: u8) -> dma::Dma { | 332 | pub fn DMA(n: u8) -> dma::Dma { |
| 320 | match n { | 333 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h733vg.rs b/embassy-stm32/src/pac/stm32h733vg.rs index e18404732..fa07dfafa 100644 --- a/embassy-stm32/src/pac/stm32h733vg.rs +++ b/embassy-stm32/src/pac/stm32h733vg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -194,6 +196,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 194 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 196 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 195 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 197 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 196 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 198 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 199 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 200 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 201 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 202 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 203 | pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); | ||
| 204 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 197 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 205 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 198 | impl_rng!(RNG, HASH_RNG); | 206 | impl_rng!(RNG, HASH_RNG); |
| 199 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 207 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -283,27 +291,32 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 283 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 291 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 284 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 292 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 285 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 293 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 294 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 286 | pub use super::regs::dma_v2 as dma; | 295 | pub use super::regs::dma_v2 as dma; |
| 287 | pub use super::regs::exti_v1 as exti; | 296 | pub use super::regs::exti_v1 as exti; |
| 297 | pub use super::regs::flash_h7 as flash; | ||
| 288 | pub use super::regs::gpio_v2 as gpio; | 298 | pub use super::regs::gpio_v2 as gpio; |
| 299 | pub use super::regs::i2c_v2 as i2c; | ||
| 300 | pub use super::regs::pwr_h7 as pwr; | ||
| 289 | pub use super::regs::rng_v1 as rng; | 301 | pub use super::regs::rng_v1 as rng; |
| 290 | pub use super::regs::sdmmc_v2 as sdmmc; | 302 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 291 | pub use super::regs::spi_v3 as spi; | 303 | pub use super::regs::spi_v3 as spi; |
| 292 | pub use super::regs::syscfg_h7 as syscfg; | 304 | pub use super::regs::syscfg_h7 as syscfg; |
| 293 | embassy_extras::peripherals!( | 305 | embassy_extras::peripherals!( |
| 294 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 306 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 295 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 307 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 296 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 308 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 297 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 309 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 298 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 310 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 299 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 311 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 300 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 312 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 301 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 313 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 302 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 314 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 303 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 315 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 304 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 316 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, |
| 305 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 317 | PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, |
| 306 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | 318 | PK10, PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, I2C5, PWR, RNG, SDMMC1, SDMMC2, |
| 319 | SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | ||
| 307 | ); | 320 | ); |
| 308 | pub fn DMA(n: u8) -> dma::Dma { | 321 | pub fn DMA(n: u8) -> dma::Dma { |
| 309 | match n { | 322 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h733zg.rs b/embassy-stm32/src/pac/stm32h733zg.rs index 876f64442..77a7f9999 100644 --- a/embassy-stm32/src/pac/stm32h733zg.rs +++ b/embassy-stm32/src/pac/stm32h733zg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -194,6 +196,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 194 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 196 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 195 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 197 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 196 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 198 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 199 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 200 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 201 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 202 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 203 | pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); | ||
| 204 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 197 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 205 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 198 | impl_rng!(RNG, HASH_RNG); | 206 | impl_rng!(RNG, HASH_RNG); |
| 199 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 207 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -294,27 +302,32 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 302 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 303 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 304 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 305 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 297 | pub use super::regs::dma_v2 as dma; | 306 | pub use super::regs::dma_v2 as dma; |
| 298 | pub use super::regs::exti_v1 as exti; | 307 | pub use super::regs::exti_v1 as exti; |
| 308 | pub use super::regs::flash_h7 as flash; | ||
| 299 | pub use super::regs::gpio_v2 as gpio; | 309 | pub use super::regs::gpio_v2 as gpio; |
| 310 | pub use super::regs::i2c_v2 as i2c; | ||
| 311 | pub use super::regs::pwr_h7 as pwr; | ||
| 300 | pub use super::regs::rng_v1 as rng; | 312 | pub use super::regs::rng_v1 as rng; |
| 301 | pub use super::regs::sdmmc_v2 as sdmmc; | 313 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 302 | pub use super::regs::spi_v3 as spi; | 314 | pub use super::regs::spi_v3 as spi; |
| 303 | pub use super::regs::syscfg_h7 as syscfg; | 315 | pub use super::regs::syscfg_h7 as syscfg; |
| 304 | embassy_extras::peripherals!( | 316 | embassy_extras::peripherals!( |
| 305 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 317 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 306 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 318 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 307 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 319 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 308 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 320 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 309 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 321 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 310 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 322 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 311 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 323 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 312 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 324 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 313 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 325 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 314 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 326 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 315 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 327 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, |
| 316 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 328 | PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, |
| 317 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 329 | PK10, PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, I2C5, PWR, RNG, SDMMC1, SDMMC2, |
| 330 | SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 318 | ); | 331 | ); |
| 319 | pub fn DMA(n: u8) -> dma::Dma { | 332 | pub fn DMA(n: u8) -> dma::Dma { |
| 320 | match n { | 333 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h735ag.rs b/embassy-stm32/src/pac/stm32h735ag.rs index 876f64442..77a7f9999 100644 --- a/embassy-stm32/src/pac/stm32h735ag.rs +++ b/embassy-stm32/src/pac/stm32h735ag.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -194,6 +196,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 194 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 196 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 195 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 197 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 196 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 198 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 199 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 200 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 201 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 202 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 203 | pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); | ||
| 204 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 197 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 205 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 198 | impl_rng!(RNG, HASH_RNG); | 206 | impl_rng!(RNG, HASH_RNG); |
| 199 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 207 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -294,27 +302,32 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 302 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 303 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 304 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 305 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 297 | pub use super::regs::dma_v2 as dma; | 306 | pub use super::regs::dma_v2 as dma; |
| 298 | pub use super::regs::exti_v1 as exti; | 307 | pub use super::regs::exti_v1 as exti; |
| 308 | pub use super::regs::flash_h7 as flash; | ||
| 299 | pub use super::regs::gpio_v2 as gpio; | 309 | pub use super::regs::gpio_v2 as gpio; |
| 310 | pub use super::regs::i2c_v2 as i2c; | ||
| 311 | pub use super::regs::pwr_h7 as pwr; | ||
| 300 | pub use super::regs::rng_v1 as rng; | 312 | pub use super::regs::rng_v1 as rng; |
| 301 | pub use super::regs::sdmmc_v2 as sdmmc; | 313 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 302 | pub use super::regs::spi_v3 as spi; | 314 | pub use super::regs::spi_v3 as spi; |
| 303 | pub use super::regs::syscfg_h7 as syscfg; | 315 | pub use super::regs::syscfg_h7 as syscfg; |
| 304 | embassy_extras::peripherals!( | 316 | embassy_extras::peripherals!( |
| 305 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 317 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 306 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 318 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 307 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 319 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 308 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 320 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 309 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 321 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 310 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 322 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 311 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 323 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 312 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 324 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 313 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 325 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 314 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 326 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 315 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 327 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, |
| 316 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 328 | PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, |
| 317 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 329 | PK10, PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, I2C5, PWR, RNG, SDMMC1, SDMMC2, |
| 330 | SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 318 | ); | 331 | ); |
| 319 | pub fn DMA(n: u8) -> dma::Dma { | 332 | pub fn DMA(n: u8) -> dma::Dma { |
| 320 | match n { | 333 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h735ig.rs b/embassy-stm32/src/pac/stm32h735ig.rs index 876f64442..77a7f9999 100644 --- a/embassy-stm32/src/pac/stm32h735ig.rs +++ b/embassy-stm32/src/pac/stm32h735ig.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -194,6 +196,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 194 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 196 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 195 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 197 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 196 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 198 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 199 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 200 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 201 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 202 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 203 | pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); | ||
| 204 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 197 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 205 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 198 | impl_rng!(RNG, HASH_RNG); | 206 | impl_rng!(RNG, HASH_RNG); |
| 199 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 207 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -294,27 +302,32 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 302 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 303 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 304 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 305 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 297 | pub use super::regs::dma_v2 as dma; | 306 | pub use super::regs::dma_v2 as dma; |
| 298 | pub use super::regs::exti_v1 as exti; | 307 | pub use super::regs::exti_v1 as exti; |
| 308 | pub use super::regs::flash_h7 as flash; | ||
| 299 | pub use super::regs::gpio_v2 as gpio; | 309 | pub use super::regs::gpio_v2 as gpio; |
| 310 | pub use super::regs::i2c_v2 as i2c; | ||
| 311 | pub use super::regs::pwr_h7 as pwr; | ||
| 300 | pub use super::regs::rng_v1 as rng; | 312 | pub use super::regs::rng_v1 as rng; |
| 301 | pub use super::regs::sdmmc_v2 as sdmmc; | 313 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 302 | pub use super::regs::spi_v3 as spi; | 314 | pub use super::regs::spi_v3 as spi; |
| 303 | pub use super::regs::syscfg_h7 as syscfg; | 315 | pub use super::regs::syscfg_h7 as syscfg; |
| 304 | embassy_extras::peripherals!( | 316 | embassy_extras::peripherals!( |
| 305 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 317 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 306 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 318 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 307 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 319 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 308 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 320 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 309 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 321 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 310 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 322 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 311 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 323 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 312 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 324 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 313 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 325 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 314 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 326 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 315 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 327 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, |
| 316 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 328 | PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, |
| 317 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 329 | PK10, PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, I2C5, PWR, RNG, SDMMC1, SDMMC2, |
| 330 | SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 318 | ); | 331 | ); |
| 319 | pub fn DMA(n: u8) -> dma::Dma { | 332 | pub fn DMA(n: u8) -> dma::Dma { |
| 320 | match n { | 333 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h735rg.rs b/embassy-stm32/src/pac/stm32h735rg.rs index 9896683ce..c94c9135f 100644 --- a/embassy-stm32/src/pac/stm32h735rg.rs +++ b/embassy-stm32/src/pac/stm32h735rg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -194,6 +196,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 194 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 196 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 195 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 197 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 196 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 198 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 199 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 200 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 201 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 202 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 203 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 197 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 204 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 198 | impl_rng!(RNG, HASH_RNG); | 205 | impl_rng!(RNG, HASH_RNG); |
| 199 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 206 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -275,27 +282,32 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 275 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 282 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 276 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 283 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 277 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 284 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 285 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 278 | pub use super::regs::dma_v2 as dma; | 286 | pub use super::regs::dma_v2 as dma; |
| 279 | pub use super::regs::exti_v1 as exti; | 287 | pub use super::regs::exti_v1 as exti; |
| 288 | pub use super::regs::flash_h7 as flash; | ||
| 280 | pub use super::regs::gpio_v2 as gpio; | 289 | pub use super::regs::gpio_v2 as gpio; |
| 290 | pub use super::regs::i2c_v2 as i2c; | ||
| 291 | pub use super::regs::pwr_h7 as pwr; | ||
| 281 | pub use super::regs::rng_v1 as rng; | 292 | pub use super::regs::rng_v1 as rng; |
| 282 | pub use super::regs::sdmmc_v2 as sdmmc; | 293 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 283 | pub use super::regs::spi_v3 as spi; | 294 | pub use super::regs::spi_v3 as spi; |
| 284 | pub use super::regs::syscfg_h7 as syscfg; | 295 | pub use super::regs::syscfg_h7 as syscfg; |
| 285 | embassy_extras::peripherals!( | 296 | embassy_extras::peripherals!( |
| 286 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 297 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 287 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 298 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 288 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 299 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 289 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 300 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 290 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 301 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 291 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 302 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 292 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 303 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 293 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 304 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 294 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 305 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 295 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 306 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 296 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 307 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, |
| 297 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 308 | PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, |
| 298 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI6, SYSCFG | 309 | PK10, PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, |
| 310 | SPI2, SPI3, SPI6, SYSCFG | ||
| 299 | ); | 311 | ); |
| 300 | pub fn DMA(n: u8) -> dma::Dma { | 312 | pub fn DMA(n: u8) -> dma::Dma { |
| 301 | match n { | 313 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h735vg.rs b/embassy-stm32/src/pac/stm32h735vg.rs index e18404732..fa07dfafa 100644 --- a/embassy-stm32/src/pac/stm32h735vg.rs +++ b/embassy-stm32/src/pac/stm32h735vg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -194,6 +196,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 194 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 196 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 195 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 197 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 196 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 198 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 199 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 200 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 201 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 202 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 203 | pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); | ||
| 204 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 197 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 205 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 198 | impl_rng!(RNG, HASH_RNG); | 206 | impl_rng!(RNG, HASH_RNG); |
| 199 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 207 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -283,27 +291,32 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 283 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 291 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 284 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 292 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 285 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 293 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 294 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 286 | pub use super::regs::dma_v2 as dma; | 295 | pub use super::regs::dma_v2 as dma; |
| 287 | pub use super::regs::exti_v1 as exti; | 296 | pub use super::regs::exti_v1 as exti; |
| 297 | pub use super::regs::flash_h7 as flash; | ||
| 288 | pub use super::regs::gpio_v2 as gpio; | 298 | pub use super::regs::gpio_v2 as gpio; |
| 299 | pub use super::regs::i2c_v2 as i2c; | ||
| 300 | pub use super::regs::pwr_h7 as pwr; | ||
| 289 | pub use super::regs::rng_v1 as rng; | 301 | pub use super::regs::rng_v1 as rng; |
| 290 | pub use super::regs::sdmmc_v2 as sdmmc; | 302 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 291 | pub use super::regs::spi_v3 as spi; | 303 | pub use super::regs::spi_v3 as spi; |
| 292 | pub use super::regs::syscfg_h7 as syscfg; | 304 | pub use super::regs::syscfg_h7 as syscfg; |
| 293 | embassy_extras::peripherals!( | 305 | embassy_extras::peripherals!( |
| 294 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 306 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 295 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 307 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 296 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 308 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 297 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 309 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 298 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 310 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 299 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 311 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 300 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 312 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 301 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 313 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 302 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 314 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 303 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 315 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 304 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 316 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, |
| 305 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 317 | PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, |
| 306 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | 318 | PK10, PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, I2C5, PWR, RNG, SDMMC1, SDMMC2, |
| 319 | SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | ||
| 307 | ); | 320 | ); |
| 308 | pub fn DMA(n: u8) -> dma::Dma { | 321 | pub fn DMA(n: u8) -> dma::Dma { |
| 309 | match n { | 322 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h735zg.rs b/embassy-stm32/src/pac/stm32h735zg.rs index 876f64442..77a7f9999 100644 --- a/embassy-stm32/src/pac/stm32h735zg.rs +++ b/embassy-stm32/src/pac/stm32h735zg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -194,6 +196,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 194 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 196 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 195 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 197 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 196 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 198 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 199 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 200 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 201 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 202 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 203 | pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); | ||
| 204 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 197 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 205 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 198 | impl_rng!(RNG, HASH_RNG); | 206 | impl_rng!(RNG, HASH_RNG); |
| 199 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 207 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -294,27 +302,32 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 294 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 302 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 295 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 303 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 296 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 304 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 305 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 297 | pub use super::regs::dma_v2 as dma; | 306 | pub use super::regs::dma_v2 as dma; |
| 298 | pub use super::regs::exti_v1 as exti; | 307 | pub use super::regs::exti_v1 as exti; |
| 308 | pub use super::regs::flash_h7 as flash; | ||
| 299 | pub use super::regs::gpio_v2 as gpio; | 309 | pub use super::regs::gpio_v2 as gpio; |
| 310 | pub use super::regs::i2c_v2 as i2c; | ||
| 311 | pub use super::regs::pwr_h7 as pwr; | ||
| 300 | pub use super::regs::rng_v1 as rng; | 312 | pub use super::regs::rng_v1 as rng; |
| 301 | pub use super::regs::sdmmc_v2 as sdmmc; | 313 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 302 | pub use super::regs::spi_v3 as spi; | 314 | pub use super::regs::spi_v3 as spi; |
| 303 | pub use super::regs::syscfg_h7 as syscfg; | 315 | pub use super::regs::syscfg_h7 as syscfg; |
| 304 | embassy_extras::peripherals!( | 316 | embassy_extras::peripherals!( |
| 305 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 317 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 306 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 318 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 307 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 319 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 308 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 320 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 309 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 321 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 310 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 322 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 311 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 323 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 312 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 324 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 313 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 325 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 314 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 326 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 315 | PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, | 327 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, |
| 316 | PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, | 328 | PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, |
| 317 | PK14, PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 329 | PK10, PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, I2C5, PWR, RNG, SDMMC1, SDMMC2, |
| 330 | SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 318 | ); | 331 | ); |
| 319 | pub fn DMA(n: u8) -> dma::Dma { | 332 | pub fn DMA(n: u8) -> dma::Dma { |
| 320 | match n { | 333 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h742ag.rs b/embassy-stm32/src/pac/stm32h742ag.rs index 87ef9faf5..c538be7e8 100644 --- a/embassy-stm32/src/pac/stm32h742ag.rs +++ b/embassy-stm32/src/pac/stm32h742ag.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h742ai.rs b/embassy-stm32/src/pac/stm32h742ai.rs index 87ef9faf5..c538be7e8 100644 --- a/embassy-stm32/src/pac/stm32h742ai.rs +++ b/embassy-stm32/src/pac/stm32h742ai.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h742bg.rs b/embassy-stm32/src/pac/stm32h742bg.rs index 87ef9faf5..c538be7e8 100644 --- a/embassy-stm32/src/pac/stm32h742bg.rs +++ b/embassy-stm32/src/pac/stm32h742bg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h742bi.rs b/embassy-stm32/src/pac/stm32h742bi.rs index 87ef9faf5..c538be7e8 100644 --- a/embassy-stm32/src/pac/stm32h742bi.rs +++ b/embassy-stm32/src/pac/stm32h742bi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h742ig.rs b/embassy-stm32/src/pac/stm32h742ig.rs index 87ef9faf5..c538be7e8 100644 --- a/embassy-stm32/src/pac/stm32h742ig.rs +++ b/embassy-stm32/src/pac/stm32h742ig.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h742ii.rs b/embassy-stm32/src/pac/stm32h742ii.rs index 87ef9faf5..c538be7e8 100644 --- a/embassy-stm32/src/pac/stm32h742ii.rs +++ b/embassy-stm32/src/pac/stm32h742ii.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h742vg.rs b/embassy-stm32/src/pac/stm32h742vg.rs index e70834d73..01eda8f20 100644 --- a/embassy-stm32/src/pac/stm32h742vg.rs +++ b/embassy-stm32/src/pac/stm32h742vg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -285,28 +293,34 @@ impl_spi_pin!(SPI4, MisoPin, PE5, 5); | |||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | 293 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); |
| 286 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 294 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 287 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 295 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 296 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 288 | pub use super::regs::dma_v2 as dma; | 297 | pub use super::regs::dma_v2 as dma; |
| 289 | pub use super::regs::exti_v1 as exti; | 298 | pub use super::regs::exti_v1 as exti; |
| 299 | pub use super::regs::flash_h7 as flash; | ||
| 290 | pub use super::regs::gpio_v2 as gpio; | 300 | pub use super::regs::gpio_v2 as gpio; |
| 301 | pub use super::regs::i2c_v2 as i2c; | ||
| 302 | pub use super::regs::pwr_h7 as pwr; | ||
| 303 | pub use super::regs::rcc_h7 as rcc; | ||
| 291 | pub use super::regs::rng_v1 as rng; | 304 | pub use super::regs::rng_v1 as rng; |
| 292 | pub use super::regs::sdmmc_v2 as sdmmc; | 305 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 293 | pub use super::regs::spi_v3 as spi; | 306 | pub use super::regs::spi_v3 as spi; |
| 294 | pub use super::regs::syscfg_h7 as syscfg; | 307 | pub use super::regs::syscfg_h7 as syscfg; |
| 295 | embassy_extras::peripherals!( | 308 | embassy_extras::peripherals!( |
| 296 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 309 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 297 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 310 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 298 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 311 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 299 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 312 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 300 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 313 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 301 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 314 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 302 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 315 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 303 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 316 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 304 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 317 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 305 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 318 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 306 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 319 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 307 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 320 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 308 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 321 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 309 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | 322 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 323 | SPI2, SPI3, SPI4, SPI6, SYSCFG | ||
| 310 | ); | 324 | ); |
| 311 | pub fn DMA(n: u8) -> dma::Dma { | 325 | pub fn DMA(n: u8) -> dma::Dma { |
| 312 | match n { | 326 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h742vi.rs b/embassy-stm32/src/pac/stm32h742vi.rs index e70834d73..01eda8f20 100644 --- a/embassy-stm32/src/pac/stm32h742vi.rs +++ b/embassy-stm32/src/pac/stm32h742vi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -285,28 +293,34 @@ impl_spi_pin!(SPI4, MisoPin, PE5, 5); | |||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | 293 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); |
| 286 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 294 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 287 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 295 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 296 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 288 | pub use super::regs::dma_v2 as dma; | 297 | pub use super::regs::dma_v2 as dma; |
| 289 | pub use super::regs::exti_v1 as exti; | 298 | pub use super::regs::exti_v1 as exti; |
| 299 | pub use super::regs::flash_h7 as flash; | ||
| 290 | pub use super::regs::gpio_v2 as gpio; | 300 | pub use super::regs::gpio_v2 as gpio; |
| 301 | pub use super::regs::i2c_v2 as i2c; | ||
| 302 | pub use super::regs::pwr_h7 as pwr; | ||
| 303 | pub use super::regs::rcc_h7 as rcc; | ||
| 291 | pub use super::regs::rng_v1 as rng; | 304 | pub use super::regs::rng_v1 as rng; |
| 292 | pub use super::regs::sdmmc_v2 as sdmmc; | 305 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 293 | pub use super::regs::spi_v3 as spi; | 306 | pub use super::regs::spi_v3 as spi; |
| 294 | pub use super::regs::syscfg_h7 as syscfg; | 307 | pub use super::regs::syscfg_h7 as syscfg; |
| 295 | embassy_extras::peripherals!( | 308 | embassy_extras::peripherals!( |
| 296 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 309 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 297 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 310 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 298 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 311 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 299 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 312 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 300 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 313 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 301 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 314 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 302 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 315 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 303 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 316 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 304 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 317 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 305 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 318 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 306 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 319 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 307 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 320 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 308 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 321 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 309 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | 322 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 323 | SPI2, SPI3, SPI4, SPI6, SYSCFG | ||
| 310 | ); | 324 | ); |
| 311 | pub fn DMA(n: u8) -> dma::Dma { | 325 | pub fn DMA(n: u8) -> dma::Dma { |
| 312 | match n { | 326 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h742xg.rs b/embassy-stm32/src/pac/stm32h742xg.rs index 87ef9faf5..c538be7e8 100644 --- a/embassy-stm32/src/pac/stm32h742xg.rs +++ b/embassy-stm32/src/pac/stm32h742xg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h742xi.rs b/embassy-stm32/src/pac/stm32h742xi.rs index 87ef9faf5..c538be7e8 100644 --- a/embassy-stm32/src/pac/stm32h742xi.rs +++ b/embassy-stm32/src/pac/stm32h742xi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h742zg.rs b/embassy-stm32/src/pac/stm32h742zg.rs index 87ef9faf5..c538be7e8 100644 --- a/embassy-stm32/src/pac/stm32h742zg.rs +++ b/embassy-stm32/src/pac/stm32h742zg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h742zi.rs b/embassy-stm32/src/pac/stm32h742zi.rs index 87ef9faf5..c538be7e8 100644 --- a/embassy-stm32/src/pac/stm32h742zi.rs +++ b/embassy-stm32/src/pac/stm32h742zi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h743ag.rs b/embassy-stm32/src/pac/stm32h743ag.rs index 48ff70f87..26a3e9cbc 100644 --- a/embassy-stm32/src/pac/stm32h743ag.rs +++ b/embassy-stm32/src/pac/stm32h743ag.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h743ai.rs b/embassy-stm32/src/pac/stm32h743ai.rs index 48ff70f87..26a3e9cbc 100644 --- a/embassy-stm32/src/pac/stm32h743ai.rs +++ b/embassy-stm32/src/pac/stm32h743ai.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h743bg.rs b/embassy-stm32/src/pac/stm32h743bg.rs index 48ff70f87..26a3e9cbc 100644 --- a/embassy-stm32/src/pac/stm32h743bg.rs +++ b/embassy-stm32/src/pac/stm32h743bg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h743bi.rs b/embassy-stm32/src/pac/stm32h743bi.rs index 48ff70f87..26a3e9cbc 100644 --- a/embassy-stm32/src/pac/stm32h743bi.rs +++ b/embassy-stm32/src/pac/stm32h743bi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h743ig.rs b/embassy-stm32/src/pac/stm32h743ig.rs index 48ff70f87..26a3e9cbc 100644 --- a/embassy-stm32/src/pac/stm32h743ig.rs +++ b/embassy-stm32/src/pac/stm32h743ig.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h743ii.rs b/embassy-stm32/src/pac/stm32h743ii.rs index 48ff70f87..26a3e9cbc 100644 --- a/embassy-stm32/src/pac/stm32h743ii.rs +++ b/embassy-stm32/src/pac/stm32h743ii.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h743vg.rs b/embassy-stm32/src/pac/stm32h743vg.rs index 23eb1ca73..41080b9e7 100644 --- a/embassy-stm32/src/pac/stm32h743vg.rs +++ b/embassy-stm32/src/pac/stm32h743vg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -285,28 +293,34 @@ impl_spi_pin!(SPI4, MisoPin, PE5, 5); | |||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | 293 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); |
| 286 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 294 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 287 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 295 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 296 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 288 | pub use super::regs::dma_v2 as dma; | 297 | pub use super::regs::dma_v2 as dma; |
| 289 | pub use super::regs::exti_v1 as exti; | 298 | pub use super::regs::exti_v1 as exti; |
| 299 | pub use super::regs::flash_h7 as flash; | ||
| 290 | pub use super::regs::gpio_v2 as gpio; | 300 | pub use super::regs::gpio_v2 as gpio; |
| 301 | pub use super::regs::i2c_v2 as i2c; | ||
| 302 | pub use super::regs::pwr_h7 as pwr; | ||
| 303 | pub use super::regs::rcc_h7 as rcc; | ||
| 291 | pub use super::regs::rng_v1 as rng; | 304 | pub use super::regs::rng_v1 as rng; |
| 292 | pub use super::regs::sdmmc_v2 as sdmmc; | 305 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 293 | pub use super::regs::spi_v3 as spi; | 306 | pub use super::regs::spi_v3 as spi; |
| 294 | pub use super::regs::syscfg_h7 as syscfg; | 307 | pub use super::regs::syscfg_h7 as syscfg; |
| 295 | embassy_extras::peripherals!( | 308 | embassy_extras::peripherals!( |
| 296 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 309 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 297 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 310 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 298 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 311 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 299 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 312 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 300 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 313 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 301 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 314 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 302 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 315 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 303 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 316 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 304 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 317 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 305 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 318 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 306 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 319 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 307 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 320 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 308 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 321 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 309 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | 322 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 323 | SPI2, SPI3, SPI4, SPI6, SYSCFG | ||
| 310 | ); | 324 | ); |
| 311 | pub fn DMA(n: u8) -> dma::Dma { | 325 | pub fn DMA(n: u8) -> dma::Dma { |
| 312 | match n { | 326 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h743vi.rs b/embassy-stm32/src/pac/stm32h743vi.rs index 23eb1ca73..41080b9e7 100644 --- a/embassy-stm32/src/pac/stm32h743vi.rs +++ b/embassy-stm32/src/pac/stm32h743vi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -285,28 +293,34 @@ impl_spi_pin!(SPI4, MisoPin, PE5, 5); | |||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | 293 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); |
| 286 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 294 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 287 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 295 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 296 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 288 | pub use super::regs::dma_v2 as dma; | 297 | pub use super::regs::dma_v2 as dma; |
| 289 | pub use super::regs::exti_v1 as exti; | 298 | pub use super::regs::exti_v1 as exti; |
| 299 | pub use super::regs::flash_h7 as flash; | ||
| 290 | pub use super::regs::gpio_v2 as gpio; | 300 | pub use super::regs::gpio_v2 as gpio; |
| 301 | pub use super::regs::i2c_v2 as i2c; | ||
| 302 | pub use super::regs::pwr_h7 as pwr; | ||
| 303 | pub use super::regs::rcc_h7 as rcc; | ||
| 291 | pub use super::regs::rng_v1 as rng; | 304 | pub use super::regs::rng_v1 as rng; |
| 292 | pub use super::regs::sdmmc_v2 as sdmmc; | 305 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 293 | pub use super::regs::spi_v3 as spi; | 306 | pub use super::regs::spi_v3 as spi; |
| 294 | pub use super::regs::syscfg_h7 as syscfg; | 307 | pub use super::regs::syscfg_h7 as syscfg; |
| 295 | embassy_extras::peripherals!( | 308 | embassy_extras::peripherals!( |
| 296 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 309 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 297 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 310 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 298 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 311 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 299 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 312 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 300 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 313 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 301 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 314 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 302 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 315 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 303 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 316 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 304 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 317 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 305 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 318 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 306 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 319 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 307 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 320 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 308 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 321 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 309 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | 322 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 323 | SPI2, SPI3, SPI4, SPI6, SYSCFG | ||
| 310 | ); | 324 | ); |
| 311 | pub fn DMA(n: u8) -> dma::Dma { | 325 | pub fn DMA(n: u8) -> dma::Dma { |
| 312 | match n { | 326 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h743xg.rs b/embassy-stm32/src/pac/stm32h743xg.rs index 48ff70f87..26a3e9cbc 100644 --- a/embassy-stm32/src/pac/stm32h743xg.rs +++ b/embassy-stm32/src/pac/stm32h743xg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h743xi.rs b/embassy-stm32/src/pac/stm32h743xi.rs index 48ff70f87..26a3e9cbc 100644 --- a/embassy-stm32/src/pac/stm32h743xi.rs +++ b/embassy-stm32/src/pac/stm32h743xi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h743zg.rs b/embassy-stm32/src/pac/stm32h743zg.rs index 48ff70f87..26a3e9cbc 100644 --- a/embassy-stm32/src/pac/stm32h743zg.rs +++ b/embassy-stm32/src/pac/stm32h743zg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h743zi.rs b/embassy-stm32/src/pac/stm32h743zi.rs index 48ff70f87..26a3e9cbc 100644 --- a/embassy-stm32/src/pac/stm32h743zi.rs +++ b/embassy-stm32/src/pac/stm32h743zi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h745bg.rs b/embassy-stm32/src/pac/stm32h745bg.rs index 3f32b6cc1..00bf15c61 100644 --- a/embassy-stm32/src/pac/stm32h745bg.rs +++ b/embassy-stm32/src/pac/stm32h745bg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h745bi.rs b/embassy-stm32/src/pac/stm32h745bi.rs index 3f32b6cc1..00bf15c61 100644 --- a/embassy-stm32/src/pac/stm32h745bi.rs +++ b/embassy-stm32/src/pac/stm32h745bi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h745ig.rs b/embassy-stm32/src/pac/stm32h745ig.rs index 3f32b6cc1..00bf15c61 100644 --- a/embassy-stm32/src/pac/stm32h745ig.rs +++ b/embassy-stm32/src/pac/stm32h745ig.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h745ii.rs b/embassy-stm32/src/pac/stm32h745ii.rs index 3f32b6cc1..00bf15c61 100644 --- a/embassy-stm32/src/pac/stm32h745ii.rs +++ b/embassy-stm32/src/pac/stm32h745ii.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h745xg.rs b/embassy-stm32/src/pac/stm32h745xg.rs index 3f32b6cc1..00bf15c61 100644 --- a/embassy-stm32/src/pac/stm32h745xg.rs +++ b/embassy-stm32/src/pac/stm32h745xg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h745xi.rs b/embassy-stm32/src/pac/stm32h745xi.rs index 3f32b6cc1..00bf15c61 100644 --- a/embassy-stm32/src/pac/stm32h745xi.rs +++ b/embassy-stm32/src/pac/stm32h745xi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h745zg.rs b/embassy-stm32/src/pac/stm32h745zg.rs index 3f32b6cc1..00bf15c61 100644 --- a/embassy-stm32/src/pac/stm32h745zg.rs +++ b/embassy-stm32/src/pac/stm32h745zg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h745zi.rs b/embassy-stm32/src/pac/stm32h745zi.rs index 3f32b6cc1..00bf15c61 100644 --- a/embassy-stm32/src/pac/stm32h745zi.rs +++ b/embassy-stm32/src/pac/stm32h745zi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h747ag.rs b/embassy-stm32/src/pac/stm32h747ag.rs index cef04c6a5..2ec339c88 100644 --- a/embassy-stm32/src/pac/stm32h747ag.rs +++ b/embassy-stm32/src/pac/stm32h747ag.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h747ai.rs b/embassy-stm32/src/pac/stm32h747ai.rs index cef04c6a5..2ec339c88 100644 --- a/embassy-stm32/src/pac/stm32h747ai.rs +++ b/embassy-stm32/src/pac/stm32h747ai.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h747bg.rs b/embassy-stm32/src/pac/stm32h747bg.rs index cef04c6a5..2ec339c88 100644 --- a/embassy-stm32/src/pac/stm32h747bg.rs +++ b/embassy-stm32/src/pac/stm32h747bg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h747bi.rs b/embassy-stm32/src/pac/stm32h747bi.rs index cef04c6a5..2ec339c88 100644 --- a/embassy-stm32/src/pac/stm32h747bi.rs +++ b/embassy-stm32/src/pac/stm32h747bi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h747ig.rs b/embassy-stm32/src/pac/stm32h747ig.rs index cef04c6a5..2ec339c88 100644 --- a/embassy-stm32/src/pac/stm32h747ig.rs +++ b/embassy-stm32/src/pac/stm32h747ig.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h747ii.rs b/embassy-stm32/src/pac/stm32h747ii.rs index cef04c6a5..2ec339c88 100644 --- a/embassy-stm32/src/pac/stm32h747ii.rs +++ b/embassy-stm32/src/pac/stm32h747ii.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h747xg.rs b/embassy-stm32/src/pac/stm32h747xg.rs index cef04c6a5..2ec339c88 100644 --- a/embassy-stm32/src/pac/stm32h747xg.rs +++ b/embassy-stm32/src/pac/stm32h747xg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h747xi.rs b/embassy-stm32/src/pac/stm32h747xi.rs index cef04c6a5..2ec339c88 100644 --- a/embassy-stm32/src/pac/stm32h747xi.rs +++ b/embassy-stm32/src/pac/stm32h747xi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h747zi.rs b/embassy-stm32/src/pac/stm32h747zi.rs index 89ec9be39..6ca02d4b4 100644 --- a/embassy-stm32/src/pac/stm32h747zi.rs +++ b/embassy-stm32/src/pac/stm32h747zi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 223 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -285,28 +293,34 @@ impl_spi_pin!(SPI4, MisoPin, PE5, 5); | |||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | 293 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); |
| 286 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 294 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 287 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 295 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 296 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 288 | pub use super::regs::dma_v2 as dma; | 297 | pub use super::regs::dma_v2 as dma; |
| 289 | pub use super::regs::exti_v1 as exti; | 298 | pub use super::regs::exti_v1 as exti; |
| 299 | pub use super::regs::flash_h7 as flash; | ||
| 290 | pub use super::regs::gpio_v2 as gpio; | 300 | pub use super::regs::gpio_v2 as gpio; |
| 301 | pub use super::regs::i2c_v2 as i2c; | ||
| 302 | pub use super::regs::pwr_h7 as pwr; | ||
| 303 | pub use super::regs::rcc_h7 as rcc; | ||
| 291 | pub use super::regs::rng_v1 as rng; | 304 | pub use super::regs::rng_v1 as rng; |
| 292 | pub use super::regs::sdmmc_v2 as sdmmc; | 305 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 293 | pub use super::regs::spi_v3 as spi; | 306 | pub use super::regs::spi_v3 as spi; |
| 294 | pub use super::regs::syscfg_h7 as syscfg; | 307 | pub use super::regs::syscfg_h7 as syscfg; |
| 295 | embassy_extras::peripherals!( | 308 | embassy_extras::peripherals!( |
| 296 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 309 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 297 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 310 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 298 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 311 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 299 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 312 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 300 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 313 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 301 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 314 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 302 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 315 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 303 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 316 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 304 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 317 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 305 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 318 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 306 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 319 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 307 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 320 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 308 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 321 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 309 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | 322 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 323 | SPI2, SPI3, SPI4, SPI6, SYSCFG | ||
| 310 | ); | 324 | ); |
| 311 | pub fn DMA(n: u8) -> dma::Dma { | 325 | pub fn DMA(n: u8) -> dma::Dma { |
| 312 | match n { | 326 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h750ib.rs b/embassy-stm32/src/pac/stm32h750ib.rs index 318356593..3f2ef7ab7 100644 --- a/embassy-stm32/src/pac/stm32h750ib.rs +++ b/embassy-stm32/src/pac/stm32h750ib.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 223 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h750vb.rs b/embassy-stm32/src/pac/stm32h750vb.rs index 3d07ff7f9..790b54222 100644 --- a/embassy-stm32/src/pac/stm32h750vb.rs +++ b/embassy-stm32/src/pac/stm32h750vb.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 223 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -285,28 +293,34 @@ impl_spi_pin!(SPI4, MisoPin, PE5, 5); | |||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | 293 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); |
| 286 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 294 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 287 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 295 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 296 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 288 | pub use super::regs::dma_v2 as dma; | 297 | pub use super::regs::dma_v2 as dma; |
| 289 | pub use super::regs::exti_v1 as exti; | 298 | pub use super::regs::exti_v1 as exti; |
| 299 | pub use super::regs::flash_h7 as flash; | ||
| 290 | pub use super::regs::gpio_v2 as gpio; | 300 | pub use super::regs::gpio_v2 as gpio; |
| 301 | pub use super::regs::i2c_v2 as i2c; | ||
| 302 | pub use super::regs::pwr_h7 as pwr; | ||
| 303 | pub use super::regs::rcc_h7 as rcc; | ||
| 291 | pub use super::regs::rng_v1 as rng; | 304 | pub use super::regs::rng_v1 as rng; |
| 292 | pub use super::regs::sdmmc_v2 as sdmmc; | 305 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 293 | pub use super::regs::spi_v3 as spi; | 306 | pub use super::regs::spi_v3 as spi; |
| 294 | pub use super::regs::syscfg_h7 as syscfg; | 307 | pub use super::regs::syscfg_h7 as syscfg; |
| 295 | embassy_extras::peripherals!( | 308 | embassy_extras::peripherals!( |
| 296 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 309 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 297 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 310 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 298 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 311 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 299 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 312 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 300 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 313 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 301 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 314 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 302 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 315 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 303 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 316 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 304 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 317 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 305 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 318 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 306 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 319 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 307 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 320 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 308 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 321 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 309 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | 322 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 323 | SPI2, SPI3, SPI4, SPI6, SYSCFG | ||
| 310 | ); | 324 | ); |
| 311 | pub fn DMA(n: u8) -> dma::Dma { | 325 | pub fn DMA(n: u8) -> dma::Dma { |
| 312 | match n { | 326 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h750xb.rs b/embassy-stm32/src/pac/stm32h750xb.rs index 318356593..3f2ef7ab7 100644 --- a/embassy-stm32/src/pac/stm32h750xb.rs +++ b/embassy-stm32/src/pac/stm32h750xb.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 223 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h750zb.rs b/embassy-stm32/src/pac/stm32h750zb.rs index 318356593..3f2ef7ab7 100644 --- a/embassy-stm32/src/pac/stm32h750zb.rs +++ b/embassy-stm32/src/pac/stm32h750zb.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 223 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h753ai.rs b/embassy-stm32/src/pac/stm32h753ai.rs index 318356593..3f2ef7ab7 100644 --- a/embassy-stm32/src/pac/stm32h753ai.rs +++ b/embassy-stm32/src/pac/stm32h753ai.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 223 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h753bi.rs b/embassy-stm32/src/pac/stm32h753bi.rs index 318356593..3f2ef7ab7 100644 --- a/embassy-stm32/src/pac/stm32h753bi.rs +++ b/embassy-stm32/src/pac/stm32h753bi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 223 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h753ii.rs b/embassy-stm32/src/pac/stm32h753ii.rs index 318356593..3f2ef7ab7 100644 --- a/embassy-stm32/src/pac/stm32h753ii.rs +++ b/embassy-stm32/src/pac/stm32h753ii.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 223 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h753vi.rs b/embassy-stm32/src/pac/stm32h753vi.rs index 3d07ff7f9..790b54222 100644 --- a/embassy-stm32/src/pac/stm32h753vi.rs +++ b/embassy-stm32/src/pac/stm32h753vi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 223 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -285,28 +293,34 @@ impl_spi_pin!(SPI4, MisoPin, PE5, 5); | |||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | 293 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); |
| 286 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 294 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 287 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 295 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 296 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 288 | pub use super::regs::dma_v2 as dma; | 297 | pub use super::regs::dma_v2 as dma; |
| 289 | pub use super::regs::exti_v1 as exti; | 298 | pub use super::regs::exti_v1 as exti; |
| 299 | pub use super::regs::flash_h7 as flash; | ||
| 290 | pub use super::regs::gpio_v2 as gpio; | 300 | pub use super::regs::gpio_v2 as gpio; |
| 301 | pub use super::regs::i2c_v2 as i2c; | ||
| 302 | pub use super::regs::pwr_h7 as pwr; | ||
| 303 | pub use super::regs::rcc_h7 as rcc; | ||
| 291 | pub use super::regs::rng_v1 as rng; | 304 | pub use super::regs::rng_v1 as rng; |
| 292 | pub use super::regs::sdmmc_v2 as sdmmc; | 305 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 293 | pub use super::regs::spi_v3 as spi; | 306 | pub use super::regs::spi_v3 as spi; |
| 294 | pub use super::regs::syscfg_h7 as syscfg; | 307 | pub use super::regs::syscfg_h7 as syscfg; |
| 295 | embassy_extras::peripherals!( | 308 | embassy_extras::peripherals!( |
| 296 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 309 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 297 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 310 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 298 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 311 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 299 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 312 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 300 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 313 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 301 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 314 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 302 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 315 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 303 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 316 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 304 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 317 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 305 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 318 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 306 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 319 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 307 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 320 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 308 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 321 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 309 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | 322 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 323 | SPI2, SPI3, SPI4, SPI6, SYSCFG | ||
| 310 | ); | 324 | ); |
| 311 | pub fn DMA(n: u8) -> dma::Dma { | 325 | pub fn DMA(n: u8) -> dma::Dma { |
| 312 | match n { | 326 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h753xi.rs b/embassy-stm32/src/pac/stm32h753xi.rs index 318356593..3f2ef7ab7 100644 --- a/embassy-stm32/src/pac/stm32h753xi.rs +++ b/embassy-stm32/src/pac/stm32h753xi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 223 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h753zi.rs b/embassy-stm32/src/pac/stm32h753zi.rs index 318356593..3f2ef7ab7 100644 --- a/embassy-stm32/src/pac/stm32h753zi.rs +++ b/embassy-stm32/src/pac/stm32h753zi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 223 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h755bi.rs b/embassy-stm32/src/pac/stm32h755bi.rs index 3df475104..808dd8fbf 100644 --- a/embassy-stm32/src/pac/stm32h755bi.rs +++ b/embassy-stm32/src/pac/stm32h755bi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 223 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h755ii.rs b/embassy-stm32/src/pac/stm32h755ii.rs index 3df475104..808dd8fbf 100644 --- a/embassy-stm32/src/pac/stm32h755ii.rs +++ b/embassy-stm32/src/pac/stm32h755ii.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 223 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h755xi.rs b/embassy-stm32/src/pac/stm32h755xi.rs index 3df475104..808dd8fbf 100644 --- a/embassy-stm32/src/pac/stm32h755xi.rs +++ b/embassy-stm32/src/pac/stm32h755xi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 223 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h755zi.rs b/embassy-stm32/src/pac/stm32h755zi.rs index 3df475104..808dd8fbf 100644 --- a/embassy-stm32/src/pac/stm32h755zi.rs +++ b/embassy-stm32/src/pac/stm32h755zi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 223 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h757ai.rs b/embassy-stm32/src/pac/stm32h757ai.rs index 73175e0ef..c818a3013 100644 --- a/embassy-stm32/src/pac/stm32h757ai.rs +++ b/embassy-stm32/src/pac/stm32h757ai.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 223 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h757bi.rs b/embassy-stm32/src/pac/stm32h757bi.rs index 73175e0ef..c818a3013 100644 --- a/embassy-stm32/src/pac/stm32h757bi.rs +++ b/embassy-stm32/src/pac/stm32h757bi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 223 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h757ii.rs b/embassy-stm32/src/pac/stm32h757ii.rs index 73175e0ef..c818a3013 100644 --- a/embassy-stm32/src/pac/stm32h757ii.rs +++ b/embassy-stm32/src/pac/stm32h757ii.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 223 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h757xi.rs b/embassy-stm32/src/pac/stm32h757xi.rs index 73175e0ef..c818a3013 100644 --- a/embassy-stm32/src/pac/stm32h757xi.rs +++ b/embassy-stm32/src/pac/stm32h757xi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 223 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -296,28 +304,34 @@ impl_spi_pin!(SPI5, MisoPin, PJ11, 5); | |||
| 296 | impl_spi_pin!(SPI5, SckPin, PK0, 5); | 304 | impl_spi_pin!(SPI5, SckPin, PK0, 5); |
| 297 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 305 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 298 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 306 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 307 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 299 | pub use super::regs::dma_v2 as dma; | 308 | pub use super::regs::dma_v2 as dma; |
| 300 | pub use super::regs::exti_v1 as exti; | 309 | pub use super::regs::exti_v1 as exti; |
| 310 | pub use super::regs::flash_h7 as flash; | ||
| 301 | pub use super::regs::gpio_v2 as gpio; | 311 | pub use super::regs::gpio_v2 as gpio; |
| 312 | pub use super::regs::i2c_v2 as i2c; | ||
| 313 | pub use super::regs::pwr_h7 as pwr; | ||
| 314 | pub use super::regs::rcc_h7 as rcc; | ||
| 302 | pub use super::regs::rng_v1 as rng; | 315 | pub use super::regs::rng_v1 as rng; |
| 303 | pub use super::regs::sdmmc_v2 as sdmmc; | 316 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 304 | pub use super::regs::spi_v3 as spi; | 317 | pub use super::regs::spi_v3 as spi; |
| 305 | pub use super::regs::syscfg_h7 as syscfg; | 318 | pub use super::regs::syscfg_h7 as syscfg; |
| 306 | embassy_extras::peripherals!( | 319 | embassy_extras::peripherals!( |
| 307 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 320 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 308 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 321 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 309 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 322 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 310 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 323 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 311 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 324 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 312 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 325 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 313 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 326 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 314 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 327 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 315 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 328 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 316 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 329 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 317 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 330 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 318 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 331 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 319 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 332 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 320 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 333 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 334 | SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 321 | ); | 335 | ); |
| 322 | pub fn DMA(n: u8) -> dma::Dma { | 336 | pub fn DMA(n: u8) -> dma::Dma { |
| 323 | match n { | 337 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h757zi.rs b/embassy-stm32/src/pac/stm32h757zi.rs index 07f1c4336..3079161fd 100644 --- a/embassy-stm32/src/pac/stm32h757zi.rs +++ b/embassy-stm32/src/pac/stm32h757zi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,12 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 221 | pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 222 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 223 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 224 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -285,28 +293,34 @@ impl_spi_pin!(SPI4, MisoPin, PE5, 5); | |||
| 285 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); | 293 | impl_spi_pin!(SPI4, MosiPin, PE6, 5); |
| 286 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); | 294 | pub const SPI6: spi::Spi = spi::Spi(0x58001400 as _); |
| 287 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 295 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 296 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 288 | pub use super::regs::dma_v2 as dma; | 297 | pub use super::regs::dma_v2 as dma; |
| 289 | pub use super::regs::exti_v1 as exti; | 298 | pub use super::regs::exti_v1 as exti; |
| 299 | pub use super::regs::flash_h7 as flash; | ||
| 290 | pub use super::regs::gpio_v2 as gpio; | 300 | pub use super::regs::gpio_v2 as gpio; |
| 301 | pub use super::regs::i2c_v2 as i2c; | ||
| 302 | pub use super::regs::pwr_h7 as pwr; | ||
| 303 | pub use super::regs::rcc_h7 as rcc; | ||
| 291 | pub use super::regs::rng_v1 as rng; | 304 | pub use super::regs::rng_v1 as rng; |
| 292 | pub use super::regs::sdmmc_v2 as sdmmc; | 305 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 293 | pub use super::regs::spi_v3 as spi; | 306 | pub use super::regs::spi_v3 as spi; |
| 294 | pub use super::regs::syscfg_h7 as syscfg; | 307 | pub use super::regs::syscfg_h7 as syscfg; |
| 295 | embassy_extras::peripherals!( | 308 | embassy_extras::peripherals!( |
| 296 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 309 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 297 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 310 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 298 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 311 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 299 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 312 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 300 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 313 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 301 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 314 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 302 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 315 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 303 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 316 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 304 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 317 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 305 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 318 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 306 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 319 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 307 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 320 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 308 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 321 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 309 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | 322 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RCC, RNG, SDMMC1, SDMMC2, SPI1, |
| 323 | SPI2, SPI3, SPI4, SPI6, SYSCFG | ||
| 310 | ); | 324 | ); |
| 311 | pub fn DMA(n: u8) -> dma::Dma { | 325 | pub fn DMA(n: u8) -> dma::Dma { |
| 312 | match n { | 326 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7a3ag.rs b/embassy-stm32/src/pac/stm32h7a3ag.rs index 536447242..ebbcbd965 100644 --- a/embassy-stm32/src/pac/stm32h7a3ag.rs +++ b/embassy-stm32/src/pac/stm32h7a3ag.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 221 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 222 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 223 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -314,28 +321,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 321 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 322 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 323 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 324 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 317 | pub use super::regs::dma_v2 as dma; | 325 | pub use super::regs::dma_v2 as dma; |
| 318 | pub use super::regs::exti_v1 as exti; | 326 | pub use super::regs::exti_v1 as exti; |
| 327 | pub use super::regs::flash_h7 as flash; | ||
| 319 | pub use super::regs::gpio_v2 as gpio; | 328 | pub use super::regs::gpio_v2 as gpio; |
| 329 | pub use super::regs::i2c_v2 as i2c; | ||
| 330 | pub use super::regs::pwr_h7 as pwr; | ||
| 320 | pub use super::regs::rng_v1 as rng; | 331 | pub use super::regs::rng_v1 as rng; |
| 321 | pub use super::regs::sdmmc_v2 as sdmmc; | 332 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 322 | pub use super::regs::spi_v3 as spi; | 333 | pub use super::regs::spi_v3 as spi; |
| 323 | pub use super::regs::syscfg_h7 as syscfg; | 334 | pub use super::regs::syscfg_h7 as syscfg; |
| 324 | embassy_extras::peripherals!( | 335 | embassy_extras::peripherals!( |
| 325 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 336 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 326 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 337 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 327 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 338 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 328 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 339 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 329 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 340 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 330 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 341 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 331 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 342 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 332 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 343 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 333 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 344 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 334 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 345 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 335 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 346 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 336 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 347 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 337 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 348 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 338 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 349 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, |
| 350 | SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 339 | ); | 351 | ); |
| 340 | pub fn DMA(n: u8) -> dma::Dma { | 352 | pub fn DMA(n: u8) -> dma::Dma { |
| 341 | match n { | 353 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7a3ai.rs b/embassy-stm32/src/pac/stm32h7a3ai.rs index 536447242..ebbcbd965 100644 --- a/embassy-stm32/src/pac/stm32h7a3ai.rs +++ b/embassy-stm32/src/pac/stm32h7a3ai.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 221 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 222 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 223 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -314,28 +321,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 321 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 322 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 323 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 324 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 317 | pub use super::regs::dma_v2 as dma; | 325 | pub use super::regs::dma_v2 as dma; |
| 318 | pub use super::regs::exti_v1 as exti; | 326 | pub use super::regs::exti_v1 as exti; |
| 327 | pub use super::regs::flash_h7 as flash; | ||
| 319 | pub use super::regs::gpio_v2 as gpio; | 328 | pub use super::regs::gpio_v2 as gpio; |
| 329 | pub use super::regs::i2c_v2 as i2c; | ||
| 330 | pub use super::regs::pwr_h7 as pwr; | ||
| 320 | pub use super::regs::rng_v1 as rng; | 331 | pub use super::regs::rng_v1 as rng; |
| 321 | pub use super::regs::sdmmc_v2 as sdmmc; | 332 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 322 | pub use super::regs::spi_v3 as spi; | 333 | pub use super::regs::spi_v3 as spi; |
| 323 | pub use super::regs::syscfg_h7 as syscfg; | 334 | pub use super::regs::syscfg_h7 as syscfg; |
| 324 | embassy_extras::peripherals!( | 335 | embassy_extras::peripherals!( |
| 325 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 336 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 326 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 337 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 327 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 338 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 328 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 339 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 329 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 340 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 330 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 341 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 331 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 342 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 332 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 343 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 333 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 344 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 334 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 345 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 335 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 346 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 336 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 347 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 337 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 348 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 338 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 349 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, |
| 350 | SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 339 | ); | 351 | ); |
| 340 | pub fn DMA(n: u8) -> dma::Dma { | 352 | pub fn DMA(n: u8) -> dma::Dma { |
| 341 | match n { | 353 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7a3ig.rs b/embassy-stm32/src/pac/stm32h7a3ig.rs index 536447242..ebbcbd965 100644 --- a/embassy-stm32/src/pac/stm32h7a3ig.rs +++ b/embassy-stm32/src/pac/stm32h7a3ig.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 221 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 222 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 223 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -314,28 +321,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 321 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 322 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 323 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 324 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 317 | pub use super::regs::dma_v2 as dma; | 325 | pub use super::regs::dma_v2 as dma; |
| 318 | pub use super::regs::exti_v1 as exti; | 326 | pub use super::regs::exti_v1 as exti; |
| 327 | pub use super::regs::flash_h7 as flash; | ||
| 319 | pub use super::regs::gpio_v2 as gpio; | 328 | pub use super::regs::gpio_v2 as gpio; |
| 329 | pub use super::regs::i2c_v2 as i2c; | ||
| 330 | pub use super::regs::pwr_h7 as pwr; | ||
| 320 | pub use super::regs::rng_v1 as rng; | 331 | pub use super::regs::rng_v1 as rng; |
| 321 | pub use super::regs::sdmmc_v2 as sdmmc; | 332 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 322 | pub use super::regs::spi_v3 as spi; | 333 | pub use super::regs::spi_v3 as spi; |
| 323 | pub use super::regs::syscfg_h7 as syscfg; | 334 | pub use super::regs::syscfg_h7 as syscfg; |
| 324 | embassy_extras::peripherals!( | 335 | embassy_extras::peripherals!( |
| 325 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 336 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 326 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 337 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 327 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 338 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 328 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 339 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 329 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 340 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 330 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 341 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 331 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 342 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 332 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 343 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 333 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 344 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 334 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 345 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 335 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 346 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 336 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 347 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 337 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 348 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 338 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 349 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, |
| 350 | SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 339 | ); | 351 | ); |
| 340 | pub fn DMA(n: u8) -> dma::Dma { | 352 | pub fn DMA(n: u8) -> dma::Dma { |
| 341 | match n { | 353 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7a3ii.rs b/embassy-stm32/src/pac/stm32h7a3ii.rs index 536447242..ebbcbd965 100644 --- a/embassy-stm32/src/pac/stm32h7a3ii.rs +++ b/embassy-stm32/src/pac/stm32h7a3ii.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 221 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 222 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 223 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -314,28 +321,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 321 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 322 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 323 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 324 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 317 | pub use super::regs::dma_v2 as dma; | 325 | pub use super::regs::dma_v2 as dma; |
| 318 | pub use super::regs::exti_v1 as exti; | 326 | pub use super::regs::exti_v1 as exti; |
| 327 | pub use super::regs::flash_h7 as flash; | ||
| 319 | pub use super::regs::gpio_v2 as gpio; | 328 | pub use super::regs::gpio_v2 as gpio; |
| 329 | pub use super::regs::i2c_v2 as i2c; | ||
| 330 | pub use super::regs::pwr_h7 as pwr; | ||
| 320 | pub use super::regs::rng_v1 as rng; | 331 | pub use super::regs::rng_v1 as rng; |
| 321 | pub use super::regs::sdmmc_v2 as sdmmc; | 332 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 322 | pub use super::regs::spi_v3 as spi; | 333 | pub use super::regs::spi_v3 as spi; |
| 323 | pub use super::regs::syscfg_h7 as syscfg; | 334 | pub use super::regs::syscfg_h7 as syscfg; |
| 324 | embassy_extras::peripherals!( | 335 | embassy_extras::peripherals!( |
| 325 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 336 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 326 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 337 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 327 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 338 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 328 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 339 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 329 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 340 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 330 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 341 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 331 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 342 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 332 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 343 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 333 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 344 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 334 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 345 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 335 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 346 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 336 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 347 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 337 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 348 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 338 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 349 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, |
| 350 | SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 339 | ); | 351 | ); |
| 340 | pub fn DMA(n: u8) -> dma::Dma { | 352 | pub fn DMA(n: u8) -> dma::Dma { |
| 341 | match n { | 353 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7a3lg.rs b/embassy-stm32/src/pac/stm32h7a3lg.rs index 536447242..ebbcbd965 100644 --- a/embassy-stm32/src/pac/stm32h7a3lg.rs +++ b/embassy-stm32/src/pac/stm32h7a3lg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 221 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 222 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 223 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -314,28 +321,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 321 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 322 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 323 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 324 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 317 | pub use super::regs::dma_v2 as dma; | 325 | pub use super::regs::dma_v2 as dma; |
| 318 | pub use super::regs::exti_v1 as exti; | 326 | pub use super::regs::exti_v1 as exti; |
| 327 | pub use super::regs::flash_h7 as flash; | ||
| 319 | pub use super::regs::gpio_v2 as gpio; | 328 | pub use super::regs::gpio_v2 as gpio; |
| 329 | pub use super::regs::i2c_v2 as i2c; | ||
| 330 | pub use super::regs::pwr_h7 as pwr; | ||
| 320 | pub use super::regs::rng_v1 as rng; | 331 | pub use super::regs::rng_v1 as rng; |
| 321 | pub use super::regs::sdmmc_v2 as sdmmc; | 332 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 322 | pub use super::regs::spi_v3 as spi; | 333 | pub use super::regs::spi_v3 as spi; |
| 323 | pub use super::regs::syscfg_h7 as syscfg; | 334 | pub use super::regs::syscfg_h7 as syscfg; |
| 324 | embassy_extras::peripherals!( | 335 | embassy_extras::peripherals!( |
| 325 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 336 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 326 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 337 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 327 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 338 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 328 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 339 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 329 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 340 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 330 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 341 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 331 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 342 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 332 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 343 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 333 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 344 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 334 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 345 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 335 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 346 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 336 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 347 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 337 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 348 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 338 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 349 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, |
| 350 | SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 339 | ); | 351 | ); |
| 340 | pub fn DMA(n: u8) -> dma::Dma { | 352 | pub fn DMA(n: u8) -> dma::Dma { |
| 341 | match n { | 353 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7a3li.rs b/embassy-stm32/src/pac/stm32h7a3li.rs index 536447242..ebbcbd965 100644 --- a/embassy-stm32/src/pac/stm32h7a3li.rs +++ b/embassy-stm32/src/pac/stm32h7a3li.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 221 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 222 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 223 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -314,28 +321,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 321 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 322 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 323 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 324 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 317 | pub use super::regs::dma_v2 as dma; | 325 | pub use super::regs::dma_v2 as dma; |
| 318 | pub use super::regs::exti_v1 as exti; | 326 | pub use super::regs::exti_v1 as exti; |
| 327 | pub use super::regs::flash_h7 as flash; | ||
| 319 | pub use super::regs::gpio_v2 as gpio; | 328 | pub use super::regs::gpio_v2 as gpio; |
| 329 | pub use super::regs::i2c_v2 as i2c; | ||
| 330 | pub use super::regs::pwr_h7 as pwr; | ||
| 320 | pub use super::regs::rng_v1 as rng; | 331 | pub use super::regs::rng_v1 as rng; |
| 321 | pub use super::regs::sdmmc_v2 as sdmmc; | 332 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 322 | pub use super::regs::spi_v3 as spi; | 333 | pub use super::regs::spi_v3 as spi; |
| 323 | pub use super::regs::syscfg_h7 as syscfg; | 334 | pub use super::regs::syscfg_h7 as syscfg; |
| 324 | embassy_extras::peripherals!( | 335 | embassy_extras::peripherals!( |
| 325 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 336 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 326 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 337 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 327 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 338 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 328 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 339 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 329 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 340 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 330 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 341 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 331 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 342 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 332 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 343 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 333 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 344 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 334 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 345 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 335 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 346 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 336 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 347 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 337 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 348 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 338 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 349 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, |
| 350 | SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 339 | ); | 351 | ); |
| 340 | pub fn DMA(n: u8) -> dma::Dma { | 352 | pub fn DMA(n: u8) -> dma::Dma { |
| 341 | match n { | 353 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7a3ng.rs b/embassy-stm32/src/pac/stm32h7a3ng.rs index 536447242..ebbcbd965 100644 --- a/embassy-stm32/src/pac/stm32h7a3ng.rs +++ b/embassy-stm32/src/pac/stm32h7a3ng.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 221 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 222 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 223 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -314,28 +321,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 321 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 322 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 323 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 324 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 317 | pub use super::regs::dma_v2 as dma; | 325 | pub use super::regs::dma_v2 as dma; |
| 318 | pub use super::regs::exti_v1 as exti; | 326 | pub use super::regs::exti_v1 as exti; |
| 327 | pub use super::regs::flash_h7 as flash; | ||
| 319 | pub use super::regs::gpio_v2 as gpio; | 328 | pub use super::regs::gpio_v2 as gpio; |
| 329 | pub use super::regs::i2c_v2 as i2c; | ||
| 330 | pub use super::regs::pwr_h7 as pwr; | ||
| 320 | pub use super::regs::rng_v1 as rng; | 331 | pub use super::regs::rng_v1 as rng; |
| 321 | pub use super::regs::sdmmc_v2 as sdmmc; | 332 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 322 | pub use super::regs::spi_v3 as spi; | 333 | pub use super::regs::spi_v3 as spi; |
| 323 | pub use super::regs::syscfg_h7 as syscfg; | 334 | pub use super::regs::syscfg_h7 as syscfg; |
| 324 | embassy_extras::peripherals!( | 335 | embassy_extras::peripherals!( |
| 325 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 336 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 326 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 337 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 327 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 338 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 328 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 339 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 329 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 340 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 330 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 341 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 331 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 342 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 332 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 343 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 333 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 344 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 334 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 345 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 335 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 346 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 336 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 347 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 337 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 348 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 338 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 349 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, |
| 350 | SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 339 | ); | 351 | ); |
| 340 | pub fn DMA(n: u8) -> dma::Dma { | 352 | pub fn DMA(n: u8) -> dma::Dma { |
| 341 | match n { | 353 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7a3ni.rs b/embassy-stm32/src/pac/stm32h7a3ni.rs index 536447242..ebbcbd965 100644 --- a/embassy-stm32/src/pac/stm32h7a3ni.rs +++ b/embassy-stm32/src/pac/stm32h7a3ni.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 221 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 222 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 223 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -314,28 +321,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 321 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 322 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 323 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 324 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 317 | pub use super::regs::dma_v2 as dma; | 325 | pub use super::regs::dma_v2 as dma; |
| 318 | pub use super::regs::exti_v1 as exti; | 326 | pub use super::regs::exti_v1 as exti; |
| 327 | pub use super::regs::flash_h7 as flash; | ||
| 319 | pub use super::regs::gpio_v2 as gpio; | 328 | pub use super::regs::gpio_v2 as gpio; |
| 329 | pub use super::regs::i2c_v2 as i2c; | ||
| 330 | pub use super::regs::pwr_h7 as pwr; | ||
| 320 | pub use super::regs::rng_v1 as rng; | 331 | pub use super::regs::rng_v1 as rng; |
| 321 | pub use super::regs::sdmmc_v2 as sdmmc; | 332 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 322 | pub use super::regs::spi_v3 as spi; | 333 | pub use super::regs::spi_v3 as spi; |
| 323 | pub use super::regs::syscfg_h7 as syscfg; | 334 | pub use super::regs::syscfg_h7 as syscfg; |
| 324 | embassy_extras::peripherals!( | 335 | embassy_extras::peripherals!( |
| 325 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 336 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 326 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 337 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 327 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 338 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 328 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 339 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 329 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 340 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 330 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 341 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 331 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 342 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 332 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 343 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 333 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 344 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 334 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 345 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 335 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 346 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 336 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 347 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 337 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 348 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 338 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 349 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, |
| 350 | SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 339 | ); | 351 | ); |
| 340 | pub fn DMA(n: u8) -> dma::Dma { | 352 | pub fn DMA(n: u8) -> dma::Dma { |
| 341 | match n { | 353 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7a3qi.rs b/embassy-stm32/src/pac/stm32h7a3qi.rs index 81699d1f4..bb8cdd699 100644 --- a/embassy-stm32/src/pac/stm32h7a3qi.rs +++ b/embassy-stm32/src/pac/stm32h7a3qi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 221 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 222 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 223 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -303,28 +310,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 303 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 310 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 304 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 311 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 305 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 312 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 313 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 306 | pub use super::regs::dma_v2 as dma; | 314 | pub use super::regs::dma_v2 as dma; |
| 307 | pub use super::regs::exti_v1 as exti; | 315 | pub use super::regs::exti_v1 as exti; |
| 316 | pub use super::regs::flash_h7 as flash; | ||
| 308 | pub use super::regs::gpio_v2 as gpio; | 317 | pub use super::regs::gpio_v2 as gpio; |
| 318 | pub use super::regs::i2c_v2 as i2c; | ||
| 319 | pub use super::regs::pwr_h7 as pwr; | ||
| 309 | pub use super::regs::rng_v1 as rng; | 320 | pub use super::regs::rng_v1 as rng; |
| 310 | pub use super::regs::sdmmc_v2 as sdmmc; | 321 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 311 | pub use super::regs::spi_v3 as spi; | 322 | pub use super::regs::spi_v3 as spi; |
| 312 | pub use super::regs::syscfg_h7 as syscfg; | 323 | pub use super::regs::syscfg_h7 as syscfg; |
| 313 | embassy_extras::peripherals!( | 324 | embassy_extras::peripherals!( |
| 314 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 325 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 315 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 326 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 316 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 327 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 317 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 328 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 318 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 329 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 319 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 330 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 320 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 331 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 321 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 332 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 322 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 333 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 323 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 334 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 324 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 335 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 325 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 336 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 326 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 337 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 327 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | 338 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, |
| 339 | SPI3, SPI4, SPI6, SYSCFG | ||
| 328 | ); | 340 | ); |
| 329 | pub fn DMA(n: u8) -> dma::Dma { | 341 | pub fn DMA(n: u8) -> dma::Dma { |
| 330 | match n { | 342 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7a3rg.rs b/embassy-stm32/src/pac/stm32h7a3rg.rs index 7ef698ee4..d4304e1b3 100644 --- a/embassy-stm32/src/pac/stm32h7a3rg.rs +++ b/embassy-stm32/src/pac/stm32h7a3rg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,10 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 218 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 219 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 220 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 221 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 222 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -295,28 +301,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 295 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 301 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 296 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 302 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 297 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 303 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 304 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 298 | pub use super::regs::dma_v2 as dma; | 305 | pub use super::regs::dma_v2 as dma; |
| 299 | pub use super::regs::exti_v1 as exti; | 306 | pub use super::regs::exti_v1 as exti; |
| 307 | pub use super::regs::flash_h7 as flash; | ||
| 300 | pub use super::regs::gpio_v2 as gpio; | 308 | pub use super::regs::gpio_v2 as gpio; |
| 309 | pub use super::regs::i2c_v2 as i2c; | ||
| 310 | pub use super::regs::pwr_h7 as pwr; | ||
| 301 | pub use super::regs::rng_v1 as rng; | 311 | pub use super::regs::rng_v1 as rng; |
| 302 | pub use super::regs::sdmmc_v2 as sdmmc; | 312 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 303 | pub use super::regs::spi_v3 as spi; | 313 | pub use super::regs::spi_v3 as spi; |
| 304 | pub use super::regs::syscfg_h7 as syscfg; | 314 | pub use super::regs::syscfg_h7 as syscfg; |
| 305 | embassy_extras::peripherals!( | 315 | embassy_extras::peripherals!( |
| 306 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 316 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 307 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 317 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 308 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 318 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 309 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 319 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 310 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 320 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 311 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 321 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 312 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 322 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 313 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 323 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 314 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 324 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 315 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 325 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 316 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 326 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 317 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 327 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 318 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 328 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 319 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI6, SYSCFG | 329 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, |
| 330 | SPI6, SYSCFG | ||
| 320 | ); | 331 | ); |
| 321 | pub fn DMA(n: u8) -> dma::Dma { | 332 | pub fn DMA(n: u8) -> dma::Dma { |
| 322 | match n { | 333 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7a3ri.rs b/embassy-stm32/src/pac/stm32h7a3ri.rs index 7ef698ee4..d4304e1b3 100644 --- a/embassy-stm32/src/pac/stm32h7a3ri.rs +++ b/embassy-stm32/src/pac/stm32h7a3ri.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,10 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 218 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 219 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 220 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 221 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 222 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -295,28 +301,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 295 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 301 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 296 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 302 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 297 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 303 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 304 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 298 | pub use super::regs::dma_v2 as dma; | 305 | pub use super::regs::dma_v2 as dma; |
| 299 | pub use super::regs::exti_v1 as exti; | 306 | pub use super::regs::exti_v1 as exti; |
| 307 | pub use super::regs::flash_h7 as flash; | ||
| 300 | pub use super::regs::gpio_v2 as gpio; | 308 | pub use super::regs::gpio_v2 as gpio; |
| 309 | pub use super::regs::i2c_v2 as i2c; | ||
| 310 | pub use super::regs::pwr_h7 as pwr; | ||
| 301 | pub use super::regs::rng_v1 as rng; | 311 | pub use super::regs::rng_v1 as rng; |
| 302 | pub use super::regs::sdmmc_v2 as sdmmc; | 312 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 303 | pub use super::regs::spi_v3 as spi; | 313 | pub use super::regs::spi_v3 as spi; |
| 304 | pub use super::regs::syscfg_h7 as syscfg; | 314 | pub use super::regs::syscfg_h7 as syscfg; |
| 305 | embassy_extras::peripherals!( | 315 | embassy_extras::peripherals!( |
| 306 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 316 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 307 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 317 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 308 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 318 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 309 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 319 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 310 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 320 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 311 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 321 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 312 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 322 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 313 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 323 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 314 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 324 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 315 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 325 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 316 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 326 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 317 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 327 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 318 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 328 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 319 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI6, SYSCFG | 329 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, |
| 330 | SPI6, SYSCFG | ||
| 320 | ); | 331 | ); |
| 321 | pub fn DMA(n: u8) -> dma::Dma { | 332 | pub fn DMA(n: u8) -> dma::Dma { |
| 322 | match n { | 333 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7a3vg.rs b/embassy-stm32/src/pac/stm32h7a3vg.rs index 81699d1f4..bb8cdd699 100644 --- a/embassy-stm32/src/pac/stm32h7a3vg.rs +++ b/embassy-stm32/src/pac/stm32h7a3vg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 221 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 222 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 223 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -303,28 +310,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 303 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 310 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 304 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 311 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 305 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 312 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 313 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 306 | pub use super::regs::dma_v2 as dma; | 314 | pub use super::regs::dma_v2 as dma; |
| 307 | pub use super::regs::exti_v1 as exti; | 315 | pub use super::regs::exti_v1 as exti; |
| 316 | pub use super::regs::flash_h7 as flash; | ||
| 308 | pub use super::regs::gpio_v2 as gpio; | 317 | pub use super::regs::gpio_v2 as gpio; |
| 318 | pub use super::regs::i2c_v2 as i2c; | ||
| 319 | pub use super::regs::pwr_h7 as pwr; | ||
| 309 | pub use super::regs::rng_v1 as rng; | 320 | pub use super::regs::rng_v1 as rng; |
| 310 | pub use super::regs::sdmmc_v2 as sdmmc; | 321 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 311 | pub use super::regs::spi_v3 as spi; | 322 | pub use super::regs::spi_v3 as spi; |
| 312 | pub use super::regs::syscfg_h7 as syscfg; | 323 | pub use super::regs::syscfg_h7 as syscfg; |
| 313 | embassy_extras::peripherals!( | 324 | embassy_extras::peripherals!( |
| 314 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 325 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 315 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 326 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 316 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 327 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 317 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 328 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 318 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 329 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 319 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 330 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 320 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 331 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 321 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 332 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 322 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 333 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 323 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 334 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 324 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 335 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 325 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 336 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 326 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 337 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 327 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | 338 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, |
| 339 | SPI3, SPI4, SPI6, SYSCFG | ||
| 328 | ); | 340 | ); |
| 329 | pub fn DMA(n: u8) -> dma::Dma { | 341 | pub fn DMA(n: u8) -> dma::Dma { |
| 330 | match n { | 342 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7a3vi.rs b/embassy-stm32/src/pac/stm32h7a3vi.rs index 81699d1f4..bb8cdd699 100644 --- a/embassy-stm32/src/pac/stm32h7a3vi.rs +++ b/embassy-stm32/src/pac/stm32h7a3vi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 221 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 222 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 223 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -303,28 +310,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 303 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 310 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 304 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 311 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 305 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 312 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 313 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 306 | pub use super::regs::dma_v2 as dma; | 314 | pub use super::regs::dma_v2 as dma; |
| 307 | pub use super::regs::exti_v1 as exti; | 315 | pub use super::regs::exti_v1 as exti; |
| 316 | pub use super::regs::flash_h7 as flash; | ||
| 308 | pub use super::regs::gpio_v2 as gpio; | 317 | pub use super::regs::gpio_v2 as gpio; |
| 318 | pub use super::regs::i2c_v2 as i2c; | ||
| 319 | pub use super::regs::pwr_h7 as pwr; | ||
| 309 | pub use super::regs::rng_v1 as rng; | 320 | pub use super::regs::rng_v1 as rng; |
| 310 | pub use super::regs::sdmmc_v2 as sdmmc; | 321 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 311 | pub use super::regs::spi_v3 as spi; | 322 | pub use super::regs::spi_v3 as spi; |
| 312 | pub use super::regs::syscfg_h7 as syscfg; | 323 | pub use super::regs::syscfg_h7 as syscfg; |
| 313 | embassy_extras::peripherals!( | 324 | embassy_extras::peripherals!( |
| 314 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 325 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 315 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 326 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 316 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 327 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 317 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 328 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 318 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 329 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 319 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 330 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 320 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 331 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 321 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 332 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 322 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 333 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 323 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 334 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 324 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 335 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 325 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 336 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 326 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 337 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 327 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | 338 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, |
| 339 | SPI3, SPI4, SPI6, SYSCFG | ||
| 328 | ); | 340 | ); |
| 329 | pub fn DMA(n: u8) -> dma::Dma { | 341 | pub fn DMA(n: u8) -> dma::Dma { |
| 330 | match n { | 342 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7a3zg.rs b/embassy-stm32/src/pac/stm32h7a3zg.rs index 536447242..ebbcbd965 100644 --- a/embassy-stm32/src/pac/stm32h7a3zg.rs +++ b/embassy-stm32/src/pac/stm32h7a3zg.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 221 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 222 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 223 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -314,28 +321,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 321 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 322 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 323 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 324 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 317 | pub use super::regs::dma_v2 as dma; | 325 | pub use super::regs::dma_v2 as dma; |
| 318 | pub use super::regs::exti_v1 as exti; | 326 | pub use super::regs::exti_v1 as exti; |
| 327 | pub use super::regs::flash_h7 as flash; | ||
| 319 | pub use super::regs::gpio_v2 as gpio; | 328 | pub use super::regs::gpio_v2 as gpio; |
| 329 | pub use super::regs::i2c_v2 as i2c; | ||
| 330 | pub use super::regs::pwr_h7 as pwr; | ||
| 320 | pub use super::regs::rng_v1 as rng; | 331 | pub use super::regs::rng_v1 as rng; |
| 321 | pub use super::regs::sdmmc_v2 as sdmmc; | 332 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 322 | pub use super::regs::spi_v3 as spi; | 333 | pub use super::regs::spi_v3 as spi; |
| 323 | pub use super::regs::syscfg_h7 as syscfg; | 334 | pub use super::regs::syscfg_h7 as syscfg; |
| 324 | embassy_extras::peripherals!( | 335 | embassy_extras::peripherals!( |
| 325 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 336 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 326 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 337 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 327 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 338 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 328 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 339 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 329 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 340 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 330 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 341 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 331 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 342 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 332 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 343 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 333 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 344 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 334 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 345 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 335 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 346 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 336 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 347 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 337 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 348 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 338 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 349 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, |
| 350 | SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 339 | ); | 351 | ); |
| 340 | pub fn DMA(n: u8) -> dma::Dma { | 352 | pub fn DMA(n: u8) -> dma::Dma { |
| 341 | match n { | 353 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7a3zi.rs b/embassy-stm32/src/pac/stm32h7a3zi.rs index 536447242..ebbcbd965 100644 --- a/embassy-stm32/src/pac/stm32h7a3zi.rs +++ b/embassy-stm32/src/pac/stm32h7a3zi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 221 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, RNG); | 222 | impl_rng!(RNG, RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 223 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -314,28 +321,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 321 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 322 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 323 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 324 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 317 | pub use super::regs::dma_v2 as dma; | 325 | pub use super::regs::dma_v2 as dma; |
| 318 | pub use super::regs::exti_v1 as exti; | 326 | pub use super::regs::exti_v1 as exti; |
| 327 | pub use super::regs::flash_h7 as flash; | ||
| 319 | pub use super::regs::gpio_v2 as gpio; | 328 | pub use super::regs::gpio_v2 as gpio; |
| 329 | pub use super::regs::i2c_v2 as i2c; | ||
| 330 | pub use super::regs::pwr_h7 as pwr; | ||
| 320 | pub use super::regs::rng_v1 as rng; | 331 | pub use super::regs::rng_v1 as rng; |
| 321 | pub use super::regs::sdmmc_v2 as sdmmc; | 332 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 322 | pub use super::regs::spi_v3 as spi; | 333 | pub use super::regs::spi_v3 as spi; |
| 323 | pub use super::regs::syscfg_h7 as syscfg; | 334 | pub use super::regs::syscfg_h7 as syscfg; |
| 324 | embassy_extras::peripherals!( | 335 | embassy_extras::peripherals!( |
| 325 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 336 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 326 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 337 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 327 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 338 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 328 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 339 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 329 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 340 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 330 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 341 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 331 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 342 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 332 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 343 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 333 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 344 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 334 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 345 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 335 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 346 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 336 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 347 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 337 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 348 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 338 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 349 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, |
| 350 | SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 339 | ); | 351 | ); |
| 340 | pub fn DMA(n: u8) -> dma::Dma { | 352 | pub fn DMA(n: u8) -> dma::Dma { |
| 341 | match n { | 353 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7b0ab.rs b/embassy-stm32/src/pac/stm32h7b0ab.rs index e63d84aab..561863369 100644 --- a/embassy-stm32/src/pac/stm32h7b0ab.rs +++ b/embassy-stm32/src/pac/stm32h7b0ab.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 221 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 222 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 223 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -314,28 +321,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 321 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 322 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 323 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 324 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 317 | pub use super::regs::dma_v2 as dma; | 325 | pub use super::regs::dma_v2 as dma; |
| 318 | pub use super::regs::exti_v1 as exti; | 326 | pub use super::regs::exti_v1 as exti; |
| 327 | pub use super::regs::flash_h7 as flash; | ||
| 319 | pub use super::regs::gpio_v2 as gpio; | 328 | pub use super::regs::gpio_v2 as gpio; |
| 329 | pub use super::regs::i2c_v2 as i2c; | ||
| 330 | pub use super::regs::pwr_h7 as pwr; | ||
| 320 | pub use super::regs::rng_v1 as rng; | 331 | pub use super::regs::rng_v1 as rng; |
| 321 | pub use super::regs::sdmmc_v2 as sdmmc; | 332 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 322 | pub use super::regs::spi_v3 as spi; | 333 | pub use super::regs::spi_v3 as spi; |
| 323 | pub use super::regs::syscfg_h7 as syscfg; | 334 | pub use super::regs::syscfg_h7 as syscfg; |
| 324 | embassy_extras::peripherals!( | 335 | embassy_extras::peripherals!( |
| 325 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 336 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 326 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 337 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 327 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 338 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 328 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 339 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 329 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 340 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 330 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 341 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 331 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 342 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 332 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 343 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 333 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 344 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 334 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 345 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 335 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 346 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 336 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 347 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 337 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 348 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 338 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 349 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, |
| 350 | SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 339 | ); | 351 | ); |
| 340 | pub fn DMA(n: u8) -> dma::Dma { | 352 | pub fn DMA(n: u8) -> dma::Dma { |
| 341 | match n { | 353 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7b0ib.rs b/embassy-stm32/src/pac/stm32h7b0ib.rs index e63d84aab..561863369 100644 --- a/embassy-stm32/src/pac/stm32h7b0ib.rs +++ b/embassy-stm32/src/pac/stm32h7b0ib.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 221 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 222 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 223 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -314,28 +321,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 321 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 322 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 323 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 324 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 317 | pub use super::regs::dma_v2 as dma; | 325 | pub use super::regs::dma_v2 as dma; |
| 318 | pub use super::regs::exti_v1 as exti; | 326 | pub use super::regs::exti_v1 as exti; |
| 327 | pub use super::regs::flash_h7 as flash; | ||
| 319 | pub use super::regs::gpio_v2 as gpio; | 328 | pub use super::regs::gpio_v2 as gpio; |
| 329 | pub use super::regs::i2c_v2 as i2c; | ||
| 330 | pub use super::regs::pwr_h7 as pwr; | ||
| 320 | pub use super::regs::rng_v1 as rng; | 331 | pub use super::regs::rng_v1 as rng; |
| 321 | pub use super::regs::sdmmc_v2 as sdmmc; | 332 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 322 | pub use super::regs::spi_v3 as spi; | 333 | pub use super::regs::spi_v3 as spi; |
| 323 | pub use super::regs::syscfg_h7 as syscfg; | 334 | pub use super::regs::syscfg_h7 as syscfg; |
| 324 | embassy_extras::peripherals!( | 335 | embassy_extras::peripherals!( |
| 325 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 336 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 326 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 337 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 327 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 338 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 328 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 339 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 329 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 340 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 330 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 341 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 331 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 342 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 332 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 343 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 333 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 344 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 334 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 345 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 335 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 346 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 336 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 347 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 337 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 348 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 338 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 349 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, |
| 350 | SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 339 | ); | 351 | ); |
| 340 | pub fn DMA(n: u8) -> dma::Dma { | 352 | pub fn DMA(n: u8) -> dma::Dma { |
| 341 | match n { | 353 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7b0rb.rs b/embassy-stm32/src/pac/stm32h7b0rb.rs index 8744f0c09..88400d852 100644 --- a/embassy-stm32/src/pac/stm32h7b0rb.rs +++ b/embassy-stm32/src/pac/stm32h7b0rb.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,10 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 218 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 219 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 220 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 221 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 222 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -295,28 +301,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 295 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 301 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 296 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 302 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 297 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 303 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 304 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 298 | pub use super::regs::dma_v2 as dma; | 305 | pub use super::regs::dma_v2 as dma; |
| 299 | pub use super::regs::exti_v1 as exti; | 306 | pub use super::regs::exti_v1 as exti; |
| 307 | pub use super::regs::flash_h7 as flash; | ||
| 300 | pub use super::regs::gpio_v2 as gpio; | 308 | pub use super::regs::gpio_v2 as gpio; |
| 309 | pub use super::regs::i2c_v2 as i2c; | ||
| 310 | pub use super::regs::pwr_h7 as pwr; | ||
| 301 | pub use super::regs::rng_v1 as rng; | 311 | pub use super::regs::rng_v1 as rng; |
| 302 | pub use super::regs::sdmmc_v2 as sdmmc; | 312 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 303 | pub use super::regs::spi_v3 as spi; | 313 | pub use super::regs::spi_v3 as spi; |
| 304 | pub use super::regs::syscfg_h7 as syscfg; | 314 | pub use super::regs::syscfg_h7 as syscfg; |
| 305 | embassy_extras::peripherals!( | 315 | embassy_extras::peripherals!( |
| 306 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 316 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 307 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 317 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 308 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 318 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 309 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 319 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 310 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 320 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 311 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 321 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 312 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 322 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 313 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 323 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 314 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 324 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 315 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 325 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 316 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 326 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 317 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 327 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 318 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 328 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 319 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI6, SYSCFG | 329 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, |
| 330 | SPI6, SYSCFG | ||
| 320 | ); | 331 | ); |
| 321 | pub fn DMA(n: u8) -> dma::Dma { | 332 | pub fn DMA(n: u8) -> dma::Dma { |
| 322 | match n { | 333 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7b0vb.rs b/embassy-stm32/src/pac/stm32h7b0vb.rs index 34da552a3..cfbd6041e 100644 --- a/embassy-stm32/src/pac/stm32h7b0vb.rs +++ b/embassy-stm32/src/pac/stm32h7b0vb.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 221 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 222 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 223 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -303,28 +310,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 303 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 310 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 304 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 311 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 305 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 312 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 313 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 306 | pub use super::regs::dma_v2 as dma; | 314 | pub use super::regs::dma_v2 as dma; |
| 307 | pub use super::regs::exti_v1 as exti; | 315 | pub use super::regs::exti_v1 as exti; |
| 316 | pub use super::regs::flash_h7 as flash; | ||
| 308 | pub use super::regs::gpio_v2 as gpio; | 317 | pub use super::regs::gpio_v2 as gpio; |
| 318 | pub use super::regs::i2c_v2 as i2c; | ||
| 319 | pub use super::regs::pwr_h7 as pwr; | ||
| 309 | pub use super::regs::rng_v1 as rng; | 320 | pub use super::regs::rng_v1 as rng; |
| 310 | pub use super::regs::sdmmc_v2 as sdmmc; | 321 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 311 | pub use super::regs::spi_v3 as spi; | 322 | pub use super::regs::spi_v3 as spi; |
| 312 | pub use super::regs::syscfg_h7 as syscfg; | 323 | pub use super::regs::syscfg_h7 as syscfg; |
| 313 | embassy_extras::peripherals!( | 324 | embassy_extras::peripherals!( |
| 314 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 325 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 315 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 326 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 316 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 327 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 317 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 328 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 318 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 329 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 319 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 330 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 320 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 331 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 321 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 332 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 322 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 333 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 323 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 334 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 324 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 335 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 325 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 336 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 326 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 337 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 327 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | 338 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, |
| 339 | SPI3, SPI4, SPI6, SYSCFG | ||
| 328 | ); | 340 | ); |
| 329 | pub fn DMA(n: u8) -> dma::Dma { | 341 | pub fn DMA(n: u8) -> dma::Dma { |
| 330 | match n { | 342 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7b0zb.rs b/embassy-stm32/src/pac/stm32h7b0zb.rs index e63d84aab..561863369 100644 --- a/embassy-stm32/src/pac/stm32h7b0zb.rs +++ b/embassy-stm32/src/pac/stm32h7b0zb.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 221 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 222 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 223 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -314,28 +321,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 321 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 322 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 323 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 324 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 317 | pub use super::regs::dma_v2 as dma; | 325 | pub use super::regs::dma_v2 as dma; |
| 318 | pub use super::regs::exti_v1 as exti; | 326 | pub use super::regs::exti_v1 as exti; |
| 327 | pub use super::regs::flash_h7 as flash; | ||
| 319 | pub use super::regs::gpio_v2 as gpio; | 328 | pub use super::regs::gpio_v2 as gpio; |
| 329 | pub use super::regs::i2c_v2 as i2c; | ||
| 330 | pub use super::regs::pwr_h7 as pwr; | ||
| 320 | pub use super::regs::rng_v1 as rng; | 331 | pub use super::regs::rng_v1 as rng; |
| 321 | pub use super::regs::sdmmc_v2 as sdmmc; | 332 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 322 | pub use super::regs::spi_v3 as spi; | 333 | pub use super::regs::spi_v3 as spi; |
| 323 | pub use super::regs::syscfg_h7 as syscfg; | 334 | pub use super::regs::syscfg_h7 as syscfg; |
| 324 | embassy_extras::peripherals!( | 335 | embassy_extras::peripherals!( |
| 325 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 336 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 326 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 337 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 327 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 338 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 328 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 339 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 329 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 340 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 330 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 341 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 331 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 342 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 332 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 343 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 333 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 344 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 334 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 345 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 335 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 346 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 336 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 347 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 337 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 348 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 338 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 349 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, |
| 350 | SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 339 | ); | 351 | ); |
| 340 | pub fn DMA(n: u8) -> dma::Dma { | 352 | pub fn DMA(n: u8) -> dma::Dma { |
| 341 | match n { | 353 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7b3ai.rs b/embassy-stm32/src/pac/stm32h7b3ai.rs index e63d84aab..561863369 100644 --- a/embassy-stm32/src/pac/stm32h7b3ai.rs +++ b/embassy-stm32/src/pac/stm32h7b3ai.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 221 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 222 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 223 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -314,28 +321,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 321 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 322 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 323 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 324 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 317 | pub use super::regs::dma_v2 as dma; | 325 | pub use super::regs::dma_v2 as dma; |
| 318 | pub use super::regs::exti_v1 as exti; | 326 | pub use super::regs::exti_v1 as exti; |
| 327 | pub use super::regs::flash_h7 as flash; | ||
| 319 | pub use super::regs::gpio_v2 as gpio; | 328 | pub use super::regs::gpio_v2 as gpio; |
| 329 | pub use super::regs::i2c_v2 as i2c; | ||
| 330 | pub use super::regs::pwr_h7 as pwr; | ||
| 320 | pub use super::regs::rng_v1 as rng; | 331 | pub use super::regs::rng_v1 as rng; |
| 321 | pub use super::regs::sdmmc_v2 as sdmmc; | 332 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 322 | pub use super::regs::spi_v3 as spi; | 333 | pub use super::regs::spi_v3 as spi; |
| 323 | pub use super::regs::syscfg_h7 as syscfg; | 334 | pub use super::regs::syscfg_h7 as syscfg; |
| 324 | embassy_extras::peripherals!( | 335 | embassy_extras::peripherals!( |
| 325 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 336 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 326 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 337 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 327 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 338 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 328 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 339 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 329 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 340 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 330 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 341 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 331 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 342 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 332 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 343 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 333 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 344 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 334 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 345 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 335 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 346 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 336 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 347 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 337 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 348 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 338 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 349 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, |
| 350 | SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 339 | ); | 351 | ); |
| 340 | pub fn DMA(n: u8) -> dma::Dma { | 352 | pub fn DMA(n: u8) -> dma::Dma { |
| 341 | match n { | 353 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7b3ii.rs b/embassy-stm32/src/pac/stm32h7b3ii.rs index e63d84aab..561863369 100644 --- a/embassy-stm32/src/pac/stm32h7b3ii.rs +++ b/embassy-stm32/src/pac/stm32h7b3ii.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 221 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 222 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 223 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -314,28 +321,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 321 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 322 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 323 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 324 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 317 | pub use super::regs::dma_v2 as dma; | 325 | pub use super::regs::dma_v2 as dma; |
| 318 | pub use super::regs::exti_v1 as exti; | 326 | pub use super::regs::exti_v1 as exti; |
| 327 | pub use super::regs::flash_h7 as flash; | ||
| 319 | pub use super::regs::gpio_v2 as gpio; | 328 | pub use super::regs::gpio_v2 as gpio; |
| 329 | pub use super::regs::i2c_v2 as i2c; | ||
| 330 | pub use super::regs::pwr_h7 as pwr; | ||
| 320 | pub use super::regs::rng_v1 as rng; | 331 | pub use super::regs::rng_v1 as rng; |
| 321 | pub use super::regs::sdmmc_v2 as sdmmc; | 332 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 322 | pub use super::regs::spi_v3 as spi; | 333 | pub use super::regs::spi_v3 as spi; |
| 323 | pub use super::regs::syscfg_h7 as syscfg; | 334 | pub use super::regs::syscfg_h7 as syscfg; |
| 324 | embassy_extras::peripherals!( | 335 | embassy_extras::peripherals!( |
| 325 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 336 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 326 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 337 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 327 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 338 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 328 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 339 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 329 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 340 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 330 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 341 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 331 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 342 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 332 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 343 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 333 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 344 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 334 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 345 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 335 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 346 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 336 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 347 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 337 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 348 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 338 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 349 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, |
| 350 | SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 339 | ); | 351 | ); |
| 340 | pub fn DMA(n: u8) -> dma::Dma { | 352 | pub fn DMA(n: u8) -> dma::Dma { |
| 341 | match n { | 353 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7b3li.rs b/embassy-stm32/src/pac/stm32h7b3li.rs index e63d84aab..561863369 100644 --- a/embassy-stm32/src/pac/stm32h7b3li.rs +++ b/embassy-stm32/src/pac/stm32h7b3li.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 221 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 222 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 223 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -314,28 +321,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 321 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 322 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 323 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 324 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 317 | pub use super::regs::dma_v2 as dma; | 325 | pub use super::regs::dma_v2 as dma; |
| 318 | pub use super::regs::exti_v1 as exti; | 326 | pub use super::regs::exti_v1 as exti; |
| 327 | pub use super::regs::flash_h7 as flash; | ||
| 319 | pub use super::regs::gpio_v2 as gpio; | 328 | pub use super::regs::gpio_v2 as gpio; |
| 329 | pub use super::regs::i2c_v2 as i2c; | ||
| 330 | pub use super::regs::pwr_h7 as pwr; | ||
| 320 | pub use super::regs::rng_v1 as rng; | 331 | pub use super::regs::rng_v1 as rng; |
| 321 | pub use super::regs::sdmmc_v2 as sdmmc; | 332 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 322 | pub use super::regs::spi_v3 as spi; | 333 | pub use super::regs::spi_v3 as spi; |
| 323 | pub use super::regs::syscfg_h7 as syscfg; | 334 | pub use super::regs::syscfg_h7 as syscfg; |
| 324 | embassy_extras::peripherals!( | 335 | embassy_extras::peripherals!( |
| 325 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 336 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 326 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 337 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 327 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 338 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 328 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 339 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 329 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 340 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 330 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 341 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 331 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 342 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 332 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 343 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 333 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 344 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 334 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 345 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 335 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 346 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 336 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 347 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 337 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 348 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 338 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 349 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, |
| 350 | SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 339 | ); | 351 | ); |
| 340 | pub fn DMA(n: u8) -> dma::Dma { | 352 | pub fn DMA(n: u8) -> dma::Dma { |
| 341 | match n { | 353 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7b3ni.rs b/embassy-stm32/src/pac/stm32h7b3ni.rs index e63d84aab..561863369 100644 --- a/embassy-stm32/src/pac/stm32h7b3ni.rs +++ b/embassy-stm32/src/pac/stm32h7b3ni.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 221 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 222 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 223 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -314,28 +321,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 321 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 322 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 323 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 324 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 317 | pub use super::regs::dma_v2 as dma; | 325 | pub use super::regs::dma_v2 as dma; |
| 318 | pub use super::regs::exti_v1 as exti; | 326 | pub use super::regs::exti_v1 as exti; |
| 327 | pub use super::regs::flash_h7 as flash; | ||
| 319 | pub use super::regs::gpio_v2 as gpio; | 328 | pub use super::regs::gpio_v2 as gpio; |
| 329 | pub use super::regs::i2c_v2 as i2c; | ||
| 330 | pub use super::regs::pwr_h7 as pwr; | ||
| 320 | pub use super::regs::rng_v1 as rng; | 331 | pub use super::regs::rng_v1 as rng; |
| 321 | pub use super::regs::sdmmc_v2 as sdmmc; | 332 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 322 | pub use super::regs::spi_v3 as spi; | 333 | pub use super::regs::spi_v3 as spi; |
| 323 | pub use super::regs::syscfg_h7 as syscfg; | 334 | pub use super::regs::syscfg_h7 as syscfg; |
| 324 | embassy_extras::peripherals!( | 335 | embassy_extras::peripherals!( |
| 325 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 336 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 326 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 337 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 327 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 338 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 328 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 339 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 329 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 340 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 330 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 341 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 331 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 342 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 332 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 343 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 333 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 344 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 334 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 345 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 335 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 346 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 336 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 347 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 337 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 348 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 338 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 349 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, |
| 350 | SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 339 | ); | 351 | ); |
| 340 | pub fn DMA(n: u8) -> dma::Dma { | 352 | pub fn DMA(n: u8) -> dma::Dma { |
| 341 | match n { | 353 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7b3qi.rs b/embassy-stm32/src/pac/stm32h7b3qi.rs index 34da552a3..cfbd6041e 100644 --- a/embassy-stm32/src/pac/stm32h7b3qi.rs +++ b/embassy-stm32/src/pac/stm32h7b3qi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 221 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 222 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 223 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -303,28 +310,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 303 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 310 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 304 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 311 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 305 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 312 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 313 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 306 | pub use super::regs::dma_v2 as dma; | 314 | pub use super::regs::dma_v2 as dma; |
| 307 | pub use super::regs::exti_v1 as exti; | 315 | pub use super::regs::exti_v1 as exti; |
| 316 | pub use super::regs::flash_h7 as flash; | ||
| 308 | pub use super::regs::gpio_v2 as gpio; | 317 | pub use super::regs::gpio_v2 as gpio; |
| 318 | pub use super::regs::i2c_v2 as i2c; | ||
| 319 | pub use super::regs::pwr_h7 as pwr; | ||
| 309 | pub use super::regs::rng_v1 as rng; | 320 | pub use super::regs::rng_v1 as rng; |
| 310 | pub use super::regs::sdmmc_v2 as sdmmc; | 321 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 311 | pub use super::regs::spi_v3 as spi; | 322 | pub use super::regs::spi_v3 as spi; |
| 312 | pub use super::regs::syscfg_h7 as syscfg; | 323 | pub use super::regs::syscfg_h7 as syscfg; |
| 313 | embassy_extras::peripherals!( | 324 | embassy_extras::peripherals!( |
| 314 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 325 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 315 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 326 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 316 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 327 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 317 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 328 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 318 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 329 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 319 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 330 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 320 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 331 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 321 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 332 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 322 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 333 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 323 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 334 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 324 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 335 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 325 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 336 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 326 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 337 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 327 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | 338 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, |
| 339 | SPI3, SPI4, SPI6, SYSCFG | ||
| 328 | ); | 340 | ); |
| 329 | pub fn DMA(n: u8) -> dma::Dma { | 341 | pub fn DMA(n: u8) -> dma::Dma { |
| 330 | match n { | 342 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7b3ri.rs b/embassy-stm32/src/pac/stm32h7b3ri.rs index 8744f0c09..88400d852 100644 --- a/embassy-stm32/src/pac/stm32h7b3ri.rs +++ b/embassy-stm32/src/pac/stm32h7b3ri.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,10 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 218 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 219 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 220 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 221 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 222 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -295,28 +301,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 295 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 301 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 296 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 302 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 297 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 303 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 304 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 298 | pub use super::regs::dma_v2 as dma; | 305 | pub use super::regs::dma_v2 as dma; |
| 299 | pub use super::regs::exti_v1 as exti; | 306 | pub use super::regs::exti_v1 as exti; |
| 307 | pub use super::regs::flash_h7 as flash; | ||
| 300 | pub use super::regs::gpio_v2 as gpio; | 308 | pub use super::regs::gpio_v2 as gpio; |
| 309 | pub use super::regs::i2c_v2 as i2c; | ||
| 310 | pub use super::regs::pwr_h7 as pwr; | ||
| 301 | pub use super::regs::rng_v1 as rng; | 311 | pub use super::regs::rng_v1 as rng; |
| 302 | pub use super::regs::sdmmc_v2 as sdmmc; | 312 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 303 | pub use super::regs::spi_v3 as spi; | 313 | pub use super::regs::spi_v3 as spi; |
| 304 | pub use super::regs::syscfg_h7 as syscfg; | 314 | pub use super::regs::syscfg_h7 as syscfg; |
| 305 | embassy_extras::peripherals!( | 315 | embassy_extras::peripherals!( |
| 306 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 316 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 307 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 317 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 308 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 318 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 309 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 319 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 310 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 320 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 311 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 321 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 312 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 322 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 313 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 323 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 314 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 324 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 315 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 325 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 316 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 326 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 317 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 327 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 318 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 328 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 319 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI6, SYSCFG | 329 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, |
| 330 | SPI6, SYSCFG | ||
| 320 | ); | 331 | ); |
| 321 | pub fn DMA(n: u8) -> dma::Dma { | 332 | pub fn DMA(n: u8) -> dma::Dma { |
| 322 | match n { | 333 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7b3vi.rs b/embassy-stm32/src/pac/stm32h7b3vi.rs index 34da552a3..cfbd6041e 100644 --- a/embassy-stm32/src/pac/stm32h7b3vi.rs +++ b/embassy-stm32/src/pac/stm32h7b3vi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 221 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 222 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 223 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -303,28 +310,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 303 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 310 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 304 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 311 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 305 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 312 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 313 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 306 | pub use super::regs::dma_v2 as dma; | 314 | pub use super::regs::dma_v2 as dma; |
| 307 | pub use super::regs::exti_v1 as exti; | 315 | pub use super::regs::exti_v1 as exti; |
| 316 | pub use super::regs::flash_h7 as flash; | ||
| 308 | pub use super::regs::gpio_v2 as gpio; | 317 | pub use super::regs::gpio_v2 as gpio; |
| 318 | pub use super::regs::i2c_v2 as i2c; | ||
| 319 | pub use super::regs::pwr_h7 as pwr; | ||
| 309 | pub use super::regs::rng_v1 as rng; | 320 | pub use super::regs::rng_v1 as rng; |
| 310 | pub use super::regs::sdmmc_v2 as sdmmc; | 321 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 311 | pub use super::regs::spi_v3 as spi; | 322 | pub use super::regs::spi_v3 as spi; |
| 312 | pub use super::regs::syscfg_h7 as syscfg; | 323 | pub use super::regs::syscfg_h7 as syscfg; |
| 313 | embassy_extras::peripherals!( | 324 | embassy_extras::peripherals!( |
| 314 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 325 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 315 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 326 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 316 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 327 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 317 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 328 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 318 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 329 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 319 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 330 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 320 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 331 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 321 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 332 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 322 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 333 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 323 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 334 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 324 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 335 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 325 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 336 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 326 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 337 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 327 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI6, SYSCFG | 338 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, |
| 339 | SPI3, SPI4, SPI6, SYSCFG | ||
| 328 | ); | 340 | ); |
| 329 | pub fn DMA(n: u8) -> dma::Dma { | 341 | pub fn DMA(n: u8) -> dma::Dma { |
| 330 | match n { | 342 | match n { |
diff --git a/embassy-stm32/src/pac/stm32h7b3zi.rs b/embassy-stm32/src/pac/stm32h7b3zi.rs index e63d84aab..561863369 100644 --- a/embassy-stm32/src/pac/stm32h7b3zi.rs +++ b/embassy-stm32/src/pac/stm32h7b3zi.rs | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | pub fn GPIO(n: usize) -> gpio::Gpio { | 5 | pub fn GPIO(n: usize) -> gpio::Gpio { |
| 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) | 6 | gpio::Gpio((0x58020000 + 0x400 * n) as _) |
| 7 | } | 7 | } |
| 8 | pub const DBGMCU: dbgmcu::Dbgmcu = dbgmcu::Dbgmcu(0x5c001000 as _); | ||
| 8 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); | 9 | pub const DMA1: dma::Dma = dma::Dma(0x40020000 as _); |
| 9 | impl_dma_channel!(DMA1_CH0, 0, 0); | 10 | impl_dma_channel!(DMA1_CH0, 0, 0); |
| 10 | impl_dma_channel!(DMA1_CH1, 0, 1); | 11 | impl_dma_channel!(DMA1_CH1, 0, 1); |
| @@ -24,6 +25,7 @@ impl_dma_channel!(DMA2_CH5, 1, 5); | |||
| 24 | impl_dma_channel!(DMA2_CH6, 1, 6); | 25 | impl_dma_channel!(DMA2_CH6, 1, 6); |
| 25 | impl_dma_channel!(DMA2_CH7, 1, 7); | 26 | impl_dma_channel!(DMA2_CH7, 1, 7); |
| 26 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); | 27 | pub const EXTI: exti::Exti = exti::Exti(0x58000000 as _); |
| 28 | pub const FLASH: flash::Flash = flash::Flash(0x52002000 as _); | ||
| 27 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); | 29 | pub const GPIOA: gpio::Gpio = gpio::Gpio(0x58020000 as _); |
| 28 | impl_gpio_pin!(PA0, 0, 0, EXTI0); | 30 | impl_gpio_pin!(PA0, 0, 0, EXTI0); |
| 29 | impl_gpio_pin!(PA1, 0, 1, EXTI1); | 31 | impl_gpio_pin!(PA1, 0, 1, EXTI1); |
| @@ -211,6 +213,11 @@ impl_gpio_pin!(PK12, 10, 12, EXTI12); | |||
| 211 | impl_gpio_pin!(PK13, 10, 13, EXTI13); | 213 | impl_gpio_pin!(PK13, 10, 13, EXTI13); |
| 212 | impl_gpio_pin!(PK14, 10, 14, EXTI14); | 214 | impl_gpio_pin!(PK14, 10, 14, EXTI14); |
| 213 | impl_gpio_pin!(PK15, 10, 15, EXTI15); | 215 | impl_gpio_pin!(PK15, 10, 15, EXTI15); |
| 216 | pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); | ||
| 217 | pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); | ||
| 218 | pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); | ||
| 219 | pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); | ||
| 220 | pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); | ||
| 214 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); | 221 | pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); |
| 215 | impl_rng!(RNG, HASH_RNG); | 222 | impl_rng!(RNG, HASH_RNG); |
| 216 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); | 223 | pub const SDMMC1: sdmmc::Sdmmc = sdmmc::Sdmmc(0x52007000 as _); |
| @@ -314,28 +321,33 @@ impl_spi_pin!(SPI6, MisoPin, PG12, 5); | |||
| 314 | impl_spi_pin!(SPI6, SckPin, PG13, 5); | 321 | impl_spi_pin!(SPI6, SckPin, PG13, 5); |
| 315 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); | 322 | impl_spi_pin!(SPI6, MosiPin, PG14, 5); |
| 316 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); | 323 | pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x58000400 as _); |
| 324 | pub use super::regs::dbgmcu_h7 as dbgmcu; | ||
| 317 | pub use super::regs::dma_v2 as dma; | 325 | pub use super::regs::dma_v2 as dma; |
| 318 | pub use super::regs::exti_v1 as exti; | 326 | pub use super::regs::exti_v1 as exti; |
| 327 | pub use super::regs::flash_h7 as flash; | ||
| 319 | pub use super::regs::gpio_v2 as gpio; | 328 | pub use super::regs::gpio_v2 as gpio; |
| 329 | pub use super::regs::i2c_v2 as i2c; | ||
| 330 | pub use super::regs::pwr_h7 as pwr; | ||
| 320 | pub use super::regs::rng_v1 as rng; | 331 | pub use super::regs::rng_v1 as rng; |
| 321 | pub use super::regs::sdmmc_v2 as sdmmc; | 332 | pub use super::regs::sdmmc_v2 as sdmmc; |
| 322 | pub use super::regs::spi_v3 as spi; | 333 | pub use super::regs::spi_v3 as spi; |
| 323 | pub use super::regs::syscfg_h7 as syscfg; | 334 | pub use super::regs::syscfg_h7 as syscfg; |
| 324 | embassy_extras::peripherals!( | 335 | embassy_extras::peripherals!( |
| 325 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, | 336 | EXTI0, EXTI1, EXTI2, EXTI3, EXTI4, EXTI5, EXTI6, EXTI7, EXTI8, EXTI9, EXTI10, EXTI11, EXTI12, |
| 326 | EXTI13, EXTI14, EXTI15, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, DMA1_CH6, | 337 | EXTI13, EXTI14, EXTI15, DBGMCU, DMA1_CH0, DMA1_CH1, DMA1_CH2, DMA1_CH3, DMA1_CH4, DMA1_CH5, |
| 327 | DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, DMA2_CH7, EXTI, | 338 | DMA1_CH6, DMA1_CH7, DMA2_CH0, DMA2_CH1, DMA2_CH2, DMA2_CH3, DMA2_CH4, DMA2_CH5, DMA2_CH6, |
| 328 | PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13, PA14, PA15, PB0, PB1, | 339 | DMA2_CH7, EXTI, FLASH, PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, |
| 329 | PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15, PC0, PC1, PC2, PC3, | 340 | PA13, PA14, PA15, PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7, PB8, PB9, PB10, PB11, PB12, PB13, |
| 330 | PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, PC15, PD0, PD1, PD2, PD3, PD4, PD5, | 341 | PB14, PB15, PC0, PC1, PC2, PC3, PC4, PC5, PC6, PC7, PC8, PC9, PC10, PC11, PC12, PC13, PC14, |
| 331 | PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, | 342 | PC15, PD0, PD1, PD2, PD3, PD4, PD5, PD6, PD7, PD8, PD9, PD10, PD11, PD12, PD13, PD14, PD15, |
| 332 | PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, | 343 | PE0, PE1, PE2, PE3, PE4, PE5, PE6, PE7, PE8, PE9, PE10, PE11, PE12, PE13, PE14, PE15, PF0, PF1, |
| 333 | PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, | 344 | PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, PG0, PG1, PG2, PG3, |
| 334 | PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, | 345 | PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, PH0, PH1, PH2, PH3, PH4, PH5, |
| 335 | PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, | 346 | PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, PI0, PI1, PI2, PI3, PI4, PI5, PI6, PI7, |
| 336 | PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, | 347 | PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, PJ0, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, |
| 337 | PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, | 348 | PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, PK0, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, |
| 338 | PK15, RNG, SDMMC1, SDMMC2, SPI1, SPI2, SPI3, SPI4, SPI5, SPI6, SYSCFG | 349 | PK11, PK12, PK13, PK14, PK15, I2C1, I2C2, I2C3, I2C4, PWR, RNG, SDMMC1, SDMMC2, SPI1, SPI2, |
| 350 | SPI3, SPI4, SPI5, SPI6, SYSCFG | ||
| 339 | ); | 351 | ); |
| 340 | pub fn DMA(n: u8) -> dma::Dma { | 352 | pub fn DMA(n: u8) -> dma::Dma { |
| 341 | match n { | 353 | match n { |
diff --git a/embassy-stm32/src/pwr/h7.rs b/embassy-stm32/src/pwr/h7.rs new file mode 100644 index 000000000..939e93eb2 --- /dev/null +++ b/embassy-stm32/src/pwr/h7.rs | |||
| @@ -0,0 +1,71 @@ | |||
| 1 | use crate::pac::peripherals; | ||
| 2 | use crate::pac::{PWR, RCC, SYSCFG}; | ||
| 3 | |||
| 4 | /// Voltage Scale | ||
| 5 | /// | ||
| 6 | /// Represents the voltage range feeding the CPU core. The maximum core | ||
| 7 | /// clock frequency depends on this value. | ||
| 8 | #[derive(Copy, Clone, PartialEq)] | ||
| 9 | pub enum VoltageScale { | ||
| 10 | /// VOS 0 range VCORE 1.26V - 1.40V | ||
| 11 | Scale0, | ||
| 12 | /// VOS 1 range VCORE 1.15V - 1.26V | ||
| 13 | Scale1, | ||
| 14 | /// VOS 2 range VCORE 1.05V - 1.15V | ||
| 15 | Scale2, | ||
| 16 | /// VOS 3 range VCORE 0.95V - 1.05V | ||
| 17 | Scale3, | ||
| 18 | } | ||
| 19 | |||
| 20 | /// Power Configuration | ||
| 21 | /// | ||
| 22 | /// Generated when the PWR peripheral is frozen. The existence of this | ||
| 23 | /// value indicates that the voltage scaling configuration can no | ||
| 24 | /// longer be changed. | ||
| 25 | pub struct Power { | ||
| 26 | pub(crate) vos: VoltageScale, | ||
| 27 | } | ||
| 28 | |||
| 29 | impl Power { | ||
| 30 | pub fn new(_peri: peripherals::PWR, enable_overdrive: bool) -> Self { | ||
| 31 | use crate::pac::rcc::vals::Apb4enrSyscfgen; | ||
| 32 | |||
| 33 | // NOTE(unsafe) we have the PWR singleton | ||
| 34 | unsafe { | ||
| 35 | // NB. The lower bytes of CR3 can only be written once after | ||
| 36 | // POR, and must be written with a valid combination. Refer to | ||
| 37 | // RM0433 Rev 7 6.8.4. This is partially enforced by dropping | ||
| 38 | // `self` at the end of this method, but of course we cannot | ||
| 39 | // know what happened between the previous POR and here. | ||
| 40 | PWR.cr3().modify(|w| { | ||
| 41 | w.set_scuen(true); | ||
| 42 | w.set_ldoen(true); | ||
| 43 | w.set_bypass(false); | ||
| 44 | }); | ||
| 45 | // Validate the supply configuration. If you are stuck here, it is | ||
| 46 | // because the voltages on your board do not match those specified | ||
| 47 | // in the D3CR.VOS and CR3.SDLEVEL fields. By default after reset | ||
| 48 | // VOS = Scale 3, so check that the voltage on the VCAP pins = | ||
| 49 | // 1.0V. | ||
| 50 | while !PWR.csr1().read().actvosrdy() {} | ||
| 51 | |||
| 52 | // Go to Scale 1 | ||
| 53 | PWR.d3cr().modify(|w| w.set_vos(0b11)); | ||
| 54 | while !PWR.d3cr().read().vosrdy() {} | ||
| 55 | |||
| 56 | let vos = if !enable_overdrive { | ||
| 57 | VoltageScale::Scale1 | ||
| 58 | } else { | ||
| 59 | critical_section::with(|_| { | ||
| 60 | RCC.apb4enr() | ||
| 61 | .modify(|w| w.set_syscfgen(Apb4enrSyscfgen::ENABLED)); | ||
| 62 | |||
| 63 | SYSCFG.pwrcr().modify(|w| w.set_oden(1)); | ||
| 64 | }); | ||
| 65 | while !PWR.d3cr().read().vosrdy() {} | ||
| 66 | VoltageScale::Scale0 | ||
| 67 | }; | ||
| 68 | Self { vos } | ||
| 69 | } | ||
| 70 | } | ||
| 71 | } | ||
diff --git a/embassy-stm32/src/pwr/mod.rs b/embassy-stm32/src/pwr/mod.rs new file mode 100644 index 000000000..0bf62ef7c --- /dev/null +++ b/embassy-stm32/src/pwr/mod.rs | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #[cfg(feature = "_stm32h7")] | ||
| 2 | mod h7; | ||
| 3 | #[cfg(feature = "_stm32h7")] | ||
| 4 | pub use h7::*; | ||
diff --git a/embassy-stm32/src/rcc/h7/mod.rs b/embassy-stm32/src/rcc/h7/mod.rs new file mode 100644 index 000000000..d8d231bae --- /dev/null +++ b/embassy-stm32/src/rcc/h7/mod.rs | |||
| @@ -0,0 +1,529 @@ | |||
| 1 | use core::marker::PhantomData; | ||
| 2 | |||
| 3 | use embassy::util::Unborrow; | ||
| 4 | |||
| 5 | use crate::fmt::{assert, panic}; | ||
| 6 | use crate::pac::peripherals; | ||
| 7 | use crate::pac::rcc::vals::Timpre; | ||
| 8 | use crate::pac::{DBGMCU, RCC, SYSCFG}; | ||
| 9 | use crate::pwr::{Power, VoltageScale}; | ||
| 10 | use crate::time::Hertz; | ||
| 11 | |||
| 12 | mod pll; | ||
| 13 | use pll::pll_setup; | ||
| 14 | pub use pll::PllConfig; | ||
| 15 | |||
| 16 | const HSI: Hertz = Hertz(64_000_000); | ||
| 17 | const CSI: Hertz = Hertz(4_000_000); | ||
| 18 | const HSI48: Hertz = Hertz(48_000_000); | ||
| 19 | const LSI: Hertz = Hertz(32_000); | ||
| 20 | |||
| 21 | /// Core clock frequencies | ||
| 22 | #[derive(Clone, Copy)] | ||
| 23 | pub struct CoreClocks { | ||
| 24 | pub hclk: Hertz, | ||
| 25 | pub pclk1: Hertz, | ||
| 26 | pub pclk2: Hertz, | ||
| 27 | pub pclk3: Hertz, | ||
| 28 | pub pclk4: Hertz, | ||
| 29 | pub ppre1: u8, | ||
| 30 | pub ppre2: u8, | ||
| 31 | pub ppre3: u8, | ||
| 32 | pub ppre4: u8, | ||
| 33 | pub csi_ck: Option<Hertz>, | ||
| 34 | pub hsi_ck: Option<Hertz>, | ||
| 35 | pub hsi48_ck: Option<Hertz>, | ||
| 36 | pub lsi_ck: Option<Hertz>, | ||
| 37 | pub per_ck: Option<Hertz>, | ||
| 38 | pub hse_ck: Option<Hertz>, | ||
| 39 | pub pll1_p_ck: Option<Hertz>, | ||
| 40 | pub pll1_q_ck: Option<Hertz>, | ||
| 41 | pub pll1_r_ck: Option<Hertz>, | ||
| 42 | pub pll2_p_ck: Option<Hertz>, | ||
| 43 | pub pll2_q_ck: Option<Hertz>, | ||
| 44 | pub pll2_r_ck: Option<Hertz>, | ||
| 45 | pub pll3_p_ck: Option<Hertz>, | ||
| 46 | pub pll3_q_ck: Option<Hertz>, | ||
| 47 | pub pll3_r_ck: Option<Hertz>, | ||
| 48 | pub timx_ker_ck: Option<Hertz>, | ||
| 49 | pub timy_ker_ck: Option<Hertz>, | ||
| 50 | pub sys_ck: Hertz, | ||
| 51 | pub c_ck: Hertz, | ||
| 52 | } | ||
| 53 | |||
| 54 | /// Configuration of the core clocks | ||
| 55 | #[non_exhaustive] | ||
| 56 | #[derive(Default)] | ||
| 57 | pub struct Config { | ||
| 58 | pub hse: Option<Hertz>, | ||
| 59 | pub bypass_hse: bool, | ||
| 60 | pub sys_ck: Option<Hertz>, | ||
| 61 | pub per_ck: Option<Hertz>, | ||
| 62 | rcc_hclk: Option<Hertz>, | ||
| 63 | pub hclk: Option<Hertz>, | ||
| 64 | pub pclk1: Option<Hertz>, | ||
| 65 | pub pclk2: Option<Hertz>, | ||
| 66 | pub pclk3: Option<Hertz>, | ||
| 67 | pub pclk4: Option<Hertz>, | ||
| 68 | pub pll1: PllConfig, | ||
| 69 | pub pll2: PllConfig, | ||
| 70 | pub pll3: PllConfig, | ||
| 71 | } | ||
| 72 | |||
| 73 | pub struct Rcc<'d> { | ||
| 74 | inner: PhantomData<&'d ()>, | ||
| 75 | config: Config, | ||
| 76 | } | ||
| 77 | |||
| 78 | impl<'d> Rcc<'d> { | ||
| 79 | pub fn new(_rcc: impl Unborrow<Target = peripherals::RCC> + 'd, config: Config) -> Self { | ||
| 80 | Self { | ||
| 81 | inner: PhantomData, | ||
| 82 | config, | ||
| 83 | } | ||
| 84 | } | ||
| 85 | |||
| 86 | /// Freeze the core clocks, returning a Core Clocks Distribution | ||
| 87 | /// and Reset (CCDR) structure. The actual frequency of the clocks | ||
| 88 | /// configured is returned in the `clocks` member of the CCDR | ||
| 89 | /// structure. | ||
| 90 | /// | ||
| 91 | /// Note that `freeze` will never result in a clock _faster_ than | ||
| 92 | /// that specified. It may result in a clock that is a factor of [1, | ||
| 93 | /// 2) slower. | ||
| 94 | /// | ||
| 95 | /// `syscfg` is required to enable the I/O compensation cell. | ||
| 96 | /// | ||
| 97 | /// # Panics | ||
| 98 | /// | ||
| 99 | /// If a clock specification cannot be achieved within the | ||
| 100 | /// hardware specification then this function will panic. This | ||
| 101 | /// function may also panic if a clock specification can be | ||
| 102 | /// achieved, but the mechanism for doing so is not yet | ||
| 103 | /// implemented here. | ||
| 104 | pub fn freeze(mut self, pwr: &Power) -> CoreClocks { | ||
| 105 | use crate::pac::rcc::vals::{ | ||
| 106 | Apb4enrSyscfgen, Ckpersel, D1ppre, D2ppre1, D3ppre, Hpre, Hsebyp, Hsidiv, Hsion, Lsion, | ||
| 107 | Pllsrc, Sw, | ||
| 108 | }; | ||
| 109 | |||
| 110 | let srcclk = self.config.hse.unwrap_or(HSI); // Available clocks | ||
| 111 | let (sys_ck, sys_use_pll1_p) = self.sys_ck_setup(srcclk); | ||
| 112 | |||
| 113 | // Configure traceclk from PLL if needed | ||
| 114 | self.traceclk_setup(sys_use_pll1_p); | ||
| 115 | |||
| 116 | // NOTE(unsafe) We have exclusive access to the RCC | ||
| 117 | let (pll1_p_ck, pll1_q_ck, pll1_r_ck) = | ||
| 118 | unsafe { pll_setup(srcclk.0, &self.config.pll1, 0) }; | ||
| 119 | let (pll2_p_ck, pll2_q_ck, pll2_r_ck) = | ||
| 120 | unsafe { pll_setup(srcclk.0, &self.config.pll2, 1) }; | ||
| 121 | let (pll3_p_ck, pll3_q_ck, pll3_r_ck) = | ||
| 122 | unsafe { pll_setup(srcclk.0, &self.config.pll3, 2) }; | ||
| 123 | |||
| 124 | let sys_ck = if sys_use_pll1_p { | ||
| 125 | Hertz(pll1_p_ck.unwrap()) // Must have been set by sys_ck_setup | ||
| 126 | } else { | ||
| 127 | sys_ck | ||
| 128 | }; | ||
| 129 | |||
| 130 | // NOTE(unsafe) We own the regblock | ||
| 131 | unsafe { | ||
| 132 | // This routine does not support HSIDIV != 1. To | ||
| 133 | // do so it would need to ensure all PLLxON bits are clear | ||
| 134 | // before changing the value of HSIDIV | ||
| 135 | let cr = RCC.cr().read(); | ||
| 136 | assert!(cr.hsion() == Hsion::ON); | ||
| 137 | assert!(cr.hsidiv() == Hsidiv::DIV1); | ||
| 138 | |||
| 139 | RCC.csr().modify(|w| w.set_lsion(Lsion::ON)); | ||
| 140 | while !RCC.csr().read().lsirdy() {} | ||
| 141 | } | ||
| 142 | |||
| 143 | // per_ck from HSI by default | ||
| 144 | let (per_ck, ckpersel) = match (self.config.per_ck == self.config.hse, self.config.per_ck) { | ||
| 145 | (true, Some(hse)) => (hse, Ckpersel::HSE), // HSE | ||
| 146 | (_, Some(CSI)) => (CSI, Ckpersel::CSI), // CSI | ||
| 147 | _ => (HSI, Ckpersel::HSI), // HSI | ||
| 148 | }; | ||
| 149 | |||
| 150 | // D1 Core Prescaler | ||
| 151 | // Set to 1 | ||
| 152 | let d1cpre_bits = 0; | ||
| 153 | let d1cpre_div = 1; | ||
| 154 | let sys_d1cpre_ck = sys_ck.0 / d1cpre_div; | ||
| 155 | |||
| 156 | // Refer to part datasheet "General operating conditions" | ||
| 157 | // table for (rev V). We do not assert checks for earlier | ||
| 158 | // revisions which may have lower limits. | ||
| 159 | let (sys_d1cpre_ck_max, rcc_hclk_max, pclk_max) = match pwr.vos { | ||
| 160 | VoltageScale::Scale0 => (480_000_000, 240_000_000, 120_000_000), | ||
| 161 | VoltageScale::Scale1 => (400_000_000, 200_000_000, 100_000_000), | ||
| 162 | VoltageScale::Scale2 => (300_000_000, 150_000_000, 75_000_000), | ||
| 163 | _ => (200_000_000, 100_000_000, 50_000_000), | ||
| 164 | }; | ||
| 165 | assert!(sys_d1cpre_ck <= sys_d1cpre_ck_max); | ||
| 166 | |||
| 167 | let rcc_hclk = self | ||
| 168 | .config | ||
| 169 | .rcc_hclk | ||
| 170 | .map(|v| v.0) | ||
| 171 | .unwrap_or(sys_d1cpre_ck / 2); | ||
| 172 | assert!(rcc_hclk <= rcc_hclk_max); | ||
| 173 | |||
| 174 | // Estimate divisor | ||
| 175 | let (hpre_bits, hpre_div) = match (sys_d1cpre_ck + rcc_hclk - 1) / rcc_hclk { | ||
| 176 | 0 => panic!(), | ||
| 177 | 1 => (Hpre::DIV1, 1), | ||
| 178 | 2 => (Hpre::DIV2, 2), | ||
| 179 | 3..=5 => (Hpre::DIV4, 4), | ||
| 180 | 6..=11 => (Hpre::DIV8, 8), | ||
| 181 | 12..=39 => (Hpre::DIV16, 16), | ||
| 182 | 40..=95 => (Hpre::DIV64, 64), | ||
| 183 | 96..=191 => (Hpre::DIV128, 128), | ||
| 184 | 192..=383 => (Hpre::DIV256, 256), | ||
| 185 | _ => (Hpre::DIV512, 512), | ||
| 186 | }; | ||
| 187 | // Calculate real AXI and AHB clock | ||
| 188 | let rcc_hclk = sys_d1cpre_ck / hpre_div; | ||
| 189 | assert!(rcc_hclk <= rcc_hclk_max); | ||
| 190 | let rcc_aclk = rcc_hclk; // AXI clock is always equal to AHB clock on H7 | ||
| 191 | // Timer prescaler selection | ||
| 192 | let timpre = Timpre::DEFAULTX2; | ||
| 193 | |||
| 194 | let requested_pclk1 = self | ||
| 195 | .config | ||
| 196 | .pclk1 | ||
| 197 | .map(|v| v.0) | ||
| 198 | .unwrap_or_else(|| pclk_max.min(rcc_hclk / 2)); | ||
| 199 | let (rcc_pclk1, ppre1_bits, ppre1, rcc_timerx_ker_ck) = | ||
| 200 | Self::ppre_calculate(requested_pclk1, rcc_hclk, pclk_max, Some(timpre)); | ||
| 201 | |||
| 202 | let requested_pclk2 = self | ||
| 203 | .config | ||
| 204 | .pclk2 | ||
| 205 | .map(|v| v.0) | ||
| 206 | .unwrap_or_else(|| pclk_max.min(rcc_hclk / 2)); | ||
| 207 | let (rcc_pclk2, ppre2_bits, ppre2, rcc_timery_ker_ck) = | ||
| 208 | Self::ppre_calculate(requested_pclk2, rcc_hclk, pclk_max, Some(timpre)); | ||
| 209 | |||
| 210 | let requested_pclk3 = self | ||
| 211 | .config | ||
| 212 | .pclk3 | ||
| 213 | .map(|v| v.0) | ||
| 214 | .unwrap_or_else(|| pclk_max.min(rcc_hclk / 2)); | ||
| 215 | let (rcc_pclk3, ppre3_bits, ppre3, _) = | ||
| 216 | Self::ppre_calculate(requested_pclk3, rcc_hclk, pclk_max, None); | ||
| 217 | |||
| 218 | let requested_pclk4 = self | ||
| 219 | .config | ||
| 220 | .pclk4 | ||
| 221 | .map(|v| v.0) | ||
| 222 | .unwrap_or_else(|| pclk_max.min(rcc_hclk / 2)); | ||
| 223 | let (rcc_pclk4, ppre4_bits, ppre4, _) = | ||
| 224 | Self::ppre_calculate(requested_pclk4, rcc_hclk, pclk_max, None); | ||
| 225 | |||
| 226 | Self::flash_setup(rcc_aclk, pwr.vos); | ||
| 227 | |||
| 228 | // Start switching clocks ------------------- | ||
| 229 | // NOTE(unsafe) We have the RCC singleton | ||
| 230 | unsafe { | ||
| 231 | // Ensure CSI is on and stable | ||
| 232 | RCC.cr().modify(|w| w.set_csion(Hsion::ON)); | ||
| 233 | while !RCC.cr().read().csirdy() {} | ||
| 234 | |||
| 235 | // Ensure HSI48 is on and stable | ||
| 236 | RCC.cr().modify(|w| w.set_hsi48on(Hsion::ON)); | ||
| 237 | while RCC.cr().read().hsi48on() == Hsion::OFF {} | ||
| 238 | |||
| 239 | // XXX: support MCO ? | ||
| 240 | |||
| 241 | let hse_ck = match self.config.hse { | ||
| 242 | Some(hse) => { | ||
| 243 | // Ensure HSE is on and stable | ||
| 244 | RCC.cr().modify(|w| { | ||
| 245 | w.set_hseon(Hsion::ON); | ||
| 246 | w.set_hsebyp(if self.config.bypass_hse { | ||
| 247 | Hsebyp::BYPASSED | ||
| 248 | } else { | ||
| 249 | Hsebyp::NOTBYPASSED | ||
| 250 | }); | ||
| 251 | }); | ||
| 252 | while !RCC.cr().read().hserdy() {} | ||
| 253 | Some(hse) | ||
| 254 | } | ||
| 255 | None => None, | ||
| 256 | }; | ||
| 257 | |||
| 258 | let pllsrc = if self.config.hse.is_some() { | ||
| 259 | Pllsrc::HSE | ||
| 260 | } else { | ||
| 261 | Pllsrc::HSI | ||
| 262 | }; | ||
| 263 | RCC.pllckselr().modify(|w| w.set_pllsrc(pllsrc)); | ||
| 264 | |||
| 265 | if pll1_p_ck.is_some() { | ||
| 266 | RCC.cr().modify(|w| w.set_pll1on(Hsion::ON)); | ||
| 267 | while !RCC.cr().read().pll1rdy() {} | ||
| 268 | } | ||
| 269 | |||
| 270 | if pll2_p_ck.is_some() { | ||
| 271 | RCC.cr().modify(|w| w.set_pll2on(Hsion::ON)); | ||
| 272 | while !RCC.cr().read().pll2rdy() {} | ||
| 273 | } | ||
| 274 | |||
| 275 | if pll3_p_ck.is_some() { | ||
| 276 | RCC.cr().modify(|w| w.set_pll3on(Hsion::ON)); | ||
| 277 | while !RCC.cr().read().pll3rdy() {} | ||
| 278 | } | ||
| 279 | |||
| 280 | // Core Prescaler / AHB Prescaler / APB3 Prescaler | ||
| 281 | RCC.d1cfgr().modify(|w| { | ||
| 282 | w.set_d1cpre(Hpre(d1cpre_bits)); | ||
| 283 | w.set_d1ppre(D1ppre(ppre3_bits)); | ||
| 284 | w.set_hpre(hpre_bits) | ||
| 285 | }); | ||
| 286 | // Ensure core prescaler value is valid before future lower | ||
| 287 | // core voltage | ||
| 288 | while RCC.d1cfgr().read().d1cpre().0 != d1cpre_bits {} | ||
| 289 | |||
| 290 | // APB1 / APB2 Prescaler | ||
| 291 | RCC.d2cfgr().modify(|w| { | ||
| 292 | w.set_d2ppre1(D2ppre1(ppre1_bits)); | ||
| 293 | w.set_d2ppre2(D2ppre1(ppre2_bits)); | ||
| 294 | }); | ||
| 295 | |||
| 296 | // APB4 Prescaler | ||
| 297 | RCC.d3cfgr().modify(|w| w.set_d3ppre(D3ppre(ppre4_bits))); | ||
| 298 | |||
| 299 | // Peripheral Clock (per_ck) | ||
| 300 | RCC.d1ccipr().modify(|w| w.set_ckpersel(ckpersel)); | ||
| 301 | |||
| 302 | // Set timer clocks prescaler setting | ||
| 303 | RCC.cfgr().modify(|w| w.set_timpre(timpre)); | ||
| 304 | |||
| 305 | // Select system clock source | ||
| 306 | let sw = match (sys_use_pll1_p, self.config.hse.is_some()) { | ||
| 307 | (true, _) => Sw::PLL1, | ||
| 308 | (false, true) => Sw::HSE, | ||
| 309 | _ => Sw::HSI, | ||
| 310 | }; | ||
| 311 | RCC.cfgr().modify(|w| w.set_sw(sw)); | ||
| 312 | while RCC.cfgr().read().sws() != sw.0 {} | ||
| 313 | |||
| 314 | // IO compensation cell - Requires CSI clock and SYSCFG | ||
| 315 | assert!(RCC.cr().read().csirdy()); | ||
| 316 | RCC.apb4enr() | ||
| 317 | .modify(|w| w.set_syscfgen(Apb4enrSyscfgen::ENABLED)); | ||
| 318 | |||
| 319 | // Enable the compensation cell, using back-bias voltage code | ||
| 320 | // provide by the cell. | ||
| 321 | critical_section::with(|_| { | ||
| 322 | SYSCFG.cccsr().modify(|w| { | ||
| 323 | w.set_en(true); | ||
| 324 | w.set_cs(false); | ||
| 325 | w.set_hslv(false); | ||
| 326 | }) | ||
| 327 | }); | ||
| 328 | while !SYSCFG.cccsr().read().ready() {} | ||
| 329 | |||
| 330 | CoreClocks { | ||
| 331 | hclk: Hertz(rcc_hclk), | ||
| 332 | pclk1: Hertz(rcc_pclk1), | ||
| 333 | pclk2: Hertz(rcc_pclk2), | ||
| 334 | pclk3: Hertz(rcc_pclk3), | ||
| 335 | pclk4: Hertz(rcc_pclk4), | ||
| 336 | ppre1, | ||
| 337 | ppre2, | ||
| 338 | ppre3, | ||
| 339 | ppre4, | ||
| 340 | csi_ck: Some(CSI), | ||
| 341 | hsi_ck: Some(HSI), | ||
| 342 | hsi48_ck: Some(HSI48), | ||
| 343 | lsi_ck: Some(LSI), | ||
| 344 | per_ck: Some(per_ck), | ||
| 345 | hse_ck, | ||
| 346 | pll1_p_ck: pll1_p_ck.map(Hertz), | ||
| 347 | pll1_q_ck: pll1_q_ck.map(Hertz), | ||
| 348 | pll1_r_ck: pll1_r_ck.map(Hertz), | ||
| 349 | pll2_p_ck: pll2_p_ck.map(Hertz), | ||
| 350 | pll2_q_ck: pll2_q_ck.map(Hertz), | ||
| 351 | pll2_r_ck: pll2_r_ck.map(Hertz), | ||
| 352 | pll3_p_ck: pll3_p_ck.map(Hertz), | ||
| 353 | pll3_q_ck: pll3_q_ck.map(Hertz), | ||
| 354 | pll3_r_ck: pll3_r_ck.map(Hertz), | ||
| 355 | timx_ker_ck: rcc_timerx_ker_ck.map(Hertz), | ||
| 356 | timy_ker_ck: rcc_timery_ker_ck.map(Hertz), | ||
| 357 | sys_ck, | ||
| 358 | c_ck: Hertz(sys_d1cpre_ck), | ||
| 359 | } | ||
| 360 | } | ||
| 361 | } | ||
| 362 | |||
| 363 | /// Enables debugging during WFI/WFE | ||
| 364 | /// | ||
| 365 | /// Set `enable_dma1` to true if you do not have at least one bus master (other than the CPU) | ||
| 366 | /// enable during WFI/WFE | ||
| 367 | pub fn enable_debug_wfe(&mut self, _dbg: &mut peripherals::DBGMCU, enable_dma1: bool) { | ||
| 368 | use crate::pac::rcc::vals::Ahb1enrDma1en; | ||
| 369 | |||
| 370 | // NOTE(unsafe) We have exclusive access to the RCC and DBGMCU | ||
| 371 | unsafe { | ||
| 372 | if enable_dma1 { | ||
| 373 | RCC.ahb1enr() | ||
| 374 | .modify(|w| w.set_dma1en(Ahb1enrDma1en::ENABLED)); | ||
| 375 | } | ||
| 376 | |||
| 377 | DBGMCU.cr().modify(|w| { | ||
| 378 | w.set_dbgsleep_d1(true); | ||
| 379 | w.set_dbgstby_d1(true); | ||
| 380 | w.set_dbgstop_d1(true); | ||
| 381 | }); | ||
| 382 | } | ||
| 383 | } | ||
| 384 | |||
| 385 | /// Setup traceclk | ||
| 386 | /// Returns a pll1_r_ck | ||
| 387 | fn traceclk_setup(&mut self, sys_use_pll1_p: bool) { | ||
| 388 | let pll1_r_ck = match (sys_use_pll1_p, self.config.pll1.r_ck) { | ||
| 389 | // pll1_p_ck selected as system clock but pll1_r_ck not | ||
| 390 | // set. The traceclk mux is synchronous with the system | ||
| 391 | // clock mux, but has pll1_r_ck as an input. In order to | ||
| 392 | // keep traceclk running, we force a pll1_r_ck. | ||
| 393 | (true, None) => Some(Hertz(self.config.pll1.p_ck.unwrap().0 / 2)), | ||
| 394 | |||
| 395 | // Either pll1 not selected as system clock, free choice | ||
| 396 | // of pll1_r_ck. Or pll1 is selected, assume user has set | ||
| 397 | // a suitable pll1_r_ck frequency. | ||
| 398 | _ => self.config.pll1.r_ck, | ||
| 399 | }; | ||
| 400 | self.config.pll1.r_ck = pll1_r_ck; | ||
| 401 | } | ||
| 402 | |||
| 403 | /// Divider calculator for pclk 1 - 4 | ||
| 404 | /// | ||
| 405 | /// Returns real pclk, bits, ppre and the timer kernel clock | ||
| 406 | fn ppre_calculate( | ||
| 407 | requested_pclk: u32, | ||
| 408 | hclk: u32, | ||
| 409 | max_pclk: u32, | ||
| 410 | tim_pre: Option<Timpre>, | ||
| 411 | ) -> (u32, u8, u8, Option<u32>) { | ||
| 412 | let (bits, ppre) = match (hclk + requested_pclk - 1) / requested_pclk { | ||
| 413 | 0 => panic!(), | ||
| 414 | 1 => (0b000, 1), | ||
| 415 | 2 => (0b100, 2), | ||
| 416 | 3..=5 => (0b101, 4), | ||
| 417 | 6..=11 => (0b110, 8), | ||
| 418 | _ => (0b111, 16), | ||
| 419 | }; | ||
| 420 | let real_pclk = hclk / u32::from(ppre); | ||
| 421 | assert!(real_pclk <= max_pclk); | ||
| 422 | |||
| 423 | let tim_ker_clk = if let Some(tim_pre) = tim_pre { | ||
| 424 | let clk = match (bits, tim_pre) { | ||
| 425 | (0b101, Timpre::DEFAULTX2) => hclk / 2, | ||
| 426 | (0b110, Timpre::DEFAULTX4) => hclk / 2, | ||
| 427 | (0b110, Timpre::DEFAULTX2) => hclk / 4, | ||
| 428 | (0b111, Timpre::DEFAULTX4) => hclk / 4, | ||
| 429 | (0b111, Timpre::DEFAULTX2) => hclk / 8, | ||
| 430 | _ => hclk, | ||
| 431 | }; | ||
| 432 | Some(clk) | ||
| 433 | } else { | ||
| 434 | None | ||
| 435 | }; | ||
| 436 | (real_pclk, bits, ppre, tim_ker_clk) | ||
| 437 | } | ||
| 438 | |||
| 439 | /// Setup sys_ck | ||
| 440 | /// Returns sys_ck frequency, and a pll1_p_ck | ||
| 441 | fn sys_ck_setup(&mut self, srcclk: Hertz) -> (Hertz, bool) { | ||
| 442 | // Compare available with wanted clocks | ||
| 443 | let sys_ck = self.config.sys_ck.unwrap_or(srcclk); | ||
| 444 | |||
| 445 | if sys_ck != srcclk { | ||
| 446 | // The requested system clock is not the immediately available | ||
| 447 | // HSE/HSI clock. Perhaps there are other ways of obtaining | ||
| 448 | // the requested system clock (such as `HSIDIV`) but we will | ||
| 449 | // ignore those for now. | ||
| 450 | // | ||
| 451 | // Therefore we must use pll1_p_ck | ||
| 452 | let pll1_p_ck = match self.config.pll1.p_ck { | ||
| 453 | Some(p_ck) => { | ||
| 454 | assert!(p_ck == sys_ck, | ||
| 455 | "Error: Cannot set pll1_p_ck independently as it must be used to generate sys_ck"); | ||
| 456 | Some(p_ck) | ||
| 457 | } | ||
| 458 | None => Some(sys_ck), | ||
| 459 | }; | ||
| 460 | self.config.pll1.p_ck = pll1_p_ck; | ||
| 461 | |||
| 462 | (sys_ck, true) | ||
| 463 | } else { | ||
| 464 | // sys_ck is derived directly from a source clock | ||
| 465 | // (HSE/HSI). pll1_p_ck can be as requested | ||
| 466 | (sys_ck, false) | ||
| 467 | } | ||
| 468 | } | ||
| 469 | |||
| 470 | fn flash_setup(rcc_aclk: u32, vos: VoltageScale) { | ||
| 471 | use crate::pac::FLASH; | ||
| 472 | |||
| 473 | // ACLK in MHz, round down and subtract 1 from integers. eg. | ||
| 474 | // 61_999_999 -> 61MHz | ||
| 475 | // 62_000_000 -> 61MHz | ||
| 476 | // 62_000_001 -> 62MHz | ||
| 477 | let rcc_aclk_mhz = (rcc_aclk - 1) / 1_000_000; | ||
| 478 | |||
| 479 | // See RM0433 Rev 7 Table 17. FLASH recommended number of wait | ||
| 480 | // states and programming delay | ||
| 481 | let (wait_states, progr_delay) = match vos { | ||
| 482 | // VOS 0 range VCORE 1.26V - 1.40V | ||
| 483 | VoltageScale::Scale0 => match rcc_aclk_mhz { | ||
| 484 | 0..=69 => (0, 0), | ||
| 485 | 70..=139 => (1, 1), | ||
| 486 | 140..=184 => (2, 1), | ||
| 487 | 185..=209 => (2, 2), | ||
| 488 | 210..=224 => (3, 2), | ||
| 489 | 225..=239 => (4, 2), | ||
| 490 | _ => (7, 3), | ||
| 491 | }, | ||
| 492 | // VOS 1 range VCORE 1.15V - 1.26V | ||
| 493 | VoltageScale::Scale1 => match rcc_aclk_mhz { | ||
| 494 | 0..=69 => (0, 0), | ||
| 495 | 70..=139 => (1, 1), | ||
| 496 | 140..=184 => (2, 1), | ||
| 497 | 185..=209 => (2, 2), | ||
| 498 | 210..=224 => (3, 2), | ||
| 499 | _ => (7, 3), | ||
| 500 | }, | ||
| 501 | // VOS 2 range VCORE 1.05V - 1.15V | ||
| 502 | VoltageScale::Scale2 => match rcc_aclk_mhz { | ||
| 503 | 0..=54 => (0, 0), | ||
| 504 | 55..=109 => (1, 1), | ||
| 505 | 110..=164 => (2, 1), | ||
| 506 | 165..=224 => (3, 2), | ||
| 507 | _ => (7, 3), | ||
| 508 | }, | ||
| 509 | // VOS 3 range VCORE 0.95V - 1.05V | ||
| 510 | VoltageScale::Scale3 => match rcc_aclk_mhz { | ||
| 511 | 0..=44 => (0, 0), | ||
| 512 | 45..=89 => (1, 1), | ||
| 513 | 90..=134 => (2, 1), | ||
| 514 | 135..=179 => (3, 2), | ||
| 515 | 180..=224 => (4, 2), | ||
| 516 | _ => (7, 3), | ||
| 517 | }, | ||
| 518 | }; | ||
| 519 | |||
| 520 | // NOTE(unsafe) Atomic write | ||
| 521 | unsafe { | ||
| 522 | FLASH.acr().write(|w| { | ||
| 523 | w.set_wrhighfreq(progr_delay); | ||
| 524 | w.set_latency(wait_states) | ||
| 525 | }); | ||
| 526 | while FLASH.acr().read().latency() != wait_states {} | ||
| 527 | } | ||
| 528 | } | ||
| 529 | } | ||
diff --git a/embassy-stm32/src/rcc/h7/pll.rs b/embassy-stm32/src/rcc/h7/pll.rs new file mode 100644 index 000000000..af958d093 --- /dev/null +++ b/embassy-stm32/src/rcc/h7/pll.rs | |||
| @@ -0,0 +1,150 @@ | |||
| 1 | use super::{Hertz, RCC}; | ||
| 2 | use crate::fmt::assert; | ||
| 3 | |||
| 4 | const VCO_MIN: u32 = 150_000_000; | ||
| 5 | const VCO_MAX: u32 = 420_000_000; | ||
| 6 | |||
| 7 | #[derive(Default)] | ||
| 8 | pub struct PllConfig { | ||
| 9 | pub p_ck: Option<Hertz>, | ||
| 10 | pub q_ck: Option<Hertz>, | ||
| 11 | pub r_ck: Option<Hertz>, | ||
| 12 | } | ||
| 13 | |||
| 14 | pub(super) struct PllConfigResults { | ||
| 15 | pub ref_x_ck: u32, | ||
| 16 | pub pll_x_m: u32, | ||
| 17 | pub pll_x_p: u32, | ||
| 18 | pub vco_ck_target: u32, | ||
| 19 | } | ||
| 20 | |||
| 21 | fn vco_output_divider_setup(output: u32, plln: usize) -> (u32, u32) { | ||
| 22 | let pll_x_p = if plln == 0 { | ||
| 23 | if output > VCO_MAX / 2 { | ||
| 24 | 1 | ||
| 25 | } else { | ||
| 26 | ((VCO_MAX / output) | 1) - 1 // Must be even or unity | ||
| 27 | } | ||
| 28 | } else { | ||
| 29 | // Specific to PLL2/3, will subtract 1 later | ||
| 30 | if output > VCO_MAX / 2 { | ||
| 31 | 1 | ||
| 32 | } else { | ||
| 33 | VCO_MAX / output | ||
| 34 | } | ||
| 35 | }; | ||
| 36 | |||
| 37 | let vco_ck = output + pll_x_p; | ||
| 38 | |||
| 39 | assert!(pll_x_p < 128); | ||
| 40 | assert!(vco_ck >= VCO_MIN); | ||
| 41 | assert!(vco_ck <= VCO_MAX); | ||
| 42 | |||
| 43 | (vco_ck, pll_x_p) | ||
| 44 | } | ||
| 45 | |||
| 46 | /// # Safety | ||
| 47 | /// | ||
| 48 | /// Must have exclusive access to the RCC register block | ||
| 49 | unsafe fn vco_setup(pll_src: u32, requested_output: u32, plln: usize) -> PllConfigResults { | ||
| 50 | use crate::pac::rcc::vals::{Pll1rge, Pll1vcosel}; | ||
| 51 | |||
| 52 | let (vco_ck_target, pll_x_p) = vco_output_divider_setup(requested_output, plln); | ||
| 53 | |||
| 54 | // Input divisor, resulting in a reference clock in the range | ||
| 55 | // 1 to 2 MHz. Choose the highest reference clock (lowest m) | ||
| 56 | let pll_x_m = (pll_src + 1_999_999) / 2_000_000; | ||
| 57 | assert!(pll_x_m < 64); | ||
| 58 | |||
| 59 | // Calculate resulting reference clock | ||
| 60 | let ref_x_ck = pll_src / pll_x_m; | ||
| 61 | assert!((1_000_000..=2_000_000).contains(&ref_x_ck)); | ||
| 62 | |||
| 63 | RCC.pllcfgr().modify(|w| { | ||
| 64 | w.set_pllvcosel(plln, Pll1vcosel::MEDIUMVCO); | ||
| 65 | w.set_pllrge(plln, Pll1rge::RANGE1); | ||
| 66 | }); | ||
| 67 | PllConfigResults { | ||
| 68 | ref_x_ck, | ||
| 69 | pll_x_m, | ||
| 70 | pll_x_p, | ||
| 71 | vco_ck_target, | ||
| 72 | } | ||
| 73 | } | ||
| 74 | |||
| 75 | /// # Safety | ||
| 76 | /// | ||
| 77 | /// Must have exclusive access to the RCC register block | ||
| 78 | pub(super) unsafe fn pll_setup( | ||
| 79 | pll_src: u32, | ||
| 80 | config: &PllConfig, | ||
| 81 | plln: usize, | ||
| 82 | ) -> (Option<u32>, Option<u32>, Option<u32>) { | ||
| 83 | use crate::pac::rcc::vals::{Divp1, Divp1en, Pll1fracen}; | ||
| 84 | |||
| 85 | match config.p_ck { | ||
| 86 | Some(requested_output) => { | ||
| 87 | let config_results = vco_setup(pll_src, requested_output.0, plln); | ||
| 88 | let PllConfigResults { | ||
| 89 | ref_x_ck, | ||
| 90 | pll_x_m, | ||
| 91 | pll_x_p, | ||
| 92 | vco_ck_target, | ||
| 93 | } = config_results; | ||
| 94 | |||
| 95 | RCC.pllckselr().modify(|w| w.set_divm(plln, pll_x_m as u8)); | ||
| 96 | |||
| 97 | // Feedback divider. Integer only | ||
| 98 | let pll_x_n = vco_ck_target / ref_x_ck; | ||
| 99 | assert!(pll_x_n >= 4); | ||
| 100 | assert!(pll_x_n <= 512); | ||
| 101 | RCC.plldivr(plln) | ||
| 102 | .modify(|w| w.set_divn1((pll_x_n - 1) as u16)); | ||
| 103 | |||
| 104 | // No FRACN | ||
| 105 | RCC.pllcfgr() | ||
| 106 | .modify(|w| w.set_pllfracen(plln, Pll1fracen::RESET)); | ||
| 107 | let vco_ck = ref_x_ck * pll_x_n; | ||
| 108 | |||
| 109 | RCC.plldivr(plln) | ||
| 110 | .modify(|w| w.set_divp1(Divp1((pll_x_p - 1) as u8))); | ||
| 111 | RCC.pllcfgr() | ||
| 112 | .modify(|w| w.set_divpen(plln, Divp1en::ENABLED)); | ||
| 113 | |||
| 114 | // Calulate additional output dividers | ||
| 115 | let q_ck = match config.q_ck { | ||
| 116 | Some(Hertz(ck)) if ck > 0 => { | ||
| 117 | let div = (vco_ck + ck - 1) / ck; | ||
| 118 | RCC.plldivr(plln).modify(|w| w.set_divq1((div - 1) as u8)); | ||
| 119 | RCC.pllcfgr() | ||
| 120 | .modify(|w| w.set_divqen(plln, Divp1en::ENABLED)); | ||
| 121 | Some(vco_ck / div) | ||
| 122 | } | ||
| 123 | _ => None, | ||
| 124 | }; | ||
| 125 | let r_ck = match config.r_ck { | ||
| 126 | Some(Hertz(ck)) if ck > 0 => { | ||
| 127 | let div = (vco_ck + ck - 1) / ck; | ||
| 128 | RCC.plldivr(plln).modify(|w| w.set_divr1((div - 1) as u8)); | ||
| 129 | RCC.pllcfgr() | ||
| 130 | .modify(|w| w.set_divren(plln, Divp1en::ENABLED)); | ||
| 131 | Some(vco_ck / div) | ||
| 132 | } | ||
| 133 | _ => None, | ||
| 134 | }; | ||
| 135 | |||
| 136 | (Some(vco_ck / pll_x_p), q_ck, r_ck) | ||
| 137 | } | ||
| 138 | None => { | ||
| 139 | assert!( | ||
| 140 | config.q_ck.is_none(), | ||
| 141 | "Must set PLL P clock for Q clock to take effect!" | ||
| 142 | ); | ||
| 143 | assert!( | ||
| 144 | config.r_ck.is_none(), | ||
| 145 | "Must set PLL P clock for R clock to take effect!" | ||
| 146 | ); | ||
| 147 | (None, None, None) | ||
| 148 | } | ||
| 149 | } | ||
| 150 | } | ||
diff --git a/embassy-stm32/src/rcc/mod.rs b/embassy-stm32/src/rcc/mod.rs new file mode 100644 index 000000000..0bf62ef7c --- /dev/null +++ b/embassy-stm32/src/rcc/mod.rs | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #[cfg(feature = "_stm32h7")] | ||
| 2 | mod h7; | ||
| 3 | #[cfg(feature = "_stm32h7")] | ||
| 4 | pub use h7::*; | ||
diff --git a/embassy-stm32/src/sdmmc/v2.rs b/embassy-stm32/src/sdmmc/v2.rs index a4da4be8e..8e6f3d43d 100644 --- a/embassy-stm32/src/sdmmc/v2.rs +++ b/embassy-stm32/src/sdmmc/v2.rs | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | #![macro_use] | 1 | #![macro_use] |
| 2 | 2 | ||
| 3 | use core::default::Default; | 3 | use core::default::Default; |
| 4 | use core::future::Future; | ||
| 5 | use core::marker::PhantomData; | 4 | use core::marker::PhantomData; |
| 6 | use core::task::Poll; | 5 | use core::task::Poll; |
| 7 | 6 | ||
| @@ -1503,6 +1502,7 @@ macro_rules! impl_sdmmc_pin { | |||
| 1503 | #[cfg(feature = "sdmmc-rs")] | 1502 | #[cfg(feature = "sdmmc-rs")] |
| 1504 | mod sdmmc_rs { | 1503 | mod sdmmc_rs { |
| 1505 | use super::*; | 1504 | use super::*; |
| 1505 | use core::future::Future; | ||
| 1506 | use embedded_sdmmc::{Block, BlockCount, BlockDevice, BlockIdx}; | 1506 | use embedded_sdmmc::{Block, BlockCount, BlockDevice, BlockIdx}; |
| 1507 | 1507 | ||
| 1508 | impl<'d, T: Instance, P: Pins<T>> BlockDevice for Sdmmc<'d, T, P> { | 1508 | impl<'d, T: Instance, P: Pins<T>> BlockDevice for Sdmmc<'d, T, P> { |
diff --git a/embassy-stm32/src/time.rs b/embassy-stm32/src/time.rs index c131415c4..ac03ce5c4 100644 --- a/embassy-stm32/src/time.rs +++ b/embassy-stm32/src/time.rs | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | pub struct Bps(pub u32); | 5 | pub struct Bps(pub u32); |
| 6 | 6 | ||
| 7 | /// Hertz | 7 | /// Hertz |
| 8 | #[derive(PartialEq, PartialOrd, Clone, Copy, Debug)] | 8 | #[derive(PartialEq, PartialOrd, Clone, Copy, Debug, Eq)] |
| 9 | pub struct Hertz(pub u32); | 9 | pub struct Hertz(pub u32); |
| 10 | 10 | ||
| 11 | /// KiloHertz | 11 | /// KiloHertz |
diff --git a/embassy-stm32/stm32-data b/embassy-stm32/stm32-data | |||
| Subproject dc3c92f0323bfe2967ecd8f92b2c53fb3dfb44f | Subproject dc1cd90181c0deb2874f5145f76a03658f50d92 | ||
