Esempio n. 1
0
int acq_SetTriggerHyst(float voltage)
{
    if ((last_trig_src == RP_TRIG_SRC_CHA_PE) || (last_trig_src == RP_TRIG_SRC_CHA_NE)) {
        ECHECK(acq_SetChannelThresholdHyst(RP_CH_1, voltage));
    } else if ((last_trig_src == RP_TRIG_SRC_CHB_PE) || (last_trig_src == RP_TRIG_SRC_CHB_NE)) {
        ECHECK(acq_SetChannelThresholdHyst(RP_CH_2, voltage));
    }
    return RP_OK;
}
Esempio n. 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;
}
Esempio n. 3
0
int acq_SetGain(rp_channel_t channel, rp_pinState_t state)
{

    rp_pinState_t *gain = NULL;

    if (channel == RP_CH_1) {
        gain = &gain_ch_a;
    }

    else {
        gain = &gain_ch_b;
    }

    // Read old values which are dependent on the gain...
    rp_pinState_t old_gain;
    float ch_thr, ch_hyst;
    old_gain = *gain;
    ECHECK(acq_GetChannelThreshold(channel, &ch_thr));
    ECHECK(acq_GetChannelThresholdHyst(channel, &ch_hyst));

    // Now update the gain
    *gain = state;

    // And recalculate new values...
    int status = acq_SetChannelThreshold(channel, ch_thr);
    if (status == RP_OK) {
        status = acq_SetChannelThresholdHyst(channel, ch_hyst);
    }

    // In case of an error, put old values back and report the error
    if (status != RP_OK) {
        *gain = old_gain;
        acq_SetChannelThreshold(channel, ch_thr);
        acq_SetChannelThresholdHyst(channel, ch_hyst);
    }
    // At the end if everything is ok, update also equalization filters based on the new gain.
    // Updating eq filters should never fail...
    else {
        status = setEqFilters(channel);
    }

    return status;
}
Esempio n. 4
0
int acq_SetTriggerHyst(float voltage)
{
    ECHECK(acq_SetChannelThresholdHyst(RP_CH_1, voltage));
    ECHECK(acq_SetChannelThresholdHyst(RP_CH_2, voltage));
    return RP_OK;
}