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
e8728041
Commit
e8728041
authored
Oct 16, 2020
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib: add board temperature as generic feature
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
49ca5fde
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
adc-lib.h
lib/adc-lib.h
+1
-0
fmc-adc-100m14b4cha.c
lib/fmc-adc-100m14b4cha.c
+10
-0
No files found.
lib/adc-lib.h
View file @
e8728041
...
...
@@ -213,6 +213,7 @@ enum adc_configuration_board {
ADC_CONF_BRD_N_TRG_EXT
,
/**< Number of external triggers */
ADC_CONF_BRD_N_TRG_THR
,
/**< Number of threshold triggers */
ADC_CONF_BRD_N_TRG_TIM
,
/**< Number of timer triggers */
ADC_CONF_BRD_TEMPERATURE
,
/**< Temperature in milli-Celsius */
/* TODO seconds, ticks and bins are bit -> High - low */
ADC_CONF_UTC_TIMING_BASE_S
,
/**< Board internal time: seconds */
ADC_CONF_UTC_TIMING_BASE_T
,
/**< Board internal time: coarse
...
...
lib/fmc-adc-100m14b4cha.c
View file @
e8728041
...
...
@@ -56,6 +56,7 @@
(1LL << ADC_CONF_BRD_N_TRG_EXT) | \
(1LL << ADC_CONF_BRD_N_TRG_THR) | \
(1LL << ADC_CONF_BRD_N_TRG_TIM) | \
(1LL << ADC_CONF_BRD_TEMPERATURE) | \
(1LL << ADC_CONF_UTC_TIMING_BASE_S) | \
(1LL << ADC_CONF_UTC_TIMING_BASE_T)
#define ADC_100M_4CH_14BIT_CUS_MASK (1ULL << ADC_CONF_100M14B4CHA_BUF_TYPE) | \
...
...
@@ -357,6 +358,15 @@ static int adc_100m14b4cha_config_brd(struct adc_dev *adc,
*
value
=
1
;
return
0
;
}
case
ADC_CONF_BRD_TEMPERATURE
:
if
(
direction
)
{
errno
=
ADC_ENOSET
;
return
-
1
;
}
else
{
return
adc_get_param
(
adc
,
"temperature"
,
NULL
,
(
int
*
)
value
);
return
0
;
}
case
ADC_CONF_UTC_TIMING_BASE_S
:
if
(
direction
)
{
errno
=
ADC_ENOSET
;
...
...
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