]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man4/man4.arm/bcm283x_pwm.4
THIS BRANCH IS OBSOLETE, PLEASE READ:
[FreeBSD/FreeBSD.git] / share / man / man4 / man4.arm / bcm283x_pwm.4
1 .\"
2 .\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
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 .\" $FreeBSD$
28 .\"
29 .Dd September 10, 2018
30 .Dt BCM283X_PWM 4
31 .Os
32 .Sh NAME
33 .Nm bcm283x_pwm
34 .Nd bcm283x_pwm - driver for Raspberry Pi 2/3 PWM
35 .Sh SYNOPSIS
36 .Cd "kldload bcm283x_clkman"
37 .Cd "kldload bcm283x_pwm"
38 .Sh DESCRIPTION
39 The
40 .Nm
41 driver provides access to the PWM engine on GPIO12 of Raspberry Pi 2 and 3 hardware.
42 .Pp
43 The PWM hardware is controlled via the
44 .Xr sysctl 8
45 interface:
46 .Bd -literal
47 dev.pwm.0.mode: 1
48 dev.pwm.0.mode2: 1
49 dev.pwm.0.freq: 125000000
50 dev.pwm.0.ratio: 2500
51 dev.pwm.0.ratio2: 2500
52 dev.pwm.0.period: 10000
53 dev.pwm.0.period2: 10000
54 dev.pwm.0.pwm_freq: 12500
55 dev.pwm.0.pwm_freq2: 12500
56 .Ed
57 .Bl -tag -width ".Va dev.pwm"
58 .It Va dev.pwm.0.mode , dev.pwm.0.mode2
59 PWM Mode for channels 1 and 2.
60 Three modes exist, 0=off, 1=PWM, 2=N/M.
61 The N/M mode is a first order delta-sigma mode, which makes a quite
62 handy DAC output with a trivial RC lowpass filter.
63 .Pp
64 .It Va dev.pwm.0.freq
65 The input frequency to the PWM hardware in Hz.
66 Applies to both channels 1 and 2.
67 Minimum frequency is 123 kHz, maximum frequency is 125 MHz.
68 .It Va dev.pwm.0.period , dev.pwm.0.period2
69 The period length in cycles.
70 In PWM mode, the output frequencies will be
71 (
72 .Va dev.pwm.0.freq
73 /
74 .Va dev.pwm.period
75 ) and (
76 .Va dev.pwm.0.freq2
77 /
78 .Va dev.pwm.0.period2
79 ).
80 In N/M mode this is the 'M'.
81 .It Va dev.pwm.0.ratio , dev.pwm.0.ratio2
82 The "on" period in cycles for PWM channels 1 and 2.
83 In PWM mode, to get a 25% dutycycle, set this to 25% of
84 .Va dev.pwm.0.period
85 or
86 .Va dev.pwm.0.period2 ,
87 as appropriate.
88 In N/M mode this is the 'N'.
89 .It Va dev.pwm.0.pwm_freq , dev.pwm.0.pwm_freq2
90 The calculated PWM output frequencies in PWM mode, for channels 1 and 2.
91 .El
92 .Pp
93 .Sh NOTES
94 Currently the
95 .Nm
96 driver ignores the 'status="disabled"' flag in the DTB, assuming that
97 if you load the driver, you want it to work.
98 .Sh SEE ALSO
99 .Xr sysctl 8
100 .Sh HISTORY
101 The
102 .Nm
103 driver first appeared in
104 .Fx 12.0 .
105 .Sh AUTHORS
106 .An -nosplit
107 The
108 .Nm
109 driver and this manual page were written by
110 .An Poul-Henning Kamp Aq Mt phk@FreeBSD.org .