expand16 2.1.0.0
Expand 16 Click Driver

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

Topics

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

Functions

void expand16_cfg_setup (expand16_cfg_t *cfg)
 Expand 16 configuration object setup function.
 
err_t expand16_init (expand16_t *ctx, expand16_cfg_t *cfg)
 Expand 16 initialization function.
 
err_t expand16_default_cfg (expand16_t *ctx)
 Expand 16 default configuration function.
 
err_t expand16_generic_write (expand16_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Expand 16 I2C writing function.
 
err_t expand16_generic_read (expand16_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Expand 16 I2C reading function.
 
void expand16_set_rst_pin (expand16_t *ctx, uint8_t pin_state)
 Expand 16 set RST pin state function.
 
void expand16_hw_reset (expand16_t *ctx)
 Expand 16 Hardware reset function.
 
uint8_t expand16_get_int_pin (expand16_t *ctx)
 Expand 16 get INT pin function.
 
err_t expand16_write_reg (expand16_t *ctx, uint8_t reg, uint8_t data_in)
 Expand 16 register write function.
 
err_t expand16_read_reg (expand16_t *ctx, uint8_t reg, uint8_t *data_out)
 Expand 16 register read function.
 
err_t expand16_set_io_dir (expand16_t *ctx, uint8_t input_pins, uint8_t output_pins)
 Expand 16 set pin input or output direction function.
 
err_t expand16_set_output_state (expand16_t *ctx, uint8_t clr_mask, uint8_t set_mask)
 Expand 16 set output pins state function.
 

Detailed Description

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

◆ expand16_cfg_setup()

void expand16_cfg_setup ( expand16_cfg_t * cfg)

Expand 16 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ expand16_default_cfg()

err_t expand16_default_cfg ( expand16_t * ctx)

Expand 16 default configuration function.

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

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

◆ expand16_generic_read()

err_t expand16_generic_read ( expand16_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Expand 16 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 expand16_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.

◆ expand16_generic_write()

err_t expand16_generic_write ( expand16_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Expand 16 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 expand16_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.

◆ expand16_get_int_pin()

uint8_t expand16_get_int_pin ( expand16_t * ctx)

Expand 16 get INT pin function.

This function is used to read state of the INT pin.

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

◆ expand16_hw_reset()

void expand16_hw_reset ( expand16_t * ctx)

Expand 16 Hardware reset function.

This function is used to perform hardware reset.

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

◆ expand16_init()

err_t expand16_init ( expand16_t * ctx,
expand16_cfg_t * cfg )

Expand 16 initialization function.

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

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

◆ expand16_read_reg()

err_t expand16_read_reg ( expand16_t * ctx,
uint8_t reg,
uint8_t * data_out )

Expand 16 register read function.

This function is used to read data from the selected register.

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

◆ expand16_set_io_dir()

err_t expand16_set_io_dir ( expand16_t * ctx,
uint8_t input_pins,
uint8_t output_pins )

Expand 16 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 expand16_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.

◆ expand16_set_output_state()

err_t expand16_set_output_state ( expand16_t * ctx,
uint8_t clr_mask,
uint8_t set_mask )

Expand 16 set output pins state function.

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

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

◆ expand16_set_rst_pin()

void expand16_set_rst_pin ( expand16_t * ctx,
uint8_t pin_state )

Expand 16 set RST pin state function.

This function is used to set RST pin state.

Parameters
[in]ctx: Click context object. See expand16_t object definition for detailed explanation.
[in]pin_state: RST pin state.
Returns
Nothing.
Note
None.

◆ expand16_write_reg()

err_t expand16_write_reg ( expand16_t * ctx,
uint8_t reg,
uint8_t data_in )

Expand 16 register write function.

This function is to write data into the selected register.

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