Пример #1
0
int acq_GetChannelThresholdHyst(rp_channel_t channel, float* voltage)
{
    float gainV;
    rp_pinState_t gain;
    uint32_t cnts;

    if (channel == RP_CH_1) {
        ECHECK(osc_GetHysteresisChA(&cnts));
    }
    else {
        ECHECK(osc_GetHysteresisChB(&cnts));
    }

    ECHECK(acq_GetGainV(channel, &gainV));
    ECHECK(acq_GetGain(channel, &gain));

    rp_calib_params_t calib = calib_GetParams();
    int32_t dc_offs = (channel == RP_CH_1 ? calib.fe_ch1_dc_offs : calib.fe_ch2_dc_offs);
    uint32_t calibScale = calib_GetFrontEndScale(channel, gain);

    *voltage = cmn_CnvCntToV(ADC_BITS, cnts, gainV, calibScale, dc_offs, 0.0);

    return RP_OK;
}
Пример #2
0
int acq_GetChannelThresholdHyst(rp_channel_t channel, float* voltage)
{
    float gainV;
    rp_pinState_t gain;
    uint32_t cnts;

    if (channel == RP_CH_1) {
        osc_GetHysteresisChA(&cnts);
    }
    else {
        osc_GetHysteresisChB(&cnts);
    }

    acq_GetGainV(channel, &gainV);
    acq_GetGain(channel, &gain);

    rp_calib_params_t calib = calib_GetParams();
    int32_t dc_offs = GET_OFFSET(channel, gain, calib);
    uint32_t calibScale = calib_GetFrontEndScale(channel, gain);

    *voltage = cmn_CnvCntToV(ADC_BITS, cnts, gainV, calibScale, dc_offs, 0.0);

    return RP_OK;
}