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