version 2.8
Driver Playback

Detailed Description

Playback driver interface for the GAUDIO module.

Functions

GDataBuffergaudioPlayGetDataBlockI (void)
 Get a block of audio data to play. More...
 
void gaudioPlayReleaseDataBlockI (GDataBuffer *paud)
 Release a block of audio data to the free list. More...
 
void gaudioPlayDoneI (void)
 Signal that all playing has now stopped. More...
 
bool_t gaudio_play_lld_init (uint16_t channel, uint32_t frequency, ArrayDataFormat format)
 Initialise the play driver. More...
 
void gaudio_play_lld_start (void)
 Start the audio output playing. More...
 
void gaudio_play_lld_stop (void)
 Stop the audio output playing. More...
 
bool_t gaudio_play_lld_set_volume (uint8_t vol)
 Set the output volume. More...
 

Function Documentation

bool_t gaudio_play_lld_init ( uint16_t  channel,
uint32_t  frequency,
ArrayDataFormat  format 
)

Initialise the play driver.

Returns
TRUE if the channel, frequency and format are valid.
Parameters
[in]channelThe channel to use (see the driver for the available channels provided)
[in]frequencyThe sample frequency to use
[in]formatThe sample format
Note
The driver will always have been stopped and de-init before this is called.
Function Class:
Normal API, this function can be invoked by regular system threads.
bool_t gaudio_play_lld_set_volume ( uint8_t  vol)

Set the output volume.

Returns
TRUE if successful.
Parameters
[in]vol0->255 (0 = muted)
Note
Some drivers may not support this. They will return FALSE.
For stereo devices, both channels are set to the same volume.
Function Class:
Normal API, this function can be invoked by regular system threads.
void gaudio_play_lld_start ( void  )

Start the audio output playing.

Note
This may be called at any stage including while the driver is already playing. The driver should check for data blocks to play using gaudioPlayGetDataBlockI().
Function Class:
Normal API, this function can be invoked by regular system threads.
void gaudio_play_lld_stop ( void  )

Stop the audio output playing.

Note
Some drivers may only stop playing at a data block boundary.
It is possible but unlikely for it to be called when playing has already stopped.
It should not return until all active buffers (currently in use by the driver) have been returned to the free-list and gaudioPlayDoneI() has been called.
Function Class:
Normal API, this function can be invoked by regular system threads.
void gaudioPlayDoneI ( void  )

Signal that all playing has now stopped.

Note
Defined in the high level GAUDIO code for use by the GAUDIO play drivers.
Function Class:
This is an I-Class API, this function can be invoked from within a system lock zone by both threads and interrupt handlers.
Function Class:
Not an API, this function is for internal use only.
GDataBuffer* gaudioPlayGetDataBlockI ( void  )

Get a block of audio data to play.

Returns
A pointer to the GAaudioData structure or NULL if none is currently available
Note
Defined in the high level GAUDIO code for use by the GAUDIO play drivers.
Function Class:
This is an I-Class API, this function can be invoked from within a system lock zone by both threads and interrupt handlers.
Function Class:
Not an API, this function is for internal use only.
void gaudioPlayReleaseDataBlockI ( GDataBuffer paud)

Release a block of audio data to the free list.

Parameters
[in]paudThe GDataBuffer block to be released.
Note
Defined in the high level GAUDIO code for use by the GAUDIO play drivers.
Function Class:
This is an I-Class API, this function can be invoked from within a system lock zone by both threads and interrupt handlers.
Function Class:
Not an API, this function is for internal use only.