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

 找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開始

搜索
查看: 3639|回復(fù): 1
收起左側(cè)

DSP2833x例程GPIO_output_LED

[復(fù)制鏈接]
ID:266728 發(fā)表于 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復(fù)用為GPIO功能
  70.    GpioCtrlRegs.GPADIR.bit.GPIO0 = 1;  // GPIO0設(shè)置為輸出
  71.    GpioCtrlRegs.GPAMUX1.bit.GPIO1 = 0; // GPIO1 = GPIO1
  72. ……………………

  73. …………限于本文篇幅 余下代碼請(qǐng)從51黑下載附件…………
復(fù)制代碼

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


回復(fù)

使用道具 舉報(bào)

ID:267330 發(fā)表于 2018-4-12 16:12 | 顯示全部樓層
學(xué)習(xí)啊
回復(fù)

使用道具 舉報(bào)

本版積分規(guī)則

手機(jī)版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表
主站蜘蛛池模板: julia中文字幕久久一区二区 | 日韩视频专区 | 国产免费福利在线 | 天天插天天狠天天透 | 欧美黄色大片在线观看 | 日韩午夜精品 | av色噜噜 | 成人av久久 | 亚洲成人一区二区在线 | 黄色精品 | 97精品超碰一区二区三区 | 日韩三级| 久久综合成人精品亚洲另类欧美 | 黄色毛片免费 | 亚洲精品欧美 | 国产成人精品一区二三区在线观看 | 国产一区二区三区四区 | 日本在线视频中文字幕 | 午夜免费看 | 国产一区二区电影 | 亚洲国产欧美日韩 | 麻豆久久久9性大片 | 精品在线观看入口 | 麻豆av一区二区三区久久 | 97caoporn国产免费人人 | 精品一区二区在线观看 | 久久久免费 | 欧美日韩在线观看视频网站 | 日本三级电影在线观看视频 | 69av在线视频| 中文字幕久久精品 | 亚洲高清在线 | 国产二区三区 | 成人高潮片免费视频欧美 | 国产视频久久久 | 亚洲精品色 | 97视频在线免费 | 国产精品网址 | 成人在线视频观看 | 亚洲天堂影院 | 日韩视频免费 |