MCUXpresso SDK API Reference Manual: ASRC Driver

| MCUXpresso SDK API Reference Manual Rev 2.11.1 NXP Semiconductors

- Main Page
- Related Pages
- API Reference

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Data Structures | Macros | Enumerations
ASRC Driver
ASRC: Asynchronous sample rate converter

## Overview

## Data Structures
struct | asrc_data_format_t
| asrc context data format More...
struct | asrc_access_ctrl_t
| asrc context access control The ASRC provides interleaving support in hardware to ensure that a variety of sample source can be internally combined tp confir with this format. More...
struct | asrc_context_input_config_t
| asrc context input configuration More...
struct | asrc_context_output_config_t
| asrc context output configuration More...
struct | asrc_context_prefilter_config_t
| asrc context prefilter configuration More...
struct | asrc_context_resampler_config_t
| asrc context resampler configuration More...
struct | asrc_context_config_t
| asrc context configuration More...
struct | asrc_transfer_t
| ASRC transfer. More...

## Macros
#define | FSL_ASRC_INPUT_FIFO_DEPTH (128U)
| ASRC fifo depth.
#define | ASRC_SUPPORT_MAXIMUM_CONTEXT_PROCESSOR_NUMBER 4U
| ASRC support maximum channel number of context.

## Enumerations
enum | { kStatus_ASRCIdle = MAKE_STATUS(kStatusGroup_ASRC, 0), kStatus_ASRCBusy = MAKE_STATUS(kStatusGroup_ASRC, 1), kStatus_ASRCInvalidArgument = MAKE_STATUS(kStatusGroup_ASRC, 2), kStatus_ASRCConfigureFailed = MAKE_STATUS(kStatusGroup_ASRC, 3), kStatus_ASRCConvertError = MAKE_STATUS(kStatusGroup_ASRC, 4), kStatus_ASRCNotSupport = MAKE_STATUS(kStatusGroup_ASRC, 5), kStatus_ASRCQueueFull = MAKE_STATUS(kStatusGroup_ASRC, 6), kStatus_ASRCQueueIdle = MAKE_STATUS(kStatusGroup_ASRC, 7), kStatus_ASRCLoadFirmwareFailed = MAKE_STATUS(kStatusGroup_ASRC, 8), kStatus_ASRCResamplerConfigureFailed = MAKE_STATUS(kStatusGroup_ASRC, 9), kStatus_ASRCPrefilterConfigureFailed = MAKE_STATUS(kStatusGroup_ASRC, 10) }
| ASRC return status, _asrc_status. More...
enum | asrc_context_t { kASRC_Context0 = 0, kASRC_Context1 = 1, kASRC_Context2 = 2, kASRC_Context3 = 3 }
| asrc context id More...
enum | { kASRC_Context0InputFifoOverflow = 1U, kASRC_Context1InputFifoOverflow = 1U << 1U, kASRC_Context2InputFifoOverflow = 1U << 2U, kASRC_Context3InputFifoOverflow = 1U << 3U, kASRC_Context0OutFifoReadEmpty = 1U << 4U, kASRC_Context1OutFifoReadEmpty = 1U << 5U, kASRC_Context2OutFifoReadEmpty = 1U << 6U, kASRC_Context3OutFifoReadEmpty = 1U << 7U, kASRC_Context0RunStopDone = 1U << 8U, kASRC_Context1RunStopDone = 1U << 9U, kASRC_Context2RunStopDone = 1U << 10U, kASRC_Context3RunStopDone = 1U << 11U, kASRC_ContextAllInterruptStatus = 0xFFFU }
| The ASRC interrupt enable flag, _asrc_interrupt_mask. More...
enum | { kASRC_FifoStatusInputFifoWatermarkFlag, kASRC_FifoStatusOutputFifoWatermarkFlag }
| ASRC fifo status, _asrc_fifo_status. More...
enum | asrc_data_endianness_t { kASRC_DataEndianLittle = 0U, kASRC_DataEndianBig = 1U }
| arsc data endianness More...
enum | asrc_data_width_t { kASRC_DataWidth32Bit = 3U, kASRC_DataWidth24Bit = 2U, kASRC_DataWidth20Bit = 1U, kASRC_DataWidth16Bit = 0U }
| data width More...
enum | asrc_data_type_t { kASRC_DataTypeInteger = 0U, kASRC_DataTypeFloat = 1U }
| data type More...
enum | asrc_data_sign_t { kASRC_DataSigned = 0U, kASRC_DataUnsigned = 1U }
| sign extension More...
enum | asrc_sampleBuffer_init_mode_t { kASRC_SampleBufferNoPreFillOnInit = 0U, kASRC_SampleBufferFillFirstSampleOnInit, kASRC_SampleBufferFillZeroOnInit = 2U }
| asrc prefilter and resampler sample buffer init mode More...
enum | asrc_sampleBuffer_stop_mode_t { kASRC_SampleBufferFillLastSampleOnStop, kASRC_SampleBufferFillZeroOnStop = 1U }
| asrc prefilter and resampler sample buffer stop mode More...
enum | asrc_prefilter_stage1_result_t { kASRC_PrefilterStage1ResultInt = 0U, kASRC_PrefilterStage1ResultFloat = 1U }
| ASRC prefilter stage1 result format. More...
enum | asrc_resampler_taps_t { kASRC_ResamplerTaps_32 = 32U, kASRC_ResamplerTaps_64 = 64U, kASRC_ResamplerTaps_128 = 128U }
| ASRC resampler taps. More...
enum | { kASRC_SampleRate_8000 = 8000, kASRC_SampleRate_11025 = 11025, kASRC_SampleRate_12000 = 12000, kASRC_SampleRate_16000 = 16000, kASRC_SampleRate_22050 = 22050, kASRC_SampleRate_24000 = 24000, kASRC_SampleRate_32000 = 32000, kASRC_SampleRate_44100 = 44100, kASRC_SampleRate_48000 = 48000, kASRC_SampleRate_64000 = 64000, kASRC_SampleRate_88200 = 88200, kASRC_SampleRate_96000 = 96000, kASRC_SampleRate_128000 = 128000, kASRC_SampleRate_176400 = 176400, kASRC_SampleRate_192000 = 192000, kASRC_SampleRate_256000 = 256000, kASRC_SampleRate_352800 = 352800, kASRC_SampleRate_384000 = 384000, kASRC_SampleRate_768000 = 768000 }
| ASRC support sample rate, _asrc_sample_rate. More...

## Driver version
#define | FSL_ASRC_DRIVER_VERSION (MAKE_VERSION(2, 0, 6))
| Version 2.0.6.

## Initialization and deinitialization
uint32_t | ASRC_GetInstance (ASRC_Type *base)
| Get instance number of the ASRC peripheral. More...
void | ASRC_Init (ASRC_Type *base)
| brief Initializes the asrc peripheral. More...
void | ASRC_Deinit (ASRC_Type *base)
| De-initializes the ASRC peripheral. More...
void | ASRC_GetContextDefaultConfig (asrc_context_config_t *config, uint32_t channels, uint32_t inSampleRate, uint32_t outSampleRate)
| ASRC get context default configuration. More...
status_t | ASRC_SetContextConfig (ASRC_Type *base, asrc_context_t context, asrc_context_config_t *config)
| ASRC configure context. More...
status_t | ASRC_SetContextOutputConfig (ASRC_Type *base, asrc_context_t context, asrc_context_output_config_t *config)
| ASRC configure context output. More...
status_t | ASRC_SetContextInputConfig (ASRC_Type *base, asrc_context_t context, asrc_context_input_config_t *config)
| ASRC configure context input. More...
static void | ASRC_EnableContextRun (ASRC_Type *base, asrc_context_t context, bool enable)
| ASRC context enable run. More...
static void | ASRC_EnableContextRunStop (ASRC_Type *base, asrc_context_t context, bool enable)
| ASRC context enable run stop. More...
static void | ASRC_EnableContextInDMA (ASRC_Type *base, asrc_context_t context, bool enable)
| ASRC context input DMA request enable. More...
static void | ASRC_EnableContextOutDMA (ASRC_Type *base, asrc_context_t context, bool enable)
| ASRC context output DMA request enable. More...
static void | ASRC_EnablePreFilterBypass (ASRC_Type *base, asrc_context_t context, bool bypass)
| ASRC prefilter bypass mode This function enable or disable the ASRC prefilter bypass mode. More...
static void | ASRC_EnableResamplerBypass (ASRC_Type *base, asrc_context_t context, bool bypass)
| ASRC resampler bypass mode This function enable or disable the ASRC resampler bypass mode. More...
static void | ASRC_SetContextChannelNumber (ASRC_Type *base, asrc_context_t context, uint32_t channels)
| ASRC set context channel number. More...
uint32_t | ASRC_GetContextOutSampleSize (uint32_t inSampleRate, uint32_t inSamplesSize, uint32_t inWidth, uint32_t outSampleRate, uint32_t outWidth)
| ASRC get output sample count. More...

## Interrupts
static void | ASRC_EnableInterrupt (ASRC_Type *base, uint32_t mask)
| ASRC interrupt enable This function enable the ASRC interrupt with the provided mask. More...
static void | ASRC_DisableInterrupt (ASRC_Type *base, uint32_t mask)
| ASRC interrupt disable This function disable the ASRC interrupt with the provided mask. More...

## Status
static uint32_t | ASRC_GetInterruptStatus (ASRC_Type *base)
| Gets the ASRC interrupt status flag state. More...
static void | ASRC_ClearInterruptStatus (ASRC_Type *base, uint32_t status)
| clear the ASRC interrupt status flag state. More...
static uint32_t | ASRC_GetFifoStatus (ASRC_Type *base, asrc_context_t context)
| Gets the ASRC fifo status flag. More...

## fifo Operations
static void | ASRC_WriteContextFifo (ASRC_Type *base, asrc_context_t context, uint32_t data)
| write the ASRC context fifo. More...
static uint32_t | ASRC_ReadContextFifo (ASRC_Type *base, asrc_context_t context)
| read the ASRC context fifo. More...
static uint32_t | ASRC_GetWriteContextFifoAddr (ASRC_Type *base, asrc_context_t context)
| Get ASRC write fifo address. More...
static uint32_t | ASRC_GetReadContextFifoAddr (ASRC_Type *base, asrc_context_t context)
| Get the ASRC read context fifo address. More...
uint32_t | ASRC_ReadFIFORemainedSample (ASRC_Type *base, asrc_context_t context, uint32_t *outAddr, uint32_t outWidth, uint32_t sampleCount)
| Get the ASRC read fifo remained samples. More...

## Transactional
status_t | ASRC_TransferBlocking (ASRC_Type *base, asrc_context_t context, asrc_transfer_t *xfer)
| ASRC blocking convert audio sample rate. More...

## Data Structure Documentation

struct asrc_data_format_t

### Data Fields
uint8_t | dataPosition
| context input data sample position
asrc_data_endianness_t | dataEndianness
| context input data endianness
asrc_data_width_t | dataWidth
| context input data width
asrc_data_type_t | dataType
| context input data type
asrc_data_sign_t | dataSign
| context input data signed or unsigned

struct asrc_access_ctrl_t

The interleave patter is controlled using 3 register fields: GROUP_LENGTH, ACCESS_LENGTH, ITERATIONIS. This is intended to support hardware configurations which distribute a single context across samples from multiple audio sources. Take a example as below: accessGroupLen = 6, the sample group length is 6 samples accessIterations = 2, the 2 sequential ACCESS_LENGTH read from single source accessLen = 2, the 2 samples fetch from one source.

### Data Fields
uint8_t | accessIterations
| number of sequential fetches per source
uint8_t | accessGroupLen
| number of channels in a context
uint8_t | accessLen
| number of channels per source1

struct asrc_context_input_config_t

### Data Fields
uint32_t | sampleRate
| input audio data sample rate
uint8_t | watermark
| input water mark per samples
asrc_access_ctrl_t | accessCtrl
| input access control
asrc_data_format_t | dataFormat
| input data format

struct asrc_context_output_config_t

### Data Fields
uint32_t | sampleRate
| output audio data sample rate
uint8_t | watermark
| output water mark per samples
asrc_access_ctrl_t | accessCtrl
| output access control
asrc_data_format_t | dataFormat
| output data format
bool | enableDither
| output path contains a TPDF dither function. More...
bool | enableIEC60958
| output IEC60958 bit field insertion enable

#### Field Documentation

bool asrc_context_output_config_t::enableDither

The dither function support all fixed output modes(16, 20, 24, 32bits) dither is not supported in 32bit floating point output mode

struct asrc_context_prefilter_config_t

### Data Fields
asrc_sampleBuffer_init_mode_t | initMode
| prefilter initial mode
asrc_sampleBuffer_stop_mode_t | stopMode
| prefilter stop mode
asrc_prefilter_stage1_result_t | stage1Result
| stage1 data store format
uint32_t | filterSt1Taps
| prefilter stage1 taps
uint32_t | filterSt2Taps
| prefilter stage2 taps
uint32_t | filterSt1Exp
| prefilter stage1 expansion factor
const uint32_t * | filterCoeffAddress
| prefilter coeff address

struct asrc_context_resampler_config_t

### Data Fields
asrc_sampleBuffer_init_mode_t | initMode
| initial mode
asrc_sampleBuffer_stop_mode_t | stopMode
| resampler stop mode
asrc_resampler_taps_t | tap
| resampleer taps
uint32_t | filterPhases
| interpolation phases
uint64_t | filterCenterTap
| interpolation center tap
const uint32_t * | filterCoeffAddress
| interpolation coeff address

struct asrc_context_config_t

### Data Fields
uint8_t | contextChannelNums
| context channel numbers
asrc_context_input_config_t | contextInput
| context input configuration
asrc_context_output_config_t | contextOutput
| context output configuration
asrc_context_prefilter_config_t | contextPrefilter
| context pre filter configuration
asrc_context_resampler_config_t | contextResampler
| context resampler configuration

struct asrc_transfer_t

### Data Fields
uint32_t * | inDataAddr
| address of audio data to be converted
uint32_t | inDataSize
| size of the audio data
uint32_t * | outDataAddr
| address of audio data that is been converted
uint32_t | outDataSize
| size of the audio data

## Enumeration Type Documentation

anonymous enum

Enumerator
kStatus_ASRCIdle | ASRC is idle.
kStatus_ASRCBusy | ASRC is busy.
kStatus_ASRCInvalidArgument | ASRC invalid argument.
kStatus_ASRCConfigureFailed | ASRC configure failed.
kStatus_ASRCConvertError | ASRC convert error failed.
kStatus_ASRCNotSupport | ASRC not support.
kStatus_ASRCQueueFull | ASRC queue full.
kStatus_ASRCQueueIdle | ASRC quue idle.
kStatus_ASRCLoadFirmwareFailed | ASRC load firmware failed.
kStatus_ASRCResamplerConfigureFailed | ASRC resampler configured failed.
kStatus_ASRCPrefilterConfigureFailed | ASRC prefilter configured failed.

enum asrc_context_t

Enumerator
kASRC_Context0 | Context 0 value.
kASRC_Context1 | Context 1 value.
kASRC_Context2 | Context 2 value.
kASRC_Context3 | Context 3 value.

anonymous enum

Enumerator
kASRC_Context0InputFifoOverflow | context 0 input fifo overflow
kASRC_Context1InputFifoOverflow | context 1 input fifo overflow
kASRC_Context2InputFifoOverflow | context 2 input fifo overflow
kASRC_Context3InputFifoOverflow | context 3 input fifo overflow
kASRC_Context0OutFifoReadEmpty | context 0 out fifo read empty
kASRC_Context1OutFifoReadEmpty | context 1 out fifo read empty
kASRC_Context2OutFifoReadEmpty | context 2 out fifo read empty
kASRC_Context3OutFifoReadEmpty | context 3 out fifo read empty
kASRC_Context0RunStopDone | context 0 run stop done interrupt
kASRC_Context1RunStopDone | context 1 run stop done interrupt
kASRC_Context2RunStopDone | context 2 run stop done interrupt
kASRC_Context3RunStopDone | context 3 run stop done interrupt
kASRC_ContextAllInterruptStatus | all the context interrupt status

anonymous enum

Enumerator
kASRC_FifoStatusInputFifoWatermarkFlag | input water mark flag raised
kASRC_FifoStatusOutputFifoWatermarkFlag | output water mark flag raised

enum asrc_data_endianness_t

Enumerator
kASRC_DataEndianLittle | context data little endian
kASRC_DataEndianBig | context data big endian

enum asrc_data_width_t

Enumerator
kASRC_DataWidth32Bit | data width 32bit
kASRC_DataWidth24Bit | data width 24bit
kASRC_DataWidth20Bit | data width 20bit
kASRC_DataWidth16Bit | data width 16bit

enum asrc_data_type_t

Enumerator
kASRC_DataTypeInteger | data type int
kASRC_DataTypeFloat | data type float, single precision floating point format

enum asrc_data_sign_t

Enumerator
kASRC_DataSigned | input data is signed
kASRC_DataUnsigned | input data is unsinged

enum asrc_sampleBuffer_init_mode_t

Enumerator
kASRC_SampleBufferNoPreFillOnInit | do not pre-fill
kASRC_SampleBufferFillFirstSampleOnInit | replicate the first sample to fill the right half of the sample buffer
kASRC_SampleBufferFillZeroOnInit | zero fill the right half og the sample buffer

enum asrc_sampleBuffer_stop_mode_t

Enumerator
kASRC_SampleBufferFillLastSampleOnStop | replicate the last sample to fill the left half of the sample buffer
kASRC_SampleBufferFillZeroOnStop | zero fill the left half of the sample buffer

enum asrc_prefilter_stage1_result_t

Enumerator
kASRC_PrefilterStage1ResultInt | prefilter stage1 results are stored in 32 bit int format
kASRC_PrefilterStage1ResultFloat | prefilter stage1 results are stored in 32 bit float format

enum asrc_resampler_taps_t

Enumerator
kASRC_ResamplerTaps_32 | resampler taps 32
kASRC_ResamplerTaps_64 | resampler taps 64
kASRC_ResamplerTaps_128 | resampler taps 128

anonymous enum

Enumerator
kASRC_SampleRate_8000 | 8K sample rate
kASRC_SampleRate_11025 | 11025 sample rate
kASRC_SampleRate_12000 | 12K sample rate
kASRC_SampleRate_16000 | 16K sample rate
kASRC_SampleRate_22050 | 22.05K sample rate
kASRC_SampleRate_24000 | 24K sample rate
kASRC_SampleRate_32000 | 32K sample rate
kASRC_SampleRate_44100 | 44.1K sample rate
kASRC_SampleRate_48000 | 48K sample rate
kASRC_SampleRate_64000 | 64K sample rate
kASRC_SampleRate_88200 | 88.2K sample rate
kASRC_SampleRate_96000 | 96K sample rate
kASRC_SampleRate_128000 | 128K sample rate
kASRC_SampleRate_176400 | 176K sample rate
kASRC_SampleRate_192000 | 256K sample rate
kASRC_SampleRate_256000 | 256K sample rate
kASRC_SampleRate_352800 | 352.8K sample rate
kASRC_SampleRate_384000 | 384K sample rate
kASRC_SampleRate_768000 | 768K sample rate

## Function Documentation

uint32_t ASRC_GetInstance | ( | ASRC_Type * | base | ) |

Parameters

  base | ASRC base pointer.

void ASRC_Init | ( | ASRC_Type * | base | ) |

This API gates the asrc clock. The asrc module can't operate unless ASRC_Init is called to enable the clock.

param base asrc base pointer.

void ASRC_Deinit | ( | ASRC_Type * | base | ) |

This API gates the ASRC clock and disable ASRC module. The ASRC module can't operate unless ASRC_Init

Parameters

  base | ASRC base pointer.

void ASRC_GetContextDefaultConfig | ( | asrc_context_config_t * | config,
|  | uint32_t | channels,
|  | uint32_t | inSampleRate,
|  | uint32_t | outSampleRate
| ) |  |

