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

📄 parameter_defines.h

📁 standdard test protocol
💻 H
字号:
#ifndef _PARAMETER_DEFINES_H_


#define CLOCK_SP        20000000

#define I2C_SCL         PIN_C0
#define I2C_SDA         PIN_C1

#define TXD             PIN_C6
#define RXD             PIN_C7

#define SS_PIN          PIN_A5
#define SDO_PIN         PIN_C5

#define SRT_PIN         PIN_C2
#define PWR_PIN         PIN_A4

#define SYNC_MCU        0x7F
#define SYNC_PC         0x90

#define PKG_RX          7
#define PKG_RX_CRC      ( PKG_RX - 1 )

#define PKG_TX          7

#define IP_CONFIG       0x01   //More MCU this change IP_ADD

#define RELAY_MODULE    0x01
#define ADCI2C_MODULE   0x02
#define ADC10BIT_MODULE 0x03
#define INPUT_MODULE    0x04
#define OUTPUT_MODULE   0x05
#define INT_MODULE      0x06
#define SPI_MODULE      0x07

#define ON_ALL          0xFF
#define OFF_ALL         0x00

#define ADC_CH0         0
#define ADC_CH1         1
#define ADC_CH2         2
#define ADC_CH3         3
#define ADC_CH4         4

#define TIME_OUT         250      // time out = 400 ms

/*********** IO configuration ***********/
#define READ            0x00
#define WRITE           0x10
#define CONFIG_INPUT    ( TRUE )      //Configuration port RB input TRUE = use
#define CONFIG_OUTPUT   ( TRUE )      //Configuration port RD output
/***************************************/

/********* Uart and I2C Inital *********/
#use    delay( clock=CLOCK_SP )
#use    I2C(master,sda=I2C_SDA,scl=I2C_SCL,FAST)
#use    rs232(baud=9600, xmit=TXD, rcv=RXD)
#use    fast_io(a)
#use    fast_io(d)//standard_io(d)
/***************************************/

/********** Variables Defines **********/
BOOLEAN SysFlag;
BOOLEAN RxFlag;
BOOLEAN InpFlag;
BOOLEAN IntFlag;
int i,k,j;

int IntCnt = 0;

int Index;
int AddrRel;
int OpStat;
int stat;
int TimeOut;

int IPConfig;
int AddressSub;
int SubStatus;

int GetIPAddress;
int ModuleAddress;

int AdcAddrID;
int AdcAddrOP;

int UartCrc;

int SetInput_RB;
int SetOutput_RD;

int MemPort;
int PinData;

int DatBuff[24];
int RxBuff[32];
int TxBuff[32];
int16 AdcBuff;
int16 AdcValue;   // ADC 10 bit Parameter

/***************************************/

#endif

⌨️ 快捷键说明

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