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 2d285140b35a8d0c7cae40dc67d1ba4c416bd3e7..9a302efb1bb34093e0de64c5ad1aca9011dd13d8 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 a8ed11015ffaa15de8edc257311b0c3d7836cb03..a0b7fad6966b349f344ec5ecc824906cee0b44e5 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 db73dee6f84b20352e4d9ea2adf659007ab823ba..66883a2bdc70ca4d564985295724ed105c3f13ac 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 b3fa3a70d396d0acca25550e51ecbe09146717af..ea08352d7ebf9049294b216d2d942e349c167dac 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 bec28852bf6cc5ecbbd5a792ac7bab1fecc5e453..21d0a8b6b49c0e9944cc44e7a6841464e1905126 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");