serial0_teststub.c

来自「RF tag interface with lpc 2148」· C语言 代码 · 共 51 行

C
51
字号
/************************************************************/
/* PROJECT NAME: SERIAL	                                    */
/* Project:      LPC2129 Training course                    */
/* Engineer:     Y.Stalin        stalin@nstlindia.com       */
/* Filename:     SERIAL0_Driver.c                           */
/* Language:     C                      	                */
/* Compiler:     Keil ARM	GCC			                    */
/* Assembler:    				                            */
/*                                                          */
/************************************************************/
/* COPYRIGHT: NSTL 		2008		  						*/
/* LICENSE:   PROPRIETORY									*/
/************************************************************/
/* Function:                                                */
/*                                                          */
/* Example 									           		*/
/*															*/
/* Demonstrates Use of the LPC2129 GPIO						*/
/*															*/	
/* Oscillator frequency 12.000 Mhz							*/
/* Target board NSTL NST2100								*/
/************************************************************/


#include <LPC214X.H>
//#include "gpio.h"
//#include "lcd.h"
//#include "common.h"
#include "serial0.h"

int main(void)
{

  setClock();

  InitSerial0(9600);

  InitSerial0Int((unsigned)serial0_RxISR);
  putStrS0("Welcome to NSTL");

  while(1);
}

void serial0_RxISR(void) __irq 
{
  unsigned char ch;
  ch = getCharS0();
  putCharS0(ch);  
  VICVectAddr 	= 0x00000000;						//Dummy write to signal end of interrupt
}

⌨️ 快捷键说明

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