📄 main.c
字号:
/****************************************Copyright (c)**************************************************
** Guangzou ZLG-MCU Development Co.,LTD.
** graduate school
** http://www.zlgmcu.com
**
**--------------File Info-------------------------------------------------------------------------------
** File name: main.c
** Last modified Date: 2004-09-16
** Last Version: 1.0
** Descriptions: The main() function example template
**
**------------------------------------------------------------------------------------------------------
** Created by: Chenmingji
** Created date: 2004-09-16
** Version: 1.0
** Descriptions: The original version
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Descriptions:
**
********************************************************************************************************/
#include "config.h"
#include "FM24C64.h"
#include <string.h>
uint8 str[64];
volatile uint16 add;
volatile uint8 len;
volatile uint8 inda;
volatile uint8 i;
int main (void)
{// add user source code
FM24C64_init_pin();
//read & write byte
inda =0x00;
add =0x00;
inda =FM24C64_read_byte(add);
inda =0xAA;
add =0x00;
FM24C64_write_byte(add, inda);
inda =0x00;
add =0x00;
inda =FM24C64_read_byte(add);
inda =0x55;
add =0x00;
FM24C64_write_byte(add, inda);
inda =0x00;
add =0x00;
inda =FM24C64_read_byte(add);
//read & write string
memset(str,0,sizeof(str));
add =0x0;
len =0x0A;
FM24C64_read_string(add, len, str);
memset(str,0,sizeof(str));
add =0x0;
len =0x0A;
for(i=0; i<len; i++)
{
str[i] =i +'0';
}
FM24C64_write_string(add, len, str);
memset(str,0,sizeof(str));
add =0x0;
len =0x0A;
FM24C64_read_string(add, len, str);
memset(str,0,sizeof(str));
add =0x0;
len =0x0A;
for(i=0; i<len; i++)
{
str[i] =i +'A';
}
FM24C64_write_string(add, len, str);
memset(str,0,sizeof(str));
add =0x0;
len =0x0A;
FM24C64_read_string(add, len, str);
while(1);
return 0;
}
/*********************************************************************************************************
** End Of File
********************************************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -