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

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

?? uart_interface.h

?? freescale的基于802.15.4的無線通訊例程
?? H
字號:
/*****************************************************************************
* This file contains UART driver API prototypes
*
*
* (c) Copyright 2006, Freescale, Inc. All rights reserved.
*
* Freescale Confidential Proprietary
*
* No part of this document must be reproduced in any form - including copied,
* transcribed, printed or by any electronic means - without specific written
* permission from Freescale Semiconductor Danmark A/S.
*****************************************************************************/
#ifndef _UART_INTERFACE_H_
#define _UART_INTERFACE_H_

#ifndef gUART_Enabled_d
/* Typically set in target compile switches, but if not
   we define a default value. Set to 1 enabled or 0 for
   disabled (Boolean) */
#define gUART_Enabled_d   TRUE
#endif /* gUART_Enabled_d */

#include "IrqControlLib.h"
#include "EmbeddedTypes.h"
#include "PortConfig.h"
#include "AppToPlatformConfig.h"
#include "TS_Interface.h"

/*****************************************************************************
******************************************************************************
* Global macros
******************************************************************************
*****************************************************************************/

/* Various constants for UART settings, do not touch */
#define gUART_Setting8DataBits_c  0
#define gUART_Setting9DataBits_c  (1 << 4)
#define gUART_SettingParityOff_c  0
#define gUART_SettingParityOn_c   (1 << 1)
#define gUART_SettingOddParity_c  0
#define gUART_SettingEvenParity_c (1 << 0)

/* The length of FIFO buffer */  
#define gUART_FIFOLen_c           16      
/* Level in FIFO at which to notify the UART task to empty the FIFO
   This value must be less than or equal to gUART_FIFOLen_c */
#define gUART_FIFOWaterMark_c     8                                         
/* If no data is received in gRx_Timeout_c ms call the callback function
   This value must be from 1 to 1048576 */                                    
#define gUART_RxTimeout_c         100     
/* The fixed timer ID for the UART timer. */
#define gUART_TimerID_c           (gApplicationTimerIDOffset_c + 4)
/* Set to 1 to use HW flow control. If you want to
   use no flow control, set to 0 (Boolean) */
#define gUART_UseHWFlowControl_d  1
/* Set to 1 to enable verification of parameters, 0 to disable (Boolean) */
#define gUART_Verification_d      1
/* Set to 1 to enable reinitialization of UART */
#define gUART_ReinitEnabled_d     1
/* UART settings: */
/* 0 = 1 start bit, 8 data bits, 1 stop bit, no parity  */
/*     Set bit 4 to get 9 data bits, else 8 data bits   */
/*     Set bit 1 to enable parity, else disabled        */
/*     Set bit 0 to get odd parity, else even parity    */
/*     See compile options gUART_SettingXYZ_c above     */
#define gUART_Settings_c          0

/* 
  Set up which SCI port to use for UART functionality
  
  For MC1319x EVB target the following applies:
    SCI1 = UART on RS232 connector
    SCI2 = UART on USB
  For MC1319x SARD target the following applies:
    SCI2 = UART on RS232 connector (only choice)
  For MC1321x NCB  target the following applies:
    SCI1 = UART on RS232 connector
    SCI2 = UART on USB
  For MC1321x SRB target the following applies:
    SCI2 = UART on USB (only choice)
  For Axiom GB 60 target the following applies: 
    SCI?? = UART on RS232 connector
*/

/* If no choice has been made regarding which SCI to use */
#ifndef gUART_OnSCI1_d
#ifndef gUART_OnSCI2_d

/* Set default SCI port for UART functionality */
#define gUART_OnSCI1_d     FALSE /* Boolean */
#define gUART_OnSCI2_d     TRUE /* Boolean */

#endif /* gUART_OnSCI1_d */
#endif /* gUART_OnSCI2_d */

#if ( (gUART_OnSCI1_d != 0) && (gUART_OnSCI2_d != 0) )
#error Only one UART supported at a time
#endif

/*****************************************************************************/ 
/* Initial settings for both SCI's                                           */
/*****************************************************************************/

#define gUART_InitSCIxC1_c    gUART_Settings_c
#define gUART_InitSCIxC2_c    0x0C /* Tx & Rx enabled */
#define gUART_InitSCIxC3_c    0x00 /* Disable error interrupts etc. */
#define gUART_TxInterrupt_c   0x80 /* Enable/Disable transmit data  */
#define gUART_DataRegMask_c   0x20 /* Data Rx */
#define gUART_DataRegEmpty_c  0x00

/*****************************************************************************/
/* Request types to the UART driver                                          */
/*****************************************************************************/ 
enum {  
  gInitUart_c = 1,	                        /* Start UART initialization */
  gRxUart_c,								/* Activate serial receive */
  gTxUart_c,								/* Activate serial transmit */
};
 
/*****************************************************************************/
/* UART identifiers. The actual value is unimportant.                        */
/*****************************************************************************/ 
#define gUART_Id1_c  1
#define gUART_Id2_c  2
 
/*****************************************************************************/
/* Return values to be handled by the UART callback function                 */
/*****************************************************************************/
enum {  
  gUartTxSuccess_c   = 0x01, /* Success Tx */
  gUartRxSuccess_c   = 0x02, /* Success Rx */
  gUartRxTimeout_c   = 0x04, /* Timeout occurred */
  gUartReinit_c      = 0x08, /* UART was reinitialized */
  gUartRxTxUnknown_c = 0x10	 /* Unknown error */			
};
  
/*****************************************************************************/ 
/* UART Request return values                                                */											
/*****************************************************************************/
enum {
  gIrpAccepted_c = 0, /* Request will be executed */
  gIrpInvalidReq_c,   /* Invalid and unknown request */
  gIrpInvalidArg_c,   /* Invalid parameters */
  gIrpNotReady_c      /* Not ready, already busy */
};

/*****************************************************************************/ 
/* Baud rates                                                                */
/*****************************************************************************/

#if !((defined gSystemClock8MHz_d) || (defined gSystemClock12MHz_d) || \
      (defined gSystemClock16MHz_d) || (defined gSystemClock16780MHz_d))
#define gSystemClock8MHz_d     0
#define gSystemClock12MHz_d    0
#define gSystemClock16MHz_d    1 /* Default assumed system clock */
#define gSystemClock16780MHz_d 0
#endif 

/* SCI baud rate = BUSCLK/(16?Baud rate) */

/* Note that not all baud rates works for all clock rates, the actual baud rate
   achieved may deviate too much from the RS232 spec. requirements */ 
      
#if (gSystemClock8MHz_d == 1)
#define gUARTBaudRate1200_c   (0x01A1)
#define gUARTBaudRate2400_c   (0x00D0)
#define gUARTBaudRate4800_c   (0x0068)
#define gUARTBaudRate9600_c   (0x0034)
#define gUARTBaudRate19200_c  (0x001A)
#define gUARTBaudRate38400_c  (0x0011)
#define gUARTBaudRate57600_c  (0x0009)
#define gUARTBaudRate115200_c (0x0004) /* May not work for all clients */
#endif /* gSystemClock8MHz_d */

#if (gSystemClock12MHz_d == 1)
#define gUARTBaudRate1200_c   (0x0271)
#define gUARTBaudRate2400_c   (0x0139)
#define gUARTBaudRate4800_c   (0x009C)
#define gUARTBaudRate9600_c   (0x004E)
#define gUARTBaudRate19200_c  (0x0027)
#define gUARTBaudRate38400_c  (0x0014)
#define gUARTBaudRate57600_c  (0x000D)
#define gUARTBaudRate115200_c (0x0007)
#endif /* gSystemClock12MHz_d */

#if (gSystemClock16MHz_d == 1)
#define gUARTBaudRate1200_c   (0x0341)
#define gUARTBaudRate2400_c   (0x01A1)
#define gUARTBaudRate4800_c   (0x00D0)
#define gUARTBaudRate9600_c   (0x0068)
#define gUARTBaudRate19200_c  (0x0034)
#define gUARTBaudRate38400_c  (0x001A)
#define gUARTBaudRate57600_c  (0x0011)
#define gUARTBaudRate115200_c (0x0009) /* May not work for all clients */
#endif /* gSystemClock16MHz_d */

#if (gSystemClock16780MHz_d == 1)
#define gUARTBaudRate1200_c   (0x036A)
#define gUARTBaudRate2400_c   (0x01B5)
#define gUARTBaudRate4800_c   (0x00DA)
#define gUARTBaudRate9600_c   (0x006D)
#define gUARTBaudRate19200_c  (0x0037)
#define gUARTBaudRate38400_c  (0x001B)
#define gUARTBaudRate57600_c  (0x0012)
#define gUARTBaudRate115200_c (0x0009)
#endif /* gSystemClock16780MHz_d */

