21#ifndef SI1133_INTERNALS_H
22#define SI1133_INTERNALS_H
33#define SI1133_I2C_ADDRESS (0x52)
39#define SI1133_REG_PART_ID (0x00)
40#define SI1133_REG_HW_ID (0x01)
41#define SI1133_REG_REV_ID (0x02)
42#define SI1133_REG_INFO0 (0x03)
43#define SI1133_REG_INFO1 (0x04)
44#define SI1133_REG_HOSTIN0 (0x0a)
45#define SI1133_REG_COMMAND (0x0b)
46#define SI1133_REG_IRQENABLE (0x0f)
47#define SI1133_REG_RESPONSE1 (0x10)
48#define SI1133_REG_RESPONSE0 (0x11)
49#define SI1133_REG_IRQ_STATUS (0x12)
50#define SI1133_REG_HOSTOUTx (0x13)
57#define SI1133_CMD_RESET_CMD_CTR (0x00)
58#define SI1133_CMD_RESET_SW (0x01)
59#define SI1133_CMD_FORCE (0x11)
60#define SI1133_CMD_PAUSE (0x12)
61#define SI1133_CMD_START (0x13)
62#define SI1133_CMD_PARAM_QUERY (0x40)
63#define SI1133_CMD_PARAM_SET (0x80)
89#define SI1133_PARAM_I2C_ADDR (0x00)
90#define SI1133_PARAM_CHAN_LIST (0x01)
91#define SI1133_PARAM_ADCCONFIG0 (0x02)
92#define SI1133_PARAM_ADCSENS0 (0x03)
93#define SI1133_PARAM_ADCPOST0 (0x04)
94#define SI1133_PARAM_MEASCONFIG0 (0x05)
95#define SI1133_PARAM_ADCCONFIG1 (0x06)
96#define SI1133_PARAM_ADCSENS1 (0x07)
97#define SI1133_PARAM_ADCPOST1 (0x08)
98#define SI1133_PARAM_MEASCONFIG1 (0x09)
99#define SI1133_PARAM_ADCCONFIG2 (0x0a)
100#define SI1133_PARAM_ADCSENS2 (0x0b)
101#define SI1133_PARAM_ADCPOST2 (0x0c)
102#define SI1133_PARAM_MEASCONFIG2 (0x0d)
103#define SI1133_PARAM_ADCCONFIG3 (0x0e)
104#define SI1133_PARAM_ADCSENS3 (0x0f)
105#define SI1133_PARAM_ADCPOST3 (0x10)
106#define SI1133_PARAM_MEASCONFIG3 (0x11)
107#define SI1133_PARAM_ADCCONFIG4 (0x12)
108#define SI1133_PARAM_ADCSENS4 (0x13)
109#define SI1133_PARAM_ADCPOST4 (0x14)
110#define SI1133_PARAM_MEASCONFIG4 (0x15)
111#define SI1133_PARAM_ADCCONFIG5 (0x16)
112#define SI1133_PARAM_ADCSENS5 (0x17)
113#define SI1133_PARAM_ADCPOST5 (0x18)
114#define SI1133_PARAM_MEASCONFIG5 (0x19)
115#define SI1133_PARAM_MEASRATE_H (0x1a)
116#define SI1133_PARAM_MEASRATE_L (0x1b)
117#define SI1133_PARAM_MEASCOUNT0 (0x1c)
118#define SI1133_PARAM_MEASCOUNT1 (0x1d)
119#define SI1133_PARAM_MEASCOUNT2 (0x1e)
120#define SI1133_PARAM_THRESHOLD0_H (0x25)
121#define SI1133_PARAM_THRESHOLD0_L (0x26)
122#define SI1133_PARAM_THRESHOLD1_H (0x27)
123#define SI1133_PARAM_THRESHOLD1_L (0x28)
124#define SI1133_PARAM_THRESHOLD2_H (0x29)
125#define SI1133_PARAM_THRESHOLD2_L (0x2a)
126#define SI1133_PARAM_BURST (0x2b)
133#define SI1133_RESP0_COUNTER_MASK (0x0f)
134#define SI1133_RESP0_CMD_ERR_MASK (0x10)
135#define SI1133_RESP0_SLEEP_MASK (0x20)
136#define SI1133_RESP0_SUSPEND_MASK (0x40)
137#define SI1133_RESP0_RUNNING_MASK (0x80)
140#define SI1133_RESP0_ERR_INVALID_COMMAND (0x01)
141#define SI1133_RESP0_ERR_INVALID_PARAM_ADDR (0x80)
142#define SI1133_RESP0_ERR_ADC_OVERFLOW (0x88)
143#define SI1133_RESP0_ERR_BUFFER_OVERFLOW (0x89)
150#define SI1133_ADCCONFIG_DECIM_RATE_MASK (0x60)
151#define SI1133_ADCCONFIG_DECIM_RATE_SHIFT (5u)
152#define SI1133_ADCCONFIG_ADCMUX_MASK (0x1f)
153#define SI1133_ADCCONFIG_ADCMUX_SHIFT (0u)
155#define SI1133_ADCSENS_HSIG_MASK (0x80)
156#define SI1133_ADCSENS_SW_GAIN_MASK (0x70)
157#define SI1133_ADCSENS_SW_GAIN_SHIFT (4u)
158#define SI1133_ADCSENS_HW_GAIN_MASK (0x0f)
159#define SI1133_ADCSENS_HW_GAIN_SHIFT (0u)
161#define SI1133_ADCPOST_24BIT_OUT_MASK (0x40)
162#define SI1133_ADCPOST_POSTSHIFT_MASK (0x38)
163#define SI1133_ADCPOST_POSTSHIFT_SHIFT (3u)
164#define SI1133_ADCPOST_THRESH_SEL_MASK (0x03)
165#define SI1133_ADCPOST_THRESH_SEL_SHIFT (0u)
167#define SI1133_MEASCONFIG_COUNTER_IDX_MASK (0xc0)
168#define SI1133_MEASCONFIG_COUNTER_IDX_SHIFT (6u)
175#define SI1133_ADCMUX_SMALL_IR (0u)
176#define SI1133_ADCMUX_MEDIUM_IR (1u)
177#define SI1133_ADCMUX_LARGE_IR (2u)
178#define SI1133_ADCMUX_WHITE (11u)
179#define SI1133_ADCMUX_LARGE_WHITE (13u)
180#define SI1133_ADCMUX_UV (24u)
181#define SI1133_ADCMUX_DEEP_UV (25u)
188#define SI1133_ID (0x33)
189#define SI1133_STARTUP_TIME_MS (25u)
190#define SI1133_NUM_CHANNELS (6u)
struct _si1133_channel_params si1133_channel_params_t
Si1133 channel parameters.
Si1133 channel parameters.
uint8_t adcsens
ADCSENSx register.
uint8_t measconfig
MEASCONFIGx register.
uint8_t adcpost
ADCPOSTx register.
uint8_t adcconfig
ADCCONFIGx register.