I find this function in the example cc112x_easy_link, and its specific location is in cc112x_spi.c. But I am puzzled with its exactly meaning even though I have read through the annotation and the function body. Can anyone helps explain it to me? Here is the code body. THX. :)
* @fn cc112xSpiReadReg * * @brief Read value(s) from config/status/extended radio register(s). * If len = 1: Reads a single register * if len != 1: Reads len register values in burst mode * * input parameters * * @param addr - address of first register to read * @param *pData - pointer to data array where read bytes are saved * @param len - number of bytes to read * * output parameters * * @return rfStatus_t */ rfStatus_t cc112xSpiReadReg(uint16 addr, uint8 *pData, uint8 len) { uint8 tempExt = (uint8)(addr>>8); uint8 tempAddr = (uint8)(addr & 0x00FF); uint8 rc; /* Checking if this is a FIFO access -> returns chip not ready */ if((CC112X_SINGLE_TXFIFO<=tempAddr)&&(tempExt==0)) return STATUS_CHIP_RDYn_BM; /* Decide what register space is accessed */ if(!tempExt) { rc = trx8BitRegAccess((RADIO_BURST_ACCESS|RADIO_READ_ACCESS),tempAddr,pData,len); } else if (tempExt == 0x2F) { rc = trx16BitRegAccess((RADIO_BURST_ACCESS|RADIO_READ_ACCESS),tempExt,tempAddr,pData,len); } return (rc); }