i2cPacket.h File Reference

The header file describes the i2cPacket interface. More...

#include <types.h>

Go to the source code of this file.

Data Structures

struct  HAL_i2cMode_t
 i2c baud rate TWI clock rate More...
struct  HAL_I2cParams_t
 i2c access control structure More...

Defines

#define HAL_I2C_PRESCALER   0ul
 i2c bus prescaler

Functions

int HAL_OpenI2cPacket (HAL_i2cMode_t *i2cMode)
 Opens twi 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 (void)
 Closes resource.
int HAL_WriteI2cPacket (HAL_I2cParams_t *param)
 Writes a series of bytes out to the TWI bus. Operation result will be sent to the callback function of the HAL_I2cParams_t structure.
int HAL_ReadI2cPacket (HAL_I2cParams_t *param)
 Reads the series of bytes from the TWI bus. Operation result will be sent to the callback function of the HAL_I2cParams_t structure.


Detailed Description

The header file describes the i2cPacket interface.

Author:
Atmel Corporation: http://www.atmel.com
Support email: avr@atmel.com
Copyright (c) 2008 , Atmel Corporation. All rights reserved. Licensed under Atmel's Limited License Agreement (BitCloudTM).

Definition in file i2cPacket.h.


Define Documentation

#define HAL_I2C_PRESCALER   0ul

i2c bus prescaler

Definition at line 32 of file i2cPacket.h.


Function Documentation

int HAL_OpenI2cPacket ( HAL_i2cMode_t i2cMode  ) 

Opens twi 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 or pointer is NULL.
0 - success.

int HAL_CloseI2cPacket ( void   ) 

Closes resource.

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

int HAL_WriteI2cPacket ( HAL_I2cParams_t param  ) 

Writes a series of bytes out to the TWI bus. Operation result will be sent to the callback function of the HAL_I2cParams_t structure.

Parameters:
[in] param - pointer to HAL_I2cParams_t structure
Returns:
0 - the bus is free and the request is accepted.
-1 - otherwise.

int HAL_ReadI2cPacket ( HAL_I2cParams_t param  ) 

Reads the series of bytes from the TWI bus. Operation result will be sent to the callback function of the HAL_I2cParams_t structure.

Parameters:
[in] param - pointer to HAL_I2cParams_t structure
Returns:
0 - the bus is free and the request is accepted.
-1 - otherwise.


Generated on Mon Feb 16 17:53:40 2009 for BitCloud Stack Documentation by  doxygen 1.5.1-p1