Infineon Logo AIROC BTSDK v4.9 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
platform_audio_device.h File Reference

AIROC audio interface header. More...

Data Structures

struct  platform_audio_config_t
 AIROC audio configuration. More...
 
union  platform_audio_device_ioctl_data_t
 

Typedefs

typedef uint16_t platform_audio_device_id_t
 

Enumerations

enum  platform_codec_device_id_t {
  PLATFORM_DEVICE_PLAY, PLATFORM_DEVICE_PLAY_RECORD, PLATFORM_DEVICE_CAPTURE, PLATFORM_DEVICE_MAX,
  PLATFORM_DEVICE_INVALID = PLATFORM_DEVICE_MAX
}
 
enum  platform_audio_io_device_t {
  SPEAKERS, HEADPHONES, LINEOUT, ANALOGMIC,
  DIGIMIC, LINEIN, AUDIO_IO_MAX
}
 AIROC audio output type.
 
enum  platform_audio_device_ioctl_t { PLATFORM_AUDIO_IOCTL_SETPARAM = 0, PLATFORM_AUDIO_IOCTL_GETPARAM, PLATFORM_AUDIO_IOCTL_MAX }
 AIROC audio device ioctl interface.
 

Functions

wiced_result_t platform_audio_device_init (const platform_audio_device_id_t device_id)
 Initialize an audio device. More...
 
wiced_result_t platform_audio_device_configure (const platform_audio_device_id_t device_id, platform_audio_config_t *config)
 Configure the audio device for a specific audio configuration. More...
 
wiced_result_t platform_audio_device_set_output_device (const platform_audio_device_id_t device_id, platform_audio_io_device_t sink)
 Set the output device for the audio device stream. More...
 
wiced_result_t platform_audio_device_set_sr (const platform_audio_device_id_t device_id, int32_t sr)
 Set the sample rate for the audio device stream. More...
 
wiced_result_t platform_audio_device_set_volume (const platform_audio_device_id_t device_id, int32_t volume_in_db)
 Set the volume for the audio device stream. More...
 
wiced_result_t platform_audio_device_set_mic_gain (const platform_audio_device_id_t device_id, int32_t volume_in_db)
 Set the mic gain for the audio device stream. More...
 
wiced_result_t platform_audio_device_get_volume (const platform_audio_device_id_t device_id, int32_t *volume_in_db)
 Get the volume set for the audio device stream driver. More...
 
wiced_result_t platform_audio_device_get_volume_range (const platform_audio_device_id_t device_id, int32_t *min_volume_in_db, int32_t *max_volume_in_db)
 Get the volume range for the audio device stream. More...
 
wiced_result_t platform_audio_device_deinit (const platform_audio_device_id_t device_id)
 De-initialize the audio device stream. More...
 
wiced_result_t platform_audio_device_start (const platform_audio_device_id_t device_id)
 Start the audio device stream. More...
 
wiced_result_t platform_audio_device_stop (const platform_audio_device_id_t device_id)
 Stop the audio device stream. More...
 
wiced_result_t platform_audio_device_ioctl (const platform_audio_device_id_t device_id, platform_audio_device_ioctl_t cmd, platform_audio_device_ioctl_data_t *cmd_data)
 Send an ioctl to the audio chip driver. More...
 

Detailed Description

AIROC audio interface header.

Function Documentation

wiced_result_t platform_audio_device_configure ( const platform_audio_device_id_t  device_id,
platform_audio_config_t config 
)

Configure the audio device for a specific audio configuration.

Parameters
[in]device_id: The id of the audio device.(defined in platform_audio_device.h)
in/out]config : Pointer to the audio configuration to use. in case result is NOT equal to WICED_SUCCESS, valid supported configuration will be updated in the config argument
Returns
wiced_result_t ,
wiced_result_t platform_audio_device_deinit ( const platform_audio_device_id_t  device_id)

De-initialize the audio device stream.

Parameters
[in]device_id: The id of the audio device.(defined in platform_audio_device.h)
Returns
wiced_result_t
wiced_result_t platform_audio_device_get_volume ( const platform_audio_device_id_t  device_id,
int32_t *  volume_in_db 
)

Get the volume set for the audio device stream driver.

Parameters
[in]device_id: The id of the audio device.(defined in platform_audio_device.h)
[out]volume: Set volume.
Returns
wiced_result_t
wiced_result_t platform_audio_device_get_volume_range ( const platform_audio_device_id_t  device_id,
int32_t *  min_volume_in_db,
int32_t *  max_volume_in_db 
)

Get the volume range for the audio device stream.

Note
The audio volume range is dependent on the audio device being used.
Parameters
[in]device_id: The id of the audio device.(defined in platform_audio_device.h)
[out]min_volume_in_db: Returned minimum volume for the audio device.
[out]max_volume_in_db: Returned maximum volume for the audio device.
Returns
wiced_result_t
wiced_result_t platform_audio_device_init ( const platform_audio_device_id_t  device_id)

Initialize an audio device.

Parameters
[in]device_id: The id of the audio device.(defined in platform_audio_device.h)
Returns
A pointer to the audio stream created.
wiced_result_t platform_audio_device_ioctl ( const platform_audio_device_id_t  device_id,
platform_audio_device_ioctl_t  cmd,
platform_audio_device_ioctl_data_t cmd_data 
)

Send an ioctl to the audio chip driver.

Note
Values passed with cmd_data are dependent upon the driver for the audio device being used.
Parameters
[in]device_id: The id of the audio device.(defined in platform_audio_device.h)
[in]cmd: The IOCTL command sent directly to the audio device driver wiced_audio_device_ioctl_t
[in]cmd: Data associated with the IOCTL command wiced_audio_device_ioctl_data_t
Returns
wiced_result_t
wiced_result_t platform_audio_device_set_mic_gain ( const platform_audio_device_id_t  device_id,
int32_t  volume_in_db 
)

Set the mic gain for the audio device stream.

Parameters
[in]device_id: The id of the audio device.(defined in platform_audio_device.h)
[in]volume: volume to set in db.
Returns
wiced_result_t
wiced_result_t platform_audio_device_set_output_device ( const platform_audio_device_id_t  device_id,
platform_audio_io_device_t  sink 
)

Set the output device for the audio device stream.

Parameters
[in]device_id: The id of the audio device.(defined in platform_audio_device.h)
[in]sink: output device.
Returns
wiced_result_t
wiced_result_t platform_audio_device_set_sr ( const platform_audio_device_id_t  device_id,
int32_t  sr 
)

Set the sample rate for the audio device stream.

Parameters
[in]device_id: The id of the audio device.(defined in platform_audio_device.h)
[in]sr: sample rate.
Returns
wiced_result_t
wiced_result_t platform_audio_device_set_volume ( const platform_audio_device_id_t  device_id,
int32_t  volume_in_db 
)

Set the volume for the audio device stream.

Parameters
[in]device_id: The id of the audio device.(defined in platform_audio_device.h)
[in]volume: volume to set in db.
Returns
wiced_result_t
wiced_result_t platform_audio_device_start ( const platform_audio_device_id_t  device_id)

Start the audio device stream.

Parameters
[in]device_id: The id of the audio device.(defined in platform_audio_device.h)
Returns
wiced_result_t
wiced_result_t platform_audio_device_stop ( const platform_audio_device_id_t  device_id)

Stop the audio device stream.

Note
After an underrun event, the audio driver must be stopped and started again.
Parameters
[in]device_id: The id of the audio device.(defined in platform_audio_device.h)
Returns
wiced_result_t