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

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

?? example_2833xi2c_rtc.c

?? DSPF28335基礎(chǔ)源碼
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
// TI File $Revision: /main/9 $
// Checkin $Date: August 10, 2007   09:05:58 $
//###########################################################################
//
// FILE:    Example_2833xI2c_rtc.c
//
// TITLE:   DSP2833x I2C RTC Example
//
// ASSUMPTIONS:
//
//    This program requires the DSP2833x header files.
//
//    This program requires an external I2C RTC connected to
//    the I2C bus at address 0x6f.
//
//    As supplied, this project is configured for "boot to SARAM"
//    operation.  The 2833x Boot Mode table is shown below.
//    For information on configuring the boot mode of an eZdsp,
//    please refer to the documentation included with the eZdsp,
//
//       $Boot_Table:
//
//         GPIO87   GPIO86     GPIO85   GPIO84
//          XA15     XA14       XA13     XA12
//           PU       PU         PU       PU
//        ==========================================
//            1        1          1        1    Jump to Flash
//            1        1          1        0    SCI-A boot
//            1        1          0        1    SPI-A boot
//            1        1          0        0    I2C-A boot
//            1        0          1        1    eCAN-A boot
//            1        0          1        0    McBSP-A boot
//            1        0          0        1    Jump to XINTF x16
//            1        0          0        0    Jump to XINTF x32
//            0        1          1        1    Jump to OTP
//            0        1          1        0    Parallel GPIO I/O boot
//            0        1          0        1    Parallel XINTF boot
//            0        1          0        0    Jump to SARAM	    <- "boot to SARAM"
//            0        0          1        1    Branch to check boot mode
//            0        0          1        0    Boot to flash, bypass ADC cal
//            0        0          0        1    Boot to SARAM, bypass ADC cal
//            0        0          0        0    Boot to SCI-A, bypass ADC cal
//                                              Boot_Table_End$
//
// DESCRIPTION:
//
//    This program will write 1-14 words to RTC and read them back.
//    The data written and the RTC address written to are contained
//    in the message structure, I2cMsgOut1. The data read back will be
//    contained in the message structure I2cMsgIn1.
//
//    This program will work with the on-board I2C RTC supplied on
//    the F2833x eZdsp.
//
//
//###########################################################################
// Original Author: D.F.
//
// $TI Release: DSP2833x Header Files V1.01 $
// $Release Date: September 26, 2007 $
//###########################################################################


#include "DSP2833x_Device.h"     // DSP2833x Headerfile Include File
#include "DSP2833x_Examples.h"   // DSP2833x Examples Include File

// Note: I2C Macros used in this example can be found in the
// DSP2833x_I2C_defines.h file

// Prototype statements for functions found within this file.
void   I2CA_Init(void);
Uint16 I2CA_WriteData(struct I2CMSG *msg);
Uint16 I2CA_ReadData(struct I2CMSG *msg);
void   WriteData(struct I2CMSG *msg,Uint16 *MsgBuffer,Uint16 MemoryAdd,Uint16 NumOfBytes);
interrupt void i2c_int1a_isr(void);
void pass(void);
void fail(void);

#define I2C_SLAVE_ADDR       0x6f
#define I2C_NUMBYTES          1
#define I2C_RNUMBYTES         8
#define I2C_RTC_HIGH_ADDR  0x00
#define I2C_RTC_LOW_ADDR   0x30

Uint16	YEAR = 0x2007;
Uint16	MONTH = 0x12;
Uint16	DAY = 0x03;
Uint16	WEEK = 0x01;
Uint16	HOUR = 0x15;
Uint16	MINUTE = 0x10;
Uint16	SECOND = 0x00;

#define	Y2K		0x0037
#define	DW		0x0036
#define	YR		0x0035
#define	MO		0x0034
#define	DT		0x0033
#define	HR		0x0032
#define	MN		0x0031
#define	SC		0x0030

// Global variables
// Two bytes will be used for the outgoing address,
struct I2CMSG I2cMsgOut1={I2C_MSGSTAT_SEND_WITHSTOP,
                          I2C_SLAVE_ADDR,
                          I2C_NUMBYTES,
                          I2C_RTC_HIGH_ADDR,
                          I2C_RTC_LOW_ADDR};


struct I2CMSG I2cMsgIn1={ I2C_MSGSTAT_SEND_NOSTOP,
                          I2C_SLAVE_ADDR,
                          I2C_RNUMBYTES,
                          I2C_RTC_HIGH_ADDR,
                          I2C_RTC_LOW_ADDR};

struct I2CMSG *CurrentMsgPtr;				// Used in interrupts
Uint16 PassCount;
Uint16 FailCount;

