Fix some bit definitions for serial registers. Set callback to NULL when uart is...
authorNathael Pajani <nathael.pajani@ed3l.fr>
Tue, 25 Aug 2015 22:52:25 +0000 (00:52 +0200)
committerNathael Pajani <nathael.pajani@ed3l.fr>
Tue, 8 Nov 2022 16:03:04 +0000 (17:03 +0100)
drivers/serial.c
include/core/lpc_regs_12xx.h

index b38bca9..7dc5d83 100644 (file)
@@ -65,7 +65,7 @@ static struct uart_device uarts[NUM_UARTS] = {
                .out_buff = {0},
                .sending = 0,
                .out_lock = 0,
-               .rx_callback = 0,
+               .rx_callback = NULL,
                .capabilities = (SERIAL_CAP_UART | SERIAL_CAP_RS485),
                .current_mode = SERIAL_MODE_UART,
        },
@@ -77,7 +77,7 @@ static struct uart_device uarts[NUM_UARTS] = {
                .out_buff = {0},
                .sending = 0,
                .out_lock = 0,
-               .rx_callback = 0,
+               .rx_callback = NULL,
                .capabilities = (SERIAL_CAP_UART | SERIAL_CAP_IRDA),
                .current_mode = SERIAL_MODE_UART,
        },
@@ -429,6 +429,7 @@ void uart_off(uint32_t uart_num)
        uart_clk_off(uart_num);
        /* Turn Off power */
        subsystem_power(uart->power_offset, 0);
+       uarts[uart_num].rx_callback = NULL;
 }
 
 
index 90e7cf9..e8b80c6 100644 (file)
@@ -563,8 +563,9 @@ struct lpc_uart
 #define LPC_UART_ENABLE_DLAB   (0x01 << 7)
 /* FIFO Control Register */
 #define LPC_UART_FIFO_EN       (0x01 << 0)
-#define LPC_UART_TX_CLR        (0x01 << 1)
-#define LPC_UART_RX_CLR        (0x01 << 2)
+#define LPC_UART_RX_CLR        (0x01 << 1)
+#define LPC_UART_TX_CLR        (0x01 << 2)
+#define LPC_UART_DMA_MODE_EN   (0x01 << 3)
 #define LPC_UART_FIFO_TRIG(x)  ((x & 0x03) << 6) /* 1 / 4 / 8 / 14 chars */
 /* Interrupt Enable Register */
 #define LPC_UART_RX_INT_EN     (0x01 << 0)