/*****************************************************************************/ 
/* PIN out for HCS08                                                         */											
/*****************************************************************************/

#if ( ( gUART_OnSCI1_d == 1 ) && ( gUART_OnSCI2_d == 0 ) )

#define SCIxBDH		SCI1BDH
#define SCIxBDL		SCI1BDL
#define SCIxC1		SCI1C1
#define SCIxC2		SCI1C2
#define SCIxC3		SCI1C3
#define SCIxD		  SCI1D
#define SCIxS1		SCI1S1

#if (gUART_UseHWFlowControl_d == 1)
#if (gTarget_UserDefined_d == 1)
#define EnableFlow()  { gSCI1RTSPort_c &= ~gSCI1RTSPin_c; }
#define DisableFlow() { gSCI1RTSPort_c |= gSCI1RTSPin_c; } 
#else
#define EnableFlow()  { PTAD &= 0xFD; }
#define DisableFlow() { PTAD |= 0x02; }
#endif /* gTarget_UserDefined_d */
#else
#define EnableFlow()
#define DisableFlow()
#endif /* gUART_UseHWFlowControl_d */

#elif ( ( gUART_OnSCI2_d == 1 ) && ( gUART_OnSCI1_d == 0 ) )

#define SCIxBDH		SCI2BDH
#define SCIxBDL		SCI2BDL
#define SCIxC1		SCI2C1
#define SCIxC2		SCI2C2
#define SCIxC3		SCI2C3
#define SCIxD     SCI2D
#define SCIxS1		SCI2S1

#if (gUART_UseHWFlowControl_d == 1)

#if (gTarget_UserDefined_d == 1)
#define EnableFlow()  { gSCI2RTSPort_c &= ~gSCI2RTSPin_c; }
#define DisableFlow() { gSCI2RTSPort_c |= gSCI2RTSPin_c; }
#else
#define EnableFlow()  { PTAD &= 0xBF; }
#define DisableFlow() { PTAD |= 0x40; }
#endif /* gTarget_UserDefined_d */
#else
#define EnableFlow()
#define DisableFlow()
#endif /* gUART_UseHWFlowControl_d */

#endif

/*****************************************************************************/ 
/* Irp structure for sending requests                                        */											
/*****************************************************************************/  
typedef struct irp_tag {
  union {
    struct {      
      uint8_t uartId;    /* Set to gUART_Id1_c or gUART_Id2_c */
      uint8_t *pBuffer;  /* Pointer to the buffer to use */
      uint8_t len;       /* The number of characters in above buffer */
      /* Pointer to the procedure to call when finished
         (Use pointer to the same IRP in call) */
      void (*pfCallback)(struct irp_tag *); 
    } rxtxParams;
    struct {
      uint8_t   uartId;  /* Set to gUART_Id1_c or gUART_Id2_c */
      uint16_t  baudRate;
    } initParams;
  } reqData;
  uint8_t   returnValue; /* The returned status */
  uint8_t   requestType; /* Function type called */
} irp_t;
  
/*****************************************************************************
******************************************************************************
* Public prototypes
******************************************************************************
*****************************************************************************/

/*****************************************************************************
* Handle the app requests. 
*
* Interface assumptions:
*
* Arguments:
*   pIrp - pointer to IRP structure. The data pointed to by this data
*          structure MUST be placed on the heap and NOT on the stack.
*
* Return value:
* 
* Revision history:
* date   Author   Comments
* ------ ------   --------
* 240406 AL,FSL  Updated
*****************************************************************************/
uint8_t UART_Request(irp_t *pIrp);

/*****************************************************************************
* The UART task that drives copying of data, manages timeouts etc. 
*
* Interface assumptions:
*
* Arguments:
*   events - The event mask sent to the UART task. 
*
* Return value:
* 
* Revision history:
* date   Author   Comments
* ------ ------   --------
* 240406 AL,FSL  Updated
*****************************************************************************/
void UART_Main(event_t events);

/*****************************************************************************
* When transmit interrupt is enabled this ISR will execute
* and pumps data out through SCIx Tx pin. 
*
* Interface assumptions:
* 
* Return value:
* None
* 
* Revision history:
* date   Author   Comments
* ------ ------   --------
* 240406 AL,FSL  Updated
*****************************************************************************/
INTERRUPT_KEYWORD void UART_SCITxIsr(void);

/*****************************************************************************
* When data is received in SCIxD ISR will be called
* this routine puts SCIxD into Rx FIFO.
*
* Interface assumptions:
* 
* Return value:
* None
* 
* Revision history:
* date   Author   Comments
* ------ ------   --------
* 240406 AL,FSL  Updated
*****************************************************************************/
INTERRUPT_KEYWORD void UART_SCIRxIsr(void);

#if (gUART_Enabled_d == 1)
/* Set up the ISR routines as used in IsrVectors.c */
#if (gUART_OnSCI1_d == 0)
#define UART_SCI1RxIsr   Default_Dummy_ISR
#define UART_SCI1TxIsr   Default_Dummy_ISR
#else
#define UART_SCI1RxIsr   UART_SCIRxIsr
#define UART_SCI1TxIsr   UART_SCITxIsr
#endif /* gUART_OnSCI1_d */

#if (gUART_OnSCI2_d == 0)
#define UART_SCI2RxIsr   Default_Dummy_ISR
#define UART_SCI2TxIsr   Default_Dummy_ISR
#else
#define UART_SCI2RxIsr   UART_SCIRxIsr
#define UART_SCI2TxIsr   UART_SCITxIsr
#endif /* gUART_OnSCI2_d */  

#else /* gUART_Enabled_d */

/* Put in dummy ISR as the UART module is not used at all */
#define UART_SCI1RxIsr   Default_Dummy_ISR
#define UART_SCI1TxIsr   Default_Dummy_ISR
#define UART_SCI2RxIsr   Default_Dummy_ISR
#define UART_SCI2TxIsr   Default_Dummy_ISR

#endif /* gUART_Enabled_d */

