Jonathan Jones
/
Radios
Radio Structures in OOP
Diff: drivers/CC1101/CC1101.cpp
- Revision:
- 2:7d523bdd2f50
- Child:
- 3:dc7e9c6bc26c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/drivers/CC1101/CC1101.cpp Sun Dec 28 06:05:17 2014 +0000 @@ -0,0 +1,84 @@ +#include "CC1101.h" + + +// Default constructor +CC1101::CC1101() : +CommLink() +{ + // [] - 1 - Initialize the CC1101 radio transceiver for operation + + // [] - 2 - Test the interrupt pin for proper operation + + // [] - 3 - Check the CC1101's version register to ensure the chip is what we believe it to be + + // [] - 4 - Set the base class's `_isInit` variable to true if all checks are passed +} + + +// Deconstructor +CC1101::~CC1101() +{ + +} + + +bool CC1101::isConnected(void) +{ + // [] - 1 - Perform a check to ensure the CC1101 can provide communication with a secondary base station link + // Note: This does not necessarily mean the link must be reliable, this only needs to determine: `Can the perheripial provide communication?` + + // [] - 2 - Return true/false for indicating a connected communication link + + return true; +} + + +uint32_t CC1101::reset(void) +{ + // [] - 1 - Perform a soft reset for the CC1101 transceiver + + // [] - 2 - Return any error codes if necessary + + return 1; +} + + +uint32_t CC1101::selfTest(void) +{ + // [] - 1 - Perform a self test for the CC1101 radio transceiver + + // [] - 2 - Return any error codes if necessary + + return 1; +} + + +uint32_t CC1101::sendPacket(RTP_t* p) +{ + // [] - 1 - Read a packet from the txQueue + + // [] - 2 - Send the packet to the CC1101 in proper format + + // [] - 3 - Set the CC1101 to begin transmitting the data + + // [] - 4 - Return any error codes if necessary + + return 1; +} + +// * The receivePacket method must account for being called from an interrupt trigger * +uint32_t CC1101::receivePacket(void) +{ + // [] - 1 - Read in received data from the CC1101 + + // [] - 2 - Decipher the RTP packet and place it in the passed RTP_t* p pointer's data structure + + // [] - 3 - Add the packet to the base class (CommLink) rxQueue + + // [] - 4 - Ensure that the base class is informed of this newly received packet + + // [] - 3 - Return any error codes if necessary + + return 1; +} +