3.9.30. pwm - pwm

3.9.30.1. Usage

pwm [-ldDPfwisv]

3.9.30.2. Synopsis

Sets pwm device parameters, or shows current value. Specify the pwm device by device name. If no other parameters are given, or if args has ‘-v’, then show the current values only. Timings can either be specified via period + duty (on) duration, or via frequency. Duty can be given either as a percentage or time. If a parameter is not specified, the current value will be used where possible. To set an output to inactive state, set the duty to 0. (although note this will not by itself stop the pwm running.) Stopping the pwm device does not necessarily set the output to inactive, but stop is handled last, so can be done in addition to other changes.

3.9.30.3. Options

-l

list registered PWMs

-d <name>

device name (eg ‘pwm0’)

-D <duty_ns>

duty cycle (ns)

-P <period_ns>

period (ns)

-f <freq_hz>

frequency (Hz)

-w <duty_%>

duty cycle (%) - the on ‘width’ of each cycle

-i

line inverted polarity

-s

stop (disable) the pwm device

-v

print current values