Loading...
Searching...
No Matches

Internal addresses, registers, constants for the Si1133 sensors family. More...

Detailed Description

Internal addresses, registers, constants for the Si1133 sensors family.

Internal addresses, registers, constants for the Si1133 sensor.

Author
iosabi iosab.nosp@m.i@pr.nosp@m.otonm.nosp@m.ail..nosp@m.com

Definition in file si1133_internals.h.

#include <stdint.h>
+ Include dependency graph for si1133_internals.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _si1133_channel_params
 Si1133 channel parameters. More...
 

Typedefs

typedef struct _si1133_channel_params si1133_channel_params_t
 Si1133 channel parameters.
 
#define SI1133_I2C_ADDRESS   (0x52) /* or 0x55 */
 Si1133 I2C address.
 

Si1133 registers

#define SI1133_REG_PART_ID   (0x00)
 
#define SI1133_REG_HW_ID   (0x01)
 
#define SI1133_REG_REV_ID   (0x02)
 
#define SI1133_REG_INFO0   (0x03)
 
#define SI1133_REG_INFO1   (0x04)
 
#define SI1133_REG_HOSTIN0   (0x0a)
 
#define SI1133_REG_COMMAND   (0x0b)
 
#define SI1133_REG_IRQENABLE   (0x0f) /* Also RESET in the datasheet.*/
 
#define SI1133_REG_RESPONSE1   (0x10)
 
#define SI1133_REG_RESPONSE0   (0x11)
 
#define SI1133_REG_IRQ_STATUS   (0x12)
 
#define SI1133_REG_HOSTOUTx   (0x13) /* Ranges from 0x13 to 0x2c */
 

Si1133 commands

#define SI1133_CMD_RESET_CMD_CTR   (0x00)
 
#define SI1133_CMD_RESET_SW   (0x01)
 
#define SI1133_CMD_FORCE   (0x11)
 
#define SI1133_CMD_PAUSE   (0x12)
 
#define SI1133_CMD_START   (0x13)
 
#define SI1133_CMD_PARAM_QUERY   (0x40) /* Add to SI1133_PARAM_* */
 
#define SI1133_CMD_PARAM_SET   (0x80) /* Add to SI1133_PARAM_* */
 

Si1133 parameters

Note
These parameters are not accessible directly from the I2C registers. Instead, to access these parameters SI1133_CMD_PARAM_QUERY and SI1133_CMD_PARAM_SET commands should be used.
#define SI1133_PARAM_I2C_ADDR   (0x00)
 
#define SI1133_PARAM_CHAN_LIST   (0x01)
 
#define SI1133_PARAM_ADCCONFIG0   (0x02)
 
#define SI1133_PARAM_ADCSENS0   (0x03)
 
#define SI1133_PARAM_ADCPOST0   (0x04)
 
#define SI1133_PARAM_MEASCONFIG0   (0x05)
 
#define SI1133_PARAM_ADCCONFIG1   (0x06)
 
#define SI1133_PARAM_ADCSENS1   (0x07)
 
#define SI1133_PARAM_ADCPOST1   (0x08)
 
#define SI1133_PARAM_MEASCONFIG1   (0x09)
 
#define SI1133_PARAM_ADCCONFIG2   (0x0a)
 
#define SI1133_PARAM_ADCSENS2   (0x0b)
 
#define SI1133_PARAM_ADCPOST2   (0x0c)
 
#define SI1133_PARAM_MEASCONFIG2   (0x0d)
 
#define SI1133_PARAM_ADCCONFIG3   (0x0e)
 
#define SI1133_PARAM_ADCSENS3   (0x0f)
 
#define SI1133_PARAM_ADCPOST3   (0x10)
 
#define SI1133_PARAM_MEASCONFIG3   (0x11)
 
#define SI1133_PARAM_ADCCONFIG4   (0x12)
 
#define SI1133_PARAM_ADCSENS4   (0x13)
 
#define SI1133_PARAM_ADCPOST4   (0x14)
 
#define SI1133_PARAM_MEASCONFIG4   (0x15)
 
#define SI1133_PARAM_ADCCONFIG5   (0x16)
 
#define SI1133_PARAM_ADCSENS5   (0x17)
 
#define SI1133_PARAM_ADCPOST5   (0x18)
 
#define SI1133_PARAM_MEASCONFIG5   (0x19)
 
#define SI1133_PARAM_MEASRATE_H   (0x1a)
 
#define SI1133_PARAM_MEASRATE_L   (0x1b)
 
#define SI1133_PARAM_MEASCOUNT0   (0x1c)
 
#define SI1133_PARAM_MEASCOUNT1   (0x1d)
 
#define SI1133_PARAM_MEASCOUNT2   (0x1e)
 
#define SI1133_PARAM_THRESHOLD0_H   (0x25)
 
#define SI1133_PARAM_THRESHOLD0_L   (0x26)
 
#define SI1133_PARAM_THRESHOLD1_H   (0x27)
 
#define SI1133_PARAM_THRESHOLD1_L   (0x28)
 
#define SI1133_PARAM_THRESHOLD2_H   (0x29)
 
#define SI1133_PARAM_THRESHOLD2_L   (0x2a)
 
#define SI1133_PARAM_BURST   (0x2b)
 

Si1133 RESPONSE0 register constants

#define SI1133_RESP0_COUNTER_MASK   (0x0f)
 
#define SI1133_RESP0_CMD_ERR_MASK   (0x10)
 
#define SI1133_RESP0_SLEEP_MASK   (0x20)
 
#define SI1133_RESP0_SUSPEND_MASK   (0x40)
 
#define SI1133_RESP0_RUNNING_MASK   (0x80)
 
#define SI1133_RESP0_ERR_INVALID_COMMAND   (0x01)
 
#define SI1133_RESP0_ERR_INVALID_PARAM_ADDR   (0x80)
 
#define SI1133_RESP0_ERR_ADC_OVERFLOW   (0x88)
 
#define SI1133_RESP0_ERR_BUFFER_OVERFLOW   (0x89)
 

Si1133 Channel configuration constants

#define SI1133_ADCCONFIG_DECIM_RATE_MASK   (0x60)
 
#define SI1133_ADCCONFIG_DECIM_RATE_SHIFT   (5u)
 
#define SI1133_ADCCONFIG_ADCMUX_MASK   (0x1f)
 
#define SI1133_ADCCONFIG_ADCMUX_SHIFT   (0u)
 
#define SI1133_ADCSENS_HSIG_MASK   (0x80)
 
#define SI1133_ADCSENS_SW_GAIN_MASK   (0x70)
 
#define SI1133_ADCSENS_SW_GAIN_SHIFT   (4u)
 
#define SI1133_ADCSENS_HW_GAIN_MASK   (0x0f)
 
#define SI1133_ADCSENS_HW_GAIN_SHIFT   (0u)
 
#define SI1133_ADCPOST_24BIT_OUT_MASK   (0x40)
 
#define SI1133_ADCPOST_POSTSHIFT_MASK   (0x38)
 
#define SI1133_ADCPOST_POSTSHIFT_SHIFT   (3u)
 
#define SI1133_ADCPOST_THRESH_SEL_MASK   (0x03)
 
#define SI1133_ADCPOST_THRESH_SEL_SHIFT   (0u)
 
#define SI1133_MEASCONFIG_COUNTER_IDX_MASK   (0xc0)
 
#define SI1133_MEASCONFIG_COUNTER_IDX_SHIFT   (6u)
 

Si1133 photodiode selection values for ADCMUX field.

#define SI1133_ADCMUX_SMALL_IR   (0u)
 
#define SI1133_ADCMUX_MEDIUM_IR   (1u)
 
#define SI1133_ADCMUX_LARGE_IR   (2u)
 
#define SI1133_ADCMUX_WHITE   (11u)
 
#define SI1133_ADCMUX_LARGE_WHITE   (13u)
 
#define SI1133_ADCMUX_UV   (24u)
 
#define SI1133_ADCMUX_DEEP_UV   (25u)
 

Si1133 constants

#define SI1133_ID   (0x33)
 
#define SI1133_STARTUP_TIME_MS   (25u)
 
#define SI1133_NUM_CHANNELS   (6u)
 

Macro Definition Documentation

◆ SI1133_ADCCONFIG_ADCMUX_MASK

#define SI1133_ADCCONFIG_ADCMUX_MASK   (0x1f)

Definition at line 152 of file si1133_internals.h.

◆ SI1133_ADCCONFIG_ADCMUX_SHIFT

#define SI1133_ADCCONFIG_ADCMUX_SHIFT   (0u)

Definition at line 153 of file si1133_internals.h.

◆ SI1133_ADCCONFIG_DECIM_RATE_MASK

#define SI1133_ADCCONFIG_DECIM_RATE_MASK   (0x60)

Definition at line 150 of file si1133_internals.h.

◆ SI1133_ADCCONFIG_DECIM_RATE_SHIFT

#define SI1133_ADCCONFIG_DECIM_RATE_SHIFT   (5u)

Definition at line 151 of file si1133_internals.h.

◆ SI1133_ADCMUX_DEEP_UV

#define SI1133_ADCMUX_DEEP_UV   (25u)

Definition at line 181 of file si1133_internals.h.

◆ SI1133_ADCMUX_LARGE_IR

#define SI1133_ADCMUX_LARGE_IR   (2u)

Definition at line 177 of file si1133_internals.h.

◆ SI1133_ADCMUX_LARGE_WHITE

#define SI1133_ADCMUX_LARGE_WHITE   (13u)

Definition at line 179 of file si1133_internals.h.

◆ SI1133_ADCMUX_MEDIUM_IR

#define SI1133_ADCMUX_MEDIUM_IR   (1u)

Definition at line 176 of file si1133_internals.h.

◆ SI1133_ADCMUX_SMALL_IR

#define SI1133_ADCMUX_SMALL_IR   (0u)

Definition at line 175 of file si1133_internals.h.

◆ SI1133_ADCMUX_UV

#define SI1133_ADCMUX_UV   (24u)

Definition at line 180 of file si1133_internals.h.

◆ SI1133_ADCMUX_WHITE

#define SI1133_ADCMUX_WHITE   (11u)

Definition at line 178 of file si1133_internals.h.

◆ SI1133_ADCPOST_24BIT_OUT_MASK

#define SI1133_ADCPOST_24BIT_OUT_MASK   (0x40)

Definition at line 161 of file si1133_internals.h.

◆ SI1133_ADCPOST_POSTSHIFT_MASK

#define SI1133_ADCPOST_POSTSHIFT_MASK   (0x38)

Definition at line 162 of file si1133_internals.h.

◆ SI1133_ADCPOST_POSTSHIFT_SHIFT

#define SI1133_ADCPOST_POSTSHIFT_SHIFT   (3u)

Definition at line 163 of file si1133_internals.h.

◆ SI1133_ADCPOST_THRESH_SEL_MASK

#define SI1133_ADCPOST_THRESH_SEL_MASK   (0x03)

Definition at line 164 of file si1133_internals.h.

◆ SI1133_ADCPOST_THRESH_SEL_SHIFT

#define SI1133_ADCPOST_THRESH_SEL_SHIFT   (0u)

Definition at line 165 of file si1133_internals.h.

◆ SI1133_ADCSENS_HSIG_MASK

#define SI1133_ADCSENS_HSIG_MASK   (0x80)

Definition at line 155 of file si1133_internals.h.

◆ SI1133_ADCSENS_HW_GAIN_MASK

#define SI1133_ADCSENS_HW_GAIN_MASK   (0x0f)

Definition at line 158 of file si1133_internals.h.

◆ SI1133_ADCSENS_HW_GAIN_SHIFT

#define SI1133_ADCSENS_HW_GAIN_SHIFT   (0u)

Definition at line 159 of file si1133_internals.h.

◆ SI1133_ADCSENS_SW_GAIN_MASK

#define SI1133_ADCSENS_SW_GAIN_MASK   (0x70)

Definition at line 156 of file si1133_internals.h.

◆ SI1133_ADCSENS_SW_GAIN_SHIFT

#define SI1133_ADCSENS_SW_GAIN_SHIFT   (4u)

Definition at line 157 of file si1133_internals.h.

◆ SI1133_CMD_FORCE

#define SI1133_CMD_FORCE   (0x11)

Definition at line 59 of file si1133_internals.h.

◆ SI1133_CMD_PARAM_QUERY

#define SI1133_CMD_PARAM_QUERY   (0x40) /* Add to SI1133_PARAM_* */

Definition at line 62 of file si1133_internals.h.

◆ SI1133_CMD_PARAM_SET

#define SI1133_CMD_PARAM_SET   (0x80) /* Add to SI1133_PARAM_* */

Definition at line 63 of file si1133_internals.h.

◆ SI1133_CMD_PAUSE

#define SI1133_CMD_PAUSE   (0x12)

Definition at line 60 of file si1133_internals.h.

◆ SI1133_CMD_RESET_CMD_CTR

#define SI1133_CMD_RESET_CMD_CTR   (0x00)

Definition at line 57 of file si1133_internals.h.

◆ SI1133_CMD_RESET_SW

#define SI1133_CMD_RESET_SW   (0x01)

Definition at line 58 of file si1133_internals.h.

◆ SI1133_CMD_START

#define SI1133_CMD_START   (0x13)

Definition at line 61 of file si1133_internals.h.

◆ SI1133_I2C_ADDRESS

#define SI1133_I2C_ADDRESS   (0x52) /* or 0x55 */

Si1133 I2C address.

Definition at line 33 of file si1133_internals.h.

◆ SI1133_ID

#define SI1133_ID   (0x33)

Definition at line 188 of file si1133_internals.h.

◆ SI1133_MEASCONFIG_COUNTER_IDX_MASK

#define SI1133_MEASCONFIG_COUNTER_IDX_MASK   (0xc0)

Definition at line 167 of file si1133_internals.h.

◆ SI1133_MEASCONFIG_COUNTER_IDX_SHIFT

#define SI1133_MEASCONFIG_COUNTER_IDX_SHIFT   (6u)

Definition at line 168 of file si1133_internals.h.

◆ SI1133_NUM_CHANNELS

#define SI1133_NUM_CHANNELS   (6u)

Definition at line 190 of file si1133_internals.h.

◆ SI1133_PARAM_ADCCONFIG0

#define SI1133_PARAM_ADCCONFIG0   (0x02)

Definition at line 91 of file si1133_internals.h.

◆ SI1133_PARAM_ADCCONFIG1

#define SI1133_PARAM_ADCCONFIG1   (0x06)

Definition at line 95 of file si1133_internals.h.

◆ SI1133_PARAM_ADCCONFIG2

#define SI1133_PARAM_ADCCONFIG2   (0x0a)

Definition at line 99 of file si1133_internals.h.

◆ SI1133_PARAM_ADCCONFIG3

#define SI1133_PARAM_ADCCONFIG3   (0x0e)

Definition at line 103 of file si1133_internals.h.

◆ SI1133_PARAM_ADCCONFIG4

#define SI1133_PARAM_ADCCONFIG4   (0x12)

Definition at line 107 of file si1133_internals.h.

◆ SI1133_PARAM_ADCCONFIG5

#define SI1133_PARAM_ADCCONFIG5   (0x16)

Definition at line 111 of file si1133_internals.h.

◆ SI1133_PARAM_ADCPOST0

#define SI1133_PARAM_ADCPOST0   (0x04)

Definition at line 93 of file si1133_internals.h.

◆ SI1133_PARAM_ADCPOST1

#define SI1133_PARAM_ADCPOST1   (0x08)

Definition at line 97 of file si1133_internals.h.

◆ SI1133_PARAM_ADCPOST2

#define SI1133_PARAM_ADCPOST2   (0x0c)

Definition at line 101 of file si1133_internals.h.

◆ SI1133_PARAM_ADCPOST3

#define SI1133_PARAM_ADCPOST3   (0x10)

Definition at line 105 of file si1133_internals.h.

◆ SI1133_PARAM_ADCPOST4

#define SI1133_PARAM_ADCPOST4   (0x14)

Definition at line 109 of file si1133_internals.h.

◆ SI1133_PARAM_ADCPOST5

#define SI1133_PARAM_ADCPOST5   (0x18)

Definition at line 113 of file si1133_internals.h.

◆ SI1133_PARAM_ADCSENS0

#define SI1133_PARAM_ADCSENS0   (0x03)

Definition at line 92 of file si1133_internals.h.

◆ SI1133_PARAM_ADCSENS1

#define SI1133_PARAM_ADCSENS1   (0x07)

