Tool/software: Code Composer Studio
Hello,
I'm working on CC1310 Launchpad and follows the rfPacketRx example. I modify the code to get I/Q samples following official tutorial and it works well. Now, I would like to do continuous Rx and get I/Q samples continuously. However, I found that the I/Q sample buffering is handled by RF_EventRxEntryDone Event mask and its corresponding callback function. If I would like to do continuous Rx, I would have to use RF_cmdRxTest Command instead of RF_cmdPropRx Command in RF_runCmd.
Original RF thread code when doing I/Q sample raw data record:
/* Request access to the radio */ rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams); /* Set the frequency */ RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0); /* Enter RX mode and stay forever in RX */ RF_EventMask terminationReason = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropRx, RF_PriorityNormal, &callback, RF_EventRxEntryDone);
I/Q sample buffer callback:
void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e) { if (e & RF_EventRxEntryDone) { /* Toggle pin to indicate RX */ PIN_setOutputValue(ledPinHandle, Board_PIN_LED2, !PIN_getOutputValue(Board_PIN_LED2)); packetDataPointer = ¤tReadEntry->rxData; //--------------------------------------------------------------------------- // Implement code for handling the IQ data uint16_t i; // IQ Sample Handling for (i = index; i < (NUMBER_OF_SAMPLE_PAIRS + index); i++) { iSamples[i] = (((*(packetDataPointer + 1)) << 8) | (*packetDataPointer)) & 0x0FFF; qSamples[i] = (((*(packetDataPointer + 2)) << 8) | (*(packetDataPointer + 1))) >> 4; packetDataPointer += 3; } if (index == (NUMBER_OF_SAMPLE_PAIRS*NUMBER_OF_BUFFERS)) { index = 0; } //--------------------------------------------------------------------------- currentReadEntry->status = DATA_ENTRY_PENDING; currentReadEntry = (rfc_dataEntryPartial_t*)currentReadEntry->pNextEntry; index += NUMBER_OF_SAMPLE_PAIRS;
Is it doable to buffer I/Q samples on continuous Rx mode? If so, which event mask should I use?
Thank you so much!