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"
67#define LIGHTTEMP_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
69 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
70 cfg.pwm1 = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
71 cfg.pwm2 = MIKROBUS( mikrobus, MIKROBUS_CS ); \
72 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
79#define LIGHTTEMP_RETVAL uint8_t
81#define LIGHTTEMP_OK 0x00
82#define LIGHTTEMP_INIT_ERROR 0xFF
89#define LIGHTTEMP_DEF_FREQ 20000
#define LIGHTTEMP_RETVAL
Definition lighttemp.h:79
void lighttemp_led1_pwm_stop(lighttemp_t *ctx)
Stop PWM module for LED1.
uint8_t lighttemp_get_interrupt_state(lighttemp_t *ctx)
Get INT pin state.
void lighttemp_led1_pwm_start(lighttemp_t *ctx)
Start PWM module for LED1.
LIGHTTEMP_RETVAL lighttemp_init(lighttemp_t *ctx, lighttemp_cfg_t *cfg)
Initialization function.
void lighttemp_led2_pwm_stop(lighttemp_t *ctx)
Stop PWM module for LED2.
void lighttemp_led2_pwm_start(lighttemp_t *ctx)
Start PWM module for LED2.
void lighttemp_led1_set_duty_cycle(lighttemp_t *ctx, float duty_cycle)
Generic sets PWM duty cycle for LED1.
void lighttemp_cfg_setup(lighttemp_cfg_t *cfg)
Config Object Initialization function.
void lighttemp_generic_write(lighttemp_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
void lighttemp_generic_read(lighttemp_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
uint16_t lighttemp_get_pg_voltage(lighttemp_t *ctx)
Get voltage.
void lighttemp_led2_set_duty_cycle(lighttemp_t *ctx, float duty_cycle)
Generic sets PWM duty cycle for LED2.
Click configuration structure definition.
Definition lighttemp.h:125
uint32_t i2c_speed
Definition lighttemp.h:139
uint32_t dev_pwm_freq
Definition lighttemp.h:141
pin_name_t scl
Definition lighttemp.h:128
pin_name_t pwm1
Definition lighttemp.h:130
pin_name_t int_pin
Definition lighttemp.h:135
pin_name_t sda
Definition lighttemp.h:129
pin_name_t pwm2
Definition lighttemp.h:131
uint8_t i2c_address
Definition lighttemp.h:140
Click ctx object definition.
Definition lighttemp.h:103
pwm_t pwm1
Definition lighttemp.h:111
pwm_t pwm2
Definition lighttemp.h:112
uint32_t pwm_freq
Definition lighttemp.h:117
digital_in_t int_pin
Definition lighttemp.h:106
i2c_master_t i2c
Definition lighttemp.h:110
uint8_t slave_address
Definition lighttemp.h:116