bargraph2 2.0.0.0

Functions

void bargraph2_cfg_setup (bargraph2_cfg_t *cfg)
 Config Object Initialization function.
 
BARGRAPH2_RETVAL bargraph2_init (bargraph2_t *ctx, bargraph2_cfg_t *cfg)
 Initialization function.
 
void bargraph2_default_cfg (bargraph2_t *ctx)
 Click Default Configuration function.
 
void bargraph2_generic_transfer (bargraph2_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
void bargraph2_reset (bargraph2_t *ctx)
 Reset function.
 
void bargraph2_write_byte (bargraph2_t *ctx, uint8_t input_data)
 Write byte function.
 
void bargraph2_led_green (bargraph2_t *ctx, uint8_t index)
 LED green function.
 
void bargraph2_led_red (bargraph2_t *ctx, uint8_t index)
 LED red function.
 
void bargraph2_led_yellow (bargraph2_t *ctx, uint8_t index)
 LED yellow function.
 
void bargraph2_leds_green (bargraph2_t *ctx, int start_index, int end_index)
 LEDs green function.
 
void bargraph2_leds_red (bargraph2_t *ctx, int start_index, int end_index)
 LEDs red function.
 
void bargraph2_leds_yellow (bargraph2_t *ctx, int start_index, int end_index)
 LEDs red function.
 
void bargraph2_lights_out (bargraph2_t *ctx)
 Lights out function.
 
void barpgraph2_power (bargraph2_t *ctx, uint8_t power_on_off)
 Lights out function.
 

Detailed Description

Function Documentation

◆ bargraph2_cfg_setup()

void bargraph2_cfg_setup ( bargraph2_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ bargraph2_default_cfg()

void bargraph2_default_cfg ( bargraph2_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Bargraph 2 click.

◆ bargraph2_generic_transfer()

void bargraph2_generic_transfer ( bargraph2_t * ctx,
uint8_t * wr_buf,
uint16_t wr_len,
uint8_t * rd_buf,
uint16_t rd_len )

Generic transfer function.

Parameters
ctxClick object.
wr_bufWrite data buffer
wr_lenNumber of byte in write data buffer
rd_bufRead data buffer
rd_lenNumber of byte in read data buffer

@description Generic SPI transfer, for sending and receiving packages

◆ bargraph2_init()

BARGRAPH2_RETVAL bargraph2_init ( bargraph2_t * ctx,
bargraph2_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ bargraph2_led_green()

void bargraph2_led_green ( bargraph2_t * ctx,
uint8_t index )

LED green function.

Parameters
ctxClick object.
indexIndex variable.
Note
LED register layout: (24th bit) 3 [MSB, LSB], 2 [MSB, LSB], 1 [MSB, LSB] (1st bit) Green LEDs: From 1 to 10. (REG_1: 8, REG_2: 2)

@description This function turns on the green LED diode of the chosen segment.

◆ bargraph2_led_red()

void bargraph2_led_red ( bargraph2_t * ctx,
uint8_t index )

LED red function.

Parameters
ctxClick object.
indexIndex variable.
Note
LED register layout: (24th bit) 3 [MSB, LSB], 2 [MSB, LSB], 1 [MSB, LSB] (1st bit) Red LEDs: From 11 to 20. (REG_2: 6, REG_3: 4)

@description This function turns on the red LED diode of the chosen segment.

◆ bargraph2_led_yellow()

void bargraph2_led_yellow ( bargraph2_t * ctx,
uint8_t index )

LED yellow function.

Parameters
ctxClick object.
indexIndex variable.
Note
LED register layout: (24th bit) 3 [MSB, LSB], 2 [MSB, LSB], 1 [MSB, LSB] (1st bit)

@description This function turns on the green & red (yellow light) LED diode of the chosen segment.

◆ bargraph2_leds_green()

void bargraph2_leds_green ( bargraph2_t * ctx,
int start_index,
int end_index )

LEDs green function.

Parameters
ctxClick object.
start_indexIndex variable.
end_indexEnd variable.

@description This function turns on green LED diodes from the starting index to the end index.

◆ bargraph2_leds_red()

void bargraph2_leds_red ( bargraph2_t * ctx,
int start_index,
int end_index )

LEDs red function.

Parameters
ctxClick object.
start_indexIndex variable.
end_indexEnd variable.

@description This function turns on red LED diodes from the starting index to the end index.

◆ bargraph2_leds_yellow()

void bargraph2_leds_yellow ( bargraph2_t * ctx,
int start_index,
int end_index )

LEDs red function.

Parameters
ctxClick object.
start_indexIndex variable.
end_indexEnd variable.

@description This function turns on green & red (yellow light) LED diodes from the starting index to the end index.

◆ bargraph2_lights_out()

void bargraph2_lights_out ( bargraph2_t * ctx)

Lights out function.

Parameters
ctxClick object.

@description This function turns off all the LED diodes.

◆ bargraph2_reset()

void bargraph2_reset ( bargraph2_t * ctx)

Reset function.

Parameters
ctxClick object.

@description This function does a reset of the click module.

◆ bargraph2_write_byte()

void bargraph2_write_byte ( bargraph2_t * ctx,
uint8_t input_data )

Write byte function.

Parameters
ctxClick object.
input_dataInput data variable.

@description This function writes one byte of data.

◆ barpgraph2_power()

void barpgraph2_power ( bargraph2_t * ctx,
uint8_t power_on_off )

Lights out function.

Parameters
ctxClick object.
power_on_ofPower state ON/OFF

@description This function turns off all the LED diodes.