libpruio  0.6.8
Fast and easy Digital/Analog Input/Output for Beaglebones
pruio_pwmss.bi
Go to the documentation of this file.
1 
16 
17 
18 
33 TYPE PwmssSet
34  AS UInt32 _
35  DeAd _
36  , ClAd _
37  , ClVa
38 
39  AS UInt32 _ '' PWMSS REGISTERS
40  IDVER _
41  , SYSCONFIG _
42  , CLKCONFIG _
43  , CLKSTATUS
44 
45  AS UInt32 _ '' eCAP registers (&h100)
46  TSCTR _
47  , CTRPHS _
48  , CAP1 _
49  , CAP2 _
50  , CAP3 _
51  , CAP4
52  AS UInt16 _
53  ECCTL1 _
54  , ECCTL2 _
55  , ECEINT _
56  , ECFLG _
57  , ECCLR _
58  , ECFRC
59  AS UInt32 _
60  CAP_REV
61 
62  AS UInt32 _ '' QEP registers (&h180)
63  QPOSCNT _
64  , QPOSINIT _
65  , QPOSMAX _
66  , QPOSCMP _
67  , QPOSILAT _
68  , QPOSSLAT _
69  , QPOSLAT _
70  , QUTMR _
71  , QUPRD
72  AS UInt16 _
73  QWDTMR _
74  , QWDPRD _
75  , QDECCTL _
76  , QEPCTL _
77  , QCAPCTL _
78  , QPOSCTL _
79  , QEINT _
80  , QFLG _
81  , QCLR _
82  , QFRC _
83  , QEPSTS _
84  , QCTMR _
85  , QCPRD _
86  , QCTMRLAT _
87  , QCPRDLAT _
88  , empty
89  AS UInt32 _
90  QEP_REV
91 
92  AS UInt16 _ '' ePWM registers (&h200)
93 _ '' Time-Base Submodule Registers (see \ArmRef{15.2.4.1} ).
94  TBCTL _
95  , TBSTS _
96  , TBPHSHR _
97  , TBPHS _
98  , TBCNT _
99  , TBPRD _
100 _ '' Counter-Compare Submodule Registers (see \ArmRef{15.2.4.2} ).
101  , CMPCTL _
102  , CMPAHR _
103  , CMPA _
104  , CMPB _
105 _ '' Action-Qualifier Submodule Registers (see \ArmRef{15.2.4.3} ).
106  , AQCTLA _
107  , AQCTLB _
108  , AQSFRC _
109  , AQCSFRC _
110 _ '' Dead-Band Generator Submodule Registers (see \ArmRef{15.2.4.4} ).
111  , DBCTL _
112  , DBRED _
113  , DBFED _
114 _ '' Trip-Zone Submodule Registers (see \ArmRef{15.2.4.5} ).
115  , TZSEL _
116  , TZCTL _
117  , TZEINT _
118  , TZFLG _
119  , TZCLR _
120  , TZFRC _
121 _ '' Event-Trigger Submodule Registers (see \ArmRef{15.2.4.6} ).
122  , ETSEL _
123  , ETPS _
124  , ETFLG _
125  , ETCLR _
126  , ETFRC _
127 _ '' PWM-Chopper Submodule Registers (see \ArmRef{15.2.4.7} ).
128  , PCCTL _
129 _ '' High-Resolution PWM (HRPWM) Submodule Registers (see \ArmRef{15.2.4.8} ).
130  , HRCTL
131 END TYPE
132 
133 
134 
141 TYPE PwmssArr
142  AS UInt32 _
143  DeAd
144  AS UInt32 _
145  CMax _
146  , C1 _
147  , C2 _
148  , QPos _
149  , NPos _
150  , OPos _
151  , PLat
152 END TYPE
153 
154 
155 
164 TYPE PwmssUdt
165  AS Pruio_ PTR Top
166  AS PwmssSet PTR _
167  Init(PRUIO_AZ_PWMSS) _
168  , Conf(PRUIO_AZ_PWMSS)
169  AS PwmssArr PTR _
171  AS UInt32 InitParA
172  AS CONST UInt16 _
173  PwmMode = &b01000010000 _
174  , CapMode = &b00011010110
175  AS ZSTRING PTR _
176  E0 = @"PWMSS not enabled" _
177  , E1 = @"set frequency in first call" _
178  , E2 = @"frequency not supported" _
179  , E3 = @"pin not in PWM mode" _
180  , E4 = @"pin has no PWM capability" _
181  , E5 = @"pin not in CAP mode" _
182  , E6 = @"pin has no CAP capability" _
183  , E7 = @"pin not in QEP mode" _
184  , E8 = @"pin has no QEP capability" _
185  , E9 = @"eCAP module not in output mode"
186 
187  DECLARE CONSTRUCTOR (BYVAL AS Pruio_ PTR)
188  DECLARE FUNCTION initialize CDECL() AS ZSTRING PTR
189  DECLARE FUNCTION pwm_pwm_set CDECL( _
190  BYVAL AS UInt8 _
191  , BYVAL AS Float_t _
192  , BYVAL AS Float_t = 0. _
193  , BYVAL AS Float_t = 0.) AS ZSTRING PTR
194  DECLARE FUNCTION cap_pwm_set CDECL( _
195  BYVAL AS UInt8 _
196  , BYVAL AS Float_t _
197  , BYVAL AS Float_t = 0.) AS ZSTRING PTR
198  DECLARE FUNCTION pwm_pwm_get CDECL( _
199  BYVAL AS UInt8 _
200  , BYVAL AS Float_t PTR = 0 _
201  , BYVAL AS Float_t PTR = 0 _
202  , BYVAL AS UInt8) AS ZSTRING PTR
203  DECLARE FUNCTION cap_pwm_get CDECL( _
204  BYVAL AS UInt8 _
205  , BYVAL AS Float_t PTR = 0 _
206  , BYVAL AS Float_t PTR = 0 ) AS ZSTRING PTR
207  DECLARE FUNCTION cap_tim_set CDECL( _
208  BYVAL AS UInt8 _
209  , BYVAL AS Float_t _
210  , BYVAL AS Float_t _
211  , BYVAL AS SHORT) AS ZSTRING PTR
212  DECLARE FUNCTION cap_tim_get CDECL( _
213  BYVAL AS UInt8 _
214  , BYVAL AS Float_t PTR _
215  , BYVAL AS Float_t PTR) AS ZSTRING PTR
216 END TYPE
217 
218 
219 
239 TYPE PwmMod
240  AS Pruio_ PTR Top
241  AS UInt16 _
242  ForceUpDown = 0 _
243  , Cntrl(PRUIO_AZ_PWMSS) = _
244  {&b1010000000010000, &b1010000000010000, &b1010000000010000} _
245  , AqCtl(1, PRUIO_AZ_PWMSS, 2) = _
246 { { {&b000000010010, &b000000010010, &b000001000010} _
247  , {&b000000010010, &b000000010010, &b000001000010} _
248  , {&b000000010010, &b000000010010, &b000001000010} } _
249 , { {&b000100000010, &b000100000010, &b010000000010} _
250  , {&b000100000010, &b000100000010, &b010000000010} _
251  , {&b000100000010, &b000100000010, &b010000000010} } }
252 
253  DECLARE CONSTRUCTOR (BYVAL AS Pruio_ PTR)
254  DECLARE FUNCTION Value CDECL( _
255  BYVAL AS UInt8 _
256  , BYVAL AS Float_t PTR = 0 _
257  , BYVAL AS Float_t PTR = 0) AS ZSTRING PTR
258  DECLARE FUNCTION setValue CDECL( _
259  BYVAL AS UInt8, _
260  BYVAL AS Float_t, _
261  BYVAL AS Float_t) AS ZSTRING PTR
262  DECLARE FUNCTION Sync CDECL( _
263  BYVAL AS UInt8) AS ZSTRING PTR
264 END TYPE
265 
266 
267 
276 TYPE CapMod
277  AS Pruio_ PTR Top
278  'AS ZSTRING PTR _
279  'E0 = @"pin has no CAP capability" _ '*< Common error message.
280  ', E1 = @"pin not in CAP mode" _ '*< Common error message.
281  ', E2 = @"CAP not enabled" '*< Common error message.
282 
283  DECLARE CONSTRUCTOR (BYVAL AS Pruio_ PTR)
284  DECLARE FUNCTION config CDECL( _
285  BYVAL AS UInt8 _
286  , BYVAL AS Float_t = 0.) AS ZSTRING PTR
287  DECLARE FUNCTION Value CDECL( _
288  BYVAL AS UInt8 _
289  , BYVAL AS Float_t PTR = 0 _
290  , BYVAL AS Float_t PTR = 0) AS ZSTRING PTR
291 END TYPE
292 
293 
294 
303 TYPE QepMod
304  AS Pruio_ PTR Top
305  AS Float_t _
306  FVh(PRUIO_AZ_PWMSS) _
307  , FVl(PRUIO_AZ_PWMSS)
308  AS UInt32 _
310 
311  DECLARE CONSTRUCTOR (BYVAL AS Pruio_ PTR)
312  DECLARE FUNCTION config CDECL( _
313  BYVAL AS UInt8 _
314  , BYVAL AS UInt32 = &h7FFFFFFFul _
315  , BYVAL AS Float_t = 25. _
316  , BYVAL AS Float_t = 1. _
317  , BYVAL AS UInt8 = 0) AS ZSTRING PTR
318  DECLARE FUNCTION Value CDECL( _
319  BYVAL AS UInt8 _
320  , BYVAL AS UInt32 PTR = 0 _
321  , BYVAL AS Float_t PTR = 0) AS ZSTRING PTR
322 END TYPE
323