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

📄 uart.c

📁 void __irq Uart0_TxInt(void) void __irq Uart0_RxIntOrErr(void) void __irq Uart0_TxDmaDone(void)
💻 C
字号:
#include "includes.h"

//#include <cs8900.h>
//#include <gzsd2410.h>
#include "isa.h"
#define uint unsigned int
//#define u8 unsigned char
#define ISA_Base_Addr 0x20000000 //nGCS4
#define CS8900_BASE 0x19000300
typedef signed char s8;
typedef unsigned char u8;

typedef signed short s16;
typedef unsigned short u16;


/***************************************************************************

描述:ISA 基本定义

****************************************************************************/
//#define ISA_BASE     0x20000000   //ISA 基本地址
//#define UARTA_BASE_OFFSET 0x3f8     
//#define UARTB_BASE_OFFSET 0x2f8


//#define CS8900_PDATA  *(volatile CS8900_REG *)(CS8900_BASE+0x03)

union Idnumspace {unsigned int id;
                  unsigned char idnum[4];
         }Pnum;
         /*
void delay_dl(unsigned int count)
{unsigned char index;
 unsigned char j;
for(index=0;index<count;index++)
  {for(j=0;j<100;j++)
     {;
     }
  }
}         */
int Main()
{  //uchar ID-l;
   //uchar ID-h;
   unsigned int id;
 //  unsigned int tempsize;
 //  unsigned char index;
   
   u8 count=5;
 //  u8  *str;
   Port_Init();            
   Uart_Port_Set();
   Uart_Init(0,115200);
   Uart_Select(1);
   
   eFunctionEnter(); 
  // ISA_EFER_ADD=0x07;
//   SelectDev(2);
  // ISA_EFER_ADD=0x20;
while(count--)//
{

 //eFunctionEnter();

//ISA_EFDR=0xcc;
//Delay(5);
//delay_dl(100);
//ISA_EFDR=0xcc;
//delay_dl(100);

Delay(5);
id=ReadIsa(0x20);
//Uart_SendByte(ISA_EFER_ADD);
Uart_SendByte(id);

Delay(5);
}

while(1);
}

⌨️ 快捷键说明

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