亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? eeprom.c

?? 礦工定位系統(tǒng)單端
?? C
字號:
//eeprom.c - code recommendation for C header file
/***********************************************************************
MODULE:    EEPROM
VERSION:   1.00
CONTAINS:  Routines for accessing the EEPROM on the Philips
           P89LPC932
COPYRIGHT: Embedded Systems Academy, Inc. - www.esacademy.com
LICENSE:   May be freely used in commercial and non-commercial code
           without royalties provided this copyright notice remains
           in this file and unaltered
WARNING:   IF THIS FILE IS REGENERATED BY CODE ARCHITECT ANY CHANGES
           MADE WILL BE LOST. WHERE POSSIBLE USE ONLY CODE ARCHITECT
           TO CHANGE THE CONTENTS OF THIS FILE
GENERATED: On "Mar 14 2004" at "11:02:25" by Code Architect 2.03
***********************************************************************/

// SFR description needs to be included
#include<REG922.h>
#include "eeprom.h"

// flag that indicates if the EEPROM is busy or not
static bit meeprombusy;

/***********************************************************************
DESC:    Initializes the EEPROM. Enables EEPROM interrupt
RETURNS: Nothing
CAUTION: Set EA to 1 after calling to enable all interrupts
************************************************************************/
void eeprom_init
  (
  void
  )
{
  // initially eeprom is not busy
  meeprombusy = 0;

  // set isr priority to 0
  IP1 &= 0x7F;
  IP0H &= 0x7F;
  // enable eeprom interrupt
  EIEE = 1;
}

/***********************************************************************
DESC:    Reads a location in the EEPROM.
         If either global interrupts or the EEPROM interrupt is disabled
         then the function will return when the operation is complete.
         If global interrupts and the EEPROM interrupt are enabled, the
         function will return immediately and an interrupt will occur
         when the operation is complete.
RETURNS: The 8-bit value read if interrupts are disabled, otherwise
         0x00 will be returned.
CAUTION: eeprom_init must be called first
************************************************************************/
unsigned char eeprom_read
  (
  unsigned int address     // 9-bit address to read (0x000 - 0x1FF)
  )
{
  // wait for previous operation to complete
  while (meeprombusy);

  // eeprom now busy
  meeprombusy = 1;

  // store bit 8 of address
  // byte operation, clear interrupt flag
  DEECON = (address >> 8) & 0x01;
  // store bits 0-7 of address
  DEEADR = address & 0xFF;

  // if not using interrupt then poll for end of operation
  if (!EA || !EIEE)
  {
    // wait for operation to complete
    while (!(DEECON & 0x80));
    // eeprom no longer busy
    meeprombusy = 0;
    // return value
    return DEEDAT;
  }

  return 0x00;
}

/***********************************************************************
DESC:    Writes to a location in the EEPROM.
         If either global interrupts or the EEPROM interrupt is disabled
         then the function will return when the operation is complete.
         If global interrupts and the EEPROM interrupt are enabled, the
         function will return immediately and an interrupt will occur
         when the operation is complete.
RETURNS: Nothing
CAUTION: eeprom_init must be called first
************************************************************************/
void eeprom_write
  (
  unsigned int address,    // 9-bit address to write to (0x000 - 0x1FF)
  unsigned char value      // value to write
  )
{
  bit eacopy;

  // wait for previous operation to complete
  while (meeprombusy);

  // eeprom now busy
  meeprombusy = 1;

  // store bit 8 of address
  // byte operation, clear interrupt flag
  DEECON = (address >> 8) & 0x01;
  // disable interrupts
  eacopy = EA;
  EA = 0;
  // store value to write
  DEEDAT = value;
  // store bits 0-7 of address
  DEEADR = address & 0xFF;
  // restore interrupts
  EA = eacopy;

  // if not using interrupt then poll for end of operation
  if (!EA || !EIEE)
  {
    // wait for operation to complete
    while (!(DEECON & 0x80));
    // eeprom no longer busy
    meeprombusy = 0;
  }
}

/***********************************************************************
DESC:    Writes a value to every location in a 64-byte row in
         the EEPROM.
         If either global interrupts or the EEPROM interrupt is disabled
         then the function will return when the operation is complete.
         If global interrupts and the EEPROM interrupt are enabled, the
         function will return immediately and an interrupt will occur
         when the operation is complete.
RETURNS: Nothing
CAUTION: eeprom_init must be called first
************************************************************************/
void eeprom_fillrow
  (
   unsigned int address,    // 9-bit starting address of row
                            // (64-byte aligned)
   unsigned char value      // value to fill row with
  )
{
  bit eacopy;

  // wait for previous operation to complete
  while (meeprombusy);

  // eeprom now busy
  meeprombusy = 1;

  // store bit 8 of address
  // row fill operation, clear interrupt flag
  DEECON = ((address >> 8) & 0x01) | 0x20;
  // disable interrupts
  eacopy = EA;
  EA = 0;
  // store fill pattern
  DEEDAT = value;
  // store bits 0-7 of address (note bits 0-5 are ignored by device)
  DEEADR = address & 0xFF;
  // restore interrupts
  EA = eacopy;

  // if not using interrupt then poll for end of operation
  if (!EA || !EIEE)
  {
    // wait for operation to complete
    while (!(DEECON & 0x80));
    // eeprom no longer busy
    meeprombusy = 0;
  }
}

/***********************************************************************
DESC:    Writes a value to every location in the EEPROM.
         If either global interrupts or the EEPROM interrupt is disabled
         then the function will return when the operation is complete.
         If global interrupts and the EEPROM interrupt are enabled, the
         function will return immediately and an interrupt will occur
         when the operation is complete.
RETURNS: Nothing
CAUTION: eeprom_init must be called first
************************************************************************/
void eeprom_fill
  (
  unsigned char value      // value to fill EEPROM with
  )
{
  bit eacopy;

  // wait for previous operation to complete
  while (meeprombusy);

  // eeprom now busy
  meeprombusy = 1;

  // bit 8 of address = 1
  // block fill operation, clear interrupt flag
  DEECON = 0x31;
  // disable interrupts
  eacopy = EA;
  EA = 0;
  // store fill pattern
  DEEDAT = value;
  // store anything to address register - value ignored by device
  DEEADR = 0x00;
  // restore interrupts
  EA = eacopy;

  // if not using interrupt then poll for end of operation
  if (!EA || !EIEE)
  {
    // wait for operation to complete
    while (!(DEECON & 0x80));
    // eeprom no longer busy
    meeprombusy = 0;
  }
}

/***********************************************************************
DESC:    Erases a 64-byte row in the EEPROM.
         If either global interrupts or the EEPROM interrupt is disabled
         then the function will return when the operation is complete.
         If global interrupts and the EEPROM interrupt are enabled, the
         function will return immediately and an interrupt will occur
         when the operation is complete.
         Equivalent to eeprom_fillrow(address, 0x00);
RETURNS: Nothing
CAUTION: eeprom_init must be called first
************************************************************************/
void eeprom_eraserow
  (
  unsigned int address      // 9-bit starting address of row
                            // (64-byte aligned)
  )
{
  eeprom_fillrow(address, 0x00);
}

/***********************************************************************
DESC:    Erases the EEPROM.
         If either global interrupts or the EEPROM interrupt is disabled
         then the function will return when the operation is complete.
         If global interrupts and the EEPROM interrupt are enabled, the
         function will return immediately and an interrupt will occur
         when the operation is complete.
         Equivalent to eeprom_fill(0x00);
RETURNS: Nothing
CAUTION: eeprom_init must be called first
************************************************************************/
void eeprom_erase
  (
  void
  )
{
  eeprom_fill(0x00);
}

/***********************************************************************
DESC:    EEPROM Interrupt Service Routine
         Called when an EEPROM operation has completed
         Uses register bank 1
RETURNS: Nothing
CAUTION: eeprom_init must be called first
************************************************************************/
void eeprom_isr
  (
  void
  ) interrupt 14 using 1
{
  // clear EEIF flag
  DEECON &= ~0x80;
  // eeprom no longer busy
  meeprombusy = 0;
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品国产久精国产爱| 粉嫩av一区二区三区粉嫩| 91黄色小视频| 亚洲黄一区二区三区| 色婷婷久久久亚洲一区二区三区| 风间由美一区二区av101| 成人高清av在线| 亚洲人吸女人奶水| 欧洲一区在线观看| 蜜臀精品久久久久久蜜臀| 亚洲色图在线视频| 日韩不卡一二三区| 午夜精品久久久久久久久久久 | 奇米一区二区三区| 欧美一级二级三级蜜桃| 免费xxxx性欧美18vr| 精品人在线二区三区| 国产福利一区二区三区在线视频| 国产精品理论片在线观看| 亚洲夂夂婷婷色拍ww47| 日本最新不卡在线| 亚洲成人一区二区| 色婷婷久久久久swag精品| 天天av天天翘天天综合网| 精品欧美一区二区三区精品久久 | 国产精品久久久久9999吃药| 色婷婷av一区二区三区软件| 日本美女一区二区| 国产精品久久毛片| 9191精品国产综合久久久久久 | 一区二区三区欧美亚洲| 欧美一区二区视频网站| a级高清视频欧美日韩| 亚洲国产精品一区二区www| 精品国产精品网麻豆系列| 色综合天天天天做夜夜夜夜做| 日韩av中文字幕一区二区三区 | 日韩亚洲欧美在线观看| 欧美国产一区在线| 91视视频在线直接观看在线看网页在线看| 国产精品第13页| 在线不卡一区二区| 99久久伊人久久99| 蜜桃一区二区三区在线| 中文字幕在线观看一区二区| 日韩写真欧美这视频| 99精品国产热久久91蜜凸| 老司机精品视频在线| 一区二区三区四区国产精品| 久久午夜国产精品| 91精品一区二区三区在线观看| 成人免费黄色在线| 免费看黄色91| 亚洲bt欧美bt精品777| 国产精品丝袜一区| 日韩欧美国产三级电影视频| 色播五月激情综合网| 99在线精品一区二区三区| 国产一区二区三区日韩| 日本不卡一区二区| 欧美精品九九99久久| 一区二区高清在线| 国产精品资源在线观看| 天堂蜜桃一区二区三区| 综合久久给合久久狠狠狠97色| 久久免费看少妇高潮| 91精品国产免费| 欧美精品少妇一区二区三区| 在线欧美日韩国产| 色老头久久综合| 色噜噜狠狠色综合中国| 色婷婷综合久色| 色欧美片视频在线观看在线视频| 99久久免费精品高清特色大片| 风间由美一区二区三区在线观看| 国产一区视频网站| 国产精品夜夜嗨| 国产精品亚洲第一| 高清国产一区二区三区| 成人午夜视频免费看| 成人的网站免费观看| 北条麻妃国产九九精品视频| 成人丝袜18视频在线观看| 丁香桃色午夜亚洲一区二区三区| 国产一区二区电影| 一区二区在线观看免费视频播放| 99国产欧美另类久久久精品| 97久久精品人人做人人爽| 国产69精品久久99不卡| 高清国产一区二区| 91蜜桃在线免费视频| 色综合色狠狠天天综合色| 欧美网站一区二区| 欧美一区二区私人影院日本| 日韩精品一区二区在线| 久久综合九色综合久久久精品综合| 久久久一区二区| 中文字幕亚洲成人| 亚洲影院理伦片| 奇米888四色在线精品| 国产自产2019最新不卡| 成人av综合一区| 在线视频欧美精品| 欧美一区二区三区啪啪| 久久综合成人精品亚洲另类欧美| 久久精品在线观看| 亚洲精品国产高清久久伦理二区| 亚洲va天堂va国产va久| 久久精品99国产国产精| 懂色av一区二区三区免费观看| 色婷婷综合在线| 26uuu国产日韩综合| 中文av一区特黄| 亚洲精品福利视频网站| 美美哒免费高清在线观看视频一区二区| 国产中文字幕一区| 色婷婷av一区二区三区gif| 日韩一区二区三区av| 国产精品久久久久一区二区三区共| 亚洲国产一区二区视频| 国产一区二三区好的| 欧美中文字幕一区二区三区 | 国产成人午夜99999| 99精品欧美一区二区三区小说| 欧美日韩国产成人在线免费| 国产欧美在线观看一区| 午夜国产精品一区| av电影在线观看完整版一区二区 | 精品成人一区二区| 一区二区高清视频在线观看| 国产激情一区二区三区四区| 日本精品一区二区三区高清| 久久天堂av综合合色蜜桃网| 亚洲成在线观看| 99亚偷拍自图区亚洲| 精品日韩欧美在线| 水蜜桃久久夜色精品一区的特点| 国产91精品久久久久久久网曝门| 欧美精品在线一区二区| 国产精品国产馆在线真实露脸| 久久99久久久久久久久久久| 色哟哟国产精品| 国产亚洲欧美日韩俺去了| 日韩电影在线免费| 99久久精品免费精品国产| 美女免费视频一区二区| 一区二区三区精品在线| 精品国产免费人成电影在线观看四季| 国产成人h网站| 亚洲一区二区高清| 欧美绝品在线观看成人午夜影视| 午夜精品视频一区| 亚洲制服丝袜av| 91天堂素人约啪| 国产亚洲欧洲997久久综合| 午夜久久福利影院| 99久久免费精品高清特色大片| 国产日韩av一区二区| 国产在线国偷精品免费看| 欧美一区二区三区日韩| 色一情一伦一子一伦一区| 国产高清精品久久久久| 欧美一区二区三区思思人| 亚洲免费成人av| 91色九色蝌蚪| 综合激情成人伊人| 久久久久久久久久美女| 久热成人在线视频| 日韩欧美一区二区三区在线| 午夜久久久久久久久| 欧美影院一区二区三区| 欧美三级在线视频| 日韩电影免费在线| 捆绑调教美女网站视频一区| 7777女厕盗摄久久久| 日韩福利视频网| 日韩免费观看2025年上映的电影| 男女男精品视频| 亚洲精品一线二线三线无人区| 激情文学综合网| 国产午夜精品一区二区三区嫩草| 国产风韵犹存在线视精品| 国产欧美精品一区二区三区四区 | 91在线观看视频| 亚洲男人的天堂在线观看| 在线亚洲欧美专区二区| 天天综合网 天天综合色| 91精品国产综合久久婷婷香蕉 | 亚洲伊人色欲综合网| 欧美亚洲动漫精品| 奇米影视一区二区三区| 久久久久久一级片| 91免费在线看| 日韩国产在线一| 国产日产欧美精品一区二区三区| 成年人网站91| 三级一区在线视频先锋| 久久综合久久久久88| 94-欧美-setu| 麻豆精品一区二区av白丝在线|