Parameters

  config | ASRC context configuration pointer.
  channels | input audio data channel numbers.
  inSampleRate | input sample rate.
  outSampleRate | output sample rate.

status_t ASRC_SetContextConfig | ( | ASRC_Type * | base,
|  | asrc_context_t | context,
|  | asrc_context_config_t * | config
| ) |  |

Parameters

  base | ASRC base pointer.
  context | index of asrc context, reference asrc_context_t.
  config | ASRC context configuration pointer.

Return values

  kStatus_InvalidArgument | invalid parameters. kStatus_ASRCConfigureFailed context configure failed. kStatus_Success context configure success.

status_t ASRC_SetContextOutputConfig | ( | ASRC_Type * | base,
|  | asrc_context_t | context,
|  | asrc_context_output_config_t * | config
| ) |  |

Parameters

  base | ASRC base pointer.
  context | index of asrc context, reference asrc_context_t.
  config | ASRC context output configuration pointer.

status_t ASRC_SetContextInputConfig | ( | ASRC_Type * | base,
|  | asrc_context_t | context,
|  | asrc_context_input_config_t * | config
| ) |  |

Parameters

  base | ASRC base pointer.
  context | index of asrc context, reference asrc_context_t.
  config | ASRC context input configuration pointer.

static void ASRC_EnableContextRun | ( | ASRC_Type * | base,
|  | asrc_context_t | context,
|  | bool | enable
| ) |  |
| inlinestatic

All control fileds associated with a context must be stable prior to setting context run enable.

Parameters

  base | ASRC base pointer.
  context | ASRC context index.
  enable | true is enable, inform the datapath begin processing sample data for the context. false is disable, data processing will halt immediately.

static void ASRC_EnableContextRunStop | ( | ASRC_Type * | base,
|  | asrc_context_t | context,
|  | bool | enable
| ) |  |
| inlinestatic

This function used to flush the ASRC pipeline and completely end processing for a context.

Parameters

  base | ASRC base pointer.
  context | ASRC context index.
  enable | true is enable, false is disable.

static void ASRC_EnableContextInDMA | ( | ASRC_Type * | base,
|  | asrc_context_t | context,
|  | bool | enable
| ) |  |
| inlinestatic

Parameters

  base | ASRC base pointer.
  context | ASRC context index.
  enable | true is enable, false is disable.

static void ASRC_EnableContextOutDMA | ( | ASRC_Type * | base,
|  | asrc_context_t | context,
|  | bool | enable
| ) |  |
| inlinestatic

Parameters

  base | ASRC base pointer.
  context | ASRC context index.
  enable | true is enable, false is disable.

static void ASRC_EnablePreFilterBypass | ( | ASRC_Type * | base,
|  | asrc_context_t | context,
|  | bool | bypass
| ) |  |
| inlinestatic

Parameters

  base | ASRC peripheral base address.
  context | context processor number.
  bypass | true is bypass, false is normal mode.

static void ASRC_EnableResamplerBypass | ( | ASRC_Type * | base,
|  | asrc_context_t | context,
|  | bool | bypass
| ) |  |
| inlinestatic

Parameters

  base | ASRC peripheral base address.
  context | context processor number.
  bypass | true is bypass, false is normal mode.

static void ASRC_SetContextChannelNumber | ( | ASRC_Type * | base,
|  | asrc_context_t | context,
|  | uint32_t | channels
| ) |  |
| inlinestatic

Note: The maximum channel number in one context can not exceed 32.

Parameters

  base | ASRC peripheral base address.
  context | context number.
  channels | channel number, should <= 32.

uint32_t ASRC_GetContextOutSampleSize | ( | uint32_t | inSampleRate,
|  | uint32_t | inSamplesSize,
|  | uint32_t | inWidth,
|  | uint32_t | outSampleRate,
|  | uint32_t | outWidth
| ) |  |

Parameters

  inSampleRate | output sample rate.
  inSamplesSize | input sample rate.
  inWidth | input samples buffer size, the size of buffer should be converted to align with 4 byte .
  outSampleRate | input sample width.
  outWidth | Output width.

Return values

  output | samples size.

