Go to the documentation of this file.
38 #include "mikrosdk_version.h"
41 #if mikroSDK_GET_VERSION < 20800ul
42 #include "rcu_delays.h"
48 #include "drv_digital_out.h"
49 #include "drv_digital_in.h"
50 #include "drv_i2c_master.h"
63 #define LIGHTTEMP_MAP_MIKROBUS( cfg, mikrobus ) \
64 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
65 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
66 cfg.pwm1 = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
67 cfg.pwm2 = MIKROBUS( mikrobus, MIKROBUS_CS ); \
68 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
75 #define LIGHTTEMP_RETVAL uint8_t
77 #define LIGHTTEMP_OK 0x00
78 #define LIGHTTEMP_INIT_ERROR 0xFF
85 #define LIGHTTEMP_DEF_FREQ 20000
274 #endif // _LIGHTTEMP_H_
Click configuration structure definition.
Definition: lighttemp.h:121
digital_in_t int_pin
Definition: lighttemp.h:102
uint32_t i2c_speed
Definition: lighttemp.h:135
void lighttemp_generic_write(lighttemp_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
uint8_t i2c_address
Definition: lighttemp.h:136
void lighttemp_led1_set_duty_cycle(lighttemp_t *ctx, float duty_cycle)
Generic sets PWM duty cycle for LED1.
pwm_t pwm2
Definition: lighttemp.h:108
i2c_master_t i2c
Definition: lighttemp.h:106
Click ctx object definition.
Definition: lighttemp.h:99
uint16_t lighttemp_get_pg_voltage(lighttemp_t *ctx)
Get voltage.
pin_name_t scl
Definition: lighttemp.h:124
uint8_t slave_address
Definition: lighttemp.h:112
pin_name_t pwm2
Definition: lighttemp.h:127
uint8_t lighttemp_get_interrupt_state(lighttemp_t *ctx)
Get INT pin state.
void lighttemp_generic_read(lighttemp_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
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.
uint32_t dev_pwm_freq
Definition: lighttemp.h:137
pin_name_t pwm1
Definition: lighttemp.h:126
#define LIGHTTEMP_RETVAL
Definition: lighttemp.h:75
pwm_t pwm1
Definition: lighttemp.h:107
pin_name_t sda
Definition: lighttemp.h:125
void lighttemp_led2_set_duty_cycle(lighttemp_t *ctx, float duty_cycle)
Generic sets PWM duty cycle for LED2.
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_pwm_stop(lighttemp_t *ctx)
Stop PWM module for LED1.
void lighttemp_cfg_setup(lighttemp_cfg_t *cfg)
Config Object Initialization function.
pin_name_t int_pin
Definition: lighttemp.h:131
uint32_t pwm_freq
Definition: lighttemp.h:113