📄 i2c.h
字号:
//*****************************************************************************
//*****************************************************************************
// FILENAME: I2C.h
// Version: 1.0, Updated on 2005/09/29 at 12:44:08
// Generated by PSoC Designer ver 4.2 b1013 : 02 September, 2004
//
// DESCRIPTION: I2C User Module C Language interface file
// for the (22/24/26/27/29xxx) PSoC family of devices
//-----------------------------------------------------------------------------
// Copyright (c) Cypress MicroSystems 2003. All Rights Reserved.
//*****************************************************************************
//*****************************************************************************
#include <m8c.h>
#define I2C_SLAVE_ADDR 0x38
#define I2C_DYNAMIC_ADDR 1
#define I2C_ROM_ENABLE 0
/* Create pragmas to support proper argument and return value passing */
#pragma fastcall16 I2C_Start
#pragma fastcall16 I2C_DisableInt
#pragma fastcall16 I2C_EnableInt
#pragma fastcall16 I2C_Stop
#pragma fastcall16 I2C_SetRamBuffer
#pragma fastcall16 I2C_GetAddr
#pragma fastcall16 I2C_GetActivity
#if ( I2C_DYNAMIC_ADDR )
#pragma fastcall16 I2C_SetAddr
#endif
#if ( I2C_ROM_ENABLE )
#pragma fastcall16 I2C_SetRomBuffer
#endif
//-------------------------------------------------
// Constants for I2C API's.
//-------------------------------------------------
//
//
#define I2C_ACTIVITY_MASK 0xB0
#define I2C_ANY_ACTIVITY 0x80
#define I2C_READ_ACTIVITY 0x20
#define I2C_WRITE_ACTIVITY 0x10
//-------------------------------------------------
// Prototypes of the I2C API.
//-------------------------------------------------
extern void I2C_Start(void); // Proxy Class 1, if Static Address
// Proxy Class 4, if Dynamic Address
extern void I2C_DisableInt(void); // Proxy Class 1
extern void I2C_EnableInt(void); // Proxy Class 1
extern void I2C_Stop(void); // Proxy Class 1
extern void I2C_SetRamBuffer(BYTE bSize, BYTE bRWBoundary, BYTE * pAddr); // Proxy Class 4
extern BYTE I2C_GetAddr(void); // Proxy Class 4
extern BYTE I2C_GetActivity(void); // Proxy Class 4
#if ( I2C_DYNAMIC_ADDR )
extern void I2C_SetAddr(BYTE bAddr); // Proxy Class 4
#endif
#if ( I2C_ROM_ENABLE )
extern void I2C_SetRomBuffer(BYTE bSize, const BYTE * pAddr); // Proxy Class 4
#endif
//-------------------------------------------------
// Define global variables.
//-------------------------------------------------
#if ( I2C_DYNAMIC_ADDR )
extern BYTE I2C_bAddr; // Proxy Class 1
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -