Synergy Software Package User's Manual
Audio Playback Framework

Audio Playback Framework Introduction

The Audio Playback Framework module provides a high-level API for audio playback applications and is implemented on either sf_audio_playback_hw_dac or sf_audio_playback_hw_i2s. The Audio Playback Framework handles the synchronization needed to play 16-bit and 8-bit pulse-code modulation (PCM) samples and uses the DAC (DAC12 or DAC8) or I2S, timer (AGT or GPT) and data-transfer (DMA or DTC) peripherals on a Synergy MCU. A user-defined callback can be created to respond to the need for additional data.

Audio Playback Framework Module Features

  • Plays long buffers by splitting the data into manageable chunks.
  • Repeats playback until a ThreadX timeout (for repeated audio like sine wave tones or looped background music).
  • Requests next data using callback after last buffer playback begins.
  • Software volume control.
  • Pause and resume functions.
  • Scaling, for example to move signed 16-bit PCM data into range of the unsigned 12-bit DAC or unsigned 8-bit DAC8.
  • Basic mixing for multiple streams.
audio_playback_BD.png
Audio Playback Framework Module Block Diagram

Audio Playback Framework Module APIs Overview

The Audio Playback Framework module defines APIs for operations such as opening, starting, playing and stopping. A complete list of the available APIs, an example API call and a short description of each can be found in the following table. A table of status return values follows the API summary table.

Audio Playback Framework Module API Summary

Function Name Example API Call and Description
open g_sf_audio_playback0.p_api->open( g_sf_audio_playback0.p_ctrl, g_sf_audio_playback0.p_cfg);
Open a device channel for read/write and control.
start g_sf_audio_playback0.p_api->start( g_sf_audio_playback0.p_ctrl, p_data, Timeout);
Start Audio Playback Hardware.
pause g_sf_audio_playback0.p_api->pause( g_sf_audio_playback0.p_ctrl);
Pause Audio Playback Hardware.
stop g_sf_audio_playback0.p_api->stop( g_sf_audio_playback0.p_ctrl);
Stop Audio Playback Hardware.
resume g_sf_audio_playback0.p_api->resume( g_sf_audio_playback0.p_ctrl, &buffer, length);
Resume playback.
volumeSet g_sf_audio_playback0.p_api->volumeSet( g_sf_audio_playback0.p_ctrl, volume);
Sets volume.
close g_sf_audio_playback0.p_api->close( g_sf_audio_playback0.p_ctrl);
Close the audio module.
versionGet g_sf_audio_playback0.p_api->versionGet(&version);
Return the version of the module using the version pointer.
Note
For more complete descriptions of operation and definitions for the function data structures, typedefs, defines, API data, API structures and function variables, review the SSP User's Manual API References for the associated module.

Status Return Values

Name Description
SSP_SUCCESS Function successful.
SSP_ERR_ASSERTION A pointer is NULL or a parameter is invalid.
SSP_ERR_OUT_OF_MEMORY The number of streams open at once is limited to SF_AUDIO_PLAYBACK_CFG_MAX_STREAMS. If this number is exceeded, an out of memory error occurs.
SSP_ERR_TIMEOUT Timeout occurred before playback finished.
SSP_ERR_NOT_OPEN The stream control block p_ctrl is not initialized.
Note
Lower-level drivers may return common error codes. Refer to the SSP User's Manual API References for the associated module for a definition of all relevant status-return values.

Audio Playback Framework Module Operational Overview

The Audio Playback Framework module creates a thread internally to support audio playback. The following figure shows a flowchart of the audio playback framework thread and its interactions with public Audio Playback Framework API functions:

audio_playback_FC.png
Audio Playback Framework Module Flow Chart

Suggested use of the audio playback framework:

  • Create a semaphore (for example, g_sf_audio_playback_semaphore). This can be done on the Threads tab. Set the initial value to 2 (the audio playback framework can store up to two data messages per stream).
  • Create a callback function (for example, sf_audio_playback_callback). Enter the name of your callback function in the Audio Playback Framework instance. The callback function will be called when the audio playback framework is done with the data. In the callback, put the semaphore created above.
  • In your main loop, get the semaphore before playing data. To play data, first acquire a buffer from the messaging framework, then create your audio playback data structure inside the buffer.

The Audio Playback Framework supports multiple audio streams on a single hardware port. A block diagram of the modules required if two streams are used is shown in the following figure:

audio_playback_AS.png
Audio Playback Framework Module Audio Streams

Audio Playback Framework Module Important Operational Notes and Limitations

Audio Playback Framework Module Operational Notes

Configuring Messages

Use the Messaging Framework configurator on the Messaging tab to configure the messaging framework:

  1. Highlight the Audio Playback event class.
  2. Add a new subscriber. Select the following configurations and make sure the Message Class Instance property set in the Properties tab of the Audio Playback Framework on sf_audio_playback module is between the Start and End instance.
    • Thread: Any thread in the application.
    • Start: First audio instance used in application.
    • End: Last audio instance used in application.
  3. Highlight the new Subscriber in the Audio Playback Subscribers. Record the Symbol name.
  4. Go back to the Threads tab.
  5. Highlight the Audio Playback Framework Shared module in HAL/Common, and set the Audio Message Queue Name to the Symbol name from the Audio Playback Subscriber.

Using the I2S Implementation

The audio framework I2S hardware port has dependencies on the I2S Driver module. The I2S driver module can be accelerated with DTC.

  • Set the ISDE properties for the I2S driver module.
    • Set the Audio Clock Frequency (Hertz) to the frequency of the input audio clock used.
    • Set the Sampling Frequency (Hertz) to the sampling frequency of your audio data.
    • Set the Data Bits and Word Length to 16 bits (audio framework accepts 16 bit samples only).
    • Enable the SSIn TXI and SSIn INT interrupts.
  • The Transfer module on r_dtc is added automatically.

Using the DAC Implementation

The audio framework DAC hardware port has dependencies on the Timer, DAC, and Transfer API modules.

  • Add a Timer module.
    • Set the Frequency in Hz to the sampling frequency of your audio data.
    • Enable the interrupt if using DTC as the transfer module (recommended).
  • Add a DAC (DAC12 or DAC8) module.
  • Add a Transfer module on r_dtc.
    • Set Destination pointer to &R_DAC->DADRn[0] if using DAC channel 0 or &R_DAC->DADRn[1] if using DAC channel 1.
    • Set Destination pointer to &R_DAC8->DADRn[2] if using DAC8 channel 2 (S128) or &R_DAC8->DADRn[0] if using DAC8 channel 0 (S1JA).
    • Set the Activation source to the timer interrupt chosen above.

Other Operational Notes

The Queue used must match the name specified in Properties for Audio Playback Framework Shared on sf_audio_playback (default is g_sf_audio_playback_queue).

Audio Playback Framework Module Limitations

  • Refer to the latest SSP Release Notes for any additional operational limitations for this module.

Including the Audio Playback Framework Module in an Application

This section describes how to include the Audio Playback Framework module in an application using the SSP configurator.

Note
This section assumes you are familiar with creating a project, adding threads, adding a stack to a thread and configuring a block within the stack. If you are unfamiliar with any of these items, refer to the first few chapters of the SSP User's Manual to learn how to manage each of these important steps in creating SSP-based applications.

To add the Audio Playback Framework module to an application, simply add it to a HAL /Common thread using the stacks selection sequence given in the following table. (The default name for the Audio Playback Framework module is g_sf_audio_playback0. This name can be changed in the associated Properties window.)

Audio Playback Framework Module Selection Sequence

Resource ISDE Tab Stacks Selection Sequence
g_sf_audio_playback Audio Playback Framework on g_sf_audio_playback Threads New Stack> Framework> Audio> Audio Playback Framework on g_sf_audio_playback

When the Audio Playback Framework module on sf_audio_playback is added to the thread stack as shown in the following figure, the configurator automatically adds any needed lower‑level modules. Any modules needing additional configuration information have the box text highlighted in Red. Modules with a Gray band are individual modules that stand alone. Modules with a Blue band are shared or common; they need only be added once and can be used by multiple stacks. Modules with a Pink band can require the selection of lower-level modules; these are either optional or recommended. (This is indicated in the block with the inclusion of this text.) If the addition of lower-level modules is required, the module description include Add in the text. Clicking on any Pink banded modules brings up the New icon and displays possible choices.

audio_playback_MS.png
Audio Playback Framework Module Stack

Configuring the Audio Playback Framework Module

The Audio Playback Framework module must be configured by the user for the desired operation. The SSP configuration window will automatically identify (by highlighting the block in red) any required configuration selections, such as interrupts or operating modes, which must be configured for lower-level modules in order to ensure successful operation. Furthermore, only those properties that can be changed without causing conflicts are available for modification. Other properties are 'locked' and are not available for changes, and are identified with a lock icon for the 'locked' property in the Properties window in the ISDE. This approach simplifies the configuration process and makes it much less error-prone than previous 'manual' approaches to configuration. The available configuration settings and defaults for all the user-accessible properties are given in the Properties tab within the SSP configurator, and are shown in the following tables for easy reference.

Note
You may want to open your ISDE, create the module and explore the property settings in parallel with looking over the following configuration table settings; this will help orient you and can be a useful 'hands-on' approach to learning the ins and outs of developing with the SSP.

Configuration Settings for the Audio Playback Framework Module on sf_audio_playback

ISDE Property Value Description
Parameter Checking BSP, Enabled, Disabled

Default: BSP
Enables or disables the parameter checking.
Buffer Size Bytes 512 Buffer size bytes selection.
Maximum Number of Streams 1 Maximum number of streams selection.
Thread Stack Size 512 Thread stack size selection.
Name g_sf_audio_playback0 Module name.
Message Class Instance 0 Message class instance selection.
Callback NULL Callback selection.
Name of generated initialization function sf_audio_playback_init0 Name of generated initialization function selection.
Auto Initialization Enable, Disable

Default: Enable
Auto initialization selection.
Note
Increasing the buffer size will increase the RAM consumption of this module.
The example values and defaults are for a project using the Synergy S7G2 MCU Group. Other MCUs may have different default values and available configuration settings.

In some cases, settings other than the defaults for lower-level modules can be desirable. For example, it might be useful to select the DAC Channel based on the target hardware implementation. The configurable properties for the lower-level stack modules are given in the following sections for completeness and as a reference.

Note
Most of the property settings for lower level modules are fairly intuitive and can usually be determined by inspection of the associated Properties window from the SSP configurator.

Configuring the Audio Playback Framework Lower-Level Modules

Typically, only a small number of settings must be modified from the default for lower-level drivers as indicated with red text in the thread stack block. Notice that some of the configuration properties must be set to a certain value for proper framework operation and will be locked to prevent user modification. The following table identifies all the settings within the properties section for the module.

Configuration Settings for the Audio Playback Framework Shared on sf_audio_playback

ISDE Property Value Description
Name g_sf_audio_playback_common0 Module name.
Thread Priority 3 Thread priority selection.
Audio Message Queue Name g_sf_audio_playback_queue Audio message queue name selection.
Note
The example values and defaults are for a project using the Synergy S7G2 MCU Group. Other MCUs may have different default values and available configuration settings.

Configuration Settings for the Messaging Framework on sf_message

ISDE Property Value Description
Parameter Checking BSP, Enabled, Disabled

