Si1145/6/7 UV/Ambient light/Proximity sensors¶
Device driver for the Si1145/6/7 sensors family.
This driver provides [S]ensor [A]ctuator [U]ber [L]ayer capabilities.
-
enum
si114x_ret_code_t
¶ - SI114X_OK
- SI114X_ERR_I2C
- SI114X_ERR_NODEV
-
enum
si114x_led_current_t
¶ - SI114X_PS_LED1
= 1
- 5.6mA
- SI114X_PS_LED2
- 11.2mA
- SI114X_PS_LED3
- 22.4mA
- SI114X_PS_LED4
- 45mA
- SI114X_PS_LED5
- 67mA
- SI114X_PS_LED6
- 90mA
- SI114X_PS_LED7
- 112mA
- SI114X_PS_LED8
- 135mA
- SI114X_PS_LED9
- 157mA
- SI114X_PS_LED10
- 180mA
- SI114X_PS_LED11
- 202mA
- SI114X_PS_LED12
- 224mA
- SI114X_PS_LED13
- 269mA
- SI114X_PS_LED14
- 314mA
- SI114X_PS_LED15
- 359mA
- SI114X_PS_LED1
-
int8_t
si114x_init
(si114x_t * dev, const si114x_params_t * params)¶ Initialize the given Si114x device.
Parameters
dev: Initialized device descriptor of Si114x device params: Initialization parameters Return values
- SI114X_OK: all good
- -SI114X_ERR_I2C: I2C bus cannot be initialized
- -SI114X_ERR_NODEV: not a valid Si114x device
-
uint16_t
si114x_read_uv
(si114x_t * dev)¶ Read UV index from the given Si114x device.
Parameters
dev: Device descriptor of Si114x device to read from Return values
- UV index
-
uint16_t
si114x_read_ir
(si114x_t * dev)¶ Read IR light value from the given Si114x device, returned in lx.
Parameters
dev: Device descriptor of Si114x device to read from Return values
- IR light in lx
-
uint16_t
si114x_read_visible
(si114x_t * dev)¶ Read visible light value from the given Si114x device, returned in lx.
Parameters
dev: Device descriptor of Si114x device to read from Return values
- Visible light in lx
-
uint16_t
si114x_read_distance
(si114x_t * dev)¶ Read distance measure from the given Si114x device, returned in ADC counts.
Parameters
dev: Device descriptor of Si114x device to read from Return values
- Distance in ADC counts
-
uint8_t
si114x_read_response
(si114x_t * dev)¶ Read the response register.
Parameters
dev: Device descriptor of Si114x device to read from Return values
- Device response register contents
-
struct
si114x_params_t
¶ Device initialization parameters.
-
i2c.h::i2c_t
i2c_dev
¶ I2C device which is used.
-
si114x.h::si114x_led_current_t
led_current
¶ Proximity LED current.
-
-
struct
si114x_t
¶ Device descriptor for the Si114x sensor.
-
si114x_params_t
params
¶ Si114x initialization parameters.
-
si114x_params_t