vumeter 2.0.0.0
VU Meter Click Driver

API for configuring and manipulating VU Meter Click driver. More...

Topics

 VU Meter Settings
 Settings of VU Meter Click driver.
 
 VU Meter MikroBUS Map
 MikroBUS pin mapping of VU Meter Click driver.
 

Functions

void vumeter_cfg_setup (vumeter_cfg_t *cfg)
 VU Meter configuration object setup function.
 
err_t vumeter_init (vumeter_t *ctx, vumeter_cfg_t *cfg)
 VU Meter initialization function.
 
err_t vumeter_read_an_pin_value (vumeter_t *ctx, uint16_t *data_out)
 VU Meter read AN pin value function.
 
err_t vumeter_read_an_pin_voltage (vumeter_t *ctx, float *data_out)
 VU Meter read AN pin voltage level function.
 
err_t vumeter_set_gain_level (vumeter_t *ctx, uint8_t gain_lvl)
 VU Meter set gain level function.
 
float vumeter_calculate_vu_level (vumeter_t *ctx, uint16_t sample_rate_ms)
 VU Meter calculate VU level function.
 

Detailed Description

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

◆ vumeter_calculate_vu_level()

float vumeter_calculate_vu_level ( vumeter_t * ctx,
uint16_t sample_rate_ms )

VU Meter calculate VU level function.

This function calculates VU level from the analog voltage input.

Parameters
[in]ctx: Click context object. See vumeter_t object definition for detailed explanation.
[in]sample_rate_ms: Time in miliseconds for ADC samples ( ADC samples 10 times per milisecond ).
Returns
VU level value [-20.0,+3.0].

See #err_t definition for detailed explanation.

Note
None.

◆ vumeter_cfg_setup()

void vumeter_cfg_setup ( vumeter_cfg_t * cfg)

VU Meter configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ vumeter_init()

err_t vumeter_init ( vumeter_t * ctx,
vumeter_cfg_t * cfg )

VU Meter initialization function.

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

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

◆ vumeter_read_an_pin_value()

err_t vumeter_read_an_pin_value ( vumeter_t * ctx,
uint16_t * data_out )

VU Meter read AN pin value function.

This function reads results of AD conversion of the AN pin.

Parameters
[in]ctx: Click context object. See vumeter_t object definition for detailed explanation.
[out]data_out: Output ADC result.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ vumeter_read_an_pin_voltage()

err_t vumeter_read_an_pin_voltage ( vumeter_t * ctx,
float * data_out )

VU Meter read AN pin voltage level function.

This function reads results of AD conversion of the AN pin and converts them to proportional voltage level.

Parameters
[in]ctx: Click context object. See vumeter_t object definition for detailed explanation.
[out]data_out: Output voltage level of the analog pin [V].
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
The conversion to voltage depends on the entered configuration of the ADC (resolution, reference voltage).

◆ vumeter_set_gain_level()

err_t vumeter_set_gain_level ( vumeter_t * ctx,
uint8_t gain_lvl )

VU Meter set gain level function.

This function sets the input signal gain level (the microphone sensitivity).

Parameters
[in]ctx: Click context object. See vumeter_t object definition for detailed explanation.
[in]gain_lvl: Gain level [0x00-0xFF].
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.