XBee Firmware Library  1.6.0
Functions
Pulse-Width Modulation (PWM)

Functions

int pwm_config (xpin_t pin, bool_t enable, uint32_t ton, uint32_t period)
 Function that configures the settings of the Pulse-Width-Modulation module. More...
 
int pwm_enable (xpin_t pin, bool_t enable)
 Function that enables/disables the Pulse-Width-Modulation. More...
 
uint32_t pwm_get_period (xpin_t pin)
 Function that returns the current period for the Pulse-Width-Modulation component. More...
 
uint32_t pwm_get_ton (xpin_t pin)
 Function that returns the current positive semiperiod for the Pulse-Width-Modulation component. More...
 
uint32_t pwm_set_ton (xpin_t pin, uint32_t ton)
 Function that changes the positive pulse-width of the Pulse-Width-Modulation component. More...
 

Detailed Description

Pulse-Width-Modulation component API Overview

This API contains the functions to configure and control the Pulse-Width-Modulation component on programmable XBee devices.

Function Documentation

int pwm_config ( xpin_t  pin,
bool_t  enable,
uint32_t  ton,
uint32_t  period 
)

Function that configures the settings of the Pulse-Width-Modulation module.

Parameters
[in]pinpin to be configured.
[in]enableTRUE for enabling, FALSE for disabling the PWM on pin.
[in]tontime (in microseconds) that the pulse will stay at positive state.
[in]periodperiod (in microseconds) of the waveform.
int pwm_enable ( xpin_t  pin,
bool_t  enable 
)

Function that enables/disables the Pulse-Width-Modulation.

Parameters
[in]pinPin (channel) to set PWM status.
[in]enableTRUE for enabling, FALSE for disabling PWM.
Return values
0On success.
-EINVALIf the selected pin is not PWM capable.
uint32_t pwm_get_period ( xpin_t  pin)

Function that returns the current period for the Pulse-Width-Modulation component.

Parameters
[in]pinpin from which the period will be read.
Return values
uint32_tThe configured period (in microseconds)
-EINVALIf the pin is not pwm capable.
uint32_t pwm_get_ton ( xpin_t  pin)

Function that returns the current positive semiperiod for the Pulse-Width-Modulation component.

Parameters
[in]pinpin from which the period will be read.
Return values
uint32_tThe configured period (in microseconds)
-EINVALIf the pin is not pwm capable.
uint32_t pwm_set_ton ( xpin_t  pin,
uint32_t  ton 
)

Function that changes the positive pulse-width of the Pulse-Width-Modulation component.

Parameters
[in]pinpin from which the period will be read.
[in]uint32_tThe configured ton (in microseconds)
Return values
-EINVALIf the pin is not pwm capable.