STM32F429ZI Discovery board drivers

Dependents:   2a 2b 2c 2d1 ... more

Committer:
Jerome Coutant
Date:
Wed Feb 28 13:17:14 2018 +0100
Revision:
2:53d9067a4feb
Parent:
1:2371382139dd
STM32Cube_FW_F4_V1.19.0 BSP_DISCO_F429ZI

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Jerome Coutant 1:2371382139dd 1 /**
Jerome Coutant 1:2371382139dd 2 ******************************************************************************
Jerome Coutant 1:2371382139dd 3 * @file stm32f429i_discovery.h
Jerome Coutant 1:2371382139dd 4 * @author MCD Application Team
Jerome Coutant 1:2371382139dd 5 * @brief This file contains definitions for STM32F429I-Discovery Kit LEDs,
Jerome Coutant 1:2371382139dd 6 * push-buttons hardware resources.
Jerome Coutant 1:2371382139dd 7 ******************************************************************************
Jerome Coutant 1:2371382139dd 8 * @attention
Jerome Coutant 1:2371382139dd 9 *
Jerome Coutant 1:2371382139dd 10 * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
Jerome Coutant 1:2371382139dd 11 *
Jerome Coutant 1:2371382139dd 12 * Redistribution and use in source and binary forms, with or without modification,
Jerome Coutant 1:2371382139dd 13 * are permitted provided that the following conditions are met:
Jerome Coutant 1:2371382139dd 14 * 1. Redistributions of source code must retain the above copyright notice,
Jerome Coutant 1:2371382139dd 15 * this list of conditions and the following disclaimer.
Jerome Coutant 1:2371382139dd 16 * 2. Redistributions in binary form must reproduce the above copyright notice,
Jerome Coutant 1:2371382139dd 17 * this list of conditions and the following disclaimer in the documentation
Jerome Coutant 1:2371382139dd 18 * and/or other materials provided with the distribution.
Jerome Coutant 1:2371382139dd 19 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Jerome Coutant 1:2371382139dd 20 * may be used to endorse or promote products derived from this software
Jerome Coutant 1:2371382139dd 21 * without specific prior written permission.
Jerome Coutant 1:2371382139dd 22 *
Jerome Coutant 1:2371382139dd 23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Jerome Coutant 1:2371382139dd 24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Jerome Coutant 1:2371382139dd 25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Jerome Coutant 1:2371382139dd 26 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Jerome Coutant 1:2371382139dd 27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Jerome Coutant 1:2371382139dd 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Jerome Coutant 1:2371382139dd 29 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Jerome Coutant 1:2371382139dd 30 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Jerome Coutant 1:2371382139dd 31 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Jerome Coutant 1:2371382139dd 32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Jerome Coutant 1:2371382139dd 33 *
Jerome Coutant 1:2371382139dd 34 ******************************************************************************
Jerome Coutant 1:2371382139dd 35 */
Jerome Coutant 1:2371382139dd 36
Jerome Coutant 1:2371382139dd 37 /* Define to prevent recursive inclusion -------------------------------------*/
Jerome Coutant 1:2371382139dd 38 #ifndef __STM32F429I_DISCOVERY_H
Jerome Coutant 1:2371382139dd 39 #define __STM32F429I_DISCOVERY_H
Jerome Coutant 1:2371382139dd 40
Jerome Coutant 1:2371382139dd 41 #ifdef __cplusplus
Jerome Coutant 1:2371382139dd 42 extern "C" {
Jerome Coutant 1:2371382139dd 43 #endif
Jerome Coutant 1:2371382139dd 44
Jerome Coutant 1:2371382139dd 45 /* Includes ------------------------------------------------------------------*/
Jerome Coutant 1:2371382139dd 46 #include "stm32f4xx_hal.h"
Jerome Coutant 1:2371382139dd 47
Jerome Coutant 1:2371382139dd 48 #define EE_M24LR64 1 // Added for mbed
Jerome Coutant 1:2371382139dd 49
Jerome Coutant 1:2371382139dd 50 /** @addtogroup BSP
Jerome Coutant 1:2371382139dd 51 * @{
Jerome Coutant 1:2371382139dd 52 */
Jerome Coutant 1:2371382139dd 53
Jerome Coutant 1:2371382139dd 54 /** @addtogroup STM32F429I_DISCOVERY
Jerome Coutant 1:2371382139dd 55 * @{
Jerome Coutant 1:2371382139dd 56 */
Jerome Coutant 1:2371382139dd 57
Jerome Coutant 1:2371382139dd 58 /** @addtogroup STM32F429I_DISCOVERY_LOW_LEVEL
Jerome Coutant 1:2371382139dd 59 * @{
Jerome Coutant 1:2371382139dd 60 */
Jerome Coutant 1:2371382139dd 61
Jerome Coutant 1:2371382139dd 62 /** @addtogroup STM32F429I_DISCOVERY_LOW_LEVEL_Exported_Types STM32F429I DISCOVERY LOW LEVEL Exported Types
Jerome Coutant 1:2371382139dd 63 * @{
Jerome Coutant 1:2371382139dd 64 */
Jerome Coutant 1:2371382139dd 65 typedef enum
Jerome Coutant 1:2371382139dd 66 {
Jerome Coutant 1:2371382139dd 67 DISCO_LED3 = 0,
Jerome Coutant 1:2371382139dd 68 DISCO_LED4 = 1
Jerome Coutant 1:2371382139dd 69 }Led_TypeDef;
Jerome Coutant 1:2371382139dd 70
Jerome Coutant 1:2371382139dd 71 typedef enum
Jerome Coutant 1:2371382139dd 72 {
Jerome Coutant 1:2371382139dd 73 BUTTON_KEY = 0,
Jerome Coutant 1:2371382139dd 74 }Button_TypeDef;
Jerome Coutant 1:2371382139dd 75
Jerome Coutant 1:2371382139dd 76 typedef enum
Jerome Coutant 1:2371382139dd 77 {
Jerome Coutant 1:2371382139dd 78 BUTTON_MODE_GPIO = 0,
Jerome Coutant 1:2371382139dd 79 BUTTON_MODE_EXTI = 1
Jerome Coutant 1:2371382139dd 80 }ButtonMode_TypeDef;
Jerome Coutant 1:2371382139dd 81
Jerome Coutant 1:2371382139dd 82 /**
Jerome Coutant 1:2371382139dd 83 * @}
Jerome Coutant 1:2371382139dd 84 */
Jerome Coutant 1:2371382139dd 85
Jerome Coutant 1:2371382139dd 86 /** @defgroup STM32F429I_DISCOVERY_LOW_LEVEL_Exported_Constants STM32F429I DISCOVERY LOW LEVEL Exported Constants
Jerome Coutant 1:2371382139dd 87 * @{
Jerome Coutant 1:2371382139dd 88 */
Jerome Coutant 1:2371382139dd 89
Jerome Coutant 1:2371382139dd 90 /**
Jerome Coutant 1:2371382139dd 91 * @brief Define for STM32F429I_DISCO board
Jerome Coutant 1:2371382139dd 92 */
Jerome Coutant 1:2371382139dd 93 #if !defined (USE_STM32F429I_DISCO)
Jerome Coutant 1:2371382139dd 94 #define USE_STM32F429I_DISCO
Jerome Coutant 1:2371382139dd 95 #endif
Jerome Coutant 1:2371382139dd 96
Jerome Coutant 1:2371382139dd 97 /** @defgroup STM32F429I_DISCOVERY_LOW_LEVEL_LED STM32F429I DISCOVERY LOW LEVEL LED
Jerome Coutant 1:2371382139dd 98 * @{
Jerome Coutant 1:2371382139dd 99 */
Jerome Coutant 1:2371382139dd 100 #define LEDn 2
Jerome Coutant 1:2371382139dd 101
Jerome Coutant 1:2371382139dd 102 #define LED3_PIN GPIO_PIN_13
Jerome Coutant 1:2371382139dd 103 #define LED3_GPIO_PORT GPIOG
Jerome Coutant 1:2371382139dd 104 #define LED3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
Jerome Coutant 1:2371382139dd 105 #define LED3_GPIO_CLK_DISABLE() __HAL_RCC_GPIOG_CLK_DISABLE()
Jerome Coutant 1:2371382139dd 106
Jerome Coutant 1:2371382139dd 107 #define LED4_PIN GPIO_PIN_14
Jerome Coutant 1:2371382139dd 108 #define LED4_GPIO_PORT GPIOG
Jerome Coutant 1:2371382139dd 109 #define LED4_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
Jerome Coutant 1:2371382139dd 110 #define LED4_GPIO_CLK_DISABLE() __HAL_RCC_GPIOG_CLK_DISABLE()
Jerome Coutant 1:2371382139dd 111
Jerome Coutant 1:2371382139dd 112 #define LEDx_GPIO_CLK_ENABLE(__INDEX__) do{if((__INDEX__) == 0) LED3_GPIO_CLK_ENABLE(); else \
Jerome Coutant 1:2371382139dd 113 if((__INDEX__) == 1) LED4_GPIO_CLK_ENABLE(); \
Jerome Coutant 1:2371382139dd 114 }while(0)
Jerome Coutant 1:2371382139dd 115 #define LEDx_GPIO_CLK_DISABLE(__INDEX__) do{if((__INDEX__) == 0) LED3_GPIO_CLK_DISABLE(); else \
Jerome Coutant 1:2371382139dd 116 if((__INDEX__) == 1) LED4_GPIO_CLK_DISABLE(); \
Jerome Coutant 1:2371382139dd 117 }while(0)
Jerome Coutant 1:2371382139dd 118 /**
Jerome Coutant 1:2371382139dd 119 * @}
Jerome Coutant 1:2371382139dd 120 */
Jerome Coutant 1:2371382139dd 121
Jerome Coutant 1:2371382139dd 122 /** @defgroup STM32F429I_DISCOVERY_LOW_LEVEL_BUTTON STM32F429I DISCOVERY LOW LEVEL BUTTON
Jerome Coutant 1:2371382139dd 123 * @{
Jerome Coutant 1:2371382139dd 124 */
Jerome Coutant 1:2371382139dd 125 #define BUTTONn 1
Jerome Coutant 1:2371382139dd 126
Jerome Coutant 1:2371382139dd 127 /**
Jerome Coutant 1:2371382139dd 128 * @brief Wakeup push-button
Jerome Coutant 1:2371382139dd 129 */
Jerome Coutant 1:2371382139dd 130 #define KEY_BUTTON_PIN GPIO_PIN_0
Jerome Coutant 1:2371382139dd 131 #define KEY_BUTTON_GPIO_PORT GPIOA
Jerome Coutant 1:2371382139dd 132 #define KEY_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
Jerome Coutant 1:2371382139dd 133 #define KEY_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
Jerome Coutant 1:2371382139dd 134 #define KEY_BUTTON_EXTI_IRQn EXTI0_IRQn
Jerome Coutant 1:2371382139dd 135
Jerome Coutant 1:2371382139dd 136 #define BUTTONx_GPIO_CLK_ENABLE(__INDEX__) do{if((__INDEX__) == 0) KEY_BUTTON_GPIO_CLK_ENABLE(); \
Jerome Coutant 1:2371382139dd 137 }while(0)
Jerome Coutant 1:2371382139dd 138 #define BUTTONx_GPIO_CLK_DISABLE(__INDEX__) do{if((__INDEX__) == 0) KEY_BUTTON_GPIO_CLK_DISABLE(); \
Jerome Coutant 1:2371382139dd 139 }while(0)
Jerome Coutant 1:2371382139dd 140 /**
Jerome Coutant 1:2371382139dd 141 * @}
Jerome Coutant 1:2371382139dd 142 */
Jerome Coutant 1:2371382139dd 143
Jerome Coutant 1:2371382139dd 144 /** @defgroup STM32F429I_DISCOVERY_LOW_LEVEL_BUS STM32F429I DISCOVERY LOW LEVEL BUS
Jerome Coutant 1:2371382139dd 145 * @{
Jerome Coutant 1:2371382139dd 146 */
Jerome Coutant 1:2371382139dd 147 /* Exported constanIO --------------------------------------------------------*/
Jerome Coutant 1:2371382139dd 148 #define IO_I2C_ADDRESS 0x82
Jerome Coutant 1:2371382139dd 149 #define TS_I2C_ADDRESS 0x82
Jerome Coutant 1:2371382139dd 150
Jerome Coutant 1:2371382139dd 151 #ifdef EE_M24LR64
Jerome Coutant 1:2371382139dd 152 #define EEPROM_I2C_ADDRESS_A01 0xA0
Jerome Coutant 1:2371382139dd 153 #define EEPROM_I2C_ADDRESS_A02 0xA6
Jerome Coutant 1:2371382139dd 154 #endif /* EE_M24LR64 */
Jerome Coutant 1:2371382139dd 155
Jerome Coutant 1:2371382139dd 156 /*############################### I2Cx #######################################*/
Jerome Coutant 1:2371382139dd 157 /* User can use this section to tailor I2Cx instance used and associated
Jerome Coutant 1:2371382139dd 158 resources */
Jerome Coutant 1:2371382139dd 159 #define DISCOVERY_I2Cx I2C3
Jerome Coutant 1:2371382139dd 160 #define DISCOVERY_I2Cx_CLOCK_ENABLE() __HAL_RCC_I2C3_CLK_ENABLE()
Jerome Coutant 1:2371382139dd 161 #define DISCOVERY_I2Cx_FORCE_RESET() __HAL_RCC_I2C3_FORCE_RESET()
Jerome Coutant 1:2371382139dd 162 #define DISCOVERY_I2Cx_RELEASE_RESET() __HAL_RCC_I2C3_RELEASE_RESET()
Jerome Coutant 1:2371382139dd 163 #define DISCOVERY_I2Cx_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
Jerome Coutant 1:2371382139dd 164 #define DISCOVERY_I2Cx_SCL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
Jerome Coutant 1:2371382139dd 165 #define DISCOVERY_I2Cx_SDA_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
Jerome Coutant 1:2371382139dd 166
Jerome Coutant 1:2371382139dd 167 /* Definition for DISCO I2Cx Pins */
Jerome Coutant 1:2371382139dd 168 #define DISCOVERY_I2Cx_SCL_PIN GPIO_PIN_8
Jerome Coutant 1:2371382139dd 169 #define DISCOVERY_I2Cx_SCL_GPIO_PORT GPIOA
Jerome Coutant 1:2371382139dd 170 #define DISCOVERY_I2Cx_SCL_SDA_AF GPIO_AF4_I2C3
Jerome Coutant 1:2371382139dd 171 #define DISCOVERY_I2Cx_SDA_PIN GPIO_PIN_9
Jerome Coutant 1:2371382139dd 172 #define DISCOVERY_I2Cx_SDA_GPIO_PORT GPIOC
Jerome Coutant 1:2371382139dd 173
Jerome Coutant 1:2371382139dd 174 /* Definition for IOE I2Cx's NVIC */
Jerome Coutant 1:2371382139dd 175 #define DISCOVERY_I2Cx_EV_IRQn I2C3_EV_IRQn
Jerome Coutant 1:2371382139dd 176 #define DISCOVERY_I2Cx_ER_IRQn I2C3_ER_IRQn
Jerome Coutant 1:2371382139dd 177
Jerome Coutant 1:2371382139dd 178 /* I2C clock speed configuration (in Hz)
Jerome Coutant 1:2371382139dd 179 WARNING:
Jerome Coutant 1:2371382139dd 180 Make sure that this define is not already declared in other files.
Jerome Coutant 1:2371382139dd 181 It can be used in parallel by other modules. */
Jerome Coutant 1:2371382139dd 182 #ifndef BSP_I2C_SPEED
Jerome Coutant 1:2371382139dd 183 #define BSP_I2C_SPEED 100000
Jerome Coutant 1:2371382139dd 184 #endif /* BSP_I2C_SPEED */
Jerome Coutant 1:2371382139dd 185
Jerome Coutant 1:2371382139dd 186 #define I2Cx_TIMEOUT_MAX 0x3000 /*<! The value of the maximal timeout for I2C waiting loops */
Jerome Coutant 1:2371382139dd 187
Jerome Coutant 1:2371382139dd 188 /*############################### SPIx #######################################*/
Jerome Coutant 1:2371382139dd 189 #define DISCOVERY_SPIx SPI5
Jerome Coutant 1:2371382139dd 190 #define DISCOVERY_SPIx_CLK_ENABLE() __HAL_RCC_SPI5_CLK_ENABLE()
Jerome Coutant 1:2371382139dd 191 #define DISCOVERY_SPIx_GPIO_PORT GPIOF /* GPIOF */
Jerome Coutant 1:2371382139dd 192 #define DISCOVERY_SPIx_AF GPIO_AF5_SPI5
Jerome Coutant 1:2371382139dd 193 #define DISCOVERY_SPIx_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE()
Jerome Coutant 1:2371382139dd 194 #define DISCOVERY_SPIx_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE()
Jerome Coutant 1:2371382139dd 195 #define DISCOVERY_SPIx_SCK_PIN GPIO_PIN_7 /* PF.07 */
Jerome Coutant 1:2371382139dd 196 #define DISCOVERY_SPIx_MISO_PIN GPIO_PIN_8 /* PF.08 */
Jerome Coutant 1:2371382139dd 197 #define DISCOVERY_SPIx_MOSI_PIN GPIO_PIN_9 /* PF.09 */
Jerome Coutant 1:2371382139dd 198 /* Maximum Timeout values for flags waiting loops. These timeouts are not based
Jerome Coutant 1:2371382139dd 199 on accurate values, they just guarantee that the application will not remain
Jerome Coutant 1:2371382139dd 200 stuck if the SPI communication is corrupted.
Jerome Coutant 1:2371382139dd 201 You may modify these timeout values depending on CPU frequency and application
Jerome Coutant 1:2371382139dd 202 conditions (interrupts routines ...). */
Jerome Coutant 1:2371382139dd 203 #define SPIx_TIMEOUT_MAX ((uint32_t)0x1000)
Jerome Coutant 1:2371382139dd 204
Jerome Coutant 1:2371382139dd 205
Jerome Coutant 1:2371382139dd 206 /*################################ IOE #######################################*/
Jerome Coutant 1:2371382139dd 207 /**
Jerome Coutant 1:2371382139dd 208 * @brief IOE Control pin
Jerome Coutant 1:2371382139dd 209 */
Jerome Coutant 1:2371382139dd 210 /* Definition for external IT for STMPE811 */
Jerome Coutant 1:2371382139dd 211 #define STMPE811_INT_PIN GPIO_PIN_15
Jerome Coutant 1:2371382139dd 212 #define STMPE811_INT_GPIO_PORT GPIOA
Jerome Coutant 1:2371382139dd 213 #define STMPE811_INT_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
Jerome Coutant 1:2371382139dd 214 #define STMPE811_INT_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
Jerome Coutant 1:2371382139dd 215 #define STMPE811_INT_EXTI EXTI15_10_IRQn
Jerome Coutant 1:2371382139dd 216 #define STMPE811_INT_EXTIHandler EXTI15_10_IRQHandler
Jerome Coutant 1:2371382139dd 217
Jerome Coutant 1:2371382139dd 218 /*################################ LCD #######################################*/
Jerome Coutant 1:2371382139dd 219 /* Chip Select macro definition */
Jerome Coutant 1:2371382139dd 220 #define LCD_CS_LOW() HAL_GPIO_WritePin(LCD_NCS_GPIO_PORT, LCD_NCS_PIN, GPIO_PIN_RESET)
Jerome Coutant 1:2371382139dd 221 #define LCD_CS_HIGH() HAL_GPIO_WritePin(LCD_NCS_GPIO_PORT, LCD_NCS_PIN, GPIO_PIN_SET)
Jerome Coutant 1:2371382139dd 222
Jerome Coutant 1:2371382139dd 223 /* Set WRX High to send data */
Jerome Coutant 1:2371382139dd 224 #define LCD_WRX_LOW() HAL_GPIO_WritePin(LCD_WRX_GPIO_PORT, LCD_WRX_PIN, GPIO_PIN_RESET)
Jerome Coutant 1:2371382139dd 225 #define LCD_WRX_HIGH() HAL_GPIO_WritePin(LCD_WRX_GPIO_PORT, LCD_WRX_PIN, GPIO_PIN_SET)
Jerome Coutant 1:2371382139dd 226
Jerome Coutant 1:2371382139dd 227 /* Set WRX High to send data */
Jerome Coutant 1:2371382139dd 228 #define LCD_RDX_LOW() HAL_GPIO_WritePin(LCD_RDX_GPIO_PORT, LCD_RDX_PIN, GPIO_PIN_RESET)
Jerome Coutant 1:2371382139dd 229 #define LCD_RDX_HIGH() HAL_GPIO_WritePin(LCD_RDX_GPIO_PORT, LCD_RDX_PIN, GPIO_PIN_SET)
Jerome Coutant 1:2371382139dd 230
Jerome Coutant 1:2371382139dd 231 /**
Jerome Coutant 1:2371382139dd 232 * @brief LCD Control pin
Jerome Coutant 1:2371382139dd 233 */
Jerome Coutant 1:2371382139dd 234 #define LCD_NCS_PIN GPIO_PIN_2
Jerome Coutant 1:2371382139dd 235 #define LCD_NCS_GPIO_PORT GPIOC
Jerome Coutant 1:2371382139dd 236 #define LCD_NCS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
Jerome Coutant 1:2371382139dd 237 #define LCD_NCS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
Jerome Coutant 1:2371382139dd 238 /**
Jerome Coutant 1:2371382139dd 239 * @}
Jerome Coutant 1:2371382139dd 240 */
Jerome Coutant 1:2371382139dd 241 /**
Jerome Coutant 1:2371382139dd 242 * @brief LCD Command/data pin
Jerome Coutant 1:2371382139dd 243 */
Jerome Coutant 1:2371382139dd 244 #define LCD_WRX_PIN GPIO_PIN_13
Jerome Coutant 1:2371382139dd 245 #define LCD_WRX_GPIO_PORT GPIOD
Jerome Coutant 1:2371382139dd 246 #define LCD_WRX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
Jerome Coutant 1:2371382139dd 247 #define LCD_WRX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE()
Jerome Coutant 1:2371382139dd 248
Jerome Coutant 1:2371382139dd 249 #define LCD_RDX_PIN GPIO_PIN_12
Jerome Coutant 1:2371382139dd 250 #define LCD_RDX_GPIO_PORT GPIOD
Jerome Coutant 1:2371382139dd 251 #define LCD_RDX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
Jerome Coutant 1:2371382139dd 252 #define LCD_RDX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE()
Jerome Coutant 1:2371382139dd 253
Jerome Coutant 1:2371382139dd 254 /*################################ GYROSCOPE #################################*/
Jerome Coutant 1:2371382139dd 255 /* Read/Write command */
Jerome Coutant 1:2371382139dd 256 #define READWRITE_CMD ((uint8_t)0x80)
Jerome Coutant 1:2371382139dd 257 /* Multiple byte read/write command */
Jerome Coutant 1:2371382139dd 258 #define MULTIPLEBYTE_CMD ((uint8_t)0x40)
Jerome Coutant 1:2371382139dd 259 /* Dummy Byte Send by the SPI Master device in order to generate the Clock to the Slave device */
Jerome Coutant 1:2371382139dd 260 #define DUMMY_BYTE ((uint8_t)0x00)
Jerome Coutant 1:2371382139dd 261
Jerome Coutant 1:2371382139dd 262 /* Chip Select macro definition */
Jerome Coutant 1:2371382139dd 263 #define GYRO_CS_LOW() HAL_GPIO_WritePin(GYRO_CS_GPIO_PORT, GYRO_CS_PIN, GPIO_PIN_RESET)
Jerome Coutant 1:2371382139dd 264 #define GYRO_CS_HIGH() HAL_GPIO_WritePin(GYRO_CS_GPIO_PORT, GYRO_CS_PIN, GPIO_PIN_SET)
Jerome Coutant 1:2371382139dd 265
Jerome Coutant 1:2371382139dd 266 /**
Jerome Coutant 1:2371382139dd 267 * @brief GYROSCOPE SPI Interface pins
Jerome Coutant 1:2371382139dd 268 */
Jerome Coutant 1:2371382139dd 269 #define GYRO_CS_PIN GPIO_PIN_1 /* PC.01 */
Jerome Coutant 1:2371382139dd 270 #define GYRO_CS_GPIO_PORT GPIOC /* GPIOC */
Jerome Coutant 1:2371382139dd 271 #define GYRO_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
Jerome Coutant 1:2371382139dd 272 #define GYRO_CS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
Jerome Coutant 1:2371382139dd 273
Jerome Coutant 1:2371382139dd 274 #define GYRO_INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
Jerome Coutant 1:2371382139dd 275 #define GYRO_INT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
Jerome Coutant 1:2371382139dd 276 #define GYRO_INT_GPIO_PORT GPIOA /* GPIOA */
Jerome Coutant 1:2371382139dd 277 #define GYRO_INT1_PIN GPIO_PIN_1 /* PA.01 */
Jerome Coutant 1:2371382139dd 278 #define GYRO_INT1_EXTI_IRQn EXTI1_IRQn
Jerome Coutant 1:2371382139dd 279 #define GYRO_INT2_PIN GPIO_PIN_2 /* PA.02 */
Jerome Coutant 1:2371382139dd 280 #define GYRO_INT2_EXTI_IRQn EXTI2_IRQn
Jerome Coutant 1:2371382139dd 281 /**
Jerome Coutant 1:2371382139dd 282 * @}
Jerome Coutant 1:2371382139dd 283 */
Jerome Coutant 1:2371382139dd 284
Jerome Coutant 1:2371382139dd 285 #ifdef EE_M24LR64
Jerome Coutant 1:2371382139dd 286 /** @defgroup STM32F429I_DISCOVERY_LOW_LEVEL_I2C_EEPROM STM32F429I DISCOVERY LOW LEVEL I2C EEPROM
Jerome Coutant 1:2371382139dd 287 * @{
Jerome Coutant 1:2371382139dd 288 */
Jerome Coutant 1:2371382139dd 289 /**
Jerome Coutant 1:2371382139dd 290 * @brief I2C EEPROM Interface pins
Jerome Coutant 1:2371382139dd 291 */
Jerome Coutant 1:2371382139dd 292 #define EEPROM_I2C_DMA DMA1
Jerome Coutant 1:2371382139dd 293 #define EEPROM_I2C_DMA_CHANNEL DMA_CHANNEL_3
Jerome Coutant 1:2371382139dd 294 #define EEPROM_I2C_DMA_STREAM_TX DMA1_Stream4
Jerome Coutant 1:2371382139dd 295 #define EEPROM_I2C_DMA_STREAM_RX DMA1_Stream2
Jerome Coutant 1:2371382139dd 296 #define EEPROM_I2C_DMA_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
Jerome Coutant 1:2371382139dd 297
Jerome Coutant 1:2371382139dd 298 #define EEPROM_I2C_DMA_TX_IRQn DMA1_Stream4_IRQn
Jerome Coutant 1:2371382139dd 299 #define EEPROM_I2C_DMA_RX_IRQn DMA1_Stream2_IRQn
Jerome Coutant 1:2371382139dd 300 #define EEPROM_I2C_DMA_TX_IRQHandler DMA1_Stream4_IRQHandler
Jerome Coutant 1:2371382139dd 301 #define EEPROM_I2C_DMA_RX_IRQHandler DMA1_Stream2_IRQHandler
Jerome Coutant 1:2371382139dd 302 #define EEPROM_I2C_DMA_PREPRIO 0x0F
Jerome Coutant 1:2371382139dd 303 /**
Jerome Coutant 1:2371382139dd 304 * @}
Jerome Coutant 1:2371382139dd 305 */
Jerome Coutant 1:2371382139dd 306
Jerome Coutant 1:2371382139dd 307 #endif /* EE_M24LR64 */
Jerome Coutant 1:2371382139dd 308
Jerome Coutant 1:2371382139dd 309 /** @defgroup STM32F429I_DISCOVERY_LOW_LEVEL_Exported_Macros STM32F429I DISCOVERY LOW LEVEL Exported Macros
Jerome Coutant 1:2371382139dd 310 * @{
Jerome Coutant 1:2371382139dd 311 */
Jerome Coutant 1:2371382139dd 312 /**
Jerome Coutant 1:2371382139dd 313 * @}
Jerome Coutant 1:2371382139dd 314 */
Jerome Coutant 1:2371382139dd 315
Jerome Coutant 1:2371382139dd 316 /** @defgroup STM32F429I_DISCOVERY_LOW_LEVEL_Exported_Functions STM32F429I DISCOVERY LOW LEVEL Exported Functions
Jerome Coutant 1:2371382139dd 317 * @{
Jerome Coutant 1:2371382139dd 318 */
Jerome Coutant 1:2371382139dd 319 uint32_t BSP_GetVersion(void);
Jerome Coutant 1:2371382139dd 320 void BSP_LED_Init(Led_TypeDef Led);
Jerome Coutant 1:2371382139dd 321 void BSP_LED_On(Led_TypeDef Led);
Jerome Coutant 1:2371382139dd 322 void BSP_LED_Off(Led_TypeDef Led);
Jerome Coutant 1:2371382139dd 323 void BSP_LED_Toggle(Led_TypeDef Led);
Jerome Coutant 1:2371382139dd 324 void BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode);
Jerome Coutant 1:2371382139dd 325 uint32_t BSP_PB_GetState(Button_TypeDef Button);
Jerome Coutant 1:2371382139dd 326
Jerome Coutant 1:2371382139dd 327 /**
Jerome Coutant 1:2371382139dd 328 * @}
Jerome Coutant 1:2371382139dd 329 */
Jerome Coutant 1:2371382139dd 330
Jerome Coutant 1:2371382139dd 331 /**
Jerome Coutant 1:2371382139dd 332 * @}
Jerome Coutant 1:2371382139dd 333 */
Jerome Coutant 1:2371382139dd 334
Jerome Coutant 1:2371382139dd 335 /**
Jerome Coutant 1:2371382139dd 336 * @}
Jerome Coutant 1:2371382139dd 337 */
Jerome Coutant 1:2371382139dd 338
Jerome Coutant 1:2371382139dd 339 /**
Jerome Coutant 1:2371382139dd 340 * @}
Jerome Coutant 1:2371382139dd 341 */
Jerome Coutant 1:2371382139dd 342
Jerome Coutant 1:2371382139dd 343 #ifdef __cplusplus
Jerome Coutant 1:2371382139dd 344 }
Jerome Coutant 1:2371382139dd 345 #endif
Jerome Coutant 1:2371382139dd 346
Jerome Coutant 1:2371382139dd 347 #endif /* __STM32F429I_DISCOVERY_H */
Jerome Coutant 1:2371382139dd 348
Jerome Coutant 1:2371382139dd 349 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/