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);
149 osalDbgCheck((uartp != NULL) && (n > 0U) && (txbuf != NULL));
175 osalDbgCheck((uartp != NULL) && (n > 0U) && (txbuf != NULL));
208 n = UART_ERR_NOT_ACTIVE;
239 return UART_ERR_NOT_ACTIVE;
255 osalDbgCheck((uartp != NULL) && (n > 0U) && (rxbuf != NULL));
281 osalDbgCheck((uartp != NULL) && (n > 0U) && (rxbuf != NULL));
314 n = UART_ERR_NOT_ACTIVE;
345 return UART_ERR_NOT_ACTIVE;
348 #if (UART_USE_WAIT == TRUE) || defined(__DOXYGEN__) 373 osalDbgCheck((uartp != NULL) && (*np > 0U) && (txbuf != NULL));
418 osalDbgCheck((uartp != NULL) && (*np > 0U) && (txbuf != NULL));
425 uartp->
early =
false;
465 osalDbgCheck((uartp != NULL) && (*np > 0U) && (rxbuf != NULL));
486 #if (UART_USE_MUTUAL_EXCLUSION == TRUE) || defined(__DOXYGEN__) static void osalMutexObjectInit(mutex_t *mp)
Initializes s mutex_t object.
const UARTConfig * config
Current configuration data.
void uartStartSend(UARTDriver *uartp, size_t n, const void *txbuf)
Starts a transmission on the UART peripheral.
size_t uartStopReceive(UARTDriver *uartp)
Stops any ongoing receive operation.
void uartInit(void)
UART Driver initialization.
void uart_lld_start(UARTDriver *uartp)
Configures and activates the UART peripheral.
bool early
Synchronization flag for transmit operations.
size_t uartStopSendI(UARTDriver *uartp)
Stops any ongoing transmission.
size_t uart_lld_stop_receive(UARTDriver *uartp)
Stops any ongoing receive operation.
#define osalDbgCheckClassI()
I-Class state check.
thread_reference_t threadrx
Waiting thread on RX.
void uartStop(UARTDriver *uartp)
Deactivates the UART peripheral.
void osalMutexLock(mutex_t *mp)
Locks the specified mutex.
static void osalSysUnlock(void)
Leaves a critical zone from thread context.
msg_t uartSendTimeout(UARTDriver *uartp, size_t *np, const void *txbuf, sysinterval_t timeout)
Performs a transmission on the UART peripheral.
size_t uartStopReceiveI(UARTDriver *uartp)
Stops any ongoing receive operation.
size_t uart_lld_stop_send(UARTDriver *uartp)
Stops any ongoing transmission.
size_t uartStopSend(UARTDriver *uartp)
Stops any ongoing transmission.
uarttxstate_t txstate
Transmitter state.
void uart_lld_stop(UARTDriver *uartp)
Deactivates 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 uart_lld_start_receive(UARTDriver *uartp, size_t n, void *rxbuf)
Starts a receive operation on the UART peripheral.
int32_t msg_t
Type of a message.
void uartStartSendI(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 uartStartReceiveI(UARTDriver *uartp, size_t n, void *rxbuf)
Starts a receive operation on the UART peripheral.
void uartReleaseBus(UARTDriver *uartp)
Releases exclusive access to the UART bus.
void uartAcquireBus(UARTDriver *uartp)
Gains exclusive access to the UART bus.
void uartStartReceive(UARTDriver *uartp, size_t n, void *rxbuf)
Starts a receive operation on the UART peripheral.
#define osalDbgCheck(c)
Function parameters check.
void uart_lld_init(void)
Low level UART driver initialization.
uint32_t sysinterval_t
Type of system time interval.
uartrxstate_t rxstate
Receiver state.
msg_t osalThreadSuspendTimeoutS(thread_reference_t *trp, sysinterval_t timeout)
Sends the current thread sleeping and sets a reference variable.
void uartStart(UARTDriver *uartp, const UARTConfig *config)
Configures and activates the UART peripheral.
uartstate_t state
Driver state.
static void osalSysLock(void)
Enters a critical zone from thread context.
Driver configuration structure.
thread_reference_t threadtx
Waiting thread on TX.
void uartObjectInit(UARTDriver *uartp)
Initializes the standard part of a UARTDriver structure.
#define osalDbgAssert(c, remark)
Condition assertion.
void osalMutexUnlock(mutex_t *mp)
Unlocks the specified mutex.
Structure representing an UART driver.
mutex_t mutex
Mutex protecting the peripheral.
msg_t uartSendFullTimeout(UARTDriver *uartp, size_t *np, const void *txbuf, sysinterval_t timeout)
Performs a transmission on the UART peripheral.