![]() |
MT2523 API Reference
LinkIt SDK v4
|
This section introduces the Audio APIs including terms and acronyms, supported features, software architecture, details on how to use this driver, Audio function groups, enums, structures and functions. More...
This section introduces the Audio APIs including terms and acronyms, supported features, software architecture, details on how to use this driver, Audio function groups, enums, structures and functions.
The APIs are grouped based on their functionality for more convenient usage. For more information about each function, please click on the function name.
Functions | |
| hal_audio_status_t | hal_audio_init (void) |
| Initializes basic settings of the audio hardware. More... | |
| hal_audio_status_t | hal_audio_deinit (void) |
| Deinitialize audio settings. More... | |
| hal_audio_status_t | hal_audio_register_copied_stream_out_callback (hal_audio_stream_copy_callback_t callback, void *user_data) |
| Register the callback function to copy stream out data. More... | |
| hal_audio_status_t | hal_audio_set_stream_out_sampling_rate (hal_audio_sampling_rate_t sample_rate) |
| Set the sampling rate of the audio output stream. More... | |
| hal_audio_status_t | hal_audio_set_stream_out_channel_number (hal_audio_channel_number_t channel_number) |
| Set the audio output channel number. More... | |
| hal_audio_status_t | hal_audio_start_stream_out (hal_audio_active_type_t active_type) |
| Power on the audio out. More... | |
| void | hal_audio_stop_stream_out (void) |
| Power off the stream out path. More... | |
| hal_audio_status_t | hal_audio_set_stream_out_volume (uint32_t digital_volume_index, uint32_t analog_volume_index) |
| Set audio output the volume. More... | |
| void | hal_audio_mute_stream_out (bool mute) |
| Mute the audio output stream. More... | |
| hal_audio_status_t | hal_audio_set_stream_out_device (hal_audio_device_t device) |
| Set the audio output device. More... | |
| hal_audio_status_t | hal_audio_write_stream_out (const void *buffer, uint32_t size) |
| Write data to audio output. More... | |
| hal_audio_status_t | hal_audio_get_stream_out_sample_count (uint32_t *sample_count) |
| Query available free space for the output. More... | |
| hal_audio_status_t | hal_audio_register_stream_out_callback (hal_audio_stream_out_callback_t callback, void *user_data) |
| Register the callback function for output data. More... | |
| hal_audio_status_t | hal_audio_set_stream_in_sampling_rate (hal_audio_sampling_rate_t sample_rate) |
| Set audio input stream sampling rate. More... | |
| hal_audio_status_t | hal_audio_set_stream_in_channel_number (hal_audio_channel_number_t channel_number) |
| Set audio input channel number. More... | |
| hal_audio_status_t | hal_audio_start_stream_in (hal_audio_active_type_t active_type) |
| Power on the audio in. More... | |
| void | hal_audio_stop_stream_in (void) |
| Power off the stream in path. More... | |
| hal_audio_status_t | hal_audio_set_stream_in_volume (uint32_t digital_volume_index, uint32_t analog_volume_index) |
| Set audio input volume. More... | |
| void | hal_audio_mute_stream_in (bool mute) |
| Mute the audio input stream. More... | |
| hal_audio_status_t | hal_audio_set_stream_in_device (hal_audio_device_t device) |
| Set audio input device. More... | |
| hal_audio_status_t | hal_audio_read_stream_in (void *buffer, uint32_t sample_count) |
| Recieve data from the audio input. More... | |
| hal_audio_status_t | hal_audio_get_stream_in_sample_count (uint32_t *sample_count) |
| Query the available input data sample count. More... | |
| hal_audio_status_t | hal_audio_register_stream_in_callback (hal_audio_stream_in_callback_t callback, void *user_data) |
| Register the callback function for input data. More... | |
| hal_audio_status_t | hal_audio_get_memory_size (uint32_t *memory_size) |
| Query the size of needed memory to be allocated for internal use in audio driver. More... | |
| hal_audio_status_t | hal_audio_set_memory (void *memory) |
| Hand over allocated memory to audio driver. More... | |
| hal_audio_status_t | hal_audio_get_audio_clock (uint32_t *sample_count) |
| Get audio clock. More... | |
Modules | |
| Enum | |
| Struct | |
| Typedef | |
| hal_audio_status_t hal_audio_deinit | ( | void | ) |
| hal_audio_status_t hal_audio_get_audio_clock | ( | uint32_t * | sample_count | ) |
Get audio clock.
| [out] | sample_count | is a pointer to the accumulated audio sample count. |
| hal_audio_status_t hal_audio_get_memory_size | ( | uint32_t * | memory_size | ) |
Query the size of needed memory to be allocated for internal use in audio driver.
| [out] | memory_size | is the amount of memory required by the audio driver for an internal use (in bytes). |
| hal_audio_status_t hal_audio_get_stream_in_sample_count | ( | uint32_t * | sample_count | ) |
Query the available input data sample count.
| [out] | sample_count | the available amount of received data (in bytes). |
| hal_audio_status_t hal_audio_get_stream_out_sample_count | ( | uint32_t * | sample_count | ) |
Query available free space for the output.
| [out] | sample_count | is the available output sample count (in bytes). |
| hal_audio_status_t hal_audio_init | ( | void | ) |
Initializes basic settings of the audio hardware.
| void hal_audio_mute_stream_in | ( | bool | mute | ) |
| void hal_audio_mute_stream_out | ( | bool | mute | ) |
| hal_audio_status_t hal_audio_read_stream_in | ( | void * | buffer, |
| uint32_t | sample_count | ||
| ) |
Recieve data from the audio input.
| [in] | buffer | is a pointer to a user defined buffer. |
| [in] | sample_count | is the amount of data received (in bytes). |
| hal_audio_status_t hal_audio_register_copied_stream_out_callback | ( | hal_audio_stream_copy_callback_t | callback, |
| void * | user_data | ||
| ) |
Register the callback function to copy stream out data.
| [in] | callback | is the function pointer of callback for output data control |
| [in] | user_data | is a user defined extended parameter. |
| hal_audio_status_t hal_audio_register_stream_in_callback | ( | hal_audio_stream_in_callback_t | callback, |
| void * | user_data | ||
| ) |
Register the callback function for input data.
| [in] | callback | is the function pointer of callback for input data control. |
| [in] | user_data | is extended parameter for user. |
| hal_audio_status_t hal_audio_register_stream_out_callback | ( | hal_audio_stream_out_callback_t | callback, |
| void * | user_data | ||
| ) |
Register the callback function for output data.
| [in] | callback | is the function pointer of callback for output data control |
| [in] | user_data | is a user defined extended parameter. |
| hal_audio_status_t hal_audio_set_memory | ( | void * | memory | ) |
Hand over allocated memory to audio driver.
| [in] | memory | is a pointer to an allocated memory. It should be 4 bytes aligned. |
| hal_audio_status_t hal_audio_set_stream_in_channel_number | ( | hal_audio_channel_number_t | channel_number | ) |
Set audio input channel number.
| [in] | channel_number | is to set input channel number. For more details, please refer to hal_audio_channel_number_t. |
| hal_audio_status_t hal_audio_set_stream_in_device | ( | hal_audio_device_t | device | ) |
Set audio input device.
| [in] | device | is the input component. For more details, please refer to hal_audio_device_t. |
| hal_audio_status_t hal_audio_set_stream_in_sampling_rate | ( | hal_audio_sampling_rate_t | sample_rate | ) |
Set audio input stream sampling rate.
| [in] | sample_rate | is to set input sampling rate. Please refers to hal_audio_sampling_rate_t. |
| hal_audio_status_t hal_audio_set_stream_in_volume | ( | uint32_t | digital_volume_index, |
| uint32_t | analog_volume_index | ||
| ) |
Set audio input volume.
| [in] | digital_volume_index | is to set a digital gain in centi-db in hex (FFFFFE0C equal to -5db). Gain range: depend on the gain map. |
| [in] | analog_volume_index | is to set digital gain in centi-db in hex (FFFFFE0C equal to -5db). Gain range: depends on the hardware design and gain map. |
| hal_audio_status_t hal_audio_set_stream_out_channel_number | ( | hal_audio_channel_number_t | channel_number | ) |
Set the audio output channel number.
| [in] | channel_number | is to set the output channel number. For more details, please refer to hal_audio_channel_number_t. |
| hal_audio_status_t hal_audio_set_stream_out_device | ( | hal_audio_device_t | device | ) |
Set the audio output device.
| [in] | device | is the ouput component. For more details, please refer to hal_audio_device_t. |
| hal_audio_status_t hal_audio_set_stream_out_sampling_rate | ( | hal_audio_sampling_rate_t | sample_rate | ) |
Set the sampling rate of the audio output stream.
| [in] | sample_rate | is to set the output sampling rate. For more details, please refer to hal_audio_sampling_rate_t. |
| hal_audio_status_t hal_audio_set_stream_out_volume | ( | uint32_t | digital_volume_index, |
| uint32_t | analog_volume_index | ||
| ) |
Set audio output the volume.
| [in] | digital_volume_index | is to set digital gain in centi-db in hex (FFFFFE0C equal to -5db). Gain range: depends on the gain map. |
| [in] | analog_volume_index | is to set digital gain in centi-db in hex (FFFFFE0C equal to -5db). Gain range: depends on the hardware design and gain map. |
| hal_audio_status_t hal_audio_start_stream_in | ( | hal_audio_active_type_t | active_type | ) |
Power on the audio in.
| [in] | active_type | is to set input function type. For more details, please refer to hal_audio_active_type_t. |
| hal_audio_status_t hal_audio_start_stream_out | ( | hal_audio_active_type_t | active_type | ) |
Power on the audio out.
| [in] | active_type | is to set the audio output function type. For more details, please refer to hal_audio_active_type_t. |
| void hal_audio_stop_stream_in | ( | void | ) |
| void hal_audio_stop_stream_out | ( | void | ) |
Power off the stream out path.
| hal_audio_status_t hal_audio_write_stream_out | ( | const void * | buffer, |
| uint32_t | size | ||
| ) |
Write data to audio output.
| [in] | buffer | is the pointer to output data. |
| [in] | size | is the available free space of the output buffer (in bytes). |