acea1e10d09ee96ae9f8077bf0f5e081370a9290
[apps/native/st-things-blind.git] / inc / resource_internal.h
1 /*
2  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
3  *
4  * Contact: Jin Yoon <jinny.yoon@samsung.com>
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an AS IS BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19 #ifndef __POSITION_FINDER_RESOURCE_INTERNAL_H__
20 #define __POSITION_FINDER_RESOURCE_INTERNAL_H__
21
22 #include <peripheral_io.h>
23
24 #include "resource/resource_illuminance_sensor_internal.h"
25
26 #define PIN_MAX 40
27
28 struct _resource_s {
29         int opened;
30         peripheral_gpio_h sensor_h;
31         void (*close) (int);
32 };
33 typedef struct _resource_s resource_s;
34
35 typedef void (*resource_read_cb)(double value, void *data);
36
37 struct _resource_read_cb_s {
38         resource_read_cb cb;
39         void *data;
40         int pin_num;
41 };
42 typedef struct _resource_read_cb_s resource_read_s;
43
44 extern resource_s *resource_get_info(int pin_num);
45 extern void resource_close_all(void);
46
47 #endif /* __POSITION_FINDER_RESOURCE_INTERNAL_H__ */