Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: STM32F3-Discovery
stm32f3_discovery.h@0:404dae88af71, 2016-03-01 (annotated)
- Committer:
- MartinJohnson
- Date:
- Tue Mar 01 02:40:19 2016 +0000
- Revision:
- 0:404dae88af71
space invaders game
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| MartinJohnson | 0:404dae88af71 | 1 | /** |
| MartinJohnson | 0:404dae88af71 | 2 | ****************************************************************************** |
| MartinJohnson | 0:404dae88af71 | 3 | * @file stm32f3_discovery.h |
| MartinJohnson | 0:404dae88af71 | 4 | * @author MCD Application Team |
| MartinJohnson | 0:404dae88af71 | 5 | * @version V1.1.0 |
| MartinJohnson | 0:404dae88af71 | 6 | * @date 20-September-2012 |
| MartinJohnson | 0:404dae88af71 | 7 | * @brief This file contains definitions for STM32F3-Discovery's Leds, push- |
| MartinJohnson | 0:404dae88af71 | 8 | * buttons hardware resources. |
| MartinJohnson | 0:404dae88af71 | 9 | ****************************************************************************** |
| MartinJohnson | 0:404dae88af71 | 10 | * @attention |
| MartinJohnson | 0:404dae88af71 | 11 | * |
| MartinJohnson | 0:404dae88af71 | 12 | * <h2><center>© COPYRIGHT 2012 STMicroelectronics</center></h2> |
| MartinJohnson | 0:404dae88af71 | 13 | * |
| MartinJohnson | 0:404dae88af71 | 14 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); |
| MartinJohnson | 0:404dae88af71 | 15 | * You may not use this file except in compliance with the License. |
| MartinJohnson | 0:404dae88af71 | 16 | * You may obtain a copy of the License at: |
| MartinJohnson | 0:404dae88af71 | 17 | * |
| MartinJohnson | 0:404dae88af71 | 18 | * http://www.st.com/software_license_agreement_liberty_v2 |
| MartinJohnson | 0:404dae88af71 | 19 | * |
| MartinJohnson | 0:404dae88af71 | 20 | * Unless required by applicable law or agreed to in writing, software |
| MartinJohnson | 0:404dae88af71 | 21 | * distributed under the License is distributed on an "AS IS" BASIS, |
| MartinJohnson | 0:404dae88af71 | 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| MartinJohnson | 0:404dae88af71 | 23 | * See the License for the specific language governing permissions and |
| MartinJohnson | 0:404dae88af71 | 24 | * limitations under the License. |
| MartinJohnson | 0:404dae88af71 | 25 | * |
| MartinJohnson | 0:404dae88af71 | 26 | ****************************************************************************** |
| MartinJohnson | 0:404dae88af71 | 27 | */ |
| MartinJohnson | 0:404dae88af71 | 28 | |
| MartinJohnson | 0:404dae88af71 | 29 | /* Define to prevent recursive inclusion -------------------------------------*/ |
| MartinJohnson | 0:404dae88af71 | 30 | #ifndef __STM32F3_DISCOVERY_H |
| MartinJohnson | 0:404dae88af71 | 31 | #define __STM32F3_DISCOVERY_H |
| MartinJohnson | 0:404dae88af71 | 32 | |
| MartinJohnson | 0:404dae88af71 | 33 | #ifdef __cplusplus |
| MartinJohnson | 0:404dae88af71 | 34 | extern "C" { |
| MartinJohnson | 0:404dae88af71 | 35 | #endif |
| MartinJohnson | 0:404dae88af71 | 36 | |
| MartinJohnson | 0:404dae88af71 | 37 | /* Includes ------------------------------------------------------------------*/ |
| MartinJohnson | 0:404dae88af71 | 38 | #include "stm32f30x.h" |
| MartinJohnson | 0:404dae88af71 | 39 | |
| MartinJohnson | 0:404dae88af71 | 40 | /** @addtogroup Utilities |
| MartinJohnson | 0:404dae88af71 | 41 | * @{ |
| MartinJohnson | 0:404dae88af71 | 42 | */ |
| MartinJohnson | 0:404dae88af71 | 43 | |
| MartinJohnson | 0:404dae88af71 | 44 | /** @addtogroup STM32F3_DISCOVERY |
| MartinJohnson | 0:404dae88af71 | 45 | * @{ |
| MartinJohnson | 0:404dae88af71 | 46 | */ |
| MartinJohnson | 0:404dae88af71 | 47 | |
| MartinJohnson | 0:404dae88af71 | 48 | /** @addtogroup STM32F3_DISCOVERY_LOW_LEVEL |
| MartinJohnson | 0:404dae88af71 | 49 | * @{ |
| MartinJohnson | 0:404dae88af71 | 50 | */ |
| MartinJohnson | 0:404dae88af71 | 51 | |
| MartinJohnson | 0:404dae88af71 | 52 | /** @defgroup STM32F3_DISCOVERY_LOW_LEVEL_Exported_Types |
| MartinJohnson | 0:404dae88af71 | 53 | * @{ |
| MartinJohnson | 0:404dae88af71 | 54 | */ |
| MartinJohnson | 0:404dae88af71 | 55 | typedef enum |
| MartinJohnson | 0:404dae88af71 | 56 | { |
| MartinJohnson | 0:404dae88af71 | 57 | LED3 = 0, |
| MartinJohnson | 0:404dae88af71 | 58 | LED4 = 1, |
| MartinJohnson | 0:404dae88af71 | 59 | LED5 = 2, |
| MartinJohnson | 0:404dae88af71 | 60 | LED6 = 3, |
| MartinJohnson | 0:404dae88af71 | 61 | LED7 = 4, |
| MartinJohnson | 0:404dae88af71 | 62 | LED8 = 5, |
| MartinJohnson | 0:404dae88af71 | 63 | LED9 = 6, |
| MartinJohnson | 0:404dae88af71 | 64 | LED10 = 7 |
| MartinJohnson | 0:404dae88af71 | 65 | } Led_TypeDef; |
| MartinJohnson | 0:404dae88af71 | 66 | |
| MartinJohnson | 0:404dae88af71 | 67 | typedef enum |
| MartinJohnson | 0:404dae88af71 | 68 | { |
| MartinJohnson | 0:404dae88af71 | 69 | BUTTON_USER = 0, |
| MartinJohnson | 0:404dae88af71 | 70 | } Button_TypeDef; |
| MartinJohnson | 0:404dae88af71 | 71 | |
| MartinJohnson | 0:404dae88af71 | 72 | typedef enum |
| MartinJohnson | 0:404dae88af71 | 73 | { |
| MartinJohnson | 0:404dae88af71 | 74 | BUTTON_MODE_GPIO = 0, |
| MartinJohnson | 0:404dae88af71 | 75 | BUTTON_MODE_EXTI = 1 |
| MartinJohnson | 0:404dae88af71 | 76 | } ButtonMode_TypeDef; |
| MartinJohnson | 0:404dae88af71 | 77 | /** |
| MartinJohnson | 0:404dae88af71 | 78 | * @} |
| MartinJohnson | 0:404dae88af71 | 79 | */ |
| MartinJohnson | 0:404dae88af71 | 80 | |
| MartinJohnson | 0:404dae88af71 | 81 | /** @defgroup STM32F3_DISCOVERY_LOW_LEVEL_Exported_Constants |
| MartinJohnson | 0:404dae88af71 | 82 | * @{ |
| MartinJohnson | 0:404dae88af71 | 83 | */ |
| MartinJohnson | 0:404dae88af71 | 84 | |
| MartinJohnson | 0:404dae88af71 | 85 | /** @addtogroup STM32F3_DISCOVERY_LOW_LEVEL_LED |
| MartinJohnson | 0:404dae88af71 | 86 | * @{ |
| MartinJohnson | 0:404dae88af71 | 87 | */ |
| MartinJohnson | 0:404dae88af71 | 88 | #define LEDn 8 |
| MartinJohnson | 0:404dae88af71 | 89 | |
| MartinJohnson | 0:404dae88af71 | 90 | #define LED6_PIN GPIO_Pin_15 |
| MartinJohnson | 0:404dae88af71 | 91 | #define LED6_GPIO_PORT GPIOE |
| MartinJohnson | 0:404dae88af71 | 92 | #define LED6_GPIO_CLK RCC_AHBPeriph_GPIOE |
| MartinJohnson | 0:404dae88af71 | 93 | |
| MartinJohnson | 0:404dae88af71 | 94 | #define LED8_PIN GPIO_Pin_14 |
| MartinJohnson | 0:404dae88af71 | 95 | #define LED8_GPIO_PORT GPIOE |
| MartinJohnson | 0:404dae88af71 | 96 | #define LED8_GPIO_CLK RCC_AHBPeriph_GPIOE |
| MartinJohnson | 0:404dae88af71 | 97 | |
| MartinJohnson | 0:404dae88af71 | 98 | #define LED10_PIN GPIO_Pin_13 |
| MartinJohnson | 0:404dae88af71 | 99 | #define LED10_GPIO_PORT GPIOE |
| MartinJohnson | 0:404dae88af71 | 100 | #define LED10_GPIO_CLK RCC_AHBPeriph_GPIOE |
| MartinJohnson | 0:404dae88af71 | 101 | |
| MartinJohnson | 0:404dae88af71 | 102 | #define LED9_PIN GPIO_Pin_12 |
| MartinJohnson | 0:404dae88af71 | 103 | #define LED9_GPIO_PORT GPIOE |
| MartinJohnson | 0:404dae88af71 | 104 | #define LED9_GPIO_CLK RCC_AHBPeriph_GPIOE |
| MartinJohnson | 0:404dae88af71 | 105 | |
| MartinJohnson | 0:404dae88af71 | 106 | #define LED7_PIN GPIO_Pin_11 |
| MartinJohnson | 0:404dae88af71 | 107 | #define LED7_GPIO_PORT GPIOE |
| MartinJohnson | 0:404dae88af71 | 108 | #define LED7_GPIO_CLK RCC_AHBPeriph_GPIOE |
| MartinJohnson | 0:404dae88af71 | 109 | |
| MartinJohnson | 0:404dae88af71 | 110 | #define LED5_PIN GPIO_Pin_10 |
| MartinJohnson | 0:404dae88af71 | 111 | #define LED5_GPIO_PORT GPIOE |
| MartinJohnson | 0:404dae88af71 | 112 | #define LED5_GPIO_CLK RCC_AHBPeriph_GPIOE |
| MartinJohnson | 0:404dae88af71 | 113 | |
| MartinJohnson | 0:404dae88af71 | 114 | #define LED3_PIN GPIO_Pin_9 |
| MartinJohnson | 0:404dae88af71 | 115 | #define LED3_GPIO_PORT GPIOE |
| MartinJohnson | 0:404dae88af71 | 116 | #define LED3_GPIO_CLK RCC_AHBPeriph_GPIOE |
| MartinJohnson | 0:404dae88af71 | 117 | |
| MartinJohnson | 0:404dae88af71 | 118 | #define LED4_PIN GPIO_Pin_8 |
| MartinJohnson | 0:404dae88af71 | 119 | #define LED4_GPIO_PORT GPIOE |
| MartinJohnson | 0:404dae88af71 | 120 | #define LED4_GPIO_CLK RCC_AHBPeriph_GPIOE |
| MartinJohnson | 0:404dae88af71 | 121 | /** |
| MartinJohnson | 0:404dae88af71 | 122 | * @} |
| MartinJohnson | 0:404dae88af71 | 123 | */ |
| MartinJohnson | 0:404dae88af71 | 124 | |
| MartinJohnson | 0:404dae88af71 | 125 | /** @addtogroup STM32F3_DISCOVERY_LOW_LEVEL_BUTTON |
| MartinJohnson | 0:404dae88af71 | 126 | * @{ |
| MartinJohnson | 0:404dae88af71 | 127 | */ |
| MartinJohnson | 0:404dae88af71 | 128 | #define BUTTONn 1 |
| MartinJohnson | 0:404dae88af71 | 129 | |
| MartinJohnson | 0:404dae88af71 | 130 | /** |
| MartinJohnson | 0:404dae88af71 | 131 | * @brief Wakeup push-button |
| MartinJohnson | 0:404dae88af71 | 132 | */ |
| MartinJohnson | 0:404dae88af71 | 133 | #define USER_BUTTON_PIN GPIO_Pin_0 |
| MartinJohnson | 0:404dae88af71 | 134 | #define USER_BUTTON_GPIO_PORT GPIOA |
| MartinJohnson | 0:404dae88af71 | 135 | #define USER_BUTTON_GPIO_CLK RCC_AHBPeriph_GPIOA |
| MartinJohnson | 0:404dae88af71 | 136 | #define USER_BUTTON_EXTI_LINE EXTI_Line0 |
| MartinJohnson | 0:404dae88af71 | 137 | #define USER_BUTTON_EXTI_PORT_SOURCE EXTI_PortSourceGPIOA |
| MartinJohnson | 0:404dae88af71 | 138 | #define USER_BUTTON_EXTI_PIN_SOURCE EXTI_PinSource0 |
| MartinJohnson | 0:404dae88af71 | 139 | #define USER_BUTTON_EXTI_IRQn EXTI0_IRQn |
| MartinJohnson | 0:404dae88af71 | 140 | /** |
| MartinJohnson | 0:404dae88af71 | 141 | * @} |
| MartinJohnson | 0:404dae88af71 | 142 | */ |
| MartinJohnson | 0:404dae88af71 | 143 | |
| MartinJohnson | 0:404dae88af71 | 144 | /** @defgroup STM32F3_DISCOVERY_LOW_LEVEL_Exported_Macros |
| MartinJohnson | 0:404dae88af71 | 145 | * @{ |
| MartinJohnson | 0:404dae88af71 | 146 | */ |
| MartinJohnson | 0:404dae88af71 | 147 | /** |
| MartinJohnson | 0:404dae88af71 | 148 | * @} |
| MartinJohnson | 0:404dae88af71 | 149 | */ |
| MartinJohnson | 0:404dae88af71 | 150 | |
| MartinJohnson | 0:404dae88af71 | 151 | |
| MartinJohnson | 0:404dae88af71 | 152 | /** @defgroup STM32F3_DISCOVERY_LOW_LEVEL_Exported_Functions |
| MartinJohnson | 0:404dae88af71 | 153 | * @{ |
| MartinJohnson | 0:404dae88af71 | 154 | */ |
| MartinJohnson | 0:404dae88af71 | 155 | void STM_EVAL_LEDInit(Led_TypeDef Led); |
| MartinJohnson | 0:404dae88af71 | 156 | void STM_EVAL_LEDOn(Led_TypeDef Led); |
| MartinJohnson | 0:404dae88af71 | 157 | void STM_EVAL_LEDOff(Led_TypeDef Led); |
| MartinJohnson | 0:404dae88af71 | 158 | void STM_EVAL_LEDToggle(Led_TypeDef Led); |
| MartinJohnson | 0:404dae88af71 | 159 | void STM_EVAL_PBInit(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode); |
| MartinJohnson | 0:404dae88af71 | 160 | uint32_t STM_EVAL_PBGetState(Button_TypeDef Button); |
| MartinJohnson | 0:404dae88af71 | 161 | /** |
| MartinJohnson | 0:404dae88af71 | 162 | * @} |
| MartinJohnson | 0:404dae88af71 | 163 | */ |
| MartinJohnson | 0:404dae88af71 | 164 | |
| MartinJohnson | 0:404dae88af71 | 165 | #ifdef __cplusplus |
| MartinJohnson | 0:404dae88af71 | 166 | } |
| MartinJohnson | 0:404dae88af71 | 167 | #endif |
| MartinJohnson | 0:404dae88af71 | 168 | |
| MartinJohnson | 0:404dae88af71 | 169 | #endif /* __STM32F3_DISCOVERY_H */ |
| MartinJohnson | 0:404dae88af71 | 170 | /** |
| MartinJohnson | 0:404dae88af71 | 171 | * @} |
| MartinJohnson | 0:404dae88af71 | 172 | */ |
| MartinJohnson | 0:404dae88af71 | 173 | |
| MartinJohnson | 0:404dae88af71 | 174 | /** |
| MartinJohnson | 0:404dae88af71 | 175 | * @} |
| MartinJohnson | 0:404dae88af71 | 176 | */ |
| MartinJohnson | 0:404dae88af71 | 177 | |
| MartinJohnson | 0:404dae88af71 | 178 | /** |
| MartinJohnson | 0:404dae88af71 | 179 | * @} |
| MartinJohnson | 0:404dae88af71 | 180 | */ |
| MartinJohnson | 0:404dae88af71 | 181 | |
| MartinJohnson | 0:404dae88af71 | 182 | |
| MartinJohnson | 0:404dae88af71 | 183 | |
| MartinJohnson | 0:404dae88af71 | 184 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |