Beispiel #1
0
int acq_SetDecimation(rp_acq_decimation_t decimation)
{
    int64_t time_ns = 0;

    if (triggerDelayInNs) {
        acq_GetTriggerDelayNs(&time_ns);
    }

    switch (decimation) {
    case RP_DEC_1:     osc_SetDecimation(DEC_1);     break;
    case RP_DEC_8:     osc_SetDecimation(DEC_8);     break;
    case RP_DEC_64:    osc_SetDecimation(DEC_64);    break;
    case RP_DEC_1024:  osc_SetDecimation(DEC_1024);  break;
    case RP_DEC_8192:  osc_SetDecimation(DEC_8192);  break;
    case RP_DEC_65536: osc_SetDecimation(DEC_65536); break;
    default:
        return RP_EOOR;
    }

    // Now update trigger delay based on new decimation
    if (triggerDelayInNs) {
        acq_SetTriggerDelayNs(time_ns, true);
    }

    return RP_OK;
}
Beispiel #2
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;
}