xref: /freebsd/usr.sbin/pwm/pwm.8 (revision d70ad055e051209d212260dcb6ddb719a4b1cd1a)
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.\"
239312900fSEmmanuel Vadot.\" $FreeBSD$
249312900fSEmmanuel Vadot.\"
25*d70ad055SYuri Pankov.Dd January 12, 2019
269312900fSEmmanuel Vadot.Dt PWM 8
279312900fSEmmanuel Vadot.Os
289312900fSEmmanuel Vadot.Sh NAME
299312900fSEmmanuel Vadot.Nm pwm
309312900fSEmmanuel Vadot.Nd configure pwm controller
319312900fSEmmanuel Vadot.Sh SYNOPSIS
329312900fSEmmanuel Vadot.Nm
339312900fSEmmanuel Vadot.Op Fl f Ar device
349312900fSEmmanuel Vadot.Fl c Ar channel
359312900fSEmmanuel Vadot.Fl E
369312900fSEmmanuel Vadot.Nm
379312900fSEmmanuel Vadot.Op Fl f Ar device
389312900fSEmmanuel Vadot.Fl c Ar channel
399312900fSEmmanuel Vadot.Fl D
409312900fSEmmanuel Vadot.Nm
419312900fSEmmanuel Vadot.Op Fl f Ar device
429312900fSEmmanuel Vadot.Fl c Ar channel
439312900fSEmmanuel Vadot.Fl C
449312900fSEmmanuel Vadot.Nm
459312900fSEmmanuel Vadot.Op Fl f Ar device
469312900fSEmmanuel Vadot.Fl c Ar channel
47*d70ad055SYuri Pankov.Fl p Ar period
489312900fSEmmanuel Vadot.Nm
499312900fSEmmanuel Vadot.Op Fl f Ar device
509312900fSEmmanuel Vadot.Fl c Ar channel
51*d70ad055SYuri Pankov.Fl d Ar duty
529312900fSEmmanuel Vadot.Sh DESCRIPTION
539312900fSEmmanuel VadotThe
549312900fSEmmanuel Vadot.Nm
559312900fSEmmanuel Vadotutility can be used to configure pwm controllers.
569312900fSEmmanuel Vadot.Pp
579312900fSEmmanuel VadotThe options are as follow:
58*d70ad055SYuri Pankov.Bl -tag -width "-c channel"
599312900fSEmmanuel Vadot.It Fl c Ar channel
609312900fSEmmanuel VadotChannel number to operate on
61*d70ad055SYuri Pankov.It Fl f Ar device
62*d70ad055SYuri PankovDevice to operate on.
63*d70ad055SYuri PankovIf not specified,
64*d70ad055SYuri Pankov.Pa /dev/pwmc0
65*d70ad055SYuri Pankovis used.
669312900fSEmmanuel Vadot.It Fl E
679312900fSEmmanuel VadotEnable the pwm channel
689312900fSEmmanuel Vadot.It Fl D
699312900fSEmmanuel VadotDisable the pwm channel
709312900fSEmmanuel Vadot.It Fl C
719312900fSEmmanuel VadotShow the configuration of the pwm channel
729312900fSEmmanuel Vadot.It Fl p Ar period
739312900fSEmmanuel VadotConfigure the period (in nanoseconds) of the pwm channel
749312900fSEmmanuel Vadot.It Fl d Ar duty
7550a123aaSEmmanuel VadotConfigure the duty (in nanoseconds or percentage) of the pwm channel
769312900fSEmmanuel Vadot.El
779312900fSEmmanuel Vadot.Sh EXAMPLES
789312900fSEmmanuel Vadot.Bl -bullet
799312900fSEmmanuel Vadot.It
809312900fSEmmanuel VadotShow the configuration of the pwm channel:
81*d70ad055SYuri Pankov.Bd -literal
829312900fSEmmanuel Vadotpwm -f /dev/pwmc0 -C
83*d70ad055SYuri Pankov.Ed
849312900fSEmmanuel Vadot.It
8550a123aaSEmmanuel VadotConfigure a 50000 ns period and a 25000 duty cycle:
86*d70ad055SYuri Pankov.Bd -literal
879312900fSEmmanuel Vadotpwm -f /dev/pwmc0 -p 50000 -d 25000
88*d70ad055SYuri Pankov.Ed
8950a123aaSEmmanuel Vadot.It
9050a123aaSEmmanuel VadotConfigure a 50% duty cycle:
91*d70ad055SYuri Pankov.Bd -literal
9250a123aaSEmmanuel Vadotpwm -f /dev/pwmc0 -d 50%
93*d70ad055SYuri Pankov.Ed
949312900fSEmmanuel Vadot.El
959312900fSEmmanuel Vadot.Sh SEE ALSO
969312900fSEmmanuel Vadot.Xr pwm 9 ,
979312900fSEmmanuel Vadot.Xr pwmbus 9
989312900fSEmmanuel Vadot.Sh HISTORY
999312900fSEmmanuel VadotThe
1009312900fSEmmanuel Vadot.Nm
1019312900fSEmmanuel Vadotutility appeared in
1029312900fSEmmanuel Vadot.Fx 13.0 .
1039312900fSEmmanuel Vadot.Sh AUTHORS
1049312900fSEmmanuel Vadot.An -nosplit
1059312900fSEmmanuel VadotThe
1069312900fSEmmanuel Vadot.Nm
1079312900fSEmmanuel Vadotutility and this manual page were written by
1089312900fSEmmanuel Vadot.An Emmanuel Vadot Aq Mt manu@FreeBSD.org .
109