STM32F3xx_Nucleo_32 BSP User Manual: stm32f3xx_nucleo_32.h Source File

STM32F3xx Nucleo 32 BSP Drivers

stm32f3xx_nucleo_32.h
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32f3xx_nucleo_32.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains definitions for:
00006   *          - LED available on STM32F3xx-Nucleo_32 Kit from STMicroelectronics
00007   *          - 7 segment display from Gravitech
00008   ******************************************************************************
00009   * @attention
00010   *
00011   * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
00012   *
00013   * Redistribution and use in source and binary forms, with or without modification,
00014   * are permitted provided that the following conditions are met:
00015   *   1. Redistributions of source code must retain the above copyright notice,
00016   *      this list of conditions and the following disclaimer.
00017   *   2. Redistributions in binary form must reproduce the above copyright notice,
00018   *      this list of conditions and the following disclaimer in the documentation
00019   *      and/or other materials provided with the distribution.
00020   *   3. Neither the name of STMicroelectronics nor the names of its contributors
00021   *      may be used to endorse or promote products derived from this software
00022   *      without specific prior written permission.
00023   *
00024   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00025   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00026   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00027   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00028   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00029   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00030   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00031   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00032   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00033   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00034   *
00035   ******************************************************************************
00036   */ 
00037   
00038 /* Define to prevent recursive inclusion -------------------------------------*/
00039 #ifndef __STM32F3XX_NUCLEO_32_H
00040 #define __STM32F3XX_NUCLEO_32_H
00041 
00042 #ifdef __cplusplus
00043  extern "C" {
00044 #endif
00045 
00046 
00047 /** @addtogroup BSP
00048   * @{
00049   */
00050 
00051 /** @defgroup STM32F3XX_NUCLEO_32 STM32F3XX-NUCLEO_32
00052   * @{
00053   */
00054  
00055 /* Includes ------------------------------------------------------------------*/
00056 #include "stm32f3xx_hal.h"
00057    
00058 
00059 /** @defgroup STM32F3XX_NUCLEO_32_Common STM32F3XX_NUCLEO_32 Common
00060   * @{
00061   */ 
00062 
00063 /** @defgroup STM32F3XX_NUCLEO_32_Private_Constants Private Constants
00064   * @{
00065   */
00066 /**
00067 * @}
00068 */        
00069 
00070 /** @defgroup STM32F3XX_NUCLEO_32_Private_Variables Private Variables
00071   * @{
00072   */
00073 /**
00074 * @}
00075 */
00076 
00077 /** @defgroup STM32F3XX_NUCLEO_32_Exported_Types Exported Types
00078   * @{
00079   */ 
00080    
00081 /**
00082  * @brief LED Types Definition
00083  */ 
00084    
00085 typedef enum 
00086 {
00087   LED3 = 0,
00088   LED_GREEN = LED3
00089 } Led_TypeDef;
00090 
00091 /**
00092   * @}
00093   */ 
00094 
00095 /** @defgroup STM32F3XX_NUCLEO_32_Exported_Constants Exported Constants 
00096   * @{
00097   */ 
00098 
00099 /** 
00100   * @brief Define for STM32F3XX_NUCLEO_32 board  
00101   */ 
00102 
00103 #if !defined (USE_STM32F3XX_NUCLEO_32)
00104  #define USE_STM32F3XX_NUCLEO_32
00105 #endif
00106 
00107 /** @defgroup STM32F3XX_NUCLEO_32_LED STM32F3XX-NUCLEO_32 LED
00108   * @{
00109   */
00110 #define LEDn                               1
00111 
00112 #define LED3_PIN                           GPIO_PIN_3
00113 #define LED3_GPIO_PORT                     GPIOB
00114 #define LED3_GPIO_CLK_ENABLE()             __HAL_RCC_GPIOB_CLK_ENABLE()  
00115 #define LED3_GPIO_CLK_DISABLE()            __HAL_RCC_GPIOB_CLK_DISABLE()  
00116 
00117 #define LEDx_GPIO_CLK_ENABLE(__INDEX__)    do {LED3_GPIO_CLK_ENABLE(); } while(0)
00118 #define LEDx_GPIO_CLK_DISABLE(__INDEX__)   LED3_GPIO_CLK_DISABLE())
00119 
00120 /**
00121   * @}
00122   */ 
00123   
00124 /** @defgroup STM32F3XX_NUCLEO_32_COM STM32F3XX-NUCLEO_32 COM
00125   * @{
00126   */ 
00127 
00128 #if defined(HAL_I2C_MODULE_ENABLED)
00129 /*##################### I2C2 ###################################*/
00130 /* User can use this section to tailor I2Cx instance used and associated resources */
00131 /* Definition for I2C1 Pins */
00132 #define BSP_I2C1                        I2C1
00133 #define BSP_I2C1_CLK_ENABLE()           __HAL_RCC_I2C1_CLK_ENABLE()
00134 #define BSP_I2C1_CLK_DISABLE()          __HAL_RCC_I2C1_CLK_DISABLE()
00135 #define BSP_I2C1_FORCE_RESET()          __HAL_RCC_I2C1_FORCE_RESET()
00136 #define BSP_I2C1_RELEASE_RESET()        __HAL_RCC_I2C1_RELEASE_RESET()  
00137 
00138 #define BSP_I2C1_SCL_PIN                GPIO_PIN_6    /* PB.6 add wire between D5 and A5 */
00139 #define BSP_I2C1_SDA_PIN                GPIO_PIN_7    /* PB.7 add wire between D4 and A4 */
00140 
00141 #define BSP_I2C1_GPIO_PORT              GPIOB      /* GPIOB */
00142 #define BSP_I2C1_GPIO_CLK_ENABLE()      __HAL_RCC_GPIOB_CLK_ENABLE()
00143 #define BSP_I2C1_GPIO_CLK_DISABLE()     __HAL_RCC_GPIOB_CLK_DISABLE() 
00144 #define BSP_I2C1_SCL_SDA_AF             GPIO_AF4_I2C1
00145   
00146 /* Maximum Timeout values for flags waiting loops. These timeouts are not based
00147    on accurate values, they just guarantee that the application will not remain
00148    stuck if the I2C communication is corrupted.
00149    You may modify these timeout values depending on CPU frequency and application
00150    conditions (interrupts routines ...). */   
00151 #define BSP_I2C1_TIMEOUT_MAX            1000
00152 
00153 /* I2C TIMING is calculated in case of the I2C Clock source is the SYSCLK = 32 MHz */
00154 /* Set TIMING to 0x009080B5 to reach 100 KHz speed (Rise time = 50ns, Fall time = 10ns) */
00155 //#define I2C1_TIMING                      0x009080B5
00156 #define I2C1_TIMING                      0xB0420F13
00157 
00158 #endif /* HAL_I2C_MODULE_ENABLED */
00159 
00160 /**
00161   * @}
00162   */
00163 
00164 /**
00165   * @}
00166   */ 
00167   
00168 /** @defgroup STM32F3XX_NUCLEO_32_Exported_Functions Exported Functions
00169   * @{
00170   */
00171   
00172 uint32_t         BSP_GetVersion(void);
00173 void             BSP_LED_Init(Led_TypeDef Led);
00174 void             BSP_LED_On(Led_TypeDef Led);
00175 void             BSP_LED_Off(Led_TypeDef Led);
00176 void             BSP_LED_Toggle(Led_TypeDef Led);
00177 
00178 /**
00179   * @}
00180   */
00181 
00182 /**
00183   * @}
00184   */
00185    
00186 /** @defgroup STM32F3XX_NUCLEO_32_GRAVITECH_4DIGITS GRAVITECH 4 DIGITS
00187   * @brief This section contains the exported functions
00188   *        required to use Gravitech shield 7 Segment Display
00189   * @{
00190   */ 
00191 
00192 /** @defgroup STM32_GRAVITECH_4DIGITS_Exported_Constants Exported Constants
00193   * @{
00194   */
00195 
00196 #define DIGIT4_SEG7_RESET 10000
00197 /**
00198   * @}
00199   */
00200 
00201 /** @defgroup STM32_GRAVITECH_4DIGITS_Exported_Functions Exported Functions
00202   * @{
00203   */   
00204   
00205 HAL_StatusTypeDef BSP_DIGIT4_SEG7_Init(void);
00206 HAL_StatusTypeDef BSP_DIGIT4_SEG7_Display(uint32_t Value);
00207 
00208 /**
00209   * @}
00210   */
00211 
00212 /**
00213   * @}
00214   */ 
00215 
00216 /**
00217   * @}
00218   */ 
00219     
00220 /**
00221   * @}
00222   */ 
00223    
00224 #ifdef __cplusplus
00225 }
00226 #endif
00227 
00228 #endif /* __STM32F3XX_NUCLEO_32_H */
00229 
00230 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
00231 
Generated on Wed May 31 2017 11:09:08 for STM32F3xx_Nucleo_32 BSP User Manual by   doxygen 1.7.6.1