SimpleLink MCU SDK Driver APIs  tidrivers_msp43x_3_01_01_03
PWMTimerMSP432.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2016, 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 #include <ti/drivers/PWM.h>
170 
171 #include <ti/devices/msp432p4xx/driverlib/pmap.h>
172 #include <ti/devices/msp432p4xx/driverlib/timer_a.h>
173 
175 /*
176  * PWMTimer port/pin defines for pin configuration. Ports P2, P3, and P7 are
177  * configurable through the port mapping controller.
178  * Value specifies the pin function and ranges from 0 to 31
179  * pin range: 0 - 7, port range: 0 - 15.
180  * The timer id (0, 1, 2, 3, or 4) is stored in bits 16 - 19
181  * The capture compare register is stored in bits 20 - 23.
182  *
183  *
184  * 23 - 20 19 - 16 15 - 10 9 8 7 - 4 3 - 0
185  * ---------------------------------------------------
186  * | CCR | Timer id | VALUE | X | X | PORT | PIN |
187  * ---------------------------------------------------
188  *
189  * value = pinConfig >> 10
190  * port = (pinConfig >> 4) & 0xf
191  * pin = pinConfig & 0x7
192  * ccr = (pinConfig >> 16) & 0xf
193  *
194  * pmap = port * 0x8; // 2 -> 0x10, 3 -> 0x18, 7 -> 0x38
195  * portMapReconfigure = PMAP_ENABLE_RECONFIGURATION;
196  *
197  * Code from pmap.c:
198  * //Get write-access to port mapping registers:
199  * PMAP->KEYID = PMAP_KEYID_VAL;
200  *
201  * //Enable/Disable reconfiguration during runtime
202  * PMAP->CTL = (PMAP->CTL & ~PMAP_CTL_PRECFG) | portMapReconfigure;
203  * HWREG8(PMAP_BASE + pin + pmap) = value;
204  *
205  * For non-configurable ports (bits 20 - 12 will be 0).
206  * Bits 8 and 9 hold the module function (PRIMARY, SECONDARY, or
207  * TERTIALRY).
208  *
209  * 23 - 20 19 - 16 15 - 10 9 8 7 - 4 3 - 0
210  * -----------------------------------------------------------------
211  * | CCR | Timer id | 0 | PnSEL1.x | PnSEL0.x | PORT | PIN |
212  * -----------------------------------------------------------------
213  *
214  * moduleFunction = (pinConfig >> 8) & 0x3
215  * port = (pinConfig >> 4) & 0xf
216  * pin = 1 << (pinConfig & 0xf)
217  *
218  * MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(port,
219  * pin, moduleFunction);
220  *
221  */
222 
223 #define PWMTimerMSP432_CCR1 (TIMER_A_CAPTURECOMPARE_REGISTER_1 << 20)
224 #define PWMTimerMSP432_CCR2 (TIMER_A_CAPTURECOMPARE_REGISTER_2 << 20)
225 #define PWMTimerMSP432_CCR3 (TIMER_A_CAPTURECOMPARE_REGISTER_3 << 20)
226 #define PWMTimerMSP432_CCR4 (TIMER_A_CAPTURECOMPARE_REGISTER_4 << 20)
227 
228 #define PWMTimerMSP432_TA0 (0 << 16)
229 #define PWMTimerMSP432_TA1 (1 << 16)
230 #define PWMTimerMSP432_TA2 (2 << 16)
231 #define PWMTimerMSP432_TA3 (3 << 16)
232 
233 #define PWMTimerMSP432_TA0CCR1 (PWMTimerMSP432_TA0 | PWMTimerMSP432_CCR1 | (PMAP_TA0CCR1A << 10))
234 #define PWMTimerMSP432_TA0CCR2 (PWMTimerMSP432_TA0 | PWMTimerMSP432_CCR2 | (PMAP_TA0CCR2A << 10))
235 #define PWMTimerMSP432_TA0CCR3 (PWMTimerMSP432_TA0 | PWMTimerMSP432_CCR3 | (PMAP_TA0CCR3A << 10))
236 #define PWMTimerMSP432_TA0CCR4 (PWMTimerMSP432_TA0 | PWMTimerMSP432_CCR4 | (PMAP_TA0CCR4A << 10))
237 
238 #define PWMTimerMSP432_TA1CCR1 (PWMTimerMSP432_TA1 | PWMTimerMSP432_CCR1 | (PMAP_TA1CCR1A << 10))
239 #define PWMTimerMSP432_TA1CCR2 (PWMTimerMSP432_TA1 | PWMTimerMSP432_CCR2 | (PMAP_TA1CCR2A << 10))
240 #define PWMTimerMSP432_TA1CCR3 (PWMTimerMSP432_TA1 | PWMTimerMSP432_CCR3 | (PMAP_TA1CCR3A << 10))
241 #define PWMTimerMSP432_TA1CCR4 (PWMTimerMSP432_TA1 | PWMTimerMSP432_CCR4 | (PMAP_TA1CCR4A << 10))
242 
243 #define PWMTimerMSP432_TA2CCR1 (PWMTimerMSP432_TA2 | PWMTimerMSP432_CCR1)
244 #define PWMTimerMSP432_TA2CCR2 (PWMTimerMSP432_TA2 | PWMTimerMSP432_CCR2)
245 #define PWMTimerMSP432_TA2CCR3 (PWMTimerMSP432_TA2 | PWMTimerMSP432_CCR3)
246 #define PWMTimerMSP432_TA2CCR4 (PWMTimerMSP432_TA2 | PWMTimerMSP432_CCR4)
247 
248 #define PWMTimerMSP432_TA3CCR1 (PWMTimerMSP432_TA3 | PWMTimerMSP432_CCR1)
249 #define PWMTimerMSP432_TA3CCR2 (PWMTimerMSP432_TA3 | PWMTimerMSP432_CCR2)
250 #define PWMTimerMSP432_TA3CCR3 (PWMTimerMSP432_TA3 | PWMTimerMSP432_CCR3)
251 #define PWMTimerMSP432_TA3CCR4 (PWMTimerMSP432_TA3 | PWMTimerMSP432_CCR4)
252 
263 #define PWMTimerMSP432_P2_0_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x20)
264 #define PWMTimerMSP432_P2_0_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x20)
265 #define PWMTimerMSP432_P2_0_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x20)
266 #define PWMTimerMSP432_P2_0_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x20)
267 #define PWMTimerMSP432_P2_0_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x20)
268 #define PWMTimerMSP432_P2_0_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x20)
269 #define PWMTimerMSP432_P2_0_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x20)
270 #define PWMTimerMSP432_P2_0_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x20)
277 #define PWMTimerMSP432_P2_1_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x21)
278 #define PWMTimerMSP432_P2_1_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x21)
279 #define PWMTimerMSP432_P2_1_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x21)
280 #define PWMTimerMSP432_P2_1_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x21)
281 #define PWMTimerMSP432_P2_1_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x21)
282 #define PWMTimerMSP432_P2_1_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x21)
283 #define PWMTimerMSP432_P2_1_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x21)
284 #define PWMTimerMSP432_P2_1_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x21)
291 #define PWMTimerMSP432_P2_2_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x22)
292 #define PWMTimerMSP432_P2_2_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x22)
293 #define PWMTimerMSP432_P2_2_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x22)
294 #define PWMTimerMSP432_P2_2_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x22)
295 #define PWMTimerMSP432_P2_2_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x22)
296 #define PWMTimerMSP432_P2_2_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x22)
297 #define PWMTimerMSP432_P2_2_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x22)
298 #define PWMTimerMSP432_P2_2_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x22)
305 #define PWMTimerMSP432_P2_3_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x23)
306 #define PWMTimerMSP432_P2_3_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x23)
307 #define PWMTimerMSP432_P2_3_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x23)
308 #define PWMTimerMSP432_P2_3_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x23)
309 #define PWMTimerMSP432_P2_3_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x23)
310 #define PWMTimerMSP432_P2_3_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x23)
311 #define PWMTimerMSP432_P2_3_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x23)
312 #define PWMTimerMSP432_P2_3_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x23)
319 #define PWMTimerMSP432_P2_4_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x24)
320 #define PWMTimerMSP432_P2_4_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x24)
321 #define PWMTimerMSP432_P2_4_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x24)
322 #define PWMTimerMSP432_P2_4_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x24)
323 #define PWMTimerMSP432_P2_4_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x24)
324 #define PWMTimerMSP432_P2_4_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x24)
325 #define PWMTimerMSP432_P2_4_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x24)
326 #define PWMTimerMSP432_P2_4_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x24)
333 #define PWMTimerMSP432_P2_5_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x25)
334 #define PWMTimerMSP432_P2_5_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x25)
335 #define PWMTimerMSP432_P2_5_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x25)
336 #define PWMTimerMSP432_P2_5_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x25)
337 #define PWMTimerMSP432_P2_5_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x25)
338 #define PWMTimerMSP432_P2_5_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x25)
339 #define PWMTimerMSP432_P2_5_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x25)
340 #define PWMTimerMSP432_P2_5_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x25)
347 #define PWMTimerMSP432_P2_6_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x26)
348 #define PWMTimerMSP432_P2_6_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x26)
349 #define PWMTimerMSP432_P2_6_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x26)
350 #define PWMTimerMSP432_P2_6_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x26)
351 #define PWMTimerMSP432_P2_6_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x26)
352 #define PWMTimerMSP432_P2_6_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x26)
353 #define PWMTimerMSP432_P2_6_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x26)
354 #define PWMTimerMSP432_P2_6_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x26)
361 #define PWMTimerMSP432_P2_7_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x27)
362 #define PWMTimerMSP432_P2_7_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x27)
363 #define PWMTimerMSP432_P2_7_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x27)
364 #define PWMTimerMSP432_P2_7_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x27)
365 #define PWMTimerMSP432_P2_7_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x27)
366 #define PWMTimerMSP432_P2_7_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x27)
367 #define PWMTimerMSP432_P2_7_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x27)
368 #define PWMTimerMSP432_P2_7_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x27)
375 #define PWMTimerMSP432_P3_0_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x30)
376 #define PWMTimerMSP432_P3_0_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x30)
377 #define PWMTimerMSP432_P3_0_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x30)
378 #define PWMTimerMSP432_P3_0_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x30)
379 #define PWMTimerMSP432_P3_0_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x30)
380 #define PWMTimerMSP432_P3_0_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x30)
381 #define PWMTimerMSP432_P3_0_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x30)
382 #define PWMTimerMSP432_P3_0_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x30)
389 #define PWMTimerMSP432_P3_1_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x31)
390 #define PWMTimerMSP432_P3_1_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x31)
391 #define PWMTimerMSP432_P3_1_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x31)
392 #define PWMTimerMSP432_P3_1_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x31)
393 #define PWMTimerMSP432_P3_1_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x31)
394 #define PWMTimerMSP432_P3_1_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x31)
395 #define PWMTimerMSP432_P3_1_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x31)
396 #define PWMTimerMSP432_P3_1_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x31)
403 #define PWMTimerMSP432_P3_2_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x32)
404 #define PWMTimerMSP432_P3_2_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x32)
405 #define PWMTimerMSP432_P3_2_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x32)
406 #define PWMTimerMSP432_P3_2_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x32)
407 #define PWMTimerMSP432_P3_2_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x32)
408 #define PWMTimerMSP432_P3_2_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x32)
409 #define PWMTimerMSP432_P3_2_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x32)
410 #define PWMTimerMSP432_P3_2_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x32)
417 #define PWMTimerMSP432_P3_3_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x33)
418 #define PWMTimerMSP432_P3_3_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x33)
419 #define PWMTimerMSP432_P3_3_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x33)
420 #define PWMTimerMSP432_P3_3_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x33)
421 #define PWMTimerMSP432_P3_3_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x33)
422 #define PWMTimerMSP432_P3_3_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x33)
423 #define PWMTimerMSP432_P3_3_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x33)
424 #define PWMTimerMSP432_P3_3_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x33)
431 #define PWMTimerMSP432_P3_4_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x34)
432 #define PWMTimerMSP432_P3_4_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x34)
433 #define PWMTimerMSP432_P3_4_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x34)
434 #define PWMTimerMSP432_P3_4_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x34)
435 #define PWMTimerMSP432_P3_4_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x34)
436 #define PWMTimerMSP432_P3_4_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x34)
437 #define PWMTimerMSP432_P3_4_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x34)
438 #define PWMTimerMSP432_P3_4_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x34)
445 #define PWMTimerMSP432_P3_5_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x35)
446 #define PWMTimerMSP432_P3_5_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x35)
447 #define PWMTimerMSP432_P3_5_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x35)
448 #define PWMTimerMSP432_P3_5_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x35)
449 #define PWMTimerMSP432_P3_5_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x35)
450 #define PWMTimerMSP432_P3_5_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x35)
451 #define PWMTimerMSP432_P3_5_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x35)
452 #define PWMTimerMSP432_P3_5_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x35)
459 #define PWMTimerMSP432_P3_6_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x36)
460 #define PWMTimerMSP432_P3_6_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x36)
461 #define PWMTimerMSP432_P3_6_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x36)
462 #define PWMTimerMSP432_P3_6_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x36)
463 #define PWMTimerMSP432_P3_6_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x36)
464 #define PWMTimerMSP432_P3_6_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x36)
465 #define PWMTimerMSP432_P3_6_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x36)
466 #define PWMTimerMSP432_P3_6_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x36)
473 #define PWMTimerMSP432_P3_7_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x37)
474 #define PWMTimerMSP432_P3_7_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x37)
475 #define PWMTimerMSP432_P3_7_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x37)
476 #define PWMTimerMSP432_P3_7_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x37)
477 #define PWMTimerMSP432_P3_7_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x37)
478 #define PWMTimerMSP432_P3_7_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x37)
479 #define PWMTimerMSP432_P3_7_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x37)
480 #define PWMTimerMSP432_P3_7_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x37)
487 #define PWMTimerMSP432_P5_6_TA2CCR1A (PWMTimerMSP432_TA2CCR1 | 0x156)
488 #define PWMTimerMSP432_P5_7_TA2CCR2A (PWMTimerMSP342_TA2CCR2 | 0x157)
495 #define PWMTimerMSP432_P6_6_TA2CCR3A (PWMTimerMSP432_TA2CCR3 | 0x166)
496 #define PWMTimerMSP432_P6_7_TA2CCR4A (PWMTimerMSP432_TA2CCR4 | 0x167)
503 #define PWMTimerMSP432_P7_0_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x70)
504 #define PWMTimerMSP432_P7_0_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x70)
505 #define PWMTimerMSP432_P7_0_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x70)
506 #define PWMTimerMSP432_P7_0_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x70)
507 #define PWMTimerMSP432_P7_0_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x70)
508 #define PWMTimerMSP432_P7_0_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x70)
509 #define PWMTimerMSP432_P7_0_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x70)
510 #define PWMTimerMSP432_P7_0_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x70)
517 #define PWMTimerMSP432_P7_1_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x71)
518 #define PWMTimerMSP432_P7_1_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x71)
519 #define PWMTimerMSP432_P7_1_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x71)
520 #define PWMTimerMSP432_P7_1_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x71)
521 #define PWMTimerMSP432_P7_1_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x71)
522 #define PWMTimerMSP432_P7_1_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x71)
523 #define PWMTimerMSP432_P7_1_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x71)
524 #define PWMTimerMSP432_P7_1_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x71)
531 #define PWMTimerMSP432_P7_2_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x72)
532 #define PWMTimerMSP432_P7_2_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x72)
533 #define PWMTimerMSP432_P7_2_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x72)
534 #define PWMTimerMSP432_P7_2_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x72)
535 #define PWMTimerMSP432_P7_2_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x72)
536 #define PWMTimerMSP432_P7_2_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x72)
537 #define PWMTimerMSP432_P7_2_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x72)
538 #define PWMTimerMSP432_P7_2_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x72)
545 #define PWMTimerMSP432_P7_3_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x73)
546 #define PWMTimerMSP432_P7_3_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x73)
547 #define PWMTimerMSP432_P7_3_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x73)
548 #define PWMTimerMSP432_P7_3_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x73)
549 #define PWMTimerMSP432_P7_3_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x73)
550 #define PWMTimerMSP432_P7_3_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x73)
551 #define PWMTimerMSP432_P7_3_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x73)
552 #define PWMTimerMSP432_P7_3_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x73)
559 #define PWMTimerMSP432_P7_4_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x74)
560 #define PWMTimerMSP432_P7_4_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x74)
561 #define PWMTimerMSP432_P7_4_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x74)
562 #define PWMTimerMSP432_P7_4_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x74)
563 #define PWMTimerMSP432_P7_4_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x74)
564 #define PWMTimerMSP432_P7_4_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x74)
565 #define PWMTimerMSP432_P7_4_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x74)
566 #define PWMTimerMSP432_P7_4_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x74)
573 #define PWMTimerMSP432_P7_5_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x75)
574 #define PWMTimerMSP432_P7_5_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x75)
575 #define PWMTimerMSP432_P7_5_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x75)
576 #define PWMTimerMSP432_P7_5_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x75)
577 #define PWMTimerMSP432_P7_5_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x75)
578 #define PWMTimerMSP432_P7_5_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x75)
579 #define PWMTimerMSP432_P7_5_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x75)
580 #define PWMTimerMSP432_P7_5_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x75)
587 #define PWMTimerMSP432_P7_6_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x76)
588 #define PWMTimerMSP432_P7_6_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x76)
589 #define PWMTimerMSP432_P7_6_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x76)
590 #define PWMTimerMSP432_P7_6_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x76)
591 #define PWMTimerMSP432_P7_6_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x76)
592 #define PWMTimerMSP432_P7_6_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x76)
593 #define PWMTimerMSP432_P7_6_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x76)
594 #define PWMTimerMSP432_P7_6_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x76)
601 #define PWMTimerMSP432_P7_7_TA0CCR1A (PWMTimerMSP432_TA0CCR1 | 0x77)
602 #define PWMTimerMSP432_P7_7_TA0CCR2A (PWMTimerMSP432_TA0CCR2 | 0x77)
603 #define PWMTimerMSP432_P7_7_TA0CCR3A (PWMTimerMSP432_TA0CCR3 | 0x77)
604 #define PWMTimerMSP432_P7_7_TA0CCR4A (PWMTimerMSP432_TA0CCR4 | 0x77)
605 #define PWMTimerMSP432_P7_7_TA1CCR1A (PWMTimerMSP432_TA1CCR1 | 0x77)
606 #define PWMTimerMSP432_P7_7_TA1CCR2A (PWMTimerMSP432_TA1CCR2 | 0x77)
607 #define PWMTimerMSP432_P7_7_TA1CCR3A (PWMTimerMSP432_TA1CCR3 | 0x77)
608 #define PWMTimerMSP432_P7_7_TA1CCR4A (PWMTimerMSP432_TA1CCR4 | 0x77)
615 #define PWMTimerMSP432_P8_2_TA3CCR2A (PWMTimerMSP342_TA3CCR2 | 0x182)
622 #define PWMTimerMSP432_P9_2_TA3CCR3A (PWMTimerMSP432_TA3CCR3 | 0x192)
623 #define PWMTimerMSP432_P9_3_TA3CCR4A (PWMTimerMSP432_TA3CCR4 | 0x193)
637 /* Add PWMTimerMSP432_STATUS_* macros here */
638 
651 /* Add PWMTimerMSP432_CMD_* macros here */
652 
656 /* Number of Timer_A peripherals available on a device. */
657 #define PWMTimerMSP432_NUM_TIMERS (4)
658 
659 /* Number of PWM outputs a Timer_A peripheral can generate. */
660 #define PWMTimerMSP432_NUM_PWM_OUTPUTS (6)
661 
663 /* PWM function table pointer */
665 
689 typedef struct PWMTimerMSP432_HWAttrsV2 {
690  uint16_t clockSource;
691  uint32_t pwmPin;
694 
700 typedef struct PWMTimerMSP432_Status {
701  uint32_t duties[PWMTimerMSP432_NUM_PWM_OUTPUTS];
702  uint32_t period;
703  uint8_t prescalar;
706 
712 typedef struct PWMTimerMSP432_Object {
714  uint32_t timerBaseAddr; /* PWMTimer base address */
715  PWM_Period_Units periodUnits; /* Current period unit */
716  PWM_Duty_Units dutyUnits; /* Current duty cycle unit */
717  PWM_IdleLevel idleLevel; /* PWM idle level when stopped */
718  uint8_t compareOutputNum; /* Timer's compare output */
719  /* number */
720  bool pwmStarted; /* Used to gate Power_setConstraint() */
721  /* and Power_releaseConstraint() calls */
722  bool isOpen; /* open flag used to check if PWM */
723  /* is opened */
725 
726 #ifdef __cplusplus
727 }
728 #endif
729 
730 #endif /* ti_driver_pwm_PWMTimerMSP432__include */
uint32_t pwmPin
Definition: PWMTimerMSP432.h:691
uint32_t duties[PWMTimerMSP432_NUM_PWM_OUTPUTS]
Definition: PWMTimerMSP432.h:701
bool isOpen
Definition: PWMTimerMSP432.h:722
struct PWMTimerMSP432_Object PWMTimerMSP432_Object
PWMTimerMSP432 Object.
PWM_Duty_Units dutyUnits
Definition: PWMTimerMSP432.h:716
PWM_Period_Units periodUnits
Definition: PWMTimerMSP432.h:715
PWMTimerMSP432 Hardware attributes.
Definition: PWMTimerMSP432.h:689
struct PWMTimerMSP432_HWAttrsV2 PWMTimerMSP432_HWAttrsV2
PWMTimerMSP432 Hardware attributes.
PWMTimerMSP432_Status.
Definition: PWMTimerMSP432.h:700
const PWM_FxnTable PWMTimerMSP432_fxnTable
uint16_t clockSource
Definition: PWMTimerMSP432.h:690
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:714
PWMTimerMSP432_Status * timerStatusStruct
Definition: PWMTimerMSP432.h:713
PWMTimerMSP432 Object.
Definition: PWMTimerMSP432.h:712
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:720
uint8_t prescalar
Definition: PWMTimerMSP432.h:703
PWM_IdleLevel idleLevel
Definition: PWMTimerMSP432.h:717
uint8_t activeOutputsMask
Definition: PWMTimerMSP432.h:704
enum PWM_IdleLevel_ PWM_IdleLevel
Idle output level when PWM is not running (stopped / not started).
uint8_t compareOutputNum
Definition: PWMTimerMSP432.h:718
struct PWMTimerMSP432_Status PWMTimerMSP432_Status
PWMTimerMSP432_Status.
uint32_t period
Definition: PWMTimerMSP432.h:702
enum PWM_Duty_Units_ PWM_Duty_Units
PWM duty cycle unit definitions. Refer to device specific implementation if using PWM_DUTY_COUNTS (ra...
Copyright 2016, Texas Instruments Incorporated