TI-RTOS Drivers  tidrivers_full_2_20_00_08
Data Structures | Typedefs | Variables
PWMTimerTiva.h File Reference

Detailed Description

PWM driver implementation using Tiva General Purpose Timers.

============================================================================

The PWM header file should be included in an application as follows:

Refer to PWM.h for a complete description of APIs & example of use.

Operation

This driver configures a Tiva 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 an independent PWM instance. The timer is automatically configured in count-down mode using the system clock as the source.

The timers operate at the system clock frequency (80 MHz or 120 MHz). So each timer tick is 12.5 ns or 8.3 ns respectively. The period and duty registers are 16 bits wide; thus 8-bit prescalars are used to extend period and duty registers. The maximum value supported is 16777215 ((2^24) - 1) timer counts; 209715 microseconds @ 80 MHz or 139810 microseconds @ 120 MHz. Updates to a PWM's period or duty will occur instantaneously (GPT peripherals do not have shadow registers).


#include <stdbool.h>
#include <ti/drivers/PWM.h>
Include dependency graph for PWMTimerTiva.h:

Go to the source code of this file.

Data Structures

struct  PWMTimerTiva_HWAttrsV1
 PWMTimerTiva Hardware attributes. More...
 
struct  PWMTimerTiva_Object
 PWMTimerTiva Object. More...
 

Typedefs

typedef struct PWMTimerTiva_HWAttrsV1 PWMTimerTiva_HWAttrsV1
 PWMTimerTiva Hardware attributes. More...
 
typedef struct PWMTimerTiva_Object PWMTimerTiva_Object
 PWMTimerTiva Object. More...
 

Variables

const PWM_FxnTable PWMTimerTiva_fxnTable
 

Typedef Documentation

PWMTimerTiva Hardware attributes.

These fields are used by driverlib APIs and therefore must be populated by driverlib macro definitions. For TivaWare these definitions are found in:

  • inc/hw_memmap.h
  • driverlib/gpio.h
  • driverlib/pin_map.h
  • driverlib/timer.h

A sample structure is shown below:

1 const PWMTimerTiva_HWAttrsV1 pwmTivaHWAttrs[] = {
2  {
3  .timerBaseAddr = TIMER2_BASE,
4  .halfTimer = TIMER_A,
5  .pinTimerPwmMode = GPIO_PA4_T2CCP0,
6  .gpioBaseAddr = GPIO_PORTA_BASE,
7  .gpioPinIndex = GPIO_PIN_4
8  }
9 };

PWMTimerTiva Object.

The application must not access any member variables of this structure!

Variable Documentation

const PWM_FxnTable PWMTimerTiva_fxnTable
Copyright 2016, Texas Instruments Incorporated