mBed RFM12B module library
Fork of RF12B by
RFM12B Library
The main purpose of this library was to implement the RFM12B module in order to be able to establish communication with the Moteino (arduino clone that uses the RFM12B).
In order to achieve my goal I was highly inspired by RF12B library from pangsk https://mbed.org/users/pangsk/ and by RFM12B arduino library made by Felix Rusu (http://lowpowerlab.com/blog/2012/12/28/rfm12b-arduino-library/)
Who/What is Moteino? (http://lowpowerlab.com/moteino/)
Diff: RF12B.h
- Revision:
- 5:12d8175359f2
- Parent:
- 4:cd581c12a4b9
--- a/RF12B.h Tue Feb 28 10:53:46 2012 +0000 +++ b/RF12B.h Tue Mar 13 10:21:46 2012 +0000 @@ -25,7 +25,12 @@ #define RF12_WANTS_ACK ((rf12_hdr & RF12_HDR_ACK) && !(rf12_hdr & RF12_HDR_CTL)) #define RF12_ACK_REPLY (rf12_hdr & RF12_HDR_DST ? RF12_HDR_CTL : \ RF12_HDR_CTL | RF12_HDR_DST | (rf12_hdr & RF12_HDR_MASK)) - + +// New for mbed +#define RF12_WANTS_ACK_MBED ((radiolink.get_hdr() & RF12_HDR_ACK) && !(radiolink.get_hdr() & RF12_HDR_CTL)) +#define RF12_ACK_REPLY_MBED (radiolink.get_hdr() & RF12_HDR_DST ? RF12_HDR_CTL : \ + RF12_HDR_CTL | RF12_HDR_DST | (radiolink.get_hdr() & RF12_HDR_MASK)) + //enum rfmode_t{RX, TX}; @@ -52,6 +57,7 @@ uint16_t check_crc(void); uint8_t length(void); uint8_t* get_data(void); + uint8_t get_hdr(void); protected: