I will use L476RG to connect with a battery power board, battery board will use two Gpio ports to ONLY send out info, such as battery is full, battery is in charge, and so on, now the question is, in STM32CubeMX, shall I set those two Gpio ports as input or output status? Also in Hal function HAL_GPIO_ReadPin(..), what is value I could get? in battery manual I should read blinking 2.5Hz and 0.5 Hz, high and low 4 status. Thanks
Inputs and outputs always imply from the point of view of the MCU.
Set the pin to input if the signal is generated by the other component.
Set the pin to output if the signal is to be generated by the MCU.
Read carefully the General-purpose I/Os (GPIO) chapter in the reference manual, and also these posts before setting input/output modes if you don't want to damage components.