久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 3768|回復: 1
打印 上一主題 下一主題
收起左側

DSP2833x例程GPIO_output_LED

[復制鏈接]
跳轉到指定樓層
樓主
ID:266728 發表于 2017-12-25 20:09 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
源程序如下:
  1. #include "DSP2833x_Device.h"     // DSP2833x Headerfile Include File
  2. #include "DSP2833x_Examples.h"   // DSP2833x Examples Include File

  3. #define          LED1        GpioDataRegs.GPADAT.bit.GPIO0
  4. #define          LED2        GpioDataRegs.GPADAT.bit.GPIO1
  5. #define          LED3        GpioDataRegs.GPADAT.bit.GPIO2
  6. #define          LED4        GpioDataRegs.GPADAT.bit.GPIO3
  7. #define          LED5        GpioDataRegs.GPADAT.bit.GPIO4

  8. void configtestled(void);

  9. void main(void)
  10. {
  11. // Step 1. Initialize System Control:
  12. // PLL, WatchDog, enable Peripheral Clocks
  13. // This example function is found in the DSP2833x_SysCtrl.c file.
  14.    InitSysCtrl();

  15. // Step 2. Initalize GPIO:
  16. // This example function is found in the DSP2833x_Gpio.c file and
  17. // illustrates how to set the GPIO to it's default state.
  18. // InitGpio();  // Skipped for this example
  19.    InitXintf16Gpio();        //zq

  20. // Step 3. Clear all interrupts and initialize PIE vector table:
  21. // Disable CPU interrupts
  22.    DINT;

  23. // Initialize the PIE control registers to their default state.
  24. // The default state is all PIE interrupts disabled and flags
  25. // are cleared.
  26. // This function is found in the DSP2833x_PieCtrl.c file.
  27.    InitPieCtrl();

  28. // Disable CPU interrupts and clear all CPU interrupt flags:
  29.    IER = 0x0000;
  30.    IFR = 0x0000;

  31. // Initialize the PIE vector table with pointers to the shell Interrupt
  32. // Service Routines (ISR).
  33. // This will populate the entire table, even if the interrupt
  34. // is not used in this example.  This is useful for debug purposes.
  35. // The shell ISR routines are found in DSP2833x_DefaultIsr.c.
  36. // This function is found in DSP2833x_PieVect.c.
  37.    InitPieVectTable();
  38.    configtestled();

  39.    //   LED1=1;
  40.   // DELAY_US(10);
  41.   //    LED2=1;
  42.   // DELAY_US(10);
  43.       LED1=0;
  44.    DELAY_US(10);
  45.       LED2=0;
  46.    DELAY_US(10);
  47.       LED3=0;
  48.    DELAY_US(10);
  49.       LED4=0;
  50.    DELAY_US(10);  
  51.       LED5=0;
  52.    DELAY_US(10);  

  53. while(1){
  54.       LED1=~LED1;
  55.    DELAY_US(100000);
  56.       LED2=~LED2;
  57.    DELAY_US(100000);
  58.       LED3=~LED3;
  59.    DELAY_US(100000);
  60.       LED4=~LED4;
  61.    DELAY_US(100000);
  62.       LED5=~LED5;
  63.    DELAY_US(100000);
  64.      }

  65. }




  66. void configtestled(void)
  67. {
  68.    EALLOW;
  69.    GpioCtrlRegs.GPAMUX1.bit.GPIO0 = 0; // GPIO0復用為GPIO功能
  70.    GpioCtrlRegs.GPADIR.bit.GPIO0 = 1;  // GPIO0設置為輸出
  71.    GpioCtrlRegs.GPAMUX1.bit.GPIO1 = 0; // GPIO1 = GPIO1
  72. ……………………

  73. …………限于本文篇幅 余下代碼請從51黑下載附件…………
復制代碼

所有資料51hei提供下載:
lab1-GPIO_output_LED.rar (412.62 KB, 下載次數: 26)


分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復

使用道具 舉報

沙發
ID:267330 發表于 2018-4-12 16:12 | 只看該作者
學習啊
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表
主站蜘蛛池模板: 91调教视频| 中文在线免费观看 | 国产免费成人 | 久久久久久久久久国产 | 日本不卡在线视频 | 在线观看欧美日韩视频 | 午夜影院免费 | www.一区| 天天综合影院 | 亚洲丝袜一区 | 日本午夜网站 | 黄色大片免费观看 | 午夜国产| 亚洲日本国产 | 第一福利视频导航 | 欧美91视频 | 国产日韩欧美亚洲 | 久久久久久国产精品 | 亚洲精品黄 | 欧美有码视频 | 在线日韩 | 日本精品视频在线 | www.日日日 | 黄色免费片 | 夜夜操夜夜操 | 久久视频一区二区 | 国产伦精品一区二区三区在线 | 97精品国产97久久久久久免费 | 三级a毛片 | 亚洲成人天堂 | 在线不卡av| 久久精品99国产国产精 | 黑人精品xxx一区一二区 | 久久精品99久久久久久 | 国产性生活 | 成人性色生活片 | 日韩色av | 国产九九九 | 国产一级片免费观看 | 日本天堂在线 | 成人免费高清视频 |