PWMTimerMSP432.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2017, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * 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  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
161 #ifndef ti_driver_pwm_PWMTimerMSP432__include
162 #define ti_driver_pwm_PWMTimerMSP432__include
163 
164 #ifdef __cplusplus
165 extern "C" {
166 #endif
167 
168 #include <stdbool.h>
169 
170 #include <ti/devices/DeviceFamily.h>
171 
172 #include <ti/drivers/PWM.h>
173 
174 #include <ti/devices/msp432p4xx/driverlib/pmap.h>
175 #include <ti/devices/msp432p4xx/driverlib/timer_a.h>
176 
178 /*
179  * PWMTimer port/pin defines for pin configuration. Ports P2, P3, and P7 are
180  * configurable through the port mapping controller.
181  * Value specifies the pin function and ranges from 0 to 31
182  * pin range: 0 - 7, port range: 0 - 15.
183  * The timer id (0, 1, 2, 3, or 4) is stored in bits 16 - 19
184  * The capture compare register is stored in bits 20 - 23.
185  *
186  *
187  * 23 - 20 19 - 16 15 - 10 9 8 7 - 4 3 - 0
188  * ---------------------------------------------------
189  * | CCR | Timer id | VALUE | X | X | PORT | PIN |
190  * ---------------------------------------------------
191  *
192  * value = pinConfig >> 10
193  * port = (pinConfig >> 4) & 0xf
194  * pin = pinConfig & 0x7
195  * ccr = (pinConfig >> 16) & 0xf
196  *
197  * pmap = port * 0x8; // 2 -> 0x10, 3 -> 0x18, 7 -> 0x38
198  * portMapReconfigure = PMAP_ENABLE_RECONFIGURATION;
199  *
200  * Code from pmap.c:
201  * //Get write-access to port mapping registers:
202  * PMAP->KEYID = PMAP_KEYID_VAL;
203  *
204  * //Enable/Disable reconfiguration during runtime
205  * PMAP->CTL = (PMAP->CTL & ~PMAP_CTL_PRECFG) | portMapReconfigure;
206  * HWREG8(PMAP_BASE + pin + pmap) = value;
207  *
208  * For non-configurable ports (bits 20 - 12 will be 0).
209  * Bits 8 and 9 hold the module function (PRIMARY, SECONDARY, or
210  * TERTIALRY).
211  *
212  * 23 - 20 19 - 16 15 - 10 9 8 7 - 4 3 - 0
213  * -----------------------------------------------------------------
214  * | CCR | Timer id | 0 | PnSEL1.x | PnSEL0.x | PORT | PIN |
215  * -----------------------------------------------------------------
216  *
217  * moduleFunction = (pinConfig >> 8) & 0x3
218  * port = (pinConfig >> 4) & 0xf
219  * pin = 1 << (pinConfig & 0xf)
220  *
221  * MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(port,
222  * pin, moduleFunction);
223  *
224  */
225 
226 #define PWMTimerMSP432_CCR1 (TIMER_A_CAPTURECOMPARE_REGISTER_1 << 20)
227 #define PWMTimerMSP432_CCR2 (TIMER_A_CAPTURECOMPARE_REGISTER_2 << 20)
228 #define PWMTimerMSP432_CCR3 (TIMER_A_CAPTURECOMPARE_REGISTER_3 << 20)
229 #define PWMTimerMSP432_CCR4 (TIMER_A_CAPTURECOMPARE_REGISTER_4 << 20)
230 
231 #define PWMTimerMSP432_TA0 (0 << 16)
232 #define PWMTimerMSP432_TA1 (1 << 16)
233 #define PWMTimerMSP432_TA2 (2 << 16)
234 #define PWMTimerMSP432_TA3 (3 << 16)
235 
236 #define PWMTimerMSP432_TA0CCR1 (PWMTimerMSP432_TA0 | PWMTimerMSP432_CCR1 | (PMAP_TA0CCR1A << 10))
237 #define PWMTimerMSP432_TA0CCR2 (PWMTimerMSP432_TA0 | PWMTimerMSP432_CCR2 | (PMAP_TA0CCR2A << 10))
238 #define PWMTimerMSP432_TA0CCR3 (PWMTimerMSP432_TA0 | PWMTimerMSP432_CCR3 | (PMAP_TA0CCR3A << 10))
239 #define PWMTimerMSP432_TA0CCR4 (PWMTimerMSP432_TA0 | PWMTimerMSP432_CCR4 | (PMAP_TA0CCR4A << 10))
240 
241 #define PWMTimerMSP432_TA1CCR1 (PWMTimerMSP432_TA1 | PWMTimerMSP432_CCR1 | (PMAP_TA1CCR1A << 10))
242 #define PWMTimerMSP432_TA1CCR2 (PWMTimerMSP432_TA1 | PWMTimerMSP432_CCR2 | (PMAP_TA1CCR2A << 10))
243 #define PWMTimerMSP432_TA1CCR3 (PWMTimerMSP432_TA1 | PWMTimerMSP432_CCR3 | (PMAP_TA1CCR3A << 10))
244 #define PWMTimerMSP432_TA1CCR4 (PWMTimerMSP432_TA1 | PWMTimerMSP432_CCR4 | (PMAP_TA1CCR4A << 10))
245 
246 #define PWMTimerMSP432_TA2CCR1 (PWMTimerMSP432_TA2 | PWMTimerMSP432_CCR1)
247 #define PWMTimerMSP432_TA2CCR2 (PWMTimerMSP432_TA2 | PWMTimerMSP432_CCR2)
248 #define PWMTimerMSP432_TA2CCR3 (PWMTimerMSP432_TA2 | PWMTimerMSP432_CCR3)
249 #define PWMTimerMSP432_TA2CCR4 (PWMTimerMSP432_TA2 | PWMTimerMSP432_CCR4)
250 
251 #define PWMTimerMSP432_TA3CCR1 (PWMTimerMSP432_TA3 | PWMTimerMSP432_CCR1)
252 #define PWMTimerMSP432_TA3CCR2 (PWMTimerMSP432_TA3 | PWMTimerMSP432_CCR2)
253 #define PWMTimerMSP432_TA3CCR3 (PWMTimerMSP432_TA3 | PWMTimerMSP432_CCR3)
254 #define PWMTimerMSP432_TA3CCR4 (PWMTimerMSP432_TA3 | PWMTimerMSP432_CCR4)
255 
266 #define PWMTimerMSP432_P2_0_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x20)
267 #define PWMTimerMSP432_P2_0_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x20)
268 #define PWMTimerMSP432_P2_0_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x20)
269 #define PWMTimerMSP432_P2_0_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x20)
270 #define PWMTimerMSP432_P2_0_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x20)
271 #define PWMTimerMSP432_P2_0_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x20)
272 #define PWMTimerMSP432_P2_0_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x20)
273 #define PWMTimerMSP432_P2_0_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x20)
280 #define PWMTimerMSP432_P2_1_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x21)
281 #define PWMTimerMSP432_P2_1_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x21)
282 #define PWMTimerMSP432_P2_1_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x21)
283 #define PWMTimerMSP432_P2_1_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x21)
284 #define PWMTimerMSP432_P2_1_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x21)
285 #define PWMTimerMSP432_P2_1_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x21)
286 #define PWMTimerMSP432_P2_1_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x21)
287 #define PWMTimerMSP432_P2_1_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x21)
294 #define PWMTimerMSP432_P2_2_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x22)
295 #define PWMTimerMSP432_P2_2_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x22)
296 #define PWMTimerMSP432_P2_2_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x22)
297 #define PWMTimerMSP432_P2_2_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x22)
298 #define PWMTimerMSP432_P2_2_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x22)
299 #define PWMTimerMSP432_P2_2_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x22)
300 #define PWMTimerMSP432_P2_2_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x22)
301 #define PWMTimerMSP432_P2_2_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x22)
308 #define PWMTimerMSP432_P2_3_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x23)
309 #define PWMTimerMSP432_P2_3_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x23)
310 #define PWMTimerMSP432_P2_3_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x23)
311 #define PWMTimerMSP432_P2_3_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x23)
312 #define PWMTimerMSP432_P2_3_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x23)
313 #define PWMTimerMSP432_P2_3_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x23)
314 #define PWMTimerMSP432_P2_3_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x23)
315 #define PWMTimerMSP432_P2_3_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x23)
322 #define PWMTimerMSP432_P2_4_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x24)
323 #define PWMTimerMSP432_P2_4_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x24)
324 #define PWMTimerMSP432_P2_4_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x24)
325 #define PWMTimerMSP432_P2_4_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x24)
326 #define PWMTimerMSP432_P2_4_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x24)
327 #define PWMTimerMSP432_P2_4_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x24)
328 #define PWMTimerMSP432_P2_4_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x24)
329 #define PWMTimerMSP432_P2_4_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x24)
336 #define PWMTimerMSP432_P2_5_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x25)
337 #define PWMTimerMSP432_P2_5_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x25)
338 #define PWMTimerMSP432_P2_5_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x25)
339 #define PWMTimerMSP432_P2_5_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x25)
340 #define PWMTimerMSP432_P2_5_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x25)
341 #define PWMTimerMSP432_P2_5_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x25)
342 #define PWMTimerMSP432_P2_5_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x25)
343 #define PWMTimerMSP432_P2_5_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x25)
350 #define PWMTimerMSP432_P2_6_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x26)
351 #define PWMTimerMSP432_P2_6_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x26)
352 #define PWMTimerMSP432_P2_6_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x26)
353 #define PWMTimerMSP432_P2_6_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x26)
354 #define PWMTimerMSP432_P2_6_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x26)
355 #define PWMTimerMSP432_P2_6_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x26)
356 #define PWMTimerMSP432_P2_6_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x26)
357 #define PWMTimerMSP432_P2_6_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x26)
364 #define PWMTimerMSP432_P2_7_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x27)
365 #define PWMTimerMSP432_P2_7_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x27)
366 #define PWMTimerMSP432_P2_7_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x27)
367 #define PWMTimerMSP432_P2_7_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x27)
368 #define PWMTimerMSP432_P2_7_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x27)
369 #define PWMTimerMSP432_P2_7_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x27)
370 #define PWMTimerMSP432_P2_7_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x27)
371 #define PWMTimerMSP432_P2_7_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x27)
378 #define PWMTimerMSP432_P3_0_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x30)
379 #define PWMTimerMSP432_P3_0_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x30)
380 #define PWMTimerMSP432_P3_0_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x30)
381 #define PWMTimerMSP432_P3_0_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x30)
382 #define PWMTimerMSP432_P3_0_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x30)
383 #define PWMTimerMSP432_P3_0_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x30)
384 #define PWMTimerMSP432_P3_0_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x30)
385 #define PWMTimerMSP432_P3_0_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x30)
392 #define PWMTimerMSP432_P3_1_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x31)
393 #define PWMTimerMSP432_P3_1_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x31)
394 #define PWMTimerMSP432_P3_1_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x31)
395 #define PWMTimerMSP432_P3_1_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x31)
396 #define PWMTimerMSP432_P3_1_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x31)
397 #define PWMTimerMSP432_P3_1_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x31)
398 #define PWMTimerMSP432_P3_1_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x31)
399 #define PWMTimerMSP432_P3_1_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x31)
406 #define PWMTimerMSP432_P3_2_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x32)
407 #define PWMTimerMSP432_P3_2_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x32)
408 #define PWMTimerMSP432_P3_2_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x32)
409 #define PWMTimerMSP432_P3_2_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x32)
410 #define PWMTimerMSP432_P3_2_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x32)
411 #define PWMTimerMSP432_P3_2_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x32)
412 #define PWMTimerMSP432_P3_2_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x32)
413 #define PWMTimerMSP432_P3_2_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x32)
420 #define PWMTimerMSP432_P3_3_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x33)
421 #define PWMTimerMSP432_P3_3_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x33)
422 #define PWMTimerMSP432_P3_3_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x33)
423 #define PWMTimerMSP432_P3_3_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x33)
424 #define PWMTimerMSP432_P3_3_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x33)
425 #define PWMTimerMSP432_P3_3_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x33)
426 #define PWMTimerMSP432_P3_3_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x33)
427 #define PWMTimerMSP432_P3_3_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x33)
434 #define PWMTimerMSP432_P3_4_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x34)
435 #define PWMTimerMSP432_P3_4_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x34)
436 #define PWMTimerMSP432_P3_4_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x34)
437 #define PWMTimerMSP432_P3_4_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x34)
438 #define PWMTimerMSP432_P3_4_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x34)
439 #define PWMTimerMSP432_P3_4_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x34)
440 #define PWMTimerMSP432_P3_4_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x34)
441 #define PWMTimerMSP432_P3_4_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x34)
448 #define PWMTimerMSP432_P3_5_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x35)
449 #define PWMTimerMSP432_P3_5_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x35)
450 #define PWMTimerMSP432_P3_5_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x35)
451 #define PWMTimerMSP432_P3_5_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x35)
452 #define PWMTimerMSP432_P3_5_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x35)
453 #define PWMTimerMSP432_P3_5_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x35)
454 #define PWMTimerMSP432_P3_5_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x35)
455 #define PWMTimerMSP432_P3_5_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x35)
462 #define PWMTimerMSP432_P3_6_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x36)
463 #define PWMTimerMSP432_P3_6_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x36)
464 #define PWMTimerMSP432_P3_6_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x36)
465 #define PWMTimerMSP432_P3_6_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x36)
466 #define PWMTimerMSP432_P3_6_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x36)
467 #define PWMTimerMSP432_P3_6_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x36)
468 #define PWMTimerMSP432_P3_6_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x36)
469 #define PWMTimerMSP432_P3_6_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x36)
476 #define PWMTimerMSP432_P3_7_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x37)
477 #define PWMTimerMSP432_P3_7_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x37)
478 #define PWMTimerMSP432_P3_7_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x37)
479 #define PWMTimerMSP432_P3_7_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x37)
480 #define PWMTimerMSP432_P3_7_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x37)
481 #define PWMTimerMSP432_P3_7_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x37)
482 #define PWMTimerMSP432_P3_7_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x37)
483 #define PWMTimerMSP432_P3_7_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x37)
490 #define PWMTimerMSP432_P5_6_TA2CCR1A (PWMTimerMSP432_TA2CCR1 | 0x156)
491 #define PWMTimerMSP432_P5_7_TA2CCR2A (PWMTimerMSP432_TA2CCR2 | 0x157)
498 #define PWMTimerMSP432_P6_6_TA2CCR3A (PWMTimerMSP432_TA2CCR3 | 0x166)
499 #define PWMTimerMSP432_P6_7_TA2CCR4A (PWMTimerMSP432_TA2CCR4 | 0x167)
506 #define PWMTimerMSP432_P7_0_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x70)
507 #define PWMTimerMSP432_P7_0_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x70)
508 #define PWMTimerMSP432_P7_0_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x70)
509 #define PWMTimerMSP432_P7_0_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x70)
510 #define PWMTimerMSP432_P7_0_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x70)
511 #define PWMTimerMSP432_P7_0_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x70)
512 #define PWMTimerMSP432_P7_0_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x70)
513 #define PWMTimerMSP432_P7_0_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x70)
520 #define PWMTimerMSP432_P7_1_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x71)
521 #define PWMTimerMSP432_P7_1_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x71)
522 #define PWMTimerMSP432_P7_1_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x71)
523 #define PWMTimerMSP432_P7_1_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x71)
524 #define PWMTimerMSP432_P7_1_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x71)
525 #define PWMTimerMSP432_P7_1_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x71)
526 #define PWMTimerMSP432_P7_1_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x71)
527 #define PWMTimerMSP432_P7_1_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x71)
534 #define PWMTimerMSP432_P7_2_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x72)
535 #define PWMTimerMSP432_P7_2_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x72)
536 #define PWMTimerMSP432_P7_2_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x72)
537 #define PWMTimerMSP432_P7_2_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x72)
538 #define PWMTimerMSP432_P7_2_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x72)
539 #define PWMTimerMSP432_P7_2_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x72)
540 #define PWMTimerMSP432_P7_2_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x72)
541 #define PWMTimerMSP432_P7_2_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x72)
548 #define PWMTimerMSP432_P7_3_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x73)
549 #define PWMTimerMSP432_P7_3_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x73)
550 #define PWMTimerMSP432_P7_3_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x73)
551 #define PWMTimerMSP432_P7_3_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x73)
552 #define PWMTimerMSP432_P7_3_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x73)
553 #define PWMTimerMSP432_P7_3_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x73)
554 #define PWMTimerMSP432_P7_3_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x73)
555 #define PWMTimerMSP432_P7_3_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x73)
562 #define PWMTimerMSP432_P7_4_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x74)
563 #define PWMTimerMSP432_P7_4_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x74)
564 #define PWMTimerMSP432_P7_4_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x74)
565 #define PWMTimerMSP432_P7_4_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x74)
566 #define PWMTimerMSP432_P7_4_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x74)
567 #define PWMTimerMSP432_P7_4_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x74)
568 #define PWMTimerMSP432_P7_4_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x74)
569 #define PWMTimerMSP432_P7_4_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x74)
576 #define PWMTimerMSP432_P7_5_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x75)
577 #define PWMTimerMSP432_P7_5_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x75)
578 #define PWMTimerMSP432_P7_5_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x75)
579 #define PWMTimerMSP432_P7_5_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x75)
580 #define PWMTimerMSP432_P7_5_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x75)
581 #define PWMTimerMSP432_P7_5_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x75)
582 #define PWMTimerMSP432_P7_5_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x75)
583 #define PWMTimerMSP432_P7_5_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x75)
590 #define PWMTimerMSP432_P7_6_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x76)
591 #define PWMTimerMSP432_P7_6_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x76)
592 #define PWMTimerMSP432_P7_6_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x76)
593 #define PWMTimerMSP432_P7_6_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x76)
594 #define PWMTimerMSP432_P7_6_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x76)
595 #define PWMTimerMSP432_P7_6_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x76)
596 #define PWMTimerMSP432_P7_6_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x76)
597 #define PWMTimerMSP432_P7_6_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x76)
604 #define PWMTimerMSP432_P7_7_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x77)
605 #define PWMTimerMSP432_P7_7_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x77)
606 #define PWMTimerMSP432_P7_7_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x77)
607 #define PWMTimerMSP432_P7_7_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x77)
608 #define PWMTimerMSP432_P7_7_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x77)
609 #define PWMTimerMSP432_P7_7_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x77)
610 #define PWMTimerMSP432_P7_7_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x77)
611 #define PWMTimerMSP432_P7_7_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x77)
618 #define PWMTimerMSP432_P8_2_TA3CCR2A (PWMTimerMSP342_TA3CCR2 | 0x182)
625 #define PWMTimerMSP432_P9_2_TA3CCR3A (PWMTimerMSP432_TA3CCR3 | 0x192)
626 #define PWMTimerMSP432_P9_3_TA3CCR4A (PWMTimerMSP432_TA3CCR4 | 0x193)
640 /* Add PWMTimerMSP432_STATUS_* macros here */
641 
654 /* Add PWMTimerMSP432_CMD_* macros here */
655 
659 /* Number of Timer_A peripherals available on a device. */
660 #define PWMTimerMSP432_NUM_TIMERS (4)
661 
662 /* Number of PWM outputs a Timer_A peripheral can generate. */
663 #define PWMTimerMSP432_NUM_PWM_OUTPUTS (6)
664 
666 /* PWM function table pointer */
668 
692 typedef struct PWMTimerMSP432_HWAttrsV2 {
693  uint16_t clockSource;
694  uint32_t pwmPin;
697 
703 typedef struct PWMTimerMSP432_Status {
704  uint32_t duties[PWMTimerMSP432_NUM_PWM_OUTPUTS];
705  uint32_t period;
706  uint8_t prescalar;
709 
715 typedef struct PWMTimerMSP432_Object {
717  uint32_t timerBaseAddr; /* PWMTimer base address */
718  PWM_Period_Units periodUnits; /* Current period unit */
719  PWM_Duty_Units dutyUnits; /* Current duty cycle unit */
720  PWM_IdleLevel idleLevel; /* PWM idle level when stopped */
721  uint8_t compareOutputNum; /* Timer's compare output */
722  /* number */
723  bool pwmStarted; /* Used to gate Power_setConstraint() */
724  /* and Power_releaseConstraint() calls */
725  bool isOpen; /* open flag used to check if PWM */
726  /* is opened */
728 
729 #ifdef __cplusplus
730 }
731 #endif
732 
733 #endif /* ti_driver_pwm_PWMTimerMSP432__include */
uint32_t pwmPin
Definition: PWMTimerMSP432.h:694
bool isOpen
Definition: PWMTimerMSP432.h:725
struct PWMTimerMSP432_Object PWMTimerMSP432_Object
PWMTimerMSP432 Object.
PWM_Duty_Units dutyUnits
Definition: PWMTimerMSP432.h:719
PWM_Period_Units periodUnits
Definition: PWMTimerMSP432.h:718
PWMTimerMSP432 Hardware attributes.
Definition: PWMTimerMSP432.h:692
struct PWMTimerMSP432_HWAttrsV2 PWMTimerMSP432_HWAttrsV2
PWMTimerMSP432 Hardware attributes.
PWMTimerMSP432_Status.
Definition: PWMTimerMSP432.h:703
const PWM_FxnTable PWMTimerMSP432_fxnTable
uint16_t clockSource
Definition: PWMTimerMSP432.h:693
PWM driver interface.
The definition of a PWM function table that contains the required set of functions to control a speci...
Definition: PWM.h:407
uint32_t timerBaseAddr
Definition: PWMTimerMSP432.h:717
PWMTimerMSP432_Status * timerStatusStruct
Definition: PWMTimerMSP432.h:716
PWMTimerMSP432 Object.
Definition: PWMTimerMSP432.h:715
enum PWM_Period_Units_ PWM_Period_Units
PWM period unit definitions. Refer to device specific implementation if using PWM_PERIOD_COUNTS (raw ...
bool pwmStarted
Definition: PWMTimerMSP432.h:723
uint8_t prescalar
Definition: PWMTimerMSP432.h:706
PWM_IdleLevel idleLevel
Definition: PWMTimerMSP432.h:720
uint8_t activeOutputsMask
Definition: PWMTimerMSP432.h:707
enum PWM_IdleLevel_ PWM_IdleLevel
Idle output level when PWM is not running (stopped / not started).
uint8_t compareOutputNum
Definition: PWMTimerMSP432.h:721
struct PWMTimerMSP432_Status PWMTimerMSP432_Status
PWMTimerMSP432_Status.
uint32_t period
Definition: PWMTimerMSP432.h:705
enum PWM_Duty_Units_ PWM_Duty_Units
PWM duty cycle unit definitions. Refer to device specific implementation if using PWM_DUTY_COUNTS (ra...
Copyright 2017, Texas Instruments Incorporated