expand11 2.1.0.0
Expand 11 Click Driver

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

Topics

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

Functions

void expand11_cfg_setup (expand11_cfg_t *cfg)
 Expand 11 configuration object setup function.
 
err_t expand11_init (expand11_t *ctx, expand11_cfg_t *cfg)
 Expand 11 initialization function.
 
err_t expand11_default_cfg (expand11_t *ctx)
 Expand 11 default configuration function.
 
err_t expand11_write_register (expand11_t *ctx, uint8_t reg, uint8_t data_in)
 Expand 11 write register function.
 
err_t expand11_read_register (expand11_t *ctx, uint8_t reg, uint8_t *data_out)
 Expand 11 read register function.
 
err_t expand11_set_pin_direction (expand11_t *ctx, uint8_t direction, uint8_t pin_mask)
 Expand 11 set pin direction function.
 
err_t expand11_set_all_pins_direction (expand11_t *ctx, uint8_t direction)
 Expand 11 set all pins direction function.
 
err_t expand11_set_pin_polarity (expand11_t *ctx, uint8_t polarity, uint8_t pin_mask)
 Expand 11 set pin polarity function.
 
err_t expand11_set_all_pins_polarity (expand11_t *ctx, uint8_t polarity)
 Expand 11 set all pins polarity function.
 
err_t expand11_set_pin_value (expand11_t *ctx, uint8_t clr_mask, uint8_t set_mask)
 Expand 11 set pin value function.
 
err_t expand11_set_all_pins_value (expand11_t *ctx, uint8_t set_mask)
 Expand 11 set all pins value function.
 
err_t expand11_read_port_value (expand11_t *ctx, uint8_t *data_out)
 Expand 11 read port value function.
 
err_t expand11_set_p3_function (expand11_t *ctx, uint8_t p3_func)
 Expand 11 set p3 function function.
 
err_t expand11_disable_pull_up (expand11_t *ctx)
 Expand 11 disable pull up function.
 
err_t expand11_enable_pull_up (expand11_t *ctx)
 Expand 11 enable pull up function.
 
uint8_t expand11_get_int_pin (expand11_t *ctx)
 Expand 11 get int pin function.
 

Detailed Description

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

◆ expand11_cfg_setup()

void expand11_cfg_setup ( expand11_cfg_t * cfg)

Expand 11 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ expand11_default_cfg()

err_t expand11_default_cfg ( expand11_t * ctx)

Expand 11 default configuration function.

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

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

◆ expand11_disable_pull_up()

err_t expand11_disable_pull_up ( expand11_t * ctx)

Expand 11 disable pull up function.

This function disables internal pull-ups for input pins.

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

◆ expand11_enable_pull_up()

err_t expand11_enable_pull_up ( expand11_t * ctx)

Expand 11 enable pull up function.

This function enables internal pull-ups for input pins.

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

◆ expand11_get_int_pin()

uint8_t expand11_get_int_pin ( expand11_t * ctx)

Expand 11 get int pin function.

This function returns the logic level of the INT pin.

Parameters
[in]ctx: Click context object. See expand11_t object definition for detailed explanation.
Returns
Pin logic level.
Note
This pin must be selected by with the PS SEL jumper and enabled in the special function register.

◆ expand11_init()

err_t expand11_init ( expand11_t * ctx,
expand11_cfg_t * cfg )

Expand 11 initialization function.

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

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

◆ expand11_read_port_value()

err_t expand11_read_port_value ( expand11_t * ctx,
uint8_t * data_out )

Expand 11 read port value function.

This function reads the value of the port input pins.

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

◆ expand11_read_register()

err_t expand11_read_register ( expand11_t * ctx,
uint8_t reg,
uint8_t * data_out )

Expand 11 read register function.

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

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

◆ expand11_set_all_pins_direction()

err_t expand11_set_all_pins_direction ( expand11_t * ctx,
uint8_t direction )

Expand 11 set all pins direction function.

This function sets the direction of all pins.

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

◆ expand11_set_all_pins_polarity()

err_t expand11_set_all_pins_polarity ( expand11_t * ctx,
uint8_t polarity )

Expand 11 set all pins polarity function.

This function sets the polarity of all pins.

Parameters
[in]ctx: Click context object. See expand11_t object definition for detailed explanation.
[in]polarity:
  • 0 - Non-Inverted,
  • 1 - Inverted.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand11_set_all_pins_value()

err_t expand11_set_all_pins_value ( expand11_t * ctx,
uint8_t set_mask )

Expand 11 set all pins value function.

This function sets the value of all output pins.

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

◆ expand11_set_p3_function()

err_t expand11_set_p3_function ( expand11_t * ctx,
uint8_t p3_func )

Expand 11 set p3 function function.

This function sets the P3 pin function to P3 or INT pin.

Parameters
[in]ctx: Click context object. See expand11_t object definition for detailed explanation.
[in]p3_func:
  • 0 - P3,
  • 1 - INT.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand11_set_pin_direction()

err_t expand11_set_pin_direction ( expand11_t * ctx,
uint8_t direction,
uint8_t pin_mask )

Expand 11 set pin direction function.

This function sets the direction of the selected pins.

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

◆ expand11_set_pin_polarity()

err_t expand11_set_pin_polarity ( expand11_t * ctx,
uint8_t polarity,
uint8_t pin_mask )

Expand 11 set pin polarity function.

This function sets the polarity of the selected pins.

Parameters
[in]ctx: Click context object. See expand11_t object definition for detailed explanation.
[in]polarity:
  • 0 - Non-Inverted,
  • 1 - Inverted.
[in]pin_mask: Pin mask.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ expand11_set_pin_value()

err_t expand11_set_pin_value ( expand11_t * ctx,
uint8_t clr_mask,
uint8_t set_mask )

Expand 11 set pin value function.

This function sets the value of the selected pins.

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

◆ expand11_write_register()

err_t expand11_write_register ( expand11_t * ctx,
uint8_t reg,
uint8_t data_in )

Expand 11 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 expand11_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.