⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 blockwrite.c

📁 ADI 公司的DSP ADSP21262 EZ-KIT LITE开发板的全部源代码
💻 C
字号:
///////////////////////////////////////////////////////////////////////////////////////
//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);

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -