serial: Add another instance to the mcux lpuart driver
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
This commit is contained in:
parent
cf2eb7d1fa
commit
175e4f4953
2 changed files with 44 additions and 0 deletions
|
@ -22,4 +22,10 @@ menuconfig UART_MCUX_LPUART_0
|
||||||
help
|
help
|
||||||
Enable UART 0.
|
Enable UART 0.
|
||||||
|
|
||||||
|
menuconfig UART_MCUX_LPUART_1
|
||||||
|
bool "UART 1"
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
Enable UART 1.
|
||||||
|
|
||||||
endif # UART_MCUX_LPUART
|
endif # UART_MCUX_LPUART
|
||||||
|
|
|
@ -318,3 +318,41 @@ static void mcux_lpuart_config_func_0(struct device *dev)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_UART_MCUX_LPUART_0 */
|
#endif /* CONFIG_UART_MCUX_LPUART_0 */
|
||||||
|
|
||||||
|
#ifdef CONFIG_UART_MCUX_LPUART_1
|
||||||
|
|
||||||
|
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
|
||||||
|
static void mcux_lpuart_config_func_1(struct device *dev);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static const struct mcux_lpuart_config mcux_lpuart_1_config = {
|
||||||
|
.base = (LPUART_Type *) CONFIG_UART_MCUX_LPUART_1_BASE_ADDRESS,
|
||||||
|
.clock_name = CONFIG_UART_MCUX_LPUART_1_CLOCK_NAME,
|
||||||
|
.clock_subsys =
|
||||||
|
(clock_control_subsys_t)CONFIG_UART_MCUX_LPUART_1_CLOCK_SUBSYS,
|
||||||
|
.baud_rate = CONFIG_UART_MCUX_LPUART_1_BAUD_RATE,
|
||||||
|
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
|
||||||
|
.irq_config_func = mcux_lpuart_config_func_1,
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct mcux_lpuart_data mcux_lpuart_1_data;
|
||||||
|
|
||||||
|
DEVICE_AND_API_INIT(uart_1, CONFIG_UART_MCUX_LPUART_1_NAME,
|
||||||
|
&mcux_lpuart_init,
|
||||||
|
&mcux_lpuart_1_data, &mcux_lpuart_1_config,
|
||||||
|
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
||||||
|
&mcux_lpuart_driver_api);
|
||||||
|
|
||||||
|
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
|
||||||
|
static void mcux_lpuart_config_func_1(struct device *dev)
|
||||||
|
{
|
||||||
|
IRQ_CONNECT(CONFIG_UART_MCUX_LPUART_1_IRQ,
|
||||||
|
CONFIG_UART_MCUX_LPUART_1_IRQ_PRI,
|
||||||
|
mcux_lpuart_isr, DEVICE_GET(uart_1), 0);
|
||||||
|
|
||||||
|
irq_enable(CONFIG_UART_MCUX_LPUART_1_IRQ);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* CONFIG_UART_MCUX_LPUART_1 */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue