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

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

?? bsl_flash.c

?? BSL64xx是一dsp的程序代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
/******************************************************************************\
* Copyright (C) 2004 by RTD Embedded Technologies, Inc.   All rights reserved.
* Confidential and Proprietary, Not for Public Release
*------------------------------------------------------------------------------
* PROJECT.......... Board Support Library for SPM6420
* VERSION.......... (Defined in README.TXT)
*------------------------------------------------------------------------------
* CONTENT.......... C source file for API of peripheral FLASH
* FILENAME......... bsl_flash.c
* GENERATED BY..... Peripheral Generator v1.1
* GENERATED AT..... 02/10/2004 08:50:53
*------------------------------------------------------------------------------
* PERIPHERAL NAME.. FLASH
* PERIPHERAL TYPE.. Single-device peripheral
* ACCESS MODE...... Direct (no handle)
* REGISTER ACCESS.. 16-bit wide
\******************************************************************************/
#define _BSL_FLASH_MOD_

#include <bsl_flash.h>
#include <csl_irq.h>
#include <csl_dat.h>
#include <bsl_uint.h>


#if (BSL_FLASH_SUPPORT)
/******************************************************************************\
*                         L O C A L   S E C T I O N
\******************************************************************************/


/******************************************************************************\
* static macro declarations
\******************************************************************************/

// valid values for Flash_lock
#define FLASH_UNLOCKED			0
#define FLASH_LOCKED			1

// flash write macro using flash relative offset
#define FLASH_WRITE16(flashByteOffset,val16) \
	*(volatile Uint16 *)(((Uint32)(FLASH_STARTING_ADDRESS)+(Uint32)(flashByteOffset))) \
	= ((Uint16)(val16))

// flash read macro using flash relative offset
#define FLASH_READ16(flashByteOffset) \
	(*(volatile Uint16 *)((Uint32)(FLASH_STARTING_ADDRESS)+(Uint32)(flashByteOffset)))

// DSP read macro using DSP absolute address
#define DSP_READ16(dspByteAddress) \
	(*(volatile Uint16 *)((Uint32)(dspByteAddress)))

// operations
#define FLASH_OP_TRANSFER_FROM_DSP			(0x00000000u)
#define FLASH_OP_TRANSFER_TO_FLASH			(0x00000000u)
#define FLASH_OP_TRANSFER_FROM_FLASH		(0x00000001u)
#define FLASH_OP_TRANSFER_TO_DSP			(0x00000001u)
#define FLASH_OP_ERASE_SECTORS				(0x00000002u)
#define FLASH_OP_ERASE_CHIP					(0x00000003u)
#define FLASH_OP_IS_BLANK					(0x00000004u)


/******************************************************************************\
* static typedef declarations
\******************************************************************************/

// Flash Resource Access Request Object, or Flash RARO for short
typedef struct
{
	Uint32	operation;	// operation
	Uint32	param1;		// parameter 1
	Uint32	param2;		// parameter 2
	Uint32	numOf16bWs;	// number of 16-bit words to be transferred
						// at read and write
	FLASH_PReturn	pReturn;	// pointer to the user's variable that
								// will be set after the flash operation
} FLASH_AccessReqObj;

/* param1 and param2 mean different things at different operation
 *
 * operation		param1						param2
 *
 * TRANSFER_xxx		byte offset within			byte address within DSP's
 *					flash's address				memory space; it must not be
 *					space						an address within flash
 *
 * ERASE_SECTORS	ordinal number of			ordinal number of
 *					beginning sector,			last sector, counted from 0
 *					counted from 0
 *
 * ERASE_CHIP		do not care					do not care
 *
 * IS_BLANK			ordinal number of			ordinal number of
 *					beginning sector,			last sector, counted from 0
 *					counted from 0
 */


/******************************************************************************\
* static function declarations
\******************************************************************************/

void	FLASH_operation();

void	FLASH_cmdUnlockBypass();
void	FLASH_cmdUnlockBypassProg16(Uint32 flashOffset, Uint16 data16);
void	FLASH_cmdUnlockBypassReset();
void	FLASH_cmdChipErase();
void	FLASH_cmdSectorErase(Uint32 sectorIndex);

Uint32	FLASH_testAndLock();
void	FLASH_release();

Uint32	FLASH_checkParams(Uint32 flashOffset, Uint32 dspAddress, Uint32 numOf16bWs);
Uint32	FLASH_checkSiParams(Uint32 startSI, Uint32 endSI);


/******************************************************************************\
* static variable definitions
\******************************************************************************/

// lock, to determine there is an operation (access request) in process
volatile Uint32	FLASH_lock;

// flash size in bytes
Uint32	FLASH_sizeInBytes;

// flash device's last byte address in the DSP memory space
Uint32	FLASH_lastAddress;

// the one and only Flash RARO
FLASH_AccessReqObj	FLASH_accessReqObj;

// variables used while an operation is running
Uint32	FLASH_OP_param1;
Uint32	FLASH_OP_param2;
Uint32	FLASH_OP_count;


/******************************************************************************\
* static function definitions
\******************************************************************************/

//==============================================================================
// Initializes the flash controller module.
//
// Called from the BLS_init().
//
// The state of flash device's Ready/Busy# pin can be accessed through an
// EPLD register, and an interrupt can be generated for the Busy#-to-Ready
// transition on the ExtInt4 to ExtInt7.
//
// The Ready/Busy# pin is redirected to the ExtInt6. The ExtInt6 provides an
// interrupt controlled flash access method.
// In the vector.asm, the ExtInt6 interrupt vector must be unmodified!
//==============================================================================
void FLASH_init()
{
	// enable the Flash Ready/Busy# IT for ExtInt7
	UINT_FSETS( EIT7SRC, FRYBYIT, ENABLE );

	// init FLASH module variables
	FLASH_lock = FLASH_UNLOCKED;
	FLASH_sizeInBytes = BSL_boardDescriptor.flashSize << 20;
	FLASH_lastAddress = FLASH_STARTING_ADDRESS + FLASH_sizeInBytes - 2;

	// reset flash device (does not generate Busy# signal --> no IT)
	FLASH_WRITE16( 0x000, 0xF0 );

	// clear the sticky bit
	UINT_CLEAR_STATUS_S( FRYBYIA );

	// open DAT (if it has not been opened); it will be used for blockRead16()	DAT_open( DAT_CHAANY, DAT_PRI_LOW, 0 );
}

//==============================================================================
// FLASH module's Callback Interrupt Service Routine
//
// This function is called, when there is a rising edge on the flash device's
// Ready/Busy# pin (that is, there is a Busy#-to-Ready change).
//==============================================================================
void FLASH_ISR_CB()
{
	// clearing the sticky bit of the Flash's Ready/Busy# Interrupt from the
	// Interrupt Status register to enable further interrupts
	UINT_CLEAR_STATUS_S( FRYBYIA );

	// doing the current flash operation
	FLASH_operation();
}

//==============================================================================
// The is the main loop of the flash controller
//==============================================================================
void FLASH_operation()
{
	if( FLASH_accessReqObj.operation == FLASH_OP_TRANSFER_TO_FLASH )
	{
		// the physical programming of a 16-bit word has been completed

		// checking the last programmed word
		if( FLASH_READ16(FLASH_OP_param1) != DSP_READ16(FLASH_OP_param2) )
		{
			// the programming failed
			FLASH_accessReqObj.pReturn->errorCode = FLASH_RETERR_PROGRAMMING_ERROR;
			FLASH_accessReqObj.pReturn->isCompleted = FLASH_COMPLETED;

			FLASH_release();
			return;
		}

		// are there more words to be programmed?
		FLASH_OP_count--;
		if( FLASH_OP_count != 0 )
		{
			// step addresses
			FLASH_OP_param1 += 2;	// param1 = flashOffset
			FLASH_OP_param2 += 2;	// param2 = dspAddress

			// start a new 16-bit word programming
			FLASH_cmdUnlockBypassProg16( FLASH_OP_param1, DSP_READ16(FLASH_OP_param2) );
			return;
		}
		else
		{
			// the end of the block programming
			// leave the Unlock Bypass mode, back to the normal read mode
			FLASH_cmdUnlockBypassReset();

			// the programming was successful
			FLASH_accessReqObj.pReturn->errorCode = FLASH_RETERR_SUCCESSFUL;
			FLASH_accessReqObj.pReturn->isCompleted = FLASH_COMPLETED;

			FLASH_release();
			return;
		}
	}
	else if( FLASH_accessReqObj.operation == FLASH_OP_ERASE_SECTORS )
	{
		// the physical erasing of a whole sector of the flash memory has been completed

		// there is no "blank check"

		// FLASH_OP_count = index of the current sector that has just been erased
		// FLASH_OP_param2 = index of the last sector to be erased

		// are there more sectors to be erased?
		FLASH_OP_count++;
		if( FLASH_OP_count <= FLASH_OP_param2 )
		{
			// step addresses
			// FLASH_OP_param2 = index of the last sector to be erased

			// start a new 16-bit word programming
			FLASH_cmdSectorErase( FLASH_OP_count );
			return;
		}
		else
		{
			// the end of the sector erases

			// the erasing was successful
			FLASH_accessReqObj.pReturn->errorCode = FLASH_RETERR_SUCCESSFUL;
			FLASH_accessReqObj.pReturn->isCompleted = FLASH_COMPLETED;

			FLASH_release();
			return;
		}
	}
	else if( FLASH_accessReqObj.operation == FLASH_OP_ERASE_CHIP )
	{
		// the physical erasing of the entire flash memory has been completed

		// there is no "blank check"

		// the erasing was successful
		FLASH_accessReqObj.pReturn->errorCode = FLASH_RETERR_SUCCESSFUL;
		FLASH_accessReqObj.pReturn->isCompleted = FLASH_COMPLETED;

		FLASH_release();
		return;
	}
}

//==============================================================================
// "Unlock bypass" flash command
// Enters unlock bypass mode
//==============================================================================
void FLASH_cmdUnlockBypass()
{
	FLASH_WRITE16( 0xAAA, 0xAA );
	FLASH_WRITE16( 0x555, 0x55 );
	FLASH_WRITE16( 0xAAA, 0x20 );
}

//==============================================================================
// "A single 16-bit word programming in unlock bypass mode" flash command
// Starts the programming of a single 16-bit word in unlock bypass mode
//
// parameters:
//		flashOffset			Byte offset within the flash address space
//		data16				16-bit word to be written in the flash at the
//							address flashOffset
//==============================================================================
void FLASH_cmdUnlockBypassProg16(Uint32 flashOffset, Uint16 data16)
{
	FLASH_WRITE16( flashOffset, 0xA0 );
	FLASH_WRITE16( flashOffset, data16 );
}

//==============================================================================
// "Unlock bypass reset" flash command
// Leaves unlock bypass mode
//==============================================================================
void FLASH_cmdUnlockBypassReset()
{
	FLASH_WRITE16( 0x000, 0x90 );
	FLASH_WRITE16( 0x000, 0x00 );
}

//==============================================================================
// "Chip erase" flash command
// Starts the erasing of the entire flash memory
//==============================================================================
void FLASH_cmdChipErase()
{
	FLASH_WRITE16( 0xAAA, 0xAA );
	FLASH_WRITE16( 0x555, 0x55 );
	FLASH_WRITE16( 0xAAA, 0x80 );
	FLASH_WRITE16( 0xAAA, 0xAA );
	FLASH_WRITE16( 0x555, 0x55 );
	FLASH_WRITE16( 0xAAA, 0x10 );
}

//==============================================================================
// "A single sector erasing" flash command
// Starts the erasing of a single sector's all the 16-bit words
//
// parameters:
//		sectorIndex			Index of the sector to be erased. Counted from 0.
//							The 0-index sector is at the beginning of the flash
//							memory.
//==============================================================================
void FLASH_cmdSectorErase(Uint32 sectorIndex)
{
	FLASH_WRITE16( 0xAAA, 0xAA );
	FLASH_WRITE16( 0x555, 0x55 );
	FLASH_WRITE16( 0xAAA, 0x80 );

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产日产av| 三级亚洲高清视频| 日韩欧美一级二级三级| 波多野结衣91| 精品一二线国产| 亚洲一级二级三级| 国产欧美精品一区| 日韩欧美一二三四区| 日本丰满少妇一区二区三区| 国产一区二区三区日韩| 亚洲aaa精品| 亚洲女人****多毛耸耸8| 久久新电视剧免费观看| 91精品国产综合久久香蕉麻豆| 99re热这里只有精品免费视频| 久久精品999| 日本不卡视频在线观看| 亚洲午夜一区二区| 日韩久久一区二区| 国产欧美精品日韩区二区麻豆天美| 日韩三区在线观看| 久久蜜桃av一区精品变态类天堂| 欧美日韩一级片在线观看| 91丝袜美女网| 成人国产在线观看| 东方aⅴ免费观看久久av| 黄网站免费久久| 美国十次了思思久久精品导航| 天堂一区二区在线| 亚洲国产精品精华液网站| 一区二区三区欧美日韩| 亚洲欧美另类在线| 日韩理论片在线| 亚洲精品一二三| 亚洲激情欧美激情| 亚洲免费av高清| 亚洲免费电影在线| 亚洲一区二区三区四区五区中文 | 色哟哟欧美精品| 99国产精品久久| av亚洲精华国产精华| av电影在线观看不卡| av午夜一区麻豆| 色又黄又爽网站www久久| 色噜噜狠狠成人中文综合| 色综合色狠狠天天综合色| 在线一区二区三区做爰视频网站| 色噜噜狠狠一区二区三区果冻| 在线观看av不卡| 欧美色区777第一页| 欧美一区永久视频免费观看| 欧美人妖巨大在线| 日韩欧美一区二区免费| 精品久久国产老人久久综合| 国产亚洲一区二区三区四区| 欧美国产一区二区在线观看 | 亚洲国产电影在线观看| 亚洲欧洲美洲综合色网| 亚洲黄色性网站| 日本不卡免费在线视频| 国产一区二区三区蝌蚪| 成人av在线影院| 欧美日韩亚州综合| 精品美女在线观看| 中文字幕一区二| 亚洲18影院在线观看| 九九国产精品视频| 成人动漫一区二区| 在线观看视频欧美| 久久综合久久鬼色| 亚洲欧美精品午睡沙发| 日韩国产成人精品| 国产成人综合自拍| 欧美在线观看一二区| 精品日韩在线观看| 亚洲少妇屁股交4| 日本不卡一二三| av网站免费线看精品| 欧美夫妻性生活| 国产欧美日韩另类视频免费观看 | 日韩精品亚洲一区二区三区免费| 狠狠狠色丁香婷婷综合激情| 色综合天天在线| 欧美成人福利视频| 亚洲精品免费电影| 国产麻豆精品在线| 欧美日高清视频| 国产精品伦理一区二区| 美女免费视频一区二区| 91亚洲精品久久久蜜桃网站 | 成人黄色在线视频| 宅男噜噜噜66一区二区66| 中文幕一区二区三区久久蜜桃| 亚洲成人激情av| 成人午夜免费av| 欧美一卡二卡在线| 一区二区三区视频在线看| 国产一区二区三区四区在线观看 | 欧美国产精品专区| 男女男精品网站| 欧美日韩一区视频| 中文字幕在线一区免费| 极品少妇xxxx精品少妇偷拍| 欧美系列日韩一区| 中文字幕亚洲不卡| 国产成都精品91一区二区三| 91精品国产综合久久蜜臀| 一区二区三区在线观看动漫| 懂色av一区二区三区免费观看| 欧美日本一区二区在线观看| 亚洲男人的天堂在线aⅴ视频| 国产成人鲁色资源国产91色综 | 在线观看日韩精品| 国产精品理论在线观看| 国产一区二区三区免费在线观看| 欧美久久久久久久久中文字幕| 一区二区成人在线视频| 国产精品1区二区.| 精品少妇一区二区三区视频免付费| 偷拍日韩校园综合在线| 欧美日韩视频在线第一区| 亚洲欧美激情小说另类| 91同城在线观看| 国产精品视频在线看| 豆国产96在线|亚洲| 国产校园另类小说区| 国产一本一道久久香蕉| 久久影院视频免费| 国产一区在线观看视频| 久久女同精品一区二区| 国产一区二区三区精品欧美日韩一区二区三区| 在线电影院国产精品| 日韩电影在线一区| 日韩欧美123| 国产一区二区久久| 国产肉丝袜一区二区| 国产精品一区二区久激情瑜伽| 欧美tickle裸体挠脚心vk| 国产一区二区免费在线| 久久精品无码一区二区三区| 欧美日韩视频专区在线播放| 亚洲欧美日韩一区二区三区在线观看| 92国产精品观看| 亚洲女人小视频在线观看| 91福利国产精品| 丝瓜av网站精品一区二区| 日韩午夜在线影院| 国产高清在线精品| 国产精品夫妻自拍| 欧美在线免费观看亚洲| 日本亚洲天堂网| 2021久久国产精品不只是精品| 国产精品18久久久久久久网站| 国产午夜亚洲精品午夜鲁丝片| 成人av电影在线网| 一区二区三区毛片| 欧美人xxxx| 国产激情视频一区二区在线观看 | 国产成人精品综合在线观看| 国产精品久久久久久亚洲毛片| 91视频精品在这里| 午夜精品久久久久久久久久| 欧美成人激情免费网| 成人av资源在线观看| 亚洲bt欧美bt精品| 国产三级久久久| 在线精品视频免费播放| 久久成人免费网| 亚洲视频一区在线观看| 337p亚洲精品色噜噜噜| 国产91精品免费| 天堂成人免费av电影一区| 久久一区二区三区四区| 91视频你懂的| 精品夜夜嗨av一区二区三区| 国产精品久久久久aaaa樱花| 欧美色视频一区| 国产精品一卡二卡| 亚洲自拍偷拍av| 久久精品亚洲国产奇米99| 欧美日韩在线精品一区二区三区激情 | 欧美美女一区二区在线观看| 久久精品国产99国产精品| 亚洲女厕所小便bbb| 久久免费的精品国产v∧| 欧美在线观看视频一区二区三区| 精品一区二区三区视频在线观看| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 在线成人午夜影院| 99精品国产视频| 久久99久国产精品黄毛片色诱| 樱桃国产成人精品视频| 久久精品视频在线看| 91麻豆精品久久久久蜜臀| 91色九色蝌蚪| 成人午夜在线视频| 久久99精品久久只有精品| 亚洲va欧美va人人爽| 国产精品短视频| 久久精品在这里|