27#if (HAL_USE_SIO == TRUE) || defined(__DOXYGEN__)
45#if (SIO_USE_STREAMS_INTERFACE == TRUE) || defined(__DOXYGEN__)
46static size_t sync_write(
void *ip,
const uint8_t *bp,
size_t n,
68static size_t sync_read(
void *ip, uint8_t *bp,
size_t n,
95static size_t __write(
void *ip,
const uint8_t *bp,
size_t n) {
100static size_t __read(
void *ip, uint8_t *bp,
size_t n) {
155static size_t __writet(
void *ip,
const uint8_t *bp,
size_t n,
161static size_t __readt(
void *ip, uint8_t *bp,
size_t n,
167static msg_t __ctl(
void *ip,
unsigned int operation,
void *arg) {
218#if SIO_USE_STREAMS_INTERFACE == TRUE
226#if SIO_USE_SYNCHRONIZATION == TRUE
234#if defined(SIO_DRIVER_EXT_INIT_HOOK)
235 SIO_DRIVER_EXT_INIT_HOOK(siop);
270#if SIO_USE_SYNCHRONIZATION == TRUE
307#if SIO_USE_SYNCHRONIZATION == TRUE
512#if (SIO_USE_SYNCHRONIZATION == TRUE) || defined(__DOXYGEN__)
static const struct EFlashDriverVMT vmt
#define HAL_RET_UNKNOWN_CTL
Unknown control code.
#define CHN_CTL_INVALID
Invalid operation code.
#define CHN_CTL_NOP
Does nothing.
static void osalSysLock(void)
Enters a critical zone from thread context.
static void osalSysUnlock(void)
Leaves a critical zone from thread context.
void osalOsRescheduleS(void)
Checks if a reschedule is required and performs it.
void osalThreadResumeI(thread_reference_t *trp, msg_t msg)
Wakes up a thread waiting on a thread reference object.
#define osalDbgAssert(c, remark)
Condition assertion.
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.
struct hal_sio_config SIOConfig
Type of structure representing a SIO configuration.
static size_t sync_write(void *ip, const uint8_t *bp, size_t n, sysinterval_t timeout)
msg_t sioSynchronizeRX(SIODriver *siop, sysinterval_t timeout)
Synchronizes with RX FIFO data availability.
#define sioHasRXErrorsX(siop)
Determines if RX has pending errors to be read and cleared.
msg_t sio_lld_control(SIODriver *siop, unsigned int operation, void *arg)
Control operation on a serial port.
msg_t sioSynchronizeRXIdle(SIODriver *siop, sysinterval_t timeout)
Synchronizes with RX going idle.
#define sioPutX(siop, data)
Pushes one frame into the TX FIFO.
static msg_t __put(void *ip, uint8_t b)
static size_t __writet(void *ip, const uint8_t *bp, size_t n, sysinterval_t timeout)
msg_t sioSynchronizeTXEnd(SIODriver *siop, sysinterval_t timeout)
Synchronizes with TX completion.
msg_t sioSynchronizeTX(SIODriver *siop, sysinterval_t timeout)
Synchronizes with TX FIFO space availability.
static size_t __read(void *ip, uint8_t *bp, size_t n)
#define sioGetX(siop)
Returns one frame from the RX FIFO.
void sioWriteEnableFlags(SIODriver *siop, sioevents_t mask)
Writes the enabled events flags mask.
sioevents_t sioGetAndClearErrors(SIODriver *siop)
Get and clears SIO error event flags.
struct hal_sio_driver SIODriver
Type of structure representing a SIO driver.
#define sioIsRXIdleX(siop)
Determines the activity state of the receiver.
static msg_t __gett(void *ip, sysinterval_t timeout)
static size_t __readt(void *ip, uint8_t *bp, size_t n, sysinterval_t timeout)
void sioInit(void)
SIO Driver initialization.
#define sioSetEnableFlagsX(siop, mask)
Sets flags into the enabled events flags mask.
#define sioWriteEnableFlagsX(siop, mask)
Writes the enabled events mask.
size_t sioAsyncRead(SIODriver *siop, uint8_t *buffer, size_t n)
Reads data from the RX FIFO.
size_t sioAsyncWrite(SIODriver *siop, const uint8_t *buffer, size_t n)
Writes data into the TX FIFO.
#define sioIsTXFullX(siop)
Determines the state of the TX FIFO.
void sioObjectInit(SIODriver *siop)
Initializes the standard part of a SIODriver structure.
msg_t sioStart(SIODriver *siop, const SIOConfig *config)
Configures and activates the SIO peripheral.
void sio_lld_stop(SIODriver *siop)
Deactivates the SIO peripheral.
#define sioGetAndClearEventsX(siop)
Get and clears SIO event flags.
sioevents_t sioGetAndClearEvents(SIODriver *siop)
Get and clears SIO event flags.
#define sioGetAndClearErrorsX(siop)
Get and clears SIO error event flags.
void sioSetEnableFlags(SIODriver *siop, sioevents_t mask)
Sets flags into the enabled events flags mask.
void sio_lld_init(void)
Low level SIO driver initialization.
eventflags_t sioevents_t
Type of event flags.
static msg_t __ctl(void *ip, unsigned int operation, void *arg)
void sioStop(SIODriver *siop)
Deactivates the SIO peripheral.
static size_t __write(void *ip, const uint8_t *bp, size_t n)
static msg_t __get(void *ip)
static size_t sync_read(void *ip, uint8_t *bp, size_t n, sysinterval_t timeout)
#define sioClearEnableFlagsX(siop, mask)
Clears flags from the enabled events flags mask.
static msg_t __putt(void *ip, uint8_t b, sysinterval_t timeout)
#define sioGetEventsX(siop)
Returns the pending SIO event flags.
#define sioAsyncReadX(siop, size, buffer)
Reads data from the RX FIFO.
#define sioAsyncWriteX(siop, size, buffer)
Writes data into the TX FIFO.
sioevents_t sioGetEvents(SIODriver *siop)
Returns the pending SIO event flags.
void sioClearEnableFlags(SIODriver *siop, sioevents_t mask)
Clears flags from the enabled events flags mask.
#define sioIsTXOngoingX(siop)
Determines the transmission state.
msg_t sio_lld_start(SIODriver *siop)
Configures and activates the SIO peripheral.
#define sioIsRXEmptyX(siop)
Determines the state of the RX FIFO.
#define SIO_EV_ALL_EVENTS
#define MSG_OK
Normal wakeup message.
#define MSG_RESET
Wakeup caused by a reset condition.
uint64_t sysinterval_t
Type of time interval.
#define TIME_INFINITE
Infinite interval specification for all functions with a timeout specification.
thread_reference_t sync_rxidle
Synchronization point for RX idle.
siostate_t state
Driver state.
sioevents_t enabled
Enabled event flags.
siocb_t cb
Events callback.
thread_reference_t sync_rx
Synchronization point for RX.
thread_reference_t sync_txend
Synchronization point for TX-end.
const struct sio_driver_vmt * vmt
Virtual Methods Table.
thread_reference_t sync_tx
Synchronization point for TX.
const SIOConfig * config
Current configuration data.
SIODriver virtual methods table.