xbee communication for UWB quadcopter project Originally by Greg Abdo Forking to reduce impact of interrupt by moving packetbuilder out of the interrupt and letting be handled in the main loop

Fork of com by Prosper Van

Committer:
oprospero
Date:
Sun Nov 02 19:18:11 2014 +0000
Revision:
22:0e8e22f161ff
Parent:
21:117e01fc0373
Clean up

Who changed what in which revision?

UserRevisionLine numberNew contents of line
oprospero 0:26a151d2c6db 1 #ifndef COM_H
oprospero 0:26a151d2c6db 2 #define COM_H
oprospero 17:acef0fb07510 3
oprospero 0:26a151d2c6db 4
oprospero 0:26a151d2c6db 5 #include "mbed.h"
oprospero 0:26a151d2c6db 6 #include "queue.h"
oprospero 17:acef0fb07510 7 #include "queueChar.h"
oprospero 13:2fb7b19dcd70 8
oprospero 17:acef0fb07510 9 int const BAUDRATE = 38400;
oprospero 0:26a151d2c6db 10
oprospero 0:26a151d2c6db 11 class com
oprospero 17:acef0fb07510 12 {
oprospero 17:acef0fb07510 13 public:
oprospero 17:acef0fb07510 14 com(PinName, PinName);
oprospero 17:acef0fb07510 15 ~com();
oprospero 17:acef0fb07510 16 short * read();
oprospero 17:acef0fb07510 17 bool isData();
oprospero 17:acef0fb07510 18 bool rdy2ack();
oprospero 17:acef0fb07510 19 void sendACK();
oprospero 17:acef0fb07510 20 void write(short,short);
oprospero 19:dc9d18037565 21 void print(char*);
oprospero 17:acef0fb07510 22
oprospero 17:acef0fb07510 23
oprospero 17:acef0fb07510 24 private:
oprospero 17:acef0fb07510 25 Serial xbee;
oprospero 21:117e01fc0373 26 // Serial xbtx;
oprospero 17:acef0fb07510 27 queue cmdBuffer;
oprospero 17:acef0fb07510 28 queue txBuffer;
oprospero 17:acef0fb07510 29 queueChar rxBuffer;
oprospero 17:acef0fb07510 30 void callback();
oprospero 1:4f53de75bc96 31
oprospero 0:26a151d2c6db 32 };
oprospero 0:26a151d2c6db 33
oprospero 0:26a151d2c6db 34 #endif