expand13 2.0.0.0
Expand 13 Click Driver

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

Topics

 Expand 13 Settings
 Settings of Expand 13 Click driver.
 
 Expand 13 MikroBUS Map
 MikroBUS pin mapping of Expand 13 Click driver.
 

Functions

void expand13_cfg_setup (expand13_cfg_t *cfg)
 Expand 13 configuration object setup function.
 
err_t expand13_init (expand13_t *ctx, expand13_cfg_t *cfg)
 Expand 13 initialization function.
 
void expand13_enable_device (expand13_t *ctx)
 Expand 13 enable device function.
 
void expand13_disable_device (expand13_t *ctx)
 Expand 13 disable device function.
 
uint8_t expand13_get_int_pin (expand13_t *ctx)
 Expand 13 get int pin function.
 
err_t expand13_write_all_ports (expand13_t *ctx, uint8_t *ports)
 Expand 13 write all ports function.
 
err_t expand13_read_all_ports (expand13_t *ctx, uint8_t *ports)
 Expand 13 read all ports function.
 
err_t expand13_set_port_value (expand13_t *ctx, uint8_t port, uint8_t clr_mask, uint8_t set_mask)
 Expand 13 set port value function.
 
err_t expand13_read_port_value (expand13_t *ctx, uint8_t port, uint8_t *data_out)
 Expand 13 read port value function.
 

Detailed Description

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

◆ expand13_cfg_setup()

void expand13_cfg_setup ( expand13_cfg_t * cfg)

Expand 13 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ expand13_disable_device()

void expand13_disable_device ( expand13_t * ctx)

Expand 13 disable device function.

This function disables the device by setting the RST pin to low logic state.

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

◆ expand13_enable_device()

void expand13_enable_device ( expand13_t * ctx)

Expand 13 enable device function.

This function enables the device by setting the RST pin to high logic state.

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

◆ expand13_get_int_pin()

uint8_t expand13_get_int_pin ( expand13_t * ctx)

Expand 13 get int pin function.

This function returns the INT pin logic state.

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

◆ expand13_init()

err_t expand13_init ( expand13_t * ctx,
expand13_cfg_t * cfg )

Expand 13 initialization function.

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

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

◆ expand13_read_all_ports()

err_t expand13_read_all_ports ( expand13_t * ctx,
uint8_t * ports )

Expand 13 read all ports function.

This function reads the state of all 6 ports.

Parameters
[in]ctx: Click context object. See expand13_t object definition for detailed explanation.
[out]ports: Ports array of 6 bytes.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ expand13_read_port_value()

err_t expand13_read_port_value ( expand13_t * ctx,
uint8_t port,
uint8_t * data_out )

Expand 13 read port value function.

This function reads the value of the selected port.

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

◆ expand13_set_port_value()

err_t expand13_set_port_value ( expand13_t * ctx,
uint8_t port,
uint8_t clr_mask,
uint8_t set_mask )

Expand 13 set port value function.

This function sets the value of the selected port.

Parameters
[in]ctx: Click context object. See expand13_t object definition for detailed explanation.
[in]port:
  • 0 - Port 0,
  • 1 - Port 1.
  • 2 - Port 2.
  • 3 - Port 3.
  • 4 - Port 4.
  • 5 - Port 5.
[in]clr_mask: Port clear mask.
[in]set_mask: Port set mask.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ expand13_write_all_ports()

err_t expand13_write_all_ports ( expand13_t * ctx,
uint8_t * ports )

Expand 13 write all ports function.

This function writes a desired data to all 6 ports.

Parameters
[in]ctx: Click context object. See expand13_t object definition for detailed explanation.
[in]ports: Ports array of 6 bytes.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.