ledring2 2.1.0.0
ledring2.h File Reference

This file contains API for LED Ring 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  ledring2_t
 LED Ring 2 Click context object. More...
 
struct  ledring2_cfg_t
 LED Ring 2 Click configuration object. More...
 

Macros

#define LEDRING2_REG_CHIP_EN   0x0000
 LED Ring 2 description register.
 
#define LEDRING2_REG_DEV_INITIAL   0x0001
 
#define LEDRING2_REG_DEV_CONFIG1   0x0002
 
#define LEDRING2_REG_DEV_CONFIG2   0x0003
 
#define LEDRING2_REG_DEV_CONFIG3   0x0004
 
#define LEDRING2_REG_GLOBAL_BRI   0x0005
 
#define LEDRING2_REG_GROUP0_BRI   0x0006
 
#define LEDRING2_REG_GROUP1_BRI   0x0007
 
#define LEDRING2_REG_GROUP2_BRI   0x0008
 
#define LEDRING2_REG_R_CURRENT_SET   0x0009
 
#define LEDRING2_REG_G_CURRENT_SET   0x000A
 
#define LEDRING2_REG_B_CURRENT_SET   0x000B
 
#define LEDRING2_REG_DOT_GRP_SEL0   0x000C
 
#define LEDRING2_REG_DOT_GRP_SEL1   0x000D
 
#define LEDRING2_REG_DOT_GRP_SEL2   0x000E
 
#define LEDRING2_REG_DOT_GRP_SEL3   0x000F
 
#define LEDRING2_REG_DOT_GRP_SEL4   0x0010
 
#define LEDRING2_REG_DOT_GRP_SEL5   0x0011
 
#define LEDRING2_REG_DOT_GRP_SEL6   0x0012
 
#define LEDRING2_REG_DOT_GRP_SEL7   0x0013
 
#define LEDRING2_REG_DOT_GRP_SEL8   0x0014
 
#define LEDRING2_REG_DOT_GRP_SEL9   0x0015
 
#define LEDRING2_REG_DOT_ONOFF0   0x0043
 
#define LEDRING2_REG_DOT_ONOFF1   0x0044
 
#define LEDRING2_REG_DOT_ONOFF2   0x0045
 
#define LEDRING2_REG_DOT_ONOFF3   0x0046
 
#define LEDRING2_REG_DOT_ONOFF4   0x0047
 
#define LEDRING2_REG_DOT_ONOFF5   0x0048
 
#define LEDRING2_REG_FAULT_STATE   0x0064
 
#define LEDRING2_REG_DOT_LOD0   0x0065
 
#define LEDRING2_REG_DOT_LOD1   0x0066
 
#define LEDRING2_REG_DOT_LOD2   0x0067
 
#define LEDRING2_REG_DOT_LOD3   0x0068
 
#define LEDRING2_REG_DOT_LOD4   0x0069
 
#define LEDRING2_REG_DOT_LOD5   0x006A
 
#define LEDRING2_REG_DOT_LSD0   0x0086
 
#define LEDRING2_REG_DOT_LSD1   0x0087
 
#define LEDRING2_REG_DOT_LSD2   0x0088
 
#define LEDRING2_REG_DOT_LSD3   0x0089
 
#define LEDRING2_REG_DOT_LSD4   0x008A
 
#define LEDRING2_REG_DOT_LSD5   0x008B
 
#define LEDRING2_REG_LOD_CLEAR   0x00A7
 
#define LEDRING2_REG_LSD_CLEAR   0x00A8
 
#define LEDRING2_REG_RESET   0x00A9
 
#define LEDRING2_REG_DC0   0x0100
 
#define LEDRING2_REG_DC1   0x0101
 
#define LEDRING2_REG_DC2   0x0102
 
#define LEDRING2_REG_DC3   0x0103
 
#define LEDRING2_REG_DC4   0x0104
 
#define LEDRING2_REG_DC5   0x0105
 
#define LEDRING2_REG_DC6   0x0106
 
#define LEDRING2_REG_DC7   0x0107
 
#define LEDRING2_REG_DC8   0x0108
 
#define LEDRING2_REG_DC9   0x0109
 
#define LEDRING2_REG_DC10   0x010A
 
#define LEDRING2_REG_DC11   0x010B
 
#define LEDRING2_REG_DC12   0x010C
 
#define LEDRING2_REG_DC13   0x010D
 
#define LEDRING2_REG_DC14   0x010E
 
#define LEDRING2_REG_DC15   0x010F
 
#define LEDRING2_REG_DC16   0x0110
 
#define LEDRING2_REG_DC17   0x0111
 
#define LEDRING2_REG_DC18   0x0112
 
#define LEDRING2_REG_DC19   0x0113
 
#define LEDRING2_REG_DC20   0x0114
 
#define LEDRING2_REG_DC21   0x0115
 
#define LEDRING2_REG_DC22   0x0116
 
#define LEDRING2_REG_DC23   0x0117
 
#define LEDRING2_REG_DC24   0x0118
 
#define LEDRING2_REG_DC25   0x0119
 
#define LEDRING2_REG_DC26   0x011A
 
#define LEDRING2_REG_DC27   0x011B
 
#define LEDRING2_REG_DC28   0x011C
 
#define LEDRING2_REG_DC29   0x011D
 
#define LEDRING2_REG_DC30   0x011E
 
#define LEDRING2_REG_DC31   0x011F
 
#define LEDRING2_REG_DC32   0x0120
 
#define LEDRING2_REG_DC33   0x0121
 
#define LEDRING2_REG_DC34   0x0122
 
#define LEDRING2_REG_DC35   0x0123
 
#define LEDRING2_REG_PWM_BRI0   0x0200
 
#define LEDRING2_REG_PWM_BRI1   0x0201
 
#define LEDRING2_REG_PWM_BRI2   0x0202
 
#define LEDRING2_REG_PWM_BRI3   0x0203
 
#define LEDRING2_REG_PWM_BRI4   0x0204
 
#define LEDRING2_REG_PWM_BRI5   0x0205
 
#define LEDRING2_REG_PWM_BRI6   0x0206
 
#define LEDRING2_REG_PWM_BRI7   0x0207
 
#define LEDRING2_REG_PWM_BRI8   0x0208
 
#define LEDRING2_REG_PWM_BRI9   0x0209
 
#define LEDRING2_REG_PWM_BRI10   0x020A
 
#define LEDRING2_REG_PWM_BRI11   0x020B
 
#define LEDRING2_REG_PWM_BRI12   0x020C
 
#define LEDRING2_REG_PWM_BRI13   0x020D
 
#define LEDRING2_REG_PWM_BRI14   0x020E
 
#define LEDRING2_REG_PWM_BRI15   0x020F
 
#define LEDRING2_REG_PWM_BRI16   0x0210
 
#define LEDRING2_REG_PWM_BRI17   0x0211
 
#define LEDRING2_REG_PWM_BRI18   0x0212
 
#define LEDRING2_REG_PWM_BRI19   0x0213
 
#define LEDRING2_REG_PWM_BRI20   0x0214
 
#define LEDRING2_REG_PWM_BRI21   0x0215
 
#define LEDRING2_REG_PWM_BRI22   0x0216
 
#define LEDRING2_REG_PWM_BRI23   0x0217
 
#define LEDRING2_REG_PWM_BRI24   0x0218
 
#define LEDRING2_REG_PWM_BRI25   0x0219
 
#define LEDRING2_REG_PWM_BRI26   0x021A
 
#define LEDRING2_REG_PWM_BRI27   0x021B
 
#define LEDRING2_REG_PWM_BRI28   0x021C
 
#define LEDRING2_REG_PWM_BRI29   0x021D
 
#define LEDRING2_REG_PWM_BRI30   0x021E
 
#define LEDRING2_REG_PWM_BRI31   0x021F
 
#define LEDRING2_REG_PWM_BRI32   0x0220
 
#define LEDRING2_REG_PWM_BRI33   0x0221
 
#define LEDRING2_REG_PWM_BRI34   0x0222
 
#define LEDRING2_REG_PWM_BRI35   0x0223
 
#define LEDRING2_REG_PWM_BRI36   0x0224
 
#define LEDRING2_REG_PWM_BRI37   0x0225
 
#define LEDRING2_REG_PWM_BRI38   0x0226
 
#define LEDRING2_REG_PWM_BRI39   0x0227
 
#define LEDRING2_REG_PWM_BRI40   0x0228
 
#define LEDRING2_REG_PWM_BRI41   0x0229
 
#define LEDRING2_REG_PWM_BRI42   0x022A
 
#define LEDRING2_REG_PWM_BRI43   0x022B
 
#define LEDRING2_REG_PWM_BRI44   0x022C
 
#define LEDRING2_REG_PWM_BRI45   0x022D
 
#define LEDRING2_REG_PWM_BRI46   0x022E
 
#define LEDRING2_REG_PWM_BRI47   0x022F
 
#define LEDRING2_REG_PWM_BRI48   0x0230
 
#define LEDRING2_REG_PWM_BRI49   0x0231
 
#define LEDRING2_REG_PWM_BRI50   0x0232
 
#define LEDRING2_REG_PWM_BRI51   0x0233
 
#define LEDRING2_REG_PWM_BRI52   0x0234
 
#define LEDRING2_REG_PWM_BRI53   0x0235
 
#define LEDRING2_REG_PWM_BRI54   0x0236
 
#define LEDRING2_REG_PWM_BRI55   0x0237
 
#define LEDRING2_REG_PWM_BRI56   0x0238
 
#define LEDRING2_REG_PWM_BRI57   0x0239
 
#define LEDRING2_REG_PWM_BRI58   0x023A
 
#define LEDRING2_REG_PWM_BRI59   0x023B
 
#define LEDRING2_REG_PWM_BRI60   0x023C
 
#define LEDRING2_REG_PWM_BRI61   0x023D
 
#define LEDRING2_REG_PWM_BRI62   0x023E
 
#define LEDRING2_REG_PWM_BRI63   0x023F
 
#define LEDRING2_REG_PWM_BRI64   0x0240
 
#define LEDRING2_REG_PWM_BRI65   0x0241
 
#define LEDRING2_REG_PWM_BRI66   0x0242
 
#define LEDRING2_REG_PWM_BRI67   0x0243
 
#define LEDRING2_REG_PWM_BRI68   0x0244
 
#define LEDRING2_REG_PWM_BRI69   0x0245
 
#define LEDRING2_REG_PWM_BRI70   0x0246
 
#define LEDRING2_REG_PWM_BRI71   0x0247
 
#define LEDRING2_8_9_BIT_MASK   0x00003
 LED Ring 2 description setting.
 
#define LEDRING2_LED_DISABLE   0x00
 
#define LEDRING2_LED_ENABLE   0x01
 
#define LEDRING2_OP_MODE_1   0x01
 
#define LEDRING2_OP_MODE_2   0x02
 
#define LEDRING2_OP_MODE_3   0x03
 
#define LEDRING2_LED_GROUP_U1_LED_1_18   0x40
 LED Ring 2 device address setting.
 
#define LEDRING2_LED_GROUP_U2_LED_19_36   0x44
 
#define LEDRING2_LED_GROUP_U3_LED_37_54   0x48
 
#define LEDRING2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  ledring2_return_value_t { LEDRING2_OK = 0 , LEDRING2_ERROR = -1 }
 LED Ring 2 Click return value data. More...
 
enum  ledring2_led_state_t { LEDRING2_LED_OFF = 0 , LEDRING2_LED_ON }
 LED Ring 2 Click LED state data. More...
 

Functions

void ledring2_cfg_setup (ledring2_cfg_t *cfg)
 LED Ring 2 configuration object setup function.
 
err_t ledring2_init (ledring2_t *ctx, ledring2_cfg_t *cfg)
 LED Ring 2 initialization function.
 
err_t ledring2_default_cfg (ledring2_t *ctx)
 LED Ring 2 default configuration function.
 
err_t ledring2_set_slave_address (ledring2_t *ctx, uint8_t slave_address)
 Set I2C Slave address.
 
err_t ledring2_write_reg (ledring2_t *ctx, uint8_t led_group, uint16_t reg, uint8_t *data_in, uint8_t len)
 LED Ring 2 write register function.
 
err_t ledring2_read_reg (ledring2_t *ctx, uint8_t led_group, uint16_t reg, uint8_t *data_out, uint8_t len)
 LED Ring 2 read registe function.
 
void ledring2_set_vsync (ledring2_t *ctx)
 LED Ring 2 read registe function.
 
err_t ledring2_enable (ledring2_t *ctx)
 LED Ring 2 enable function.
 
err_t ledring2_disable (ledring2_t *ctx)
 LED Ring 2 disable function.
 
err_t ledring2_set_all_led_state (ledring2_t *ctx, ledring2_led_state_t led_state)
 LED Ring 2 set all LED state function.
 
err_t ledring2_set_led_pos_state (ledring2_t *ctx, uint8_t led_pos, ledring2_led_state_t led_state)
 LED Ring 2 set LED state function.
 
err_t ledring2_set_led_brightness (ledring2_t *ctx, uint8_t led_pos, uint16_t led_brightness)
 LED Ring 2 set LED brightness function.
 

Detailed Description

This file contains API for LED Ring 2 Click Driver.

Enumeration Type Documentation

◆ ledring2_led_state_t

LED Ring 2 Click LED state data.

Predefined enum values for driver LED state values.

Enumerator
LEDRING2_LED_OFF 
LEDRING2_LED_ON 

◆ ledring2_return_value_t

LED Ring 2 Click return value data.

Predefined enum values for driver return values.

Enumerator
LEDRING2_OK 
LEDRING2_ERROR