#include "hpm_i2c_drv.h"Go to the source code of this file.
Data Structures | |
| struct | sgtl_context_t |
Typedefs | |
| typedef enum _sgtl5000_module | sgtl_module_t |
| Modules in Sgtl5000 board. More... | |
| typedef enum _sgtl_route | sgtl_route_t |
| Sgtl5000 data route. More... | |
| typedef enum _sgtl_protocol | sgtl_protocol_t |
| The audio data transfer protocol choice. Sgtl5000 only supports I2S format and PCM format. More... | |
| typedef enum _sgtl_sclk_edge | sgtl_sclk_edge_t |
| SGTL SCLK valid edge. More... | |
| typedef struct _sgtl_audio_format | sgtl_audio_format_t |
| Audio format configuration. More... | |
| typedef struct _sgtl_config | sgtl_config_t |
| Initailize structure of sgtl5000. More... | |
Enumerations | |
| enum | { sgtl_headphone_left = 0 , sgtl_headphone_right = 1 , sgtl_lineout_left = 2 , sgtl_lineout_right = 3 } |
| sgtl play channel More... | |
| enum | { sgtl_record_source_linein = 0U , sgtl_record_source_mic = 1U } |
| sgtl record source _sgtl_record_source More... | |
| enum | { sgtl_play_source_linein = 0U , sgtl_play_source_dac = 1U } |
| sgtl play source _stgl_play_source More... | |
Functions | |
| hpm_stat_t | sgtl_init (sgtl_context_t *context, sgtl_config_t *config) |
| sgtl5000 initialize function. More... | |
| hpm_stat_t | sgtl_set_data_route (sgtl_context_t *context, sgtl_route_t route) |
| Set audio data route in sgtl5000. More... | |
| hpm_stat_t | sgtl_set_protocol (sgtl_context_t *context, sgtl_protocol_t protocol) |
| Set the audio transfer protocol. More... | |
| void | sgtl_set_master_mode (sgtl_context_t *context, bool master) |
| Set sgtl5000 as master or slave. More... | |
| hpm_stat_t | sgtl_set_volume (sgtl_context_t *context, sgtl_module_t module, uint32_t volume) |
| Set the volume of different modules in sgtl5000. More... | |
| uint32_t | sgtl_get_volume (sgtl_context_t *context, sgtl_module_t module) |
| Get the volume of different modules in sgtl5000. More... | |
| hpm_stat_t | sgtl_set_mute (sgtl_context_t *context, sgtl_module_t module, bool mute) |
| Mute/unmute modules in sgtl5000. More... | |
| hpm_stat_t | sgtl_enable_module (sgtl_context_t *context, sgtl_module_t module) |
| Enable expected devices. More... | |
| hpm_stat_t | sgtl_disable_module (sgtl_context_t *context, sgtl_module_t module) |
| Disable expected devices. More... | |
| hpm_stat_t | sgtl_deint (sgtl_context_t *context) |
| Deinit the sgtl5000 codec. Shut down Sgtl5000 modules. More... | |
| hpm_stat_t | sgtl_config_data_format (sgtl_context_t *context, uint32_t mclk, uint32_t sample_rate, uint32_t bits) |
| Configure the data format of audio data. More... | |
| hpm_stat_t | sgtl_set_play (sgtl_context_t *context, uint32_t playSource) |
| select SGTL codec play source. More... | |
| hpm_stat_t | sgtl_set_record (sgtl_context_t *context, uint32_t recordSource) |
| select SGTL codec record source. More... | |
| hpm_stat_t | sgtl_write_reg (sgtl_context_t *context, uint16_t reg, uint16_t val) |
| Write register to sgtl using I2C. More... | |
| hpm_stat_t | sgtl_read_reg (sgtl_context_t *context, uint16_t reg, uint16_t *val) |
| Read register from sgtl using I2C. More... | |
| hpm_stat_t | sgtl_modify_reg (sgtl_context_t *context, uint16_t reg, uint16_t clr_mask, uint16_t val) |
| Modify some bits in the register using I2C. More... | |