monoZ docs
MZ_Addon_Si1133.h
Go to the documentation of this file.
1/*
2 * MZ_Addon_Si1133.h
3 *
4 * Created on: Aug 26, 2021
5 * Author: SKM
6 */
7
8
9/*
10 * This is a sample implementation of the Si1133 driver as per data sheet.
11 * Please refer Si1133 datasheet for details
12 */
13
14#ifndef MZ_ADDON_SI1133_H_
15#define MZ_ADDON_SI1133_H_
16
17#include "stdio.h"
18#include "math.h"
19#include "stdlib.h"
20#include "stdint.h"
21
22
23typedef enum
24{
66
67typedef enum
68{
108
109typedef enum
110{
120
121typedef enum
122{
127
132typedef struct __attribute ((packed))
133{
134 uint8_t irq_status;
135 int32_t ch0;
136 int32_t ch1;
137 int32_t ch2;
138 int32_t ch3;
140
141typedef struct
142{
143 int16_t info;
144 uint16_t mag;
146
147typedef struct
148{
149 Si1133_coeff coeff_high[4];
150 Si1133_coeff coeff_low[9];
152
153
154typedef enum
155{
159
160
163Si1133_error SI1133_get_hardware_id (uint8_t *hardware_id);
164Si1133_error SI1133_measure_lux_uv (float *lux, float *uvi);
165Si1133_error SI1133_get_measurement (float *lux, float *uvi);
166float SI1133_get_light_level(void);
167float SI1133_get_uv_index(void);
168
169#endif /* MZ_ADDON_SI1133_H_ */
Si1133_register
@ SI1133_REG_HOSTOUT10
Captured Sensor Data.
@ SI1133_REG_HOSTOUT18
Captured Sensor Data.
@ SI1133_REG_HOSTOUT16
Captured Sensor Data.
@ SI1133_REG_HOSTOUT22
Captured Sensor Data.
@ SI1133_REG_HOSTOUT23
Captured Sensor Data.
@ SI1133_REG_IRQ_STATUS
Interrupt status.
@ SI1133_REG_HOSTOUT13
Captured Sensor Data.
@ SI1133_REG_COMMAND
Initiated action in Sensor when specific codes written here.
@ SI1133_REG_HOSTIN3
Host 3.
@ SI1133_REG_HOSTIN1
Host 1.
@ SI1133_REG_IRQ_ENABLE
Interrupt enable
@ SI1133_REG_HOSTOUT19
Captured Sensor Data.
@ SI1133_REG_HOSTOUT4
Captured Sensor Data.
@ SI1133_REG_HOSTOUT2
Captured Sensor Data.
@ SI1133_REG_HOSTOUT5
Captured Sensor Data.
@ SI1133_REG_HOSTOUT25
Captured Sensor Data.
@ SI1133_REG_INFO1
Info 1.
@ SI1133_REG_REV_ID
Hardware revision.
@ SI1133_REG_HOSTOUT7
Captured Sensor Data.
@ SI1133_REG_PART_ID
Part ID.
@ SI1133_REG_HOSTOUT12
Captured Sensor Data.
@ SI1133_REG_HOSTOUT24
Captured Sensor Data.
@ SI1133_REG_HOSTOUT8
Captured Sensor Data.
@ SI1133_REG_HOSTOUT21
Captured Sensor Data.
@ SI1133_REG_HOSTOUT15
Captured Sensor Data.
@ SI1133_REG_HOSTOUT9
Captured Sensor Data.
@ SI1133_REG_HOSTOUT20
Captured Sensor Data.
@ SI1133_REG_HOSTIN2
Host 2.
@ SI1133_REG_HOSTIN0
Host 0 -Data for parameter table on PARAM_SET write to COMMAND register.
@ SI1133_REG_HOSTOUT3
Captured Sensor Data.
@ SI1133_REG_HOSTOUT1
Captured Sensor Data.
@ SI1133_REG_HOSTOUT6
Captured Sensor Data.
@ SI1133_REG_RESPONSE0
Chip state and error status.
@ SI1133_REG_HOSTOUT14
Captured Sensor Data.
@ SI1133_REG_HOSTOUT11
Captured Sensor Data.
@ SI1133_REG_INFO0
Info 0.
@ SI1133_REG_HW_ID
Hardware ID.
@ SI1133_REG_HOSTOUT17
Captured Sensor Data.
@ SI1133_REG_RESPONSE1
Contains the readback value from a query or a set command.
@ SI1133_REG_HOSTOUT0
Captured Sensor Data.
Si1133_error
@ SI_OK
@ SI_FAIL
Si1133_error SI1133_deinit(void)
Si1133_error SI1133_measure_lux_uv(float *lux, float *uvi)
float SI1133_get_uv_index(void)
Si1133_response
@ SI1133_RSP0_CHIPSTAT_MASK
Chip state mask in Response0 register.
@ SI1133_RSP0_SLEEP
Sleep state indicator bit mask in Response0 register.
@ SI1133_RSP0_COUNTER_MASK
Command counter and error indicator mask in Response0 register.
Si1133_error SI1133_get_measurement(float *lux, float *uvi)
Si1133_command
@ SI1133_CMD_RESET
Forces a Reset.
@ SI1133_CMD_PAUSE_CH
Pauses autonomous measurements.
@ SI1133_CMD_NEW_ADDR
Stores the new I2C address.
@ SI1133_CMD_FORCE_CH
Initiates a set of measurements specified in CHAN_LIST parameter.
@ SI1133_CMD_RESET_CMD_CTR
Resets the command counter.
@ SI1133_CMD_PARAM_SET
Sets a parameter.
@ SI1133_CMD_START
Starts autonomous measurements.
@ SI1133_CMD_PARAM_QUERY
Reads a parameter.
Si1133_error SI1133_init(void)
Si1133_parameter
@ SI1133_PARAM_ADCPOST2
ADC resolution, shift and threshold settings for Channel 2.
@ SI1133_PARAM_THRESHOLD1_L
Threshold level 1 LSB.
@ SI1133_PARAM_ADCPOST5
ADC resolution, shift and threshold settings for Channel 5.
@ SI1133_PARAM_ADCSENS1
ADC sensitivity setting for Channel 1.
@ SI1133_PARAM_ADCSENS3
ADC sensitivity setting for Channel 3.
@ SI1133_PARAM_MEASCOUNT1
Measurement rate extension counter 1.
@ SI1133_PARAM_MEASCONFIG1
ADC measurement counter selection for Channel 1.
@ SI1133_PARAM_MEASRATE_H
Main measurement rate counter MSB.
@ SI1133_PARAM_ADCCONFIG3
ADC config for Channel 3
@ SI1133_PARAM_ADCCONFIG1
ADC config for Channel 1.
@ SI1133_PARAM_MEASCONFIG4
ADC measurement counter selection for Channel 4.
@ SI1133_PARAM_THRESHOLD0_L
Threshold level 0 LSB.
@ SI1133_PARAM_THRESHOLD0_H
Threshold level 0 MSB.
@ SI1133_PARAM_CH_LIST
Channel list.
@ SI1133_PARAM_I2C_ADDR
I2C address.
@ SI1133_PARAM_MEASCONFIG0
ADC measurement counter selection for Channel 0.
@ SI1133_PARAM_ADCPOST4
ADC resolution, shift and threshold settings for Channel 4.
@ SI1133_PARAM_ADCSENS4
ADC sensitivity setting for Channel 4.
@ SI1133_PARAM_MEASCONFIG5
ADC measurement counter selection for Channel 5.
@ SI1133_PARAM_ADCSENS5
ADC sensitivity setting for Channel 5.
@ SI1133_PARAM_MEASCOUNT2
Measurement rate extension counter 2.
@ SI1133_PARAM_ADCCONFIG2
ADC config for Channel 2.
@ SI1133_PARAM_MEASCOUNT0
Measurement rate extension counter 0.
@ SI1133_PARAM_ADCSENS0
ADC sensitivity setting for Channel 0.
@ SI1133_PARAM_MEASCONFIG3
ADC measurement counter selection for Channel 3.
@ SI1133_PARAM_THRESHOLD2_H
Threshold level 2 MSB.
@ SI1133_PARAM_ADCSENS2
ADC sensitivity setting for Channel 2.
@ SI1133_PARAM_ADCCONFIG4
ADC config for Channel 4.
@ SI1133_PARAM_ADCCONFIG0
ADC config for Channel 0.
@ SI1133_PARAM_MEASRATE_L
Main measurement rate counter LSB.
@ SI1133_PARAM_ADCPOST0
ADC resolution, shift and threshold settings for Channel 0.
@ SI1133_PARAM_BURST
Burst enable and burst count.
@ SI1133_PARAM_THRESHOLD2_L
Threshold level 2 LSB.
@ SI1133_PARAM_ADCCONFIG5
ADC config for Channel 5.
@ SI1133_PARAM_ADCPOST3
ADC resolution, shift and threshold settings for Channel 3.
@ SI1133_PARAM_ADCPOST1
ADC resolution, shift and threshold settings for Channel 1.
@ SI1133_PARAM_MEASCONFIG2
ADC measurement counter selection for Channel 2.
@ SI1133_PARAM_THRESHOLD1_H
Threshold level 1 MSB.
Si1133_error SI1133_get_hardware_id(uint8_t *hardware_id)
struct __attribute((packed))
Structure to store the data measured by the Si1133.
float SI1133_get_light_level(void)
Si1133_samples
uint16_t mag
Magnitude.
int16_t info
Info.