| i2stx Vitis Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List

Functions
xi2stx_intr_example.c File Reference

## Overview

This file contains a example for using the I2s Transmitter hardware device and I2s Transmitter 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 | I2sSelfTestExample (u16 DeviceId)
| This function does a minimal test on the I2s Transmitter device and driver as a design example. More...
int | I2sTxIntrExample (INTC *IntcInstancePtr, XI2s_Tx *I2sTxInstancePtr, u16 DeviceId, u16 IntrId)
| This function does a minimal test on the I2s Transmitter device and driver as a design example. More...
void | I2sTxDisableIntr (INTC *IntcInstancePtr, u16 IntrId)
| This function disables the interrupts for the I2s Transmitter. More...
void | I2sTxAesBlockCmplIntrHandler (void *CallBackRef)
| This function is the handler which performs processing for the I2s Transmitter. More...
void | I2sTxAesBlockErrIntrHandler (void *CallBackRef)
| This function is the handler which performs processing for the I2s Transmitter. More...
void | I2sTxAesGetChStsHandler (void *CallBackRef)
| This function is the handler which performs processing for the I2s Transmitter. More...
void | I2sTxUnderflowIntrHandler (void *CallBackRef)
| This function is the handler which performs processing for the I2s Transmitter. More...
int | main (void)
| This function is the main function of the I2S Transmitter example using Interrupts. More...

## Function Documentation

int I2sSelfTestExample | ( | u16 | DeviceId | ) |

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

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

Parameters

  DeviceId | is the Device ID of the I2s TX Device and is the XPAR_<I2S_TRANSMITTER_instance>_DEVICE_ID value from xparameters.h

Returns
  XST_SUCCESS if successful, otherwise XST_FAILURE.

Note
  None.

References XI2stx_Config::BaseAddress, XI2s_Tx_CfgInitialize(), XI2s_Tx_LookupConfig(), and XI2s_Tx_SelfTest().

Referenced by main().

void I2sTxAesBlockCmplIntrHandler | ( | void * | CallBackRef | ) |

This function is the handler which performs processing for the I2s Transmitter.

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

This handler provides an example of how to handle I2s Transmitter interrupts but is application specific.

Parameters

  CallBackRef | is a pointer to the callback function

Returns
  None.

Note
  None.

Referenced by I2sTxIntrExample().

void I2sTxAesBlockErrIntrHandler | ( | void * | CallBackRef | ) |

This function is the handler which performs processing for the I2s Transmitter.

It is called from an interrupt context when the I2s Transmitter receives a AES Block Error Interrupt.

This handler provides an example of how to handle I2s Transmitter interrupts but is application specific.

Parameters

  CallBackRef | is a pointer to the callback function

Returns
  None.

Note
  None.

Referenced by I2sTxIntrExample().

void I2sTxAesGetChStsHandler | ( | void * | CallBackRef | ) |

This function is the handler which performs processing for the I2s Transmitter.

It is called from an interrupt context when the I2s Transmitter receives a AES Channel Status Updated Interrupt.

This handler provides an example of how to handle I2s Transmitter interrupts but is application specific.

Parameters

  CallBackRef | is a pointer to the callback function

Returns
  None.

Note
  None.

Referenced by I2sTxIntrExample().

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

This function disables the interrupts for the I2s Transmitter.

Parameters

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

Returns
  None.

Note
  None.

int I2sTxIntrExample | ( | INTC * | IntcInstancePtr,
|  | XI2s_Tx * | I2sTxInstancePtr,
|  | u16 | DeviceId,
|  | u16 | IntrId
| ) |  |

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

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

This function uses interrupt driven mode of the I2s Transmitter.

Parameters

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

Returns
  XST_SUCCESS if the Test is successful, otherwise XST_FAILURE

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

References XI2stx_Config::BaseAddress, XI2s_Tx::Config, I2sTxAesBlockCmplIntrHandler(), I2sTxAesBlockErrIntrHandler(), I2sTxAesGetChStsHandler(), I2sTxUnderflowIntrHandler(), XI2s_Tx_CfgInitialize(), XI2S_TX_CHMUX_AXIS_01, XI2s_Tx_Enable(), XI2S_TX_GINTR_EN_MASK, XI2S_TX_HANDLER_AES_BLKCMPLT, XI2S_TX_HANDLER_AES_BLKSYNCERR, XI2S_TX_HANDLER_AES_CHSTSUPD, XI2S_TX_HANDLER_AUD_UNDRFLW, XI2S_TX_INTR_AES_BLKCMPLT_MASK, XI2S_TX_INTR_AUDUNDRFLW_MASK, XI2s_Tx_IntrEnable(), XI2s_Tx_IntrHandler(), XI2s_Tx_LookupConfig(), XI2s_Tx_SelfTest(), XI2s_Tx_SetChMux(), XI2s_Tx_SetHandler(), and XI2s_Tx_SetSclkOutDiv().

Referenced by main().

void I2sTxUnderflowIntrHandler | ( | void * | CallBackRef | ) |

This function is the handler which performs processing for the I2s Transmitter.

It is called from an interrupt context when the I2s Transmitter receives a Underflow Interrupt.

This handler provides an example of how to handle I2s Transmitter interrupts but is application specific.

Parameters

  CallBackRef | is a pointer to the callback function

Returns
  None.

Note
  None.

Referenced by I2sTxIntrExample().

int main | ( | void |  | ) |

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

Parameters

  None. |

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

Note
  None.

References I2sTxIntrExample().