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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? norflashcfi.c

?? IAR5.2下 AT91SAM9260 ARM 對 MCP2515 控制源化碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
    unsigned int sector)
{
    unsigned short i;
    unsigned short j;
    unsigned short numBlockRegion,numBlockPerRegion;
    unsigned int block = 0;
    
    numBlockRegion = pNorFlashInfo->cfiDescription.norFlashCfiDeviceGeometry.numEraseRegion;
    for (i = 0; i < numBlockRegion; i++) {
    	numBlockPerRegion = (pNorFlashInfo->cfiDescription.norFlashCfiDeviceGeometry.eraseRegionInfo[i]).Y + 1;
    	for (j = 0; j < numBlockPerRegion; j++) {
    		if (block == sector) {
    			return (pNorFlashInfo->cfiDescription.norFlashCfiDeviceGeometry.eraseRegionInfo[i].Z) * 256 ;
    		}
    		block++;
        }
    }
    return 0;
}

//------------------------------------------------------------------------------
/// Returns secort number on specified memory offset.
/// \param pNorFlashInfo  Pointer to a NorFlashInfo instance.
/// \param memoryOffset  Memory offset.
//------------------------------------------------------------------------------
unsigned short NorFlash_GetDeviceSectorInRegion(
    struct NorFlashInfo *pNorFlashInfo,
    unsigned int memoryOffset)
{
	unsigned short numBlockRegion,numBlockPerRegion;
    unsigned short sectorId = 0;
    unsigned int size = 0;
    unsigned char done = 0;
    unsigned short i , j;
    
    numBlockRegion = pNorFlashInfo->cfiDescription.norFlashCfiDeviceGeometry.numEraseRegion;
    
    for (i = 0; i < numBlockRegion; i++) {
    	numBlockPerRegion = (pNorFlashInfo->cfiDescription.norFlashCfiDeviceGeometry.eraseRegionInfo[i]).Y + 1;
        for (j = 0; j < numBlockPerRegion; j++) {
            size+= (pNorFlashInfo->cfiDescription.norFlashCfiDeviceGeometry.eraseRegionInfo[i].Z) * 256 ;
            if(size >= memoryOffset) {
                done = 1;
                break;
            }
            sectorId++;
        }
        if (done) break;
    }
    
    return sectorId;
}

//------------------------------------------------------------------------------
/// Returns start address of specified sector number.
/// \param pNorFlashInfo  Pointer to a NorFlashInfo instance.
/// \param sector  Sector number.
//------------------------------------------------------------------------------
unsigned int NorFlash_GetDeviceSectorAddress(
    struct NorFlashInfo *pNorFlashInfo,
    unsigned int sector)
{
	unsigned short numBlockRegion,numBlockPerRegion;
    unsigned short sectorId = 0;
    unsigned int address = 0;
    unsigned char done = 0;
    unsigned short i , j;
    
    numBlockRegion = pNorFlashInfo->cfiDescription.norFlashCfiDeviceGeometry.numEraseRegion;
    for (i = 0; i < numBlockRegion; i++) {
    	numBlockPerRegion = (pNorFlashInfo->cfiDescription.norFlashCfiDeviceGeometry.eraseRegionInfo[i]).Y + 1;
        for (j = 0; j < numBlockPerRegion; j++) {
            if (sector == sectorId) {
                done = 1;
                break;
            }
            address+= (pNorFlashInfo->cfiDescription.norFlashCfiDeviceGeometry.eraseRegionInfo[i].Z) * 256 ;
            sectorId++;
        }
        if (done) break;
    }
    
    return address;
}

//------------------------------------------------------------------------------
/// Convert address to byte addressing.
/// \param pNorFlashInfo  Pointer to a NorFlashInfo instance.
/// \Param offset Address offset
//------------------------------------------------------------------------------
unsigned int NorFlash_GetByteAddress(
   struct NorFlashInfo *pNorFlashInfo, unsigned int offset)
{
    return (offset * pNorFlashInfo-> deviceChipWidth);
}

//------------------------------------------------------------------------------
/// Convert address to byte addressing and return the address in chip.
/// \param pNorFlashInfo  Pointer to a NorFlashInfo instance.
/// \Param offset Address offset
//------------------------------------------------------------------------------
unsigned int NorFlash_GetByteAddressInChip(
   struct NorFlashInfo *pNorFlashInfo, unsigned int offset)
{
    return (pNorFlashInfo->baseAddress + (offset * pNorFlashInfo-> deviceChipWidth));
}


//------------------------------------------------------------------------------
/// Returns the address in chip.
/// \param pNorFlashInfo  Pointer to a NorFlashInfo instance.
/// \Param offset Address offset
//------------------------------------------------------------------------------
unsigned int NorFlash_GetAddressInChip(struct NorFlashInfo *pNorFlashInfo, unsigned int offset)
{
    return (pNorFlashInfo->baseAddress + offset);
}

