![]() |
ChibiOS/RT Architecture - Reference Manual - Guides |
Serial Driver macros and structures. More...
#include "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... | |
Defines | |
| #define | SD_NO_ERROR 0 |
| No pending conditions. | |
| #define | SD_CONNECTED 1 |
| Connection happened. | |
| #define | SD_DISCONNECTED 2 |
| Disconnection happened. | |
| #define | SD_PARITY_ERROR 4 |
| Parity error happened. | |
| #define | SD_FRAMING_ERROR 8 |
| Framing error happened. | |
| #define | SD_OVERRUN_ERROR 16 |
| Overflow happened. | |
| #define | SD_NOISE_ERROR 32 |
| Noise on the line. | |
| #define | SD_BREAK_DETECTED 64 |
| Break detected. | |
| #define | SERIAL_DEFAULT_BITRATE 38400 |
| Default bit rate. | |
| #define | SERIAL_BUFFERS_SIZE 64 |
| Serial buffers size. | |
| #define | _serial_driver_methods _base_asynchronous_channel_methods |
SerialDriver specific methods. | |
| #define | sdPutWouldBlock(sdp) chOQIsFull(&(sdp)->oqueue) |
Direct output check on a SerialDriver. | |
| #define | sdGetWouldBlock(sdp) chIQIsEmpty(&(sdp)->iqueue) |
Direct input check on a SerialDriver. | |
| #define | sdPut(sdp, b) chOQPut(&(sdp)->oqueue, b) |
Direct write to a SerialDriver. | |
| #define | sdPutTimeout(sdp, b, t) chOQPutTimeout(&(sdp)->iqueue, b, t) |
Direct write to a SerialDriver with timeout specification. | |
| #define | sdGet(sdp) chIQGet(&(sdp)->iqueue) |
Direct read from a SerialDriver. | |
| #define | sdGetTimeout(sdp, t) chIQGetTimeout(&(sdp)->iqueue, t) |
Direct read from a SerialDriver with timeout specification. | |
| #define | sdWrite(sdp, b, n) chOQWriteTimeout(&(sdp)->oqueue, b, n, TIME_INFINITE) |
Direct blocking write to a SerialDriver. | |
| #define | sdWriteTimeout(sdp, b, n, t) chOQWriteTimeout(&(sdp)->oqueue, b, n, t) |
Direct blocking write to a SerialDriver with timeout specification. | |
| #define | sdAsynchronousWrite(sdp, b, n) chOQWriteTimeout(&(sdp)->oqueue, b, n, TIME_IMMEDIATE) |
Direct non-blocking write to a SerialDriver. | |
| #define | sdRead(sdp, b, n) chIQReadTimeout(&(sdp)->iqueue, b, n, TIME_INFINITE) |
Direct blocking read from a SerialDriver. | |
| #define | sdReadTimeout(sdp, b, n, t) chIQReadTimeout(&(sdp)->iqueue, b, n, t) |
Direct blocking read from a SerialDriver with timeout specification. | |
| #define | sdAsynchronousRead(sdp, b, n) chIQReadTimeout(&(sdp)->iqueue, b, n, TIME_IMMEDIATE) |
Direct non-blocking read from a SerialDriver. | |
| #define | sdGetStatusChangeEventSource(ip) (&((ip)->vmt->sevent)) |
| Returns the status change event source. | |
Typedefs | |
| typedef struct _SerialDriver | SerialDriver |
| Structure representing a serial driver. | |
Enumerations | |
| enum | sdstate_t { SD_UNINIT = 0, SD_STOP = 1, SD_READY = 2 } |
Driver state machine possible states. More... | |
Functions | |
| void | sdInit (void) |
| Serial Driver initialization. | |
| void | sdObjectInit (SerialDriver *sdp, qnotify_t inotify, qnotify_t onotify) |
| Initializes a generic full duplex driver object. | |
| void | sdStart (SerialDriver *sdp, const SerialConfig *config) |
| Configures and starts the driver. | |
| void | sdStop (SerialDriver *sdp) |
| Stops the driver. | |
| void | sdIncomingDataI (SerialDriver *sdp, uint8_t b) |
| Handles incoming data. | |
| msg_t | sdRequestDataI (SerialDriver *sdp) |
| Handles outgoing data. | |
| void | sdAddFlagsI (SerialDriver *sdp, sdflags_t mask) |
| Handles communication events/errors. | |
| sdflags_t | sdGetAndClearFlags (SerialDriver *sdp) |
| Returns and clears the errors mask associated to the driver. | |
Serial Driver macros and structures.
Definition in file serial.h.
1.7.1