You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

113 lines
3.0 KiB

#ifndef __STC8A8K64D4_ext_H__
#define __STC8A8K64D4_ext_H__
#include "c_bit.h"
///辅助寄存器 1(AUXR)
#define T2R BITN4
///T2R:定时器2的运行控制位 0:定时器 2 停止计数 1:定时器 2 开始计数
/////////////////////////////////////////////////
/********
IE2(中断使能寄存器 2) 符号 地址
B7 B6 B5 B4 B3 B2 B1 B0
IE2 AFH ET4 ET3 ES4 ES3 ET2 ESPI ES2
ET4:定时/计数器 T4 的溢出中断允许位。 0:禁止 T4 中断 1:允许 T4 中断
ET3:定时/计数器 T3 的溢出中断允许位。 0:禁止 T3 中断 1:允许 T3 中断
ES4:串行口 4 中断允许位。 0:禁止串行口 4 中断 1:允许串行口 4 中断
ES3:串行口 3 中断允许位。 0:禁止串行口 3 中断 1:允许串行口 3 中断
ET2:定时/计数器 T2 的溢出中断允许位。 0:禁止 T2 中断 1:允许 T2 中断
ESPI:SPI 中断允许位。 0:禁止 SPI 中断 1:允许 SPI 中断
ES2:串行口 2 中断允许位。 0:禁止串行口 2 中断 1:允许串行口 2 中断
**********/
#define ET4 BITN6
#define ET3 BITN5
#define ES4 BITN4
#define ES3 BITN3
#define ET2 BITN2
#define ESPI BITN1
#define ES2 BITN0
//-----------------------------------------------------------------
///sfr P_SW2 = 0xBA; //0xxx,x000 外设端口切换寄存器
#define EAXFR BITN7
#define I2C_S1 BITN5
#define I2C_S2 BITN4
#define CMPO_S BITN3
#define S4_S BITN2
#define S3_S BITN1
#define S2_S BITN0
#define D_MCLKO_DIV2 2
#define D_MCLKO_DIV4 4
#define D_MCLKO_DIV8 6
#define D_MCLKO_DIV16 8
#define D_MCLKO_DIV32 10
#define D_MCLKO_DIV64 12
#define MCLKO_S BITN7
#define INT_CLKO INTCLKO
#define INT_EX4 BITN6
#define INT_EX3 BITN5
#define INT_EX2 BITN4
#define L0_INT0_UD() IT0 = 0 ///;使能 INT0 上升沿和下降沿中断 ;
#define L0_INT0_D() IT0 = 1
#define L0_INT1_UD() IT1 = 0 ///;使能 INT0 上升沿和下降沿中断 ;
#define L0_INT1_D() IT1 = 1
#define L0_INT3_OPEN() BITN_1(INT_CLKO, INT_EX3);
#define L0_INT3_CLOSE() BITN_0(INT_CLKO, INT_EX3);
#define L0_INT2_OPEN() BITN_1(INT_CLKO, INT_EX2);
#define L0_INT2_CLOSE() BITN_0(INT_CLKO, INT_EX2);
#define L0_INT1_OPEN() EX1 = 1;
#define L0_INT1_CLOSE() EX1 = 0;
#define L0_INT0_OPEN() EX0 = 1;
#define L0_INT0_CLOSE() EX0 = 0;
#define CLKSET_IRC 0
#define CLKSET_EXT 1
#define CLKSET_32KEXT 2
#define CLKSET_32KIRC 3
/***********
sfr CCAP0H = 0xfa;
sfr CCAP1H = 0xfb;
sfr CCAP2H = 0xfc;
sfr RSTCFG = 0xff;
sfr CCAP0L = 0xea;
sfr CCAP1L = 0xeb;
sfr CCAP2L = 0xec;
sfr IP3H = 0xee;
sfr AUXINTIF = 0xef;
sfr B = 0xf0;
sfr PWMSET = 0xf1;
sfr PCA_PWM0 = 0xf2;
sfr PCA_PWM1 = 0xf3;
sfr PCA_PWM2 = 0xf4;
*/
#endif