//*****************************************************************************
//*****************************************************************************
//  FILENAME: I2Cm_1.h
//   Version: 1.4, Updated on 2004/10/27 at 18:25:50
//  Generated by PSoC Designer ver 4.2  b1013 : 02 September, 2004
//
//  DESCRIPTION:  I2Cm User Module C Language interface file for the
//                22/24/25/26/27xxx PSoC family of devices.
//-----------------------------------------------------------------------------
//      Copyright (c) Cypress MicroSystems 2000-2003. All Rights Reserved.
//*****************************************************************************
//*****************************************************************************

#include <m8c.h>

// Create pragmas to support proper argument and return value passing
#pragma fastcall16  I2Cm_1_fReadBytes
#pragma fastcall16  I2Cm_1_bWriteBytes
#pragma fastcall16  I2Cm_1_bWriteCBytes
#pragma fastcall16  I2Cm_1_Start
#pragma fastcall16  I2Cm_1_Stop
#pragma fastcall16  I2Cm_1_fSendStart
#pragma fastcall16  I2Cm_1_fSendRepeatStart
#pragma fastcall16  I2Cm_1_SendStop
#pragma fastcall16  I2Cm_1_fWrite
#pragma fastcall16  I2Cm_1_bRead

//-------------------------------------------------
// Prototypes of the I2Cm_1 API.
//-------------------------------------------------
// High leval commands
extern void  I2Cm_1_Start(void);
extern BYTE  I2Cm_1_fReadBytes(BYTE bSlaveAddr, BYTE * pbXferData, BYTE bCnt, BYTE bMode);
extern BYTE  I2Cm_1_bWriteBytes(BYTE bSlaveAddr, BYTE * pbXferData, BYTE bCnt, BYTE bMode);
extern BYTE  I2Cm_1_bWriteCBytes(BYTE bSlaveAddr, const BYTE * pcbXferData, BYTE bCnt, BYTE bMode);
extern void  I2Cm_1_Stop(void);

// Low level commands
extern BYTE  I2Cm_1_fSendStart(BYTE bSlaveAddr, BYTE fRW);
extern BYTE  I2Cm_1_fSendRepeatStart(BYTE bSlaveAddr, BYTE fRW);
extern void  I2Cm_1_SendStop(void);
extern BYTE  I2Cm_1_fWrite(BYTE bData);
extern BYTE  I2Cm_1_bRead(BYTE fACK);

//-------------------------------------------------
// Constants for I2Cm_1 API's.
//-------------------------------------------------
#define I2Cm_1_CompleteXfer   0x00 // Perform a complete I2C transfer
#define I2Cm_1_RepStart       0x01 // Perform a complete transfer with a Repeat Start
#define I2Cm_1_NoStop         0x02 // Perform a complete transfer, but leave off the stop

#define I2Cm_1_READ           0x01 // Set the R/W flag after the slave address.
#define I2Cm_1_WRITE          0x00 // Clear the R/W flag after the slave address.

#define I2Cm_1_XFER_ERROR     0x00 // Communication error with the slave.
#define I2Cm_1_NAKslave       0x00 // NAK the slave after a read.
#define I2Cm_1_ACKslave       0x01 // ACK the slave after a read.

// end of file I2Cm_1.h
