27 #if (HAL_USE_SERIAL == TRUE) || defined(__DOXYGEN__) 50 static size_t _write(
void *ip,
const uint8_t *bp,
size_t n) {
56 static size_t _read(
void *ip, uint8_t *bp,
size_t n) {
62 static msg_t _put(
void *ip, uint8_t b) {
67 static msg_t _get(
void *ip) {
82 static size_t _writet(
void *ip,
const uint8_t *bp,
size_t n,
88 static size_t _readt(
void *ip, uint8_t *bp,
size_t n,
94 static msg_t _ctl(
void *ip,
unsigned int operation,
void *arg) {
103 case CHN_CTL_INVALID:
107 #if defined(SD_LLD_IMPLEMENTS_CTL) 109 return sd_lld_control(sdp, operation, arg);
119 _write, _read, _put, _get,
120 _putt, _gett, _writet, _readt,
155 #if !defined(SERIAL_ADVANCED_BUFFERING_SUPPORT) || \ 156 (SERIAL_ADVANCED_BUFFERING_SUPPORT == FALSE) || \ 247 if (
iqPutI(&sdp->iqueue, b) < MSG_OK)
344 return _ctl((
void *)sdp, operation, arg);
#define SERIAL_BUFFERS_SIZE
Serial buffers size.
void iqObjectInit(input_queue_t *iqp, uint8_t *bp, size_t size, qnotify_t infy, void *link)
Initializes an input queue.
msg_t iqGetTimeout(input_queue_t *iqp, sysinterval_t timeout)
Input queue read with timeout.
void sdStart(SerialDriver *sdp, const SerialConfig *config)
Configures and starts the driver.
void oqObjectInit(output_queue_t *oqp, uint8_t *bp, size_t size, qnotify_t onfy, void *link)
Initializes an output queue.
#define iqIsEmptyI(iqp)
Evaluates to true if the specified input queue is empty.
void iqResetI(input_queue_t *iqp)
Resets an input queue.
void sdInit(void)
Serial Driver initialization.
bool sdPutWouldBlock(SerialDriver *sdp)
Direct output check on a SerialDriver.
#define osalDbgCheckClassI()
I-Class state check.
void oqResetI(output_queue_t *oqp)
Resets an output queue.
static void osalSysUnlock(void)
Leaves a critical zone from thread context.
msg_t sdRequestDataI(SerialDriver *sdp)
Handles outgoing data.
void osalOsRescheduleS(void)
Checks if a reschedule is required and performs it.
void sd_lld_init(void)
Low level serial driver initialization.
static void osalEventObjectInit(event_source_t *esp)
Initializes an event source object.
void sd_lld_start(SerialDriver *sdp, const SerialConfig *config)
Low level serial driver configuration and (re)start.
int32_t msg_t
Type of a message.
void(* qnotify_t)(io_queue_t *qp)
Queue notification callback type.
const struct SerialDriverVMT * vmt
Virtual Methods Table.
size_t oqWriteTimeout(output_queue_t *oqp, const uint8_t *bp, size_t n, sysinterval_t timeout)
Output queue write with timeout.
#define oqIsFullI(oqp)
Evaluates to true if the specified output queue is full.
msg_t oqPutTimeout(output_queue_t *oqp, uint8_t b, sysinterval_t timeout)
Output queue write with timeout.
#define osalDbgCheck(c)
Function parameters check.
Full duplex serial driver class.
SerialDriver virtual methods table.
msg_t sdControl(SerialDriver *sdp, unsigned int operation, void *arg)
Control operation on a serial port.
uint32_t sysinterval_t
Type of system time interval.
msg_t oqGetI(output_queue_t *oqp)
Output queue read.
void sdObjectInit(SerialDriver *sdp, qnotify_t inotify, qnotify_t onotify)
Initializes a generic full duplex driver object.
static void osalSysLock(void)
Enters a critical zone from thread context.
bool sdGetWouldBlock(SerialDriver *sdp)
Direct input check on a SerialDriver.
void sd_lld_stop(SerialDriver *sdp)
Low level serial driver stop.
void sdIncomingDataI(SerialDriver *sdp, uint8_t b)
Handles incoming data.
#define chnAddFlagsI(ip, flags)
Adds status flags to the listeners's flags mask.
msg_t iqPutI(input_queue_t *iqp, uint8_t b)
Input queue write.
#define osalDbgAssert(c, remark)
Condition assertion.
#define CHN_OUTPUT_EMPTY
Output queue empty.
size_t iqReadTimeout(input_queue_t *iqp, uint8_t *bp, size_t n, sysinterval_t timeout)
Input queue read with timeout.
#define CHN_INPUT_AVAILABLE
Data available in the input queue.
#define SD_QUEUE_FULL_ERROR
Queue full.
PLATFORM Serial Driver configuration structure.
void sdStop(SerialDriver *sdp)
Stops the driver.