drivers: serial: stm32: remove HAL driver legacy

Remove UART_HandleTypeDef instance, which is used
only to store baudrate value.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
This commit is contained in:
Ilya Tagunov 2018-04-11 15:21:16 +03:00 committed by Kumar Gala
commit 6632ffa60f
2 changed files with 4 additions and 8 deletions

View file

@ -291,7 +291,7 @@ static int uart_stm32_init(struct device *dev)
#ifdef USART_CR1_OVER8
LL_USART_OVERSAMPLING_16,
#endif
data->huart.Init.BaudRate);
config->baud_rate);
LL_USART_Enable(UartInstance);
@ -342,14 +342,10 @@ static const struct uart_stm32_config uart_stm32_dev_cfg_##n = { \
STM32_UART_IRQ_HANDLER_FUNC(n) \
}, \
STM32_CLOCK_UART(clock_bus, clock_enr), \
.baud_rate = CONFIG_UART_STM32_PORT_ ## n ## _BAUD_RATE \
}; \
\
static struct uart_stm32_data uart_stm32_dev_data_##n = { \
.huart = { \
.Init = { \
.BaudRate = CONFIG_UART_STM32_PORT_##n##_BAUD_RATE \
} \
} \
}; \
\
DEVICE_AND_API_INIT(uart_stm32_##n, CONFIG_UART_STM32_PORT_##n##_NAME, \

View file

@ -17,12 +17,12 @@ struct uart_stm32_config {
struct uart_device_config uconf;
/* clock subsystem driving this peripheral */
struct stm32_pclken pclken;
/* Baud rate */
u32_t baud_rate;
};
/* driver data */
struct uart_stm32_data {
/* Uart peripheral handler */
UART_HandleTypeDef huart;
/* clock device */
struct device *clock;
#ifdef CONFIG_UART_INTERRUPT_DRIVEN