i2cPacket.h File Reference

Declaration of the i2cPacket interface. More...

#include <i2c.h>

Go to the source code of this file.

Functions

int HAL_OpenI2cPacket (const HAL_i2cMode_t *i2cMode)
 Opens resource.
field of i2cMode structure
i2cClockRate_t clockrate (set by user). Must be chosen from:
I2C_CLOCK_RATE_250 - 250 Kb/s clock rate
I2C_CLOCK_RATE_125 - 125 Kb/s clock rate
I2C_CLOCK_RATE_62 - 62.5 Kb/s clock rate
.
int HAL_CloseI2cPacket ()
 Closes resource.
int HAL_WriteI2cPacket (uint8_t id, uint8_t length, const uint8_t *data, void(*f)(bool result))
 Writes a series of bytes out to the TWI bus.
int HAL_ReadI2cPacket (uint8_t id, uint8_t length, uint8_t *data, void(*f)(bool result))
 Reads the series of bytes from the TWI bus.


Detailed Description

Declaration of the i2cPacket interface.

Definition in file i2cPacket.h.


Function Documentation

int HAL_CloseI2cPacket (  ) 

Closes resource.

Returns:
-1 - resource was not open.
0 - success.

int HAL_OpenI2cPacket ( const HAL_i2cMode_t *  i2cMode  ) 

Opens resource.
field of i2cMode structure
i2cClockRate_t clockrate (set by user). Must be chosen from:
I2C_CLOCK_RATE_250 - 250 Kb/s clock rate
I2C_CLOCK_RATE_125 - 125 Kb/s clock rate
I2C_CLOCK_RATE_62 - 62.5 Kb/s clock rate
.

Parameters:
[in] i2cMode - pointer to the mode structure.
Returns:
-1 - resource was already open.
0 - success.

int HAL_ReadI2cPacket ( uint8_t  id,
uint8_t  length,
uint8_t *  data,
void(*)(bool result)  f 
)

Reads the series of bytes from the TWI bus.

Parameters:
[in] id - address of the i2c device on the bus
[in] length - number of bytes to be read from the bus.
[in] data - pointer to the data buffer
[in] f - pointer to the callback function
Returns:
0 - the bus is free and the request is accepted.
-1 - otherwise.

int HAL_WriteI2cPacket ( uint8_t  id,
uint8_t  length,
const uint8_t *  data,
void(*)(bool result)  f 
)

Writes a series of bytes out to the TWI bus.

Parameters:
[in] id - address of the i2c device on the bus
[in] length - number of bytes to be written to the bus
[in] data - pointer to the data
[in] f - pointer to the callback function
Returns:
0 - the bus is free and the request is accepted.
-1 - otherwise.


Generated on Wed Apr 2 19:06:16 2008 for ZigBeeNet Stack Documentation by  doxygen 1.5.1-p1