static void ASRC_EnableInterrupt | ( | ASRC_Type * | base,
|  | uint32_t | mask
| ) |  |
| inlinestatic

Parameters

  base | ASRC peripheral base address.
  mask | The interrupts to enable. Logical OR of _asrc_interrupt_mask.

static void ASRC_DisableInterrupt | ( | ASRC_Type * | base,
|  | uint32_t | mask
| ) |  |
| inlinestatic

Parameters

  base | ASRC peripheral base address.
  mask | The interrupts to disable. Logical OR of _asrc_interrupt_mask.

static uint32_t ASRC_GetInterruptStatus | ( | ASRC_Type * | base | ) |
| inlinestatic

Parameters

  base | ASRC base pointer

Returns
  ASRC Tx status flag value. Use the Status Mask to get the status value needed.

static void ASRC_ClearInterruptStatus | ( | ASRC_Type * | base,
|  | uint32_t | status
| ) |  |
| inlinestatic

Parameters

  base | ASRC base pointer
  status | status flag to be cleared.

static uint32_t ASRC_GetFifoStatus | ( | ASRC_Type * | base,
|  | asrc_context_t | context
| ) |  |
| inlinestatic

Parameters

  base | ASRC base pointer
  context | context id

static void ASRC_WriteContextFifo | ( | ASRC_Type * | base,
|  | asrc_context_t | context,
|  | uint32_t | data
| ) |  |
| inlinestatic

Parameters

  base | ASRC base pointer.
  context | context id.
  data | data to write.

static uint32_t ASRC_ReadContextFifo | ( | ASRC_Type * | base,
|  | asrc_context_t | context
| ) |  |
| inlinestatic

Parameters

  base | ASRC base pointer.
  context | context id.

Return values

  read | data.

static uint32_t ASRC_GetWriteContextFifoAddr | ( | ASRC_Type * | base,
|  | asrc_context_t | context
| ) |  |
| inlinestatic

Parameters

  base | ASRC base pointer.
  context | context id.

Return values

  write | fifo address.

static uint32_t ASRC_GetReadContextFifoAddr | ( | ASRC_Type * | base,
|  | asrc_context_t | context
| ) |  |
| inlinestatic

Parameters

  base | ASRC base pointer.
  context | context id.

Return values

  read | fifo address.

uint32_t ASRC_ReadFIFORemainedSample | ( | ASRC_Type * | base,
|  | asrc_context_t | context,
|  | uint32_t * | outAddr,
|  | uint32_t | outWidth,
|  | uint32_t | sampleCount
| ) |  |

Since the DMA request will be triggered only when the sample group in read fifo is bigger then the watermark, so when the data size cannot be divisible by the (watermark + 1), then part of sample will left in read fifo, application should call this api to get the left samples.

Parameters

  base | ASRC base pointer.
  context | context id.
  outAddr | address to receive remained sample in read fifo.
  outWidth | output data width.
  sampleCount | specify the read sample count.

Return values

  sample | counts actual read from output fifo.

status_t ASRC_TransferBlocking | ( | ASRC_Type * | base,
|  | asrc_context_t | context,
|  | asrc_transfer_t * | xfer
| ) |  |

This function depends on the configuration of input and output, so it should be called after the ASRC_SetContextConfig. The data format it supports: 1.16bit 16bit per sample in input buffer, input buffer size should be calculate as: samples 2U output buffer size can be calculated by call function ASRC_GetContextOutSampleSize, the parameter outWidth should be 2 2.20bit 24bit per sample in input buffer, input buffer size should be calculate as: samples 3U output buffer size can be calculated by call function ASRC_GetContextOutSampleSize, the outWidth should be 3. 3.24bit 24bit per sample in input buffer, input buffer size should be calculate as: samples * 3U output buffer size can be calculated by call function ASRC_GetContextOutSampleSize, the outWidth should be 3. 4.32bit 32bit per sample in input buffer, input buffer size should be calculate as: samples * 4U output buffer size can be calculated by call function ASRC_GetContextOutSampleSize, the outWidth should be 4.

Parameters

  base | ASRC base pointer.
  context | context id.
  xfer | .xfer configuration.

Return values

  kStatus_Success. |