Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
adc-lib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
misc
adc-lib
Commits
b9ff1cff
Commit
b9ff1cff
authored
Oct 23, 2018
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib:adc100m14b: use enum symbols instead of raw values
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
fb5af3df
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
adc-lib-100m14b4cha.h
lib/adc-lib-100m14b4cha.h
+4
-0
fmc-adc-100m14b4cha.c
lib/fmc-adc-100m14b4cha.c
+7
-7
No files found.
lib/adc-lib-100m14b4cha.h
View file @
b9ff1cff
...
...
@@ -32,6 +32,10 @@ enum adc_configuration_100m14b4cha_channel_range {
ADC_CONF_100M14B4CHA_CHN_RANGE_100mV
=
0x23
,
ADC_CONF_100M14B4CHA_CHN_RANGE_1V
=
0x11
,
ADC_CONF_100M14B4CHA_CHN_RANGE_10V
=
0x45
,
ADC_CONF_100M14B4CHA_CHN_RANGE_100mV_CAL
=
0x42
,
ADC_CONF_100M14B4CHA_CHN_RANGE_1V_CAL
=
0x40
,
ADC_CONF_100M14B4CHA_CHN_RANGE_10V_CAL
=
0x44
,
};
/**
...
...
lib/fmc-adc-100m14b4cha.c
View file @
b9ff1cff
...
...
@@ -944,19 +944,19 @@ static int32_t __convert_hw_to_uv(int32_t val, unsigned int range)
int32_t
result_int
,
result_frac
,
range_uV
,
factor
;
switch
(
range
)
{
case
0x44
:
case
0x45
:
case
ADC_CONF_100M14B4CHA_CHN_RANGE_10V_CAL
:
case
ADC_CONF_100M14B4CHA_CHN_RANGE_10V
:
/* 10V */
range_uV
=
10000000
;
break
;
case
0x42
:
case
0x23
:
case
ADC_CONF_100M14B4CHA_CHN_RANGE_100mV_CAL
:
case
ADC_CONF_100M14B4CHA_CHN_RANGE_100mV
:
/* 100mV */
range_uV
=
100000
;
break
;
case
0x40
:
case
0x11
:
case
0x00
:
case
ADC_CONF_100M14B4CHA_CHN_RANGE_1V_CAL
:
case
ADC_CONF_100M14B4CHA_CHN_RANGE_1V
:
case
ADC_CONF_100M14B4CHA_CHN_RANGE_OPEN_DRAIN
:
/* 1V */
range_uV
=
1000000
;
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment