forked for landscape mode text

Dependents:   DISCO-F429ZI_LCDTS_demo_richard

Fork of BSP_DISCO_F429ZI by ST

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