ChibiOS/HAL  6.1.0
hal_serial.h File Reference

Serial Driver macros and structures. More...

#include "hal_serial_lld.h"

Go to the source code of this file.

Data Structures

struct  SerialDriverVMT
 SerialDriver virtual methods table. More...
 
struct  SerialDriver
 Full duplex serial driver class. More...
 

Macros

#define _serial_driver_methods   _base_asynchronous_channel_methods
 SerialDriver specific methods. More...
 
Serial status flags
#define SD_PARITY_ERROR   (eventflags_t)32
 Parity. More...
 
#define SD_FRAMING_ERROR   (eventflags_t)64
 Framing. More...
 
#define SD_OVERRUN_ERROR   (eventflags_t)128
 Overflow. More...
 
#define SD_NOISE_ERROR   (eventflags_t)256
 Line noise. More...
 
#define SD_BREAK_DETECTED   (eventflags_t)512
 LIN Break. More...
 
#define SD_QUEUE_FULL_ERROR   (eventflags_t)1024
 Queue full. More...
 
Serial configuration options
#define SERIAL_DEFAULT_BITRATE   38400
 Default bit rate. More...
 
#define SERIAL_BUFFERS_SIZE   16
 Serial buffers size. More...
 
Macro Functions
#define sdPutI(sdp, b)   oqPutI(&(sdp)->oqueue, b)
 Direct write to a SerialDriver. More...
 
#define sdPut(sdp, b)   oqPut(&(sdp)->oqueue, b)
 Direct write to a SerialDriver. More...
 
#define sdPutTimeout(sdp, b, t)   oqPutTimeout(&(sdp)->oqueue, b, t)
 Direct write to a SerialDriver with timeout specification. More...
 
#define sdGetI(sdp)   iqGetI(&(sdp)->iqueue)
 Direct read from a SerialDriver. More...
 
#define sdGet(sdp)   iqGet(&(sdp)->iqueue)
 Direct read from a SerialDriver. More...
 
#define sdGetTimeout(sdp, t)   iqGetTimeout(&(sdp)->iqueue, t)
 Direct read from a SerialDriver with timeout specification. More...
 
#define sdWriteI(sdp, b, n)   oqWriteI(&(sdp)->oqueue, b, n)
 Direct blocking write to a SerialDriver. More...
 
#define sdWrite(sdp, b, n)   oqWriteTimeout(&(sdp)->oqueue, b, n, TIME_INFINITE)
 Direct blocking write to a SerialDriver. More...
 
#define sdWriteTimeout(sdp, b, n, t)   oqWriteTimeout(&(sdp)->oqueue, b, n, t)
 Direct blocking write to a SerialDriver with timeout specification. More...
 
#define sdAsynchronousWrite(sdp, b, n)   oqWriteTimeout(&(sdp)->oqueue, b, n, TIME_IMMEDIATE)
 Direct non-blocking write to a SerialDriver. More...
 
#define sdReadI(sdp, b, n)   iqReadI(&(sdp)->iqueue, b, n, TIME_INFINITE)
 Direct blocking read from a SerialDriver. More...
 
#define sdRead(sdp, b, n)   iqReadTimeout(&(sdp)->iqueue, b, n, TIME_INFINITE)
 Direct blocking read from a SerialDriver. More...
 
#define sdReadTimeout(sdp, b, n, t)   iqReadTimeout(&(sdp)->iqueue, b, n, t)
 Direct blocking read from a SerialDriver with timeout specification. More...
 
#define sdAsynchronousRead(sdp, b, n)   iqReadTimeout(&(sdp)->iqueue, b, n, TIME_IMMEDIATE)
 Direct non-blocking read from a SerialDriver. More...
 

Typedefs

typedef struct SerialDriver SerialDriver
 Structure representing a serial driver. More...
 

Enumerations

Functions

void sdInit (void)
 Serial Driver initialization. More...
 
void sdObjectInit (SerialDriver *sdp, qnotify_t inotify, qnotify_t onotify)
 Initializes a generic full duplex driver object. More...
 
void sdStart (SerialDriver *sdp, const SerialConfig *config)
 Configures and starts the driver. More...
 
void sdStop (SerialDriver *sdp)
 Stops the driver. More...
 
void sdIncomingDataI (SerialDriver *sdp, uint8_t b)
 Handles incoming data. More...
 
msg_t sdRequestDataI (SerialDriver *sdp)
 Handles outgoing data. More...
 
bool sdPutWouldBlock (SerialDriver *sdp)
 Direct output check on a SerialDriver. More...
 
bool sdGetWouldBlock (SerialDriver *sdp)
 Direct input check on a SerialDriver. More...
 
msg_t sdControl (SerialDriver *sdp, unsigned int operation, void *arg)
 Control operation on a serial port. More...
 

Detailed Description

Serial Driver macros and structures.

Definition in file hal_serial.h.