![]() |
fdserial library
v0.86
Functions for connecting with full duplex serial devices
|
Functions | |
fdserial * | fdserial_open (int rxpin, int txpin, int mode, int baudrate) |
Open a full duplex serial connection. | |
void | fdserial_close (fdserial *term) |
Stop stops the cog running the native assembly driver. | |
int | fdserial_txEmpty (fdserial *term) |
Check if the transmit buffer is empty. | |
int | fdserial_rxCheck (fdserial *term) |
Gets a byte from the receive buffer if available, but does not wait if there's nothing in the buffer. | |
int | fdserial_rxChar (fdserial *term) |
Get a byte from the receive buffer, or if it's emtpy, wait until a byte is received. | |
int | fdserial_txChar (fdserial *term, int txbyte) |
Send a byte by adding it to the transmit buffer. |
Full Duplex Serial adapter module.
Copyright (c) 2008-2013, Steve Denson See end of file for terms of use.
void fdserial_close | ( | fdserial * | term | ) |
Stop stops the cog running the native assembly driver.
*term | Device ID returned by fdserial_open. |
fdserial* fdserial_open | ( | int | rxpin, |
int | txpin, | ||
int | mode, | ||
int | baudrate | ||
) |
Open a full duplex serial connection.
rxpin | Serial receive input pin number. |
txpin | Serial transmit output pin number. |
mode | Set/clear bits to define mode: 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 |
baudrate | Rate binary values are transmitted, like 115200, 57600,..., 9600 etc. |
int fdserial_rxChar | ( | fdserial * | term | ) |
Get a byte from the receive buffer, or if it's emtpy, wait until a byte is received.
*term | Device ID returned by fdserial_open. |
Oldest byte (0 to 255) in receive buffer
int fdserial_rxCheck | ( | fdserial * | term | ) |
Gets a byte from the receive buffer if available, but does not wait if there's nothing in the buffer.
*term | Device ID returned by fdserial_open. |
int fdserial_txChar | ( | fdserial * | term, |
int | txbyte | ||
) |
Send a byte by adding it to the transmit buffer.
*term | Device ID returned by fdserial_open. |
txbyte | is byte to send. |
int fdserial_txEmpty | ( | fdserial * | term | ) |
Check if the transmit buffer is empty.
*term | Device ID returned by fdserial_open. |