Data Structures | Typedefs | Variables
PWMTimerWFF3.h File Reference

Detailed Description

PWM driver implementation for Wi-Fi F3 devices.


Overview

The general PWM API should be used in application code, i.e. PWM_open() should be used instead of PWMTimerWFF3_open(). The board file will define the device specific config, and casting in the general API will ensure that the correct device specific functions are called.

General Behavior

Before using PWM on WFF3:

Error handling

If unsupported arguments are provided to an API returning an error code, the PWM configuration will not be updated and PWM will stay in the mode it was already configured to.

Power Management

The SimpleLink power management framework will try to put the device into the most power efficient mode whenever possible. Please see the technical reference manual for further details on each power mode.

The PWMTimerWFF3.h driver is not explicitly setting a power constraint when the PWM is running to prevent standby as this is assumed to be done in the underlying GPTimer driver. The following statements are valid:

Accuracy

The PWM output period and duty cycle are limited by the underlying timer. For GPT counter widths see GPT peripheral properties.

The frequency of the underlying timer counter can be divided by configuring the preScalerDivision element of the PWMTimerWFF3_HwAttrs struct. This configuration can be used to extend the PWM signal period but will decrease the accuracy. The minimum obtainable PWM signal frequency is dependent on the width of the counter for the GPT peripheral used and the configured preScalerDivision value. When using either the GPT0 or the GPT1 peripheral with the default preScalerDivision value of 1, the minimal frequency is 40MHz / (2^32-1) = 0.0093Hz (107.374sec).

When using high output frequencies the duty cycle resolution is reduced correspondingly. For a 20MHz PWM only a 0%/50%/100% duty is available as the timer uses only counts 0 and 1. Similarly for a 10MHz period the duty cycle will be limited to a 12.5% resolution.

Note
The PWM signals are generated by the GPT peripheral using the timer clock which is dependent on the system clock.

Limitations

Basic PWM output

The below example will output a 8MHz PWM signal with 50% duty cycle.

PWM_Handle pwmHandle;
PWM_Params_init(&params);
params.periodValue = 8e6;
params.dutyValue = PWM_DUTY_FRACTION_MAX / 2;
pwmHandle = PWM_open(CONFIG_PWM0, &params);
if(pwmHandle == NULL) {
Log_error0("Failed to open PWM");
Task_exit();
}
PWM_start(pwmHandle);
#include <stdint.h>
#include <stdbool.h>
#include <ti/drivers/PWM.h>
#include <ti/drivers/timer/GPTimerWFF3.h>
Include dependency graph for PWMTimerWFF3.h:

Go to the source code of this file.

Data Structures

struct  PWMTimerWFF3_HwAttrs
 PWMTimerWFF3 Hardware attributes. More...
 
struct  PWMTimerWFF3_Object
 PWMTimerWFF3 Object. More...
 

Typedefs

typedef struct PWMTimerWFF3_HwAttrs PWMTimerWFF3_HwAttrs
 PWMTimerWFF3 Hardware attributes. More...
 
typedef struct PWMTimerWFF3_Object PWMTimerWFF3_Object
 PWMTimerWFF3 Object. More...
 

Variables

const PWM_FxnTable PWMTimerWFF3_fxnTable
 

Typedef Documentation

§ PWMTimerWFF3_HwAttrs

PWMTimerWFF3 Hardware attributes.

These fields are used by the driver to set up the underlying GPTimer driver statically.

§ PWMTimerWFF3_Object

PWMTimerWFF3 Object.

These fields are used by the driver to store and modify PWM configuration during run-time. The application must not edit any member variables of this structure. Appplications should also not access member variables of this structure as backwards compatibility is not guaranteed.

Variable Documentation

§ PWMTimerWFF3_fxnTable

const PWM_FxnTable PWMTimerWFF3_fxnTable
© Copyright 1995-2026, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale