42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_in.h"
54#include "drv_i2c_master.h"
66#define LEDDRIVER6_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
68 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
69 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
70 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
77#define LEDDRIVER6_OK 0
78#define LEDDRIVER6_INIT_ERROR (-1)
85#define LEDDRIVER6_DEF_FREQ 10000
248 // End click Driver group
void leddriver6_cfg_setup(leddriver6_cfg_t *cfg)
Config Object Initialization function.
err_t leddriver6_read_adc(leddriver6_t *ctx, uint16_t *data_out)
Read ADC function.
err_t leddriver6_set_duty_cycle(leddriver6_t *ctx, float duty_cycle)
Sets PWM duty cycle.
err_t leddriver6_pwm_start(leddriver6_t *ctx)
Start PWM module.
uint8_t leddriver6_get_interrupt_state(leddriver6_t *ctx)
Function for getting interrupt pin state.
err_t leddriver6_init(leddriver6_t *ctx, leddriver6_cfg_t *cfg)
Initialization function.
err_t leddriver6_get_pg_voltage(leddriver6_t *ctx, float *data_out)
Function for reading current PG output voltage.
err_t leddriver6_pwm_stop(leddriver6_t *ctx)
Stop PWM module.
Click configuration structure definition.
Definition leddriver6.h:121
uint32_t i2c_speed
Definition leddriver6.h:134
uint32_t dev_pwm_freq
Definition leddriver6.h:136
pin_name_t scl
Definition leddriver6.h:124
pin_name_t int_pin
Definition leddriver6.h:130
pin_name_t pwm
Definition leddriver6.h:126
pin_name_t sda
Definition leddriver6.h:125
uint8_t i2c_address
Definition leddriver6.h:135
Click ctx object definition.
Definition leddriver6.h:99
uint32_t pwm_freq
Definition leddriver6.h:112
digital_in_t int_pin
Definition leddriver6.h:103
i2c_master_t i2c
Definition leddriver6.h:108
uint8_t slave_address
Definition leddriver6.h:113
pwm_t pwm
Definition leddriver6.h:107