Expand description
ADC device node control contract (/devices/adc/<name>).
§Control commands (kind b'a')
| Number | Command | Direction | Input | Output | Effect |
|---|---|---|---|---|---|
0x00 | GET_INFO | Read | VersionAbi | InfoAbi | Returns channels, resolution and reference. |
0x01 | SELECT_CHANNEL | Write | SelectChannelAbi | VersionAbi | Selects the channel used by plain reads. |
0x02 | READ_MILLIVOLTS | Read | VersionAbi | MillivoltsAbi | Converts 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_millivoltsis meaningful only whenreference_presentis 1. - Millivolts
Abi - One conversion in millivolts.
- READ_
MILLIVOLTS - SELECT_
CHANNEL - Select
Channel Abi - Selects the channel used by plain reads.
- Version
Abi - 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.