English
Language : 

SDBC-DK3UG Datasheet, PDF (64/76 Pages) Silicon Laboratories – 4 buttons and 4 LEDs for custom purposes
SDBC-DK3 UG
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+ FUNCTION NAME: RF_ENUM RFIdle(void)
+ DESCRIPTION:
Sets the transceiver and the RF stack into IDLE state,
+
independently of the actual state of the RF stack.
+ RETURN:
RF_OK:
The operation was successful
+ NOTES:
+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
RF_ENUM RFIdle(void)
{
// disable transmitter and receiver
SpiRfWriteAddressData((REG_WRITE | OperatingFunctionControl1), 0x01);
// disable all ITs
SpiRfWriteAddressData((REG_WRITE | InterruptEnable1), 0x00);
SpiRfWriteAddressData((REG_WRITE | InterruptEnable2), 0x00);
// read the interrupt status registers from the radio to clear the IT flags
ItStatus1 = SpiRfReadRegister(InterruptStatus1);
ItStatus2 = SpiRfReadRegister(InterruptStatus2);
return RF_OK;
}
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+ FUNCTION NAME: RF_ENUM RFTransmit(uint8 * packet, uint8 length)
+ DESCRIPTION:
Starts packet transmission
+ INPUT:
MESSAGE structure
+ RETURN:
RF_OK:
The packet sent correctly
+
+ NOTES:
+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
RF_ENUM RFTransmit(uint8 * packet, uint8 length)
{
uint8 temp8;
// set packet length
SpiRfWriteAddressData((REG_WRITE | TransmitPacketLength), length);
for(temp8=0;temp8<length;temp8++)
{
SpiRfWriteAddressData((REG_WRITE | FIFOAccess),packet[temp8]);
}
// enable transmitter
SpiRfWriteAddressData((REG_WRITE | OperatingFunctionControl1), 0x09);
// enable the packet sent interrupt only
SpiRfWriteAddressData((REG_WRITE | InterruptEnable1), 0x04);
// read interrupt status registers
ItStatus1 = SpiRfReadRegister(InterruptStatus1);
64
Rev. 0.4