volume2 2.0.0.0
Volume 2 Click Driver

API for configuring and manipulating Volume 2 Click driver. More...

Topics

 Volume 2 Registers List
 List of registers of Volume 2 Click driver.
 
 Volume 2 Registers Settings
 Settings for registers of Volume 2 Click driver.
 
 Volume 2 option List
 List of mute options of Volume 2 Click driver.
 
 Volume 2 MikroBUS Map
 MikroBUS pin mapping of Volume 2 Click driver.
 

Functions

void volume2_cfg_setup (volume2_cfg_t *cfg)
 Volume 2 configuration object setup function.
 
err_t volume2_init (volume2_t *ctx, volume2_cfg_t *cfg)
 Volume 2 initialization function.
 
err_t volume2_default_cfg (volume2_t *ctx)
 Volume 2 default configuration function.
 
err_t volume2_generic_write (volume2_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Volume 2 I2C writing function.
 
err_t volume2_generic_read (volume2_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Volume 2 I2C reading function.
 
err_t volume2_device_mute (volume2_t *ctx, uint8_t mte_state)
 Volume 2 device mute function.
 
err_t volume2_update_vol_data (volume2_t *ctx, volume2_vol_data_t update_data)
 Volume 2 update volume data function.
 

Detailed Description

API for configuring and manipulating Volume 2 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ volume2_cfg_setup()

void volume2_cfg_setup ( volume2_cfg_t * cfg)

Volume 2 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See volume2_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ volume2_default_cfg()

err_t volume2_default_cfg ( volume2_t * ctx)

Volume 2 default configuration function.

This function executes a default configuration of Volume 2 click board.

Parameters
[in]ctx: Click context object. See volume2_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ volume2_device_mute()

err_t volume2_device_mute ( volume2_t * ctx,
uint8_t mte_state )

Volume 2 device mute function.

This function is used to set mute on or off by controlling the mte pin.

Parameters
[in]ctx: Click context object. See volume2_t object definition for detailed explanation.
[in]mte_state: Device mute state.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ volume2_generic_read()

err_t volume2_generic_read ( volume2_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

Volume 2 I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See volume2_t object definition for detailed explanation.
[in]reg: Start register address.
[out]rx_buf: Output read data.
[in]rx_len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ volume2_generic_write()

err_t volume2_generic_write ( volume2_t * ctx,
uint8_t reg,
uint8_t * tx_buf,
uint8_t tx_len )

Volume 2 I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See volume2_t object definition for detailed explanation.
[in]reg: Start register address.
[in]tx_buf: Data to be written.
[in]tx_len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ volume2_init()

err_t volume2_init ( volume2_t * ctx,
volume2_cfg_t * cfg )

Volume 2 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See volume2_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See volume2_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ volume2_update_vol_data()

err_t volume2_update_vol_data ( volume2_t * ctx,
volume2_vol_data_t update_data )

Volume 2 update volume data function.

This function updates the volume by using direct defined structure options. When adjusting the structure data, it is mandatory to call this function so the changes can take place.

Parameters
[in]ctx: Click context object. See volume2_t object definition for detailed explanation.
[in]update_data: Volume data structure.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.