Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC ADC 100M 14b 4cha
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
FMC ADC 100M 14b 4cha
Commits
80613102
Commit
80613102
authored
Oct 19, 2018
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drv: add function to just set the offset
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
45aed88c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
fa-core.c
kernel/fa-core.c
+15
-2
No files found.
kernel/fa-core.c
View file @
80613102
...
...
@@ -91,6 +91,20 @@ int zfad_pattern_data_enable(struct fa_dev *fa, uint16_t pattern,
return
0
;
}
/**
* It sets the DAC voltage to apply an offset on the input channel
* @chan
* @val DAC values (-5V: 0x0000, 0V: 0x8000, +5V: 0x7FFF)
*
* Return: 0 on success, otherwise a negative error number
*/
static
int
zfad_dac_set
(
struct
zio_channel
*
chan
,
uint32_t
val
)
{
struct
fa_dev
*
fa
=
get_zfadc
(
&
chan
->
cset
->
zdev
->
head
.
dev
);
return
fa_spi_xfer
(
fa
,
FA_SPI_SS_DAC
(
chan
->
index
),
16
,
val
,
NULL
);
}
/*
* zfad_apply_user_offset
* @fa: the fmc-adc descriptor
...
...
@@ -136,8 +150,7 @@ int zfad_apply_user_offset(struct fa_dev *fa, struct zio_channel *chan,
if
(
hwval
>
0xffff
)
hwval
=
0xffff
;
/* Apply calibrated offset to DAC */
return
fa_spi_xfer
(
fa
,
FA_SPI_SS_DAC
(
chan
->
index
),
16
,
hwval
,
NULL
);
return
zfad_dac_set
(
chan
,
hwval
);
}
/*
...
...
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