XBee Firmware Library  1.6.0
Functions

Functions

int port_bit_get (port_t port, uint8_t bit)
 Reads the value of the specified bit of the selected port. More...
 
int port_bit_set (port_t port, uint8_t bit, bool_t val)
 Writes a value in the specified bit of the selected port. More...
 
int port_config (port_t port, uint8_t cfg)
 Initializes and configures the specified port with the parameters selected in cfg param. More...
 
uint8_t port_get (port_t port)
 Reads a byte of data from the specified port. More...
 
void port_set (port_t port, uint8_t val)
 Writes a byte in the specified port. More...
 

Detailed Description

Port API Overview

This API contains the functions to configure and control the ports of the 

the programmable XBee devices. The ports are not the actual ports of the hcs08 chip, so they are not read and written atomically. They are groups of GPIOs that have a custom read and write implementation in code. The ports are defined by an array of xpin_t values and they can go from 2 pins to 8 pins. The value written and read in a port is always a byte.

- Port configuration functions:
    - port_config()

- Port functions to read/write the ports:
    - port_set()
    - port_get()

Function Documentation

int port_bit_get ( port_t  port,
uint8_t  bit 
)

Reads the value of the specified bit of the selected port.

Parameters
[in]portthe port where a bit will be read.
[in]bitthe bit of the port that will be read.
Return values
intthe value read from the port on success
-EINVALon error
int port_bit_set ( port_t  port,
uint8_t  bit,
bool_t  val 
)

Writes a value in the specified bit of the selected port.

Parameters
[in]portthe port where a bit will be written.
[in]bitthe bit of the port that will be written.
[in]valthe value that will be written.
Return values
0on success
-EINVALon error (invalid port bit)
int port_config ( port_t  port,
uint8_t  cfg 
)

Initializes and configures the specified port with the parameters selected in cfg param.

Parameters
[in]portthe port that to initialize. A port is defined by an array of standard GPIO capable pins.
[in]cfga byte containing the configuration masks for the standard GPIO pins of the port. See the Standard GPIO Macros for more information.
Return values
0on successfully
EINVALinvalid xpin_t parameter (one or more of the pins are not standard GPIO capable pins).
uint8_t port_get ( port_t  port)

Reads a byte of data from the specified port.

Parameters
[in]pinthe port to read the data from.
Return values
uint8_tthe byte read from the port.
void port_set ( port_t  port,
uint8_t  val 
)

Writes a byte in the specified port.

Parameters
[in]portthe port where the byte will be written.
[in]valthe byte to write in the port.
Return values
None