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