ESOS_I2C_Service


Files

file  esos_pic24_i2c.h
 This file contains routines which configure and use I2C on the Microchip PIC24 MCUs.
file  esos_pic24_i2c.c

Defines

#define ESOS_TASK_WAIT_ON_WRITE1I2C1(u8_addr, u8_d1)
#define ESOS_TASK_WAIT_ON_WRITE2I2C1(u8_addr, u8_d1, u8_d2)
#define ESOS_TASK_WAIT_ON_WRITENI2C1(u8_addr, pu8_d, u16_cnt)
#define ESOS_TASK_WAIT_ON_READ1I2C1(u8_addr, u8_d1)
#define ESOS_TASK_WAIT_ON_READ2I2C1(u8_addr, u8_d1, u8_d2)
#define ESOS_TASK_WAIT_ON_READNI2C1(u8_addr, pu8_d, u16_cnt)

Functions

void esos_pic24_configI2C1 (uint16 u16_FkHZ)
 ESOS_CHILD_TASK (__esos_pic24_writeNI2C1, uint8 u8_addr, uint8 *pu8_d, uint16 u16_cnt)
 ESOS_CHILD_TASK (__esos_pic24_readNI2C1, uint8 u8_addr, uint8 *pu8_d, uint16 u16_cnt)

Define Documentation

#define ESOS_TASK_WAIT_ON_READ1I2C1 ( u8_addr,
u8_d1   ) 

Transaction: Read 1 (ONE) byte from I2C slave at address u8_addr, and save to variable u8_d1 As per the I2C standard, a NAK is returned for the last byte read from the slave, ACKs are returned for the other bytes.

Parameters:
u8_addr Slave I2C address
u8_d1 variable to hold the read byte
See also:
ESOS_TASK_WAIT_ON_READ2I2C1

ESOS_TASK_WAIT_ON_READNI2C1

esos_pic24_configI2C1

Definition at line 155 of file esos_pic24_i2c.h.

#define ESOS_TASK_WAIT_ON_READ2I2C1 ( u8_addr,
u8_d1,
u8_d2   ) 

Transaction: Read 2 (TWO) bytes from I2C slave at address u8_addr, save to variables u8_d1 and u8_d2 As per the I2C standard, a NAK is returned for the last byte read from the slave, ACKs are returned for the other bytes.

Parameters:
u8_addr Slave I2C address
u8_d1 variable to hold first read byte
u8_d2 variable to hold second read byte
See also:
ESOS_TASK_WAIT_ON_READ1I2C1

ESOS_TASK_WAIT_ON_READNI2C1

esos_pic24_configI2C1

Definition at line 173 of file esos_pic24_i2c.h.

#define ESOS_TASK_WAIT_ON_READNI2C1 ( u8_addr,
pu8_d,
u16_cnt   ) 

Transaction: Read u16_cnt bytes from I2C slave at address u8_addr, save to buffer *pu8_d. As per the I2C standard, a NAK is returned for the last byte read from the slave, ACKs are returned for the other bytes.

Parameters:
u8_addr Slave I2C address
pu8_d Pointer to buffer for storing bytes read from slave
u16_cnt Number of bytes read from slave.
See also:
ESOS_TASK_WAIT_ON_READ1I2C1

ESOS_TASK_WAIT_ON_READ2I2C1

esos_pic24_configI2C1

Definition at line 191 of file esos_pic24_i2c.h.

#define ESOS_TASK_WAIT_ON_WRITE1I2C1 ( u8_addr,
u8_d1   ) 

Transaction: Write 1 (ONE) byte stored in variable u8_d1 to I2C slave at address u8_addr.

Parameters:
u8_addr Slave I2C address
u8_d1 Variable containing first byte to write
See also:
ESOS_TASK_WAIT_ON_WRITE2I2C1

ESOS_TASK_WAIT_ON_WRITENI2C1

esos_pic24_configI2C1

Definition at line 107 of file esos_pic24_i2c.h.

#define ESOS_TASK_WAIT_ON_WRITE2I2C1 ( u8_addr,
u8_d1,
u8_d2   ) 

Transaction: Write 2 (TWO) bytes stored in variables u8_d1 and u8_d2 to I2C slave at address u8_addr.

Parameters:
u8_addr Slave I2C address
u8_d1 Variable containing first byte to write
u8_d2 Variable containing second byte to write
See also:
ESOS_TASK_WAIT_ON_WRITE1I2C1

ESOS_TASK_WAIT_ON_WRITENI2C1

Definition at line 126 of file esos_pic24_i2c.h.

#define ESOS_TASK_WAIT_ON_WRITENI2C1 ( u8_addr,
pu8_d,
u16_cnt   ) 

Transaction: Write u16_cnt bytes stored in buffer *pu8_d to I2C slave at address u8_addr.

Parameters:
u8_addr Slave I2C address
pu8_d Pointer to buffer containing bytes to send
u16_cnt Number of bytes to send
See also:
ESOS_TASK_WAIT_ON_WRITE1I2C1

ESOS_TASK_WAIT_ON_WRITE2I2C1

Definition at line 142 of file esos_pic24_i2c.h.


Function Documentation

ESOS_CHILD_TASK ( __esos_pic24_readNI2C1  ,
uint8  u8_addr,
uint8 pu8_d,
uint16  u16_cnt 
)

Transaction: Read u16_cnt bytes from I2C slave at address u8_addr, save to buffer *pu8_d. As per the I2C standard, a NAK is returned for the last byte read from the slave, ACKs are returned for the other bytes.

Parameters:
u8_addr Slave I2C address
pu8_d Pointer to buffer for storing bytes read from slave
u16_cnt Number of bytes read from slave.

Definition at line 122 of file esos_pic24_i2c.c.

ESOS_CHILD_TASK ( __esos_pic24_writeNI2C1  ,
uint8  u8_addr,
uint8 pu8_d,
uint16  u16_cnt 
)

Transaction: Write u16_cnt bytes stored in buffer *pu8_d to I2C slave at address u8_addr.

Parameters:
u8_addr Slave I2C address
pu8_d Pointer to buffer containing bytes to send
u16_cnt Number of bytes to send

Definition at line 98 of file esos_pic24_i2c.c.

void esos_pic24_configI2C1 ( uint16  u16_fKHz  ) 

Configure and enable the I2C1 module for operation at u16_fKHz KHz clock speed.

Parameters:
u16_fKHz specifies clock speed in KHz
See also:
ESOS_TASK_WAIT_ON_WRITENI2C1

ESOS_TASK_WAIT_ON_READNI2C1

Definition at line 65 of file esos_pic24_i2c.c.


Generated on Sun Mar 15 11:14:22 2009 for PIC24 Support Libraries by  doxygen 1.5.8