si114x.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2018 Inria
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
25 #ifndef SI114X_H
26 #define SI114X_H
27 
28 #include "saul.h"
29 #include "periph/i2c.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
38 typedef enum {
39  SI114X_OK,
40  SI114X_ERR_I2C,
41  SI114X_ERR_NODEV
43 
47 typedef enum {
64 
68 typedef struct {
72 
73 
77 typedef struct {
79 } si114x_t;
80 
91 int8_t si114x_init(si114x_t *dev, const si114x_params_t * params);
92 
100 uint16_t si114x_read_uv(si114x_t *dev);
101 
109 uint16_t si114x_read_ir(si114x_t *dev);
110 
118 uint16_t si114x_read_visible(si114x_t *dev);
119 
128 uint16_t si114x_read_distance(si114x_t *dev);
129 
137 uint8_t si114x_read_response(si114x_t *dev);
138 
139 #ifdef __cplusplus
140 }
141 #endif
142 
143 #endif /* SI114X_H */
144 
si114x_params_t::i2c_dev
i2c_t i2c_dev
I2C device which is used.
Definition: si114x.h:69
SI114X_PS_LED7
@ SI114X_PS_LED7
112mA
Definition: si114x.h:54
si114x_init
int8_t si114x_init(si114x_t *dev, const si114x_params_t *params)
Initialize the given Si114x device.
si114x_read_ir
uint16_t si114x_read_ir(si114x_t *dev)
Read IR light value from the given Si114x device, returned in lx.
si114x_read_uv
uint16_t si114x_read_uv(si114x_t *dev)
Read UV index from the given Si114x device.
si114x_read_distance
uint16_t si114x_read_distance(si114x_t *dev)
Read distance measure from the given Si114x device, returned in ADC counts.
i2c_t
unsigned int i2c_t
Default i2c_t type definition.
Definition: i2c.h:151
SI114X_PS_LED2
@ SI114X_PS_LED2
11.2mA
Definition: si114x.h:49
si114x_read_visible
uint16_t si114x_read_visible(si114x_t *dev)
Read visible light value from the given Si114x device, returned in lx.
SI114X_PS_LED14
@ SI114X_PS_LED14
314mA
Definition: si114x.h:61
SI114X_PS_LED6
@ SI114X_PS_LED6
90mA
Definition: si114x.h:53
SI114X_PS_LED15
@ SI114X_PS_LED15
359mA
Definition: si114x.h:62
si114x_ret_code_t
si114x_ret_code_t
Initialization return codes.
Definition: si114x.h:38
SI114X_PS_LED9
@ SI114X_PS_LED9
157mA
Definition: si114x.h:56
si114x_read_response
uint8_t si114x_read_response(si114x_t *dev)
Read the response register.
SI114X_PS_LED13
@ SI114X_PS_LED13
269mA
Definition: si114x.h:60
si114x_t
Device descriptor for the Si114x sensor.
Definition: si114x.h:77
SI114X_PS_LED4
@ SI114X_PS_LED4
45mA
Definition: si114x.h:51
si114x_params_t::led_current
si114x_led_current_t led_current
Proximity LED current.
Definition: si114x.h:70
SI114X_PS_LED5
@ SI114X_PS_LED5
67mA
Definition: si114x.h:52
SI114X_PS_LED10
@ SI114X_PS_LED10
180mA
Definition: si114x.h:57
SI114X_PS_LED8
@ SI114X_PS_LED8
135mA
Definition: si114x.h:55
si114x_t::params
si114x_params_t params
Si114x initialization parameters.
Definition: si114x.h:78
SI114X_PS_LED12
@ SI114X_PS_LED12
224mA
Definition: si114x.h:59
saul.h
Definition of the generic [S]ensor [A]ctuator [U]ber [L]ayer.
si114x_led_current_t
si114x_led_current_t
Active LED current parameters.
Definition: si114x.h:47
si114x_params_t
Device initialization parameters.
Definition: si114x.h:68
i2c.h
Low-level I2C peripheral driver interface definition.
SI114X_PS_LED3
@ SI114X_PS_LED3
22.4mA
Definition: si114x.h:50
SI114X_PS_LED1
@ SI114X_PS_LED1
5.6mA
Definition: si114x.h:48
SI114X_PS_LED11
@ SI114X_PS_LED11
202mA
Definition: si114x.h:58