#endif _UART_INTERFACE_H_

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区在线播放| 久久爱www久久做| 97久久超碰国产精品电影| 久久精品视频网| 国产精品综合视频| 国产日韩欧美亚洲| 97国产一区二区| 亚洲激情欧美激情| 欧美日韩在线观看一区二区| 亚洲午夜免费电影| 日韩一区二区视频| 国产一区二区三区在线观看免费视频 | 久久夜色精品国产欧美乱极品| 久久精品二区亚洲w码| 久久综合久久综合九色| 国产麻豆视频精品| 亚洲人精品午夜| 亚洲欧洲日产国码二区| 在线视频国产一区| 蜜桃久久av一区| 国产三级三级三级精品8ⅰ区| 成人午夜又粗又硬又大| 日韩美女啊v在线免费观看| 欧美视频一区二区在线观看| 午夜精品国产更新| 久久一区二区三区四区| 色美美综合视频| 男女男精品视频| 国产女人18毛片水真多成人如厕 | 在线免费观看不卡av| 奇米一区二区三区av| 2020日本不卡一区二区视频| 91丨国产丨九色丨pron| 日本中文字幕不卡| 久久精品免费在线观看| 在线观看av不卡| 极品少妇xxxx精品少妇偷拍| 亚洲少妇中出一区| 91精品国产入口| 亚洲人成影院在线观看| 午夜精品久久一牛影视| 久久久国产综合精品女国产盗摄| 不卡的电视剧免费网站有什么| 亚洲国产一区二区三区青草影视| 日韩色视频在线观看| 成人免费毛片app| 天天影视色香欲综合网老头| 欧美激情一区二区三区在线| 欧美日韩精品三区| 丁香五精品蜜臀久久久久99网站| 亚洲一区二区三区四区五区黄| 2欧美一区二区三区在线观看视频| 91在线播放网址| 国产精品一区一区三区| 亚洲一区二区3| 日本一区免费视频| 制服丝袜国产精品| 色一情一乱一乱一91av| 欧美乱妇20p| 91丨porny丨户外露出| 九九在线精品视频| 亚洲成在线观看| 亚洲三级电影全部在线观看高清| 日韩一级成人av| 欧美日韩一区二区欧美激情| 大陆成人av片| 国产综合色在线视频区| 亚洲成人久久影院| 一区二区三区四区中文字幕| 中文字幕在线一区免费| 久久综合久久综合亚洲| 精品日韩成人av| 91.麻豆视频| 欧美三级一区二区| 日本电影欧美片| 91麻豆免费观看| av一区二区久久| 不卡的av电影| a在线播放不卡| 国产91对白在线观看九色| 狠狠色狠狠色合久久伊人| 日本午夜一区二区| 免费成人你懂的| 日韩激情视频网站| 日本成人在线看| 日本欧美久久久久免费播放网| 亚洲国产日产av| 亚洲午夜精品一区二区三区他趣| 亚洲精品欧美在线| 亚洲伦理在线免费看| 亚洲免费在线视频一区 二区| 国产精品国产三级国产a| 国产精品久久久久久久久免费丝袜 | 91麻豆国产自产在线观看| 91免费国产在线观看| 色视频欧美一区二区三区| 91福利视频网站| 欧美日韩精品一区二区| 欧美喷潮久久久xxxxx| 91麻豆精品国产91久久久使用方法| 欧美日韩一区二区在线视频| 777奇米四色成人影色区| 欧美一区二区在线不卡| 久久综合色综合88| 国产精品青草综合久久久久99| 国产精品久线在线观看| 亚洲人被黑人高潮完整版| 亚洲国产中文字幕在线视频综合| 天堂精品中文字幕在线| 国内精品久久久久影院薰衣草| 国产一区91精品张津瑜| eeuss鲁片一区二区三区| 欧美亚洲愉拍一区二区| 91精品免费在线观看| 久久久久久一二三区| 国产精品传媒在线| 亚洲v日本v欧美v久久精品| 看片的网站亚洲| 成人av资源网站| 欧美日本在线一区| 久久久噜噜噜久久人人看| 亚洲猫色日本管| 日本在线观看不卡视频| 国产精品69毛片高清亚洲| 99re66热这里只有精品3直播 | 波多野结衣视频一区| 欧美在线综合视频| 日韩精品中午字幕| 成人免费在线视频观看| 日韩精品91亚洲二区在线观看| 国产精品正在播放| 欧美在线综合视频| 国产亚洲视频系列| 午夜精品免费在线观看| 国产aⅴ综合色| 欧美日本视频在线| 国产精品美女视频| 日产欧产美韩系列久久99| 成人精品视频一区| 日韩欧美不卡在线观看视频| 中文字幕欧美一区| 国产曰批免费观看久久久| 欧美在线你懂得| 中文幕一区二区三区久久蜜桃| 五月天久久比比资源色| 91香蕉视频mp4| 久久久夜色精品亚洲| 成人免费毛片a| 日韩天堂在线观看| 亚洲伊人色欲综合网| 成人av午夜电影| 欧美成人猛片aaaaaaa| 亚洲制服丝袜av| 成人不卡免费av| 久久久久久一二三区| 美国一区二区三区在线播放| 日本高清不卡视频| 日韩毛片一二三区| 国产99久久久国产精品潘金网站| 日韩精品一区二区三区视频播放| 一区二区三区在线高清| av不卡一区二区三区| 国产亚洲欧美中文| 国产在线视视频有精品| 日韩一卡二卡三卡四卡| 天堂一区二区在线| 欧美日韩国产另类不卡| 一区二区三区精品在线观看| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 亚洲国产精华液网站w| 黑人巨大精品欧美一区| 日韩三级高清在线| 日本强好片久久久久久aaa| 欧美日韩一区二区三区在线看| 一区二区三区欧美视频| 91毛片在线观看| 亚洲精品中文字幕乱码三区| www..com久久爱| 久久蜜桃av一区精品变态类天堂| 日本aⅴ免费视频一区二区三区| 欧美理论电影在线| 亚洲va国产天堂va久久en| 欧美日韩精品是欧美日韩精品| 亚洲国产精品久久人人爱蜜臀| 欧美亚洲国产一区二区三区va| 亚洲激情六月丁香| 欧美在线免费播放| 午夜精品123| 欧美一区二区精品在线| 久草这里只有精品视频| 久久精品水蜜桃av综合天堂| 粉嫩13p一区二区三区| 国产精品美女久久久久久久久| 成人动漫在线一区| 亚洲人成亚洲人成在线观看图片| 欧美优质美女网站| 免费在线观看精品| 久久这里只精品最新地址| 成人爽a毛片一区二区免费| 亚洲日本在线看|