fdserial library
v0.85
Functions for connecting with full duplex serial devices
|
Full Duplex Serial adapter API definition. More...
#include "simpletext.h"
Go to the source code of this file.
Data Structures | |
struct | fdserial_struct |
Macros | |
#define | FDSERIAL_BUFF_MASK 0x3f |
#define | FDSERIAL_MODE_NONE 0 |
#define | FDSERIAL_MODE_INVERT_RX 1 |
#define | FDSERIAL_MODE_INVERT_TX 2 |
#define | FDSERIAL_MODE_OPENDRAIN_TX 4 |
#define | FDSERIAL_MODE_IGNORE_TX_ECHO 8 |
Typedefs | |
typedef text_t | fdserial |
typedef struct fdserial_struct | fdserial_st |
Functions | |
fdserial * | fdserial_open (int rxpin, int txpin, int mode, int baudrate) |
Initializes and starts native assembly driver in a cog. More... | |
void | fdserial_close (fdserial *term) |
Stop stops the cog running the native assembly driver. | |
int | fdserial_rxCheck (fdserial *term) |
Gets a byte from the receive queue if available function does not block. More... | |
void | fdserial_rxFlush (fdserial *term) |
Empties the receive queue. | |
int | fdserial_rxReady (fdserial *term) |
Find out if a byte is ready in the receive buffer. The function does not block. More... | |
int | fdserial_rxTime (fdserial *term, int ms) |
Gets a byte from the receive queue if available by timeout function blocks if no recieve for ms timeout. More... | |
int | fdserial_rxChar (fdserial *term) |
Waits for a byte from the receive queue. blocks until somehting is ready. More... | |
int | fdserial_txChar (fdserial *term, int txbyte) |
Sends a byte on the transmit queue. More... | |
int | fdserial_txEmpty (fdserial *term) |
Find out if the tx queue is empty. More... | |
void | fdserial_txFlush (fdserial *term) |
Flush the transmit queue. | |
Full Duplex Serial adapter API definition.
#define FDSERIAL_BUFF_MASK 0x3f |
Defines buffer length. hard coded in asm driver ... s/b bigger
#define FDSERIAL_MODE_NONE 0 |
Defines mode bits mode bit 0 = invert rx mode bit 1 = invert tx mode bit 2 = open-drain/source tx mode bit 3 = ignore tx echo on rx
typedef struct fdserial_struct fdserial_st |
Defines fdserial interface struct 9 contiguous longs + buffers
fdserial* fdserial_open | ( | int | rxpin, |
int | txpin, | ||
int | mode, | ||
int | baudrate | ||
) |
Initializes and starts native assembly driver in a cog.
rxpin | is pin number for receive input |
txpin | is pin number for transmit output |
mode | is interface mode |
baudrate | is frequency of bits ... 115200, 57600, etc... |
int fdserial_rxChar | ( | fdserial * | term) |
Waits for a byte from the receive queue. blocks until somehting is ready.
int fdserial_rxCheck | ( | fdserial * | term) |
Gets a byte from the receive queue if available function does not block.
int fdserial_rxReady | ( | fdserial * | term) |
Find out if a byte is ready in the receive buffer. The function does not block.
int fdserial_rxTime | ( | fdserial * | term, |
int | ms | ||
) |
Gets a byte from the receive queue if available by timeout function blocks if no recieve for ms timeout.
ms | is number of milliseconds to wait for a char |
int fdserial_txChar | ( | fdserial * | term, |
int | txbyte | ||
) |
Sends a byte on the transmit queue.
txbyte | is byte to send. |
int fdserial_txEmpty | ( | fdserial * | term) |
Find out if the tx queue is empty.