xref: /freebsd/share/man/man4/man4.arm/bcm283x_pwm.4 (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
1.\"
2.\" SPDX-License-Identifier: BSD-2-Clause
3.\"
4.\" Copyright (c) 2017 Poul-Henning Kamp <phk@FreeBSD.org>
5.\" All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26.\"
27.Dd September 10, 2018
28.Dt BCM283X_PWM 4
29.Os
30.Sh NAME
31.Nm bcm283x_pwm
32.Nd bcm283x_pwm - driver for Raspberry Pi 2/3 PWM
33.Sh SYNOPSIS
34.Cd "kldload bcm283x_clkman"
35.Cd "kldload bcm283x_pwm"
36.Sh DESCRIPTION
37The
38.Nm
39driver provides access to the PWM engine on GPIO12 of Raspberry Pi 2 and 3 hardware.
40.Pp
41The PWM hardware is controlled via the
42.Xr sysctl 8
43interface:
44.Bd -literal
45dev.pwm.0.mode: 1
46dev.pwm.0.mode2: 1
47dev.pwm.0.freq: 125000000
48dev.pwm.0.ratio: 2500
49dev.pwm.0.ratio2: 2500
50dev.pwm.0.period: 10000
51dev.pwm.0.period2: 10000
52dev.pwm.0.pwm_freq: 12500
53dev.pwm.0.pwm_freq2: 12500
54.Ed
55.Bl -tag -width ".Va dev.pwm"
56.It Va dev.pwm.0.mode , dev.pwm.0.mode2
57PWM Mode for channels 1 and 2.
58Three modes exist, 0=off, 1=PWM, 2=N/M.
59The N/M mode is a first order delta-sigma mode, which makes a quite
60handy DAC output with a trivial RC lowpass filter.
61.Pp
62.It Va dev.pwm.0.freq
63The input frequency to the PWM hardware in Hz.
64Applies to both channels 1 and 2.
65Minimum frequency is 123 kHz, maximum frequency is 125 MHz.
66.It Va dev.pwm.0.period , dev.pwm.0.period2
67The period length in cycles.
68In PWM mode, the output frequencies will be
69(
70.Va dev.pwm.0.freq
71/
72.Va dev.pwm.period
73) and (
74.Va dev.pwm.0.freq2
75/
76.Va dev.pwm.0.period2
77).
78In N/M mode this is the 'M'.
79.It Va dev.pwm.0.ratio , dev.pwm.0.ratio2
80The "on" period in cycles for PWM channels 1 and 2.
81In PWM mode, to get a 25% dutycycle, set this to 25% of
82.Va dev.pwm.0.period
83or
84.Va dev.pwm.0.period2 ,
85as appropriate.
86In N/M mode this is the 'N'.
87.It Va dev.pwm.0.pwm_freq , dev.pwm.0.pwm_freq2
88The calculated PWM output frequencies in PWM mode, for channels 1 and 2.
89.El
90.Pp
91.Sh NOTES
92Currently the
93.Nm
94driver ignores the 'status="disabled"' flag in the DTB, assuming that
95if you load the driver, you want it to work.
96.Sh SEE ALSO
97.Xr sysctl 8
98.Sh HISTORY
99The
100.Nm
101driver first appeared in
102.Fx 12.0 .
103.Sh AUTHORS
104.An -nosplit
105The
106.Nm
107driver and this manual page were written by
108.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org .
109