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

📄 main.c

📁 lpc2300串口中断程序,此源码在KEIL下调试通过.
💻 C
字号:
/*----------------------------------------------------------------------------
 *      Name:    main.c
 *      Purpose: Interrupt Driven SIO Using printf for Philips LPC2300
 *      Version: V1.0
 *----------------------------------------------------------------------------
 *      This file is part of the uVision/ARM development tools.
 *      This software may only be used under the terms of a valid, current,
 *      end user licence from KEIL for a compatible version of KEIL software
 *      development tools. Nothing else gives you the right to use it.
 *
 *      Copyright (c) 2005-2007 Keil Software.
 *---------------------------------------------------------------------------*/

#include <LPC23XX.H>                                  /* LPC23xx definitions */
#include <stdio.h>
#include "LCD.h"
#include "sio.h"

const char message [] =
  "This is a test to see if the interrupt driven serial I/O routines work.";

int main (void) {

  PINSEL10 = 0;                                      /* Disable ETM interface */

  FIO2DIR  = 0x000000FF;                 /* LEDs, port 2, bit 0~7 output only */
  FIO2MASK = 0x00000000;
  FIO2PIN  = 0x00000000;

  LCD_init ();                               /* Initialize LCD display module */
  LCD_cur_off ();
  LCD_cls ();
  LCD_puts ("MCB2300 UART IRQ");
  LCD_puts ("  www.keil.com  ");

  com_initialize ();                      /* init interrupt driven serial I/O */

  printf ("Interrupt-driven Serial I/O Example\r\n\r\n");

  while (1) {
    unsigned char c;

    printf ("Press a key. ");
    c = getchar ();
    printf ("\r\n");
    printf ("You pressed '%c'.\r\n\r\n", c);
  }
}

/*----------------------------------------------------------------------------
 *---------------------------------------------------------------------------*/

⌨️ 快捷键说明

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