Search code examples
c++cameraembeddedstm32tri-state-logic

Tri-Stating SAI1_SDA for stm32439i-eval2


I am trying to tri-state the SAI1-SDA on my stm32439i-eval2 board in order to try and make my ov2640 camera work. To do this, I need to set bit 13 (address 0x300) to 1 on the wm8994 audio chip. I am struggling with this. If anyone could help me either vaguely or specifically that would be great.


Solution

  • Your question is unclear (what's SAI1-SDA?), but if you want to make a pin in an STM32 microcontroller behave like a tri-state pin, here's what you have to do:

    • To output 0 or 1, configure the GPIO as a push-pull output (using the GPIO_Init() standard firmware library call) and then reset or set, respectively, the GPIO using GPIO_ResetBits() and GPIO_SetBits().
    • To put the pin into a high-impedance state, just configure it as a floating input.