?? blockwrite.c
字號(hào):
///////////////////////////////////////////////////////////////////////////////////////
//NAME: blockWrite.c (AMD Parallel Flash Programmer)
//DATE: 9/18/03
//PURPOSE: Program the Parallel Flash for the ADSP-21262 Ezkit
//
//USAGE: This file calls the subroutines used to program and verify the Flash,
// call this routine with the buffer address, destination address, and byte
// length from the main program.
//
////////////////////////////////////////////////////////////////////////////////////////
#include "ppflash.h"
//----------------------------------------
//BLOCK WRITE SUBROUTINE
//Calls all of the Flash subroutines necessary to program the flash
//Inputs - buffer_src_addr - address of the buffer holding the 32-bit words to write (pointer)
// buffer_dest_addr - address to write to in external memory (pointer)
// buffer_length - number of bytes to write.
//Returns- none
void blockWrite(int *buffer_src_addr,int *buffer_dest_addr,int buffer_length)
{
int numSectors;
//Reset the state of the flash
flashReset(buffer_dest_addr);
//Calculate the number of sectors to be programmed (min = 1)
numSectors = (buffer_length >> 16) + 1;
//Erase that number of sectors
sectorErase(buffer_dest_addr,numSectors);
//program the flash with the selected data
programBlock(buffer_src_addr,buffer_dest_addr,buffer_length);
//verify that the flash was programmed correctly
verifyBlock(buffer_src_addr,buffer_dest_addr,buffer_length);
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -