Example #1
0
/**
 * Sets default configuration
 * @return
 */
int acq_SetDefault() {
    ECHECK(acq_SetChannelThreshold(RP_CH_1, 0.0));
    ECHECK(acq_SetChannelThreshold(RP_CH_2, 0.0));
    ECHECK(acq_SetChannelThresholdHyst(RP_CH_1, 0.0));
    ECHECK(acq_SetChannelThresholdHyst(RP_CH_2, 0.0));

    ECHECK(acq_SetGain(RP_CH_1, RP_LOW));
    ECHECK(acq_SetGain(RP_CH_2, RP_LOW));
    ECHECK(acq_SetDecimation(RP_DEC_1));
    ECHECK(acq_SetSamplingRate(RP_SMP_125M));
    ECHECK(acq_SetAveraging(true));
    ECHECK(acq_SetTriggerSrc(RP_TRIG_SRC_DISABLED));
    ECHECK(acq_SetTriggerDelay(0, false));
    ECHECK(acq_SetTriggerDelayNs(0, false));

    return RP_OK;
}
Example #2
0
int acq_SetSamplingRate(rp_acq_sampling_rate_t sampling_rate)
{
    switch (sampling_rate) {
    case RP_SMP_125M:      return acq_SetDecimation(RP_DEC_1);
    case RP_SMP_15_625M:   return acq_SetDecimation(RP_DEC_8);
    case RP_SMP_1_953M:    return acq_SetDecimation(RP_DEC_64);
    case RP_SMP_122_070K:  return acq_SetDecimation(RP_DEC_1024);
    case RP_SMP_15_258K:   return acq_SetDecimation(RP_DEC_8192);
    case RP_SMP_1_907K:    return acq_SetDecimation(RP_DEC_65536);
    default:
        return RP_EOOR;
    }
}