INCLUDE_DIRECTORIES(${INC_DIR}/gdbus)
INCLUDE_DIRECTORIES(${INC_DIR}/interface)
+SET(SRC_DIR src)
+INCLUDE_DIRECTORIES(${SRC_DIR}/gdbus)
+
INCLUDE(FindPkgConfig)
pkg_check_modules(${fw_name} REQUIRED ${dependents})
FOREACH(flag ${${fw_name}_CFLAGS})
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
#ifndef __PERIPHERAL_GDBUS_COMMON_H__
#define __PERIPHERAL_GDBUS_COMMON_H__
#include <gio/gio.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <gio/gunixfdlist.h>
+
+#include "peripheral_io.h"
+#include "peripheral_internal.h"
+#include "peripheral_common.h"
+#include "peripheral_io_gdbus.h"
#define PERIPHERAL_GDBUS_INTERFACE "org.tizen.peripheral_io"
#define PERIPHERAL_GDBUS_GPIO_PATH "/Org/Tizen/Peripheral_io/Gpio"
#ifndef __PERIPHERAL_GDBUS_GPIO_H__
#define __PERIPHERAL_GDBUS_GPIO_H__
+#include "peripheral_gdbus_common.h"
+
int peripheral_gdbus_gpio_open(peripheral_gpio_h gpio);
int peripheral_gdbus_gpio_close(peripheral_gpio_h gpio);
#ifndef __PERIPHERAL_GDBUS_I2C_H__
#define __PERIPHERAL_GDBUS_I2C_H__
+#include "peripheral_gdbus_common.h"
+
int peripheral_gdbus_i2c_open(peripheral_i2c_h i2c, int bus, int address);
int peripheral_gdbus_i2c_close(peripheral_i2c_h i2c);
#ifndef __PERIPHERAL_GDBUS_PWM_H__
#define __PERIPHERAL_GDBUS_PWM_H__
+#include "peripheral_gdbus_common.h"
+
int peripheral_gdbus_pwm_open(peripheral_pwm_h pwm, int chip, int pin);
int peripheral_gdbus_pwm_close(peripheral_pwm_h pwm);
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
#ifndef __PERIPHERAL_GDBUS_SPI_H_
#define __PERIPHERAL_GDBUS_SPI_H_
+#include "peripheral_gdbus_common.h"
+
int peripheral_gdbus_spi_open(peripheral_spi_h spi, int bus, int cs);
int peripheral_gdbus_spi_close(peripheral_spi_h spi);
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
#ifndef __PERIPHERAL_GDBUS_UART_H_
#define __PERIPHERAL_GDBUS_UART_H_
+#include "peripheral_gdbus_common.h"
+
int peripheral_gdbus_uart_open(peripheral_uart_h uart, int port);
int peripheral_gdbus_uart_close(peripheral_uart_h uart);
#ifndef __PERIPHERAL_INTERFACE_COMMON_H__
#define __PERIPHERAL_INTERFACE_COMMON_H__
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include "peripheral_io.h"
+#include "peripheral_internal.h"
+#include "peripheral_common.h"
+
#define CHECK_ERROR(val) \
do { \
if (val < 0) { \
#ifndef __PERIPHERAL_INTERFACE_GPIO_H__
#define __PERIPHERAL_INTERFACE_GPIO_H__
-#include "peripheral_io.h"
+#include "peripheral_interface_common.h"
#define SYSFS_GPIO_DIR "/sys/class/gpio"
#define GPIO_BUFFER_MAX 64
#ifndef __PERIPHERAL_INTERFACE_I2C_H__
#define __PERIPHERAL_INTERFACE_I2C_H__
-#include <stdint.h>
-
-#include "peripheral_io.h"
+#include "peripheral_interface_common.h"
#define SYSFS_I2C_DIR "/dev/i2c"
#define I2C_BUFFER_MAX 64
#ifndef __PERIPHERAL_INTERFACE_PWM_H__
#define __PERIPHERAL_INTERFACE_PWM_H__
-#include "peripheral_io.h"
+#include "peripheral_interface_common.h"
/**
* @brief pwm_close() deinit pwm pin.
#ifndef __PERIPHERAL_INTERFACE_SPI_H__
#define __PERIPHERAL_INTERFACE_SPI_H__
-#include "peripheral_io.h"
+#include "peripheral_interface_common.h"
int peripheral_interface_spi_close(peripheral_spi_h spi);
int peripheral_interface_spi_set_mode(peripheral_spi_h spi, peripheral_spi_mode_e mode);
#ifndef __PERIPHERAL_INTERFACE_UART_H__
#define __PERIPHERAL_INTERFACE_UART_H__
-#include "peripheral_io.h"
-
-#include <stdint.h>
+#include "peripheral_interface_common.h"
/**
* @brief uart_close() closes uart port.
* limitations under the License.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <gio/gunixfdlist.h>
-
-#include "peripheral_io.h"
-#include "peripheral_gdbus_common.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
-#include "peripheral_io_gdbus.h"
+#include "peripheral_gdbus_gpio.h"
#define GPIO_FD_INDEX_DIRECTION 0
#define GPIO_FD_INDEX_EDGE 1
* limitations under the License.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <gio/gunixfdlist.h>
-
-#include "peripheral_io.h"
-#include "peripheral_gdbus_common.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
-#include "peripheral_io_gdbus.h"
+#include "peripheral_gdbus_i2c.h"
#define I2C_FD_INDEX 0
* limitations under the License.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <gio/gunixfdlist.h>
-
-#include "peripheral_io.h"
-#include "peripheral_gdbus_common.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
-#include "peripheral_io_gdbus.h"
+#include "peripheral_gdbus_pwm.h"
#define PWM_FD_INDEX_PERIOD 0
#define PWM_FD_INDEX_DUTY_CYCLE 1
* limitations under the License.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <gio/gunixfdlist.h>
-
-#include "peripheral_io.h"
-#include "peripheral_gdbus_common.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
-#include "peripheral_io_gdbus.h"
+#include "peripheral_gdbus_spi.h"
#define SPI_FD_INDEX 0
* limitations under the License.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <gio/gunixfdlist.h>
-
-#include "peripheral_io.h"
-#include "peripheral_gdbus_common.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
-#include "peripheral_io_gdbus.h"
+#include "peripheral_gdbus_uart.h"
#define UART_FD_INDEX 0
* limitations under the License.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <poll.h>
-
-#include "peripheral_interface_common.h"
#include "peripheral_interface_gpio.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
#define MAX_ERR_LEN 255
* limitations under the License.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
#include <sys/ioctl.h>
-#include "peripheral_interface_common.h"
#include "peripheral_interface_i2c.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
#define MAX_ERR_LEN 255
* limitations under the License.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdbool.h>
-
-#include "peripheral_interface_common.h"
#include "peripheral_interface_pwm.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
#define SYSFS_PWM_PATH "/sys/class/pwm"
* limitations under the License.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/spi/spidev.h>
-#include "peripheral_interface_common.h"
#include "peripheral_interface_spi.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
#define SYSFS_SPI_DIR "/dev/spidev"
#define SYSFS_SPI_BUFSIZ "/sys/module/spidev/parameters/bufsiz"
* limitations under the License.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
#include <termios.h>
-#include <stdbool.h>
-#include <sys/ioctl.h>
-#include "peripheral_interface_common.h"
#include "peripheral_interface_uart.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
#define PATH_BUF_MAX 64
#define UART_BUF_MAX 16