analogmux5 2.0.0.0
Analog MUX 5 Click Driver

API for configuring and manipulating Analog MUX 5 Click driver. More...

Topics

 Analog MUX 5 MikroBUS Map
 MikroBUS pin mapping of Analog MUX 5 Click driver.
 
 Ch_select
 

Functions

void analogmux5_cfg_setup (analogmux5_cfg_t *cfg)
 Analog MUX 5 configuration object setup function.
 
err_t analogmux5_init (analogmux5_t *ctx, analogmux5_cfg_t *cfg)
 Analog MUX 5 initialization function.
 
err_t analogmux5_default_cfg (analogmux5_t *ctx)
 Analog MUX 5 default configuration function.
 
err_t analogmux5_read_an_pin_value (analogmux5_t *ctx, uint16_t *data_out)
 Analog MUX 5 read AN pin value function.
 
err_t analogmux5_read_an_pin_voltage (analogmux5_t *ctx, float *data_out)
 Analog MUX 5 read AN pin voltage level function.
 
void analogmux5_enable (analogmux5_t *ctx)
 Analog MUX 5 enable function.
 
void analogmux5_disable (analogmux5_t *ctx)
 Analog MUX 5 disable function.
 
err_t analogmux5_select_ch (analogmux5_t *ctx, uint8_t ch_select)
 Analog MUX 5 set channel function.
 

Detailed Description

API for configuring and manipulating Analog MUX 5 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

◆ analogmux5_cfg_setup()

void analogmux5_cfg_setup ( analogmux5_cfg_t * cfg)

Analog MUX 5 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ analogmux5_default_cfg()

err_t analogmux5_default_cfg ( analogmux5_t * ctx)

Analog MUX 5 default configuration function.

This function executes a default configuration of Analog MUX 5 click board.

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

◆ analogmux5_disable()

void analogmux5_disable ( analogmux5_t * ctx)

Analog MUX 5 disable function.

This function disable all switch channels.

Parameters
[in]ctx: Click context object. See analogmux5_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ analogmux5_enable()

void analogmux5_enable ( analogmux5_t * ctx)

Analog MUX 5 enable function.

This function enable all switch channels.

Parameters
[in]ctx: Click context object. See analogmux5_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ analogmux5_init()

err_t analogmux5_init ( analogmux5_t * ctx,
analogmux5_cfg_t * cfg )

Analog MUX 5 initialization function.

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

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

◆ analogmux5_read_an_pin_value()

err_t analogmux5_read_an_pin_value ( analogmux5_t * ctx,
uint16_t * data_out )

Analog MUX 5 read AN pin value function.

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

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

◆ analogmux5_read_an_pin_voltage()

err_t analogmux5_read_an_pin_voltage ( analogmux5_t * ctx,
float * data_out )

Analog MUX 5 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 analogmux5_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).

◆ analogmux5_select_ch()

err_t analogmux5_select_ch ( analogmux5_t * ctx,
uint8_t ch_select )

Analog MUX 5 set channel function.

This function sets the active channel.

Parameters
[in]ctx: Click context object. See analogmux5_t object definition for detailed explanation.
[in]ch_select:
  • 0x01 ( ANALOGMUX5_SEL_CH_1 ) - Set active channel 1,
  • 0x02 ( ANALOGMUX5_SEL_CH_2 ) - Set active channel 2,
  • 0x03 ( ANALOGMUX5_SEL_CH_3 ) - Set active channel 3,
  • 0x04 ( ANALOGMUX5_SEL_CH_4 ) - Set active channel 4,
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.