LEDComm
1.0
|
LEDComm Driver macros and structures. More...
#include "ledcommconf.h"
Go to the source code of this file.
Data Structures | |
struct | LEDCommConfig_t |
LEDComm Driver configuration structure. More... | |
struct | LEDCommDriverVMT |
LEDCommDriver virtual methods table. More... | |
struct | LEDCommDriver |
Full duplex LEDComm driver class. More... | |
Macros | |
#define | LEDCOMM_DEFAULT_SYNCS 18 |
Number of MARKs before considering the link is "up". More... | |
#define | LEDCOMM_DEFAULT_THRESHOLD 3000 |
Maximum number of hal ticks for a "shine". More... | |
#define | LEDCOMM_DATA_BITS8 0 |
8 data bits per character. More... | |
#define | LEDCOMM_DATA_BITS7 1 |
7 data bits per character (default). More... | |
#define | LEDCOMM_PARITY_NONE 0 |
Disable parity generation/detection (default). More... | |
#define | LEDCOMM_PARITY 1 |
Enable parity generation/detection. More... | |
#define | LEDCOMM_PARITY_EVEN 0 |
Use even parity (default). More... | |
#define | LEDCOMM_PARITY_ODD 1 |
Use off parity. More... | |
#define | LEDCOMM_PARITY_SPACE 2 |
Use space parity. More... | |
#define | LEDCOMM_PARITY_MARK 3 |
Use mark parity. More... | |
#define | _ledcomm_driver_data |
LEDCommDriver specific data. More... | |
#define | _ledcomm_driver_methods _base_asynchronous_channel_methods |
LEDCommDriver specific methods. More... | |
LEDComm status flags | |
#define | LD_PARITY_ERROR 32 |
Parity error happened. More... | |
#define | LD_FRAMING_ERROR 64 |
Framing error happened. More... | |
#define | LD_OVERRUN_ERROR 128 |
Overflow happened. More... | |
#define | LD_LINK_UP 256 |
Link detected. More... | |
#define | LD_LINK_DOWN 512 |
No link detected. More... | |
Configuration options | |
#define | LEDCOMM_USE_LCOM1 TRUE |
#define | LEDCOMM_USE_LCOM2 FALSE |
#define | LEDCOMM_BUFFERS_SIZE 16 |
Macro Functions | |
#define | ldPut(ldp, b) chOQPut(&(ldp)->oqueue, b) |
Direct write to a LEDCommDriver . More... | |
#define | ldPutTimeout(ldp, b, t) chOQPutTimeout(&(ldp)->oqueue, b, t) |
Direct write to a LEDCommDriver with timeout specification. More... | |
#define | ldGet(ldp) chIQGet(&(ldp)->iqueue) |
Direct read from a LEDCommDriver . More... | |
#define | ldGetTimeout(ldp, t) chIQGetTimeout(&(ldp)->iqueue, t) |
Direct read from a LEDCommDriver with timeout specification. More... | |
#define | ldWrite(ldp, b, n) chOQWriteTimeout(&(ldp)->oqueue, b, n, TIME_INFINITE) |
Direct blocking write to a LEDCommDriver . More... | |
#define | ldWriteTimeout(ldp, b, n, t) chOQWriteTimeout(&(ldp)->oqueue, b, n, t) |
Direct blocking write to a LEDCommDriver with timeout specification. More... | |
#define | ldAsynchronousWrite(ldp, b, n) chOQWriteTimeout(&(ldp)->oqueue, b, n, TIME_IMMEDIATE) |
Direct non-blocking write to a LEDCommDriver . More... | |
#define | ldRead(ldp, b, n) chIQReadTimeout(&(ldp)->iqueue, b, n, TIME_INFINITE) |
Direct blocking read from a LEDCommDriver . More... | |
#define | ldReadTimeout(ldp, b, n, t) chIQReadTimeout(&(ldp)->iqueue, b, n, t) |
Direct blocking read from a LEDCommDriver with timeout specification. More... | |
#define | ldAsynchronousRead(ldp, b, n) chIQReadTimeout(&(ldp)->iqueue, b, n, TIME_IMMEDIATE) |
Direct non-blocking read from a LEDCommDriver . More... | |
Typedefs | |
typedef struct LEDCommDriver | LEDCommDriver_t |
Structure representing a LEDComm driver. More... | |
Enumerations | |
enum | ldstate_t { LD_UNINIT = 0, LD_STOP = 1, LD_READY = 2 } |
Driver state machine possible states. More... | |
Functions | |
void | ldInit (void) |
LEDComm Driver initialization. More... | |
void | ldObjectInit (LEDCommDriver_t *ldp, qnotify_t inotify, qnotify_t onotify) |
Initializes a generic full duplex driver object. More... | |
void | ldStart (LEDCommDriver_t *ldp, const LEDCommConfig_t *config) |
Configures and starts the driver. More... | |
void | ldStop (LEDCommDriver_t *ldp) |
Stops the driver. More... | |
void | ldIncomingDataI (LEDCommDriver_t *ldp, uint8_t b) |
Handles incoming data. More... | |
msg_t | ldRequestDataI (LEDCommDriver_t *ldp) |
Handles outgoing data. More... | |
LEDComm Driver macros and structures.
Definition in file ledcomm.h.
#define LEDCOMM_DEFAULT_SYNCS 18 |
#define LEDCOMM_DEFAULT_THRESHOLD 3000 |
#define LEDCOMM_DATA_BITS7 1 |
#define LEDCOMM_PARITY_NONE 0 |
#define LEDCOMM_PARITY 1 |
#define _ledcomm_driver_data |
LEDCommDriver
specific data.
#define _ledcomm_driver_methods _base_asynchronous_channel_methods |
LEDCommDriver
specific methods.
#define ldPut | ( | ldp, | |
b | |||
) | chOQPut(&(ldp)->oqueue, b) |
Direct write to a LEDCommDriver
.
#define ldPutTimeout | ( | ldp, | |
b, | |||
t | |||
) | chOQPutTimeout(&(ldp)->oqueue, b, t) |
Direct write to a LEDCommDriver
with timeout specification.
#define ldGet | ( | ldp | ) | chIQGet(&(ldp)->iqueue) |
Direct read from a LEDCommDriver
.
#define ldGetTimeout | ( | ldp, | |
t | |||
) | chIQGetTimeout(&(ldp)->iqueue, t) |
Direct read from a LEDCommDriver
with timeout specification.
#define ldWrite | ( | ldp, | |
b, | |||
n | |||
) | chOQWriteTimeout(&(ldp)->oqueue, b, n, TIME_INFINITE) |
Direct blocking write to a LEDCommDriver
.
#define ldWriteTimeout | ( | ldp, | |
b, | |||
n, | |||
t | |||
) | chOQWriteTimeout(&(ldp)->oqueue, b, n, t) |
Direct blocking write to a LEDCommDriver
with timeout specification.
#define ldAsynchronousWrite | ( | ldp, | |
b, | |||
n | |||
) | chOQWriteTimeout(&(ldp)->oqueue, b, n, TIME_IMMEDIATE) |
Direct non-blocking write to a LEDCommDriver
.
#define ldRead | ( | ldp, | |
b, | |||
n | |||
) | chIQReadTimeout(&(ldp)->iqueue, b, n, TIME_INFINITE) |
Direct blocking read from a LEDCommDriver
.
#define ldReadTimeout | ( | ldp, | |
b, | |||
n, | |||
t | |||
) | chIQReadTimeout(&(ldp)->iqueue, b, n, t) |
Direct blocking read from a LEDCommDriver
with timeout specification.
#define ldAsynchronousRead | ( | ldp, | |
b, | |||
n | |||
) | chIQReadTimeout(&(ldp)->iqueue, b, n, TIME_IMMEDIATE) |
Direct non-blocking read from a LEDCommDriver
.
typedef struct LEDCommDriver LEDCommDriver_t |