39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_i2c_master.h"
73#define LEDDRIVER15_REG_R0 0x00
74#define LEDDRIVER15_REG_R1 0x01
92#define LEDDRIVER15_R0_EN 0x80
93#define LEDDRIVER15_R0_REF_SET_MASK 0x7C
94#define LEDDRIVER15_R0_REF_SET_OFFSET 2
100#define LEDDRIVER15_R1_DIMS_I2C 0x00
101#define LEDDRIVER15_R1_DIMS_PWM 0x40
102#define LEDDRIVER15_R1_DIMS_MASK 0x40
103#define LEDDRIVER15_R1_SYNC_DISABLE 0x00
104#define LEDDRIVER15_R1_SYNC_ENABLE 0x20
105#define LEDDRIVER15_R1_SYNC_MASK 0x20
106#define LEDDRIVER15_R1_OVP_13p5V 0x00
107#define LEDDRIVER15_R1_OVP_24V 0x10
108#define LEDDRIVER15_R1_OVP_35p5V 0x08
109#define LEDDRIVER15_R1_OVP_MASK 0x18
110#define LEDDRIVER15_R1_VOS 0x04
111#define LEDDRIVER15_R1_LED0 0x02
112#define LEDDRIVER15_R1_OTP 0x01
118#define LEDDRIVER15_I2C_DIMMING_MIN 0
119#define LEDDRIVER15_I2C_DIMMING_MAX 31
126#define LEDDRIVER15_DEVICE_ADDRESS 0x17
144#define LEDDRIVER15_MAP_MIKROBUS( cfg, mikrobus ) \
145 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
146 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
147 cfg.en = MIKROBUS( mikrobus, MIKROBUS_PWM );
void leddriver15_cfg_setup(leddriver15_cfg_t *cfg)
LED Driver 15 configuration object setup function.
err_t leddriver15_default_cfg(leddriver15_t *ctx)
LED Driver 15 default configuration function.
void leddriver15_enable_device(leddriver15_t *ctx)
LED Driver 15 enable device function.
void leddriver15_disable_device(leddriver15_t *ctx)
LED Driver 15 disable device function.
err_t leddriver15_write_register(leddriver15_t *ctx, uint8_t reg, uint8_t data_in)
LED Driver 15 write register function.
err_t leddriver15_read_register(leddriver15_t *ctx, uint8_t reg, uint8_t *data_out)
LED Driver 15 read register function.
err_t leddriver15_set_i2c_dimming(leddriver15_t *ctx, uint8_t dimming)
LED Driver 15 set i2c dimming function.
err_t leddriver15_init(leddriver15_t *ctx, leddriver15_cfg_t *cfg)
LED Driver 15 initialization function.
leddriver15_return_value_t
LED Driver 15 Click return value data.
Definition leddriver15.h:186
@ LEDDRIVER15_OK
Definition leddriver15.h:187
@ LEDDRIVER15_ERROR
Definition leddriver15.h:188
LED Driver 15 Click configuration object.
Definition leddriver15.h:171
uint32_t i2c_speed
Definition leddriver15.h:176
pin_name_t scl
Definition leddriver15.h:172
pin_name_t en
Definition leddriver15.h:174
pin_name_t sda
Definition leddriver15.h:173
uint8_t i2c_address
Definition leddriver15.h:177
LED Driver 15 Click context object.
Definition leddriver15.h:157
i2c_master_t i2c
Definition leddriver15.h:160
digital_out_t en
Definition leddriver15.h:158
uint8_t slave_address
Definition leddriver15.h:162