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

📄 constant.h.bak

📁 原创的msp430单片机的整套编码 包括通信,红外检测,软件计时等多种功能
💻 BAK
字号:
//=======================================================================
//                  FRAM I/O模拟定义常量
//=======================================================================
#define WREN_INST 0x06	 // Write enable latch instruction (WREN)
#define WRDI_INST 0x04	 // Write disable latch instruction (WRDI)
#define WRSR_INST 0x01   // Write status register instruction (WRSR)
#define RDSR_INST 0x05   // Read status register instruction (RDSR
#define WRITE_INST 0x02  // Write memory instruction (WRITE)
#define READ_INST 0x03   // Read memory instruction (READ)
#define STATUS_REG 0x00  // Status register,BP1 and BP0 are all zero,no menory write protection

#define FRAM_CS_LOW  P3OUT &= ~BIT0	//SPI片选低,选定FRAM
#define FRAM_CS_HIGH  P3OUT |= BIT0	//SPI片选高,取消FRAM的选定
#define FRAM_SIMO_LOW  P3OUT &= ~BIT1	//SPI的SIMO输出低,输出0
#define FRAM_SIMO_HIGH  P3OUT |= BIT1	//SPI的SIMO输出高,输出1
#define FRAM_CLK_LOW  P3OUT &= ~BIT3	//SPI的CLK拉低
#define FRAM_CLK_HIGH  P3OUT |= BIT3	//SPI的CLK拉高

#define FRAM_POINT_SOE                0x0004 //保存SOE记录指针,它指向准备发送的SOE记录
#define FRAM_NUM_SOE                  0x0006 //表示保存在FRAM中的尚未发送过的事件数目的地址
#define SOE_REC_BASE 0x0008



//=======================================================================
//                 记录发送类型定义常量
//=======================================================================
#define CounterSP  0x0F      //售烟事件允许发送
#define CounterSF  0x00      //售烟事件禁止发送
#define DoorSP  0x1F         //柜门开启事件允许发送
#define DoorSF  0x10         //柜门开启事件禁止发送

#define		TqueueRS485_Length		42// 发送队列长度字节数
#define		RqueueRS485_Length		96// 接收循环队列长度字节数
//#define		TqueueRS232_Length    8// 串行通信发送队列长度
#define		RqueueRS232_Length    8// 串行通信接收循环队列长度

#define		ON					1
#define		OFF					0
#define   KEYROWNUM   10//键盘行值
#define   KEYCOLNUM   12//键盘列值
#define   VERSION     "CNT1210V2.0"//程序版本号



//=======================================================================
//                 按键输入与电机驱动输出对应表
//=======================================================================
#define MOTORCOL1_HIGH P4OUT |= BIT5
#define MOTORCOL2_HIGH P4OUT |= BIT4
#define MOTORCOL3_HIGH P4OUT |= BIT3
#define MOTORCOL4_HIGH P4OUT |= BIT2
#define MOTORCOL5_HIGH P4OUT |= BIT1
#define MOTORCOL6_HIGH P4OUT |= BIT0
#define MOTORCOL7_HIGH P3OUT |= BIT7
#define MOTORCOL8_HIGH P2OUT |= BIT7
#define MOTORCOL9_HIGH P2OUT |= BIT6
#define MOTORCOL10_HIGH P2OUT |= BIT5
#define MOTORCOL11_HIGH P2OUT |= BIT4
#define MOTORCOL12_HIGH P2OUT |= BIT1

#define MOTORROW1_HIGH P5OUT |= BIT7
#define MOTORROW2_HIGH P5OUT |= BIT6
#define MOTORROW3_HIGH P5OUT |= BIT5
#define MOTORROW4_HIGH P5OUT |= BIT4
#define MOTORROW5_HIGH P5OUT |= BIT3
#define MOTORROW6_HIGH P5OUT |= BIT2
#define MOTORROW7_HIGH P5OUT |= BIT1
#define MOTORROW8_HIGH P5OUT |= BIT0
#define MOTORROW9_HIGH P4OUT |= BIT7
#define MOTORROW10_HIGH P4OUT |= BIT6


#define MOTOR0_OFF P2OUT &= 0x0D
#define MOTOR1_OFF P3OUT &= 0x7F
#define MOTOR2_OFF P4OUT = 0
#define MOTOR3_OFF P5OUT = 0





//=======================================================================
//                 工作电压限值
//=======================================================================
#define PBOUNDMEASURE 1880 //工作电压下限值10V        1880=4095*10*10/(66*3.3)
//#define MaxMeasure  2200    //堵转与工作电压上限值   4000=4095*3.22/3.3
//#define MPBoundMeasure  830  //正转堵转电压下限值    2000=4095*1.61/3.30
//#define MNBoundMeasure  800  //反转堵转电压下限值    2000=4095*1.61/3.30
//#define MRunMeasure    100    //电机转动检测下限值,低于该值认为电机没有转动    2000=4095*1.61/3.30
//#define MaxMeasure  4000     //堵转与工作电压上限值   4000=4095*3.22/3.30
//#define MPBoundMeasure  1500  //正转堵转电压下限值    2000=4095*1.61/3.30
//#define MNBoundMeasure  1200  //反转堵转电压下限值    2000=4095*1.61/3.30
//#define MRunMeasure    200    //电机转动检测下限值,低于该值认为电机没有转动    2000=4095*1.61/3.30




//=======================================================================
//                     蜂鸣器工作变量设定
//=======================================================================
#define BEESOLDCN 2  //售烟鸣笛次数=BEESOLDCN/2
#define BEEALARMCN 6//售报警鸣笛次数=BEEALARMCN/2
#define BEELENGTH 10//鸣笛持续时间=BEELENGTH×10ms

⌨️ 快捷键说明

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