?? di2cs.h
字號:
/****************************************************************************/
/* Copyright (c) 1999-2007 Digital Core Design DCD */
/****************************************************************************/
/* Please review the terms of the license agreement before using this file. */
/* If you are not an authorized user, please destroy this source code file */
/* and notify DCD immediately that you inadvertently received an */
/* unauthorized copy. */
/****************************************************************************/
/* */
/*--------------------------------------------------------------------------*/
/* Project name : DI2CS */
/* Project description : DI2CS - I2C BUS INTERFACE-SLAVE */
/* */
/* File name : di2cs.h */
/* File contents : DI2CS C compiler interface functions */
/* headers. */
/*--------------------------------------------------------------------------*/
/* Design Engineer : T.K. */
/* Version : 1.38 */
/* Last modification : 2007-01-24 */
/*--------------------------------------------------------------------------*/
/****************************************************************************/
/* DI2CS registers location */
sfr DI2CS_OA = 0xF1; /* Slave Own Address register */
sfr DI2CS_CR = 0xF2; /* Control register */
sfr DI2CS_SR = 0xF2; /* Status register */
sfr DI2CS_BUF = 0xF3; /* Buffer register */
/* DI2CS pseudo-functions */
#define reset_di2cs() (DI2CS_CR|=0x80) /* Reset DI2CS */
#define enable_di2cs() (DI2CS_CR|=0x01) /* Enable DI2CS module */
#define disable_di2cs() (DI2CS_CR&=0xFE) /* Disable DI2CS module */
#define readbuf_di2cs() (DI2CS_BUF) /* Read data buffer */
#define writebuf_di2cs(a) (DI2CS_BUF=a) /* Write data buffer */
#define ownaddr_di2cs(sa) (DI2CS_OA=sa) /* Set Own addr. */
/* DI2CS registers direct access */
#define write_di2cs(a, addr) (addr=a)
#define read_di2cs(addr) (addr)
/* DI2CS STATUS CODES */
#define SR_SENDFIN 0x04
#define SR_TREQ 0x02
#define SR_RREQ 0x01
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -