wince_gbus.h

来自「Sigma SMP8634 Mrua v. 2.8.2.0」· C头文件 代码 · 共 78 行

H
78
字号
#ifndef __WINCE_GBUS_H_#define __WINCE_GBUS_H_// windows CE implementation of gbus access#include <windows.h>#include <oal.h>typedef unsigned long RMuint32;/** 16 bits long integer */typedef unsigned short RMuint16;typedef unsigned char RMuint8;struct gbus;static RMuint32 gbus_read_uint32 (struct gbus *h, RMuint32 byte_address){	volatile RMuint32 *p;	if (byte_address & 0x20000000)		byte_address -= 0x14000000;	p = (RMuint32 *)OALPAtoUA(byte_address);	return (RMuint32)(*p);}static void gbus_write_uint32 (struct gbus *h, RMuint32 byte_address, RMuint32 data){	volatile RMuint32 *p;	if (byte_address & 0x20000000)		byte_address -= 0x14000000;	p = (RMuint32 *)OALPAtoUA(byte_address);	*p = data;}static RMuint16 gbus_read_uint16(struct gbus *h, RMuint32 byte_address){	volatile RMuint16 *p;	if (byte_address & 0x20000000)		byte_address -= 0x14000000;	p = (RMuint16 *)OALPAtoUA(byte_address);	return  (RMuint16)(*p);}static void gbus_write_uint8 (struct gbus *h, RMuint32 byte_address, RMuint8 data){	volatile RMuint8 *p;	if (byte_address & 0x20000000)		byte_address -= 0x14000000;	p = (RMuint8 *)OALPAtoUA(byte_address);	*((RMuint8*)p) = data;}static RMuint8 gbus_read_uint8 (struct gbus *h, RMuint32 byte_address){	volatile RMuint8 *p;	if (byte_address & 0x20000000)		byte_address -= 0x14000000;	p = (RMuint8 *)OALPAtoUA(byte_address);	return  (RMuint8)(*p);}static void gbus_read_data8(struct gbus *h, RMuint32 byte_address, RMuint8 *pData, RMuint32 size){	RMuint32 i;	for(i=0; i < size; i++, byte_address++)	{		pData[i] = gbus_read_uint8(h, byte_address);	}}static void gbus_write_data8(struct gbus *h, RMuint32 byte_address, const RMuint8 *pData, RMuint32 size){	RMuint32 i;	for(i=0; i < size; i++, byte_address++, pData++)	{		gbus_write_uint8(h, byte_address, *pData);	}}#endif

⌨️ 快捷键说明

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