Skip to main content

Module adc

Module adc 

Source
Expand description

ADC device node control contract (/devices/adc/<name>).

§Control commands (kind b'a')

NumberCommandDirectionInputOutputEffect
0x00GET_INFOReadVersionAbiInfoAbiReturns channels, resolution and reference.
0x01SELECT_CHANNELWriteSelectChannelAbiVersionAbiSelects the channel used by plain reads.
0x02READ_MILLIVOLTSReadVersionAbiMillivoltsAbiConverts the selected channel to millivolts.

Every struct starts with a version field equal to ABI_VERSION and its reserved fields must be zero; otherwise the command fails with InvalidArgument. A channel outside 0..channels is InvalidArgument, and READ_MILLIVOLTS on a converter without a reference voltage is Unsupported.

Structs§

GET_INFO
InfoAbi
Converter geometry. reference_millivolts is meaningful only when reference_present is 1.
MillivoltsAbi
One conversion in millivolts.
READ_MILLIVOLTS
SELECT_CHANNEL
SelectChannelAbi
Selects the channel used by plain reads.
VersionAbi
Carries only the ABI version. Used as input of queries and output of commands that have no other payload.

Constants§

ABI_VERSION
Version of every ADC control ABI struct in this module.