cancel
Showing results for 
Search instead for 
Did you mean: 

SImple question #ifndef __STM32F100_Dicovery_H

xtian
Associate II
Posted on January 18, 2013 at 02:11

what is this for

/**

  ******************************************************************************

  * @file    STM32vldiscovery.h

  * @author  MCD Application Team

  * @version V1.0.0

  * @date    09/13/2010

  * @brief   Header file for STM32vldiscovery.c module.

  ******************************************************************************

  * @copy

  *

  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS

  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE

  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY

  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING

  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE

  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.

  *

  * <h2><center>&copy; COPYRIGHT 2010 STMicroelectronics</center></h2>

  */

 

/* Define to prevent recursive inclusion -------------------------------------*/

 

&sharpifndef __STM32F100_Dicovery_H

 

&sharpdefine __STM32F100_Dicovery_H

//this one, is see this in every header... what is their function?

&sharpifdef __cplusplus

 extern ''C'' {

&sharpendif

/* Includes ------------------------------------------------------------------*/

&sharpinclude ''STM32f10x.h''

/** @addtogroup Utilities

  * @{

  */

 

/** @addtogroup STM32vldiscovery

#new-question-=-new-thread #include-guard #include-guard #include-guard #learning-c
11 REPLIES 11
xtian
Associate II
Posted on January 18, 2013 at 16:41

thanks guys for your help.. additional question

/* GPIOA Periph clock enable */

  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);

  /* Configure PA0 .. PA7 in output pushpull mode */

  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7;

  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;

  GPIO_Init(GPIOA, &GPIO_InitStructure);

  /* Configure PA8 .. PA15 in input, pulled up mode */

  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15;

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;

  GPIO_Init(GPIOA, &GPIO_InitStructure);

  GPIOA->ODR = GPIOA->IDR >> 8; // Mirror high ordered inputs to low ordered outputs

could you explain to me the bold one especially ''8'' and IDR

Posted on January 18, 2013 at 16:58

You should start a new thread for a new question - otherwise the thread title becomes meaningless, and it all gets very confusing...