| tmr_manager Vitis Drivers API Documentation

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

Functions
xtmr_manager_intr_example.c File Reference

## Overview

This file contains a design example using the TMR_Manager driver (XTMR_Manager) and hardware device using the interrupt mode.

Note

None.

MODIFICATION HISTORY:

    Ver   Who  Date     Changes

    1.0   sa   04/05/17 First release
    1.3     adk  31/01/22 Updated the example independent of SEM IP hardware
                          configuration.
    1.7   adk  04/04/25 Ported example to the SDT flow.

## Functions
int | TMR_ManagerIntrExample (u16 DeviceId)
| This function does a minimal test on the TMR_Manager device and driver as a design example. More...
int | SetupInterruptSystem (XTMR_Manager *TMR_ManagerPtr)
| This function sets up the interrupt system such that interrupts can occur for the TMR_Manager device. More...
void | Handler (void *CallBackRef)
| This function is the handler which performs processing to send data to the TMR_Manager. More...
int | main (void)
| Main function to call the TMR_Manager interrupt example. More...

## Function Documentation

void Handler | ( | void * | CallBackRef | ) |

This function is the handler which performs processing to send data to the TMR_Manager.

It is called from an interrupt context such that the amount of processing performed should be minimized. It is called when the transmit FIFO of the TMR_Manager is empty and more data can be sent through the TMR_Manager.

This handler provides an example of how to handle data for the TMR_Manager, but is application specific.

Parameters

  CallBackRef | contains a callback reference from the driver. In this case it is the instance pointer for the TMR_Manager driver.

Returns
  None.

Note
  None.

int main | ( | void |  | ) |

Main function to call the TMR_Manager interrupt example.

Parameters

  None |

Returns
  XST_SUCCESS if successful, XST_FAILURE if unsuccessful

Note
  None

References TMR_ManagerIntrExample().

int SetupInterruptSystem | ( | XTMR_Manager * | TMR_ManagerPtr | ) |

This function sets up the interrupt system such that interrupts can occur for the TMR_Manager device.

This function is application specific since the actual system may or may not have an interrupt controller. The TMR_Manager could be directly connected to a processor without an interrupt controller. The user should modify this function to fit the application.

Parameters

  TMR_ManagerPtr | contains a pointer to the instance of the TMR_Manager component which is going to be connected to the interrupt controller.

Returns
  XST_SUCCESS if successful, otherwise XST_FAILURE.

Note
  None.

Referenced by TMR_ManagerIntrExample().

int TMR_ManagerIntrExample | ( | u16 | DeviceId | ) |

This function does a minimal test on the TMR_Manager device and driver as a design example.

The purpose of this function is to illustrate how to use the XTMR_Manager component.

This function sends data and expects to receive the same data through the TMR_Manager. The user must provide a physical loopback such that data which is transmitted will be received.

This function uses interrupt driver mode of the TMR_Manager device. The calls to the TMR_Manager driver in the handlers should only use the non-blocking calls.

Parameters

  DeviceId | is the Device ID of the TMR_Manager Device and is the XPAR_<tmr_manager_instance>_DEVICE_ID value from xparameters.h.

Returns
  XST_SUCCESS if successful, otherwise XST_FAILURE.

Note

This function contains an infinite loop such that if interrupts are not working it may never return.

References SetupInterruptSystem(), XTMR_Manager_EnableInterrupt(), XTMR_Manager_Initialize(), and XTMR_Manager_SelfTest().

Referenced by main().