42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_i2c_master.h"
66#define LEDDRIVER3_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
68 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
75#define LEDDRIVER3_RETVAL uint8_t
77#define LEDDRIVER3_OK 0x00
78#define LEDDRIVER3_INIT_ERROR 0xFF
85#define LEDDRIVER3_COLOR_RED 0x5F6080
86#define LEDDRIVER3_COLOR_ORANGE 0x5F6280
87#define LEDDRIVER3_COLOR_YELLOW 0x5F7480
88#define LEDDRIVER3_COLOR_GREEN 0x407F80
89#define LEDDRIVER3_COLOR_BLUE 0x40609F
90#define LEDDRIVER3_COLOR_WHITE 0x5F7F9F
91#define LEDDRIVER3_COLOR_PURPLE 0x58609C
92#define LEDDRIVER3_COLOR_OFF 0x000000
99#define LEDDRIVER3_TIMER_8ms 0xE1
100#define LEDDRIVER3_TIMER_16ms 0xE2
101#define LEDDRIVER3_TIMER_32ms 0xE4
102#define LEDDRIVER3_TIMER_64ms 0xE8
103#define LEDDRIVER3_TIMER_128ms 0xE0
110#define LEDDRIVER3_INTENSITY_1 0x01
111#define LEDDRIVER3_INTENSITY_2 0x02
112#define LEDDRIVER3_INTENSITY_4 0x04
113#define LEDDRIVER3_INTENSITY_8 0x08
114#define LEDDRIVER3_INTENSITY_16 0x10
116#define LEDDRIVER3_INCREMENT 0xA0
117#define LEDDRIVER3_DECREMENT 0xC0
118#define LEDDRIVER3_CONSTANT 0x20
#define LEDDRIVER3_RETVAL
Definition leddriver3.h:75
void leddriver3_set_color(leddriver3_t *ctx, uint32_t color)
Function set color.
void leddriver3_generic_read(leddriver3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
void leddriver3_set_timer(leddriver3_t *ctx, uint8_t time)
Set timer function.
void leddriver3_set_rgb_color(leddriver3_t *ctx, leddriver3_rgb_t *rgb)
Function set RGB color.
void leddriver3_generic_write(leddriver3_t *ctx, uint8_t reg)
Generic write function.
void leddriver3_shut_down(leddriver3_t *ctx)
Shut down function.
LEDDRIVER3_RETVAL leddriver3_init(leddriver3_t *ctx, leddriver3_cfg_t *cfg)
Initialization function.
void leddriver3_set_intensity(leddriver3_t *ctx, uint8_t intensity)
Set intensity function.
void leddriver3_cfg_setup(leddriver3_cfg_t *cfg)
Config Object Initialization function.
Click configuration structure definition.
Definition leddriver3.h:157
i2c_master_speed_t i2c_speed
Definition leddriver3.h:165
pin_name_t scl
Definition leddriver3.h:160
pin_name_t sda
Definition leddriver3.h:161
uint8_t i2c_address
Definition leddriver3.h:166
RGB color value definition.
Definition leddriver3.h:132
uint8_t blue
Definition leddriver3.h:135
uint8_t green
Definition leddriver3.h:134
uint8_t red
Definition leddriver3.h:133
Click ctx object definition.
Definition leddriver3.h:142
i2c_master_t i2c
Definition leddriver3.h:145
uint8_t slave_address
Definition leddriver3.h:149