2018-12-15 05:26 PM
I'm trying to do something similar to what have been covered by the application note AN4666 "Parallel synchronous transmission using GPIO and DMA" but now I'm testing without DMA functionality. Right now, I can write/send data to GPIO port using:
GPIOC->ODR = DataBuf[i];
But when I need to read data back, can I use the following:
ReadBuf[i] = GPIOC->IDR;
without any modification to the GPIO Port configurations, or I need to re-configure the post as "INPUT" before I can read data? If port is configured as "OUTPUT OD", can I read the GPIO as stated earlier?
2018-12-15 06:27 PM
Well you can read back what it sees externally, which should be what you've written unless you have other devices attached which are conflicting/fighting with the levels you are asserting.
If you have other things driving that you want to read, you should put the mode of the pin to input.
2018-12-15 06:38 PM
Yes, I have a device attached to lowest 8-bits of GPIOC, so basically I want to read what the device sends over to the port and not values asserted by me. So, it has to be configured as input before reading the port.