saul.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Freie Universit├Ąt Berlin
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 
44 #ifndef SAUL_H
45 #define SAUL_H
46 
47 #include <stdint.h>
48 #include <errno.h>
49 
50 #include "phydat.h"
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
84 enum {
85  SAUL_CAT_UNDEF = 0x00,
86  SAUL_CAT_ACT = 0x40,
87  SAUL_CAT_SENSE = 0x80,
88 };
89 
93 enum {
101  /* Extend this list as needed, but keep SAUL_ACT_ID_ANY the first and
102  * SAUL_ACT_NUMOF the last entry
103  */
104 };
105 
109 enum {
138  /* Extend this list as needed, but keep SAUL_SENSE_ID_ANY the first and
139  * SAUL_SENSE_NUMOF the last entry
140  */
141 };
142 
149 enum {
184  /* extend this list as needed... */
185 };
186 
191 enum {
192  SAUL_CAT_MASK = 0xc0,
193  SAUL_ID_MASK = 0x3f,
194 };
214 typedef int(*saul_read_t)(const void *dev, phydat_t *res);
215 
234 typedef int(*saul_write_t)(const void *dev, phydat_t *data);
235 
239 typedef struct {
242  uint8_t type;
243 } saul_driver_t;
244 
248 int saul_notsup(const void *dev, phydat_t *dat);
249 
258 const char *saul_class_to_str(const uint8_t class_id);
259 
260 #ifdef __cplusplus
261 }
262 #endif
263 
264 #endif /* SAUL_H */
265 
Actuator device class.
Definition: saul.h:86
sensor: proximity
Definition: saul.h:174
sensor: occupancy
Definition: saul.h:173
sensor: capacitance
Definition: saul.h:133
device class undefined
Definition: saul.h:85
actuator: servo motor
Definition: saul.h:96
sensor: magnetometer
Definition: saul.h:116
sensor: temperature
Definition: saul.h:158
int(* saul_write_t)(const void *dev, phydat_t *data)
Write a value (a set of values) to a device.
Definition: saul.h:234
sensor: pulse counter
Definition: saul.h:169
sensor: pH
Definition: saul.h:135
int(* saul_read_t)(const void *dev, phydat_t *res)
Read a value (a set of values) from a device.
Definition: saul.h:214
Generic data container for physical data interface.
sensor: power
Definition: saul.h:182
actuator: RGB LED
Definition: saul.h:95
actuator: simple on/off switch
Definition: saul.h:98
sensor: RSSI
Definition: saul.h:175
sensor: (light) color
Definition: saul.h:118
sensor: TVOC Gas
Definition: saul.h:126
sensor: CO2 Gas
Definition: saul.h:171
sensor: TVOC Gas
Definition: saul.h:172
const char * saul_class_to_str(const uint8_t class_id)
Helper function converts a class ID to a string.
sensor: UV index
Definition: saul.h:121
sensor: voltage
Definition: saul.h:180
Definition of the RIOT actuator/sensor interface.
Definition: saul.h:239
any actuator - wildcard
Definition: saul.h:94
sensor: distance
Definition: saul.h:124
actuator: dimmable switch
Definition: saul.h:99
sensor: coulomb counter
Definition: saul.h:176
sensor: voltage
Definition: saul.h:134
sensor: pressure
Definition: saul.h:165
sensor: particulate matter
Definition: saul.h:178
sensor: object temperature
Definition: saul.h:168
sensor: CO2 Gas
Definition: saul.h:125
sensor: coulomb counter
Definition: saul.h:130
sensor: power
Definition: saul.h:136
actuator: simple on/off switch
Definition: saul.h:154
sensor: (light) color
Definition: saul.h:164
actuator: RGB LED
Definition: saul.h:151
sensor: RSSI
Definition: saul.h:129
sensor: ammeter
Definition: saul.h:177
sensor: UV index
Definition: saul.h:167
sensor: light
Definition: saul.h:160
sensor: distance
Definition: saul.h:170
Generic data structure for expressing physical values.
Definition: phydat.h:145
saul_write_t write
write function pointer
Definition: saul.h:241
actuator: motor
Definition: saul.h:153
any actuator - wildcard
Definition: saul.h:150
sensor: simple button
Definition: saul.h:111
int saul_notsup(const void *dev, phydat_t *dat)
Default not supported function.
sensor: humidity
Definition: saul.h:159
Bitmask to obtain the category ID.
Definition: saul.h:192
any device - wildcard
Definition: saul.h:183
Bitmask to obtain the intra-category ID.
Definition: saul.h:193
sensor: simple button
Definition: saul.h:157
sensor: humidity
Definition: saul.h:113
sensor: pulse counter
Definition: saul.h:123
sensor: proximity
Definition: saul.h:128
sensor: raw analog value
Definition: saul.h:120
sensor: capacitance
Definition: saul.h:179
sensor: particulate matter
Definition: saul.h:132
any sensor - wildcard
Definition: saul.h:156
Number of actuators supported.
Definition: saul.h:100
sensor: ammeter
Definition: saul.h:131
actuator: servo motor
Definition: saul.h:152
actuator: motor
Definition: saul.h:97
sensor: magnetometer
Definition: saul.h:162
actuator: dimmable switch
Definition: saul.h:155
sensor: gyroscope
Definition: saul.h:117
sensor: accelerometer
Definition: saul.h:161
sensor: pH
Definition: saul.h:181
any sensor - wildcard
Definition: saul.h:110
sensor: accelerometer
Definition: saul.h:115
sensor: pressure
Definition: saul.h:119
uint8_t type
device class the device belongs to
Definition: saul.h:242
sensor: light
Definition: saul.h:114
sensor: object temperature
Definition: saul.h:122
sensor: temperature
Definition: saul.h:112
sensor: gyroscope
Definition: saul.h:163
Number of actuators supported.
Definition: saul.h:137
Sensor device class.
Definition: saul.h:87
sensor: raw analog value
Definition: saul.h:166
sensor: occupancy
Definition: saul.h:127
saul_read_t read
read function pointer
Definition: saul.h:240