STM32746G-Discovery board drivers V1.0.0
Dependents: DISCO-F746NG_LCDTS_CC3000_NTP DISCO-F746NG_ROPE_WIFI F746_SpectralAnalysis_NoPhoto ecte433 ... more
Drivers/BSP/STM32746G-Discovery/stm32746g_discovery.h@10:1050c589b2ad, 2019-11-12 (annotated)
- Committer:
- Jerome Coutant
- Date:
- Tue Nov 12 11:24:03 2019 +0100
- Revision:
- 10:1050c589b2ad
- Parent:
- 8:56384bddaba5
STM32Cube_FW_F7_V1.15.0 BSP_DISCO_F746NG
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bcostm | 6:e1d9da7fe856 | 1 | /** |
bcostm | 6:e1d9da7fe856 | 2 | ****************************************************************************** |
bcostm | 6:e1d9da7fe856 | 3 | * @file stm32746g_discovery.h |
bcostm | 6:e1d9da7fe856 | 4 | * @author MCD Application Team |
bcostm | 6:e1d9da7fe856 | 5 | * @brief This file contains definitions for STM32746G_DISCOVERY's LEDs, |
bcostm | 6:e1d9da7fe856 | 6 | * push-buttons and COM ports hardware resources. |
bcostm | 6:e1d9da7fe856 | 7 | ****************************************************************************** |
bcostm | 6:e1d9da7fe856 | 8 | * @attention |
bcostm | 6:e1d9da7fe856 | 9 | * |
bcostm | 6:e1d9da7fe856 | 10 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
bcostm | 6:e1d9da7fe856 | 11 | * |
bcostm | 6:e1d9da7fe856 | 12 | * Redistribution and use in source and binary forms, with or without modification, |
bcostm | 6:e1d9da7fe856 | 13 | * are permitted provided that the following conditions are met: |
bcostm | 6:e1d9da7fe856 | 14 | * 1. Redistributions of source code must retain the above copyright notice, |
bcostm | 6:e1d9da7fe856 | 15 | * this list of conditions and the following disclaimer. |
bcostm | 6:e1d9da7fe856 | 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
bcostm | 6:e1d9da7fe856 | 17 | * this list of conditions and the following disclaimer in the documentation |
bcostm | 6:e1d9da7fe856 | 18 | * and/or other materials provided with the distribution. |
bcostm | 6:e1d9da7fe856 | 19 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
bcostm | 6:e1d9da7fe856 | 20 | * may be used to endorse or promote products derived from this software |
bcostm | 6:e1d9da7fe856 | 21 | * without specific prior written permission. |
bcostm | 6:e1d9da7fe856 | 22 | * |
bcostm | 6:e1d9da7fe856 | 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
bcostm | 6:e1d9da7fe856 | 24 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
bcostm | 6:e1d9da7fe856 | 25 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
bcostm | 6:e1d9da7fe856 | 26 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
bcostm | 6:e1d9da7fe856 | 27 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
bcostm | 6:e1d9da7fe856 | 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
bcostm | 6:e1d9da7fe856 | 29 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
bcostm | 6:e1d9da7fe856 | 30 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
bcostm | 6:e1d9da7fe856 | 31 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
bcostm | 6:e1d9da7fe856 | 32 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
bcostm | 6:e1d9da7fe856 | 33 | * |
bcostm | 6:e1d9da7fe856 | 34 | ****************************************************************************** |
bcostm | 6:e1d9da7fe856 | 35 | */ |
bcostm | 6:e1d9da7fe856 | 36 | |
bcostm | 6:e1d9da7fe856 | 37 | /* Define to prevent recursive inclusion -------------------------------------*/ |
bcostm | 6:e1d9da7fe856 | 38 | #ifndef __STM32746G_DISCOVERY_H |
bcostm | 6:e1d9da7fe856 | 39 | #define __STM32746G_DISCOVERY_H |
bcostm | 6:e1d9da7fe856 | 40 | |
bcostm | 6:e1d9da7fe856 | 41 | #ifdef __cplusplus |
bcostm | 6:e1d9da7fe856 | 42 | extern "C" { |
bcostm | 6:e1d9da7fe856 | 43 | #endif |
bcostm | 6:e1d9da7fe856 | 44 | |
bcostm | 6:e1d9da7fe856 | 45 | /* Includes ------------------------------------------------------------------*/ |
bcostm | 6:e1d9da7fe856 | 46 | #include "stm32f7xx_hal.h" |
bcostm | 6:e1d9da7fe856 | 47 | |
bcostm | 6:e1d9da7fe856 | 48 | /** @addtogroup BSP |
bcostm | 6:e1d9da7fe856 | 49 | * @{ |
bcostm | 6:e1d9da7fe856 | 50 | */ |
bcostm | 6:e1d9da7fe856 | 51 | |
bcostm | 6:e1d9da7fe856 | 52 | /** @addtogroup STM32746G_DISCOVERY |
bcostm | 6:e1d9da7fe856 | 53 | * @{ |
bcostm | 6:e1d9da7fe856 | 54 | */ |
bcostm | 6:e1d9da7fe856 | 55 | |
bcostm | 6:e1d9da7fe856 | 56 | /** @addtogroup STM32746G_DISCOVERY_LOW_LEVEL |
bcostm | 6:e1d9da7fe856 | 57 | * @{ |
bcostm | 6:e1d9da7fe856 | 58 | */ |
bcostm | 6:e1d9da7fe856 | 59 | |
bcostm | 6:e1d9da7fe856 | 60 | /** @defgroup STM32746G_DISCOVERY_LOW_LEVEL_Exported_Types STM32746G_DISCOVERY_LOW_LEVEL Exported Types |
bcostm | 6:e1d9da7fe856 | 61 | * @{ |
bcostm | 6:e1d9da7fe856 | 62 | */ |
bcostm | 6:e1d9da7fe856 | 63 | typedef enum |
bcostm | 6:e1d9da7fe856 | 64 | { |
bcostm | 6:e1d9da7fe856 | 65 | DISCO_LED1 = 0, // MBED |
bcostm | 6:e1d9da7fe856 | 66 | LED_GREEN = DISCO_LED1, // MBED |
bcostm | 6:e1d9da7fe856 | 67 | }Led_TypeDef; |
bcostm | 6:e1d9da7fe856 | 68 | |
bcostm | 6:e1d9da7fe856 | 69 | typedef enum |
bcostm | 6:e1d9da7fe856 | 70 | { |
bcostm | 6:e1d9da7fe856 | 71 | BUTTON_WAKEUP = 0, |
bcostm | 6:e1d9da7fe856 | 72 | BUTTON_TAMPER = 1, |
bcostm | 6:e1d9da7fe856 | 73 | BUTTON_KEY = 2 |
bcostm | 6:e1d9da7fe856 | 74 | }Button_TypeDef; |
bcostm | 6:e1d9da7fe856 | 75 | |
bcostm | 6:e1d9da7fe856 | 76 | typedef enum |
bcostm | 6:e1d9da7fe856 | 77 | { |
bcostm | 6:e1d9da7fe856 | 78 | BUTTON_MODE_GPIO = 0, |
bcostm | 6:e1d9da7fe856 | 79 | BUTTON_MODE_EXTI = 1 |
bcostm | 6:e1d9da7fe856 | 80 | }ButtonMode_TypeDef; |
bcostm | 6:e1d9da7fe856 | 81 | |
bcostm | 6:e1d9da7fe856 | 82 | typedef enum |
bcostm | 6:e1d9da7fe856 | 83 | { |
bcostm | 6:e1d9da7fe856 | 84 | COM1 = 0, |
bcostm | 6:e1d9da7fe856 | 85 | COM2 = 1 |
bcostm | 6:e1d9da7fe856 | 86 | }COM_TypeDef; |
bcostm | 6:e1d9da7fe856 | 87 | /** |
bcostm | 6:e1d9da7fe856 | 88 | * @} |
bcostm | 6:e1d9da7fe856 | 89 | */ |
bcostm | 6:e1d9da7fe856 | 90 | |
bcostm | 6:e1d9da7fe856 | 91 | /** @defgroup STM32746G_DISCOVERY_LOW_LEVEL_Exported_Constants STM32746G_DISCOVERY_LOW_LEVEL Exported Constants |
bcostm | 6:e1d9da7fe856 | 92 | * @{ |
bcostm | 6:e1d9da7fe856 | 93 | */ |
bcostm | 6:e1d9da7fe856 | 94 | |
bcostm | 6:e1d9da7fe856 | 95 | /** |
bcostm | 6:e1d9da7fe856 | 96 | * @brief Define for STM32746G_DISCOVERY board |
bcostm | 6:e1d9da7fe856 | 97 | */ |
bcostm | 6:e1d9da7fe856 | 98 | #if !defined (USE_STM32746G_DISCO) |
bcostm | 6:e1d9da7fe856 | 99 | #define USE_STM32746G_DISCO |
bcostm | 6:e1d9da7fe856 | 100 | #endif |
bcostm | 6:e1d9da7fe856 | 101 | |
bcostm | 6:e1d9da7fe856 | 102 | /** @addtogroup STM32746G_DISCOVERY_LOW_LEVEL_LED |
bcostm | 6:e1d9da7fe856 | 103 | * @{ |
bcostm | 6:e1d9da7fe856 | 104 | */ |
bcostm | 6:e1d9da7fe856 | 105 | |
bcostm | 6:e1d9da7fe856 | 106 | #define LEDn ((uint8_t)1) |
bcostm | 6:e1d9da7fe856 | 107 | |
bcostm | 6:e1d9da7fe856 | 108 | #define LED1_GPIO_PORT GPIOI |
bcostm | 6:e1d9da7fe856 | 109 | #define LED1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE() |
bcostm | 6:e1d9da7fe856 | 110 | #define LED1_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE() |
bcostm | 6:e1d9da7fe856 | 111 | #define LED1_PIN GPIO_PIN_1 |
bcostm | 6:e1d9da7fe856 | 112 | |
bcostm | 6:e1d9da7fe856 | 113 | /** |
bcostm | 6:e1d9da7fe856 | 114 | * @} |
bcostm | 6:e1d9da7fe856 | 115 | */ |
bcostm | 6:e1d9da7fe856 | 116 | |
bcostm | 6:e1d9da7fe856 | 117 | /** @addtogroup STM32746G_DISCOVERY_LOW_LEVEL_BUTTON |
bcostm | 6:e1d9da7fe856 | 118 | * @{ |
bcostm | 6:e1d9da7fe856 | 119 | */ |
bcostm | 6:e1d9da7fe856 | 120 | #define BUTTONn ((uint8_t)3) |
bcostm | 6:e1d9da7fe856 | 121 | |
bcostm | 6:e1d9da7fe856 | 122 | /** |
bcostm | 6:e1d9da7fe856 | 123 | * @brief Wakeup push-button |
bcostm | 6:e1d9da7fe856 | 124 | */ |
bcostm | 6:e1d9da7fe856 | 125 | #define WAKEUP_BUTTON_PIN GPIO_PIN_11 |
bcostm | 6:e1d9da7fe856 | 126 | #define WAKEUP_BUTTON_GPIO_PORT GPIOI |
bcostm | 6:e1d9da7fe856 | 127 | #define WAKEUP_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE() |
bcostm | 6:e1d9da7fe856 | 128 | #define WAKEUP_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE() |
bcostm | 6:e1d9da7fe856 | 129 | #define WAKEUP_BUTTON_EXTI_IRQn EXTI15_10_IRQn |
bcostm | 6:e1d9da7fe856 | 130 | |
bcostm | 6:e1d9da7fe856 | 131 | /** |
bcostm | 6:e1d9da7fe856 | 132 | * @brief Tamper push-button |
bcostm | 6:e1d9da7fe856 | 133 | */ |
bcostm | 6:e1d9da7fe856 | 134 | #define TAMPER_BUTTON_PIN GPIO_PIN_11 |
bcostm | 6:e1d9da7fe856 | 135 | #define TAMPER_BUTTON_GPIO_PORT GPIOI |
bcostm | 6:e1d9da7fe856 | 136 | #define TAMPER_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE() |
bcostm | 6:e1d9da7fe856 | 137 | #define TAMPER_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE() |
bcostm | 6:e1d9da7fe856 | 138 | #define TAMPER_BUTTON_EXTI_IRQn EXTI15_10_IRQn |
bcostm | 6:e1d9da7fe856 | 139 | |
bcostm | 6:e1d9da7fe856 | 140 | /** |
bcostm | 6:e1d9da7fe856 | 141 | * @brief Key push-button |
bcostm | 6:e1d9da7fe856 | 142 | */ |
bcostm | 6:e1d9da7fe856 | 143 | #define KEY_BUTTON_PIN GPIO_PIN_11 |
bcostm | 6:e1d9da7fe856 | 144 | #define KEY_BUTTON_GPIO_PORT GPIOI |
bcostm | 6:e1d9da7fe856 | 145 | #define KEY_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE() |
bcostm | 6:e1d9da7fe856 | 146 | #define KEY_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE() |
bcostm | 6:e1d9da7fe856 | 147 | #define KEY_BUTTON_EXTI_IRQn EXTI15_10_IRQn |
bcostm | 6:e1d9da7fe856 | 148 | |
bcostm | 6:e1d9da7fe856 | 149 | #define BUTTONx_GPIO_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == 0) WAKEUP_BUTTON_GPIO_CLK_ENABLE(); else\ |
bcostm | 6:e1d9da7fe856 | 150 | if((__INDEX__) == 1) TAMPER_BUTTON_GPIO_CLK_ENABLE(); else\ |
bcostm | 6:e1d9da7fe856 | 151 | KEY_BUTTON_GPIO_CLK_ENABLE(); } while(0) |
bcostm | 6:e1d9da7fe856 | 152 | |
bcostm | 6:e1d9da7fe856 | 153 | #define BUTTONx_GPIO_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? WAKEUP_BUTTON_GPIO_CLK_DISABLE() :\ |
bcostm | 6:e1d9da7fe856 | 154 | ((__INDEX__) == 1) ? TAMPER_BUTTON_GPIO_CLK_DISABLE() : KEY_BUTTON_GPIO_CLK_DISABLE()) |
bcostm | 6:e1d9da7fe856 | 155 | |
bcostm | 6:e1d9da7fe856 | 156 | /** |
bcostm | 6:e1d9da7fe856 | 157 | * @} |
bcostm | 6:e1d9da7fe856 | 158 | */ |
bcostm | 6:e1d9da7fe856 | 159 | |
bcostm | 6:e1d9da7fe856 | 160 | /** @addtogroup STM32746G_DISCOVERY_LOW_LEVEL_SIGNAL |
bcostm | 6:e1d9da7fe856 | 161 | * @{ |
bcostm | 6:e1d9da7fe856 | 162 | */ |
bcostm | 6:e1d9da7fe856 | 163 | #define SIGNALn ((uint8_t)1) |
bcostm | 6:e1d9da7fe856 | 164 | |
bcostm | 6:e1d9da7fe856 | 165 | /** |
bcostm | 6:e1d9da7fe856 | 166 | * @brief SD-detect signal |
bcostm | 6:e1d9da7fe856 | 167 | */ |
bcostm | 6:e1d9da7fe856 | 168 | #define SD_DETECT_PIN GPIO_PIN_13 |
bcostm | 6:e1d9da7fe856 | 169 | #define SD_DETECT_GPIO_PORT GPIOC |
bcostm | 6:e1d9da7fe856 | 170 | #define SD_DETECT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE() |
bcostm | 6:e1d9da7fe856 | 171 | #define SD_DETECT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE() |
bcostm | 6:e1d9da7fe856 | 172 | #define SD_DETECT_EXTI_IRQn EXTI15_10_IRQn |
bcostm | 6:e1d9da7fe856 | 173 | |
bcostm | 6:e1d9da7fe856 | 174 | /** |
bcostm | 6:e1d9da7fe856 | 175 | * @brief Touch screen interrupt signal |
bcostm | 6:e1d9da7fe856 | 176 | */ |
bcostm | 6:e1d9da7fe856 | 177 | #define TS_INT_PIN GPIO_PIN_13 |
bcostm | 6:e1d9da7fe856 | 178 | #define TS_INT_GPIO_PORT GPIOI |
bcostm | 6:e1d9da7fe856 | 179 | #define TS_INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE() |
bcostm | 6:e1d9da7fe856 | 180 | #define TS_INT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE() |
bcostm | 6:e1d9da7fe856 | 181 | #define TS_INT_EXTI_IRQn EXTI15_10_IRQn |
bcostm | 6:e1d9da7fe856 | 182 | |
bcostm | 6:e1d9da7fe856 | 183 | /** |
bcostm | 6:e1d9da7fe856 | 184 | * @} |
bcostm | 6:e1d9da7fe856 | 185 | */ |
bcostm | 6:e1d9da7fe856 | 186 | |
bcostm | 6:e1d9da7fe856 | 187 | /** @addtogroup STM32746G_DISCOVERY_LOW_LEVEL_COM |
bcostm | 6:e1d9da7fe856 | 188 | * @{ |
bcostm | 6:e1d9da7fe856 | 189 | */ |
bcostm | 6:e1d9da7fe856 | 190 | #define COMn ((uint8_t)1) |
bcostm | 6:e1d9da7fe856 | 191 | |
bcostm | 6:e1d9da7fe856 | 192 | /** |
bcostm | 6:e1d9da7fe856 | 193 | * @brief Definition for COM port1, connected to USART1 |
bcostm | 6:e1d9da7fe856 | 194 | */ |
bcostm | 6:e1d9da7fe856 | 195 | #define DISCOVERY_COM1 USART1 |
bcostm | 6:e1d9da7fe856 | 196 | #define DISCOVERY_COM1_CLK_ENABLE() __HAL_RCC_USART1_CLK_ENABLE() |
bcostm | 6:e1d9da7fe856 | 197 | #define DISCOVERY_COM1_CLK_DISABLE() __HAL_RCC_USART1_CLK_DISABLE() |
bcostm | 6:e1d9da7fe856 | 198 | |
bcostm | 6:e1d9da7fe856 | 199 | #define DISCOVERY_COM1_TX_PIN GPIO_PIN_9 |
bcostm | 6:e1d9da7fe856 | 200 | #define DISCOVERY_COM1_TX_GPIO_PORT GPIOA |
bcostm | 6:e1d9da7fe856 | 201 | #define DISCOVERY_COM1_TX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE() |
bcostm | 6:e1d9da7fe856 | 202 | #define DISCOVERY_COM1_TX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE() |
bcostm | 6:e1d9da7fe856 | 203 | #define DISCOVERY_COM1_TX_AF GPIO_AF7_USART1 |
bcostm | 6:e1d9da7fe856 | 204 | |
bcostm | 6:e1d9da7fe856 | 205 | #define DISCOVERY_COM1_RX_PIN GPIO_PIN_7 |
bcostm | 6:e1d9da7fe856 | 206 | #define DISCOVERY_COM1_RX_GPIO_PORT GPIOB |
bcostm | 6:e1d9da7fe856 | 207 | #define DISCOVERY_COM1_RX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE() |
bcostm | 6:e1d9da7fe856 | 208 | #define DISCOVERY_COM1_RX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE() |
bcostm | 6:e1d9da7fe856 | 209 | #define DISCOVERY_COM1_RX_AF GPIO_AF7_USART1 |
bcostm | 6:e1d9da7fe856 | 210 | |
bcostm | 6:e1d9da7fe856 | 211 | #define DISCOVERY_COM1_IRQn USART1_IRQn |
bcostm | 6:e1d9da7fe856 | 212 | |
bcostm | 6:e1d9da7fe856 | 213 | #define DISCOVERY_COMx_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) DISCOVERY_COM1_CLK_ENABLE(); } while(0) |
bcostm | 6:e1d9da7fe856 | 214 | #define DISCOVERY_COMx_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? DISCOVERY_COM1_CLK_DISABLE() : 0) |
bcostm | 6:e1d9da7fe856 | 215 | |
bcostm | 6:e1d9da7fe856 | 216 | #define DISCOVERY_COMx_TX_GPIO_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) DISCOVERY_COM1_TX_GPIO_CLK_ENABLE(); } while(0) |
bcostm | 6:e1d9da7fe856 | 217 | #define DISCOVERY_COMx_TX_GPIO_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? DISCOVERY_COM1_TX_GPIO_CLK_DISABLE() : 0) |
bcostm | 6:e1d9da7fe856 | 218 | |
bcostm | 6:e1d9da7fe856 | 219 | #define DISCOVERY_COMx_RX_GPIO_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) DISCOVERY_COM1_RX_GPIO_CLK_ENABLE(); } while(0) |
bcostm | 6:e1d9da7fe856 | 220 | #define DISCOVERY_COMx_RX_GPIO_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? DISCOVERY_COM1_RX_GPIO_CLK_DISABLE() : 0) |
bcostm | 6:e1d9da7fe856 | 221 | |
bcostm | 6:e1d9da7fe856 | 222 | /* Exported constant IO ------------------------------------------------------*/ |
bcostm | 6:e1d9da7fe856 | 223 | |
bcostm | 6:e1d9da7fe856 | 224 | #define LCD_I2C_ADDRESS ((uint16_t)0x70) |
bcostm | 6:e1d9da7fe856 | 225 | #define CAMERA_I2C_ADDRESS ((uint16_t)0x60) |
bcostm | 6:e1d9da7fe856 | 226 | #define AUDIO_I2C_ADDRESS ((uint16_t)0x34) |
bcostm | 6:e1d9da7fe856 | 227 | #define EEPROM_I2C_ADDRESS_A01 ((uint16_t)0xA0) |
bcostm | 6:e1d9da7fe856 | 228 | #define EEPROM_I2C_ADDRESS_A02 ((uint16_t)0xA6) |
bcostm | 6:e1d9da7fe856 | 229 | #define TS_I2C_ADDRESS ((uint16_t)0x70) |
bcostm | 6:e1d9da7fe856 | 230 | |
bcostm | 6:e1d9da7fe856 | 231 | /* I2C clock speed configuration (in Hz) |
bcostm | 6:e1d9da7fe856 | 232 | WARNING: |
bcostm | 6:e1d9da7fe856 | 233 | Make sure that this define is not already declared in other files (ie. |
bcostm | 6:e1d9da7fe856 | 234 | stm32746g_discovery.h file). It can be used in parallel by other modules. */ |
bcostm | 6:e1d9da7fe856 | 235 | #ifndef I2C_SPEED |
bcostm | 6:e1d9da7fe856 | 236 | #define I2C_SPEED ((uint32_t)100000) |
bcostm | 6:e1d9da7fe856 | 237 | #endif /* I2C_SPEED */ |
bcostm | 6:e1d9da7fe856 | 238 | |
bcostm | 6:e1d9da7fe856 | 239 | /* User can use this section to tailor I2Cx/I2Cx instance used and associated |
bcostm | 6:e1d9da7fe856 | 240 | resources */ |
bcostm | 6:e1d9da7fe856 | 241 | /* Definition for AUDIO and LCD I2Cx resources */ |
bcostm | 6:e1d9da7fe856 | 242 | #define DISCOVERY_AUDIO_I2Cx I2C3 |
bcostm | 6:e1d9da7fe856 | 243 | #define DISCOVERY_AUDIO_I2Cx_CLK_ENABLE() __HAL_RCC_I2C3_CLK_ENABLE() |
bcostm | 6:e1d9da7fe856 | 244 | #define DISCOVERY_AUDIO_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE() |
bcostm | 6:e1d9da7fe856 | 245 | #define DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE() |
bcostm | 6:e1d9da7fe856 | 246 | |
bcostm | 6:e1d9da7fe856 | 247 | #define DISCOVERY_AUDIO_I2Cx_FORCE_RESET() __HAL_RCC_I2C3_FORCE_RESET() |
bcostm | 6:e1d9da7fe856 | 248 | #define DISCOVERY_AUDIO_I2Cx_RELEASE_RESET() __HAL_RCC_I2C3_RELEASE_RESET() |
bcostm | 6:e1d9da7fe856 | 249 | |
bcostm | 6:e1d9da7fe856 | 250 | /* Definition for I2Cx Pins */ |
bcostm | 6:e1d9da7fe856 | 251 | #define DISCOVERY_AUDIO_I2Cx_SCL_PIN GPIO_PIN_7 |
bcostm | 6:e1d9da7fe856 | 252 | #define DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_PORT GPIOH |
bcostm | 6:e1d9da7fe856 | 253 | #define DISCOVERY_AUDIO_I2Cx_SCL_SDA_AF GPIO_AF4_I2C3 |
bcostm | 6:e1d9da7fe856 | 254 | #define DISCOVERY_AUDIO_I2Cx_SDA_PIN GPIO_PIN_8 |
bcostm | 6:e1d9da7fe856 | 255 | |
bcostm | 6:e1d9da7fe856 | 256 | /* I2C interrupt requests */ |
bcostm | 6:e1d9da7fe856 | 257 | #define DISCOVERY_AUDIO_I2Cx_EV_IRQn I2C3_EV_IRQn |
bcostm | 6:e1d9da7fe856 | 258 | #define DISCOVERY_AUDIO_I2Cx_ER_IRQn I2C3_ER_IRQn |
bcostm | 6:e1d9da7fe856 | 259 | |
bcostm | 6:e1d9da7fe856 | 260 | /* Definition for external, camera and Arduino connector I2Cx resources */ |
bcostm | 6:e1d9da7fe856 | 261 | #define DISCOVERY_EXT_I2Cx I2C1 |
bcostm | 6:e1d9da7fe856 | 262 | #define DISCOVERY_EXT_I2Cx_CLK_ENABLE() __HAL_RCC_I2C1_CLK_ENABLE() |
bcostm | 6:e1d9da7fe856 | 263 | #define DISCOVERY_EXT_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE() |
bcostm | 6:e1d9da7fe856 | 264 | #define DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE() |
bcostm | 6:e1d9da7fe856 | 265 | |
bcostm | 6:e1d9da7fe856 | 266 | #define DISCOVERY_EXT_I2Cx_FORCE_RESET() __HAL_RCC_I2C1_FORCE_RESET() |
bcostm | 6:e1d9da7fe856 | 267 | #define DISCOVERY_EXT_I2Cx_RELEASE_RESET() __HAL_RCC_I2C1_RELEASE_RESET() |
bcostm | 6:e1d9da7fe856 | 268 | |
bcostm | 6:e1d9da7fe856 | 269 | /* Definition for I2Cx Pins */ |
bcostm | 6:e1d9da7fe856 | 270 | #define DISCOVERY_EXT_I2Cx_SCL_PIN GPIO_PIN_8 |
bcostm | 6:e1d9da7fe856 | 271 | #define DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_PORT GPIOB |
bcostm | 6:e1d9da7fe856 | 272 | #define DISCOVERY_EXT_I2Cx_SCL_SDA_AF GPIO_AF4_I2C1 |
bcostm | 6:e1d9da7fe856 | 273 | #define DISCOVERY_EXT_I2Cx_SDA_PIN GPIO_PIN_9 |
bcostm | 6:e1d9da7fe856 | 274 | |
bcostm | 6:e1d9da7fe856 | 275 | /* I2C interrupt requests */ |
bcostm | 6:e1d9da7fe856 | 276 | #define DISCOVERY_EXT_I2Cx_EV_IRQn I2C1_EV_IRQn |
bcostm | 6:e1d9da7fe856 | 277 | #define DISCOVERY_EXT_I2Cx_ER_IRQn I2C1_ER_IRQn |
bcostm | 6:e1d9da7fe856 | 278 | |
bcostm | 6:e1d9da7fe856 | 279 | /* I2C TIMING Register define when I2C clock source is SYSCLK */ |
bcostm | 6:e1d9da7fe856 | 280 | /* I2C TIMING is calculated from APB1 source clock = 50 MHz */ |
bcostm | 6:e1d9da7fe856 | 281 | /* Due to the big MOFSET capacity for adapting the camera level the rising time is very large (>1us) */ |
bcostm | 6:e1d9da7fe856 | 282 | /* 0x40912732 takes in account the big rising and aims a clock of 100khz */ |
bcostm | 6:e1d9da7fe856 | 283 | #ifndef DISCOVERY_I2Cx_TIMING |
bcostm | 6:e1d9da7fe856 | 284 | #define DISCOVERY_I2Cx_TIMING ((uint32_t)0x40912732) |
bcostm | 6:e1d9da7fe856 | 285 | #endif /* DISCOVERY_I2Cx_TIMING */ |
bcostm | 6:e1d9da7fe856 | 286 | |
bcostm | 6:e1d9da7fe856 | 287 | /** |
bcostm | 6:e1d9da7fe856 | 288 | * @} |
bcostm | 6:e1d9da7fe856 | 289 | */ |
bcostm | 6:e1d9da7fe856 | 290 | |
bcostm | 6:e1d9da7fe856 | 291 | /** |
bcostm | 6:e1d9da7fe856 | 292 | * @} |
bcostm | 6:e1d9da7fe856 | 293 | */ |
bcostm | 6:e1d9da7fe856 | 294 | |
bcostm | 6:e1d9da7fe856 | 295 | /** @defgroup STM32746G_DISCOVERY_LOW_LEVEL_Exported_Macros STM32746G_DISCOVERY_LOW_LEVEL Exported Macros |
bcostm | 6:e1d9da7fe856 | 296 | * @{ |
bcostm | 6:e1d9da7fe856 | 297 | */ |
bcostm | 6:e1d9da7fe856 | 298 | /** |
bcostm | 6:e1d9da7fe856 | 299 | * @} |
bcostm | 6:e1d9da7fe856 | 300 | */ |
bcostm | 6:e1d9da7fe856 | 301 | |
bcostm | 6:e1d9da7fe856 | 302 | /** @addtogroup STM32746G_DISCOVERY_LOW_LEVEL_Exported_Functions |
bcostm | 6:e1d9da7fe856 | 303 | * @{ |
bcostm | 6:e1d9da7fe856 | 304 | */ |
bcostm | 6:e1d9da7fe856 | 305 | uint32_t BSP_GetVersion(void); |
bcostm | 6:e1d9da7fe856 | 306 | void BSP_LED_Init(Led_TypeDef Led); |
bcostm | 6:e1d9da7fe856 | 307 | void BSP_LED_DeInit(Led_TypeDef Led); |
bcostm | 6:e1d9da7fe856 | 308 | void BSP_LED_On(Led_TypeDef Led); |
bcostm | 6:e1d9da7fe856 | 309 | void BSP_LED_Off(Led_TypeDef Led); |
bcostm | 6:e1d9da7fe856 | 310 | void BSP_LED_Toggle(Led_TypeDef Led); |
bcostm | 6:e1d9da7fe856 | 311 | void BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode); |
bcostm | 6:e1d9da7fe856 | 312 | void BSP_PB_DeInit(Button_TypeDef Button); |
bcostm | 6:e1d9da7fe856 | 313 | uint32_t BSP_PB_GetState(Button_TypeDef Button); |
bcostm | 6:e1d9da7fe856 | 314 | void BSP_COM_Init(COM_TypeDef COM, UART_HandleTypeDef *husart); |
bcostm | 6:e1d9da7fe856 | 315 | void BSP_COM_DeInit(COM_TypeDef COM, UART_HandleTypeDef *huart); |
bcostm | 6:e1d9da7fe856 | 316 | |
bcostm | 6:e1d9da7fe856 | 317 | /** |
bcostm | 6:e1d9da7fe856 | 318 | * @} |
bcostm | 6:e1d9da7fe856 | 319 | */ |
bcostm | 6:e1d9da7fe856 | 320 | |
bcostm | 6:e1d9da7fe856 | 321 | /** |
bcostm | 6:e1d9da7fe856 | 322 | * @} |
bcostm | 6:e1d9da7fe856 | 323 | */ |
bcostm | 6:e1d9da7fe856 | 324 | |
bcostm | 6:e1d9da7fe856 | 325 | /** |
bcostm | 6:e1d9da7fe856 | 326 | * @} |
bcostm | 6:e1d9da7fe856 | 327 | */ |
bcostm | 6:e1d9da7fe856 | 328 | |
bcostm | 6:e1d9da7fe856 | 329 | /** |
bcostm | 6:e1d9da7fe856 | 330 | * @} |
bcostm | 6:e1d9da7fe856 | 331 | */ |
bcostm | 6:e1d9da7fe856 | 332 | |
bcostm | 6:e1d9da7fe856 | 333 | #ifdef __cplusplus |
bcostm | 6:e1d9da7fe856 | 334 | } |
bcostm | 6:e1d9da7fe856 | 335 | #endif |
bcostm | 6:e1d9da7fe856 | 336 | |
bcostm | 6:e1d9da7fe856 | 337 | #endif /* __STM32746G_DISCOVERY_H */ |
bcostm | 6:e1d9da7fe856 | 338 | |
bcostm | 6:e1d9da7fe856 | 339 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |