Files | Functions
Extended Serial Communication

Special operations for serial communication with SPiCboards. More...

## Files
file | com_ext.h

## Functions
int8_t | sb_com_setBaud (uint32_t baud)
| Set the baud rate (transmission frequence) More...
uint8_t | sb_com_hasReceivedItem ()
| Check if there is a new byte item in the receive buffer. More...

## Detailed Description

Special operations for serial communication with SPiCboards.

See also
  com_ext.h

### Function Documentation

uint8_t sb_com_hasReceivedItem | ( |  | ) |

Check if there is a new byte item in the receive buffer.

This method provides information if the next item has been received and

In other words, a positive answer ensures that a call to sb_com_receiveByte() would return within the usual processing time (without the need to wait for the other communication end point to begin transmission).

Return values

  1 | there is one item to receive
  0 | currently no item to receive, would have to wait

int8_t sb_com_setBaud | ( | uint32_t | baud | ) |

Set the baud rate (transmission frequence)

The baud rate is the number of symbols to be transfered within one second. Hence this defines the transmission interval for a single symbol:

Warning
  In case your connection is instable you should propably consider a lower frequency!

Parameters

  baud | the desired baud rate

Return values

  4 | using CPU frequency/1024 for timer
  3 | using CPU frequency/256 for timer
  2 | using CPU frequency/64 for timer
  1 | using CPU frequency/8 for timer
  0 | using CPU frequency for timer
  -1 | baud rate too high
  -2 | baud rate too low
  -3 | setting baud rate not supported (default BAUD_RATE is used)