mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 04:23:41 +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.
28 lines
519 B
Go
28 lines
519 B
Go
//go:build stm32 && !stm32f1 && !stm32l5 && !stm32wlx && !stm32g0 && !stm32u5
|
|
|
|
package machine
|
|
|
|
import (
|
|
"device/stm32"
|
|
"runtime/volatile"
|
|
)
|
|
|
|
func getEXTIConfigRegister(pin uint8) *volatile.Register32 {
|
|
switch (pin & 0xf) / 4 {
|
|
case 0:
|
|
return &stm32.SYSCFG.EXTICR1
|
|
case 1:
|
|
return &stm32.SYSCFG.EXTICR2
|
|
case 2:
|
|
return &stm32.SYSCFG.EXTICR3
|
|
case 3:
|
|
return &stm32.SYSCFG.EXTICR4
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func enableEXTIConfigRegisters() {
|
|
// Enable SYSCFG
|
|
stm32.RCC.APB2ENR.SetBits(stm32.RCC_APB2ENR_SYSCFGEN)
|
|
}
|