当前位置: 首页 > wzjs >正文

网站建设服务代理商发稿时间是什么意思

网站建设服务代理商,发稿时间是什么意思,品牌网络,可以直接进入网址的正能量大豆网文章目录 1 实验任务2 系统框图3 软件设计 1 实验任务 本实验任务是通过CPU私有定时器的中断,每 200ms 控制一次PS LED灯的亮灭。 2 系统框图 3 软件设计 注意事项: 定时器中断在收到中断后,只需清除中断状态,无需禁用中断、启…

文章目录

  • 1 实验任务
  • 2 系统框图
  • 3 软件设计

1 实验任务

本实验任务是通过CPU私有定时器的中断,每 200ms 控制一次PS LED灯的亮灭。

2 系统框图

在这里插入图片描述

3 软件设计

注意事项:

  1. 定时器中断在收到中断后,只需清除中断状态,无需禁用中断、启动中断操作。
/***************************** Include Files ********************************/
#include <stdio.h>
#include "xparameters.h"
#include "xgpiops.h"
#include "xscutimer.h"
#include "xscugic.h"
#include "xil_exception.h"
#include "xstatus.h"
/************************** Constant Definitions ****************************/
#define GPIO_DEVICE_ID  	XPAR_XGPIOPS_0_DEVICE_ID
#define TIMER_DEVICE_ID		XPAR_XSCUTIMER_0_DEVICE_ID
#define INTC_DEVICE_ID		XPAR_SCUGIC_SINGLE_DEVICE_ID#define TIMER_INTR_ID	    XPAR_SCUTIMER_INTR#define PS_LED0_GPIO_PIN	0#define TIMER_LOAD_VALUE	XPAR_CPU_CORTEXA9_0_CPU_CLK_FREQ_HZ / 2
/**************************** Type Definitions ******************************//***************** Macros (Inline Functions) Definitions ********************//************************** Function Prototypes *****************************/
int  GpioInit(XGpioPs* GpioInstPtr);
int  TimerInit(XScuTimer* TimerInstPtr);
int  SetupIntrSystem(XScuGic* IntcInstPtr, XScuTimer* TimerInstPtr, u16 TimerIntrId);
void TimerIntrHandler(void *CallBackRef);
/************************** Variable Definitions ****************************/
XGpioPs   GpioInst;
XScuTimer TimerInst;
XScuGic   IntcInst;u32 TimeOut = 0;
/****************************************************************************/int GpioInit(XGpioPs* GpioInstPtr)
{//int Status;XGpioPs_Config* GpioPsConfigPtr;//GpioPsConfigPtr = XGpioPs_LookupConfig(GPIO_DEVICE_ID);Status = XGpioPs_CfgInitialize(GpioInstPtr, GpioPsConfigPtr, GpioPsConfigPtr->BaseAddr);if (Status != XST_SUCCESS) {return XST_FAILURE;}// 设置输出XGpioPs_SetDirectionPin(GpioInstPtr, PS_LED0_GPIO_PIN, 1);// 使能输出XGpioPs_SetOutputEnablePin(GpioInstPtr, PS_LED0_GPIO_PIN, 1);//return XST_SUCCESS;
}int  TimerInit(XScuTimer* TimerInstPtr)
{//int Status;XScuTimer_Config* TimerConfigPtr;//TimerConfigPtr = XScuTimer_LookupConfig(TIMER_DEVICE_ID);Status = XScuTimer_CfgInitialize(TimerInstPtr, TimerConfigPtr, TimerConfigPtr->BaseAddr);if (Status != XST_SUCCESS) {return XST_FAILURE;}// 自动加载XScuTimer_EnableAutoReload(TimerInstPtr);// 加载初值XScuTimer_LoadTimer(TimerInstPtr, TIMER_LOAD_VALUE);// 使能中断XScuTimer_EnableInterrupt(TimerInstPtr);//return XST_SUCCESS;
}int  SetupIntrSystem(XScuGic* IntcInstPtr, XScuTimer* TimerInstPtr, u16 TimerIntrId)
{//int Status;XScuGic_Config* IntcConfigPtr;// step1. 初始化中断控制器GICIntcConfigPtr= XScuGic_LookupConfig(INTC_DEVICE_ID);if (NULL == IntcConfigPtr) {return XST_FAILURE;}Status = XScuGic_CfgInitialize(IntcInstPtr, IntcConfigPtr, IntcConfigPtr->CpuBaseAddress);if (Status != XST_SUCCESS) {return XST_FAILURE;}// step2. 在处理器中初始化异常处理功能Xil_ExceptionInit();// step3. 在处理器中为IRQ中断异常注册处理程序Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT, (Xil_ExceptionHandler)XScuGic_InterruptHandler, IntcInstPtr);// step4. 在处理器中使能IRQ中断异常Xil_ExceptionEnableMask(XIL_EXCEPTION_IRQ);// step5. 在GIC中为外设注册中断处理程序Status = XScuGic_Connect(IntcInstPtr, TimerIntrId, (Xil_ExceptionHandler)TimerIntrHandler, (void *)TimerInstPtr);if (Status != XST_SUCCESS) {return XST_FAILURE;}// step6. 在GIC中设置外设中断的优先级和触发类型
//	XScuGic_SetPriorityTriggerType();// step7. 在GIC中使能外设中断XScuGic_Enable(IntcInstPtr, TimerIntrId);//return XST_SUCCESS;
}void TimerIntrHandler(void *CallBackRef)
{//XScuTimer* TimerInstPtr = (XScuTimer*)CallBackRef;//if (XScuTimer_IsExpired(TimerInstPtr)){XScuTimer_ClearInterruptStatus(TimerInstPtr);printf("Timer is timeout.\n");TimeOut = 1;}//return;
}int main()
{//int Status;u32 LedValue;//printf("Timter Interrupt Control LED Test\n");//Status = GpioInit(&GpioInst);if (Status == XST_FAILURE) {printf("GPIO Init Failed.\n");}//Status = TimerInit(&TimerInst);if (Status == XST_FAILURE) {printf("Timer Init Failed.\n");}//Status = SetupIntrSystem(&IntcInst, &TimerInst, TIMER_INTR_ID);if (Status == XST_FAILURE) {printf("Setup Interrupt System Failed.\n");}// 启动定时器XScuTimer_Start(&TimerInst);//while(1){if(TimeOut==1){LedValue = ~XGpioPs_ReadPin(&GpioInst, PS_LED0_GPIO_PIN);XGpioPs_WritePin(&GpioInst, PS_LED0_GPIO_PIN, LedValue);TimeOut = 0;}}//return 0;
}

文章转载自:

http://daExO5SL.gtgwh.cn
http://fAAiFlqC.gtgwh.cn
http://PfwqrmZU.gtgwh.cn
http://7OzCflo1.gtgwh.cn
http://8ib2qm13.gtgwh.cn
http://x0t0XfNo.gtgwh.cn
http://hH9sCh0V.gtgwh.cn
http://Q7Mr2Qxd.gtgwh.cn
http://3K3KsCHQ.gtgwh.cn
http://V2ZfMEfQ.gtgwh.cn
http://gQ63TYUO.gtgwh.cn
http://MYZxw39z.gtgwh.cn
http://tS4xbqT7.gtgwh.cn
http://FbCHp0Zm.gtgwh.cn
http://Lwvebnfg.gtgwh.cn
http://J3HNznQ3.gtgwh.cn
http://krEjP9gb.gtgwh.cn
http://ojgn9XJi.gtgwh.cn
http://CyAgo3ZK.gtgwh.cn
http://37q2HwbN.gtgwh.cn
http://clKwx13u.gtgwh.cn
http://jfQJeLUP.gtgwh.cn
http://Ug0A2fRB.gtgwh.cn
http://jjx2GLQQ.gtgwh.cn
http://iQ8jA6kD.gtgwh.cn
http://oSiRO43J.gtgwh.cn
http://CkMPIhqm.gtgwh.cn
http://KMWkNl3o.gtgwh.cn
http://Fwf3VfFH.gtgwh.cn
http://wAx23iFb.gtgwh.cn
http://www.dtcms.com/wzjs/660849.html

相关文章:

  • 制作音乐的软件免费潍坊seo关键词排名
  • 网站开发介绍ppt简述网页制作的步骤
  • 天河建设网站系统当图网免费ppt下载
  • 毕业设计做视频网站好做么wordpress 5.0.2企业站主题
  • 网站建设属于会计哪个科目有公司如何制作网站
  • 杭州网站推广服务湖南株洲网
  • 山西百度公司做网站的商城网站建设最好的公司
  • 如何做网赌网站男女做暖暖的视频试看网站
  • 网站维护的主要工作中国接单外发加工网
  • 哪些网站可以做edge主页深圳市坪山区
  • 网站的设计分析广州网站建设信科网络
  • 网站搭建流程图企业网站系统功能设计说明
  • app 网站开发团队人员配置wordpress站内计费搜索
  • 做国外网站的公证要多少钱淘宝客怎么做自己网站推广
  • 在线编辑图片的网站有哪些专业制作网站服务公司
  • 网站做任务包括什么网店推广渠道有哪些
  • 做企业网站 需要注意的商城类网站功能
  • 如皋网站开发青岛建设官方网站
  • 泗洪县建设局网站怎么查不到白云区网站建设mg126
  • 如何建造企业网站淘宝数据查询
  • 网站后台制作步骤广州今天刚刚发生的重大新闻
  • 品牌网站建设哪个好seo怎么推广
  • 常州外贸网站制作中国东方营销网站
  • 建站公司排名前十名如何把本地网站
  • 泵阀网站建设酷家乐网站做墙裙教程
  • 建设网站平台的用语简洁大气公司网站
  • 不利用网站怎么做调查问卷性能优化工具
  • 宁夏政务网站建设标准宝安专业手机网站设计公司
  • iis默认网站停止百度客户端在哪里打开
  • 展馆网站建设南陵网站建设