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"
52#include "drv_analog_in.h"
75#define LEDDRIVER11_MAX_CURRENT 0x0000
76#define LEDDRIVER11_MIN_CURRENT 0x0FFF
82#define LEDDRIVER11_DEF_FREQ 5000
88#define LEDDRIVER11_SET_DEV_ADDR 0x60
106#define LEDDRIVER11_MAP_MIKROBUS( cfg, mikrobus ) \
107 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
108 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
109 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN ); \
110 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM );
err_t leddriver11_default_cfg(leddriver11_t *ctx)
LED Driver 11 default configuration function.
err_t leddriver11_read_an_pin_voltage(leddriver11_t *ctx, float *data_out)
LED Driver 11 read AN pin voltage level function.
err_t leddriver11_init(leddriver11_t *ctx, leddriver11_cfg_t *cfg)
LED Driver 11 initialization function.
err_t leddriver11_read_an_pin_value(leddriver11_t *ctx, uint16_t *data_out)
LED Driver 11 read AN pin value function.
err_t leddriver11_read_dac_memory(leddriver11_t *ctx, uint8_t *data_out)
LED Driver 11 read DAC memory.
void leddriver11_cfg_setup(leddriver11_cfg_t *cfg)
LED Driver 11 configuration object setup function.
err_t leddriver11_set_duty_cycle(leddriver11_t *ctx, float duty_cycle)
LED Driver 11 sets PWM duty cycle.
err_t leddriver11_set_current(leddriver11_t *ctx, uint16_t curr)
LED Driver 11 set current function.
err_t leddriver11_pwm_stop(leddriver11_t *ctx)
LED Driver 11 stop PWM module.
err_t leddriver11_pwm_start(leddriver11_t *ctx)
LED Driver 11 start PWM module.
leddriver11_return_value_t
LED Driver 11 Click return value data.
Definition leddriver11.h:158
@ LEDDRIVER11_OK
Definition leddriver11.h:159
@ LEDDRIVER11_ERROR
Definition leddriver11.h:160
LED Driver 11 Click configuration object.
Definition leddriver11.h:139
analog_in_resolution_t resolution
Definition leddriver11.h:145
float vref
Definition leddriver11.h:146
uint32_t i2c_speed
Definition leddriver11.h:147
uint32_t dev_pwm_freq
Definition leddriver11.h:149
pin_name_t scl
Definition leddriver11.h:140
pin_name_t pwm
Definition leddriver11.h:143
pin_name_t sda
Definition leddriver11.h:141
pin_name_t an
Definition leddriver11.h:142
uint8_t i2c_address
Definition leddriver11.h:148
LED Driver 11 Click context object.
Definition leddriver11.h:120
uint32_t pwm_freq
Definition leddriver11.h:127
i2c_master_t i2c
Definition leddriver11.h:123
uint8_t slave_address
Definition leddriver11.h:130
analog_in_t adc
Definition leddriver11.h:122
pwm_t pwm
Definition leddriver11.h:124