testi2c.h

来自「这是一个基于nec78f8024的led驱动程序」· C头文件 代码 · 共 47 行

H
47
字号
/*
*******************************************************************************
**  COPYRIGHT (C) NEC Electronics Corporation 2008
**  NEC ELECTRONICS CONFIDENTIAL AND PROPRIETARY
**  All rights reserved by NEC Electronics Corporation.
**  Use of copyright notice does not evidence publication.
**
**  Filename :	I2C.h
**  Abstract :	This file implements the definition that relates to the I2C communication 
**              not influenced by the setting in the GUI application. 
**
**  Device :	uPD78F8024
**
**  Compiler :	NEC/CC78K0
**
*******************************************************************************
*/
#ifndef	_MDI2C_
#define _MDI2C_

/* mnemonic of register related to I2C communication */
#define	IICE0					IICC0.7
#define	IICRSV					IICF0.0
#define	STCEN					IICF0.1
#define	SPD0					IICS0.0
#define	STD0					IICS0.1
#define	COI0					IICS0.4
#define	TRC0					IICS0.3
#define	WREL0					IICC0.5

/* set value definition of register related to I2C communication */
#define	IICC0_INIT_VALUE		0b00011100
#define	IICX0_INIT_VALUE		0b00000000

/* Mnemonic of register that relates to port used by I2C communication */
#define	PORT_SDA0				P6.1
#define	PORT_MODE_SDA0			PM6.1
#define	PORT_SCL0				P6.0
#define	PORT_MODE_SCL0			PM6.0

/* function prototypes */
void I2C_init(void);
short  I2C_getValue( unsigned char  ucChannel );

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?