AnsweredAssumed Answered

A stupid question about GPIO input mode

Question asked by yao.randy.001 on Jun 7, 2014
Latest reply on Jun 7, 2014 by Clive One
Hi ST,

I'm using ST32F4Discovery board, and I want to read a 4 bit data that is continuously streaming in. I'm thinking of doing:

1. set GPIO port for the input (say PA10)
2. call this function to read data: GPIO_ReadInputDataBit(GPIOA, GPIO_PIN_10)

Would this work?

Also, i just wanted to ask how can you even use the function GPIO_ReadInputData (in the GPIO library) if it has no pin# as input parameter?

uint8_t GPIO_ReadInputDataBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
uint16_t GPIO_ReadInputData(GPIO_TypeDef* GPIOx);

Also, is there a way to do this in DMA mode? read input 4-bit data and go straight into memory.

Outcomes