Rename peripheral_pwm_context_h to peripheral_pwm_h 64/129464/1
authorjino.cho <jino.cho@samsung.com>
Tue, 16 May 2017 12:02:51 +0000 (21:02 +0900)
committerjino.cho <jino.cho@samsung.com>
Tue, 16 May 2017 12:02:51 +0000 (21:02 +0900)
Change-Id: I0e39d439d1095502b158b26a8be140aa3cad98fa
Signed-off-by: jino.cho <jino.cho@samsung.com>
include/peripheral_gdbus_pwm.h
include/peripheral_io.h
src/peripheral_gdbus_pwm.c
src/peripheral_pwm.c
test/peripheral-io-test.c

index 2d28514..9a302ef 100644 (file)
 void pwm_proxy_init(void);
 void pwm_proxy_deinit(void);
 
-int peripheral_gdbus_pwm_open(peripheral_pwm_context_h dev, int device, int channel);
-int peripheral_gdbus_pwm_close(peripheral_pwm_context_h dev);
-int peripheral_gdbus_pwm_get_duty_cycle(peripheral_pwm_context_h dev, int *duty_cycle);
-int peripheral_gdbus_pwm_set_duty_cycle(peripheral_pwm_context_h dev, int duty_cycle);
-int peripheral_gdbus_pwm_get_period(peripheral_pwm_context_h dev, int *period);
-int peripheral_gdbus_pwm_set_period(peripheral_pwm_context_h dev, int period);
-int peripheral_gdbus_pwm_set_enable(peripheral_pwm_context_h dev, peripheral_pwm_state_e enable);
+int peripheral_gdbus_pwm_open(peripheral_pwm_h dev, int device, int channel);
+int peripheral_gdbus_pwm_close(peripheral_pwm_h dev);
+int peripheral_gdbus_pwm_get_duty_cycle(peripheral_pwm_h dev, int *duty_cycle);
+int peripheral_gdbus_pwm_set_duty_cycle(peripheral_pwm_h dev, int duty_cycle);
+int peripheral_gdbus_pwm_get_period(peripheral_pwm_h dev, int *period);
+int peripheral_gdbus_pwm_set_period(peripheral_pwm_h dev, int period);
+int peripheral_gdbus_pwm_set_enable(peripheral_pwm_h dev, peripheral_pwm_state_e enable);
 
 #endif /* __PERIPHERAL_GDBUS_PWM_H__ */
index a8ed110..a0b7fad 100644 (file)
@@ -376,28 +376,33 @@ struct _peripheral_pwm_s {
        int duty_cycle;
        int enabled;
 };
-typedef struct _peripheral_pwm_s *peripheral_pwm_context_h;
+
+/**
+ * @brief The handle to the pwm device
+ * @since_tizen 4.0
+ */
+typedef struct _peripheral_pwm_s *peripheral_pwm_h;
 
 typedef enum {
        PERIPHERAL_PWM_DISABLE = 0,
        PERIPHERAL_PWM_ENABLE,
 } peripheral_pwm_state_e;
 
-peripheral_pwm_context_h peripheral_pwm_open(int device, int channel);
+peripheral_pwm_h peripheral_pwm_open(int device, int channel);
 
-int peripheral_pwm_close(peripheral_pwm_context_h pwm);
+int peripheral_pwm_close(peripheral_pwm_h pwm);
 
-int peripheral_pwm_set_duty_cycle(peripheral_pwm_context_h pwm, int duty_cycle);
+int peripheral_pwm_set_duty_cycle(peripheral_pwm_h pwm, int duty_cycle);
 
-int peripheral_pwm_set_period(peripheral_pwm_context_h pwm, int period);
+int peripheral_pwm_set_period(peripheral_pwm_h pwm, int period);
 
-int peripheral_pwm_set_enabled(peripheral_pwm_context_h pwm, peripheral_pwm_state_e enable);
+int peripheral_pwm_set_enabled(peripheral_pwm_h pwm, peripheral_pwm_state_e enable);
 
-int peripheral_pwm_is_enabled(peripheral_pwm_context_h pwm);
+int peripheral_pwm_is_enabled(peripheral_pwm_h pwm);
 
