audiodac 2.1.0.0
|
API for configuring and manipulating Audio DAC Click driver. More...
Topics | |
Audio DAC Registers List | |
List of registers of Audio DAC Click driver. | |
Audio DAC Registers Settings | |
Settings for registers of Audio DAC Click driver. | |
Audio DAC MikroBUS Map | |
MikroBUS pin mapping of Audio DAC Click driver. | |
Functions | |
void | audiodac_cfg_setup (audiodac_cfg_t *cfg) |
Audio DAC configuration object setup function. | |
err_t | audiodac_init (audiodac_t *ctx, audiodac_cfg_t *cfg) |
Audio DAC initialization function. | |
err_t | audiodac_default_cfg (audiodac_t *ctx) |
Audio DAC default configuration function. | |
err_t | audiodac_generic_write (audiodac_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Audio DAC I2C writing function. | |
err_t | audiodac_generic_read (audiodac_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Audio DAC I2C reading function. | |
err_t | audiodac_write_register (audiodac_t *ctx, uint8_t reg, uint8_t data_in) |
Audio DAC write register function. | |
err_t | audiodac_read_register (audiodac_t *ctx, uint8_t reg, uint8_t *data_out) |
Audio DAC read register function. | |
void | audiodac_mute_output (audiodac_t *ctx) |
Audio DAC mute output function. | |
void | audiodac_unmute_output (audiodac_t *ctx) |
Audio DAC unmute output function. | |
uint8_t | audiodac_get_gpio4_pin (audiodac_t *ctx) |
Audio DAC get gpio4 pin function. | |
err_t | audiodac_select_page (audiodac_t *ctx, uint8_t page_num) |
Audio DAC select page function. | |
err_t | audiodac_volume_control (audiodac_t *ctx, uint8_t channel, uint8_t volume) |
Audio DAC volume control function. | |
API for configuring and manipulating Audio DAC Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void audiodac_cfg_setup | ( | audiodac_cfg_t * | cfg | ) |
Audio DAC configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See audiodac_cfg_t object definition for detailed explanation. |
err_t audiodac_default_cfg | ( | audiodac_t * | ctx | ) |
Audio DAC default configuration function.
This function executes a default configuration of Audio DAC click board.
[in] | ctx | : Click context object. See audiodac_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t audiodac_generic_read | ( | audiodac_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Audio DAC I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See audiodac_t object definition for detailed explanation. |
[in] | reg | : Start register address, for address auto increment OR it with AUDIODAC_AUTO_INCREMENT_ENABLE. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t audiodac_generic_write | ( | audiodac_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Audio DAC I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See audiodac_t object definition for detailed explanation. |
[in] | reg | : Start register address, for address auto increment OR it with AUDIODAC_AUTO_INCREMENT_ENABLE. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t audiodac_get_gpio4_pin | ( | audiodac_t * | ctx | ) |
Audio DAC get gpio4 pin function.
This function returns the GPIO4 pin logic state. The GPIO4 pin is mapped to auto mute flag output for both L and R channels by default.
[in] | ctx | : Click context object. See audiodac_t object definition for detailed explanation. |
err_t audiodac_init | ( | audiodac_t * | ctx, |
audiodac_cfg_t * | cfg ) |
Audio DAC initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See audiodac_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See audiodac_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void audiodac_mute_output | ( | audiodac_t * | ctx | ) |
Audio DAC mute output function.
This function performs soft mute output by setting the XSMT pin to low logic state.
[in] | ctx | : Click context object. See audiodac_t object definition for detailed explanation. |
err_t audiodac_read_register | ( | audiodac_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
Audio DAC read register function.
This function reads data byte from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See audiodac_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t audiodac_select_page | ( | audiodac_t * | ctx, |
uint8_t | page_num ) |
Audio DAC select page function.
This function selects the register page.
[in] | ctx | : Click context object. See audiodac_t object definition for detailed explanation. |
[in] | page_num | : Register page number. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void audiodac_unmute_output | ( | audiodac_t * | ctx | ) |
Audio DAC unmute output function.
This function performs soft un-mute output by setting the XSMT pin to high logic state.
[in] | ctx | : Click context object. See audiodac_t object definition for detailed explanation. |
err_t audiodac_volume_control | ( | audiodac_t * | ctx, |
uint8_t | channel, | ||
uint8_t | volume ) |
Audio DAC volume control function.
This function sets the volume level for the selected output channel.
[in] | ctx | : Click context object. See audiodac_t object definition for detailed explanation. |
[in] | channel | :
|
[in] | volume | : Volume level [0-100], 0 - MUTE, 100 - MAX volume. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t audiodac_write_register | ( | audiodac_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
Audio DAC write register function.
This function writes a data byte to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See audiodac_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.