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
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
adc-lib
Commits
9030b06e
Commit
9030b06e
authored
Sep 06, 2021
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tool: move voltage range unit to microvolts
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
8267c532
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
adc-acq.c
tools/adc-acq.c
+9
-5
No files found.
tools/adc-acq.c
View file @
9030b06e
...
...
@@ -82,7 +82,7 @@ static const char *help_msg_opt_desc =
" <n-shots>
\n
"
" number of consecutive acquisitions
\n
"
" <offset>*
\n
"
" offset to apply on input channel
\n
"
" offset to apply on input channel
in micro Volts (the offset range depends on the target board)
\n
"
" <polarity>
\n
"
" positive edge/slope: 0, negative edge/slope: 1
\n
"
" <post-sample>
\n
"
...
...
@@ -90,7 +90,7 @@ static const char *help_msg_opt_desc =
" <pre-sample>
\n
"
" number of samples to be acquired before trigger
\n
"
" <range>*
\n
"
" voltage range to use
\n
"
" voltage range to use
in micro Volts (the value depends on the target board)
\n
"
" <saturation>*
\n
"
" saturation value for an input channel
\n
"
" <seconds>
\n
"
...
...
@@ -515,18 +515,22 @@ static int fald_acq_channel_configuration(struct adc_dev *adc, char *param)
* 0x00 (0): Open input
*/
switch
(
range
)
{
case
100
:
case
100
000
:
range
=
ADC_CONF_100M14B4CHA_CHN_RANGE_100mV
;
bit_scale
=
0
.
05
/
(
1
<<
15
);
break
;
case
1
:
case
1
000000
:
range
=
ADC_CONF_100M14B4CHA_CHN_RANGE_1V
;
bit_scale
=
0
.
5
/
(
1
<<
15
);
break
;
case
10
:
case
10
000000
:
range
=
ADC_CONF_100M14B4CHA_CHN_RANGE_10V
;
bit_scale
=
5
.
0
/
(
1
<<
15
);
break
;
default:
fprintf
(
stderr
,
"Invalid range value %d
\n
"
,
range
);
errno
=
EINVAL
;
return
-
1
;
}
adc_set_conf
(
&
cfg
,
ADC_CONF_CHN_RANGE
,
range
);
case
2
:
...
...
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