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/)
Revision 3:e926e54424cb, committed 2012-02-28
- Comitter:
- pangsk
- Date:
- Tue Feb 28 10:40:30 2012 +0000
- Parent:
- 2:cfeb4c9cdbe3
- Child:
- 4:cd581c12a4b9
- Commit message:
- Remove debugs
Changed in this revision
RF12B.cpp | Show annotated file Show diff for this revision Revisions of this file |
RF12B.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/RF12B.cpp Mon Jan 30 21:43:24 2012 +0000 +++ b/RF12B.cpp Tue Feb 28 10:40:30 2012 +0000 @@ -35,16 +35,15 @@ TXPRE1, TXPRE2, TXPRE3, TXSYN1, TXSYN2, }; -DigitalOut rfled(LED3); -DigitalOut t1(p5); -DigitalOut t2(p6); +//DigitalOut rfled(LED3); + RF12B::RF12B(PinName _SDI, PinName _SDO, PinName _SCK, PinName _NCS, PinName _NIRQ):spi(_SDI, _SDO, _SCK), - NCS(_NCS), NIRQ(_NIRQ), NIRQ_in(_NIRQ), rfled(LED3),t1(p5),t2(p6) { + NCS(_NCS), NIRQ(_NIRQ), NIRQ_in(_NIRQ) { /* SPI frequency, word lenght, polarity and phase */ spi.format(8,0); @@ -95,7 +94,7 @@ rxstate = TXIDLE; - rfled = 0; + } /* Write a command to the RF Module */
--- a/RF12B.h Mon Jan 30 21:43:24 2012 +0000 +++ b/RF12B.h Tue Feb 28 10:40:30 2012 +0000 @@ -60,9 +60,7 @@ DigitalOut NCS; InterruptIn NIRQ; DigitalIn NIRQ_in; - DigitalOut rfled; - DigitalOut t1; - DigitalOut t2; + volatile uint16_t rf12_crc; // running crc value volatile unsigned char rf12_buf[RF_MAX]; // recv/xmit buf, including hdr & crc bytes volatile uint8_t nodeid; // address of this node