The reference manula says i can configure the STM32 GPIO as either Input pull-up or as Input-pull-down.
But i do not see any register which configures this. Can anybody clarify this.
Regards, Jawaad
Where did you look?
RM0008: Reference manual (Doc id: 13902) www.st.com/.../13902.pdf
The whole point of the Standard Peripheral Library is to save you having to worry about the details of individual registers.
I would suggest that you start by using the Standard Peripheral Library - so that you can gain an understanding of how the chip as a whole works.
Once you have that basic understanding, then you can start delving into the inner details of the registers if you still find it necessary...
Note that the Standard Peripheral Library is provided as source code - so you can see what registers it uses, and how...
This is a bit tricky I grant you that, but the answer is p148 (table 18) of the manual. To use those pull-up or pull-down resitance you in fact have to clear/set the OUTPUT data register of your port. It makes sense if you look a at the schematic of the I/O port. I agree that it should be put more clearly but this trick is used on many micro-controller so the manual just assumes you know that.
Oh and by the way a google search would have put you on the tracks.
Many thanks Loup
And i would like to add that STM32_Init.c (Configuration wizard) is not taking care of this.
Should it?
"The whole point of the Standard Peripheral Library is to save you having to worry about the details of individual registers..."
Two things:
- I would think twice before trying to confront Andrew on anything regarding embedded system. - You really ouhgt to learn how to search on the internet for things you don't know about. By typing "ST's Standard Peripheral Library" in your favorite Web search engin, you would have eventually hit this page : www.st.com/.../stm32f10x_stdperiph_lib.zip
You should find the drivers you need in here.
Easy guys easy… I was not trying to confront nobody...
My apologies to Andrew. I happen to find the lib after Andrew highlighted it. I was just comparing the two styles of ST and recommend my team to use the lib to cover the missing things in STM32_Init.c
And secondly I mentioned about STM32_Init, so that anybody would correct me if it does support the said feature.
Your inputs expedited the development process...
I thank again Andrew and Loup for their support.
What "Configuration wizard" are you talking about - Keil's, or something from ST?
Keil's
"The Configuration Wizard is an integrated editor utility to configure assembler, C/C++, or initialization files through graphical controls."
http://www.keil.com/support/man/docs/uv4/uv4_ut_configwizard.htm
This has to do with the compiler startup code - not your application's own initialisation.