📄 resources.h.svn-base
字号:
/*******************************************
* MSP430 IO Port define
* Ver 1.0
*******************************************/
#ifndef __MSP430Resources
#define __MSP430Resources
#include<msp430x13x.h>
//Define internal key IO Port BIT P1.0-1.3
#define KEY P1IN
#define KEY_select ~0x01
#define KEY_set ~0x02
#define KEY_shift ~0x04
#define KEY_up ~0x08
#define sys_select
#define sys_set
#define sys_shift
#define sys_up
// scan key:
// key:
//Define external key IO Port BIT
#define KEY_GJ ~0x20 //外部要求攻击潜望镜加热P1.5 GJ=WG
#define KEY_SS ~0x40 //外部要求搜索潜望镜加热P1.6 SS=QWJ
//P1.4 DS1821 写操作 BIT
#define WR_SEN P1OUT
#define WR_sensor BIT4
//////////////////////////////////////
#define set_wr_(chr,prt) prt |= (chr) //Write bit 1
#define clr_wr_(chr,prt) prt &= (~(chr)) //Write bit 0
//Define heating P2 Port BIT
#define P2_CON P2OUT
#define P2_CON_HEAT_GJ BIT1 //攻击潜望镜加热控制P2.1 GJ=WG
#define P2_CON_HEAT_SS BIT2 //搜索潜望镜加热控制P2.2 SS=QWJ
#define set_heat_(chr,prt) prt |= (chr) //Write bit 1
#define clr_heat_(chr,prt) prt &= (~(chr)) //Write bit 0
///Define external LED IO Port BIT
#define P2_CON_WLED_SS BIT3 //外部要求搜索潜望镜加热启动指示P2.3 SS=QWJ
#define P2_CON_WLED_GJ BIT4 //外部要求攻击潜望镜加热启动指示P2.4 GJ=WG
#define P2_CON_LED_N BIT5 //正负温度指示P2.5
#define P2_CON_LED_GJ BIT6 //攻击潜望镜加热指示P2.6 GJ=WG
#define P2_CON_LED_SS BIT7 //搜索潜望镜加热指示P2.7 SS=QWJ
#define set_led_(chr,prt) prt |= (chr) //Write bit 1
#define clr_led_(chr,prt) prt &= (~(chr)) //Write bit 0
//////////////////////////////////
///Define external LED IO P3 Port BIT
#define P3_CON P3OUT
#define P3_CON_LED_WG1 BIT0 //温度传感器1工作状态指示P3.0
#define P3_CON_LED_WG2 BIT1 //温度传感器2工作状态指示P3.1
#define P3_CON_LED_HEAT BIT2 //加热状态指示P3.2
#define P3_CON_LED_HOLD BIT3 //保温状态显示P3.3
#define P3_CON_POW BIT6 //DS1821启动信号P3.6
#define P3_CON_BELL BIT7 //故障报警蜂鸣器3.7
#define set_con_(chr,prt) prt |= (chr) //Write bit 1
#define clr_con_(chr,prt) prt &= (~(chr)) //Write bit 0
//led data port P4,P5
#define LED_OUT_H P4OUT
#define LED_OUT_L P5OUT
//ANALOG pt100 sampling//
////////////////////////////Reference////////////////////////////
/*
#define clr_P2intflg_() P2IFG = 0 //Clear P2 interrupt flag ;
#define p2_int_en_() P2IE |= 0xff //Enable P2 interruput
#define p2_int_ds_() P2IE &= 0x00 //desible P2 interruput
//rs485 read write control
#define rs485in_() P3OUT &= ~0x08;\
U0ME &= ~UTXE0;\
U0ME |= URXE0
#define rs485out_() P3OUT |= 0x08;\
U0ME &= ~URXE0;\
U0ME |= UTXE0
//Port 2
#define RL P6OUT
#define RL_PWR BIT6 //Relay 1 压缩机power
#define RL_BELL BIT5 //Relay 2 bell
#define RL_DOOR BIT7 //Relay 3 door
#define set_rl_(chr,prt) prt |= (chr) //Write bit 1
#define clr_rl_(chr,prt) prt &= (~(chr)) //Write bit 0
//port 4.5 :door info
#define DOORINF P3IN & 0x02
//low: close high:open
//lcd data port
#define LCD_IN_PORT P5IN
#define LCD_OUT_PORT P5OUT
//lcd control port
#define LCD_CTL_PORT P4OUT
#define LCD_DIR BIT7
#define LCD_RD BIT6
#define LCD_WR BIT5
#define LCD_CD BIT4
#define LCD_CS BIT3
//dir: =L, read ; =H, write
//cd: CD=H, command; CD=L, data
//wr,rd: =L, read write
//ce: =L, enable for chip
#define lcd_dt_in_() P5DIR = 0x00; \
LCD_CTL_PORT &= ~LCD_DIR;_NOP()
#define lcd_dt_out_() LCD_CTL_PORT |= LCD_DIR;\
P5DIR = 0xff; _NOP()
#define lcd_en_() LCD_CTL_PORT |= LCD_CS; _NOP()
#define lcd_dis_() LCD_CTL_PORT &= ~LCD_CS; _NOP()
#define lcd_cmd_() LCD_CTL_PORT &= ~LCD_CD; _NOP()
#define lcd_dt_() LCD_CTL_PORT |= LCD_CD; _NOP()
#define lcd_rd0_() LCD_CTL_PORT |= LCD_RD; _NOP()
#define lcd_rd1_() LCD_CTL_PORT &= ~LCD_RD; _NOP()
#define lcd_wr0_() LCD_CTL_PORT |= LCD_WR; _NOP()
#define lcd_wr1_() LCD_CTL_PORT &= ~LCD_WR; _NOP()
#endif //end define __MSP430Resources
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -