Commit fa0aaad8 authored by Federico Vaga's avatar Federico Vaga

lib [temporary]: add zio_control device attribute enumeration

This patch is temporary at it should be reverted in the future when a
better alternative is ready
Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 92301b9c
......@@ -227,6 +227,10 @@ enum fa_trig_ext_attributes {
* The trigger extended attribute order is the same in the declaration
* and in the zio_control, so we can always use enumeration. But, the
* enumeration must start with 0 followed by only consecutive value.
*
* NOTE: this values are temporary copied also in the userspace
* library, so if you change the order you have to fix also the
* library header.
*/
ZFAT_ATTR_EXT = 0,
ZFAT_ATTR_POL,
......@@ -248,6 +252,9 @@ enum fa_dev_ext_attributes {
* NOTE: At the moment the only extended attributes we have in
* the device hierarchy are in the cset level, so we can safely
* start from index 0
* NOTE: this values are temporary copied also in the userspace
* library, so if you change the order you have to fix also the
* library header.
*/
ZFAD_ATTR_DECI = 0,
ZFAD_ATTR_CH0_OFFSET,
......
/*
* The ADC library for the specific card
*
* Copyright (C) 2014 CERN (www.cern.ch)
* Author: Federico Vaga <federico.vaga@cern.ch>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2 as published by the Free Software Foundation or, at your
* option, any later version.
*/
#ifndef FMCA_ADC_100MA4B4CHA_H_
#define FMCA_ADC_100MA4B4CHA_H_
/*
* Trigger Extended Attribute Enumeration
*/
enum fa_trig_ext_attributes {
/*
* The trigger extended attribute order is the same in the declaration
* and in the zio_control, so we can always use enumeration. But, the
* enumeration must start with 0 followed by only consecutive value.
*
* NOTE: this values are temporary copied from the adc driver, so
* do not change this enum
*/
ZFAT_ATTR_EXT = 0,
ZFAT_ATTR_POL,
ZFAT_ATTR_INT_CHAN,
ZFAT_ATTR_INT_THRES,
ZFAT_ATTR_DELAY,
};
/*
* Device Extended Attribute Enumeration
*/
enum fa_dev_ext_attributes {
/*
* NOTE: At the moment the only extended attributes we have in
* the device hierarchy are in the cset level, so we can safely
* start from index 0
* NOTE: this values are temporary copied from the adc driver, so
* do not change this enum
*/
ZFAD_ATTR_DECI = 0,
ZFAD_ATTR_CH0_OFFSET,
ZFAD_ATTR_CH1_OFFSET,
ZFAD_ATTR_CH2_OFFSET,
ZFAD_ATTR_CH3_OFFSET,
ZFAD_ATTR_CH0_VREF,
ZFAD_ATTR_CH1_VREF,
ZFAD_ATTR_CH2_VREF,
ZFAD_ATTR_CH3_VREF,
ZFAD_ATTR_CH0_50TERM,
ZFAD_ATTR_CH1_50TERM,
ZFAD_ATTR_CH2_50TERM,
ZFAD_ATTR_CH3_50TERM,
ZFAD_ATTR_ACQ_START_S,
ZFAD_ATTR_ACQ_START_C,
ZFAD_ATTR_ACQ_START_F,
};
#endif /* FMCA_ADC_100MA4B4CHA_H_ */
......@@ -24,6 +24,7 @@
#include <linux/zio-user.h>
#include <fmcadc-lib.h>
#include <fmc-adc-100m14b4cha.h>
static void fald_help()
{
......@@ -630,8 +631,8 @@ int main(int argc, char *argv[])
/* FIXME adc-lib should provide enums to retrive
* attributes values */
fprintf(stderr, "Acquisition started at secs:%u ticks:%u\n",
ctrl->attr_channel.ext_val[13],
ctrl->attr_channel.ext_val[14]);
ctrl->attr_channel.ext_val[ZFAD_ATTR_ACQ_START_S],
ctrl->attr_channel.ext_val[ZFAD_ATTR_ACQ_START_C]);
fprintf(stderr, "Read %d samples from shot %i/%i secs:%lld ticks:%lld (loop: %d)\n",
ctrl->nsamples,
i + 1, acq_cfg.value[FMCADC_CONF_ACQ_N_SHOTS],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment