亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? example_281xmcbsp_spi_ffdlb.c

?? dsp f2812 hardware configure source code.It is very help for the beginner of dsp developper.
?? C
字號(hào):
//###########################################################################
//
// FILE:	Example_281xMCBSP__SPI_FFDLB.c
//
// TITLE:	DSP281x Device McBSP in SPI mode Digital Loop Back program.
//
// ASSUMPTIONS:
//
//          This program requires the DSP281x header files.
//          As supplied, this project is configured for "boot to H0" operation.
//
//          Other then boot mode pin configuration, no other hardware configuration
//          is required.
//
// DESCRIPTION:
//
//          Digital loopback tests for the McBSP peripheral in SPI master mode.
//
//          Three different serial word sizes can be tested.
//
//          Before compiling this project:
//          * Select the serial word size (8/16/32) by using
//            the #define statements at the beginning of the code.
//
//          * Select the FIFO level by using the #define statement
//            at the beginning of the code.
//
//          This example does not use interrupts.  Instead a polling method
//          is used to check the level of the receive FIFO.  The incoming
//          data is checked for accuracy.  If an error is found the error()
//          function is called and execution stops.
//
//           McBSP Signals      SPI equivalent
//           -------------------------------------
//           MCLKX              SPICLK  (master)
//           MFSX               SPISTE  (master)
//           MDX                SPISIMO
//           MCLKR              SPICLK  (slave - not used for this example)
//           MFSR               SPISTE  (slave - not used for this example)
//           MRX                SPISOMI (not used for this example)
//
// This program will execute and transmit words until terminated by the user.
//
// By default for the McBSP examples, the McBSP sample rate generator (SRG) input
// clock frequency is LSPCLK (150E6/4) assuming SYSCLKOUT = 150 MHz.
// If while testing, the SRG input frequency
// is changed, the #define MCBSP_SRG_FREQ  (150E6/4) in the Mcbsp.c file must
// also be updated accordingly.  This define is used to determine the Mcbsp initialization
// delay after the SRG is enabled, which must be at least 2 SRG clock cycles.
//
//    Watch Variables:
//          sdata1
//          sdata2
//          rdata1
//          rdata2
//          rdata1_point
//          rdata2_point
//
//###########################################################################
//
// Original Author: S.S.
//
// $TI Release: Internal Release 2 INT2 $
// $Release Date: January 9, 2007 $
//###########################################################################



#include "DSP281x_Device.h"     // DSP281x Headerfile Include File
#include "DSP281x_Examples.h"   // DSP281x Examples Include File

// Define the level of the FIFO 1-16
#define FIFO_LEVEL 1

// Choose a word size.  Uncomment one of the following lines
#define WORD_SIZE    8    // Run a loopback test in 8-bit mode
//#define WORD_SIZE 16      // Run a loopback test in 16-bit mode
//#define WORD_SIZE 32        // Run a loopback test in 32-bit mode


// Prototype statements for functions found within this file.

void init_mcbsp_spi(void);
void mcbsp_xmit(int a, int b);
void mcbsp_fifo_init(void);
void error(void);

// Global data for this example
Uint16 sdata1 = 0x000;    // Sent Data
Uint16 rdata1 = 0x000;    // Recieved Data

Uint16 sdata2 = 0x000;    // Sent Data
Uint16 rdata2 = 0x000;    // Recieved Data

Uint16 rdata1_point;
Uint16 rdata2_point;


void main(void)
{

   Uint16 i;


// Step 1. Initialize System Control:
// PLL, WatchDog, enable Peripheral Clocks
// This example function is found in the DSP281x_SysCtrl.c file.
   InitSysCtrl();

// Step 2. Initalize GPIO:
// This example function is found in the DSP281x_Gpio.c file and
// illustrates how to set the GPIO to it's default state.
// InitGpio();  // Skipped for this example
// For this example, only enable the GPIO for McBSP
   InitMcbspGpio();                  // Select GPIOs to be McBSP pins
                                     // Port F MUX - x011 1111 0000 0000

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

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

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

// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
// This will populate the entire table, even if the interrupt
// is not used in this example.  This is useful for debug purposes.
// The shell ISR routines are found in DSP281x_DefaultIsr.c.
// This function is found in DSP281x_PieVect.c.
   InitPieVectTable();

// Step 4. Initialize all the Device Peripherals:
// This function is found in DSP281x_InitPeripherals.c
// InitPeripherals();     // Not required for this example
   mcbsp_fifo_init();     // Initialize the Mcbsp FIFO
   init_mcbsp_spi();      // Initalize the Mcbsp in spi master loopback mode

// Step 5. User specific code, enable interrupts:

      if(WORD_SIZE == 8)             // Run a loopback test in 8-bit mode
      {
          InitMcbspa8bit();
          sdata2 = 0x0000;           // value is a don't care for 8-bit mode
          sdata1 = 0x0000;           // 8-bit value to send
          rdata1_point = sdata1;
          while(1)
          {
             for(i = 1; i <= FIFO_LEVEL; i++)
             {
                 mcbsp_xmit(sdata1,sdata2);
                 sdata1++;
                 sdata1 = sdata1 & 0x00FF;                     // Keep it to 8-bits
             }
             while(McbspaRegs.MFFRX.bit.RXFFST != FIFO_LEVEL ) { }  // Check for receive
             for(i = 1; i <= FIFO_LEVEL; i++)
             {
                 rdata1 = McbspaRegs.DRR1.all;                  // read DRR1
                 if(rdata1 != rdata1_point) error();
                 rdata1_point++;
                 rdata1_point = rdata1_point & 0x00FF;         // Keep it to 8-bits
             }
             asm("    nop");                                    // Good place for a breakpoint
          }
       }


      if(WORD_SIZE == 16)            // Run a loopback test in 16-bit mode
      {
          InitMcbspa16bit();
          sdata2 = 0x0000;           // value is a don't care for 16-bit mode
          sdata1 = 0x0000;           // 16-bit value to send
          rdata1_point = sdata1;
          while(1)
          {
             for(i = 1; i <= FIFO_LEVEL; i++)
             {
                 mcbsp_xmit(sdata1,sdata2);
                 sdata1++;
             }
             while(McbspaRegs.MFFRX.bit.RXFFST != FIFO_LEVEL ) { }  // Check for receive
             for(i = 1; i <= FIFO_LEVEL; i++)
             {
                 rdata1 = McbspaRegs.DRR1.all;                  // read DRR1
                 if(rdata1 != rdata1_point) error();
                 rdata1_point++;
             }
             asm("    nop");                                    // Good place for a breakpoint
          }
       }


      if(WORD_SIZE == 32)            // Run a loopback test in 16-bit mode
      {
          InitMcbspa32bit();
          sdata1 = 0x0000;
          sdata2 = 0xFFFF;
          rdata1_point = sdata1;
          rdata2_point = sdata2;
          while(1)
          {
             for(i = 1; i <= FIFO_LEVEL; i++)
             {
                 mcbsp_xmit(sdata1,sdata2);
                 sdata1++;
                 sdata2--;
             }
             while(McbspaRegs.MFFRX.bit.RXFFST != FIFO_LEVEL ) { }  // Check for receive
             for(i = 1; i <= FIFO_LEVEL; i++)
             {
                 rdata2 = McbspaRegs.DRR2.all;
                 rdata1 = McbspaRegs.DRR1.all;
                 if(rdata1 != rdata1_point) error();
                 if(rdata2 != rdata2_point) error();
                 rdata1_point++;
                 rdata2_point--;
             }
             asm("    nop");                                    // Good place for a breakpoint

           }

       }
}



// Some Useful local functions

void error(void)
{
    asm("     ESTOP0");  // test failed!! Stop!
    for (;;);
}

void init_mcbsp_spi()
{
    // McBSP register settings in SPI master mode for Digital loop back
    McbspaRegs.SPCR2.all=0x0000;		// Reset FS generator, sample rate generator & transmitter
	McbspaRegs.SPCR1.all=0x0000;		// Reset Receiver, Right justify word, Digital loopback dis.
    McbspaRegs.PCR.all=0x0F08;          //(CLKXM=CLKRM=FSXM=FSRM= 1, FSXP = 1)
    McbspaRegs.SPCR1.bit.DLB = 1;
    McbspaRegs.SPCR1.bit.CLKSTP = 2;    // Together with CLKXP/CLKRP determines clocking scheme
	McbspaRegs.PCR.bit.CLKXP = 0;		// CPOL = 0, CPHA = 0 rising edge no delay
	McbspaRegs.PCR.bit.CLKRP = 0;
    McbspaRegs.RCR2.bit.RDATDLY=01;     // FSX setup time 1 in master mode. 0 for slave mode (Receive)
    McbspaRegs.XCR2.bit.XDATDLY=01;     // FSX setup time 1 in master mode. 0 for slave mode (Transmit)

	McbspaRegs.RCR1.bit.RWDLEN1=5;      // 32-bit word
    McbspaRegs.XCR1.bit.XWDLEN1=5;      // 32-bit word

    McbspaRegs.SRGR2.all=0x2000; 	 	// CLKSM=1, FPER = 1 CLKG periods
    McbspaRegs.SRGR1.all= 0x000F;	    // Frame Width = 1 CLKG period, CLKGDV=16

    McbspaRegs.SPCR2.bit.GRST=1;        // Enable the sample rate generator
	delay_loop();                       // Wait at least 2 SRG clock cycles
	McbspaRegs.SPCR2.bit.XRST=1;        // Release TX from Reset
	McbspaRegs.SPCR1.bit.RRST=1;        // Release RX from Reset
    McbspaRegs.SPCR2.bit.FRST=1;        // Frame Sync Generator reset
}


void mcbsp_xmit(int a, int b)
{
    McbspaRegs.DXR2.all=b;
    McbspaRegs.DXR1.all=a;
}

void mcbsp_fifo_init()
{

    McbspaRegs.MFFTX.all=0x0000;
    McbspaRegs.MFFRX.all=0x001F;
    McbspaRegs.MFFCT.all=0x0;
    McbspaRegs.MFFINT.all=0x0;
    McbspaRegs.MFFST.all=0x0;
    McbspaRegs.MFFTX.bit.MFFENA=1;         // Enable FIFO
    McbspaRegs.MFFTX.bit.TXFIFO_RESET=1;   // Enable Transmit channel
    McbspaRegs.MFFRX.bit.RXFIFO_RESET=1;   // Enable Receive channel


}



//===========================================================================
// No more.
//===========================================================================

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二三区| 91在线视频在线| 亚洲婷婷国产精品电影人久久| 精品视频一区三区九区| 国内精品久久久久影院一蜜桃| 自拍偷拍亚洲综合| 精品久久久三级丝袜| 91精品1区2区| 国产a区久久久| 久久精品国产网站| 一区二区欧美在线观看| 亚洲国产精品精华液2区45| 欧美一级黄色片| 欧美三级电影网站| 91一区二区三区在线播放| 狠狠色狠狠色综合| 日本视频一区二区三区| 亚洲一二三区在线观看| 中文字幕一区在线观看| 久久久精品综合| 日韩免费在线观看| 91精品国产欧美一区二区成人| 91麻豆swag| eeuss鲁一区二区三区| 国产成人午夜精品影院观看视频 | 日本一区二区高清| 亚洲精品一区二区三区在线观看| 欧美日韩中文字幕一区二区| 91网站在线观看视频| 国产成人鲁色资源国产91色综| 蜜臀久久99精品久久久久久9| 亚洲综合丁香婷婷六月香| 亚洲人吸女人奶水| 中文字幕亚洲在| 亚洲品质自拍视频| 亚洲免费观看高清完整版在线| 国产欧美精品一区二区三区四区 | 亚洲三级理论片| 综合久久久久久久| 亚洲日本在线天堂| 日韩美女久久久| 亚洲你懂的在线视频| 亚洲欧美在线另类| 亚洲乱码日产精品bd| 亚洲欧美另类小说| 亚洲一区二区四区蜜桃| 洋洋av久久久久久久一区| 一区二区三区在线免费播放| 亚洲美女电影在线| 亚洲精品久久久蜜桃| 亚洲图片有声小说| 日韩精品乱码av一区二区| 日韩精品五月天| 另类小说图片综合网| 国产在线国偷精品免费看| 国产精品一区二区三区四区 | 久久成人免费日本黄色| 精品一二三四区| 国产精品一二三区在线| 成人自拍视频在线| 日本韩国一区二区三区| 制服丝袜一区二区三区| 精品国产区一区| 亚洲国产岛国毛片在线| 亚洲日本青草视频在线怡红院 | 欧美极品少妇xxxxⅹ高跟鞋 | 欧美日韩久久久| 日韩一区二区三区精品视频| 久久久美女毛片| ●精品国产综合乱码久久久久| 亚洲午夜一区二区| 麻豆91在线播放| av福利精品导航| 欧美高清精品3d| 26uuu欧美| 亚洲男女一区二区三区| 天天综合色天天综合色h| 激情综合色综合久久综合| 国产sm精品调教视频网站| 欧美午夜一区二区三区| 精品国产一区二区三区忘忧草 | 国产成人免费在线视频| 色国产综合视频| 日韩欧美国产综合一区| 国产精品电影一区二区| 日本成人超碰在线观看| 不卡一卡二卡三乱码免费网站| 欧美日韩夫妻久久| 国产丝袜在线精品| 亚洲sss视频在线视频| 国产成人三级在线观看| 欧美日韩精品一区二区| 欧美国产激情一区二区三区蜜月| 亚洲va欧美va人人爽| 处破女av一区二区| 日韩欧美电影一区| 一区二区在线观看视频| 国产乱色国产精品免费视频| 欧美性猛交xxxx黑人交| 中文一区一区三区高中清不卡| 日本麻豆一区二区三区视频| www.欧美色图| 精品av久久707| 婷婷成人激情在线网| av亚洲精华国产精华精华| 337p日本欧洲亚洲大胆精品| 亚洲高清视频中文字幕| 99视频有精品| 国产亚洲欧美一区在线观看| 日韩av一区二| 欧美色老头old∨ideo| 国产精品久久久久久久久免费相片 | 国产一区二区网址| 88在线观看91蜜桃国自产| 亚洲精品国产无天堂网2021| 成人性生交大片免费看在线播放| 日韩免费在线观看| 日本一不卡视频| 欧美日韩国产乱码电影| 综合久久国产九一剧情麻豆| 国产成人在线免费观看| 精品少妇一区二区三区免费观看 | 欧美xxxxxxxx| 水蜜桃久久夜色精品一区的特点| 91蝌蚪porny| 亚洲欧美日韩国产成人精品影院| 高清不卡一二三区| 久久免费视频色| 国产综合成人久久大片91| 日韩欧美在线网站| 免费在线观看视频一区| 欧美精品久久久久久久久老牛影院| 一区二区三区四区高清精品免费观看 | 色哟哟一区二区三区| 最新国产の精品合集bt伙计| 99精品视频在线播放观看| 国产女同互慰高潮91漫画| 高清在线成人网| 国产精品久久久久影院亚瑟 | 天天操天天综合网| 欧美群妇大交群的观看方式| 亚洲福利视频三区| 在线成人免费观看| 久久精品噜噜噜成人88aⅴ| 欧美一区二区三区视频| 免费成人在线观看视频| 精品免费视频.| 国产一区二区在线免费观看| 国产午夜精品理论片a级大结局| 国产盗摄视频一区二区三区| 国产精品毛片久久久久久| 99精品一区二区| 亚洲h在线观看| 日韩精品专区在线影院观看| 国产一区二区三区美女| 国产精品美女久久久久久久久久久| 成人高清视频在线| 亚洲精品国产视频| 欧美男女性生活在线直播观看| 男人操女人的视频在线观看欧美 | 亚洲一区在线电影| 5858s免费视频成人| 久久国产婷婷国产香蕉| 欧美激情中文不卡| 欧美亚洲高清一区| 蜜桃一区二区三区四区| 国产欧美一区二区精品仙草咪| 91亚洲精华国产精华精华液| 亚洲成人av福利| 久久综合九色综合97婷婷女人 | 五月天丁香久久| 久久久噜噜噜久久人人看 | 欧美国产激情二区三区| 欧日韩精品视频| 久久国产综合精品| 中文字幕亚洲在| 8v天堂国产在线一区二区| 国产成人午夜电影网| 亚洲精品免费电影| 欧美电影免费观看高清完整版在线观看 | 亚洲已满18点击进入久久| 精品国产一区二区三区不卡 | 欧美调教femdomvk| 狠狠狠色丁香婷婷综合激情 | 久久欧美一区二区| 欧美在线999| 国产在线视频一区二区| 亚洲精品v日韩精品| 2020国产精品| 欧美三级电影一区| 国产91在线|亚洲| 日一区二区三区| 综合久久久久久久| 久久久久久久免费视频了| 欧美三级中文字幕| aaa欧美色吧激情视频| 久久疯狂做爰流白浆xx| 一区二区激情视频| 欧美激情中文字幕一区二区| 日韩一级完整毛片|