mux4 2.0.0.0
MUX 4 Click Driver

API for configuring and manipulating MUX 4 Click driver. More...

Topics

 MUX 4 setting.
 Specified settings for MUX 4 Click driver.
 
 MUX 4 MikroBUS Map
 MikroBUS pin mapping of MUX 4 Click driver.
 

Functions

void mux4_cfg_setup (mux4_cfg_t *cfg)
 MUX 4 configuration object setup function.
 
err_t mux4_init (mux4_t *ctx, mux4_cfg_t *cfg)
 MUX 4 initialization function.
 
err_t mux4_read_an_pin_value (mux4_t *ctx, uint16_t *data_out)
 MUX 4 read AN pin value function.
 
err_t mux4_read_an_pin_voltage (mux4_t *ctx, float *data_out)
 MUX 4 read AN pin voltage level function.
 
void mux4_enable_input (mux4_t *ctx, uint8_t en_state)
 MUX 4 enable input function.
 
void mux4_select_input (mux4_t *ctx, uint8_t input)
 MUX 4 select input function.
 

Detailed Description

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

◆ mux4_cfg_setup()

void mux4_cfg_setup ( mux4_cfg_t * cfg)

MUX 4 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ mux4_enable_input()

void mux4_enable_input ( mux4_t * ctx,
uint8_t en_state )

MUX 4 enable input function.

This function enable or disables analog inputs.

Parameters
[in]ctx: Click context object. See mux4_t object definition for detailed explanation.
[in]en_state:
  • 0 - Enable inputs.
  • 1 - Disable inputs independed of S0 to S2 pin states.
Returns
None.
Note
None.

◆ mux4_init()

err_t mux4_init ( mux4_t * ctx,
mux4_cfg_t * cfg )

MUX 4 initialization function.

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

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

◆ mux4_read_an_pin_value()

err_t mux4_read_an_pin_value ( mux4_t * ctx,
uint16_t * data_out )

MUX 4 read AN pin value function.

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

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

◆ mux4_read_an_pin_voltage()

err_t mux4_read_an_pin_voltage ( mux4_t * ctx,
float * data_out )

MUX 4 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 mux4_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).

◆ mux4_select_input()

void mux4_select_input ( mux4_t * ctx,
uint8_t input )

MUX 4 select input function.

This function selects which input channel signal is being forwarded to the AN/EXT pin.

Parameters
[in]ctx: Click context object. See mux4_t object definition for detailed explanation.
[in]input: Select input [1-8].
Returns
None.
Note
None.