Expand description
PWM device node control contract (/devices/pwm/<name>).
§Control commands (kind b'p')
| Number | Command | Direction | Input | Output | Effect |
|---|---|---|---|---|---|
0x00 | GET_INFO | Read | PwmVersionAbi | PwmInfoAbi | Returns channel count, max duty and period. |
0x01 | SET_FREQUENCY | Write | PwmFrequencyAbi | PwmInfoAbi | Sets the channel period in hertz. |
0x02 | SET_DUTY_PERMILLE | Write | PwmDutyPermilleAbi | PwmInfoAbi | Sets duty as 0..=1000 per mille of max duty. |
Every struct starts with a version field equal to ABI_VERSION and
carries zeroed reserved fields. A wrong version, a non-zero reserved field
or an out-of-range value is InvalidArgument. A frequency the controller
cannot express, or a fixed-period controller, is Unsupported.
Structs§
- GET_
INFO - PwmDuty
Permille Abi - Input of
SET_DUTY_PERMILLE.permilleis 0..=PERMILLE_FULL_SCALE. - PwmFrequency
Abi - Input of
SET_FREQUENCY. - PwmInfo
Abi - Channel description returned by every PWM command.
- PwmVersion
Abi - Carries only the ABI version and a reserved field. Input of
GET_INFO. - SET_
DUTY_ PERMILLE - SET_
FREQUENCY
Constants§
- ABI_
VERSION - Version of every PWM control ABI struct in this module.
- PERMILLE_
FULL_ SCALE - Largest value accepted by
SET_DUTY_PERMILLE.