c7seg2 2.1.0.0
7-SEG 2 Click Driver

API for configuring and manipulating 7-SEG 2 Click driver. More...

Topics

 7-SEG 2 Registers List
 List of registers of 7-SEG 2 Click driver.
 
 7-SEG 2 Registers Settings
 Settings for registers of 7-SEG 2 Click driver.
 
 7-SEG 2 MikroBUS Map
 MikroBUS pin mapping of 7-SEG 2 Click driver.
 

Functions

void c7seg2_cfg_setup (c7seg2_cfg_t *cfg)
 7-SEG 2 configuration object setup function.
 
err_t c7seg2_init (c7seg2_t *ctx, c7seg2_cfg_t *cfg)
 7-SEG 2 initialization function.
 
err_t c7seg2_sw_reset (c7seg2_t *ctx)
 7-SEG 2 software reset function.
 
err_t c7seg2_default_cfg (c7seg2_t *ctx)
 7-SEG 2 default configuration function.
 
err_t c7seg2_generic_write (c7seg2_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 7-SEG 2 I2C writing function.
 
err_t c7seg2_generic_read (c7seg2_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 7-SEG 2 I2C reading function.
 
uint8_t c7seg2_get_int_pin (c7seg2_t *ctx)
 7-SEG 2 get interrupt pin state function.
 
err_t c7seg2_write_reg (c7seg2_t *ctx, uint8_t reg, uint8_t data_in)
 7-SEG 2 I2C register writing function.
 
err_t c7seg2_read_reg (c7seg2_t *ctx, uint8_t reg, uint8_t *data_out)
 7-SEG 2 I2C register reading function.
 
err_t c7seg2_set_segments_current (c7seg2_t *ctx, float current_val)
 7-SEG 2 set segments current value function.
 
err_t c7seg2_write_segment (c7seg2_t *ctx, uint8_t segment, uint8_t number, uint8_t dpt)
 7-SEG 2 single segment writing function.
 
err_t c7seg2_disable_segments (c7seg2_t *ctx)
 7-SEG 2 disable segments function.
 
err_t c7seg2_write_number (c7seg2_t *ctx, uint16_t number, uint8_t dpt)
 7-SEG 2 number writing function.
 

Detailed Description

API for configuring and manipulating 7-SEG 2 Click driver.

7-SEG 2 Click segment number.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Predefined enum values for segment number values.

API for configuring and manipulating 7-SEG 2 Click driver.

Function Documentation

◆ c7seg2_cfg_setup()

void c7seg2_cfg_setup ( c7seg2_cfg_t * cfg)

7-SEG 2 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ c7seg2_default_cfg()

err_t c7seg2_default_cfg ( c7seg2_t * ctx)

7-SEG 2 default configuration function.

This function executes a default configuration of 7-SEG 2 click board.

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

◆ c7seg2_disable_segments()

err_t c7seg2_disable_segments ( c7seg2_t * ctx)

7-SEG 2 disable segments function.

This function is used to disable channel output.

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

◆ c7seg2_generic_read()

err_t c7seg2_generic_read ( c7seg2_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

7-SEG 2 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 c7seg2_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.

◆ c7seg2_generic_write()

err_t c7seg2_generic_write ( c7seg2_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

7-SEG 2 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 c7seg2_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.

◆ c7seg2_get_int_pin()

uint8_t c7seg2_get_int_pin ( c7seg2_t * ctx)

7-SEG 2 get interrupt pin state function.

This function reads an interrupt pin state.

Parameters
[in]ctx: Click context object. See c7seg2_t object definition for detailed explanation.
Returns
Interrupt pin state.
Note
None.

◆ c7seg2_init()

err_t c7seg2_init ( c7seg2_t * ctx,
c7seg2_cfg_t * cfg )

7-SEG 2 initialization function.

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

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

◆ c7seg2_read_reg()

err_t c7seg2_read_reg ( c7seg2_t * ctx,
uint8_t reg,
uint8_t * data_out )

7-SEG 2 I2C register reading function.

This function reads a byte of data in the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See c7seg2_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Data to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c7seg2_set_segments_current()

err_t c7seg2_set_segments_current ( c7seg2_t * ctx,
float current_val )

7-SEG 2 set segments current value function.

This function is used to set the current value of the segment's leds.

Parameters
[in]ctx: Click context object. See c7seg2_t object definition for detailed explanation.
[in]current_val: Current value in mA [up to 20mA].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c7seg2_sw_reset()

err_t c7seg2_sw_reset ( c7seg2_t * ctx)

7-SEG 2 software reset function.

This function is used to perform a software reset.

Parameters
[in]ctx: Click context object. See c7seg2_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
All the set register values will be reset to factory values after using this function.

◆ c7seg2_write_number()

err_t c7seg2_write_number ( c7seg2_t * ctx,
uint16_t number,
uint8_t dpt )

7-SEG 2 number writing function.

This function is used to write a number [0..999] to a selected segment [0..2] with or w/o a decimal pointer.

Parameters
[in]ctx: Click context object. See c7seg2_t object definition for detailed explanation.
[in]number: Number to be displayed [0..999].
[in]dpt: Decimal point [1..3], [0] if none.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function must be called as frequently as possible in order for a number to be displayed properly.

◆ c7seg2_write_reg()

err_t c7seg2_write_reg ( c7seg2_t * ctx,
uint8_t reg,
uint8_t data_in )

7-SEG 2 I2C register writing function.

This function writes a byte of data in the selected register by using I2C serial interface.

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

◆ c7seg2_write_segment()

err_t c7seg2_write_segment ( c7seg2_t * ctx,
uint8_t segment,
uint8_t number,
uint8_t dpt )

7-SEG 2 single segment writing function.

This function is used to write a number [0..9] to a selected segment [0..2] with or w/o a decimal pointer.

Parameters
[in]ctx: Click context object. See c7seg2_t object definition for detailed explanation.
[in]segment: Segment number [0..2].
[in]number: Number to be displayed [0..9].
[in]dpt: Decimal point [0..1].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.