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

📄 typedef.h

📁 DataFlash芯片AT45DB081读写程序
💻 H
字号:
#ifndef _TypeDef_H

#define _TypeDef_H

//#include"stdinc.h"
#include"intrins.h"

#define False 0
#define True 	1

#define uint 	unsigned int
#define uchar unsigned char
#define ulong unsigned long

//#define const _rom
#define const code
#define _rom code

#define DisableInterrupt()	{EA=0;}
#define EnableInterrupt()	{EA=1;}

#define _nop()	{_nop_();}

struct bytes			// Create struct datatype.
{
unsigned char lo;
unsigned char hi;
};

union WordByte  			// Create Union of struct and long.
{
	unsigned int Word;

	struct			// Create struct datatype.
	{
		unsigned char hi;
		unsigned char lo;
	}Byte;
};

union LongInt
{
	struct
	{
		uint hi;
		uint lo;
	}Int;
	long Long;
};

/*
union __FLASHPtr
 {
  unsigned long int FLASHAddr;    
  struct 
   {
      uchar NOUSEBYTE;	
      uchar Page;
      uchar * PageOffset;
   } FLASHPtr;                 
 };


typedef struct	// general structure of 8 bit register allowing bit access 
	{
	unsigned int bit0 : 1;
	unsigned int bit1 : 1;
	unsigned int bit2 : 1;
	unsigned int bit3 : 1;
	unsigned int bit4 : 1;
 	unsigned int bit5 : 1;
	unsigned int bit6 : 1;
	unsigned int bit7 : 1;
	} Register;    

typedef union	// allow bit or byte access to registers 
	{
	char byte;
	Register bits;
	} Mix_Reg;

*/
#endif

⌨️ 快捷键说明

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