2024-12-09 11:59 AM
Hi,
I'm trying to read an LCD 8 bits information, so I need to quickly change PA0 ~ PA7 to input, then read the IDR register, and return them to output after reading the 8 bit bus, but I need help.
Thank you all.
2024-12-09 12:42 PM
Define macros, than call when necessary.
#define setWriteDir() { setReadDir(); \
GPIOA->MODER |= 0x150000; GPIOB->MODER |= 0x100540; GPIOC->MODER |= 0x4000; }
#define setReadDir() { GPIOA->MODER &= ~0x3F0000; GPIOB->MODER &= ~0x300FC0; GPIOC->MODER &= ~0xC000; }