Definition at line 96 of file si1133_internals.h.

◆ SI1133_PARAM_ADCSENS2

#define SI1133_PARAM_ADCSENS2   (0x0b)

Definition at line 100 of file si1133_internals.h.

◆ SI1133_PARAM_ADCSENS3

#define SI1133_PARAM_ADCSENS3   (0x0f)

Definition at line 104 of file si1133_internals.h.

◆ SI1133_PARAM_ADCSENS4

#define SI1133_PARAM_ADCSENS4   (0x13)

Definition at line 108 of file si1133_internals.h.

◆ SI1133_PARAM_ADCSENS5

#define SI1133_PARAM_ADCSENS5   (0x17)

Definition at line 112 of file si1133_internals.h.

◆ SI1133_PARAM_BURST

#define SI1133_PARAM_BURST   (0x2b)

Definition at line 126 of file si1133_internals.h.

◆ SI1133_PARAM_CHAN_LIST

#define SI1133_PARAM_CHAN_LIST   (0x01)

Definition at line 90 of file si1133_internals.h.

◆ SI1133_PARAM_I2C_ADDR

#define SI1133_PARAM_I2C_ADDR   (0x00)

Definition at line 89 of file si1133_internals.h.

◆ SI1133_PARAM_MEASCONFIG0

#define SI1133_PARAM_MEASCONFIG0   (0x05)

Definition at line 94 of file si1133_internals.h.

◆ SI1133_PARAM_MEASCONFIG1

#define SI1133_PARAM_MEASCONFIG1   (0x09)

Definition at line 98 of file si1133_internals.h.

◆ SI1133_PARAM_MEASCONFIG2

#define SI1133_PARAM_MEASCONFIG2   (0x0d)

Definition at line 102 of file si1133_internals.h.

◆ SI1133_PARAM_MEASCONFIG3

#define SI1133_PARAM_MEASCONFIG3   (0x11)

Definition at line 106 of file si1133_internals.h.

◆ SI1133_PARAM_MEASCONFIG4

#define SI1133_PARAM_MEASCONFIG4   (0x15)

Definition at line 110 of file si1133_internals.h.

◆ SI1133_PARAM_MEASCONFIG5

#define SI1133_PARAM_MEASCONFIG5   (0x19)

Definition at line 114 of file si1133_internals.h.

◆ SI1133_PARAM_MEASCOUNT0

#define SI1133_PARAM_MEASCOUNT0   (0x1c)

Definition at line 117 of file si1133_internals.h.

◆ SI1133_PARAM_MEASCOUNT1

#define SI1133_PARAM_MEASCOUNT1   (0x1d)

Definition at line 118 of file si1133_internals.h.

◆ SI1133_PARAM_MEASCOUNT2

#define SI1133_PARAM_MEASCOUNT2   (0x1e)

Definition at line 119 of file si1133_internals.h.

◆ SI1133_PARAM_MEASRATE_H

#define SI1133_PARAM_MEASRATE_H   (0x1a)

Definition at line 115 of file si1133_internals.h.

◆ SI1133_PARAM_MEASRATE_L

#define SI1133_PARAM_MEASRATE_L   (0x1b)

Definition at line 116 of file si1133_internals.h.

◆ SI1133_PARAM_THRESHOLD0_H

#define SI1133_PARAM_THRESHOLD0_H   (0x25)

Definition at line 120 of file si1133_internals.h.

◆ SI1133_PARAM_THRESHOLD0_L

#define SI1133_PARAM_THRESHOLD0_L   (0x26)

Definition at line 121 of file si1133_internals.h.

◆ SI1133_PARAM_THRESHOLD1_H

#define SI1133_PARAM_THRESHOLD1_H   (0x27)

Definition at line 122 of file si1133_internals.h.

◆ SI1133_PARAM_THRESHOLD1_L

#define SI1133_PARAM_THRESHOLD1_L   (0x28)

Definition at line 123 of file si1133_internals.h.

◆ SI1133_PARAM_THRESHOLD2_H

#define SI1133_PARAM_THRESHOLD2_H   (0x29)

Definition at line 124 of file si1133_internals.h.

◆ SI1133_PARAM_THRESHOLD2_L

#define SI1133_PARAM_THRESHOLD2_L   (0x2a)

Definition at line 125 of file si1133_internals.h.

◆ SI1133_REG_COMMAND

#define SI1133_REG_COMMAND   (0x0b)

Definition at line 45 of file si1133_internals.h.

◆ SI1133_REG_HOSTIN0

#define SI1133_REG_HOSTIN0   (0x0a)

Definition at line 44 of file si1133_internals.h.

◆ SI1133_REG_HOSTOUTx

#define SI1133_REG_HOSTOUTx   (0x13) /* Ranges from 0x13 to 0x2c */

Definition at line 50 of file si1133_internals.h.

◆ SI1133_REG_HW_ID

#define SI1133_REG_HW_ID   (0x01)

Definition at line 40 of file si1133_internals.h.

◆ SI1133_REG_INFO0

#define SI1133_REG_INFO0   (0x03)

Definition at line 42 of file si1133_internals.h.

◆ SI1133_REG_INFO1

#define SI1133_REG_INFO1   (0x04)

Definition at line 43 of file si1133_internals.h.

◆ SI1133_REG_IRQ_STATUS

#define SI1133_REG_IRQ_STATUS   (0x12)

Definition at line 49 of file si1133_internals.h.

◆ SI1133_REG_IRQENABLE

#define SI1133_REG_IRQENABLE   (0x0f) /* Also RESET in the datasheet.*/

Definition at line 46 of file si1133_internals.h.

◆ SI1133_REG_PART_ID

#define SI1133_REG_PART_ID   (0x00)

Definition at line 39 of file si1133_internals.h.

◆ SI1133_REG_RESPONSE0

#define SI1133_REG_RESPONSE0   (0x11)

Definition at line 48 of file si1133_internals.h.

◆ SI1133_REG_RESPONSE1

#define SI1133_REG_RESPONSE1   (0x10)

Definition at line 47 of file si1133_internals.h.

◆ SI1133_REG_REV_ID

#define SI1133_REG_REV_ID   (0x02)

Definition at line 41 of file si1133_internals.h.

◆ SI1133_RESP0_CMD_ERR_MASK

#define SI1133_RESP0_CMD_ERR_MASK   (0x10)

Definition at line 134 of file si1133_internals.h.

◆ SI1133_RESP0_COUNTER_MASK

#define SI1133_RESP0_COUNTER_MASK   (0x0f)

Definition at line 133 of file si1133_internals.h.

◆ SI1133_RESP0_ERR_ADC_OVERFLOW

#define SI1133_RESP0_ERR_ADC_OVERFLOW   (0x88)

Definition at line 142 of file si1133_internals.h.

◆ SI1133_RESP0_ERR_BUFFER_OVERFLOW

#define SI1133_RESP0_ERR_BUFFER_OVERFLOW   (0x89)

Definition at line 143 of file si1133_internals.h.

◆ SI1133_RESP0_ERR_INVALID_COMMAND

#define SI1133_RESP0_ERR_INVALID_COMMAND   (0x01)

Definition at line 140 of file si1133_internals.h.

◆ SI1133_RESP0_ERR_INVALID_PARAM_ADDR

#define SI1133_RESP0_ERR_INVALID_PARAM_ADDR   (0x80)

Definition at line 141 of file si1133_internals.h.

◆ SI1133_RESP0_RUNNING_MASK

#define SI1133_RESP0_RUNNING_MASK   (0x80)

Definition at line 137 of file si1133_internals.h.

◆ SI1133_RESP0_SLEEP_MASK

#define SI1133_RESP0_SLEEP_MASK   (0x20)

Definition at line 135 of file si1133_internals.h.

◆ SI1133_RESP0_SUSPEND_MASK

#define SI1133_RESP0_SUSPEND_MASK   (0x40)

Definition at line 136 of file si1133_internals.h.

◆ SI1133_STARTUP_TIME_MS

#define SI1133_STARTUP_TIME_MS   (25u)

Definition at line 189 of file si1133_internals.h.

Typedef Documentation

◆ si1133_channel_params_t

Si1133 channel parameters.

These parameters define how a "channel" is sampled, ADC settings, resolution timing, etc. These four register values define a single channel. This is a convenience struct to handle them together in the same order as they appear in the parameter list below.