XBee Firmware Library  1.6.0
Functions
Output Compare component

Functions

int ocompare_config (xpin_t pin, bool_t enable, uint32_t max_timeout, uint32_t init_timeout, uint8_t behavior)
 Function that configures the settings of the output-compare component. More...
 
int ocompare_enable (xpin_t pin, bool_t enable)
 Function that enables/disables the output-compare module. More...
 
int ocompare_get_mode (xpin_t pin)
 Function that returns the programmed behavior of the output-compare pin. More...
 
int ocompare_irq_enable (xpin_t pin, bool_t enable)
 Function that returns the status of output-compare interrupt. More...
 
int ocompare_set_mode (xpin_t pin, uint8_t behavior)
 Function that sets behavior of the output-compare pin. More...
 
int ocompare_set_timeout (xpin_t pin, uint32_t timeout)
 Function that sets timeout of the output-compare interrupt. More...
 

Detailed Description

Input Capture API Overview

This API contains the functions to configure and control the Output Compare component on programmable XBee devices.

Output Compare Configuration Macros

The ocompare_ch_config function needs a parameter to state the active edge. The three different options are defined in the following macros:

Function Documentation

int ocompare_config ( xpin_t  pin,
bool_t  enable,
uint32_t  max_timeout,
uint32_t  init_timeout,
uint8_t  behavior 
)

Function that configures the settings of the output-compare component.

Parameters
[in]pinpin to be configured.
[in]enableTRUE for enabling, FALSE for disabling the Output Compare IRQ on pin.
[in]max_timeoutMaximum timeout value (in microseconds) that will be used in the followings calls to ocompare_set_timeout function.
[in]init_timeouttimeout value (in microseconds) for the first interrupt.
[in]behaviorstate of the pin when timeout is achieved: set, clear or toggle (use defined macros).
Return values
0on success
-EINVALif the selected pin is not output-compare capable or bad parameters are passed.
-EOVERFLOWif the requested timeouts can't be achieved
int ocompare_enable ( xpin_t  pin,
bool_t  enable 
)

Function that enables/disables the output-compare module.

Parameters
[in]pinpin (channel) to enable/disable.
[in]enableTRUE for enabling, FALSE for disabling module.
Return values
0On success.
-EINVALIf the selected pin is not output-compare capable.
int ocompare_get_mode ( xpin_t  pin)

Function that returns the programmed behavior of the output-compare pin.

Parameters
[in]pinPin to read behavior.
Return values
intThe configured behavior (refer to defined macros).
-EINVALIf the selected pin is not output-compare capable.
int ocompare_irq_enable ( xpin_t  pin,
bool_t  enable 
)

Function that returns the status of output-compare interrupt.

Parameters
[in]pinpin (channel) to read status
Return values
intthe configured status.
-EINVALif the selected pin is not output-compare capable.
int ocompare_set_mode ( xpin_t  pin,
uint8_t  behavior 
)

Function that sets behavior of the output-compare pin.

Parameters
[in]pinpin to set behavior.
Return values
intthe configured behavior.
-EINVALif the selected pin is not output-compare capable.
int ocompare_set_timeout ( xpin_t  pin,
uint32_t  timeout 
)

Function that sets timeout of the output-compare interrupt.

Parameters
[in]pinpin to set IRQ timeout
Return values
0on success
-EINVALif the selected pin is not output-compare capable