STM32Cube BSP FW for STM32F769I-Discovery

Dependents:   mbed-os-example-blinky-5 DISCO-F769NI_TOUCHSCREEN_demo_custom_1 Datarecorder2 DISCO-F769NI_TOUCHSCREEN_demo ... more

Committer:
Jerome Coutant
Date:
Thu Feb 23 14:14:08 2017 +0100
Revision:
1:3e58f8a39705
Parent:
0:c0f3bbab73d2
Child:
4:72a949940ad6
Child:
6:05b81d60cdae
STM32Cube_FW_F7_V1.6.0 BSP_DISCO_F769NI

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Jerome Coutant 0:c0f3bbab73d2 1 /**
Jerome Coutant 0:c0f3bbab73d2 2 ******************************************************************************
Jerome Coutant 0:c0f3bbab73d2 3 * @file stm32f769i_discovery.h
Jerome Coutant 0:c0f3bbab73d2 4 * @author MCD Application Team
Jerome Coutant 1:3e58f8a39705 5 * @version V2.0.0
Jerome Coutant 1:3e58f8a39705 6 * @date 30-December-2016
Jerome Coutant 0:c0f3bbab73d2 7 * @brief This file contains definitions for STM32F769I-Discovery LEDs,
Jerome Coutant 0:c0f3bbab73d2 8 * push-buttons hardware resources.
Jerome Coutant 0:c0f3bbab73d2 9 ******************************************************************************
Jerome Coutant 0:c0f3bbab73d2 10 * @attention
Jerome Coutant 0:c0f3bbab73d2 11 *
Jerome Coutant 0:c0f3bbab73d2 12 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
Jerome Coutant 0:c0f3bbab73d2 13 *
Jerome Coutant 0:c0f3bbab73d2 14 * Redistribution and use in source and binary forms, with or without modification,
Jerome Coutant 0:c0f3bbab73d2 15 * are permitted provided that the following conditions are met:
Jerome Coutant 0:c0f3bbab73d2 16 * 1. Redistributions of source code must retain the above copyright notice,
Jerome Coutant 0:c0f3bbab73d2 17 * this list of conditions and the following disclaimer.
Jerome Coutant 0:c0f3bbab73d2 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
Jerome Coutant 0:c0f3bbab73d2 19 * this list of conditions and the following disclaimer in the documentation
Jerome Coutant 0:c0f3bbab73d2 20 * and/or other materials provided with the distribution.
Jerome Coutant 0:c0f3bbab73d2 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Jerome Coutant 0:c0f3bbab73d2 22 * may be used to endorse or promote products derived from this software
Jerome Coutant 0:c0f3bbab73d2 23 * without specific prior written permission.
Jerome Coutant 0:c0f3bbab73d2 24 *
Jerome Coutant 0:c0f3bbab73d2 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Jerome Coutant 0:c0f3bbab73d2 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Jerome Coutant 0:c0f3bbab73d2 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Jerome Coutant 0:c0f3bbab73d2 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Jerome Coutant 0:c0f3bbab73d2 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Jerome Coutant 0:c0f3bbab73d2 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Jerome Coutant 0:c0f3bbab73d2 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Jerome Coutant 0:c0f3bbab73d2 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Jerome Coutant 0:c0f3bbab73d2 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Jerome Coutant 0:c0f3bbab73d2 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Jerome Coutant 0:c0f3bbab73d2 35 *
Jerome Coutant 0:c0f3bbab73d2 36 ******************************************************************************
Jerome Coutant 0:c0f3bbab73d2 37 */
Jerome Coutant 0:c0f3bbab73d2 38
Jerome Coutant 0:c0f3bbab73d2 39 /* Define to prevent recursive inclusion -------------------------------------*/
Jerome Coutant 0:c0f3bbab73d2 40 #ifndef __STM32F769I_DISCOVERY_H
Jerome Coutant 0:c0f3bbab73d2 41 #define __STM32F769I_DISCOVERY_H
Jerome Coutant 0:c0f3bbab73d2 42
Jerome Coutant 0:c0f3bbab73d2 43 #ifdef __cplusplus
Jerome Coutant 0:c0f3bbab73d2 44 extern "C" {
Jerome Coutant 0:c0f3bbab73d2 45 #endif
Jerome Coutant 0:c0f3bbab73d2 46
Jerome Coutant 0:c0f3bbab73d2 47
Jerome Coutant 0:c0f3bbab73d2 48 /* Includes ------------------------------------------------------------------*/
Jerome Coutant 0:c0f3bbab73d2 49 #include "stm32f7xx_hal.h"
Jerome Coutant 0:c0f3bbab73d2 50
Jerome Coutant 0:c0f3bbab73d2 51 /** @addtogroup BSP
Jerome Coutant 0:c0f3bbab73d2 52 * @{
Jerome Coutant 0:c0f3bbab73d2 53 */
Jerome Coutant 0:c0f3bbab73d2 54
Jerome Coutant 1:3e58f8a39705 55 /** @addtogroup STM32F769I_DISCOVERY
Jerome Coutant 0:c0f3bbab73d2 56 * @{
Jerome Coutant 0:c0f3bbab73d2 57 */
Jerome Coutant 0:c0f3bbab73d2 58
Jerome Coutant 1:3e58f8a39705 59 /** @defgroup STM32F769I_DISCOVERY_LOW_LEVEL STM32F769I-Discovery LOW LEVEL
Jerome Coutant 0:c0f3bbab73d2 60 * @{
Jerome Coutant 0:c0f3bbab73d2 61 */
Jerome Coutant 0:c0f3bbab73d2 62
Jerome Coutant 1:3e58f8a39705 63 /** @defgroup STM32F769I_DISCOVERY_LOW_LEVEL_Exported_Types STM32F769I Discovery Low Level Exported Types
Jerome Coutant 0:c0f3bbab73d2 64 * @{
Jerome Coutant 0:c0f3bbab73d2 65 */
Jerome Coutant 0:c0f3bbab73d2 66
Jerome Coutant 0:c0f3bbab73d2 67 /**
Jerome Coutant 0:c0f3bbab73d2 68 * @brief Define for STM32F769I_DISCOVERY board
Jerome Coutant 0:c0f3bbab73d2 69 */
Jerome Coutant 0:c0f3bbab73d2 70 #if !defined (USE_STM32F769I_DISCO)
Jerome Coutant 0:c0f3bbab73d2 71 #define USE_STM32F769I_DISCO
Jerome Coutant 0:c0f3bbab73d2 72 #endif
Jerome Coutant 0:c0f3bbab73d2 73
Jerome Coutant 0:c0f3bbab73d2 74 /** @brief Led_TypeDef
Jerome Coutant 1:3e58f8a39705 75 * STM32F769I_DISCOVERY board leds definitions.
Jerome Coutant 0:c0f3bbab73d2 76 */
Jerome Coutant 0:c0f3bbab73d2 77 typedef enum
Jerome Coutant 0:c0f3bbab73d2 78 {
Jerome Coutant 0:c0f3bbab73d2 79 DISCO_LED1 = 0, // patch for MBED
Jerome Coutant 0:c0f3bbab73d2 80 LED_RED = DISCO_LED1, // patch for MBED
Jerome Coutant 0:c0f3bbab73d2 81 DISCO_LED2 = 1, // patch for MBED
Jerome Coutant 0:c0f3bbab73d2 82 LED_GREEN = DISCO_LED2 // patch for MBED
Jerome Coutant 0:c0f3bbab73d2 83 } Led_TypeDef;
Jerome Coutant 0:c0f3bbab73d2 84
Jerome Coutant 0:c0f3bbab73d2 85 /** @brief Button_TypeDef
Jerome Coutant 1:3e58f8a39705 86 * STM32F769I_DISCOVERY board Buttons definitions.
Jerome Coutant 0:c0f3bbab73d2 87 */
Jerome Coutant 0:c0f3bbab73d2 88 typedef enum
Jerome Coutant 0:c0f3bbab73d2 89 {
Jerome Coutant 0:c0f3bbab73d2 90 BUTTON_WAKEUP = 0,
Jerome Coutant 0:c0f3bbab73d2 91 } Button_TypeDef;
Jerome Coutant 0:c0f3bbab73d2 92
Jerome Coutant 0:c0f3bbab73d2 93 #define BUTTON_USER BUTTON_WAKEUP
Jerome Coutant 0:c0f3bbab73d2 94
Jerome Coutant 0:c0f3bbab73d2 95 /** @brief ButtonMode_TypeDef
Jerome Coutant 1:3e58f8a39705 96 * STM32F769I_DISCOVERY board Buttons Modes definitions.
Jerome Coutant 0:c0f3bbab73d2 97 */
Jerome Coutant 0:c0f3bbab73d2 98 typedef enum
Jerome Coutant 0:c0f3bbab73d2 99 {
Jerome Coutant 0:c0f3bbab73d2 100 BUTTON_MODE_GPIO = 0,
Jerome Coutant 0:c0f3bbab73d2 101 BUTTON_MODE_EXTI = 1
Jerome Coutant 0:c0f3bbab73d2 102
Jerome Coutant 0:c0f3bbab73d2 103 } ButtonMode_TypeDef;
Jerome Coutant 0:c0f3bbab73d2 104
Jerome Coutant 0:c0f3bbab73d2 105 /** @addtogroup Exported_types
Jerome Coutant 0:c0f3bbab73d2 106 * @{
Jerome Coutant 0:c0f3bbab73d2 107 */
Jerome Coutant 0:c0f3bbab73d2 108 typedef enum
Jerome Coutant 0:c0f3bbab73d2 109 {
Jerome Coutant 0:c0f3bbab73d2 110 PB_SET = 0,
Jerome Coutant 0:c0f3bbab73d2 111 PB_RESET = !PB_SET
Jerome Coutant 0:c0f3bbab73d2 112 } ButtonValue_TypeDef;
Jerome Coutant 0:c0f3bbab73d2 113
Jerome Coutant 0:c0f3bbab73d2 114
Jerome Coutant 0:c0f3bbab73d2 115 /** @brief DISCO_Status_TypeDef
Jerome Coutant 0:c0f3bbab73d2 116 * STM32F769I_DISCO board Status return possible values.
Jerome Coutant 0:c0f3bbab73d2 117 */
Jerome Coutant 0:c0f3bbab73d2 118 typedef enum
Jerome Coutant 0:c0f3bbab73d2 119 {
Jerome Coutant 0:c0f3bbab73d2 120 DISCO_OK = 0,
Jerome Coutant 0:c0f3bbab73d2 121 DISCO_ERROR = 1
Jerome Coutant 0:c0f3bbab73d2 122
Jerome Coutant 0:c0f3bbab73d2 123 } DISCO_Status_TypeDef;
Jerome Coutant 0:c0f3bbab73d2 124
Jerome Coutant 0:c0f3bbab73d2 125 /**
Jerome Coutant 0:c0f3bbab73d2 126 * @}
Jerome Coutant 0:c0f3bbab73d2 127 */
Jerome Coutant 0:c0f3bbab73d2 128
Jerome Coutant 1:3e58f8a39705 129 /** @defgroup STM32F769I_DISCOVERY_LOW_LEVEL_Exported_Constants STM32F769I Discovery Low Level Exported Constants
Jerome Coutant 0:c0f3bbab73d2 130 * @{
Jerome Coutant 0:c0f3bbab73d2 131 */
Jerome Coutant 0:c0f3bbab73d2 132
Jerome Coutant 0:c0f3bbab73d2 133
Jerome Coutant 1:3e58f8a39705 134 /** @addtogroup STM32F769I_DISCOVERY_LOW_LEVEL_LED STM32F769I Discovery Low Level Led
Jerome Coutant 0:c0f3bbab73d2 135 * @{
Jerome Coutant 0:c0f3bbab73d2 136 */
Jerome Coutant 0:c0f3bbab73d2 137 /* Always four leds for all revisions of Discovery boards */
Jerome Coutant 0:c0f3bbab73d2 138 #define LEDn ((uint8_t)2)
Jerome Coutant 0:c0f3bbab73d2 139
Jerome Coutant 0:c0f3bbab73d2 140
Jerome Coutant 0:c0f3bbab73d2 141 /* 2 Leds are connected to MCU directly on PJ13 and PJ5 */
Jerome Coutant 0:c0f3bbab73d2 142 #define LED1_GPIO_PORT ((GPIO_TypeDef*)GPIOJ)
Jerome Coutant 0:c0f3bbab73d2 143 #define LED2_GPIO_PORT ((GPIO_TypeDef*)GPIOJ)
Jerome Coutant 0:c0f3bbab73d2 144
Jerome Coutant 0:c0f3bbab73d2 145 #define LEDx_GPIO_CLK_ENABLE() __HAL_RCC_GPIOJ_CLK_ENABLE()
Jerome Coutant 0:c0f3bbab73d2 146 #define LEDx_GPIO_CLK_DISABLE() __HAL_RCC_GPIOJ_CLK_DISABLE()
Jerome Coutant 0:c0f3bbab73d2 147
Jerome Coutant 0:c0f3bbab73d2 148 #define LED1_PIN ((uint32_t)GPIO_PIN_13)
Jerome Coutant 0:c0f3bbab73d2 149 #define LED2_PIN ((uint32_t)GPIO_PIN_5)
Jerome Coutant 0:c0f3bbab73d2 150
Jerome Coutant 0:c0f3bbab73d2 151 /**
Jerome Coutant 0:c0f3bbab73d2 152 * @}
Jerome Coutant 0:c0f3bbab73d2 153 */
Jerome Coutant 0:c0f3bbab73d2 154
Jerome Coutant 1:3e58f8a39705 155 /** @addtogroup STM32F769I_DISCOVERY_LOW_LEVEL_BUTTON STM32F769I Discovery Low Level Button
Jerome Coutant 0:c0f3bbab73d2 156 * @{
Jerome Coutant 0:c0f3bbab73d2 157 */
Jerome Coutant 0:c0f3bbab73d2 158 /* Only one User/Wakeup button */
Jerome Coutant 0:c0f3bbab73d2 159 #define BUTTONn ((uint8_t)1)
Jerome Coutant 0:c0f3bbab73d2 160
Jerome Coutant 0:c0f3bbab73d2 161 /**
Jerome Coutant 0:c0f3bbab73d2 162 * @brief Wakeup push-button
Jerome Coutant 0:c0f3bbab73d2 163 */
Jerome Coutant 0:c0f3bbab73d2 164 #define WAKEUP_BUTTON_PIN GPIO_PIN_0
Jerome Coutant 0:c0f3bbab73d2 165 #define WAKEUP_BUTTON_GPIO_PORT GPIOA
Jerome Coutant 0:c0f3bbab73d2 166 #define WAKEUP_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
Jerome Coutant 0:c0f3bbab73d2 167 #define WAKEUP_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
Jerome Coutant 0:c0f3bbab73d2 168 #define WAKEUP_BUTTON_EXTI_IRQn EXTI0_IRQn
Jerome Coutant 0:c0f3bbab73d2 169
Jerome Coutant 0:c0f3bbab73d2 170 /* Define the USER button as an alias of the Wakeup button */
Jerome Coutant 0:c0f3bbab73d2 171 #define USER_BUTTON_PIN WAKEUP_BUTTON_PIN
Jerome Coutant 0:c0f3bbab73d2 172 #define USER_BUTTON_GPIO_PORT WAKEUP_BUTTON_GPIO_PORT
Jerome Coutant 0:c0f3bbab73d2 173 #define USER_BUTTON_GPIO_CLK_ENABLE() WAKEUP_BUTTON_GPIO_CLK_ENABLE()
Jerome Coutant 0:c0f3bbab73d2 174 #define USER_BUTTON_GPIO_CLK_DISABLE() WAKEUP_BUTTON_GPIO_CLK_DISABLE()
Jerome Coutant 0:c0f3bbab73d2 175 #define USER_BUTTON_EXTI_IRQn WAKEUP_BUTTON_EXTI_IRQn
Jerome Coutant 0:c0f3bbab73d2 176
Jerome Coutant 0:c0f3bbab73d2 177 #define BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
Jerome Coutant 0:c0f3bbab73d2 178
Jerome Coutant 0:c0f3bbab73d2 179 /**
Jerome Coutant 0:c0f3bbab73d2 180 * @}
Jerome Coutant 0:c0f3bbab73d2 181 */
Jerome Coutant 0:c0f3bbab73d2 182
Jerome Coutant 0:c0f3bbab73d2 183 /**
Jerome Coutant 0:c0f3bbab73d2 184 * @brief USB OTG HS Over Current signal
Jerome Coutant 0:c0f3bbab73d2 185 */
Jerome Coutant 0:c0f3bbab73d2 186 #define OTG_HS_OVER_CURRENT_PIN GPIO_PIN_4
Jerome Coutant 0:c0f3bbab73d2 187 #define OTG_HS_OVER_CURRENT_PORT GPIOD
Jerome Coutant 0:c0f3bbab73d2 188 #define OTG_HS_OVER_CURRENT_PORT_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
Jerome Coutant 0:c0f3bbab73d2 189
Jerome Coutant 0:c0f3bbab73d2 190 /**
Jerome Coutant 0:c0f3bbab73d2 191 * @brief SD-detect signal
Jerome Coutant 0:c0f3bbab73d2 192 */
Jerome Coutant 0:c0f3bbab73d2 193 #define SD_DETECT_PIN ((uint32_t)GPIO_PIN_15)
Jerome Coutant 0:c0f3bbab73d2 194 #define SD_DETECT_GPIO_PORT ((GPIO_TypeDef*)GPIOI)
Jerome Coutant 0:c0f3bbab73d2 195 #define SD_DETECT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
Jerome Coutant 0:c0f3bbab73d2 196 #define SD_DETECT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
Jerome Coutant 0:c0f3bbab73d2 197 #define SD_DETECT_EXTI_IRQn EXTI15_10_IRQn
Jerome Coutant 0:c0f3bbab73d2 198
Jerome Coutant 0:c0f3bbab73d2 199 /**
Jerome Coutant 0:c0f3bbab73d2 200 * @brief Touch screen interrupt signal
Jerome Coutant 0:c0f3bbab73d2 201 */
Jerome Coutant 0:c0f3bbab73d2 202 #define TS_INT_PIN ((uint32_t)GPIO_PIN_13)
Jerome Coutant 0:c0f3bbab73d2 203 #define TS_INT_GPIO_PORT ((GPIO_TypeDef*)GPIOI)
Jerome Coutant 0:c0f3bbab73d2 204 #define TS_INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
Jerome Coutant 0:c0f3bbab73d2 205 #define TS_INT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
Jerome Coutant 0:c0f3bbab73d2 206 #define TS_INT_EXTI_IRQn EXTI15_10_IRQn
Jerome Coutant 0:c0f3bbab73d2 207
Jerome Coutant 0:c0f3bbab73d2 208 /**
Jerome Coutant 1:3e58f8a39705 209 * @brief TouchScreen FT6206 Slave I2C address 1
Jerome Coutant 0:c0f3bbab73d2 210 */
Jerome Coutant 0:c0f3bbab73d2 211 #define TS_I2C_ADDRESS ((uint16_t)0x54)
Jerome Coutant 0:c0f3bbab73d2 212
Jerome Coutant 0:c0f3bbab73d2 213 /**
Jerome Coutant 1:3e58f8a39705 214 * @brief TouchScreen FT6336G Slave I2C address 2
Jerome Coutant 1:3e58f8a39705 215 */
Jerome Coutant 1:3e58f8a39705 216 #define TS_I2C_ADDRESS_A02 ((uint16_t)0x70)
Jerome Coutant 1:3e58f8a39705 217
Jerome Coutant 1:3e58f8a39705 218 /**
Jerome Coutant 0:c0f3bbab73d2 219 * @brief Audio I2C Slave address
Jerome Coutant 0:c0f3bbab73d2 220 */
Jerome Coutant 0:c0f3bbab73d2 221 #define AUDIO_I2C_ADDRESS ((uint16_t)0x34)
Jerome Coutant 0:c0f3bbab73d2 222
Jerome Coutant 0:c0f3bbab73d2 223 /**
Jerome Coutant 0:c0f3bbab73d2 224 * @brief EEPROM I2C Slave address 1
Jerome Coutant 0:c0f3bbab73d2 225 */
Jerome Coutant 0:c0f3bbab73d2 226 #define EEPROM_I2C_ADDRESS_A01 ((uint16_t)0xA0)
Jerome Coutant 0:c0f3bbab73d2 227
Jerome Coutant 0:c0f3bbab73d2 228 /**
Jerome Coutant 0:c0f3bbab73d2 229 * @brief EEPROM I2C Slave address 2
Jerome Coutant 0:c0f3bbab73d2 230 */
Jerome Coutant 0:c0f3bbab73d2 231 #define EEPROM_I2C_ADDRESS_A02 ((uint16_t)0xA6)
Jerome Coutant 0:c0f3bbab73d2 232
Jerome Coutant 0:c0f3bbab73d2 233 /**
Jerome Coutant 0:c0f3bbab73d2 234 * @brief User can use this section to tailor I2C4/I2C4 instance used and associated
Jerome Coutant 0:c0f3bbab73d2 235 * resources (audio codec).
Jerome Coutant 0:c0f3bbab73d2 236 * Definition for I2C4 clock resources
Jerome Coutant 0:c0f3bbab73d2 237 */
Jerome Coutant 0:c0f3bbab73d2 238 #define DISCOVERY_AUDIO_I2Cx I2C4
Jerome Coutant 0:c0f3bbab73d2 239 #define DISCOVERY_AUDIO_I2Cx_CLK_ENABLE() __HAL_RCC_I2C4_CLK_ENABLE()
Jerome Coutant 0:c0f3bbab73d2 240 #define DISCOVERY_AUDIO_I2Cx_SCL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
Jerome Coutant 0:c0f3bbab73d2 241 #define DISCOVERY_AUDIO_I2Cx_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
Jerome Coutant 0:c0f3bbab73d2 242
Jerome Coutant 0:c0f3bbab73d2 243 #define DISCOVERY_AUDIO_I2Cx_FORCE_RESET() __HAL_RCC_I2C4_FORCE_RESET()
Jerome Coutant 0:c0f3bbab73d2 244 #define DISCOVERY_AUDIO_I2Cx_RELEASE_RESET() __HAL_RCC_I2C4_RELEASE_RESET()
Jerome Coutant 0:c0f3bbab73d2 245
Jerome Coutant 0:c0f3bbab73d2 246 /** @brief Definition for I2C4 Pins
Jerome Coutant 0:c0f3bbab73d2 247 */
Jerome Coutant 0:c0f3bbab73d2 248 #define DISCOVERY_AUDIO_I2Cx_SCL_PIN GPIO_PIN_12 /*!< PD12 */
Jerome Coutant 0:c0f3bbab73d2 249 #define DISCOVERY_AUDIO_I2Cx_SCL_AF GPIO_AF4_I2C4
Jerome Coutant 0:c0f3bbab73d2 250 #define DISCOVERY_AUDIO_I2Cx_SCL_GPIO_PORT GPIOD
Jerome Coutant 0:c0f3bbab73d2 251 #define DISCOVERY_AUDIO_I2Cx_SDA_PIN GPIO_PIN_7 /*!< PB7 */
Jerome Coutant 0:c0f3bbab73d2 252 #define DISCOVERY_AUDIO_I2Cx_SDA_AF GPIO_AF11_I2C4
Jerome Coutant 0:c0f3bbab73d2 253 #define DISCOVERY_AUDIO_I2Cx_SDA_GPIO_PORT GPIOB
Jerome Coutant 0:c0f3bbab73d2 254 /** @brief Definition of I2C4 interrupt requests
Jerome Coutant 0:c0f3bbab73d2 255 */
Jerome Coutant 0:c0f3bbab73d2 256 #define DISCOVERY_AUDIO_I2Cx_EV_IRQn I2C4_EV_IRQn
Jerome Coutant 0:c0f3bbab73d2 257 #define DISCOVERY_AUDIO_I2Cx_ER_IRQn I2C4_ER_IRQn
Jerome Coutant 0:c0f3bbab73d2 258
Jerome Coutant 0:c0f3bbab73d2 259 /**
Jerome Coutant 0:c0f3bbab73d2 260 * @brief User can use this section to tailor I2C1/I2C1 instance used and associated
Jerome Coutant 0:c0f3bbab73d2 261 * resources.
Jerome Coutant 0:c0f3bbab73d2 262 * Definition for I2C1 clock resources
Jerome Coutant 0:c0f3bbab73d2 263 */
Jerome Coutant 0:c0f3bbab73d2 264 #define DISCOVERY_EXT_I2Cx I2C1
Jerome Coutant 0:c0f3bbab73d2 265 #define DISCOVERY_EXT_I2Cx_CLK_ENABLE() __HAL_RCC_I2C1_CLK_ENABLE()
Jerome Coutant 0:c0f3bbab73d2 266 #define DISCOVERY_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
Jerome Coutant 0:c0f3bbab73d2 267 #define DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
Jerome Coutant 0:c0f3bbab73d2 268
Jerome Coutant 0:c0f3bbab73d2 269 #define DISCOVERY_EXT_I2Cx_FORCE_RESET() __HAL_RCC_I2C1_FORCE_RESET()
Jerome Coutant 0:c0f3bbab73d2 270 #define DISCOVERY_EXT_I2Cx_RELEASE_RESET() __HAL_RCC_I2C1_RELEASE_RESET()
Jerome Coutant 0:c0f3bbab73d2 271
Jerome Coutant 0:c0f3bbab73d2 272 /** @brief Definition for I2C1 Pins
Jerome Coutant 0:c0f3bbab73d2 273 */
Jerome Coutant 0:c0f3bbab73d2 274 #define DISCOVERY_EXT_I2Cx_SCL_PIN GPIO_PIN_8 /*!< PB8 */
Jerome Coutant 0:c0f3bbab73d2 275 #define DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_PORT GPIOB
Jerome Coutant 0:c0f3bbab73d2 276 #define DISCOVERY_EXT_I2Cx_SCL_SDA_AF GPIO_AF4_I2C1
Jerome Coutant 0:c0f3bbab73d2 277 #define DISCOVERY_EXT_I2Cx_SDA_PIN GPIO_PIN_9 /*!< PB9 */
Jerome Coutant 0:c0f3bbab73d2 278
Jerome Coutant 0:c0f3bbab73d2 279 /** @brief Definition of I2C interrupt requests
Jerome Coutant 0:c0f3bbab73d2 280 */
Jerome Coutant 0:c0f3bbab73d2 281 #define DISCOVERY_EXT_I2Cx_EV_IRQn I2C1_EV_IRQn
Jerome Coutant 0:c0f3bbab73d2 282 #define DISCOVERY_EXT_I2Cx_ER_IRQn I2C1_ER_IRQn
Jerome Coutant 0:c0f3bbab73d2 283
Jerome Coutant 0:c0f3bbab73d2 284 /* I2C TIMING Register define when I2C clock source is SYSCLK */
Jerome Coutant 0:c0f3bbab73d2 285 /* I2C TIMING is calculated from APB1 source clock = 50 MHz */
Jerome Coutant 0:c0f3bbab73d2 286 /* Due to the big MOFSET capacity for adapting the camera level the rising time is very large (>1us) */
Jerome Coutant 0:c0f3bbab73d2 287 /* 0x40912732 takes in account the big rising and aims a clock of 100khz */
Jerome Coutant 0:c0f3bbab73d2 288 #ifndef DISCOVERY_I2Cx_TIMING
Jerome Coutant 0:c0f3bbab73d2 289 #define DISCOVERY_I2Cx_TIMING ((uint32_t)0x40912732)
Jerome Coutant 0:c0f3bbab73d2 290 #endif /* DISCOVERY_I2Cx_TIMING */
Jerome Coutant 0:c0f3bbab73d2 291
Jerome Coutant 0:c0f3bbab73d2 292
Jerome Coutant 0:c0f3bbab73d2 293 /**
Jerome Coutant 0:c0f3bbab73d2 294 * @}
Jerome Coutant 0:c0f3bbab73d2 295 */
Jerome Coutant 0:c0f3bbab73d2 296
Jerome Coutant 1:3e58f8a39705 297 /** @defgroup STM32F769I_DISCOVERY_LOW_LEVEL_Exported_Macros STM32F769I Discovery Low Level Exported Macros
Jerome Coutant 0:c0f3bbab73d2 298 * @{
Jerome Coutant 0:c0f3bbab73d2 299 */
Jerome Coutant 0:c0f3bbab73d2 300 /**
Jerome Coutant 0:c0f3bbab73d2 301 * @}
Jerome Coutant 0:c0f3bbab73d2 302 */
Jerome Coutant 0:c0f3bbab73d2 303
Jerome Coutant 1:3e58f8a39705 304 /** @defgroup STM32F769I_DISCOVERY_LOW_LEVEL_Exported_Functions STM32F769I Discovery Low Level Exported Functions
Jerome Coutant 0:c0f3bbab73d2 305 * @{
Jerome Coutant 0:c0f3bbab73d2 306 */
Jerome Coutant 0:c0f3bbab73d2 307 uint32_t BSP_GetVersion(void);
Jerome Coutant 0:c0f3bbab73d2 308 void BSP_LED_Init(Led_TypeDef Led);
Jerome Coutant 0:c0f3bbab73d2 309 void BSP_LED_DeInit(Led_TypeDef Led);
Jerome Coutant 0:c0f3bbab73d2 310 void BSP_LED_On(Led_TypeDef Led);
Jerome Coutant 0:c0f3bbab73d2 311 void BSP_LED_Off(Led_TypeDef Led);
Jerome Coutant 0:c0f3bbab73d2 312 void BSP_LED_Toggle(Led_TypeDef Led);
Jerome Coutant 0:c0f3bbab73d2 313 void BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode);
Jerome Coutant 0:c0f3bbab73d2 314 void BSP_PB_DeInit(Button_TypeDef Button);
Jerome Coutant 0:c0f3bbab73d2 315 uint32_t BSP_PB_GetState(Button_TypeDef Button);
Jerome Coutant 0:c0f3bbab73d2 316
Jerome Coutant 0:c0f3bbab73d2 317 /**
Jerome Coutant 0:c0f3bbab73d2 318 * @}
Jerome Coutant 0:c0f3bbab73d2 319 */
Jerome Coutant 0:c0f3bbab73d2 320
Jerome Coutant 0:c0f3bbab73d2 321 /**
Jerome Coutant 0:c0f3bbab73d2 322 * @}
Jerome Coutant 0:c0f3bbab73d2 323 */
Jerome Coutant 0:c0f3bbab73d2 324
Jerome Coutant 0:c0f3bbab73d2 325 /**
Jerome Coutant 0:c0f3bbab73d2 326 * @}
Jerome Coutant 0:c0f3bbab73d2 327 */
Jerome Coutant 0:c0f3bbab73d2 328
Jerome Coutant 0:c0f3bbab73d2 329 /**
Jerome Coutant 0:c0f3bbab73d2 330 * @}
Jerome Coutant 0:c0f3bbab73d2 331 */
Jerome Coutant 0:c0f3bbab73d2 332
Jerome Coutant 0:c0f3bbab73d2 333 /**
Jerome Coutant 0:c0f3bbab73d2 334 * @}
Jerome Coutant 0:c0f3bbab73d2 335 */
Jerome Coutant 0:c0f3bbab73d2 336
Jerome Coutant 0:c0f3bbab73d2 337
Jerome Coutant 0:c0f3bbab73d2 338 #ifdef __cplusplus
Jerome Coutant 0:c0f3bbab73d2 339 }
Jerome Coutant 0:c0f3bbab73d2 340 #endif
Jerome Coutant 0:c0f3bbab73d2 341
Jerome Coutant 0:c0f3bbab73d2 342 #endif /* __STM32F769I_DISCOVERY_H */
Jerome Coutant 0:c0f3bbab73d2 343
Jerome Coutant 0:c0f3bbab73d2 344 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/