speaker 2.0.0.0
Speaker Click Driver

API for configuring and manipulating Speaker Click driver. More...

Topics

 Speaker MikroBUS Map
 MikroBUS pin mapping of Speaker Click driver.
 

Functions

void speaker_cfg_setup (speaker_cfg_t *cfg)
 Speaker configuration object setup function.
 
err_t speaker_init (speaker_t *ctx, speaker_cfg_t *cfg)
 Speaker initialization function.
 
err_t speaker_default_cfg (speaker_t *ctx)
 Speaker default configuration function.
 
err_t speaker_enable_slave_amp (speaker_t *ctx)
 Speaker enables the slave amplifier function.
 
err_t speaker_disable_slave_amp (speaker_t *ctx)
 Speaker disables the slave amplifier function.
 
err_t speaker_shutdown (speaker_t *ctx)
 Speaker shutdown mode function.
 
err_t speaker_normal_operation (speaker_t *ctx)
 Speaker normal operation mode function.
 

Detailed Description

API for configuring and manipulating Speaker 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

◆ speaker_cfg_setup()

void speaker_cfg_setup ( speaker_cfg_t * cfg)

Speaker configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ speaker_default_cfg()

err_t speaker_default_cfg ( speaker_t * ctx)

Speaker default configuration function.

This function executes a default configuration of Speaker click board.

Parameters
[in]ctx: Click context object. See speaker_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.

◆ speaker_disable_slave_amp()

err_t speaker_disable_slave_amp ( speaker_t * ctx)

Speaker disables the slave amplifier function.

This function disables the slave amplifier by sets the SB ( INT ) pin on the high level of the Speaker click board™.

Parameters
[in]ctx: Click context object. See speaker_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ speaker_enable_slave_amp()

err_t speaker_enable_slave_amp ( speaker_t * ctx)

Speaker enables the slave amplifier function.

This function enables the slave amplifier by clears the SB ( INT ) pin on the low level of the Speaker click board™.

Parameters
[in]ctx: Click context object. See speaker_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ speaker_init()

err_t speaker_init ( speaker_t * ctx,
speaker_cfg_t * cfg )

Speaker initialization function.

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

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

◆ speaker_normal_operation()

err_t speaker_normal_operation ( speaker_t * ctx)

Speaker normal operation mode function.

This function enables the shutdown mode by sets the PWR ( PWM ) pin on the high level of the Speaker click board™.

Parameters
[in]ctx: Click context object. See speaker_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ speaker_shutdown()

err_t speaker_shutdown ( speaker_t * ctx)

Speaker shutdown mode function.

This function enables the shutdown mode by clears the PWR ( PWM ) pin on the low level of the Speaker click board™.

Parameters
[in]ctx: Click context object. See speaker_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.