#ifndef __POSITION_FINDER_RESOURCE_H__
#define __POSITION_FINDER_RESOURCE_H__
-#include <peripheral_io.h>
-
-#include "resource_internal.h"
#include "resource/resource_infrared_obstacle_avoidance_sensor.h"
#endif /* __POSITION_FINDER_RESOURCE_H__ */
#ifndef __POSITION_FINDER_RESOURCE_INFRARED_OBSTACLE_AVOIDANCE_SENSOR_H__
#define __POSITION_FINDER_RESOURCE_INFRARED_OBSTACLE_AVOIDANCE_SENSOR_H__
+#include "resource_type.h"
-#include <stdint.h>
-#include "resource_internal.h"
/**
* @brief Reads the value of gpio connected infrared obstacle avoidance sensor.
* @param[in] pin_num The number of the gpio pin connected to the infrared obstacle avoidance sensor
* @return 0 on success, otherwise a negative error value
* @see If the gpio pin is not open, creates gpio handle before reading the value of gpio.
*/
-extern int resource_read_infrared_obstacle_avoidance_sensor(int pin_num, uint32_t *out_value);
+extern int resource_read_infrared_obstacle_avoidance_sensor(int pin_num, unsigned int *out_value);
extern int resource_set_infrared_obstacle_avoidance_sensor_interrupted_cb(int pin_num, resource_changed_cb cb, void *data);
#define __POSITION_FINDER_RESOURCE_INTERNAL_H__
#include <peripheral_io.h>
-#include <stdint.h>
+#include "resource_type.h"
#define PIN_MAX 40
-typedef void (*resource_read_cb)(double value, void *data);
-
typedef struct _resource_read_cb_s {
resource_read_cb cb;
void *data;
int pin_num;
} resource_read_s;
-typedef void (*resource_changed_cb)(unsigned int value, void *data);
-
typedef struct _resource_changed_s {
resource_changed_cb cb;
void *data;
resource_changed_s *resource_changed_info;
} resource_s;
-
extern resource_s *resource_get_info(int pin_num);
extern void resource_close_all(void);
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Contact: Jin Yoon <jinny.yoon@samsung.com>
+ * Geunsun Lee <gs86.lee@samsung.com>
+ * Eunyoung Lee <ey928.lee@samsung.com>
+ * Junkyu Han <junkyu.han@samsung.com>
+ *
+ * Licensed under the Flora License, Version 1.1 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __POSITION_FINDER_RESOURCE_TYPE_H__
+#define __POSITION_FINDER_RESOURCE_TYPE_H__
+
+typedef void (*resource_read_cb)(double value, void *data);
+typedef void (*resource_changed_cb)(unsigned int value, void *data);
+
+#endif /* __POSITION_FINDER_RESOURCE_TYPE_H__ */
#include <peripheral_io.h>
#include "log.h"
-#include "resource.h"
+#include "resource_internal.h"
static resource_s resource_info[PIN_MAX] = { {0, NULL, NULL}, };
*/
#include <stdlib.h>
-#include <unistd.h>
#include <peripheral_io.h>
-#include <sys/time.h>
-
#include "log.h"
#include "resource_internal.h"
return 0;
}
-int resource_read_infrared_obstacle_avoidance_sensor(int pin_num, uint32_t *out_value)
+int resource_read_infrared_obstacle_avoidance_sensor(int pin_num, unsigned int *out_value)
{
int ret = PERIPHERAL_ERROR_NONE;