Document number
205065
Version
Rev. N
Issue date
2019-02-04
Sirius OBC and TCM User Manual
Page
91
of
174
Return value
Description
>= 0
Number of bytes that were
read.
- 1
see
errno
values
errno values
EPERM
Device not open
EINVAL
Invalid number of bytes to be
read
ADC data buffer bit definition
Description
31:8
ADC value
7:4
ADC status
3:0
Channel number
5.10.2.5.
Function int ioctl(…)
Ioctl allows for more in-depth control of the ADC IP like setting the sample mode, clock
divisor etc.
Argument name
Type
Direction Description
Fd
int
in
File descriptor received at open
Cmd
int
in
Command to send
Val
uint32_t / uint32_t*
in/out
Value to write or a pointer to a buffer
where data will be written.
Command table
Type
Direction Description
ADC_SET_SAMPLE_RATE_IOCTL
uint32_t
in
Set the sample rate of the ADC chip,
see [RD6].
ADC_GET_SAMPLE_RATE_IOCTL
uint32_t
out
Get the sample rate of the ADC chip,
see [RD6].
ADC_SET_CLOCK_DIVISOR
uint32_t
in
Set the clock divisor of the clock used
for communication with the ADC chip.
Minimum 4 and maximum 255.
Default is 255.
ADC_GET_CLOCK_DIVISOR
uint32_t
out
Get the clock divisor of the clock
used for communication with the
ADC chip.
ADC_ENABLE_CHANNEL
uint32_t
in
Enable specified channel number to
be included when sampling. Minimum
0 and maximum 15.
ADC_DISABLE_CHANNEL
uint32_t
in
Disable specified channel number to
be included when sampling. Minimum
0 and maximum 15.
Return value
Description
0
Command executed
successfully
-1
see
errno
values