Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: serial: Use RPi Pico UART fifos #43

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions drivers/serial/uart_rpi_pico.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@
}

#ifdef CONFIG_UART_INTERRUPT_DRIVEN
hw_write_masked(&uart_hw->lcr_h, UART_UARTLCR_H_FEN_BITS,
UART_UARTLCR_H_FEN_BITS);
config->irq_config_func(dev);
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */

Expand Down Expand Up @@ -249,7 +251,6 @@
uart_hw_t * const uart_hw = config->uart_regs;

uart_hw->imsc |= UART_UARTIMSC_TXIM_BITS;
uart_hw->ifls &= ~UART_UARTIFLS_TXIFLSEL_BITS;
}

static void uart_rpi_irq_tx_disable(const struct device *dev)
Expand All @@ -273,8 +274,8 @@
const struct uart_rpi_config * const config = dev->config;
uart_hw_t * const uart_hw = config->uart_regs;

uart_hw->imsc |= UART_UARTIMSC_RXIM_BITS;
uart_hw->ifls &= ~UART_UARTIFLS_RXIFLSEL_BITS;
// Trigger interrupts on 1/2 full FIFO or RX timeout

Check failure on line 277 in drivers/serial/uart_rpi_pico.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

C99_COMMENTS

drivers/serial/uart_rpi_pico.c:277 do not use C99 // comments
uart_hw->imsc |= (UART_UARTIMSC_RXIM_BITS | UART_UARTIMSC_RTIM_BITS);
}

static void uart_rpi_irq_rx_disable(const struct device *dev)
Expand All @@ -298,7 +299,7 @@
const struct uart_rpi_config * const config = dev->config;
uart_hw_t * const uart_hw = config->uart_regs;

return (uart_hw->mis & UART_UARTMIS_RXMIS_BITS) == UART_UARTMIS_RXMIS_BITS;
return (uart_hw->mis & (UART_UARTMIS_RXMIS_BITS | UART_UARTMIS_RTMIS_BITS)) != 0;
}

static void uart_rpi_irq_err_enable(const struct device *dev)
Expand Down
Loading