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

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

?? 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_

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品视频第一区| 久久不见久久见免费视频1| 无码av免费一区二区三区试看| 青青草国产精品亚洲专区无| www.欧美亚洲| 精品久久久久久无| 亚洲在线免费播放| 国产精品久久久一本精品 | 日韩免费观看高清完整版在线观看| 国产调教视频一区| 日本成人在线一区| 91极品美女在线| 中文字幕欧美日韩一区| 美国一区二区三区在线播放| 欧美亚洲精品一区| 亚洲日本电影在线| 99精品视频在线免费观看| 欧美精品一区二区三区很污很色的 | 国产成人在线免费| 欧美不卡一二三| 日日夜夜精品视频天天综合网| 色综合中文综合网| 亚洲精品成a人| 成人黄色在线网站| 欧美国产日本韩| 国产精品白丝av| 久久影音资源网| 国产精品自拍一区| 久久午夜色播影院免费高清| 久久99九九99精品| 欧美一级二级在线观看| 亚洲va在线va天堂| 欧美一区二区三区公司| 久久电影网站中文字幕| 欧美一区二区三区电影| 久久99国产精品久久99| 日韩三级中文字幕| 美女网站色91| 久久久久久9999| 国产iv一区二区三区| 国产精品女同一区二区三区| 成人aa视频在线观看| 成人免费一区二区三区视频| 一本一道久久a久久精品综合蜜臀| 国产精品白丝在线| 在线观看精品一区| 日韩电影免费在线看| 日韩欧美国产一区二区在线播放| 国产制服丝袜一区| 国产精品久久久久久亚洲毛片 | 精品对白一区国产伦| 丁香啪啪综合成人亚洲小说| 日韩美女久久久| 欧美日韩免费观看一区二区三区| 偷拍一区二区三区| 久久先锋影音av| 欧美最猛黑人xxxxx猛交| 日韩国产在线一| 精品国产免费人成在线观看| 成人黄色av网站在线| 亚洲小说欧美激情另类| 精品区一区二区| 99国产精品久久久| 三级一区在线视频先锋| 国产亚洲精品资源在线26u| 91丨九色丨黑人外教| 日韩国产欧美三级| 中文字幕精品三区| 欧美人妇做爰xxxⅹ性高电影| 精品一区二区三区日韩| 亚洲免费观看在线视频| 日韩久久久久久| 99精品在线观看视频| 久久精品国产99国产| 亚洲精品日韩综合观看成人91| 日韩免费在线观看| 色综合天天做天天爱| 激情六月婷婷久久| 亚洲国产日韩精品| 日本一区二区三区四区| 欧美一级日韩一级| 色香蕉成人二区免费| 国产一区二区三区香蕉| 亚洲h在线观看| 国产精品成人一区二区艾草| 欧美变态tickling挠脚心| 色88888久久久久久影院野外| 狠狠狠色丁香婷婷综合久久五月| 亚洲最新视频在线观看| 国产视频一区二区在线| 欧美福利一区二区| 91麻豆国产在线观看| 成人一区在线观看| 国内精品写真在线观看| 性感美女极品91精品| 亚洲综合免费观看高清完整版在线| 国产欧美日韩在线视频| 欧美电影免费提供在线观看| 在线不卡免费欧美| 欧美日韩免费视频| 欧美午夜影院一区| 欧洲av一区二区嗯嗯嗯啊| a级精品国产片在线观看| 国产高清精品在线| 国产又黄又大久久| 精品一区二区三区视频| 美国毛片一区二区三区| 日韩成人av影视| 亚洲一区二区三区小说| 亚洲一二三四久久| 亚洲国产成人高清精品| 亚洲国产视频a| 亚洲mv大片欧洲mv大片精品| 亚洲成精国产精品女| 香蕉久久一区二区不卡无毒影院| 亚洲第一会所有码转帖| 亚洲国产成人va在线观看天堂 | 亚洲免费观看在线观看| 中文字幕亚洲视频| 亚洲欧洲av在线| 国产精品萝li| 亚洲另类中文字| 亚洲一区二三区| 丝袜美腿亚洲色图| 另类综合日韩欧美亚洲| 国内成人免费视频| 国产精品18久久久| 99国内精品久久| 欧美三级视频在线| 91精品国产高清一区二区三区| 日韩一区二区在线观看| 久久日韩粉嫩一区二区三区| 国产精品久久久久影院亚瑟| 一区二区欧美在线观看| 香蕉久久夜色精品国产使用方法| 麻豆精品新av中文字幕| 国产成人精品亚洲日本在线桃色| 成人高清免费观看| 91福利资源站| 精品欧美乱码久久久久久1区2区| 久久久亚洲精华液精华液精华液| 中文乱码免费一区二区| 亚洲精品国产无套在线观| 天堂资源在线中文精品| 国产一区在线不卡| 91亚洲国产成人精品一区二三| 欧美又粗又大又爽| 精品国产区一区| 亚洲欧美电影一区二区| 日本视频免费一区| 成人午夜激情在线| 欧美精品vⅰdeose4hd| 中文字幕乱码亚洲精品一区| 亚洲国产裸拍裸体视频在线观看乱了| 日本亚洲天堂网| 91同城在线观看| 2019国产精品| 亚洲精品精品亚洲| 国产主播一区二区三区| 欧美视频一区二区三区在线观看| 精品国产伦理网| 亚洲国产一区二区三区| 波多野结衣视频一区| 欧美成人aa大片| 亚洲成av人**亚洲成av**| 成人av第一页| 久久久精品tv| 免费日韩伦理电影| 欧洲一区在线观看| 国产精品乱码久久久久久| 国产一区二区按摩在线观看| 欧美主播一区二区三区美女| 久久久91精品国产一区二区三区| 日本不卡不码高清免费观看| 色老汉av一区二区三区| 国产欧美视频一区二区| 久久99热狠狠色一区二区| 欧美日韩高清一区二区三区| 中文字幕一区二区三区蜜月| 国产麻豆精品在线观看| 日韩精品在线看片z| 天堂成人免费av电影一区| 在线一区二区三区做爰视频网站| 欧美高清一级片在线观看| 精品无人码麻豆乱码1区2区| 91精品国产色综合久久久蜜香臀| 亚洲黄色免费网站| 97se狠狠狠综合亚洲狠狠| 国产嫩草影院久久久久| 国产一区二区三区香蕉| 久久午夜免费电影| 久久99精品久久久久婷婷| 欧美一区二区三区免费视频| 亚洲v日本v欧美v久久精品| 欧美无乱码久久久免费午夜一区| 亚洲精品国产一区二区三区四区在线| 99久久99久久精品国产片果冻 | 日日噜噜夜夜狠狠视频欧美人 | 久久九九久久九九| 国产一区二区三区高清播放|