ledflash4  2.1.0.0
Data Structures | Macros | Enumerations | Functions
ledflash4.h File Reference

This file contains API for LED Flash 4 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  ledflash4_t
 LED Flash 4 Click context object. More...
 
struct  ledflash4_cfg_t
 LED Flash 4 Click configuration object. More...
 

Macros

#define LEDFLASH4_REG_CHIP_ID   0x00
 LED Flash 4 register. More...
 
#define LEDFLASH4_REG_CURRENT_SET_LED1   0x01
 
#define LEDFLASH4_REG_CURRENT_SET_LED2   0x02
 
#define LEDFLASH4_REG_LOW_VOLTAGE   0x04
 
#define LEDFLASH4_REG_FLASH_TIMER   0x05
 
#define LEDFLASH4_REG_CONTROL   0x06
 
#define LEDFLASH4_REG_STROBE_SIGNALING   0x07
 
#define LEDFLASH4_REG_FAULT   0x08
 
#define LEDFLASH4_REG_PWM_AND_INDICATOR   0x09
 
#define LEDFLASH4_REG_MINIMUM_LED_CURRENT   0x0E
 
#define LEDFLASH4_REG_ACTUAL_LED_CURRENT   0x0F
 
#define LEDFLASH4_REG_PASSWORD   0x80
 
#define LEDFLASH4_REG_CURRENT_BOOST   0x81
 
#define LEDFLASH4_DEVICE_ID   0xB0
 LED Flash 4 device ID setting. More...
 
#define LEDFLASH4_DEVICE_ID_MASK   0xF8
 
#define LEDFLASH4_LED_CURRENT_MIN   0
 LED Flash 4 LED current setting. More...
 
#define LEDFLASH4_LED_CURRENT_MAX   900
 
#define LEDFLASH4_LED_CURRENT_DEFAULT   50
 
#define LEDFLASH4_LED_CURRENT_REG_MASK   0xFF
 
#define LEDFLASH4_LED_CURRENT_ROUND_INT   0.5f
 
#define LEDFLASH4_VIN_LOW_V_RUN_DIS   0x00
 LED Flash 4 low voltage register setting. More...
 
#define LEDFLASH4_VIN_LOW_V_RUN_3V   0x01
 
#define LEDFLASH4_VIN_LOW_V_RUN_3_07V   0x02
 
#define LEDFLASH4_VIN_LOW_V_RUN_3_14V   0x03
 
#define LEDFLASH4_VIN_LOW_V_RUN_3_22V   0x04
 
#define LEDFLASH4_VIN_LOW_V_RUN_3_3V   0x05
 
#define LEDFLASH4_VIN_LOW_V_RUN_3_38V   0x06
 
#define LEDFLASH4_VIN_LOW_V_RUN_3_47V   0x07
 
#define LEDFLASH4_VIN_LOW_V_RUN_MASK   0x07
 
#define LEDFLASH4_VIN_LOW_V_DIS   0x00
 
#define LEDFLASH4_VIN_LOW_V_3V   0x08
 
#define LEDFLASH4_VIN_LOW_V_3_07V   0x10
 
#define LEDFLASH4_VIN_LOW_V_3_14V   0x18
 
#define LEDFLASH4_VIN_LOW_V_3_22V   0x20
 
#define LEDFLASH4_VIN_LOW_V_3_3V   0x28
 
#define LEDFLASH4_VIN_LOW_V_3_38V   0x30
 
#define LEDFLASH4_VIN_LOW_V_3_47V   0x38
 
#define LEDFLASH4_VIN_LOW_V_MASK   0x38
 
#define LEDFLASH4_VIN_LOW_V_SHUTDOWN_MASK   0x40
 
#define LEDFLASH4_CONST_V_MODE_MASK   0x80
 
#define LEDFLASH4_FLASH_TIMER_36MS   0x23
 LED Flash 4 flash timer register setting. More...
 
#define LEDFLASH4_CONTROL_MODE_SHUTDOWN   0x00
 LED Flash 4 control register setting. More...
 
#define LEDFLASH4_CONTROL_MODE_INDICATOR   0x01
 
#define LEDFLASH4_CONTROL_MODE_ASSIST_LIGHT   0x02
 
#define LEDFLASH4_CONTROL_MODE_FLASH   0x03
 
#define LEDFLASH4_CONTROL_MODE_MASK   0x03
 
#define LEDFLASH4_CONTROL_OUT_OFF   0x00
 
#define LEDFLASH4_CONTROL_OUT_ON   0x08
 
#define LEDFLASH4_CONTROL_OUT_MASK   0x08
 
#define LEDFLASH4_CONTROL_AUTO_STROBE_OFF   0x00
 
#define LEDFLASH4_CONTROL_AUTO_STROBE_ON   0x10
 
#define LEDFLASH4_CONTROL_AUTO_STROBE_MASK   0x10
 
#define LEDFLASH4_CONTROL_STROBE_TYPE_EDGE   0x00
 
#define LEDFLASH4_CONTROL_STROBE_TYPE_LEVEL   0x40
 
#define LEDFLASH4_CONTROL_STROBE_TYPE_MASK   0x40
 
#define LEDFLASH4_CONTROL_STROBE_INPUT_OFF   0x00
 
#define LEDFLASH4_CONTROL_STROBE_INPUT_ON   0x80
 
#define LEDFLASH4_CONTROL_STROBE_INPUT_MASK   0x80
 
#define LEDFLASH4_FAULT_UVLO   0x01
 LED Flash 4 fault register setting. More...
 
#define LEDFLASH4_FAULT_TIMEOUT   0x10
 
#define LEDFLASH4_FAULT_OVERTEMP   0x20
 
#define LEDFLASH4_FAULT_LED_SHORT   0x40
 
#define LEDFLASH4_FAULT_OVP   0x80
 
#define LEDFLASH4_PWM_INCT_1_OF_16_DC   0x00
 LED Flash 4 pwm and indicator register setting. More...
 
#define LEDFLASH4_PWM_INCT_2_OF_16_DC   0x01
 
#define LEDFLASH4_PWM_INCT_3_OF_16_DC   0x02
 
#define LEDFLASH4_PWM_INCT_4_OF_16_DC   0x03
 
#define LEDFLASH4_PWM_INCT_MASK   0x03
 
#define LEDFLASH4_PWM_FREQ_SWITCH_ON_MASK   0x04
 
#define LEDFLASH4_PWM_LED_OUT1ABOVE2_MASK   0x08
 
#define LEDFLASH4_PWM_LED_OUT2ABOVE1_MASK   0x10
 
#define LEDFLASH4_PWM_LOAD_BALANCE_ON_MASK   0x20
 
#define LEDFLASH4_STROBE_PIN_LOW   0
 LED Flash 4 strobe pin setting. More...
 
#define LEDFLASH4_STROBE_PIN_HIGH   1
 
#define LEDFLASH4_DEVICE_ADDRESS_0   0x30
 LED Flash 4 device address setting. More...
 
#define LEDFLASH4_DEVICE_ADDRESS_1   0x32
 
#define LEDFLASH4_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping. More...
 

Enumerations

enum  ledflash4_return_value_t { LEDFLASH4_OK = 0, LEDFLASH4_ERROR = -1 }
 LED Flash 4 Click return value data. More...
 

Functions

void ledflash4_cfg_setup (ledflash4_cfg_t *cfg)
 LED Flash 4 configuration object setup function. More...
 
err_t ledflash4_init (ledflash4_t *ctx, ledflash4_cfg_t *cfg)
 LED Flash 4 initialization function. More...
 
err_t ledflash4_default_cfg (ledflash4_t *ctx)
 LED Flash 4 default configuration function. More...
 
err_t ledflash4_generic_write (ledflash4_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 LED Flash 4 I2C writing function. More...
 
err_t ledflash4_generic_read (ledflash4_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 LED Flash 4 I2C reading function. More...
 
err_t ledflash4_write_reg (ledflash4_t *ctx, uint8_t reg, uint8_t data_in)
 LED Flash 4 write reg function. More...
 
err_t ledflash4_read_reg (ledflash4_t *ctx, uint8_t reg, uint8_t *data_out)
 LED Flash 4 read reg function. More...
 
void ledflash4_set_stb_pin (ledflash4_t *ctx, uint8_t state)
 LED Flash 4 set STB pin function. More...
 
err_t ledflash4_check_communication (ledflash4_t *ctx)
 LED Flash 4 check communication function. More...
 
err_t ledflash4_set_led1_current (ledflash4_t *ctx, uint16_t led_current)
 LED Flash 4 set LED1 current function. More...
 
err_t ledflash4_set_led2_current (ledflash4_t *ctx, uint16_t led_current)
 LED Flash 4 set LED2 current function. More...
 

Detailed Description

This file contains API for LED Flash 4 Click Driver.

Enumeration Type Documentation

◆ ledflash4_return_value_t

LED Flash 4 Click return value data.

Predefined enum values for driver return values.

Enumerator
LEDFLASH4_OK 
LEDFLASH4_ERROR