volume 2.0.0.0
|
API for configuring and manipulating Volume Click driver. More...
Topics | |
Volume MikroBUS Map | |
MikroBUS pin mapping of Volume Click driver. | |
Zce_state | |
Mute_state | |
Functions | |
void | volume_cfg_setup (volume_cfg_t *cfg) |
Volume configuration object setup function. | |
err_t | volume_init (volume_t *ctx, volume_cfg_t *cfg) |
Volume initialization function. | |
void | volume_default_cfg (volume_t *ctx) |
Volume default configuration function. | |
void | volume_power_up (volume_t *ctx) |
Power Up function. | |
void | volume_hw_mute (volume_t *ctx, uint8_t mute_state) |
Hardware MUTE function. | |
void | volume_zero_crossing (volume_t *ctx, uint8_t zce_state) |
Zero Crossing option function. | |
err_t | volume_set_vol_gain (volume_t *ctx, float volume_left_dB, float volume_right_dB) |
Set volume gain function. | |
API for configuring and manipulating Volume Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void volume_cfg_setup | ( | volume_cfg_t * | cfg | ) |
Volume configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See volume_cfg_t object definition for detailed explanation. |
void volume_default_cfg | ( | volume_t * | ctx | ) |
Volume default configuration function.
This function executes a default configuration of Volume click board.
[in] | ctx | : Click context object. See volume_t object definition for detailed explanation. |
void volume_hw_mute | ( | volume_t * | ctx, |
uint8_t | mute_state ) |
Hardware MUTE function.
This function performs hardware mute by setting the state of SEN pin.
ctx | Click object. | |
[in] | mute_state | :
|
err_t volume_init | ( | volume_t * | ctx, |
volume_cfg_t * | cfg ) |
Volume initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See volume_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See volume_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.void volume_power_up | ( | volume_t * | ctx | ) |
Power Up function.
This function should be called upon initial power-up sequence. This sequence sets the serial shift register and the volume control register to zero and performs an offset calibration.
ctx | Click object. |
err_t volume_set_vol_gain | ( | volume_t * | ctx, |
float | volume_left_dB, | ||
float | volume_right_dB ) |
Set volume gain function.
This function sets a desired gain volume of left and right channel speaker.
[in] | ctx | : Click context object. |
[in] | volume_left | : Gain in [dB] on the left channel ranging from -96.0 to +31.5. |
[in] | volume_right | : Gain in [dB] on the right channel ranging from -96.0 to +31.5. |
0
- Success, -1
- Error.void volume_zero_crossing | ( | volume_t * | ctx, |
uint8_t | zce_state ) |
Zero Crossing option function.
This function enables the zero crossing option by setting the state of ZCE pin.
ctx | Click object. | |
[in] | zce_state | :
|