c7seg2 2.1.0.0
c7seg2.h File Reference

This file contains API for 7-SEG 2 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  c7seg2_t
 7-SEG 2 Click context object. More...
 
struct  c7seg2_cfg_t
 7-SEG 2 Click configuration object. More...
 

Macros

#define C7SEG2_REG_DEVICE_ID   0x00
 7-SEG 2 description register.
 
#define C7SEG2_REG_DEVICE_EN   0x01
 
#define C7SEG2_REG_CH_EN_LOW   0x02
 
#define C7SEG2_REG_CH_EN_HIGH   0x03
 
#define C7SEG2_REG_CONFIG   0x04
 
#define C7SEG2_REG_FAULT_MASK   0x05
 
#define C7SEG2_REG_FAULT_INT   0x06
 
#define C7SEG2_REG_OPEN_LED_LOW   0x07
 
#define C7SEG2_REG_OPEN_LED_HIGH   0x08
 
#define C7SEG2_REG_CUR_LED_CS0   0x09
 
#define C7SEG2_REG_CUR_LED_CS1   0x0A
 
#define C7SEG2_REG_CUR_LED_CS2   0x0B
 
#define C7SEG2_REG_CUR_LED_CS3   0x0C
 
#define C7SEG2_REG_CUR_LED_CS4   0x0D
 
#define C7SEG2_REG_CUR_LED_CS5   0x0E
 
#define C7SEG2_REG_CUR_LED_CS6   0x0F
 
#define C7SEG2_REG_CUR_LED_CS7   0x10
 
#define C7SEG2_REG_CUR_LED_CS8   0x11
 
#define C7SEG2_REG_CUR_LED_CS9   0x12
 
#define C7SEG2_REG_CUR_LED_CS10   0x13
 
#define C7SEG2_REG_CUR_LED_CS11   0x14
 
#define C7SEG2_REG_PATTERN_SEQ_REP   0x15
 
#define C7SEG2_REG_PATTERN_0_DUR   0x16
 
#define C7SEG2_REG_PATTERN_1_DUR   0x17
 
#define C7SEG2_REG_PATTERN_2_DUR   0x18
 
#define C7SEG2_REG_PATTERN_3_DUR   0x19
 
#define C7SEG2_REG_PATTERN_4_DUR   0x1A
 
#define C7SEG2_REG_PATTERN_5_DUR   0x1B
 
#define C7SEG2_REG_PATTERN_6_DUR   0x1C
 
#define C7SEG2_REG_PATTERN_7_DUR   0x1D
 
#define C7SEG2_REG_PWMREG_OFFSET   0x1E
 
#define C7SEG2_REG_CLOCK_CONFIG   0xE0
 
#define C7SEG2_SEGMENT_0   0
 7-SEG 2 segments setting.
 
#define C7SEG2_SEGMENT_1   1
 
#define C7SEG2_SEGMENT_2   2
 
#define C7SEG2_SEGMENTS_NUMBER   3
 
#define C7SEG2_SEGMENTS_DISABLED   0x0000u
 
#define C7SEG2_DP_NONE   0
 7-SEG 2 decimal point setting.
 
#define C7SEG2_DP_AT_SEGMENT_0   1
 
#define C7SEG2_DP_AT_SEGMENT_1   2
 
#define C7SEG2_DP_AT_SEGMENT_2   3
 
#define C7SEG2_DP_MASK   0x03
 
#define C7SEG2_DP_PIN_MASK   0x0010u
 
#define C7SEG2_REFRESH_RATE_US   7500
 7-SEG 2 refresh rate setting.
 
#define C7SEG2_REFRESH_RATE_DELAY   ( C7SEG2_REFRESH_RATE_US / 50 )
 
#define C7SEG2_DIGIT_0   0
 7-SEG 2 digits and numbers setting.
 
#define C7SEG2_DIGIT_1   1
 
#define C7SEG2_DIGIT_2   2
 
#define C7SEG2_DIGIT_3   3
 
#define C7SEG2_DIGIT_4   4
 
#define C7SEG2_DIGIT_5   5
 
#define C7SEG2_DIGIT_6   6
 
#define C7SEG2_DIGIT_7   7
 
#define C7SEG2_DIGIT_8   8
 
#define C7SEG2_DIGIT_9   9
 
#define C7SEG2_DIGITS_NUMBER   10
 
#define C7SEG2_MAX_NUMBER   999
 
#define C7SEG2_DEVICE_ID   0x12
 7-SEG 2 description setting.
 
#define C7SEG2_SW_RESET   0x80
 7-SEG 2 device state setting.
 
#define C7SEG2_ENABLE   0x01
 
#define C7SEG2_CURRENT_DEFAULT   15.0f
 7-SEG 2 current calculation setting.
 
#define C7SEG2_CURRENT_STEP_TO_HEX   12.75f
 
#define C7SEG2_DEVICE_ADDRESS   0x58
 7-SEG 2 device address setting.
 
#define C7SEG2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  c7seg2_return_value_t { C7SEG2_OK = 0 , C7SEG2_ERROR = -1 }
 7-SEG 2 Click return value data. More...
 

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

This file contains API for 7-SEG 2 Click Driver.

Enumeration Type Documentation

◆ c7seg2_return_value_t

7-SEG 2 Click return value data.

Predefined enum values for driver return values.

Enumerator
C7SEG2_OK 
C7SEG2_ERROR