📄 i2c0_drv.h
字号:
//----------------------------------------------------------------------------
// Filename : I2C0_drv.h
//----------------------------------------------------------------------------
//
// Copyright (c) 2008,东莞太平计算机科技有限公司
// All rights reserved.
// www.pacific-gold.com.cn
//
// 历史版本:
//
// 版本: V1.0
// 作者: 罗先能
// 日期: 2007-12-21
// 描述: 建立第一版本
//
//
// 描述:
// 1. 设备FM24CL04的驱动程序
//
//
//----------------------------------------------------------------------------
#ifndef __I2C0_DRV_H__
#define __I2C0_DRV_H__
//============================================================================
//----------------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------------
#include "71x_lib.h"
//----------------------------------------------------------------------------
// Global Constant Definitions
//----------------------------------------------------------------------------
// address offset define
typedef enum
{ I2C0_TEST = 0, /* store test datas of I2C0 */
TAG_HEAD = 0x04, /* store start address of tag begin datas */
TAG_TAIL = 0x08, /* store end address of tag end datas */
TAG_AREA_HEAD = 0x0b, /* store start address of tag data area */
TAG_AREA_TAIL = 0x10 /* store end address of tag data area */
} TAG_DEF;
typedef struct
{
u32 *head;
u32 *tail;
u32 *area_head;
u32 *area_tail;
} TAG;
//----------------------------------------------------------------------------
// Global Varable Declare
//----------------------------------------------------------------------------
extern TAG i2c_tag;
//----------------------------------------------------------------------------
// Global Function Declare
//----------------------------------------------------------------------------
extern bool i2c0_init(void); // initialize I2C0
extern bool i2c0_open(void); // open device I2C0
extern bool i2c0_close(void); // close device I2C0
extern u32 i2c0_read( TAG_DEF addr); // read 4bytes data from I2C0
extern bool i2c0_write(TAG_DEF addr, u32 data); // write 4bytes data to I2C0
extern bool i2c0_test(void); // only test the divice on I2C0
//============================================================================
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -