bargraph5  2.1.0.0
Modules | Functions
BarGraph 5 Click Driver

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

Modules

 BarGraph 5 Registers Settings
 Settings for registers of BarGraph 5 Click driver.
 
 BarGraph 5 MikroBUS Map
 MikroBUS pin mapping of BarGraph 5 Click driver.
 

Functions

void bargraph5_cfg_setup (bargraph5_cfg_t *cfg)
 BarGraph 5 configuration object setup function. More...
 
err_t bargraph5_init (bargraph5_t *ctx, bargraph5_cfg_t *cfg)
 BarGraph 5 initialization function. More...
 
err_t bargraph5_default_cfg (bargraph5_t *ctx)
 BarGraph 5 default configuration function. More...
 
err_t bargraph5_write_channels (bargraph5_t *ctx)
 BarGraph 5 write channels function. More...
 
err_t bargraph5_read_channels (bargraph5_t *ctx)
 BarGraph 5 read channels function. More...
 
void bargraph5_output_enable (bargraph5_t *ctx)
 BarGraph 5 output enable function. More...
 
void bargraph5_output_disable (bargraph5_t *ctx)
 BarGraph 5 output disable function. More...
 
err_t bargraph5_set_bar_level (bargraph5_t *ctx, bargraph5_bar_sel_t bar_num, bargraph5_level_t level, uint16_t brightness)
 BarGraph 5 set bar level function. More...
 

Detailed Description

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

◆ bargraph5_cfg_setup()

void bargraph5_cfg_setup ( bargraph5_cfg_t cfg)

BarGraph 5 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ bargraph5_default_cfg()

err_t bargraph5_default_cfg ( bargraph5_t ctx)

BarGraph 5 default configuration function.

This function executes a default configuration of BarGraph 5 click board.

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

◆ bargraph5_init()

err_t bargraph5_init ( bargraph5_t ctx,
bargraph5_cfg_t cfg 
)

BarGraph 5 initialization function.

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

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

◆ bargraph5_output_disable()

void bargraph5_output_disable ( bargraph5_t ctx)

BarGraph 5 output disable function.

This function disables the BarGraph LEDs output by setting the BLANK pin to high logic state.

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

◆ bargraph5_output_enable()

void bargraph5_output_enable ( bargraph5_t ctx)

BarGraph 5 output enable function.

This function enables the BarGraph LEDs output by setting the BLANK pin to low logic state.

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

◆ bargraph5_read_channels()

err_t bargraph5_read_channels ( bargraph5_t ctx)

BarGraph 5 read channels function.

This function reads all 24 output channels by using SPI serial interface and stores the results in the ctx->channels array.

Parameters
[in]ctx: Click context object. See bargraph5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The bargraph5_write_channels will be executed upon successful reading to preserve channels config.

◆ bargraph5_set_bar_level()

err_t bargraph5_set_bar_level ( bargraph5_t ctx,
bargraph5_bar_sel_t  bar_num,
bargraph5_level_t  level,
uint16_t  brightness 
)

BarGraph 5 set bar level function.

This function sets the level of a selected BarGraph channel at the selected brightness.

Parameters
[in]ctx: Click context object. See bargraph5_t object definition for detailed explanation.
[in]bar_num: Bar channel selection [0-5]. See bargraph5_bar_sel_t enum definition for detailed explanation.
[in]level: Bar level selection [0-4]. See bargraph5_level_t enum definition for detailed explanation.
[in]brightness: Bar level brightness [0-4095].
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function does not affect other BarGraphs state.

◆ bargraph5_write_channels()

err_t bargraph5_write_channels ( bargraph5_t ctx)

BarGraph 5 write channels function.

This function writes all 24 output channels from the ctx->channels array by using SPI serial interface.

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