📄 config.h
字号:
#include <reg52.h>
sfr WDT_CONTR = 0xe1; // STC 单片机
// ---- ))))) *********************************************************** (((((
sfr AUXR=0x8e; //STC 单片机 timer,uart,ad的设定
// ------ SPI ------
// ---- ))))) *********************************************************** (((((
sfr SPSTAT = 0x84; //STC 单片机 SPI的状态
sfr SPCTL = 0x85; //STC 单片机 SPI口的控制
sfr SPDAT = 0x86; //STC 单片机 SPI的数据
// ---- ))))) *********************************************************** (((((
sfr ADC_CONTR = 0xC5; //STC 单片机 // A/D转换控制寄存器
sfr ADC_DATA = 0xC6; // A/D转换结果寄存器
// ---- ))))) *********************************************************** (((((
sfr P1M0 = 0x91; //STC 单片机 // 端口模式的设定
sfr P1M1 = 0x92;
sfr P3M0 = 0xb1;
sfr P3M1 = 0xb2;
// ---- ))))) *********************************************************** (((((
//STC 单片机
sfr XICON =0xC0; // 外部中断2,3的寄存器
sbit PX3 = XICON^7;
sbit EX3 = XICON^6;
sbit IE3 = XICON^5;
sbit IT3 = XICON^4;
sbit PX2 = XICON^3;
sbit EX2 = XICON^2;
sbit IE2 = XICON^1;
sbit IT2 = XICON^0;
// PX3 External interrupt 3 priority high if set
// EX3 External interrupt 3 enable if set
// IE3 IE3 is set/cleared automatically by hardware when interrupt is detected/serviced
// IT3 External interrupt 3 is falling-edge/low-level triggered when this bit is set/cleared by software
// PX2 External interrupt 2 priority high if set
// EX2 External interrupt 2 enable if set
// IE2 IE2 is set/cleared automatically by hardware when interrupt is detected/serviced
// IT2 External interrupt 2 is falling-edge/low-level triggered when this bit is set/cleared by software
// PXH3 External interrupt 3 priority highest if set
// PXH2 External interrupt 2 priority highest if set
#define uint32 unsigned long int
#define uint16 unsigned int
#define uint8 unsigned char
#define XDATA_USING 0
#define SPI_USING 0
#define AD_USING 0
#define PCALVD_USING 1
#define EEPROM_USING 0
#define RS232GET_USING 0
#define RS232_USING 0
// --- 控制PT2322----------
sbit SDA=P1^1; /*模拟I2C数据传送位*/
sbit SCL=P1^0; /*模拟I2C时钟控制位*/
// ------ 按键的检测--------------
sbit KEY1 = P3^4;
// ------ 模式指示灯的控制----------------------
sbit LED1 = P1^7;
sbit LED2 = P1^6;
sbit LED3 = P1^5;
sbit LED4 = P1^4;
// ---------- JOG的检测-------------------------
sbit UP = P3^2;
sbit DOWN = P3^3;
// ----------- MUTE ----------------
sbit MUTE_CTL = P3^7;
// ----------- KEY ------------------
sbit KEY_1 = P3^4;
// ----------------------------------------
sbit MCU_OFF_ON = P1^3; // 用MCU强制关电???
sbit PWR_ON_OFF = P1^2; // POWER ON/OFF的检测,主要是掉电检测
#include <intrins.h>
#include <system_init.h>
#include <eint.h> // 外部中断
#include <timer.h> // 定时器中断
#if SPI_USING
#include <spiad.h> // SPI中断 A/D中断
#endif
#if PCALVD_USING
#include <pcalvd.h> // 低压中断
#endif
#include <rs232.h> // 串口中断
#include <pt2322s.h> // 音量控制芯片
#include <VIIC_C51.h> // 模拟I2C
#if EEPROM_USING
#include <eeprom.h>
#endif
#include <input.h>
#include <other.h>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -