From: Segwon Date: Tue, 21 Nov 2017 05:24:50 +0000 (+0900) Subject: handle: change file name "peripheral_bus.h" to "peripheral_handle.h" X-Git-Tag: submit/tizen_4.0/20171220.125806^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8477e86feed71be3c8ee26401e74574897c201c7;p=platform%2Fcore%2Fsystem%2Fperipheral-bus.git handle: change file name "peripheral_bus.h" to "peripheral_handle.h" Change-Id: I1d65506dd9601ece9b685ee388332d484da26c24 Signed-off-by: Segwon --- diff --git a/include/handle/peripheral_handle.h b/include/handle/peripheral_handle.h new file mode 100644 index 0000000..595ca2c --- /dev/null +++ b/include/handle/peripheral_handle.h @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2016-2017 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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 __PERIPHERAL_BUS_H__ +#define __PERIPHERAL_BUS_H__ + +#include + +#include "peripheral_io_gdbus.h" +#include "peripheral_bus_board.h" + +typedef enum { + PERIPHERAL_BUS_TYPE_GPIO = 0, + PERIPHERAL_BUS_TYPE_I2C, + PERIPHERAL_BUS_TYPE_PWM, + PERIPHERAL_BUS_TYPE_UART, + PERIPHERAL_BUS_TYPE_SPI, +} peripheral_bus_type_e; + +typedef struct { + pb_board_s *board; + /* devices */ + GList *gpio_list; + GList *i2c_list; + GList *pwm_list; + GList *uart_list; + GList *spi_list; + /* gdbus variable */ + guint reg_id; + GDBusConnection *connection; + PeripheralIoGdbusGpio *gpio_skeleton; + PeripheralIoGdbusI2c *i2c_skeleton; + PeripheralIoGdbusPwm *pwm_skeleton; + PeripheralIoGdbusUart *uart_skeleton; + PeripheralIoGdbusSpi *spi_skeleton; +} peripheral_bus_s; + +typedef struct { + char *id; + pid_t pid; + pid_t pgid; +} pb_client_info_s; + +typedef struct { + int pin; +} peripheral_bus_gpio_s; + +typedef struct { + int bus; + int address; + int fd; +} peripheral_bus_i2c_s; + +typedef struct { + int chip; + int pin; +} peripheral_bus_pwm_s; + +typedef struct { + int port; + int fd; +} peripheral_bus_uart_s; + +typedef struct { + int bus; + int cs; + int fd; +} peripheral_bus_spi_s; + +typedef struct { + peripheral_bus_type_e type; + uint watch_id; + GList **list; + /* client info */ + pb_client_info_s client_info; + union { + peripheral_bus_gpio_s gpio; + peripheral_bus_i2c_s i2c; + peripheral_bus_pwm_s pwm; + peripheral_bus_uart_s uart; + peripheral_bus_spi_s spi; + } dev; +} peripheral_bus_data_s; + +typedef peripheral_bus_data_s *pb_data_h; + +#endif /* __PERIPHERAL_BUS_H__ */ diff --git a/include/handle/peripheral_handle_common.h b/include/handle/peripheral_handle_common.h index ef5cc17..1341b21 100644 --- a/include/handle/peripheral_handle_common.h +++ b/include/handle/peripheral_handle_common.h @@ -19,7 +19,8 @@ #include -#include "peripheral_bus.h" +#include "peripheral_handle.h" +#include "peripheral_log.h" pb_data_h peripheral_bus_data_new(GList **plist); int peripheral_bus_data_free(pb_data_h handle); diff --git a/include/peripheral_bus.h b/include/peripheral_bus.h deleted file mode 100644 index 595ca2c..0000000 --- a/include/peripheral_bus.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2016-2017 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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 __PERIPHERAL_BUS_H__ -#define __PERIPHERAL_BUS_H__ - -#include - -#include "peripheral_io_gdbus.h" -#include "peripheral_bus_board.h" - -typedef enum { - PERIPHERAL_BUS_TYPE_GPIO = 0, - PERIPHERAL_BUS_TYPE_I2C, - PERIPHERAL_BUS_TYPE_PWM, - PERIPHERAL_BUS_TYPE_UART, - PERIPHERAL_BUS_TYPE_SPI, -} peripheral_bus_type_e; - -typedef struct { - pb_board_s *board; - /* devices */ - GList *gpio_list; - GList *i2c_list; - GList *pwm_list; - GList *uart_list; - GList *spi_list; - /* gdbus variable */ - guint reg_id; - GDBusConnection *connection; - PeripheralIoGdbusGpio *gpio_skeleton; - PeripheralIoGdbusI2c *i2c_skeleton; - PeripheralIoGdbusPwm *pwm_skeleton; - PeripheralIoGdbusUart *uart_skeleton; - PeripheralIoGdbusSpi *spi_skeleton; -} peripheral_bus_s; - -typedef struct { - char *id; - pid_t pid; - pid_t pgid; -} pb_client_info_s; - -typedef struct { - int pin; -} peripheral_bus_gpio_s; - -typedef struct { - int bus; - int address; - int fd; -} peripheral_bus_i2c_s; - -typedef struct { - int chip; - int pin; -} peripheral_bus_pwm_s; - -typedef struct { - int port; - int fd; -} peripheral_bus_uart_s; - -typedef struct { - int bus; - int cs; - int fd; -} peripheral_bus_spi_s; - -typedef struct { - peripheral_bus_type_e type; - uint watch_id; - GList **list; - /* client info */ - pb_client_info_s client_info; - union { - peripheral_bus_gpio_s gpio; - peripheral_bus_i2c_s i2c; - peripheral_bus_pwm_s pwm; - peripheral_bus_uart_s uart; - peripheral_bus_spi_s spi; - } dev; -} peripheral_bus_data_s; - -typedef peripheral_bus_data_s *pb_data_h; - -#endif /* __PERIPHERAL_BUS_H__ */ diff --git a/src/gdbus/peripheral_gdbus_gpio.c b/src/gdbus/peripheral_gdbus_gpio.c index 5bd576b..4bb0fe3 100644 --- a/src/gdbus/peripheral_gdbus_gpio.c +++ b/src/gdbus/peripheral_gdbus_gpio.c @@ -18,7 +18,7 @@ #include #include "peripheral_io_gdbus.h" -#include "peripheral_bus.h" +#include "peripheral_handle.h" #include "peripheral_handle_gpio.h" #include "peripheral_log.h" #include "peripheral_gdbus_gpio.h" diff --git a/src/gdbus/peripheral_gdbus_i2c.c b/src/gdbus/peripheral_gdbus_i2c.c index 5ba2da4..5f23353 100644 --- a/src/gdbus/peripheral_gdbus_i2c.c +++ b/src/gdbus/peripheral_gdbus_i2c.c @@ -17,7 +17,7 @@ #include #include "peripheral_io_gdbus.h" -#include "peripheral_bus.h" +#include "peripheral_handle.h" #include "peripheral_handle_i2c.h" #include "peripheral_log.h" #include "peripheral_gdbus_i2c.h" diff --git a/src/gdbus/peripheral_gdbus_pwm.c b/src/gdbus/peripheral_gdbus_pwm.c index ac42ff2..2f1adf8 100644 --- a/src/gdbus/peripheral_gdbus_pwm.c +++ b/src/gdbus/peripheral_gdbus_pwm.c @@ -17,7 +17,7 @@ #include #include "peripheral_io_gdbus.h" -#include "peripheral_bus.h" +#include "peripheral_handle.h" #include "peripheral_handle_pwm.h" #include "peripheral_log.h" #include "peripheral_gdbus_pwm.h" diff --git a/src/gdbus/peripheral_gdbus_spi.c b/src/gdbus/peripheral_gdbus_spi.c index df7b9e8..9910670 100644 --- a/src/gdbus/peripheral_gdbus_spi.c +++ b/src/gdbus/peripheral_gdbus_spi.c @@ -17,7 +17,7 @@ #include #include "peripheral_io_gdbus.h" -#include "peripheral_bus.h" +#include "peripheral_handle.h" #include "peripheral_handle_spi.h" #include "peripheral_log.h" #include "peripheral_gdbus_spi.h" diff --git a/src/gdbus/peripheral_gdbus_uart.c b/src/gdbus/peripheral_gdbus_uart.c index c0698e1..740001c 100644 --- a/src/gdbus/peripheral_gdbus_uart.c +++ b/src/gdbus/peripheral_gdbus_uart.c @@ -17,7 +17,7 @@ #include #include "peripheral_io_gdbus.h" -#include "peripheral_bus.h" +#include "peripheral_handle.h" #include "peripheral_handle_uart.h" #include "peripheral_log.h" #include "peripheral_gdbus_uart.h" diff --git a/src/handle/peripheral_handle_common.c b/src/handle/peripheral_handle_common.c index bbd6b61..fb30ee8 100644 --- a/src/handle/peripheral_handle_common.c +++ b/src/handle/peripheral_handle_common.c @@ -17,7 +17,6 @@ #include #include "peripheral_handle_common.h" -#include "peripheral_log.h" pb_data_h peripheral_bus_data_new(GList **plist) { diff --git a/src/handle/peripheral_handle_gpio.c b/src/handle/peripheral_handle_gpio.c index 9c788ed..c92be1e 100644 --- a/src/handle/peripheral_handle_gpio.c +++ b/src/handle/peripheral_handle_gpio.c @@ -24,8 +24,6 @@ #include #include "peripheral_interface_gpio.h" -#include "peripheral_bus.h" -#include "peripheral_log.h" #include "peripheral_handle_common.h" static bool peripheral_bus_gpio_is_available(int pin, peripheral_bus_s *pb_data) diff --git a/src/handle/peripheral_handle_i2c.c b/src/handle/peripheral_handle_i2c.c index 5cea9c9..899725a 100644 --- a/src/handle/peripheral_handle_i2c.c +++ b/src/handle/peripheral_handle_i2c.c @@ -21,8 +21,6 @@ #include #include "peripheral_interface_i2c.h" -#include "peripheral_bus.h" -#include "peripheral_log.h" #include "peripheral_handle_common.h" #define INITIAL_BUFFER_SIZE 128 diff --git a/src/handle/peripheral_handle_pwm.c b/src/handle/peripheral_handle_pwm.c index 73d46e8..1f38f36 100644 --- a/src/handle/peripheral_handle_pwm.c +++ b/src/handle/peripheral_handle_pwm.c @@ -21,8 +21,6 @@ #include #include "peripheral_interface_pwm.h" -#include "peripheral_bus.h" -#include "peripheral_log.h" #include "peripheral_handle_common.h" static bool peripheral_bus_pwm_is_available(int chip, int pin, peripheral_bus_s *pb_data) diff --git a/src/handle/peripheral_handle_spi.c b/src/handle/peripheral_handle_spi.c index 52a7331..c0615c8 100644 --- a/src/handle/peripheral_handle_spi.c +++ b/src/handle/peripheral_handle_spi.c @@ -21,8 +21,6 @@ #include #include "peripheral_interface_spi.h" -#include "peripheral_bus.h" -#include "peripheral_log.h" #include "peripheral_handle_common.h" static bool __peripheral_bus_spi_is_available(int bus, int cs, peripheral_bus_s *pb_data) diff --git a/src/handle/peripheral_handle_uart.c b/src/handle/peripheral_handle_uart.c index bc87d5d..64191c5 100644 --- a/src/handle/peripheral_handle_uart.c +++ b/src/handle/peripheral_handle_uart.c @@ -21,9 +21,6 @@ #include #include "peripheral_interface_uart.h" -#include "peripheral_io_gdbus.h" -#include "peripheral_bus.h" -#include "peripheral_log.h" #include "peripheral_handle_common.h" #define INITIAL_BUFFER_SIZE 128 diff --git a/src/peripheral_bus.c b/src/peripheral_bus.c index d4c038f..1d14112 100644 --- a/src/peripheral_bus.c +++ b/src/peripheral_bus.c @@ -23,7 +23,7 @@ #include #include "peripheral_io_gdbus.h" -#include "peripheral_bus.h" +#include "peripheral_handle.h" #include "peripheral_log.h" #include "peripheral_gdbus_gpio.h" #include "peripheral_gdbus_i2c.h"