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.
 
 
 
 

301 lines
7.8 KiB

//////////////////////////////////////////////////////////////////////////
/// COPYRIGHT NOTICE
/// Copyright (c) 2023 CCSENS
/// All rights reserved.
///
/// @file __C51_MACRO_H_
/// @brief macro define 和cpu相关,可以和同一个系列的cpu共享
///
///(本文件实现的功能的详述)
///
/// @version 1.1 CCsens technology
/// @author CC
/// @date 20180102
//
//////////////////////////////////////////////////////////////////////////
#ifndef __C51_MACRO_H_
#define __C51_MACRO_H_
#include<intrins.h>
#define D_P07_ON() P07 = 1
#define D_P06_ON() P06 = 1
#define D_P05_ON() P05 = 1
#define D_P04_ON() P04 = 1
#define D_P03_ON() P03 = 1
#define D_P02_ON() P02 = 1
#define D_P01_ON() P01 = 1
#define D_P00_ON() P00 = 1
#define D_P07_OFF() P07 = 0
#define D_P06_OFF() P06 = 0
#define D_P05_OFF() P05 = 0
#define D_P04_OFF() P04 = 0
#define D_P03_OFF() P03 = 0
#define D_P02_OFF() P02 = 0
#define D_P01_OFF() P01 = 0
#define D_P00_OFF() P00 = 0
#define D_P07_AT() (P07)
#define D_P06_AT() (P06)
#define D_P05_AT() (P05)
#define D_P04_AT() (P04)
#define D_P03_AT() (P03)
#define D_P02_AT() (P02)
#define D_P01_AT() (P01)
#define D_P00_AT() (P00)
#define D_P07_REV() P07 = ~P07
#define D_P06_REV() P06 = ~P06
#define D_P05_REV() P05 = ~P05
#define D_P04_REV() P04 = ~P04
#define D_P03_REV() P03 = ~P03
#define D_P02_REV() P02 = ~P02
#define D_P01_REV() P01 = ~P01
#define D_P00_REV() P00 = ~P00
#define D_P17_ON() P17 = 1
#define D_P16_ON() P16 = 1
#define D_P15_ON() P15 = 1
#define D_P14_ON() P14 = 1
#define D_P13_ON() P13 = 1
#define D_P12_ON() P12 = 1
#define D_P11_ON() P11 = 1
#define D_P10_ON() P10 = 1
#define D_P17_OFF() P17 = 0
#define D_P16_OFF() P16 = 0
#define D_P15_OFF() P15 = 0
#define D_P14_OFF() P14 = 0
#define D_P13_OFF() P13 = 0
#define D_P12_OFF() P12 = 0
#define D_P11_OFF() P11 = 0
#define D_P10_OFF() P10 = 0
#define D_P17_AT() (P17)
#define D_P16_AT() (P16)
#define D_P15_AT() (P15)
#define D_P14_AT() (P14)
#define D_P13_AT() (P13)
#define D_P12_AT() (P12)
#define D_P11_AT() (P11)
#define D_P10_AT() (P10)
#define D_P17_REV() P17 = ~P17
#define D_P16_REV() P16 = ~P16
#define D_P15_REV() P15 = ~P15
#define D_P14_REV() P14 = ~P14
#define D_P13_REV() P13 = ~P13
#define D_P12_REV() P12 = ~P12
#define D_P11_REV() P11 = ~P11
#define D_P10_REV() P10 = ~P10
#define D_P27_ON() P27 = 1
#define D_P26_ON() P26 = 1
#define D_P25_ON() P25 = 1
#define D_P24_ON() P24 = 1
#define D_P23_ON() P23 = 1
#define D_P22_ON() P22 = 1
#define D_P21_ON() P21 = 1
#define D_P20_ON() P20 = 1
#define D_P27_OFF() P27 = 0
#define D_P26_OFF() P26 = 0
#define D_P25_OFF() P25 = 0
#define D_P24_OFF() P24 = 0
#define D_P23_OFF() P23 = 0
#define D_P22_OFF() P22 = 0
#define D_P21_OFF() P21 = 0
#define D_P20_OFF() P20 = 0
#define D_P27_AT() (P27)
#define D_P26_AT() (P26)
#define D_P25_AT() (P25)
#define D_P24_AT() (P24)
#define D_P23_AT() (P23)
#define D_P22_AT() (P22)
#define D_P21_AT() (P21)
#define D_P20_AT() (P20)
#define D_P27_REV() P27 = ~P27
#define D_P26_REV() P26 = ~P26
#define D_P25_REV() P25 = ~P25
#define D_P24_REV() P24 = ~P24
#define D_P23_REV() P23 = ~P23
#define D_P22_REV() P22 = ~P22
#define D_P21_REV() P21 = ~P21
#define D_P20_REV() P20 = ~P20
#define D_P37_ON() P37 = 1
#define D_P36_ON() P36 = 1
#define D_P35_ON() P35 = 1
#define D_P34_ON() P34 = 1
#define D_P33_ON() P33 = 1
#define D_P32_ON() P32 = 1
#define D_P31_ON() P31 = 1
#define D_P30_ON() P30 = 1
#define D_P37_OFF() P37 = 0
#define D_P36_OFF() P36 = 0
#define D_P35_OFF() P35 = 0
#define D_P34_OFF() P34 = 0
#define D_P33_OFF() P33 = 0
#define D_P32_OFF() P32 = 0
#define D_P31_OFF() P31 = 0
#define D_P30_OFF() P30 = 0
#define D_P37_AT() (P37)
#define D_P36_AT() (P36)
#define D_P35_AT() (P35)
#define D_P34_AT() (P34)
#define D_P33_AT() (P33)
#define D_P32_AT() (P32)
#define D_P31_AT() (P31)
#define D_P30_AT() (P30)
#define D_P37_REV() P37 = ~P37
#define D_P36_REV() P36 = ~P36
#define D_P35_REV() P35 = ~P35
#define D_P34_REV() P34 = ~P34
#define D_P33_REV() P33 = ~P33
#define D_P32_REV() P32 = ~P32
#define D_P31_REV() P31 = ~P31
#define D_P30_REV() P30 = ~P30
#define D_P47_ON() P47 = 1
#define D_P46_ON() P46 = 1
#define D_P45_ON() P45 = 1
#define D_P44_ON() P44 = 1
#define D_P43_ON() P43 = 1
#define D_P42_ON() P42 = 1
#define D_P41_ON() P41 = 1
#define D_P40_ON() P40 = 1
#define D_P47_OFF() P47 = 0
#define D_P46_OFF() P46 = 0
#define D_P45_OFF() P45 = 0
#define D_P44_OFF() P44 = 0
#define D_P43_OFF() P43 = 0
#define D_P42_OFF() P42 = 0
#define D_P41_OFF() P41 = 0
#define D_P40_OFF() P40 = 0
#define D_P47_AT() (P47)
#define D_P46_AT() (P46)
#define D_P45_AT() (P45)
#define D_P44_AT() (P44)
#define D_P43_AT() (P43)
#define D_P42_AT() (P42)
#define D_P41_AT() (P41)
#define D_P40_AT() (P40)
#define D_P47_REV() P47 = ~P47
#define D_P46_REV() P46 = ~P46
#define D_P45_REV() P45 = ~P45
#define D_P44_REV() P44 = ~P44
#define D_P43_REV() P43 = ~P43
#define D_P42_REV() P42 = ~P42
#define D_P41_REV() P41 = ~P41
#define D_P40_REV() P40 = ~P40
#define D_P57_ON() P57 = 1
#define D_P56_ON() P56 = 1
#define D_P55_ON() P55 = 1
#define D_P54_ON() P54 = 1
#define D_P53_ON() P53 = 1
#define D_P52_ON() P52 = 1
#define D_P51_ON() P51 = 1
#define D_P50_ON() P50 = 1
#define D_P57_OFF() P57 = 0
#define D_P56_OFF() P56 = 0
#define D_P55_OFF() P55 = 0
#define D_P54_OFF() P54 = 0
#define D_P53_OFF() P53 = 0
#define D_P52_OFF() P52 = 0
#define D_P51_OFF() P51 = 0
#define D_P50_OFF() P50 = 0
#define D_P57_AT() (P57)
#define D_P56_AT() (P56)
#define D_P55_AT() (P55)
#define D_P54_AT() (P54)
#define D_P53_AT() (P53)
#define D_P52_AT() (P52)
#define D_P51_AT() (P51)
#define D_P50_AT() (P50)
#define D_P57_REV() P57 = ~P57
#define D_P56_REV() P56 = ~P56
#define D_P55_REV() P55 = ~P55
#define D_P54_REV() P54 = ~P54
#define D_P53_REV() P53 = ~P53
#define D_P52_REV() P52 = ~P52
#define D_P51_REV() P51 = ~P51
#define D_P50_REV() P50 = ~P50
#define D_P67_ON() P67 = 1
#define D_P66_ON() P66 = 1
#define D_P65_ON() P65 = 1
#define D_P64_ON() P64 = 1
#define D_P63_ON() P63 = 1
#define D_P62_ON() P62 = 1
#define D_P61_ON() P61 = 1
#define D_P60_ON() P60 = 1
#define D_P67_OFF() P67 = 0
#define D_P66_OFF() P66 = 0
#define D_P65_OFF() P65 = 0
#define D_P64_OFF() P64 = 0
#define D_P63_OFF() P63 = 0
#define D_P62_OFF() P62 = 0
#define D_P61_OFF() P61 = 0
#define D_P60_OFF() P60 = 0
#define D_P67_AT() (P67)
#define D_P66_AT() (P66)
#define D_P65_AT() (P65)
#define D_P64_AT() (P64)
#define D_P63_AT() (P63)
#define D_P62_AT() (P62)
#define D_P61_AT() (P61)
#define D_P60_AT() (P60)
#define D_P67_REV() P67 = ~P67
#define D_P66_REV() P66 = ~P66
#define D_P65_REV() P65 = ~P65
#define D_P64_REV() P64 = ~P64
#define D_P63_REV() P63 = ~P63
#define D_P62_REV() P62 = ~P62
#define D_P61_REV() P61 = ~P61
#define D_P60_REV() P60 = ~P60
#define D_P77_ON() P77 = 1
#define D_P76_ON() P76 = 1
#define D_P75_ON() P75 = 1
#define D_P74_ON() P74 = 1
#define D_P73_ON() P73 = 1
#define D_P72_ON() P72 = 1
#define D_P71_ON() P71 = 1
#define D_P70_ON() P70 = 1
#define D_P77_OFF() P77 = 0
#define D_P76_OFF() P76 = 0
#define D_P75_OFF() P75 = 0
#define D_P74_OFF() P74 = 0
#define D_P73_OFF() P73 = 0
#define D_P72_OFF() P72 = 0
#define D_P71_OFF() P71 = 0
#define D_P70_OFF() P70 = 0
#define D_P77_AT() (P77)
#define D_P76_AT() (P76)
#define D_P75_AT() (P75)
#define D_P74_AT() (P74)
#define D_P73_AT() (P73)
#define D_P72_AT() (P72)
#define D_P71_AT() (P71)
#define D_P70_AT() (P70)
#define D_P77_REV() P77 = ~P77
#define D_P76_REV() P76 = ~P76
#define D_P75_REV() P75 = ~P75
#define D_P74_REV() P74 = ~P74
#define D_P73_REV() P73 = ~P73
#define D_P72_REV() P72 = ~P72
#define D_P71_REV() P71 = ~P71
#define D_P70_REV() P70 = ~P70
#endif //__C51_MACRO_H_