URL
https://opencores.org/ocsvn/neorv32/neorv32/trunk
[/] [neorv32/] [trunk/] [sw/] [lib/] [source/] [neorv32_uart.c] - Diff between revs 2 and 3
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 2 |
Rev 3 |
Line 128... |
Line 128... |
|
|
/**********************************************************************//**
|
/**********************************************************************//**
|
* Send single char via UART.
|
* Send single char via UART.
|
*
|
*
|
* @note This function is blocking.
|
* @note This function is blocking.
|
|
* @warning The 'SIMCOM_UART_OVERRIDE' compiler user flag will forward all UART TX data to the SIMCOM simulation console output.
|
*
|
*
|
* @param[in] c Char to be send.
|
* @param[in] c Char to be send.
|
**************************************************************************/
|
**************************************************************************/
|
void neorv32_uart_putc(char c) {
|
void neorv32_uart_putc(char c) {
|
|
|
|
#ifdef DEVNULL_UART_OVERRIDE
|
|
#warning UART OVERRIDE! Sending all UART.TX data to DEVNULL simulation output instead of UART transmitter. Use this for simulations only!
|
|
DEVNULL_DATA = (uint32_t)c;
|
|
#else
|
// wait for previous transfer to finish
|
// wait for previous transfer to finish
|
while ((UART_CT & (1<<UART_CT_TX_BUSY)) != 0);
|
while ((UART_CT & (1<<UART_CT_TX_BUSY)) != 0);
|
UART_DATA = ((uint32_t)c) << UART_DATA_LSB;
|
UART_DATA = ((uint32_t)c) << UART_DATA_LSB;
|
|
#endif
|
|
|
}
|
}
|
|
|
|
|
/**********************************************************************//**
|
/**********************************************************************//**
|
* Get char from UART.
|
* Get char from UART.
|
© copyright 1999-2025
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.