Platform/ECM3532/M3/hw/csp/ecm3532/m3/csp/src/eta_csp_hfo.c
/***************************************************************************/
/**
 *
 *  FreqGet - Get frequency after averaging over N samples.
 *
 *  @param ui32NumSamples is the number of samples to average over.
 *  @return Return the computed frequency.
 *
 ******************************************************************************/
Get frequency after averaging over N samples.
@param ui32NumSamples is the number of samples to average over.
@return Return the computed frequency.
Get frequency after averaging over N samples . @param ui32NumSamples is the number of samples to average over . @return Return the computed frequency .
static uint32_t
FreqGet(uint32_t ui32NumSamples)
{
    uint32_t ui32StartFlag, ui32Count, ui32I;
    ui32Count = 0;
    ui32StartFlag = REG_GPIO_HFO_FREQ.BF.FLAG;
    while(ui32StartFlag == REG_GPIO_HFO_FREQ.BF.FLAG) {  };
    for( ui32I=0; ui32I<ui32NumSamples; ui32I++) {
        while(ui32StartFlag != REG_GPIO_HFO_FREQ.BF.FLAG) {  };
        ui32StartFlag = !ui32StartFlag;
        ui32Count += MEMIO16(REG_GPIO_HFO_FREQ_ADDR) & BM_GPIO_HFO_FREQ_COUNT;
    }
    return(ui32Count / ui32NumSamples);
}
static uint32_t FreqGet ( uint32_t ui32NumSamples ) { uint32_t ui32StartFlag , ui32Count , ui32I ; ui32Count = 0 ; ui32StartFlag = REG_GPIO_HFO_FREQ . BF . FLAG ; while ( ui32StartFlag == REG_GPIO_HFO_FREQ . BF . FLAG ) { } ; for ( ui32I = 0 ; ui32I < ui32NumSamples ; ui32I ++ ) { while ( ui32StartFlag != REG_GPIO_HFO_FREQ . BF . FLAG ) { } ; ui32StartFlag = ! ui32StartFlag ; ui32Count += MEMIO16 ( REG_GPIO_HFO_FREQ_ADDR ) & BM_GPIO_HFO_FREQ_COUNT ; } return ( ui32Count / ui32NumSamples ) ; }
FreqGet - Get frequency after averaging over N samples.
FreqGet - Get frequency after averaging over N samples .
// Wait for start of measurement period /* wait */ // Wait for measurement period to complete /* wait */ // Collect frequency measurement // Return the frequency.