00001 /**************************************************************************** 00002 * 00003 * (C) 2000 by PWR Solutions GbR 00004 * 00005 * PWR Solutions GbR 00006 * Euckenstrasse 17 00007 * D-81369 München 00008 * 00009 * Phone : (49)-89-726092-30 00010 * Fax : (49)-89-726092-59 00011 00012 $Header: i2c_api.h, 5, 16.01.2002 11:11:07, Christoph Stoidner$ 00013 00014 * 00015 * --------------------------------------------------------------------------- 00016 * Module : I2C_API.H 00017 * Function : Defines and typedefs for I2C_API.C 00018 * 00019 * Compiler : Borland C++ 5.0 00020 * Memorymodel : Large 00021 * 00022 * Author : Bernhard Roth 00023 * Date : 17.07.00 00024 * --------------------------------------------------------------------------- 00025 00026 $Log: 00027 5 IPC@CHIP 1.4 16.01.2002 11:11:07 Christoph Stoidner add starteam 00028 directives 00029 4 IPC@CHIP 1.3 16.01.2002 11:09:09 Christoph Stoidner add new 00030 functions and comments 00031 3 IPC@CHIP 1.2 13.08.2001 17:06:37 Christoph Stoidner Edit header 00032 2 IPC@CHIP 1.1 13.08.2001 16:29:06 Christoph Stoidner edit 00033 1 IPC@CHIP 1.0 13.08.2001 16:27:00 Christoph Stoidner 00034 $ 00035 00036 * 00037 * History : 00038 * 00039 * Vx.yy Author Changes 00040 * 00041 * 17.07.00 roth Create 00042 * 00043 * ------------------------------------------------------------------------- 00044 * Published on the Beck WebSite with kindlier permission of Bernhard Roth. 00045 ****************************************************************************/ 00046 00047 #ifndef __I2CAPI_H__ 00048 #define __I2CAPI_H__ 00049 00050 #define I2CINT 0xAA 00051 00052 /*************************************************************************/ 00053 // I2C Api Services 00054 /*************************************************************************/ 00055 #define I2C_INIT 0x80 00056 #define I2C_SCAN 0x81 00057 #define I2C_TRANS_RECV_CHAR 0x82 00058 #define I2C_TRANS_RECV_BLOCK 0x83 00059 #define I2C_RELEASE 0x84 00060 #define I2C_RESTART 0x8B 00061 #define I2C_SELECT_CLK_PIN 0x8E 00062 #define I2C_SELECT_DATA_PIN 0x8F 00063 00064 /*************************************************************************/ 00065 //prototypes 00066 /*************************************************************************/ 00067 00068 void I2C_init (void); 00069 void I2C_release (void); 00070 void I2C_restart (void); 00071 unsigned char I2C_scan (unsigned char start_addr, unsigned char end_addr); 00072 int I2C_transmit_block (unsigned char slave, char far * buffer, int length); 00073 int I2C_receive_block (unsigned char slave, char far * buffer, int length); 00074 int I2C_transmit_char (unsigned char slave, char c); 00075 int I2C_receive_char (unsigned char slave, char * c, unsigned char lastchar); 00076 void I2C_select_clock_pin(unsigned char pio_no); 00077 void I2C_select_data_pin(unsigned char pio_no); 00078 00079 /*************************************************************************/ 00080 #endif /* __I2CAPI_H__*/ 00081 /*************************************************************************/ 00082 //end i2c_api.h 00083 /*************************************************************************/