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 LEDDRIVER9_REG_MODE1 0x00
79#define LEDDRIVER9_REG_MODE2 0x01
85#define LEDDRIVER9_REG_PWM0 0x02
91#define LEDDRIVER9_REG_PWM1 0x03
97#define LEDDRIVER9_REG_PWM2 0x04
103#define LEDDRIVER9_REG_PWM3 0x05
109#define LEDDRIVER9_REG_PWM4 0x06
115#define LEDDRIVER9_REG_PWM5 0x07
121#define LEDDRIVER9_REG_PWM6 0x08
127#define LEDDRIVER9_REG_PWM7 0x09
133#define LEDDRIVER9_REG_PWM8 0x0A
139#define LEDDRIVER9_REG_PWM9 0x0B
145#define LEDDRIVER9_REG_PWM10 0x0C
151#define LEDDRIVER9_REG_PWM11 0x0D
157#define LEDDRIVER9_REG_PWM12 0x0E
163#define LEDDRIVER9_REG_PWM13 0x0F
169#define LEDDRIVER9_REG_PWM14 0x10
175#define LEDDRIVER9_REG_PWM15 0x11
181#define LEDDRIVER9_REG_GRPPWM 0x12
187#define LEDDRIVER9_REG_GRPFREQ 0x13
193#define LEDDRIVER9_REG_LEDOUT0 0x14
199#define LEDDRIVER9_REG_LEDOUT1 0x15
205#define LEDDRIVER9_REG_LEDOUT2 0x16
211#define LEDDRIVER9_REG_LEDOUT3 0x17
217#define LEDDRIVER9_REG_SUBADR1 0x18
223#define LEDDRIVER9_REG_SUBADR2 0x19
229#define LEDDRIVER9_REG_SUBADR3 0x1A
235#define LEDDRIVER9_REG_ALLCALLADR 0x1B
241#define LEDDRIVER9_REG_IREF 0x1C
247#define LEDDRIVER9_REG_EFLAG1 0x1D
253#define LEDDRIVER9_REG_EFLAG2 0x1E
272#define LEDDRIVER9_SET_DEV_ADDR 0x60
290#define LEDDRIVER9_MAP_MIKROBUS( cfg, mikrobus ) \
291 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
292 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
293 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST )
err_t leddriver9_ledout_state(leddriver9_t *ctx, leddriver9_output_state_t *output_state)
LED Driver 9 LEDOUT state function.
err_t leddriver9_set_pwm(leddriver9_t *ctx, leddriver9_channel_sel_t ch_out, float duty_cycle)
LED Driver 9 set PWM function.
err_t leddriver9_set_dimmer_pwm(leddriver9_t *ctx, float duty_cycle)
LED Driver 9 set dimmer PWM function.
void leddriver9_cfg_setup(leddriver9_cfg_t *cfg)
LED Driver 9 configuration object setup function.
err_t leddriver9_init(leddriver9_t *ctx, leddriver9_cfg_t *cfg)
LED Driver 9 initialization function.
err_t leddriver9_mode1_reg_read(leddriver9_t *ctx, leddriver9_mode_reg_t *mode_reg)
LED Driver 9 MODE1 reg read function.
err_t leddriver9_mode1_reg_write(leddriver9_t *ctx, leddriver9_mode_reg_t *mode_reg)
LED Driver 9 MODE1 reg write function.
err_t leddriver9_mode2_reg_write(leddriver9_t *ctx, leddriver9_mode_reg_t *mode_reg)
LED Driver 9 MODE2 reg write function.
err_t leddriver9_generic_read(leddriver9_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
LED Driver 9 I2C reading function.
err_t leddriver9_mode2_reg_read(leddriver9_t *ctx, leddriver9_mode_reg_t *mode_reg)
LED Driver 9 MODE2 reg read function.
err_t leddriver9_set_blink_period(leddriver9_t *ctx, float period)
LED Driver 9 set blink period function.
void leddriver9_hardware_reset(leddriver9_t *ctx)
LED Driver 9 hardware reset function.
void leddriver9_default_cfg(leddriver9_t *ctx)
LED Driver 9 default configuration function.
err_t leddriver9_generic_write(leddriver9_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
LED Driver 9 I2C writing function.
leddriver9_channel_sel_t
LED Driver 9 Click channel select options.
Definition leddriver9.h:351
@ LEDDRIVER9_CHANNEL11
Definition leddriver9.h:363
@ LEDDRIVER9_CHANNEL15
Definition leddriver9.h:367
@ LEDDRIVER9_CHANNEL12
Definition leddriver9.h:364
@ LEDDRIVER9_CHANNEL6
Definition leddriver9.h:358
@ LEDDRIVER9_CHANNEL3
Definition leddriver9.h:355
@ LEDDRIVER9_CHANNEL14
Definition leddriver9.h:366
@ LEDDRIVER9_CHANNEL7
Definition leddriver9.h:359
@ LEDDRIVER9_CHANNEL0
Definition leddriver9.h:352
@ LEDDRIVER9_CHANNEL1
Definition leddriver9.h:353
@ LEDDRIVER9_CHANNEL2
Definition leddriver9.h:354
@ LEDDRIVER9_CHANNEL8
Definition leddriver9.h:360
@ LEDDRIVER9_CHANNEL9
Definition leddriver9.h:361
@ LEDDRIVER9_CHANNEL10
Definition leddriver9.h:362
@ LEDDRIVER9_CHANNEL5
Definition leddriver9.h:357
@ LEDDRIVER9_CHANNEL13
Definition leddriver9.h:365
@ LEDDRIVER9_CHANNEL4
Definition leddriver9.h:356
leddriver9_return_value_t
LED Driver 9 Click return value data.
Definition leddriver9.h:339
@ LEDDRIVER9_ERROR
Definition leddriver9.h:341
@ LEDDRIVER9_OK
Definition leddriver9.h:340
leddriver9_ledout_sel_t
LED Driver 9 Click ledout select options.
Definition leddriver9.h:377
@ LEDDRIVER9_OFF
Definition leddriver9.h:378
@ LEDDRIVER9_INDIVIDUAL
Definition leddriver9.h:380
@ LEDDRIVER9_GROUP
Definition leddriver9.h:381
@ LEDDRIVER9_FULL_ON
Definition leddriver9.h:379
LED Driver 9 Click configuration object.
Definition leddriver9.h:323
uint32_t i2c_speed
Definition leddriver9.h:329
pin_name_t scl
Definition leddriver9.h:324
pin_name_t sda
Definition leddriver9.h:325
pin_name_t rst
Definition leddriver9.h:327
uint8_t i2c_address
Definition leddriver9.h:330
LED Driver 9 Click mode registers.
Definition leddriver9.h:391
uint8_t EFCLR
Definition leddriver9.h:418
uint8_t ALLCALL
Definition leddriver9.h:397
uint8_t AI1
Definition leddriver9.h:403
uint8_t OCH
Definition leddriver9.h:414
uint8_t AI2
Definition leddriver9.h:404
uint8_t DMBLNK
Definition leddriver9.h:416
uint8_t RES2
Definition leddriver9.h:417
uint8_t RES1
Definition leddriver9.h:415
uint8_t byte
Definition leddriver9.h:394
uint8_t OSC
Definition leddriver9.h:401
uint8_t SUB1
Definition leddriver9.h:400
uint8_t RES
Definition leddriver9.h:413
uint8_t AI0
Definition leddriver9.h:402
uint8_t SUB3
Definition leddriver9.h:398
uint8_t SUB2
Definition leddriver9.h:399
LED Driver 9 Click LED output state registers.
Definition leddriver9.h:429
uint8_t LDR8
Definition leddriver9.h:459
uint8_t LDR11
Definition leddriver9.h:462
uint8_t LDR15
Definition leddriver9.h:474
uint8_t LDR5
Definition leddriver9.h:448
uint8_t LDR4
Definition leddriver9.h:447
uint8_t LDR10
Definition leddriver9.h:461
uint8_t byte
Definition leddriver9.h:432
uint8_t LDR12
Definition leddriver9.h:471
uint8_t LDR6
Definition leddriver9.h:449
uint8_t LDR9
Definition leddriver9.h:460
uint8_t LDR0
Definition leddriver9.h:435
uint8_t LDR7
Definition leddriver9.h:450
uint8_t LDR14
Definition leddriver9.h:473
uint8_t LDR3
Definition leddriver9.h:438
uint8_t LDR1
Definition leddriver9.h:436
uint8_t LDR2
Definition leddriver9.h:437
uint8_t LDR13
Definition leddriver9.h:472
LED Driver 9 Click context object.
Definition leddriver9.h:303
i2c_master_t i2c
Definition leddriver9.h:310
digital_out_t rst
Definition leddriver9.h:306
uint8_t slave_address
Definition leddriver9.h:314