MTB CAT1 Peripheral driver library
All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules Pages
Mixer (Audio Mixer)

General Description

The Mixer driver provides APIs to configure the audio mixer.

The functions and other declarations used in this driver are in cy_mixer.h. You can include cy_pdl.h (ModusToolbox only) to get access to all functions and declarations in the PDL.

Features:

Configuration Considerations

To set up an audio mixer, initialize the mixer destination and one or more source streams.

The mixer destination can be configured by providing all of the parameters in the cy_stc_mixer_dst_config_t structure. Then call the Cy_Mixer_DestinationInit function to initialize the mixer destination. Additional APIs are provided to configure and control the mixer destination after initialization.

A mixer source can be configured by providing all of the parameters in the cy_stc_mixer_src_config_t structure. Then call the Cy_Mixer_SourceInit function to initialize the mixer source. Additional APIs are provided to configure and control the mixer source after initialization.

For the mixer to operate, the destination and one or more sources must be enabled and activated. Typically, enabling a source is done at mixer initialization time and activating/deactivating a source is done at a finer grain, based on system events that activate (start) and/or deactivate (end) PCM source streams.

Destination initialization example:

/* Scenario: Set up and start a mixer destination */
.fadeCode = CY_MIXER_CODE_SAME,
.gainCode = 115,
.trgLevel = 0,
};
/* Apply mixer destination configuration */
Cy_Mixer_DestinationInit(MIXER0_MIXER_DST_STRUCT, &config);
/* Enable the mixer destination */
Cy_Mixer_Dst_Enable(MIXER0_MIXER_DST_STRUCT);
/* Activate the mixer destination */
Cy_Mixer_Dst_Activate(MIXER0_MIXER_DST_STRUCT);

Source initialization example:

/* Scenario: Set up and start a mixer source */
.fadeCode = CY_MIXER_CODE_MUTE,
.gainCode = 115,
.trgLevel = 0,
};
/* Apply mixer source configuration */
Cy_Mixer_SourceInit(MIXER0_MIXER_SRC_STRUCT0, &config);
/* Enable the mixer source */
Cy_Mixer_Src_Enable(MIXER0_MIXER_SRC_STRUCT0);
/* Activate the mixer source */
Cy_Mixer_Src_Activate(MIXER0_MIXER_SRC_STRUCT0);

Mixer sources and destinations may be written and read by the MCU (via the provided APIs: Cy_Mixer_Src_FifoWriteData, Cy_Mixer_Dst_FifoReadData) or by DMA. If using DMA, the DMA channel should be previously configured. Triggers generated by the Mixer can be used to initiate DMA transfers to and from the mixer source and destination FIFOs.

More Information.

See the Mixer chapter of the device technical reference manual (TRM).

Changelog

VersionChangesReason for Change
1.0 The initial version.

API Reference

 Macros
 
 Functions
 
 Data Structures
 
 Enumerated Types