2016-03-03 22:33:20 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2016 Open-RnD Sp. z o.o.
|
|
|
|
*
|
2017-01-19 09:01:01 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2016-03-03 22:33:20 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2016-11-18 00:00:49 +08:00
|
|
|
* @brief Driver for UART port on STM32 family processor.
|
2016-03-03 22:33:20 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2018-09-15 01:43:44 +08:00
|
|
|
#ifndef ZEPHYR_DRIVERS_SERIAL_UART_STM32_H_
|
|
|
|
#define ZEPHYR_DRIVERS_SERIAL_UART_STM32_H_
|
2016-03-03 22:33:20 +08:00
|
|
|
|
|
|
|
/* device config */
|
|
|
|
struct uart_stm32_config {
|
|
|
|
struct uart_device_config uconf;
|
|
|
|
/* clock subsystem driving this peripheral */
|
2017-01-24 00:55:57 +08:00
|
|
|
struct stm32_pclken pclken;
|
2019-02-09 01:39:35 +08:00
|
|
|
/* initial hardware flow control, 1 for RTS/CTS */
|
|
|
|
bool hw_flow_control;
|
2020-03-18 19:40:21 +08:00
|
|
|
/* initial parity, 0 for none, 1 for odd, 2 for even */
|
|
|
|
int parity;
|
2016-03-03 22:33:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
/* driver data */
|
|
|
|
struct uart_stm32_data {
|
2019-01-08 05:52:24 +08:00
|
|
|
/* Baud rate */
|
|
|
|
u32_t baud_rate;
|
2016-03-03 22:33:20 +08:00
|
|
|
/* clock device */
|
|
|
|
struct device *clock;
|
2016-03-14 02:37:25 +08:00
|
|
|
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
|
2018-07-17 02:12:26 +08:00
|
|
|
uart_irq_callback_user_data_t user_cb;
|
|
|
|
void *user_data;
|
2016-03-14 02:37:25 +08:00
|
|
|
#endif
|
2016-03-03 22:33:20 +08:00
|
|
|
};
|
|
|
|
|
2018-09-15 01:43:44 +08:00
|
|
|
#endif /* ZEPHYR_DRIVERS_SERIAL_UART_STM32_H_ */
|