19312900fSEmmanuel Vadot.\" Copyright (c) 2018 Emmanuel Vadot <manu@freebsd.org> 29312900fSEmmanuel Vadot.\" 39312900fSEmmanuel Vadot.\" Redistribution and use in source and binary forms, with or without 49312900fSEmmanuel Vadot.\" modification, are permitted provided that the following conditions 59312900fSEmmanuel Vadot.\" are met: 69312900fSEmmanuel Vadot.\" 1. Redistributions of source code must retain the above copyright 79312900fSEmmanuel Vadot.\" notice, this list of conditions and the following disclaimer. 89312900fSEmmanuel Vadot.\" 2. Redistributions in binary form must reproduce the above copyright 99312900fSEmmanuel Vadot.\" notice, this list of conditions and the following disclaimer in the 109312900fSEmmanuel Vadot.\" documentation and/or other materials provided with the distribution. 119312900fSEmmanuel Vadot.\" 129312900fSEmmanuel Vadot.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR 139312900fSEmmanuel Vadot.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 149312900fSEmmanuel Vadot.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 159312900fSEmmanuel Vadot.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, 169312900fSEmmanuel Vadot.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 179312900fSEmmanuel Vadot.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 189312900fSEmmanuel Vadot.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 199312900fSEmmanuel Vadot.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 209312900fSEmmanuel Vadot.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 219312900fSEmmanuel Vadot.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 229312900fSEmmanuel Vadot.\" 237d763870SIan Lepore.Dd June 17, 2019 249312900fSEmmanuel Vadot.Dt PWM 8 259312900fSEmmanuel Vadot.Os 269312900fSEmmanuel Vadot.Sh NAME 279312900fSEmmanuel Vadot.Nm pwm 28123570fbSIan Lepore.Nd configure PWM (Pulse Width Modulation) hardware 299312900fSEmmanuel Vadot.Sh SYNOPSIS 309312900fSEmmanuel Vadot.Nm 319312900fSEmmanuel Vadot.Op Fl f Ar device 329312900fSEmmanuel Vadot.Fl C 339312900fSEmmanuel Vadot.Nm 349312900fSEmmanuel Vadot.Op Fl f Ar device 3526f3ca61SIan Lepore.Op Fl D | Fl E 36*17b14d8fSOskar Holmund.Op Fl I 3726f3ca61SIan Lepore.Op Fl p Ar period 3826f3ca61SIan Lepore.Op Fl d Ar duty 399312900fSEmmanuel Vadot.Sh DESCRIPTION 409312900fSEmmanuel VadotThe 419312900fSEmmanuel Vadot.Nm 42123570fbSIan Leporeutility can be used to configure pwm hardware. 43123570fbSIan Lepore.Nm 44123570fbSIan Leporeuses a 45123570fbSIan Lepore.Xr pwmc 4 46123570fbSIan Leporedevice to communicate with the hardware. 47123570fbSIan LeporeSome PWM hardware supports multiple output channels within a single 48123570fbSIan Leporecontroller block; each 49123570fbSIan Lepore.Xr pwmc 4 50123570fbSIan Leporeinstance controls a single PWM channel. 519312900fSEmmanuel Vadot.Pp 52123570fbSIan Lepore.Xr pwmc 4 53123570fbSIan Leporedevices are named 54123570fbSIan Lepore.Pa /dev/pwm/pwmcX.Y , 55123570fbSIan Leporewhere 56123570fbSIan Lepore.Va X 57123570fbSIan Leporeis the controller unit number and 58123570fbSIan Lepore.Va Y 59123570fbSIan Leporeis the channel number within that unit. 60123570fbSIan Lepore.Pp 61123570fbSIan LeporeThe options are as follows: 62780c3de8SIan Lepore.Bl -tag -width "-f device" 63d70ad055SYuri Pankov.It Fl f Ar device 64d70ad055SYuri PankovDevice to operate on. 65d70ad055SYuri PankovIf not specified, 667d763870SIan Lepore.Pa /dev/pwm/pwmc0.0 67d70ad055SYuri Pankovis used. 687d763870SIan LeporeIf an unqualified name is provided, 697d763870SIan Lepore.Pa /dev/pwm 707d763870SIan Leporeis automatically prepended. 719312900fSEmmanuel Vadot.It Fl C 72123570fbSIan LeporeShow the configuration of the PWM channel. 7326f3ca61SIan Lepore.It Fl D 7426f3ca61SIan LeporeDisable the PWM channel. 759312900fSEmmanuel Vadot.It Fl d Ar duty 760309916aSIan LeporeConfigure the duty cycle (in nanoseconds or percentage) of the PWM channel. 77060e6388SIan LeporeDuty is the portion of the 78060e6388SIan Lepore.Ar period 79060e6388SIan Leporeduring which the signal is asserted. 8026f3ca61SIan Lepore.It Fl E 8126f3ca61SIan LeporeEnable the PWM channel. 8226f3ca61SIan Lepore.It Fl p Ar period 8326f3ca61SIan LeporeConfigure the period (in nanoseconds) of the PWM channel. 84*17b14d8fSOskar Holmund.It Fl I 85*17b14d8fSOskar HolmundInvert PWM signal polarity 869312900fSEmmanuel Vadot.El 879312900fSEmmanuel Vadot.Sh EXAMPLES 889312900fSEmmanuel Vadot.Bl -bullet 899312900fSEmmanuel Vadot.It 90123570fbSIan LeporeShow the configuration of the PWM channel: 91d70ad055SYuri Pankov.Bd -literal 927d763870SIan Leporepwm -f /dev/pwm/pwmc0.1 -C 93d70ad055SYuri Pankov.Ed 949312900fSEmmanuel Vadot.It 9526f3ca61SIan LeporeConfigure a 50000 ns period and a 25000 ns duty cycle 9626f3ca61SIan Leporeand enable the channel: 97d70ad055SYuri Pankov.Bd -literal 9826f3ca61SIan Leporepwm -f pwmc1.1 -E -p 50000 -d 25000 99d70ad055SYuri Pankov.Ed 10050a123aaSEmmanuel Vadot.It 1017d763870SIan LeporeConfigure a 50% duty cycle on the device and channel which 1027d763870SIan Leporewere configured in 1037d763870SIan Lepore.Xr pwmc 4 1047d763870SIan Leporeto have the label 1057d763870SIan Lepore.Pa backlight : 106d70ad055SYuri Pankov.Bd -literal 1077d763870SIan Leporepwm -f backlight -d 50% 108d70ad055SYuri Pankov.Ed 1099312900fSEmmanuel Vadot.El 1109312900fSEmmanuel Vadot.Sh SEE ALSO 1119312900fSEmmanuel Vadot.Xr pwm 9 , 1129312900fSEmmanuel Vadot.Xr pwmbus 9 1139312900fSEmmanuel Vadot.Sh HISTORY 1149312900fSEmmanuel VadotThe 1159312900fSEmmanuel Vadot.Nm 1169312900fSEmmanuel Vadotutility appeared in 1179312900fSEmmanuel Vadot.Fx 13.0 . 1189312900fSEmmanuel Vadot.Sh AUTHORS 1199312900fSEmmanuel Vadot.An -nosplit 1209312900fSEmmanuel VadotThe 1219312900fSEmmanuel Vadot.Nm 1229312900fSEmmanuel Vadotutility and this manual page were written by 1239312900fSEmmanuel Vadot.An Emmanuel Vadot Aq Mt manu@FreeBSD.org . 124