Working lib for qq v2
Diff: RF12B.h
- Revision:
- 1:09e016eea608
- Parent:
- 0:048b717be6c0
--- a/RF12B.h Fri Mar 11 18:02:05 2011 +0000 +++ b/RF12B.h Wed Feb 08 16:51:49 2012 +0000 @@ -4,8 +4,6 @@ #include "mbed.h" #include <queue> -#define PACKET_LEN 16 - enum rfmode_t{RX, TX}; class RF12B { @@ -28,9 +26,8 @@ /* Transmits a packet of data */ void write(unsigned char* data, unsigned char length); - - /* Transmits a 1-byte packet of data */ - void write(unsigned char data); + void write(unsigned char data); /* 1-byte packet */ + void write(queue<char> &data, int length = -1); /* sends a whole queue */ /* Returns the packet length if data is available in the receive buffer, 0 otherwise*/ unsigned int available(); @@ -47,6 +44,8 @@ InterruptIn NIRQ; DigitalIn NIRQ_in; DigitalOut rfled; + + rfmode_t mode; /* Initialises the RF12B module */ void init();