亚洲春色中文字幕久久久-三上亚,一吻二脱三床四吻胸,国产真实伦对白视频全集,在线毛片观看,精品成品入口黄网,国产毛aⅴ片久久久,亚洲AV色香蕉一区二区三区老师,萧皇后A级艳片,色情日本视频更新,99久久亚洲精品日本无码
標題:
LPC1768 GPIO中斷實驗 八個LED輪流點亮100毫秒
[打印本頁]
作者:
wxy幻滅
時間:
2017-6-12 20:20
標題:
LPC1768 GPIO中斷實驗 八個LED輪流點亮100毫秒
路虎LPC1768開發板 GPIO實驗
這個例程是將路虎開發板上的八個LED輪流點亮100毫秒,
采用SYStick 定時器中斷方式做延時 系統時鐘設置在100MHZ
使用時,短路JP8跳線使能LED。
單片機源程序如下:
/**************************************************************************//**
* @file main.c
* @brief CMSIS Cortex-M3 GPIO example
* a LED using CM3 SysTick
* @version V1.30
* @date 24. Jan 2010
*
* @note
* Copyright (C) 2009 ARM Limited. All rights reserved.
*
* @par
* ARM Limited (ARM) is supplying this software for use with Cortex-M
* processor based microcontrollers. This file can be freely distributed
* within development tools that are supporting such ARM based processors.
*
* @par
* THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
* ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
* CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
*
******************************************************************************/
#include "LPC17xx.h"
volatile uint32_t msTicks; /* counts 1ms timeTicks */
/*----------------------------------------------------------------------------
SysTick_Handler
*----------------------------------------------------------------------------*/
void SysTick_Handler(void) {
msTicks++; /* increment counter necessary in Delay() */
}
/*------------------------------------------------------------------------------
delays number of tick Systicks (happens every 1 ms)
*------------------------------------------------------------------------------*/
__INLINE static void Delay (uint32_t dlyTicks) {
uint32_t curTicks;
curTicks = msTicks;
while ((msTicks - curTicks) < dlyTicks);
}
/*------------------------------------------------------------------------------
configer LED pins
*------------------------------------------------------------------------------*/
__INLINE static void LED_Config(void) {
LPC_GPIO2->FIODIR = 0x000000ff; /* LEDs PORT2 are Output */
LPC_GPIO0->FIODIR = 0x00200000;
LPC_GPIO0->FIOPIN |= 0x00200000;
}
/*------------------------------------------------------------------------------
Switch on LEDs
*------------------------------------------------------------------------------*/
__INLINE static void LED_On (uint32_t led) {
LPC_GPIO2->FIOPIN |= (led); /* Turn On LED */
}
/*------------------------------------------------------------------------------
Switch off LEDs
*------------------------------------------------------------------------------*/
__INLINE static void LED_Off (uint32_t led) {
LPC_GPIO2->FIOPIN &= ~(led); /* Turn Off LED */
}
/*----------------------------------------------------------------------------
MAIN function
*----------------------------------------------------------------------------*/
int main (void) {
uint8_t location;
if (SysTick_Config(SystemCoreClock / 1000)) { /* Setup SysTick Timer for 1 msec interrupts */
while (1); /* Capture error */
}
LED_Config();
while(1)
{
LED_On (0xff);
Delay (500);
……………………
…………限于本文篇幅 余下代碼請從51黑下載附件…………
復制代碼
0.png
(64.84 KB, 下載次數: 156)
下載附件
2017-6-13 02:39 上傳
所有資料51hei提供下載:
GPIO.rar
(163.57 KB, 下載次數: 18)
2017-6-12 20:20 上傳
點擊文件名下載附件
下載積分: 黑幣 -5
歡迎光臨 (http://www.denmoz.com/bbs/)
Powered by Discuz! X3.1