AudioRecord and FFT/MSE comparison. Call AudioRecord_demo for control record and AudioSample for subsequent recordings.
Dependencies: CMSIS_DSP_401 STM32L4xx_HAL_Driver
Fork of OneHopeOnePrayer by
stm32l4xx_nucleo.h@5:f6afbd3fc47a, 2015-12-05 (annotated)
- Committer:
- EricLew
- Date:
- Sat Dec 05 16:17:25 2015 +0000
- Revision:
- 5:f6afbd3fc47a
Ported to Nucleo
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
EricLew | 5:f6afbd3fc47a | 1 | /** |
EricLew | 5:f6afbd3fc47a | 2 | ****************************************************************************** |
EricLew | 5:f6afbd3fc47a | 3 | * @file stm32l4xx_nucleo.h |
EricLew | 5:f6afbd3fc47a | 4 | * @author MCD Application Team |
EricLew | 5:f6afbd3fc47a | 5 | * @version V2.0.0 |
EricLew | 5:f6afbd3fc47a | 6 | * @date 16-September-2015 |
EricLew | 5:f6afbd3fc47a | 7 | * @brief This file contains definitions for: |
EricLew | 5:f6afbd3fc47a | 8 | * - LEDs and push-button available on STM32L4XX-Nucleo Kit |
EricLew | 5:f6afbd3fc47a | 9 | * from STMicroelectronics |
EricLew | 5:f6afbd3fc47a | 10 | * - LCD, joystick and microSD available on Adafruit 1.8" TFT LCD |
EricLew | 5:f6afbd3fc47a | 11 | * shield (reference ID 802) |
EricLew | 5:f6afbd3fc47a | 12 | ****************************************************************************** |
EricLew | 5:f6afbd3fc47a | 13 | * @attention |
EricLew | 5:f6afbd3fc47a | 14 | * |
EricLew | 5:f6afbd3fc47a | 15 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
EricLew | 5:f6afbd3fc47a | 16 | * |
EricLew | 5:f6afbd3fc47a | 17 | * Redistribution and use in source and binary forms, with or without modification, |
EricLew | 5:f6afbd3fc47a | 18 | * are permitted provided that the following conditions are met: |
EricLew | 5:f6afbd3fc47a | 19 | * 1. Redistributions of source code must retain the above copyright notice, |
EricLew | 5:f6afbd3fc47a | 20 | * this list of conditions and the following disclaimer. |
EricLew | 5:f6afbd3fc47a | 21 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
EricLew | 5:f6afbd3fc47a | 22 | * this list of conditions and the following disclaimer in the documentation |
EricLew | 5:f6afbd3fc47a | 23 | * and/or other materials provided with the distribution. |
EricLew | 5:f6afbd3fc47a | 24 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
EricLew | 5:f6afbd3fc47a | 25 | * may be used to endorse or promote products derived from this software |
EricLew | 5:f6afbd3fc47a | 26 | * without specific prior written permission. |
EricLew | 5:f6afbd3fc47a | 27 | * |
EricLew | 5:f6afbd3fc47a | 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
EricLew | 5:f6afbd3fc47a | 29 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
EricLew | 5:f6afbd3fc47a | 30 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
EricLew | 5:f6afbd3fc47a | 31 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
EricLew | 5:f6afbd3fc47a | 32 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
EricLew | 5:f6afbd3fc47a | 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
EricLew | 5:f6afbd3fc47a | 34 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
EricLew | 5:f6afbd3fc47a | 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
EricLew | 5:f6afbd3fc47a | 36 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
EricLew | 5:f6afbd3fc47a | 37 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
EricLew | 5:f6afbd3fc47a | 38 | * |
EricLew | 5:f6afbd3fc47a | 39 | ****************************************************************************** |
EricLew | 5:f6afbd3fc47a | 40 | */ |
EricLew | 5:f6afbd3fc47a | 41 | |
EricLew | 5:f6afbd3fc47a | 42 | /* Define to prevent recursive inclusion -------------------------------------*/ |
EricLew | 5:f6afbd3fc47a | 43 | #ifndef __STM32L4XX_NUCLEO_H |
EricLew | 5:f6afbd3fc47a | 44 | #define __STM32L4XX_NUCLEO_H |
EricLew | 5:f6afbd3fc47a | 45 | |
EricLew | 5:f6afbd3fc47a | 46 | #ifdef __cplusplus |
EricLew | 5:f6afbd3fc47a | 47 | extern "C" { |
EricLew | 5:f6afbd3fc47a | 48 | #endif |
EricLew | 5:f6afbd3fc47a | 49 | |
EricLew | 5:f6afbd3fc47a | 50 | /** @addtogroup BSP |
EricLew | 5:f6afbd3fc47a | 51 | * @{ |
EricLew | 5:f6afbd3fc47a | 52 | */ |
EricLew | 5:f6afbd3fc47a | 53 | |
EricLew | 5:f6afbd3fc47a | 54 | /** @addtogroup STM32L4XX_NUCLEO |
EricLew | 5:f6afbd3fc47a | 55 | * @{ |
EricLew | 5:f6afbd3fc47a | 56 | */ |
EricLew | 5:f6afbd3fc47a | 57 | |
EricLew | 5:f6afbd3fc47a | 58 | /* Includes ------------------------------------------------------------------*/ |
EricLew | 5:f6afbd3fc47a | 59 | #include "stm32l4xx_hal.h" |
EricLew | 5:f6afbd3fc47a | 60 | |
EricLew | 5:f6afbd3fc47a | 61 | |
EricLew | 5:f6afbd3fc47a | 62 | /** @defgroup STM32L4XX_NUCLEO_Exported_Types Exported Types |
EricLew | 5:f6afbd3fc47a | 63 | * @{ |
EricLew | 5:f6afbd3fc47a | 64 | */ |
EricLew | 5:f6afbd3fc47a | 65 | typedef enum |
EricLew | 5:f6afbd3fc47a | 66 | { |
EricLew | 5:f6afbd3fc47a | 67 | LED2 = 0, |
EricLew | 5:f6afbd3fc47a | 68 | LED4 = 1, // disco |
EricLew | 5:f6afbd3fc47a | 69 | LED_GREEN = LED2 |
EricLew | 5:f6afbd3fc47a | 70 | } Led_TypeDef; |
EricLew | 5:f6afbd3fc47a | 71 | |
EricLew | 5:f6afbd3fc47a | 72 | typedef enum |
EricLew | 5:f6afbd3fc47a | 73 | { |
EricLew | 5:f6afbd3fc47a | 74 | BUTTON_USER = 0, |
EricLew | 5:f6afbd3fc47a | 75 | /* Alias */ |
EricLew | 5:f6afbd3fc47a | 76 | BUTTON_KEY = BUTTON_USER |
EricLew | 5:f6afbd3fc47a | 77 | } Button_TypeDef; |
EricLew | 5:f6afbd3fc47a | 78 | |
EricLew | 5:f6afbd3fc47a | 79 | typedef enum |
EricLew | 5:f6afbd3fc47a | 80 | { |
EricLew | 5:f6afbd3fc47a | 81 | BUTTON_MODE_GPIO = 0, |
EricLew | 5:f6afbd3fc47a | 82 | BUTTON_MODE_EXTI = 1 |
EricLew | 5:f6afbd3fc47a | 83 | } ButtonMode_TypeDef; |
EricLew | 5:f6afbd3fc47a | 84 | |
EricLew | 5:f6afbd3fc47a | 85 | typedef enum |
EricLew | 5:f6afbd3fc47a | 86 | { |
EricLew | 5:f6afbd3fc47a | 87 | JOY_NONE = 0, |
EricLew | 5:f6afbd3fc47a | 88 | JOY_SEL = 1, |
EricLew | 5:f6afbd3fc47a | 89 | JOY_DOWN = 2, |
EricLew | 5:f6afbd3fc47a | 90 | JOY_LEFT = 3, |
EricLew | 5:f6afbd3fc47a | 91 | JOY_RIGHT = 4, |
EricLew | 5:f6afbd3fc47a | 92 | JOY_UP = 5 |
EricLew | 5:f6afbd3fc47a | 93 | } JOYState_TypeDef; |
EricLew | 5:f6afbd3fc47a | 94 | |
EricLew | 5:f6afbd3fc47a | 95 | /** |
EricLew | 5:f6afbd3fc47a | 96 | * @} |
EricLew | 5:f6afbd3fc47a | 97 | */ |
EricLew | 5:f6afbd3fc47a | 98 | |
EricLew | 5:f6afbd3fc47a | 99 | /** @defgroup STM32L4XX_NUCLEO_Exported_Constants Exported Constants |
EricLew | 5:f6afbd3fc47a | 100 | * @{ |
EricLew | 5:f6afbd3fc47a | 101 | */ |
EricLew | 5:f6afbd3fc47a | 102 | |
EricLew | 5:f6afbd3fc47a | 103 | /** |
EricLew | 5:f6afbd3fc47a | 104 | * @brief Define for STM32L4XX_NUCLEO board |
EricLew | 5:f6afbd3fc47a | 105 | */ |
EricLew | 5:f6afbd3fc47a | 106 | #if !defined (USE_STM32L4XX_NUCLEO) |
EricLew | 5:f6afbd3fc47a | 107 | #define USE_STM32L4XX_NUCLEO |
EricLew | 5:f6afbd3fc47a | 108 | #endif |
EricLew | 5:f6afbd3fc47a | 109 | |
EricLew | 5:f6afbd3fc47a | 110 | /** @defgroup STM32L4XX_NUCLEO_LED LED Constants |
EricLew | 5:f6afbd3fc47a | 111 | * @{ |
EricLew | 5:f6afbd3fc47a | 112 | */ |
EricLew | 5:f6afbd3fc47a | 113 | #define LEDn 1 |
EricLew | 5:f6afbd3fc47a | 114 | |
EricLew | 5:f6afbd3fc47a | 115 | #define LED2_PIN GPIO_PIN_5 |
EricLew | 5:f6afbd3fc47a | 116 | #define LED2_GPIO_PORT GPIOA |
EricLew | 5:f6afbd3fc47a | 117 | #define LED2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE() |
EricLew | 5:f6afbd3fc47a | 118 | #define LED2_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE() |
EricLew | 5:f6afbd3fc47a | 119 | |
EricLew | 5:f6afbd3fc47a | 120 | #define LEDx_GPIO_CLK_ENABLE(__LED__) do { if((__LED__) == LED2) { LED2_GPIO_CLK_ENABLE(); } } while(0) |
EricLew | 5:f6afbd3fc47a | 121 | |
EricLew | 5:f6afbd3fc47a | 122 | #define LEDx_GPIO_CLK_DISABLE(__LED__) do { if((__LED__) == LED2) { LED2_GPIO_CLK_DISABLE(); } } while(0) |
EricLew | 5:f6afbd3fc47a | 123 | /** |
EricLew | 5:f6afbd3fc47a | 124 | * @} |
EricLew | 5:f6afbd3fc47a | 125 | */ |
EricLew | 5:f6afbd3fc47a | 126 | |
EricLew | 5:f6afbd3fc47a | 127 | /** @defgroup STM32L4XX_NUCLEO_BUTTON BUTTON Constants |
EricLew | 5:f6afbd3fc47a | 128 | * @{ |
EricLew | 5:f6afbd3fc47a | 129 | */ |
EricLew | 5:f6afbd3fc47a | 130 | #define BUTTONn 1 |
EricLew | 5:f6afbd3fc47a | 131 | |
EricLew | 5:f6afbd3fc47a | 132 | /** |
EricLew | 5:f6afbd3fc47a | 133 | * @brief Key push-button |
EricLew | 5:f6afbd3fc47a | 134 | */ |
EricLew | 5:f6afbd3fc47a | 135 | #define USER_BUTTON_PIN GPIO_PIN_13 |
EricLew | 5:f6afbd3fc47a | 136 | #define USER_BUTTON_GPIO_PORT GPIOC |
EricLew | 5:f6afbd3fc47a | 137 | #define USER_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE() |
EricLew | 5:f6afbd3fc47a | 138 | #define USER_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE() |
EricLew | 5:f6afbd3fc47a | 139 | #define USER_BUTTON_EXTI_LINE GPIO_PIN_13 |
EricLew | 5:f6afbd3fc47a | 140 | #define USER_BUTTON_EXTI_IRQn EXTI15_10_IRQn |
EricLew | 5:f6afbd3fc47a | 141 | /* Aliases */ |
EricLew | 5:f6afbd3fc47a | 142 | #define KEY_BUTTON_PIN USER_BUTTON_PIN |
EricLew | 5:f6afbd3fc47a | 143 | #define KEY_BUTTON_GPIO_PORT USER_BUTTON_GPIO_PORT |
EricLew | 5:f6afbd3fc47a | 144 | #define KEY_BUTTON_GPIO_CLK_ENABLE() USER_BUTTON_GPIO_CLK_ENABLE() |
EricLew | 5:f6afbd3fc47a | 145 | #define KEY_BUTTON_GPIO_CLK_DISABLE() USER_BUTTON_GPIO_CLK_DISABLE() |
EricLew | 5:f6afbd3fc47a | 146 | #define KEY_BUTTON_EXTI_LINE USER_BUTTON_EXTI_LINE |
EricLew | 5:f6afbd3fc47a | 147 | #define KEY_BUTTON_EXTI_IRQn USER_BUTTON_EXTI_IRQn |
EricLew | 5:f6afbd3fc47a | 148 | |
EricLew | 5:f6afbd3fc47a | 149 | |
EricLew | 5:f6afbd3fc47a | 150 | #define BUTTONx_GPIO_CLK_ENABLE(__BUTTON__) do { if((__BUTTON__) == BUTTON_USER) { USER_BUTTON_GPIO_CLK_ENABLE(); } } while(0) |
EricLew | 5:f6afbd3fc47a | 151 | |
EricLew | 5:f6afbd3fc47a | 152 | #define BUTTONx_GPIO_CLK_DISABLE(__BUTTON__) do { if((__BUTTON__) == BUTTON_USER) { USER_BUTTON_GPIO_CLK_DISABLE(); } } while(0) |
EricLew | 5:f6afbd3fc47a | 153 | /** |
EricLew | 5:f6afbd3fc47a | 154 | * @} |
EricLew | 5:f6afbd3fc47a | 155 | */ |
EricLew | 5:f6afbd3fc47a | 156 | |
EricLew | 5:f6afbd3fc47a | 157 | /** @addtogroup STM32L4XX_NUCLEO_BUS BUS Constants |
EricLew | 5:f6afbd3fc47a | 158 | * @{ |
EricLew | 5:f6afbd3fc47a | 159 | */ |
EricLew | 5:f6afbd3fc47a | 160 | /*###################### SPI1 ###################################*/ |
EricLew | 5:f6afbd3fc47a | 161 | #define NUCLEO_SPIx SPI1 |
EricLew | 5:f6afbd3fc47a | 162 | #define NUCLEO_SPIx_CLK_ENABLE() __HAL_RCC_SPI1_CLK_ENABLE() |
EricLew | 5:f6afbd3fc47a | 163 | |
EricLew | 5:f6afbd3fc47a | 164 | #define NUCLEO_SPIx_SCK_AF GPIO_AF5_SPI1 |
EricLew | 5:f6afbd3fc47a | 165 | #define NUCLEO_SPIx_SCK_GPIO_PORT GPIOA |
EricLew | 5:f6afbd3fc47a | 166 | #define NUCLEO_SPIx_SCK_PIN GPIO_PIN_5 |
EricLew | 5:f6afbd3fc47a | 167 | #define NUCLEO_SPIx_SCK_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE() |
EricLew | 5:f6afbd3fc47a | 168 | #define NUCLEO_SPIx_SCK_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE() |
EricLew | 5:f6afbd3fc47a | 169 | |
EricLew | 5:f6afbd3fc47a | 170 | #define NUCLEO_SPIx_MISO_MOSI_AF GPIO_AF5_SPI1 |
EricLew | 5:f6afbd3fc47a | 171 | #define NUCLEO_SPIx_MISO_MOSI_GPIO_PORT GPIOA |
EricLew | 5:f6afbd3fc47a | 172 | #define NUCLEO_SPIx_MISO_MOSI_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE() |
EricLew | 5:f6afbd3fc47a | 173 | #define NUCLEO_SPIx_MISO_MOSI_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE() |
EricLew | 5:f6afbd3fc47a | 174 | #define NUCLEO_SPIx_MISO_PIN GPIO_PIN_6 |
EricLew | 5:f6afbd3fc47a | 175 | #define NUCLEO_SPIx_MOSI_PIN GPIO_PIN_7 |
EricLew | 5:f6afbd3fc47a | 176 | /* Maximum Timeout values for flags waiting loops. These timeouts are not based |
EricLew | 5:f6afbd3fc47a | 177 | on accurate values, they just guarantee that the application will not remain |
EricLew | 5:f6afbd3fc47a | 178 | stuck if the SPI communication is corrupted. |
EricLew | 5:f6afbd3fc47a | 179 | You may modify these timeout values depending on CPU frequency and application |
EricLew | 5:f6afbd3fc47a | 180 | conditions (interrupts routines ...). */ |
EricLew | 5:f6afbd3fc47a | 181 | #define NUCLEO_SPIx_TIMEOUT_MAX 1000 |
EricLew | 5:f6afbd3fc47a | 182 | |
EricLew | 5:f6afbd3fc47a | 183 | |
EricLew | 5:f6afbd3fc47a | 184 | /** |
EricLew | 5:f6afbd3fc47a | 185 | * @brief SD Control Lines management |
EricLew | 5:f6afbd3fc47a | 186 | */ |
EricLew | 5:f6afbd3fc47a | 187 | #define SD_CS_LOW() HAL_GPIO_WritePin(SD_CS_GPIO_PORT, SD_CS_PIN, GPIO_PIN_RESET) |
EricLew | 5:f6afbd3fc47a | 188 | #define SD_CS_HIGH() HAL_GPIO_WritePin(SD_CS_GPIO_PORT, SD_CS_PIN, GPIO_PIN_SET) |
EricLew | 5:f6afbd3fc47a | 189 | |
EricLew | 5:f6afbd3fc47a | 190 | /** |
EricLew | 5:f6afbd3fc47a | 191 | * @brief LCD Control Lines management |
EricLew | 5:f6afbd3fc47a | 192 | */ |
EricLew | 5:f6afbd3fc47a | 193 | #define LCD_CS_LOW() HAL_GPIO_WritePin(LCD_CS_GPIO_PORT, LCD_CS_PIN, GPIO_PIN_RESET) |
EricLew | 5:f6afbd3fc47a | 194 | #define LCD_CS_HIGH() HAL_GPIO_WritePin(LCD_CS_GPIO_PORT, LCD_CS_PIN, GPIO_PIN_SET) |
EricLew | 5:f6afbd3fc47a | 195 | #define LCD_DC_LOW() HAL_GPIO_WritePin(LCD_DC_GPIO_PORT, LCD_DC_PIN, GPIO_PIN_RESET) |
EricLew | 5:f6afbd3fc47a | 196 | #define LCD_DC_HIGH() HAL_GPIO_WritePin(LCD_DC_GPIO_PORT, LCD_DC_PIN, GPIO_PIN_SET) |
EricLew | 5:f6afbd3fc47a | 197 | |
EricLew | 5:f6afbd3fc47a | 198 | /** |
EricLew | 5:f6afbd3fc47a | 199 | * @brief SD Control Interface pins |
EricLew | 5:f6afbd3fc47a | 200 | */ |
EricLew | 5:f6afbd3fc47a | 201 | #define SD_CS_PIN GPIO_PIN_5 |
EricLew | 5:f6afbd3fc47a | 202 | #define SD_CS_GPIO_PORT GPIOB |
EricLew | 5:f6afbd3fc47a | 203 | #define SD_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE() |
EricLew | 5:f6afbd3fc47a | 204 | #define SD_CS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE() |
EricLew | 5:f6afbd3fc47a | 205 | |
EricLew | 5:f6afbd3fc47a | 206 | /** |
EricLew | 5:f6afbd3fc47a | 207 | * @brief LCD Control Interface pins |
EricLew | 5:f6afbd3fc47a | 208 | */ |
EricLew | 5:f6afbd3fc47a | 209 | #define LCD_CS_PIN GPIO_PIN_6 |
EricLew | 5:f6afbd3fc47a | 210 | #define LCD_CS_GPIO_PORT GPIOB |
EricLew | 5:f6afbd3fc47a | 211 | #define LCD_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE() |
EricLew | 5:f6afbd3fc47a | 212 | #define LCD_CS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE() |
EricLew | 5:f6afbd3fc47a | 213 | |
EricLew | 5:f6afbd3fc47a | 214 | /** |
EricLew | 5:f6afbd3fc47a | 215 | * @brief LCD Data/Command Interface pins |
EricLew | 5:f6afbd3fc47a | 216 | */ |
EricLew | 5:f6afbd3fc47a | 217 | #define LCD_DC_PIN GPIO_PIN_9 |
EricLew | 5:f6afbd3fc47a | 218 | #define LCD_DC_GPIO_PORT GPIOA |
EricLew | 5:f6afbd3fc47a | 219 | #define LCD_DC_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE() |
EricLew | 5:f6afbd3fc47a | 220 | #define LCD_DC_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE() |
EricLew | 5:f6afbd3fc47a | 221 | |
EricLew | 5:f6afbd3fc47a | 222 | /* Audio codec I2C address */ |
EricLew | 5:f6afbd3fc47a | 223 | #define AUDIO_I2C_ADDRESS ((uint16_t) 0x94) // disco |
EricLew | 5:f6afbd3fc47a | 224 | |
EricLew | 5:f6afbd3fc47a | 225 | /*##################### ADC1 ###################################*/ |
EricLew | 5:f6afbd3fc47a | 226 | /** |
EricLew | 5:f6afbd3fc47a | 227 | * @brief ADC Interface pins |
EricLew | 5:f6afbd3fc47a | 228 | * used to detect motion of Joystick available on Adafruit 1.8" TFT shield |
EricLew | 5:f6afbd3fc47a | 229 | */ |
EricLew | 5:f6afbd3fc47a | 230 | #define NUCLEO_ADCx ADC1 |
EricLew | 5:f6afbd3fc47a | 231 | #define NUCLEO_ADCx_CLK_ENABLE() __HAL_RCC_ADC_CLK_ENABLE() |
EricLew | 5:f6afbd3fc47a | 232 | |
EricLew | 5:f6afbd3fc47a | 233 | #define NUCLEO_ADCx_GPIO_PORT GPIOB |
EricLew | 5:f6afbd3fc47a | 234 | #define NUCLEO_ADCx_GPIO_PIN GPIO_PIN_0 |
EricLew | 5:f6afbd3fc47a | 235 | #define NUCLEO_ADCx_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE() |
EricLew | 5:f6afbd3fc47a | 236 | #define NUCLEO_ADCx_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE() |
EricLew | 5:f6afbd3fc47a | 237 | |
EricLew | 5:f6afbd3fc47a | 238 | /** |
EricLew | 5:f6afbd3fc47a | 239 | * @} |
EricLew | 5:f6afbd3fc47a | 240 | */ |
EricLew | 5:f6afbd3fc47a | 241 | |
EricLew | 5:f6afbd3fc47a | 242 | /** |
EricLew | 5:f6afbd3fc47a | 243 | * @} |
EricLew | 5:f6afbd3fc47a | 244 | */ |
EricLew | 5:f6afbd3fc47a | 245 | |
EricLew | 5:f6afbd3fc47a | 246 | /** @addtogroup STM32L4XX_NUCLEO_Exported_Functions |
EricLew | 5:f6afbd3fc47a | 247 | * @{ |
EricLew | 5:f6afbd3fc47a | 248 | */ |
EricLew | 5:f6afbd3fc47a | 249 | uint32_t BSP_GetVersion(void); |
EricLew | 5:f6afbd3fc47a | 250 | |
EricLew | 5:f6afbd3fc47a | 251 | /** @addtogroup STM32L4XX_NUCLEO_LED_Functions |
EricLew | 5:f6afbd3fc47a | 252 | * @{ |
EricLew | 5:f6afbd3fc47a | 253 | */ |
EricLew | 5:f6afbd3fc47a | 254 | void BSP_LED_Init(Led_TypeDef Led); |
EricLew | 5:f6afbd3fc47a | 255 | void BSP_LED_On(Led_TypeDef Led); |
EricLew | 5:f6afbd3fc47a | 256 | void BSP_LED_Off(Led_TypeDef Led); |
EricLew | 5:f6afbd3fc47a | 257 | void BSP_LED_Toggle(Led_TypeDef Led); |
EricLew | 5:f6afbd3fc47a | 258 | /** |
EricLew | 5:f6afbd3fc47a | 259 | * @} |
EricLew | 5:f6afbd3fc47a | 260 | */ |
EricLew | 5:f6afbd3fc47a | 261 | |
EricLew | 5:f6afbd3fc47a | 262 | /** @addtogroup STM32L4XX_NUCLEO_BUTTON_Functions |
EricLew | 5:f6afbd3fc47a | 263 | * @{ |
EricLew | 5:f6afbd3fc47a | 264 | */ |
EricLew | 5:f6afbd3fc47a | 265 | void BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode); |
EricLew | 5:f6afbd3fc47a | 266 | uint32_t BSP_PB_GetState(Button_TypeDef Button); |
EricLew | 5:f6afbd3fc47a | 267 | #ifdef HAL_ADC_MODULE_ENABLED |
EricLew | 5:f6afbd3fc47a | 268 | uint8_t BSP_JOY_Init(void); |
EricLew | 5:f6afbd3fc47a | 269 | JOYState_TypeDef BSP_JOY_GetState(void); |
EricLew | 5:f6afbd3fc47a | 270 | #endif /* HAL_ADC_MODULE_ENABLED */ |
EricLew | 5:f6afbd3fc47a | 271 | /** |
EricLew | 5:f6afbd3fc47a | 272 | * @} |
EricLew | 5:f6afbd3fc47a | 273 | */ |
EricLew | 5:f6afbd3fc47a | 274 | |
EricLew | 5:f6afbd3fc47a | 275 | /** |
EricLew | 5:f6afbd3fc47a | 276 | * @} |
EricLew | 5:f6afbd3fc47a | 277 | */ |
EricLew | 5:f6afbd3fc47a | 278 | |
EricLew | 5:f6afbd3fc47a | 279 | /** |
EricLew | 5:f6afbd3fc47a | 280 | * @} |
EricLew | 5:f6afbd3fc47a | 281 | */ |
EricLew | 5:f6afbd3fc47a | 282 | |
EricLew | 5:f6afbd3fc47a | 283 | /** |
EricLew | 5:f6afbd3fc47a | 284 | * @} |
EricLew | 5:f6afbd3fc47a | 285 | */ |
EricLew | 5:f6afbd3fc47a | 286 | |
EricLew | 5:f6afbd3fc47a | 287 | #ifdef __cplusplus |
EricLew | 5:f6afbd3fc47a | 288 | } |
EricLew | 5:f6afbd3fc47a | 289 | #endif |
EricLew | 5:f6afbd3fc47a | 290 | |
EricLew | 5:f6afbd3fc47a | 291 | #endif /* __STM32L4XX_NUCLEO_H */ |
EricLew | 5:f6afbd3fc47a | 292 | |
EricLew | 5:f6afbd3fc47a | 293 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
EricLew | 5:f6afbd3fc47a | 294 | |
EricLew | 5:f6afbd3fc47a | 295 |