2021-04-23 01:00 AM
Hi,
S2LPRadioGetSymClkRecoverInfo code should be like this (Fast Gain are located in tmpBuffer[1] and nottmpBuffer[ 0]).
/**
* @brief Return the clock recovery configuration
* @param xSSymClkRecInit pointer to the clock recovery struct to be filled with the clock recovery settings of the chip.
* @retval None.
*/
void S2LPRadioGetSymClkRecoverInfo(CRF_TRX_S2LP_HandleTypeDef* handle, SSymClkRecInit* xSSymClkRecInit)
{
uint8_t tmpBuffer[2];
S2LPSpiReadRegisters(handle, CLOCKREC1_ADDR, 2, tmpBuffer);
xSSymClkRecInit->xSClkRecMode = (SClkRecMode)((tmpBuffer[0]&CLK_REC_ALGO_SEL_REGMASK)>>4);
xSSymClkRecInit->cClkRecIGainSlow = tmpBuffer[0]&CLK_REC_I_GAIN_SLOW_REGMASK;
xSSymClkRecInit->cClkRecPGainSlow = (tmpBuffer[0]&CLK_REC_P_GAIN_SLOW_REGMASK)>>5;
xSSymClkRecInit->cClkRec16SymPostFlt = (SFunctionalState)((tmpBuffer[1]&CLK_REC_ALGO_SEL_REGMASK)>>4);
xSSymClkRecInit->cClkRecIGainFast = tmpBuffer[1]&CLK_REC_I_GAIN_FAST_REGMASK;
xSSymClkRecInit->cClkRecPGainFast = (tmpBuffer[1]&CLK_REC_P_GAIN_FAST_REGMASK)>>5;
}