Default: BSP
Enables or disables the parameter checking.
Message Queue Depth (Total number of messages to be enqueued in a Message Queue) 16 Specify the size of Thread X Message Queue in bytes for Message Subscribers. This value is applied to all the Message Queues.
Name g_sf_message0 The name of Messaging Framework module control block instance.
Work memory size in bytes 2048 Specify the work memory size in bytes. Choosing a small number results in a small number of buffers, which can be allocated at the same time (you can confirm the total buffer number on sf_message_instance_ctrl_t::number_of_buffers). If the value is smaller than the peak number of messages to be posted at the same time, the Framework has a buffer allocation failure, affecting system performance.
Pointer to subscriber list array p_subscriber_lists Specify the name of pointer to the Subscriber List array.
name of the block pool internally used in the messaging framework sf_msg_blk_pool The name of memory block memory the Framework creates in the control block. This parameter might be useful for debugging purpose but NULL can be specified for saving memory.
Name of generated initialization function sf_message_init0 Name of generated initialization function selection.
Auto Initialization Enable, Disable

Default: Enable
Auto initialization selection.
Note
The example values and defaults are for a project using the Synergy S7G2 MCU Group. Other MCUs may have different default values and available configuration settings.

Configuration Settings for the Audio Playback Hardware Framework Shared on sf_audio_playback_hw_dac

ISDE Property Value Description
Parameter Checking BSP, Enabled, Disabled

Default: BSP
Enables or disables the parameter checking.
DMAC Support Disabled, Enabled

Default: Disabled
DMAC support selection.
Name g_sf_audio_playback_hw0 Module name.
Note
The example values and defaults are for a project using the Synergy S7G2 MCU Group. Other MCUs may have different default values and available configuration settings.

Configuration Settings for the Transfer Driver on r_dmac Software Activation

ISDE Property Value Description
Parameter Checking BSP, Enabled, Disabled

