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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? example_281xmcbsp_spi_ffdlb.c

?? examples for TI DSP2812, created by Texas Instruments
?? C
字號:
//###########################################################################
//
// 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)
//           MDR                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: DSP281x Header Files V1.11 $
// $Release Date: September 26, 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.
//===========================================================================

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本精品视频一区二区| 国产精品不卡在线| 国产精品嫩草99a| 亚洲成av人在线观看| 国产精品一品二品| 正在播放亚洲一区| 一卡二卡三卡日韩欧美| 国产精品综合一区二区| 日韩欧美一二三| 亚洲成人免费观看| 一本到高清视频免费精品| 久久影院视频免费| 美国十次综合导航| 欧美精品自拍偷拍| 亚洲综合免费观看高清完整版在线| 国产精品一级黄| 久久综合视频网| 天天操天天干天天综合网| 91视频国产观看| 国产精品久久久久一区| 国产成人精品一区二| 欧美zozozo| 精品一区二区三区在线播放视频| 欧美久久一二区| 亚洲国产va精品久久久不卡综合| 色综合欧美在线视频区| 中文字幕一区二区在线播放| 国产91丝袜在线观看| 久久久精品国产免费观看同学| 久久国产综合精品| 91精品国产乱码久久蜜臀| 天堂蜜桃91精品| 91精品午夜视频| 美国毛片一区二区| 26uuu色噜噜精品一区| 国内一区二区视频| 欧美激情中文不卡| 波多野结衣中文字幕一区 | 色婷婷香蕉在线一区二区| 欧美经典一区二区| 成人国产精品视频| 亚洲免费观看高清| 91福利区一区二区三区| 亚洲一区二区三区中文字幕在线| 在线欧美小视频| 日韩高清不卡一区二区三区| 3d动漫精品啪啪一区二区竹菊| 久久精品国产成人一区二区三区| 日韩精品中文字幕在线不卡尤物| 国产综合色视频| 国产精品国产馆在线真实露脸| 91在线一区二区三区| 洋洋成人永久网站入口| 欧美日韩1234| 激情久久久久久久久久久久久久久久| 日韩欧美的一区| 成人性生交大片免费| 亚洲欧美福利一区二区| 91精选在线观看| 国产精品一区二区三区99| 亚洲欧美日韩综合aⅴ视频| 欧美日韩高清一区二区三区| 理论片日本一区| ●精品国产综合乱码久久久久 | 9l国产精品久久久久麻豆| 亚洲乱码国产乱码精品精的特点| 欧美性猛片aaaaaaa做受| 精品一区二区三区视频在线观看| 国产精品免费网站在线观看| 欧美日韩国产大片| 国产69精品久久777的优势| 亚洲愉拍自拍另类高清精品| 精品国产伦一区二区三区免费| 99久久精品情趣| 免费黄网站欧美| 综合网在线视频| 日韩欧美的一区| 精品国精品自拍自在线| 成人精品视频一区二区三区| 日韩精品一二区| 亚洲视频一二区| 久久亚洲春色中文字幕久久久| 欧美午夜精品久久久久久超碰| 国产一区二区三区不卡在线观看| 亚洲综合色视频| 国产精品美女久久久久av爽李琼| 91精品国产欧美日韩| 96av麻豆蜜桃一区二区| 国产一区二区中文字幕| 亚洲成人在线观看视频| 亚洲天堂免费看| 久久新电视剧免费观看| 日韩视频免费观看高清在线视频| 色综合久久66| av毛片久久久久**hd| 国产曰批免费观看久久久| 日韩av电影天堂| 午夜精品久久久久久久久久久| 中文字幕中文字幕一区二区| 久久精品在这里| 欧美成人在线直播| 在线不卡中文字幕播放| 欧美性色欧美a在线播放| 91亚洲永久精品| 懂色av一区二区三区免费看| 久草中文综合在线| 美日韩一级片在线观看| 日日摸夜夜添夜夜添亚洲女人| 亚洲综合一区二区| 一区二区三区成人| 自拍偷拍欧美精品| 亚洲视频中文字幕| 亚洲精品高清视频在线观看| 亚洲欧美综合网| 亚洲特黄一级片| 亚洲人亚洲人成电影网站色| 日韩理论电影院| 亚洲激情中文1区| 亚洲国产视频在线| 五月激情综合色| 毛片av一区二区| 久久丁香综合五月国产三级网站| 久久国产精品99久久人人澡| 久久 天天综合| 国产精品亚洲а∨天堂免在线| 国产成人在线视频播放| 不卡一卡二卡三乱码免费网站| 不卡的av在线| 欧美丝袜自拍制服另类| 制服丝袜在线91| 久久久www成人免费毛片麻豆| 欧美国产精品一区| 亚洲精品国产无天堂网2021 | 一区二区免费看| 午夜伊人狠狠久久| 久久99精品国产麻豆婷婷| 精品一区二区av| 成人一区二区在线观看| 色天天综合色天天久久| 欧美日韩国产美| 久久久久国产精品麻豆ai换脸| 欧美国产一区视频在线观看| 尤物视频一区二区| 日韩电影在线一区二区三区| 国产一区二区三区在线观看免费| eeuss鲁片一区二区三区| 欧美另类一区二区三区| 久久嫩草精品久久久久| 亚洲九九爱视频| 免费美女久久99| 91丝袜呻吟高潮美腿白嫩在线观看| 在线亚洲人成电影网站色www| 日韩亚洲欧美在线| 国产精品久久毛片| 日本系列欧美系列| 99精品视频一区| 日韩一级片在线播放| 亚洲欧洲av一区二区三区久久| 日韩黄色小视频| 99久精品国产| www激情久久| 亚洲午夜精品17c| 成人夜色视频网站在线观看| 欧美日韩日日夜夜| 中文字幕中文字幕一区二区| 美脚の诱脚舐め脚责91| 在线免费观看视频一区| 国产日韩精品久久久| 日韩电影在线一区| 一本大道久久a久久精品综合| 久久免费电影网| 水野朝阳av一区二区三区| 北条麻妃一区二区三区| 亚洲精品一区二区三区四区高清| 一区二区三区四区在线播放| 国产精品自拍网站| 欧美日韩中文字幕一区| 亚洲欧美日韩国产成人精品影院| 激情亚洲综合在线| 91精品婷婷国产综合久久性色| 亚洲少妇30p| 不卡欧美aaaaa| 国产欧美一区二区精品久导航| 蜜桃视频在线一区| 91精品在线免费| 日韩成人一区二区三区在线观看| 日本久久精品电影| 中文字幕人成不卡一区| 丁香亚洲综合激情啪啪综合| 欧美电影免费观看高清完整版在线| 亚洲成人精品影院| 日本精品一级二级| 亚洲精品高清视频在线观看| 91污在线观看| 成人免费在线观看入口| 成人免费观看av| 首页欧美精品中文字幕| 欧美日韩大陆在线| 亚洲18女电影在线观看| 欧美在线免费播放|