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 {
70  si114x_led_current_t led_current;
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 
180mA
Definition: si114x.h:57
11.2mA
Definition: si114x.h:49
uint16_t si114x_read_uv(si114x_t *dev)
Read UV index from the given Si114x device.
45mA
Definition: si114x.h:51
135mA
Definition: si114x.h:55
269mA
Definition: si114x.h:60
Device initialization parameters.
Definition: si114x.h:68
unsigned int i2c_t
Default i2c_t type definition.
Definition: i2c.h:157
int8_t si114x_init(si114x_t *dev, const si114x_params_t *params)
Initialize the given Si114x device.
uint16_t si114x_read_visible(si114x_t *dev)
Read visible light value from the given Si114x device, returned in lx.
Definition of the generic [S]ensor [A]ctuator [U]ber [L]ayer.
90mA
Definition: si114x.h:53
si114x_params_t params
Si114x initialization parameters.
Definition: si114x.h:78
si114x_ret_code_t
Initialization return codes.
Definition: si114x.h:38
uint8_t si114x_read_response(si114x_t *dev)
Read the response register.
314mA
Definition: si114x.h:61
359mA
Definition: si114x.h:62
112mA
Definition: si114x.h:54
si114x_led_current_t
Active LED current parameters.
Definition: si114x.h:47
22.4mA
Definition: si114x.h:50
67mA
Definition: si114x.h:52
202mA
Definition: si114x.h:58
5.6mA
Definition: si114x.h:48
uint16_t si114x_read_ir(si114x_t *dev)
Read IR light value from the given Si114x device, returned in lx.
uint16_t si114x_read_distance(si114x_t *dev)
Read distance measure from the given Si114x device, returned in ADC counts.
i2c_t i2c_dev
I2C device which is used.
Definition: si114x.h:69
157mA
Definition: si114x.h:56
224mA
Definition: si114x.h:59
Device descriptor for the Si114x sensor.
Definition: si114x.h:77
si114x_led_current_t led_current
Proximity LED current.
Definition: si114x.h:70
Low-level I2C peripheral driver interface definition.