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"
66#define UV3_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
68 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
69 cfg.ack = MIKROBUS( mikrobus, MIKROBUS_INT )
76#define UV3_RETVAL uint8_t
79#define UV3_INIT_ERROR 0xFF
86#define UV3_I2C_ADDR_DEFAULT 0x38
87#define UV3_ADDR_ARA 0x0C
88#define UV3_ADDR_CMD 0x38
89#define UV3_ADDR_DATA_LSB 0x38
90#define UV3_ADDR_DATA_MSB 0x39
97#define UV3_CMD_DEFAULT 0x02
98#define UV3_CMD_SD 0x01
99#define UV3_CMD_IT_0_5T 0x00
100#define UV3_CMD_IT_1T 0x04
101#define UV3_CMD_IT_2T 0x08
102#define UV3_CMD_IT_4T 0x0C
109#define UV3_RAD_LOW 0x01
110#define UV3_RAD_MODERATE 0x02
111#define UV3_RAD_HIGH 0x03
112#define UV3_RAD_VERY_HIGH 0x04
113#define UV3_RAD_EXTREME 0x05
#define UV3_RETVAL
Definition uv3.h:76
void uv3_default_cfg(uv3_t *ctx)
Click Default Configuration function.
UV3_RETVAL uv3_init(uv3_t *ctx, uv3_cfg_t *cfg)
Initialization function.
void uv3_set_integration_time(uv3_t *ctx, uint8_t int_data)
Set integration time function.
void uv3_enable_sensor(uv3_t *ctx)
Enable sensor function.
void uv3_disable_mode(uv3_t *ctx)
Disable sensor function.
uint8_t uv3_get_interrupt(uv3_t *ctx)
Get state of interrupt pin function.
uint8_t uv3_risk_level(uint16_t uv_data)
Calculate UV risk level function.
uint8_t uv3_read_byte(uv3_t *ctx, uint8_t slave_addr)
Read function.
uint16_t uv3_read_measurements(uv3_t *ctx)
Get UV data measurements function.
void uv3_cfg_setup(uv3_cfg_t *cfg)
Config Object Initialization function.
void uv3_write_command(uv3_t *ctx, uint8_t slave_addr, uint8_t command)
Write function.
void uv3_clear_ack(uv3_t *ctx)
Read ARA to clear interrupt function.
Click configuration structure definition.
Definition uv3.h:146
uint32_t i2c_speed
Definition uv3.h:158
pin_name_t ack
Definition uv3.h:154
pin_name_t scl
Definition uv3.h:149
pin_name_t sda
Definition uv3.h:150
uint8_t i2c_address
Definition uv3.h:159
Click ctx object definition.
Definition uv3.h:127
digital_in_t ack
Definition uv3.h:130
i2c_master_t i2c
Definition uv3.h:134
uint8_t slave_address
Definition uv3.h:138