//------------------------------------------------------------------------------
/// Returns bus width in bits of giving device.
/// \param pNorFlashInfo  Pointer to a NorFlashInfo instance.
//------------------------------------------------------------------------------
unsigned char NorFlash_GetDataBusWidth( struct NorFlashInfo *pNorFlashInfo)
{
    return (pNorFlashInfo->deviceChipWidth * 8);
}
    
//------------------------------------------------------------------------------
/// Returns the size of the whole device in bytes 
/// \param pNorFlashInfo  Pointer to a NorFlashInfo instance.
//------------------------------------------------------------------------------
unsigned long  NorFlash_GetDeviceSizeInBytes(
   struct NorFlashInfo *pNorFlashInfo)
{
    return ((unsigned long) 2 << ((pNorFlashInfo->cfiDescription.norFlashCfiDeviceGeometry.deviceSize) - 1));
}

//------------------------------------------------------------------------------
/// Looks for query struct in Norflash common flash interface.
/// If found, the model variable is filled with the correct values.
/// This function returns 0 if a matching model has been found; otherwise it
/// returns NorCommon_ERROR_UNKNOWNMODEL.
//------------------------------------------------------------------------------
unsigned char NorFlash_CFI_Detect(
    struct NorFlash *pNorFlash, 
    unsigned char hardwareBusWidth)
{
	
    unsigned char i;
    unsigned char *pCfi = (unsigned char*)(&(pNorFlash->norFlashInfo.cfiDescription));
    unsigned int address;
    
    pNorFlash->norFlashInfo.cfiCompatible = 0;
    pNorFlash->norFlashInfo.deviceChipWidth = hardwareBusWidth;
    address = CFI_QUERY_OFFSET;
    for(i = 0; i< sizeof(struct NorFlashInfo) ; i++){
        WriteCommand(8, NorFlash_GetByteAddressInChip(&(pNorFlash->norFlashInfo), CFI_QUERY_ADDRESS), CFI_QUERY_COMMAND);
        ReadRawData(8, NorFlash_GetByteAddressInChip(&(pNorFlash->norFlashInfo), address), pCfi);
        address++;
        pCfi++;
        
    }
    // Check the query-unique ASCII string "QRY"
    if( (pNorFlash->norFlashInfo.cfiDescription.norFlashCfiQueryInfo.queryUniqueString[0] != 'Q' )
        || (pNorFlash->norFlashInfo.cfiDescription.norFlashCfiQueryInfo.queryUniqueString[1] != 'R') 
        || (pNorFlash->norFlashInfo.cfiDescription.norFlashCfiQueryInfo.queryUniqueString[2] != 'Y') ) {
        return NorCommon_ERROR_UNKNOWNMODEL;
    }
    
#ifdef DUMP_CFI    
	NorFlash_CFI_DumpConfigruation(&(pNorFlash->norFlashInfo.cfiDescription));
#endif

	if (pNorFlash->norFlashInfo.cfiDescription.norFlashCfiQueryInfo.primaryCode == CMD_SET_AMD) {
		pNorFlash->pOperations = &amdOperations;
	}
	else if (pNorFlash->norFlashInfo.cfiDescription.norFlashCfiQueryInfo.primaryCode == CMD_SET_INTEL_EXT) {
		pNorFlash->pOperations = &intelOperations;
	}
	else {
		return NorCommon_ERROR_UNKNOWNMODEL;
	}
	
	pNorFlash->norFlashInfo.cfiCompatible = 1;
    NORFLASH_Reset(pNorFlash, 0);
    return 0;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩在线播| 国产精品一区免费视频| 欧美伦理电影网| 五月天网站亚洲| 欧美卡1卡2卡| 久久99精品国产麻豆婷婷| 欧美大胆人体bbbb| 国产精品一区二区男女羞羞无遮挡| 久久久亚洲高清| av电影在线不卡| 亚洲第一综合色| 欧美一区二区三区视频| 国产精品一线二线三线| 亚洲视频一区在线| 欧美日韩视频在线一区二区| 久久不见久久见免费视频1| 国产精品日产欧美久久久久| 色8久久精品久久久久久蜜| 亚洲国产成人av| 久久久久久亚洲综合影院红桃| av在线免费不卡| 日韩精品一二三| 中文字幕av一区二区三区高| 欧美视频完全免费看| 国产老妇另类xxxxx| 亚洲精品老司机| www久久精品| 色系网站成人免费| 激情伊人五月天久久综合| 综合网在线视频| 日韩一区二区三区在线| 99久久亚洲一区二区三区青草| 天天综合网 天天综合色| 国产欧美一区二区精品忘忧草 | 亚洲免费成人av| 欧美一区二区视频在线观看2020| 国产精品66部| 免费精品99久久国产综合精品| 亚洲欧洲三级电影| 精品久久久久99| 欧美综合久久久| 国产成人高清视频| 美女mm1313爽爽久久久蜜臀| 亚洲人xxxx| 欧美极品少妇xxxxⅹ高跟鞋| 91麻豆精品国产91久久久| 91免费国产在线| 国产成人综合精品三级| 天天色天天操综合| 亚洲免费三区一区二区| 国产欧美精品一区aⅴ影院 | 欧美videos大乳护士334| 欧美自拍丝袜亚洲| 97久久精品人人爽人人爽蜜臀 | 91麻豆国产福利在线观看| 国产精品资源网| 激情欧美一区二区| 精品一区二区三区视频| 日韩**一区毛片| 亚洲aaa精品| 亚洲成人av电影| 亚洲国产一区视频| 亚洲国产精品久久人人爱| 亚洲色图视频网| 亚洲色图视频网| 国产精品久久久久桃色tv| 国产日韩欧美精品综合| 国产午夜亚洲精品理论片色戒 | 在线观看欧美黄色| 91影院在线免费观看| 91视视频在线直接观看在线看网页在线看 | 成人福利在线看| 国产二区国产一区在线观看| 国产精品一区二区男女羞羞无遮挡| 免费看精品久久片| 精品一区二区三区不卡| 麻豆国产91在线播放| 久久草av在线| 国产做a爰片久久毛片| 国产精品88av| 成人综合婷婷国产精品久久免费| 国产成人亚洲综合a∨婷婷图片| 国产精品一级在线| 成人精品一区二区三区四区| 国产欧美日韩精品a在线观看| 亚洲成人一二三| 夜夜亚洲天天久久| 亚洲理论在线观看| 午夜电影网亚洲视频| 日本一不卡视频| 国产在线一区二区综合免费视频| 国产永久精品大片wwwapp | 欧美激情在线一区二区三区| 国产无一区二区| 亚洲日本一区二区| 亚洲午夜羞羞片| 久久精品国产精品青草| 成人av网址在线| 欧美色男人天堂| 精品国产麻豆免费人成网站| 中文字幕在线不卡视频| 夜夜精品浪潮av一区二区三区| 日韩高清电影一区| 国产一区二区在线观看视频| 懂色av一区二区三区免费观看| 99免费精品视频| 欧美精品v国产精品v日韩精品 | 成人丝袜18视频在线观看| 懂色av一区二区三区蜜臀| 成人亚洲精品久久久久软件| 色婷婷亚洲综合| 精品国产乱码久久久久久久| 国产精品每日更新| 亚洲v精品v日韩v欧美v专区| 狠狠色狠狠色综合| 91在线云播放| 日韩三级电影网址| 国产精品久久久久毛片软件| 日韩专区欧美专区| 丁香啪啪综合成人亚洲小说 | 成人av在线播放网址| 欧美色爱综合网| 久久精品亚洲精品国产欧美kt∨ | 免费在线一区观看| 91最新地址在线播放| 精品久久人人做人人爰| 亚洲精品国产第一综合99久久| 正在播放亚洲一区| 日韩欧美区一区二| 亚洲人成网站色在线观看| 老司机精品视频导航| 日本精品裸体写真集在线观看| 欧美成人一区二区三区片免费| 亚洲精品午夜久久久| 国产不卡一区视频| 精品国产乱子伦一区| 亚洲高清免费视频| aaa国产一区| 久久一区二区三区四区| 三级不卡在线观看| 床上的激情91.| 欧美成人一区二区三区| 亚洲国产cao| 色噜噜久久综合| 国产精品久久久久一区二区三区| 精品在线视频一区| 日韩一区二区三区四区五区六区| 亚洲一二三四区不卡| 在线日韩av片| 亚洲日本青草视频在线怡红院| 国产成人av电影在线播放| 欧美电视剧在线看免费| 婷婷六月综合网| 欧美天天综合网| 一区二区三区精密机械公司| 91欧美一区二区| 亚洲视频图片小说| 99精品一区二区| ㊣最新国产の精品bt伙计久久| 国产69精品久久久久777| 精品裸体舞一区二区三区| 99久久综合狠狠综合久久| 日韩精品专区在线影院观看| 日韩成人伦理电影在线观看| 欧美亚洲愉拍一区二区| 亚洲自拍偷拍图区| 欧美少妇一区二区| 午夜精品福利一区二区蜜股av| 色综合一个色综合亚洲| 一区二区三区不卡在线观看 | av成人免费在线| 亚洲视频一二区| 91视视频在线观看入口直接观看www | 日韩免费性生活视频播放| 蓝色福利精品导航| 精品国产第一区二区三区观看体验| 看电影不卡的网站| 久久久久久免费毛片精品| 国产成人一区二区精品非洲| 国产精品美女久久久久久久久 | 五月天亚洲婷婷| 日韩欧美久久久| 国产高清亚洲一区| 国产精品不卡在线观看| 欧美在线你懂的| 丝袜美腿高跟呻吟高潮一区| 欧美一区2区视频在线观看| 老汉av免费一区二区三区| 久久久久综合网| 91在线视频播放地址| 香蕉加勒比综合久久| 日韩视频永久免费| 国产91精品免费| 亚洲综合成人网| 日韩视频一区二区| 99国产精品久久| 婷婷综合在线观看| 国产欧美日韩卡一| 精品视频资源站| 精品写真视频在线观看|