cancel
Showing results for 
Search instead for 
Did you mean: 

Programatically reading the state of a GPIO Output Pin.

Pevy.Andy
Associate III
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
1 REPLY 1
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