-int peripheral_pwm_get_duty_cycle(peripheral_pwm_context_h pwm, int *duty_cycle);
+int peripheral_pwm_get_duty_cycle(peripheral_pwm_h pwm, int *duty_cycle);
 
-int peripheral_pwm_get_period(peripheral_pwm_context_h pwm, int *period);
+int peripheral_pwm_get_period(peripheral_pwm_h pwm, int *period);
 
 
 /**
index db73dee..66883a2 100644 (file)
@@ -49,7 +49,7 @@ void pwm_proxy_deinit()
        }
 }
 
-int peripheral_gdbus_pwm_open(peripheral_pwm_context_h dev, int device, int channel)
+int peripheral_gdbus_pwm_open(peripheral_pwm_h dev, int device, int channel)
 {
        GError *error = NULL;
        gint32 ret = PERIPHERAL_ERROR_NONE;
@@ -72,7 +72,7 @@ int peripheral_gdbus_pwm_open(peripheral_pwm_context_h dev, int device, int chan
        return ret;
 }
 
-int peripheral_gdbus_pwm_close(peripheral_pwm_context_h dev)
+int peripheral_gdbus_pwm_close(peripheral_pwm_h dev)
 {
        GError *error = NULL;
        gint32 ret = PERIPHERAL_ERROR_NONE;
@@ -95,7 +95,7 @@ int peripheral_gdbus_pwm_close(peripheral_pwm_context_h dev)
        return ret;
 }
 
-int peripheral_gdbus_pwm_get_duty_cycle(peripheral_pwm_context_h dev, int *duty_cycle)
+int peripheral_gdbus_pwm_get_duty_cycle(peripheral_pwm_h dev, int *duty_cycle)
 {
        GError *error = NULL;
        gint32 ret = PERIPHERAL_ERROR_NONE;
@@ -118,7 +118,7 @@ int peripheral_gdbus_pwm_get_duty_cycle(peripheral_pwm_context_h dev, int *duty_
 
        return ret;
 }
-int peripheral_gdbus_pwm_set_duty_cycle(peripheral_pwm_context_h dev, int duty_cycle)
+int peripheral_gdbus_pwm_set_duty_cycle(peripheral_pwm_h dev, int duty_cycle)
 {
        GError *error = NULL;
        gint32 ret = PERIPHERAL_ERROR_NONE;
@@ -142,7 +142,7 @@ int peripheral_gdbus_pwm_set_duty_cycle(peripheral_pwm_context_h dev, int duty_c
        return ret;
 }
 
-int peripheral_gdbus_pwm_get_period(peripheral_pwm_context_h dev, int *period)
+int peripheral_gdbus_pwm_get_period(peripheral_pwm_h dev, int *period)
 {
        GError *error = NULL;
        gint32 ret = PERIPHERAL_ERROR_NONE;
@@ -166,7 +166,7 @@ int peripheral_gdbus_pwm_get_period(peripheral_pwm_context_h dev, int *period)
        return ret;
 }
 
-int peripheral_gdbus_pwm_set_period(peripheral_pwm_context_h dev, int period)
+int peripheral_gdbus_pwm_set_period(peripheral_pwm_h dev, int period)
 {
        GError *error = NULL;
        gint32 ret = PERIPHERAL_ERROR_NONE;
@@ -190,7 +190,7 @@ int peripheral_gdbus_pwm_set_period(peripheral_pwm_context_h dev, int period)
        return ret;
 }
 
-int peripheral_gdbus_pwm_set_enable(peripheral_pwm_context_h dev, peripheral_pwm_state_e enable)
+int peripheral_gdbus_pwm_set_enable(peripheral_pwm_h dev, peripheral_pwm_state_e enable)
 {
        GError *error = NULL;
        gint32 ret = PERIPHERAL_ERROR_NONE;
index b3fa3a7..ea08352 100644 (file)
 #define PWM_ENABLE     1
 #define PWM_DISABLE    0
 
-peripheral_pwm_context_h peripheral_pwm_open(int device, int channel)
+peripheral_pwm_h peripheral_pwm_open(int device, int channel)
 {
-       peripheral_pwm_context_h dev = NULL;
+       peripheral_pwm_h dev = NULL;
        int ret = PERIPHERAL_ERROR_NONE;
 
        assert(device >= 0);
        assert(channel >= 0);
 
        /* Initialize */
