Interfacing a four wire resistive touch screen with STM32F429DISCOVERY
On the STM32F429 Discovery board, PA1 and PA2 are directly connected to the interrupt outputs of the L3GD20 motion sensor chip, which are by default active high. That means, they should output a logic low signal until some (programmable) event occurs. Which, as the part is presumably not initialised, never happens.

The X+ and X- pins of a resistive touchscreen are connected with a resistor, typically with a value below 1kΩ. Connecting X+ to PA0 and X- to a low-level output effectively created a 1kΩ pulldown on PA0.

PA0 is connected to ground through a 220k pulldown resistor (part of the debouncing circuit of the blue pushbutton) on the discovery board as well, so it's not a great choice for an analog connection either.

You can free up PA0 by cutting a solder bridge somewhere, but PA1 and PA2 are apparently directly wired to the motion sensor.

You should consult the User Manual of your board and find 4 unused pins, two of them must be usable as ADC channels. Unfortunately the onboard LCD takes up most of the ADC pins, but there are a few left, namely PA5, PC3, and PF6. Pick two of them for the analog-digital conversion, and find two unused pins for the other two terminals. Opening the predefined STM32F429-Discovery project in STM32CubeMX is perhaps the simplest way to find the usable pins.