?? 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 + -