mux5 2.1.0.0
MUX 5 Click Driver

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

Topics

 MUX 5 Registers List
 List of registers of MUX 5 Click driver.
 
 MUX 5 Registers Settings
 Settings for registers of MUX 5 Click driver.
 
 MUX 5 MikroBUS Map
 MikroBUS pin mapping of MUX 5 Click driver.
 

Functions

void mux5_cfg_setup (mux5_cfg_t *cfg)
 MUX 5 configuration object setup function.
 
err_t mux5_init (mux5_t *ctx, mux5_cfg_t *cfg)
 MUX 5 initialization function.
 
err_t mux5_default_cfg (mux5_t *ctx)
 MUX 5 default configuration function.
 
err_t mux5_i2c_write_register (mux5_t *ctx, uint8_t reg, uint8_t data_in)
 MUX 5 I2C write register function.
 
err_t mux5_i2c_read_register (mux5_t *ctx, uint8_t reg, uint8_t *data_out)
 MUX 5 I2C read register function.
 
err_t mux5_set_channels_state (mux5_t *ctx, uint16_t ch_mask, uint8_t ch_state)
 MUX 5 set channels state function.
 
void mux5_enable_device (mux5_t *ctx)
 MUX 5 enable device function.
 
void mux5_disable_device (mux5_t *ctx)
 MUX 5 disable device function.
 
uint8_t mux5_get_com_a_pin (mux5_t *ctx)
 MUX 5 get com a pin function.
 
uint8_t mux5_get_com_b_pin (mux5_t *ctx)
 MUX 5 get com b pin function.
 

Detailed Description

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

◆ mux5_cfg_setup()

void mux5_cfg_setup ( mux5_cfg_t * cfg)

MUX 5 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ mux5_default_cfg()

err_t mux5_default_cfg ( mux5_t * ctx)

MUX 5 default configuration function.

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

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

◆ mux5_disable_device()

void mux5_disable_device ( mux5_t * ctx)

MUX 5 disable device function.

This function disables the device by setting the shutdown (SD) pin to low logic state.

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

◆ mux5_enable_device()

void mux5_enable_device ( mux5_t * ctx)

MUX 5 enable device function.

This function enables the device by setting the shutdown (SD) pin to high logic state.

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

◆ mux5_get_com_a_pin()

uint8_t mux5_get_com_a_pin ( mux5_t * ctx)

MUX 5 get com a pin function.

This function returns the COM A pin logic state.

Parameters
[in]ctx: Click context object. See mux5_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ mux5_get_com_b_pin()

uint8_t mux5_get_com_b_pin ( mux5_t * ctx)

MUX 5 get com b pin function.

This function returns the COM B pin logic state.

Parameters
[in]ctx: Click context object. See mux5_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ mux5_i2c_read_register()

err_t mux5_i2c_read_register ( mux5_t * ctx,
uint8_t reg,
uint8_t * data_out )

MUX 5 I2C read register function.

This function reads data from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See mux5_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ mux5_i2c_write_register()

err_t mux5_i2c_write_register ( mux5_t * ctx,
uint8_t reg,
uint8_t data_in )

MUX 5 I2C write register function.

This function writes a desired data to the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See mux5_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ mux5_init()

err_t mux5_init ( mux5_t * ctx,
mux5_cfg_t * cfg )

MUX 5 initialization function.

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

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

◆ mux5_set_channels_state()

err_t mux5_set_channels_state ( mux5_t * ctx,
uint16_t ch_mask,
uint8_t ch_state )

MUX 5 set channels state function.

This function sets a desired ch_state of the channels selected with ch_mask.

Parameters
[in]ctx: Click context object. See mux5_t object definition for detailed explanation.
[in]ch_mask: Bit mask of channels to set.
[in]ch_state: Channel state.
  • 0 - High Z,
  • 1 - COM A,
  • 2 - COM B,
  • 3 - COM AB (Be careful when setting this state and combining it with states 1 and 2, since the COM_A and COM_B are going to be shorted. Refer to the functional diagram from the datasheet for more details.).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.