//PC1<-->ERR
//PC2<-->COMM
//PC3<-->RUN
//PB10<-->UART3_TX
//PB11<-->UART3_RX
//PA4<-->DAC_OUT1
//PA5<-->DAC_OUT2
//ADC1_6<-->PA6
//ADC1_7<-->PA7
//ADC1_8<-->PB0
//ADC1_9<-->PB1
enum PLCTYPEStatus
{
MON=0,FX1S, FX1N,FX2N
};
char PLCTYPE=FX2N;
#define brd 19200
//#define brd 9600
//#define PLCTYPE 0X6662//FX1N
//#define PLCTYPE 0X5EF6
//#define PLCTYPE 0X56C2//FX1S
#define XX00 (GPIOA->IDR &GPIO;_Pin_0)//PA0
#define XX01 (GPIOA->IDR &GPIO;_Pin_1)//PA1
#define XX02 (GPIOC->IDR &GPIO;_Pin_5)//PC5
#define XX03 (GPIOC->IDR &GPIO;_Pin_6)//PC6
#define XX04 (GPIOC->IDR &GPIO;_Pin_7)//PC7
#define XX05 (GPIOC->IDR &GPIO;_Pin_4)//PC4
#define XX06 (GPIOA->IDR &GPIO;_Pin_14)//PA14
#define XX07 (GPIOA->IDR &GPIO;_Pin_13)//PA13
#define XX10 (GPIOA->IDR &GPIO;_Pin_11)//PA11
#define XX11 (GPIOA->IDR &GPIO;_Pin_8)//PA8
#define XX12 (GPIOC->IDR &GPIO;_Pin_9)//PC9
#define XX13 (GPIOD->IDR &GPIO;_Pin_15)//PD15
#define XX14 (GPIOD->IDR &GPIO;_Pin_14)//PD14
#define XX15 (GPIOD->IDR &GPIO;_Pin_13)//PD13
#define XX16 (GPIOD->IDR &GPIO;_Pin_12)//PD12
#define XX17 (GPIOD->IDR &GPIO;_Pin_11)//PD11
#define XX20 (GPIOD->IDR &GPIO;_Pin_10//PD10
#define XX21 (GPIOD->IDR &GPIO;_Pin_9)//PD9
#define XX22 (GPIOD->IDR &GPIO;_Pin_8)//PD8
#define XX23 (GPIOB->IDR &GPIO;_Pin_15)//PB15
#define XX24 (GPIOB->IDR &GPIO;_Pin_14)//PB14
#define XX25 (GPIOB->IDR &GPIO;_Pin_13)//PB13
#define XX26 (GPIOE->IDR &GPIO;_Pin_15)//PE15
#define XX27 (GPIOE->IDR &GPIO;_Pin_10)//PE10
#define XX30 (GPIOE->IDR &GPIO;_Pin_14)//PE14
#define XX31 (GPIOE->IDR &GPIO;_Pin_11)//PE11
#define XX32 (GPIOE->IDR &GPIO;_Pin_13)//PE13
#define XX33 (GPIOE->IDR &GPIO;_Pin_12)//PE12
#define XX34 (GPIOB->IDR &GPIO;_Pin_12)//PB12<-->RUN_SW
#define XX35 (GPIOE->IDR &GPIO;_Pin_7)//PE7<-->POWER DETECT
//YY00<-->PA2
//YY01<-->PC8
//YY02<-->PA15
//YY03<-->PC10
//YY04<-->PC11
//YY05<-->PC12
//YY06<-->PD0
//YY07<-->PD1
//YY10<-->PD3
//YY11<-->PD4
//YY12<-->PD5
//YY13<-->PD6
//YY14<-->PD7
//YY15<-->PB3
//YY16<-->PB4
//YY17<-->PB5
//YY20<-->PB6
//YY21<-->PB7
//YY22<-->PE1
//YY23<-->PE2
//YY24<-->PE3
//YY25<-->PE4
//YY26<-->PE5
//YY27<-->PE6
1