ipipsu: xipipsu_self_test_example.c File Reference

| ipipsu Xilinx SDK Drivers API Documentation

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

Functions
xipipsu_self_test_example.c File Reference

## Overview

This file consists of a self test example which uses the XIpiPsu driver to send an IPI message to self and get a response Each IPI channel can trigger an interrupt to itself and can exchange messages through the message buffer.

This feature is used here to exercise the driver APIs. Example control flow:

- Init the IPI and GIC drivers
- Setup Interrupt System with IPI handler which inverts the received message and sends back as response
- Write a Message and Trigger IPI to Self.
- Keep polling for response till timeout
- Interrupt handler receives IPI and sends back response
- Read the received response and do a sanity check
- Print PASS or FAIL based on sanity check of response message

    MODIFICATION HISTORY:

    Ver  Who Date     Changes

    2.2  ms  01/23/17 Modified xil_printf statement in main function to
                      ensure that "Successfully ran" and "Failed" strings
                      are available in all examples. This is a fix for
                      CR-965028.

## Functions
void | IpiIntrHandler (void *XIpiPsuPtr)
| Interrupt Handler : -Polls for each of the valid sources -Checks if there is a message -Reads the message -Inverts the bits -Sends back the inverted message as response. More...
int | main ()

## Function Documentation

void IpiIntrHandler | ( | void * | XIpiPsuPtr | ) |

Interrupt Handler : -Polls for each of the valid sources -Checks if there is a message -Reads the message -Inverts the bits -Sends back the inverted message as response.

< Holds the IPI status register value

< Holds the received Message, later inverted and sent back as response

References XIpiPsu::Config, XIpiPsu_Target::Mask, XIpiPsu_Config::TargetCount, XIpiPsu_ClearInterruptStatus, XIpiPsu_GetInterruptStatus, XIpiPsu_ReadMessage(), and XIpiPsu_WriteMessage().

int main | ( |  | ) |

Do Nothing We need to loop on to receive IPIs and respond to them

References XIpiPsu_Config::BaseAddress, XIpiPsu::Config, XIpiPsu_Config::IntId, XIpiPsu_CfgInitialize(), XIpiPsu_ClearInterruptStatus, XIpiPsu_InterruptEnable, and XIpiPsu_LookupConfig().