GPIO_0 PIN5 as INPUT and OUTPUT in the same section

3文章/ 0
Last post
yassin.bennaceur
Offline
Last seen:5 years 6 months ago
乔ined:2015-04-10 15:32
GPIO_0 PIN5 as INPUT and OUTPUT in the same section

I am implementing a driver for a motion sensor which communicates on a single wire communication (GPIO)

I need to set the pin high and low for certain systick values then read one bit sent by the sensor, and the process is about doing this in a loop until the 32 bits are all sent from the sensor.

Is this doable, I mean setting the pin out put set it high and then low, and immediately set it input and read out the state ?

RvA
Offline
Last seen:4 days 21 hours ago
Staff
乔ined:2014-02-07 14:10
Hi Yassin,

Hi Yassin,

Yes this is doable. I have heard of a project where one-wire communication has been used for control. I will try to get some more details on this. regarding the switching of a GPIO from GPO to GPI I do not have details, but you can alsways try in your code to see if the timing will fit the requirements of your sensor.

Best regards, RvA

yassin.bennaceur
Offline
Last seen:5 years 6 months ago
乔ined:2015-04-10 15:32
Thanks. Yes I made it work

Thanks. Yes I made it work but I had to write directly to registers to speed up the communication and the switching as fast as possible.