The PWM API provides functions to control PWM peripherals connected to the IoT device.
Required Header
#include <peripheral_io.h>
Overview
This PWM API provides functions to control PWM peripherals connected to the IoT device.
Realted Features
This API is related with the following feature:
It is recommended to use features in your application for reliability.
You can check if a IoT device supports the related features for this API
by using System Information, and control your application's actions accordingly.
To ensure your application is only running on the IoT device with specific features,
please define the features in your manifest file using the manifest editor in the SDK.
More details on featuring your application can be found from Feature Element.
Typedef Documentation
The handle of the PWM peripherals.
- Since :
- 4.0
Enumeration Type Documentation
Enumeration for Polarity.
- Since :
- 4.0
- Enumerator:
PERIPHERAL_PWM_POLARITY_ACTIVE_HIGH |
PWM signal start in the active high state (Normal)
|
PERIPHERAL_PWM_POLARITY_ACTIVE_LOW |
PWM signal start in the active low state (Inversed)
|
Function Documentation
Opens the PWM pin.
- Warning:
- This is not for use by third-party applications.
- Since :
- 4.0
- Privilege Level:
- platform
- Privilege:
- http://tizen.org/privilege/peripheralio
- Parameters:
-
[in] | chip | The PWM chip number |
[in] | pin | The PWM pin(channel) number to control |
[out] | pwm | The PWM handle is created on success |
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
- Postcondition:
- peripheral_pwm_close()
Sets duty cycle of the PWM pin.
- Warning:
- This is not for use by third-party applications.
- Since :
- 4.0
- Privilege Level:
- platform
- Privilege:
- http://tizen.org/privilege/peripheralio
- Parameters:
-
[in] | pwm | The PWM handle |
[in] | duty_cycle_ns | The duty cycle of the PWM pin (in nanoseconds) |
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
Enables the PWM pin.
- Warning:
- This is not for use by third-party applications.
- Since :
- 4.0
- Privilege Level:
- platform
- Privilege:
- http://tizen.org/privilege/peripheralio
- Parameters:
-
[in] | pwm | The PWM handle |
[in] | enabled | Enable/disable the PWM pin |
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
Sets period of the PWM pin.
- Warning:
- This is not for use by third-party applications.
- Since :
- 4.0
- Privilege Level:
- platform
- Privilege:
- http://tizen.org/privilege/peripheralio
- Parameters:
-
[in] | pwm | The PWM handle |
[in] | period_ns | The total period of the PWM pin (in nanoseconds) |
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
Sets polarity of the PWM pin.
- Warning:
- This is not for use by third-party applications.
- Since :
- 4.0
- Privilege Level:
- platform
- Privilege:
- http://tizen.org/privilege/peripheralio
- Parameters:
-
[in] | pwm | The PWM handle |
[in] | polarity | The polarity of the PWM pin |
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
- See also:
- peripheral_pwm_polarity_e