|
主程序
#include <stdio.h> /* standard I/O .h-file */
#include <ctype.h> /* character functions */
#include <LPC23xx.H>
#include "config.h"//提示错误的头文件
#include "I2CINT.h"
int main(void)
{
//锁定PLL
PLLCON = 1; // 使能PLL
PLLCFG = 0xB; // 设置M 为6,P 为2
PLLFEED = 0xAA; // 发送PLL 馈送序列
PLLFEED = 0x55;
while((PLLSTAT & (1 << 26)) == 0); // 等待PLL 锁定
PLLCON = 3; // PLL使能和连接
PLLFEED = 0xAA; // 发送PLL 馈送序列
PLLFEED = 0x55;
//配置管脚
PINSEL0=0xC0000050;
PINSEL1=0x014043FF;
PINSEL3=0x00000000;
PINSEL2=0x01500000;
//RTC地址0XEB
//uint8 I2C_ReadNByte (uint8 sla, uint32 suba_type, uint32 suba, uint8 *s, uint32 num);
#define RTC 0xEB
#define RTC_sec 0x00
uint8 sec;//问题出在这里,uint8在config.h头文件里面定义
//I2C_ReadNByte(RTC,ONE_BYTE_SUBA,RTC_sec,sec,1);
sec=1;//还有这里
}
*****************************
config.h头文件
#ifndef __CONFIG_H
#define __CONFIG_H
// 不能被更改
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
typedef unsigned char uint8; /* 无符号8 位整型变量 */
typedef signed char int8; /* 有符号8 位整型变量 */
typedef unsigned short uint16; /* 无符号16 位整型变量 */
typedef signed short int16; /* 有符号16 位整型变量 */
typedef unsigned int uint32; /* 无符号32 位整型变量 */
typedef signed int int32; /* 有符号32 位整型变量 */
typedef float fp32; /* 单精度浮点数(32 位长度) */
typedef double fp64; /* 双精度浮点数(64 位长度) */
#endif
************************************************** |
阿莫论坛20周年了!感谢大家的支持与爱护!!
知道什么是神吗?其实神本来也是人,只不过神做了人做不到的事情 所以才成了神。 (头文字D, 杜汶泽)
|