Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed ESC SR04 TSI
com/com.h
- Committer:
- dereklmc
- Date:
- 2013-06-09
- Revision:
- 30:17297295ce0c
- Parent:
- 16:5f736b955d53
File content as of revision 30:17297295ce0c:
/******************************* com.h ***********************************/
/* Version: 1.0 */
/* Last Updated: June 1, 2013 */
/*************************************************************************/
#ifndef COM_H
#define COM_H
#include "mbed.h"
#include "queue.h"
class com
{
public:
com( PinName, PinName ); // Setup the com serial port. (tx, rx)
bool isData(); // Is there data to be read?
void write( char ); // Write to the port.
char * read(); // Read from the queue.
private:
void callback(); // Handle the interrupts.
void packetBuilder(); // Called by callback to place commandes into the queue.
char buffer[50]; // Buffer for holding serial data.
int bLength; // Location in the buffer to place next data.
Serial xbee; // tx - DIN, rx - DOUT
queue *readBuffer; // queue of commands ready to be read.
};
#endif
