mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-08 04:53:42 +00:00
38a3ccee52
Add machine-level support for STM32U5 family: GPIO ports A-I with clock enables via AHB2ENR1, EXTI pin interrupts (individual EXTI0-15 IRQs), timer definitions (TIM1-8, TIM15-17), RNG, and alternate function clock enables for all peripherals. Add UART support with STM32U585 baud rate and register configuration. Add arduino-uno-q board pin definitions and USART2 serial. Update shared build tags: gpio_revb, gpio_reva, exti_exti, exti_syscfg.
27 lines
400 B
Go
27 lines
400 B
Go
//go:build stm32l5 || stm32u5
|
|
|
|
package machine
|
|
|
|
import (
|
|
"device/stm32"
|
|
"runtime/volatile"
|
|
)
|
|
|
|
func getEXTIConfigRegister(pin uint8) *volatile.Register32 {
|
|
switch (pin & 0xf) / 4 {
|
|
case 0:
|
|
return &stm32.EXTI.EXTICR1
|
|
case 1:
|
|
return &stm32.EXTI.EXTICR2
|
|
case 2:
|
|
return &stm32.EXTI.EXTICR3
|
|
case 3:
|
|
return &stm32.EXTI.EXTICR4
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func enableEXTIConfigRegisters() {
|
|
// No-op
|
|
}
|