Go to the documentation of this file.
35 #include "drv_digital_out.h"
36 #include "drv_digital_in.h"
37 #include "drv_i2c_master.h"
59 #define UVA_REG_CHIP_ID 0x00
60 #define UVA_REG_MODE 0x01
61 #define UVA_REG_RES_UV 0x04
62 #define UVA_REG_RANGE_UVA 0x05
63 #define UVA_REG_MODE_CTRL 0x0A
64 #define UVA_REG_SOFT_RESET 0x0B
65 #define UVA_REG_UVA_LSB 0x15
66 #define UVA_REG_UVA_MSB 0x16
67 #define UVA_REG_NVM_READ_CTRL 0x30
68 #define UVA_REG_NVM_MSB 0x31
69 #define UVA_REG_NVM_LSB 0x32
87 #define UVA_CHIP_ID 0x62
93 #define UVA_MODE_NO_OPERATION 0x00
94 #define UVA_MODE_UVA_OPERATION 0x10
95 #define UVA_MODE_NORMAL 0x00
96 #define UVA_MODE_LOW_POWER 0x01
97 #define UVA_MODE_AUTO_SHUTDOWN 0x02
98 #define UVA_MODE_SHUTDOWN 0x03
104 #define UVA_RESOLUTION_800MS 0x00
105 #define UVA_RESOLUTION_400MS 0x01
106 #define UVA_RESOLUTION_200MS 0x02
107 #define UVA_RESOLUTION_100MS 0x03
113 #define UVA_RANGE_X1 0x00
114 #define UVA_RANGE_X2 0x01
115 #define UVA_RANGE_X4 0x02
116 #define UVA_RANGE_X8 0x03
117 #define UVA_RANGE_X16 0x04
118 #define UVA_RANGE_X32 0x05
119 #define UVA_RANGE_X64 0x06
120 #define UVA_RANGE_X128 0x07
126 #define UVA_MODE_CTRL_SLEEP_2_TIMES 0x00
127 #define UVA_MODE_CTRL_SLEEP_4_TIMES 0x01
128 #define UVA_MODE_CTRL_SLEEP_8_TIMES 0x02
129 #define UVA_MODE_CTRL_SLEEP_16_TIMES 0x03
130 #define UVA_MODE_CTRL_SLEEP_32_TIMES 0x04
131 #define UVA_MODE_CTRL_SLEEP_64_TIMES 0x05
132 #define UVA_MODE_CTRL_SLEEP_128_TIMES 0x06
133 #define UVA_MODE_CTRL_SLEEP_256_TIMES 0x07
139 #define UVA_SOFT_RESET 0xA5
145 #define UVA_NVM_READ_ADDRESS_OFFSET 0x0A
146 #define UVA_NVM_READ_ADDRESS_A_SCALE 0x0B
153 #define UVA_SET_DEV_ADDR 0x39
171 #define UVA_MAP_MIKROBUS( cfg, mikrobus ) \
172 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
173 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA );
err_t uva_read_data(uva_t *ctx, uint16_t *uva_data)
UVA read data function.
err_t uva_generic_read(uva_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
UVA I2C reading function.
err_t uva_read_register(uva_t *ctx, uint8_t reg, uint8_t *data_out)
UVA read register function.
@ UVA_OK
Definition: uva.h:212
err_t uva_check_communication(uva_t *ctx)
UVA check communication function.
pin_name_t sda
Definition: uva.h:199
pin_name_t scl
Definition: uva.h:198
uva_return_value_t
UVA Click return value data.
Definition: uva.h:211
err_t uva_init(uva_t *ctx, uva_cfg_t *cfg)
UVA initialization function.
err_t uva_soft_reset(uva_t *ctx)
UVA soft reset function.
void uva_cfg_setup(uva_cfg_t *cfg)
UVA configuration object setup function.
uint8_t slave_address
Definition: uva.h:188
err_t uva_default_cfg(uva_t *ctx)
UVA default configuration function.
@ UVA_ERROR
Definition: uva.h:213
i2c_master_t i2c
Definition: uva.h:185
UVA Click configuration object.
Definition: uva.h:197
err_t uva_write_register(uva_t *ctx, uint8_t reg, uint8_t data_in)
UVA write register function.
uint32_t i2c_speed
Definition: uva.h:201
err_t uva_generic_write(uva_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
UVA I2C writing function.
UVA Click context object.
Definition: uva.h:183
uint8_t i2c_address
Definition: uva.h:202