Projet

Dependents:   DISCO-F746NG_Scope_copy

Fork of BSP_DISCO_F746NG by ST

Committer:
bcostm
Date:
Mon Sep 28 13:34:16 2015 +0000
Revision:
0:c9112f0c67e3
Child:
2:458ab1edf6b2
Initial version.

Who changed what in which revision?

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