hello.c

来自「用keil仿真arm芯片的一个简单程序」· C语言 代码 · 共 29 行

C
29
字号
/*------------------------------------------------------------------------------
HELLO.C

Copyright 1995-2002 Keil Software, Inc.
------------------------------------------------------------------------------*/

#include <stdio.h>                /* prototype declarations for I/O functions */
#include <91M40800.H>             /* AT91M40800 definitions                   */


/****************/
/* main program */
/****************/
int main (void)  {                /* execution starts here                    */

  /* initialize the serial interface   */
  PIO_PDR  = (1<<PIORXD0) | (1<<PIOTXD0);  /* Enable RXD0 and TXD0            */
  US0_MR   = US_CHRL_8 | US_PAR_NO;        /* 8 bits, no Parity, 1 Stop bit   */
  US0_BRGR = 260;                          /* 9600 Baud Rate @ 40 MHz Clock   */
  US0_CR   = US_RXEN | US_TXEN;            /* Enable RX and TX                */

  printf ("Hello World\n");       /* the 'printf' function call               */

  while (1) {                     /* An embedded program does not stop and    */
    ;  /* ... */                  /* never returns.  We've used an endless    */
  }                               /* loop.  You may wish to put in your own   */
}                                 /* code were we've printed the dots (...).  */

⌨️ 快捷键说明

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