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__ */
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);
/**
}
}
-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;
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;
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;
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;
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;
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;
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;
#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;
}
return dev;
}
-int peripheral_pwm_close(peripheral_pwm_context_h pwm)
+int peripheral_pwm_close(peripheral_pwm_h pwm)
{
int ret = PERIPHERAL_ERROR_NONE;
}
-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;
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;
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;
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;
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;
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;
int set_duty_cycle;
int get_period, get_duty_cycle;
- peripheral_pwm_context_h dev;
+ peripheral_pwm_h dev;
printf("<<< pwm_test >>>\n");
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");