api_mem.c

来自「数码投影仪项目可以作为学习实用」· C语言 代码 · 共 54 行

C
54
字号
//=============================================================================
// Filename:     api_mem.c
//
// Description:  This file defines an interface for reading and writing 
//               API memory. 
//
// Copyright (C) 2000 - 2002 Texas Instruments Incorporated
//
//============================================================================

//============================================================================
// Function:		Read_Short_API()
//
// Description:		Read and return one 16-bit word from the API memory.  
//
//============================================================================
unsigned short Read_Short_API(volatile unsigned short *address)
{
    return *address;
}

//============================================================================
// Function:		Read_Long_API()
//
// Description:		Read and return a 32-bit long from the API memory.  
//
//============================================================================
unsigned long Read_Long_API(volatile unsigned long *address)
{
    return *address;
}

//============================================================================
// Function:		Write_Short_API()
//
// Description:		Write a 16-bit word to the API memory.  
//
//============================================================================
void Write_Short_API(volatile unsigned short *address, unsigned short data)
{
    *address = data;
}

//============================================================================
// Function:		Write_Long_API()
//
// Description:		Write a 32-bit long to the API memory.  
//
//============================================================================
void Write_Long_API(volatile unsigned long *address, unsigned long data)
{
    *address = data;
}

⌨️ 快捷键说明

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