lgt92: update to new UART structure
Этот коммит содержится в:
родитель
c7bd5405c3
коммит
aa7c7b7bd9
2 изменённых файлов: 10 добавлений и 8 удалений
|
@ -56,14 +56,16 @@ var (
|
||||||
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
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче