ledflash3 2.1.0.0
ledflash3.h File Reference

This file contains API for LED Flash 3 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  ledflash3_t
 LED Flash 3 Click context object. More...
 
struct  ledflash3_cfg_t
 LED Flash 3 Click configuration object. More...
 

Macros

#define LEDFLASH3_REG_ENABLE   0x01
 LED Flash 3 description register.
 
#define LEDFLASH3_REG_CONFIGURATION   0x02
 
#define LEDFLASH3_REG_FLASH_CURRENT   0x03
 
#define LEDFLASH3_REG_TOUCH_CURRENT   0x04
 
#define LEDFLASH3_REG_FAULT_FLAG   0x05
 
#define LEDFLASH3_REG_DEVICE_ID   0x06
 
#define LEDFLASH3_LVP_ENABLE   0x10
 LED Flash 3 description setting.
 
#define LEDFLASH3_STROBE_LEVEL   0x00
 
#define LEDFLASH3_STROBE_EDGE   0x08
 
#define LEDFLASH3_STROBE_PIN_ENABLE   0x04
 
#define LEDFLASH3_MODE_FLASH   0x03
 
#define LEDFLASH3_MODE_TORCH   0x02
 
#define LEDFLASH3_MODE_IR   0x01
 
#define LEDFLASH3_MODE_STANDBY   0x00
 
#define LEDFLASH3_LVP_THRESHOLD_2V9   0x00
 LED Flash 3 Configuration register setting.
 
#define LEDFLASH3_LVP_THRESHOLD_3V   0x02
 
#define LEDFLASH3_LVP_THRESHOLD_3V1   0x04
 
#define LEDFLASH3_LVP_THRESHOLD_3V2   0x06
 
#define LEDFLASH3_LVP_THRESHOLD_3V3   0x08
 
#define LEDFLASH3_LVP_THRESHOLD_3V4   0x0A
 
#define LEDFLASH3_LVP_THRESHOLD_3V5   0x0C
 
#define LEDFLASH3_LVP_THRESHOLD_3V6   0x0E
 
#define LEDFLASH3_TIME_OUT_40MS   0x00
 
#define LEDFLASH3_TIME_OUT_80MS   0x02
 
#define LEDFLASH3_TIME_OUT_120MS   0x04
 
#define LEDFLASH3_TIME_OUT_160MS   0x06
 
#define LEDFLASH3_TIME_OUT_200MS   0x08
 
#define LEDFLASH3_TIME_OUT_240MS   0x0A
 
#define LEDFLASH3_TIME_OUT_280MS   0x0C
 
#define LEDFLASH3_TIME_OUT_320MS   0x0E
 
#define LEDFLASH3_TIME_OUT_360MS   0x10
 
#define LEDFLASH3_TIME_OUT_400MS   0x12
 
#define LEDFLASH3_TIME_OUT_600MS   0x14
 
#define LEDFLASH3_TIME_OUT_800MS   0x16
 
#define LEDFLASH3_TIME_OUT_1000MS   0x18
 
#define LEDFLASH3_TIME_OUT_1200MS   0x1A
 
#define LEDFLASH3_TIME_OUT_1400MS   0x1C
 
#define LEDFLASH3_TIME_OUT_1600MS   0x1E
 
#define LEDFLASH3_TORCH_RAMP_TIME_1MS   0x01
 
#define LEDFLASH3_LVP_FAULT_MASK   0x40
 LED Flash 3 Fault register setting.
 
#define LEDFLASH3_LED_SHORT_FAULT_MASK   0x20
 
#define LEDFLASH3_THERMAL_SHDN_MASK   0x04
 
#define LEDFLASH3_THERMAL_SHDN_MASK   0x04
 
#define LEDFLASH3_OVLO_FAULT_MASK   0x02
 
#define LEDFLASH3_FLASH_TIMEOUT_MASK   0x01
 
#define LEDFLASH3_SW_RESET_MASK   0x80
 LED Flash 3 software reset.
 
#define LEDFLASH3_TORCH_CURRENT_MAX   376.0f
 LED Flash 3 Fault register setting.
 
#define LEDFLASH3_TORCH_CURRENT_MIN   2.94f
 
#define LEDFLASH3_FLASH_CURRENT_MAX   1500.0f
 
#define LEDFLASH3_FLASH_CURRENT_MIN   11.72f
 
#define LEDFLASH3_ROUND_TO_NEAR_INT   0.5f
 
#define LEDFLASH3_DEVICE_ADDRESS   0x64
 LED Flash 3 device address setting.
 
#define LEDFLASH3_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  ledflash3_return_value_t { LEDFLASH3_OK = 0 , LEDFLASH3_ERROR = -1 }
 LED Flash 3 Click return value data. More...
 

Functions

void ledflash3_cfg_setup (ledflash3_cfg_t *cfg)
 LED Flash 3 configuration object setup function.
 
err_t ledflash3_init (ledflash3_t *ctx, ledflash3_cfg_t *cfg)
 LED Flash 3 initialization function.
 
err_t ledflash3_default_cfg (ledflash3_t *ctx)
 LED Flash 3 default configuration function.
 
err_t ledflash3_generic_write (ledflash3_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 LED Flash 3 I2C writing function.
 
err_t ledflash3_generic_read (ledflash3_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 LED Flash 3 I2C reading function.
 
err_t ledflash3_write_reg (ledflash3_t *ctx, uint8_t reg, uint8_t data_in)
 LED Flash 3 register writing function.
 
err_t ledflash3_read_reg (ledflash3_t *ctx, uint8_t reg, uint8_t *data_out)
 LED Flash 3 regiister reading function.
 
void ledflash3_strobe_pin (ledflash3_t *ctx)
 LED Flash 3 strobe function.
 
err_t ledflash3_set_flash_current (ledflash3_t *ctx, float flash_current)
 LED Flash 3 set flash current function.
 
err_t ledflash3_set_torch_current (ledflash3_t *ctx, float torch_current)
 LED Flash 3 set torch current function.
 

Detailed Description

This file contains API for LED Flash 3 Click Driver.

Enumeration Type Documentation

◆ ledflash3_return_value_t

LED Flash 3 Click return value data.

Predefined enum values for driver return values.

Enumerator
LEDFLASH3_OK 
LEDFLASH3_ERROR