Default: BSP
Selects if code for parameter checking is to be included in the build.
Name g_transfer0 Module name.
Channel 0 Channel selection.
Mode Normal Mode selection.
Transfer Size 2 Bytes Transfer size selection.
Destination Address Mode Fixed Destination address mode selection.
Source Address Mode Incremented Source address mode selection.
Repeat Area (Unused in Normal Mode Source Repeat area selection.
Destination Pointer NULL Destination pointer selection.
Source Pointer NULL Source pointer selection.
Number of Transfers 0 Number of transfers selection.
Number of Blocks (Valid only in Block Mode) 0 Number of blocks selection.
Activation Source Software Activation, Peripheral Events

Default: Software Activation
Activation source selection.
Auto Enable False Auto enable selection.
Callback NULL Callback selection.
Interrupt Priority Priority 0 (highest), Priority 1:14, Priority 15 (lowest - not valid if using ThreadX)

Default: Disabled
Interrupt priority selection.
Note
The example values and defaults are for a project using the Synergy S7G2 MCU Group. Other MCUs may have different default values and available configuration settings.

Configuration Settings for the Transfer Driver on r_dmac Software Activation 1

ISDE Property Value Description
Parameter Checking BSP, Enabled, Disabled

Default: BSP
Selects if code for parameter checking is to be included in the build.
Software Start Enabled, Disabled

Default: Disabled
Software start selection.
Linker section to keep DTC vector table .ssp_dtc_vector_table Linker section selection.
Name g_transfer0 Module name.
Mode Normal Mode selection.
Transfer Size 2 Bytes Transfer size selection.
Destination Address Mode Fixed Destination address mode selection.
Source Address Mode Incremented Source address mode selection.
Repeat Area (Unused in Normal Mode Source Repeat area selection.
Interrupt Frequency After all transfers have completed Interrupt frequency selection.
Destination Pointer NULL Destination pointer selection.
Source Pointer NULL Source pointer selection.
Number of Transfers 0 Number of transfers selection.
Number of Blocks (Valid only in Block Mode) 0 Number of blocks selection.
Activation Source (Must enable IRQ) Software Activation 1, Software Activation 2, Peripheral Events

Default: Software Activation 1
Activation source selection.
Auto Enable False Auto enable selection.
Callback (Only valid with Software start) NULL Callback selection.
ELC Software Event Interrupt Priority Priority 0 (highest), Priority 1:14, Priority 15 (lowest - not valid if using ThreadX)

Default: Disabled
ELC Software Event interrupt priority selection.
Note
The example values and defaults are for a project using the Synergy S7G2 MCU Group. Other MCUs may have different default values and available configuration settings.

Configuration Settings for the Timer Driver on r_agt

ISDE Property Value Description
Parameter Checking BSP, Enabled, Disabled

Default: BSP
Enables or disables parameter checking.
Name g_timer0 Module name.
Channel 0 Physical hardware channel.
Mode Periodic Warning: One-shot functionality is not available in the GPT hardware, so it is implemented in software by stopping the timer in the ISR called when the period expires. For this reason, ISRs must be enabled for one-shot mode even if the callback is unused.
Period Value 10 See Timer Period Calculation.
Period Unit Hertz See Timer Period Calculation.
Auto Start False Set to true to start the timer after configuring or false to leave the timer stopped until timer_api_t::start is called.
Count Source PCLKB, PCLKB/8, PCLKB/2, LOCO, AGT0 Underflow, AGT0 fSub

Default: PCLKB
The clock source for the AGT counter.
AGTO Output Enabled True, False

Default: False
Set to true to output the timer signal on a port pin configured for AGT (AGTO pin). Set to false for no output of the timer signal.
AGTIO Output Enabled True, False

Default: False
Set to true to output the timer signal on a port pin configured for AGT (AGTIO pin). Set to false for no output of the timer signal.
Output Inverted True, False

Default: False
Set to false to start the output signal low. Set to true to start the output signal high.
Enable comparator A output pin True, False

Default: False
Enable comparator A output pin selection.
Enable comparator B output pin True, False

Default: False
Enable comparator B output pin selection.
Callback NULL A user callback function can be registered in timer_api_t::open. If this callback function is provided, it will be called from the interrupt service routine (ISR) each time the timer period elapses.

Warning: Since the callback is called from an ISR, care should be taken not to use blocking calls or lengthy processing. Spending excessive time in an ISR can affect the responsiveness of the system.
Interrupt Priority Priority 0 (highest), Priority 1:14, Priority 15 (lowest - not valid if using ThreadX)

Default: Disabled
Timer interrupt priority. 0 is the highest priority.
Note
The example values and defaults are for a project using the Synergy S7G2 MCU Group. Other MCUs may have different default values and available configuration settings.

Configuration Settings for the Timer Driver on r_gpt

ISDE Property Value Description
Parameter Checking BSP, Enabled, Disabled

Default: BSP
Enables or disables the parameter checking.
Name g_timer0 Module name.
Channel 0 Channel selection.
Mode Periodic Warning: One-shot functionality is not available in the GPT hardware, so it is implemented in software by stopping the timer in the ISR called when the period expires. For this reason, ISRs must be enabled for one-shot mode even if the callback is unused.
Period Value 10 See Timer Period Calculation.
Period Unit Hertz See Timer Period Calculation.
Duty Cycle Value 50 Duty cycle value selection.
Duty Cycle Unit Unit Raw Counts, Unit Percent, Unit Percent x 1000

Default: Unit Raw Counts
Duty cycle unit selection.
Auto Start False Set to true to start the timer after configuring or false to leave the timer stopped until timer_api_t::start is called.
GTIOCA Output Enabled True, False

Default: False
Set to true to output the timer signal on a port pin configured for GPT. Set to false for no output of the timer signal.
GTIOCA Stop Level Pin Level Low, Pin Level High, Pin Level Retained

Default: Pin Level Low
Controls output pin level when the timer is stopped.
GTIOCB Output Enabled True, False

Default: False
Set to true to output the timer signal on a port pin configured for GPT. Set to false for no output of the timer signal.
GTIOCB Stop Level Pin Level Low, Pin Level High, Pin Level Retained

Default: Pin Level Low
Controls output pin level when the timer is stopped.
Callback NULL A user callback function can be registered in timer_api_t::open. If this callback function is provided, it will be called from the interrupt service routine (ISR) each time the timer period elapses.

Warning: Since the callback is called from an ISR, care should be taken not to use blocking calls or lengthy processing. Spending excessive time in an ISR can affect the responsiveness of the system.
Interrupt Priority Priority 0 (highest), Priority 1:14, Priority 15 (lowest - not valid if using ThreadX)

Default: Disabled
Interrupt priority selection.
Note
The example values and defaults are for a project using the Synergy S7G2 MCU Group. Other MCUs may have different default values and available configuration settings.

Configuration Settings for the DAC HAL Module on r_dac

ISDE Property Value Description
Parameter Checking BSP, Enabled, Disabled

Default: BSP
Enable or disable the parameter error checking.
Name g_dac0 Module name.
Channel 0 Set to 0 for output DA0 or 1 for output DA1.
Synchronize with ADC Enabled, Disabled

Default: Disabled
Set to true for anti-interference synchronization with the Analog-to-Digital Converter (ADC) Module. Set to false if power supply interference between the analog modules is not a problem, or if asynchronous conversion by the DAC module is desired.
Data Format Right Justified Set to zero, if 12-bit data values are loaded in bits 11 through 0, or right justified. Set to one, if 12-bit data values are loaded in bits 15 through 4, or left justified.
Output Amplifier Enable, Disable

Default: Disable
Set to true, if output amplifier hardware function is desired. Set to false to bypass output amplifier hardware function.
Note
The example values and defaults are for a project using the Synergy S7G2 MCU Group. Other MCUs may have different default values and available configuration settings.

Configuration Settings for the Audio Playback Framework Shared on sf_audio_playback_hw_i2s

ISDE Property Value Description
Parameter Checking BSP, Enabled, Disabled

Default: BSP
Enable or disable the parameter error checking.
Name g_sf_audio_playback_hw0 Module name.
Note
The example values and defaults are for a project using the Synergy S7G2 MCU Group. Other MCUs may have different default values and available configuration settings.

Configuration Settings for the I2S HAL Module on r_ssi

ISDE Property Value Description
Parameter Checking BSP, Enabled, Disabled

Default: BSP
Enables or disables the parameter checking.
Name g_i2s0 Module name.
Channel 0 Physical hardware channel.
Audio Clock Frequency (Hertz) 2822400 Input audio clock frequency, used to generate the I2S clock. Must be a multiple between 1 and 128 of (sampling_freq_hz * word_length_in_bits).
Sampling Frequecy (Hertz) 44100 Sampling frequency of audio data.
Data Bits 8 bits, 16, 18, 20, 22, 24

Default: 16 bits
Bit depth of audio data, which is the size in bits of one sample of audio data.
Word Length 8 bits, 16, 24, 32

Default: 16 bits
Word length of audio data, must be at least the same size as the bit depth (Data Bits field).
WS Continue Mode Enabled, Disabled

Default: Disabled
Enable WS continue mode to continue to output the word select line when the peripheral is idle. Disable to stop outputting the word select line when the peripheral is idle.
Name of I2S callback function to be defined by user NULL A user callback function must be registered in open. The callback will be called from the interrupt service routine (ISR) when the transmission FIFO reaches the high watermark point after all data for transmission is transmitted or when reception is complete (the requested number of bytes have been received).

Warning: Since the callback is called from an ISR, care should be taken not to use blocking calls or lengthy processing. Spending excessive time in an ISR can affect the responsiveness of the system.
Transmit Interrupt Priority Priority 0 (highest), Priority 1:14, Priority 15 (lowest - not valid if using ThreadX)

Default: Disabled
Transmit interrupt priority selection.
Receive Interrupt Priority Priority 0 (highest), Priority 1:14, Priority 15 (lowest - not valid if using ThreadX)

Default: Disabled
Receive interrupt priority selection.
Idle/Error Interrupt Priority Priority 0 (highest), Priority 1:14, Priority 15 (lowest - not valid if using ThreadX)

Default: Priority 12
Idle/error interrupt priority selection.
Note
The example values and defaults are for a project using the Synergy S7G2 MCU Group. Other MCUs may have different default values and available configuration settings.

Configuration Settings for the Transfer Driver on r_dtc Software Activation 1

ISDE Property Value Description
Parameter Checking BSP, Enabled, Disabled

Default: BSP
Parameter selection.
Software Start Enabled, Disabled

Default: Disabled
Software start selection.
Linker section to keep DTC vector table .ssp_dtc_vector_table Linker section to keep DTC vector table.
Name g_transfer0 Driver name.
Mode Normal Mode selection.
Transfer Size 4 Bytes Transfer size selection.
Destination Address Mode Fixed Destination address mode selection.
Source Address Mode Incremented Source address mode selection.
Repeat Area (Unused in Normal Mode Source Repeat area selection.
Interrupt Frequency After all transfers have completed Interrupt frequency selection.
Destination Pointer NULL Destination pointer selection.
Source Pointer NULL Source pointer selection.
Number of Transfers 0 Number of transfers selection.
Number of Blocks (Valid only in Block Mode) 0 Number of blocks selection.
Activation Source (Must enable IRQ) Software Activation 1, Software Activiation 2, Peripheral Events

Default: Software Activation 1
Activation source selection.
Auto Enable False Auto enable selection.
Callback (Only valid with Software start) NULL Callback selection.
ELC Software Event Interrupt Priority Priority 0 (highest), Priority 1:14, Priority 15 (lowest - not valid if using ThreadX)

Default: Disabled
ELC software event interrupt priority selection.
Note
The example values and defaults are for a project using the Synergy S7G2 MCU Group. Other MCUs may have different default values and available configuration settings.

Configuration Settings for the Transfer Driver on r_dtc Software Activation 1

ISDE Property Value Description
Parameter Checking BSP, Enabled, Disabled

Default: BSP
Parameter selection.
Software Start Enabled, Disabled

Default: Disabled
Software start selection.
Linker section to keep DTC vector table .ssp_dtc_vector_table Linker section to keep DTC vector table.
Name g_transfer1 Driver name.
Mode Normal Mode selection.
Transfer Size 4 Bytes Transfer size selection.
Destination Address Mode Incremented Destination address mode selection.
Source Address Mode Fixed Source address mode selection.
Repeat Area (Unused in Normal Mode Destination Repeat area selection.
Interrupt Frequency After all transfers have completed Interrupt frequency selection.
Destination Pointer NULL Destination pointer selection.
Source Pointer NULL Source pointer selection.
Number of Transfers 0 Number of transfers selection.
Number of Blocks (Valid only in Block Mode) 0 Number of blocks selection.
Activation Source (Must enable IRQ) Software Activation 1, Software Activiation 2, Peripheral Events

Default: Software Activation 1
Activation source selection.
Auto Enable False Auto enable selection.
Callback (Only valid with Software start) NULL Callback selection.
ELC Software Event Interrupt Priority Priority 0 (highest), Priority 1:14, Priority 15 (lowest - not valid if using ThreadX)

Default: Disabled
ELC software event interrupt priority selection.
Note
The example values and defaults are for a project using the Synergy S7G2 MCU Group. Other MCUs may have different default values and available configuration settings.

Configuration Settings for the Timer Driver on r_agt

ISDE Property Value Description
Parameter Checking BSP, Enabled, Disabled

Default: BSP
Parameter selection.
Software Start Enabled, Disabled

Default: Disabled
Software start selection.
Linker section to keep DTC vector table .ssp_dtc_vector_table Linker section to keep DTC vector table.
Name g_transfer1 Driver name.
Mode Normal Mode selection.
Transfer Size 4 Bytes Transfer size selection.
Destination Address Mode Incremented Destination address mode selection.
Source Address Mode Fixed Source address mode selection.
Repeat Area (Unused in Normal Mode Destination Repeat area selection.
Interrupt Frequency After all transfers have completed Interrupt frequency selection.
Destination Pointer NULL Destination pointer selection.
Source Pointer NULL Source pointer selection.
Number of Transfers 0 Number of transfers selection.
Number of Blocks (Valid only in Block Mode) 0 Number of blocks selection.
Activation Source (Must enable IRQ) Software Activation 1, Software Activation 2, Peripheral Events

Default: Software Activation 1
Activation source selection.
Auto Enable False Auto enable selection.
Callback (Only valid with Software start) NULL Callback selection.
ELC Software Event Interrupt Priority Priority 0 (highest), Priority 1:14, Priority 15 (lowest - not valid if using ThreadX)

Default: Disabled
ELC software event interrupt priority selection.
Note
The example values and defaults are for a project using the Synergy S7G2 MCU Group. Other MCUs may have different default values and available configuration settings.

Configuration Settings for the Timer Driver on r_gpt

ISDE Property Value Description
Parameter Checking BSP, Enabled, Disabled

Default: BSP
Parameter selection.
Name g_timer0 Module name.
Channel 0 Channel selection.
Mode Periodic Mode selection.
Period Value 2822400 *2 Period value selection.
Period Unit Hertz Period unit selection.
Duty Cycle Value 50 Duty cycle value selection.
Duty Cycle Unit Unit Raw Counts, Unit Percent, Unit Percent x 1000

Default: Unit Raw Counts
Duty cycle unit selection.
Auto Start FALSE Auto start selection.
GTIOCA Output Enabled True, False

Default: False
GTIOCA output enabled selection.
GTIOCA Stop Level Pin Level Low, Pin Level High, Pin Level Retained

Default: Pin Level Low
GTIOCA stop level selection.
GTIOCB Output Enabled True, False

Default: False
GTIOCB output enabled selection.
GTIOCB Stop Level Pin Level Low, Pin Level High, Pin Level Retained

Default: Pin Level Low
GTIOCB stop level selection.
Callback NULL Callback selection.
Overflow Interrupt Priority Priority 0 (highest), Priority 1:14, Priority 15 (lowest - not valid if using ThreadX)

Default: Disabled
Interrupt priority selection.
Note
The example values and defaults are for a project using the Synergy S7G2 MCU Group. Other MCUs may have different default values and available configuration settings.

Audio Playback Framework Module Clock Configuration

The Audio Playback Framework hardware modules use the peripheral clocks available in the clock configuration window.

Audio Playback Framework Module Pin Configuration

The DAC or SSI peripheral module uses pins on the MCU to communicate with external devices. I/O pins must be selected and configured as required by the external device. The following tables illustrate the method for selecting the pins within the SSP configuration window, and show an example selection for the associated pins.

Pin Selection Sequence for the Audio Playback Framework Module

Resource ISDE Tab Pin selection Sequence
DAC Pins Select Peripherals > Analog:DAC12 > DAC120/121
SSI Pins Select Peripherals > Connectivity:SSI > SSI/0/1
Note
The selection sequence assumes the DAC0/DAC1 or the SSI0/SSI1 is the desired hardware target of the driver.

Pin Configuration Settings for the DAC Driver on r_dac

Pin Configuration Property Value Description
Operation Mode Enabled, Disabled Operation selection.
DAC None, P014
(Default: P014)
DAC pin selection.
Note
The example values are for a project using the Synergy S7G2 MCU Group and the SK-S7G2 Kit. Other Synergy Kits and other Synergy MCUs may have different available pin configuration settings.

Using the Audio Playback Framework Module in an Application

The typical steps in using the Audio Playback Framework module in an application are:

  1. Initialize an audio stream using the sf_audio_playback_api_t::open API.
  2. Use the callback function to post to a semaphore with an initial count equal to the number of buffers required. This is implemented in the application code. 
  3. Acquire a buffer from the Messaging Framework using sf_message_api_t::bufferAcquire API.
  4. Start the Audio Playback Framework using the sf_audio_playback_api_t::start API.
Note
If multiple streams are desired, repeat steps 1-4 for any additional audio streams.  A separate audio stream should only be used if the streams need to play simultaneously using mixing.  If audio sounds are always played in sequence and never overlap, the stream can be reused.

These common steps are illustrated in a typical operational flow in the following figure:

audio_playback_TA.png
Flow Diagram of a Typical Audio Playback Framework Module Application