bargraph4 2.0.0.0
BarGraph 4 Click Driver

API for configuring and manipulating BarGraph 4 Click driver. More...

Topics

 BarGraph 4 Settings
 Settings of BarGraph 4 Click driver.
 
 BarGraph 4 MikroBUS Map
 MikroBUS pin mapping of BarGraph 4 Click driver.
 

Functions

void bargraph4_cfg_setup (bargraph4_cfg_t *cfg)
 BarGraph 4 configuration object setup function.
 
err_t bargraph4_init (bargraph4_t *ctx, bargraph4_cfg_t *cfg)
 BarGraph 4 initialization function.
 
err_t bargraph4_set_output (bargraph4_t *ctx, uint16_t ch_mask)
 BarGraph 4 set output function.
 
err_t bargraph4_read_output (bargraph4_t *ctx, uint16_t *ch_mask)
 BarGraph 4 read output function.
 
void bargraph4_disable_output (bargraph4_t *ctx)
 BarGraph 4 disable output function.
 
void bargraph4_enable_output (bargraph4_t *ctx)
 BarGraph 4 enable output function.
 
err_t bargraph4_set_channel_level (bargraph4_t *ctx, bargraph4_sel_ch_t channel, bargraph4_level_t level)
 BarGraph 4 set channel level function.
 

Detailed Description

API for configuring and manipulating BarGraph 4 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

◆ bargraph4_cfg_setup()

void bargraph4_cfg_setup ( bargraph4_cfg_t * cfg)

BarGraph 4 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ bargraph4_disable_output()

void bargraph4_disable_output ( bargraph4_t * ctx)

BarGraph 4 disable output function.

This function disables all outputs.

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

◆ bargraph4_enable_output()

void bargraph4_enable_output ( bargraph4_t * ctx)

BarGraph 4 enable output function.

This function enables all outputs.

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

◆ bargraph4_init()

err_t bargraph4_init ( bargraph4_t * ctx,
bargraph4_cfg_t * cfg )

BarGraph 4 initialization function.

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

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

◆ bargraph4_read_output()

err_t bargraph4_read_output ( bargraph4_t * ctx,
uint16_t * ch_mask )

BarGraph 4 read output function.

This function reads the current state of all output by using SPI serial interface.

Parameters
[in]ctx: Click context object. See bargraph4_t object definition for detailed explanation.
[out]ch_mask: Output read bit mask.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function doesn't affect the channels output state.

◆ bargraph4_set_channel_level()

err_t bargraph4_set_channel_level ( bargraph4_t * ctx,
bargraph4_sel_ch_t channel,
bargraph4_level_t level )

BarGraph 4 set channel level function.

This function sets the level of a desired bar graph channel.

Parameters
[in]ctx: Click context object. See bargraph4_t object definition for detailed explanation.
[in]channel: Channel selection. See bargraph4_sel_ch_t enum definition for detailed explanation.
[in]level: Level selection. See bargraph4_level_t enum definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function doesn't affect other channels output state.

◆ bargraph4_set_output()

err_t bargraph4_set_output ( bargraph4_t * ctx,
uint16_t ch_mask )

BarGraph 4 set output function.

This function sets all outputs to desired value by using SPI serial interface.

Parameters
[in]ctx: Click context object. See bargraph4_t object definition for detailed explanation.
[in]ch_mask: Output write bit mask.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function affects all channel outputs.