ble

Dependencies:   HC_SR04_Ultrasonic_Library Servo mbed

Fork of FIP_REV1 by Robotique FIP

Committer:
julientiron
Date:
Thu Jul 09 13:33:36 2015 +0000
Revision:
4:69a35a56ac48
Parent:
0:3d641e170a74
BLE

Who changed what in which revision?

UserRevisionLine numberNew contents of line
julientiron 0:3d641e170a74 1 /**
julientiron 0:3d641e170a74 2 ******************************************************************************
julientiron 0:3d641e170a74 3 * @file stm32f4xx_nucleo.h
julientiron 0:3d641e170a74 4 * @author MCD Application Team
julientiron 0:3d641e170a74 5 * @version V1.0.0
julientiron 0:3d641e170a74 6 * @date 18-February-2014
julientiron 0:3d641e170a74 7 * @brief This file contains definitions for STM32F4xx-Nucleo Kit's Leds and
julientiron 0:3d641e170a74 8 * push-button hardware resources.
julientiron 0:3d641e170a74 9 ******************************************************************************
julientiron 0:3d641e170a74 10 * @attention
julientiron 0:3d641e170a74 11 *
julientiron 0:3d641e170a74 12 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
julientiron 0:3d641e170a74 13 *
julientiron 0:3d641e170a74 14 * Redistribution and use in source and binary forms, with or without modification,
julientiron 0:3d641e170a74 15 * are permitted provided that the following conditions are met:
julientiron 0:3d641e170a74 16 * 1. Redistributions of source code must retain the above copyright notice,
julientiron 0:3d641e170a74 17 * this list of conditions and the following disclaimer.
julientiron 0:3d641e170a74 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
julientiron 0:3d641e170a74 19 * this list of conditions and the following disclaimer in the documentation
julientiron 0:3d641e170a74 20 * and/or other materials provided with the distribution.
julientiron 0:3d641e170a74 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
julientiron 0:3d641e170a74 22 * may be used to endorse or promote products derived from this software
julientiron 0:3d641e170a74 23 * without specific prior written permission.
julientiron 0:3d641e170a74 24 *
julientiron 0:3d641e170a74 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
julientiron 0:3d641e170a74 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
julientiron 0:3d641e170a74 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
julientiron 0:3d641e170a74 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
julientiron 0:3d641e170a74 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
julientiron 0:3d641e170a74 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
julientiron 0:3d641e170a74 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
julientiron 0:3d641e170a74 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
julientiron 0:3d641e170a74 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
julientiron 0:3d641e170a74 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
julientiron 0:3d641e170a74 35 *
julientiron 0:3d641e170a74 36 ******************************************************************************
julientiron 0:3d641e170a74 37 */
julientiron 0:3d641e170a74 38
julientiron 0:3d641e170a74 39 /* Define to prevent recursive inclusion -------------------------------------*/
julientiron 0:3d641e170a74 40 #ifndef __STM32F4XX_NUCLEO_H
julientiron 0:3d641e170a74 41 #define __STM32F4XX_NUCLEO_H
julientiron 0:3d641e170a74 42
julientiron 0:3d641e170a74 43 #ifdef __cplusplus
julientiron 0:3d641e170a74 44 extern "C" {
julientiron 0:3d641e170a74 45 #endif
julientiron 0:3d641e170a74 46
julientiron 0:3d641e170a74 47 /* Includes ------------------------------------------------------------------*/
julientiron 0:3d641e170a74 48 #include "stm32f4xx_hal.h"
julientiron 0:3d641e170a74 49
julientiron 0:3d641e170a74 50 /** @addtogroup BSP
julientiron 0:3d641e170a74 51 * @{
julientiron 0:3d641e170a74 52 */
julientiron 0:3d641e170a74 53
julientiron 0:3d641e170a74 54 /** @addtogroup STM32F4XX_NUCLEO
julientiron 0:3d641e170a74 55 * @{
julientiron 0:3d641e170a74 56 */
julientiron 0:3d641e170a74 57
julientiron 0:3d641e170a74 58 /** @addtogroup STM32F4XX_NUCLEO_LOW_LEVEL
julientiron 0:3d641e170a74 59 * @{
julientiron 0:3d641e170a74 60 */
julientiron 0:3d641e170a74 61
julientiron 0:3d641e170a74 62 /** @defgroup STM32F4XX_NUCLEO_LOW_LEVEL_Exported_Types STM32F4XX_NUCLEO_LOW_LEVEL_Exported_Types
julientiron 0:3d641e170a74 63 * @{
julientiron 0:3d641e170a74 64 */
julientiron 0:3d641e170a74 65 typedef enum
julientiron 0:3d641e170a74 66 {
julientiron 0:3d641e170a74 67 F4_LED2 = 0
julientiron 0:3d641e170a74 68 } Led_TypeDef;
julientiron 0:3d641e170a74 69
julientiron 0:3d641e170a74 70 typedef enum
julientiron 0:3d641e170a74 71 {
julientiron 0:3d641e170a74 72 BUTTON_KEY = 0,
julientiron 0:3d641e170a74 73 } Button_TypeDef;
julientiron 0:3d641e170a74 74
julientiron 0:3d641e170a74 75 typedef enum
julientiron 0:3d641e170a74 76 {
julientiron 0:3d641e170a74 77 BUTTON_MODE_GPIO = 0,
julientiron 0:3d641e170a74 78 BUTTON_MODE_EXTI = 1
julientiron 0:3d641e170a74 79 } ButtonMode_TypeDef;
julientiron 0:3d641e170a74 80
julientiron 0:3d641e170a74 81 /**
julientiron 0:3d641e170a74 82 * @}
julientiron 0:3d641e170a74 83 */
julientiron 0:3d641e170a74 84
julientiron 0:3d641e170a74 85 /** @defgroup STM32F4XX_NUCLEO_LOW_LEVEL_Exported_Constants STM32F4XX_NUCLEO_LOW_LEVEL_Exported_Constants
julientiron 0:3d641e170a74 86 * @{
julientiron 0:3d641e170a74 87 */
julientiron 0:3d641e170a74 88
julientiron 0:3d641e170a74 89 /**
julientiron 0:3d641e170a74 90 * @brief Define for STM32F4XX_NUCLEO board
julientiron 0:3d641e170a74 91 */
julientiron 0:3d641e170a74 92 #if !defined (USE_STM32F4XX_NUCLEO)
julientiron 0:3d641e170a74 93 #define USE_STM32F4XX_NUCLEO
julientiron 0:3d641e170a74 94 #endif
julientiron 0:3d641e170a74 95
julientiron 0:3d641e170a74 96 /** @addtogroup STM32F4XX_NUCLEO_LOW_LEVEL_LED
julientiron 0:3d641e170a74 97 * @{
julientiron 0:3d641e170a74 98 */
julientiron 0:3d641e170a74 99 #define LEDn 1
julientiron 0:3d641e170a74 100
julientiron 0:3d641e170a74 101 #define LED2_PIN GPIO_PIN_5
julientiron 0:3d641e170a74 102 #define LED2_GPIO_PORT GPIOA
julientiron 0:3d641e170a74 103 #define LED2_GPIO_CLK_ENABLE() __GPIOA_CLK_ENABLE()
julientiron 0:3d641e170a74 104 #define LED2_GPIO_CLK_DISABLE() __GPIOA_CLK_DISABLE()
julientiron 0:3d641e170a74 105
julientiron 0:3d641e170a74 106 #define LEDx_GPIO_CLK_ENABLE(__INDEX__) (((__INDEX__) == 0) ? LED2_GPIO_CLK_ENABLE() : 0)
julientiron 0:3d641e170a74 107 #define LEDx_GPIO_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? LED2_GPIO_CLK_DISABLE() : 0)
julientiron 0:3d641e170a74 108 /**
julientiron 0:3d641e170a74 109 * @}
julientiron 0:3d641e170a74 110 */
julientiron 0:3d641e170a74 111
julientiron 0:3d641e170a74 112 /** @addtogroup STM32F4XX_NUCLEO_LOW_LEVEL_BUTTON
julientiron 0:3d641e170a74 113 * @{
julientiron 0:3d641e170a74 114 */
julientiron 0:3d641e170a74 115 #define BUTTONn 1
julientiron 0:3d641e170a74 116
julientiron 0:3d641e170a74 117 /**
julientiron 0:3d641e170a74 118 * @brief Wakeup push-button
julientiron 0:3d641e170a74 119 */
julientiron 0:3d641e170a74 120 #define KEY_BUTTON_PIN GPIO_PIN_13
julientiron 0:3d641e170a74 121 #define KEY_BUTTON_GPIO_PORT GPIOC
julientiron 0:3d641e170a74 122 #define KEY_BUTTON_GPIO_CLK_ENABLE() __GPIOC_CLK_ENABLE()
julientiron 0:3d641e170a74 123 #define KEY_BUTTON_GPIO_CLK_DISABLE() __GPIOC_CLK_DISABLE()
julientiron 0:3d641e170a74 124 #define KEY_BUTTON_EXTI_IRQn EXTI15_10_IRQn
julientiron 0:3d641e170a74 125
julientiron 0:3d641e170a74 126 #define BUTTONx_GPIO_CLK_ENABLE(__INDEX__) (((__INDEX__) == 0) ? KEY_BUTTON_GPIO_CLK_ENABLE() : 0)
julientiron 0:3d641e170a74 127 #define BUTTONx_GPIO_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? KEY_BUTTON_GPIO_CLK_DISABLE() : 0)
julientiron 0:3d641e170a74 128 /**
julientiron 0:3d641e170a74 129 * @}
julientiron 0:3d641e170a74 130 */
julientiron 0:3d641e170a74 131
julientiron 0:3d641e170a74 132 /** @addtogroup STM32F4XX_NUCLEO_LOW_LEVEL_BUS
julientiron 0:3d641e170a74 133 * @{
julientiron 0:3d641e170a74 134 */
julientiron 0:3d641e170a74 135
julientiron 0:3d641e170a74 136 /**
julientiron 0:3d641e170a74 137 * @}
julientiron 0:3d641e170a74 138 */
julientiron 0:3d641e170a74 139
julientiron 0:3d641e170a74 140 /** @defgroup STM32F4XX_NUCLEO_LOW_LEVEL_Exported_Macros STM32F4XX_NUCLEO_LOW_LEVEL_Exported_Macros
julientiron 0:3d641e170a74 141 * @{
julientiron 0:3d641e170a74 142 */
julientiron 0:3d641e170a74 143 /**
julientiron 0:3d641e170a74 144 * @}
julientiron 0:3d641e170a74 145 */
julientiron 0:3d641e170a74 146
julientiron 0:3d641e170a74 147
julientiron 0:3d641e170a74 148 /** @defgroup STM32F4XX_NUCLEO_LOW_LEVEL_Exported_Functions STM32F4XX_NUCLEO_LOW_LEVEL_Exported_Functions
julientiron 0:3d641e170a74 149 * @{
julientiron 0:3d641e170a74 150 */
julientiron 0:3d641e170a74 151 uint32_t BSP_GetVersion(void);
julientiron 0:3d641e170a74 152 void BSP_LED_Init(Led_TypeDef Led);
julientiron 0:3d641e170a74 153 void BSP_LED_On(Led_TypeDef Led);
julientiron 0:3d641e170a74 154 void BSP_LED_Off(Led_TypeDef Led);
julientiron 0:3d641e170a74 155 void BSP_LED_Toggle(Led_TypeDef Led);
julientiron 0:3d641e170a74 156 void BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode);
julientiron 0:3d641e170a74 157 uint32_t BSP_PB_GetState(Button_TypeDef Button);
julientiron 0:3d641e170a74 158
julientiron 0:3d641e170a74 159 /**
julientiron 0:3d641e170a74 160 * @}
julientiron 0:3d641e170a74 161 */
julientiron 0:3d641e170a74 162
julientiron 0:3d641e170a74 163 #ifdef __cplusplus
julientiron 0:3d641e170a74 164 }
julientiron 0:3d641e170a74 165 #endif
julientiron 0:3d641e170a74 166
julientiron 0:3d641e170a74 167 #endif /* __STM32F4XX_NUCLEO_H */
julientiron 0:3d641e170a74 168 /**
julientiron 0:3d641e170a74 169 * @}
julientiron 0:3d641e170a74 170 */
julientiron 0:3d641e170a74 171
julientiron 0:3d641e170a74 172 /**
julientiron 0:3d641e170a74 173 * @}
julientiron 0:3d641e170a74 174 */
julientiron 0:3d641e170a74 175
julientiron 0:3d641e170a74 176 /**
julientiron 0:3d641e170a74 177 * @}
julientiron 0:3d641e170a74 178 */
julientiron 0:3d641e170a74 179
julientiron 0:3d641e170a74 180 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
julientiron 0:3d641e170a74 181