leddriver19 2.1.0.0
leddriver19.h File Reference

This file contains API for LED Driver 19 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  leddriver19_t
 LED Driver 19 Click context object. More...
 
struct  leddriver19_cfg_t
 LED Driver 19 Click configuration object. More...
 

Macros

#define LEDDRIVER19_REG_DEVICE_ID   0x00
 LED Driver 19 description register.
 
#define LEDDRIVER19_REG_DEVICE_EN   0x01
 
#define LEDDRIVER19_REG_CH_EN_LOW   0x02
 
#define LEDDRIVER19_REG_CH_EN_HIGH   0x03
 
#define LEDDRIVER19_REG_CONFIG   0x04
 
#define LEDDRIVER19_REG_FAULT_MASK   0x05
 
#define LEDDRIVER19_REG_FAULT_INT   0x06
 
#define LEDDRIVER19_REG_OPEN_LED_LOW   0x07
 
#define LEDDRIVER19_REG_OPEN_LED_HIGH   0x08
 
#define LEDDRIVER19_REG_CUR_LED_CS0   0x09
 
#define LEDDRIVER19_REG_CUR_LED_CS1   0x0A
 
#define LEDDRIVER19_REG_CUR_LED_CS2   0x0B
 
#define LEDDRIVER19_REG_CUR_LED_CS3   0x0C
 
#define LEDDRIVER19_REG_CUR_LED_CS4   0x0D
 
#define LEDDRIVER19_REG_CUR_LED_CS5   0x0E
 
#define LEDDRIVER19_REG_CUR_LED_CS6   0x0F
 
#define LEDDRIVER19_REG_CUR_LED_CS7   0x10
 
#define LEDDRIVER19_REG_CUR_LED_CS8   0x11
 
#define LEDDRIVER19_REG_CUR_LED_CS9   0x12
 
#define LEDDRIVER19_REG_CUR_LED_CS10   0x13
 
#define LEDDRIVER19_REG_CUR_LED_CS11   0x14
 
#define LEDDRIVER19_REG_PATTERN_SEQ_REP   0x15
 
#define LEDDRIVER19_REG_PATTERN_0_DUR   0x16
 
#define LEDDRIVER19_REG_PATTERN_1_DUR   0x17
 
#define LEDDRIVER19_REG_PATTERN_2_DUR   0x18
 
#define LEDDRIVER19_REG_PATTERN_3_DUR   0x19
 
#define LEDDRIVER19_REG_PATTERN_4_DUR   0x1A
 
#define LEDDRIVER19_REG_PATTERN_5_DUR   0x1B
 
#define LEDDRIVER19_REG_PATTERN_6_DUR   0x1C
 
#define LEDDRIVER19_REG_PATTERN_7_DUR   0x1D
 
#define LEDDRIVER19_REG_PWMREG_OFFSET   0x1E
 
#define LEDDRIVER19_REG_CLOCK_CONFIG   0xE0
 
#define LEDDRIVER19_DEVICE_ID   0x12
 LED Driver 19 description setting.
 
#define LEDDRIVER19_PIN_STATE_HIGH   0x01
 LED Driver 19 pin state setting.
 
#define LEDDRIVER19_PIN_STATE_LOW   0x00
 
#define LEDDRIVER19_SW_RESET   0x80
 LED Driver 19 device state setting.
 
#define LEDDRIVER19_ENABLE   0x01
 
#define LEDDRIVER19_PATSEL_0   0x00
 LED Driver 19 pattern state setting.
 
#define LEDDRIVER19_PATSEL_1   0x01
 
#define LEDDRIVER19_PATSEL_2   0x02
 
#define LEDDRIVER19_PATSEL_3   0x03
 
#define LEDDRIVER19_PATSEL_4   0x04
 
#define LEDDRIVER19_PATSEL_5   0x05
 
#define LEDDRIVER19_PATSEL_6   0x06
 
#define LEDDRIVER19_PATSEL_7   0x07
 
#define LEDDRIVER19_CH_SEL_0   0x00
 LED Driver 19 channel enable setting.
 
#define LEDDRIVER19_CH_SEL_1   0x01
 
#define LEDDRIVER19_CH_SEL_2   0x02
 
#define LEDDRIVER19_CH_SEL_3   0x03
 
#define LEDDRIVER19_CH_SEL_4   0x04
 
#define LEDDRIVER19_CH_SEL_5   0x05
 
#define LEDDRIVER19_CH_SEL_6   0x06
 
#define LEDDRIVER19_CH_SEL_7   0x07
 
#define LEDDRIVER19_CH_SEL_8   0x08
 
#define LEDDRIVER19_CH_SEL_9   0x09
 
#define LEDDRIVER19_CH_SEL_10   0x0A
 
#define LEDDRIVER19_CH_SEL_11   0x0B
 
#define LEDDRIVER19_SHFT_EN   0x08
 LED Driver 19 config setting.
 
#define LEDDRIVER19_SHFT_DIS   0x00
 
#define LEDDRIVER19_GCTRL_EN   0x01
 
#define LEDDRIVER19_GCTRL_DIS   0x00
 
#define LEDDRIVER19_PATSR_RUNING   0x01
 
#define LEDDRIVER19_PATSR_DONE   0x00
 
#define LEDDRIVER19_PATS_EN   0x01
 
#define LEDDRIVER19_PATS_DIS   0x00
 
#define LEDDRIVER19_OVTP_MASK   0x01
 LED Driver 19 interrupt masks setting.
 
#define LEDDRIVER19_OPEN_MASK   0x02
 
#define LEDDRIVER19_PAT_MASK   0x04
 
#define LEDDRIVER19_SOF_MASK   0x08
 
#define LEDDRIVER19_OVTP   0x01
 LED Driver 19 interrupt flags setting.
 
#define LEDDRIVER19_OPEN   0x02
 
#define LEDDRIVER19_PAT   0x04
 
#define LEDDRIVER19_SOF   0x08
 
#define LEDDRIVER19_PATTERN_SEL_OFFSET   0x18
 LED Driver 19 pattern selection setting.
 
#define LEDDRIVER19_PWM_MASK   0x0FFFu
 LED Driver 19 PWM mask setting.
 
#define LEDDRIVER19_CS0_OPEN   0x0001u
 LED Driver 19 channel open state setting.
 
#define LEDDRIVER19_CS1_OPEN   0x0002u
 
#define LEDDRIVER19_CS2_OPEN   0x0004u
 
#define LEDDRIVER19_CS3_OPEN   0x0008u
 
#define LEDDRIVER19_CS4_OPEN   0x0010u
 
#define LEDDRIVER19_CS5_OPEN   0x0020u
 
#define LEDDRIVER19_CS6_OPEN   0x0040u
 
#define LEDDRIVER19_CS7_OPEN   0x0080u
 
#define LEDDRIVER19_CS8_OPEN   0x0100u
 
#define LEDDRIVER19_CS9_OPEN   0x0200u
 
#define LEDDRIVER19_CS10_OPEN   0x0400u
 
#define LEDDRIVER19_CS11_OPEN   0x0800u
 
#define LEDDRIVER19_CS0_ENABLE   0x0001u
 LED Driver 19 channel selection setting.
 
#define LEDDRIVER19_CS1_ENABLE   0x0002u
 
#define LEDDRIVER19_CS2_ENABLE   0x0004u
 
#define LEDDRIVER19_CS3_ENABLE   0x0008u
 
#define LEDDRIVER19_CS4_ENABLE   0x0010u
 
#define LEDDRIVER19_CS5_ENABLE   0x0020u
 
#define LEDDRIVER19_CS6_ENABLE   0x0040u
 
#define LEDDRIVER19_CS7_ENABLE   0x0080u
 
#define LEDDRIVER19_CS8_ENABLE   0x0100u
 
#define LEDDRIVER19_CS9_ENABLE   0x0200u
 
#define LEDDRIVER19_CS10_ENABLE   0x0400u
 
#define LEDDRIVER19_CS11_ENABLE   0x0800u
 
#define LEDDRIVER19_CS_ENABLE_ALL   0x0FFFu
 
#define LEDDRIVER19_PWM_VAL_CONVERSION   40.95f
 LED Driver 19 calculation setting.
 
#define LEDDRIVER19_CURRENT_STEP_TO_MA   0.07843f
 
#define LEDDRIVER19_CURRENT_STEP_TO_HEX   12.75f
 
#define LEDDRIVER19_DEVICE_ADDRESS_0   0x58
 LED Driver 19 device address setting.
 
#define LEDDRIVER19_DEVICE_ADDRESS_1   0x59
 
#define LEDDRIVER19_DEVICE_ADDRESS_2   0x5A
 
#define LEDDRIVER19_DEVICE_ADDRESS_3   0x5B
 
#define LEDDRIVER19_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  leddriver19_return_value_t { LEDDRIVER19_OK = 0 , LEDDRIVER19_ERROR = -1 }
 LED Driver 19 Click return value data. More...
 

Functions

void leddriver19_cfg_setup (leddriver19_cfg_t *cfg)
 LED Driver 19 configuration object setup function.
 
err_t leddriver19_init (leddriver19_t *ctx, leddriver19_cfg_t *cfg)
 LED Driver 19 initialization function.
 
err_t leddriver19_default_cfg (leddriver19_t *ctx)
 LED Driver 19 default configuration function.
 
err_t leddriver19_generic_write (leddriver19_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 LED Driver 19 I2C writing function.
 
err_t leddriver19_generic_read (leddriver19_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 LED Driver 19 I2C reading function.
 
uint8_t leddriver19_get_int_pin (leddriver19_t *ctx)
 LED Driver 19 get interrupt pin state function.
 
err_t leddriver19_write_reg (leddriver19_t *ctx, uint8_t reg, uint8_t data_in)
 LED Driver 19 I2C register writing function.
 
err_t leddriver19_read_reg (leddriver19_t *ctx, uint8_t reg, uint8_t *data_out)
 LED Driver 19 I2C register reading function.
 
err_t leddriver19_sw_reset (leddriver19_t *ctx)
 LED Driver 19 software reset function.
 
err_t leddriver19_enable_channels (leddriver19_t *ctx, uint16_t channels_en)
 LED Driver 19 enables channels function.
 
err_t leddriver19_disable_channels (leddriver19_t *ctx, uint16_t channels_dis)
 LED Driver 19 disable channels function.
 
err_t leddriver19_set_pattern_pwm (leddriver19_t *ctx, uint8_t pattern_sel, uint8_t channel_sel, float pwm_value)
 LED Driver 19 set pattern PWM value function.
 
err_t leddriver19_get_ch_current (leddriver19_t *ctx, uint8_t channel_sel, float *current_val)
 LED Driver 19 get channel current value function.
 
err_t leddriver19_set_ch_current (leddriver19_t *ctx, uint8_t channel_sel, float current_val)
 LED Driver 19 set channel current value function.
 
err_t leddriver19_get_int_data (leddriver19_t *ctx, uint8_t *int_data)
 LED Driver 19 get interrupt register data function.
 
err_t leddriver19_get_nc_led (leddriver19_t *ctx, uint16_t *led_data)
 LED Driver 19 get LED open ( NC channels ) data function.
 

Detailed Description

This file contains API for LED Driver 19 Click Driver.

Enumeration Type Documentation

◆ leddriver19_return_value_t

LED Driver 19 Click return value data.

Predefined enum values for driver return values.

Enumerator
LEDDRIVER19_OK 
LEDDRIVER19_ERROR