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

📄 blinky.c

📁 LPC22xx代码示例
💻 C
字号:
/*
  File: Blinky.c

  To blink the onboard LED (D3) of the Phytec PCM-023 board
  for every 65ms.

*/

#include <intrinsics.h>
#include "timer.h"
#include "lpc2294.h"

void main (void)
{
  // System initialization, this will map the exception vectors.
  LPC2294SystemInit();

  // Set up peripheral registers.
  LPC2294InitPIO();

  // First disable interrupts.
  __disable_interrupt();

  // Setup interrupt controller.
  LPC2294InitVIC();
  LPC2294InitTimerInterrupt(TimerBeat);

  // Periodic timer initialization.
  LPC2294InitTimer();

  // Enable interrupts.
  __enable_interrupt();

  // Start periodic timer.
  LPC2294StartTimer();

  // Loop forever.
  for (;;)
  {
    LPC2294LedSet();
    Sleep(200);      // Display for 65 ms.
    LPC2294LedClear();
    Sleep(200);      // Display for 65 ms.
  }
}

⌨️ 快捷键说明

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