Tizen RT Public API  v1.1 D4

Provides APIs for PWM (Pulse Width Modulation) More...

Collaboration diagram for PWM:

Files

file  iotbus_pwm.h
 Iotbus APIs for PWM.
 

Typedefs

typedef struct _iotbus_pwm_s * iotbus_pwm_context_h
 Pointer definition to the internal struct _iotbus_pwm_s. More...
 
typedef uint8_t percent_t
 Type of pwm duty cycle. More...
 

Enumerations

enum  iotbus_pwm_state_e
 Enumeration of PWM state. More...
 

Functions

iotbus_pwm_context_h iotbus_pwm_open (int device, int channel)
 closes the pwm_context. More...
 
int iotbus_pwm_close (iotbus_pwm_context_h pwm)
 closes the pwm_context. More...
 
int iotbus_pwm_set_duty_cycle (iotbus_pwm_context_h pwm, percent_t duty_cycle)
 sets the pwm duty cycle. More...
 
int iotbus_pwm_set_period (iotbus_pwm_context_h pwm, uint32_t period)
 sets the pwm period. More...
 
int iotbus_pwm_set_enabled (iotbus_pwm_context_h pwm, iotbus_pwm_state_e enable)
 sets the pwm state. More...
 
int iotbus_pwm_is_enabled (iotbus_pwm_context_h pwm)
 checks if pwm state is enabled. More...
 
int iotbus_pwm_get_duty_cycle (iotbus_pwm_context_h pwm)
 gets the pwm duty cycle. More...
 
int iotbus_pwm_get_period (iotbus_pwm_context_h pwm)
 gets the pwm period. More...
 

Detailed Description

Provides APIs for PWM (Pulse Width Modulation)

Typedef Documentation

◆ iotbus_pwm_context_h

typedef struct _iotbus_pwm_s* iotbus_pwm_context_h

Pointer definition to the internal struct _iotbus_pwm_s.

Definition at line 42 of file iotbus_pwm.h.

◆ percent_t

typedef uint8_t percent_t

Type of pwm duty cycle.

Duty cycle is measured in terms of percentage so uint8_t is enough to hold percentage values.

Definition at line 61 of file iotbus_pwm.h.

Enumeration Type Documentation

◆ iotbus_pwm_state_e

Enumeration of PWM state.

Enumeration Details:
IOTBUS_PWM_DISABLE
IOTBUS_PWM_ENABLE

Definition at line 51 of file iotbus_pwm.h.

Function Documentation

◆ iotbus_pwm_close()

int iotbus_pwm_close ( iotbus_pwm_context_h  pwm)

closes the pwm_context.

#include <iotbus/iotbus_pwm.h>

Parameters
[in]pwmhandle of pwm_context
Returns
On success, 0 is returned. On failure, a negative value is returned.
Since
Tizen RT v1.0

◆ iotbus_pwm_get_duty_cycle()

int iotbus_pwm_get_duty_cycle ( iotbus_pwm_context_h  pwm)

gets the pwm duty cycle.

#include <iotbus/iotbus_pwm.h>

Parameters
[in]pwmhandle of pwm_context
Returns
On success, current pwm duty cycle is returned. On failure, a negative value is returned.
Since
Tizen RT v1.0

◆ iotbus_pwm_get_period()

int iotbus_pwm_get_period ( iotbus_pwm_context_h  pwm)

gets the pwm period.

#include <iotbus/iotbus_pwm.h>

Parameters
[in]pwmhandle of pwm_context
Returns
On success, current pwm period is returned. On failure, a negative value is returned.
Since
Tizen RT v1.0

◆ iotbus_pwm_is_enabled()

int iotbus_pwm_is_enabled ( iotbus_pwm_context_h  pwm)

checks if pwm state is enabled.

#include <iotbus/iotbus_pwm.h>

Parameters
[in]pwmhandle of pwm_context
Returns
On success, current pwm state value is returned. On failure, a negative value is returned.
Since
Tizen RT v1.0

◆ iotbus_pwm_open()

iotbus_pwm_context_h iotbus_pwm_open ( int  device,
int  channel 
)

closes the pwm_context.

#include <iotbus/iotbus_pwm.h>

Parameters
[in]deviceN/A
[in]channelpwm channel number
Returns
On success, handle of pwm_context is returned. On failure, NULL is returned.
Since
Tizen RT v1.0

◆ iotbus_pwm_set_duty_cycle()

int iotbus_pwm_set_duty_cycle ( iotbus_pwm_context_h  pwm,
percent_t  duty_cycle 
)

sets the pwm duty cycle.

#include <iotbus/iotbus_pwm.h>

Parameters
[in]pwmhandle of pwm_context
[in]duty_cyclepwm duty cycle
Returns
On success, 0 is returned. On failure, a negative value is returned.
Since
Tizen RT v1.0

◆ iotbus_pwm_set_enabled()

int iotbus_pwm_set_enabled ( iotbus_pwm_context_h  pwm,
iotbus_pwm_state_e  enable 
)

sets the pwm state.

#include <iotbus/iotbus_pwm.h>

Parameters
[in]pwmhandle of pwm_context
[in]enablepwm enable/disabled state value
Returns
On success, 0 is returned. On failure, a negative value is returned.
Since
Tizen RT v1.0

◆ iotbus_pwm_set_period()

int iotbus_pwm_set_period ( iotbus_pwm_context_h  pwm,
uint32_t  period 
)

sets the pwm period.

#include <iotbus/iotbus_pwm.h>

Parameters
[in]pwmhandle of pwm_context
[in]periodpwm duty period
Returns
On success, 0 is returned. On failure, a negative value is returned.
Since
Tizen RT v1.0