Jonathan Jones
/
Radios
Radio Structures in OOP
Diff: drivers/CC1101/CC1101.h
- Revision:
- 2:7d523bdd2f50
- Child:
- 3:dc7e9c6bc26c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/drivers/CC1101/CC1101.h Sun Dec 28 06:05:17 2014 +0000 @@ -0,0 +1,47 @@ +#ifndef CC1101_RADIO_H +#define CC1101_RADIO_H + +#include "mbed.h" +#include "CommLink.h" +#include "cmsis_os.h" +#include "RTP.h" +#include "ThreadHelper.h" + +class CC1101 : public CommLink +{ +public: + // Default constructor + CC1101(); + + // Deconstructor + virtual ~CC1101(); + + // These must have implementations in the CC1101 class since it is a derived class of the base class CommLink + virtual uint32_t sendPacket(RTP_t*); + virtual uint32_t receivePacket(void); + virtual uint32_t reset(void); + virtual uint32_t selfTest(void); + virtual bool isConnected(void); + + // Set the chip's operating channel + void channel(uint16_t); + + // Set the chip's datarate (baudrate) + void datarate(uint16_6); + + // Used for assigning a tasks that will run when the interrupt pin is triggered + // void set_interrupt_callback(void(*cb)(void)); + +protected: + // The NOP command used to get the CC1101's status byte + uint8_t status(void); + +private: + // Flush chip's rx/tx buffers + void flushRx(void); + void flushTx(void); + +}; + +#endif // CC1101_RADIO_H +