ADI 那个FLASH驱动的代码,在官方评估板的软件包
ADSP-BF609_Evaluation_Board-Rel1.0.3\BF609_EZ-Board\Blackfin\Examples\Device_Programmer 目录下。
有个地方看了说明也 实在还是看不懂,就是在main函数里面的大循环是这样的:
while ( !bExit )
{
/*
* the programmer will set a breakpoint at "AFP_BreakReady" so it knows
* when we are ready for a new command because the processor will halt
*
* the jump is used so that the label will be part of the debug
* information in the driver image otherwise it may be left out
* since the label is not referenced anywhere
*/
asm("AFP_BreakReady:");
asm("nop;");
if ( FALSE )
asm("jump AFP_BreakReady;");
/* Make a call to the ProcessCommand */
AFP_Error = ProcessCommand();
}
外面的程序调用驱动的时候,怎么把操作驱动的意图,是读是写还是擦写的命令通过全局变量AFP_Command传进来,然后给ProcessCommand函数执行, 因为ProcessCommand 函数会根据全局变量AFP_Command进行实际操作:
static ERROR_CODE ProcessCommand(void)
{
ERROR_CODE ErrorCode = NO_ERR;
switch (AFP_Command)
{
/* erase all */
case FLASH_ERASE_ALL:
。。。。。。。。
}
求指点迷津。。