| audio_formatter Vitis Drivers API Documentation

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

Data Structures | Macros | Functions
Overview

## Data Structures
struct | XAudioFormatter_Config
| This typedef contains configuration information for a audio formatter core. More...
struct | XAudioFormatter
| The audio formatter driver instance data structure. More...
struct | XAudioFormatterHwParams
| This typedef contains hw params information for a audio formatter core. More...

## Macros
#define | XAUDFMT_H_
| Prevent circular inclusions by using protection macros. More...

## Functions
void | XAudioFormatterDMAReset (XAudioFormatter *InstancePtr)
| This function soft resets the audio formatter DMA core. More...
u32 | XAudioFormatter_CfgInitialize (XAudioFormatter *InstancePtr, XAudioFormatter_Config *CfgPtr)
| This function initializes the audio formatter core instance. More...
void | XAudioFormatter_InterruptClear (XAudioFormatter *InstancePtr, u32 mask)
| This function clears the interrupts for audio formatter core. More...
void | XAudioFormatter_InterruptEnable (XAudioFormatter *InstancePtr, u32 Mask)
| This function enables the interrupts for audio formatter core. More...
void | XAudioFormatter_InterruptDisable (XAudioFormatter *InstancePtr, u32 Mask)
| This function disables the interrupts for audio formatter core. More...
void | XAudioFormatterDMAStart (XAudioFormatter *InstancePtr)
| This function starts the dma for audio formatter core. More...
void | XAudioFormatterDMAStop (XAudioFormatter *InstancePtr)
| This function stops the dma for audio formatter core. More...
void | XAudioFormatterSetHwParams (XAudioFormatter *InstancePtr, XAudioFormatterHwParams *hw_params)
| This function sets the hw params for audio formatter core. More...
u32 | XAudioFormatterGetDMATransferCount (XAudioFormatter *InstancePtr)
| This function returns the No. More...
void | XAudioFormatterSetS2MMTimeOut (XAudioFormatter *InstancePtr, u32 TimeOut)
| This function sets the S2MM timeout. More...
void | XAudioFormatterSetFsMultiplier (XAudioFormatter *InstancePtr, u32 Mclk, u32 Fs)
| This function calculates the Fs multiplier value. More...
void | XSdiAud_GetChStat (XAudioFormatter *InstancePtr, u8 *ChStatBuf)
| This function reads all the Channel Status registers and writes to a buffer. More...
XAudioFormatter_Config * | XAudioFormatter_LookupConfig (u16 DeviceId)
| XAudioFormatter_LookupConfig returns a reference to an XAudioFormatter_Config structure based on the unique device id, DeviceId. More...

## Macro Definition Documentation

#define XAUDFMT_H_

Prevent circular inclusions by using protection macros.

## Function Documentation

u32 XAudioFormatter_CfgInitialize | ( | XAudioFormatter * | InstancePtr,
|  | XAudioFormatter_Config * | CfgPtr
| ) |  |

This function initializes the audio formatter core instance.

Parameters

  InstancePtr | is a pointer to the XAudioFormatter instance.
  CfgPtr | is a reference to a structure containing information about a specific XAudioFormatter instance.

Returns
  - XST_SUCCESS if initialization was successful.

Note
  None.

References XAudioFormatter_Config::BaseAddress, XAudioFormatter::Config, XAudioFormatter::IsReady, and XAudioFormatterDMAReset().

Referenced by AFSelfTestExample().

void XAudioFormatter_InterruptClear | ( | XAudioFormatter * | InstancePtr,
|  | u32 | mask
| ) |  |

This function clears the interrupts for audio formatter core.

Parameters

  InstancePtr | is a pointer to the XAudioFormatter instance.
  offset | this is the offset to S2MM or MM2S.

Returns
  None.

Note
  None.

References XAudioFormatter::IsReady.

void XAudioFormatter_InterruptDisable | ( | XAudioFormatter * | InstancePtr,
|  | u32 | Mask
| ) |  |

This function disables the interrupts for audio formatter core.

Parameters

  InstancePtr | is a pointer to the XAudioFormatter instance.
  Mask | is the interrupt mask.

Returns
  None.

Note
  None.

References XAudioFormatter::IsReady.

void XAudioFormatter_InterruptEnable | ( | XAudioFormatter * | InstancePtr,
|  | u32 | Mask
| ) |  |

This function enables the interrupts for audio formatter core.

Parameters

  InstancePtr | is a pointer to the XAudioFormatter instance.
  Mask | is the interrupt mask.

Returns
  None.

Note
  None.

References XAudioFormatter::IsReady.

XAudioFormatter_Config * XAudioFormatter_LookupConfig | ( | u16 | DeviceId | ) |

XAudioFormatter_LookupConfig returns a reference to an XAudioFormatter_Config structure based on the unique device id, DeviceId.

The return value will refer to an entry in the device configuration table defined in the xaudioformatter_g.c file.

Parameters

  DeviceId | is the unique device ID of the device for the lookup operation.

Returns
  CfgPtr is a reference to a config record in the configuration table (in xaudioformatter_g.c) corresponding to DeviceId, or NULL if no match is found.

Note
  None.

Referenced by AFSelfTestExample().

void XAudioFormatterDMAReset | ( | XAudioFormatter * | InstancePtr | ) |

This function soft resets the audio formatter DMA core.

Parameters

  InstancePtr | is a pointer to the XAudioFormatter instance.

Returns
  None.

Note
  None.

Referenced by XAudioFormatter_CfgInitialize().

void XAudioFormatterDMAStart | ( | XAudioFormatter * | InstancePtr | ) |

This function starts the dma for audio formatter core.

Parameters

  InstancePtr | is a pointer to the XAudioFormatter instance.

Returns
  None.

Note
  None.

References XAudioFormatter::IsReady.

void XAudioFormatterDMAStop | ( | XAudioFormatter * | InstancePtr | ) |

This function stops the dma for audio formatter core.

Parameters

  InstancePtr | is a pointer to the XAudioFormatter instance.

Returns
  None.

Note
  None.

References XAudioFormatter::IsReady.

u32 XAudioFormatterGetDMATransferCount | ( | XAudioFormatter * | InstancePtr | ) |

This function returns the No.

of bytes of data read from memory..

Parameters

  InstancePtr | is a pointer to the Audio Formatter instance.

Returns
  - No. of bytes of data read from memory.

References XAudioFormatter::IsReady.

void XAudioFormatterSetFsMultiplier | ( | XAudioFormatter * | InstancePtr,
|  | u32 | Mclk,
|  | u32 | Fs
| ) |  |

This function calculates the Fs multiplier value.

Parameters

  InstancePtr | is a pointer to the Audio Formatter instance.
  MClk | is the frequency of the MClk.
  Fs | is the sampling frequency of the system.

Returns
  - None

References XAudioFormatter::IsReady.

void XAudioFormatterSetHwParams | ( | XAudioFormatter * | InstancePtr,
|  | XAudioFormatterHwParams * | hw_params
| ) |  |

This function sets the hw params for audio formatter core.

Parameters

  InstancePtr | is a pointer to the XAudioFormatter instance.
  hw_params | is a pointer to the XAudioFormatterHwParams structure which contains the no. of channels, bit width, no. of periods, bytes per period, bytes per channel and buffer address.

Returns
  None.

Note
  None.

References XAudioFormatter::Config, XAudioFormatter::IsReady, XAudioFormatter_Config::MaxChannelsMM2S, and XAudioFormatter_Config::MaxChannelsS2MM.

void XAudioFormatterSetS2MMTimeOut | ( | XAudioFormatter * | InstancePtr,
|  | u32 | TimeOut
| ) |  |

This function sets the S2MM timeout.

Parameters

  InstancePtr | is a pointer to the Audio Formatter instance.
  TimeOut | is the Timeout value after which all the data is flushed to memory if there is no incoming data from any channel.

Returns
  - None

References XAudioFormatter::IsReady.

void XSdiAud_GetChStat | ( | XAudioFormatter * | InstancePtr,
|  | u8 * | ChStatBuf
| ) |  |

This function reads all the Channel Status registers and writes to a buffer.

Parameters

  InstancePtr | is a pointer to the Audio Formatter instance.
  ChStatBuf | is a pointer to a buffer.

Returns
  None.

References XAudioFormatter_Config::BaseAddress, and XAudioFormatter::Config.