Radio Structures in OOP

Dependencies:   mbed mbed-rtos

drivers/CC1101/CC1101.h

Committer:
jjones646
Date:
2014-12-28
Revision:
2:7d523bdd2f50
Child:
3:dc7e9c6bc26c

File content as of revision 2:7d523bdd2f50:

#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