Go to the documentation of this file.
27 #if (HAL_USE_SIO == TRUE) || defined(__DOXYGEN__)
53 #if (SIO_USE_SYNCHRONIZATION == TRUE) || defined(__DOXYGEN__)
54 static size_t sync_write(
void *ip,
const uint8_t *bp,
size_t n,
76 static size_t sync_read(
void *ip, uint8_t *bp,
size_t n,
103 static size_t __write(
void *ip,
const uint8_t *bp,
size_t n) {
108 static size_t __read(
void *ip, uint8_t *bp,
size_t n) {
113 static msg_t __put(
void *ip, uint8_t b) {
126 static msg_t __get(
void *ip) {
163 static size_t __writet(
void *ip,
const uint8_t *bp,
size_t n,
166 return sync_write(ip, bp, n, timeout);
169 static size_t __readt(
void *ip, uint8_t *bp,
size_t n,
172 return sync_read(ip, bp, n, timeout);
175 static msg_t __ctl(
void *ip,
unsigned int operation,
void *arg) {
196 __write, __read, __put, __get,
197 __putt, __gett, __writet, __readt,
227 #if SIO_USE_SYNCHRONIZATION == TRUE
234 #if defined(SIO_DRIVER_EXT_INIT_HOOK)
235 SIO_DRIVER_EXT_INIT_HOOK(siop);
313 if (operation != NULL) {
341 #if SIO_USE_SYNCHRONIZATION == TRUE
432 #if (SIO_USE_SYNCHRONIZATION == TRUE) || defined(__DOXYGEN__)
thread_reference_t sync_tx
Synchronization point for TX.
#define sioGetX(siop)
Returns one frame from the RX FIFO.
#define CHN_CTL_NOP
Does nothing.
#define CHN_CTL_INVALID
Invalid operation code.
#define sioAsyncReadI(siop, size, buffer)
Reads data from the RX FIFO.
#define MSG_RESET
Wakeup caused by a reset condition.
#define sioPutX(siop, data)
Pushes one frame into the TX FIFO.
void sioStop(SIODriver *siop)
Deactivates the SIO peripheral.
void sio_lld_init(void)
Low level SIO driver initialization.
#define sio_lld_is_tx_ongoing(siop)
Determines the transmission state.
size_t sioAsyncRead(SIODriver *siop, uint8_t *buffer, size_t n)
Reads data from the RX FIFO.
void sioStartOperation(SIODriver *siop, const SIOOperation *operation)
Starts a SIO operation.
static void osalSysUnlock(void)
Leaves a critical zone from thread context.
const SIOOperation * operation
Current configuration data.
bool sioStart(SIODriver *siop, const SIOConfig *config)
Configures and activates the SIO peripheral.
msg_t sioSynchronizeRX(SIODriver *siop, sysinterval_t timeout)
Synchronizes with RX FIFO data availability.
const SIOConfig * config
Current configuration data.
msg_t sio_lld_control(SIODriver *siop, unsigned int operation, void *arg)
Control operation on a serial port.
Structure representing a SIO operation.
#define sioAsyncWriteI(siop, size, buffer)
Writes data into the TX FIFO.
thread_reference_t sync_txend
Synchronization point for TX-end.
void sioObjectInit(SIODriver *siop)
Initializes the standard part of a SIODriver structure.
Driver configuration structure.
msg_t sioSynchronizeTX(SIODriver *siop, sysinterval_t timeout)
Synchronizes with TX FIFO space availability.
#define TIME_INFINITE
Infinite interval specification for all functions with a timeout specification.
void sio_lld_stop(SIODriver *siop)
Deactivates the SIO peripheral.
#define sioGetAndClearEventsI(siop)
Return the pending SIO events flags.
#define MSG_OK
Normal wakeup message.
#define osalDbgCheck(c)
Function parameters check.
msg_t osalThreadSuspendTimeoutS(thread_reference_t *trp, sysinterval_t timeout)
Sends the current thread sleeping and sets a reference variable.
siostate_t state
Driver state.
uint64_t sysinterval_t
Type of time interval.
static void osalSysLock(void)
Enters a critical zone from thread context.
msg_t sioSynchronizeTXEnd(SIODriver *siop, sysinterval_t timeout)
Synchronizes with TX completion.
void sioStopOperation(SIODriver *siop)
Stops an ongoing SIO operation, if any.
void sio_lld_start_operation(SIODriver *siop)
Starts a SIO operation.
#define sio_lld_is_tx_full(siop)
Determines the state of the TX FIFO.
const struct sio_driver_vmt * vmt
Virtual Methods Table.
size_t sioAsyncWrite(SIODriver *siop, const uint8_t *buffer, size_t n)
Writes data into the TX FIFO.
#define osalDbgAssert(c, remark)
Condition assertion.
void osalThreadResumeI(thread_reference_t *trp, msg_t msg)
Wakes up a thread waiting on a thread reference object.
void sioInit(void)
SIO Driver initialization.
siocb_t rx_cb
Receive non-empty callback.
Structure representing a SIO driver.
SIODriver virtual methods table.
bool sio_lld_start(SIODriver *siop)
Configures and activates the SIO peripheral.
void sio_lld_stop_operation(SIODriver *siop)
Stops an ongoing SIO operation, if any.
thread_reference_t sync_rx
Synchronization point for RX.
sio_events_mask_t sioGetAndClearEvents(SIODriver *siop)
Return the pending SIO events flags.
#define sio_lld_is_rx_empty(siop)
Determines the state of the RX FIFO.
uint32_t sio_events_mask_t
Type of a SIO events mask.