Commit cf84af6e authored by Federico Vaga's avatar Federico Vaga

*: add voltage ranges for ADC100M14b4CHA

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent a20673aa
......@@ -255,6 +255,10 @@ since the specifc parameters for this card are global, so there is no need for
any routing mechanism.
Following some special values defined for this board.
.. doxygenenum:: adc_configuration_100m14b4cha_channel_range
Acquisition
-----------
......
......@@ -23,6 +23,16 @@ extern "C" {
#include "adc-lib.h"
/**
* List of known voltage ranges to be used with the configuration option
* ADC_CONF_CHN_RANGE
*/
enum adc_configuration_100m14b4cha_channel_range {
ADC_CONF_100M14B4CHA_CHN_RANGE_OPEN_DRAIN= 0,
ADC_CONF_100M14B4CHA_CHN_RANGE_100mV= 0x23,
ADC_CONF_100M14B4CHA_CHN_RANGE_1V= 0x11,
ADC_CONF_100M14B4CHA_CHN_RANGE_10V= 0x45,
};
/**
* List of possible buffer types (options for ADC_CONF_100M14B4CHA_BUF_TYPE)
......
......@@ -22,6 +22,7 @@
#include <unistd.h>
#include <inttypes.h>
#include <adc-lib.h>
#include <adc-lib-100m14b4cha.h>
static int arg_show_config = 0;
static int arg_no_read = 0;
......@@ -448,15 +449,15 @@ static int fald_acq_channel_configuration(struct adc_dev *adc, char *param)
*/
switch (range) {
case 100:
range = 0x23;
range = ADC_CONF_100M14B4CHA_CHN_RANGE_100mV;
bit_scale = 0.05/(1<<15);
break;
case 1:
range = 0x11;
range = ADC_CONF_100M14B4CHA_CHN_RANGE_1V;
bit_scale = 0.5/(1<<15);
break;
case 10:
range = 0x45;
range = ADC_CONF_100M14B4CHA_CHN_RANGE_10V;
bit_scale = 5.0/(1<<15);
break;
}
......
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