/** ****************************************************************************** * @file stm32f4_discovery.h * @author MCD Application Team * @brief This file contains definitions for STM32F4-Discovery Kit's Leds and * push-button hardware resources. ****************************************************************************** * @attention * * Copyright (c) 2017 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** *//* ... *//* Define to prevent recursive inclusion -------------------------------------*/#ifndef__STM32F4_DISCOVERY_H#define__STM32F4_DISCOVERY_H#ifdef__cplusplusextern"C"{#endif/* Includes ------------------------------------------------------------------*/#include"stm32f4xx_hal.h"/** @addtogroup BSP * @{ *//* ... *//** @addtogroup STM32F4_DISCOVERY * @{ *//* ... *//** @addtogroup STM32F4_DISCOVERY_LOW_LEVEL * @{ *//* ... *//** @defgroup STM32F4_DISCOVERY_LOW_LEVEL_Exported_Types STM32F4 DISCOVERY LOW LEVEL_Exported_Types * @{ *//* ... */typedefenum{LED4=0,LED3=1,LED5=2,LED6=3...}Led_TypeDef;typedefenum{BUTTON_KEY=0,...}Button_TypeDef;typedefenum{BUTTON_MODE_GPIO=0,BUTTON_MODE_EXTI=1...}ButtonMode_TypeDef;/** * @} *//* ... *//** @defgroup STM32F4_DISCOVERY_LOW_LEVEL_Exported_Constants STM32F4 DISCOVERY LOW LEVEL Exported Constants * @{ *//* ... *//** * @brief Define for STM32F4_DISCOVERY board *//* ... */#if!defined(USE_STM32F4_DISCO)#defineUSE_STM32F4_DISCO#endif/** @defgroup STM32F4_DISCOVERY_LOW_LEVEL_LED STM32F4 DISCOVERY LOW LEVEL LED * @{ *//* ... */#defineLEDn4#defineLED4_PINGPIO_PIN_12#defineLED4_GPIO_PORTGPIOD#defineLED4_GPIO_CLK_ENABLE()__HAL_RCC_GPIOD_CLK_ENABLE()#defineLED4_GPIO_CLK_DISABLE()__HAL_RCC_GPIOD_CLK_DISABLE()#defineLED3_PINGPIO_PIN_13#defineLED3_GPIO_PORTGPIOD#defineLED3_GPIO_CLK_ENABLE()__HAL_RCC_GPIOD_CLK_ENABLE()#defineLED3_GPIO_CLK_DISABLE()__HAL_RCC_GPIOD_CLK_DISABLE()#defineLED5_PINGPIO_PIN_14#defineLED5_GPIO_PORTGPIOD#defineLED5_GPIO_CLK_ENABLE()__HAL_RCC_GPIOD_CLK_ENABLE()#defineLED5_GPIO_CLK_DISABLE()__HAL_RCC_GPIOD_CLK_DISABLE()#defineLED6_PINGPIO_PIN_15#defineLED6_GPIO_PORTGPIOD#defineLED6_GPIO_CLK_ENABLE()__HAL_RCC_GPIOD_CLK_ENABLE()#defineLED6_GPIO_CLK_DISABLE()__HAL_RCC_GPIOD_CLK_DISABLE()#defineLEDx_GPIO_CLK_ENABLE(__INDEX__)do{if((__INDEX__)==0)LED4_GPIO_CLK_ENABLE();else\if((__INDEX__)==1)LED3_GPIO_CLK_ENABLE();else\if((__INDEX__)==2)LED5_GPIO_CLK_ENABLE();else\if((__INDEX__)==3)LED6_GPIO_CLK_ENABLE();\...}while(0)...#defineLEDx_GPIO_CLK_DISABLE(__INDEX__)do{if((__INDEX__)==0)LED4_GPIO_CLK_DISABLE();else\if((__INDEX__)==1)LED3_GPIO_CLK_DISABLE();else\if((__INDEX__)==2)LED5_GPIO_CLK_DISABLE();else\if((__INDEX__)==3)LED6_GPIO_CLK_DISABLE();\...}while(0).../** * @} *//* ... *//** @defgroup STM32F4_DISCOVERY_LOW_LEVEL_BUTTON STM32F4 DISCOVERY LOW LEVEL BUTTON * @{ *//* ... */#defineBUTTONn1/** * @brief Wakeup push-button *//* ... */#defineKEY_BUTTON_PINGPIO_PIN_0#defineKEY_BUTTON_GPIO_PORTGPIOA#defineKEY_BUTTON_GPIO_CLK_ENABLE()__HAL_RCC_GPIOA_CLK_ENABLE()#defineKEY_BUTTON_GPIO_CLK_DISABLE()__HAL_RCC_GPIOA_CLK_DISABLE()#defineKEY_BUTTON_EXTI_IRQnEXTI0_IRQn#defineBUTTONx_GPIO_CLK_ENABLE(__INDEX__)do{if((__INDEX__)==0)KEY_BUTTON_GPIO_CLK_ENABLE();\...}while(0)...#defineBUTTONx_GPIO_CLK_DISABLE(__INDEX__)do{if((__INDEX__)==0)KEY_BUTTON_GPIO_CLK_DISABLE();\...}while(0).../** * @} *//* ... *//** @defgroup STM32F4_DISCOVERY_LOW_LEVEL_BUS STM32F4 DISCOVERY LOW LEVEL BUS * @{ *//* ... *//*############################### SPI1 #######################################*/#defineDISCOVERY_SPIxSPI1#defineDISCOVERY_SPIx_CLK_ENABLE()__HAL_RCC_SPI1_CLK_ENABLE()#defineDISCOVERY_SPIx_GPIO_PORTGPIOA/* GPIOA */#defineDISCOVERY_SPIx_AFGPIO_AF5_SPI1#defineDISCOVERY_SPIx_GPIO_CLK_ENABLE()__HAL_RCC_GPIOA_CLK_ENABLE()#defineDISCOVERY_SPIx_GPIO_CLK_DISABLE()__HAL_RCC_GPIOA_CLK_DISABLE()#defineDISCOVERY_SPIx_SCK_PINGPIO_PIN_5/* PA.05 */#defineDISCOVERY_SPIx_MISO_PINGPIO_PIN_6/* PA.06 */#defineDISCOVERY_SPIx_MOSI_PINGPIO_PIN_7/* PA.07 *//* Maximum Timeout values for flags waiting loops. These timeouts are not based on accurate values, they just guarantee that the application will not remain stuck if the SPI communication is corrupted. You may modify these timeout values depending on CPU frequency and application conditions (interrupts routines ...). *//* ... */#defineSPIx_TIMEOUT_MAX0x1000/*<! The value of the maximal timeout for BUS waiting loops */37 defines/*############################# I2C1 #########################################*//* I2C clock speed configuration (in Hz) */#ifndefBSP_I2C_SPEED#defineBSP_I2C_SPEED100000#endif/* BSP_I2C_SPEED *//* I2C peripheral configuration defines (control interface of the audio codec) */#defineDISCOVERY_I2CxI2C1#defineDISCOVERY_I2Cx_CLK_ENABLE()__HAL_RCC_I2C1_CLK_ENABLE()#defineDISCOVERY_I2Cx_SCL_SDA_GPIO_CLK_ENABLE()__HAL_RCC_GPIOB_CLK_ENABLE()#defineDISCOVERY_I2Cx_SCL_SDA_AFGPIO_AF4_I2C1#defineDISCOVERY_I2Cx_SCL_SDA_GPIO_PORTGPIOB#defineDISCOVERY_I2Cx_SCL_PINGPIO_PIN_6#defineDISCOVERY_I2Cx_SDA_PINGPIO_PIN_9#defineDISCOVERY_I2Cx_FORCE_RESET()__HAL_RCC_I2C1_FORCE_RESET()#defineDISCOVERY_I2Cx_RELEASE_RESET()__HAL_RCC_I2C1_RELEASE_RESET()/* I2C interrupt requests */#defineDISCOVERY_I2Cx_EV_IRQnI2C1_EV_IRQn#defineDISCOVERY_I2Cx_ER_IRQnI2C1_ER_IRQn/* Maximum Timeout values for flags waiting loops. These timeouts are not based on accurate values, they just guarantee that the application will not remain stuck if the SPI communication is corrupted. You may modify these timeout values depending on CPU frequency and application conditions (interrupts routines ...). *//* ... */#defineI2Cx_TIMEOUT_MAX0x1000/*<! The value of the maximal timeout for BUS waiting loops *//*############################# ACCELEROMETER ################################*//* Read/Write command */#defineREADWRITE_CMD((uint8_t)0x80)/* Multiple byte read/write command */#defineMULTIPLEBYTE_CMD((uint8_t)0x40)/* Dummy Byte Send by the SPI Master device in order to generate the Clock to the Slave device */#defineDUMMY_BYTE((uint8_t)0x00)/* Chip Select macro definition */#defineACCELERO_CS_LOW()HAL_GPIO_WritePin(ACCELERO_CS_GPIO_PORT,ACCELERO_CS_PIN,GPIO_PIN_RESET)#defineACCELERO_CS_HIGH()HAL_GPIO_WritePin(ACCELERO_CS_GPIO_PORT,ACCELERO_CS_PIN,GPIO_PIN_SET)/** * @brief ACCELEROMETER Interface pins *//* ... */#defineACCELERO_CS_PINGPIO_PIN_3/* PE.03 */#defineACCELERO_CS_GPIO_PORTGPIOE/* GPIOE */#defineACCELERO_CS_GPIO_CLK_ENABLE()__HAL_RCC_GPIOE_CLK_ENABLE()#defineACCELERO_CS_GPIO_CLK_DISABLE()__HAL_RCC_GPIOE_CLK_DISABLE()#defineACCELERO_INT_GPIO_PORTGPIOE/* GPIOE */#defineACCELERO_INT_GPIO_CLK_ENABLE()__HAL_RCC_GPIOE_CLK_ENABLE()#defineACCELERO_INT_GPIO_CLK_DISABLE()__HAL_RCC_GPIOE_CLK_DISABLE()#defineACCELERO_INT1_PINGPIO_PIN_0/* PE.00 */#defineACCELERO_INT1_EXTI_IRQnEXTI0_IRQn#defineACCELERO_INT2_PINGPIO_PIN_1/* PE.01 */#defineACCELERO_INT2_EXTI_IRQnEXTI1_IRQn/** * @} *//* ... *//*############################### AUDIO ######################################*//** * @brief AUDIO I2C Interface pins *//* ... */#defineAUDIO_I2C_ADDRESS0x94/* Audio Reset Pin definition */#defineAUDIO_RESET_GPIO_CLK_ENABLE()__HAL_RCC_GPIOD_CLK_ENABLE()#defineAUDIO_RESET_PINGPIO_PIN_4#defineAUDIO_RESET_GPIOGPIOD32 defines/** * @} *//* ... *//** @defgroup STM32F4_DISCOVERY_LOW_LEVEL_Exported_Macros STM32F4 DISCOVERY LOW LEVEL Exported Macros * @{ *//* ... *//** * @} *//* ... *//** @defgroup STM32F4_DISCOVERY_LOW_LEVEL_Exported_Functions STM32F4 DISCOVERY LOW LEVEL Exported Functions * @{ *//* ... */uint32_tBSP_GetVersion(void);voidBSP_LED_Init(Led_TypeDefLed);voidBSP_LED_On(Led_TypeDefLed);voidBSP_LED_Off(Led_TypeDefLed);voidBSP_LED_Toggle(Led_TypeDefLed);voidBSP_PB_Init(Button_TypeDefButton,ButtonMode_TypeDefMode);uint32_tBSP_PB_GetState(Button_TypeDefButton);/** * @} *//* ... *//** * @} *//* ... *//** * @} *//* ... *//** * @} *//* ... *//** * @} *//* ... */#ifdef__cplusplus}extern "C" { ... }#endif/* ... */#endif/* __STM32F4_DISCOVERY_H */
Details
Show: from
Types: Columns:
All items filtered out
All items filtered out
This file uses the notable symbols shown below. Click anywhere in the file to view more details.