TI-RTOS Drivers  tidrivers_full_2_20_00_08
PWMTiva.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  */
87 #ifndef ti_driver_pwm_PWMTiva__include
88 #define ti_driver_pwm_PWMTiva__include
89 
90 #ifdef __cplusplus
91 extern "C" {
92 #endif
93 
94 #include <stdbool.h>
95 #include <ti/drivers/PWM.h>
96 
107 /* Add PWMTiva_STATUS_* macros here */
108 
123 /* Number of PWM peripherals available on a device. */
124 #define PWMTiva_NUM_PWM_PERIPHERALS (2)
125 
126 /* Number of signal generator blocks per PWM peripheral. */
127 #define PWMTiva_NUM_PWM_GENERATORS (4)
128 
129  /* Number of PWM signals a PWM peripheral can generate. */
130 #define PWMTiva_NUM_PWM_OUTPUTS (8)
131 
132 /* PWM function table pointer */
133 extern const PWM_FxnTable PWMTiva_fxnTable;
134 
158 typedef struct PWMTiva_HWAttrsV1 {
160  uint32_t pwmBaseAddr;
162  uint32_t pwmOutput;
164  uint32_t pwmGenOpts;
166  uint32_t pinPwmMode;
168  uint32_t gpioBaseAddr;
170  uint8_t gpioPinIndex;
171 
173 
179 typedef struct PWMTiva_Status {
182  uint8_t prescalar;
183  uint8_t activeOutputs;
185 
191 typedef struct PWMTiva_Object {
196  uint8_t pwmOutputNum;
197  uint8_t pwmOutputBit;
198  bool isOpen;
200 
201 #ifdef __cplusplus
202 }
203 #endif
204 
205 #endif /* ti_driver_pwm_PWMTiva__include */
const PWM_FxnTable PWMTiva_fxnTable
struct PWMTiva_HWAttrsV1 PWMTiva_HWAttrsV1
PWMTiva Hardware attributes.
PWMTiva Hardware attributes.
Definition: PWMTiva.h:158
PWMTiva_Status * pwmStatusStruct
Definition: PWMTiva.h:192
struct PWMTiva_Status PWMTiva_Status
PWMTiva_Status.
bool isOpen
Definition: PWMTiva.h:198
uint32_t genPeriods[PWMTiva_NUM_PWM_GENERATORS]
Definition: PWMTiva.h:181
PWM_Duty_Units
PWM duty cycle unit definitions. Refer to device specific implementation if using PWM_DUTY_COUNTS (ra...
Definition: PWM.h:237
uint8_t pwmOutputNum
Definition: PWMTiva.h:196
uint8_t prescalar
Definition: PWMTiva.h:182
PWM driver interface.
PWM_Period_Units
PWM period unit definitions. Refer to device specific implementation if using PWM_PERIOD_COUNTS (raw ...
Definition: PWM.h:227
PWM_Duty_Units dutyUnits
Definition: PWMTiva.h:193
uint32_t gpioBaseAddr
Definition: PWMTiva.h:168
uint32_t pwmBaseAddr
Definition: PWMTiva.h:160
The definition of a PWM function table that contains the required set of functions to control a speci...
Definition: PWM.h:331
uint32_t pwmGenOpts
Definition: PWMTiva.h:164
uint32_t pwmDuties[PWMTiva_NUM_PWM_OUTPUTS]
Definition: PWMTiva.h:180
uint32_t pinPwmMode
Definition: PWMTiva.h:166
struct PWMTiva_Object PWMTiva_Object
PWMTiva Object.
#define PWMTiva_NUM_PWM_GENERATORS
Definition: PWMTiva.h:127
PWMTiva Object.
Definition: PWMTiva.h:191
PWM_IdleLevel idleLevel
Definition: PWMTiva.h:195
uint32_t pwmOutput
Definition: PWMTiva.h:162
uint8_t pwmOutputBit
Definition: PWMTiva.h:197
PWM_IdleLevel
Idle output level when PWM is not running (stopped / not started).
Definition: PWM.h:246
uint8_t activeOutputs
Definition: PWMTiva.h:183
PWMTiva_Status.
Definition: PWMTiva.h:179
uint8_t gpioPinIndex
Definition: PWMTiva.h:170
#define PWMTiva_NUM_PWM_OUTPUTS
Definition: PWMTiva.h:130
PWM_Period_Units periodUnits
Definition: PWMTiva.h:194
Copyright 2016, Texas Instruments Incorporated