i2srx: xi2srx_intr_example.c File Reference

| i2srx Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List

Functions
xi2srx_intr_example.c File Reference

## Overview

This file contains a example for using the I2S receiver hardware device and I2S receiver driver using interrupt mode.This example assumes that the interrupt controller is also present as a part of the system.

     MODIFICATION HISTORY:

    Ver     Who     Date            Changes

    1.0     kar     01/25/18        First release

## Functions
int | I2sRxIntrExample (INTC *IntcInstancePtr, XI2s_Rx *I2sRxInstancePtr, u16 DeviceId, u16 IntrId)
| This function does a minimal test on the I2S receiver device and driver as a design example. More...
void | I2sRxDisableIntr (INTC *IntcInstancePtr, u16 IntrId)
| This function disables the interrupts for the I2S receiver. More...
void | I2sRxAesBlockCmplIntrHandler (void *CallBackRef)
| This function is the handler which performs processing for the I2S receiver. More...
void | I2sRxOvrflwIntrHandler (void *CallBackRef)
| This function is the handler which performs processing for the I2S receiver. More...
int | main (void)
| This function is the main function of the I2S receiver example using Interrupts. More...

## Function Documentation

void I2sRxAesBlockCmplIntrHandler | ( | void * | CallBackRef | ) |

This function is the handler which performs processing for the I2S receiver.

It is called from an interrupt context when the I2S receiver receives a AES Block Complete Interrupt.

This handler provides an example of how to handle I2S receiver interrupts but is application specific.

Parameters

  CallBackRef | is a pointer to the callback function

Returns
  None.

Note
  None.

Referenced by I2sRxIntrExample().

void I2sRxDisableIntr | ( | INTC * | IntcInstancePtr,
|  | u16 | IntrId
| ) |  |

This function disables the interrupts for the I2S receiver.

Parameters

  IntcInstancePtr | is a reference to the Interrupt Controller driver Instance.
  IntrId | is XPAR_<INTC_instance>_<i2s_rx_instance>_VEC_ID value from xparameters.h.

Returns
  None.

Note
  None.

int I2sRxIntrExample | ( | INTC * | IntcInstancePtr,
|  | XI2s_Rx * | I2sRxInstancePtr,
|  | u16 | DeviceId,
|  | u16 | IntrId
| ) |  |

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

The purpose of this function is to illustrate how to use the XI2s_Rx component. It initializes a I2S receiver and then sets it up such that a periodic interrupt is generated.

This function uses interrupt driven mode of the I2S receiver.

Parameters

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

Returns
  XST_SUCCESS if the Test is successful, otherwise XST_FAILURE

References I2sRxAesBlockCmplIntrHandler(), I2sRxOvrflwIntrHandler(), XI2s_Rx_CfgInitialize(), XI2S_RX_CHMUX_XI2S_01, XI2s_Rx_Enable(), XI2S_RX_GINTR_EN_MASK, XI2S_RX_HANDLER_AES_BLKCMPLT, XI2S_RX_HANDLER_AUD_OVRFLW, XI2S_RX_INTR_AES_BLKCMPLT_MASK, XI2S_RX_INTR_AUDOVRFLW_MASK, XI2s_Rx_IntrEnable(), XI2s_Rx_LookupConfig(), XI2s_Rx_SetChMux(), XI2s_Rx_SetHandler(), and XI2s_Rx_SetSclkOutDiv().

Referenced by main().

void I2sRxOvrflwIntrHandler | ( | void * | CallBackRef | ) |

This function is the handler which performs processing for the I2S receiver.

It is called from an interrupt context when the I2S receiver receives a Underflow Interrupt.

This handler provides an example of how to handle I2S receiver interrupts but is application specific.

Parameters

  CallBackRef | is a pointer to the callback function

Returns
  None.

Note
  None.

Referenced by I2sRxIntrExample().

int main | ( | void |  | ) |

This function is the main function of the I2S receiver example using Interrupts.

Parameters

  None. |

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

Note
  None.

References I2sRxIntrExample().