文档详情

华北电力大学科技学院arm课程设计92666895.doc

发布:2017-10-06约2万字共27页下载文档
文本预览下载声明
科 技 学 院 课程设计(综合实验)报告 ( 2015-- 2016年度第一学期) 名 称:ARM课程设计 题 目:操作系统加采集电压显示 院 系:信息工程系 班 级 13K2 学 号: 31 学生姓名: 指导教师:张老师 设计周数: 2 成 绩: 日期: 2016年 6月 23日 一、课程设计#include lpc177x_8x.h #include includes.h #include ../ADC/adc.h #if ADC_DEBUG #include ../UART/uart.h #endif extern volatile uint32_t ADCValue[ADC_NUM]; extern volatile uint32_t ADCIntDone; #if ADC_DEBUG extern volatile uint32_t UART0Count; extern volatile uint8_t UART0Buffer[BUFSIZE]; #endif #define BEEPON (LPC_GPIO3-CLR = 1ul 30) //蜂鸣器工作 #define BEEPOFF (LPC_GPIO3-SET = 1ul 30) //蜂鸣器不工作 / OS_EVENT *mbox; static OS_STK stkTaskA[256]; static OS_STK stkTaskB[256]; static OS_STK stkTaskC[256]; static OS_STK stkTaskD[256]; /********************************************************************************************************* 宏定义 *********************************************************************************************************/ uint32_t x=0;//定义全局变量 INT8U err; INT16U *pd; uint32_t ADCSum=0; uint32_t i; /********************************************************************************************************* ** 函数名称:myDelay ** 函数描述:软件延时 ** 输入参数:ulTime ** 返回值 :无 *********************************************************************************************************/ void myDelay (uint32_t ulTime) { uint32_t i; while (ulTime--) { for (i = 0; i 19192; i++); } } void GPIOInit( void ) { LPC_GPIO3-DIR |= 130; //设置P3.30为输出 LPC_GPIO3-SET |= 130; //设置P3.30为高电平 } /********************************************************************************************************* ** 函数名称:beepOperate ** 函数描述:蜂鸣器工作 ** 输入参数:uiFrequency 蜂鸣器工作频率 ** 返回值 :无 *********************************************************************************************************/ void beepOperate (void) { BEEPON; // 蜂鸣器鸣叫
显示全部
相似文档