-       dev = (peripheral_pwm_context_h)malloc(sizeof(struct _peripheral_pwm_s));
+       dev = (peripheral_pwm_h)malloc(sizeof(struct _peripheral_pwm_s));
 
        if (dev == NULL) {
-               _E("Failed to allocate peripheral_pwm_context_h");
+               _E("Failed to allocate peripheral_pwm_h");
                return NULL;
        }
 
@@ -57,7 +57,7 @@ peripheral_pwm_context_h peripheral_pwm_open(int device, int channel)
        return dev;
 }
 
-int peripheral_pwm_close(peripheral_pwm_context_h pwm)
+int peripheral_pwm_close(peripheral_pwm_h pwm)
 {
        int ret = PERIPHERAL_ERROR_NONE;
 
@@ -73,7 +73,7 @@ int peripheral_pwm_close(peripheral_pwm_context_h pwm)
 }
 
 
-int    peripheral_pwm_set_duty_cycle(peripheral_pwm_context_h pwm, int duty_cycle)
+int    peripheral_pwm_set_duty_cycle(peripheral_pwm_h pwm, int duty_cycle)
 {
        int ret = PERIPHERAL_ERROR_NONE;
 
@@ -85,7 +85,7 @@ int   peripheral_pwm_set_duty_cycle(peripheral_pwm_context_h pwm, int duty_cycle)
        return ret;
 }
 
-int peripheral_pwm_set_period(peripheral_pwm_context_h pwm, int period)
+int peripheral_pwm_set_period(peripheral_pwm_h pwm, int period)
 {
        int ret = PERIPHERAL_ERROR_NONE;
 
@@ -97,7 +97,7 @@ int peripheral_pwm_set_period(peripheral_pwm_context_h pwm, int period)
        return ret;
 }
 
-int    peripheral_pwm_set_enabled(peripheral_pwm_context_h pwm, peripheral_pwm_state_e enable)
+int    peripheral_pwm_set_enabled(peripheral_pwm_h pwm, peripheral_pwm_state_e enable)
 {
        int ret = PERIPHERAL_ERROR_NONE;
 
@@ -109,7 +109,7 @@ int peripheral_pwm_set_enabled(peripheral_pwm_context_h pwm, peripheral_pwm_stat
        return PERIPHERAL_ERROR_NONE;
 }
 
-int peripheral_pwm_is_enabled(peripheral_pwm_context_h pwm)
+int peripheral_pwm_is_enabled(peripheral_pwm_h pwm)
 {
        if (pwm->enabled == PWM_ENABLE)
                return PWM_ENABLE;
@@ -117,7 +117,7 @@ int peripheral_pwm_is_enabled(peripheral_pwm_context_h pwm)
                return PWM_DISABLE;
 }
 
-int peripheral_pwm_get_duty_cycle(peripheral_pwm_context_h pwm, int *duty_cycle)
+int peripheral_pwm_get_duty_cycle(peripheral_pwm_h pwm, int *duty_cycle)
 {
        int ret = PERIPHERAL_ERROR_NONE;
 
@@ -129,7 +129,7 @@ int peripheral_pwm_get_duty_cycle(peripheral_pwm_context_h pwm, int *duty_cycle)
        return ret;
 }
 
-int peripheral_pwm_get_period(peripheral_pwm_context_h pwm, int *period)
+int peripheral_pwm_get_period(peripheral_pwm_h pwm, int *period)
 {
        int ret = PERIPHERAL_ERROR_NONE;
 
index bec2885..21d0a8b 100644 (file)
@@ -220,7 +220,7 @@ int pwm_test_led(void)
 
        int set_duty_cycle;
        int get_period, get_duty_cycle;
-       peripheral_pwm_context_h dev;
+       peripheral_pwm_h dev;
 
        printf("<<< pwm_test >>>\n");
 
@@ -261,7 +261,7 @@ int pwm_test_motor(void)
        int duty_cycle = 1500000;
        int cnt = 0, idx = 0;
        int degree[3] = {0, 45, 90};
-       peripheral_pwm_context_h dev;
+       peripheral_pwm_h dev;
 
        printf("<<< pwm_test_motor >>>\n");