TI-RTOS for SimpleLink Wireless MCUs  2.14.03.28
PWMTiva.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015, 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  */
100 #ifndef ti_driver_pwm_PWMTiva__include
101 #define ti_driver_pwm_PWMTiva__include
102 
103 #ifdef __cplusplus
104 extern "C" {
105 #endif
106 
107 #include <ti/drivers/PWM.h>
108 
109 /* Number of PWM peripherals available on a device */
110 #define PWMTiva_NUM_PWM_PERIPHERALS 2
111 
112 /* Number of signal generator blocks per PWM peripheral */
113 #define PWMTiva_NUM_PWM_GENERATORS 4
114 
115 /* PWM_control commands */
116 #define PWMTiva_CHANGE_GEN_PERIOD PWM_CMD_RESERVED + 0
117 
118 /* PWM function table pointer */
119 extern const PWM_FxnTable PWMTiva_fxnTable;
120 
139 typedef struct PWMTiva_HWAttrs {
140  uint32_t baseAddr;
141  uint32_t pwmOutput;
142  uint32_t pwmGenOpts;
144 
150 typedef struct PWMTiva_Status {
153  uint8_t prescalar;
154  uint8_t activeOutputs;
156 
162 typedef struct PWMTiva_Object {
164  uint16_t pwmDuty;
165  uint8_t pwmOutputBit;
166  uint8_t dutyMode; /* Units in which duty is specified */
168 
169 #ifdef __cplusplus
170 }
171 #endif
172 
173 #endif /* ti_driver_pwm_PWMTiva__include */
const PWM_FxnTable PWMTiva_fxnTable
PWMTiva_Status * pwmStatus
Definition: PWMTiva.h:163
struct PWMTiva_Status PWMTiva_Status
PWMTiva_Status.
struct PWMTiva_HWAttrs PWMTiva_HWAttrs
PWMTiva Hardware attributes.
uint32_t pwmGenOpts
Definition: PWMTiva.h:142
uint8_t dutyMode
Definition: PWMTiva.h:166
uint8_t prescalar
Definition: PWMTiva.h:153
PWM driver interface.
The definition of a PWM function table that contains the required set of functions to control a speci...
Definition: PWM.h:327
uint16_t genPeriods[PWMTiva_NUM_PWM_GENERATORS]
Definition: PWMTiva.h:151
uint32_t baseAddr
Definition: PWMTiva.h:140
uint32_t pwmOutput
Definition: PWMTiva.h:141
struct PWMTiva_Object PWMTiva_Object
PWMTiva Object.
#define PWMTiva_NUM_PWM_GENERATORS
Definition: PWMTiva.h:113
PWMTiva Object.
Definition: PWMTiva.h:162
uint16_t pwmDuty
Definition: PWMTiva.h:164
uint8_t pwmOutputBit
Definition: PWMTiva.h:165
PWMTiva Hardware attributes.
Definition: PWMTiva.h:139
uint8_t activeOutputs
Definition: PWMTiva.h:154
PWMTiva_Status.
Definition: PWMTiva.h:150
uint8_t cyclesPerMicroSec
Definition: PWMTiva.h:152
Copyright 2015, Texas Instruments Incorporated