⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bun_sav.c

📁 可以从计算机向WINBOND516直接下载程序的源码
💻 C
字号:
/**------------------------------------------------------------------------
BUTTON_PLS.C

Fireware for XYYQ demo board

Copyright 2000 Xingyuan Instrument and equipment Co.,Ltd
-------------------------------------------------------------------------*/
#include <reg51.h>
#include "demo.h"

void ButtonSave(void)
{
BYTE i;
    
     //value 0
    I2C_SendByteWithStart(EEPROMWRITEID);
    I2C_SendByte(0);
    
    for(i=0; i<16;i++)
    {
	I2C_SendByte(Userdate.value0.bytes[i]);
        ShortDelay(5);
	}

   
   

    I2C_SendStop();
    I2C_ReleaseBus();
    ShortDelay(500);

    I2C_SendByteWithStart(EEPROMWRITEID);
    I2C_SendByte(16);
    for(i=16; i<32;    i++)
    {
	I2C_SendByte(Userdate.value0.bytes[i]);
        ShortDelay(5);
	}

    
    

    I2C_SendStop();
    I2C_ReleaseBus();
    ShortDelay(500);

     //value 1
    I2C_SendByteWithStart(EEPROMWRITEID);
    I2C_SendByte(32);
    
    for(i=0; i<8; i++)
    {
	I2C_SendByte(Userdate.value1.bytes[i]);
        ShortDelay(5);     
    }
	
    I2C_SendStop();
    I2C_ReleaseBus();
    ShortDelay(500);

    //value 2

    I2C_SendByteWithStart(EEPROMWRITEID);
    I2C_SendByte(48);
    
    for(i=0; i<8; i++)
    {
	I2C_SendByte(Userdate.value2.bytes[i]);
        ShortDelay(5);     
    }
	
    
    for(i=0; i<8; i++)
    {
	I2C_SendByte(Userdate.value3.bytes[i]);
        ShortDelay(5);     
    }
      
	I2C_SendStop();
    I2C_ReleaseBus();
    ShortDelay(500);
//////////////////////add new 3500 and 3106////////////
I2C_SendByteWithStart(EEPROMWRITEID);
    I2C_SendByte(64);
    
    for(i=0; i<8;i++)
    {
	I2C_SendByte(Userdate.value4.bytes[i]);
        ShortDelay(5);
	}
     

    I2C_SendStop();
    I2C_ReleaseBus();
    DefaultOnLED();
}


⌨️ 快捷键说明

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