void main(void)
{
   Uint16 i;

   CurrentMsgPtr = &I2cMsgOut1;

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


// Step 2. Initalize GPIO:
// This example function is found in the DSP2833x_Gpio.c file and
// illustrates how to set the GPIO to it's default state.
// InitGpio();
// Setup only the GP I/O only for I2C functionality
   InitI2CGpio();

// 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 DSP2833x_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 DSP2833x_DefaultIsr.c.
// This function is found in DSP2833x_PieVect.c.
   InitPieVectTable();

// Interrupts that are used in this example are re-mapped to
// ISR functions found within this file.
   EALLOW;	// This is needed to write to EALLOW protected registers
   PieVectTable.I2CINT1A = &i2c_int1a_isr;
   EDIS;   // This is needed to disable write to EALLOW protected registers

// Step 4. Initialize all the Device Peripherals:
// This function is found in DSP2833x_InitPeripherals.c
// InitPeripherals(); // Not required for this example
   I2CA_Init();

// Step 5. User specific code

// Enable interrupts required for this example

// Enable I2C interrupt 1 in the PIE: Group 8 interrupt 1
   PieCtrlRegs.PIEIER8.bit.INTx1 = 1;

// Enable CPU INT8 which is connected to PIE group 8
   IER |= M_INT8;
   EINT;

   // Application loop
   for(;;)
   {
      //////////////////////////////////
      // Write data to RTC CTRL section //
      //////////////////////////////////

      // Check the outgoing message to see if it should be sent.
      // In this example it is initialized to send with a stop bit.
      if(I2cMsgOut1.MsgStatus == I2C_MSGSTAT_SEND_WITHSTOP)
      {
		 i = 0x02;
		 WriteData(&I2cMsgOut1,&i,0x003f,1);
		 i = 0x06;
		 WriteData(&I2cMsgOut1,&i,0x003f,1);

		 i = YEAR >> 8;
		 WriteData(&I2cMsgOut1,&i,Y2K,1);
		 i = YEAR & 0xff;
		 WriteData(&I2cMsgOut1,&i,YR,1);
		 i = MONTH;
		 WriteData(&I2cMsgOut1,&i,MO,1);
		 i = DAY;
		 WriteData(&I2cMsgOut1,&i,DT,1);
		 i = WEEK;
		 WriteData(&I2cMsgOut1,&i,DW,1);
		 i = HOUR;
		 WriteData(&I2cMsgOut1,&i,HR,1);
		 i = MINUTE;
		 WriteData(&I2cMsgOut1,&i,MN,1);
		 i = SECOND;
		 WriteData(&I2cMsgOut1,&i,SC,1);

      }  // end of write section

      ///////////////////////////////////
      // Read data from RTC section //
      ///////////////////////////////////

      // Check outgoing message status. Bypass read section if status is
      // not inactive.
      if (I2cMsgOut1.MsgStatus == I2C_MSGSTAT_INACTIVE)
      {
         // Check incoming message status.
         if(I2cMsgIn1.MsgStatus == I2C_MSGSTAT_SEND_NOSTOP)
         {
            // RTC address setup portion
            while(I2CA_ReadData(&I2cMsgIn1) != I2C_SUCCESS)
            {
               // Maybe setup an attempt counter to break an infinite while
               // loop. The RTC will send back a NACK while it is performing
               // a write operation. Even though the write communique is
               // complete at this point, the RTC could still be busy
               // programming the data. Therefore, multiple attempts are
               // necessary.
            }
            // Update current message pointer and message status
            CurrentMsgPtr = &I2cMsgIn1;
            I2cMsgIn1.MsgStatus = I2C_MSGSTAT_SEND_NOSTOP_BUSY;
         }

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品沙发午睡系列990531| 精品在线观看视频| 欧美日韩dvd在线观看| 亚洲国产毛片aaaaa无费看| 欧美日韩一区精品| 蜜臀av性久久久久蜜臀aⅴ四虎| 欧美成人艳星乳罩| 粉嫩aⅴ一区二区三区四区| 亚洲日本乱码在线观看| 欧美日本一道本在线视频| 久久99最新地址| 国产精品久久久久久久久免费丝袜 | 丁香婷婷综合色啪| 中文字幕一区二区三| 欧美性生活大片视频| 麻豆视频观看网址久久| 中文字幕第一区二区| 欧美综合天天夜夜久久| 免费看黄色91| 日本一区二区久久| 欧美探花视频资源| 久久精品国产精品青草| 国产精品女主播在线观看| 色丁香久综合在线久综合在线观看| 日韩电影一区二区三区四区| 亚洲精品一区二区精华| 99久久精品国产一区二区三区| 亚洲一区二区综合| 日韩欧美国产一二三区| 不卡大黄网站免费看| 亚洲va在线va天堂| 久久久蜜臀国产一区二区| 99久久伊人网影院| 热久久国产精品| 中文字幕乱码日本亚洲一区二区| 欧美少妇性性性| 国产精品996| 亚洲va欧美va国产va天堂影院| 久久综合狠狠综合久久激情| 99re热视频精品| 美腿丝袜亚洲色图| 亚洲私人黄色宅男| 日韩亚洲欧美在线| 91麻豆国产自产在线观看| 久久国产三级精品| 亚洲欧美日韩中文字幕一区二区三区 | 欧美调教femdomvk| 国产成人啪免费观看软件| 亚洲国产精品嫩草影院| 久久久精品天堂| 欧美日韩国产片| jlzzjlzz亚洲女人18| 精品制服美女久久| 亚洲一区二区综合| 国产精品毛片高清在线完整版 | 国产精品视频九色porn| 欧美电影一区二区| 91丨porny丨首页| 极品瑜伽女神91| 亚洲福中文字幕伊人影院| 欧美激情资源网| 日韩三区在线观看| 欧美性感一区二区三区| 菠萝蜜视频在线观看一区| 精品一区二区三区在线播放 | 成人欧美一区二区三区白人| 欧美成人一区二区| 在线播放亚洲一区| 在线看不卡av| 成人三级伦理片| 九九精品视频在线看| 亚洲超碰97人人做人人爱| 国产精品国产三级国产| 久久综合九色综合欧美就去吻| 91精品欧美久久久久久动漫| 色哟哟一区二区| 成人激情综合网站| 国产一区在线观看视频| 日韩高清一级片| 亚洲高清一区二区三区| 亚洲狠狠丁香婷婷综合久久久| 国产精品拍天天在线| 久久综合狠狠综合久久综合88| 3d成人动漫网站| 欧美欧美午夜aⅴ在线观看| 不卡视频一二三四| 国产成人午夜高潮毛片| 国产一区二区免费在线| 久久精品国产亚洲a| 免费观看一级欧美片| 天堂va蜜桃一区二区三区 | 丝袜诱惑制服诱惑色一区在线观看| 亚洲天天做日日做天天谢日日欢 | 成人av小说网| 粉嫩嫩av羞羞动漫久久久 | 欧美成人乱码一区二区三区| 欧美一区二区在线视频| 欧美日韩久久久久久| 欧美无乱码久久久免费午夜一区| 在线精品视频一区二区三四| 色偷偷久久一区二区三区| 91天堂素人约啪| 色婷婷久久久久swag精品| 97久久精品人人爽人人爽蜜臀 | 成人午夜碰碰视频| 国产v综合v亚洲欧| 国产白丝网站精品污在线入口| 粉嫩欧美一区二区三区高清影视| 国产成人av网站| 福利电影一区二区| 成人h精品动漫一区二区三区| 不卡视频在线看| 91麻豆精品一区二区三区| 色94色欧美sute亚洲线路一久| 在线观看视频一区二区欧美日韩| 日本久久电影网| 欧美日韩国产综合一区二区三区| 欧美肥妇free| 日韩欧美国产三级| www国产精品av| 欧美国产日产图区| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 午夜激情久久久| 日韩成人精品在线| 激情六月婷婷综合| 国产成人av福利| 91蜜桃婷婷狠狠久久综合9色| 色婷婷精品大视频在线蜜桃视频 | 国产精品―色哟哟| 亚洲欧美另类综合偷拍| 亚洲小说欧美激情另类| 日韩中文字幕区一区有砖一区| 久久激情综合网| 国产成人欧美日韩在线电影| 色综合天天综合网天天狠天天| 欧美另类高清zo欧美| 欧美大片一区二区三区| 国产日产亚洲精品系列| 亚洲欧美日韩久久精品| 五月激情综合婷婷| 国内外成人在线| 91性感美女视频| 91精品国产综合久久香蕉的特点 | 日本久久电影网| 日韩一区二区三区电影在线观看| 久久久久久99久久久精品网站| 自拍偷拍国产亚洲| 午夜成人免费电影| 国产永久精品大片wwwapp| 色综合夜色一区| 日韩女优av电影在线观看| 国产精品电影一区二区三区| 午夜精品久久久久久久蜜桃app| 国产最新精品免费| 91丝袜美腿高跟国产极品老师 | 欧美伊人精品成人久久综合97| 欧美一卡二卡在线| 国产精品久久久久久久久免费樱桃| 亚洲超碰精品一区二区| 国产精品夜夜嗨| 欧美日韩一区二区三区在线 | 懂色av一区二区在线播放| 91福利在线免费观看| 欧美成人艳星乳罩| 亚洲同性同志一二三专区| 蜜臀国产一区二区三区在线播放| www.成人在线| 91麻豆精品国产| 国产精品另类一区| 日韩精品久久久久久| 成人激情av网| 日韩一卡二卡三卡国产欧美| 国产精品视频你懂的| 日韩激情在线观看| 99久久国产免费看| 欧美大片在线观看| 夜夜精品视频一区二区| 国产精品自在在线| 欧美久久一二三四区| 国产精品美女久久久久久久久| 日韩电影在线观看一区| 一本色道久久加勒比精品| 精品噜噜噜噜久久久久久久久试看| 亚洲欧美日韩国产一区二区三区| 国产真实乱偷精品视频免| 欧美在线观看禁18| 亚洲国产高清在线| 久久99精品久久久久婷婷| 欧美性色黄大片| 1024国产精品| 国产美女精品在线| 宅男噜噜噜66一区二区66| 亚洲丝袜另类动漫二区| 国产成人综合亚洲网站| 日韩一二在线观看| 亚洲va韩国va欧美va精品| 99免费精品在线观看| 久久久久青草大香线综合精品| 视频一区二区三区入口| 在线观看日产精品|