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

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

?? eeprom93xx.c

?? QEMU 0.91 source code, supports ARM processor including S3C24xx series
?? C
字號(hào):
/* * QEMU EEPROM 93xx emulation * * Copyright (c) 2006-2007 Stefan Weil * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA *//* Emulation for serial EEPROMs: * NMC93C06 256-Bit (16 x 16) * NMC93C46 1024-Bit (64 x 16) * NMC93C56 2028 Bit (128 x 16) * NMC93C66 4096 Bit (256 x 16) * Compatible devices include FM93C46 and others. * * Other drivers use these interface functions: * eeprom93xx_new   - add a new EEPROM (with 16, 64 or 256 words) * eeprom93xx_free  - destroy EEPROM * eeprom93xx_read  - read data from the EEPROM * eeprom93xx_write - write data to the EEPROM * eeprom93xx_data  - get EEPROM data array for external manipulation * * Todo list: * - No emulation of EEPROM timings. */#include <assert.h>#include "hw.h"#include "eeprom93xx.h"/* Debug EEPROM emulation. *///~ #define DEBUG_EEPROM#ifdef DEBUG_EEPROM#define logout(fmt, args...) fprintf(stderr, "EEPROM\t%-24s" fmt, __func__, ##args)#else#define logout(fmt, args...) ((void)0)#endifstatic int eeprom_instance = 0;static const int eeprom_version = 20061112;#if 0typedef enum {  eeprom_read  = 0x80,   /* read register xx */  eeprom_write = 0x40,   /* write register xx */  eeprom_erase = 0xc0,   /* erase register xx */  eeprom_ewen  = 0x30,   /* erase / write enable */  eeprom_ewds  = 0x00,   /* erase / write disable */  eeprom_eral  = 0x20,   /* erase all registers */  eeprom_wral  = 0x10,   /* write all registers */  eeprom_amask = 0x0f,  eeprom_imask = 0xf0} eeprom_instruction_t;#endif#ifdef DEBUG_EEPROMstatic const char *opstring[] = {  "extended", "write", "read", "erase"};#endifstruct _eeprom_t {    uint8_t  tick;    uint8_t  address;    uint8_t  command;    uint8_t  writeable;    uint8_t eecs;    uint8_t eesk;    uint8_t eedo;    uint8_t  addrbits;    uint8_t  size;    uint16_t data;    uint16_t contents[0];};/* Code for saving and restoring of EEPROM state. */static void eeprom_save(QEMUFile *f, void *opaque){    /* Save EEPROM data. */    unsigned address;    eeprom_t *eeprom = (eeprom_t *)opaque;    qemu_put_buffer(f, (uint8_t *)eeprom, sizeof(*eeprom) - 2);    qemu_put_be16(f, eeprom->data);    for (address = 0; address < eeprom->size; address++) {        qemu_put_be16(f, eeprom->contents[address]);    }}static int eeprom_load(QEMUFile *f, void *opaque, int version_id){    /* Load EEPROM data from saved data if version and EEPROM size       of data and current EEPROM are identical. */    eeprom_t *eeprom = (eeprom_t *)opaque;    int result = -EINVAL;    if (version_id == eeprom_version) {        unsigned address;        uint8_t size = eeprom->size;        qemu_get_buffer(f, (uint8_t *)eeprom, sizeof(*eeprom) - 2);        if (eeprom->size == size) {            eeprom->data = qemu_get_be16(f);            for (address = 0; address < eeprom->size; address++) {                eeprom->contents[address] = qemu_get_be16(f);            }            result = 0;        }    }    return result;}void eeprom93xx_write(eeprom_t *eeprom, int eecs, int eesk, int eedi){    uint8_t tick = eeprom->tick;    uint8_t eedo = eeprom->eedo;    uint16_t address = eeprom->address;    uint8_t command = eeprom->command;    logout("CS=%u SK=%u DI=%u DO=%u, tick = %u\n",           eecs, eesk, eedi, eedo, tick);    if (! eeprom->eecs && eecs) {        /* Start chip select cycle. */        logout("Cycle start, waiting for 1st start bit (0)\n");        tick = 0;        command = 0x0;        address = 0x0;    } else if (eeprom->eecs && ! eecs) {        /* End chip select cycle. This triggers write / erase. */        if (eeprom->writeable) {            uint8_t subcommand = address >> (eeprom->addrbits - 2);            if (command == 0 && subcommand == 2) {                /* Erase all. */                for (address = 0; address < eeprom->size; address++) {                    eeprom->contents[address] = 0xffff;                }            } else if (command == 3) {                /* Erase word. */                eeprom->contents[address] = 0xffff;            } else if (tick >= 2 + 2 + eeprom->addrbits + 16) {                if (command == 1) {                    /* Write word. */                    eeprom->contents[address] &= eeprom->data;                } else if (command == 0 && subcommand == 1) {                    /* Write all. */                    for (address = 0; address < eeprom->size; address++) {                        eeprom->contents[address] &= eeprom->data;                    }                }            }        }        /* Output DO is tristate, read results in 1. */        eedo = 1;    } else if (eecs && ! eeprom->eesk && eesk) {        /* Raising edge of clock shifts data in. */        if (tick == 0) {            /* Wait for 1st start bit. */            if (eedi == 0) {                logout("Got correct 1st start bit, waiting for 2nd start bit (1)\n");                tick++;            } else {                logout("wrong 1st start bit (is 1, should be 0)\n");                tick = 2;                //~ assert(!"wrong start bit");            }        } else if (tick == 1) {            /* Wait for 2nd start bit. */            if (eedi != 0) {                logout("Got correct 2nd start bit, getting command + address\n");                tick++;            } else {                logout("1st start bit is longer than needed\n");            }        } else if (tick < 2 + 2) {            /* Got 2 start bits, transfer 2 opcode bits. */            tick++;            command <<= 1;            if (eedi) {                command += 1;            }        } else if (tick < 2 + 2 + eeprom->addrbits) {            /* Got 2 start bits and 2 opcode bits, transfer all address bits. */            tick++;            address = ((address << 1) | eedi);            if (tick == 2 + 2 + eeprom->addrbits) {                logout("%s command, address = 0x%02x (value 0x%04x)\n",                       opstring[command], address, eeprom->contents[address]);                if (command == 2) {                    eedo = 0;                }                address = address % eeprom->size;                if (command == 0) {                    /* Command code in upper 2 bits of address. */                    switch (address >> (eeprom->addrbits - 2)) {                        case 0:                            logout("write disable command\n");                            eeprom->writeable = 0;                            break;                        case 1:                            logout("write all command\n");                            break;                        case 2:                            logout("erase all command\n");                            break;                        case 3:                            logout("write enable command\n");                            eeprom->writeable = 1;                            break;                    }                } else {                    /* Read, write or erase word. */                    eeprom->data = eeprom->contents[address];                }            }        } else if (tick < 2 + 2 + eeprom->addrbits + 16) {            /* Transfer 16 data bits. */            tick++;            if (command == 2) {                /* Read word. */                eedo = ((eeprom->data & 0x8000) != 0);            }            eeprom->data <<= 1;            eeprom->data += eedi;        } else {            logout("additional unneeded tick, not processed\n");        }    }    /* Save status of EEPROM. */    eeprom->tick = tick;    eeprom->eecs = eecs;    eeprom->eesk = eesk;    eeprom->eedo = eedo;    eeprom->address = address;    eeprom->command = command;}uint16_t eeprom93xx_read(eeprom_t *eeprom){    /* Return status of pin DO (0 or 1). */    logout("CS=%u DO=%u\n", eeprom->eecs, eeprom->eedo);    return (eeprom->eedo);}#if 0void eeprom93xx_reset(eeprom_t *eeprom){    /* prepare eeprom */    logout("eeprom = 0x%p\n", eeprom);    eeprom->tick = 0;    eeprom->command = 0;}#endifeeprom_t *eeprom93xx_new(uint16_t nwords){    /* Add a new EEPROM (with 16, 64 or 256 words). */    eeprom_t *eeprom;    uint8_t addrbits;    switch (nwords) {        case 16:        case 64:            addrbits = 6;            break;        case 128:        case 256:            addrbits = 8;            break;        default:            assert(!"Unsupported EEPROM size, fallback to 64 words!");            nwords = 64;            addrbits = 6;    }    eeprom = (eeprom_t *)qemu_mallocz(sizeof(*eeprom) + nwords * 2);    eeprom->size = nwords;    eeprom->addrbits = addrbits;    /* Output DO is tristate, read results in 1. */    eeprom->eedo = 1;    logout("eeprom = 0x%p, nwords = %u\n", eeprom, nwords);    register_savevm("eeprom", eeprom_instance, eeprom_version,                    eeprom_save, eeprom_load, eeprom);    return eeprom;}void eeprom93xx_free(eeprom_t *eeprom){    /* Destroy EEPROM. */    logout("eeprom = 0x%p\n", eeprom);    qemu_free(eeprom);}uint16_t *eeprom93xx_data(eeprom_t *eeprom){    /* Get EEPROM data array. */    return &eeprom->contents[0];}/* eof */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
www.欧美色图| 色婷婷激情一区二区三区| 日韩一区在线看| 日韩视频在线永久播放| 99久久伊人网影院| 久久er精品视频| 亚洲综合精品自拍| 国产日韩亚洲欧美综合| 91精品国模一区二区三区| 不卡免费追剧大全电视剧网站| 日本女人一区二区三区| 一区二区三区在线免费| 日本一区二区动态图| 日韩三级av在线播放| 精品视频一区 二区 三区| www.亚洲在线| 国产激情视频一区二区三区欧美| 日韩高清一区二区| 亚洲永久免费av| 亚洲日本va午夜在线影院| 亚洲国产激情av| 日韩成人dvd| 香蕉加勒比综合久久| 国产精品成人免费精品自在线观看 | 成人在线视频一区| 精品一区二区久久久| 美腿丝袜亚洲综合| 免费成人美女在线观看| 亚洲午夜免费视频| 亚洲国产sm捆绑调教视频 | 国产成人精品网址| 天堂va蜜桃一区二区三区漫画版| 3d动漫精品啪啪一区二区竹菊| 国产精品入口麻豆原神| 91麻豆123| 亚洲欧美日韩国产另类专区| eeuss影院一区二区三区| 亚洲三级视频在线观看| 欧美丰满高潮xxxx喷水动漫| 99这里只有久久精品视频| 国产综合色在线视频区| 国产精品久久久久久久裸模| 久久99九九99精品| 欧美不卡一区二区三区四区| 91蜜桃免费观看视频| 国产一区二区三区免费播放| 免费在线观看一区二区三区| 欧美人牲a欧美精品| 国产精品大尺度| 男女男精品网站| 日本精品一级二级| 久久久久青草大香线综合精品| 日本大胆欧美人术艺术动态| 国产精品久久久久久久久果冻传媒 | 久久国产欧美日韩精品| 亚洲免费观看高清完整| 久久久久久麻豆| 成人综合在线观看| 99在线热播精品免费| jvid福利写真一区二区三区| 依依成人精品视频| 丝袜亚洲精品中文字幕一区| 狠狠色丁香九九婷婷综合五月| 国产精品一区二区视频| 91在线视频播放| 欧美另类一区二区三区| 久久亚洲影视婷婷| 亚洲精品中文在线影院| 视频一区国产视频| 国产呦精品一区二区三区网站| 成人黄色综合网站| 欧美日韩国产成人在线免费| 久久一区二区视频| 亚洲综合一二区| 韩国女主播成人在线| 一本到三区不卡视频| 精品免费国产一区二区三区四区| 中文字幕中文字幕一区二区| 亚洲成av人片| 成人av片在线观看| 欧美精品丝袜中出| 国产精品第五页| 久久国产综合精品| 成人高清伦理免费影院在线观看| 欧美日韩精品欧美日韩精品| 欧美激情中文字幕| 日韩专区在线视频| 99精品视频在线观看| 精品日韩欧美在线| 亚洲在线视频免费观看| 国产v日产∨综合v精品视频| 7777精品伊人久久久大香线蕉超级流畅| 久久香蕉国产线看观看99| 亚洲一区二区美女| 成人精品国产福利| 一区二区三区欧美日韩| 国产一区二区剧情av在线| 欧美午夜一区二区三区| 欧美韩国日本综合| 日韩成人免费看| 在线观看网站黄不卡| 2020国产成人综合网| 亚洲主播在线观看| 波多野结衣在线一区| 欧美成人a∨高清免费观看| 亚洲成人午夜影院| 色狠狠桃花综合| 国产精品乱码一区二区三区软件| 青青草原综合久久大伊人精品| 91首页免费视频| 国产精品天天摸av网| 国产精品一区二区在线观看网站 | 在线视频综合导航| 国产精品色哟哟| 国产美女视频91| 日韩欧美在线不卡| 亚洲成a人片在线观看中文| 色琪琪一区二区三区亚洲区| 国产精品欧美经典| 成人性生交大片免费看在线播放| 欧美va亚洲va| 久久97超碰国产精品超碰| 日韩视频一区二区在线观看| 婷婷中文字幕一区三区| 色综合天天狠狠| 樱花影视一区二区| 在线亚洲高清视频| 亚洲资源中文字幕| 欧美日韩精品久久久| 亚洲一卡二卡三卡四卡 | 91丨porny丨首页| 中文字幕一区二区三区不卡在线| 丁香婷婷综合激情五月色| 久久久亚洲精品石原莉奈 | 91黄色免费看| 夜夜嗨av一区二区三区| 色婷婷精品久久二区二区蜜臀av| 日韩一区在线播放| 91国产福利在线| 亚洲午夜激情av| 69堂精品视频| 久久99精品久久久久久国产越南 | 精品国产亚洲一区二区三区在线观看| 日本视频中文字幕一区二区三区| 日韩欧美一区二区不卡| 久久国产生活片100| 久久久国际精品| av激情成人网| 一个色妞综合视频在线观看| 欧美日韩卡一卡二| 免费看日韩a级影片| 久久久久久久免费视频了| 国产成a人亚洲| 亚洲品质自拍视频网站| 欧美三级日本三级少妇99| 天堂蜜桃91精品| 久久综合成人精品亚洲另类欧美| 国产成人夜色高潮福利影视| 亚洲欧美综合另类在线卡通| 欧美在线观看一区| 黄一区二区三区| 中文字幕亚洲电影| 欧美日韩激情在线| 国产在线播放一区| 最好看的中文字幕久久| 6080亚洲精品一区二区| 国产一区二区在线视频| 中文字幕制服丝袜一区二区三区 | 欧美精品第1页| 国产精品羞羞答答xxdd| 一区二区三区四区在线免费观看 | 欧美日韩精品欧美日韩精品一综合| 男女男精品视频| 中文字幕中文字幕在线一区 | 久久狠狠亚洲综合| 中文字幕av免费专区久久| 欧美色男人天堂| 国产成人超碰人人澡人人澡| 亚洲一区在线看| 国产午夜亚洲精品羞羞网站| 欧美自拍丝袜亚洲| 国产不卡在线播放| 日韩精品视频网站| 中文字幕中文字幕在线一区| 欧美一区二区女人| 99国产精品久| 国产中文字幕精品| 亚洲国产日韩在线一区模特| 久久精品一区二区三区不卡| 欧美日韩视频在线一区二区| 丰满少妇久久久久久久 | 不卡电影一区二区三区| 蜜臀a∨国产成人精品| 一区二区三区日韩在线观看| 久久久久久久久99精品| 色综合中文综合网| 一本在线高清不卡dvd| 亚洲乱码中文字幕| 久久精品视频一区二区| 9191成人精品久久|