u8 LCD_Data_I(void) { u8 i; i=0; if(GPIO_ReadInputDataBit(DB0)) i |= 0x01; if(GPIO_ReadInputDataBit(DB1)) i |= 0x02; if(GPIO_ReadInputDataBit(DB2)) i |= 0x04; if(GPIO_ReadInputDataBit(DB3)) i |= 0x08; if(GPIO_ReadInputDataBit(DB4)) i |= 0x10; if(GPIO_ReadInputDataBit(DB5)) i |= 0x20; if(GPIO_ReadInputDataBit(DB6)) i |= 0x40; if(GPIO_ReadInputDataBit(DB7)) i |= 0x80;
7.1.8 Output configuration When the I/O Port is programmed as Output: ● The Output Buffer is enabled: – Open Drain Mode: A “0” in the Output register activates the N-MOS while a “1” in the Output register leaves the port in Hi-Z. (the P-MOS is never activated) – Push-Pull Mode: A “0” in the Output register activates the N-MOS while a “1” in the Output register activates the P-MOS. ● The Schmitt Trigger Input is activated. ● The weak pull-up and pull-down resistors are disabled. ● ● ● The data present on the I/O pin is sampled into the Input Data Register every APB2 clock cycle ● A read access to the Input Data Register gets the I/O state in open drain mode ● A read access to the Output Data register gets the last written value in Push-Pull mode