| tmrctr Vitis Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Functions
xtmrctr_pwm_example.c File Reference

## Overview

This file contains a design example using the timer counter driver and hardware device using interrupt mode.

The example demonstrates the use of PWM feature of axi timers. PWM is configured to operate at specific duty cycle and after every N cycles the duty cycle is incremented until a specific duty cycle is achieved. No software validation of duty cycle is undergone in the example.

This example assumes that the interrupt controller is also present as a part of the system.

     MODIFICATION HISTORY:

     Ver   Who  Date         Changes

     1.00b cjp  03/28/18 First release

## Functions
int | TmrCtrPwmExample (INTC *IntcInstancePtr, XTmrCtr *TmrCtrInstancePtr, u16 DeviceId, u16 IntrId)
| This function demonstrates the use of tmrctr PWM APIs. More...
int | main (void)
| This function is the main function of the Tmrctr PWM example. More...

## Function Documentation

int main | ( | void |  | ) |

This function is the main function of the Tmrctr PWM example.

Parameters

  None. |

Returns
  XST_SUCCESS to indicate success, else XST_FAILURE to indicate a Failure.

Note
  None.

References TmrCtrPwmExample().

int TmrCtrPwmExample | ( | INTC * | IntcInstancePtr,
|  | XTmrCtr * | TmrCtrInstancePtr,
|  | u16 | DeviceId,
|  | u16 | IntrId
| ) |  |

This function demonstrates the use of tmrctr PWM APIs.

Parameters

  IntcInstancePtr | is a pointer to the Interrupt Controller driver Instance
  TmrCtrInstancePtr | is a pointer to the XTmrCtr driver Instance
  DeviceId | is the XPAR_<TmrCtr_instance>_DEVICE_ID value from xparameters.h
  IntrId | is XPAR_<INTC_instance>_<TmrCtr_instance>_INTERRUPT_INTR value from xparameters.h

Returns
  XST_SUCCESS if the Test is successful, otherwise XST_FAILURE

Note
  none.

References XTmrCtr::Config, TimerCounterHandler(), XTmrCtr_Initialize(), XTmrCtr_InterruptHandler(), XTmrCtr_PwmConfigure(), XTmrCtr_PwmDisable(), XTmrCtr_PwmEnable(), XTmrCtr_SelfTest(), XTmrCtr_SetHandler(), and XTmrCtr_SetOptions().

Referenced by main().