mic2 2.0.0.0
Public function

Functions

void mic2_cfg_setup (mic2_cfg_t *cfg)
 Config Object Initialization function.
 
err_t mic2_init (mic2_t *ctx, mic2_cfg_t *cfg)
 Initialization function.
 
void mic2_generic_write (mic2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Click Default Configuration function.
 
void mic2_set_potentiometer (mic2_t *ctx, uint8_t ptt_value)
 Set potentiometer value.
 
err_t mic2_read_an_pin_value (mic2_t *ctx, uint16_t *data_out)
 MIC 2 read AN pin value function.
 
err_t mic2_read_an_pin_voltage (mic2_t *ctx, float *data_out)
 MIC 2 read AN pin voltage level function.
 

Detailed Description

Function Documentation

◆ mic2_cfg_setup()

void mic2_cfg_setup ( mic2_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ mic2_generic_write()

void mic2_generic_write ( mic2_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Click Default Configuration function.

Parameters
ctxClick object.

This function executes default configuration for MIC 2 click.

◆ mic2_init()

err_t mic2_init ( mic2_t * ctx,
mic2_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ mic2_read_an_pin_value()

err_t mic2_read_an_pin_value ( mic2_t * ctx,
uint16_t * data_out )

MIC 2 read AN pin value function.

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

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

◆ mic2_read_an_pin_voltage()

err_t mic2_read_an_pin_voltage ( mic2_t * ctx,
float * data_out )

MIC 2 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 mic2_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).

◆ mic2_set_potentiometer()

void mic2_set_potentiometer ( mic2_t * ctx,
uint8_t ptt_value )

Set potentiometer value.

Parameters
ctxClick object.

This function set the value of digital potentiometer.