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

📄 rx8_1.h

📁 单片机控制122x32液晶。液晶内部芯片包含RAM(类似于显存)
💻 H
字号:
//*****************************************************************************
//*****************************************************************************
//  FILENAME: RX8_1.h
//   Version: 3.1, Updated on 2004/07/29 at 17:46:48
//  Generated by PSoC Designer ver 4.2  b1013 : 02 September, 2004
//
//  DESCRIPTION:  RX8 User Module C Language interface file for the
//                22/24/25/26/27xxx PSoC family of devices.
//-----------------------------------------------------------------------------
//      Copyright (c) Cypress MicroSystems 2000-2003. All Rights Reserved.
//*****************************************************************************
//*****************************************************************************


// include the global header file
#include <m8c.h>

#define RX8_1_RXBUF_ENABLE 1

//-------------------------------------------------
// Prototypes of the RX8_1 API.
//-------------------------------------------------

#if ( RX8_1_RXBUF_ENABLE )
extern char RX8_1_aRxBuffer[];
extern BYTE RX8_1_bRxCnt;
extern BYTE RX8_1_fStatus;
#endif

// Create pragmas to support proper argument and return value passing
#pragma fastcall16  RX8_1_EnableInt
#pragma fastcall16  RX8_1_DisableInt
#pragma fastcall16  RX8_1_Start
#pragma fastcall16  RX8_1_Stop
#pragma fastcall16  RX8_1_bReadRxData
#pragma fastcall16  RX8_1_bReadRxStatus

#pragma fastcall16  RX8_1_cGetChar
#pragma fastcall16  RX8_1_cReadChar
#pragma fastcall16  RX8_1_iReadChar

#if ( RX8_1_RXBUF_ENABLE )
#pragma fastcall16  RX8_1_CmdReset
#pragma fastcall16  RX8_1_bCmdCheck
#pragma fastcall16  RX8_1_bErrCheck
#pragma fastcall16  RX8_1_bCmdLength
#pragma fastcall16  RX8_1_szGetParam
#pragma fastcall16  RX8_1_szGetRestOfParams
#endif

//-------------------------------------------------
// Prototypes of the RX8_1 API.
//-------------------------------------------------
extern void  RX8_1_EnableInt(void);
extern void  RX8_1_DisableInt(void);
extern void  RX8_1_Start(BYTE bParity);
extern void  RX8_1_Stop(void);
extern BYTE  RX8_1_bReadRxData(void);
extern BYTE  RX8_1_bReadRxStatus(void);

// High level RX functions
extern CHAR         RX8_1_cGetChar(void);
extern CHAR         RX8_1_cReadChar(void);
extern INT          RX8_1_iReadChar(void);

#if ( RX8_1_RXBUF_ENABLE )
extern void   RX8_1_CmdReset(void);
extern BYTE   RX8_1_bCmdCheck(void);
extern BYTE   RX8_1_bErrCheck(void);
extern BYTE   RX8_1_bCmdLength(void);
extern char * RX8_1_szGetParam(void);
extern char * RX8_1_szGetRestOfParams(void);
#endif

// Old function call names, do not use.
// These names will be removed in a future release.
#pragma fastcall16 bRX8_1_ReadRxData
#pragma fastcall16 bRX8_1_ReadRxStatus
extern BYTE bRX8_1_ReadRxData(void);
extern BYTE bRX8_1_ReadRxStatus(void);

//-------------------------------------------------
// Constants for RX8_1 API's.
//-------------------------------------------------

//------------------------------------
// Receiver Interrupt masks
//------------------------------------
#define RX8_1_INT_REG_ADDR                     ( 0x0e1 )
#define RX8_1_bINT_MASK                        ( 0x40 )

//------------------------------------
// Receiver Parity masks
//------------------------------------
#define  RX8_1_PARITY_NONE         0x00
#define  RX8_1_PARITY_EVEN         0x02
#define  RX8_1_PARITY_ODD          0x06

//------------------------------------
//  Receiver Status Register masks
//------------------------------------
#define  RX8_1_RX_ACTIVE           0x10
#define  RX8_1_RX_COMPLETE         0x08
#define  RX8_1_RX_PARITY_ERROR     0x80
#define  RX8_1_RX_OVERRUN_ERROR    0x40
#define  RX8_1_RX_FRAMING_ERROR    0x20
#define  RX8_1_RX_NO_ERROR         0xE0

#define  RX8_1_RX_NO_DATA         0x01

#define  RX8_1_RX_BUF_ERROR               0xF0  // Mask for any Rx that may occur.
#define  RX8_1_RX_BUF_OVERRUN             0x10  // This indicates the software buffer has
                                                           // been over run.
#define  RX8_1_RX_BUF_CMDTERM             0x01  // Command terminator has been received.

// Old defines, will be removed in future release
#define  RX8_PARITY_NONE         0x00
#define  RX8_PARITY_EVEN         0x02
#define  RX8_PARITY_ODD          0x06
#define  RX8_RX_ACTIVE           0x10
#define  RX8_RX_COMPLETE         0x08
#define  RX8_RX_PARITY_ERROR     0x80
#define  RX8_RX_OVERRUN_ERROR    0x40
#define  RX8_RX_FRAMING_ERROR    0x20
#define  RX8_RX_NO_ERROR         0xE0

//-------------------------------------------------
// Register Addresses for RX8_1
//-------------------------------------------------
#pragma ioport  RX8_1_CONTROL_REG:  0x03b                  // Control register
BYTE            RX8_1_CONTROL_REG;
#pragma ioport  RX8_1_RX_SHIFT_REG: 0x038                  // RX Shift Register register
BYTE            RX8_1_RX_SHIFT_REG;
#pragma ioport  RX8_1_RX_BUFFER_REG:    0x03a              // RX Buffer Register
BYTE            RX8_1_RX_BUFFER_REG;
#pragma ioport  RX8_1_FUNC_REG: 0x138                      // Function register
BYTE            RX8_1_FUNC_REG;
#pragma ioport  RX8_1_INPUT_REG:    0x139                  // Input register
BYTE            RX8_1_INPUT_REG;
#pragma ioport  RX8_1_OUTPUT_REG:   0x13a                  // Output register
BYTE            RX8_1_OUTPUT_REG;

// end of file RX8_1.h

⌨️ 快捷键说明

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