davincievm_flash_read.c
来自「TI的DM6446的硬件平台搭建的相关例子」· C语言 代码 · 共 41 行
C
41 行
/*
* Copyright 2005 by Spectrum Digital Incorporated.
* All rights reserved. Property of Spectrum Digital Incorporated.
*
* Not for distribution.
*/
/*
* Flash implementation - Read flash
*
*/
#include "davincievm_flash.h"
/* ------------------------------------------------------------------------ *
* *
* DAVINCIEVM_FLASH_read( src, dst, length ) *
* Read from Flash address ( src ) to the data at non-Flash address *
* ( dst ) for ( length ) bytes. *
* *
* src <- source address *
* dest <- destination address *
* length <- length in bytes *
* *
* ------------------------------------------------------------------------ */
Int16 DAVINCIEVM_FLASH_read( Uint32 src, Uint32 dst, Uint32 length )
{
Uint32 i = 0;
Uint16* psrc = ( Uint16* )src;
Uint16* pdst = ( Uint16* )dst;
/* Flash Mode: Read Array */
*( volatile Uint16* )src = FLASH_RESET;
/* Transfer bytes from source to destination */
for ( ; i < length ; i += 2 )
*pdst++ = *psrc++;
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?