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

📄 davincievm_flash_read.c

📁 TI的DM6446的硬件平台搭建的相关例子
💻 C
字号:
/*
 *  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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -