TI-RTOS for SimpleLink Wireless MCUs
2.14.01.20
|
PWM driver implementation using CC3200 General Purpose Timer peripherals.
============================================================================
The PWM header file should be included in an application as follows:
This driver configures a CC3200 General Purpose Timer (GPT) in PWM mode. When in PWM mode, each GPT is divided into 2 PWM outputs. This driver manages each output as independent PWM instances. The timer is automatically configured in count-down mode using the system clock as the source.
The period in the PWM_Params structure must be used to set the initial period. After opening, the PWM_control() API can be used to change a period. The period and duty registers are 16 bits wide; thus, prescalars are used to extend period and duty registers. The maximum period supported is calculated as: MAX_PERIOD = (((MAX_PRESCALAR + 1) * MAX_MATCH_VAL) / CYCLES_PER_US) - 1 80 MHz clock: (((255 + 1) * 65535) / 80) - 1 = 209711 microseconds
Below is an example of how to use the PWM_control() to change a period:
Updates to a PWM instance will occur instantaneously (i.e. GPT peripherals do not have shadow registers). Finally, if the duty supplied is greater than the period, the output will remain in active state.
#include <ti/drivers/PWM.h>
Go to the source code of this file.
Data Structures | |
struct | PWMTimerCC3200_HWAttrs |
PWMTimerCC3200 Hardware attributes. More... | |
struct | PWMTimerCC3200_Object |
PWMTimerCC3200 Object. More... | |
Macros | |
#define | PWMTimerCC3200_CHANGE_PERIOD PWM_CMD_RESERVED + 0 |
Typedefs | |
typedef struct PWMTimerCC3200_HWAttrs | PWMTimerCC3200_HWAttrs |
PWMTimerCC3200 Hardware attributes. More... | |
typedef struct PWMTimerCC3200_Object | PWMTimerCC3200_Object |
PWMTimerCC3200 Object. More... | |
Variables | |
const PWM_FxnTable | PWMTimerCC3200_fxnTable |
#define PWMTimerCC3200_CHANGE_PERIOD PWM_CMD_RESERVED + 0 |
typedef struct PWMTimerCC3200_HWAttrs PWMTimerCC3200_HWAttrs |
PWMTimerCC3200 Hardware attributes.
These fields are used by CC3200 driverlib APIs and therefore must be populated by driverlib macro definitions. For CC3200 driverlib these definitions are found in:
A sample structure is shown below:
typedef struct PWMTimerCC3200_Object PWMTimerCC3200_Object |
PWMTimerCC3200 Object.
The application must not access any member variables of this structure!
const PWM_FxnTable PWMTimerCC3200_fxnTable |