Skip to main content
Pevy.Andy
Associate III
June 16, 2015
Question

Programatically reading the state of a GPIO Output Pin.

  • June 16, 2015
  • 1 reply
  • 1251 views
Posted on June 16, 2015 at 10:45

Hi,  I want to use the state of a GPIO Pin (It is driving a chip select on an SPI device) to determine that the SPI transfer has completed. I do know about the callback on the CMSIS code, but I'd prefer not to use that.

So, can I read the state of the actual H/W Pin when I have that pin set to Output mode ?.

Thanks,

Andy

#stm32-cmsis
    This topic has been closed for replies.

    1 reply

    waclawek.jan
    Super User
    June 16, 2015
    Posted on June 16, 2015 at 11:37

    As the fine manual states (this one is from RM0008 for STM32F1xx, but I doubt others will be different - check yours):

     

    When the I/O Port is programmed as Output:

     

    [...]

     

    The data present on the I/O pin is sampled into the Input Data Register every APB2

     

    clock cycle

    This has nothing to do with CMSIS.

    JW