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