expand17  2.1.0.0
Modules | Functions
Expand 17 Click Driver

API for configuring and manipulating Expand 17 Click driver. More...

Modules

 Expand 17 Registers List
 List of registers of Expand 17 Click driver.
 
 Expand 17 Registers Settings
 Settings for registers of Expand 17 Click driver.
 
 Expand 17 MikroBUS Map
 MikroBUS pin mapping of Expand 17 Click driver.
 

Functions

void expand17_cfg_setup (expand17_cfg_t *cfg)
 Expand 17 configuration object setup function. More...
 
err_t expand17_init (expand17_t *ctx, expand17_cfg_t *cfg)
 Expand 17 initialization function. More...
 
err_t expand17_default_cfg (expand17_t *ctx)
 Expand 17 default configuration function. More...
 
err_t expand17_generic_write (expand17_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Expand 17 I2C writing function. More...
 
err_t expand17_generic_read (expand17_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Expand 17 I2C reading function. More...
 
void expand17_set_rst_pin (expand17_t *ctx, uint8_t pin_state)
 Expand 17 set reset pin state function. More...
 
uint8_t expand17_get_int_pin (expand17_t *ctx)
 Expand 17 get interrupt pin state function. More...
 
void expand17_hw_reset (expand17_t *ctx)
 Expand 17 hardware reset function. More...
 
err_t expand17_set_io_dir (expand17_t *ctx, uint8_t input_pins, uint8_t output_pins)
 Expand 17 set pin input or output direction function. More...
 
err_t expand17_set_output_state (expand17_t *ctx, uint8_t clr_mask, uint8_t set_mask)
 Expand 17 set output pins state function. More...
 
err_t expand17_get_input_state (expand17_t *ctx, uint8_t *input_state)
 Expand 17 get input pins state function. More...
 

Detailed Description

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

◆ expand17_cfg_setup()

void expand17_cfg_setup ( expand17_cfg_t cfg)

Expand 17 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ expand17_default_cfg()

err_t expand17_default_cfg ( expand17_t ctx)

Expand 17 default configuration function.

This function executes a default configuration of Expand 17 click board.

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

◆ expand17_generic_read()

err_t expand17_generic_read ( expand17_t ctx,
uint8_t  reg,
uint8_t *  data_out,
uint8_t  len 
)

Expand 17 I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See expand17_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand17_generic_write()

err_t expand17_generic_write ( expand17_t ctx,
uint8_t  reg,
uint8_t *  data_in,
uint8_t  len 
)

Expand 17 I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See expand17_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand17_get_input_state()

err_t expand17_get_input_state ( expand17_t ctx,
uint8_t *  input_state 
)

Expand 17 get input pins state function.

This function is used to get state of the input pins.

Parameters
[in]ctx: Click context object. See expand17_t object definition for detailed explanation.
[out]input_state: Input pins state.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand17_get_int_pin()

uint8_t expand17_get_int_pin ( expand17_t ctx)

Expand 17 get interrupt pin state function.

This function is used to get state of the interrupt pin of Expand 17 click board.

Parameters
[in]ctx: Click context object. See expand17_t object definition for detailed explanation.
Returns
State of the INT pin.
Note
None.

◆ expand17_hw_reset()

void expand17_hw_reset ( expand17_t ctx)

Expand 17 hardware reset function.

This function is used to perform the hardware reset of Expand 17 click board.

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

◆ expand17_init()

err_t expand17_init ( expand17_t ctx,
expand17_cfg_t cfg 
)

Expand 17 initialization function.

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

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

◆ expand17_set_io_dir()

err_t expand17_set_io_dir ( expand17_t ctx,
uint8_t  input_pins,
uint8_t  output_pins 
)

Expand 17 set pin input or output direction function.

This function is used to set input or output direction of pins.

Parameters
[in]ctx: Click context object. See expand17_t object definition for detailed explanation.
[in]input_pins: Selected pins will be set as input.
[in]output_pins: Selected pins will be set as output.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand17_set_output_state()

err_t expand17_set_output_state ( expand17_t ctx,
uint8_t  clr_mask,
uint8_t  set_mask 
)

Expand 17 set output pins state function.

This function is used to set output state of the pins.

Parameters
[in]ctx: Click context object. See expand17_t object definition for detailed explanation.
[in]clr_mask: Output of the selected pins will be set as LOW.
[in]set_mask: Output of the selected pins will be set as HIGH.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand17_set_rst_pin()

void expand17_set_rst_pin ( expand17_t ctx,
uint8_t  pin_state 
)

Expand 17 set reset pin state function.

This function is used to set state of the reset pin of Expand 17 click board.

Parameters
[in]ctx: Click context object. See expand17_t object definition for detailed explanation.
[in]pin_state: State of the reset pin.
Returns
Nothing.
Note
None.