fdserial library v0.85 Functions for connecting with full duplex serial devices

- Main Page
- Data Structures
- Files

- File List
- Globals

Functions
fdserial.c File Reference
`#include <stdlib.h>`
`#include "fdserial.h"`

## 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_txEmpty (fdserial *term)
| Find out if the tx queue is empty. More...
int | fdserial_rxCheck (fdserial *term)
| Gets a byte from the receive queue if available function does not block. 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...

## Detailed Description

Full Duplex Serial adapter module.

Copyright (c) 2008-2013, Steve Denson See end of file for terms of use.

## Function Documentation

fdserial* fdserial_open | ( | int | rxpin,
|  | int | txpin,
|  | int | mode,
|  | int | baudrate
| ) |  |

Initializes and starts native assembly driver in a cog.

Parameters

  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...

Returns
  non-zero on success

int fdserial_rxChar | ( | fdserial * | term) |  |

Waits for a byte from the receive queue. blocks until somehting is ready.

Returns
  received byte.

int fdserial_rxCheck | ( | fdserial * | term) |  |

Gets a byte from the receive queue if available function does not block.

Returns
  receive byte 0 to 0xff or -1 if none available

int fdserial_txChar | ( | fdserial * | term,
|  | int | txbyte
| ) |  |

Sends a byte on the transmit queue.

Parameters

  txbyte | is byte to send.

Returns
  waits for and returns received byte if mode is 8

int fdserial_txEmpty | ( | fdserial * | term) |  |

Find out if the tx queue is empty.

Returns
  non-zero if tx buffer is empty.