TI-RTOS Drivers  tidrivers_tivac_2_16_00_08
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  */
102 #ifndef ti_driver_pwm_PWMTiva__include
103 #define ti_driver_pwm_PWMTiva__include
104 
105 #ifdef __cplusplus
106 extern "C" {
107 #endif
108 
109 #include <ti/drivers/PWM.h>
110 
121 /* Add PWMTiva_STATUS_* macros here */
122 
138 #define PWMTiva_CMD_CHANGE_GEN_PERIOD PWM_CMD_RESERVED + 0
139 
141 /* BACKWARDS COMPATIBILITY */
142 #define PWMTiva_CHANGE_GEN_PERIOD PWMTiva_CMD_CHANGE_GEN_PERIOD
143 /* BACKWARDS COMPATIBILITY */
144 
145 /* Number of PWM peripherals available on a device */
146 #define PWMTiva_NUM_PWM_PERIPHERALS 2
147 
148 /* Number of signal generator blocks per PWM peripheral */
149 #define PWMTiva_NUM_PWM_GENERATORS 4
150 
151 /* PWM function table pointer */
152 extern const PWM_FxnTable PWMTiva_fxnTable;
153 
172 typedef struct PWMTiva_HWAttrs {
173  uint32_t baseAddr;
174  uint32_t pwmOutput;
175  uint32_t pwmGenOpts;
177 
183 typedef struct PWMTiva_Status {
186  uint8_t prescalar;
187  uint8_t activeOutputs;
189 
195 typedef struct PWMTiva_Object {
197  uint16_t pwmDuty;
198  uint8_t pwmOutputBit;
199  uint8_t dutyMode; /* Units in which duty is specified */
201 
202 #ifdef __cplusplus
203 }
204 #endif
205 
206 #endif /* ti_driver_pwm_PWMTiva__include */
const PWM_FxnTable PWMTiva_fxnTable
PWMTiva_Status * pwmStatus
Definition: PWMTiva.h:196
struct PWMTiva_Status PWMTiva_Status
PWMTiva_Status.
struct PWMTiva_HWAttrs PWMTiva_HWAttrs
PWMTiva Hardware attributes.
uint32_t pwmGenOpts
Definition: PWMTiva.h:175
uint8_t dutyMode
Definition: PWMTiva.h:199
uint8_t prescalar
Definition: PWMTiva.h:186
PWM driver interface.
The definition of a PWM function table that contains the required set of functions to control a speci...
Definition: PWM.h:349
uint16_t genPeriods[PWMTiva_NUM_PWM_GENERATORS]
Definition: PWMTiva.h:184
uint32_t baseAddr
Definition: PWMTiva.h:173
uint32_t pwmOutput
Definition: PWMTiva.h:174
struct PWMTiva_Object PWMTiva_Object
PWMTiva Object.
#define PWMTiva_NUM_PWM_GENERATORS
Definition: PWMTiva.h:149
PWMTiva Object.
Definition: PWMTiva.h:195
uint16_t pwmDuty
Definition: PWMTiva.h:197
uint8_t pwmOutputBit
Definition: PWMTiva.h:198
PWMTiva Hardware attributes.
Definition: PWMTiva.h:172
uint8_t activeOutputs
Definition: PWMTiva.h:187
PWMTiva_Status.
Definition: PWMTiva.h:183
uint8_t cyclesPerMicroSec
Definition: PWMTiva.h:185
Copyright 2016, Texas Instruments Incorporated