Pulse-Width-Modulation component API Overview
This API contains the functions to configure and control the Pulse-Width-Modulation component on programmable XBee devices.
- Output Compare functions:
Function that configures the settings of the Pulse-Width-Modulation module.
- Parameters
-
| [in] | pin | pin to be configured. |
| [in] | enable | TRUE for enabling, FALSE for disabling the PWM on pin. |
| [in] | ton | time (in microseconds) that the pulse will stay at positive state. |
| [in] | period | period (in microseconds) of the waveform. |
Function that enables/disables the Pulse-Width-Modulation.
- Parameters
-
| [in] | pin | Pin (channel) to set PWM status. |
| [in] | enable | TRUE for enabling, FALSE for disabling PWM. |
- Return values
-
| 0 | On success. |
| -EINVAL | If the selected pin is not PWM capable. |
Function that returns the current period for the Pulse-Width-Modulation component.
- Parameters
-
| [in] | pin | pin from which the period will be read. |
- Return values
-
| uint32_t | The configured period (in microseconds) |
| -EINVAL | If the pin is not pwm capable. |
Function that returns the current positive semiperiod for the Pulse-Width-Modulation component.
- Parameters
-
| [in] | pin | pin from which the period will be read. |
- Return values
-
| uint32_t | The configured period (in microseconds) |
| -EINVAL | If the pin is not pwm capable. |
Function that changes the positive pulse-width of the Pulse-Width-Modulation component.
- Parameters
-
| [in] | pin | pin from which the period will be read. |
| [in] | uint32_t | The configured ton (in microseconds) |
- Return values
-
| -EINVAL | If the pin is not pwm capable. |