expand19  2.1.0.0
Modules | Functions
Expand 19 Click Driver

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

Modules

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

Functions

void expand19_cfg_setup (expand19_cfg_t *cfg)
 Expand 19 configuration object setup function. More...
 
err_t expand19_init (expand19_t *ctx, expand19_cfg_t *cfg)
 Expand 19 initialization function. More...
 
err_t expand19_default_cfg (expand19_t *ctx)
 Expand 19 default configuration function. More...
 
err_t expand19_write_register (expand19_t *ctx, uint8_t reg, uint8_t data_in)
 Expand 19 write register function. More...
 
err_t expand19_read_register (expand19_t *ctx, uint8_t reg, uint8_t *data_out)
 Expand 19 read register function. More...
 
void expand19_set_rst_pin (expand19_t *ctx, uint8_t state)
 Expand 19 set RST pin function. More...
 
void expand19_reset_device (expand19_t *ctx)
 Expand 19 reset device function. More...
 
uint8_t expand19_get_int_pin (expand19_t *ctx)
 Expand 19 get INT pin function. More...
 
err_t expand19_set_pin_direction (expand19_t *ctx, uint8_t direction, uint8_t pin_mask)
 Expand 19 set pin direction function. More...
 
err_t expand19_set_all_pins_direction (expand19_t *ctx, uint8_t direction)
 Expand 19 set all pins direction function. More...
 
err_t expand19_set_all_pins_value (expand19_t *ctx, uint8_t set_mask)
 Expand 19 set all pins value function. More...
 
err_t expand19_set_pin_value (expand19_t *ctx, uint8_t clr_mask, uint8_t set_mask)
 Expand 19 set pin value function. More...
 
err_t expand19_read_port_value (expand19_t *ctx, uint8_t *data_out)
 Expand 19 read port value function. More...
 

Detailed Description

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

◆ expand19_cfg_setup()

void expand19_cfg_setup ( expand19_cfg_t cfg)

Expand 19 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ expand19_default_cfg()

err_t expand19_default_cfg ( expand19_t ctx)

Expand 19 default configuration function.

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

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

◆ expand19_get_int_pin()

uint8_t expand19_get_int_pin ( expand19_t ctx)

Expand 19 get INT pin function.

This function returns the INT pin logic state.

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

◆ expand19_init()

err_t expand19_init ( expand19_t ctx,
expand19_cfg_t cfg 
)

Expand 19 initialization function.

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

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

◆ expand19_read_port_value()

err_t expand19_read_port_value ( expand19_t ctx,
uint8_t *  data_out 
)

Expand 19 read port value function.

This function reads the value of all input pins.

Parameters
[in]ctx: Click context object. See expand19_t object definition for detailed explanation.
[out]data_out: Port value.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand19_read_register()

err_t expand19_read_register ( expand19_t ctx,
uint8_t  reg,
uint8_t *  data_out 
)

Expand 19 read register function.

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

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

◆ expand19_reset_device()

void expand19_reset_device ( expand19_t ctx)

Expand 19 reset device function.

This function resets the device by toggling the RST pin logic state.

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

◆ expand19_set_all_pins_direction()

err_t expand19_set_all_pins_direction ( expand19_t ctx,
uint8_t  direction 
)

Expand 19 set all pins direction function.

This function sets the direction of all pins.

Parameters
[in]ctx: Click context object. See expand19_t object definition for detailed explanation.
[in]direction:
  • 0 - Output,
  • 1 - Input.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand19_set_all_pins_value()

err_t expand19_set_all_pins_value ( expand19_t ctx,
uint8_t  set_mask 
)

Expand 19 set all pins value function.

This function sets the value of all output pins.

Parameters
[in]ctx: Click context object. See expand19_t object definition for detailed explanation.
[in]set_mask: Pin set mask.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand19_set_pin_direction()

err_t expand19_set_pin_direction ( expand19_t ctx,
uint8_t  direction,
uint8_t  pin_mask 
)

Expand 19 set pin direction function.

This function sets the direction of the selected pins.

Parameters
[in]ctx: Click context object. See expand19_t object definition for detailed explanation.
[in]direction:
  • 0 - Output,
  • 1 - Input.
[in]pin_mask: Pin mask.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand19_set_pin_value()

err_t expand19_set_pin_value ( expand19_t ctx,
uint8_t  clr_mask,
uint8_t  set_mask 
)

Expand 19 set pin value function.

This function sets the value of the selected pins.

Parameters
[in]ctx: Click context object. See expand19_t object definition for detailed explanation.
[in]clr_mask: Pin clear mask.
[in]set_mask: Pin set mask.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand19_set_rst_pin()

void expand19_set_rst_pin ( expand19_t ctx,
uint8_t  state 
)

Expand 19 set RST pin function.

This function sets the RST pin logic state.

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

◆ expand19_write_register()

err_t expand19_write_register ( expand19_t ctx,
uint8_t  reg,
uint8_t  data_in 
)

Expand 19 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 expand19_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.