TizenRT Public API
v2.0 M2
|
Provides APIs for PWM (Pulse Width Modulation) More...
![]() |
Files | |
file | iotbus_pwm.h |
Iotbus APIs for PWM. | |
Typedefs | |
typedef struct _iotbus_pwm_wrapper_s * | iotbus_pwm_context_h |
Pointer definition to the internal struct _iotbus_pwm_wrapper_s. More... | |
typedef uint8_t | percent_t |
Type of pwm duty cycle. More... | |
Enumerations |
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... | |
Provides APIs for PWM (Pulse Width Modulation)
typedef struct _iotbus_pwm_wrapper_s* iotbus_pwm_context_h |
Pointer definition to the internal struct _iotbus_pwm_wrapper_s.
Definition at line 42 of file iotbus_pwm.h.
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.
enum 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.
int iotbus_pwm_close | ( | iotbus_pwm_context_h | pwm | ) |
closes the pwm_context.
#include <iotbus/iotbus_pwm.h>
[in] | pwm | handle of pwm_context |
int iotbus_pwm_get_duty_cycle | ( | iotbus_pwm_context_h | pwm | ) |
gets the pwm duty cycle.
#include <iotbus/iotbus_pwm.h>
[in] | pwm | handle of pwm_context |
int iotbus_pwm_get_period | ( | iotbus_pwm_context_h | pwm | ) |
gets the pwm period.
#include <iotbus/iotbus_pwm.h>
[in] | pwm | handle of pwm_context |
int iotbus_pwm_is_enabled | ( | iotbus_pwm_context_h | pwm | ) |
checks if pwm state is enabled.
#include <iotbus/iotbus_pwm.h>
[in] | pwm | handle of pwm_context |
iotbus_pwm_context_h iotbus_pwm_open | ( | int | device, |
int | channel | ||
) |
closes the pwm_context.
#include <iotbus/iotbus_pwm.h>
[in] | device | N/A |
[in] | channel | pwm channel number |
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>
[in] | pwm | handle of pwm_context |
[in] | duty_cycle | pwm duty cycle |
int iotbus_pwm_set_enabled | ( | iotbus_pwm_context_h | pwm, |
iotbus_pwm_state_e | enable | ||
) |
sets the pwm state.
#include <iotbus/iotbus_pwm.h>
[in] | pwm | handle of pwm_context |
[in] | enable | pwm enable/disabled state value |
int iotbus_pwm_set_period | ( | iotbus_pwm_context_h | pwm, |
uint32_t | period | ||
) |
sets the pwm period.
#include <iotbus/iotbus_pwm.h>
[in] | pwm | handle of pwm_context |
[in] | period | pwm duty period |