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

📄 spim_radio.h

📁 Cypress公司开发的2.4G无线键盘鼠标及其Bridge源代码
💻 H
字号:
//*****************************************************************************
//*****************************************************************************
//  FILENAME: SPIM_Radio.h
//   Version: 2.5, Updated on 2006/05/18 at 10:27:31
//  Generated by PSoC Designer ver 4.4  b1884 : 14 Jan, 2007
//
//  DESCRIPTION:
//    SPIM_Radio SPIM User Module header file.
//-----------------------------------------------------------------------------
//      Copyright (c) Cypress MicroSystems 2000-2003. All Rights Reserved.
//*****************************************************************************
//*****************************************************************************

#include <m8c.h>

#pragma fastcall16  SPIM_Radio_EnableInt
#pragma fastcall16  SPIM_Radio_DisableInt
#pragma fastcall16  SPIM_Radio_Start
#pragma fastcall16  SPIM_Radio_Stop
#pragma fastcall16  SPIM_Radio_SendTxData
#pragma fastcall16  SPIM_Radio_bReadRxData
#pragma fastcall16  SPIM_Radio_bReadStatus

//-------------------------------------------------
// Prototypes of the SPIM_Radio API.
//-------------------------------------------------
extern void  SPIM_Radio_EnableInt(void);
extern void  SPIM_Radio_DisableInt(void);
extern void  SPIM_Radio_Start(BYTE bConfiguration);
extern void  SPIM_Radio_Stop(void);
extern void  SPIM_Radio_SendTxData(BYTE bTxData);
extern BYTE  SPIM_Radio_bReadRxData(void);
extern BYTE  SPIM_Radio_bReadStatus(void);

// Old function prototypes, Do not use
// These will be removed in a future release
#pragma fastcall16 bSPIM_Radio_ReadRxData
#pragma fastcall16 bSPIM_Radio_ReadStatus
extern BYTE bSPIM_Radio_ReadRxData(void);
extern BYTE bSPIM_Radio_ReadStatus(void);


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

#define SPIM_Radio_INT_REG_ADDR                ( 0x0e1 )
#define SPIM_Radio_bINT_MASK                   ( 0x04 )

//*******************************
// SPI Configuration definitions
//*******************************
#define  SPIM_Radio_SPIM_MODE_0            0x00      // MODE 0 - Leading edge latches data - pos clock
#define  SPIM_Radio_SPIM_MODE_1            0x02      // MODE 1 - Leading edge latches data - neg clock
#define  SPIM_Radio_SPIM_MODE_2            0x04      // MODE 2 - Trailing edge latches data - pos clock
#define  SPIM_Radio_SPIM_MODE_3            0x06      // MODE 3 - Trailing edge latches data - neg clock
#define  SPIM_Radio_SPIM_LSB_FIRST         0x80      // LSB bit transmitted/received first
#define  SPIM_Radio_SPIM_MSB_FIRST         0x00      // MSB bit transmitted/received first

//********************************
// SPI Status register masks
//********************************
#define  SPIM_Radio_SPIM_RX_OVERRUN_ERROR  0x40      // Overrun error in received data
#define  SPIM_Radio_SPIM_TX_BUFFER_EMPTY   0x10      // TX Buffer register is ready for next data byte
#define  SPIM_Radio_SPIM_RX_BUFFER_FULL    0x08      // RX Buffer register has received current data
#define  SPIM_Radio_SPIM_SPI_COMPLETE      0x20      // SPI Tx/Rx cycle has completed

//-------------------------------------------------
// Register Addresses for SPIM_Radio
//-------------------------------------------------
#pragma ioport  SPIM_Radio_CONTROL_REG: 0x02b              //Control register
BYTE            SPIM_Radio_CONTROL_REG;
#pragma ioport  SPIM_Radio_SHIFT_REG:   0x028              //TX Shift Register register
BYTE            SPIM_Radio_SHIFT_REG;
#pragma ioport  SPIM_Radio_TX_BUFFER_REG:   0x029          //TX Buffer Register
BYTE            SPIM_Radio_TX_BUFFER_REG;
#pragma ioport  SPIM_Radio_RX_BUFFER_REG:   0x02a          //RX Buffer Register
BYTE            SPIM_Radio_RX_BUFFER_REG;
#pragma ioport  SPIM_Radio_FUNCTION_REG:    0x128          //Function register
BYTE            SPIM_Radio_FUNCTION_REG;
#pragma ioport  SPIM_Radio_INPUT_REG:   0x129              //Input register
BYTE            SPIM_Radio_INPUT_REG;
#pragma ioport  SPIM_Radio_OUTPUT_REG:  0x12a              //Output register
BYTE            SPIM_Radio_OUTPUT_REG;

// end of file SPIM_Radio.h

⌨️ 快捷键说明

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