mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-17 11:13:27 +00:00
lgt92: update to new UART structure
This commit is contained in:
@@ -54,16 +54,18 @@ var (
|
|||||||
|
|
||||||
// Console UART (LPUSART1)
|
// Console UART (LPUSART1)
|
||||||
UART0 = UART{
|
UART0 = UART{
|
||||||
Buffer: NewRingBuffer(),
|
Buffer: NewRingBuffer(),
|
||||||
Bus: stm32.LPUART1,
|
Bus: stm32.LPUART1,
|
||||||
AltFuncSelector: 6,
|
TxAltFuncSelector: 6,
|
||||||
|
RxAltFuncSelector: 6,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gps UART
|
// Gps UART
|
||||||
UART1 = UART{
|
UART1 = UART{
|
||||||
Buffer: NewRingBuffer(),
|
Buffer: NewRingBuffer(),
|
||||||
Bus: stm32.USART1,
|
Bus: stm32.USART1,
|
||||||
AltFuncSelector: 0,
|
TxAltFuncSelector: 0,
|
||||||
|
RxAltFuncSelector: 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
// SPI
|
// SPI
|
||||||
|
|||||||
@@ -191,8 +191,8 @@ func enableAltFuncClock(bus unsafe.Pointer) {
|
|||||||
// Configure the UART.
|
// Configure the UART.
|
||||||
func (uart UART) configurePins(config UARTConfig) {
|
func (uart UART) configurePins(config UARTConfig) {
|
||||||
// enable the alternate functions on the TX and RX pins
|
// enable the alternate functions on the TX and RX pins
|
||||||
config.TX.ConfigureAltFunc(PinConfig{Mode: PinModeUARTTX}, uart.AltFuncSelector)
|
config.TX.ConfigureAltFunc(PinConfig{Mode: PinModeUARTTX}, uart.TxAltFuncSelector)
|
||||||
config.RX.ConfigureAltFunc(PinConfig{Mode: PinModeUARTRX}, uart.AltFuncSelector)
|
config.RX.ConfigureAltFunc(PinConfig{Mode: PinModeUARTRX}, uart.RxAltFuncSelector)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UART baudrate calc based on the bus and clockspeed
|
// UART baudrate calc based on the bus and clockspeed
|
||||||
|
|||||||
Reference in New Issue
Block a user