⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 probe_rs232.h

📁 ucos-ii 的完整代码
💻 H
字号:
/*
*********************************************************************************************************
*                                      uC/Probe Communication
*
*                           (c) Copyright 2007; Micrium, Inc.; Weston, FL
*
*               All rights reserved.  Protected by international copyright laws.
*               Knowledge of the source code may NOT be used to develop a similar product.
*               Please help us continue to provide the Embedded community with the finest
*               software available.  Your honesty is greatly appreciated.
*********************************************************************************************************
*/

/*
*********************************************************************************************************
*
*                                              uC/Probe
*
*                                      Communication: RS-232
*
* Filename      : probe_rs232.h
* Version       : V1.40
* Programmer(s) : BAN
*********************************************************************************************************
*/

#ifndef   __PROBE_RS232_H__
#define   __PROBE_RS232_H__

/*
*********************************************************************************************************
*                                               EXTERNS
*********************************************************************************************************
*/

#ifdef    PROBE_RS232_GLOBALS
#define   PROBE_RS232_EXT
#else
#define   PROBE_RS232_EXT  extern
#endif

/*
*********************************************************************************************************
*                                             INCLUDE FILES
*********************************************************************************************************
*/

#include <probe_com.h>

#if (PROBE_COM_METHOD_RS232 > 0)

/*
*********************************************************************************************************
*                                               DEFINES
*********************************************************************************************************
*/

/*
*********************************************************************************************************
*                                          GLOBAL VARIABLES
*********************************************************************************************************
*/

#if (PROBE_COM_STAT_EN > 0)
                                                                    /* ---------------- Byte counters --------------------- */
PROBE_RS232_EXT  CPU_INT32U  ProbeRS232_RxCtr;                      /*  ... Number of bytes received                        */
PROBE_RS232_EXT  CPU_INT32U  ProbeRS232_TxCtr;                      /*  ... Number of bytes transmitted                     */
#endif

/*
*********************************************************************************************************
*                                               MACRO'S
*********************************************************************************************************
*/

/*
*********************************************************************************************************
*                                         FUNCTION PROTOTYPES
*********************************************************************************************************
*/

void  ProbeRS232_Init          (CPU_INT32U   baud_rate);            /* Initialize uC/Probe RS-232 Communication Module      */
void  ProbeRS232_RxHandler     (CPU_INT08U   rx_data);              /* Processor independent Rx handler                     */
void  ProbeRS232_TxHandler     (void);                              /* Processor independent Tx handler                     */

#if (PROBE_RS232_PARSE_TASK > 0)
void  ProbeRS232_Task          (void        *p_arg);
#endif

/*
*********************************************************************************************************
*                                         FUNCTION PROTOTYPES
*                                  DEFINED IN PORT's probe_rs232c.c
*********************************************************************************************************
*/

void  ProbeRS232_InitTarget    (CPU_INT32U   baud_rate);            /* Initialize the target specifics                      */

void  ProbeRS232_RxTxISRHandler(void);                              /* Code to process Rx or Tx character                   */

void  ProbeRS232_RxISRHandler  (void);                              /* Code to process character received                   */
void  ProbeRS232_RxIntEn       (void);                              /* Enable  Rx interrupts                                */
void  ProbeRS232_RxIntDis      (void);                              /* Disable Rx interrupts                                */

void  ProbeRS232_TxISRHandler  (void);                              /* Code to process next character to send               */
void  ProbeRS232_TxIntEn       (void);                              /* Enable  Tx interrupts                                */
void  ProbeRS232_TxIntDis      (void);                              /* Disable Tx interrupts                                */
void  ProbeRS232_Tx1           (CPU_INT08U   c);                    /* Function to send a single character                  */

/*
*********************************************************************************************************
*                                         FUNCTION PROTOTYPES
*                                 DEFINED IN OS's probe_rs232_os.c
*********************************************************************************************************
*/

#if (PROBE_RS232_PARSE_TASK > 0)
void  ProbeRS232_OS_Init       (void);
void  ProbeRS232_OS_Pend       (void);
void  ProbeRS232_OS_Post       (void);
#endif

/*
*********************************************************************************************************
*                                        CONFIGURATION ERRORS
*********************************************************************************************************
*/

#ifndef    PROBE_RS232_PARSE_TASK
  #error  "PROBE_RS232_PARSE_TASK            not #define'd in 'probe_com_cfg.h'     "
  #error  "                           [MUST be  DEF_TRUE   Packet parsed in task   ]"
  #error  "                           [     ||  DEF_FALSE  Packet parsed in ISR    ]"

#elif    ((PROBE_RS232_PARSE_TASK != DEF_TRUE ) && \
          (PROBE_RS232_PARSE_TASK != DEF_FALSE))
  #error  "PROBE_RS232_PARSE_TASK      illegally #define'd in 'probe_com_cfg.h'     "
  #error  "                           [MUST be  DEF_TRUE   Packet parsed in task   ]"
  #error  "                           [     ||  DEF_FALSE  Packet parsed in ISR    ]"

#elif     (PROBE_RS232_PARSE_TASK == DEF_TRUE)

#ifndef    PROBE_RS232_TASK_PRIO
  #error  "PROBE_RS232_TASK_PRIO             not #define'd in 'probe_com_cfg.h'     "
#endif

#ifndef    PROBE_RS232_TASK_STK_SIZE
  #error  "PROBE_RS232_TASK_STK_SIZE         not #define'd in 'probe_com_cfg.h'     "
#endif

#endif



#ifndef    PROBE_RS232_RX_BUF_SIZE
  #error  "PROBE_RS232_RX_BUF_SIZE           not #define'd in 'probe_com_cfg.h'     "
#endif



#ifndef    PROBE_RS232_TX_BUF_SIZE
  #error  "PROBE_RS232_TX_BUF_SIZE           not #define'd in 'probe_com_cfg.h'     "
#endif


#ifndef    PROBE_RS232_COMM_SEL
  #error  "PROBE_RS232_COMM_SEL              not #define'd in 'probe_com_cfg.h'     "
#endif



#endif

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -