Derek McLean / Mbed 2 deprecated uwb-quadcopter

Dependencies:   mbed ESC SR04 TSI

Revision:
16:5f736b955d53
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/com/com.h	Thu Jun 06 00:18:29 2013 +0000
@@ -0,0 +1,30 @@
+/******************************* 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
\ No newline at end of file