XBee Firmware Library
1.6.0
|
Functions | |
int | xbee_ser_baudrate (xbee_serial_t *serial, uint32_t baudrate) |
Change the baud rate of XBee serial port serial to baudrate bits/second. More... | |
int | xbee_ser_break (xbee_serial_t *serial, bool_t enabled) |
Disable the serial transmit pin and pull it low to send a break to the XBee serial port. More... | |
int | xbee_ser_close (xbee_serial_t *serial) |
Close the serial port attached to XBee serial port serial. More... | |
int | xbee_ser_flowcontrol (xbee_serial_t *serial, bool_t enabled) |
Enable or disable hardware flow control (CTS/RTS) on the serial port for XBee serial port serial. More... | |
int | xbee_ser_get_cts (xbee_serial_t *serial) |
Read the status of the /CTS (clear to send) pin on the serial port connected to XBee serial port serial. More... | |
int | xbee_ser_getchar (xbee_serial_t *serial) |
Reads a single character from the XBee serial port serial. More... | |
XBEE_BEGIN_DECLS bool_t | xbee_ser_invalid (xbee_serial_t *serial) |
Helper function used by other xbee_serial functions to validate the serial parameter. More... | |
int | xbee_ser_open (xbee_serial_t *serial, uint32_t baudrate) |
Opens the serial port connected to XBee serial port serial at baudrate bits/second. More... | |
const char * | xbee_ser_portname (xbee_serial_t *serial) |
Returns a human-readable string describing the serial port. More... | |
int | xbee_ser_putchar (xbee_serial_t *serial, uint8_t ch) |
Transmits a single character, ch, to the XBee serial port serial. More... | |
int | xbee_ser_read (xbee_serial_t *serial, void FAR *buffer, int bufsize) |
Reads up to bufsize bytes from XBee serial port serial and into buffer. More... | |
int | xbee_ser_rx_flush (xbee_serial_t *serial) |
Deletes all characters in the serial receive buffer for XBee serial port serial. More... | |
int | xbee_ser_rx_free (xbee_serial_t *serial) |
Returns the number of bytes of unused space in the serial receive buffer for XBee serial port serial. More... | |
int | xbee_ser_rx_used (xbee_serial_t *serial) |
Returns the number of queued bytes in the serial receive buffer for XBee serial port serial. More... | |
int | xbee_ser_set_rts (xbee_serial_t *serial, bool_t asserted) |
Disable hardware flow control and manually set the RTS (ready to send) pin on the XBee device's serial port. More... | |
int | xbee_ser_tx_flush (xbee_serial_t *serial) |
Flushes (i.e., deletes and does not transmit) characters in the serial transmit buffer for XBee serial port serial. More... | |
int | xbee_ser_tx_free (xbee_serial_t *serial) |
Returns the number of bytes of unused space in the serial transmit buffer for XBee serial port serial. More... | |
int | xbee_ser_tx_used (xbee_serial_t *serial) |
Returns the number of queued bytes in the serial transmit buffer for XBee serial port serial. More... | |
int | xbee_ser_write (xbee_serial_t *serial, const void FAR *buffer, int length) |
Transmits length bytes from buffer to the XBee serial port serial. More... | |
Platform-specific layer provieds a consistent serial API to upper layers of the driver.
This platform-specific layer maps a consistent serial API for the upper levels of the driver to the device's native serial API (e.g., serXread/serXwrite on the Rabbit, opening a COM port on a Windows PC).
User code will not typically call these functions, unless they are not making use of the higher layers of the driver.
Note that we may need some additional functions to support firmware updates. The firmware update code typically needs to be able to open the serial port at different baud rates, send a break on the Tx pin and control the reset pin.