expand15 2.1.0.0
Expand 15 Click Driver

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

Topics

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

Functions

void expand15_cfg_setup (expand15_cfg_t *cfg)
 Expand 15 configuration object setup function.
 
err_t expand15_init (expand15_t *ctx, expand15_cfg_t *cfg)
 Expand 15 initialization function.
 
err_t expand15_default_cfg (expand15_t *ctx)
 Expand 15 default configuration function.
 
err_t expand15_generic_write (expand15_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Expand 15 I2C writing function.
 
err_t expand15_generic_read (expand15_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Expand 15 I2C reading function.
 
uint8_t expand15_get_int_pin_state (expand15_t *ctx)
 Expand 15 get interrupt function.
 
void expand15_hw_reset (expand15_t *ctx)
 Expand 15 hardware reset function.
 
err_t expand15_get_in_pin_state (expand15_t *ctx, uint8_t port, uint8_t *pin_state)
 Expand 15 get input pin state function.
 
err_t expand15_get_out_pin_state (expand15_t *ctx, uint8_t port, uint8_t *pin_state)
 Expand 15 get output pin state function.
 
err_t expand15_set_out_pin_state (expand15_t *ctx, uint8_t port, uint8_t pin_state)
 Expand 15 set output pin state function.
 
err_t expand15_get_in_pin_polarity (expand15_t *ctx, uint8_t port, uint8_t *pin_polarity)
 Expand 15 get input pin polarity function.
 
err_t expand15_set_in_pin_polarity (expand15_t *ctx, uint8_t port, uint8_t pin_polarity)
 Expand 15 set input pin polarity function.
 
err_t expand15_get_pin_config (expand15_t *ctx, uint8_t port, uint8_t *pin_config)
 Expand 15 get pin configuration function.
 
err_t expand15_set_pin_as_in (expand15_t *ctx, uint8_t port, uint8_t pin_config)
 Expand 15 set pin as input function.
 
err_t expand15_set_pin_as_out (expand15_t *ctx, uint8_t port, uint8_t pin_config)
 Expand 15 set pin as output function.
 
err_t expand15_get_out_level (expand15_t *ctx, uint8_t port, uint16_t *pin_output_level)
 Expand 15 get output level function.
 
err_t expand15_set_out_level (expand15_t *ctx, uint8_t port, uint16_t pin_output_level)
 Expand 15 set output level function.
 
err_t expand15_set_out_pin_strength (expand15_t *ctx, uint8_t port, uint8_t pin, uint8_t strength)
 Expand 15 set pin output strength function.
 
err_t expand15_set_en_pull_up_down (expand15_t *ctx, uint8_t port, uint8_t port_config)
 Expand 15 set enable pull up/down function.
 
err_t expand15_get_en_pull_up_down (expand15_t *ctx, uint8_t port, uint8_t *port_config)
 Expand 15 get enable pull up/down function.
 
err_t expand15_set_pull_up_down (expand15_t *ctx, uint8_t port, uint8_t pin_config)
 Expand 15 set pull up/down function.
 
err_t expand15_get_pull_up_down (expand15_t *ctx, uint8_t port, uint8_t *pin_config)
 Expand 15 get pull up/down function.
 
err_t expand15_set_int_mask (expand15_t *ctx, uint8_t port, uint8_t int_config)
 Expand 15 set interrupt mask function.
 
err_t expand15_get_int_mask (expand15_t *ctx, uint8_t port, uint8_t *int_config)
 Expand 15 get interrupt mask function.
 
err_t expand15_get_int_status (expand15_t *ctx, uint8_t port, uint8_t *int_status)
 Expand 15 get interrupt status function.
 
err_t expand15_get_out_port_config (expand15_t *ctx, uint8_t *port0_cfg, uint8_t *port1_cfg)
 Expand 15 get output port configuration function.
 
err_t expand15_set_out_port_config (expand15_t *ctx, uint8_t port0_cfg, uint8_t port1_cfg)
 Expand 15 set output port configuration function.
 

Detailed Description

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

◆ expand15_cfg_setup()

void expand15_cfg_setup ( expand15_cfg_t * cfg)

Expand 15 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ expand15_default_cfg()

err_t expand15_default_cfg ( expand15_t * ctx)

Expand 15 default configuration function.

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

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

◆ expand15_generic_read()

err_t expand15_generic_read ( expand15_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Expand 15 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 expand15_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.

◆ expand15_generic_write()

err_t expand15_generic_write ( expand15_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Expand 15 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 expand15_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.

◆ expand15_get_en_pull_up_down()

err_t expand15_get_en_pull_up_down ( expand15_t * ctx,
uint8_t port,
uint8_t * port_config )

Expand 15 get enable pull up/down function.

This function reads pull up/down enables of selected port.

Parameters
[in]ctx: Click context object. See expand15_t object definition for detailed explanation.
[in]port: Selected port.
[out]port_config: Port config to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand15_get_in_pin_polarity()

err_t expand15_get_in_pin_polarity ( expand15_t * ctx,
uint8_t port,
uint8_t * pin_polarity )

Expand 15 get input pin polarity function.

This function reads a polarity of the pins defined as input.

Parameters
[in]ctx: Click context object. See expand15_t object definition for detailed explanation.
[in]port: Selected port.
[out]pin_polarity: Pin polarity of the selected port.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand15_get_in_pin_state()

err_t expand15_get_in_pin_state ( expand15_t * ctx,
uint8_t port,
uint8_t * pin_state )

Expand 15 get input pin state function.

This function reads a state of the pins defined as input.

Parameters
[in]ctx: Click context object. See expand15_t object definition for detailed explanation.
[in]port: Selected port.
[out]pin_state: Pin state of the selected port.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand15_get_int_mask()

err_t expand15_get_int_mask ( expand15_t * ctx,
uint8_t port,
uint8_t * int_config )

Expand 15 get interrupt mask function.

This function read interrupt mask value of selected port.

Parameters
[in]ctx: Click context object. See expand15_t object definition for detailed explanation.
[in]port: Selected port.
[out]int_config: Pin interrupt mask of selected port.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand15_get_int_pin_state()

uint8_t expand15_get_int_pin_state ( expand15_t * ctx)

Expand 15 get interrupt function.

This function reads a state of the interrupt pin.

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

◆ expand15_get_int_status()

err_t expand15_get_int_status ( expand15_t * ctx,
uint8_t port,
uint8_t * int_status )

Expand 15 get interrupt status function.

This function read interrupt status value of selected port.

Parameters
[in]ctx: Click context object. See expand15_t object definition for detailed explanation.
[in]port: Selected port.
[out]int_status: Pin interrupt status of selected port.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand15_get_out_level()

err_t expand15_get_out_level ( expand15_t * ctx,
uint8_t port,
uint16_t * pin_output_level )

Expand 15 get output level function.

This function reads a output level of pins of selected port.

Parameters
[in]ctx: Click context object. See expand15_t object definition for detailed explanation.
[in]port: Selected port.
[out]pin_output_level: Pin output level of the selected port.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand15_get_out_pin_state()

err_t expand15_get_out_pin_state ( expand15_t * ctx,
uint8_t port,
uint8_t * pin_state )

Expand 15 get output pin state function.

This function reads a state of the pins defined as output.

Parameters
[in]ctx: Click context object. See expand15_t object definition for detailed explanation.
[in]port: Selected port.
[out]pin_state: Pin state of the selected port.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand15_get_out_port_config()

err_t expand15_get_out_port_config ( expand15_t * ctx,
uint8_t * port0_cfg,
uint8_t * port1_cfg )

Expand 15 get output port configuration function.

This function reads port output configuration value of selected port.

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

◆ expand15_get_pin_config()

err_t expand15_get_pin_config ( expand15_t * ctx,
uint8_t port,
uint8_t * pin_config )

Expand 15 get pin configuration function.

This function reads a configuration of pins of selected port.

Parameters
[in]ctx: Click context object. See expand15_t object definition for detailed explanation.
[in]port: Selected port.
[out]pin_config: Pin configuration of the selected port.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand15_get_pull_up_down()

err_t expand15_get_pull_up_down ( expand15_t * ctx,
uint8_t port,
uint8_t * pin_config )

Expand 15 get pull up/down function.

This function reads pull up/down pin state of selected port.

Parameters
[in]ctx: Click context object. See expand15_t object definition for detailed explanation.
[in]port: Selected port.
[out]pin_config: Pins where pull up/down is active.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand15_hw_reset()

void expand15_hw_reset ( expand15_t * ctx)

Expand 15 hardware reset function.

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

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

◆ expand15_init()

err_t expand15_init ( expand15_t * ctx,
expand15_cfg_t * cfg )

Expand 15 initialization function.

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

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

◆ expand15_set_en_pull_up_down()

err_t expand15_set_en_pull_up_down ( expand15_t * ctx,
uint8_t port,
uint8_t port_config )

Expand 15 set enable pull up/down function.

This function enables pull up/down of selected port.

Parameters
[in]ctx: Click context object. See expand15_t object definition for detailed explanation.
[in]port: Selected port.
[in]port_config: Port config to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand15_set_in_pin_polarity()

err_t expand15_set_in_pin_polarity ( expand15_t * ctx,
uint8_t port,
uint8_t pin_polarity )

Expand 15 set input pin polarity function.

This function write a polarity of the pins defined as input.

Parameters
[in]ctx: Click context object. See expand15_t object definition for detailed explanation.
[in]port: Selected port.
[in]pin_polarity: Pin polarity of the selected port.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand15_set_int_mask()

err_t expand15_set_int_mask ( expand15_t * ctx,
uint8_t port,
uint8_t int_config )

Expand 15 set interrupt mask function.

This function writes interrupt mask value of selected port.

Parameters
[in]ctx: Click context object. See expand15_t object definition for detailed explanation.
[in]port: Selected port.
[in]int_config: Pin interrupt mask of selected port.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand15_set_out_level()

err_t expand15_set_out_level ( expand15_t * ctx,
uint8_t port,
uint16_t pin_output_level )

Expand 15 set output level function.

This function writes a output level of pins of selected port.

Parameters
[in]ctx: Click context object. See expand15_t object definition for detailed explanation.
[in]port: Selected port.
[in]pin_output_level: Pin output level of the selected port.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand15_set_out_pin_state()

err_t expand15_set_out_pin_state ( expand15_t * ctx,
uint8_t port,
uint8_t pin_state )

Expand 15 set output pin state function.

This function writes a state of the pins defined as output.

Parameters
[in]ctx: Click context object. See expand15_t object definition for detailed explanation.
[in]port: Selected port.
[in]pin_state: Pin state of the selected port.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand15_set_out_pin_strength()

err_t expand15_set_out_pin_strength ( expand15_t * ctx,
uint8_t port,
uint8_t pin,
uint8_t strength )

Expand 15 set pin output strength function.

This function writes a set pin output strength of selected port.

Parameters
[in]ctx: Click context object. See expand15_t object definition for detailed explanation.
[in]port: Selected port.
[in]pin: Selected pin.
[in]strength: Strength of pin output.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand15_set_out_port_config()

err_t expand15_set_out_port_config ( expand15_t * ctx,
uint8_t port0_cfg,
uint8_t port1_cfg )

Expand 15 set output port configuration function.

This function writes port output configuration value of selected port.

Parameters
[in]ctx: Click context object. See expand15_t object definition for detailed explanation.
[in]port0_cfg: Port 0 configuration.
[in]port1_cfg: Port 1 configuration.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand15_set_pin_as_in()

err_t expand15_set_pin_as_in ( expand15_t * ctx,
uint8_t port,
uint8_t pin_config )

Expand 15 set pin as input function.

This function writes a input pin configuration of pins of selected port.

Parameters
[in]ctx: Click context object. See expand15_t object definition for detailed explanation.
[in]port: Selected port.
[in]pin_config: Pin configuration of the selected port.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand15_set_pin_as_out()

err_t expand15_set_pin_as_out ( expand15_t * ctx,
uint8_t port,
uint8_t pin_config )

Expand 15 set pin as output function.

This function writes a output pin configuration of pins of selected port.

Parameters
[in]ctx: Click context object. See expand15_t object definition for detailed explanation.
[in]port: Selected port.
[in]pin_config: Pin configuration of the selected port.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand15_set_pull_up_down()

err_t expand15_set_pull_up_down ( expand15_t * ctx,
uint8_t port,
uint8_t pin_config )

Expand 15 set pull up/down function.

This function writes pull up/down pin state of selected port.

Parameters
[in]ctx: Click context object. See expand15_t object definition for detailed explanation.
[in]port: Selected port.
[in]pin_config: Pins where pull up/down is active.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.