27#if (HAL_USE_UART == TRUE) || defined(__DOXYGEN__)
74#if UART_USE_WAIT == TRUE
79#if UART_USE_MUTUAL_EXCLUSION == TRUE
84#if defined(UART_DRIVER_EXT_INIT_HOOK)
85 UART_DRIVER_EXT_INIT_HOOK(uartp);
109#if defined(UART_LLD_ENHANCED_API)
166 osalDbgCheck((uartp != NULL) && (n > 0U) && (txbuf != NULL));
192 osalDbgCheck((uartp != NULL) && (n > 0U) && (txbuf != NULL));
272 osalDbgCheck((uartp != NULL) && (n > 0U) && (rxbuf != NULL));
298 osalDbgCheck((uartp != NULL) && (n > 0U) && (rxbuf != NULL));
365#if (UART_USE_WAIT == TRUE) || defined(__DOXYGEN__)
390 osalDbgCheck((uartp != NULL) && (*np > 0U) && (txbuf != NULL));
435 osalDbgCheck((uartp != NULL) && (*np > 0U) && (txbuf != NULL));
442 uartp->
early =
false;
482 osalDbgCheck((uartp != NULL) && (*np > 0U) && (rxbuf != NULL));
503#if (UART_USE_MUTUAL_EXCLUSION == TRUE) || defined(__DOXYGEN__)
static void osalSysLock(void)
Enters a critical zone from thread context.
static void osalMutexObjectInit(mutex_t *mp)
Initializes a mutex_t object.
static void osalSysUnlock(void)
Leaves a critical zone from thread context.
int32_t msg_t
Type of a message.
uint32_t sysinterval_t
Type of system time interval.
void osalMutexLock(mutex_t *mp)
Locks the specified mutex.
#define osalDbgAssert(c, remark)
Condition assertion.
void osalMutexUnlock(mutex_t *mp)
Unlocks the specified mutex.
msg_t osalThreadSuspendTimeoutS(thread_reference_t *trp, sysinterval_t timeout)
Sends the current thread sleeping and sets a reference variable.
#define osalDbgCheck(c)
Function parameters check.
#define osalDbgCheckClassI()
I-Class state check.
struct hal_uart_config UARTConfig
Driver configuration structure.
void uartInit(void)
UART Driver initialization.
void uartStartSend(UARTDriver *uartp, size_t n, const void *txbuf)
Starts a transmission on the UART peripheral.
void uart_lld_start_send(UARTDriver *uartp, size_t n, const void *txbuf)
Starts a transmission on the UART peripheral.
void uartStartSendI(UARTDriver *uartp, size_t n, const void *txbuf)
Starts a transmission on the UART peripheral.
void uartObjectInit(UARTDriver *uartp)
Initializes the standard part of a UARTDriver structure.
void uart_lld_start(UARTDriver *uartp)
Configures and activates the UART peripheral.
void uartAcquireBus(UARTDriver *uartp)
Gains exclusive access to the UART bus.
msg_t uartStart(UARTDriver *uartp, const UARTConfig *config)
Configures and activates the UART peripheral.
void uartStartReceiveI(UARTDriver *uartp, size_t n, void *rxbuf)
Starts a receive operation on the UART peripheral.
msg_t uartReceiveTimeout(UARTDriver *uartp, size_t *np, void *rxbuf, sysinterval_t timeout)
Performs a receive operation on the UART peripheral.
void uartReleaseBus(UARTDriver *uartp)
Releases exclusive access to the UART bus.
msg_t uartSendFullTimeout(UARTDriver *uartp, size_t *np, const void *txbuf, sysinterval_t timeout)
Performs a transmission on the UART peripheral.
void uartStop(UARTDriver *uartp)
Deactivates the UART peripheral.
#define UART_ERR_NOT_ACTIVE
void uart_lld_init(void)
Low level UART driver initialization.
void uartStartReceive(UARTDriver *uartp, size_t n, void *rxbuf)
Starts a receive operation on the UART peripheral.
size_t uartStopSend(UARTDriver *uartp)
Stops any ongoing transmission.
size_t uart_lld_stop_send(UARTDriver *uartp)
Stops any ongoing transmission.
size_t uartStopReceive(UARTDriver *uartp)
Stops any ongoing receive operation.
size_t uartStopSendI(UARTDriver *uartp)
Stops any ongoing transmission.
size_t uartStopReceiveI(UARTDriver *uartp)
Stops any ongoing receive operation.
void uart_lld_start_receive(UARTDriver *uartp, size_t n, void *rxbuf)
Starts a receive operation on the UART peripheral.
msg_t uartSendTimeout(UARTDriver *uartp, size_t *np, const void *txbuf, sysinterval_t timeout)
Performs a transmission on the UART peripheral.
size_t uart_lld_stop_receive(UARTDriver *uartp)
Stops any ongoing receive operation.
void uart_lld_stop(UARTDriver *uartp)
Deactivates the UART peripheral.
struct hal_uart_driver UARTDriver
Type of structure representing an UART driver.
const UARTConfig * config
Current configuration data.
uartstate_t state
Driver state.
thread_reference_t threadrx
Waiting thread on RX.
uartrxstate_t rxstate
Receiver state.
thread_reference_t threadtx
Waiting thread on TX.
bool early
Synchronization flag for transmit operations.
mutex_t mutex
Mutex protecting the peripheral.
uarttxstate_t txstate
Transmitter state.