Filter results by

Older Versions

Older API versions are available as a download. To view, extract the file and open the index.html file in a web browser.

artik_sensor.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2017 Samsung Electronics All Rights Reserved.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing,
12  * software distributed under the License is distributed on an
13  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
14  * either express or implied. See the License for the specific
15  * language governing permissions and limitations under the License.
16  *
17  */
18 
19 #ifndef __ARTIK_SENSOR_H__
20 #define __ARTIK_SENSOR_H__
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 #include "artik_error.h"
27 #include "artik_types.h"
28 
46 #define MAX_NAME_LEN 64
47 
54 typedef void *artik_sensor_ops;
55 
62 typedef void *artik_sensor_handle;
63 
70 typedef enum {
71  ARTIK_SENSOR_ACCELEROMETER = 0x1L,
72  ARTIK_SENSOR_HUMIDITY = 0x4L,
73  ARTIK_SENSOR_LIGHT = 0x8L,
74  ARTIK_SENSOR_TEMPERATURE = 0x10L,
75  ARTIK_SENSOR_PROXIMITY = 0x20L,
76  ARTIK_SENSOR_FLAME = 0x40L,
77  ARTIK_SENSOR_HALL = 0x80L,
78  ARTIK_SENSOR_BAROMETER = 0x100L,
79  ARTIK_SENSOR_GYRO = 0x101L,
80  ARTIK_SENSOR_NONE = 0
82 
89 typedef struct {
90  /*
91  * \brief Pin used by the SENSOR module.
92  */
94  /*
95  * \brief Friendly name for the SENSOR module.
96  */
97  char *name;
98 
102  const void *config;
106  void *data_user;
107 
109 
116 typedef struct {
128  artik_error(*request) (artik_sensor_handle * handle,
129  artik_sensor_config * config);
139  artik_error(*release) (artik_sensor_handle handle);
154  artik_error(*get_speed_x) (artik_sensor_handle handle,
155  int *store);
168  artik_error(*get_speed_y) (artik_sensor_handle handle,
169  int *store);
183  artik_error(*get_speed_z) (artik_sensor_handle handle,
184  int *store);
185 
187 
194 typedef struct {
205  artik_error(*request) (artik_sensor_handle * handle,
206  artik_sensor_config * config);
216  artik_error(*release) (artik_sensor_handle handle);
229  artik_error(*get_yaw) (artik_sensor_handle handle,
230  int *store);
243  artik_error(*get_roll) (artik_sensor_handle handle,
244  int *store);
257  artik_error(*get_pitch) (artik_sensor_handle handle,
258  int *store);
259 
261 
268 typedef struct {
279  artik_error(*request) (artik_sensor_handle * handle,
280  artik_sensor_config * config);
290  artik_error(*release) (artik_sensor_handle handle);
305  artik_error(*get_humidity) (artik_sensor_handle handle,
306  int *store);
307 
309 
316 typedef struct {
327  artik_error(*request) (artik_sensor_handle * handle,
328  artik_sensor_config * config);
337  artik_error(*release) (artik_sensor_handle handle);
351  artik_error(*get_intensity) (artik_sensor_handle handle,
352  int *store);
353 
355 
362 typedef struct {
373  artik_error(*request) (artik_sensor_handle * handle,
374  artik_sensor_config * config);
384  artik_error(*release) (artik_sensor_handle handle);
398  artik_error(*get_celsius) (artik_sensor_handle handle,
399  int *store);
413  artik_error(*get_fahrenheit) (artik_sensor_handle handle,
414  int *store);
415 
417 
424 typedef struct {
435  artik_error(*request) (artik_sensor_handle * handle,
436  artik_sensor_config * config);
446  artik_error(*release) (artik_sensor_handle handle);
460  artik_error(*get_presence) (artik_sensor_handle handle,
461  int *store);
462 
464 
471 typedef struct {
482  artik_error(*request) (artik_sensor_handle * handle,
483  artik_sensor_config * config);
493  artik_error(*release) (artik_sensor_handle handle);
494 
509  artik_error(*get_signals) (artik_sensor_handle handle,
510  int *store);
511 
513 
520 typedef struct {
531  artik_error(*request) (artik_sensor_handle * handle,
532  artik_sensor_config * config);
542  artik_error(*release) (artik_sensor_handle handle);
543 
557  artik_error(*get_pressure) (artik_sensor_handle handle,
558  int *store);
559 
561 
568 typedef struct {
579  artik_error(*request) (artik_sensor_handle * handle,
580  artik_sensor_config * config);
590  artik_error(*release) (artik_sensor_handle handle);
591 
606  artik_error(*get_detection) (artik_sensor_handle handle,
607  int *store);
608 
610 
618 typedef struct {
636  artik_error(*request)(artik_sensor_config * config,
637  artik_sensor_handle * handle,
638  artik_sensor_ops * sensor);
645  artik_sensor_config * (*list)(void);
655  artik_sensor_config * (*get_sensor)(unsigned int index,
656  artik_sensor_device_t type);
657 
666  artik_sensor_config * (*get_accelerometer_sensor)(unsigned int index);
667 
676  artik_sensor_config * (*get_humidity_sensor)(unsigned int index);
677 
686  artik_sensor_config * (*get_light_sensor)(unsigned int index);
687 
697  artik_sensor_config * (*get_temperature_sensor)(unsigned int index);
698 
708  artik_sensor_config * (*get_proximity_sensor)(unsigned int index);
709 
718  artik_sensor_config * (*get_flame_sensor)(unsigned int index);
719 
728  artik_sensor_config * (*get_pressure_sensor)(unsigned int index);
729 
738  artik_sensor_config * (*get_gyro_sensor)(unsigned int index);
739 
748  artik_sensor_config * (*get_hall_sensor)(unsigned int index);
749 
751 
752 extern artik_sensor_module sensor_module;
753 
754 #ifdef __cplusplus
755 }
756 #endif
757 #endif /* __ARTIK_SENSOR_H__ */
SENSOR FLAME devices data structure.
Definition: artik_sensor.h:471
SENSOR PROXIMITY devices data structure.
Definition: artik_sensor.h:424
SENSOR HUMIDITY devices data structure.
Definition: artik_sensor.h:268
void * artik_sensor_handle
SENSOR handle type.
Definition: artik_sensor.h:62
SENSOR TEMPERATURE devices data structure.
Definition: artik_sensor.h:362
SENSOR LIGHT devices data structure.
Definition: artik_sensor.h:316
SENSOR HALL devices data structure.
Definition: artik_sensor.h:568
void * data_user
Pointer to data for internal use by the API.
Definition: artik_sensor.h:106
Custom types.
void * artik_sensor_ops
SENSOR device type.
Definition: artik_sensor.h:54
SENSOR ACCELEROMETER devices data structure.
Definition: artik_sensor.h:116
SENSOR GYROMETER devices data structure.
Definition: artik_sensor.h:194
const void * config
Pointer to config for internal use by the API.
Definition: artik_sensor.h:102
int artik_error
Error type.
Definition: artik_error.h:35
SENSOR PRESSURE devices data structure.
Definition: artik_sensor.h:520
SENSOR configuration structure.
Definition: artik_sensor.h:89
artik_sensor_device_t
SENSOR device type.
Definition: artik_sensor.h:70
Error codes.
SENSOR module operations.
Definition: artik_sensor.h:618
Last updated on: