generated code, added drawings on Silkscreen
This commit is contained in:
		
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										944
									
								
								Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										944
									
								
								Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,944 @@
 | 
			
		||||
/**
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @file    stm32f3xx_hal.h
 | 
			
		||||
  * @author  MCD Application Team
 | 
			
		||||
  * @brief   This file contains all the functions prototypes for the HAL 
 | 
			
		||||
  *          module driver.
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @attention
 | 
			
		||||
  *
 | 
			
		||||
  * Copyright (c) 2016 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 __STM32F3xx_HAL_H
 | 
			
		||||
#define __STM32F3xx_HAL_H
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
 extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Includes ------------------------------------------------------------------*/
 | 
			
		||||
#include "stm32f3xx_hal_conf.h"
 | 
			
		||||
 | 
			
		||||
/** @addtogroup STM32F3xx_HAL_Driver
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup HAL
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
 | 
			
		||||
/* Private macros ------------------------------------------------------------*/
 | 
			
		||||
/** @addtogroup HAL_Private_Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define IS_SYSCFG_FASTMODEPLUS(__PIN__) ((((__PIN__) & SYSCFG_FASTMODEPLUS_PB6)  == SYSCFG_FASTMODEPLUS_PB6)  || \
 | 
			
		||||
                                         (((__PIN__) & SYSCFG_FASTMODEPLUS_PB7)  == SYSCFG_FASTMODEPLUS_PB7)  || \
 | 
			
		||||
                                         (((__PIN__) & SYSCFG_FASTMODEPLUS_PB8)  == SYSCFG_FASTMODEPLUS_PB8)  || \
 | 
			
		||||
                                         (((__PIN__) & SYSCFG_FASTMODEPLUS_PB9)  == SYSCFG_FASTMODEPLUS_PB9))
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported types ------------------------------------------------------------*/
 | 
			
		||||
/* Exported constants --------------------------------------------------------*/
 | 
			
		||||
/** @defgroup HAL_Exported_Constants HAL Exported Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup HAL_TICK_FREQ Tick Frequency
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
typedef enum
 | 
			
		||||
{
 | 
			
		||||
  HAL_TICK_FREQ_10HZ         = 100U,
 | 
			
		||||
  HAL_TICK_FREQ_100HZ        = 10U,
 | 
			
		||||
  HAL_TICK_FREQ_1KHZ         = 1U,
 | 
			
		||||
  HAL_TICK_FREQ_DEFAULT      = HAL_TICK_FREQ_1KHZ
 | 
			
		||||
} HAL_TickFreqTypeDef;
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
/** @defgroup HAL_Exported_Constants HAL Exported Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/** @defgroup SYSCFG_BitAddress_AliasRegion SYSCFG registers bit address in the alias region
 | 
			
		||||
  * @brief SYSCFG registers bit address in the alias region
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/* ------------ SYSCFG registers bit address in the alias region -------------*/
 | 
			
		||||
#define SYSCFG_OFFSET                (SYSCFG_BASE - PERIPH_BASE)
 | 
			
		||||
/* --- CFGR2 Register ---*/
 | 
			
		||||
/* Alias word address of BYP_ADDR_PAR bit */
 | 
			
		||||
#define CFGR2_OFFSET                 (SYSCFG_OFFSET + 0x18U)
 | 
			
		||||
#define BYPADDRPAR_BitNumber          0x04U
 | 
			
		||||
#define CFGR2_BYPADDRPAR_BB          (PERIPH_BB_BASE + (CFGR2_OFFSET * 32U) + (BYPADDRPAR_BitNumber * 4U))
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#if defined(SYSCFG_CFGR1_DMA_RMP)
 | 
			
		||||
/** @defgroup HAL_DMA_Remapping HAL DMA Remapping
 | 
			
		||||
  *        Elements values convention: 0xXXYYYYYY
 | 
			
		||||
  *           - YYYYYY  : Position in the register
 | 
			
		||||
  *           - XX  : Register index
 | 
			
		||||
  *                 - 00: CFGR1 register in SYSCFG
 | 
			
		||||
  *                 - 01: CFGR3 register in SYSCFG (not available on STM32F373xC/STM32F378xx devices)
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define HAL_REMAPDMA_ADC24_DMA2_CH34         (0x00000100U) /*!< ADC24 DMA remap (STM32F303xB/C/E, STM32F358xx and STM32F398xx devices)
 | 
			
		||||
                                                                          1: Remap (ADC24 DMA requests mapped on DMA2 channels 3 and 4) */
 | 
			
		||||
#define HAL_REMAPDMA_TIM16_DMA1_CH6          (0x00000800U) /*!< TIM16 DMA request remap
 | 
			
		||||
                                                                         1: Remap (TIM16_CH1 and TIM16_UP DMA requests mapped on DMA1 channel 6) */
 | 
			
		||||
#define HAL_REMAPDMA_TIM17_DMA1_CH7          (0x00001000U) /*!< TIM17 DMA request remap
 | 
			
		||||
                                                                         1: Remap (TIM17_CH1 and TIM17_UP DMA requests mapped on DMA1 channel 7) */
 | 
			
		||||
#define HAL_REMAPDMA_TIM6_DAC1_CH1_DMA1_CH3  (0x00002000U) /*!< TIM6 and DAC channel1 DMA remap (STM32F303xB/C/E, STM32F358xx and STM32F398xx devices)
 | 
			
		||||
                                                                         1: Remap (TIM6_UP and DAC_CH1 DMA requests mapped on DMA1 channel 3) */
 | 
			
		||||
#define HAL_REMAPDMA_TIM7_DAC1_CH2_DMA1_CH4  (0x00004000U) /*!< TIM7 and DAC channel2 DMA remap (STM32F303xB/C/E, STM32F358xx and STM32F398xx devices)
 | 
			
		||||
                                                                         1: Remap (TIM7_UP and DAC_CH2 DMA requests mapped on DMA1 channel 4) */
 | 
			
		||||
#define HAL_REMAPDMA_DAC2_CH1_DMA1_CH5       (0x00008000U) /*!< DAC2 channel1 DMA remap (STM32F303x4/6/8 devices only)
 | 
			
		||||
                                                                         1: Remap (DAC2_CH1 DMA requests mapped on DMA1 channel 5) */
 | 
			
		||||
#define HAL_REMAPDMA_TIM18_DAC2_CH1_DMA1_CH5 (0x00008000U) /*!< DAC2 channel1 DMA remap (STM32F303x4/6/8 devices only)
 | 
			
		||||
                                                                         1: Remap (DAC2_CH1 DMA requests mapped on DMA1 channel 5) */
 | 
			
		||||
#if defined(SYSCFG_CFGR3_DMA_RMP)
 | 
			
		||||
#if !defined(HAL_REMAP_CFGR3_MASK) 
 | 
			
		||||
#define HAL_REMAP_CFGR3_MASK                 (0x01000000U)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define HAL_REMAPDMA_SPI1_RX_DMA1_CH2        (0x01000003U) /*!< SPI1_RX DMA remap (STM32F303x4/6/8 devices only)
 | 
			
		||||
                                                                         11: Map on DMA1 channel 2 */
 | 
			
		||||
#define HAL_REMAPDMA_SPI1_RX_DMA1_CH4        (0x01000001U) /*!< SPI1_RX DMA remap (STM32F303x4/6/8 devices only)
 | 
			
		||||
                                                                         01: Map on DMA1 channel 4 */
 | 
			
		||||
#define HAL_REMAPDMA_SPI1_RX_DMA1_CH6        (0x01000002U) /*!< SPI1_RX DMA remap (STM32F303x4/6/8 devices only)
 | 
			
		||||
                                                                         10: Map on DMA1 channel 6 */
 | 
			
		||||
#define HAL_REMAPDMA_SPI1_TX_DMA1_CH3        (0x0100000CU) /*!< SPI1_TX DMA remap (STM32F303x4/6/8 devices only)
 | 
			
		||||
                                                                         11: Map on DMA1 channel 3 */
 | 
			
		||||
#define HAL_REMAPDMA_SPI1_TX_DMA1_CH5        (0x01000004U) /*!< SPI1_TX DMA remap (STM32F303x4/6/8 devices only)
 | 
			
		||||
                                                                         01: Map on DMA1 channel 5 */
 | 
			
		||||
#define HAL_REMAPDMA_SPI1_TX_DMA1_CH7        (0x01000008U) /*!< SPI1_TX DMA remap (STM32F303x4/6/8 devices only)
 | 
			
		||||
                                                                         10: Map on DMA1 channel 7 */
 | 
			
		||||
#define HAL_REMAPDMA_I2C1_RX_DMA1_CH7        (0x01000030U) /*!< I2C1_RX DMA remap (STM32F303x4/6/8 devices only)
 | 
			
		||||
                                                                         11: Map on DMA1 channel 7 */
 | 
			
		||||
#define HAL_REMAPDMA_I2C1_RX_DMA1_CH3        (0x01000010U) /*!< I2C1_RX DMA remap (STM32F303x4/6/8 devices only)
 | 
			
		||||
                                                                         01: Map on DMA1 channel 3 */
 | 
			
		||||
#define HAL_REMAPDMA_I2C1_RX_DMA1_CH5        (0x01000020U) /*!< I2C1_RX DMA remap (STM32F303x4/6/8 devices only)
 | 
			
		||||
                                                                         10: Map on DMA1 channel 5 */
 | 
			
		||||
#define HAL_REMAPDMA_I2C1_TX_DMA1_CH6        (0x010000C0U) /*!< I2C1_TX DMA remap (STM32F303x4/6/8 devices only)
 | 
			
		||||
                                                                         11: Map on DMA1 channel 6 */
 | 
			
		||||
#define HAL_REMAPDMA_I2C1_TX_DMA1_CH2        (0x01000040U) /*!< I2C1_TX DMA remap (STM32F303x4/6/8 devices only)
 | 
			
		||||
                                                                         01: Map on DMA1 channel 2 */
 | 
			
		||||
#define HAL_REMAPDMA_I2C1_TX_DMA1_CH4        (0x01000080U) /*!< I2C1_TX DMA remap (STM32F303x4/6/8 devices only)
 | 
			
		||||
                                                                         10: Map on DMA1 channel 4 */
 | 
			
		||||
#define HAL_REMAPDMA_ADC2_DMA1_CH2           (0x01000100U) /*!< ADC2 DMA remap
 | 
			
		||||
                                                                         x0: No remap (ADC2 on DMA2)
 | 
			
		||||
                                                                         10: Map on DMA1 channel 2 */
 | 
			
		||||
#define HAL_REMAPDMA_ADC2_DMA1_CH4           (0x01000300U) /*!< ADC2 DMA remap
 | 
			
		||||
                                                                         11: Map on DMA1 channel 4 */
 | 
			
		||||
#endif /* SYSCFG_CFGR3_DMA_RMP */
 | 
			
		||||
 | 
			
		||||
#if defined(SYSCFG_CFGR3_DMA_RMP)
 | 
			
		||||
#define IS_DMA_REMAP(RMP) ((((RMP) & HAL_REMAPDMA_ADC24_DMA2_CH34)         == HAL_REMAPDMA_ADC24_DMA2_CH34)         || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_TIM16_DMA1_CH6)          == HAL_REMAPDMA_TIM16_DMA1_CH6)          || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_TIM17_DMA1_CH7)          == HAL_REMAPDMA_TIM17_DMA1_CH7)          || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_TIM6_DAC1_CH1_DMA1_CH3)  == HAL_REMAPDMA_TIM6_DAC1_CH1_DMA1_CH3)  || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_TIM7_DAC1_CH2_DMA1_CH4)  == HAL_REMAPDMA_TIM7_DAC1_CH2_DMA1_CH4)  || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_DAC2_CH1_DMA1_CH5)       == HAL_REMAPDMA_DAC2_CH1_DMA1_CH5)       || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_TIM18_DAC2_CH1_DMA1_CH5) == HAL_REMAPDMA_TIM18_DAC2_CH1_DMA1_CH5) || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_SPI1_RX_DMA1_CH2)        == HAL_REMAPDMA_SPI1_RX_DMA1_CH2)  || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_SPI1_RX_DMA1_CH4)        == HAL_REMAPDMA_SPI1_RX_DMA1_CH4)  || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_SPI1_RX_DMA1_CH6)        == HAL_REMAPDMA_SPI1_RX_DMA1_CH6)  || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_SPI1_TX_DMA1_CH3)        == HAL_REMAPDMA_SPI1_TX_DMA1_CH3)  || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_SPI1_TX_DMA1_CH5)        == HAL_REMAPDMA_SPI1_TX_DMA1_CH5)  || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_SPI1_TX_DMA1_CH7)        == HAL_REMAPDMA_SPI1_TX_DMA1_CH7)  || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_I2C1_RX_DMA1_CH7)        == HAL_REMAPDMA_I2C1_RX_DMA1_CH7)  || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_I2C1_RX_DMA1_CH3)        == HAL_REMAPDMA_I2C1_RX_DMA1_CH3)  || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_I2C1_RX_DMA1_CH5)        == HAL_REMAPDMA_I2C1_RX_DMA1_CH5)  || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_I2C1_TX_DMA1_CH6)        == HAL_REMAPDMA_I2C1_TX_DMA1_CH6)  || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_I2C1_TX_DMA1_CH2)        == HAL_REMAPDMA_I2C1_TX_DMA1_CH2)  || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_I2C1_TX_DMA1_CH4)        == HAL_REMAPDMA_I2C1_TX_DMA1_CH4)  || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_ADC2_DMA1_CH2)           == HAL_REMAPDMA_ADC2_DMA1_CH2)     || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_ADC2_DMA1_CH4)           == HAL_REMAPDMA_ADC2_DMA1_CH4))
 | 
			
		||||
#else
 | 
			
		||||
#define IS_DMA_REMAP(RMP) ((((RMP) & HAL_REMAPDMA_ADC24_DMA2_CH34)         == HAL_REMAPDMA_ADC24_DMA2_CH34)         || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_TIM16_DMA1_CH6)          == HAL_REMAPDMA_TIM16_DMA1_CH6)          || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_TIM17_DMA1_CH7)          == HAL_REMAPDMA_TIM17_DMA1_CH7)          || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_TIM6_DAC1_CH1_DMA1_CH3)  == HAL_REMAPDMA_TIM6_DAC1_CH1_DMA1_CH3)  || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_TIM7_DAC1_CH2_DMA1_CH4)  == HAL_REMAPDMA_TIM7_DAC1_CH2_DMA1_CH4)  || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_DAC2_CH1_DMA1_CH5)       == HAL_REMAPDMA_DAC2_CH1_DMA1_CH5)       || \
 | 
			
		||||
                              (((RMP) & HAL_REMAPDMA_TIM18_DAC2_CH1_DMA1_CH5) == HAL_REMAPDMA_TIM18_DAC2_CH1_DMA1_CH5))
 | 
			
		||||
#endif /* SYSCFG_CFGR3_DMA_RMP && SYSCFG_CFGR1_DMA_RMP*/
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
#endif /* SYSCFG_CFGR1_DMA_RMP */
 | 
			
		||||
 | 
			
		||||
/** @defgroup HAL_Trigger_Remapping HAL Trigger Remapping
 | 
			
		||||
  *        Elements values convention: 0xXXYYYYYY
 | 
			
		||||
  *           - YYYYYY  : Position in the register
 | 
			
		||||
  *           - XX  : Register index
 | 
			
		||||
  *                 - 00: CFGR1 register in SYSCFG
 | 
			
		||||
  *                 - 01: CFGR3 register in SYSCFG
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define HAL_REMAPTRIGGER_DAC1_TRIG         (0x00000080U)  /*!< DAC trigger remap (when TSEL = 001 on STM32F303xB/C and STM32F358xx devices)
 | 
			
		||||
                                                                        0: No remap (DAC trigger is TIM8_TRGO)
 | 
			
		||||
                                                                        1: Remap (DAC trigger is TIM3_TRGO) */
 | 
			
		||||
#define HAL_REMAPTRIGGER_TIM1_ITR3         (0x00000040U)  /*!< TIM1 ITR3 trigger remap
 | 
			
		||||
                                                                        0: No remap
 | 
			
		||||
                                                                        1: Remap (TIM1_TRG3 = TIM17_OC) */
 | 
			
		||||
#if defined(SYSCFG_CFGR3_TRIGGER_RMP)
 | 
			
		||||
#if !defined(HAL_REMAP_CFGR3_MASK) 
 | 
			
		||||
#define HAL_REMAP_CFGR3_MASK               (0x01000000U)
 | 
			
		||||
#endif
 | 
			
		||||
#define HAL_REMAPTRIGGER_DAC1_TRIG3        (0x01010000U)  /*!< DAC1_CH1 / DAC1_CH2 Trigger remap
 | 
			
		||||
                                                                        0: Remap (DAC trigger is TIM15_TRGO)
 | 
			
		||||
                                                                        1: Remap (DAC trigger is HRTIM1_DAC1_TRIG1) */
 | 
			
		||||
#define HAL_REMAPTRIGGER_DAC1_TRIG5        (0x01020000U)  /*!< DAC1_CH1 / DAC1_CH2 Trigger remap
 | 
			
		||||
                                                                        0: No remap
 | 
			
		||||
                                                                        1: Remap (DAC trigger is HRTIM1_DAC1_TRIG2) */
 | 
			
		||||
#define IS_HAL_REMAPTRIGGER(RMP) ((((RMP) & HAL_REMAPTRIGGER_DAC1)       == HAL_REMAPTRIGGER_DAC1)       || \
 | 
			
		||||
                                  (((RMP) & HAL_REMAPTRIGGER_TIM1_ITR3)  == HAL_REMAPTRIGGER_TIM1_ITR3)  || \
 | 
			
		||||
                                  (((RMP) & HAL_REMAPTRIGGER_DAC1_TRIG3) == HAL_REMAPTRIGGER_DAC1_TRIG3) || \
 | 
			
		||||
                                  (((RMP) & HAL_REMAPTRIGGER_DAC1_TRIG5) == HAL_REMAPTRIGGER_DAC1_TRIG5))
 | 
			
		||||
#else
 | 
			
		||||
#define IS_HAL_REMAPTRIGGER(RMP) ((((RMP) & HAL_REMAPTRIGGER_DAC1)       == HAL_REMAPTRIGGER_DAC1)       || \
 | 
			
		||||
                                  (((RMP) & HAL_REMAPTRIGGER_TIM1_ITR3)  == HAL_REMAPTRIGGER_TIM1_ITR3))
 | 
			
		||||
#endif /* SYSCFG_CFGR3_TRIGGER_RMP */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#if defined (STM32F302xE)
 | 
			
		||||
/** @defgroup HAL_ADC_Trigger_Remapping HAL ADC Trigger Remapping
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define HAL_REMAPADCTRIGGER_ADC12_EXT2        SYSCFG_CFGR4_ADC12_EXT2_RMP   /*!< Input trigger of ADC12 regular channel EXT2
 | 
			
		||||
                                                                                 0: No remap (TIM1_CC3)
 | 
			
		||||
                                                                                 1: Remap (TIM20_TRGO) */
 | 
			
		||||
#define HAL_REMAPADCTRIGGER_ADC12_EXT3        SYSCFG_CFGR4_ADC12_EXT3_RMP   /*!< Input trigger of ADC12 regular channel EXT3
 | 
			
		||||
                                                                                 0: No remap (TIM2_CC2)
 | 
			
		||||
                                                                                 1: Remap (TIM20_TRGO2) */
 | 
			
		||||
#define HAL_REMAPADCTRIGGER_ADC12_EXT5        SYSCFG_CFGR4_ADC12_EXT5_RMP   /*!< Input trigger of ADC12 regular channel EXT5
 | 
			
		||||
                                                                                 0: No remap (TIM4_CC4)
 | 
			
		||||
                                                                                 1: Remap (TIM20_CC1) */
 | 
			
		||||
#define HAL_REMAPADCTRIGGER_ADC12_EXT13       SYSCFG_CFGR4_ADC12_EXT13_RMP  /*!< Input trigger of ADC12 regular channel EXT13
 | 
			
		||||
                                                                                 0: No remap (TIM6_TRGO)
 | 
			
		||||
                                                                                 1: Remap (TIM20_CC2) */
 | 
			
		||||
#define HAL_REMAPADCTRIGGER_ADC12_EXT15       SYSCFG_CFGR4_ADC12_EXT15_RMP  /*!< Input trigger of ADC12 regular channel EXT15
 | 
			
		||||
                                                                                 0: No remap (TIM3_CC4)
 | 
			
		||||
                                                                                 1: Remap (TIM20_CC3) */
 | 
			
		||||
#define HAL_REMAPADCTRIGGER_ADC12_JEXT3       SYSCFG_CFGR4_ADC12_JEXT3_RMP  /*!< Input trigger of ADC12 injected channel JEXT3
 | 
			
		||||
                                                                                 0: No remap (TIM2_CC1)
 | 
			
		||||
                                                                                 1: Remap (TIM20_TRGO) */
 | 
			
		||||
#define HAL_REMAPADCTRIGGER_ADC12_JEXT6       SYSCFG_CFGR4_ADC12_JEXT6_RMP  /*!< Input trigger of ADC12 injected channel JEXT6
 | 
			
		||||
                                                                                 0: No remap (EXTI line 15)
 | 
			
		||||
                                                                                 1: Remap (TIM20_TRGO2) */
 | 
			
		||||
#define HAL_REMAPADCTRIGGER_ADC12_JEXT13      SYSCFG_CFGR4_ADC12_JEXT13_RMP  /*!< Input trigger of ADC12 injected channel JEXT13
 | 
			
		||||
                                                                                 0: No remap (TIM3_CC1)
 | 
			
		||||
                                                                                 1: Remap (TIM20_CC4) */
 | 
			
		||||
 | 
			
		||||
#define IS_HAL_REMAPADCTRIGGER(RMP)  ((((RMP) & HAL_REMAPADCTRIGGER_ADC12_EXT2)   == HAL_REMAPADCTRIGGER_ADC12_EXT2)   || \
 | 
			
		||||
                                      (((RMP) & HAL_REMAPADCTRIGGER_ADC12_EXT3)   == HAL_REMAPADCTRIGGER_ADC12_EXT3)   || \
 | 
			
		||||
                                      (((RMP) & HAL_REMAPADCTRIGGER_ADC12_EXT5)   == HAL_REMAPADCTRIGGER_ADC12_EXT5)   || \
 | 
			
		||||
                                      (((RMP) & HAL_REMAPADCTRIGGER_ADC12_EXT13)  == HAL_REMAPADCTRIGGER_ADC12_EXT13)  || \
 | 
			
		||||
                                      (((RMP) & HAL_REMAPADCTRIGGER_ADC12_EXT15)  == HAL_REMAPADCTRIGGER_ADC12_EXT15)  || \
 | 
			
		||||
                                      (((RMP) & HAL_REMAPADCTRIGGER_ADC12_JEXT3)  == HAL_REMAPADCTRIGGER_ADC12_JEXT3)  || \
 | 
			
		||||
                                      (((RMP) & HAL_REMAPADCTRIGGER_ADC12_JEXT6)  == HAL_REMAPADCTRIGGER_ADC12_JEXT6)  || \
 | 
			
		||||
                                      (((RMP) & HAL_REMAPADCTRIGGER_ADC12_JEXT13) == HAL_REMAPADCTRIGGER_ADC12_JEXT13))
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
#endif /* STM32F302xE */
 | 
			
		||||
 | 
			
		||||
#if defined (STM32F303xE) || defined (STM32F398xx)
 | 
			
		||||
/** @defgroup HAL_ADC_Trigger_Remapping HAL ADC Trigger Remapping
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define HAL_REMAPADCTRIGGER_ADC12_EXT2        SYSCFG_CFGR4_ADC12_EXT2_RMP   /*!< Input trigger of ADC12 regular channel EXT2
 | 
			
		||||
                                                                                 0: No remap (TIM1_CC3)
 | 
			
		||||
                                                                                 1: Remap (TIM20_TRGO) */
 | 
			
		||||
#define HAL_REMAPADCTRIGGER_ADC12_EXT3        SYSCFG_CFGR4_ADC12_EXT3_RMP   /*!< Input trigger of ADC12 regular channel EXT3
 | 
			
		||||
                                                                                 0: No remap (TIM2_CC2)
 | 
			
		||||
                                                                                 1: Remap (TIM20_TRGO2) */
 | 
			
		||||
#define HAL_REMAPADCTRIGGER_ADC12_EXT5        SYSCFG_CFGR4_ADC12_EXT5_RMP   /*!< Input trigger of ADC12 regular channel EXT5
 | 
			
		||||
                                                                                 0: No remap (TIM4_CC4)
 | 
			
		||||
                                                                                 1: Remap (TIM20_CC1) */
 | 
			
		||||
#define HAL_REMAPADCTRIGGER_ADC12_EXT13       SYSCFG_CFGR4_ADC12_EXT13_RMP  /*!< Input trigger of ADC12 regular channel EXT13
 | 
			
		||||
                                                                                 0: No remap (TIM6_TRGO)
 | 
			
		||||
                                                                                 1: Remap (TIM20_CC2) */
 | 
			
		||||
#define HAL_REMAPADCTRIGGER_ADC12_EXT15       SYSCFG_CFGR4_ADC12_EXT15_RMP  /*!< Input trigger of ADC12 regular channel EXT15
 | 
			
		||||
                                                                                 0: No remap (TIM3_CC4)
 | 
			
		||||
                                                                                 1: Remap (TIM20_CC3) */
 | 
			
		||||
#define HAL_REMAPADCTRIGGER_ADC12_JEXT3       SYSCFG_CFGR4_ADC12_JEXT3_RMP  /*!< Input trigger of ADC12 injected channel JEXT3
 | 
			
		||||
                                                                                 0: No remap (TIM2_CC1)
 | 
			
		||||
                                                                                 1: Remap (TIM20_TRGO) */
 | 
			
		||||
#define HAL_REMAPADCTRIGGER_ADC12_JEXT6       SYSCFG_CFGR4_ADC12_JEXT6_RMP  /*!< Input trigger of ADC12 injected channel JEXT6
 | 
			
		||||
                                                                                 0: No remap (EXTI line 15)
 | 
			
		||||
                                                                                 1: Remap (TIM20_TRGO2) */
 | 
			
		||||
#define HAL_REMAPADCTRIGGER_ADC12_JEXT13      SYSCFG_CFGR4_ADC12_JEXT13_RMP  /*!< Input trigger of ADC12 injected channel JEXT13
 | 
			
		||||
                                                                                 0: No remap (TIM3_CC1)
 | 
			
		||||
                                                                                 1: Remap (TIM20_CC4) */
 | 
			
		||||
#define HAL_REMAPADCTRIGGER_ADC34_EXT5        SYSCFG_CFGR4_ADC34_EXT5_RMP   /*!< Input trigger of ADC34 regular channel EXT5
 | 
			
		||||
                                                                                 0: No remap (EXTI line 2)
 | 
			
		||||
                                                                                 1: Remap (TIM20_TRGO) */
 | 
			
		||||
#define HAL_REMAPADCTRIGGER_ADC34_EXT6        SYSCFG_CFGR4_ADC34_EXT6_RMP   /*!< Input trigger of ADC34 regular channel EXT6
 | 
			
		||||
                                                                                 0: No remap (TIM4_CC1)
 | 
			
		||||
                                                                                 1: Remap (TIM20_TRGO2) */
 | 
			
		||||
#define HAL_REMAPADCTRIGGER_ADC34_EXT15       SYSCFG_CFGR4_ADC34_EXT15_RMP  /*!< Input trigger of ADC34 regular channel EXT15
 | 
			
		||||
                                                                                 0: No remap (TIM2_CC1)
 | 
			
		||||
                                                                                 1: Remap (TIM20_CC1) */
 | 
			
		||||
#define HAL_REMAPADCTRIGGER_ADC34_JEXT5       SYSCFG_CFGR4_ADC34_JEXT5_RMP  /*!< Input trigger of ADC34 injected channel JEXT5
 | 
			
		||||
                                                                                 0: No remap (TIM4_CC3)
 | 
			
		||||
                                                                                 1: Remap (TIM20_TRGO) */
 | 
			
		||||
#define HAL_REMAPADCTRIGGER_ADC34_JEXT11      SYSCFG_CFGR4_ADC34_JEXT11_RMP /*!< Input trigger of ADC34 injected channel JEXT11
 | 
			
		||||
                                                                                 0: No remap (TIM1_CC3)
 | 
			
		||||
                                                                                 1: Remap (TIM20_TRGO2) */
 | 
			
		||||
#define HAL_REMAPADCTRIGGER_ADC34_JEXT14      SYSCFG_CFGR4_ADC34_JEXT14_RMP /*!< Input trigger of ADC34 injected channel JEXT14
 | 
			
		||||
                                                                                 0: No remap (TIM7_TRGO)
 | 
			
		||||
                                                                                 1: Remap (TIM20_CC2) */
 | 
			
		||||
 | 
			
		||||
#define IS_HAL_REMAPADCTRIGGER(RMP)  ((((RMP) & HAL_REMAPADCTRIGGER_ADC12_EXT2)   == HAL_REMAPADCTRIGGER_ADC12_EXT2)   || \
 | 
			
		||||
                                      (((RMP) & HAL_REMAPADCTRIGGER_ADC12_EXT3)   == HAL_REMAPADCTRIGGER_ADC12_EXT3)   || \
 | 
			
		||||
                                      (((RMP) & HAL_REMAPADCTRIGGER_ADC12_EXT5)   == HAL_REMAPADCTRIGGER_ADC12_EXT5)   || \
 | 
			
		||||
                                      (((RMP) & HAL_REMAPADCTRIGGER_ADC12_EXT13)  == HAL_REMAPADCTRIGGER_ADC12_EXT13)  || \
 | 
			
		||||
                                      (((RMP) & HAL_REMAPADCTRIGGER_ADC12_EXT15)  == HAL_REMAPADCTRIGGER_ADC12_EXT15)  || \
 | 
			
		||||
                                      (((RMP) & HAL_REMAPADCTRIGGER_ADC12_JEXT3)  == HAL_REMAPADCTRIGGER_ADC12_JEXT3)  || \
 | 
			
		||||
                                      (((RMP) & HAL_REMAPADCTRIGGER_ADC12_JEXT6)  == HAL_REMAPADCTRIGGER_ADC12_JEXT6)  || \
 | 
			
		||||
                                      (((RMP) & HAL_REMAPADCTRIGGER_ADC12_JEXT13) == HAL_REMAPADCTRIGGER_ADC12_JEXT13) || \
 | 
			
		||||
                                      (((RMP) & HAL_REMAPADCTRIGGER_ADC34_EXT5)   == HAL_REMAPADCTRIGGER_ADC34_EXT5)   || \
 | 
			
		||||
                                      (((RMP) & HAL_REMAPADCTRIGGER_ADC34_EXT6)   == HAL_REMAPADCTRIGGER_ADC34_EXT6)   || \
 | 
			
		||||
                                      (((RMP) & HAL_REMAPADCTRIGGER_ADC34_EXT15)  == HAL_REMAPADCTRIGGER_ADC34_EXT15)  || \
 | 
			
		||||
                                      (((RMP) & HAL_REMAPADCTRIGGER_ADC34_JEXT5)  == HAL_REMAPADCTRIGGER_ADC34_JEXT5)  || \
 | 
			
		||||
                                      (((RMP) & HAL_REMAPADCTRIGGER_ADC34_JEXT11) == HAL_REMAPADCTRIGGER_ADC34_JEXT11) || \
 | 
			
		||||
                                      (((RMP) & HAL_REMAPADCTRIGGER_ADC34_JEXT14) == HAL_REMAPADCTRIGGER_ADC34_JEXT14))
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
#endif /* STM32F303xE || STM32F398xx */
 | 
			
		||||
 | 
			
		||||
/** @defgroup SYSCFG_FastModePlus_GPIO Fast-mode Plus on GPIO
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @brief  Fast-mode Plus driving capability on a specific GPIO
 | 
			
		||||
  */  
 | 
			
		||||
#if defined(SYSCFG_CFGR1_I2C_PB6_FMP)
 | 
			
		||||
#define SYSCFG_FASTMODEPLUS_PB6    ((uint32_t)SYSCFG_CFGR1_I2C_PB6_FMP)  /*!< Enable Fast-mode Plus on PB6  */
 | 
			
		||||
#endif /* SYSCFG_CFGR1_I2C_PB6_FMP */
 | 
			
		||||
 | 
			
		||||
#if defined(SYSCFG_CFGR1_I2C_PB7_FMP)
 | 
			
		||||
#define SYSCFG_FASTMODEPLUS_PB7    ((uint32_t)SYSCFG_CFGR1_I2C_PB7_FMP)  /*!< Enable Fast-mode Plus on PB7  */
 | 
			
		||||
#endif /* SYSCFG_CFGR1_I2C_PB7_FMP */
 | 
			
		||||
 | 
			
		||||
#if defined(SYSCFG_CFGR1_I2C_PB8_FMP)
 | 
			
		||||
#define SYSCFG_FASTMODEPLUS_PB8    ((uint32_t)SYSCFG_CFGR1_I2C_PB8_FMP)  /*!< Enable Fast-mode Plus on PB8  */
 | 
			
		||||
#endif /* SYSCFG_CFGR1_I2C_PB8_FMP */
 | 
			
		||||
 | 
			
		||||
#if defined(SYSCFG_CFGR1_I2C_PB9_FMP)
 | 
			
		||||
#define SYSCFG_FASTMODEPLUS_PB9    ((uint32_t)SYSCFG_CFGR1_I2C_PB9_FMP)  /*!< Enable Fast-mode Plus on PB9  */
 | 
			
		||||
#endif /* SYSCFG_CFGR1_I2C_PB9_FMP */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#if defined(SYSCFG_RCR_PAGE0)
 | 
			
		||||
/* CCM-SRAM defined */
 | 
			
		||||
/** @defgroup HAL_Page_Write_Protection HAL CCM RAM page write protection
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define HAL_SYSCFG_WP_PAGE0                    (SYSCFG_RCR_PAGE0)  /*!< ICODE SRAM Write protection page 0 */
 | 
			
		||||
#define HAL_SYSCFG_WP_PAGE1                    (SYSCFG_RCR_PAGE1)  /*!< ICODE SRAM Write protection page 1 */
 | 
			
		||||
#define HAL_SYSCFG_WP_PAGE2                    (SYSCFG_RCR_PAGE2)  /*!< ICODE SRAM Write protection page 2 */
 | 
			
		||||
#define HAL_SYSCFG_WP_PAGE3                    (SYSCFG_RCR_PAGE3)  /*!< ICODE SRAM Write protection page 3 */
 | 
			
		||||
#if defined(SYSCFG_RCR_PAGE4)
 | 
			
		||||
/* More than 4KB CCM-SRAM defined */
 | 
			
		||||
#define HAL_SYSCFG_WP_PAGE4                    (SYSCFG_RCR_PAGE4)  /*!< ICODE SRAM Write protection page 4 */
 | 
			
		||||
#define HAL_SYSCFG_WP_PAGE5                    (SYSCFG_RCR_PAGE5)  /*!< ICODE SRAM Write protection page 5 */
 | 
			
		||||
#define HAL_SYSCFG_WP_PAGE6                    (SYSCFG_RCR_PAGE6)  /*!< ICODE SRAM Write protection page 6 */
 | 
			
		||||
#define HAL_SYSCFG_WP_PAGE7                    (SYSCFG_RCR_PAGE7)  /*!< ICODE SRAM Write protection page 7 */
 | 
			
		||||
#endif /* SYSCFG_RCR_PAGE4 */
 | 
			
		||||
#if defined(SYSCFG_RCR_PAGE8)
 | 
			
		||||
#define HAL_SYSCFG_WP_PAGE8                    (SYSCFG_RCR_PAGE8)  /*!< ICODE SRAM Write protection page 8 */
 | 
			
		||||
#define HAL_SYSCFG_WP_PAGE9                    (SYSCFG_RCR_PAGE9)  /*!< ICODE SRAM Write protection page 9 */
 | 
			
		||||
#define HAL_SYSCFG_WP_PAGE10                   (SYSCFG_RCR_PAGE10) /*!< ICODE SRAM Write protection page 10 */
 | 
			
		||||
#define HAL_SYSCFG_WP_PAGE11                   (SYSCFG_RCR_PAGE11) /*!< ICODE SRAM Write protection page 11 */
 | 
			
		||||
#define HAL_SYSCFG_WP_PAGE12                   (SYSCFG_RCR_PAGE12) /*!< ICODE SRAM Write protection page 12 */
 | 
			
		||||
#define HAL_SYSCFG_WP_PAGE13                   (SYSCFG_RCR_PAGE13) /*!< ICODE SRAM Write protection page 13 */
 | 
			
		||||
#define HAL_SYSCFG_WP_PAGE14                   (SYSCFG_RCR_PAGE14) /*!< ICODE SRAM Write protection page 14 */
 | 
			
		||||
#define HAL_SYSCFG_WP_PAGE15                   (SYSCFG_RCR_PAGE15) /*!< ICODE SRAM Write protection page 15 */
 | 
			
		||||
#endif /* SYSCFG_RCR_PAGE8 */
 | 
			
		||||
 | 
			
		||||
#if defined(SYSCFG_RCR_PAGE8)
 | 
			
		||||
#define IS_HAL_SYSCFG_WP_PAGE(__PAGE__)        (((__PAGE__) > 0U) && ((__PAGE__) <= 0xFFFFU))
 | 
			
		||||
#elif defined(SYSCFG_RCR_PAGE4)
 | 
			
		||||
#define IS_HAL_SYSCFG_WP_PAGE(__PAGE__)        (((__PAGE__) > 0U) && ((__PAGE__) <= 0x00FFU))
 | 
			
		||||
#else
 | 
			
		||||
#define IS_HAL_SYSCFG_WP_PAGE(__PAGE__)        (((__PAGE__) > 0U) && ((__PAGE__) <= 0x000FU))
 | 
			
		||||
#endif /* SYSCFG_RCR_PAGE8 */      
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
#endif /* SYSCFG_RCR_PAGE0 */
 | 
			
		||||
 | 
			
		||||
/** @defgroup HAL_SYSCFG_Interrupts HAL SYSCFG Interrupts
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define HAL_SYSCFG_IT_FPU_IOC                  (SYSCFG_CFGR1_FPU_IE_0)  /*!< Floating Point Unit Invalid operation Interrupt */
 | 
			
		||||
#define HAL_SYSCFG_IT_FPU_DZC                  (SYSCFG_CFGR1_FPU_IE_1)  /*!< Floating Point Unit Divide-by-zero Interrupt */
 | 
			
		||||
#define HAL_SYSCFG_IT_FPU_UFC                  (SYSCFG_CFGR1_FPU_IE_2)  /*!< Floating Point Unit Underflow Interrupt */
 | 
			
		||||
#define HAL_SYSCFG_IT_FPU_OFC                  (SYSCFG_CFGR1_FPU_IE_3)  /*!< Floating Point Unit Overflow Interrupt */
 | 
			
		||||
#define HAL_SYSCFG_IT_FPU_IDC                  (SYSCFG_CFGR1_FPU_IE_4)  /*!< Floating Point Unit Input denormal Interrupt */
 | 
			
		||||
#define HAL_SYSCFG_IT_FPU_IXC                  (SYSCFG_CFGR1_FPU_IE_5)  /*!< Floating Point Unit Inexact Interrupt */
 | 
			
		||||
 | 
			
		||||
#define IS_HAL_SYSCFG_INTERRUPT(__INTERRUPT__) ((((__INTERRUPT__) & SYSCFG_CFGR1_FPU_IE_0) == SYSCFG_CFGR1_FPU_IE_0) || \
 | 
			
		||||
                                                (((__INTERRUPT__) & SYSCFG_CFGR1_FPU_IE_1) == SYSCFG_CFGR1_FPU_IE_1) || \
 | 
			
		||||
                                                (((__INTERRUPT__) & SYSCFG_CFGR1_FPU_IE_2) == SYSCFG_CFGR1_FPU_IE_2) || \
 | 
			
		||||
                                                (((__INTERRUPT__) & SYSCFG_CFGR1_FPU_IE_3) == SYSCFG_CFGR1_FPU_IE_3) || \
 | 
			
		||||
                                                (((__INTERRUPT__) & SYSCFG_CFGR1_FPU_IE_4) == SYSCFG_CFGR1_FPU_IE_4) || \
 | 
			
		||||
                                                (((__INTERRUPT__) & SYSCFG_CFGR1_FPU_IE_5) == SYSCFG_CFGR1_FPU_IE_5))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
  
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */ 
 | 
			
		||||
 | 
			
		||||
/* Exported macros -----------------------------------------------------------*/
 | 
			
		||||
/** @defgroup HAL_Exported_Macros HAL Exported Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup Debug_MCU_APB1_Freeze Freeze/Unfreeze APB1 Peripherals in Debug mode
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#if defined(DBGMCU_APB1_FZ_DBG_TIM2_STOP)
 | 
			
		||||
#define __HAL_DBGMCU_FREEZE_TIM2()           (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM2_STOP))
 | 
			
		||||
#define __HAL_DBGMCU_UNFREEZE_TIM2()         (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM2_STOP))
 | 
			
		||||
#endif /* DBGMCU_APB1_FZ_DBG_TIM2_STOP */
 | 
			
		||||
 | 
			
		||||
#if defined(DBGMCU_APB1_FZ_DBG_TIM3_STOP)
 | 
			
		||||
#define __HAL_DBGMCU_FREEZE_TIM3()           (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM3_STOP))
 | 
			
		||||
#define __HAL_DBGMCU_UNFREEZE_TIM3()         (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM3_STOP))
 | 
			
		||||
#endif /* DBGMCU_APB1_FZ_DBG_TIM3_STOP */
 | 
			
		||||
 | 
			
		||||
#if defined(DBGMCU_APB1_FZ_DBG_TIM4_STOP)
 | 
			
		||||
#define __HAL_DBGMCU_FREEZE_TIM4()           (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM4_STOP))
 | 
			
		||||
#define __HAL_DBGMCU_UNFREEZE_TIM4()         (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM4_STOP))
 | 
			
		||||
#endif /* DBGMCU_APB1_FZ_DBG_TIM4_STOP */
 | 
			
		||||
 | 
			
		||||
#if defined(DBGMCU_APB1_FZ_DBG_TIM5_STOP)
 | 
			
		||||
#define __HAL_DBGMCU_FREEZE_TIM5()           (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM5_STOP))
 | 
			
		||||
#define __HAL_DBGMCU_UNFREEZE_TIM5()         (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM5_STOP))
 | 
			
		||||
#endif /* DBGMCU_APB1_FZ_DBG_TIM5_STOP */
 | 
			
		||||
 | 
			
		||||
#if defined(DBGMCU_APB1_FZ_DBG_TIM6_STOP)
 | 
			
		||||
#define __HAL_DBGMCU_FREEZE_TIM6()           (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM6_STOP))
 | 
			
		||||
#define __HAL_DBGMCU_UNFREEZE_TIM6()         (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM6_STOP))
 | 
			
		||||
#endif /* DBGMCU_APB1_FZ_DBG_TIM6_STOP */
 | 
			
		||||
 | 
			
		||||
#if defined(DBGMCU_APB1_FZ_DBG_TIM7_STOP)
 | 
			
		||||
#define __HAL_DBGMCU_FREEZE_TIM7()           (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM7_STOP))
 | 
			
		||||
#define __HAL_DBGMCU_UNFREEZE_TIM7()         (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM7_STOP))
 | 
			
		||||
#endif /* DBGMCU_APB1_FZ_DBG_TIM7_STOP */
 | 
			
		||||
 | 
			
		||||
#if defined(DBGMCU_APB1_FZ_DBG_TIM12_STOP)
 | 
			
		||||
#define __HAL_DBGMCU_FREEZE_TIM12()          (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM12_STOP))
 | 
			
		||||
#define __HAL_DBGMCU_UNFREEZE_TIM12()        (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM12_STOP))
 | 
			
		||||
#endif /* DBGMCU_APB1_FZ_DBG_TIM12_STOP */
 | 
			
		||||
 | 
			
		||||
#if defined(DBGMCU_APB1_FZ_DBG_TIM13_STOP)
 | 
			
		||||
#define __HAL_DBGMCU_FREEZE_TIM13()          (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM13_STOP))
 | 
			
		||||
#define __HAL_DBGMCU_UNFREEZE_TIM13()        (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM13_STOP))
 | 
			
		||||
#endif /* DBGMCU_APB1_FZ_DBG_TIM13_STOP */
 | 
			
		||||
 | 
			
		||||
#if defined(DBGMCU_APB1_FZ_DBG_TIM14_STOP)
 | 
			
		||||
#define __HAL_DBGMCU_FREEZE_TIM14()          (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM14_STOP))
 | 
			
		||||
#define __HAL_DBGMCU_UNFREEZE_TIM14()        (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM14_STOP))
 | 
			
		||||
#endif /* DBGMCU_APB1_FZ_DBG_TIM14_STOP */
 | 
			
		||||
 | 
			
		||||
#if defined(DBGMCU_APB1_FZ_DBG_TIM18_STOP)
 | 
			
		||||
#define __HAL_FREEZE_TIM18_DBGMCU()          (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM18_STOP))
 | 
			
		||||
#define __HAL_UNFREEZE_TIM18_DBGMCU()        (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM18_STOP))
 | 
			
		||||
#endif /* DBGMCU_APB1_FZ_DBG_TIM14_STOP */
 | 
			
		||||
 | 
			
		||||
#if defined(DBGMCU_APB1_FZ_DBG_RTC_STOP)
 | 
			
		||||
#define __HAL_DBGMCU_FREEZE_RTC()            (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_RTC_STOP))
 | 
			
		||||
#define __HAL_DBGMCU_UNFREEZE_RTC()          (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_RTC_STOP))
 | 
			
		||||
#endif /* DBGMCU_APB1_FZ_DBG_RTC_STOP */
 | 
			
		||||
 | 
			
		||||
#if defined(DBGMCU_APB1_FZ_DBG_WWDG_STOP)
 | 
			
		||||
#define __HAL_DBGMCU_FREEZE_WWDG()           (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_WWDG_STOP))
 | 
			
		||||
#define __HAL_DBGMCU_UNFREEZE_WWDG()         (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_WWDG_STOP))
 | 
			
		||||
#endif /* DBGMCU_APB1_FZ_DBG_WWDG_STOP */
 | 
			
		||||
 | 
			
		||||
#if defined(DBGMCU_APB1_FZ_DBG_IWDG_STOP)
 | 
			
		||||
#define __HAL_DBGMCU_FREEZE_IWDG()           (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_IWDG_STOP))
 | 
			
		||||
#define __HAL_DBGMCU_UNFREEZE_IWDG()         (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_IWDG_STOP))
 | 
			
		||||
#endif /* DBGMCU_APB1_FZ_DBG_IWDG_STOP */
 | 
			
		||||
 | 
			
		||||
#if defined(DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT)
 | 
			
		||||
#define __HAL_DBGMCU_FREEZE_I2C1_TIMEOUT()   (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT))
 | 
			
		||||
#define __HAL_DBGMCU_UNFREEZE_I2C1_TIMEOUT() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT))
 | 
			
		||||
#endif /* DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT */
 | 
			
		||||
 | 
			
		||||
#if defined(DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT)
 | 
			
		||||
#define __HAL_DBGMCU_FREEZE_I2C2_TIMEOUT()   (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT))
 | 
			
		||||
#define __HAL_DBGMCU_UNFREEZE_I2C2_TIMEOUT() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT))
 | 
			
		||||
#endif /* DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT */
 | 
			
		||||
 | 
			
		||||
#if defined(DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT)
 | 
			
		||||
#define __HAL_DBGMCU_FREEZE_I2C3_TIMEOUT()   (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT))
 | 
			
		||||
#define __HAL_DBGMCU_UNFREEZE_I2C3_TIMEOUT() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT))
 | 
			
		||||
#endif /* DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT */
 | 
			
		||||
 | 
			
		||||
#if defined(DBGMCU_APB1_FZ_DBG_CAN_STOP)
 | 
			
		||||
#define __HAL_FREEZE_CAN_DBGMCU()            (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_CAN_STOP))
 | 
			
		||||
#define __HAL_UNFREEZE_CAN_DBGMCU()          (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_CAN_STOP))
 | 
			
		||||
#endif /* DBGMCU_APB1_FZ_DBG_CAN_STOP */
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
/** @defgroup Debug_MCU_APB2_Freeze Freeze/Unfreeze APB2 Peripherals in Debug mode
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#if defined(DBGMCU_APB2_FZ_DBG_TIM1_STOP)
 | 
			
		||||
#define __HAL_DBGMCU_FREEZE_TIM1()           (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM1_STOP))
 | 
			
		||||
#define __HAL_DBGMCU_UNFREEZE_TIM1()           (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM1_STOP))
 | 
			
		||||
#endif /* DBGMCU_APB2_FZ_DBG_TIM1_STOP */
 | 
			
		||||
 | 
			
		||||
#if defined(DBGMCU_APB2_FZ_DBG_TIM8_STOP)
 | 
			
		||||
#define __HAL_DBGMCU_FREEZE_TIM8()           (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM8_STOP))
 | 
			
		||||
#define __HAL_DBGMCU_UNFREEZE_TIM8()         (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM8_STOP))
 | 
			
		||||
#endif /* DBGMCU_APB2_FZ_DBG_TIM8_STOP */
 | 
			
		||||
 | 
			
		||||
#if defined(DBGMCU_APB2_FZ_DBG_TIM15_STOP)
 | 
			
		||||
#define __HAL_DBGMCU_FREEZE_TIM15()          (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM15_STOP))
 | 
			
		||||
#define __HAL_DBGMCU_UNFREEZE_TIM15()        (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM15_STOP))
 | 
			
		||||
#endif /* DBGMCU_APB2_FZ_DBG_TIM15_STOP */
 | 
			
		||||
 | 
			
		||||
#if defined(DBGMCU_APB2_FZ_DBG_TIM16_STOP)
 | 
			
		||||
#define __HAL_DBGMCU_FREEZE_TIM16()          (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM16_STOP))
 | 
			
		||||
#define __HAL_DBGMCU_UNFREEZE_TIM16()        (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM16_STOP))
 | 
			
		||||
#endif /* DBGMCU_APB2_FZ_DBG_TIM16_STOP */
 | 
			
		||||
 | 
			
		||||
#if defined(DBGMCU_APB2_FZ_DBG_TIM17_STOP)
 | 
			
		||||
#define __HAL_DBGMCU_FREEZE_TIM17()          (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM17_STOP))
 | 
			
		||||
#define __HAL_DBGMCU_UNFREEZE_TIM17()        (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM17_STOP))
 | 
			
		||||
#endif /* DBGMCU_APB2_FZ_DBG_TIM17_STOP */
 | 
			
		||||
 | 
			
		||||
#if defined(DBGMCU_APB2_FZ_DBG_TIM19_STOP)
 | 
			
		||||
#define __HAL_FREEZE_TIM19_DBGMCU()          (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM19_STOP))
 | 
			
		||||
#define __HAL_UNFREEZE_TIM19_DBGMCU()        (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM19_STOP))
 | 
			
		||||
#endif /* DBGMCU_APB2_FZ_DBG_TIM19_STOP */
 | 
			
		||||
 | 
			
		||||
#if defined(DBGMCU_APB2_FZ_DBG_TIM20_STOP)
 | 
			
		||||
#define __HAL_FREEZE_TIM20_DBGMCU()          (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM20_STOP))
 | 
			
		||||
#define __HAL_UNFREEZE_TIM20_DBGMCU()        (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM20_STOP))
 | 
			
		||||
#endif /* DBGMCU_APB2_FZ_DBG_TIM20_STOP */
 | 
			
		||||
 | 
			
		||||
#if defined(DBGMCU_APB2_FZ_DBG_HRTIM1_STOP)
 | 
			
		||||
#define __HAL_FREEZE_HRTIM1_DBGMCU()          (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_HRTIM1_STOP))
 | 
			
		||||
#define __HAL_UNFREEZE_HRTIM1_DBGMCU()        (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_HRTIM1_STOP))
 | 
			
		||||
#endif /* DBGMCU_APB2_FZ_DBG_HRTIM1_STOP */
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/** @defgroup Memory_Mapping_Selection Memory Mapping Selection
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#if defined(SYSCFG_CFGR1_MEM_MODE)
 | 
			
		||||
/** @brief  Main Flash memory mapped at 0x00000000
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_SYSCFG_REMAPMEMORY_FLASH()        (SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_MEM_MODE))
 | 
			
		||||
#endif /* SYSCFG_CFGR1_MEM_MODE */
 | 
			
		||||
 | 
			
		||||
#if defined(SYSCFG_CFGR1_MEM_MODE_0)
 | 
			
		||||
/** @brief  System Flash memory mapped at 0x00000000
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH()  do {SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_MEM_MODE); \
 | 
			
		||||
                                             SYSCFG->CFGR1 |= SYSCFG_CFGR1_MEM_MODE_0;  \
 | 
			
		||||
                                            }while(0U)
 | 
			
		||||
#endif /* SYSCFG_CFGR1_MEM_MODE_0 */
 | 
			
		||||
 | 
			
		||||
#if defined(SYSCFG_CFGR1_MEM_MODE_0) && defined(SYSCFG_CFGR1_MEM_MODE_1)
 | 
			
		||||
/** @brief  Embedded SRAM mapped at 0x00000000
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_SYSCFG_REMAPMEMORY_SRAM()         do {SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_MEM_MODE); \
 | 
			
		||||
                                             SYSCFG->CFGR1 |= (SYSCFG_CFGR1_MEM_MODE_0 | SYSCFG_CFGR1_MEM_MODE_1); \
 | 
			
		||||
                                            }while(0U)
 | 
			
		||||
#endif /* SYSCFG_CFGR1_MEM_MODE_0 && SYSCFG_CFGR1_MEM_MODE_1 */
 | 
			
		||||
 | 
			
		||||
#if defined(SYSCFG_CFGR1_MEM_MODE_2)
 | 
			
		||||
#define __HAL_SYSCFG_FMC_BANK()         do {SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_MEM_MODE); \
 | 
			
		||||
                                     SYSCFG->CFGR1 |= (SYSCFG_CFGR1_MEM_MODE_2); \
 | 
			
		||||
                                    }while(0U)
 | 
			
		||||
#endif /* SYSCFG_CFGR1_MEM_MODE_2 */
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
/** @defgroup Encoder_Mode Encoder Mode
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#if defined(SYSCFG_CFGR1_ENCODER_MODE)
 | 
			
		||||
/** @brief  No Encoder mode
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_REMAPENCODER_NONE()        (SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_ENCODER_MODE))
 | 
			
		||||
#endif /* SYSCFG_CFGR1_ENCODER_MODE */
 | 
			
		||||
 | 
			
		||||
#if defined(SYSCFG_CFGR1_ENCODER_MODE_0)
 | 
			
		||||
/** @brief  Encoder mode : TIM2 IC1 and TIM2 IC2 are connected to TIM15 IC1 and TIM15 IC2 respectively
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_REMAPENCODER_TIM2()        do {SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_ENCODER_MODE); \
 | 
			
		||||
                                             SYSCFG->CFGR1 |= SYSCFG_CFGR1_ENCODER_MODE_0;  \
 | 
			
		||||
                                            }while(0U)
 | 
			
		||||
#endif /* SYSCFG_CFGR1_ENCODER_MODE_0 */
 | 
			
		||||
 | 
			
		||||
#if defined(SYSCFG_CFGR1_ENCODER_MODE_1)
 | 
			
		||||
/** @brief  Encoder mode : TIM3 IC1 and TIM3 IC2 are connected to TIM15 IC1 and TIM15 IC2 respectively
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_REMAPENCODER_TIM3()        do {SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_ENCODER_MODE); \
 | 
			
		||||
                                             SYSCFG->CFGR1 |= SYSCFG_CFGR1_ENCODER_MODE_1;  \
 | 
			
		||||
                                            }while(0U)
 | 
			
		||||
#endif /* SYSCFG_CFGR1_ENCODER_MODE_1 */
 | 
			
		||||
 | 
			
		||||
#if defined(SYSCFG_CFGR1_ENCODER_MODE_0) && defined(SYSCFG_CFGR1_ENCODER_MODE_1)
 | 
			
		||||
/** @brief  Encoder mode : TIM4 IC1 and TIM4 IC2 are connected to TIM15 IC1 and TIM15 IC2 (STM32F303xB/C and STM32F358xx devices)
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_REMAPENCODER_TIM4()        do {SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_ENCODER_MODE); \
 | 
			
		||||
                                             SYSCFG->CFGR1 |= (SYSCFG_CFGR1_ENCODER_MODE_0 | SYSCFG_CFGR1_ENCODER_MODE_1);  \
 | 
			
		||||
                                            }while(0U)
 | 
			
		||||
#endif /* SYSCFG_CFGR1_ENCODER_MODE_0 && SYSCFG_CFGR1_ENCODER_MODE_1 */
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
/** @defgroup DMA_Remap_Enable DMA Remap Enable
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#if defined(SYSCFG_CFGR3_DMA_RMP) && defined(SYSCFG_CFGR1_DMA_RMP)
 | 
			
		||||
/** @brief  DMA remapping enable/disable macros
 | 
			
		||||
  * @param __DMA_REMAP__ This parameter can be a value of @ref HAL_DMA_Remapping
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_DMA_REMAP_CHANNEL_ENABLE(__DMA_REMAP__)   do {assert_param(IS_DMA_REMAP((__DMA_REMAP__)));                  \
 | 
			
		||||
                                                           (((__DMA_REMAP__) & HAL_REMAP_CFGR3_MASK) ?                      \
 | 
			
		||||
                                                             (SYSCFG->CFGR3 |= ((__DMA_REMAP__) & ~HAL_REMAP_CFGR3_MASK)) : \
 | 
			
		||||
                                                             (SYSCFG->CFGR1 |= (__DMA_REMAP__)));                           \
 | 
			
		||||
                                                         }while(0U)
 | 
			
		||||
#define __HAL_DMA_REMAP_CHANNEL_DISABLE(__DMA_REMAP__)  do {assert_param(IS_DMA_REMAP((__DMA_REMAP__)));                  \
 | 
			
		||||
                                                           (((__DMA_REMAP__) & HAL_REMAP_CFGR3_MASK) ?                      \
 | 
			
		||||
                                                             (SYSCFG->CFGR3 &= (~(__DMA_REMAP__) | HAL_REMAP_CFGR3_MASK)) : \
 | 
			
		||||
                                                             (SYSCFG->CFGR1 &= ~(__DMA_REMAP__)));                          \
 | 
			
		||||
                                                         }while(0U)
 | 
			
		||||
#elif defined(SYSCFG_CFGR1_DMA_RMP)
 | 
			
		||||
/** @brief  DMA remapping enable/disable macros
 | 
			
		||||
  * @param __DMA_REMAP__ This parameter can be a value of @ref HAL_DMA_Remapping
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_DMA_REMAP_CHANNEL_ENABLE(__DMA_REMAP__)   do {assert_param(IS_DMA_REMAP((__DMA_REMAP__)));                  \
 | 
			
		||||
                                                           SYSCFG->CFGR1 |= (__DMA_REMAP__);                                \
 | 
			
		||||
                                                         }while(0U)
 | 
			
		||||
#define __HAL_DMA_REMAP_CHANNEL_DISABLE(__DMA_REMAP__)  do {assert_param(IS_DMA_REMAP((__DMA_REMAP__)));                  \
 | 
			
		||||
                                                           SYSCFG->CFGR1 &= ~(__DMA_REMAP__);                               \
 | 
			
		||||
                                                         }while(0U)
 | 
			
		||||
#endif /* SYSCFG_CFGR3_DMA_RMP || SYSCFG_CFGR1_DMA_RMP */
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
/** @defgroup FastModePlus_GPIO Fast-mode Plus on GPIO
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/** @brief  Fast-mode Plus driving capability enable/disable macros
 | 
			
		||||
  * @param __FASTMODEPLUS__ This parameter can be a value of @ref SYSCFG_FastModePlus_GPIO values.
 | 
			
		||||
  *                          That you can find above these macros.
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_SYSCFG_FASTMODEPLUS_ENABLE(__FASTMODEPLUS__)  do {assert_param(IS_SYSCFG_FASTMODEPLUS((__FASTMODEPLUS__)));\
 | 
			
		||||
                                                                SET_BIT(SYSCFG->CFGR1, (__FASTMODEPLUS__));\
 | 
			
		||||
                                                               }while(0U)
 | 
			
		||||
 | 
			
		||||
#define __HAL_SYSCFG_FASTMODEPLUS_DISABLE(__FASTMODEPLUS__) do {assert_param(IS_SYSCFG_FASTMODEPLUS((__FASTMODEPLUS__)));\
 | 
			
		||||
                                                                CLEAR_BIT(SYSCFG->CFGR1, (__FASTMODEPLUS__));\
 | 
			
		||||
                                                               }while(0U)
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/** @defgroup Floating_Point_Unit_Interrupts_Enable Floating Point Unit Interrupts Enable
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/** @brief  SYSCFG interrupt enable/disable macros
 | 
			
		||||
  * @param __INTERRUPT__ This parameter can be a value of @ref HAL_SYSCFG_Interrupts
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_SYSCFG_INTERRUPT_ENABLE(__INTERRUPT__)        do {assert_param(IS_HAL_SYSCFG_INTERRUPT((__INTERRUPT__))); \
 | 
			
		||||
                                                                SYSCFG->CFGR1 |= (__INTERRUPT__);                       \
 | 
			
		||||
                                                               }while(0U)
 | 
			
		||||
 | 
			
		||||
#define __HAL_SYSCFG_INTERRUPT_DISABLE(__INTERRUPT__)       do {assert_param(IS_HAL_SYSCFG_INTERRUPT((__INTERRUPT__))); \
 | 
			
		||||
                                                                SYSCFG->CFGR1 &= ~(__INTERRUPT__);                      \
 | 
			
		||||
                                                               }while(0U)
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
#if defined(SYSCFG_CFGR1_USB_IT_RMP)
 | 
			
		||||
/** @defgroup USB_Interrupt_Remap USB Interrupt Remap
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
/** @brief  USB interrupt remapping enable/disable macros
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_REMAPINTERRUPT_USB_ENABLE()              (SYSCFG->CFGR1 |= (SYSCFG_CFGR1_USB_IT_RMP))
 | 
			
		||||
#define __HAL_REMAPINTERRUPT_USB_DISABLE()             (SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_USB_IT_RMP))
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
#endif /* SYSCFG_CFGR1_USB_IT_RMP */
 | 
			
		||||
 
 | 
			
		||||
#if defined(SYSCFG_CFGR1_VBAT)
 | 
			
		||||
/** @defgroup VBAT_Monitoring_Enable VBAT Monitoring Enable
 | 
			
		||||
  * @{
 | 
			
		||||
  */  
 | 
			
		||||
/** @brief  SYSCFG interrupt enable/disable macros
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_SYSCFG_VBAT_MONITORING_ENABLE()          (SYSCFG->CFGR1 |= (SYSCFG_CFGR1_VBAT))
 | 
			
		||||
#define __HAL_SYSCFG_VBAT_MONITORING_DISABLE()         (SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_VBAT))
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
#endif /* SYSCFG_CFGR1_VBAT */
 | 
			
		||||
 
 | 
			
		||||
#if defined(SYSCFG_CFGR2_LOCKUP_LOCK)
 | 
			
		||||
/** @defgroup Cortex_Lockup_Enable Cortex Lockup Enable
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/** @brief  SYSCFG Break Lockup lock
 | 
			
		||||
  *         Enables and locks the connection of Cortex-M4 LOCKUP (Hardfault) output to TIM1/15/16/17 Break input
 | 
			
		||||
  * @note   The selected configuration is locked and can be unlocked by system reset
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_SYSCFG_BREAK_LOCKUP_LOCK()   do {SYSCFG->CFGR2 &= ~(SYSCFG_CFGR2_LOCKUP_LOCK); \
 | 
			
		||||
                                               SYSCFG->CFGR2 |= SYSCFG_CFGR2_LOCKUP_LOCK;    \
 | 
			
		||||
                                              }while(0U)
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
#endif /* SYSCFG_CFGR2_LOCKUP_LOCK */
 | 
			
		||||
 
 | 
			
		||||
#if defined(SYSCFG_CFGR2_PVD_LOCK)
 | 
			
		||||
/** @defgroup PVD_Lock_Enable PVD Lock
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/** @brief  SYSCFG Break PVD lock
 | 
			
		||||
  *         Enables and locks the PVD connection with Timer1/8/15/16/17 Break Input, , as well as the PVDE and PLS[2:0] in the PWR_CR register
 | 
			
		||||
  * @note   The selected configuration is locked and can be unlocked by system reset
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_SYSCFG_BREAK_PVD_LOCK()      do {SYSCFG->CFGR2 &= ~(SYSCFG_CFGR2_PVD_LOCK); \
 | 
			
		||||
                                               SYSCFG->CFGR2 |= SYSCFG_CFGR2_PVD_LOCK;    \
 | 
			
		||||
                                              }while(0U)
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
#endif /* SYSCFG_CFGR2_PVD_LOCK */
 | 
			
		||||
 | 
			
		||||
#if defined(SYSCFG_CFGR2_SRAM_PARITY_LOCK)
 | 
			
		||||
/** @defgroup SRAM_Parity_Lock SRAM Parity Lock
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/** @brief  SYSCFG Break SRAM PARITY lock
 | 
			
		||||
  *         Enables and locks the SRAM_PARITY error signal with Break Input of TIMER1/8/15/16/17
 | 
			
		||||
  * @note   The selected configuration is locked and can be unlocked by system reset
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_SYSCFG_BREAK_SRAMPARITY_LOCK() do {SYSCFG->CFGR2 &= ~(SYSCFG_CFGR2_SRAM_PARITY_LOCK); \
 | 
			
		||||
                                                 SYSCFG->CFGR2 |= SYSCFG_CFGR2_SRAM_PARITY_LOCK;    \
 | 
			
		||||
                                                }while(0U)
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
#endif /* SYSCFG_CFGR2_SRAM_PARITY_LOCK */
 | 
			
		||||
 
 | 
			
		||||
/** @defgroup Trigger_Remapping_Enable Trigger Remapping Enable
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#if defined(SYSCFG_CFGR3_TRIGGER_RMP)
 | 
			
		||||
/** @brief  Trigger remapping enable/disable macros
 | 
			
		||||
  * @param __TRIGGER_REMAP__ This parameter can be a value of @ref HAL_Trigger_Remapping
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_REMAPTRIGGER_ENABLE(__TRIGGER_REMAP__)   do {assert_param(IS_HAL_REMAPTRIGGER((__TRIGGER_REMAP__)));             \
 | 
			
		||||
                                                           (((__TRIGGER_REMAP__) & HAL_REMAP_CFGR3_MASK) ?                     \
 | 
			
		||||
                                                             (SYSCFG->CFGR3 |= ((__TRIGGER_REMAP__) & ~HAL_REMAP_CFGR3_MASK)) : \
 | 
			
		||||
                                                             (SYSCFG->CFGR1 |= (__TRIGGER_REMAP__)));                           \
 | 
			
		||||
                                                         }while(0U)
 | 
			
		||||
#define __HAL_REMAPTRIGGER_DISABLE(__TRIGGER_REMAP__)  do {assert_param(IS_HAL_REMAPTRIGGER((__TRIGGER_REMAP__)));             \
 | 
			
		||||
                                                           (((__TRIGGER_REMAP__) & HAL_REMAP_CFGR3_MASK) ?                     \
 | 
			
		||||
                                                             (SYSCFG->CFGR3 &= (~(__TRIGGER_REMAP__) | HAL_REMAP_CFGR3_MASK)) : \
 | 
			
		||||
                                                             (SYSCFG->CFGR1 &= ~(__TRIGGER_REMAP__)));                          \
 | 
			
		||||
                                                         }while(0U)
 | 
			
		||||
#else
 | 
			
		||||
/** @brief  Trigger remapping enable/disable macros
 | 
			
		||||
  * @param __TRIGGER_REMAP__ This parameter can be a value of @ref HAL_Trigger_Remapping
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_REMAPTRIGGER_ENABLE(__TRIGGER_REMAP__)   do {assert_param(IS_HAL_REMAPTRIGGER((__TRIGGER_REMAP__)));             \
 | 
			
		||||
                                                           (SYSCFG->CFGR1 |= (__TRIGGER_REMAP__));                           \
 | 
			
		||||
                                                         }while(0U)
 | 
			
		||||
#define __HAL_REMAPTRIGGER_DISABLE(__TRIGGER_REMAP__)  do {assert_param(IS_HAL_REMAPTRIGGER((__TRIGGER_REMAP__)));             \
 | 
			
		||||
                                                           (SYSCFG->CFGR1 &= ~(__TRIGGER_REMAP__));                          \
 | 
			
		||||
                                                         }while(0U)
 | 
			
		||||
#endif /* SYSCFG_CFGR3_TRIGGER_RMP */
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
#if defined (STM32F302xE) || defined (STM32F303xE) || defined (STM32F398xx)
 | 
			
		||||
/** @defgroup ADC_Trigger_Remapping_Enable ADC Trigger Remapping Enable
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/** @brief  ADC trigger remapping enable/disable macros
 | 
			
		||||
  * @param __ADCTRIGGER_REMAP__ This parameter can be a value of @ref HAL_ADC_Trigger_Remapping
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_REMAPADCTRIGGER_ENABLE(__ADCTRIGGER_REMAP__)   do {assert_param(IS_HAL_REMAPADCTRIGGER((__ADCTRIGGER_REMAP__)));   \
 | 
			
		||||
                                                             (SYSCFG->CFGR4 |= (__ADCTRIGGER_REMAP__));                          \
 | 
			
		||||
                                                         }while(0U)
 | 
			
		||||
#define __HAL_REMAPADCTRIGGER_DISABLE(__ADCTRIGGER_REMAP__)  do {assert_param(IS_HAL_REMAPADCTRIGGER((__ADCTRIGGER_REMAP__)));   \
 | 
			
		||||
                                                             (SYSCFG->CFGR4 &= ~(__ADCTRIGGER_REMAP__));                         \
 | 
			
		||||
                                                         }while(0U)
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
#endif /* STM32F302xE || STM32F303xE || STM32F398xx */
 | 
			
		||||
                                                           
 | 
			
		||||
#if defined(SYSCFG_CFGR2_BYP_ADDR_PAR)
 | 
			
		||||
/** @defgroup RAM_Parity_Check_Disable RAM Parity Check Disable
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Parity check on RAM disable macro
 | 
			
		||||
  * @note   Disabling the parity check on RAM locks the configuration bit.
 | 
			
		||||
  *         To re-enable the parity check on RAM perform a system reset.
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_SYSCFG_RAM_PARITYCHECK_DISABLE()         (*(__IO uint32_t *) CFGR2_BYPADDRPAR_BB = 0x00000001U)
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
#endif /* SYSCFG_CFGR2_BYP_ADDR_PAR */
 | 
			
		||||
 
 | 
			
		||||
#if defined(SYSCFG_RCR_PAGE0)
 | 
			
		||||
/** @defgroup CCM_RAM_Page_Write_Protection_Enable CCM RAM page write protection enable
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/** @brief  CCM RAM page write protection enable macro
 | 
			
		||||
  * @param __PAGE_WP__ This parameter can be a value of @ref HAL_Page_Write_Protection
 | 
			
		||||
  * @note   write protection can only be disabled by a system reset
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_SYSCFG_SRAM_WRP_ENABLE(__PAGE_WP__)      do {assert_param(IS_HAL_SYSCFG_WP_PAGE((__PAGE_WP__))); \
 | 
			
		||||
                                                           SYSCFG->RCR |= (__PAGE_WP__);                       \
 | 
			
		||||
                                                          }while(0U)
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
#endif /* SYSCFG_RCR_PAGE0 */
 | 
			
		||||
 
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */ 
 | 
			
		||||
/* Private macro -------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup HAL_Private_Macros HAL Private Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define IS_TICKFREQ(FREQ) (((FREQ) == HAL_TICK_FREQ_10HZ)  || \
 | 
			
		||||
                           ((FREQ) == HAL_TICK_FREQ_100HZ) || \
 | 
			
		||||
                           ((FREQ) == HAL_TICK_FREQ_1KHZ))
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */ 
 | 
			
		||||
/* Exported functions --------------------------------------------------------*/
 | 
			
		||||
/** @addtogroup HAL_Exported_Functions HAL Exported Functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup HAL_Exported_Functions_Group1 Initialization and de-initialization Functions 
 | 
			
		||||
 *  @brief    Initialization and de-initialization functions
 | 
			
		||||
 * @{
 | 
			
		||||
 */
 | 
			
		||||
/* Initialization and de-initialization functions  ******************************/
 | 
			
		||||
HAL_StatusTypeDef HAL_Init(void);
 | 
			
		||||
HAL_StatusTypeDef HAL_DeInit(void);
 | 
			
		||||
void HAL_MspInit(void);
 | 
			
		||||
void HAL_MspDeInit(void);
 | 
			
		||||
HAL_StatusTypeDef HAL_InitTick (uint32_t TickPriority);
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
/* Exported variables ---------------------------------------------------------*/
 | 
			
		||||
/** @addtogroup HAL_Exported_Variables
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
extern __IO uint32_t uwTick;
 | 
			
		||||
extern uint32_t uwTickPrio;
 | 
			
		||||
extern HAL_TickFreqTypeDef uwTickFreq;
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 
 | 
			
		||||
/** @addtogroup HAL_Exported_Functions_Group2 HAL Control functions 
 | 
			
		||||
 *  @brief    HAL Control functions
 | 
			
		||||
 * @{
 | 
			
		||||
 */
 | 
			
		||||
/* Peripheral Control functions  ************************************************/
 | 
			
		||||
void     HAL_IncTick(void);
 | 
			
		||||
void     HAL_Delay(uint32_t Delay);
 | 
			
		||||
void     HAL_SuspendTick(void);
 | 
			
		||||
void     HAL_ResumeTick(void);
 | 
			
		||||
uint32_t HAL_GetTick(void);
 | 
			
		||||
uint32_t HAL_GetTickPrio(void);
 | 
			
		||||
HAL_StatusTypeDef HAL_SetTickFreq(HAL_TickFreqTypeDef Freq);
 | 
			
		||||
HAL_TickFreqTypeDef HAL_GetTickFreq(void);
 | 
			
		||||
uint32_t HAL_GetHalVersion(void);
 | 
			
		||||
uint32_t HAL_GetREVID(void);
 | 
			
		||||
uint32_t HAL_GetDEVID(void);
 | 
			
		||||
uint32_t HAL_GetUIDw0(void);
 | 
			
		||||
uint32_t HAL_GetUIDw1(void);
 | 
			
		||||
uint32_t HAL_GetUIDw2(void);
 | 
			
		||||
void     HAL_DBGMCU_EnableDBGSleepMode(void);
 | 
			
		||||
void     HAL_DBGMCU_DisableDBGSleepMode(void);
 | 
			
		||||
void     HAL_DBGMCU_EnableDBGStopMode(void);
 | 
			
		||||
void     HAL_DBGMCU_DisableDBGStopMode(void);
 | 
			
		||||
void     HAL_DBGMCU_EnableDBGStandbyMode(void);
 | 
			
		||||
void     HAL_DBGMCU_DisableDBGStandbyMode(void);
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */ 
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */ 
 | 
			
		||||
  
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* __STM32F3xx_HAL_H */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,270 @@
 | 
			
		||||
/**
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @file    stm32f3xx_hal_adc.h
 | 
			
		||||
  * @author  MCD Application Team
 | 
			
		||||
  * @brief   Header file containing functions prototypes of ADC HAL library.
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @attention
 | 
			
		||||
  *
 | 
			
		||||
  * Copyright (c) 2016 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 __STM32F3xx_ADC_H
 | 
			
		||||
#define __STM32F3xx_ADC_H
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
 extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Includes ------------------------------------------------------------------*/
 | 
			
		||||
#include "stm32f3xx_hal_def.h"
 | 
			
		||||
   
 | 
			
		||||
/* Include ADC HAL Extended module */
 | 
			
		||||
/* (include on top of file since ADC structures are defined in extended file) */
 | 
			
		||||
#include "stm32f3xx_hal_adc_ex.h"
 | 
			
		||||
   
 | 
			
		||||
/** @addtogroup STM32F3xx_HAL_Driver
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup ADC
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
 | 
			
		||||
/* Exported types ------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup ADC_Exported_Types ADC Exported Types
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/** 
 | 
			
		||||
  * @brief  HAL ADC state machine: ADC states definition (bitfields)
 | 
			
		||||
  * @note   ADC state machine is managed by bitfields, state must be compared
 | 
			
		||||
  *         with bit by bit.
 | 
			
		||||
  *         For example:                                                         
 | 
			
		||||
  *           " if (HAL_IS_BIT_SET(HAL_ADC_GetState(hadc1), HAL_ADC_STATE_REG_BUSY)) "
 | 
			
		||||
  *           " if (HAL_IS_BIT_SET(HAL_ADC_GetState(hadc1), HAL_ADC_STATE_AWD1)    ) "
 | 
			
		||||
  */
 | 
			
		||||
/* States of ADC global scope */
 | 
			
		||||
#define HAL_ADC_STATE_RESET             (0x00000000U)    /*!< ADC not yet initialized or disabled */
 | 
			
		||||
#define HAL_ADC_STATE_READY             (0x00000001U)    /*!< ADC peripheral ready for use */
 | 
			
		||||
#define HAL_ADC_STATE_BUSY_INTERNAL     (0x00000002U)    /*!< ADC is busy to internal process (initialization, calibration) */
 | 
			
		||||
#define HAL_ADC_STATE_TIMEOUT           (0x00000004U)    /*!< TimeOut occurrence */
 | 
			
		||||
 | 
			
		||||
/* States of ADC errors */
 | 
			
		||||
#define HAL_ADC_STATE_ERROR_INTERNAL    (0x00000010U)    /*!< Internal error occurrence */
 | 
			
		||||
#define HAL_ADC_STATE_ERROR_CONFIG      (0x00000020U)    /*!< Configuration error occurrence */
 | 
			
		||||
#define HAL_ADC_STATE_ERROR_DMA         (0x00000040U)    /*!< DMA error occurrence */
 | 
			
		||||
 | 
			
		||||
/* States of ADC group regular */
 | 
			
		||||
#define HAL_ADC_STATE_REG_BUSY          (0x00000100U)    /*!< A conversion on group regular is ongoing or can occur (either by continuous mode,
 | 
			
		||||
                                                                       external trigger, low power auto power-on, multimode ADC master control) */
 | 
			
		||||
#define HAL_ADC_STATE_REG_EOC           (0x00000200U)    /*!< Conversion data available on group regular */
 | 
			
		||||
#define HAL_ADC_STATE_REG_OVR           (0x00000400U)    /*!< Overrun occurrence */
 | 
			
		||||
#define HAL_ADC_STATE_REG_EOSMP         (0x00000800U)    /*!< End Of Sampling flag raised  */
 | 
			
		||||
 | 
			
		||||
/* States of ADC group injected */
 | 
			
		||||
#define HAL_ADC_STATE_INJ_BUSY          (0x00001000U)    /*!< A conversion on group injected is ongoing or can occur (either by auto-injection mode,
 | 
			
		||||
                                                                       external trigger, low power auto power-on, multimode ADC master control) */
 | 
			
		||||
#define HAL_ADC_STATE_INJ_EOC           (0x00002000U)    /*!< Conversion data available on group injected */
 | 
			
		||||
#define HAL_ADC_STATE_INJ_JQOVF         (0x00004000U)    /*!< Injected queue overflow occurrence */
 | 
			
		||||
 | 
			
		||||
/* States of ADC analog watchdogs */
 | 
			
		||||
#define HAL_ADC_STATE_AWD1              (0x00010000U)    /*!< Out-of-window occurrence of analog watchdog 1 */
 | 
			
		||||
#define HAL_ADC_STATE_AWD2              (0x00020000U)    /*!< Out-of-window occurrence of analog watchdog 2 */
 | 
			
		||||
#define HAL_ADC_STATE_AWD3              (0x00040000U)    /*!< Out-of-window occurrence of analog watchdog 3 */
 | 
			
		||||
 | 
			
		||||
/* States of ADC multi-mode */
 | 
			
		||||
#define HAL_ADC_STATE_MULTIMODE_SLAVE   (0x00100000U)    /*!< ADC in multimode slave state, controlled by another ADC master ( */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/** 
 | 
			
		||||
  * @brief  ADC handle Structure definition  
 | 
			
		||||
  */
 | 
			
		||||
typedef struct __ADC_HandleTypeDef
 | 
			
		||||
{
 | 
			
		||||
  ADC_TypeDef                   *Instance;              /*!< Register base address */
 | 
			
		||||
 | 
			
		||||
  ADC_InitTypeDef               Init;                   /*!< ADC required parameters */
 | 
			
		||||
 | 
			
		||||
  DMA_HandleTypeDef             *DMA_Handle;            /*!< Pointer DMA Handler */
 | 
			
		||||
 | 
			
		||||
  HAL_LockTypeDef               Lock;                   /*!< ADC locking object */
 | 
			
		||||
 | 
			
		||||
  __IO uint32_t                 State;                  /*!< ADC communication state (bitmap of ADC states) */
 | 
			
		||||
 | 
			
		||||
  __IO uint32_t                 ErrorCode;              /*!< ADC Error code */
 | 
			
		||||
  
 | 
			
		||||
#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \
 | 
			
		||||
    defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \
 | 
			
		||||
    defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \
 | 
			
		||||
    defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx)
 | 
			
		||||
  ADC_InjectionConfigTypeDef    InjectionConfig ;       /*!< ADC injected channel configuration build-up structure */  
 | 
			
		||||
#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */
 | 
			
		||||
       /* STM32F302xC || STM32F303xC || STM32F358xx || */
 | 
			
		||||
       /* STM32F303x8 || STM32F334x8 || STM32F328xx || */
 | 
			
		||||
       /* STM32F301x8 || STM32F302x8 || STM32F318xx    */
 | 
			
		||||
 | 
			
		||||
#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
 | 
			
		||||
  void (* ConvCpltCallback)(struct __ADC_HandleTypeDef *hadc);              /*!< ADC conversion complete callback */
 | 
			
		||||
  void (* ConvHalfCpltCallback)(struct __ADC_HandleTypeDef *hadc);          /*!< ADC conversion DMA half-transfer callback */
 | 
			
		||||
  void (* LevelOutOfWindowCallback)(struct __ADC_HandleTypeDef *hadc);      /*!< ADC analog watchdog 1 callback */
 | 
			
		||||
  void (* ErrorCallback)(struct __ADC_HandleTypeDef *hadc);                 /*!< ADC error callback */
 | 
			
		||||
  void (* InjectedConvCpltCallback)(struct __ADC_HandleTypeDef *hadc);      /*!< ADC group injected conversion complete callback */       /*!< ADC end of sampling callback */
 | 
			
		||||
  void (* MspInitCallback)(struct __ADC_HandleTypeDef *hadc);               /*!< ADC Msp Init callback */
 | 
			
		||||
  void (* MspDeInitCallback)(struct __ADC_HandleTypeDef *hadc);             /*!< ADC Msp DeInit callback */
 | 
			
		||||
#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */
 | 
			
		||||
}ADC_HandleTypeDef;
 | 
			
		||||
 | 
			
		||||
#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  HAL ADC Callback ID enumeration definition
 | 
			
		||||
  */
 | 
			
		||||
typedef enum
 | 
			
		||||
{
 | 
			
		||||
  HAL_ADC_CONVERSION_COMPLETE_CB_ID     = 0x00U,  /*!< ADC conversion complete callback ID */
 | 
			
		||||
  HAL_ADC_CONVERSION_HALF_CB_ID         = 0x01U,  /*!< ADC conversion DMA half-transfer callback ID */
 | 
			
		||||
  HAL_ADC_LEVEL_OUT_OF_WINDOW_1_CB_ID   = 0x02U,  /*!< ADC analog watchdog 1 callback ID */
 | 
			
		||||
  HAL_ADC_ERROR_CB_ID                   = 0x03U,  /*!< ADC error callback ID */
 | 
			
		||||
  HAL_ADC_INJ_CONVERSION_COMPLETE_CB_ID = 0x04U,  /*!< ADC group injected conversion complete callback ID */
 | 
			
		||||
  HAL_ADC_MSPINIT_CB_ID                 = 0x09U,  /*!< ADC Msp Init callback ID          */
 | 
			
		||||
  HAL_ADC_MSPDEINIT_CB_ID               = 0x0AU   /*!< ADC Msp DeInit callback ID        */
 | 
			
		||||
} HAL_ADC_CallbackIDTypeDef;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  HAL ADC Callback pointer definition
 | 
			
		||||
  */
 | 
			
		||||
typedef  void (*pADC_CallbackTypeDef)(ADC_HandleTypeDef *hadc); /*!< pointer to a ADC callback function */
 | 
			
		||||
 | 
			
		||||
#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported constants --------------------------------------------------------*/
 | 
			
		||||
/* Exported macros -----------------------------------------------------------*/
 | 
			
		||||
     
 | 
			
		||||
/** @defgroup ADC_Exported_Macro ADC Exported Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/** @brief  Reset ADC handle state
 | 
			
		||||
  * @param  __HANDLE__ ADC handle
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
 | 
			
		||||
#define __HAL_ADC_RESET_HANDLE_STATE(__HANDLE__)                               \
 | 
			
		||||
  do{                                                                          \
 | 
			
		||||
     (__HANDLE__)->State = HAL_ADC_STATE_RESET;                                \
 | 
			
		||||
     (__HANDLE__)->MspInitCallback = NULL;                                     \
 | 
			
		||||
     (__HANDLE__)->MspDeInitCallback = NULL;                                   \
 | 
			
		||||
    } while(0)
 | 
			
		||||
#else
 | 
			
		||||
#define __HAL_ADC_RESET_HANDLE_STATE(__HANDLE__)                               \
 | 
			
		||||
  ((__HANDLE__)->State = HAL_ADC_STATE_RESET)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */ 
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Exported functions --------------------------------------------------------*/
 | 
			
		||||
/** @addtogroup ADC_Exported_Functions ADC Exported Functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
 | 
			
		||||
/** @addtogroup ADC_Exported_Functions_Group1 Initialization and de-initialization functions 
 | 
			
		||||
 * @{
 | 
			
		||||
 */ 
 | 
			
		||||
/* Initialization and de-initialization functions  **********************************/
 | 
			
		||||
HAL_StatusTypeDef       HAL_ADC_Init(ADC_HandleTypeDef* hadc);
 | 
			
		||||
HAL_StatusTypeDef       HAL_ADC_DeInit(ADC_HandleTypeDef *hadc);
 | 
			
		||||
void                    HAL_ADC_MspInit(ADC_HandleTypeDef* hadc);
 | 
			
		||||
void                    HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc);
 | 
			
		||||
 | 
			
		||||
#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
 | 
			
		||||
/* Callbacks Register/UnRegister functions  ***********************************/
 | 
			
		||||
HAL_StatusTypeDef HAL_ADC_RegisterCallback(ADC_HandleTypeDef *hadc, HAL_ADC_CallbackIDTypeDef CallbackID, pADC_CallbackTypeDef pCallback);
 | 
			
		||||
HAL_StatusTypeDef HAL_ADC_UnRegisterCallback(ADC_HandleTypeDef *hadc, HAL_ADC_CallbackIDTypeDef CallbackID);
 | 
			
		||||
#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup ADC_Exported_Functions_Group2 Input and Output operation functions
 | 
			
		||||
 * @{
 | 
			
		||||
 */ 
 | 
			
		||||
/* Blocking mode: Polling */
 | 
			
		||||
HAL_StatusTypeDef       HAL_ADC_Start(ADC_HandleTypeDef* hadc);
 | 
			
		||||
HAL_StatusTypeDef       HAL_ADC_Stop(ADC_HandleTypeDef* hadc);
 | 
			
		||||
HAL_StatusTypeDef       HAL_ADC_PollForConversion(ADC_HandleTypeDef* hadc, uint32_t Timeout);
 | 
			
		||||
HAL_StatusTypeDef       HAL_ADC_PollForEvent(ADC_HandleTypeDef* hadc, uint32_t EventType, uint32_t Timeout);
 | 
			
		||||
 | 
			
		||||
/* Non-blocking mode: Interruption */
 | 
			
		||||
HAL_StatusTypeDef       HAL_ADC_Start_IT(ADC_HandleTypeDef* hadc);
 | 
			
		||||
HAL_StatusTypeDef       HAL_ADC_Stop_IT(ADC_HandleTypeDef* hadc);
 | 
			
		||||
 | 
			
		||||
/* Non-blocking mode: DMA */
 | 
			
		||||
HAL_StatusTypeDef       HAL_ADC_Start_DMA(ADC_HandleTypeDef* hadc, uint32_t* pData, uint32_t Length);
 | 
			
		||||
HAL_StatusTypeDef       HAL_ADC_Stop_DMA(ADC_HandleTypeDef* hadc);
 | 
			
		||||
 | 
			
		||||
/* ADC retrieve conversion value intended to be used with polling or interruption */
 | 
			
		||||
uint32_t                HAL_ADC_GetValue(ADC_HandleTypeDef* hadc);
 | 
			
		||||
 | 
			
		||||
/* ADC IRQHandler and Callbacks used in non-blocking modes (Interruption and DMA) */
 | 
			
		||||
void                    HAL_ADC_IRQHandler(ADC_HandleTypeDef* hadc);
 | 
			
		||||
void                    HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc);
 | 
			
		||||
void                    HAL_ADC_ConvHalfCpltCallback(ADC_HandleTypeDef* hadc);
 | 
			
		||||
void                    HAL_ADC_LevelOutOfWindowCallback(ADC_HandleTypeDef* hadc);
 | 
			
		||||
void                    HAL_ADC_ErrorCallback(ADC_HandleTypeDef *hadc);
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup ADC_Exported_Functions_Group3 Peripheral Control functions
 | 
			
		||||
 * @{
 | 
			
		||||
 */ 
 | 
			
		||||
/* Peripheral Control functions ***********************************************/
 | 
			
		||||
HAL_StatusTypeDef       HAL_ADC_ConfigChannel(ADC_HandleTypeDef* hadc, ADC_ChannelConfTypeDef* sConfig);
 | 
			
		||||
HAL_StatusTypeDef       HAL_ADC_AnalogWDGConfig(ADC_HandleTypeDef* hadc, ADC_AnalogWDGConfTypeDef* AnalogWDGConfig);
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup ADC_Exported_Functions_Group4 Peripheral State functions
 | 
			
		||||
 *  @brief   ADC Peripheral State functions 
 | 
			
		||||
 * @{
 | 
			
		||||
 */ 
 | 
			
		||||
/* Peripheral State functions *************************************************/
 | 
			
		||||
uint32_t                HAL_ADC_GetState(ADC_HandleTypeDef* hadc);
 | 
			
		||||
uint32_t                HAL_ADC_GetError(ADC_HandleTypeDef *hadc);
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */ 
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /*__STM32F3xx_ADC_H */
 | 
			
		||||
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -0,0 +1,847 @@
 | 
			
		||||
/**
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @file    stm32f3xx_hal_can.h
 | 
			
		||||
  * @author  MCD Application Team
 | 
			
		||||
  * @brief   Header file of CAN HAL module.
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @attention
 | 
			
		||||
  *
 | 
			
		||||
  * Copyright (c) 2016 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 STM32F3xx_HAL_CAN_H
 | 
			
		||||
#define STM32F3xx_HAL_CAN_H
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Includes ------------------------------------------------------------------*/
 | 
			
		||||
#include "stm32f3xx_hal_def.h"
 | 
			
		||||
 | 
			
		||||
/** @addtogroup STM32F3xx_HAL_Driver
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#if defined (CAN)
 | 
			
		||||
/** @addtogroup CAN
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported types ------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup CAN_Exported_Types CAN Exported Types
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  HAL State structures definition
 | 
			
		||||
  */
 | 
			
		||||
typedef enum
 | 
			
		||||
{
 | 
			
		||||
  HAL_CAN_STATE_RESET             = 0x00U,  /*!< CAN not yet initialized or disabled */
 | 
			
		||||
  HAL_CAN_STATE_READY             = 0x01U,  /*!< CAN initialized and ready for use   */
 | 
			
		||||
  HAL_CAN_STATE_LISTENING         = 0x02U,  /*!< CAN receive process is ongoing      */
 | 
			
		||||
  HAL_CAN_STATE_SLEEP_PENDING     = 0x03U,  /*!< CAN sleep request is pending        */
 | 
			
		||||
  HAL_CAN_STATE_SLEEP_ACTIVE      = 0x04U,  /*!< CAN sleep mode is active            */
 | 
			
		||||
  HAL_CAN_STATE_ERROR             = 0x05U   /*!< CAN error state                     */
 | 
			
		||||
 | 
			
		||||
} HAL_CAN_StateTypeDef;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  CAN init structure definition
 | 
			
		||||
  */
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
  uint32_t Prescaler;                  /*!< Specifies the length of a time quantum.
 | 
			
		||||
                                            This parameter must be a number between Min_Data = 1 and Max_Data = 1024. */
 | 
			
		||||
 | 
			
		||||
  uint32_t Mode;                       /*!< Specifies the CAN operating mode.
 | 
			
		||||
                                            This parameter can be a value of @ref CAN_operating_mode */
 | 
			
		||||
 | 
			
		||||
  uint32_t SyncJumpWidth;              /*!< Specifies the maximum number of time quanta the CAN hardware
 | 
			
		||||
                                            is allowed to lengthen or shorten a bit to perform resynchronization.
 | 
			
		||||
                                            This parameter can be a value of @ref CAN_synchronisation_jump_width */
 | 
			
		||||
 | 
			
		||||
  uint32_t TimeSeg1;                   /*!< Specifies the number of time quanta in Bit Segment 1.
 | 
			
		||||
                                            This parameter can be a value of @ref CAN_time_quantum_in_bit_segment_1 */
 | 
			
		||||
 | 
			
		||||
  uint32_t TimeSeg2;                   /*!< Specifies the number of time quanta in Bit Segment 2.
 | 
			
		||||
                                            This parameter can be a value of @ref CAN_time_quantum_in_bit_segment_2 */
 | 
			
		||||
 | 
			
		||||
  FunctionalState TimeTriggeredMode;   /*!< Enable or disable the time triggered communication mode.
 | 
			
		||||
                                            This parameter can be set to ENABLE or DISABLE. */
 | 
			
		||||
 | 
			
		||||
  FunctionalState AutoBusOff;          /*!< Enable or disable the automatic bus-off management.
 | 
			
		||||
                                            This parameter can be set to ENABLE or DISABLE. */
 | 
			
		||||
 | 
			
		||||
  FunctionalState AutoWakeUp;          /*!< Enable or disable the automatic wake-up mode.
 | 
			
		||||
                                            This parameter can be set to ENABLE or DISABLE. */
 | 
			
		||||
 | 
			
		||||
  FunctionalState AutoRetransmission;  /*!< Enable or disable the non-automatic retransmission mode.
 | 
			
		||||
                                            This parameter can be set to ENABLE or DISABLE. */
 | 
			
		||||
 | 
			
		||||
  FunctionalState ReceiveFifoLocked;   /*!< Enable or disable the Receive FIFO Locked mode.
 | 
			
		||||
                                            This parameter can be set to ENABLE or DISABLE. */
 | 
			
		||||
 | 
			
		||||
  FunctionalState TransmitFifoPriority;/*!< Enable or disable the transmit FIFO priority.
 | 
			
		||||
                                            This parameter can be set to ENABLE or DISABLE. */
 | 
			
		||||
 | 
			
		||||
} CAN_InitTypeDef;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  CAN filter configuration structure definition
 | 
			
		||||
  */
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
  uint32_t FilterIdHigh;          /*!< Specifies the filter identification number (MSBs for a 32-bit
 | 
			
		||||
                                       configuration, first one for a 16-bit configuration).
 | 
			
		||||
                                       This parameter must be a number between
 | 
			
		||||
                                       Min_Data = 0x0000 and Max_Data = 0xFFFF. */
 | 
			
		||||
 | 
			
		||||
  uint32_t FilterIdLow;           /*!< Specifies the filter identification number (LSBs for a 32-bit
 | 
			
		||||
                                       configuration, second one for a 16-bit configuration).
 | 
			
		||||
                                       This parameter must be a number between
 | 
			
		||||
                                       Min_Data = 0x0000 and Max_Data = 0xFFFF. */
 | 
			
		||||
 | 
			
		||||
  uint32_t FilterMaskIdHigh;      /*!< Specifies the filter mask number or identification number,
 | 
			
		||||
                                       according to the mode (MSBs for a 32-bit configuration,
 | 
			
		||||
                                       first one for a 16-bit configuration).
 | 
			
		||||
                                       This parameter must be a number between
 | 
			
		||||
                                       Min_Data = 0x0000 and Max_Data = 0xFFFF. */
 | 
			
		||||
 | 
			
		||||
  uint32_t FilterMaskIdLow;       /*!< Specifies the filter mask number or identification number,
 | 
			
		||||
                                       according to the mode (LSBs for a 32-bit configuration,
 | 
			
		||||
                                       second one for a 16-bit configuration).
 | 
			
		||||
                                       This parameter must be a number between
 | 
			
		||||
                                       Min_Data = 0x0000 and Max_Data = 0xFFFF. */
 | 
			
		||||
 | 
			
		||||
  uint32_t FilterFIFOAssignment;  /*!< Specifies the FIFO (0 or 1U) which will be assigned to the filter.
 | 
			
		||||
                                       This parameter can be a value of @ref CAN_filter_FIFO */
 | 
			
		||||
 | 
			
		||||
  uint32_t FilterBank;            /*!< Specifies the filter bank which will be initialized.
 | 
			
		||||
                                       This parameter mus be a number between Min_Data = 0 and Max_Data = 13. */
 | 
			
		||||
 | 
			
		||||
  uint32_t FilterMode;            /*!< Specifies the filter mode to be initialized.
 | 
			
		||||
                                       This parameter can be a value of @ref CAN_filter_mode */
 | 
			
		||||
 | 
			
		||||
  uint32_t FilterScale;           /*!< Specifies the filter scale.
 | 
			
		||||
                                       This parameter can be a value of @ref CAN_filter_scale */
 | 
			
		||||
 | 
			
		||||
  uint32_t FilterActivation;      /*!< Enable or disable the filter.
 | 
			
		||||
                                       This parameter can be a value of @ref CAN_filter_activation */
 | 
			
		||||
 | 
			
		||||
  uint32_t SlaveStartFilterBank;  /*!< Select the start filter bank for the slave CAN instance.
 | 
			
		||||
                                       STM32F3xx devices don't support slave CAN instance (dual CAN). Therefore
 | 
			
		||||
                                       this parameter is meaningless but it has been kept for compatibility across
 | 
			
		||||
                                       STM32 families. */
 | 
			
		||||
 | 
			
		||||
} CAN_FilterTypeDef;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  CAN Tx message header structure definition
 | 
			
		||||
  */
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
  uint32_t StdId;    /*!< Specifies the standard identifier.
 | 
			
		||||
                          This parameter must be a number between Min_Data = 0 and Max_Data = 0x7FF. */
 | 
			
		||||
 | 
			
		||||
  uint32_t ExtId;    /*!< Specifies the extended identifier.
 | 
			
		||||
                          This parameter must be a number between Min_Data = 0 and Max_Data = 0x1FFFFFFF. */
 | 
			
		||||
 | 
			
		||||
  uint32_t IDE;      /*!< Specifies the type of identifier for the message that will be transmitted.
 | 
			
		||||
                          This parameter can be a value of @ref CAN_identifier_type */
 | 
			
		||||
 | 
			
		||||
  uint32_t RTR;      /*!< Specifies the type of frame for the message that will be transmitted.
 | 
			
		||||
                          This parameter can be a value of @ref CAN_remote_transmission_request */
 | 
			
		||||
 | 
			
		||||
  uint32_t DLC;      /*!< Specifies the length of the frame that will be transmitted.
 | 
			
		||||
                          This parameter must be a number between Min_Data = 0 and Max_Data = 8. */
 | 
			
		||||
 | 
			
		||||
  FunctionalState TransmitGlobalTime; /*!< Specifies whether the timestamp counter value captured on start
 | 
			
		||||
                          of frame transmission, is sent in DATA6 and DATA7 replacing pData[6] and pData[7].
 | 
			
		||||
                          @note: Time Triggered Communication Mode must be enabled.
 | 
			
		||||
                          @note: DLC must be programmed as 8 bytes, in order these 2 bytes are sent.
 | 
			
		||||
                          This parameter can be set to ENABLE or DISABLE. */
 | 
			
		||||
 | 
			
		||||
} CAN_TxHeaderTypeDef;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  CAN Rx message header structure definition
 | 
			
		||||
  */
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
  uint32_t StdId;    /*!< Specifies the standard identifier.
 | 
			
		||||
                          This parameter must be a number between Min_Data = 0 and Max_Data = 0x7FF. */
 | 
			
		||||
 | 
			
		||||
  uint32_t ExtId;    /*!< Specifies the extended identifier.
 | 
			
		||||
                          This parameter must be a number between Min_Data = 0 and Max_Data = 0x1FFFFFFF. */
 | 
			
		||||
 | 
			
		||||
  uint32_t IDE;      /*!< Specifies the type of identifier for the message that will be transmitted.
 | 
			
		||||
                          This parameter can be a value of @ref CAN_identifier_type */
 | 
			
		||||
 | 
			
		||||
  uint32_t RTR;      /*!< Specifies the type of frame for the message that will be transmitted.
 | 
			
		||||
                          This parameter can be a value of @ref CAN_remote_transmission_request */
 | 
			
		||||
 | 
			
		||||
  uint32_t DLC;      /*!< Specifies the length of the frame that will be transmitted.
 | 
			
		||||
                          This parameter must be a number between Min_Data = 0 and Max_Data = 8. */
 | 
			
		||||
 | 
			
		||||
  uint32_t Timestamp; /*!< Specifies the timestamp counter value captured on start of frame reception.
 | 
			
		||||
                          @note: Time Triggered Communication Mode must be enabled.
 | 
			
		||||
                          This parameter must be a number between Min_Data = 0 and Max_Data = 0xFFFF. */
 | 
			
		||||
 | 
			
		||||
  uint32_t FilterMatchIndex; /*!< Specifies the index of matching acceptance filter element.
 | 
			
		||||
                          This parameter must be a number between Min_Data = 0 and Max_Data = 0xFF. */
 | 
			
		||||
 | 
			
		||||
} CAN_RxHeaderTypeDef;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  CAN handle Structure definition
 | 
			
		||||
  */
 | 
			
		||||
typedef struct __CAN_HandleTypeDef
 | 
			
		||||
{
 | 
			
		||||
  CAN_TypeDef                 *Instance;                 /*!< Register base address */
 | 
			
		||||
 | 
			
		||||
  CAN_InitTypeDef             Init;                      /*!< CAN required parameters */
 | 
			
		||||
 | 
			
		||||
  __IO HAL_CAN_StateTypeDef   State;                     /*!< CAN communication state */
 | 
			
		||||
 | 
			
		||||
  __IO uint32_t               ErrorCode;                 /*!< CAN Error code.
 | 
			
		||||
                                                              This parameter can be a value of @ref CAN_Error_Code */
 | 
			
		||||
 | 
			
		||||
#if USE_HAL_CAN_REGISTER_CALLBACKS == 1
 | 
			
		||||
  void (* TxMailbox0CompleteCallback)(struct __CAN_HandleTypeDef *hcan);/*!< CAN Tx Mailbox 0 complete callback    */
 | 
			
		||||
  void (* TxMailbox1CompleteCallback)(struct __CAN_HandleTypeDef *hcan);/*!< CAN Tx Mailbox 1 complete callback    */
 | 
			
		||||
  void (* TxMailbox2CompleteCallback)(struct __CAN_HandleTypeDef *hcan);/*!< CAN Tx Mailbox 2 complete callback    */
 | 
			
		||||
  void (* TxMailbox0AbortCallback)(struct __CAN_HandleTypeDef *hcan);   /*!< CAN Tx Mailbox 0 abort callback       */
 | 
			
		||||
  void (* TxMailbox1AbortCallback)(struct __CAN_HandleTypeDef *hcan);   /*!< CAN Tx Mailbox 1 abort callback       */
 | 
			
		||||
  void (* TxMailbox2AbortCallback)(struct __CAN_HandleTypeDef *hcan);   /*!< CAN Tx Mailbox 2 abort callback       */
 | 
			
		||||
  void (* RxFifo0MsgPendingCallback)(struct __CAN_HandleTypeDef *hcan); /*!< CAN Rx FIFO 0 msg pending callback    */
 | 
			
		||||
  void (* RxFifo0FullCallback)(struct __CAN_HandleTypeDef *hcan);       /*!< CAN Rx FIFO 0 full callback           */
 | 
			
		||||
  void (* RxFifo1MsgPendingCallback)(struct __CAN_HandleTypeDef *hcan); /*!< CAN Rx FIFO 1 msg pending callback    */
 | 
			
		||||
  void (* RxFifo1FullCallback)(struct __CAN_HandleTypeDef *hcan);       /*!< CAN Rx FIFO 1 full callback           */
 | 
			
		||||
  void (* SleepCallback)(struct __CAN_HandleTypeDef *hcan);             /*!< CAN Sleep callback                    */
 | 
			
		||||
  void (* WakeUpFromRxMsgCallback)(struct __CAN_HandleTypeDef *hcan);   /*!< CAN Wake Up from Rx msg callback      */
 | 
			
		||||
  void (* ErrorCallback)(struct __CAN_HandleTypeDef *hcan);             /*!< CAN Error callback                    */
 | 
			
		||||
 | 
			
		||||
  void (* MspInitCallback)(struct __CAN_HandleTypeDef *hcan);           /*!< CAN Msp Init callback                 */
 | 
			
		||||
  void (* MspDeInitCallback)(struct __CAN_HandleTypeDef *hcan);         /*!< CAN Msp DeInit callback               */
 | 
			
		||||
 | 
			
		||||
#endif /* (USE_HAL_CAN_REGISTER_CALLBACKS) */
 | 
			
		||||
} CAN_HandleTypeDef;
 | 
			
		||||
 | 
			
		||||
#if USE_HAL_CAN_REGISTER_CALLBACKS == 1
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  HAL CAN common Callback ID enumeration definition
 | 
			
		||||
  */
 | 
			
		||||
typedef enum
 | 
			
		||||
{
 | 
			
		||||
  HAL_CAN_TX_MAILBOX0_COMPLETE_CB_ID       = 0x00U,    /*!< CAN Tx Mailbox 0 complete callback ID         */
 | 
			
		||||
  HAL_CAN_TX_MAILBOX1_COMPLETE_CB_ID       = 0x01U,    /*!< CAN Tx Mailbox 1 complete callback ID         */
 | 
			
		||||
  HAL_CAN_TX_MAILBOX2_COMPLETE_CB_ID       = 0x02U,    /*!< CAN Tx Mailbox 2 complete callback ID         */
 | 
			
		||||
  HAL_CAN_TX_MAILBOX0_ABORT_CB_ID          = 0x03U,    /*!< CAN Tx Mailbox 0 abort callback ID            */
 | 
			
		||||
  HAL_CAN_TX_MAILBOX1_ABORT_CB_ID          = 0x04U,    /*!< CAN Tx Mailbox 1 abort callback ID            */
 | 
			
		||||
  HAL_CAN_TX_MAILBOX2_ABORT_CB_ID          = 0x05U,    /*!< CAN Tx Mailbox 2 abort callback ID            */
 | 
			
		||||
  HAL_CAN_RX_FIFO0_MSG_PENDING_CB_ID       = 0x06U,    /*!< CAN Rx FIFO 0 message pending callback ID     */
 | 
			
		||||
  HAL_CAN_RX_FIFO0_FULL_CB_ID              = 0x07U,    /*!< CAN Rx FIFO 0 full callback ID                */
 | 
			
		||||
  HAL_CAN_RX_FIFO1_MSG_PENDING_CB_ID       = 0x08U,    /*!< CAN Rx FIFO 1 message pending callback ID     */
 | 
			
		||||
  HAL_CAN_RX_FIFO1_FULL_CB_ID              = 0x09U,    /*!< CAN Rx FIFO 1 full callback ID                */
 | 
			
		||||
  HAL_CAN_SLEEP_CB_ID                      = 0x0AU,    /*!< CAN Sleep callback ID                         */
 | 
			
		||||
  HAL_CAN_WAKEUP_FROM_RX_MSG_CB_ID         = 0x0BU,    /*!< CAN Wake Up from Rx msg callback ID          */
 | 
			
		||||
  HAL_CAN_ERROR_CB_ID                      = 0x0CU,    /*!< CAN Error callback ID                         */
 | 
			
		||||
 | 
			
		||||
  HAL_CAN_MSPINIT_CB_ID                    = 0x0DU,    /*!< CAN MspInit callback ID                       */
 | 
			
		||||
  HAL_CAN_MSPDEINIT_CB_ID                  = 0x0EU,    /*!< CAN MspDeInit callback ID                     */
 | 
			
		||||
 | 
			
		||||
} HAL_CAN_CallbackIDTypeDef;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  HAL CAN Callback pointer definition
 | 
			
		||||
  */
 | 
			
		||||
typedef  void (*pCAN_CallbackTypeDef)(CAN_HandleTypeDef *hcan); /*!< pointer to a CAN callback function   */
 | 
			
		||||
 | 
			
		||||
#endif /* USE_HAL_CAN_REGISTER_CALLBACKS */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported constants --------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/** @defgroup CAN_Exported_Constants CAN Exported Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CAN_Error_Code CAN Error Code
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define HAL_CAN_ERROR_NONE            (0x00000000U)  /*!< No error                                             */
 | 
			
		||||
#define HAL_CAN_ERROR_EWG             (0x00000001U)  /*!< Protocol Error Warning                               */
 | 
			
		||||
#define HAL_CAN_ERROR_EPV             (0x00000002U)  /*!< Error Passive                                        */
 | 
			
		||||
#define HAL_CAN_ERROR_BOF             (0x00000004U)  /*!< Bus-off error                                        */
 | 
			
		||||
#define HAL_CAN_ERROR_STF             (0x00000008U)  /*!< Stuff error                                          */
 | 
			
		||||
#define HAL_CAN_ERROR_FOR             (0x00000010U)  /*!< Form error                                           */
 | 
			
		||||
#define HAL_CAN_ERROR_ACK             (0x00000020U)  /*!< Acknowledgment error                                 */
 | 
			
		||||
#define HAL_CAN_ERROR_BR              (0x00000040U)  /*!< Bit recessive error                                  */
 | 
			
		||||
#define HAL_CAN_ERROR_BD              (0x00000080U)  /*!< Bit dominant error                                   */
 | 
			
		||||
#define HAL_CAN_ERROR_CRC             (0x00000100U)  /*!< CRC error                                            */
 | 
			
		||||
#define HAL_CAN_ERROR_RX_FOV0         (0x00000200U)  /*!< Rx FIFO0 overrun error                               */
 | 
			
		||||
#define HAL_CAN_ERROR_RX_FOV1         (0x00000400U)  /*!< Rx FIFO1 overrun error                               */
 | 
			
		||||
#define HAL_CAN_ERROR_TX_ALST0        (0x00000800U)  /*!< TxMailbox 0 transmit failure due to arbitration lost */
 | 
			
		||||
#define HAL_CAN_ERROR_TX_TERR0        (0x00001000U)  /*!< TxMailbox 0 transmit failure due to transmit error   */
 | 
			
		||||
#define HAL_CAN_ERROR_TX_ALST1        (0x00002000U)  /*!< TxMailbox 1 transmit failure due to arbitration lost */
 | 
			
		||||
#define HAL_CAN_ERROR_TX_TERR1        (0x00004000U)  /*!< TxMailbox 1 transmit failure due to transmit error   */
 | 
			
		||||
#define HAL_CAN_ERROR_TX_ALST2        (0x00008000U)  /*!< TxMailbox 2 transmit failure due to arbitration lost */
 | 
			
		||||
#define HAL_CAN_ERROR_TX_TERR2        (0x00010000U)  /*!< TxMailbox 2 transmit failure due to transmit error   */
 | 
			
		||||
#define HAL_CAN_ERROR_TIMEOUT         (0x00020000U)  /*!< Timeout error                                        */
 | 
			
		||||
#define HAL_CAN_ERROR_NOT_INITIALIZED (0x00040000U)  /*!< Peripheral not initialized                           */
 | 
			
		||||
#define HAL_CAN_ERROR_NOT_READY       (0x00080000U)  /*!< Peripheral not ready                                 */
 | 
			
		||||
#define HAL_CAN_ERROR_NOT_STARTED     (0x00100000U)  /*!< Peripheral not started                               */
 | 
			
		||||
#define HAL_CAN_ERROR_PARAM           (0x00200000U)  /*!< Parameter error                                      */
 | 
			
		||||
 | 
			
		||||
#if USE_HAL_CAN_REGISTER_CALLBACKS == 1
 | 
			
		||||
#define HAL_CAN_ERROR_INVALID_CALLBACK (0x00400000U) /*!< Invalid Callback error                               */
 | 
			
		||||
#endif /* USE_HAL_CAN_REGISTER_CALLBACKS */
 | 
			
		||||
#define HAL_CAN_ERROR_INTERNAL        (0x00800000U)  /*!< Internal error                                       */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CAN_InitStatus CAN InitStatus
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define CAN_INITSTATUS_FAILED       (0x00000000U)  /*!< CAN initialization failed */
 | 
			
		||||
#define CAN_INITSTATUS_SUCCESS      (0x00000001U)  /*!< CAN initialization OK     */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CAN_operating_mode CAN Operating Mode
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define CAN_MODE_NORMAL             (0x00000000U)                              /*!< Normal mode   */
 | 
			
		||||
#define CAN_MODE_LOOPBACK           ((uint32_t)CAN_BTR_LBKM)                   /*!< Loopback mode */
 | 
			
		||||
#define CAN_MODE_SILENT             ((uint32_t)CAN_BTR_SILM)                   /*!< Silent mode   */
 | 
			
		||||
#define CAN_MODE_SILENT_LOOPBACK    ((uint32_t)(CAN_BTR_LBKM | CAN_BTR_SILM))  /*!< Loopback combined with
 | 
			
		||||
                                                                                    silent mode   */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/** @defgroup CAN_synchronisation_jump_width CAN Synchronization Jump Width
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define CAN_SJW_1TQ                 (0x00000000U)              /*!< 1 time quantum */
 | 
			
		||||
#define CAN_SJW_2TQ                 ((uint32_t)CAN_BTR_SJW_0)  /*!< 2 time quantum */
 | 
			
		||||
#define CAN_SJW_3TQ                 ((uint32_t)CAN_BTR_SJW_1)  /*!< 3 time quantum */
 | 
			
		||||
#define CAN_SJW_4TQ                 ((uint32_t)CAN_BTR_SJW)    /*!< 4 time quantum */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CAN_time_quantum_in_bit_segment_1 CAN Time Quantum in Bit Segment 1
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define CAN_BS1_1TQ                 (0x00000000U)                                                /*!< 1 time quantum  */
 | 
			
		||||
#define CAN_BS1_2TQ                 ((uint32_t)CAN_BTR_TS1_0)                                    /*!< 2 time quantum  */
 | 
			
		||||
#define CAN_BS1_3TQ                 ((uint32_t)CAN_BTR_TS1_1)                                    /*!< 3 time quantum  */
 | 
			
		||||
#define CAN_BS1_4TQ                 ((uint32_t)(CAN_BTR_TS1_1 | CAN_BTR_TS1_0))                  /*!< 4 time quantum  */
 | 
			
		||||
#define CAN_BS1_5TQ                 ((uint32_t)CAN_BTR_TS1_2)                                    /*!< 5 time quantum  */
 | 
			
		||||
#define CAN_BS1_6TQ                 ((uint32_t)(CAN_BTR_TS1_2 | CAN_BTR_TS1_0))                  /*!< 6 time quantum  */
 | 
			
		||||
#define CAN_BS1_7TQ                 ((uint32_t)(CAN_BTR_TS1_2 | CAN_BTR_TS1_1))                  /*!< 7 time quantum  */
 | 
			
		||||
#define CAN_BS1_8TQ                 ((uint32_t)(CAN_BTR_TS1_2 | CAN_BTR_TS1_1 | CAN_BTR_TS1_0))  /*!< 8 time quantum  */
 | 
			
		||||
#define CAN_BS1_9TQ                 ((uint32_t)CAN_BTR_TS1_3)                                    /*!< 9 time quantum  */
 | 
			
		||||
#define CAN_BS1_10TQ                ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_0))                  /*!< 10 time quantum */
 | 
			
		||||
#define CAN_BS1_11TQ                ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_1))                  /*!< 11 time quantum */
 | 
			
		||||
#define CAN_BS1_12TQ                ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_1 | CAN_BTR_TS1_0))  /*!< 12 time quantum */
 | 
			
		||||
#define CAN_BS1_13TQ                ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_2))                  /*!< 13 time quantum */
 | 
			
		||||
#define CAN_BS1_14TQ                ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_2 | CAN_BTR_TS1_0))  /*!< 14 time quantum */
 | 
			
		||||
#define CAN_BS1_15TQ                ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_2 | CAN_BTR_TS1_1))  /*!< 15 time quantum */
 | 
			
		||||
#define CAN_BS1_16TQ                ((uint32_t)CAN_BTR_TS1) /*!< 16 time quantum */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CAN_time_quantum_in_bit_segment_2 CAN Time Quantum in Bit Segment 2
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define CAN_BS2_1TQ                 (0x00000000U)                                /*!< 1 time quantum */
 | 
			
		||||
#define CAN_BS2_2TQ                 ((uint32_t)CAN_BTR_TS2_0)                    /*!< 2 time quantum */
 | 
			
		||||
#define CAN_BS2_3TQ                 ((uint32_t)CAN_BTR_TS2_1)                    /*!< 3 time quantum */
 | 
			
		||||
#define CAN_BS2_4TQ                 ((uint32_t)(CAN_BTR_TS2_1 | CAN_BTR_TS2_0))  /*!< 4 time quantum */
 | 
			
		||||
#define CAN_BS2_5TQ                 ((uint32_t)CAN_BTR_TS2_2)                    /*!< 5 time quantum */
 | 
			
		||||
#define CAN_BS2_6TQ                 ((uint32_t)(CAN_BTR_TS2_2 | CAN_BTR_TS2_0))  /*!< 6 time quantum */
 | 
			
		||||
#define CAN_BS2_7TQ                 ((uint32_t)(CAN_BTR_TS2_2 | CAN_BTR_TS2_1))  /*!< 7 time quantum */
 | 
			
		||||
#define CAN_BS2_8TQ                 ((uint32_t)CAN_BTR_TS2)                      /*!< 8 time quantum */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CAN_filter_mode CAN Filter Mode
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define CAN_FILTERMODE_IDMASK       (0x00000000U)  /*!< Identifier mask mode */
 | 
			
		||||
#define CAN_FILTERMODE_IDLIST       (0x00000001U)  /*!< Identifier list mode */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CAN_filter_scale CAN Filter Scale
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define CAN_FILTERSCALE_16BIT       (0x00000000U)  /*!< Two 16-bit filters */
 | 
			
		||||
#define CAN_FILTERSCALE_32BIT       (0x00000001U)  /*!< One 32-bit filter  */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CAN_filter_activation CAN Filter Activation
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define CAN_FILTER_DISABLE          (0x00000000U)  /*!< Disable filter */
 | 
			
		||||
#define CAN_FILTER_ENABLE           (0x00000001U)  /*!< Enable filter  */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CAN_filter_FIFO CAN Filter FIFO
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define CAN_FILTER_FIFO0            (0x00000000U)  /*!< Filter FIFO 0 assignment for filter x */
 | 
			
		||||
#define CAN_FILTER_FIFO1            (0x00000001U)  /*!< Filter FIFO 1 assignment for filter x */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CAN_identifier_type CAN Identifier Type
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define CAN_ID_STD                  (0x00000000U)  /*!< Standard Id */
 | 
			
		||||
#define CAN_ID_EXT                  (0x00000004U)  /*!< Extended Id */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CAN_remote_transmission_request CAN Remote Transmission Request
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define CAN_RTR_DATA                (0x00000000U)  /*!< Data frame   */
 | 
			
		||||
#define CAN_RTR_REMOTE              (0x00000002U)  /*!< Remote frame */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CAN_receive_FIFO_number CAN Receive FIFO Number
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define CAN_RX_FIFO0                (0x00000000U)  /*!< CAN receive FIFO 0 */
 | 
			
		||||
#define CAN_RX_FIFO1                (0x00000001U)  /*!< CAN receive FIFO 1 */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CAN_Tx_Mailboxes CAN Tx Mailboxes
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define CAN_TX_MAILBOX0             (0x00000001U)  /*!< Tx Mailbox 0  */
 | 
			
		||||
#define CAN_TX_MAILBOX1             (0x00000002U)  /*!< Tx Mailbox 1  */
 | 
			
		||||
#define CAN_TX_MAILBOX2             (0x00000004U)  /*!< Tx Mailbox 2  */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CAN_flags CAN Flags
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/* Transmit Flags */
 | 
			
		||||
#define CAN_FLAG_RQCP0              (0x00000500U)  /*!< Request complete MailBox 0 flag   */
 | 
			
		||||
#define CAN_FLAG_TXOK0              (0x00000501U)  /*!< Transmission OK MailBox 0 flag    */
 | 
			
		||||
#define CAN_FLAG_ALST0              (0x00000502U)  /*!< Arbitration Lost MailBox 0 flag   */
 | 
			
		||||
#define CAN_FLAG_TERR0              (0x00000503U)  /*!< Transmission error MailBox 0 flag */
 | 
			
		||||
#define CAN_FLAG_RQCP1              (0x00000508U)  /*!< Request complete MailBox1 flag    */
 | 
			
		||||
#define CAN_FLAG_TXOK1              (0x00000509U)  /*!< Transmission OK MailBox 1 flag    */
 | 
			
		||||
#define CAN_FLAG_ALST1              (0x0000050AU)  /*!< Arbitration Lost MailBox 1 flag   */
 | 
			
		||||
#define CAN_FLAG_TERR1              (0x0000050BU)  /*!< Transmission error MailBox 1 flag */
 | 
			
		||||
#define CAN_FLAG_RQCP2              (0x00000510U)  /*!< Request complete MailBox2 flag    */
 | 
			
		||||
#define CAN_FLAG_TXOK2              (0x00000511U)  /*!< Transmission OK MailBox 2 flag    */
 | 
			
		||||
#define CAN_FLAG_ALST2              (0x00000512U)  /*!< Arbitration Lost MailBox 2 flag   */
 | 
			
		||||
#define CAN_FLAG_TERR2              (0x00000513U)  /*!< Transmission error MailBox 2 flag */
 | 
			
		||||
#define CAN_FLAG_TME0               (0x0000051AU)  /*!< Transmit mailbox 0 empty flag     */
 | 
			
		||||
#define CAN_FLAG_TME1               (0x0000051BU)  /*!< Transmit mailbox 1 empty flag     */
 | 
			
		||||
#define CAN_FLAG_TME2               (0x0000051CU)  /*!< Transmit mailbox 2 empty flag     */
 | 
			
		||||
#define CAN_FLAG_LOW0               (0x0000051DU)  /*!< Lowest priority mailbox 0 flag    */
 | 
			
		||||
#define CAN_FLAG_LOW1               (0x0000051EU)  /*!< Lowest priority mailbox 1 flag    */
 | 
			
		||||
#define CAN_FLAG_LOW2               (0x0000051FU)  /*!< Lowest priority mailbox 2 flag    */
 | 
			
		||||
 | 
			
		||||
/* Receive Flags */
 | 
			
		||||
#define CAN_FLAG_FF0                (0x00000203U)  /*!< RX FIFO 0 Full flag               */
 | 
			
		||||
#define CAN_FLAG_FOV0               (0x00000204U)  /*!< RX FIFO 0 Overrun flag            */
 | 
			
		||||
#define CAN_FLAG_FF1                (0x00000403U)  /*!< RX FIFO 1 Full flag               */
 | 
			
		||||
#define CAN_FLAG_FOV1               (0x00000404U)  /*!< RX FIFO 1 Overrun flag            */
 | 
			
		||||
 | 
			
		||||
/* Operating Mode Flags */
 | 
			
		||||
#define CAN_FLAG_INAK               (0x00000100U)  /*!< Initialization acknowledge flag   */
 | 
			
		||||
#define CAN_FLAG_SLAK               (0x00000101U)  /*!< Sleep acknowledge flag            */
 | 
			
		||||
#define CAN_FLAG_ERRI               (0x00000102U)  /*!< Error flag                        */
 | 
			
		||||
#define CAN_FLAG_WKU                (0x00000103U)  /*!< Wake up interrupt flag            */
 | 
			
		||||
#define CAN_FLAG_SLAKI              (0x00000104U)  /*!< Sleep acknowledge interrupt flag  */
 | 
			
		||||
 | 
			
		||||
/* Error Flags */
 | 
			
		||||
#define CAN_FLAG_EWG                (0x00000300U)  /*!< Error warning flag                */
 | 
			
		||||
#define CAN_FLAG_EPV                (0x00000301U)  /*!< Error passive flag                */
 | 
			
		||||
#define CAN_FLAG_BOF                (0x00000302U)  /*!< Bus-Off flag                      */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/** @defgroup CAN_Interrupts CAN Interrupts
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/* Transmit Interrupt */
 | 
			
		||||
#define CAN_IT_TX_MAILBOX_EMPTY     ((uint32_t)CAN_IER_TMEIE)   /*!< Transmit mailbox empty interrupt */
 | 
			
		||||
 | 
			
		||||
/* Receive Interrupts */
 | 
			
		||||
#define CAN_IT_RX_FIFO0_MSG_PENDING ((uint32_t)CAN_IER_FMPIE0)  /*!< FIFO 0 message pending interrupt */
 | 
			
		||||
#define CAN_IT_RX_FIFO0_FULL        ((uint32_t)CAN_IER_FFIE0)   /*!< FIFO 0 full interrupt            */
 | 
			
		||||
#define CAN_IT_RX_FIFO0_OVERRUN     ((uint32_t)CAN_IER_FOVIE0)  /*!< FIFO 0 overrun interrupt         */
 | 
			
		||||
#define CAN_IT_RX_FIFO1_MSG_PENDING ((uint32_t)CAN_IER_FMPIE1)  /*!< FIFO 1 message pending interrupt */
 | 
			
		||||
#define CAN_IT_RX_FIFO1_FULL        ((uint32_t)CAN_IER_FFIE1)   /*!< FIFO 1 full interrupt            */
 | 
			
		||||
#define CAN_IT_RX_FIFO1_OVERRUN     ((uint32_t)CAN_IER_FOVIE1)  /*!< FIFO 1 overrun interrupt         */
 | 
			
		||||
 | 
			
		||||
/* Operating Mode Interrupts */
 | 
			
		||||
#define CAN_IT_WAKEUP               ((uint32_t)CAN_IER_WKUIE)   /*!< Wake-up interrupt                */
 | 
			
		||||
#define CAN_IT_SLEEP_ACK            ((uint32_t)CAN_IER_SLKIE)   /*!< Sleep acknowledge interrupt      */
 | 
			
		||||
 | 
			
		||||
/* Error Interrupts */
 | 
			
		||||
#define CAN_IT_ERROR_WARNING        ((uint32_t)CAN_IER_EWGIE)   /*!< Error warning interrupt          */
 | 
			
		||||
#define CAN_IT_ERROR_PASSIVE        ((uint32_t)CAN_IER_EPVIE)   /*!< Error passive interrupt          */
 | 
			
		||||
#define CAN_IT_BUSOFF               ((uint32_t)CAN_IER_BOFIE)   /*!< Bus-off interrupt                */
 | 
			
		||||
#define CAN_IT_LAST_ERROR_CODE      ((uint32_t)CAN_IER_LECIE)   /*!< Last error code interrupt        */
 | 
			
		||||
#define CAN_IT_ERROR                ((uint32_t)CAN_IER_ERRIE)   /*!< Error Interrupt                  */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported macros -----------------------------------------------------------*/
 | 
			
		||||
/** @defgroup CAN_Exported_Macros CAN Exported Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @brief  Reset CAN handle state
 | 
			
		||||
  * @param  __HANDLE__ CAN handle.
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#if USE_HAL_CAN_REGISTER_CALLBACKS == 1
 | 
			
		||||
#define __HAL_CAN_RESET_HANDLE_STATE(__HANDLE__) do{                                              \
 | 
			
		||||
                                                     (__HANDLE__)->State = HAL_CAN_STATE_RESET;   \
 | 
			
		||||
                                                     (__HANDLE__)->MspInitCallback = NULL;        \
 | 
			
		||||
                                                     (__HANDLE__)->MspDeInitCallback = NULL;      \
 | 
			
		||||
                                                   } while(0)
 | 
			
		||||
#else
 | 
			
		||||
#define __HAL_CAN_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_CAN_STATE_RESET)
 | 
			
		||||
#endif /*USE_HAL_CAN_REGISTER_CALLBACKS */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Enable the specified CAN interrupts.
 | 
			
		||||
  * @param  __HANDLE__ CAN handle.
 | 
			
		||||
  * @param  __INTERRUPT__ CAN Interrupt sources to enable.
 | 
			
		||||
  *           This parameter can be any combination of @arg CAN_Interrupts
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_CAN_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->IER) |= (__INTERRUPT__))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Disable the specified CAN interrupts.
 | 
			
		||||
  * @param  __HANDLE__ CAN handle.
 | 
			
		||||
  * @param  __INTERRUPT__ CAN Interrupt sources to disable.
 | 
			
		||||
  *           This parameter can be any combination of @arg CAN_Interrupts
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_CAN_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->IER) &= ~(__INTERRUPT__))
 | 
			
		||||
 | 
			
		||||
/** @brief  Check if the specified CAN interrupt source is enabled or disabled.
 | 
			
		||||
  * @param  __HANDLE__ specifies the CAN Handle.
 | 
			
		||||
  * @param  __INTERRUPT__ specifies the CAN interrupt source to check.
 | 
			
		||||
  *           This parameter can be a value of @arg CAN_Interrupts
 | 
			
		||||
  * @retval The state of __IT__ (TRUE or FALSE).
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_CAN_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->IER) & (__INTERRUPT__))
 | 
			
		||||
 | 
			
		||||
/** @brief  Check whether the specified CAN flag is set or not.
 | 
			
		||||
  * @param  __HANDLE__ specifies the CAN Handle.
 | 
			
		||||
  * @param  __FLAG__ specifies the flag to check.
 | 
			
		||||
  *         This parameter can be one of @arg CAN_flags
 | 
			
		||||
  * @retval The state of __FLAG__ (TRUE or FALSE).
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_CAN_GET_FLAG(__HANDLE__, __FLAG__) \
 | 
			
		||||
  ((((__FLAG__) >> 8U) == 5U)? ((((__HANDLE__)->Instance->TSR) & (1U << ((__FLAG__) & CAN_FLAG_MASK))) == (1U << ((__FLAG__) & CAN_FLAG_MASK))): \
 | 
			
		||||
   (((__FLAG__) >> 8U) == 2U)? ((((__HANDLE__)->Instance->RF0R) & (1U << ((__FLAG__) & CAN_FLAG_MASK))) == (1U << ((__FLAG__) & CAN_FLAG_MASK))): \
 | 
			
		||||
   (((__FLAG__) >> 8U) == 4U)? ((((__HANDLE__)->Instance->RF1R) & (1U << ((__FLAG__) & CAN_FLAG_MASK))) == (1U << ((__FLAG__) & CAN_FLAG_MASK))): \
 | 
			
		||||
   (((__FLAG__) >> 8U) == 1U)? ((((__HANDLE__)->Instance->MSR) & (1U << ((__FLAG__) & CAN_FLAG_MASK))) == (1U << ((__FLAG__) & CAN_FLAG_MASK))): \
 | 
			
		||||
   (((__FLAG__) >> 8U) == 3U)? ((((__HANDLE__)->Instance->ESR) & (1U << ((__FLAG__) & CAN_FLAG_MASK))) == (1U << ((__FLAG__) & CAN_FLAG_MASK))): 0U)
 | 
			
		||||
 | 
			
		||||
/** @brief  Clear the specified CAN pending flag.
 | 
			
		||||
  * @param  __HANDLE__ specifies the CAN Handle.
 | 
			
		||||
  * @param  __FLAG__ specifies the flag to check.
 | 
			
		||||
  *         This parameter can be one of the following values:
 | 
			
		||||
  *            @arg CAN_FLAG_RQCP0: Request complete MailBox 0 Flag
 | 
			
		||||
  *            @arg CAN_FLAG_TXOK0: Transmission OK MailBox 0 Flag
 | 
			
		||||
  *            @arg CAN_FLAG_ALST0: Arbitration Lost MailBox 0 Flag
 | 
			
		||||
  *            @arg CAN_FLAG_TERR0: Transmission error MailBox 0 Flag
 | 
			
		||||
  *            @arg CAN_FLAG_RQCP1: Request complete MailBox 1 Flag
 | 
			
		||||
  *            @arg CAN_FLAG_TXOK1: Transmission OK MailBox 1 Flag
 | 
			
		||||
  *            @arg CAN_FLAG_ALST1: Arbitration Lost MailBox 1 Flag
 | 
			
		||||
  *            @arg CAN_FLAG_TERR1: Transmission error MailBox 1 Flag
 | 
			
		||||
  *            @arg CAN_FLAG_RQCP2: Request complete MailBox 2 Flag
 | 
			
		||||
  *            @arg CAN_FLAG_TXOK2: Transmission OK MailBox 2 Flag
 | 
			
		||||
  *            @arg CAN_FLAG_ALST2: Arbitration Lost MailBox 2 Flag
 | 
			
		||||
  *            @arg CAN_FLAG_TERR2: Transmission error MailBox 2 Flag
 | 
			
		||||
  *            @arg CAN_FLAG_FF0:   RX FIFO 0 Full Flag
 | 
			
		||||
  *            @arg CAN_FLAG_FOV0:  RX FIFO 0 Overrun Flag
 | 
			
		||||
  *            @arg CAN_FLAG_FF1:   RX FIFO 1 Full Flag
 | 
			
		||||
  *            @arg CAN_FLAG_FOV1:  RX FIFO 1 Overrun Flag
 | 
			
		||||
  *            @arg CAN_FLAG_WKUI:  Wake up Interrupt Flag
 | 
			
		||||
  *            @arg CAN_FLAG_SLAKI: Sleep acknowledge Interrupt Flag
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_CAN_CLEAR_FLAG(__HANDLE__, __FLAG__) \
 | 
			
		||||
  ((((__FLAG__) >> 8U) == 5U)? (((__HANDLE__)->Instance->TSR) = (1U << ((__FLAG__) & CAN_FLAG_MASK))): \
 | 
			
		||||
   (((__FLAG__) >> 8U) == 2U)? (((__HANDLE__)->Instance->RF0R) = (1U << ((__FLAG__) & CAN_FLAG_MASK))): \
 | 
			
		||||
   (((__FLAG__) >> 8U) == 4U)? (((__HANDLE__)->Instance->RF1R) = (1U << ((__FLAG__) & CAN_FLAG_MASK))): \
 | 
			
		||||
   (((__FLAG__) >> 8U) == 1U)? (((__HANDLE__)->Instance->MSR) = (1U << ((__FLAG__) & CAN_FLAG_MASK))): 0U)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* Exported functions --------------------------------------------------------*/
 | 
			
		||||
/** @addtogroup CAN_Exported_Functions CAN Exported Functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup CAN_Exported_Functions_Group1 Initialization and de-initialization functions
 | 
			
		||||
 *  @brief    Initialization and Configuration functions
 | 
			
		||||
 * @{
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* Initialization and de-initialization functions *****************************/
 | 
			
		||||
HAL_StatusTypeDef HAL_CAN_Init(CAN_HandleTypeDef *hcan);
 | 
			
		||||
HAL_StatusTypeDef HAL_CAN_DeInit(CAN_HandleTypeDef *hcan);
 | 
			
		||||
void HAL_CAN_MspInit(CAN_HandleTypeDef *hcan);
 | 
			
		||||
void HAL_CAN_MspDeInit(CAN_HandleTypeDef *hcan);
 | 
			
		||||
 | 
			
		||||
#if USE_HAL_CAN_REGISTER_CALLBACKS == 1
 | 
			
		||||
/* Callbacks Register/UnRegister functions  ***********************************/
 | 
			
		||||
HAL_StatusTypeDef HAL_CAN_RegisterCallback(CAN_HandleTypeDef *hcan, HAL_CAN_CallbackIDTypeDef CallbackID,
 | 
			
		||||
                                           void (* pCallback)(CAN_HandleTypeDef *_hcan));
 | 
			
		||||
HAL_StatusTypeDef HAL_CAN_UnRegisterCallback(CAN_HandleTypeDef *hcan, HAL_CAN_CallbackIDTypeDef CallbackID);
 | 
			
		||||
 | 
			
		||||
#endif /* (USE_HAL_CAN_REGISTER_CALLBACKS) */
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup CAN_Exported_Functions_Group2 Configuration functions
 | 
			
		||||
 *  @brief    Configuration functions
 | 
			
		||||
 * @{
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* Configuration functions ****************************************************/
 | 
			
		||||
HAL_StatusTypeDef HAL_CAN_ConfigFilter(CAN_HandleTypeDef *hcan, const CAN_FilterTypeDef *sFilterConfig);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup CAN_Exported_Functions_Group3 Control functions
 | 
			
		||||
 *  @brief    Control functions
 | 
			
		||||
 * @{
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* Control functions **********************************************************/
 | 
			
		||||
HAL_StatusTypeDef HAL_CAN_Start(CAN_HandleTypeDef *hcan);
 | 
			
		||||
HAL_StatusTypeDef HAL_CAN_Stop(CAN_HandleTypeDef *hcan);
 | 
			
		||||
HAL_StatusTypeDef HAL_CAN_RequestSleep(CAN_HandleTypeDef *hcan);
 | 
			
		||||
HAL_StatusTypeDef HAL_CAN_WakeUp(CAN_HandleTypeDef *hcan);
 | 
			
		||||
uint32_t HAL_CAN_IsSleepActive(const CAN_HandleTypeDef *hcan);
 | 
			
		||||
HAL_StatusTypeDef HAL_CAN_AddTxMessage(CAN_HandleTypeDef *hcan, const CAN_TxHeaderTypeDef *pHeader,
 | 
			
		||||
                                       const uint8_t aData[], uint32_t *pTxMailbox);
 | 
			
		||||
HAL_StatusTypeDef HAL_CAN_AbortTxRequest(CAN_HandleTypeDef *hcan, uint32_t TxMailboxes);
 | 
			
		||||
uint32_t HAL_CAN_GetTxMailboxesFreeLevel(const CAN_HandleTypeDef *hcan);
 | 
			
		||||
uint32_t HAL_CAN_IsTxMessagePending(const CAN_HandleTypeDef *hcan, uint32_t TxMailboxes);
 | 
			
		||||
uint32_t HAL_CAN_GetTxTimestamp(const CAN_HandleTypeDef *hcan, uint32_t TxMailbox);
 | 
			
		||||
HAL_StatusTypeDef HAL_CAN_GetRxMessage(CAN_HandleTypeDef *hcan, uint32_t RxFifo,
 | 
			
		||||
                                       CAN_RxHeaderTypeDef *pHeader, uint8_t aData[]);
 | 
			
		||||
uint32_t HAL_CAN_GetRxFifoFillLevel(const CAN_HandleTypeDef *hcan, uint32_t RxFifo);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup CAN_Exported_Functions_Group4 Interrupts management
 | 
			
		||||
 *  @brief    Interrupts management
 | 
			
		||||
 * @{
 | 
			
		||||
 */
 | 
			
		||||
/* Interrupts management ******************************************************/
 | 
			
		||||
HAL_StatusTypeDef HAL_CAN_ActivateNotification(CAN_HandleTypeDef *hcan, uint32_t ActiveITs);
 | 
			
		||||
HAL_StatusTypeDef HAL_CAN_DeactivateNotification(CAN_HandleTypeDef *hcan, uint32_t InactiveITs);
 | 
			
		||||
void HAL_CAN_IRQHandler(CAN_HandleTypeDef *hcan);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup CAN_Exported_Functions_Group5 Callback functions
 | 
			
		||||
 *  @brief    Callback functions
 | 
			
		||||
 * @{
 | 
			
		||||
 */
 | 
			
		||||
/* Callbacks functions ********************************************************/
 | 
			
		||||
 | 
			
		||||
void HAL_CAN_TxMailbox0CompleteCallback(CAN_HandleTypeDef *hcan);
 | 
			
		||||
void HAL_CAN_TxMailbox1CompleteCallback(CAN_HandleTypeDef *hcan);
 | 
			
		||||
void HAL_CAN_TxMailbox2CompleteCallback(CAN_HandleTypeDef *hcan);
 | 
			
		||||
void HAL_CAN_TxMailbox0AbortCallback(CAN_HandleTypeDef *hcan);
 | 
			
		||||
void HAL_CAN_TxMailbox1AbortCallback(CAN_HandleTypeDef *hcan);
 | 
			
		||||
void HAL_CAN_TxMailbox2AbortCallback(CAN_HandleTypeDef *hcan);
 | 
			
		||||
void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan);
 | 
			
		||||
void HAL_CAN_RxFifo0FullCallback(CAN_HandleTypeDef *hcan);
 | 
			
		||||
void HAL_CAN_RxFifo1MsgPendingCallback(CAN_HandleTypeDef *hcan);
 | 
			
		||||
void HAL_CAN_RxFifo1FullCallback(CAN_HandleTypeDef *hcan);
 | 
			
		||||
void HAL_CAN_SleepCallback(CAN_HandleTypeDef *hcan);
 | 
			
		||||
void HAL_CAN_WakeUpFromRxMsgCallback(CAN_HandleTypeDef *hcan);
 | 
			
		||||
void HAL_CAN_ErrorCallback(CAN_HandleTypeDef *hcan);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup CAN_Exported_Functions_Group6 Peripheral State and Error functions
 | 
			
		||||
 *  @brief   CAN Peripheral State functions
 | 
			
		||||
 * @{
 | 
			
		||||
 */
 | 
			
		||||
/* Peripheral State and Error functions ***************************************/
 | 
			
		||||
HAL_CAN_StateTypeDef HAL_CAN_GetState(const CAN_HandleTypeDef *hcan);
 | 
			
		||||
uint32_t HAL_CAN_GetError(const CAN_HandleTypeDef *hcan);
 | 
			
		||||
HAL_StatusTypeDef HAL_CAN_ResetError(CAN_HandleTypeDef *hcan);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @}
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* Private types -------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup CAN_Private_Types CAN Private Types
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Private variables ---------------------------------------------------------*/
 | 
			
		||||
/** @defgroup CAN_Private_Variables CAN Private Variables
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Private constants ---------------------------------------------------------*/
 | 
			
		||||
/** @defgroup CAN_Private_Constants CAN Private Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define CAN_FLAG_MASK  (0x000000FFU)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Private Macros -----------------------------------------------------------*/
 | 
			
		||||
/** @defgroup CAN_Private_Macros CAN Private Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#define IS_CAN_MODE(MODE) (((MODE) == CAN_MODE_NORMAL) || \
 | 
			
		||||
                           ((MODE) == CAN_MODE_LOOPBACK)|| \
 | 
			
		||||
                           ((MODE) == CAN_MODE_SILENT) || \
 | 
			
		||||
                           ((MODE) == CAN_MODE_SILENT_LOOPBACK))
 | 
			
		||||
#define IS_CAN_SJW(SJW) (((SJW) == CAN_SJW_1TQ) || ((SJW) == CAN_SJW_2TQ) || \
 | 
			
		||||
                         ((SJW) == CAN_SJW_3TQ) || ((SJW) == CAN_SJW_4TQ))
 | 
			
		||||
#define IS_CAN_BS1(BS1) (((BS1) == CAN_BS1_1TQ) || ((BS1) == CAN_BS1_2TQ) || \
 | 
			
		||||
                         ((BS1) == CAN_BS1_3TQ) || ((BS1) == CAN_BS1_4TQ) || \
 | 
			
		||||
                         ((BS1) == CAN_BS1_5TQ) || ((BS1) == CAN_BS1_6TQ) || \
 | 
			
		||||
                         ((BS1) == CAN_BS1_7TQ) || ((BS1) == CAN_BS1_8TQ) || \
 | 
			
		||||
                         ((BS1) == CAN_BS1_9TQ) || ((BS1) == CAN_BS1_10TQ)|| \
 | 
			
		||||
                         ((BS1) == CAN_BS1_11TQ)|| ((BS1) == CAN_BS1_12TQ)|| \
 | 
			
		||||
                         ((BS1) == CAN_BS1_13TQ)|| ((BS1) == CAN_BS1_14TQ)|| \
 | 
			
		||||
                         ((BS1) == CAN_BS1_15TQ)|| ((BS1) == CAN_BS1_16TQ))
 | 
			
		||||
#define IS_CAN_BS2(BS2) (((BS2) == CAN_BS2_1TQ) || ((BS2) == CAN_BS2_2TQ) || \
 | 
			
		||||
                         ((BS2) == CAN_BS2_3TQ) || ((BS2) == CAN_BS2_4TQ) || \
 | 
			
		||||
                         ((BS2) == CAN_BS2_5TQ) || ((BS2) == CAN_BS2_6TQ) || \
 | 
			
		||||
                         ((BS2) == CAN_BS2_7TQ) || ((BS2) == CAN_BS2_8TQ))
 | 
			
		||||
#define IS_CAN_PRESCALER(PRESCALER) (((PRESCALER) >= 1U) && ((PRESCALER) <= 1024U))
 | 
			
		||||
#define IS_CAN_FILTER_ID_HALFWORD(HALFWORD) ((HALFWORD) <= 0xFFFFU)
 | 
			
		||||
#define IS_CAN_FILTER_BANK_SINGLE(BANK) ((BANK) <= 13U)
 | 
			
		||||
#define IS_CAN_FILTER_MODE(MODE) (((MODE) == CAN_FILTERMODE_IDMASK) || \
 | 
			
		||||
                                  ((MODE) == CAN_FILTERMODE_IDLIST))
 | 
			
		||||
#define IS_CAN_FILTER_SCALE(SCALE) (((SCALE) == CAN_FILTERSCALE_16BIT) || \
 | 
			
		||||
                                    ((SCALE) == CAN_FILTERSCALE_32BIT))
 | 
			
		||||
#define IS_CAN_FILTER_ACTIVATION(ACTIVATION) (((ACTIVATION) == CAN_FILTER_DISABLE) || \
 | 
			
		||||
                                              ((ACTIVATION) == CAN_FILTER_ENABLE))
 | 
			
		||||
#define IS_CAN_FILTER_FIFO(FIFO) (((FIFO) == CAN_FILTER_FIFO0) || \
 | 
			
		||||
                                  ((FIFO) == CAN_FILTER_FIFO1))
 | 
			
		||||
#define IS_CAN_TX_MAILBOX(TRANSMITMAILBOX) (((TRANSMITMAILBOX) == CAN_TX_MAILBOX0 ) || \
 | 
			
		||||
                                            ((TRANSMITMAILBOX) == CAN_TX_MAILBOX1 ) || \
 | 
			
		||||
                                            ((TRANSMITMAILBOX) == CAN_TX_MAILBOX2 ))
 | 
			
		||||
#define IS_CAN_TX_MAILBOX_LIST(TRANSMITMAILBOX) ((TRANSMITMAILBOX) <= (CAN_TX_MAILBOX0 | CAN_TX_MAILBOX1 | \
 | 
			
		||||
                                                                       CAN_TX_MAILBOX2))
 | 
			
		||||
#define IS_CAN_STDID(STDID)   ((STDID) <= 0x7FFU)
 | 
			
		||||
#define IS_CAN_EXTID(EXTID)   ((EXTID) <= 0x1FFFFFFFU)
 | 
			
		||||
#define IS_CAN_DLC(DLC)       ((DLC) <= 8U)
 | 
			
		||||
#define IS_CAN_IDTYPE(IDTYPE)  (((IDTYPE) == CAN_ID_STD) || \
 | 
			
		||||
                                ((IDTYPE) == CAN_ID_EXT))
 | 
			
		||||
#define IS_CAN_RTR(RTR) (((RTR) == CAN_RTR_DATA) || ((RTR) == CAN_RTR_REMOTE))
 | 
			
		||||
#define IS_CAN_RX_FIFO(FIFO) (((FIFO) == CAN_RX_FIFO0) || ((FIFO) == CAN_RX_FIFO1))
 | 
			
		||||
#define IS_CAN_IT(IT) ((IT) <= (CAN_IT_TX_MAILBOX_EMPTY     | CAN_IT_RX_FIFO0_MSG_PENDING      | \
 | 
			
		||||
                                CAN_IT_RX_FIFO0_FULL        | CAN_IT_RX_FIFO0_OVERRUN          | \
 | 
			
		||||
                                CAN_IT_RX_FIFO1_MSG_PENDING | CAN_IT_RX_FIFO1_FULL             | \
 | 
			
		||||
                                CAN_IT_RX_FIFO1_OVERRUN     | CAN_IT_WAKEUP                    | \
 | 
			
		||||
                                CAN_IT_SLEEP_ACK            | CAN_IT_ERROR_WARNING             | \
 | 
			
		||||
                                CAN_IT_ERROR_PASSIVE        | CAN_IT_BUSOFF                    | \
 | 
			
		||||
                                CAN_IT_LAST_ERROR_CODE      | CAN_IT_ERROR))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
/* End of private macros -----------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif /* CAN */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* STM32F3xx_HAL_CAN_H */
 | 
			
		||||
@ -0,0 +1,424 @@
 | 
			
		||||
/**
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @file    stm32f3xx_hal_cortex.h
 | 
			
		||||
  * @author  MCD Application Team
 | 
			
		||||
  * @brief   Header file of CORTEX HAL module.
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @attention
 | 
			
		||||
  *
 | 
			
		||||
  * Copyright (c) 2016 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 __STM32F3xx_HAL_CORTEX_H
 | 
			
		||||
#define __STM32F3xx_HAL_CORTEX_H
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
 extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Includes ------------------------------------------------------------------*/
 | 
			
		||||
#include "stm32f3xx_hal_def.h"
 | 
			
		||||
 | 
			
		||||
/** @addtogroup STM32F3xx_HAL_Driver
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup CORTEX
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
/* Exported types ------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup CORTEX_Exported_Types CORTEX Exported Types
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#if (__MPU_PRESENT == 1U)
 | 
			
		||||
/** @defgroup CORTEX_MPU_Region_Initialization_Structure_definition MPU Region Initialization Structure Definition
 | 
			
		||||
  * @brief  MPU Region initialization structure 
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
  uint8_t                Enable;                /*!< Specifies the status of the region. 
 | 
			
		||||
                                                     This parameter can be a value of @ref CORTEX_MPU_Region_Enable                 */
 | 
			
		||||
  uint8_t                Number;                /*!< Specifies the number of the region to protect. 
 | 
			
		||||
                                                     This parameter can be a value of @ref CORTEX_MPU_Region_Number                 */
 | 
			
		||||
  uint32_t               BaseAddress;           /*!< Specifies the base address of the region to protect.                           */
 | 
			
		||||
  uint8_t                Size;                  /*!< Specifies the size of the region to protect. 
 | 
			
		||||
                                                     This parameter can be a value of @ref CORTEX_MPU_Region_Size                   */
 | 
			
		||||
  uint8_t                SubRegionDisable;      /*!< Specifies the number of the subregion protection to disable. 
 | 
			
		||||
                                                     This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF    */         
 | 
			
		||||
  uint8_t                TypeExtField;          /*!< Specifies the TEX field level.
 | 
			
		||||
                                                     This parameter can be a value of @ref CORTEX_MPU_TEX_Levels                    */                 
 | 
			
		||||
  uint8_t                AccessPermission;      /*!< Specifies the region access permission type. 
 | 
			
		||||
                                                     This parameter can be a value of @ref CORTEX_MPU_Region_Permission_Attributes  */
 | 
			
		||||
  uint8_t                DisableExec;           /*!< Specifies the instruction access status. 
 | 
			
		||||
                                                     This parameter can be a value of @ref CORTEX_MPU_Instruction_Access            */
 | 
			
		||||
  uint8_t                IsShareable;           /*!< Specifies the shareability status of the protected region. 
 | 
			
		||||
                                                     This parameter can be a value of @ref CORTEX_MPU_Access_Shareable              */
 | 
			
		||||
  uint8_t                IsCacheable;           /*!< Specifies the cacheable status of the region protected. 
 | 
			
		||||
                                                     This parameter can be a value of @ref CORTEX_MPU_Access_Cacheable              */
 | 
			
		||||
  uint8_t                IsBufferable;          /*!< Specifies the bufferable status of the protected region. 
 | 
			
		||||
                                                     This parameter can be a value of @ref CORTEX_MPU_Access_Bufferable             */
 | 
			
		||||
}MPU_Region_InitTypeDef;
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
#endif /* __MPU_PRESENT */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported constants --------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_Exported_Constants CORTEX Exported Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_Preemption_Priority_Group CORTEX Preemption Priority Group
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define NVIC_PRIORITYGROUP_0         (0x00000007U) /*!< 0 bits for pre-emption priority
 | 
			
		||||
                                                                 4 bits for subpriority */
 | 
			
		||||
#define NVIC_PRIORITYGROUP_1         (0x00000006U) /*!< 1 bits for pre-emption priority
 | 
			
		||||
                                                                 3 bits for subpriority */
 | 
			
		||||
#define NVIC_PRIORITYGROUP_2         (0x00000005U) /*!< 2 bits for pre-emption priority
 | 
			
		||||
                                                                 2 bits for subpriority */
 | 
			
		||||
#define NVIC_PRIORITYGROUP_3         (0x00000004U) /*!< 3 bits for pre-emption priority
 | 
			
		||||
                                                                 1 bits for subpriority */
 | 
			
		||||
#define NVIC_PRIORITYGROUP_4         (0x00000003U) /*!< 4 bits for pre-emption priority
 | 
			
		||||
                                                                 0 bits for subpriority */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_SysTick_clock_source CORTEX SysTick clock source
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define SYSTICK_CLKSOURCE_HCLK_DIV8    (0x00000000U)
 | 
			
		||||
#define SYSTICK_CLKSOURCE_HCLK         (0x00000004U)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#if (__MPU_PRESENT == 1U)
 | 
			
		||||
/** @defgroup CORTEX_MPU_HFNMI_PRIVDEF_Control MPU HFNMI and PRIVILEGED Access control
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define  MPU_HFNMI_PRIVDEF_NONE      (0x00000000U)  
 | 
			
		||||
#define  MPU_HARDFAULT_NMI           (0x00000002U)
 | 
			
		||||
#define  MPU_PRIVILEGED_DEFAULT      (0x00000004U)
 | 
			
		||||
#define  MPU_HFNMI_PRIVDEF           (0x00000006U)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_MPU_Region_Enable CORTEX MPU Region Enable
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define  MPU_REGION_ENABLE     ((uint8_t)0x01U)
 | 
			
		||||
#define  MPU_REGION_DISABLE    ((uint8_t)0x00U)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_MPU_Instruction_Access CORTEX MPU Instruction Access
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define  MPU_INSTRUCTION_ACCESS_ENABLE      ((uint8_t)0x00U)
 | 
			
		||||
#define  MPU_INSTRUCTION_ACCESS_DISABLE     ((uint8_t)0x01U)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_MPU_Access_Shareable CORTEX MPU Instruction Access Shareable
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define  MPU_ACCESS_SHAREABLE        ((uint8_t)0x01U)
 | 
			
		||||
#define  MPU_ACCESS_NOT_SHAREABLE    ((uint8_t)0x00U)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_MPU_Access_Cacheable CORTEX MPU Instruction Access Cacheable
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define  MPU_ACCESS_CACHEABLE         ((uint8_t)0x01U)
 | 
			
		||||
#define  MPU_ACCESS_NOT_CACHEABLE     ((uint8_t)0x00U)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_MPU_Access_Bufferable CORTEX MPU Instruction Access Bufferable
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define  MPU_ACCESS_BUFFERABLE         ((uint8_t)0x01U)
 | 
			
		||||
#define  MPU_ACCESS_NOT_BUFFERABLE     ((uint8_t)0x00U)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_MPU_TEX_Levels MPU TEX Levels
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define  MPU_TEX_LEVEL0    ((uint8_t)0x00U)
 | 
			
		||||
#define  MPU_TEX_LEVEL1    ((uint8_t)0x01U)
 | 
			
		||||
#define  MPU_TEX_LEVEL2    ((uint8_t)0x02U)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_MPU_Region_Size CORTEX MPU Region Size
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define   MPU_REGION_SIZE_32B      ((uint8_t)0x04U)
 | 
			
		||||
#define   MPU_REGION_SIZE_64B      ((uint8_t)0x05U)
 | 
			
		||||
#define   MPU_REGION_SIZE_128B     ((uint8_t)0x06U) 
 | 
			
		||||
#define   MPU_REGION_SIZE_256B     ((uint8_t)0x07U) 
 | 
			
		||||
#define   MPU_REGION_SIZE_512B     ((uint8_t)0x08U) 
 | 
			
		||||
#define   MPU_REGION_SIZE_1KB      ((uint8_t)0x09U)  
 | 
			
		||||
#define   MPU_REGION_SIZE_2KB      ((uint8_t)0x0AU)
 | 
			
		||||
#define   MPU_REGION_SIZE_4KB      ((uint8_t)0x0BU) 
 | 
			
		||||
#define   MPU_REGION_SIZE_8KB      ((uint8_t)0x0CU) 
 | 
			
		||||
#define   MPU_REGION_SIZE_16KB     ((uint8_t)0x0DU) 
 | 
			
		||||
#define   MPU_REGION_SIZE_32KB     ((uint8_t)0x0EU) 
 | 
			
		||||
#define   MPU_REGION_SIZE_64KB     ((uint8_t)0x0FU) 
 | 
			
		||||
#define   MPU_REGION_SIZE_128KB    ((uint8_t)0x10U)
 | 
			
		||||
#define   MPU_REGION_SIZE_256KB    ((uint8_t)0x11U)
 | 
			
		||||
#define   MPU_REGION_SIZE_512KB    ((uint8_t)0x12U)
 | 
			
		||||
#define   MPU_REGION_SIZE_1MB      ((uint8_t)0x13U) 
 | 
			
		||||
#define   MPU_REGION_SIZE_2MB      ((uint8_t)0x14U) 
 | 
			
		||||
#define   MPU_REGION_SIZE_4MB      ((uint8_t)0x15U) 
 | 
			
		||||
#define   MPU_REGION_SIZE_8MB      ((uint8_t)0x16U) 
 | 
			
		||||
#define   MPU_REGION_SIZE_16MB     ((uint8_t)0x17U)
 | 
			
		||||
#define   MPU_REGION_SIZE_32MB     ((uint8_t)0x18U)
 | 
			
		||||
#define   MPU_REGION_SIZE_64MB     ((uint8_t)0x19U)
 | 
			
		||||
#define   MPU_REGION_SIZE_128MB    ((uint8_t)0x1AU)
 | 
			
		||||
#define   MPU_REGION_SIZE_256MB    ((uint8_t)0x1BU)
 | 
			
		||||
#define   MPU_REGION_SIZE_512MB    ((uint8_t)0x1CU)
 | 
			
		||||
#define   MPU_REGION_SIZE_1GB      ((uint8_t)0x1DU) 
 | 
			
		||||
#define   MPU_REGION_SIZE_2GB      ((uint8_t)0x1EU) 
 | 
			
		||||
#define   MPU_REGION_SIZE_4GB      ((uint8_t)0x1FU)
 | 
			
		||||
/**                                
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
   
 | 
			
		||||
/** @defgroup CORTEX_MPU_Region_Permission_Attributes CORTEX MPU Region Permission Attributes 
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define  MPU_REGION_NO_ACCESS      ((uint8_t)0x00U)  
 | 
			
		||||
#define  MPU_REGION_PRIV_RW        ((uint8_t)0x01U) 
 | 
			
		||||
#define  MPU_REGION_PRIV_RW_URO    ((uint8_t)0x02U)  
 | 
			
		||||
#define  MPU_REGION_FULL_ACCESS    ((uint8_t)0x03U)  
 | 
			
		||||
#define  MPU_REGION_PRIV_RO        ((uint8_t)0x05U) 
 | 
			
		||||
#define  MPU_REGION_PRIV_RO_URO    ((uint8_t)0x06U)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_MPU_Region_Number CORTEX MPU Region Number
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define  MPU_REGION_NUMBER0    ((uint8_t)0x00U)  
 | 
			
		||||
#define  MPU_REGION_NUMBER1    ((uint8_t)0x01U) 
 | 
			
		||||
#define  MPU_REGION_NUMBER2    ((uint8_t)0x02U)  
 | 
			
		||||
#define  MPU_REGION_NUMBER3    ((uint8_t)0x03U)  
 | 
			
		||||
#define  MPU_REGION_NUMBER4    ((uint8_t)0x04U) 
 | 
			
		||||
#define  MPU_REGION_NUMBER5    ((uint8_t)0x05U)
 | 
			
		||||
#define  MPU_REGION_NUMBER6    ((uint8_t)0x06U)
 | 
			
		||||
#define  MPU_REGION_NUMBER7    ((uint8_t)0x07U)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
#endif /* __MPU_PRESENT */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported Macros -----------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Exported functions --------------------------------------------------------*/
 | 
			
		||||
/** @addtogroup CORTEX_Exported_Functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup CORTEX_Exported_Functions_Group1
 | 
			
		||||
 * @{
 | 
			
		||||
 */
 | 
			
		||||
/* Initialization and de-initialization functions *****************************/
 | 
			
		||||
void HAL_NVIC_SetPriorityGrouping(uint32_t PriorityGroup);
 | 
			
		||||
void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority);
 | 
			
		||||
void HAL_NVIC_EnableIRQ(IRQn_Type IRQn);
 | 
			
		||||
void HAL_NVIC_DisableIRQ(IRQn_Type IRQn);
 | 
			
		||||
void HAL_NVIC_SystemReset(void);
 | 
			
		||||
uint32_t HAL_SYSTICK_Config(uint32_t TicksNumb);
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
  
 | 
			
		||||
/** @addtogroup CORTEX_Exported_Functions_Group2
 | 
			
		||||
 * @{
 | 
			
		||||
 */
 | 
			
		||||
/* Peripheral Control functions ***********************************************/
 | 
			
		||||
#if (__MPU_PRESENT == 1U)
 | 
			
		||||
void HAL_MPU_ConfigRegion(MPU_Region_InitTypeDef *MPU_Init);
 | 
			
		||||
#endif /* __MPU_PRESENT */
 | 
			
		||||
uint32_t HAL_NVIC_GetPriorityGrouping(void);
 | 
			
		||||
void HAL_NVIC_GetPriority(IRQn_Type IRQn, uint32_t PriorityGroup, uint32_t* pPreemptPriority, uint32_t* pSubPriority);
 | 
			
		||||
uint32_t HAL_NVIC_GetPendingIRQ(IRQn_Type IRQn);
 | 
			
		||||
void HAL_NVIC_SetPendingIRQ(IRQn_Type IRQn);
 | 
			
		||||
void HAL_NVIC_ClearPendingIRQ(IRQn_Type IRQn);
 | 
			
		||||
uint32_t HAL_NVIC_GetActive(IRQn_Type IRQn);
 | 
			
		||||
void HAL_SYSTICK_CLKSourceConfig(uint32_t CLKSource);
 | 
			
		||||
void HAL_SYSTICK_IRQHandler(void);
 | 
			
		||||
void HAL_SYSTICK_Callback(void);
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */  
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Private types -------------------------------------------------------------*/ 
 | 
			
		||||
/* Private variables ---------------------------------------------------------*/
 | 
			
		||||
/* Private constants ---------------------------------------------------------*/
 | 
			
		||||
/* Private macros ------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup CORTEX_Private_Macros CORTEX Private Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */  
 | 
			
		||||
#define IS_NVIC_PRIORITY_GROUP(GROUP) (((GROUP) == NVIC_PRIORITYGROUP_0) || \
 | 
			
		||||
                                       ((GROUP) == NVIC_PRIORITYGROUP_1) || \
 | 
			
		||||
                                       ((GROUP) == NVIC_PRIORITYGROUP_2) || \
 | 
			
		||||
                                       ((GROUP) == NVIC_PRIORITYGROUP_3) || \
 | 
			
		||||
                                       ((GROUP) == NVIC_PRIORITYGROUP_4))
 | 
			
		||||
 | 
			
		||||
#define IS_NVIC_PREEMPTION_PRIORITY(PRIORITY)  ((PRIORITY) < 0x10U)
 | 
			
		||||
 | 
			
		||||
#define IS_NVIC_SUB_PRIORITY(PRIORITY)  ((PRIORITY) < 0x10U)
 | 
			
		||||
 | 
			
		||||
#define IS_NVIC_DEVICE_IRQ(IRQ)  ((IRQ) >= 0x00)
 | 
			
		||||
                                  
 | 
			
		||||
/** @defgroup CORTEX_SysTick_clock_source_Macro_Private CORTEX SysTick clock source
 | 
			
		||||
  * @{
 | 
			
		||||
  */                       
 | 
			
		||||
#define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SYSTICK_CLKSOURCE_HCLK) || \
 | 
			
		||||
                                       ((SOURCE) == SYSTICK_CLKSOURCE_HCLK_DIV8))
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#if (__MPU_PRESENT == 1U)
 | 
			
		||||
#define IS_MPU_REGION_ENABLE(STATE) (((STATE) == MPU_REGION_ENABLE) || \
 | 
			
		||||
                                     ((STATE) == MPU_REGION_DISABLE))
 | 
			
		||||
 | 
			
		||||
#define IS_MPU_INSTRUCTION_ACCESS(STATE) (((STATE) == MPU_INSTRUCTION_ACCESS_ENABLE) || \
 | 
			
		||||
                                          ((STATE) == MPU_INSTRUCTION_ACCESS_DISABLE))
 | 
			
		||||
 | 
			
		||||
#define IS_MPU_ACCESS_SHAREABLE(STATE)   (((STATE) == MPU_ACCESS_SHAREABLE) || \
 | 
			
		||||
                                          ((STATE) == MPU_ACCESS_NOT_SHAREABLE))
 | 
			
		||||
 | 
			
		||||
#define IS_MPU_ACCESS_CACHEABLE(STATE)   (((STATE) == MPU_ACCESS_CACHEABLE) || \
 | 
			
		||||
                                          ((STATE) == MPU_ACCESS_NOT_CACHEABLE))
 | 
			
		||||
 | 
			
		||||
#define IS_MPU_ACCESS_BUFFERABLE(STATE)   (((STATE) == MPU_ACCESS_BUFFERABLE) || \
 | 
			
		||||
                                          ((STATE) == MPU_ACCESS_NOT_BUFFERABLE))
 | 
			
		||||
 | 
			
		||||
#define IS_MPU_TEX_LEVEL(TYPE) (((TYPE) == MPU_TEX_LEVEL0)  || \
 | 
			
		||||
                                ((TYPE) == MPU_TEX_LEVEL1)  || \
 | 
			
		||||
                                ((TYPE) == MPU_TEX_LEVEL2))
 | 
			
		||||
 | 
			
		||||
#define IS_MPU_REGION_PERMISSION_ATTRIBUTE(TYPE) (((TYPE) == MPU_REGION_NO_ACCESS)   || \
 | 
			
		||||
                                                  ((TYPE) == MPU_REGION_PRIV_RW)     || \
 | 
			
		||||
                                                  ((TYPE) == MPU_REGION_PRIV_RW_URO) || \
 | 
			
		||||
                                                  ((TYPE) == MPU_REGION_FULL_ACCESS) || \
 | 
			
		||||
                                                  ((TYPE) == MPU_REGION_PRIV_RO)     || \
 | 
			
		||||
                                                  ((TYPE) == MPU_REGION_PRIV_RO_URO))
 | 
			
		||||
 | 
			
		||||
#define IS_MPU_REGION_NUMBER(NUMBER)    (((NUMBER) == MPU_REGION_NUMBER0) || \
 | 
			
		||||
                                         ((NUMBER) == MPU_REGION_NUMBER1) || \
 | 
			
		||||
                                         ((NUMBER) == MPU_REGION_NUMBER2) || \
 | 
			
		||||
                                         ((NUMBER) == MPU_REGION_NUMBER3) || \
 | 
			
		||||
                                         ((NUMBER) == MPU_REGION_NUMBER4) || \
 | 
			
		||||
                                         ((NUMBER) == MPU_REGION_NUMBER5) || \
 | 
			
		||||
                                         ((NUMBER) == MPU_REGION_NUMBER6) || \
 | 
			
		||||
                                         ((NUMBER) == MPU_REGION_NUMBER7))
 | 
			
		||||
 | 
			
		||||
#define IS_MPU_REGION_SIZE(SIZE)    (((SIZE) == MPU_REGION_SIZE_32B)   || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_64B)   || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_128B)  || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_256B)  || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_512B)  || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_1KB)   || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_2KB)   || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_4KB)   || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_8KB)   || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_16KB)  || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_32KB)  || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_64KB)  || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_128KB) || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_256KB) || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_512KB) || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_1MB)   || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_2MB)   || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_4MB)   || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_8MB)   || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_16MB)  || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_32MB)  || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_64MB)  || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_128MB) || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_256MB) || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_512MB) || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_1GB)   || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_2GB)   || \
 | 
			
		||||
                                     ((SIZE) == MPU_REGION_SIZE_4GB))
 | 
			
		||||
 | 
			
		||||
#define IS_MPU_SUB_REGION_DISABLE(SUBREGION)  ((SUBREGION) < (uint16_t)0x00FFU)
 | 
			
		||||
#endif /* __MPU_PRESENT */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Private functions ---------------------------------------------------------*/   
 | 
			
		||||
/** @defgroup CORTEX_Private_Functions CORTEX Private Functions
 | 
			
		||||
  * @brief    CORTEX private  functions 
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#if (__MPU_PRESENT == 1U)
 | 
			
		||||
 | 
			
		||||
void HAL_MPU_Disable(void);
 | 
			
		||||
void HAL_MPU_Enable(uint32_t MPU_Control);
 | 
			
		||||
 | 
			
		||||
#endif /* __MPU_PRESENT */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */ 
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
  
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* __STM32F3xx_HAL_CORTEX_H */
 | 
			
		||||
 
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,178 @@
 | 
			
		||||
/**
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @file    stm32f3xx_hal_def.h
 | 
			
		||||
  * @author  MCD Application Team
 | 
			
		||||
  * @brief   This file contains HAL common defines, enumeration, macros and 
 | 
			
		||||
  *          structures definitions. 
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @attention
 | 
			
		||||
  *
 | 
			
		||||
  * Copyright (c) 2016 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 __STM32F3xx_HAL_DEF
 | 
			
		||||
#define __STM32F3xx_HAL_DEF
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
 extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Includes ------------------------------------------------------------------*/
 | 
			
		||||
#include "stm32f3xx.h"
 | 
			
		||||
#include "Legacy/stm32_hal_legacy.h"
 | 
			
		||||
#include <stddef.h>
 | 
			
		||||
 | 
			
		||||
/* Exported types ------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/** 
 | 
			
		||||
  * @brief  HAL Status structures definition  
 | 
			
		||||
  */  
 | 
			
		||||
typedef enum 
 | 
			
		||||
{
 | 
			
		||||
  HAL_OK       = 0x00U,
 | 
			
		||||
  HAL_ERROR    = 0x01U,
 | 
			
		||||
  HAL_BUSY     = 0x02U,
 | 
			
		||||
  HAL_TIMEOUT  = 0x03
 | 
			
		||||
} HAL_StatusTypeDef;
 | 
			
		||||
 | 
			
		||||
/** 
 | 
			
		||||
  * @brief  HAL Lock structures definition  
 | 
			
		||||
  */
 | 
			
		||||
typedef enum 
 | 
			
		||||
{
 | 
			
		||||
  HAL_UNLOCKED = 0x00U,
 | 
			
		||||
  HAL_LOCKED   = 0x01  
 | 
			
		||||
} HAL_LockTypeDef;
 | 
			
		||||
 | 
			
		||||
/* Exported macro ------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
#if !defined(UNUSED)
 | 
			
		||||
#define UNUSED(X) (void)X      /* To avoid gcc/g++ warnings */
 | 
			
		||||
#endif /* UNUSED */
 | 
			
		||||
 | 
			
		||||
#define HAL_MAX_DELAY      0xFFFFFFFFU
 | 
			
		||||
 | 
			
		||||
#define HAL_IS_BIT_SET(REG, BIT)         (((REG) & (BIT)) == BIT)
 | 
			
		||||
#define HAL_IS_BIT_CLR(REG, BIT)         (((REG) & (BIT)) == 0U)
 | 
			
		||||
 | 
			
		||||
#define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD_, __DMA_HANDLE_)                 \
 | 
			
		||||
                        do{                                                        \
 | 
			
		||||
                              (__HANDLE__)->__PPP_DMA_FIELD_ = &(__DMA_HANDLE_);   \
 | 
			
		||||
                              (__DMA_HANDLE_).Parent = (__HANDLE__);               \
 | 
			
		||||
                          } while(0U)
 | 
			
		||||
 | 
			
		||||
/** @brief Reset the Handle's State field.
 | 
			
		||||
  * @param __HANDLE__ specifies the Peripheral Handle.
 | 
			
		||||
  * @note  This macro can be used for the following purpose:
 | 
			
		||||
  *          - When the Handle is declared as local variable; before passing it as parameter
 | 
			
		||||
  *            to HAL_PPP_Init() for the first time, it is mandatory to use this macro
 | 
			
		||||
  *            to set to 0 the Handle's "State" field.
 | 
			
		||||
  *            Otherwise, "State" field may have any random value and the first time the function
 | 
			
		||||
  *            HAL_PPP_Init() is called, the low level hardware initialization will be missed
 | 
			
		||||
  *            (i.e. HAL_PPP_MspInit() will not be executed).
 | 
			
		||||
  *          - When there is a need to reconfigure the low level hardware: instead of calling
 | 
			
		||||
  *            HAL_PPP_DeInit() then HAL_PPP_Init(), user can make a call to this macro then HAL_PPP_Init().
 | 
			
		||||
  *            In this later function, when the Handle's "State" field is set to 0, it will execute the function
 | 
			
		||||
  *            HAL_PPP_MspInit() which will reconfigure the low level hardware.
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = 0U)
 | 
			
		||||
 | 
			
		||||
#if (USE_RTOS == 1U)
 | 
			
		||||
  #error " USE_RTOS should be 0 in the current HAL release "
 | 
			
		||||
#else
 | 
			
		||||
  #define __HAL_LOCK(__HANDLE__)                                           \
 | 
			
		||||
                                do{                                        \
 | 
			
		||||
                                    if((__HANDLE__)->Lock == HAL_LOCKED)   \
 | 
			
		||||
                                    {                                      \
 | 
			
		||||
                                       return HAL_BUSY;                    \
 | 
			
		||||
                                    }                                      \
 | 
			
		||||
                                    else                                   \
 | 
			
		||||
                                    {                                      \
 | 
			
		||||
                                       (__HANDLE__)->Lock = HAL_LOCKED;    \
 | 
			
		||||
                                    }                                      \
 | 
			
		||||
       	                          }while (0U)
 | 
			
		||||
 | 
			
		||||
  #define __HAL_UNLOCK(__HANDLE__)                                          \
 | 
			
		||||
                                  do{                                       \
 | 
			
		||||
                                      (__HANDLE__)->Lock = HAL_UNLOCKED;    \
 | 
			
		||||
                                    }while (0U)
 | 
			
		||||
#endif /* USE_RTOS */
 | 
			
		||||
 | 
			
		||||
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) /* ARM Compiler V6 */
 | 
			
		||||
  #ifndef __weak
 | 
			
		||||
    #define __weak  __attribute__((weak))
 | 
			
		||||
  #endif
 | 
			
		||||
  #ifndef __packed
 | 
			
		||||
    #define __packed  __attribute__((packed))
 | 
			
		||||
  #endif
 | 
			
		||||
#elif defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */
 | 
			
		||||
  #ifndef __weak
 | 
			
		||||
    #define __weak   __attribute__((weak))
 | 
			
		||||
  #endif /* __weak */
 | 
			
		||||
  #ifndef __packed
 | 
			
		||||
    #define __packed __attribute__((__packed__))
 | 
			
		||||
  #endif /* __packed */
 | 
			
		||||
#endif /* __GNUC__ */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Macro to get variable aligned on 4-bytes, for __ICCARM__ the directive "#pragma data_alignment=4" must be used instead */
 | 
			
		||||
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) /* ARM Compiler V6 */
 | 
			
		||||
  #ifndef __ALIGN_BEGIN
 | 
			
		||||
    #define __ALIGN_BEGIN
 | 
			
		||||
  #endif
 | 
			
		||||
  #ifndef __ALIGN_END
 | 
			
		||||
    #define __ALIGN_END      __attribute__ ((aligned (4)))
 | 
			
		||||
  #endif
 | 
			
		||||
#elif defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */
 | 
			
		||||
  #ifndef __ALIGN_END
 | 
			
		||||
    #define __ALIGN_END    __attribute__ ((aligned (4)))
 | 
			
		||||
  #endif /* __ALIGN_END */
 | 
			
		||||
  #ifndef __ALIGN_BEGIN  
 | 
			
		||||
    #define __ALIGN_BEGIN
 | 
			
		||||
  #endif /* __ALIGN_BEGIN */
 | 
			
		||||
#else
 | 
			
		||||
  #ifndef __ALIGN_END
 | 
			
		||||
    #define __ALIGN_END
 | 
			
		||||
  #endif /* __ALIGN_END */
 | 
			
		||||
  #ifndef __ALIGN_BEGIN      
 | 
			
		||||
    #if defined   (__CC_ARM)      /* ARM Compiler V5*/
 | 
			
		||||
      #define __ALIGN_BEGIN    __align(4)  
 | 
			
		||||
    #elif defined (__ICCARM__)    /* IAR Compiler */
 | 
			
		||||
      #define __ALIGN_BEGIN 
 | 
			
		||||
    #endif /* __CC_ARM */
 | 
			
		||||
  #endif /* __ALIGN_BEGIN */
 | 
			
		||||
#endif /* __GNUC__ */
 | 
			
		||||
 | 
			
		||||
/** 
 | 
			
		||||
  * @brief  __NOINLINE definition
 | 
			
		||||
  */ 
 | 
			
		||||
#if defined ( __CC_ARM   ) || (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) || defined   (  __GNUC__  )
 | 
			
		||||
/* ARM V4/V5 and V6 & GNU Compiler
 | 
			
		||||
   -------------------------------
 | 
			
		||||
*/
 | 
			
		||||
#define __NOINLINE __attribute__ ( (noinline) )  
 | 
			
		||||
 | 
			
		||||
#elif defined ( __ICCARM__ )
 | 
			
		||||
/* ICCARM Compiler
 | 
			
		||||
   ---------------
 | 
			
		||||
*/
 | 
			
		||||
#define __NOINLINE _Pragma("optimize = no_inline")
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* ___STM32F3xx_HAL_DEF */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,452 @@
 | 
			
		||||
/**
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @file    stm32f3xx_hal_dma.h
 | 
			
		||||
  * @author  MCD Application Team
 | 
			
		||||
  * @brief   Header file of DMA HAL module.
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @attention
 | 
			
		||||
  *
 | 
			
		||||
  * Copyright (c) 2016 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 __STM32F3xx_HAL_DMA_H
 | 
			
		||||
#define __STM32F3xx_HAL_DMA_H
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
 extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Includes ------------------------------------------------------------------*/
 | 
			
		||||
#include "stm32f3xx_hal_def.h"
 | 
			
		||||
 | 
			
		||||
/** @addtogroup STM32F3xx_HAL_Driver
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup DMA
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
 | 
			
		||||
/* Exported types ------------------------------------------------------------*/ 
 | 
			
		||||
 | 
			
		||||
/** @defgroup DMA_Exported_Types DMA Exported Types
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** 
 | 
			
		||||
  * @brief  DMA Configuration Structure definition  
 | 
			
		||||
  */
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
  uint32_t Direction;                 /*!< Specifies if the data will be transferred from memory to peripheral, 
 | 
			
		||||
                                           from memory to memory or from peripheral to memory.
 | 
			
		||||
                                           This parameter can be a value of @ref DMA_Data_transfer_direction */
 | 
			
		||||
 | 
			
		||||
  uint32_t PeriphInc;                 /*!< Specifies whether the Peripheral address register should be incremented or not.
 | 
			
		||||
                                           This parameter can be a value of @ref DMA_Peripheral_incremented_mode */
 | 
			
		||||
                               
 | 
			
		||||
  uint32_t MemInc;                    /*!< Specifies whether the memory address register should be incremented or not.
 | 
			
		||||
                                           This parameter can be a value of @ref DMA_Memory_incremented_mode */
 | 
			
		||||
  
 | 
			
		||||
  uint32_t PeriphDataAlignment;       /*!< Specifies the Peripheral data width.
 | 
			
		||||
                                           This parameter can be a value of @ref DMA_Peripheral_data_size */
 | 
			
		||||
 | 
			
		||||
  uint32_t MemDataAlignment;          /*!< Specifies the Memory data width.
 | 
			
		||||
                                           This parameter can be a value of @ref DMA_Memory_data_size */
 | 
			
		||||
                               
 | 
			
		||||
  uint32_t Mode;                      /*!< Specifies the operation mode of the DMAy Channelx.
 | 
			
		||||
                                           This parameter can be a value of @ref DMA_mode
 | 
			
		||||
                                           @note The circular buffer mode cannot be used if the memory-to-memory
 | 
			
		||||
                                           data transfer is configured on the selected Channel */ 
 | 
			
		||||
 | 
			
		||||
  uint32_t Priority;                   /*!< Specifies the software priority for the DMAy Channelx.
 | 
			
		||||
                                            This parameter can be a value of @ref DMA_Priority_level */
 | 
			
		||||
} DMA_InitTypeDef;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  HAL DMA State structures definition  
 | 
			
		||||
  */
 | 
			
		||||
typedef enum
 | 
			
		||||
{
 | 
			
		||||
  HAL_DMA_STATE_RESET             = 0x00U,  /*!< DMA not yet initialized or disabled */  
 | 
			
		||||
  HAL_DMA_STATE_READY             = 0x01U,  /*!< DMA initialized and ready for use   */
 | 
			
		||||
  HAL_DMA_STATE_BUSY              = 0x02U,  /*!< DMA process is ongoing              */     
 | 
			
		||||
  HAL_DMA_STATE_TIMEOUT           = 0x03   /*!< DMA timeout state                   */  
 | 
			
		||||
}HAL_DMA_StateTypeDef;
 | 
			
		||||
 | 
			
		||||
/** 
 | 
			
		||||
  * @brief  HAL DMA Error Code structure definition  
 | 
			
		||||
  */ 
 | 
			
		||||
typedef enum
 | 
			
		||||
{
 | 
			
		||||
  HAL_DMA_FULL_TRANSFER      = 0x00U,    /*!< Full transfer     */
 | 
			
		||||
  HAL_DMA_HALF_TRANSFER      = 0x01     /*!< Half Transfer     */
 | 
			
		||||
}HAL_DMA_LevelCompleteTypeDef;      
 | 
			
		||||
 | 
			
		||||
/** 
 | 
			
		||||
  * @brief  HAL DMA Callback ID structure definition
 | 
			
		||||
  */
 | 
			
		||||
typedef enum
 | 
			
		||||
{
 | 
			
		||||
  HAL_DMA_XFER_CPLT_CB_ID          = 0x00U,    /*!< Full transfer     */
 | 
			
		||||
  HAL_DMA_XFER_HALFCPLT_CB_ID      = 0x01U,    /*!< Half transfer     */
 | 
			
		||||
  HAL_DMA_XFER_ERROR_CB_ID         = 0x02U,    /*!< Error             */ 
 | 
			
		||||
  HAL_DMA_XFER_ABORT_CB_ID         = 0x03U,    /*!< Abort             */ 
 | 
			
		||||
  HAL_DMA_XFER_ALL_CB_ID           = 0x04     /*!< All               */ 
 | 
			
		||||
}HAL_DMA_CallbackIDTypeDef;                                                                 
 | 
			
		||||
 | 
			
		||||
/** 
 | 
			
		||||
  * @brief  DMA handle Structure definition  
 | 
			
		||||
  */ 
 | 
			
		||||
typedef struct __DMA_HandleTypeDef
 | 
			
		||||
{  
 | 
			
		||||
  DMA_Channel_TypeDef   *Instance;                                                    /*!< Register base address                  */
 | 
			
		||||
  
 | 
			
		||||
  DMA_InitTypeDef       Init;                                                         /*!< DMA communication parameters           */ 
 | 
			
		||||
  
 | 
			
		||||
  HAL_LockTypeDef       Lock;                                                         /*!< DMA locking object                     */  
 | 
			
		||||
  
 | 
			
		||||
  HAL_DMA_StateTypeDef  State;                                                        /*!< DMA transfer state                     */
 | 
			
		||||
  
 | 
			
		||||
  void                  *Parent;                                                      /*!< Parent object state                    */  
 | 
			
		||||
  
 | 
			
		||||
  void                  (* XferCpltCallback)( struct __DMA_HandleTypeDef * hdma);     /*!< DMA transfer complete callback         */
 | 
			
		||||
  
 | 
			
		||||
  void                  (* XferHalfCpltCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA Half transfer complete callback    */
 | 
			
		||||
  
 | 
			
		||||
  void                  (* XferErrorCallback)( struct __DMA_HandleTypeDef * hdma);    /*!< DMA transfer error callback            */
 | 
			
		||||
  
 | 
			
		||||
  void                  (* XferAbortCallback)( struct __DMA_HandleTypeDef * hdma);    /*!< DMA transfer abort callback            */  
 | 
			
		||||
  
 | 
			
		||||
  __IO uint32_t         ErrorCode;                                                    /*!< DMA Error code                         */
 | 
			
		||||
  
 | 
			
		||||
  DMA_TypeDef          *DmaBaseAddress;                                               /*!< DMA Channel Base Address               */
 | 
			
		||||
  
 | 
			
		||||
  uint32_t              ChannelIndex;                                                 /*!< DMA Channel Index                      */
 | 
			
		||||
} DMA_HandleTypeDef;    
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported constants --------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/** @defgroup DMA_Exported_Constants DMA Exported Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup DMA_Error_Code DMA Error Code
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
#define HAL_DMA_ERROR_NONE          (0x00000000U)    /*!< No error             */
 | 
			
		||||
#define HAL_DMA_ERROR_TE            (0x00000001U)    /*!< Transfer error       */
 | 
			
		||||
#define HAL_DMA_ERROR_NO_XFER       (0x00000004U)    /*!< no ongoin transfer   */
 | 
			
		||||
#define HAL_DMA_ERROR_TIMEOUT       (0x00000020U)    /*!< Timeout error        */
 | 
			
		||||
#define HAL_DMA_ERROR_NOT_SUPPORTED (0x00000100U)    /*!< Not supported mode */     
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup DMA_Data_transfer_direction DMA Data transfer direction
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
#define DMA_PERIPH_TO_MEMORY         (0x00000000U)        /*!< Peripheral to memory direction */
 | 
			
		||||
#define DMA_MEMORY_TO_PERIPH         ((uint32_t)DMA_CCR_DIR)       /*!< Memory to peripheral direction */
 | 
			
		||||
#define DMA_MEMORY_TO_MEMORY         ((uint32_t)DMA_CCR_MEM2MEM)   /*!< Memory to memory direction     */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
  
 | 
			
		||||
/** @defgroup DMA_Peripheral_incremented_mode DMA Peripheral incremented mode
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
#define DMA_PINC_ENABLE        ((uint32_t)DMA_CCR_PINC)  /*!< Peripheral increment mode Enable */
 | 
			
		||||
#define DMA_PINC_DISABLE       (0x00000000U)    /*!< Peripheral increment mode Disable */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */ 
 | 
			
		||||
 | 
			
		||||
/** @defgroup DMA_Memory_incremented_mode DMA Memory incremented mode
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
#define DMA_MINC_ENABLE         ((uint32_t)DMA_CCR_MINC)  /*!< Memory increment mode Enable  */
 | 
			
		||||
#define DMA_MINC_DISABLE        (0x00000000U)    /*!< Memory increment mode Disable */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup DMA_Peripheral_data_size DMA Peripheral data size
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
#define DMA_PDATAALIGN_BYTE          (0x00000000U)       /*!< Peripheral data alignment : Byte     */
 | 
			
		||||
#define DMA_PDATAALIGN_HALFWORD      ((uint32_t)DMA_CCR_PSIZE_0)  /*!< Peripheral data alignment : HalfWord */
 | 
			
		||||
#define DMA_PDATAALIGN_WORD          ((uint32_t)DMA_CCR_PSIZE_1)  /*!< Peripheral data alignment : Word     */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */ 
 | 
			
		||||
 | 
			
		||||
/** @defgroup DMA_Memory_data_size DMA Memory data size
 | 
			
		||||
  * @{ 
 | 
			
		||||
  */
 | 
			
		||||
#define DMA_MDATAALIGN_BYTE          (0x00000000U)       /*!< Memory data alignment : Byte     */
 | 
			
		||||
#define DMA_MDATAALIGN_HALFWORD      ((uint32_t)DMA_CCR_MSIZE_0)  /*!< Memory data alignment : HalfWord */
 | 
			
		||||
#define DMA_MDATAALIGN_WORD          ((uint32_t)DMA_CCR_MSIZE_1)  /*!< Memory data alignment : Word     */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup DMA_mode DMA mode
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
#define DMA_NORMAL         (0x00000000U)      /*!< Normal Mode                  */
 | 
			
		||||
#define DMA_CIRCULAR       ((uint32_t)DMA_CCR_CIRC)    /*!< Circular Mode                */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup DMA_Priority_level DMA Priority level
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define DMA_PRIORITY_LOW             (0x00000000U)    /*!< Priority level : Low       */
 | 
			
		||||
#define DMA_PRIORITY_MEDIUM          ((uint32_t)DMA_CCR_PL_0)  /*!< Priority level : Medium    */
 | 
			
		||||
#define DMA_PRIORITY_HIGH            ((uint32_t)DMA_CCR_PL_1)  /*!< Priority level : High      */
 | 
			
		||||
#define DMA_PRIORITY_VERY_HIGH       ((uint32_t)DMA_CCR_PL)    /*!< Priority level : Very_High */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */ 
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/** @defgroup DMA_interrupt_enable_definitions DMA interrupt enable definitions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define DMA_IT_TC                         ((uint32_t)DMA_CCR_TCIE)
 | 
			
		||||
#define DMA_IT_HT                         ((uint32_t)DMA_CCR_HTIE)
 | 
			
		||||
#define DMA_IT_TE                         ((uint32_t)DMA_CCR_TEIE)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup DMA_flag_definitions DMA flag definitions
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
#define DMA_FLAG_GL1                      (0x00000001U)
 | 
			
		||||
#define DMA_FLAG_TC1                      (0x00000002U)
 | 
			
		||||
#define DMA_FLAG_HT1                      (0x00000004U)
 | 
			
		||||
#define DMA_FLAG_TE1                      (0x00000008U)
 | 
			
		||||
#define DMA_FLAG_GL2                      (0x00000010U)
 | 
			
		||||
#define DMA_FLAG_TC2                      (0x00000020U)
 | 
			
		||||
#define DMA_FLAG_HT2                      (0x00000040U)
 | 
			
		||||
#define DMA_FLAG_TE2                      (0x00000080U)
 | 
			
		||||
#define DMA_FLAG_GL3                      (0x00000100U)
 | 
			
		||||
#define DMA_FLAG_TC3                      (0x00000200U)
 | 
			
		||||
#define DMA_FLAG_HT3                      (0x00000400U)
 | 
			
		||||
#define DMA_FLAG_TE3                      (0x00000800U)
 | 
			
		||||
#define DMA_FLAG_GL4                      (0x00001000U)
 | 
			
		||||
#define DMA_FLAG_TC4                      (0x00002000U)
 | 
			
		||||
#define DMA_FLAG_HT4                      (0x00004000U)
 | 
			
		||||
#define DMA_FLAG_TE4                      (0x00008000U)
 | 
			
		||||
#define DMA_FLAG_GL5                      (0x00010000U)
 | 
			
		||||
#define DMA_FLAG_TC5                      (0x00020000U)
 | 
			
		||||
#define DMA_FLAG_HT5                      (0x00040000U)
 | 
			
		||||
#define DMA_FLAG_TE5                      (0x00080000U)
 | 
			
		||||
#define DMA_FLAG_GL6                      (0x00100000U)
 | 
			
		||||
#define DMA_FLAG_TC6                      (0x00200000U)
 | 
			
		||||
#define DMA_FLAG_HT6                      (0x00400000U)
 | 
			
		||||
#define DMA_FLAG_TE6                      (0x00800000U)
 | 
			
		||||
#define DMA_FLAG_GL7                      (0x01000000U)
 | 
			
		||||
#define DMA_FLAG_TC7                      (0x02000000U)
 | 
			
		||||
#define DMA_FLAG_HT7                      (0x04000000U)
 | 
			
		||||
#define DMA_FLAG_TE7                      (0x08000000U)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Exported macro ------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup DMA_Exported_Macros DMA Exported Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @brief  Reset DMA handle state
 | 
			
		||||
  * @param  __HANDLE__ DMA handle.
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_DMA_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DMA_STATE_RESET)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Enable the specified DMA Channel.
 | 
			
		||||
  * @param  __HANDLE__ DMA handle
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_DMA_ENABLE(__HANDLE__)        ((__HANDLE__)->Instance->CCR |= DMA_CCR_EN)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Disable the specified DMA Channel.
 | 
			
		||||
  * @param  __HANDLE__ DMA handle
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_DMA_DISABLE(__HANDLE__)       ((__HANDLE__)->Instance->CCR &= ~DMA_CCR_EN)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Interrupt & Flag management */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Enables the specified DMA Channel interrupts.
 | 
			
		||||
  * @param  __HANDLE__ DMA handle
 | 
			
		||||
  * @param __INTERRUPT__ specifies the DMA interrupt sources to be enabled or disabled. 
 | 
			
		||||
  *          This parameter can be any combination of the following values:
 | 
			
		||||
  *            @arg DMA_IT_TC:  Transfer complete interrupt mask
 | 
			
		||||
  *            @arg DMA_IT_HT:  Half transfer complete interrupt mask
 | 
			
		||||
  *            @arg DMA_IT_TE:  Transfer error interrupt mask
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_DMA_ENABLE_IT(__HANDLE__, __INTERRUPT__)   ((__HANDLE__)->Instance->CCR |= (__INTERRUPT__))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Disables the specified DMA Channel interrupts.
 | 
			
		||||
  * @param  __HANDLE__ DMA handle
 | 
			
		||||
  * @param __INTERRUPT__ specifies the DMA interrupt sources to be enabled or disabled. 
 | 
			
		||||
  *          This parameter can be any combination of the following values:
 | 
			
		||||
  *            @arg DMA_IT_TC:  Transfer complete interrupt mask
 | 
			
		||||
  *            @arg DMA_IT_HT:  Half transfer complete interrupt mask
 | 
			
		||||
  *            @arg DMA_IT_TE:  Transfer error interrupt mask
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_DMA_DISABLE_IT(__HANDLE__, __INTERRUPT__)  ((__HANDLE__)->Instance->CCR &= ~(__INTERRUPT__))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Checks whether the specified DMA Channel interrupt is enabled or disabled.
 | 
			
		||||
  * @param  __HANDLE__ DMA handle
 | 
			
		||||
  * @param  __INTERRUPT__ specifies the DMA interrupt source to check.
 | 
			
		||||
  *          This parameter can be one of the following values:
 | 
			
		||||
  *            @arg DMA_IT_TC:  Transfer complete interrupt mask
 | 
			
		||||
  *            @arg DMA_IT_HT:  Half transfer complete interrupt mask
 | 
			
		||||
  *            @arg DMA_IT_TE:  Transfer error interrupt mask
 | 
			
		||||
  * @retval The state of DMA_IT (SET or RESET).
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_DMA_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__)  (((__HANDLE__)->Instance->CCR & (__INTERRUPT__)))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Returns the number of remaining data units in the current DMAy Channelx transfer.
 | 
			
		||||
  * @param  __HANDLE__ DMA handle
 | 
			
		||||
  *   
 | 
			
		||||
  * @retval The number of remaining data units in the current DMA Channel transfer.
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_DMA_GET_COUNTER(__HANDLE__) ((__HANDLE__)->Instance->CNDTR)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Include DMA HAL Extended module */
 | 
			
		||||
#include "stm32f3xx_hal_dma_ex.h"   
 | 
			
		||||
 | 
			
		||||
/* Exported functions --------------------------------------------------------*/
 | 
			
		||||
/** @addtogroup DMA_Exported_Functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup DMA_Exported_Functions_Group1 Initialization and de-initialization functions 
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/* Initialization and de-initialization functions *****************************/
 | 
			
		||||
HAL_StatusTypeDef HAL_DMA_Init(DMA_HandleTypeDef *hdma);
 | 
			
		||||
HAL_StatusTypeDef HAL_DMA_DeInit (DMA_HandleTypeDef *hdma);
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup DMA_Exported_Functions_Group2 Input and Output operation functions 
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/* Input and Output operation functions *****************************************************/
 | 
			
		||||
HAL_StatusTypeDef HAL_DMA_Start (DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength);
 | 
			
		||||
HAL_StatusTypeDef HAL_DMA_Start_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength);
 | 
			
		||||
HAL_StatusTypeDef HAL_DMA_Abort(DMA_HandleTypeDef *hdma);
 | 
			
		||||
HAL_StatusTypeDef HAL_DMA_Abort_IT(DMA_HandleTypeDef *hdma);
 | 
			
		||||
HAL_StatusTypeDef HAL_DMA_PollForTransfer(DMA_HandleTypeDef *hdma, uint32_t CompleteLevel, uint32_t Timeout);
 | 
			
		||||
void HAL_DMA_IRQHandler(DMA_HandleTypeDef *hdma);
 | 
			
		||||
HAL_StatusTypeDef HAL_DMA_RegisterCallback(DMA_HandleTypeDef *hdma, HAL_DMA_CallbackIDTypeDef CallbackID, void (* pCallback)( DMA_HandleTypeDef * _hdma));
 | 
			
		||||
HAL_StatusTypeDef HAL_DMA_UnRegisterCallback(DMA_HandleTypeDef *hdma, HAL_DMA_CallbackIDTypeDef CallbackID);
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup DMA_Exported_Functions_Group3 Peripheral State functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/* Peripheral State and Error functions ***************************************/
 | 
			
		||||
HAL_DMA_StateTypeDef HAL_DMA_GetState(DMA_HandleTypeDef *hdma);
 | 
			
		||||
uint32_t             HAL_DMA_GetError(DMA_HandleTypeDef *hdma);
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
/* Private macros ------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup DMA_Private_Macros DMA Private Macros
 | 
			
		||||
  * @brief    DMA private macros 
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#define IS_DMA_BUFFER_SIZE(SIZE) (((SIZE) >= 0x1U) && ((SIZE) < 0x10000U))
 | 
			
		||||
 | 
			
		||||
#define IS_DMA_DIRECTION(DIRECTION) (((DIRECTION) == DMA_PERIPH_TO_MEMORY ) || \
 | 
			
		||||
                                     ((DIRECTION) == DMA_MEMORY_TO_PERIPH)  || \
 | 
			
		||||
                                     ((DIRECTION) == DMA_MEMORY_TO_MEMORY)) 
 | 
			
		||||
 | 
			
		||||
#define IS_DMA_PERIPHERAL_INC_STATE(STATE) (((STATE) == DMA_PINC_ENABLE) || \
 | 
			
		||||
                                            ((STATE) == DMA_PINC_DISABLE))
 | 
			
		||||
											
 | 
			
		||||
#define IS_DMA_MEMORY_INC_STATE(STATE) (((STATE) == DMA_MINC_ENABLE)  || \
 | 
			
		||||
                                        ((STATE) == DMA_MINC_DISABLE))
 | 
			
		||||
 | 
			
		||||
#define IS_DMA_PERIPHERAL_DATA_SIZE(SIZE) (((SIZE) == DMA_PDATAALIGN_BYTE)     || \
 | 
			
		||||
                                           ((SIZE) == DMA_PDATAALIGN_HALFWORD) || \
 | 
			
		||||
                                           ((SIZE) == DMA_PDATAALIGN_WORD))
 | 
			
		||||
 | 
			
		||||
#define IS_DMA_MEMORY_DATA_SIZE(SIZE) (((SIZE) == DMA_MDATAALIGN_BYTE)     || \
 | 
			
		||||
                                       ((SIZE) == DMA_MDATAALIGN_HALFWORD) || \
 | 
			
		||||
                                       ((SIZE) == DMA_MDATAALIGN_WORD ))
 | 
			
		||||
 | 
			
		||||
#define IS_DMA_MODE(MODE) (((MODE) == DMA_NORMAL )  || \
 | 
			
		||||
                           ((MODE) == DMA_CIRCULAR)) 
 | 
			
		||||
 | 
			
		||||
#define IS_DMA_PRIORITY(PRIORITY) (((PRIORITY) == DMA_PRIORITY_LOW )   || \
 | 
			
		||||
                                   ((PRIORITY) == DMA_PRIORITY_MEDIUM) || \
 | 
			
		||||
                                   ((PRIORITY) == DMA_PRIORITY_HIGH)   || \
 | 
			
		||||
                                   ((PRIORITY) == DMA_PRIORITY_VERY_HIGH)) 
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */ 
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */ 
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* __STM32F3xx_HAL_DMA_H */
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,272 @@
 | 
			
		||||
/**
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @file    stm32f3xx_hal_dma_ex.h
 | 
			
		||||
  * @author  MCD Application Team
 | 
			
		||||
  * @brief   Header file of DMA HAL extension module.
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @attention
 | 
			
		||||
  *
 | 
			
		||||
  * Copyright (c) 2016 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 __STM32F3xx_HAL_DMA_EX_H
 | 
			
		||||
#define __STM32F3xx_HAL_DMA_EX_H
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
 extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Includes ------------------------------------------------------------------*/
 | 
			
		||||
#include "stm32f3xx_hal_def.h"
 | 
			
		||||
 | 
			
		||||
/** @addtogroup STM32F3xx_HAL_Driver
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup DMAEx
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
 | 
			
		||||
/* Exported types ------------------------------------------------------------*/ 
 | 
			
		||||
/* Exported constants --------------------------------------------------------*/
 | 
			
		||||
/* Exported macro ------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup DMAEx_Exported_Macros DMA Extended Exported Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/* Interrupt & Flag management */
 | 
			
		||||
 | 
			
		||||
#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \
 | 
			
		||||
    defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \
 | 
			
		||||
    defined(STM32F373xC) || defined(STM32F378xx)
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Returns the current DMA Channel transfer complete flag.
 | 
			
		||||
  * @param  __HANDLE__ DMA handle
 | 
			
		||||
  * @retval The specified transfer complete flag index.
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_DMA_GET_TC_FLAG_INDEX(__HANDLE__) \
 | 
			
		||||
(((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_TC1 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_TC2 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_TC3 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_TC4 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_FLAG_TC5 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_TC6 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel7))? DMA_FLAG_TC7 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel1))? DMA_FLAG_TC1 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel2))? DMA_FLAG_TC2 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel3))? DMA_FLAG_TC3 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel4))? DMA_FLAG_TC4 :\
 | 
			
		||||
   DMA_FLAG_TC5)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Returns the current DMA Channel half transfer complete flag.
 | 
			
		||||
  * @param  __HANDLE__ DMA handle
 | 
			
		||||
  * @retval The specified half transfer complete flag index.
 | 
			
		||||
  */      
 | 
			
		||||
#define __HAL_DMA_GET_HT_FLAG_INDEX(__HANDLE__)\
 | 
			
		||||
(((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_HT1 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_HT2 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_HT3 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_HT4 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_FLAG_HT5 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_HT6 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel7))? DMA_FLAG_HT7 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel1))? DMA_FLAG_HT1 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel2))? DMA_FLAG_HT2 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel3))? DMA_FLAG_HT3 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel4))? DMA_FLAG_HT4 :\
 | 
			
		||||
   DMA_FLAG_HT5)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Returns the current DMA Channel transfer error flag.
 | 
			
		||||
  * @param  __HANDLE__ DMA handle
 | 
			
		||||
  * @retval The specified transfer error flag index.
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_DMA_GET_TE_FLAG_INDEX(__HANDLE__)\
 | 
			
		||||
(((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_TE1 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_TE2 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_TE3 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_TE4 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_FLAG_TE5 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_TE6 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel7))? DMA_FLAG_TE7 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel1))? DMA_FLAG_TE1 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel2))? DMA_FLAG_TE2 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel3))? DMA_FLAG_TE3 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel4))? DMA_FLAG_TE4 :\
 | 
			
		||||
   DMA_FLAG_TE5)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Return the current DMA Channel Global interrupt flag.
 | 
			
		||||
  * @param  __HANDLE__ DMA handle
 | 
			
		||||
  * @retval The specified transfer error flag index.
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_DMA_GET_GI_FLAG_INDEX(__HANDLE__)\
 | 
			
		||||
(((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_GL1 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_GL2 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_GL3 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_GL4 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_FLAG_GL5 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_GL6 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel7))? DMA_FLAG_GL7 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel1))? DMA_FLAG_GL1 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel2))? DMA_FLAG_GL2 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel3))? DMA_FLAG_GL3 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel4))? DMA_FLAG_GL4 :\
 | 
			
		||||
   DMA_FLAG_GL5)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Get the DMA Channel pending flags.
 | 
			
		||||
  * @param  __HANDLE__ DMA handle
 | 
			
		||||
  * @param  __FLAG__ Get the specified flag.
 | 
			
		||||
  *          This parameter can be any combination of the following values:
 | 
			
		||||
  *            @arg DMA_FLAG_TCx:  Transfer complete flag
 | 
			
		||||
  *            @arg DMA_FLAG_HTx:  Half transfer complete flag
 | 
			
		||||
  *            @arg DMA_FLAG_TEx:  Transfer error flag
 | 
			
		||||
  *         Where x can be 1_7 or 1_5 (depending on DMA1 or DMA2) to select the DMA Channel flag.   
 | 
			
		||||
  * @retval The state of FLAG (SET or RESET).
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_DMA_GET_FLAG(__HANDLE__, __FLAG__)\
 | 
			
		||||
(((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Channel7)? (DMA2->ISR & (__FLAG__)) :\
 | 
			
		||||
  (DMA1->ISR & (__FLAG__)))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Clears the DMA Channel pending flags.
 | 
			
		||||
  * @param  __HANDLE__ DMA handle
 | 
			
		||||
  * @param  __FLAG__ specifies the flag to clear.
 | 
			
		||||
  *          This parameter can be any combination of the following values:
 | 
			
		||||
  *            @arg DMA_FLAG_TCx:  Transfer complete flag
 | 
			
		||||
  *            @arg DMA_FLAG_HTx:  Half transfer complete flag
 | 
			
		||||
  *            @arg DMA_FLAG_TEx:  Transfer error flag
 | 
			
		||||
  *         Where x can be 1_7 or 1_5 (depending on DMA1 or DMA2) to select the DMA Channel flag.   
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_DMA_CLEAR_FLAG(__HANDLE__, __FLAG__) \
 | 
			
		||||
(((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Channel7)? (DMA2->IFCR = (__FLAG__)) :\
 | 
			
		||||
  (DMA1->IFCR = (__FLAG__)))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#else /* STM32F301x8_STM32F302x8_STM32F318xx_STM32F303x8_STM32F334x8_STM32F328xx Product devices */
 | 
			
		||||
/** @defgroup DMA_Low_density_Medium_density_Product_devices DMA Low density and Medium density product devices
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Returns the current DMA Channel transfer complete flag.
 | 
			
		||||
  * @param  __HANDLE__ DMA handle
 | 
			
		||||
  * @retval The specified transfer complete flag index.
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_DMA_GET_TC_FLAG_INDEX(__HANDLE__) \
 | 
			
		||||
(((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_TC1 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_TC2 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_TC3 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_TC4 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_FLAG_TC5 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_TC6 :\
 | 
			
		||||
   DMA_FLAG_TC7)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Returns the current DMA Channel half transfer complete flag.
 | 
			
		||||
  * @param  __HANDLE__ DMA handle
 | 
			
		||||
  * @retval The specified half transfer complete flag index.
 | 
			
		||||
  */      
 | 
			
		||||
#define __HAL_DMA_GET_HT_FLAG_INDEX(__HANDLE__)\
 | 
			
		||||
(((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_HT1 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_HT2 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_HT3 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_HT4 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_FLAG_HT5 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_HT6 :\
 | 
			
		||||
   DMA_FLAG_HT7)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Returns the current DMA Channel transfer error flag.
 | 
			
		||||
  * @param  __HANDLE__ DMA handle
 | 
			
		||||
  * @retval The specified transfer error flag index.
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_DMA_GET_TE_FLAG_INDEX(__HANDLE__)\
 | 
			
		||||
(((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_TE1 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_TE2 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_TE3 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_TE4 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_FLAG_TE5 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_TE6 :\
 | 
			
		||||
   DMA_FLAG_TE7)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Return the current DMA Channel Global interrupt flag.
 | 
			
		||||
  * @param  __HANDLE__ DMA handle
 | 
			
		||||
  * @retval The specified transfer error flag index.
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_DMA_GET_GI_FLAG_INDEX(__HANDLE__)\
 | 
			
		||||
(((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_GL1 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_GL2 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_GL3 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_GL4 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_FLAG_GL5 :\
 | 
			
		||||
 ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_GL6 :\
 | 
			
		||||
   DMA_FLAG_GL7)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Get the DMA Channel pending flags.
 | 
			
		||||
  * @param  __HANDLE__ DMA handle
 | 
			
		||||
  * @param  __FLAG__ Get the specified flag.
 | 
			
		||||
  *          This parameter can be any combination of the following values:
 | 
			
		||||
  *            @arg DMA_FLAG_TCx:  Transfer complete flag
 | 
			
		||||
  *            @arg DMA_FLAG_HTx:  Half transfer complete flag
 | 
			
		||||
  *            @arg DMA_FLAG_TEx:  Transfer error flag
 | 
			
		||||
  *         Where x can be 1_7 to select the DMA Channel flag.   
 | 
			
		||||
  * @retval The state of FLAG (SET or RESET).
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#define __HAL_DMA_GET_FLAG(__HANDLE__, __FLAG__)   (DMA1->ISR & (__FLAG__))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Clears the DMA Channel pending flags.
 | 
			
		||||
  * @param  __HANDLE__ DMA handle
 | 
			
		||||
  * @param  __FLAG__ specifies the flag to clear.
 | 
			
		||||
  *          This parameter can be any combination of the following values:
 | 
			
		||||
  *            @arg DMA_FLAG_TCx:  Transfer complete flag
 | 
			
		||||
  *            @arg DMA_FLAG_HTx:  Half transfer complete flag
 | 
			
		||||
  *            @arg DMA_FLAG_TEx:  Transfer error flag
 | 
			
		||||
  *         Where x can be 1_7 to select the DMA Channel flag.   
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_DMA_CLEAR_FLAG(__HANDLE__, __FLAG__) (DMA1->IFCR = (__FLAG__))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
  
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */ 
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */
 | 
			
		||||
       /* STM32F302xC || STM32F303xC || STM32F358xx || */
 | 
			
		||||
       /* STM32F373xC || STM32F378xx                   */
 | 
			
		||||
 | 
			
		||||
#endif /* __STM32F3xx_HAL_DMA_H */
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,402 @@
 | 
			
		||||
/**
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @file    stm32f3xx_hal_exti.h
 | 
			
		||||
  * @author  MCD Application Team
 | 
			
		||||
  * @brief   Header file of EXTI HAL module.
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @attention
 | 
			
		||||
  *
 | 
			
		||||
  * Copyright (c) 2019 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 STM32F3xx_HAL_EXTI_H
 | 
			
		||||
#define STM32F3xx_HAL_EXTI_H
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Includes ------------------------------------------------------------------*/
 | 
			
		||||
#include "stm32f3xx_hal_def.h"
 | 
			
		||||
 | 
			
		||||
/** @addtogroup STM32F3xx_HAL_Driver
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup EXTI EXTI
 | 
			
		||||
  * @brief EXTI HAL module driver
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported types ------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/** @defgroup EXTI_Exported_Types EXTI Exported Types
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  HAL EXTI common Callback ID enumeration definition
 | 
			
		||||
  */
 | 
			
		||||
typedef enum
 | 
			
		||||
{
 | 
			
		||||
  HAL_EXTI_COMMON_CB_ID          = 0x00U
 | 
			
		||||
} EXTI_CallbackIDTypeDef;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  EXTI Handle structure definition
 | 
			
		||||
  */
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
  uint32_t Line;                    /*!<  Exti line number */
 | 
			
		||||
  void (* PendingCallback)(void);   /*!<  Exti pending callback */
 | 
			
		||||
} EXTI_HandleTypeDef;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  EXTI Configuration structure definition
 | 
			
		||||
  */
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
  uint32_t Line;      /*!< The Exti line to be configured. This parameter
 | 
			
		||||
                           can be a value of @ref EXTI_Line */
 | 
			
		||||
  uint32_t Mode;      /*!< The Exit Mode to be configured for a core.
 | 
			
		||||
                           This parameter can be a combination of @ref EXTI_Mode */
 | 
			
		||||
  uint32_t Trigger;   /*!< The Exti Trigger to be configured. This parameter
 | 
			
		||||
                           can be a value of @ref EXTI_Trigger */
 | 
			
		||||
  uint32_t GPIOSel;   /*!< The Exti GPIO multiplexer selection to be configured.
 | 
			
		||||
                           This parameter is only possible for line 0 to 15. It
 | 
			
		||||
                           can be a value of @ref EXTI_GPIOSel */
 | 
			
		||||
} EXTI_ConfigTypeDef;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported constants --------------------------------------------------------*/
 | 
			
		||||
/** @defgroup EXTI_Exported_Constants EXTI Exported Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup EXTI_Line  EXTI Line
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define EXTI_LINE_0                        (EXTI_GPIO        | EXTI_REG1 | 0x00u)    /*!< External interrupt line 0 */
 | 
			
		||||
#define EXTI_LINE_1                        (EXTI_GPIO        | EXTI_REG1 | 0x01u)    /*!< External interrupt line 1 */
 | 
			
		||||
#define EXTI_LINE_2                        (EXTI_GPIO        | EXTI_REG1 | 0x02u)    /*!< External interrupt line 2 */
 | 
			
		||||
#define EXTI_LINE_3                        (EXTI_GPIO        | EXTI_REG1 | 0x03u)    /*!< External interrupt line 3 */
 | 
			
		||||
#define EXTI_LINE_4                        (EXTI_GPIO        | EXTI_REG1 | 0x04u)    /*!< External interrupt line 4 */
 | 
			
		||||
#define EXTI_LINE_5                        (EXTI_GPIO        | EXTI_REG1 | 0x05u)    /*!< External interrupt line 5 */
 | 
			
		||||
#define EXTI_LINE_6                        (EXTI_GPIO        | EXTI_REG1 | 0x06u)    /*!< External interrupt line 6 */
 | 
			
		||||
#define EXTI_LINE_7                        (EXTI_GPIO        | EXTI_REG1 | 0x07u)    /*!< External interrupt line 7 */
 | 
			
		||||
#define EXTI_LINE_8                        (EXTI_GPIO        | EXTI_REG1 | 0x08u)    /*!< External interrupt line 8 */
 | 
			
		||||
#define EXTI_LINE_9                        (EXTI_GPIO        | EXTI_REG1 | 0x09u)    /*!< External interrupt line 9 */
 | 
			
		||||
#define EXTI_LINE_10                       (EXTI_GPIO        | EXTI_REG1 | 0x0Au)    /*!< External interrupt line 10 */
 | 
			
		||||
#define EXTI_LINE_11                       (EXTI_GPIO        | EXTI_REG1 | 0x0Bu)    /*!< External interrupt line 11 */
 | 
			
		||||
#define EXTI_LINE_12                       (EXTI_GPIO        | EXTI_REG1 | 0x0Cu)    /*!< External interrupt line 12 */
 | 
			
		||||
#define EXTI_LINE_13                       (EXTI_GPIO        | EXTI_REG1 | 0x0Du)    /*!< External interrupt line 13 */
 | 
			
		||||
#define EXTI_LINE_14                       (EXTI_GPIO        | EXTI_REG1 | 0x0Eu)    /*!< External interrupt line 14 */
 | 
			
		||||
#define EXTI_LINE_15                       (EXTI_GPIO        | EXTI_REG1 | 0x0Fu)    /*!< External interrupt line 15 */
 | 
			
		||||
#define EXTI_LINE_16                       (EXTI_CONFIG      | EXTI_REG1 | 0x10u)    /*!< External interrupt line 16 Connected to the PVD Output */
 | 
			
		||||
#define EXTI_LINE_17                       (EXTI_CONFIG      | EXTI_REG1 | 0x11u)    /*!< External interrupt line 17 Connected to the RTC Alarm event */
 | 
			
		||||
 | 
			
		||||
#if defined(EXTI_IMR_MR18)
 | 
			
		||||
#define EXTI_LINE_18                       (EXTI_CONFIG      | EXTI_REG1 | 0x12u)    /*!< External interrupt line 18 Connected to the USB OTG FS Wakeup from suspend event */
 | 
			
		||||
#else
 | 
			
		||||
#define EXTI_LINE_18                       (EXTI_RESERVED    | EXTI_REG1 | 0x12u)
 | 
			
		||||
#endif /* EXTI_IMR_MR18 */
 | 
			
		||||
 | 
			
		||||
#define EXTI_LINE_19                       (EXTI_CONFIG      | EXTI_REG1 | 0x13u)    /*!< External interrupt line 19 Connected to the RTC tamper and Timestamps */
 | 
			
		||||
#define EXTI_LINE_20                       (EXTI_CONFIG      | EXTI_REG1 | 0x14u)    /*!< External interrupt line 20 Connected to the RTC wakeup timer  */
 | 
			
		||||
 | 
			
		||||
#if defined(EXTI_IMR_MR21)
 | 
			
		||||
#define EXTI_LINE_21                       (EXTI_CONFIG      | EXTI_REG1 | 0x15u)    /*!< External interrupt line 21 Connected to the Comparator 1 output */
 | 
			
		||||
#else
 | 
			
		||||
#define EXTI_LINE_21                       (EXTI_RESERVED    | EXTI_REG1 | 0x15u)
 | 
			
		||||
#endif /* EXTI_IMR_MR21 */
 | 
			
		||||
 | 
			
		||||
#define EXTI_LINE_22                       (EXTI_CONFIG      | EXTI_REG1 | 0x16u)    /*!< External interrupt line 22 Connected to the Comparator 2 output */
 | 
			
		||||
#define EXTI_LINE_23                       (EXTI_DIRECT      | EXTI_REG1 | 0x17u)    /*!< External interrupt line 23 Connected to the internal I2C1 wakeup event  */
 | 
			
		||||
 | 
			
		||||
#if defined(EXTI_IMR_MR24)
 | 
			
		||||
#define EXTI_LINE_24                       (EXTI_DIRECT      | EXTI_REG1 | 0x18u)    /*!< External interrupt line 24 Connected to the internal I2C2 wakeup event  */
 | 
			
		||||
#else
 | 
			
		||||
#define EXTI_LINE_24                       (EXTI_RESERVED    | EXTI_REG1 | 0x18u)
 | 
			
		||||
#endif /* EXTI_IMR_MR24 */
 | 
			
		||||
 | 
			
		||||
#define EXTI_LINE_25                       (EXTI_DIRECT      | EXTI_REG1 | 0x19u)    /*!< External interrupt line 25 Connected to the internal USART1 wakeup event  */
 | 
			
		||||
 | 
			
		||||
#if defined(EXTI_IMR_MR26)
 | 
			
		||||
#define EXTI_LINE_26                       (EXTI_DIRECT      | EXTI_REG1 | 0x1Au)    /*!< External interrupt line 26 Connected to the internal USART2 wakeup event  */
 | 
			
		||||
#else
 | 
			
		||||
#define EXTI_LINE_26                       (EXTI_RESERVED    | EXTI_REG1 | 0x1Au)
 | 
			
		||||
#endif /* EXTI_IMR_MR26 */
 | 
			
		||||
 | 
			
		||||
#if defined(EXTI_IMR_MR27)
 | 
			
		||||
#define EXTI_LINE_27                       (EXTI_DIRECT      | EXTI_REG1 | 0x1Bu)    /*!< External interrupt line 27 Connected to the internal I2C3 wakeup event  */
 | 
			
		||||
#else
 | 
			
		||||
#define EXTI_LINE_27                       (EXTI_RESERVED    | EXTI_REG1 | 0x1Bu)
 | 
			
		||||
#endif /* EXTI_IMR_MR27 */
 | 
			
		||||
 | 
			
		||||
#if defined(EXTI_IMR_MR28)
 | 
			
		||||
#define EXTI_LINE_28                       (EXTI_DIRECT      | EXTI_REG1 | 0x1Cu)    /*!< External interrupt line 28 Connected to the  internal USART3 wakeup event   */
 | 
			
		||||
#else
 | 
			
		||||
#define EXTI_LINE_28                       (EXTI_RESERVED    | EXTI_REG1 | 0x1Cu)
 | 
			
		||||
#endif /* EXTI_IMR_MR28 */
 | 
			
		||||
 | 
			
		||||
#if defined(EXTI_32_63_SUPPORT)
 | 
			
		||||
 | 
			
		||||
#if defined(EXTI_IMR_MR29)
 | 
			
		||||
#define EXTI_LINE_29                       (EXTI_CONFIG      | EXTI_REG1 | 0x1Du)    /*!< External interrupt line 29 Connected to the Comparator 3 output */
 | 
			
		||||
#else
 | 
			
		||||
#define EXTI_LINE_29                       (EXTI_RESERVED    | EXTI_REG1 | 0x1Cu)
 | 
			
		||||
#endif /* EXTI_IMR_MR29 */
 | 
			
		||||
 | 
			
		||||
#if defined(EXTI_IMR_MR30)
 | 
			
		||||
#define EXTI_LINE_30                       (EXTI_CONFIG      | EXTI_REG1 | 0x1Eu)    /*!< External interrupt line 30 Connected to the Comparator 4 output */
 | 
			
		||||
#else
 | 
			
		||||
#define EXTI_LINE_30                       (EXTI_RESERVED    | EXTI_REG1 | 0x1Eu)
 | 
			
		||||
#endif /* EXTI_IMR_MR30 */
 | 
			
		||||
 | 
			
		||||
#if defined(EXTI_IMR_MR31)
 | 
			
		||||
#define EXTI_LINE_31                       (EXTI_CONFIG      | EXTI_REG1 | 0x1Fu)    /*!< External interrupt line 31 Connected to the Comparator 5 output */
 | 
			
		||||
#else
 | 
			
		||||
#define EXTI_LINE_31                       (EXTI_RESERVED    | EXTI_REG1 | 0x1Fu)
 | 
			
		||||
#endif /* EXTI_IMR_MR31 */
 | 
			
		||||
 | 
			
		||||
#define EXTI_LINE_32                       (EXTI_CONFIG      | EXTI_REG2 | 0x00u)    /*!< External interrupt line 32 Connected to the  Comparator 6 output  */
 | 
			
		||||
 | 
			
		||||
#if defined(EXTI_IMR2_MR33)
 | 
			
		||||
#define EXTI_LINE_33                       (EXTI_CONFIG      | EXTI_REG2 | 0x01u)    /*!< External interrupt line 33 Connected to the  Comparator 7 output  */
 | 
			
		||||
#else
 | 
			
		||||
#define EXTI_LINE_33                       (EXTI_RESERVED    | EXTI_REG2 | 0x01u)
 | 
			
		||||
#endif /* EXTI_IMR2_MR33 */
 | 
			
		||||
 | 
			
		||||
#if defined(EXTI_IMR2_MR34)
 | 
			
		||||
#define EXTI_LINE_34                       (EXTI_DIRECT      | EXTI_REG2 | 0x02u)    /*!< External interrupt line 34 Connected to the  USART4 output  */
 | 
			
		||||
#else
 | 
			
		||||
#define EXTI_LINE_34                       (EXTI_RESERVED    | EXTI_REG2 | 0x02u)
 | 
			
		||||
#endif /* EXTI_IMR2_MR34 */
 | 
			
		||||
 | 
			
		||||
#if defined(EXTI_IMR2_MR35)
 | 
			
		||||
#define EXTI_LINE_35                       (EXTI_DIRECT      | EXTI_REG2 | 0x03u)    /*!< External interrupt line 35 Connected to the  USART5 output  */
 | 
			
		||||
#else
 | 
			
		||||
#define EXTI_LINE_35                       (EXTI_RESERVED    | EXTI_REG2 | 0x03u)
 | 
			
		||||
#endif /* EXTI_IMR2_MR35 */
 | 
			
		||||
 | 
			
		||||
#endif /* EXTI_32_63_SUPPORT */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup EXTI_Mode  EXTI Mode
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define EXTI_MODE_NONE                      0x00000000u
 | 
			
		||||
#define EXTI_MODE_INTERRUPT                 0x00000001u
 | 
			
		||||
#define EXTI_MODE_EVENT                     0x00000002u
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup EXTI_Trigger  EXTI Trigger
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define EXTI_TRIGGER_NONE                   0x00000000u
 | 
			
		||||
#define EXTI_TRIGGER_RISING                 0x00000001u
 | 
			
		||||
#define EXTI_TRIGGER_FALLING                0x00000002u
 | 
			
		||||
#define EXTI_TRIGGER_RISING_FALLING         (EXTI_TRIGGER_RISING | EXTI_TRIGGER_FALLING)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup EXTI_GPIOSel  EXTI GPIOSel
 | 
			
		||||
  * @brief
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define EXTI_GPIOA                          0x00000000u
 | 
			
		||||
#define EXTI_GPIOB                          0x00000001u
 | 
			
		||||
#define EXTI_GPIOC                          0x00000002u
 | 
			
		||||
#define EXTI_GPIOD                          0x00000003u
 | 
			
		||||
#if defined(GPIOE)
 | 
			
		||||
#define EXTI_GPIOE                          0x00000004u
 | 
			
		||||
#endif /* GPIOE */
 | 
			
		||||
#define EXTI_GPIOF                          0x00000005u
 | 
			
		||||
#if defined(GPIOG)
 | 
			
		||||
#define EXTI_GPIOG                          0x00000006u
 | 
			
		||||
#endif /* GPIOG */
 | 
			
		||||
#if defined(GPIOH)
 | 
			
		||||
#define EXTI_GPIOH                          0x00000007u
 | 
			
		||||
#endif /* GPIOH */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported macro ------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup EXTI_Exported_Macros EXTI Exported Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Private constants --------------------------------------------------------*/
 | 
			
		||||
/** @defgroup EXTI_Private_Constants EXTI Private Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  EXTI Line property definition
 | 
			
		||||
  */
 | 
			
		||||
#define EXTI_PROPERTY_SHIFT                 24u
 | 
			
		||||
#define EXTI_DIRECT                         (0x01uL << EXTI_PROPERTY_SHIFT)
 | 
			
		||||
#define EXTI_CONFIG                         (0x02uL << EXTI_PROPERTY_SHIFT)
 | 
			
		||||
#define EXTI_GPIO                           ((0x04uL << EXTI_PROPERTY_SHIFT) | EXTI_CONFIG)
 | 
			
		||||
#define EXTI_RESERVED                       (0x08uL << EXTI_PROPERTY_SHIFT)
 | 
			
		||||
#define EXTI_PROPERTY_MASK                  (EXTI_DIRECT | EXTI_CONFIG | EXTI_GPIO)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  EXTI Register and bit usage
 | 
			
		||||
  */
 | 
			
		||||
#define EXTI_REG_SHIFT                      16u
 | 
			
		||||
#define EXTI_REG1                           (0x00uL << EXTI_REG_SHIFT)
 | 
			
		||||
#define EXTI_REG2                           (0x01uL << EXTI_REG_SHIFT)
 | 
			
		||||
#define EXTI_REG_MASK                       (EXTI_REG1 | EXTI_REG2)
 | 
			
		||||
#define EXTI_PIN_MASK                       0x0000001Fu
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  EXTI Mask for interrupt & event mode
 | 
			
		||||
  */
 | 
			
		||||
#define EXTI_MODE_MASK                      (EXTI_MODE_EVENT | EXTI_MODE_INTERRUPT)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  EXTI Mask for trigger possibilities
 | 
			
		||||
  */
 | 
			
		||||
#define EXTI_TRIGGER_MASK                   (EXTI_TRIGGER_RISING | EXTI_TRIGGER_FALLING)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  EXTI Line number
 | 
			
		||||
  */
 | 
			
		||||
#if defined(EXTI_32_63_SUPPORT)
 | 
			
		||||
#define EXTI_LINE_NB                        36uL
 | 
			
		||||
#else
 | 
			
		||||
#define EXTI_LINE_NB                        29uL
 | 
			
		||||
#endif /* EXTI_32_63_SUPPORT */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Private macros ------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup EXTI_Private_Macros EXTI Private Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define IS_EXTI_LINE(__EXTI_LINE__)          ((((__EXTI_LINE__) & ~(EXTI_PROPERTY_MASK | EXTI_REG_MASK | EXTI_PIN_MASK)) == 0x00u) && \
 | 
			
		||||
                                             ((((__EXTI_LINE__) & EXTI_PROPERTY_MASK) == EXTI_DIRECT)   || \
 | 
			
		||||
                                              (((__EXTI_LINE__) & EXTI_PROPERTY_MASK) == EXTI_CONFIG)   || \
 | 
			
		||||
                                              (((__EXTI_LINE__) & EXTI_PROPERTY_MASK) == EXTI_GPIO))    && \
 | 
			
		||||
                                              (((__EXTI_LINE__) & (EXTI_REG_MASK | EXTI_PIN_MASK))      < \
 | 
			
		||||
                                              (((EXTI_LINE_NB / 32u) << EXTI_REG_SHIFT) | (EXTI_LINE_NB % 32u))))
 | 
			
		||||
 | 
			
		||||
#define IS_EXTI_MODE(__EXTI_LINE__)          ((((__EXTI_LINE__) & EXTI_MODE_MASK) != 0x00u) && \
 | 
			
		||||
                                              (((__EXTI_LINE__) & ~EXTI_MODE_MASK) == 0x00u))
 | 
			
		||||
 | 
			
		||||
#define IS_EXTI_TRIGGER(__EXTI_LINE__)       (((__EXTI_LINE__) & ~EXTI_TRIGGER_MASK) == 0x00u)
 | 
			
		||||
 | 
			
		||||
#define IS_EXTI_PENDING_EDGE(__EXTI_LINE__)  ((__EXTI_LINE__) == EXTI_TRIGGER_RISING_FALLING)
 | 
			
		||||
 | 
			
		||||
#define IS_EXTI_CONFIG_LINE(__EXTI_LINE__)   (((__EXTI_LINE__) & EXTI_CONFIG) != 0x00u)
 | 
			
		||||
 | 
			
		||||
#if defined(GPIOH)
 | 
			
		||||
#define IS_EXTI_GPIO_PORT(__PORT__)     (((__PORT__) == EXTI_GPIOA) || \
 | 
			
		||||
                                         ((__PORT__) == EXTI_GPIOB) || \
 | 
			
		||||
                                         ((__PORT__) == EXTI_GPIOC) || \
 | 
			
		||||
                                         ((__PORT__) == EXTI_GPIOD) || \
 | 
			
		||||
                                         ((__PORT__) == EXTI_GPIOE) || \
 | 
			
		||||
                                         ((__PORT__) == EXTI_GPIOF) || \
 | 
			
		||||
                                         ((__PORT__) == EXTI_GPIOG) || \
 | 
			
		||||
                                         ((__PORT__) == EXTI_GPIOH))
 | 
			
		||||
#elif defined(GPIOE)
 | 
			
		||||
#define IS_EXTI_GPIO_PORT(__PORT__)     (((__PORT__) == EXTI_GPIOA) || \
 | 
			
		||||
                                         ((__PORT__) == EXTI_GPIOB) || \
 | 
			
		||||
                                         ((__PORT__) == EXTI_GPIOC) || \
 | 
			
		||||
                                         ((__PORT__) == EXTI_GPIOD) || \
 | 
			
		||||
                                         ((__PORT__) == EXTI_GPIOE) || \
 | 
			
		||||
                                         ((__PORT__) == EXTI_GPIOF))
 | 
			
		||||
#else
 | 
			
		||||
#define IS_EXTI_GPIO_PORT(__PORT__)     (((__PORT__) == EXTI_GPIOA) || \
 | 
			
		||||
                                         ((__PORT__) == EXTI_GPIOB) || \
 | 
			
		||||
                                         ((__PORT__) == EXTI_GPIOC) || \
 | 
			
		||||
                                         ((__PORT__) == EXTI_GPIOD) || \
 | 
			
		||||
                                         ((__PORT__) == EXTI_GPIOF))
 | 
			
		||||
#endif /* GPIOE */
 | 
			
		||||
 | 
			
		||||
#define IS_EXTI_GPIO_PIN(__PIN__)       ((__PIN__) < 16u)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Exported functions --------------------------------------------------------*/
 | 
			
		||||
/** @defgroup EXTI_Exported_Functions EXTI Exported Functions
 | 
			
		||||
  * @brief    EXTI Exported Functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup EXTI_Exported_Functions_Group1 Configuration functions
 | 
			
		||||
  * @brief    Configuration functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/* Configuration functions ****************************************************/
 | 
			
		||||
HAL_StatusTypeDef HAL_EXTI_SetConfigLine(EXTI_HandleTypeDef *hexti, EXTI_ConfigTypeDef *pExtiConfig);
 | 
			
		||||
HAL_StatusTypeDef HAL_EXTI_GetConfigLine(EXTI_HandleTypeDef *hexti, EXTI_ConfigTypeDef *pExtiConfig);
 | 
			
		||||
HAL_StatusTypeDef HAL_EXTI_ClearConfigLine(EXTI_HandleTypeDef *hexti);
 | 
			
		||||
HAL_StatusTypeDef HAL_EXTI_RegisterCallback(EXTI_HandleTypeDef *hexti, EXTI_CallbackIDTypeDef CallbackID, void (*pPendingCbfn)(void));
 | 
			
		||||
HAL_StatusTypeDef HAL_EXTI_GetHandle(EXTI_HandleTypeDef *hexti, uint32_t ExtiLine);
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup EXTI_Exported_Functions_Group2 IO operation functions
 | 
			
		||||
  * @brief    IO operation functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/* IO operation functions *****************************************************/
 | 
			
		||||
void              HAL_EXTI_IRQHandler(EXTI_HandleTypeDef *hexti);
 | 
			
		||||
uint32_t          HAL_EXTI_GetPending(EXTI_HandleTypeDef *hexti, uint32_t Edge);
 | 
			
		||||
void              HAL_EXTI_ClearPending(EXTI_HandleTypeDef *hexti, uint32_t Edge);
 | 
			
		||||
void              HAL_EXTI_GenerateSWI(EXTI_HandleTypeDef *hexti);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* STM32F3xx_HAL_EXTI_H */
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,378 @@
 | 
			
		||||
/**
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @file    stm32f3xx_hal_flash.h
 | 
			
		||||
  * @author  MCD Application Team
 | 
			
		||||
  * @brief   Header file of Flash HAL module.
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @attention
 | 
			
		||||
  *
 | 
			
		||||
  * Copyright (c) 2016 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 __STM32F3xx_HAL_FLASH_H
 | 
			
		||||
#define __STM32F3xx_HAL_FLASH_H
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
 extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Includes ------------------------------------------------------------------*/
 | 
			
		||||
#include "stm32f3xx_hal_def.h"
 | 
			
		||||
   
 | 
			
		||||
/** @addtogroup STM32F3xx_HAL_Driver
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup FLASH
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
  
 | 
			
		||||
/** @addtogroup FLASH_Private_Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define FLASH_TIMEOUT_VALUE      (50000U) /* 50 s */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup FLASH_Private_Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#define IS_FLASH_TYPEPROGRAM(VALUE)  (((VALUE) == FLASH_TYPEPROGRAM_HALFWORD) || \
 | 
			
		||||
                                      ((VALUE) == FLASH_TYPEPROGRAM_WORD)     || \
 | 
			
		||||
                                      ((VALUE) == FLASH_TYPEPROGRAM_DOUBLEWORD))  
 | 
			
		||||
 | 
			
		||||
#define IS_FLASH_LATENCY(__LATENCY__) (((__LATENCY__) == FLASH_LATENCY_0) || \
 | 
			
		||||
                                       ((__LATENCY__) == FLASH_LATENCY_1) || \
 | 
			
		||||
                                       ((__LATENCY__) == FLASH_LATENCY_2))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */  
 | 
			
		||||
 | 
			
		||||
/* Exported types ------------------------------------------------------------*/ 
 | 
			
		||||
/** @defgroup FLASH_Exported_Types FLASH Exported Types
 | 
			
		||||
  * @{
 | 
			
		||||
  */  
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  FLASH Procedure structure definition
 | 
			
		||||
  */
 | 
			
		||||
typedef enum 
 | 
			
		||||
{
 | 
			
		||||
  FLASH_PROC_NONE              = 0U, 
 | 
			
		||||
  FLASH_PROC_PAGEERASE         = 1U,
 | 
			
		||||
  FLASH_PROC_MASSERASE         = 2U,
 | 
			
		||||
  FLASH_PROC_PROGRAMHALFWORD   = 3U,
 | 
			
		||||
  FLASH_PROC_PROGRAMWORD       = 4U,
 | 
			
		||||
  FLASH_PROC_PROGRAMDOUBLEWORD = 5U
 | 
			
		||||
} FLASH_ProcedureTypeDef;
 | 
			
		||||
 | 
			
		||||
/** 
 | 
			
		||||
  * @brief  FLASH handle Structure definition  
 | 
			
		||||
  */
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
  __IO FLASH_ProcedureTypeDef ProcedureOnGoing; /*!< Internal variable to indicate which procedure is ongoing or not in IT context */
 | 
			
		||||
  
 | 
			
		||||
  __IO uint32_t               DataRemaining;    /*!< Internal variable to save the remaining pages to erase or half-word to program in IT context */
 | 
			
		||||
 | 
			
		||||
  __IO uint32_t               Address;          /*!< Internal variable to save address selected for program or erase */
 | 
			
		||||
 | 
			
		||||
  __IO uint64_t               Data;             /*!< Internal variable to save data to be programmed */
 | 
			
		||||
 | 
			
		||||
  HAL_LockTypeDef             Lock;             /*!< FLASH locking object                */
 | 
			
		||||
 | 
			
		||||
  __IO uint32_t               ErrorCode;        /*!< FLASH error code                    
 | 
			
		||||
                                                     This parameter can be a value of @ref FLASH_Error_Codes  */
 | 
			
		||||
} FLASH_ProcessTypeDef;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported constants --------------------------------------------------------*/
 | 
			
		||||
/** @defgroup FLASH_Exported_Constants FLASH Exported Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */  
 | 
			
		||||
 | 
			
		||||
/** @defgroup FLASH_Error_Codes FLASH Error Codes
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#define HAL_FLASH_ERROR_NONE      0x00U  /*!< No error */
 | 
			
		||||
#define HAL_FLASH_ERROR_PROG      0x01U  /*!< Programming error */
 | 
			
		||||
#define HAL_FLASH_ERROR_WRP       0x02U  /*!< Write protection error */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup FLASH_Type_Program FLASH Type Program
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
#define FLASH_TYPEPROGRAM_HALFWORD   (0x01U)  /*!<Program a half-word (16-bit) at a specified address.*/
 | 
			
		||||
#define FLASH_TYPEPROGRAM_WORD       (0x02U)  /*!<Program a word (32-bit) at a specified address.*/
 | 
			
		||||
#define FLASH_TYPEPROGRAM_DOUBLEWORD (0x03U)  /*!<Program a double word (64-bit) at a specified address*/
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup FLASH_Latency FLASH Latency
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define FLASH_LATENCY_0            (0x00000000U)    /*!< FLASH Zero Latency cycle */
 | 
			
		||||
#define FLASH_LATENCY_1            FLASH_ACR_LATENCY_0       /*!< FLASH One Latency cycle */
 | 
			
		||||
#define FLASH_LATENCY_2            FLASH_ACR_LATENCY_1       /*!< FLASH Two Latency cycles */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/** @defgroup FLASH_Flag_definition FLASH Flag definition
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
#define FLASH_FLAG_BSY             FLASH_SR_BSY            /*!< FLASH Busy flag                           */ 
 | 
			
		||||
#define FLASH_FLAG_PGERR           FLASH_SR_PGERR          /*!< FLASH Programming error flag    */
 | 
			
		||||
#define FLASH_FLAG_WRPERR          FLASH_SR_WRPERR         /*!< FLASH Write protected error flag          */
 | 
			
		||||
#define FLASH_FLAG_EOP             FLASH_SR_EOP            /*!< FLASH End of Operation flag               */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
  
 | 
			
		||||
/** @defgroup FLASH_Interrupt_definition FLASH Interrupt definition
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
#define FLASH_IT_EOP               FLASH_CR_EOPIE          /*!< End of FLASH Operation Interrupt source */
 | 
			
		||||
#define FLASH_IT_ERR               FLASH_CR_ERRIE  /*!< Error Interrupt source */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */  
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */  
 | 
			
		||||
  
 | 
			
		||||
/* Exported macro ------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/** @defgroup FLASH_Exported_Macros FLASH Exported Macros
 | 
			
		||||
 *  @brief macros to control FLASH features 
 | 
			
		||||
 *  @{
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
/** @defgroup FLASH_Half_Cycle FLASH Half Cycle
 | 
			
		||||
 *  @brief macros to handle FLASH half cycle
 | 
			
		||||
 * @{
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Enable the FLASH half cycle access.
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_FLASH_HALF_CYCLE_ACCESS_ENABLE()  (FLASH->ACR |= FLASH_ACR_HLFCYA)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Disable the FLASH half cycle access.
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_FLASH_HALF_CYCLE_ACCESS_DISABLE() (FLASH->ACR &= (~FLASH_ACR_HLFCYA))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup FLASH_EM_Latency FLASH Latency
 | 
			
		||||
 *  @brief macros to handle FLASH Latency
 | 
			
		||||
 * @{
 | 
			
		||||
 */ 
 | 
			
		||||
  
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Set the FLASH Latency.
 | 
			
		||||
  * @param  __LATENCY__ FLASH Latency                   
 | 
			
		||||
  *         This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref FLASH_LATENCY_0 FLASH Zero Latency cycle
 | 
			
		||||
  *         @arg @ref FLASH_LATENCY_1 FLASH One Latency cycle
 | 
			
		||||
  *         @arg @ref FLASH_LATENCY_2 FLASH Two Latency cycles
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */ 
 | 
			
		||||
#define __HAL_FLASH_SET_LATENCY(__LATENCY__)    (FLASH->ACR = (FLASH->ACR&(~FLASH_ACR_LATENCY)) | (__LATENCY__))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Get the FLASH Latency.
 | 
			
		||||
  * @retval FLASH Latency                   
 | 
			
		||||
  *         This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref FLASH_LATENCY_0 FLASH Zero Latency cycle
 | 
			
		||||
  *         @arg @ref FLASH_LATENCY_1 FLASH One Latency cycle
 | 
			
		||||
  *         @arg @ref FLASH_LATENCY_2 FLASH Two Latency cycles
 | 
			
		||||
  */ 
 | 
			
		||||
#define __HAL_FLASH_GET_LATENCY()     (READ_BIT((FLASH->ACR), FLASH_ACR_LATENCY))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup FLASH_Prefetch FLASH Prefetch
 | 
			
		||||
 *  @brief macros to handle FLASH Prefetch buffer
 | 
			
		||||
 * @{
 | 
			
		||||
 */   
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Enable the FLASH prefetch buffer.
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */ 
 | 
			
		||||
#define __HAL_FLASH_PREFETCH_BUFFER_ENABLE()    (FLASH->ACR |= FLASH_ACR_PRFTBE)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Disable the FLASH prefetch buffer.
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_FLASH_PREFETCH_BUFFER_DISABLE()   (FLASH->ACR &= (~FLASH_ACR_PRFTBE))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
  
 | 
			
		||||
/** @defgroup FLASH_Interrupt FLASH Interrupts
 | 
			
		||||
 *  @brief macros to handle FLASH interrupts
 | 
			
		||||
 * @{
 | 
			
		||||
 */ 
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Enable the specified FLASH interrupt.
 | 
			
		||||
  * @param  __INTERRUPT__  FLASH interrupt 
 | 
			
		||||
  *         This parameter can be any combination of the following values:
 | 
			
		||||
  *     @arg @ref FLASH_IT_EOP End of FLASH Operation Interrupt
 | 
			
		||||
  *     @arg @ref FLASH_IT_ERR Error Interrupt    
 | 
			
		||||
  * @retval none
 | 
			
		||||
  */  
 | 
			
		||||
#define __HAL_FLASH_ENABLE_IT(__INTERRUPT__)  SET_BIT((FLASH->CR), (__INTERRUPT__))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Disable the specified FLASH interrupt.
 | 
			
		||||
  * @param  __INTERRUPT__  FLASH interrupt 
 | 
			
		||||
  *         This parameter can be any combination of the following values:
 | 
			
		||||
  *     @arg @ref FLASH_IT_EOP End of FLASH Operation Interrupt
 | 
			
		||||
  *     @arg @ref FLASH_IT_ERR Error Interrupt    
 | 
			
		||||
  * @retval none
 | 
			
		||||
  */  
 | 
			
		||||
#define __HAL_FLASH_DISABLE_IT(__INTERRUPT__)  CLEAR_BIT((FLASH->CR), (uint32_t)(__INTERRUPT__))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Get the specified FLASH flag status. 
 | 
			
		||||
  * @param  __FLAG__ specifies the FLASH flag to check.
 | 
			
		||||
  *          This parameter can be one of the following values:
 | 
			
		||||
  *            @arg @ref FLASH_FLAG_BSY         FLASH Busy flag
 | 
			
		||||
  *            @arg @ref FLASH_FLAG_EOP         FLASH End of Operation flag 
 | 
			
		||||
  *            @arg @ref FLASH_FLAG_WRPERR      FLASH Write protected error flag 
 | 
			
		||||
  *            @arg @ref FLASH_FLAG_PGERR       FLASH Programming error flag
 | 
			
		||||
  * @retval The new state of __FLAG__ (SET or RESET).
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_FLASH_GET_FLAG(__FLAG__)   (((FLASH->SR) & (__FLAG__)) == (__FLAG__))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Clear the specified FLASH flag.
 | 
			
		||||
  * @param  __FLAG__ specifies the FLASH flags to clear.
 | 
			
		||||
  *          This parameter can be any combination of the following values:
 | 
			
		||||
  *            @arg @ref FLASH_FLAG_EOP         FLASH End of Operation flag 
 | 
			
		||||
  *            @arg @ref FLASH_FLAG_WRPERR      FLASH Write protected error flag 
 | 
			
		||||
  *            @arg @ref FLASH_FLAG_PGERR       FLASH Programming error flag
 | 
			
		||||
  * @retval none
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_FLASH_CLEAR_FLAG(__FLAG__)   ((FLASH->SR) = (__FLAG__))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */ 
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */ 
 | 
			
		||||
 | 
			
		||||
/* Include FLASH HAL Extended module */
 | 
			
		||||
#include "stm32f3xx_hal_flash_ex.h"  
 | 
			
		||||
 | 
			
		||||
/* Exported functions --------------------------------------------------------*/
 | 
			
		||||
/** @addtogroup FLASH_Exported_Functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
  
 | 
			
		||||
/** @addtogroup FLASH_Exported_Functions_Group1
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/* IO operation functions *****************************************************/
 | 
			
		||||
HAL_StatusTypeDef HAL_FLASH_Program(uint32_t TypeProgram, uint32_t Address, uint64_t Data);
 | 
			
		||||
HAL_StatusTypeDef HAL_FLASH_Program_IT(uint32_t TypeProgram, uint32_t Address, uint64_t Data);
 | 
			
		||||
 | 
			
		||||
/* FLASH IRQ handler function */
 | 
			
		||||
void       HAL_FLASH_IRQHandler(void);
 | 
			
		||||
/* Callbacks in non blocking modes */ 
 | 
			
		||||
void       HAL_FLASH_EndOfOperationCallback(uint32_t ReturnValue);
 | 
			
		||||
void       HAL_FLASH_OperationErrorCallback(uint32_t ReturnValue);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup FLASH_Exported_Functions_Group2
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/* Peripheral Control functions ***********************************************/
 | 
			
		||||
HAL_StatusTypeDef HAL_FLASH_Unlock(void);
 | 
			
		||||
HAL_StatusTypeDef HAL_FLASH_Lock(void);
 | 
			
		||||
HAL_StatusTypeDef HAL_FLASH_OB_Unlock(void);
 | 
			
		||||
HAL_StatusTypeDef HAL_FLASH_OB_Lock(void);
 | 
			
		||||
HAL_StatusTypeDef HAL_FLASH_OB_Launch(void);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup FLASH_Exported_Functions_Group3
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/* Peripheral State and Error functions ***************************************/
 | 
			
		||||
uint32_t HAL_FLASH_GetError(void);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Private function -------------------------------------------------*/
 | 
			
		||||
/** @addtogroup FLASH_Private_Functions
 | 
			
		||||
 * @{
 | 
			
		||||
 */
 | 
			
		||||
HAL_StatusTypeDef       FLASH_WaitForLastOperation(uint32_t Timeout);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* __STM32F3xx_HAL_FLASH_H */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,472 @@
 | 
			
		||||
/**
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @file    stm32f3xx_hal_flash_ex.h
 | 
			
		||||
  * @author  MCD Application Team
 | 
			
		||||
  * @brief   Header file of Flash HAL Extended module.
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @attention
 | 
			
		||||
  *
 | 
			
		||||
  * Copyright (c) 2016 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 __STM32F3xx_HAL_FLASH_EX_H
 | 
			
		||||
#define __STM32F3xx_HAL_FLASH_EX_H
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
 extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Includes ------------------------------------------------------------------*/
 | 
			
		||||
#include "stm32f3xx_hal_def.h"
 | 
			
		||||
 | 
			
		||||
/** @addtogroup STM32F3xx_HAL_Driver
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup FLASHEx
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
 | 
			
		||||
/** @addtogroup FLASHEx_Private_Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#define FLASH_SIZE_DATA_REGISTER (0x1FFFF7CCU)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */  
 | 
			
		||||
 | 
			
		||||
/** @addtogroup FLASHEx_Private_Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define IS_FLASH_TYPEERASE(VALUE) (((VALUE) == FLASH_TYPEERASE_PAGES) || \
 | 
			
		||||
                             ((VALUE) == FLASH_TYPEERASE_MASSERASE))  
 | 
			
		||||
 | 
			
		||||
#define IS_OPTIONBYTE(VALUE) ((VALUE) <= (OPTIONBYTE_WRP | OPTIONBYTE_RDP | OPTIONBYTE_USER | OPTIONBYTE_DATA))
 | 
			
		||||
 | 
			
		||||
#define IS_WRPSTATE(VALUE) (((VALUE) == OB_WRPSTATE_DISABLE) || \
 | 
			
		||||
                            ((VALUE) == OB_WRPSTATE_ENABLE))  
 | 
			
		||||
 | 
			
		||||
#define IS_OB_DATA_ADDRESS(ADDRESS) (((ADDRESS) == OB_DATA_ADDRESS_DATA0) || ((ADDRESS) == OB_DATA_ADDRESS_DATA1)) 
 | 
			
		||||
 | 
			
		||||
#define IS_OB_RDP_LEVEL(LEVEL)     (((LEVEL) == OB_RDP_LEVEL_0)   ||\
 | 
			
		||||
                                    ((LEVEL) == OB_RDP_LEVEL_1))/*||\
 | 
			
		||||
                                    ((LEVEL) == OB_RDP_LEVEL_2))*/
 | 
			
		||||
 | 
			
		||||
#define IS_OB_IWDG_SOURCE(SOURCE)  (((SOURCE) == OB_IWDG_SW) || ((SOURCE) == OB_IWDG_HW))
 | 
			
		||||
 | 
			
		||||
#define IS_OB_STOP_SOURCE(SOURCE)  (((SOURCE) == OB_STOP_NO_RST) || ((SOURCE) == OB_STOP_RST))
 | 
			
		||||
 | 
			
		||||
#define IS_OB_STDBY_SOURCE(SOURCE) (((SOURCE) == OB_STDBY_NO_RST) || ((SOURCE) == OB_STDBY_RST))
 | 
			
		||||
 | 
			
		||||
#define IS_OB_BOOT1(BOOT1)         (((BOOT1) == OB_BOOT1_RESET) || ((BOOT1) == OB_BOOT1_SET))
 | 
			
		||||
 | 
			
		||||
#define IS_OB_VDDA_ANALOG(ANALOG)  (((ANALOG) == OB_VDDA_ANALOG_ON) || ((ANALOG) == OB_VDDA_ANALOG_OFF))
 | 
			
		||||
 | 
			
		||||
#define IS_OB_SRAM_PARITY(PARITY)  (((PARITY) == OB_SRAM_PARITY_SET) || ((PARITY) == OB_SRAM_PARITY_RESET))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#if defined(FLASH_OBR_SDADC12_VDD_MONITOR)
 | 
			
		||||
#define IS_OB_SDACD_VDD_MONITOR(VDD_MONITOR) (((VDD_MONITOR) == OB_SDACD_VDD_MONITOR_SET) || \
 | 
			
		||||
                                              ((VDD_MONITOR) == OB_SDACD_VDD_MONITOR_RESET))
 | 
			
		||||
#endif /* FLASH_OBR_SDADC12_VDD_MONITOR */
 | 
			
		||||
 | 
			
		||||
#define IS_OB_WRP(PAGE) (((PAGE) != 0x0000000U))
 | 
			
		||||
 | 
			
		||||
#if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) \
 | 
			
		||||
 || defined(STM32F373xC) || defined(STM32F378xx)
 | 
			
		||||
#define IS_FLASH_PROGRAM_ADDRESS(ADDRESS) (((ADDRESS) >= FLASH_BASE) && (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x100U) ? \
 | 
			
		||||
                                           ((ADDRESS) <= 0x0803FFFFU) :  (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x80U) ? \
 | 
			
		||||
                                           ((ADDRESS) <= 0x0801FFFFU) :  ((ADDRESS) <= 0x0800FFFFU))))
 | 
			
		||||
#endif /* STM32F302xC || STM32F303xC || STM32F358xx || */
 | 
			
		||||
       /* STM32F373xC || STM32F378xx */
 | 
			
		||||
 | 
			
		||||
#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)
 | 
			
		||||
#define IS_FLASH_PROGRAM_ADDRESS(ADDRESS) (((ADDRESS) >= FLASH_BASE) && ((ADDRESS) <= 0x0807FFFFU))
 | 
			
		||||
#endif /* STM32F302xE || STM32F303xE || STM32F398xx */
 | 
			
		||||
 | 
			
		||||
#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) \
 | 
			
		||||
 || defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)
 | 
			
		||||
#define IS_FLASH_PROGRAM_ADDRESS(ADDRESS) (((ADDRESS) >= FLASH_BASE) && (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x40U) ? \
 | 
			
		||||
                                           ((ADDRESS) <= 0x0800FFFFU) :  (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x20U) ? \
 | 
			
		||||
                                           ((ADDRESS) <= 0x08007FFFU) :  ((ADDRESS) <= 0x08003FFFU))))
 | 
			
		||||
#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */
 | 
			
		||||
       /* STM32F303x8 || STM32F334x8 || STM32F328xx */
 | 
			
		||||
 | 
			
		||||
#if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) \
 | 
			
		||||
 || defined(STM32F373xC) || defined(STM32F378xx)
 | 
			
		||||
#define IS_FLASH_NB_PAGES(ADDRESS,NBPAGES) (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x100U) ? ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x0803FFFFU) : \
 | 
			
		||||
                                           (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x80U)  ? ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x0801FFFFU) : \
 | 
			
		||||
                                            ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x0800FFFFU)))
 | 
			
		||||
#endif /* STM32F302xC || STM32F303xC || STM32F358xx || */
 | 
			
		||||
       /* STM32F373xC || STM32F378xx */
 | 
			
		||||
 | 
			
		||||
#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)
 | 
			
		||||
#define IS_FLASH_NB_PAGES(ADDRESS,NBPAGES) ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x0807FFFFU)
 | 
			
		||||
#endif /* STM32F302xE || STM32F303xE || STM32F398xx */
 | 
			
		||||
 | 
			
		||||
#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) \
 | 
			
		||||
 || defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)
 | 
			
		||||
#define IS_FLASH_NB_PAGES(ADDRESS,NBPAGES) (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x40U) ? ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x0800FFFFU) : \
 | 
			
		||||
                                           (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x20U) ? ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x08007FFFU) : \
 | 
			
		||||
                                            ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x08003FFFU)))
 | 
			
		||||
#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */
 | 
			
		||||
       /* STM32F303x8 || STM32F334x8 || STM32F328xx */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported types ------------------------------------------------------------*/ 
 | 
			
		||||
/** @defgroup FLASHEx_Exported_Types FLASHEx Exported Types
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  FLASH Erase structure definition
 | 
			
		||||
  */
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
  uint32_t TypeErase;   /*!< TypeErase: Mass erase or page erase.
 | 
			
		||||
                             This parameter can be a value of @ref FLASHEx_Type_Erase */
 | 
			
		||||
 | 
			
		||||
  uint32_t PageAddress; /*!< PageAdress: Initial FLASH page address to erase when mass erase is disabled
 | 
			
		||||
                             This parameter must be a number between Min_Data = FLASH_BASE and Max_Data = FLASH_BANK1_END */
 | 
			
		||||
  
 | 
			
		||||
  uint32_t NbPages;     /*!< NbPages: Number of pagess to be erased.
 | 
			
		||||
                             This parameter must be a value between Min_Data = 1 and Max_Data = (max number of pages - value of initial page)*/
 | 
			
		||||
                                                          
 | 
			
		||||
} FLASH_EraseInitTypeDef;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  FLASH Options bytes program structure definition
 | 
			
		||||
  */
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
  uint32_t OptionType;  /*!< OptionType: Option byte to be configured.
 | 
			
		||||
                             This parameter can be a value of @ref FLASHEx_OB_Type */
 | 
			
		||||
 | 
			
		||||
  uint32_t WRPState;    /*!< WRPState: Write protection activation or deactivation.
 | 
			
		||||
                             This parameter can be a value of @ref FLASHEx_OB_WRP_State */
 | 
			
		||||
 | 
			
		||||
  uint32_t WRPPage;     /*!< WRPPage: specifies the page(s) to be write protected
 | 
			
		||||
                             This parameter can be a value of @ref FLASHEx_OB_Write_Protection */
 | 
			
		||||
 | 
			
		||||
  uint8_t RDPLevel;     /*!< RDPLevel: Set the read protection level..
 | 
			
		||||
                             This parameter can be a value of @ref FLASHEx_OB_Read_Protection */
 | 
			
		||||
 | 
			
		||||
  uint8_t USERConfig;   /*!< USERConfig: Program the FLASH User Option Byte: 
 | 
			
		||||
                             IWDG / STOP / STDBY / BOOT1 / VDDA_ANALOG / SRAM_PARITY / SDADC12_VDD_MONITOR
 | 
			
		||||
                             This parameter can be a combination of @ref FLASHEx_OB_IWatchdog, @ref FLASHEx_OB_nRST_STOP, 
 | 
			
		||||
                             @ref FLASHEx_OB_nRST_STDBY, @ref FLASHEx_OB_BOOT1, @ref FLASHEx_OB_VDDA_Analog_Monitoring,
 | 
			
		||||
                             @ref FLASHEx_OB_RAM_Parity_Check_Enable.
 | 
			
		||||
                             @if STM32F373xC
 | 
			
		||||
                             And @ref FLASHEx_OB_SDADC12_VDD_MONITOR (only for STM32F373xC & STM32F378xx devices)
 | 
			
		||||
                             @endif
 | 
			
		||||
                             @if STM32F378xx
 | 
			
		||||
                             And @ref FLASHEx_OB_SDADC12_VDD_MONITOR (only for STM32F373xC & STM32F378xx devices)
 | 
			
		||||
                             @endif
 | 
			
		||||
                             */
 | 
			
		||||
 | 
			
		||||
  uint32_t DATAAddress; /*!< DATAAddress: Address of the option byte DATA to be programmed
 | 
			
		||||
                             This parameter can be a value of @ref FLASHEx_OB_Data_Address */
 | 
			
		||||
  
 | 
			
		||||
  uint8_t DATAData;     /*!< DATAData: Data to be stored in the option byte DATA
 | 
			
		||||
                             This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFFU */  
 | 
			
		||||
} FLASH_OBProgramInitTypeDef;
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */  
 | 
			
		||||
 | 
			
		||||
/* Exported constants --------------------------------------------------------*/
 | 
			
		||||
/** @defgroup FLASHEx_Exported_Constants FLASHEx Exported Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup FLASHEx_Page_Size FLASHEx Page Size
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define FLASH_PAGE_SIZE          0x800
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup FLASHEx_Type_Erase FLASH Type Erase
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
#define FLASH_TYPEERASE_PAGES     (0x00U)  /*!<Pages erase only*/
 | 
			
		||||
#define FLASH_TYPEERASE_MASSERASE (0x01U)  /*!<Flash mass erase activation*/
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
  
 | 
			
		||||
/** @defgroup FLASHEx_OptionByte_Constants Option Byte Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
 | 
			
		||||
/** @defgroup FLASHEx_OB_Type Option Bytes Type
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define OPTIONBYTE_WRP       (0x01U)  /*!<WRP option byte configuration*/
 | 
			
		||||
#define OPTIONBYTE_RDP       (0x02U)  /*!<RDP option byte configuration*/
 | 
			
		||||
#define OPTIONBYTE_USER      (0x04U)  /*!<USER option byte configuration*/
 | 
			
		||||
#define OPTIONBYTE_DATA      (0x08U)  /*!<DATA option byte configuration*/
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup FLASHEx_OB_WRP_State Option Byte WRP State
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
#define OB_WRPSTATE_DISABLE   (0x00U)  /*!<Disable the write protection of the desired pages*/
 | 
			
		||||
#define OB_WRPSTATE_ENABLE    (0x01U)  /*!<Enable the write protection of the desired pagess*/
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup FLASHEx_OB_Write_Protection FLASHEx OB Write Protection
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define OB_WRP_PAGES0TO1               (0x00000001U) /* Write protection of page 0 to 1 */
 | 
			
		||||
#define OB_WRP_PAGES2TO3               (0x00000002U) /* Write protection of page 2 to 3 */
 | 
			
		||||
#define OB_WRP_PAGES4TO5               (0x00000004U) /* Write protection of page 4 to 5 */
 | 
			
		||||
#define OB_WRP_PAGES6TO7               (0x00000008U) /* Write protection of page 6 to 7 */
 | 
			
		||||
#define OB_WRP_PAGES8TO9               (0x00000010U) /* Write protection of page 8 to 9 */
 | 
			
		||||
#define OB_WRP_PAGES10TO11             (0x00000020U) /* Write protection of page 10 to 11 */
 | 
			
		||||
#define OB_WRP_PAGES12TO13             (0x00000040U) /* Write protection of page 12 to 13 */
 | 
			
		||||
#define OB_WRP_PAGES14TO15             (0x00000080U) /* Write protection of page 14 to 15 */
 | 
			
		||||
#define OB_WRP_PAGES16TO17             (0x00000100U) /* Write protection of page 16 to 17 */
 | 
			
		||||
#define OB_WRP_PAGES18TO19             (0x00000200U) /* Write protection of page 18 to 19 */
 | 
			
		||||
#define OB_WRP_PAGES20TO21             (0x00000400U) /* Write protection of page 20 to 21 */
 | 
			
		||||
#define OB_WRP_PAGES22TO23             (0x00000800U) /* Write protection of page 22 to 23 */
 | 
			
		||||
#define OB_WRP_PAGES24TO25             (0x00001000U) /* Write protection of page 24 to 25 */
 | 
			
		||||
#define OB_WRP_PAGES26TO27             (0x00002000U) /* Write protection of page 26 to 27 */
 | 
			
		||||
#define OB_WRP_PAGES28TO29             (0x00004000U) /* Write protection of page 28 to 29 */
 | 
			
		||||
#define OB_WRP_PAGES30TO31             (0x00008000U) /* Write protection of page 30 to 31 */
 | 
			
		||||
 | 
			
		||||
#if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) \
 | 
			
		||||
 || defined(STM32F373xC) || defined(STM32F378xx)
 | 
			
		||||
#define OB_WRP_PAGES32TO33             (0x00010000U) /* Write protection of page 32 to 33 */
 | 
			
		||||
#define OB_WRP_PAGES34TO35             (0x00020000U) /* Write protection of page 34 to 35 */
 | 
			
		||||
#define OB_WRP_PAGES36TO37             (0x00040000U) /* Write protection of page 36 to 37 */
 | 
			
		||||
#define OB_WRP_PAGES38TO39             (0x00080000U) /* Write protection of page 38 to 39 */
 | 
			
		||||
#define OB_WRP_PAGES40TO41             (0x00100000U) /* Write protection of page 40 to 41 */
 | 
			
		||||
#define OB_WRP_PAGES42TO43             (0x00200000U) /* Write protection of page 42 to 43 */
 | 
			
		||||
#define OB_WRP_PAGES44TO45             (0x00400000U) /* Write protection of page 44 to 45 */
 | 
			
		||||
#define OB_WRP_PAGES46TO47             (0x00800000U) /* Write protection of page 46 to 47 */
 | 
			
		||||
#define OB_WRP_PAGES48TO49             (0x01000000U) /* Write protection of page 48 to 49 */
 | 
			
		||||
#define OB_WRP_PAGES50TO51             (0x02000000U) /* Write protection of page 50 to 51 */
 | 
			
		||||
#define OB_WRP_PAGES52TO53             (0x04000000U) /* Write protection of page 52 to 53 */
 | 
			
		||||
#define OB_WRP_PAGES54TO55             (0x08000000U) /* Write protection of page 54 to 55 */
 | 
			
		||||
#define OB_WRP_PAGES56TO57             (0x10000000U) /* Write protection of page 56 to 57 */
 | 
			
		||||
#define OB_WRP_PAGES58TO59             (0x20000000U) /* Write protection of page 58 to 59 */
 | 
			
		||||
#define OB_WRP_PAGES60TO61             (0x40000000U) /* Write protection of page 60 to 61 */
 | 
			
		||||
#define OB_WRP_PAGES62TO127            (0x80000000U) /* Write protection of page 62 to 127 */
 | 
			
		||||
#endif /* STM32F302xC || STM32F303xC || STM32F358xx || */ 
 | 
			
		||||
       /* STM32F373xC || STM32F378xx                   */
 | 
			
		||||
 | 
			
		||||
#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)
 | 
			
		||||
#define OB_WRP_PAGES32TO33             (0x00010000U) /* Write protection of page 32 to 33 */
 | 
			
		||||
#define OB_WRP_PAGES34TO35             (0x00020000U) /* Write protection of page 34 to 35 */
 | 
			
		||||
#define OB_WRP_PAGES36TO37             (0x00040000U) /* Write protection of page 36 to 37 */
 | 
			
		||||
#define OB_WRP_PAGES38TO39             (0x00080000U) /* Write protection of page 38 to 39 */
 | 
			
		||||
#define OB_WRP_PAGES40TO41             (0x00100000U) /* Write protection of page 40 to 41 */
 | 
			
		||||
#define OB_WRP_PAGES42TO43             (0x00200000U) /* Write protection of page 42 to 43 */
 | 
			
		||||
#define OB_WRP_PAGES44TO45             (0x00400000U) /* Write protection of page 44 to 45 */
 | 
			
		||||
#define OB_WRP_PAGES46TO47             (0x00800000U) /* Write protection of page 46 to 47 */
 | 
			
		||||
#define OB_WRP_PAGES48TO49             (0x01000000U) /* Write protection of page 48 to 49 */
 | 
			
		||||
#define OB_WRP_PAGES50TO51             (0x02000000U) /* Write protection of page 50 to 51 */
 | 
			
		||||
#define OB_WRP_PAGES52TO53             (0x04000000U) /* Write protection of page 52 to 53 */
 | 
			
		||||
#define OB_WRP_PAGES54TO55             (0x08000000U) /* Write protection of page 54 to 55 */
 | 
			
		||||
#define OB_WRP_PAGES56TO57             (0x10000000U) /* Write protection of page 56 to 57 */
 | 
			
		||||
#define OB_WRP_PAGES58TO59             (0x20000000U) /* Write protection of page 58 to 59 */
 | 
			
		||||
#define OB_WRP_PAGES60TO61             (0x40000000U) /* Write protection of page 60 to 61 */
 | 
			
		||||
#define OB_WRP_PAGES62TO255            (0x80000000U) /* Write protection of page 62 to 255 */
 | 
			
		||||
#endif /* STM32F302xE || STM32F303xE || STM32F398xx */
 | 
			
		||||
 | 
			
		||||
#define OB_WRP_PAGES0TO15MASK          (0x000000FFU)
 | 
			
		||||
#define OB_WRP_PAGES16TO31MASK         (0x0000FF00U)
 | 
			
		||||
 | 
			
		||||
#if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) \
 | 
			
		||||
 || defined(STM32F373xC) || defined(STM32F378xx)
 | 
			
		||||
#define OB_WRP_PAGES32TO47MASK         (0x00FF0000U)
 | 
			
		||||
#define OB_WRP_PAGES48TO127MASK        (0xFF000000U)
 | 
			
		||||
#endif /* STM32F302xC || STM32F303xC || STM32F358xx || */
 | 
			
		||||
       /* STM32F373xC || STM32F378xx                   */
 | 
			
		||||
 | 
			
		||||
#if defined(STM32F302xE) || defined(STM32F303xE)
 | 
			
		||||
#define OB_WRP_PAGES32TO47MASK         (0x00FF0000U)
 | 
			
		||||
#define OB_WRP_PAGES48TO255MASK        (0xFF000000U)
 | 
			
		||||
#endif /* STM32F302xE || STM32F303xE */
 | 
			
		||||
 | 
			
		||||
#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) \
 | 
			
		||||
 || defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) \
 | 
			
		||||
 || defined(STM32F373xC) || defined(STM32F378xx)
 | 
			
		||||
#define OB_WRP_ALLPAGES                (0xFFFFFFFFU) /*!< Write protection of all pages */
 | 
			
		||||
#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */
 | 
			
		||||
       /* STM32F302xC || STM32F303xC || STM32F358xx || */
 | 
			
		||||
       /* STM32F373xC || STM32F378xx                   */
 | 
			
		||||
 | 
			
		||||
#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) \
 | 
			
		||||
 || defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)
 | 
			
		||||
#define OB_WRP_ALLPAGES                (0x0000FFFFU) /*!< Write protection of all pages */
 | 
			
		||||
#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */
 | 
			
		||||
       /* STM32F303x8 || STM32F334x8 || STM32F328xx    */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup FLASHEx_OB_Read_Protection Option Byte Read Protection
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define OB_RDP_LEVEL_0             ((uint8_t)0xAAU)
 | 
			
		||||
#define OB_RDP_LEVEL_1             ((uint8_t)0xBBU)
 | 
			
		||||
#define OB_RDP_LEVEL_2             ((uint8_t)0xCCU) /*!< Warning: When enabling read protection level 2 
 | 
			
		||||
                                                      it's no more possible to go back to level 1 or 0U */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
  
 | 
			
		||||
/** @defgroup FLASHEx_OB_IWatchdog Option Byte IWatchdog
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
#define OB_IWDG_SW                 ((uint8_t)0x01U)  /*!< Software IWDG selected */
 | 
			
		||||
#define OB_IWDG_HW                 ((uint8_t)0x00U)  /*!< Hardware IWDG selected */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
  
 | 
			
		||||
/** @defgroup FLASHEx_OB_nRST_STOP Option Byte nRST STOP
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
#define OB_STOP_NO_RST             ((uint8_t)0x02U) /*!< No reset generated when entering in STOP */
 | 
			
		||||
#define OB_STOP_RST                ((uint8_t)0x00U) /*!< Reset generated when entering in STOP */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup FLASHEx_OB_nRST_STDBY Option Byte nRST STDBY
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
#define OB_STDBY_NO_RST            ((uint8_t)0x04U) /*!< No reset generated when entering in STANDBY */
 | 
			
		||||
#define OB_STDBY_RST               ((uint8_t)0x00U) /*!< Reset generated when entering in STANDBY */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup FLASHEx_OB_BOOT1 Option Byte BOOT1
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define OB_BOOT1_RESET             ((uint8_t)0x00U) /*!< BOOT1 Reset */
 | 
			
		||||
#define OB_BOOT1_SET               ((uint8_t)0x10U) /*!< BOOT1 Set */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup FLASHEx_OB_VDDA_Analog_Monitoring Option Byte VDDA Analog Monitoring
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define OB_VDDA_ANALOG_ON          ((uint8_t)0x20U) /*!< Analog monitoring on VDDA Power source ON */
 | 
			
		||||
#define OB_VDDA_ANALOG_OFF         ((uint8_t)0x00U) /*!< Analog monitoring on VDDA Power source OFF */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup FLASHEx_OB_RAM_Parity_Check_Enable Option Byte SRAM Parity Check Enable
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define OB_SRAM_PARITY_SET         ((uint8_t)0x00U) /*!< SRAM parity check enable set */
 | 
			
		||||
#define OB_SRAM_PARITY_RESET       ((uint8_t)0x40U) /*!< SRAM parity check enable reset */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#if defined(FLASH_OBR_SDADC12_VDD_MONITOR)
 | 
			
		||||
/** @defgroup FLASHEx_OB_SDADC12_VDD_MONITOR OB SDADC12 VDD MONITOR
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define OB_SDACD_VDD_MONITOR_RESET           ((uint8_t)0x00U) /*!< SDADC VDD Monitor reset */
 | 
			
		||||
#define OB_SDACD_VDD_MONITOR_SET             ((uint8_t)0x80U) /*!< SDADC VDD Monitor set */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */ 
 | 
			
		||||
#endif /* FLASH_OBR_SDADC12_VDD_MONITOR */
 | 
			
		||||
 | 
			
		||||
/** @defgroup FLASHEx_OB_Data_Address  Option Byte Data Address
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define OB_DATA_ADDRESS_DATA0     (0x1FFFF804U)
 | 
			
		||||
#define OB_DATA_ADDRESS_DATA1     (0x1FFFF806U)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported functions --------------------------------------------------------*/
 | 
			
		||||
/** @addtogroup FLASHEx_Exported_Functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
  
 | 
			
		||||
/** @addtogroup FLASHEx_Exported_Functions_Group1
 | 
			
		||||
  * @{
 | 
			
		||||
  */   
 | 
			
		||||
/* IO operation functions *****************************************************/
 | 
			
		||||
HAL_StatusTypeDef  HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *PageError);
 | 
			
		||||
HAL_StatusTypeDef  HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */ 
 | 
			
		||||
 | 
			
		||||
/** @addtogroup FLASHEx_Exported_Functions_Group2
 | 
			
		||||
  * @{
 | 
			
		||||
  */   
 | 
			
		||||
/* Peripheral Control functions ***********************************************/
 | 
			
		||||
HAL_StatusTypeDef  HAL_FLASHEx_OBErase(void);
 | 
			
		||||
HAL_StatusTypeDef  HAL_FLASHEx_OBProgram(FLASH_OBProgramInitTypeDef *pOBInit);
 | 
			
		||||
void               HAL_FLASHEx_OBGetConfig(FLASH_OBProgramInitTypeDef *pOBInit);
 | 
			
		||||
uint32_t           HAL_FLASHEx_OBGetUserData(uint32_t DATAAdress);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
  
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* __STM32F3xx_HAL_FLASH_EX_H */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,323 @@
 | 
			
		||||
/**
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @file    stm32f3xx_hal_gpio.h
 | 
			
		||||
  * @author  MCD Application Team
 | 
			
		||||
  * @brief   Header file of GPIO HAL module.
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @attention
 | 
			
		||||
  *
 | 
			
		||||
  * Copyright (c) 2016 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 __STM32F3xx_HAL_GPIO_H
 | 
			
		||||
#define __STM32F3xx_HAL_GPIO_H
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
 extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Includes ------------------------------------------------------------------*/
 | 
			
		||||
#include "stm32f3xx_hal_def.h"
 | 
			
		||||
 | 
			
		||||
/** @addtogroup STM32F3xx_HAL_Driver
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup GPIO
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported types ------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/** @defgroup GPIO_Exported_Types GPIO Exported Types
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/**
 | 
			
		||||
  * @brief   GPIO Init structure definition
 | 
			
		||||
  */
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
  uint32_t Pin;        /*!< Specifies the GPIO pins to be configured.
 | 
			
		||||
                           This parameter can be any value of @ref GPIO_pins */
 | 
			
		||||
 | 
			
		||||
  uint32_t Mode;       /*!< Specifies the operating mode for the selected pins.
 | 
			
		||||
                           This parameter can be a value of @ref GPIO_mode */
 | 
			
		||||
 | 
			
		||||
  uint32_t Pull;       /*!< Specifies the Pull-up or Pull-Down activation for the selected pins.
 | 
			
		||||
                           This parameter can be a value of @ref GPIO_pull */
 | 
			
		||||
 | 
			
		||||
  uint32_t Speed;      /*!< Specifies the speed for the selected pins.
 | 
			
		||||
                           This parameter can be a value of @ref GPIO_speed */
 | 
			
		||||
 | 
			
		||||
  uint32_t Alternate;  /*!< Peripheral to be connected to the selected pins 
 | 
			
		||||
                            This parameter can be a value of @ref GPIOEx_Alternate_function_selection */
 | 
			
		||||
}GPIO_InitTypeDef;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  GPIO Bit SET and Bit RESET enumeration
 | 
			
		||||
  */
 | 
			
		||||
typedef enum
 | 
			
		||||
{
 | 
			
		||||
  GPIO_PIN_RESET = 0U,
 | 
			
		||||
  GPIO_PIN_SET
 | 
			
		||||
}GPIO_PinState;
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported constants --------------------------------------------------------*/
 | 
			
		||||
/** @defgroup GPIO_Exported_Constants GPIO Exported Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/** @defgroup GPIO_pins GPIO pins
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define GPIO_PIN_0                 ((uint16_t)0x0001U)  /* Pin 0 selected    */
 | 
			
		||||
#define GPIO_PIN_1                 ((uint16_t)0x0002U)  /* Pin 1 selected    */
 | 
			
		||||
#define GPIO_PIN_2                 ((uint16_t)0x0004U)  /* Pin 2 selected    */
 | 
			
		||||
#define GPIO_PIN_3                 ((uint16_t)0x0008U)  /* Pin 3 selected    */
 | 
			
		||||
#define GPIO_PIN_4                 ((uint16_t)0x0010U)  /* Pin 4 selected    */
 | 
			
		||||
#define GPIO_PIN_5                 ((uint16_t)0x0020U)  /* Pin 5 selected    */
 | 
			
		||||
#define GPIO_PIN_6                 ((uint16_t)0x0040U)  /* Pin 6 selected    */
 | 
			
		||||
#define GPIO_PIN_7                 ((uint16_t)0x0080U)  /* Pin 7 selected    */
 | 
			
		||||
#define GPIO_PIN_8                 ((uint16_t)0x0100U)  /* Pin 8 selected    */
 | 
			
		||||
#define GPIO_PIN_9                 ((uint16_t)0x0200U)  /* Pin 9 selected    */
 | 
			
		||||
#define GPIO_PIN_10                ((uint16_t)0x0400U)  /* Pin 10 selected   */
 | 
			
		||||
#define GPIO_PIN_11                ((uint16_t)0x0800U)  /* Pin 11 selected   */
 | 
			
		||||
#define GPIO_PIN_12                ((uint16_t)0x1000U)  /* Pin 12 selected   */
 | 
			
		||||
#define GPIO_PIN_13                ((uint16_t)0x2000U)  /* Pin 13 selected   */
 | 
			
		||||
#define GPIO_PIN_14                ((uint16_t)0x4000U)  /* Pin 14 selected   */
 | 
			
		||||
#define GPIO_PIN_15                ((uint16_t)0x8000U)  /* Pin 15 selected   */
 | 
			
		||||
#define GPIO_PIN_All               ((uint16_t)0xFFFFU)  /* All pins selected */
 | 
			
		||||
 | 
			
		||||
#define GPIO_PIN_MASK              (0x0000FFFFU) /* PIN mask for assert test */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup GPIO_mode GPIO mode
 | 
			
		||||
  * @brief GPIO Configuration Mode
 | 
			
		||||
  *        Elements values convention: 0x00WX00YZ
 | 
			
		||||
  *           - W  : EXTI trigger detection on 3 bits
 | 
			
		||||
  *           - X  : EXTI mode (IT or Event) on 2 bits
 | 
			
		||||
  *           - Y  : Output type (Push Pull or Open Drain) on 1 bit
 | 
			
		||||
  *           - Z  : GPIO mode (Input, Output, Alternate or Analog) on 2 bits
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define  GPIO_MODE_INPUT                        MODE_INPUT                                                  /*!< Input Floating Mode                   */
 | 
			
		||||
#define  GPIO_MODE_OUTPUT_PP                    (MODE_OUTPUT | OUTPUT_PP)                                   /*!< Output Push Pull Mode                 */
 | 
			
		||||
#define  GPIO_MODE_OUTPUT_OD                    (MODE_OUTPUT | OUTPUT_OD)                                   /*!< Output Open Drain Mode                */
 | 
			
		||||
#define  GPIO_MODE_AF_PP                        (MODE_AF | OUTPUT_PP)                                       /*!< Alternate Function Push Pull Mode     */
 | 
			
		||||
#define  GPIO_MODE_AF_OD                        (MODE_AF | OUTPUT_OD)                                       /*!< Alternate Function Open Drain Mode    */
 | 
			
		||||
 | 
			
		||||
#define  GPIO_MODE_ANALOG                       MODE_ANALOG                                                 /*!< Analog Mode  */
 | 
			
		||||
    
 | 
			
		||||
#define  GPIO_MODE_IT_RISING                    (MODE_INPUT | EXTI_IT | TRIGGER_RISING)                     /*!< External Interrupt Mode with Rising edge trigger detection          */
 | 
			
		||||
#define  GPIO_MODE_IT_FALLING                   (MODE_INPUT | EXTI_IT | TRIGGER_FALLING)                    /*!< External Interrupt Mode with Falling edge trigger detection         */
 | 
			
		||||
#define  GPIO_MODE_IT_RISING_FALLING            (MODE_INPUT | EXTI_IT | TRIGGER_RISING | TRIGGER_FALLING)   /*!< External Interrupt Mode with Rising/Falling edge trigger detection  */
 | 
			
		||||
 
 | 
			
		||||
#define  GPIO_MODE_EVT_RISING                   (MODE_INPUT | EXTI_EVT | TRIGGER_RISING)                     /*!< External Event Mode with Rising edge trigger detection             */
 | 
			
		||||
#define  GPIO_MODE_EVT_FALLING                  (MODE_INPUT | EXTI_EVT | TRIGGER_FALLING)                    /*!< External Event Mode with Falling edge trigger detection            */
 | 
			
		||||
#define  GPIO_MODE_EVT_RISING_FALLING           (MODE_INPUT | EXTI_EVT | TRIGGER_RISING | TRIGGER_FALLING)   /*!< External Event Mode with Rising/Falling edge trigger detection     */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup GPIO_speed GPIO speed
 | 
			
		||||
  * @brief GPIO Output Maximum frequency
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define  GPIO_SPEED_FREQ_LOW      (0x00000000U)  /*!< range up to 2 MHz, please refer to the product datasheet */
 | 
			
		||||
#define  GPIO_SPEED_FREQ_MEDIUM   (0x00000001U)  /*!< range  4 MHz to 10 MHz, please refer to the product datasheet */
 | 
			
		||||
#define  GPIO_SPEED_FREQ_HIGH     (0x00000003U)  /*!< range 10 MHz to 50 MHz, please refer to the product datasheet */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
 /** @defgroup GPIO_pull GPIO pull
 | 
			
		||||
   * @brief GPIO Pull-Up or Pull-Down Activation
 | 
			
		||||
   * @{
 | 
			
		||||
   */
 | 
			
		||||
#define  GPIO_NOPULL        (0x00000000U)   /*!< No Pull-up or Pull-down activation  */
 | 
			
		||||
#define  GPIO_PULLUP        (0x00000001U)   /*!< Pull-up activation                  */
 | 
			
		||||
#define  GPIO_PULLDOWN      (0x00000002U)   /*!< Pull-down activation                */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported macro ------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup GPIO_Exported_Macros GPIO Exported Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
  
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Check whether the specified EXTI line flag is set or not.
 | 
			
		||||
  * @param  __EXTI_LINE__ specifies the EXTI line flag to check.
 | 
			
		||||
  *         This parameter can be GPIO_PIN_x where x can be(0..15)
 | 
			
		||||
  * @retval The new state of __EXTI_LINE__ (SET or RESET).
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_GPIO_EXTI_GET_FLAG(__EXTI_LINE__)       (EXTI->PR & (__EXTI_LINE__))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Clear the EXTI's line pending flags.
 | 
			
		||||
  * @param  __EXTI_LINE__ specifies the EXTI lines flags to clear.
 | 
			
		||||
  *         This parameter can be any combination of GPIO_PIN_x where x can be (0..15)
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_GPIO_EXTI_CLEAR_FLAG(__EXTI_LINE__)     (EXTI->PR = (__EXTI_LINE__))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Check whether the specified EXTI line is asserted or not.
 | 
			
		||||
  * @param  __EXTI_LINE__ specifies the EXTI line to check.
 | 
			
		||||
  *          This parameter can be GPIO_PIN_x where x can be(0..15)
 | 
			
		||||
  * @retval The new state of __EXTI_LINE__ (SET or RESET).
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_GPIO_EXTI_GET_IT(__EXTI_LINE__)         (EXTI->PR & (__EXTI_LINE__))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Clear the EXTI's line pending bits.
 | 
			
		||||
  * @param  __EXTI_LINE__ specifies the EXTI lines to clear.
 | 
			
		||||
  *          This parameter can be any combination of GPIO_PIN_x where x can be (0..15)
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_GPIO_EXTI_CLEAR_IT(__EXTI_LINE__)       (EXTI->PR = (__EXTI_LINE__))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Generate a Software interrupt on selected EXTI line.
 | 
			
		||||
  * @param  __EXTI_LINE__ specifies the EXTI line to check.
 | 
			
		||||
  *          This parameter can be GPIO_PIN_x where x can be(0..15)
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_GPIO_EXTI_GENERATE_SWIT(__EXTI_LINE__)  (EXTI->SWIER |= (__EXTI_LINE__))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Private macros ------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup GPIO_Private_Constants GPIO Private Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define GPIO_MODE_Pos                           0u
 | 
			
		||||
#define GPIO_MODE                               (0x3uL << GPIO_MODE_Pos)
 | 
			
		||||
#define MODE_INPUT                              (0x0uL << GPIO_MODE_Pos)
 | 
			
		||||
#define MODE_OUTPUT                             (0x1uL << GPIO_MODE_Pos)
 | 
			
		||||
#define MODE_AF                                 (0x2uL << GPIO_MODE_Pos)
 | 
			
		||||
#define MODE_ANALOG                             (0x3uL << GPIO_MODE_Pos)
 | 
			
		||||
#define OUTPUT_TYPE_Pos                         4u
 | 
			
		||||
#define OUTPUT_TYPE                             (0x1uL << OUTPUT_TYPE_Pos)
 | 
			
		||||
#define OUTPUT_PP                               (0x0uL << OUTPUT_TYPE_Pos)
 | 
			
		||||
#define OUTPUT_OD                               (0x1uL << OUTPUT_TYPE_Pos)
 | 
			
		||||
#define EXTI_MODE_Pos                           16u
 | 
			
		||||
#define EXTI_MODE                               (0x3uL << EXTI_MODE_Pos)
 | 
			
		||||
#define EXTI_IT                                 (0x1uL << EXTI_MODE_Pos)
 | 
			
		||||
#define EXTI_EVT                                (0x2uL << EXTI_MODE_Pos)
 | 
			
		||||
#define TRIGGER_MODE_Pos                         20u
 | 
			
		||||
#define TRIGGER_MODE                            (0x7uL << TRIGGER_MODE_Pos)
 | 
			
		||||
#define TRIGGER_RISING                          (0x1uL << TRIGGER_MODE_Pos)
 | 
			
		||||
#define TRIGGER_FALLING                         (0x2uL << TRIGGER_MODE_Pos)
 | 
			
		||||
#define TRIGGER_LEVEL                           (0x4uL << TRIGGER_MODE_Pos)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
   
 | 
			
		||||
/** @addtogroup GPIO_Private_Macros GPIO Private Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define IS_GPIO_PIN_ACTION(ACTION)  (((ACTION) == GPIO_PIN_RESET) || ((ACTION) == GPIO_PIN_SET))
 | 
			
		||||
 | 
			
		||||
#define IS_GPIO_PIN(__PIN__)        (((((uint32_t)__PIN__) & GPIO_PIN_MASK) != 0x00U) &&\
 | 
			
		||||
                                     ((((uint32_t)__PIN__) & ~GPIO_PIN_MASK) == 0x00U))
 | 
			
		||||
 | 
			
		||||
#define IS_GPIO_MODE(__MODE__)      (((__MODE__) == GPIO_MODE_INPUT)              ||\
 | 
			
		||||
                                     ((__MODE__) == GPIO_MODE_OUTPUT_PP)          ||\
 | 
			
		||||
                                     ((__MODE__) == GPIO_MODE_OUTPUT_OD)          ||\
 | 
			
		||||
                                     ((__MODE__) == GPIO_MODE_AF_PP)              ||\
 | 
			
		||||
                                     ((__MODE__) == GPIO_MODE_AF_OD)              ||\
 | 
			
		||||
                                     ((__MODE__) == GPIO_MODE_IT_RISING)          ||\
 | 
			
		||||
                                     ((__MODE__) == GPIO_MODE_IT_FALLING)         ||\
 | 
			
		||||
                                     ((__MODE__) == GPIO_MODE_IT_RISING_FALLING)  ||\
 | 
			
		||||
                                     ((__MODE__) == GPIO_MODE_EVT_RISING)         ||\
 | 
			
		||||
                                     ((__MODE__) == GPIO_MODE_EVT_FALLING)        ||\
 | 
			
		||||
                                     ((__MODE__) == GPIO_MODE_EVT_RISING_FALLING) ||\
 | 
			
		||||
                                     ((__MODE__) == GPIO_MODE_ANALOG))
 | 
			
		||||
 | 
			
		||||
#define IS_GPIO_SPEED(__SPEED__)    (((__SPEED__) == GPIO_SPEED_FREQ_LOW)    ||\
 | 
			
		||||
                                     ((__SPEED__) == GPIO_SPEED_FREQ_MEDIUM) ||\
 | 
			
		||||
                                     ((__SPEED__) == GPIO_SPEED_FREQ_HIGH))
 | 
			
		||||
 | 
			
		||||
#define IS_GPIO_PULL(__PULL__)      (((__PULL__) == GPIO_NOPULL)   ||\
 | 
			
		||||
                                     ((__PULL__) == GPIO_PULLUP)   || \
 | 
			
		||||
                                     ((__PULL__) == GPIO_PULLDOWN))
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Include GPIO HAL Extended module */
 | 
			
		||||
#include "stm32f3xx_hal_gpio_ex.h"
 | 
			
		||||
 | 
			
		||||
/* Exported functions --------------------------------------------------------*/ 
 | 
			
		||||
/** @addtogroup GPIO_Exported_Functions GPIO Exported Functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup GPIO_Exported_Functions_Group1 Initialization/de-initialization functions 
 | 
			
		||||
 *  @brief    Initialization and Configuration functions
 | 
			
		||||
 * @{
 | 
			
		||||
 */
 | 
			
		||||
     
 | 
			
		||||
/* Initialization and de-initialization functions *****************************/
 | 
			
		||||
void              HAL_GPIO_Init(GPIO_TypeDef  *GPIOx, GPIO_InitTypeDef *GPIO_Init);
 | 
			
		||||
void              HAL_GPIO_DeInit(GPIO_TypeDef  *GPIOx, uint32_t GPIO_Pin);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup GPIO_Exported_Functions_Group2 IO operation functions 
 | 
			
		||||
 * @{
 | 
			
		||||
 */
 | 
			
		||||
   
 | 
			
		||||
/* IO operation functions *****************************************************/
 | 
			
		||||
GPIO_PinState     HAL_GPIO_ReadPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
 | 
			
		||||
void              HAL_GPIO_WritePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState);
 | 
			
		||||
void              HAL_GPIO_TogglePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
 | 
			
		||||
HAL_StatusTypeDef HAL_GPIO_LockPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
 | 
			
		||||
void              HAL_GPIO_EXTI_IRQHandler(uint16_t GPIO_Pin);
 | 
			
		||||
void              HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */ 
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */  
 | 
			
		||||
  
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* __STM32F3xx_HAL_GPIO_H */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -0,0 +1,840 @@
 | 
			
		||||
/**
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @file    stm32f3xx_hal_i2c.h
 | 
			
		||||
  * @author  MCD Application Team
 | 
			
		||||
  * @brief   Header file of I2C HAL module.
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @attention
 | 
			
		||||
  *
 | 
			
		||||
  * Copyright (c) 2016 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 STM32F3xx_HAL_I2C_H
 | 
			
		||||
#define STM32F3xx_HAL_I2C_H
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Includes ------------------------------------------------------------------*/
 | 
			
		||||
#include "stm32f3xx_hal_def.h"
 | 
			
		||||
 | 
			
		||||
/** @addtogroup STM32F3xx_HAL_Driver
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup I2C
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported types ------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup I2C_Exported_Types I2C Exported Types
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup I2C_Configuration_Structure_definition I2C Configuration Structure definition
 | 
			
		||||
  * @brief  I2C Configuration Structure definition
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
  uint32_t Timing;              /*!< Specifies the I2C_TIMINGR_register value.
 | 
			
		||||
                                     This parameter calculated by referring to I2C initialization section
 | 
			
		||||
                                     in Reference manual */
 | 
			
		||||
 | 
			
		||||
  uint32_t OwnAddress1;         /*!< Specifies the first device own address.
 | 
			
		||||
                                     This parameter can be a 7-bit or 10-bit address. */
 | 
			
		||||
 | 
			
		||||
  uint32_t AddressingMode;      /*!< Specifies if 7-bit or 10-bit addressing mode is selected.
 | 
			
		||||
                                     This parameter can be a value of @ref I2C_ADDRESSING_MODE */
 | 
			
		||||
 | 
			
		||||
  uint32_t DualAddressMode;     /*!< Specifies if dual addressing mode is selected.
 | 
			
		||||
                                     This parameter can be a value of @ref I2C_DUAL_ADDRESSING_MODE */
 | 
			
		||||
 | 
			
		||||
  uint32_t OwnAddress2;         /*!< Specifies the second device own address if dual addressing mode is selected
 | 
			
		||||
                                     This parameter can be a 7-bit address. */
 | 
			
		||||
 | 
			
		||||
  uint32_t OwnAddress2Masks;    /*!< Specifies the acknowledge mask address second device own address if dual addressing
 | 
			
		||||
                                     mode is selected.
 | 
			
		||||
                                     This parameter can be a value of @ref I2C_OWN_ADDRESS2_MASKS */
 | 
			
		||||
 | 
			
		||||
  uint32_t GeneralCallMode;     /*!< Specifies if general call mode is selected.
 | 
			
		||||
                                     This parameter can be a value of @ref I2C_GENERAL_CALL_ADDRESSING_MODE */
 | 
			
		||||
 | 
			
		||||
  uint32_t NoStretchMode;       /*!< Specifies if nostretch mode is selected.
 | 
			
		||||
                                     This parameter can be a value of @ref I2C_NOSTRETCH_MODE */
 | 
			
		||||
 | 
			
		||||
} I2C_InitTypeDef;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup HAL_state_structure_definition HAL state structure definition
 | 
			
		||||
  * @brief  HAL State structure definition
 | 
			
		||||
  * @note  HAL I2C State value coding follow below described bitmap :\n
 | 
			
		||||
  *          b7-b6  Error information\n
 | 
			
		||||
  *             00 : No Error\n
 | 
			
		||||
  *             01 : Abort (Abort user request on going)\n
 | 
			
		||||
  *             10 : Timeout\n
 | 
			
		||||
  *             11 : Error\n
 | 
			
		||||
  *          b5     Peripheral initialization status\n
 | 
			
		||||
  *             0  : Reset (peripheral not initialized)\n
 | 
			
		||||
  *             1  : Init done (peripheral initialized and ready to use. HAL I2C Init function called)\n
 | 
			
		||||
  *          b4     (not used)\n
 | 
			
		||||
  *             x  : Should be set to 0\n
 | 
			
		||||
  *          b3\n
 | 
			
		||||
  *             0  : Ready or Busy (No Listen mode ongoing)\n
 | 
			
		||||
  *             1  : Listen (peripheral in Address Listen Mode)\n
 | 
			
		||||
  *          b2     Intrinsic process state\n
 | 
			
		||||
  *             0  : Ready\n
 | 
			
		||||
  *             1  : Busy (peripheral busy with some configuration or internal operations)\n
 | 
			
		||||
  *          b1     Rx state\n
 | 
			
		||||
  *             0  : Ready (no Rx operation ongoing)\n
 | 
			
		||||
  *             1  : Busy (Rx operation ongoing)\n
 | 
			
		||||
  *          b0     Tx state\n
 | 
			
		||||
  *             0  : Ready (no Tx operation ongoing)\n
 | 
			
		||||
  *             1  : Busy (Tx operation ongoing)
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
typedef enum
 | 
			
		||||
{
 | 
			
		||||
  HAL_I2C_STATE_RESET             = 0x00U,   /*!< Peripheral is not yet Initialized         */
 | 
			
		||||
  HAL_I2C_STATE_READY             = 0x20U,   /*!< Peripheral Initialized and ready for use  */
 | 
			
		||||
  HAL_I2C_STATE_BUSY              = 0x24U,   /*!< An internal process is ongoing            */
 | 
			
		||||
  HAL_I2C_STATE_BUSY_TX           = 0x21U,   /*!< Data Transmission process is ongoing      */
 | 
			
		||||
  HAL_I2C_STATE_BUSY_RX           = 0x22U,   /*!< Data Reception process is ongoing         */
 | 
			
		||||
  HAL_I2C_STATE_LISTEN            = 0x28U,   /*!< Address Listen Mode is ongoing            */
 | 
			
		||||
  HAL_I2C_STATE_BUSY_TX_LISTEN    = 0x29U,   /*!< Address Listen Mode and Data Transmission
 | 
			
		||||
                                                 process is ongoing                         */
 | 
			
		||||
  HAL_I2C_STATE_BUSY_RX_LISTEN    = 0x2AU,   /*!< Address Listen Mode and Data Reception
 | 
			
		||||
                                                 process is ongoing                         */
 | 
			
		||||
  HAL_I2C_STATE_ABORT             = 0x60U,   /*!< Abort user request ongoing                */
 | 
			
		||||
  HAL_I2C_STATE_TIMEOUT           = 0xA0U,   /*!< Timeout state                             */
 | 
			
		||||
  HAL_I2C_STATE_ERROR             = 0xE0U    /*!< Error                                     */
 | 
			
		||||
 | 
			
		||||
} HAL_I2C_StateTypeDef;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup HAL_mode_structure_definition HAL mode structure definition
 | 
			
		||||
  * @brief  HAL Mode structure definition
 | 
			
		||||
  * @note  HAL I2C Mode value coding follow below described bitmap :\n
 | 
			
		||||
  *          b7     (not used)\n
 | 
			
		||||
  *             x  : Should be set to 0\n
 | 
			
		||||
  *          b6\n
 | 
			
		||||
  *             0  : None\n
 | 
			
		||||
  *             1  : Memory (HAL I2C communication is in Memory Mode)\n
 | 
			
		||||
  *          b5\n
 | 
			
		||||
  *             0  : None\n
 | 
			
		||||
  *             1  : Slave (HAL I2C communication is in Slave Mode)\n
 | 
			
		||||
  *          b4\n
 | 
			
		||||
  *             0  : None\n
 | 
			
		||||
  *             1  : Master (HAL I2C communication is in Master Mode)\n
 | 
			
		||||
  *          b3-b2-b1-b0  (not used)\n
 | 
			
		||||
  *             xxxx : Should be set to 0000
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
typedef enum
 | 
			
		||||
{
 | 
			
		||||
  HAL_I2C_MODE_NONE               = 0x00U,   /*!< No I2C communication on going             */
 | 
			
		||||
  HAL_I2C_MODE_MASTER             = 0x10U,   /*!< I2C communication is in Master Mode       */
 | 
			
		||||
  HAL_I2C_MODE_SLAVE              = 0x20U,   /*!< I2C communication is in Slave Mode        */
 | 
			
		||||
  HAL_I2C_MODE_MEM                = 0x40U    /*!< I2C communication is in Memory Mode       */
 | 
			
		||||
 | 
			
		||||
} HAL_I2C_ModeTypeDef;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup I2C_Error_Code_definition I2C Error Code definition
 | 
			
		||||
  * @brief  I2C Error Code definition
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define HAL_I2C_ERROR_NONE      (0x00000000U)    /*!< No error              */
 | 
			
		||||
#define HAL_I2C_ERROR_BERR      (0x00000001U)    /*!< BERR error            */
 | 
			
		||||
#define HAL_I2C_ERROR_ARLO      (0x00000002U)    /*!< ARLO error            */
 | 
			
		||||
#define HAL_I2C_ERROR_AF        (0x00000004U)    /*!< ACKF error            */
 | 
			
		||||
#define HAL_I2C_ERROR_OVR       (0x00000008U)    /*!< OVR error             */
 | 
			
		||||
#define HAL_I2C_ERROR_DMA       (0x00000010U)    /*!< DMA transfer error    */
 | 
			
		||||
#define HAL_I2C_ERROR_TIMEOUT   (0x00000020U)    /*!< Timeout error         */
 | 
			
		||||
#define HAL_I2C_ERROR_SIZE      (0x00000040U)    /*!< Size Management error */
 | 
			
		||||
#define HAL_I2C_ERROR_DMA_PARAM (0x00000080U)    /*!< DMA Parameter Error   */
 | 
			
		||||
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
 | 
			
		||||
#define HAL_I2C_ERROR_INVALID_CALLBACK  (0x00000100U)    /*!< Invalid Callback error */
 | 
			
		||||
#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */
 | 
			
		||||
#define HAL_I2C_ERROR_INVALID_PARAM     (0x00000200U)    /*!< Invalid Parameters error  */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup I2C_handle_Structure_definition I2C handle Structure definition
 | 
			
		||||
  * @brief  I2C handle Structure definition
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
typedef struct __I2C_HandleTypeDef
 | 
			
		||||
{
 | 
			
		||||
  I2C_TypeDef                *Instance;      /*!< I2C registers base address                */
 | 
			
		||||
 | 
			
		||||
  I2C_InitTypeDef            Init;           /*!< I2C communication parameters              */
 | 
			
		||||
 | 
			
		||||
  uint8_t                    *pBuffPtr;      /*!< Pointer to I2C transfer buffer            */
 | 
			
		||||
 | 
			
		||||
  uint16_t                   XferSize;       /*!< I2C transfer size                         */
 | 
			
		||||
 | 
			
		||||
  __IO uint16_t              XferCount;      /*!< I2C transfer counter                      */
 | 
			
		||||
 | 
			
		||||
  __IO uint32_t              XferOptions;    /*!< I2C sequantial transfer options, this parameter can
 | 
			
		||||
                                                  be a value of @ref I2C_XFEROPTIONS */
 | 
			
		||||
 | 
			
		||||
  __IO uint32_t              PreviousState;  /*!< I2C communication Previous state          */
 | 
			
		||||
 | 
			
		||||
  HAL_StatusTypeDef(*XferISR)(struct __I2C_HandleTypeDef *hi2c, uint32_t ITFlags, uint32_t ITSources);
 | 
			
		||||
  /*!< I2C transfer IRQ handler function pointer */
 | 
			
		||||
 | 
			
		||||
  DMA_HandleTypeDef          *hdmatx;        /*!< I2C Tx DMA handle parameters              */
 | 
			
		||||
 | 
			
		||||
  DMA_HandleTypeDef          *hdmarx;        /*!< I2C Rx DMA handle parameters              */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  HAL_LockTypeDef            Lock;           /*!< I2C locking object                        */
 | 
			
		||||
 | 
			
		||||
  __IO HAL_I2C_StateTypeDef  State;          /*!< I2C communication state                   */
 | 
			
		||||
 | 
			
		||||
  __IO HAL_I2C_ModeTypeDef   Mode;           /*!< I2C communication mode                    */
 | 
			
		||||
 | 
			
		||||
  __IO uint32_t              ErrorCode;      /*!< I2C Error code                            */
 | 
			
		||||
 | 
			
		||||
  __IO uint32_t              AddrEventCount; /*!< I2C Address Event counter                 */
 | 
			
		||||
 | 
			
		||||
  __IO uint32_t              Devaddress;     /*!< I2C Target device address                 */
 | 
			
		||||
 | 
			
		||||
  __IO uint32_t              Memaddress;     /*!< I2C Target memory address                 */
 | 
			
		||||
 | 
			
		||||
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
 | 
			
		||||
  void (* MasterTxCpltCallback)(struct __I2C_HandleTypeDef *hi2c);
 | 
			
		||||
  /*!< I2C Master Tx Transfer completed callback */
 | 
			
		||||
  void (* MasterRxCpltCallback)(struct __I2C_HandleTypeDef *hi2c);
 | 
			
		||||
  /*!< I2C Master Rx Transfer completed callback */
 | 
			
		||||
  void (* SlaveTxCpltCallback)(struct __I2C_HandleTypeDef *hi2c);
 | 
			
		||||
  /*!< I2C Slave Tx Transfer completed callback  */
 | 
			
		||||
  void (* SlaveRxCpltCallback)(struct __I2C_HandleTypeDef *hi2c);
 | 
			
		||||
  /*!< I2C Slave Rx Transfer completed callback  */
 | 
			
		||||
  void (* ListenCpltCallback)(struct __I2C_HandleTypeDef *hi2c);
 | 
			
		||||
  /*!< I2C Listen Complete callback              */
 | 
			
		||||
  void (* MemTxCpltCallback)(struct __I2C_HandleTypeDef *hi2c);
 | 
			
		||||
  /*!< I2C Memory Tx Transfer completed callback */
 | 
			
		||||
  void (* MemRxCpltCallback)(struct __I2C_HandleTypeDef *hi2c);
 | 
			
		||||
  /*!< I2C Memory Rx Transfer completed callback */
 | 
			
		||||
  void (* ErrorCallback)(struct __I2C_HandleTypeDef *hi2c);
 | 
			
		||||
  /*!< I2C Error callback                        */
 | 
			
		||||
  void (* AbortCpltCallback)(struct __I2C_HandleTypeDef *hi2c);
 | 
			
		||||
  /*!< I2C Abort callback                        */
 | 
			
		||||
 | 
			
		||||
  void (* AddrCallback)(struct __I2C_HandleTypeDef *hi2c, uint8_t TransferDirection, uint16_t AddrMatchCode);
 | 
			
		||||
  /*!< I2C Slave Address Match callback */
 | 
			
		||||
 | 
			
		||||
  void (* MspInitCallback)(struct __I2C_HandleTypeDef *hi2c);
 | 
			
		||||
  /*!< I2C Msp Init callback                     */
 | 
			
		||||
  void (* MspDeInitCallback)(struct __I2C_HandleTypeDef *hi2c);
 | 
			
		||||
  /*!< I2C Msp DeInit callback                   */
 | 
			
		||||
 | 
			
		||||
#endif  /* USE_HAL_I2C_REGISTER_CALLBACKS */
 | 
			
		||||
} I2C_HandleTypeDef;
 | 
			
		||||
 | 
			
		||||
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  HAL I2C Callback ID enumeration definition
 | 
			
		||||
  */
 | 
			
		||||
typedef enum
 | 
			
		||||
{
 | 
			
		||||
  HAL_I2C_MASTER_TX_COMPLETE_CB_ID      = 0x00U,    /*!< I2C Master Tx Transfer completed callback ID  */
 | 
			
		||||
  HAL_I2C_MASTER_RX_COMPLETE_CB_ID      = 0x01U,    /*!< I2C Master Rx Transfer completed callback ID  */
 | 
			
		||||
  HAL_I2C_SLAVE_TX_COMPLETE_CB_ID       = 0x02U,    /*!< I2C Slave Tx Transfer completed callback ID   */
 | 
			
		||||
  HAL_I2C_SLAVE_RX_COMPLETE_CB_ID       = 0x03U,    /*!< I2C Slave Rx Transfer completed callback ID   */
 | 
			
		||||
  HAL_I2C_LISTEN_COMPLETE_CB_ID         = 0x04U,    /*!< I2C Listen Complete callback ID               */
 | 
			
		||||
  HAL_I2C_MEM_TX_COMPLETE_CB_ID         = 0x05U,    /*!< I2C Memory Tx Transfer callback ID            */
 | 
			
		||||
  HAL_I2C_MEM_RX_COMPLETE_CB_ID         = 0x06U,    /*!< I2C Memory Rx Transfer completed callback ID  */
 | 
			
		||||
  HAL_I2C_ERROR_CB_ID                   = 0x07U,    /*!< I2C Error callback ID                         */
 | 
			
		||||
  HAL_I2C_ABORT_CB_ID                   = 0x08U,    /*!< I2C Abort callback ID                         */
 | 
			
		||||
 | 
			
		||||
  HAL_I2C_MSPINIT_CB_ID                 = 0x09U,    /*!< I2C Msp Init callback ID                      */
 | 
			
		||||
  HAL_I2C_MSPDEINIT_CB_ID               = 0x0AU     /*!< I2C Msp DeInit callback ID                    */
 | 
			
		||||
 | 
			
		||||
} HAL_I2C_CallbackIDTypeDef;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  HAL I2C Callback pointer definition
 | 
			
		||||
  */
 | 
			
		||||
typedef  void (*pI2C_CallbackTypeDef)(I2C_HandleTypeDef *hi2c);
 | 
			
		||||
/*!< pointer to an I2C callback function */
 | 
			
		||||
typedef  void (*pI2C_AddrCallbackTypeDef)(I2C_HandleTypeDef *hi2c, uint8_t TransferDirection,
 | 
			
		||||
                                          uint16_t AddrMatchCode);
 | 
			
		||||
/*!< pointer to an I2C Address Match callback function */
 | 
			
		||||
 | 
			
		||||
#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
/* Exported constants --------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/** @defgroup I2C_Exported_Constants I2C Exported Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup I2C_XFEROPTIONS  I2C Sequential Transfer Options
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define I2C_FIRST_FRAME                 ((uint32_t)I2C_SOFTEND_MODE)
 | 
			
		||||
#define I2C_FIRST_AND_NEXT_FRAME        ((uint32_t)(I2C_RELOAD_MODE | I2C_SOFTEND_MODE))
 | 
			
		||||
#define I2C_NEXT_FRAME                  ((uint32_t)(I2C_RELOAD_MODE | I2C_SOFTEND_MODE))
 | 
			
		||||
#define I2C_FIRST_AND_LAST_FRAME        ((uint32_t)I2C_AUTOEND_MODE)
 | 
			
		||||
#define I2C_LAST_FRAME                  ((uint32_t)I2C_AUTOEND_MODE)
 | 
			
		||||
#define I2C_LAST_FRAME_NO_STOP          ((uint32_t)I2C_SOFTEND_MODE)
 | 
			
		||||
 | 
			
		||||
/* List of XferOptions in usage of :
 | 
			
		||||
 * 1- Restart condition in all use cases (direction change or not)
 | 
			
		||||
 */
 | 
			
		||||
#define  I2C_OTHER_FRAME                (0x000000AAU)
 | 
			
		||||
#define  I2C_OTHER_AND_LAST_FRAME       (0x0000AA00U)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup I2C_ADDRESSING_MODE I2C Addressing Mode
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define I2C_ADDRESSINGMODE_7BIT         (0x00000001U)
 | 
			
		||||
#define I2C_ADDRESSINGMODE_10BIT        (0x00000002U)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup I2C_DUAL_ADDRESSING_MODE I2C Dual Addressing Mode
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define I2C_DUALADDRESS_DISABLE         (0x00000000U)
 | 
			
		||||
#define I2C_DUALADDRESS_ENABLE          I2C_OAR2_OA2EN
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup I2C_OWN_ADDRESS2_MASKS I2C Own Address2 Masks
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define I2C_OA2_NOMASK                  ((uint8_t)0x00U)
 | 
			
		||||
#define I2C_OA2_MASK01                  ((uint8_t)0x01U)
 | 
			
		||||
#define I2C_OA2_MASK02                  ((uint8_t)0x02U)
 | 
			
		||||
#define I2C_OA2_MASK03                  ((uint8_t)0x03U)
 | 
			
		||||
#define I2C_OA2_MASK04                  ((uint8_t)0x04U)
 | 
			
		||||
#define I2C_OA2_MASK05                  ((uint8_t)0x05U)
 | 
			
		||||
#define I2C_OA2_MASK06                  ((uint8_t)0x06U)
 | 
			
		||||
#define I2C_OA2_MASK07                  ((uint8_t)0x07U)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup I2C_GENERAL_CALL_ADDRESSING_MODE I2C General Call Addressing Mode
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define I2C_GENERALCALL_DISABLE         (0x00000000U)
 | 
			
		||||
#define I2C_GENERALCALL_ENABLE          I2C_CR1_GCEN
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup I2C_NOSTRETCH_MODE I2C No-Stretch Mode
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define I2C_NOSTRETCH_DISABLE           (0x00000000U)
 | 
			
		||||
#define I2C_NOSTRETCH_ENABLE            I2C_CR1_NOSTRETCH
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup I2C_MEMORY_ADDRESS_SIZE I2C Memory Address Size
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define I2C_MEMADD_SIZE_8BIT            (0x00000001U)
 | 
			
		||||
#define I2C_MEMADD_SIZE_16BIT           (0x00000002U)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup I2C_XFERDIRECTION I2C Transfer Direction Master Point of View
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define I2C_DIRECTION_TRANSMIT          (0x00000000U)
 | 
			
		||||
#define I2C_DIRECTION_RECEIVE           (0x00000001U)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup I2C_RELOAD_END_MODE I2C Reload End Mode
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define  I2C_RELOAD_MODE                I2C_CR2_RELOAD
 | 
			
		||||
#define  I2C_AUTOEND_MODE               I2C_CR2_AUTOEND
 | 
			
		||||
#define  I2C_SOFTEND_MODE               (0x00000000U)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup I2C_START_STOP_MODE I2C Start or Stop Mode
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define  I2C_NO_STARTSTOP               (0x00000000U)
 | 
			
		||||
#define  I2C_GENERATE_STOP              (uint32_t)(0x80000000U | I2C_CR2_STOP)
 | 
			
		||||
#define  I2C_GENERATE_START_READ        (uint32_t)(0x80000000U | I2C_CR2_START | I2C_CR2_RD_WRN)
 | 
			
		||||
#define  I2C_GENERATE_START_WRITE       (uint32_t)(0x80000000U | I2C_CR2_START)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup I2C_Interrupt_configuration_definition I2C Interrupt configuration definition
 | 
			
		||||
  * @brief I2C Interrupt definition
 | 
			
		||||
  *        Elements values convention: 0xXXXXXXXX
 | 
			
		||||
  *           - XXXXXXXX  : Interrupt control mask
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define I2C_IT_ERRI                     I2C_CR1_ERRIE
 | 
			
		||||
#define I2C_IT_TCI                      I2C_CR1_TCIE
 | 
			
		||||
#define I2C_IT_STOPI                    I2C_CR1_STOPIE
 | 
			
		||||
#define I2C_IT_NACKI                    I2C_CR1_NACKIE
 | 
			
		||||
#define I2C_IT_ADDRI                    I2C_CR1_ADDRIE
 | 
			
		||||
#define I2C_IT_RXI                      I2C_CR1_RXIE
 | 
			
		||||
#define I2C_IT_TXI                      I2C_CR1_TXIE
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup I2C_Flag_definition I2C Flag definition
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define I2C_FLAG_TXE                    I2C_ISR_TXE
 | 
			
		||||
#define I2C_FLAG_TXIS                   I2C_ISR_TXIS
 | 
			
		||||
#define I2C_FLAG_RXNE                   I2C_ISR_RXNE
 | 
			
		||||
#define I2C_FLAG_ADDR                   I2C_ISR_ADDR
 | 
			
		||||
#define I2C_FLAG_AF                     I2C_ISR_NACKF
 | 
			
		||||
#define I2C_FLAG_STOPF                  I2C_ISR_STOPF
 | 
			
		||||
#define I2C_FLAG_TC                     I2C_ISR_TC
 | 
			
		||||
#define I2C_FLAG_TCR                    I2C_ISR_TCR
 | 
			
		||||
#define I2C_FLAG_BERR                   I2C_ISR_BERR
 | 
			
		||||
#define I2C_FLAG_ARLO                   I2C_ISR_ARLO
 | 
			
		||||
#define I2C_FLAG_OVR                    I2C_ISR_OVR
 | 
			
		||||
#define I2C_FLAG_PECERR                 I2C_ISR_PECERR
 | 
			
		||||
#define I2C_FLAG_TIMEOUT                I2C_ISR_TIMEOUT
 | 
			
		||||
#define I2C_FLAG_ALERT                  I2C_ISR_ALERT
 | 
			
		||||
#define I2C_FLAG_BUSY                   I2C_ISR_BUSY
 | 
			
		||||
#define I2C_FLAG_DIR                    I2C_ISR_DIR
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported macros -----------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/** @defgroup I2C_Exported_Macros I2C Exported Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @brief Reset I2C handle state.
 | 
			
		||||
  * @param  __HANDLE__ specifies the I2C Handle.
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
 | 
			
		||||
#define __HAL_I2C_RESET_HANDLE_STATE(__HANDLE__)                do{                                             \
 | 
			
		||||
                                                                    (__HANDLE__)->State = HAL_I2C_STATE_RESET;  \
 | 
			
		||||
                                                                    (__HANDLE__)->MspInitCallback = NULL;       \
 | 
			
		||||
                                                                    (__HANDLE__)->MspDeInitCallback = NULL;     \
 | 
			
		||||
                                                                  } while(0)
 | 
			
		||||
#else
 | 
			
		||||
#define __HAL_I2C_RESET_HANDLE_STATE(__HANDLE__)                ((__HANDLE__)->State = HAL_I2C_STATE_RESET)
 | 
			
		||||
#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */
 | 
			
		||||
 | 
			
		||||
/** @brief  Enable the specified I2C interrupt.
 | 
			
		||||
  * @param  __HANDLE__ specifies the I2C Handle.
 | 
			
		||||
  * @param  __INTERRUPT__ specifies the interrupt source to enable.
 | 
			
		||||
  *        This parameter can be one of the following values:
 | 
			
		||||
  *            @arg @ref I2C_IT_ERRI  Errors interrupt enable
 | 
			
		||||
  *            @arg @ref I2C_IT_TCI   Transfer complete interrupt enable
 | 
			
		||||
  *            @arg @ref I2C_IT_STOPI STOP detection interrupt enable
 | 
			
		||||
  *            @arg @ref I2C_IT_NACKI NACK received interrupt enable
 | 
			
		||||
  *            @arg @ref I2C_IT_ADDRI Address match interrupt enable
 | 
			
		||||
  *            @arg @ref I2C_IT_RXI   RX interrupt enable
 | 
			
		||||
  *            @arg @ref I2C_IT_TXI   TX interrupt enable
 | 
			
		||||
  *
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_I2C_ENABLE_IT(__HANDLE__, __INTERRUPT__)          ((__HANDLE__)->Instance->CR1 |= (__INTERRUPT__))
 | 
			
		||||
 | 
			
		||||
/** @brief  Disable the specified I2C interrupt.
 | 
			
		||||
  * @param  __HANDLE__ specifies the I2C Handle.
 | 
			
		||||
  * @param  __INTERRUPT__ specifies the interrupt source to disable.
 | 
			
		||||
  *        This parameter can be one of the following values:
 | 
			
		||||
  *            @arg @ref I2C_IT_ERRI  Errors interrupt enable
 | 
			
		||||
  *            @arg @ref I2C_IT_TCI   Transfer complete interrupt enable
 | 
			
		||||
  *            @arg @ref I2C_IT_STOPI STOP detection interrupt enable
 | 
			
		||||
  *            @arg @ref I2C_IT_NACKI NACK received interrupt enable
 | 
			
		||||
  *            @arg @ref I2C_IT_ADDRI Address match interrupt enable
 | 
			
		||||
  *            @arg @ref I2C_IT_RXI   RX interrupt enable
 | 
			
		||||
  *            @arg @ref I2C_IT_TXI   TX interrupt enable
 | 
			
		||||
  *
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_I2C_DISABLE_IT(__HANDLE__, __INTERRUPT__)         ((__HANDLE__)->Instance->CR1 &= (~(__INTERRUPT__)))
 | 
			
		||||
 | 
			
		||||
/** @brief  Check whether the specified I2C interrupt source is enabled or not.
 | 
			
		||||
  * @param  __HANDLE__ specifies the I2C Handle.
 | 
			
		||||
  * @param  __INTERRUPT__ specifies the I2C interrupt source to check.
 | 
			
		||||
  *          This parameter can be one of the following values:
 | 
			
		||||
  *            @arg @ref I2C_IT_ERRI  Errors interrupt enable
 | 
			
		||||
  *            @arg @ref I2C_IT_TCI   Transfer complete interrupt enable
 | 
			
		||||
  *            @arg @ref I2C_IT_STOPI STOP detection interrupt enable
 | 
			
		||||
  *            @arg @ref I2C_IT_NACKI NACK received interrupt enable
 | 
			
		||||
  *            @arg @ref I2C_IT_ADDRI Address match interrupt enable
 | 
			
		||||
  *            @arg @ref I2C_IT_RXI   RX interrupt enable
 | 
			
		||||
  *            @arg @ref I2C_IT_TXI   TX interrupt enable
 | 
			
		||||
  *
 | 
			
		||||
  * @retval The new state of __INTERRUPT__ (SET or RESET).
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_I2C_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__)      ((((__HANDLE__)->Instance->CR1 & \
 | 
			
		||||
                                                                   (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
 | 
			
		||||
 | 
			
		||||
/** @brief  Check whether the specified I2C flag is set or not.
 | 
			
		||||
  * @param  __HANDLE__ specifies the I2C Handle.
 | 
			
		||||
  * @param  __FLAG__ specifies the flag to check.
 | 
			
		||||
  *        This parameter can be one of the following values:
 | 
			
		||||
  *            @arg @ref I2C_FLAG_TXE     Transmit data register empty
 | 
			
		||||
  *            @arg @ref I2C_FLAG_TXIS    Transmit interrupt status
 | 
			
		||||
  *            @arg @ref I2C_FLAG_RXNE    Receive data register not empty
 | 
			
		||||
  *            @arg @ref I2C_FLAG_ADDR    Address matched (slave mode)
 | 
			
		||||
  *            @arg @ref I2C_FLAG_AF      Acknowledge failure received flag
 | 
			
		||||
  *            @arg @ref I2C_FLAG_STOPF   STOP detection flag
 | 
			
		||||
  *            @arg @ref I2C_FLAG_TC      Transfer complete (master mode)
 | 
			
		||||
  *            @arg @ref I2C_FLAG_TCR     Transfer complete reload
 | 
			
		||||
  *            @arg @ref I2C_FLAG_BERR    Bus error
 | 
			
		||||
  *            @arg @ref I2C_FLAG_ARLO    Arbitration lost
 | 
			
		||||
  *            @arg @ref I2C_FLAG_OVR     Overrun/Underrun
 | 
			
		||||
  *            @arg @ref I2C_FLAG_PECERR  PEC error in reception
 | 
			
		||||
  *            @arg @ref I2C_FLAG_TIMEOUT Timeout or Tlow detection flag
 | 
			
		||||
  *            @arg @ref I2C_FLAG_ALERT   SMBus alert
 | 
			
		||||
  *            @arg @ref I2C_FLAG_BUSY    Bus busy
 | 
			
		||||
  *            @arg @ref I2C_FLAG_DIR     Transfer direction (slave mode)
 | 
			
		||||
  *
 | 
			
		||||
  * @retval The new state of __FLAG__ (SET or RESET).
 | 
			
		||||
  */
 | 
			
		||||
#define I2C_FLAG_MASK  (0x0001FFFFU)
 | 
			
		||||
#define __HAL_I2C_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & \
 | 
			
		||||
                                                    (__FLAG__)) == (__FLAG__)) ? SET : RESET)
 | 
			
		||||
 | 
			
		||||
/** @brief  Clear the I2C pending flags which are cleared by writing 1 in a specific bit.
 | 
			
		||||
  * @param  __HANDLE__ specifies the I2C Handle.
 | 
			
		||||
  * @param  __FLAG__ specifies the flag to clear.
 | 
			
		||||
  *          This parameter can be any combination of the following values:
 | 
			
		||||
  *            @arg @ref I2C_FLAG_TXE     Transmit data register empty
 | 
			
		||||
  *            @arg @ref I2C_FLAG_ADDR    Address matched (slave mode)
 | 
			
		||||
  *            @arg @ref I2C_FLAG_AF      Acknowledge failure received flag
 | 
			
		||||
  *            @arg @ref I2C_FLAG_STOPF   STOP detection flag
 | 
			
		||||
  *            @arg @ref I2C_FLAG_BERR    Bus error
 | 
			
		||||
  *            @arg @ref I2C_FLAG_ARLO    Arbitration lost
 | 
			
		||||
  *            @arg @ref I2C_FLAG_OVR     Overrun/Underrun
 | 
			
		||||
  *            @arg @ref I2C_FLAG_PECERR  PEC error in reception
 | 
			
		||||
  *            @arg @ref I2C_FLAG_TIMEOUT Timeout or Tlow detection flag
 | 
			
		||||
  *            @arg @ref I2C_FLAG_ALERT   SMBus alert
 | 
			
		||||
  *
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_I2C_CLEAR_FLAG(__HANDLE__, __FLAG__) (((__FLAG__) == I2C_FLAG_TXE) ? \
 | 
			
		||||
                                                    ((__HANDLE__)->Instance->ISR |= (__FLAG__)) : \
 | 
			
		||||
                                                    ((__HANDLE__)->Instance->ICR = (__FLAG__)))
 | 
			
		||||
 | 
			
		||||
/** @brief  Enable the specified I2C peripheral.
 | 
			
		||||
  * @param  __HANDLE__ specifies the I2C Handle.
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_I2C_ENABLE(__HANDLE__)                         (SET_BIT((__HANDLE__)->Instance->CR1, I2C_CR1_PE))
 | 
			
		||||
 | 
			
		||||
/** @brief  Disable the specified I2C peripheral.
 | 
			
		||||
  * @param  __HANDLE__ specifies the I2C Handle.
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_I2C_DISABLE(__HANDLE__)                        (CLEAR_BIT((__HANDLE__)->Instance->CR1, I2C_CR1_PE))
 | 
			
		||||
 | 
			
		||||
/** @brief  Generate a Non-Acknowledge I2C peripheral in Slave mode.
 | 
			
		||||
  * @param  __HANDLE__ specifies the I2C Handle.
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_I2C_GENERATE_NACK(__HANDLE__)                  (SET_BIT((__HANDLE__)->Instance->CR2, I2C_CR2_NACK))
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Include I2C HAL Extended module */
 | 
			
		||||
#include "stm32f3xx_hal_i2c_ex.h"
 | 
			
		||||
 | 
			
		||||
/* Exported functions --------------------------------------------------------*/
 | 
			
		||||
/** @addtogroup I2C_Exported_Functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup I2C_Exported_Functions_Group1 Initialization and de-initialization functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/* Initialization and de-initialization functions******************************/
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Init(I2C_HandleTypeDef *hi2c);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_DeInit(I2C_HandleTypeDef *hi2c);
 | 
			
		||||
void HAL_I2C_MspInit(I2C_HandleTypeDef *hi2c);
 | 
			
		||||
void HAL_I2C_MspDeInit(I2C_HandleTypeDef *hi2c);
 | 
			
		||||
 | 
			
		||||
/* Callbacks Register/UnRegister functions  ***********************************/
 | 
			
		||||
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1)
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_RegisterCallback(I2C_HandleTypeDef *hi2c, HAL_I2C_CallbackIDTypeDef CallbackID,
 | 
			
		||||
                                           pI2C_CallbackTypeDef pCallback);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_UnRegisterCallback(I2C_HandleTypeDef *hi2c, HAL_I2C_CallbackIDTypeDef CallbackID);
 | 
			
		||||
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_RegisterAddrCallback(I2C_HandleTypeDef *hi2c, pI2C_AddrCallbackTypeDef pCallback);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_UnRegisterAddrCallback(I2C_HandleTypeDef *hi2c);
 | 
			
		||||
#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup I2C_Exported_Functions_Group2 Input and Output operation functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/* IO operation functions  ****************************************************/
 | 
			
		||||
/******* Blocking mode: Polling */
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Master_Transmit(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData,
 | 
			
		||||
                                          uint16_t Size, uint32_t Timeout);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Master_Receive(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData,
 | 
			
		||||
                                         uint16_t Size, uint32_t Timeout);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Slave_Transmit(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size,
 | 
			
		||||
                                         uint32_t Timeout);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Slave_Receive(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size,
 | 
			
		||||
                                        uint32_t Timeout);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Mem_Write(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress,
 | 
			
		||||
                                    uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Mem_Read(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress,
 | 
			
		||||
                                   uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_IsDeviceReady(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint32_t Trials,
 | 
			
		||||
                                        uint32_t Timeout);
 | 
			
		||||
 | 
			
		||||
/******* Non-Blocking mode: Interrupt */
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Master_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData,
 | 
			
		||||
                                             uint16_t Size);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Master_Receive_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData,
 | 
			
		||||
                                            uint16_t Size);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Slave_Transmit_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Slave_Receive_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Mem_Write_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress,
 | 
			
		||||
                                       uint16_t MemAddSize, uint8_t *pData, uint16_t Size);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Mem_Read_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress,
 | 
			
		||||
                                      uint16_t MemAddSize, uint8_t *pData, uint16_t Size);
 | 
			
		||||
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData,
 | 
			
		||||
                                                 uint16_t Size, uint32_t XferOptions);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Master_Seq_Receive_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData,
 | 
			
		||||
                                                uint16_t Size, uint32_t XferOptions);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Slave_Seq_Transmit_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size,
 | 
			
		||||
                                                uint32_t XferOptions);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Slave_Seq_Receive_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size,
 | 
			
		||||
                                               uint32_t XferOptions);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_EnableListen_IT(I2C_HandleTypeDef *hi2c);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_DisableListen_IT(I2C_HandleTypeDef *hi2c);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Master_Abort_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress);
 | 
			
		||||
 | 
			
		||||
/******* Non-Blocking mode: DMA */
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Master_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData,
 | 
			
		||||
                                              uint16_t Size);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Master_Receive_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData,
 | 
			
		||||
                                             uint16_t Size);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Slave_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Slave_Receive_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Mem_Write_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress,
 | 
			
		||||
                                        uint16_t MemAddSize, uint8_t *pData, uint16_t Size);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Mem_Read_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress,
 | 
			
		||||
                                       uint16_t MemAddSize, uint8_t *pData, uint16_t Size);
 | 
			
		||||
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData,
 | 
			
		||||
                                                  uint16_t Size, uint32_t XferOptions);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Master_Seq_Receive_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData,
 | 
			
		||||
                                                 uint16_t Size, uint32_t XferOptions);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Slave_Seq_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size,
 | 
			
		||||
                                                 uint32_t XferOptions);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2C_Slave_Seq_Receive_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size,
 | 
			
		||||
                                                uint32_t XferOptions);
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup I2C_IRQ_Handler_and_Callbacks IRQ Handler and Callbacks
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/******* I2C IRQHandler and Callbacks used in non blocking modes (Interrupt and DMA) */
 | 
			
		||||
void HAL_I2C_EV_IRQHandler(I2C_HandleTypeDef *hi2c);
 | 
			
		||||
void HAL_I2C_ER_IRQHandler(I2C_HandleTypeDef *hi2c);
 | 
			
		||||
void HAL_I2C_MasterTxCpltCallback(I2C_HandleTypeDef *hi2c);
 | 
			
		||||
void HAL_I2C_MasterRxCpltCallback(I2C_HandleTypeDef *hi2c);
 | 
			
		||||
void HAL_I2C_SlaveTxCpltCallback(I2C_HandleTypeDef *hi2c);
 | 
			
		||||
void HAL_I2C_SlaveRxCpltCallback(I2C_HandleTypeDef *hi2c);
 | 
			
		||||
void HAL_I2C_AddrCallback(I2C_HandleTypeDef *hi2c, uint8_t TransferDirection, uint16_t AddrMatchCode);
 | 
			
		||||
void HAL_I2C_ListenCpltCallback(I2C_HandleTypeDef *hi2c);
 | 
			
		||||
void HAL_I2C_MemTxCpltCallback(I2C_HandleTypeDef *hi2c);
 | 
			
		||||
void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c);
 | 
			
		||||
void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c);
 | 
			
		||||
void HAL_I2C_AbortCpltCallback(I2C_HandleTypeDef *hi2c);
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup I2C_Exported_Functions_Group3 Peripheral State, Mode and Error functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/* Peripheral State, Mode and Error functions  *********************************/
 | 
			
		||||
HAL_I2C_StateTypeDef HAL_I2C_GetState(const I2C_HandleTypeDef *hi2c);
 | 
			
		||||
HAL_I2C_ModeTypeDef  HAL_I2C_GetMode(const I2C_HandleTypeDef *hi2c);
 | 
			
		||||
uint32_t             HAL_I2C_GetError(const I2C_HandleTypeDef *hi2c);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Private constants ---------------------------------------------------------*/
 | 
			
		||||
/** @defgroup I2C_Private_Constants I2C Private Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Private macros ------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup I2C_Private_Macro I2C Private Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#define IS_I2C_ADDRESSING_MODE(MODE)    (((MODE) == I2C_ADDRESSINGMODE_7BIT) || \
 | 
			
		||||
                                         ((MODE) == I2C_ADDRESSINGMODE_10BIT))
 | 
			
		||||
 | 
			
		||||
#define IS_I2C_DUAL_ADDRESS(ADDRESS)    (((ADDRESS) == I2C_DUALADDRESS_DISABLE) || \
 | 
			
		||||
                                         ((ADDRESS) == I2C_DUALADDRESS_ENABLE))
 | 
			
		||||
 | 
			
		||||
#define IS_I2C_OWN_ADDRESS2_MASK(MASK)  (((MASK) == I2C_OA2_NOMASK)  || \
 | 
			
		||||
                                         ((MASK) == I2C_OA2_MASK01) || \
 | 
			
		||||
                                         ((MASK) == I2C_OA2_MASK02) || \
 | 
			
		||||
                                         ((MASK) == I2C_OA2_MASK03) || \
 | 
			
		||||
                                         ((MASK) == I2C_OA2_MASK04) || \
 | 
			
		||||
                                         ((MASK) == I2C_OA2_MASK05) || \
 | 
			
		||||
                                         ((MASK) == I2C_OA2_MASK06) || \
 | 
			
		||||
                                         ((MASK) == I2C_OA2_MASK07))
 | 
			
		||||
 | 
			
		||||
#define IS_I2C_GENERAL_CALL(CALL)       (((CALL) == I2C_GENERALCALL_DISABLE) || \
 | 
			
		||||
                                         ((CALL) == I2C_GENERALCALL_ENABLE))
 | 
			
		||||
 | 
			
		||||
#define IS_I2C_NO_STRETCH(STRETCH)      (((STRETCH) == I2C_NOSTRETCH_DISABLE) || \
 | 
			
		||||
                                         ((STRETCH) == I2C_NOSTRETCH_ENABLE))
 | 
			
		||||
 | 
			
		||||
#define IS_I2C_MEMADD_SIZE(SIZE)        (((SIZE) == I2C_MEMADD_SIZE_8BIT) || \
 | 
			
		||||
                                         ((SIZE) == I2C_MEMADD_SIZE_16BIT))
 | 
			
		||||
 | 
			
		||||
#define IS_TRANSFER_MODE(MODE)          (((MODE) == I2C_RELOAD_MODE)   || \
 | 
			
		||||
                                         ((MODE) == I2C_AUTOEND_MODE) || \
 | 
			
		||||
                                         ((MODE) == I2C_SOFTEND_MODE))
 | 
			
		||||
 | 
			
		||||
#define IS_TRANSFER_REQUEST(REQUEST)    (((REQUEST) == I2C_GENERATE_STOP)        || \
 | 
			
		||||
                                         ((REQUEST) == I2C_GENERATE_START_READ)  || \
 | 
			
		||||
                                         ((REQUEST) == I2C_GENERATE_START_WRITE) || \
 | 
			
		||||
                                         ((REQUEST) == I2C_NO_STARTSTOP))
 | 
			
		||||
 | 
			
		||||
#define IS_I2C_TRANSFER_OPTIONS_REQUEST(REQUEST)  (((REQUEST) == I2C_FIRST_FRAME)          || \
 | 
			
		||||
                                                   ((REQUEST) == I2C_FIRST_AND_NEXT_FRAME) || \
 | 
			
		||||
                                                   ((REQUEST) == I2C_NEXT_FRAME)           || \
 | 
			
		||||
                                                   ((REQUEST) == I2C_FIRST_AND_LAST_FRAME) || \
 | 
			
		||||
                                                   ((REQUEST) == I2C_LAST_FRAME)           || \
 | 
			
		||||
                                                   ((REQUEST) == I2C_LAST_FRAME_NO_STOP)   || \
 | 
			
		||||
                                                   IS_I2C_TRANSFER_OTHER_OPTIONS_REQUEST(REQUEST))
 | 
			
		||||
 | 
			
		||||
#define IS_I2C_TRANSFER_OTHER_OPTIONS_REQUEST(REQUEST) (((REQUEST) == I2C_OTHER_FRAME)     || \
 | 
			
		||||
                                                        ((REQUEST) == I2C_OTHER_AND_LAST_FRAME))
 | 
			
		||||
 | 
			
		||||
#define I2C_RESET_CR2(__HANDLE__)                 ((__HANDLE__)->Instance->CR2 &= \
 | 
			
		||||
                                                   (uint32_t)~((uint32_t)(I2C_CR2_SADD   | I2C_CR2_HEAD10R | \
 | 
			
		||||
                                                                          I2C_CR2_NBYTES | I2C_CR2_RELOAD  | \
 | 
			
		||||
                                                                          I2C_CR2_RD_WRN)))
 | 
			
		||||
 | 
			
		||||
#define I2C_GET_ADDR_MATCH(__HANDLE__)            ((uint16_t)(((__HANDLE__)->Instance->ISR & I2C_ISR_ADDCODE) \
 | 
			
		||||
                                                              >> 16U))
 | 
			
		||||
#define I2C_GET_DIR(__HANDLE__)                   ((uint8_t)(((__HANDLE__)->Instance->ISR & I2C_ISR_DIR) \
 | 
			
		||||
                                                             >> 16U))
 | 
			
		||||
#define I2C_GET_STOP_MODE(__HANDLE__)             ((__HANDLE__)->Instance->CR2 & I2C_CR2_AUTOEND)
 | 
			
		||||
#define I2C_GET_OWN_ADDRESS1(__HANDLE__)          ((uint16_t)((__HANDLE__)->Instance->OAR1 & I2C_OAR1_OA1))
 | 
			
		||||
#define I2C_GET_OWN_ADDRESS2(__HANDLE__)          ((uint16_t)((__HANDLE__)->Instance->OAR2 & I2C_OAR2_OA2))
 | 
			
		||||
 | 
			
		||||
#define IS_I2C_OWN_ADDRESS1(ADDRESS1)             ((ADDRESS1) <= 0x000003FFU)
 | 
			
		||||
#define IS_I2C_OWN_ADDRESS2(ADDRESS2)             ((ADDRESS2) <= (uint16_t)0x00FFU)
 | 
			
		||||
 | 
			
		||||
#define I2C_MEM_ADD_MSB(__ADDRESS__)              ((uint8_t)((uint16_t)(((uint16_t)((__ADDRESS__) & \
 | 
			
		||||
                                                                         (uint16_t)(0xFF00U))) >> 8U)))
 | 
			
		||||
#define I2C_MEM_ADD_LSB(__ADDRESS__)              ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)(0x00FFU))))
 | 
			
		||||
 | 
			
		||||
#define I2C_GENERATE_START(__ADDMODE__,__ADDRESS__) (((__ADDMODE__) == I2C_ADDRESSINGMODE_7BIT) ? \
 | 
			
		||||
                                                     (uint32_t)((((uint32_t)(__ADDRESS__) & (I2C_CR2_SADD)) | \
 | 
			
		||||
                                                                 (I2C_CR2_START) | (I2C_CR2_AUTOEND)) & \
 | 
			
		||||
                                                                (~I2C_CR2_RD_WRN)) : \
 | 
			
		||||
                                                     (uint32_t)((((uint32_t)(__ADDRESS__) & (I2C_CR2_SADD)) | \
 | 
			
		||||
                                                                 (I2C_CR2_ADD10) | (I2C_CR2_START) | \
 | 
			
		||||
                                                                 (I2C_CR2_AUTOEND)) & (~I2C_CR2_RD_WRN)))
 | 
			
		||||
 | 
			
		||||
#define I2C_CHECK_FLAG(__ISR__, __FLAG__)         ((((__ISR__) & ((__FLAG__) & I2C_FLAG_MASK)) == \
 | 
			
		||||
                                                    ((__FLAG__) & I2C_FLAG_MASK)) ? SET : RESET)
 | 
			
		||||
#define I2C_CHECK_IT_SOURCE(__CR1__, __IT__)      ((((__CR1__) & (__IT__)) == (__IT__)) ? SET : RESET)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Private Functions ---------------------------------------------------------*/
 | 
			
		||||
/** @defgroup I2C_Private_Functions I2C Private Functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/* Private functions are defined in stm32f3xx_hal_i2c.c file */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif /* STM32F3xx_HAL_I2C_H */
 | 
			
		||||
@ -0,0 +1,177 @@
 | 
			
		||||
/**
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @file    stm32f3xx_hal_i2c_ex.h
 | 
			
		||||
  * @author  MCD Application Team
 | 
			
		||||
  * @brief   Header file of I2C HAL Extended module.
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @attention
 | 
			
		||||
  *
 | 
			
		||||
  * Copyright (c) 2016 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 STM32F3xx_HAL_I2C_EX_H
 | 
			
		||||
#define STM32F3xx_HAL_I2C_EX_H
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Includes ------------------------------------------------------------------*/
 | 
			
		||||
#include "stm32f3xx_hal_def.h"
 | 
			
		||||
 | 
			
		||||
/** @addtogroup STM32F3xx_HAL_Driver
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup I2CEx
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported types ------------------------------------------------------------*/
 | 
			
		||||
/* Exported constants --------------------------------------------------------*/
 | 
			
		||||
/** @defgroup I2CEx_Exported_Constants I2C Extended Exported Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup I2CEx_Analog_Filter I2C Extended Analog Filter
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define I2C_ANALOGFILTER_ENABLE         0x00000000U
 | 
			
		||||
#define I2C_ANALOGFILTER_DISABLE        I2C_CR1_ANFOFF
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup I2CEx_FastModePlus I2C Extended Fast Mode Plus
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define I2C_FMP_NOT_SUPPORTED           0xAAAA0000U                                     /*!< Fast Mode Plus not supported       */
 | 
			
		||||
#define I2C_FASTMODEPLUS_PB6            SYSCFG_CFGR1_I2C_PB6_FMP                        /*!< Enable Fast Mode Plus on PB6       */
 | 
			
		||||
#define I2C_FASTMODEPLUS_PB7            SYSCFG_CFGR1_I2C_PB7_FMP                        /*!< Enable Fast Mode Plus on PB7       */
 | 
			
		||||
#define I2C_FASTMODEPLUS_PB8            SYSCFG_CFGR1_I2C_PB8_FMP                        /*!< Enable Fast Mode Plus on PB8       */
 | 
			
		||||
#define I2C_FASTMODEPLUS_PB9            SYSCFG_CFGR1_I2C_PB9_FMP                        /*!< Enable Fast Mode Plus on PB9       */
 | 
			
		||||
#define I2C_FASTMODEPLUS_I2C1           SYSCFG_CFGR1_I2C1_FMP                           /*!< Enable Fast Mode Plus on I2C1 pins */
 | 
			
		||||
#if defined(SYSCFG_CFGR1_I2C2_FMP)
 | 
			
		||||
#define I2C_FASTMODEPLUS_I2C2           SYSCFG_CFGR1_I2C2_FMP                           /*!< Enable Fast Mode Plus on I2C2 pins */
 | 
			
		||||
#else
 | 
			
		||||
#define I2C_FASTMODEPLUS_I2C2           (uint32_t)(0x00000200U | I2C_FMP_NOT_SUPPORTED) /*!< Fast Mode Plus I2C2 not supported  */
 | 
			
		||||
#endif /* SYSCFG_CFGR1_I2C2_FMP */
 | 
			
		||||
#if defined(SYSCFG_CFGR1_I2C3_FMP)
 | 
			
		||||
#define I2C_FASTMODEPLUS_I2C3           SYSCFG_CFGR1_I2C3_FMP                           /*!< Enable Fast Mode Plus on I2C3 pins */
 | 
			
		||||
#else
 | 
			
		||||
#define I2C_FASTMODEPLUS_I2C3           (uint32_t)(0x00000400U | I2C_FMP_NOT_SUPPORTED) /*!< Fast Mode Plus I2C3 not supported  */
 | 
			
		||||
#endif /* SYSCFG_CFGR1_I2C3_FMP */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported macro ------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup I2CEx_Exported_Macros I2C Extended Exported Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported functions --------------------------------------------------------*/
 | 
			
		||||
/** @addtogroup I2CEx_Exported_Functions I2C Extended Exported Functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup I2CEx_Exported_Functions_Group1 Filter Mode Functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/* Peripheral Control functions  ************************************************/
 | 
			
		||||
HAL_StatusTypeDef HAL_I2CEx_ConfigAnalogFilter(I2C_HandleTypeDef *hi2c, uint32_t AnalogFilter);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2CEx_ConfigDigitalFilter(I2C_HandleTypeDef *hi2c, uint32_t DigitalFilter);
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup I2CEx_Exported_Functions_Group2 WakeUp Mode Functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
HAL_StatusTypeDef HAL_I2CEx_EnableWakeUp(I2C_HandleTypeDef *hi2c);
 | 
			
		||||
HAL_StatusTypeDef HAL_I2CEx_DisableWakeUp(I2C_HandleTypeDef *hi2c);
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup I2CEx_Exported_Functions_Group3 Fast Mode Plus Functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
void HAL_I2CEx_EnableFastModePlus(uint32_t ConfigFastModePlus);
 | 
			
		||||
void HAL_I2CEx_DisableFastModePlus(uint32_t ConfigFastModePlus);
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Private constants ---------------------------------------------------------*/
 | 
			
		||||
/** @defgroup I2CEx_Private_Constants I2C Extended Private Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Private macros ------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup I2CEx_Private_Macro I2C Extended Private Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define IS_I2C_ANALOG_FILTER(FILTER)    (((FILTER) == I2C_ANALOGFILTER_ENABLE) || \
 | 
			
		||||
                                         ((FILTER) == I2C_ANALOGFILTER_DISABLE))
 | 
			
		||||
 | 
			
		||||
#define IS_I2C_DIGITAL_FILTER(FILTER)   ((FILTER) <= 0x0000000FU)
 | 
			
		||||
 | 
			
		||||
#define IS_I2C_FASTMODEPLUS(__CONFIG__) ((((__CONFIG__) & I2C_FMP_NOT_SUPPORTED) != I2C_FMP_NOT_SUPPORTED) && \
 | 
			
		||||
                                         ((((__CONFIG__) & (I2C_FASTMODEPLUS_PB6))  == I2C_FASTMODEPLUS_PB6)     || \
 | 
			
		||||
                                          (((__CONFIG__) & (I2C_FASTMODEPLUS_PB7))  == I2C_FASTMODEPLUS_PB7)     || \
 | 
			
		||||
                                          (((__CONFIG__) & (I2C_FASTMODEPLUS_PB8))  == I2C_FASTMODEPLUS_PB8)     || \
 | 
			
		||||
                                          (((__CONFIG__) & (I2C_FASTMODEPLUS_PB9))  == I2C_FASTMODEPLUS_PB9)     || \
 | 
			
		||||
                                          (((__CONFIG__) & (I2C_FASTMODEPLUS_I2C1)) == I2C_FASTMODEPLUS_I2C1)    || \
 | 
			
		||||
                                          (((__CONFIG__) & (I2C_FASTMODEPLUS_I2C2)) == I2C_FASTMODEPLUS_I2C2)    || \
 | 
			
		||||
                                          (((__CONFIG__) & (I2C_FASTMODEPLUS_I2C3)) == I2C_FASTMODEPLUS_I2C3)))
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Private Functions ---------------------------------------------------------*/
 | 
			
		||||
/** @defgroup I2CEx_Private_Functions I2C Extended Private Functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/* Private functions are defined in stm32f3xx_hal_i2c_ex.c file */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* STM32F3xx_HAL_I2C_EX_H */
 | 
			
		||||
@ -0,0 +1,216 @@
 | 
			
		||||
/**
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @file    stm32f3xx_hal_pwr.h
 | 
			
		||||
  * @author  MCD Application Team
 | 
			
		||||
  * @brief   Header file of PWR HAL module.
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @attention
 | 
			
		||||
  *
 | 
			
		||||
  * Copyright (c) 2016 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 __STM32F3xx_HAL_PWR_H
 | 
			
		||||
#define __STM32F3xx_HAL_PWR_H
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
 extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Includes ------------------------------------------------------------------*/
 | 
			
		||||
#include "stm32f3xx_hal_def.h"
 | 
			
		||||
 | 
			
		||||
/** @addtogroup STM32F3xx_HAL_Driver
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup PWR PWR
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
 | 
			
		||||
/* Exported types ------------------------------------------------------------*/
 | 
			
		||||
/* Exported constants --------------------------------------------------------*/
 | 
			
		||||
/** @defgroup PWR_Exported_Constants PWR Exported Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */ 
 | 
			
		||||
 | 
			
		||||
/** @defgroup PWR_WakeUp_Pins PWR WakeUp Pins
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#define PWR_WAKEUP_PIN1                 ((uint32_t)PWR_CSR_EWUP1)   /*!< Wakeup pin 1U */
 | 
			
		||||
#define PWR_WAKEUP_PIN2                 ((uint32_t)PWR_CSR_EWUP2)   /*!< Wakeup pin 2U */
 | 
			
		||||
#define PWR_WAKEUP_PIN3                 ((uint32_t)PWR_CSR_EWUP3)   /*!< Wakeup pin 3U */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup PWR_Regulator_state_in_STOP_mode PWR Regulator state in STOP mode
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define PWR_MAINREGULATOR_ON         (0x00000000U) /*!< Voltage regulator on during STOP mode                */
 | 
			
		||||
#define PWR_LOWPOWERREGULATOR_ON     PWR_CR_LPDS            /*!< Voltage regulator in low-power mode during STOP mode */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup PWR_SLEEP_mode_entry PWR SLEEP mode entry
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define PWR_SLEEPENTRY_WFI              ((uint8_t)0x01U)   /*!< Wait For Interruption instruction to enter SLEEP mode */
 | 
			
		||||
#define PWR_SLEEPENTRY_WFE              ((uint8_t)0x02U)   /*!< Wait For Event instruction to enter SLEEP mode        */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup PWR_STOP_mode_entry PWR STOP mode entry
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define PWR_STOPENTRY_WFI               ((uint8_t)0x01U)   /*!< Wait For Interruption instruction to enter STOP mode */
 | 
			
		||||
#define PWR_STOPENTRY_WFE               ((uint8_t)0x02U)   /*!< Wait For Event instruction to enter STOP mode        */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup PWR_Flag PWR Flag
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define PWR_FLAG_WU                     PWR_CSR_WUF             /*!< Wakeup event from wakeup pin or RTC alarm */
 | 
			
		||||
#define PWR_FLAG_SB                     PWR_CSR_SBF             /*!< Standby flag                              */
 | 
			
		||||
#define PWR_FLAG_PVDO                   PWR_CSR_PVDO            /*!< Power Voltage Detector output flag        */
 | 
			
		||||
#define PWR_FLAG_VREFINTRDY             PWR_CSR_VREFINTRDYF     /*!< VREFINT reference voltage ready           */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported macro ------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup PWR_Exported_Macro PWR Exported Macro
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @brief  Check PWR flag is set or not.
 | 
			
		||||
  * @param  __FLAG__ specifies the flag to check.
 | 
			
		||||
  *           This parameter can be one of the following values:
 | 
			
		||||
  *            @arg PWR_FLAG_WU: Wake Up flag. This flag indicates that a wakeup event
 | 
			
		||||
  *                  was received from the WKUP pin or from the RTC alarm (Alarm A
 | 
			
		||||
  *                  or Alarm B), RTC Tamper event, RTC TimeStamp event or RTC Wakeup.
 | 
			
		||||
  *                  An additional wakeup event is detected if the WKUP pin is enabled
 | 
			
		||||
  *                  (by setting the EWUP bit) when the WKUP pin level is already high.
 | 
			
		||||
  *            @arg PWR_FLAG_SB: StandBy flag. This flag indicates that the system was
 | 
			
		||||
  *                  resumed from StandBy mode.
 | 
			
		||||
  *            @arg PWR_FLAG_PVDO: PVD Output. This flag is valid only if PVD is enabled
 | 
			
		||||
  *                  by the HAL_PWR_EnablePVD() function. The PVD is stopped by Standby mode
 | 
			
		||||
  *                  For this reason, this bit is equal to 0 after Standby or reset
 | 
			
		||||
  *                  until the PVDE bit is set.
 | 
			
		||||
  *            @arg PWR_FLAG_VREFINTRDY: This flag indicates that the internal reference
 | 
			
		||||
  *                  voltage VREFINT is ready.
 | 
			
		||||
  * @retval The new state of __FLAG__ (TRUE or FALSE).
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_PWR_GET_FLAG(__FLAG__) ((PWR->CSR & (__FLAG__)) == (__FLAG__))
 | 
			
		||||
 | 
			
		||||
/** @brief  Clear the PWR's pending flags.
 | 
			
		||||
  * @param  __FLAG__ specifies the flag to clear.
 | 
			
		||||
  *          This parameter can be one of the following values:
 | 
			
		||||
  *            @arg PWR_FLAG_WU: Wake Up flag
 | 
			
		||||
  *            @arg PWR_FLAG_SB: StandBy flag
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_PWR_CLEAR_FLAG(__FLAG__) (PWR->CR |=  (__FLAG__) << 2U)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
  
 | 
			
		||||
/* Private macros --------------------------------------------------------*/
 | 
			
		||||
/** @addtogroup  PWR_Private_Macros   PWR Private Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#define IS_PWR_WAKEUP_PIN(PIN) (((PIN) == PWR_WAKEUP_PIN1) || \
 | 
			
		||||
                                ((PIN) == PWR_WAKEUP_PIN2) || \
 | 
			
		||||
                                ((PIN) == PWR_WAKEUP_PIN3))
 | 
			
		||||
                                
 | 
			
		||||
#define IS_PWR_REGULATOR(REGULATOR) (((REGULATOR) == PWR_MAINREGULATOR_ON) || \
 | 
			
		||||
                                     ((REGULATOR) == PWR_LOWPOWERREGULATOR_ON))
 | 
			
		||||
                                     
 | 
			
		||||
#define IS_PWR_SLEEP_ENTRY(ENTRY) (((ENTRY) == PWR_SLEEPENTRY_WFI) || ((ENTRY) == PWR_SLEEPENTRY_WFE))
 | 
			
		||||
 | 
			
		||||
#define IS_PWR_STOP_ENTRY(ENTRY) (((ENTRY) == PWR_STOPENTRY_WFI) || ((ENTRY) == PWR_STOPENTRY_WFE))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */    
 | 
			
		||||
 | 
			
		||||
/* Include PWR HAL Extended module */
 | 
			
		||||
#include "stm32f3xx_hal_pwr_ex.h"
 | 
			
		||||
 | 
			
		||||
/* Exported functions --------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/** @addtogroup PWR_Exported_Functions PWR Exported Functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
  
 | 
			
		||||
/** @addtogroup PWR_Exported_Functions_Group1 Initialization and de-initialization functions 
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Initialization and de-initialization functions *****************************/
 | 
			
		||||
void HAL_PWR_DeInit(void);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup PWR_Exported_Functions_Group2 Peripheral Control functions 
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Peripheral Control functions  **********************************************/
 | 
			
		||||
void HAL_PWR_EnableBkUpAccess(void);
 | 
			
		||||
void HAL_PWR_DisableBkUpAccess(void);
 | 
			
		||||
 | 
			
		||||
/* WakeUp pins configuration functions ****************************************/
 | 
			
		||||
void HAL_PWR_EnableWakeUpPin(uint32_t WakeUpPinx);
 | 
			
		||||
void HAL_PWR_DisableWakeUpPin(uint32_t WakeUpPinx);
 | 
			
		||||
 | 
			
		||||
/* Low Power modes configuration functions ************************************/
 | 
			
		||||
void HAL_PWR_EnterSTOPMode(uint32_t Regulator, uint8_t STOPEntry);
 | 
			
		||||
void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry);
 | 
			
		||||
void HAL_PWR_EnterSTANDBYMode(void);
 | 
			
		||||
 | 
			
		||||
void HAL_PWR_EnableSleepOnExit(void);
 | 
			
		||||
void HAL_PWR_DisableSleepOnExit(void);
 | 
			
		||||
void HAL_PWR_EnableSEVOnPend(void);
 | 
			
		||||
void HAL_PWR_DisableSEVOnPend(void);
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif /* __STM32F3xx_HAL_PWR_H */
 | 
			
		||||
@ -0,0 +1,319 @@
 | 
			
		||||
/**
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @file    stm32f3xx_hal_pwr_ex.h
 | 
			
		||||
  * @author  MCD Application Team
 | 
			
		||||
  * @brief   Header file of PWR HAL Extended module.
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @attention
 | 
			
		||||
  *
 | 
			
		||||
  * Copyright (c) 2016 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 __STM32F3xx_HAL_PWR_EX_H
 | 
			
		||||
#define __STM32F3xx_HAL_PWR_EX_H
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
 extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Includes ------------------------------------------------------------------*/
 | 
			
		||||
#include "stm32f3xx_hal_def.h"
 | 
			
		||||
 | 
			
		||||
/** @addtogroup STM32F3xx_HAL_Driver
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup PWREx
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported types ------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/** @defgroup PWREx_Exported_Types PWR Extended Exported Types
 | 
			
		||||
 *  @{
 | 
			
		||||
 */
 | 
			
		||||
#if defined(STM32F302xE) || defined(STM32F303xE) || \
 | 
			
		||||
    defined(STM32F302xC) || defined(STM32F303xC) || \
 | 
			
		||||
    defined(STM32F303x8) || defined(STM32F334x8) || \
 | 
			
		||||
    defined(STM32F301x8) || defined(STM32F302x8) || \
 | 
			
		||||
    defined(STM32F373xC) 
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  PWR PVD configuration structure definition
 | 
			
		||||
  */
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
  uint32_t PVDLevel;   /*!< PVDLevel: Specifies the PVD detection level
 | 
			
		||||
                            This parameter can be a value of @ref PWREx_PVD_detection_level */
 | 
			
		||||
 | 
			
		||||
  uint32_t Mode;       /*!< Mode: Specifies the operating mode for the selected pins.
 | 
			
		||||
                            This parameter can be a value of @ref PWREx_PVD_Mode */
 | 
			
		||||
}PWR_PVDTypeDef;
 | 
			
		||||
#endif /* STM32F302xE || STM32F303xE || */
 | 
			
		||||
       /* STM32F302xC || STM32F303xC || */
 | 
			
		||||
       /* STM32F303x8 || STM32F334x8 || */
 | 
			
		||||
       /* STM32F301x8 || STM32F302x8 || */
 | 
			
		||||
       /* STM32F373xC                   */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported constants --------------------------------------------------------*/
 | 
			
		||||
/** @defgroup PWREx_Exported_Constants PWR Extended Exported Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#if defined(STM32F302xE) || defined(STM32F303xE) || \
 | 
			
		||||
    defined(STM32F302xC) || defined(STM32F303xC) || \
 | 
			
		||||
    defined(STM32F303x8) || defined(STM32F334x8) || \
 | 
			
		||||
    defined(STM32F301x8) || defined(STM32F302x8) || \
 | 
			
		||||
    defined(STM32F373xC)
 | 
			
		||||
    
 | 
			
		||||
/** @defgroup PWREx_PVD_detection_level PWR Extended PVD detection level
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define PWR_PVDLEVEL_0                  PWR_CR_PLS_LEV0    /*!< PVD threshold around 2.2 V */                                    
 | 
			
		||||
#define PWR_PVDLEVEL_1                  PWR_CR_PLS_LEV1    /*!< PVD threshold around 2.3 V */                                    
 | 
			
		||||
#define PWR_PVDLEVEL_2                  PWR_CR_PLS_LEV2    /*!< PVD threshold around 2.4 V */                                    
 | 
			
		||||
#define PWR_PVDLEVEL_3                  PWR_CR_PLS_LEV3    /*!< PVD threshold around 2.5 V */                                    
 | 
			
		||||
#define PWR_PVDLEVEL_4                  PWR_CR_PLS_LEV4    /*!< PVD threshold around 2.6 V */                                    
 | 
			
		||||
#define PWR_PVDLEVEL_5                  PWR_CR_PLS_LEV5    /*!< PVD threshold around 2.7 V */                                    
 | 
			
		||||
#define PWR_PVDLEVEL_6                  PWR_CR_PLS_LEV6    /*!< PVD threshold around 2.8 V */                                    
 | 
			
		||||
#define PWR_PVDLEVEL_7                  PWR_CR_PLS_LEV7    /*!< PVD threshold around 2.9 V */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup PWREx_PVD_Mode PWR Extended PVD Mode
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define PWR_PVD_MODE_NORMAL                 (0x00000000U)   /*!< Basic mode is used */
 | 
			
		||||
#define PWR_PVD_MODE_IT_RISING              (0x00010001U)   /*!< External Interrupt Mode with Rising edge trigger detection */
 | 
			
		||||
#define PWR_PVD_MODE_IT_FALLING             (0x00010002U)   /*!< External Interrupt Mode with Falling edge trigger detection */
 | 
			
		||||
#define PWR_PVD_MODE_IT_RISING_FALLING      (0x00010003U)   /*!< External Interrupt Mode with Rising/Falling edge trigger detection */
 | 
			
		||||
#define PWR_PVD_MODE_EVENT_RISING           (0x00020001U)   /*!< Event Mode with Rising edge trigger detection */
 | 
			
		||||
#define PWR_PVD_MODE_EVENT_FALLING          (0x00020002U)   /*!< Event Mode with Falling edge trigger detection */
 | 
			
		||||
#define PWR_PVD_MODE_EVENT_RISING_FALLING   (0x00020003U)   /*!< Event Mode with Rising/Falling edge trigger detection */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#define PWR_EXTI_LINE_PVD  EXTI_IMR_MR16  /*!< External interrupt line 16 Connected to the PVD EXTI Line */
 | 
			
		||||
 | 
			
		||||
#endif /* STM32F302xE || STM32F303xE || */
 | 
			
		||||
       /* STM32F302xC || STM32F303xC || */
 | 
			
		||||
       /* STM32F303x8 || STM32F334x8 || */
 | 
			
		||||
       /* STM32F301x8 || STM32F302x8 || */
 | 
			
		||||
       /* STM32F373xC                   */
 | 
			
		||||
 | 
			
		||||
#if defined(STM32F373xC) || defined(STM32F378xx)
 | 
			
		||||
/** @defgroup PWREx_SDADC_ANALOGx PWR Extended SDADC ANALOGx
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define PWR_SDADC_ANALOG1              ((uint32_t)PWR_CR_ENSD1)   /*!< Enable SDADC1 */ 
 | 
			
		||||
#define PWR_SDADC_ANALOG2              ((uint32_t)PWR_CR_ENSD2)   /*!< Enable SDADC2 */
 | 
			
		||||
#define PWR_SDADC_ANALOG3              ((uint32_t)PWR_CR_ENSD3)   /*!< Enable SDADC3 */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
#endif /* STM32F373xC || STM32F378xx */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported macro ------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup PWREx_Exported_Macros PWR Extended Exported Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#if defined(STM32F302xE) || defined(STM32F303xE) || \
 | 
			
		||||
    defined(STM32F302xC) || defined(STM32F303xC) || \
 | 
			
		||||
    defined(STM32F303x8) || defined(STM32F334x8) || \
 | 
			
		||||
    defined(STM32F301x8) || defined(STM32F302x8) || \
 | 
			
		||||
    defined(STM32F373xC)
 | 
			
		||||
    
 | 
			
		||||
/**
 | 
			
		||||
  * @brief Enable interrupt on PVD Exti Line 16.
 | 
			
		||||
  * @retval None.
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_PWR_PVD_EXTI_ENABLE_IT()      (EXTI->IMR |= (PWR_EXTI_LINE_PVD))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief Disable interrupt on PVD Exti Line 16.
 | 
			
		||||
  * @retval None.
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_PWR_PVD_EXTI_DISABLE_IT()     (EXTI->IMR &= ~(PWR_EXTI_LINE_PVD))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief Generate a Software interrupt on selected EXTI line.
 | 
			
		||||
  * @retval None.
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_PWR_PVD_EXTI_GENERATE_SWIT()  (EXTI->SWIER |= (PWR_EXTI_LINE_PVD))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief Enable event on PVD Exti Line 16.
 | 
			
		||||
  * @retval None.
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_PWR_PVD_EXTI_ENABLE_EVENT()   (EXTI->EMR |= (PWR_EXTI_LINE_PVD))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief Disable event on PVD Exti Line 16.
 | 
			
		||||
  * @retval None.
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_PWR_PVD_EXTI_DISABLE_EVENT()  (EXTI->EMR &= ~(PWR_EXTI_LINE_PVD))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief Disable the PVD Extended Interrupt Rising Trigger.
 | 
			
		||||
  * @retval None.
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE()  CLEAR_BIT(EXTI->RTSR, PWR_EXTI_LINE_PVD)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief Disable the PVD Extended Interrupt Falling Trigger.
 | 
			
		||||
  * @retval None.
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE()  CLEAR_BIT(EXTI->FTSR, PWR_EXTI_LINE_PVD)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief Disable the PVD Extended Interrupt Rising & Falling Trigger.
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_PWR_PVD_EXTI_DISABLE_RISING_FALLING_EDGE()  __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE();__HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE();
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  PVD EXTI line configuration: set falling edge trigger.
 | 
			
		||||
  * @retval None.
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE()  EXTI->FTSR |= (PWR_EXTI_LINE_PVD)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  PVD EXTI line configuration: set rising edge trigger.
 | 
			
		||||
  * @retval None.
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE()   EXTI->RTSR |= (PWR_EXTI_LINE_PVD)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Enable the PVD Extended Interrupt Rising & Falling Trigger.
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_PWR_PVD_EXTI_ENABLE_RISING_FALLING_EDGE()   __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE();__HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE();
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief Check whether the specified PVD EXTI interrupt flag is set or not.
 | 
			
		||||
  * @retval EXTI PVD Line Status.
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_PWR_PVD_EXTI_GET_FLAG()       (EXTI->PR & (PWR_EXTI_LINE_PVD))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief Clear the PVD EXTI flag.
 | 
			
		||||
  * @retval None.
 | 
			
		||||
  */
 | 
			
		||||
#define __HAL_PWR_PVD_EXTI_CLEAR_FLAG()     (EXTI->PR = (PWR_EXTI_LINE_PVD))
 | 
			
		||||
 | 
			
		||||
#endif /* STM32F302xE || STM32F303xE || */
 | 
			
		||||
       /* STM32F302xC || STM32F303xC || */
 | 
			
		||||
       /* STM32F303x8 || STM32F334x8 || */
 | 
			
		||||
       /* STM32F301x8 || STM32F302x8 || */
 | 
			
		||||
       /* STM32F373xC                   */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
  
 | 
			
		||||
/* Private macros --------------------------------------------------------*/
 | 
			
		||||
/** @addtogroup  PWREx_Private_Macros   PWR Extended Private Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#if defined(STM32F302xE) || defined(STM32F303xE) || \
 | 
			
		||||
    defined(STM32F302xC) || defined(STM32F303xC) || \
 | 
			
		||||
    defined(STM32F303x8) || defined(STM32F334x8) || \
 | 
			
		||||
    defined(STM32F301x8) || defined(STM32F302x8) || \
 | 
			
		||||
    defined(STM32F373xC)
 | 
			
		||||
#define IS_PWR_PVD_LEVEL(LEVEL) (((LEVEL) == PWR_PVDLEVEL_0) || ((LEVEL) == PWR_PVDLEVEL_1)|| \
 | 
			
		||||
                                 ((LEVEL) == PWR_PVDLEVEL_2) || ((LEVEL) == PWR_PVDLEVEL_3)|| \
 | 
			
		||||
                                 ((LEVEL) == PWR_PVDLEVEL_4) || ((LEVEL) == PWR_PVDLEVEL_5)|| \
 | 
			
		||||
                                 ((LEVEL) == PWR_PVDLEVEL_6) || ((LEVEL) == PWR_PVDLEVEL_7))
 | 
			
		||||
 | 
			
		||||
#define IS_PWR_PVD_MODE(MODE) (((MODE) == PWR_PVD_MODE_IT_RISING)|| ((MODE) == PWR_PVD_MODE_IT_FALLING) || \
 | 
			
		||||
                              ((MODE) == PWR_PVD_MODE_IT_RISING_FALLING) || ((MODE) == PWR_PVD_MODE_EVENT_RISING) || \
 | 
			
		||||
                              ((MODE) == PWR_PVD_MODE_EVENT_FALLING) || ((MODE) == PWR_PVD_MODE_EVENT_RISING_FALLING) || \
 | 
			
		||||
                              ((MODE) == PWR_PVD_MODE_NORMAL))
 | 
			
		||||
#endif /* STM32F302xE || STM32F303xE || */
 | 
			
		||||
       /* STM32F302xC || STM32F303xC || */
 | 
			
		||||
       /* STM32F303x8 || STM32F334x8 || */
 | 
			
		||||
       /* STM32F301x8 || STM32F302x8 || */
 | 
			
		||||
       /* STM32F373xC                   */
 | 
			
		||||
 | 
			
		||||
#if defined(STM32F373xC) || defined(STM32F378xx)
 | 
			
		||||
#define IS_PWR_SDADC_ANALOG(SDADC) (((SDADC) == PWR_SDADC_ANALOG1) || \
 | 
			
		||||
                                    ((SDADC) == PWR_SDADC_ANALOG2) || \
 | 
			
		||||
                                    ((SDADC) == PWR_SDADC_ANALOG3))
 | 
			
		||||
#endif /* STM32F373xC || STM32F378xx */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */    
 | 
			
		||||
 | 
			
		||||
/* Exported functions --------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/** @addtogroup PWREx_Exported_Functions PWR Extended Exported Functions
 | 
			
		||||
 *  @{
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup PWREx_Exported_Functions_Group1 Peripheral Extended Control Functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/* Peripheral Extended control functions **************************************/
 | 
			
		||||
#if defined(STM32F302xE) || defined(STM32F303xE) || \
 | 
			
		||||
    defined(STM32F302xC) || defined(STM32F303xC) || \
 | 
			
		||||
    defined(STM32F303x8) || defined(STM32F334x8) || \
 | 
			
		||||
    defined(STM32F301x8) || defined(STM32F302x8) || \
 | 
			
		||||
    defined(STM32F373xC)
 | 
			
		||||
void HAL_PWR_ConfigPVD(PWR_PVDTypeDef *sConfigPVD);
 | 
			
		||||
void HAL_PWR_EnablePVD(void);
 | 
			
		||||
void HAL_PWR_DisablePVD(void);
 | 
			
		||||
void HAL_PWR_PVD_IRQHandler(void);
 | 
			
		||||
void HAL_PWR_PVDCallback(void);
 | 
			
		||||
#endif /* STM32F302xE || STM32F303xE || */
 | 
			
		||||
       /* STM32F302xC || STM32F303xC || */
 | 
			
		||||
       /* STM32F303x8 || STM32F334x8 || */
 | 
			
		||||
       /* STM32F301x8 || STM32F302x8 || */
 | 
			
		||||
       /* STM32F373xC                   */
 | 
			
		||||
 | 
			
		||||
#if defined(STM32F373xC) || defined(STM32F378xx)
 | 
			
		||||
void HAL_PWREx_EnableSDADC(uint32_t Analogx);
 | 
			
		||||
void HAL_PWREx_DisableSDADC(uint32_t Analogx);
 | 
			
		||||
#endif /* STM32F373xC || STM32F378xx */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* __STM32F3xx_HAL_PWR_EX_H */
 | 
			
		||||
							
								
								
									
										1737
									
								
								Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_rcc.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1737
									
								
								Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_rcc.h
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										2559
									
								
								Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tim.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2559
									
								
								Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tim.h
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -0,0 +1,342 @@
 | 
			
		||||
/**
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @file    stm32f3xx_hal_tim_ex.h
 | 
			
		||||
  * @author  MCD Application Team
 | 
			
		||||
  * @brief   Header file of TIM HAL Extended module.
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @attention
 | 
			
		||||
  *
 | 
			
		||||
  * Copyright (c) 2016 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 STM32F3xx_HAL_TIM_EX_H
 | 
			
		||||
#define STM32F3xx_HAL_TIM_EX_H
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Includes ------------------------------------------------------------------*/
 | 
			
		||||
#include "stm32f3xx_hal_def.h"
 | 
			
		||||
 | 
			
		||||
/** @addtogroup STM32F3xx_HAL_Driver
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup TIMEx
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported types ------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup TIMEx_Exported_Types TIM Extended Exported Types
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  TIM Hall sensor Configuration Structure definition
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
  uint32_t IC1Polarity;         /*!< Specifies the active edge of the input signal.
 | 
			
		||||
                                     This parameter can be a value of @ref TIM_Input_Capture_Polarity */
 | 
			
		||||
 | 
			
		||||
  uint32_t IC1Prescaler;        /*!< Specifies the Input Capture Prescaler.
 | 
			
		||||
                                     This parameter can be a value of @ref TIM_Input_Capture_Prescaler */
 | 
			
		||||
 | 
			
		||||
  uint32_t IC1Filter;           /*!< Specifies the input capture filter.
 | 
			
		||||
                                     This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */
 | 
			
		||||
 | 
			
		||||
  uint32_t Commutation_Delay;   /*!< Specifies the pulse value to be loaded into the Capture Compare Register.
 | 
			
		||||
                                     This parameter can be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */
 | 
			
		||||
} TIM_HallSensor_InitTypeDef;
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
/* End of exported types -----------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/* Exported constants --------------------------------------------------------*/
 | 
			
		||||
/** @defgroup TIMEx_Exported_Constants TIM Extended Exported Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup TIMEx_Remap TIM Extended Remapping
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#if defined(TIM1)
 | 
			
		||||
#define TIM_TIM1_ADC1_NONE                     (0x00000000U) /*!< TIM1_ETR is not connected to any AWD (analog watchdog)*/
 | 
			
		||||
#define TIM_TIM1_ADC1_AWD1                     (0x00000001U) /*!< TIM1_ETR is connected to ADC1 AWD1 */
 | 
			
		||||
#define TIM_TIM1_ADC1_AWD2                     (0x00000002U) /*!< TIM1_ETR is connected to ADC1 AWD2 */
 | 
			
		||||
#define TIM_TIM1_ADC1_AWD3                     (0x00000003U) /*!< TIM1_ETR is connected to ADC1 AWD3 */
 | 
			
		||||
 | 
			
		||||
#if defined(ADC4)
 | 
			
		||||
#define TIM_TIM1_ADC4_NONE                     (0x00000000U) /*!< TIM1_ETR is not connected to any AWD (analog watchdog)*/
 | 
			
		||||
#define TIM_TIM1_ADC4_AWD1                     (0x00000004U) /*!< TIM1_ETR is connected to ADC4 AWD1 */
 | 
			
		||||
#define TIM_TIM1_ADC4_AWD2                     (0x00000008U) /*!< TIM1_ETR is connected to ADC4 AWD2 */
 | 
			
		||||
#define TIM_TIM1_ADC4_AWD3                     (0x0000000CU) /*!< TIM1_ETR is connected to ADC4 AWD3 */
 | 
			
		||||
#elif defined(ADC2)
 | 
			
		||||
#define TIM_TIM1_ADC2_NONE                     (0x00000000U) /*!< TIM1_ETR is not connected to any AWD (analog watchdog)*/
 | 
			
		||||
#define TIM_TIM1_ADC2_AWD1                     (0x00000004U) /*!< TIM1_ETR is connected to ADC2 AWD1 */
 | 
			
		||||
#define TIM_TIM1_ADC2_AWD2                     (0x00000008U) /*!< TIM1_ETR is connected to ADC2 AWD2 */
 | 
			
		||||
#define TIM_TIM1_ADC2_AWD3                     (0x0000000CU) /*!< TIM1_ETR is connected to ADC2 AWD3 */
 | 
			
		||||
#endif /* ADC4 */
 | 
			
		||||
#endif /* TIM1 */
 | 
			
		||||
 | 
			
		||||
#if defined(TIM8)
 | 
			
		||||
#define TIM_TIM8_ADC2_NONE                     (0x00000000U) /*!< TIM8_ETR is not connected to any AWD (analog watchdog) */
 | 
			
		||||
#define TIM_TIM8_ADC2_AWD1                     (0x00000001U) /*!< TIM8_ETR is connected to ADC2 AWD1 */
 | 
			
		||||
#define TIM_TIM8_ADC2_AWD2                     (0x00000002U) /*!< TIM8_ETR is connected to ADC2 AWD2 */
 | 
			
		||||
#define TIM_TIM8_ADC2_AWD3                     (0x00000003U) /*!< TIM8_ETR is connected to ADC2 AWD3 */
 | 
			
		||||
 | 
			
		||||
#define TIM_TIM8_ADC3_NONE                     (0x00000000U) /*!< TIM8_ETR is not connected to any AWD (analog watchdog) */
 | 
			
		||||
#define TIM_TIM8_ADC3_AWD1                     (0x00000004U) /*!< TIM8_ETR is connected to ADC3 AWD1 */
 | 
			
		||||
#define TIM_TIM8_ADC3_AWD2                     (0x00000008U) /*!< TIM8_ETR is connected to ADC3 AWD2 */
 | 
			
		||||
#define TIM_TIM8_ADC3_AWD3                     (0x0000000CU) /*!< TIM8_ETR is connected to ADC3 AWD3 */
 | 
			
		||||
#endif /* TIM8 */
 | 
			
		||||
 | 
			
		||||
#if defined(TIM14)
 | 
			
		||||
#define TIM_TIM14_GPIO                         (0x00000000U) /*!< TIM14 TI1 is connected to GPIO */
 | 
			
		||||
#define TIM_TIM14_RTC                          (0x00000001U) /*!< TIM14 TI1 is connected to RTC_clock */
 | 
			
		||||
#define TIM_TIM14_HSE                          (0x00000002U) /*!< TIM14 TI1 is connected to HSE/32U */
 | 
			
		||||
#define TIM_TIM14_MCO                          (0x00000003U) /*!< TIM14 TI1 is connected to MCO */
 | 
			
		||||
#endif /* TIM14 */
 | 
			
		||||
 | 
			
		||||
#if defined(TIM16)
 | 
			
		||||
#define TIM_TIM16_GPIO                         (0x00000000U) /*!< TIM16 TI1 is connected to GPIO */
 | 
			
		||||
#define TIM_TIM16_RTC                          (0x00000001U) /*!< TIM16 TI1 is connected to RTC_clock */
 | 
			
		||||
#define TIM_TIM16_HSE                          (0x00000002U) /*!< TIM16 TI1 is connected to HSE/32 */
 | 
			
		||||
#define TIM_TIM16_MCO                          (0x00000003U) /*!< TIM16 TI1 is connected to MCO */
 | 
			
		||||
#endif /* TIM16 */
 | 
			
		||||
 | 
			
		||||
#if defined(TIM20)
 | 
			
		||||
#define TIM_TIM20_ADC3_NONE                    (0x00000000U) /*!< TIM20_ETR is not connected to any AWD (analog watchdog) */
 | 
			
		||||
#define TIM_TIM20_ADC3_AWD1                    (0x00000001U) /*!< TIM20_ETR is connected to ADC3 AWD1 */
 | 
			
		||||
#define TIM_TIM20_ADC3_AWD2                    (0x00000002U) /*!< TIM20_ETR is connected to ADC3 AWD2 */
 | 
			
		||||
#define TIM_TIM20_ADC3_AWD3                    (0x00000003U) /*!< TIM20_ETR is connected to ADC3 AWD3 */
 | 
			
		||||
 | 
			
		||||
#define TIM_TIM20_ADC4_NONE                    (0x00000000U) /*!< TIM20_ETR is not connected to any AWD (analog watchdog) */
 | 
			
		||||
#define TIM_TIM20_ADC4_AWD1                    (0x00000004U) /*!< TIM20_ETR is connected to ADC4 AWD1 */
 | 
			
		||||
#define TIM_TIM20_ADC4_AWD2                    (0x00000008U) /*!< TIM20_ETR is connected to ADC4 AWD2 */
 | 
			
		||||
#define TIM_TIM20_ADC4_AWD3                    (0x0000000CU) /*!< TIM20_ETR is connected to ADC4 AWD3 */
 | 
			
		||||
#endif /* TIM20 */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
/* End of exported constants -------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/* Exported macro ------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup TIMEx_Exported_Macros TIM Extended Exported Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
/* End of exported macro -----------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/* Private macro -------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup TIMEx_Private_Macros TIM Extended Private Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#if defined(TIM1) && defined(TIM8) && defined(TIM20) && defined(TIM16)
 | 
			
		||||
#define IS_TIM_REMAP(__INSTANCE__, __REMAP__)                                        \
 | 
			
		||||
  ((((__INSTANCE__) == TIM1)  && ((((__REMAP__) & 0xFFFFFFF0U) == 0x00000000U)))     \
 | 
			
		||||
   || (((__INSTANCE__) == TIM8)  && ((((__REMAP__) & 0xFFFFFFF0U) == 0x00000000U)))  \
 | 
			
		||||
   || (((__INSTANCE__) == TIM20) && ((((__REMAP__) & 0xFFFFFFF0U) == 0x00000000U)))  \
 | 
			
		||||
   || (((__INSTANCE__) == TIM16) && ((((__REMAP__) & 0xFFFFFFFCU) == 0x00000000U))))
 | 
			
		||||
#elif defined(TIM1) && defined(TIM8) && defined(TIM16)
 | 
			
		||||
#define IS_TIM_REMAP(__INSTANCE__, __REMAP__)                                        \
 | 
			
		||||
  ((((__INSTANCE__) == TIM1)  && ((((__REMAP__) & 0xFFFFFFF0U) == 0x00000000U)))     \
 | 
			
		||||
   || (((__INSTANCE__) == TIM8)  && ((((__REMAP__) & 0xFFFFFFF0U) == 0x00000000U)))  \
 | 
			
		||||
   || (((__INSTANCE__) == TIM16) && ((((__REMAP__) & 0xFFFFFFFCU) == 0x00000000U))))
 | 
			
		||||
#elif defined(TIM1) && defined(TIM16)
 | 
			
		||||
#define IS_TIM_REMAP(__INSTANCE__, __REMAP__)                                        \
 | 
			
		||||
  ((((__INSTANCE__) == TIM1)  && ((((__REMAP__) & 0xFFFFFFF0U) == 0x00000000U)))     \
 | 
			
		||||
   || (((__INSTANCE__) == TIM16) && ((((__REMAP__) & 0xFFFFFFFCU) == 0x00000000U))))
 | 
			
		||||
#elif defined(TIM14)
 | 
			
		||||
#define IS_TIM_REMAP(__INSTANCE__, __REMAP__)                                        \
 | 
			
		||||
  (((__INSTANCE__) == TIM14)  && (((__REMAP__) & 0xFFFFFFFCU) == 0x00000000U))
 | 
			
		||||
#endif /* TIM1 && TIM8 && TIM20 && TIM16 */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
/* End of private macro ------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/* Exported functions --------------------------------------------------------*/
 | 
			
		||||
/** @addtogroup TIMEx_Exported_Functions TIM Extended Exported Functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup TIMEx_Exported_Functions_Group1 Extended Timer Hall Sensor functions
 | 
			
		||||
  *  @brief    Timer Hall Sensor functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/*  Timer Hall Sensor functions  **********************************************/
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Init(TIM_HandleTypeDef *htim, const TIM_HallSensor_InitTypeDef *sConfig);
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_HallSensor_DeInit(TIM_HandleTypeDef *htim);
 | 
			
		||||
 | 
			
		||||
void HAL_TIMEx_HallSensor_MspInit(TIM_HandleTypeDef *htim);
 | 
			
		||||
void HAL_TIMEx_HallSensor_MspDeInit(TIM_HandleTypeDef *htim);
 | 
			
		||||
 | 
			
		||||
/* Blocking mode: Polling */
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start(TIM_HandleTypeDef *htim);
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop(TIM_HandleTypeDef *htim);
 | 
			
		||||
/* Non-Blocking mode: Interrupt */
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_IT(TIM_HandleTypeDef *htim);
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_IT(TIM_HandleTypeDef *htim);
 | 
			
		||||
/* Non-Blocking mode: DMA */
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_DMA(TIM_HandleTypeDef *htim, uint32_t *pData, uint16_t Length);
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_DMA(TIM_HandleTypeDef *htim);
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup TIMEx_Exported_Functions_Group2 Extended Timer Complementary Output Compare functions
 | 
			
		||||
  *  @brief   Timer Complementary Output Compare functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/*  Timer Complementary Output Compare functions  *****************************/
 | 
			
		||||
/* Blocking mode: Polling */
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_OCN_Start(TIM_HandleTypeDef *htim, uint32_t Channel);
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_OCN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel);
 | 
			
		||||
 | 
			
		||||
/* Non-Blocking mode: Interrupt */
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_OCN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
 | 
			
		||||
 | 
			
		||||
/* Non-Blocking mode: DMA */
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_OCN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, const uint32_t *pData,
 | 
			
		||||
                                          uint16_t Length);
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel);
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup TIMEx_Exported_Functions_Group3 Extended Timer Complementary PWM functions
 | 
			
		||||
  *  @brief    Timer Complementary PWM functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/*  Timer Complementary PWM functions  ****************************************/
 | 
			
		||||
/* Blocking mode: Polling */
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_PWMN_Start(TIM_HandleTypeDef *htim, uint32_t Channel);
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel);
 | 
			
		||||
 | 
			
		||||
/* Non-Blocking mode: Interrupt */
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
 | 
			
		||||
/* Non-Blocking mode: DMA */
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, const uint32_t *pData,
 | 
			
		||||
                                           uint16_t Length);
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel);
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup TIMEx_Exported_Functions_Group4 Extended Timer Complementary One Pulse functions
 | 
			
		||||
  *  @brief    Timer Complementary One Pulse functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/*  Timer Complementary One Pulse functions  **********************************/
 | 
			
		||||
/* Blocking mode: Polling */
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start(TIM_HandleTypeDef *htim, uint32_t OutputChannel);
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop(TIM_HandleTypeDef *htim, uint32_t OutputChannel);
 | 
			
		||||
 | 
			
		||||
/* Non-Blocking mode: Interrupt */
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel);
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel);
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup TIMEx_Exported_Functions_Group5 Extended Peripheral Control functions
 | 
			
		||||
  *  @brief    Peripheral Control functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/* Extended Control functions  ************************************************/
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent(TIM_HandleTypeDef *htim, uint32_t  InputTrigger,
 | 
			
		||||
                                              uint32_t  CommutationSource);
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent_IT(TIM_HandleTypeDef *htim, uint32_t  InputTrigger,
 | 
			
		||||
                                                 uint32_t  CommutationSource);
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent_DMA(TIM_HandleTypeDef *htim, uint32_t  InputTrigger,
 | 
			
		||||
                                                  uint32_t  CommutationSource);
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization(TIM_HandleTypeDef *htim,
 | 
			
		||||
                                                        const TIM_MasterConfigTypeDef *sMasterConfig);
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime(TIM_HandleTypeDef *htim,
 | 
			
		||||
                                                const TIM_BreakDeadTimeConfigTypeDef *sBreakDeadTimeConfig);
 | 
			
		||||
#if defined(TIM_CCR5_CCR5)
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_GroupChannel5(TIM_HandleTypeDef *htim, uint32_t Channels);
 | 
			
		||||
#endif /* TIM_CCR5_CCR5 */
 | 
			
		||||
HAL_StatusTypeDef HAL_TIMEx_RemapConfig(TIM_HandleTypeDef *htim, uint32_t Remap);
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup TIMEx_Exported_Functions_Group6 Extended Callbacks functions
 | 
			
		||||
  * @brief    Extended Callbacks functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/* Extended Callback **********************************************************/
 | 
			
		||||
void HAL_TIMEx_CommutCallback(TIM_HandleTypeDef *htim);
 | 
			
		||||
void HAL_TIMEx_CommutHalfCpltCallback(TIM_HandleTypeDef *htim);
 | 
			
		||||
void HAL_TIMEx_BreakCallback(TIM_HandleTypeDef *htim);
 | 
			
		||||
#if defined(TIM_BDTR_BK2E)
 | 
			
		||||
void HAL_TIMEx_Break2Callback(TIM_HandleTypeDef *htim);
 | 
			
		||||
#endif /* TIM_BDTR_BK2E */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup TIMEx_Exported_Functions_Group7 Extended Peripheral State functions
 | 
			
		||||
  * @brief    Extended Peripheral State functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/* Extended Peripheral State functions  ***************************************/
 | 
			
		||||
HAL_TIM_StateTypeDef HAL_TIMEx_HallSensor_GetState(const TIM_HandleTypeDef *htim);
 | 
			
		||||
HAL_TIM_ChannelStateTypeDef HAL_TIMEx_GetChannelNState(const TIM_HandleTypeDef *htim,  uint32_t ChannelN);
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
/* End of exported functions -------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/* Private functions----------------------------------------------------------*/
 | 
			
		||||
/** @addtogroup TIMEx_Private_Functions TIM Extended Private Functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
void TIMEx_DMACommutationCplt(DMA_HandleTypeDef *hdma);
 | 
			
		||||
void TIMEx_DMACommutationHalfCplt(DMA_HandleTypeDef *hdma);
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
/* End of private functions --------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif /* STM32F3xx_HAL_TIM_EX_H */
 | 
			
		||||
							
								
								
									
										1588
									
								
								Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_uart.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1588
									
								
								Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_uart.h
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -0,0 +1,513 @@
 | 
			
		||||
/**
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @file    stm32f3xx_hal_uart_ex.h
 | 
			
		||||
  * @author  MCD Application Team
 | 
			
		||||
  * @brief   Header file of UART HAL Extended module.
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @attention
 | 
			
		||||
  *
 | 
			
		||||
  * Copyright (c) 2016 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 STM32F3xx_HAL_UART_EX_H
 | 
			
		||||
#define STM32F3xx_HAL_UART_EX_H
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Includes ------------------------------------------------------------------*/
 | 
			
		||||
#include "stm32f3xx_hal_def.h"
 | 
			
		||||
 | 
			
		||||
/** @addtogroup STM32F3xx_HAL_Driver
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup UARTEx
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported types ------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup UARTEx_Exported_Types UARTEx Exported Types
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  UART wake up from stop mode parameters
 | 
			
		||||
  */
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
  uint32_t WakeUpEvent;        /*!< Specifies which event will activate the Wakeup from Stop mode flag (WUF).
 | 
			
		||||
                                    This parameter can be a value of @ref UART_WakeUp_from_Stop_Selection.
 | 
			
		||||
                                    If set to UART_WAKEUP_ON_ADDRESS, the two other fields below must
 | 
			
		||||
                                    be filled up. */
 | 
			
		||||
 | 
			
		||||
  uint16_t AddressLength;      /*!< Specifies whether the address is 4 or 7-bit long.
 | 
			
		||||
                                    This parameter can be a value of @ref UARTEx_WakeUp_Address_Length.  */
 | 
			
		||||
 | 
			
		||||
  uint8_t Address;             /*!< UART/USART node address (7-bit long max). */
 | 
			
		||||
} UART_WakeUpTypeDef;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported constants --------------------------------------------------------*/
 | 
			
		||||
/** @defgroup UARTEx_Exported_Constants UARTEx Exported Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup UARTEx_Word_Length UARTEx Word Length
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#if defined(USART_CR1_M1)
 | 
			
		||||
#define UART_WORDLENGTH_7B          USART_CR1_M1   /*!< 7-bit long UART frame */
 | 
			
		||||
#endif /* USART_CR1_M1 */
 | 
			
		||||
#define UART_WORDLENGTH_8B          0x00000000U    /*!< 8-bit long UART frame */
 | 
			
		||||
#if defined (USART_CR1_M0)
 | 
			
		||||
#define UART_WORDLENGTH_9B          USART_CR1_M0   /*!< 9-bit long UART frame */
 | 
			
		||||
#else
 | 
			
		||||
#define UART_WORDLENGTH_9B          USART_CR1_M   /*!< 9-bit long UART frame */
 | 
			
		||||
#endif /* USART_CR1_M0 */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup UARTEx_WakeUp_Address_Length UARTEx WakeUp Address Length
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define UART_ADDRESS_DETECT_4B      0x00000000U      /*!< 4-bit long wake-up address */
 | 
			
		||||
#define UART_ADDRESS_DETECT_7B      USART_CR2_ADDM7  /*!< 7-bit long wake-up address */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported macros -----------------------------------------------------------*/
 | 
			
		||||
/* Exported functions --------------------------------------------------------*/
 | 
			
		||||
/** @addtogroup UARTEx_Exported_Functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup UARTEx_Exported_Functions_Group1
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Initialization and de-initialization functions  ****************************/
 | 
			
		||||
HAL_StatusTypeDef HAL_RS485Ex_Init(UART_HandleTypeDef *huart, uint32_t Polarity, uint32_t AssertionTime,
 | 
			
		||||
                                   uint32_t DeassertionTime);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup UARTEx_Exported_Functions_Group2
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
void HAL_UARTEx_WakeupCallback(UART_HandleTypeDef *huart);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @addtogroup UARTEx_Exported_Functions_Group3
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Peripheral Control functions  **********************************************/
 | 
			
		||||
HAL_StatusTypeDef HAL_UARTEx_StopModeWakeUpSourceConfig(UART_HandleTypeDef *huart, UART_WakeUpTypeDef WakeUpSelection);
 | 
			
		||||
HAL_StatusTypeDef HAL_UARTEx_EnableStopMode(UART_HandleTypeDef *huart);
 | 
			
		||||
HAL_StatusTypeDef HAL_UARTEx_DisableStopMode(UART_HandleTypeDef *huart);
 | 
			
		||||
 | 
			
		||||
HAL_StatusTypeDef HAL_MultiProcessorEx_AddressLength_Set(UART_HandleTypeDef *huart, uint32_t AddressLength);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint16_t *RxLen,
 | 
			
		||||
                                           uint32_t Timeout);
 | 
			
		||||
HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size);
 | 
			
		||||
HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle_DMA(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size);
 | 
			
		||||
 | 
			
		||||
HAL_UART_RxEventTypeTypeDef HAL_UARTEx_GetRxEventType(UART_HandleTypeDef *huart);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Private macros ------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup UARTEx_Private_Macros UARTEx Private Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @brief  Report the UART clock source.
 | 
			
		||||
  * @param  __HANDLE__ specifies the UART Handle.
 | 
			
		||||
  * @param  __CLOCKSOURCE__ output variable.
 | 
			
		||||
  * @retval UART clocking source, written in __CLOCKSOURCE__.
 | 
			
		||||
  */
 | 
			
		||||
#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || defined(STM32F302xC) \
 | 
			
		||||
 || defined(STM32F303xC) || defined(STM32F358xx)
 | 
			
		||||
#define UART_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__)       \
 | 
			
		||||
  do {                                                        \
 | 
			
		||||
    if((__HANDLE__)->Instance == USART1)                      \
 | 
			
		||||
    {                                                         \
 | 
			
		||||
      switch(__HAL_RCC_GET_USART1_SOURCE())                   \
 | 
			
		||||
      {                                                       \
 | 
			
		||||
        case RCC_USART1CLKSOURCE_PCLK2:                       \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK2;         \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_USART1CLKSOURCE_HSI:                         \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI;           \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_USART1CLKSOURCE_SYSCLK:                      \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK;        \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_USART1CLKSOURCE_LSE:                         \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE;           \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        default:                                              \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED;     \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
      }                                                       \
 | 
			
		||||
    }                                                         \
 | 
			
		||||
    else if((__HANDLE__)->Instance == USART2)                 \
 | 
			
		||||
    {                                                         \
 | 
			
		||||
      switch(__HAL_RCC_GET_USART2_SOURCE())                   \
 | 
			
		||||
      {                                                       \
 | 
			
		||||
        case RCC_USART2CLKSOURCE_PCLK1:                       \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1;         \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_USART2CLKSOURCE_HSI:                         \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI;           \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_USART2CLKSOURCE_SYSCLK:                      \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK;        \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_USART2CLKSOURCE_LSE:                         \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE;           \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        default:                                              \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED;     \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
      }                                                       \
 | 
			
		||||
    }                                                         \
 | 
			
		||||
    else if((__HANDLE__)->Instance == USART3)                 \
 | 
			
		||||
    {                                                         \
 | 
			
		||||
      switch(__HAL_RCC_GET_USART3_SOURCE())                   \
 | 
			
		||||
      {                                                       \
 | 
			
		||||
        case RCC_USART3CLKSOURCE_PCLK1:                       \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1;         \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_USART3CLKSOURCE_HSI:                         \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI;           \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_USART3CLKSOURCE_SYSCLK:                      \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK;        \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_USART3CLKSOURCE_LSE:                         \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE;           \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        default:                                              \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED;     \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
      }                                                       \
 | 
			
		||||
    }                                                         \
 | 
			
		||||
    else if((__HANDLE__)->Instance == UART4)                  \
 | 
			
		||||
    {                                                         \
 | 
			
		||||
      switch(__HAL_RCC_GET_UART4_SOURCE())                    \
 | 
			
		||||
      {                                                       \
 | 
			
		||||
        case RCC_UART4CLKSOURCE_PCLK1:                        \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1;         \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_UART4CLKSOURCE_HSI:                          \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI;           \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_UART4CLKSOURCE_SYSCLK:                       \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK;        \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_UART4CLKSOURCE_LSE:                          \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE;           \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        default:                                              \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED;     \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
      }                                                       \
 | 
			
		||||
    }                                                         \
 | 
			
		||||
    else if ((__HANDLE__)->Instance == UART5)                 \
 | 
			
		||||
    {                                                         \
 | 
			
		||||
      switch(__HAL_RCC_GET_UART5_SOURCE())                    \
 | 
			
		||||
      {                                                       \
 | 
			
		||||
        case RCC_UART5CLKSOURCE_PCLK1:                        \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1;         \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_UART5CLKSOURCE_HSI:                          \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI;           \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_UART5CLKSOURCE_SYSCLK:                       \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK;        \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_UART5CLKSOURCE_LSE:                          \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE;           \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        default:                                              \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED;     \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
      }                                                       \
 | 
			
		||||
    }                                                         \
 | 
			
		||||
    else                                                      \
 | 
			
		||||
    {                                                         \
 | 
			
		||||
      (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED;         \
 | 
			
		||||
    }                                                         \
 | 
			
		||||
  } while(0U)
 | 
			
		||||
#elif defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || defined(STM32F301x8) \
 | 
			
		||||
  || defined(STM32F302x8) || defined(STM32F318xx)
 | 
			
		||||
#define UART_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__)       \
 | 
			
		||||
  do {                                                        \
 | 
			
		||||
    if((__HANDLE__)->Instance == USART1)                      \
 | 
			
		||||
    {                                                         \
 | 
			
		||||
      switch(__HAL_RCC_GET_USART1_SOURCE())                   \
 | 
			
		||||
      {                                                       \
 | 
			
		||||
        case RCC_USART1CLKSOURCE_PCLK1:                       \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1;         \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_USART1CLKSOURCE_HSI:                         \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI;           \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_USART1CLKSOURCE_SYSCLK:                      \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK;        \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_USART1CLKSOURCE_LSE:                         \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE;           \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        default:                                              \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED;     \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
      }                                                       \
 | 
			
		||||
    }                                                         \
 | 
			
		||||
    else if((__HANDLE__)->Instance == USART2)                 \
 | 
			
		||||
    {                                                         \
 | 
			
		||||
      (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1;             \
 | 
			
		||||
    }                                                         \
 | 
			
		||||
    else if((__HANDLE__)->Instance == USART3)                 \
 | 
			
		||||
    {                                                         \
 | 
			
		||||
      (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1;             \
 | 
			
		||||
    }                                                         \
 | 
			
		||||
    else                                                      \
 | 
			
		||||
    {                                                         \
 | 
			
		||||
      (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED;         \
 | 
			
		||||
    }                                                         \
 | 
			
		||||
  } while(0U)
 | 
			
		||||
#else
 | 
			
		||||
#define UART_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__)       \
 | 
			
		||||
  do {                                                        \
 | 
			
		||||
    if((__HANDLE__)->Instance == USART1)                      \
 | 
			
		||||
    {                                                         \
 | 
			
		||||
      switch(__HAL_RCC_GET_USART1_SOURCE())                   \
 | 
			
		||||
      {                                                       \
 | 
			
		||||
        case RCC_USART1CLKSOURCE_PCLK2:                       \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK2;         \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_USART1CLKSOURCE_HSI:                         \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI;           \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_USART1CLKSOURCE_SYSCLK:                      \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK;        \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_USART1CLKSOURCE_LSE:                         \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE;           \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        default:                                              \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED;     \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
      }                                                       \
 | 
			
		||||
    }                                                         \
 | 
			
		||||
    else if((__HANDLE__)->Instance == USART2)                 \
 | 
			
		||||
    {                                                         \
 | 
			
		||||
      switch(__HAL_RCC_GET_USART2_SOURCE())                   \
 | 
			
		||||
      {                                                       \
 | 
			
		||||
        case RCC_USART2CLKSOURCE_PCLK1:                       \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1;         \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_USART2CLKSOURCE_HSI:                         \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI;           \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_USART2CLKSOURCE_SYSCLK:                      \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK;        \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_USART2CLKSOURCE_LSE:                         \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE;           \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        default:                                              \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED;     \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
      }                                                       \
 | 
			
		||||
    }                                                         \
 | 
			
		||||
    else if((__HANDLE__)->Instance == USART3)                 \
 | 
			
		||||
    {                                                         \
 | 
			
		||||
      switch(__HAL_RCC_GET_USART3_SOURCE())                   \
 | 
			
		||||
      {                                                       \
 | 
			
		||||
        case RCC_USART3CLKSOURCE_PCLK1:                       \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1;         \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_USART3CLKSOURCE_HSI:                         \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI;           \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_USART3CLKSOURCE_SYSCLK:                      \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK;        \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        case RCC_USART3CLKSOURCE_LSE:                         \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE;           \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
        default:                                              \
 | 
			
		||||
          (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED;     \
 | 
			
		||||
          break;                                              \
 | 
			
		||||
      }                                                       \
 | 
			
		||||
    }                                                         \
 | 
			
		||||
    else                                                      \
 | 
			
		||||
    {                                                         \
 | 
			
		||||
      (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED;         \
 | 
			
		||||
    }                                                         \
 | 
			
		||||
  } while(0U)
 | 
			
		||||
#endif /* STM32F302xE || STM32F303xE || STM32F398xx || STM32F302xC || STM32F303xC || STM32F358xx  */
 | 
			
		||||
 | 
			
		||||
/** @brief  Report the UART mask to apply to retrieve the received data
 | 
			
		||||
  *         according to the word length and to the parity bits activation.
 | 
			
		||||
  * @note   If PCE = 1, the parity bit is not included in the data extracted
 | 
			
		||||
  *         by the reception API().
 | 
			
		||||
  *         This masking operation is not carried out in the case of
 | 
			
		||||
  *         DMA transfers.
 | 
			
		||||
  * @param  __HANDLE__ specifies the UART Handle.
 | 
			
		||||
  * @retval None, the mask to apply to UART RDR register is stored in (__HANDLE__)->Mask field.
 | 
			
		||||
  */
 | 
			
		||||
#if defined (USART_CR1_M1)
 | 
			
		||||
#define UART_MASK_COMPUTATION(__HANDLE__)                             \
 | 
			
		||||
  do {                                                                \
 | 
			
		||||
    if ((__HANDLE__)->Init.WordLength == UART_WORDLENGTH_9B)          \
 | 
			
		||||
    {                                                                 \
 | 
			
		||||
      if ((__HANDLE__)->Init.Parity == UART_PARITY_NONE)              \
 | 
			
		||||
      {                                                               \
 | 
			
		||||
        (__HANDLE__)->Mask = 0x01FFU ;                                \
 | 
			
		||||
      }                                                               \
 | 
			
		||||
      else                                                            \
 | 
			
		||||
      {                                                               \
 | 
			
		||||
        (__HANDLE__)->Mask = 0x00FFU ;                                \
 | 
			
		||||
      }                                                               \
 | 
			
		||||
    }                                                                 \
 | 
			
		||||
    else if ((__HANDLE__)->Init.WordLength == UART_WORDLENGTH_8B)     \
 | 
			
		||||
    {                                                                 \
 | 
			
		||||
      if ((__HANDLE__)->Init.Parity == UART_PARITY_NONE)              \
 | 
			
		||||
      {                                                               \
 | 
			
		||||
        (__HANDLE__)->Mask = 0x00FFU ;                                \
 | 
			
		||||
      }                                                               \
 | 
			
		||||
      else                                                            \
 | 
			
		||||
      {                                                               \
 | 
			
		||||
        (__HANDLE__)->Mask = 0x007FU ;                                \
 | 
			
		||||
      }                                                               \
 | 
			
		||||
    }                                                                 \
 | 
			
		||||
    else if ((__HANDLE__)->Init.WordLength == UART_WORDLENGTH_7B)     \
 | 
			
		||||
    {                                                                 \
 | 
			
		||||
      if ((__HANDLE__)->Init.Parity == UART_PARITY_NONE)              \
 | 
			
		||||
      {                                                               \
 | 
			
		||||
        (__HANDLE__)->Mask = 0x007FU ;                                \
 | 
			
		||||
      }                                                               \
 | 
			
		||||
      else                                                            \
 | 
			
		||||
      {                                                               \
 | 
			
		||||
        (__HANDLE__)->Mask = 0x003FU ;                                \
 | 
			
		||||
      }                                                               \
 | 
			
		||||
    }                                                                 \
 | 
			
		||||
    else                                                              \
 | 
			
		||||
    {                                                                 \
 | 
			
		||||
      (__HANDLE__)->Mask = 0x0000U;                                   \
 | 
			
		||||
    }                                                                 \
 | 
			
		||||
  } while(0U)
 | 
			
		||||
 | 
			
		||||
#else
 | 
			
		||||
#define UART_MASK_COMPUTATION(__HANDLE__)                             \
 | 
			
		||||
  do {                                                                \
 | 
			
		||||
    if ((__HANDLE__)->Init.WordLength == UART_WORDLENGTH_9B)          \
 | 
			
		||||
    {                                                                 \
 | 
			
		||||
      if ((__HANDLE__)->Init.Parity == UART_PARITY_NONE)              \
 | 
			
		||||
      {                                                               \
 | 
			
		||||
        (__HANDLE__)->Mask = 0x01FFU ;                                \
 | 
			
		||||
      }                                                               \
 | 
			
		||||
      else                                                            \
 | 
			
		||||
      {                                                               \
 | 
			
		||||
        (__HANDLE__)->Mask = 0x00FFU ;                                \
 | 
			
		||||
      }                                                               \
 | 
			
		||||
    }                                                                 \
 | 
			
		||||
    else if ((__HANDLE__)->Init.WordLength == UART_WORDLENGTH_8B)     \
 | 
			
		||||
    {                                                                 \
 | 
			
		||||
      if ((__HANDLE__)->Init.Parity == UART_PARITY_NONE)              \
 | 
			
		||||
      {                                                               \
 | 
			
		||||
        (__HANDLE__)->Mask = 0x00FFU ;                                \
 | 
			
		||||
      }                                                               \
 | 
			
		||||
      else                                                            \
 | 
			
		||||
      {                                                               \
 | 
			
		||||
        (__HANDLE__)->Mask = 0x007FU ;                                \
 | 
			
		||||
      }                                                               \
 | 
			
		||||
    }                                                                 \
 | 
			
		||||
    else                                                              \
 | 
			
		||||
    {                                                                 \
 | 
			
		||||
      (__HANDLE__)->Mask = 0x0000U;                                   \
 | 
			
		||||
    }                                                                 \
 | 
			
		||||
  } while(0U)
 | 
			
		||||
 | 
			
		||||
#endif /* USART_CR1_M1 */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief Ensure that UART frame length is valid.
 | 
			
		||||
  * @param __LENGTH__ UART frame length.
 | 
			
		||||
  * @retval SET (__LENGTH__ is valid) or RESET (__LENGTH__ is invalid)
 | 
			
		||||
  */
 | 
			
		||||
#if defined (USART_CR1_M1)
 | 
			
		||||
#define IS_UART_WORD_LENGTH(__LENGTH__) (((__LENGTH__) == UART_WORDLENGTH_7B) || \
 | 
			
		||||
                                         ((__LENGTH__) == UART_WORDLENGTH_8B) || \
 | 
			
		||||
                                         ((__LENGTH__) == UART_WORDLENGTH_9B))
 | 
			
		||||
#else
 | 
			
		||||
#define IS_UART_WORD_LENGTH(__LENGTH__) (((__LENGTH__) == UART_WORDLENGTH_8B) || \
 | 
			
		||||
                                         ((__LENGTH__) == UART_WORDLENGTH_9B))
 | 
			
		||||
#endif /* USART_CR1_M1 */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief Ensure that UART wake-up address length is valid.
 | 
			
		||||
  * @param __ADDRESS__ UART wake-up address length.
 | 
			
		||||
  * @retval SET (__ADDRESS__ is valid) or RESET (__ADDRESS__ is invalid)
 | 
			
		||||
  */
 | 
			
		||||
#define IS_UART_ADDRESSLENGTH_DETECT(__ADDRESS__) (((__ADDRESS__) == UART_ADDRESS_DETECT_4B) || \
 | 
			
		||||
                                                   ((__ADDRESS__) == UART_ADDRESS_DETECT_7B))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Private functions ---------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* STM32F3xx_HAL_UART_EX_H */
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										10828
									
								
								Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_adc.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10828
									
								
								Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_adc.h
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										1060
									
								
								Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_bus.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1060
									
								
								Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_bus.h
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -0,0 +1,638 @@
 | 
			
		||||
/**
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @file    stm32f3xx_ll_cortex.h
 | 
			
		||||
  * @author  MCD Application Team
 | 
			
		||||
  * @brief   Header file of CORTEX LL module.
 | 
			
		||||
  @verbatim
 | 
			
		||||
  ==============================================================================
 | 
			
		||||
                     ##### How to use this driver #####
 | 
			
		||||
  ==============================================================================
 | 
			
		||||
    [..]
 | 
			
		||||
    The LL CORTEX driver contains a set of generic APIs that can be
 | 
			
		||||
    used by user:
 | 
			
		||||
      (+) SYSTICK configuration used by LL_mDelay and LL_Init1msTick
 | 
			
		||||
          functions
 | 
			
		||||
      (+) Low power mode configuration (SCB register of Cortex-MCU)
 | 
			
		||||
      (+) MPU API to configure and enable regions
 | 
			
		||||
          (MPU services provided only on some devices)
 | 
			
		||||
      (+) API to access to MCU info (CPUID register)
 | 
			
		||||
      (+) API to enable fault handler (SHCSR accesses)
 | 
			
		||||
 | 
			
		||||
  @endverbatim
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @attention
 | 
			
		||||
  *
 | 
			
		||||
  * Copyright (c) 2016 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 __STM32F3xx_LL_CORTEX_H
 | 
			
		||||
#define __STM32F3xx_LL_CORTEX_H
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Includes ------------------------------------------------------------------*/
 | 
			
		||||
#include "stm32f3xx.h"
 | 
			
		||||
 | 
			
		||||
/** @addtogroup STM32F3xx_LL_Driver
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_LL CORTEX
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Private types -------------------------------------------------------------*/
 | 
			
		||||
/* Private variables ---------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/* Private constants ---------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/* Private macros ------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/* Exported types ------------------------------------------------------------*/
 | 
			
		||||
/* Exported constants --------------------------------------------------------*/
 | 
			
		||||
/** @defgroup CORTEX_LL_Exported_Constants CORTEX Exported Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_LL_EC_CLKSOURCE_HCLK SYSTICK Clock Source
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define LL_SYSTICK_CLKSOURCE_HCLK_DIV8     0x00000000U                 /*!< AHB clock divided by 8 selected as SysTick clock source.*/
 | 
			
		||||
#define LL_SYSTICK_CLKSOURCE_HCLK          SysTick_CTRL_CLKSOURCE_Msk  /*!< AHB clock selected as SysTick clock source. */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_LL_EC_FAULT Handler Fault type
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define LL_HANDLER_FAULT_USG               SCB_SHCSR_USGFAULTENA_Msk              /*!< Usage fault */
 | 
			
		||||
#define LL_HANDLER_FAULT_BUS               SCB_SHCSR_BUSFAULTENA_Msk              /*!< Bus fault */
 | 
			
		||||
#define LL_HANDLER_FAULT_MEM               SCB_SHCSR_MEMFAULTENA_Msk              /*!< Memory management fault */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#if __MPU_PRESENT
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_LL_EC_CTRL_HFNMI_PRIVDEF MPU Control
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define LL_MPU_CTRL_HFNMI_PRIVDEF_NONE     0x00000000U                                       /*!< Disable NMI and privileged SW access */
 | 
			
		||||
#define LL_MPU_CTRL_HARDFAULT_NMI          MPU_CTRL_HFNMIENA_Msk                             /*!< Enables the operation of MPU during hard fault, NMI, and FAULTMASK handlers */
 | 
			
		||||
#define LL_MPU_CTRL_PRIVILEGED_DEFAULT     MPU_CTRL_PRIVDEFENA_Msk                           /*!< Enable privileged software access to default memory map */
 | 
			
		||||
#define LL_MPU_CTRL_HFNMI_PRIVDEF          (MPU_CTRL_HFNMIENA_Msk | MPU_CTRL_PRIVDEFENA_Msk) /*!< Enable NMI and privileged SW access */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_LL_EC_REGION MPU Region Number
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define LL_MPU_REGION_NUMBER0              0x00U /*!< REGION Number 0 */
 | 
			
		||||
#define LL_MPU_REGION_NUMBER1              0x01U /*!< REGION Number 1 */
 | 
			
		||||
#define LL_MPU_REGION_NUMBER2              0x02U /*!< REGION Number 2 */
 | 
			
		||||
#define LL_MPU_REGION_NUMBER3              0x03U /*!< REGION Number 3 */
 | 
			
		||||
#define LL_MPU_REGION_NUMBER4              0x04U /*!< REGION Number 4 */
 | 
			
		||||
#define LL_MPU_REGION_NUMBER5              0x05U /*!< REGION Number 5 */
 | 
			
		||||
#define LL_MPU_REGION_NUMBER6              0x06U /*!< REGION Number 6 */
 | 
			
		||||
#define LL_MPU_REGION_NUMBER7              0x07U /*!< REGION Number 7 */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_LL_EC_REGION_SIZE MPU Region Size
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_32B             (0x04U << MPU_RASR_SIZE_Pos) /*!< 32B Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_64B             (0x05U << MPU_RASR_SIZE_Pos) /*!< 64B Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_128B            (0x06U << MPU_RASR_SIZE_Pos) /*!< 128B Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_256B            (0x07U << MPU_RASR_SIZE_Pos) /*!< 256B Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_512B            (0x08U << MPU_RASR_SIZE_Pos) /*!< 512B Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_1KB             (0x09U << MPU_RASR_SIZE_Pos) /*!< 1KB Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_2KB             (0x0AU << MPU_RASR_SIZE_Pos) /*!< 2KB Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_4KB             (0x0BU << MPU_RASR_SIZE_Pos) /*!< 4KB Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_8KB             (0x0CU << MPU_RASR_SIZE_Pos) /*!< 8KB Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_16KB            (0x0DU << MPU_RASR_SIZE_Pos) /*!< 16KB Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_32KB            (0x0EU << MPU_RASR_SIZE_Pos) /*!< 32KB Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_64KB            (0x0FU << MPU_RASR_SIZE_Pos) /*!< 64KB Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_128KB           (0x10U << MPU_RASR_SIZE_Pos) /*!< 128KB Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_256KB           (0x11U << MPU_RASR_SIZE_Pos) /*!< 256KB Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_512KB           (0x12U << MPU_RASR_SIZE_Pos) /*!< 512KB Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_1MB             (0x13U << MPU_RASR_SIZE_Pos) /*!< 1MB Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_2MB             (0x14U << MPU_RASR_SIZE_Pos) /*!< 2MB Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_4MB             (0x15U << MPU_RASR_SIZE_Pos) /*!< 4MB Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_8MB             (0x16U << MPU_RASR_SIZE_Pos) /*!< 8MB Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_16MB            (0x17U << MPU_RASR_SIZE_Pos) /*!< 16MB Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_32MB            (0x18U << MPU_RASR_SIZE_Pos) /*!< 32MB Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_64MB            (0x19U << MPU_RASR_SIZE_Pos) /*!< 64MB Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_128MB           (0x1AU << MPU_RASR_SIZE_Pos) /*!< 128MB Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_256MB           (0x1BU << MPU_RASR_SIZE_Pos) /*!< 256MB Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_512MB           (0x1CU << MPU_RASR_SIZE_Pos) /*!< 512MB Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_1GB             (0x1DU << MPU_RASR_SIZE_Pos) /*!< 1GB Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_2GB             (0x1EU << MPU_RASR_SIZE_Pos) /*!< 2GB Size of the MPU protection region */
 | 
			
		||||
#define LL_MPU_REGION_SIZE_4GB             (0x1FU << MPU_RASR_SIZE_Pos) /*!< 4GB Size of the MPU protection region */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_LL_EC_REGION_PRIVILEDGES MPU Region Privileges
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define LL_MPU_REGION_NO_ACCESS            (0x00U << MPU_RASR_AP_Pos) /*!< No access*/
 | 
			
		||||
#define LL_MPU_REGION_PRIV_RW              (0x01U << MPU_RASR_AP_Pos) /*!< RW privileged (privileged access only)*/
 | 
			
		||||
#define LL_MPU_REGION_PRIV_RW_URO          (0x02U << MPU_RASR_AP_Pos) /*!< RW privileged - RO user (Write in a user program generates a fault) */
 | 
			
		||||
#define LL_MPU_REGION_FULL_ACCESS          (0x03U << MPU_RASR_AP_Pos) /*!< RW privileged & user (Full access) */
 | 
			
		||||
#define LL_MPU_REGION_PRIV_RO              (0x05U << MPU_RASR_AP_Pos) /*!< RO privileged (privileged read only)*/
 | 
			
		||||
#define LL_MPU_REGION_PRIV_RO_URO          (0x06U << MPU_RASR_AP_Pos) /*!< RO privileged & user (read only) */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_LL_EC_TEX MPU TEX Level
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define LL_MPU_TEX_LEVEL0                  (0x00U << MPU_RASR_TEX_Pos) /*!< b000 for TEX bits */
 | 
			
		||||
#define LL_MPU_TEX_LEVEL1                  (0x01U << MPU_RASR_TEX_Pos) /*!< b001 for TEX bits */
 | 
			
		||||
#define LL_MPU_TEX_LEVEL2                  (0x02U << MPU_RASR_TEX_Pos) /*!< b010 for TEX bits */
 | 
			
		||||
#define LL_MPU_TEX_LEVEL4                  (0x04U << MPU_RASR_TEX_Pos) /*!< b100 for TEX bits */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_LL_EC_INSTRUCTION_ACCESS MPU Instruction Access
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define LL_MPU_INSTRUCTION_ACCESS_ENABLE   0x00U            /*!< Instruction fetches enabled */
 | 
			
		||||
#define LL_MPU_INSTRUCTION_ACCESS_DISABLE  MPU_RASR_XN_Msk  /*!< Instruction fetches disabled*/
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_LL_EC_SHAREABLE_ACCESS MPU Shareable Access
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define LL_MPU_ACCESS_SHAREABLE            MPU_RASR_S_Msk   /*!< Shareable memory attribute */
 | 
			
		||||
#define LL_MPU_ACCESS_NOT_SHAREABLE        0x00U            /*!< Not Shareable memory attribute */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_LL_EC_CACHEABLE_ACCESS MPU Cacheable Access
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define LL_MPU_ACCESS_CACHEABLE            MPU_RASR_C_Msk   /*!< Cacheable memory attribute */
 | 
			
		||||
#define LL_MPU_ACCESS_NOT_CACHEABLE        0x00U            /*!< Not Cacheable memory attribute */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_LL_EC_BUFFERABLE_ACCESS MPU Bufferable Access
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define LL_MPU_ACCESS_BUFFERABLE           MPU_RASR_B_Msk   /*!< Bufferable memory attribute */
 | 
			
		||||
#define LL_MPU_ACCESS_NOT_BUFFERABLE       0x00U            /*!< Not Bufferable memory attribute */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
#endif /* __MPU_PRESENT */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported macro ------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/* Exported functions --------------------------------------------------------*/
 | 
			
		||||
/** @defgroup CORTEX_LL_Exported_Functions CORTEX Exported Functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_LL_EF_SYSTICK SYSTICK
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  This function checks if the Systick counter flag is active or not.
 | 
			
		||||
  * @note   It can be used in timeout function on application side.
 | 
			
		||||
  * @rmtoll STK_CTRL     COUNTFLAG     LL_SYSTICK_IsActiveCounterFlag
 | 
			
		||||
  * @retval State of bit (1 or 0).
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_SYSTICK_IsActiveCounterFlag(void)
 | 
			
		||||
{
 | 
			
		||||
  return ((SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) == (SysTick_CTRL_COUNTFLAG_Msk));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Configures the SysTick clock source
 | 
			
		||||
  * @rmtoll STK_CTRL     CLKSOURCE     LL_SYSTICK_SetClkSource
 | 
			
		||||
  * @param  Source This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_SYSTICK_CLKSOURCE_HCLK_DIV8
 | 
			
		||||
  *         @arg @ref LL_SYSTICK_CLKSOURCE_HCLK
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_SYSTICK_SetClkSource(uint32_t Source)
 | 
			
		||||
{
 | 
			
		||||
  if (Source == LL_SYSTICK_CLKSOURCE_HCLK)
 | 
			
		||||
  {
 | 
			
		||||
    SET_BIT(SysTick->CTRL, LL_SYSTICK_CLKSOURCE_HCLK);
 | 
			
		||||
  }
 | 
			
		||||
  else
 | 
			
		||||
  {
 | 
			
		||||
    CLEAR_BIT(SysTick->CTRL, LL_SYSTICK_CLKSOURCE_HCLK);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Get the SysTick clock source
 | 
			
		||||
  * @rmtoll STK_CTRL     CLKSOURCE     LL_SYSTICK_GetClkSource
 | 
			
		||||
  * @retval Returned value can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_SYSTICK_CLKSOURCE_HCLK_DIV8
 | 
			
		||||
  *         @arg @ref LL_SYSTICK_CLKSOURCE_HCLK
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_SYSTICK_GetClkSource(void)
 | 
			
		||||
{
 | 
			
		||||
  return READ_BIT(SysTick->CTRL, LL_SYSTICK_CLKSOURCE_HCLK);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Enable SysTick exception request
 | 
			
		||||
  * @rmtoll STK_CTRL     TICKINT       LL_SYSTICK_EnableIT
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_SYSTICK_EnableIT(void)
 | 
			
		||||
{
 | 
			
		||||
  SET_BIT(SysTick->CTRL, SysTick_CTRL_TICKINT_Msk);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Disable SysTick exception request
 | 
			
		||||
  * @rmtoll STK_CTRL     TICKINT       LL_SYSTICK_DisableIT
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_SYSTICK_DisableIT(void)
 | 
			
		||||
{
 | 
			
		||||
  CLEAR_BIT(SysTick->CTRL, SysTick_CTRL_TICKINT_Msk);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Checks if the SYSTICK interrupt is enabled or disabled.
 | 
			
		||||
  * @rmtoll STK_CTRL     TICKINT       LL_SYSTICK_IsEnabledIT
 | 
			
		||||
  * @retval State of bit (1 or 0).
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_SYSTICK_IsEnabledIT(void)
 | 
			
		||||
{
 | 
			
		||||
  return (READ_BIT(SysTick->CTRL, SysTick_CTRL_TICKINT_Msk) == (SysTick_CTRL_TICKINT_Msk));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_LL_EF_LOW_POWER_MODE LOW POWER MODE
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Processor uses sleep as its low power mode
 | 
			
		||||
  * @rmtoll SCB_SCR      SLEEPDEEP     LL_LPM_EnableSleep
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_LPM_EnableSleep(void)
 | 
			
		||||
{
 | 
			
		||||
  /* Clear SLEEPDEEP bit of Cortex System Control Register */
 | 
			
		||||
  CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Processor uses deep sleep as its low power mode
 | 
			
		||||
  * @rmtoll SCB_SCR      SLEEPDEEP     LL_LPM_EnableDeepSleep
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_LPM_EnableDeepSleep(void)
 | 
			
		||||
{
 | 
			
		||||
  /* Set SLEEPDEEP bit of Cortex System Control Register */
 | 
			
		||||
  SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Configures sleep-on-exit when returning from Handler mode to Thread mode.
 | 
			
		||||
  * @note   Setting this bit to 1 enables an interrupt-driven application to avoid returning to an
 | 
			
		||||
  *         empty main application.
 | 
			
		||||
  * @rmtoll SCB_SCR      SLEEPONEXIT   LL_LPM_EnableSleepOnExit
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_LPM_EnableSleepOnExit(void)
 | 
			
		||||
{
 | 
			
		||||
  /* Set SLEEPONEXIT bit of Cortex System Control Register */
 | 
			
		||||
  SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPONEXIT_Msk));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Do not sleep when returning to Thread mode.
 | 
			
		||||
  * @rmtoll SCB_SCR      SLEEPONEXIT   LL_LPM_DisableSleepOnExit
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_LPM_DisableSleepOnExit(void)
 | 
			
		||||
{
 | 
			
		||||
  /* Clear SLEEPONEXIT bit of Cortex System Control Register */
 | 
			
		||||
  CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPONEXIT_Msk));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Enabled events and all interrupts, including disabled interrupts, can wakeup the
 | 
			
		||||
  *         processor.
 | 
			
		||||
  * @rmtoll SCB_SCR      SEVEONPEND    LL_LPM_EnableEventOnPend
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_LPM_EnableEventOnPend(void)
 | 
			
		||||
{
 | 
			
		||||
  /* Set SEVEONPEND bit of Cortex System Control Register */
 | 
			
		||||
  SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SEVONPEND_Msk));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Only enabled interrupts or events can wakeup the processor, disabled interrupts are
 | 
			
		||||
  *         excluded
 | 
			
		||||
  * @rmtoll SCB_SCR      SEVEONPEND    LL_LPM_DisableEventOnPend
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_LPM_DisableEventOnPend(void)
 | 
			
		||||
{
 | 
			
		||||
  /* Clear SEVEONPEND bit of Cortex System Control Register */
 | 
			
		||||
  CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SEVONPEND_Msk));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_LL_EF_HANDLER HANDLER
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Enable a fault in System handler control register (SHCSR)
 | 
			
		||||
  * @rmtoll SCB_SHCSR    MEMFAULTENA   LL_HANDLER_EnableFault
 | 
			
		||||
  * @param  Fault This parameter can be a combination of the following values:
 | 
			
		||||
  *         @arg @ref LL_HANDLER_FAULT_USG
 | 
			
		||||
  *         @arg @ref LL_HANDLER_FAULT_BUS
 | 
			
		||||
  *         @arg @ref LL_HANDLER_FAULT_MEM
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_HANDLER_EnableFault(uint32_t Fault)
 | 
			
		||||
{
 | 
			
		||||
  /* Enable the system handler fault */
 | 
			
		||||
  SET_BIT(SCB->SHCSR, Fault);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Disable a fault in System handler control register (SHCSR)
 | 
			
		||||
  * @rmtoll SCB_SHCSR    MEMFAULTENA   LL_HANDLER_DisableFault
 | 
			
		||||
  * @param  Fault This parameter can be a combination of the following values:
 | 
			
		||||
  *         @arg @ref LL_HANDLER_FAULT_USG
 | 
			
		||||
  *         @arg @ref LL_HANDLER_FAULT_BUS
 | 
			
		||||
  *         @arg @ref LL_HANDLER_FAULT_MEM
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_HANDLER_DisableFault(uint32_t Fault)
 | 
			
		||||
{
 | 
			
		||||
  /* Disable the system handler fault */
 | 
			
		||||
  CLEAR_BIT(SCB->SHCSR, Fault);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup CORTEX_LL_EF_MCU_INFO MCU INFO
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Get Implementer code
 | 
			
		||||
  * @rmtoll SCB_CPUID    IMPLEMENTER   LL_CPUID_GetImplementer
 | 
			
		||||
  * @retval Value should be equal to 0x41 for ARM
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_CPUID_GetImplementer(void)
 | 
			
		||||
{
 | 
			
		||||
  return (uint32_t)(READ_BIT(SCB->CPUID, SCB_CPUID_IMPLEMENTER_Msk) >> SCB_CPUID_IMPLEMENTER_Pos);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Get Variant number (The r value in the rnpn product revision identifier)
 | 
			
		||||
  * @rmtoll SCB_CPUID    VARIANT       LL_CPUID_GetVariant
 | 
			
		||||
  * @retval Value between 0 and 255 (0x0: revision 0)
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_CPUID_GetVariant(void)
 | 
			
		||||
{
 | 
			
		||||
  return (uint32_t)(READ_BIT(SCB->CPUID, SCB_CPUID_VARIANT_Msk) >> SCB_CPUID_VARIANT_Pos);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Get Constant number
 | 
			
		||||
  * @rmtoll SCB_CPUID    ARCHITECTURE  LL_CPUID_GetConstant
 | 
			
		||||
  * @retval Value should be equal to 0xF for Cortex-M4 devices
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_CPUID_GetConstant(void)
 | 
			
		||||
{
 | 
			
		||||
  return (uint32_t)(READ_BIT(SCB->CPUID, SCB_CPUID_ARCHITECTURE_Msk) >> SCB_CPUID_ARCHITECTURE_Pos);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Get Part number
 | 
			
		||||
  * @rmtoll SCB_CPUID    PARTNO        LL_CPUID_GetParNo
 | 
			
		||||
  * @retval Value should be equal to 0xC24 for Cortex-M4
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_CPUID_GetParNo(void)
 | 
			
		||||
{
 | 
			
		||||
  return (uint32_t)(READ_BIT(SCB->CPUID, SCB_CPUID_PARTNO_Msk) >> SCB_CPUID_PARTNO_Pos);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Get Revision number (The p value in the rnpn product revision identifier, indicates patch release)
 | 
			
		||||
  * @rmtoll SCB_CPUID    REVISION      LL_CPUID_GetRevision
 | 
			
		||||
  * @retval Value between 0 and 255 (0x1: patch 1)
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_CPUID_GetRevision(void)
 | 
			
		||||
{
 | 
			
		||||
  return (uint32_t)(READ_BIT(SCB->CPUID, SCB_CPUID_REVISION_Msk) >> SCB_CPUID_REVISION_Pos);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#if __MPU_PRESENT
 | 
			
		||||
/** @defgroup CORTEX_LL_EF_MPU MPU
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Enable MPU with input options
 | 
			
		||||
  * @rmtoll MPU_CTRL     ENABLE        LL_MPU_Enable
 | 
			
		||||
  * @param  Options This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_MPU_CTRL_HFNMI_PRIVDEF_NONE
 | 
			
		||||
  *         @arg @ref LL_MPU_CTRL_HARDFAULT_NMI
 | 
			
		||||
  *         @arg @ref LL_MPU_CTRL_PRIVILEGED_DEFAULT
 | 
			
		||||
  *         @arg @ref LL_MPU_CTRL_HFNMI_PRIVDEF
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_MPU_Enable(uint32_t Options)
 | 
			
		||||
{
 | 
			
		||||
  /* Enable the MPU*/
 | 
			
		||||
  WRITE_REG(MPU->CTRL, (MPU_CTRL_ENABLE_Msk | Options));
 | 
			
		||||
  /* Ensure MPU settings take effects */
 | 
			
		||||
  __DSB();
 | 
			
		||||
  /* Sequence instruction fetches using update settings */
 | 
			
		||||
  __ISB();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Disable MPU
 | 
			
		||||
  * @rmtoll MPU_CTRL     ENABLE        LL_MPU_Disable
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_MPU_Disable(void)
 | 
			
		||||
{
 | 
			
		||||
  /* Make sure outstanding transfers are done */
 | 
			
		||||
  __DMB();
 | 
			
		||||
  /* Disable MPU*/
 | 
			
		||||
  WRITE_REG(MPU->CTRL, 0U);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Check if MPU is enabled or not
 | 
			
		||||
  * @rmtoll MPU_CTRL     ENABLE        LL_MPU_IsEnabled
 | 
			
		||||
  * @retval State of bit (1 or 0).
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_MPU_IsEnabled(void)
 | 
			
		||||
{
 | 
			
		||||
  return (READ_BIT(MPU->CTRL, MPU_CTRL_ENABLE_Msk) == (MPU_CTRL_ENABLE_Msk));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Enable a MPU region
 | 
			
		||||
  * @rmtoll MPU_RASR     ENABLE        LL_MPU_EnableRegion
 | 
			
		||||
  * @param  Region This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_NUMBER0
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_NUMBER1
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_NUMBER2
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_NUMBER3
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_NUMBER4
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_NUMBER5
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_NUMBER6
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_NUMBER7
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_MPU_EnableRegion(uint32_t Region)
 | 
			
		||||
{
 | 
			
		||||
  /* Set Region number */
 | 
			
		||||
  WRITE_REG(MPU->RNR, Region);
 | 
			
		||||
  /* Enable the MPU region */
 | 
			
		||||
  SET_BIT(MPU->RASR, MPU_RASR_ENABLE_Msk);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Configure and enable a region
 | 
			
		||||
  * @rmtoll MPU_RNR      REGION        LL_MPU_ConfigRegion\n
 | 
			
		||||
  *         MPU_RBAR     REGION        LL_MPU_ConfigRegion\n
 | 
			
		||||
  *         MPU_RBAR     ADDR          LL_MPU_ConfigRegion\n
 | 
			
		||||
  *         MPU_RASR     XN            LL_MPU_ConfigRegion\n
 | 
			
		||||
  *         MPU_RASR     AP            LL_MPU_ConfigRegion\n
 | 
			
		||||
  *         MPU_RASR     S             LL_MPU_ConfigRegion\n
 | 
			
		||||
  *         MPU_RASR     C             LL_MPU_ConfigRegion\n
 | 
			
		||||
  *         MPU_RASR     B             LL_MPU_ConfigRegion\n
 | 
			
		||||
  *         MPU_RASR     SIZE          LL_MPU_ConfigRegion
 | 
			
		||||
  * @param  Region This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_NUMBER0
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_NUMBER1
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_NUMBER2
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_NUMBER3
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_NUMBER4
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_NUMBER5
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_NUMBER6
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_NUMBER7
 | 
			
		||||
  * @param  Address Value of region base address
 | 
			
		||||
  * @param  SubRegionDisable Sub-region disable value between Min_Data = 0x00 and Max_Data = 0xFF
 | 
			
		||||
  * @param  Attributes This parameter can be a combination of the following values:
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_SIZE_32B or @ref LL_MPU_REGION_SIZE_64B or @ref LL_MPU_REGION_SIZE_128B or @ref LL_MPU_REGION_SIZE_256B or @ref LL_MPU_REGION_SIZE_512B
 | 
			
		||||
  *           or @ref LL_MPU_REGION_SIZE_1KB or @ref LL_MPU_REGION_SIZE_2KB or @ref LL_MPU_REGION_SIZE_4KB or @ref LL_MPU_REGION_SIZE_8KB or @ref LL_MPU_REGION_SIZE_16KB
 | 
			
		||||
  *           or @ref LL_MPU_REGION_SIZE_32KB or @ref LL_MPU_REGION_SIZE_64KB or @ref LL_MPU_REGION_SIZE_128KB or @ref LL_MPU_REGION_SIZE_256KB or @ref LL_MPU_REGION_SIZE_512KB
 | 
			
		||||
  *           or @ref LL_MPU_REGION_SIZE_1MB or @ref LL_MPU_REGION_SIZE_2MB or @ref LL_MPU_REGION_SIZE_4MB or @ref LL_MPU_REGION_SIZE_8MB or @ref LL_MPU_REGION_SIZE_16MB
 | 
			
		||||
  *           or @ref LL_MPU_REGION_SIZE_32MB or @ref LL_MPU_REGION_SIZE_64MB or @ref LL_MPU_REGION_SIZE_128MB or @ref LL_MPU_REGION_SIZE_256MB or @ref LL_MPU_REGION_SIZE_512MB
 | 
			
		||||
  *           or @ref LL_MPU_REGION_SIZE_1GB or @ref LL_MPU_REGION_SIZE_2GB or @ref LL_MPU_REGION_SIZE_4GB
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_NO_ACCESS or @ref LL_MPU_REGION_PRIV_RW or @ref LL_MPU_REGION_PRIV_RW_URO or @ref LL_MPU_REGION_FULL_ACCESS
 | 
			
		||||
  *           or @ref LL_MPU_REGION_PRIV_RO or @ref LL_MPU_REGION_PRIV_RO_URO
 | 
			
		||||
  *         @arg @ref LL_MPU_TEX_LEVEL0 or @ref LL_MPU_TEX_LEVEL1 or @ref LL_MPU_TEX_LEVEL2 or @ref LL_MPU_TEX_LEVEL4
 | 
			
		||||
  *         @arg @ref LL_MPU_INSTRUCTION_ACCESS_ENABLE or  @ref LL_MPU_INSTRUCTION_ACCESS_DISABLE
 | 
			
		||||
  *         @arg @ref LL_MPU_ACCESS_SHAREABLE or @ref LL_MPU_ACCESS_NOT_SHAREABLE
 | 
			
		||||
  *         @arg @ref LL_MPU_ACCESS_CACHEABLE or @ref LL_MPU_ACCESS_NOT_CACHEABLE
 | 
			
		||||
  *         @arg @ref LL_MPU_ACCESS_BUFFERABLE or @ref LL_MPU_ACCESS_NOT_BUFFERABLE
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_MPU_ConfigRegion(uint32_t Region, uint32_t SubRegionDisable, uint32_t Address, uint32_t Attributes)
 | 
			
		||||
{
 | 
			
		||||
  /* Set Region number */
 | 
			
		||||
  WRITE_REG(MPU->RNR, Region);
 | 
			
		||||
  /* Set base address */
 | 
			
		||||
  WRITE_REG(MPU->RBAR, (Address & 0xFFFFFFE0U));
 | 
			
		||||
  /* Configure MPU */
 | 
			
		||||
  WRITE_REG(MPU->RASR, (MPU_RASR_ENABLE_Msk | Attributes | SubRegionDisable << MPU_RASR_SRD_Pos));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Disable a region
 | 
			
		||||
  * @rmtoll MPU_RNR      REGION        LL_MPU_DisableRegion\n
 | 
			
		||||
  *         MPU_RASR     ENABLE        LL_MPU_DisableRegion
 | 
			
		||||
  * @param  Region This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_NUMBER0
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_NUMBER1
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_NUMBER2
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_NUMBER3
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_NUMBER4
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_NUMBER5
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_NUMBER6
 | 
			
		||||
  *         @arg @ref LL_MPU_REGION_NUMBER7
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_MPU_DisableRegion(uint32_t Region)
 | 
			
		||||
{
 | 
			
		||||
  /* Set Region number */
 | 
			
		||||
  WRITE_REG(MPU->RNR, Region);
 | 
			
		||||
  /* Disable the MPU region */
 | 
			
		||||
  CLEAR_BIT(MPU->RASR, MPU_RASR_ENABLE_Msk);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#endif /* __MPU_PRESENT */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* __STM32F3xx_LL_CORTEX_H */
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										1994
									
								
								Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_dma.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1994
									
								
								Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_dma.h
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										1381
									
								
								Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_exti.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1381
									
								
								Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_exti.h
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -0,0 +1,978 @@
 | 
			
		||||
/**
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @file    stm32f3xx_ll_gpio.h
 | 
			
		||||
  * @author  MCD Application Team
 | 
			
		||||
  * @brief   Header file of GPIO LL module.
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @attention
 | 
			
		||||
  *
 | 
			
		||||
  * Copyright (c) 2016 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 __STM32F3xx_LL_GPIO_H
 | 
			
		||||
#define __STM32F3xx_LL_GPIO_H
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Includes ------------------------------------------------------------------*/
 | 
			
		||||
#include "stm32f3xx.h"
 | 
			
		||||
 | 
			
		||||
/** @addtogroup STM32F3xx_LL_Driver
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#if defined (GPIOA) || defined (GPIOB) || defined (GPIOC) || defined (GPIOD) || defined (GPIOE) || defined (GPIOF) || defined (GPIOG) || defined (GPIOH)
 | 
			
		||||
 | 
			
		||||
/** @defgroup GPIO_LL GPIO
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Private types -------------------------------------------------------------*/
 | 
			
		||||
/* Private variables ---------------------------------------------------------*/
 | 
			
		||||
/* Private constants ---------------------------------------------------------*/
 | 
			
		||||
/* Private macros ------------------------------------------------------------*/
 | 
			
		||||
#if defined(USE_FULL_LL_DRIVER)
 | 
			
		||||
/** @defgroup GPIO_LL_Private_Macros GPIO Private Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
#endif /*USE_FULL_LL_DRIVER*/
 | 
			
		||||
 | 
			
		||||
/* Exported types ------------------------------------------------------------*/
 | 
			
		||||
#if defined(USE_FULL_LL_DRIVER)
 | 
			
		||||
/** @defgroup GPIO_LL_ES_INIT GPIO Exported Init structures
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief LL GPIO Init Structure definition
 | 
			
		||||
  */
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
  uint32_t Pin;          /*!< Specifies the GPIO pins to be configured.
 | 
			
		||||
                              This parameter can be any value of @ref GPIO_LL_EC_PIN */
 | 
			
		||||
 | 
			
		||||
  uint32_t Mode;         /*!< Specifies the operating mode for the selected pins.
 | 
			
		||||
                              This parameter can be a value of @ref GPIO_LL_EC_MODE.
 | 
			
		||||
 | 
			
		||||
                              GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinMode().*/
 | 
			
		||||
 | 
			
		||||
  uint32_t Speed;        /*!< Specifies the speed for the selected pins.
 | 
			
		||||
                              This parameter can be a value of @ref GPIO_LL_EC_SPEED.
 | 
			
		||||
 | 
			
		||||
                              GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinSpeed().*/
 | 
			
		||||
 | 
			
		||||
  uint32_t OutputType;   /*!< Specifies the operating output type for the selected pins.
 | 
			
		||||
                              This parameter can be a value of @ref GPIO_LL_EC_OUTPUT.
 | 
			
		||||
 | 
			
		||||
                              GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinOutputType().*/
 | 
			
		||||
 | 
			
		||||
  uint32_t Pull;         /*!< Specifies the operating Pull-up/Pull down for the selected pins.
 | 
			
		||||
                              This parameter can be a value of @ref GPIO_LL_EC_PULL.
 | 
			
		||||
 | 
			
		||||
                              GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinPull().*/
 | 
			
		||||
 | 
			
		||||
  uint32_t Alternate;    /*!< Specifies the Peripheral to be connected to the selected pins.
 | 
			
		||||
                              This parameter can be a value of @ref GPIO_LL_EC_AF.
 | 
			
		||||
 | 
			
		||||
                              GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetAFPin_0_7() and LL_GPIO_SetAFPin_8_15().*/
 | 
			
		||||
} LL_GPIO_InitTypeDef;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
#endif /* USE_FULL_LL_DRIVER */
 | 
			
		||||
 | 
			
		||||
/* Exported constants --------------------------------------------------------*/
 | 
			
		||||
/** @defgroup GPIO_LL_Exported_Constants GPIO Exported Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup GPIO_LL_EC_PIN PIN
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define LL_GPIO_PIN_0                      GPIO_BSRR_BS_0 /*!< Select pin 0 */
 | 
			
		||||
#define LL_GPIO_PIN_1                      GPIO_BSRR_BS_1 /*!< Select pin 1 */
 | 
			
		||||
#define LL_GPIO_PIN_2                      GPIO_BSRR_BS_2 /*!< Select pin 2 */
 | 
			
		||||
#define LL_GPIO_PIN_3                      GPIO_BSRR_BS_3 /*!< Select pin 3 */
 | 
			
		||||
#define LL_GPIO_PIN_4                      GPIO_BSRR_BS_4 /*!< Select pin 4 */
 | 
			
		||||
#define LL_GPIO_PIN_5                      GPIO_BSRR_BS_5 /*!< Select pin 5 */
 | 
			
		||||
#define LL_GPIO_PIN_6                      GPIO_BSRR_BS_6 /*!< Select pin 6 */
 | 
			
		||||
#define LL_GPIO_PIN_7                      GPIO_BSRR_BS_7 /*!< Select pin 7 */
 | 
			
		||||
#define LL_GPIO_PIN_8                      GPIO_BSRR_BS_8 /*!< Select pin 8 */
 | 
			
		||||
#define LL_GPIO_PIN_9                      GPIO_BSRR_BS_9 /*!< Select pin 9 */
 | 
			
		||||
#define LL_GPIO_PIN_10                     GPIO_BSRR_BS_10 /*!< Select pin 10 */
 | 
			
		||||
#define LL_GPIO_PIN_11                     GPIO_BSRR_BS_11 /*!< Select pin 11 */
 | 
			
		||||
#define LL_GPIO_PIN_12                     GPIO_BSRR_BS_12 /*!< Select pin 12 */
 | 
			
		||||
#define LL_GPIO_PIN_13                     GPIO_BSRR_BS_13 /*!< Select pin 13 */
 | 
			
		||||
#define LL_GPIO_PIN_14                     GPIO_BSRR_BS_14 /*!< Select pin 14 */
 | 
			
		||||
#define LL_GPIO_PIN_15                     GPIO_BSRR_BS_15 /*!< Select pin 15 */
 | 
			
		||||
#define LL_GPIO_PIN_ALL                    (GPIO_BSRR_BS_0 | GPIO_BSRR_BS_1  | GPIO_BSRR_BS_2  | \
 | 
			
		||||
                                           GPIO_BSRR_BS_3  | GPIO_BSRR_BS_4  | GPIO_BSRR_BS_5  | \
 | 
			
		||||
                                           GPIO_BSRR_BS_6  | GPIO_BSRR_BS_7  | GPIO_BSRR_BS_8  | \
 | 
			
		||||
                                           GPIO_BSRR_BS_9  | GPIO_BSRR_BS_10 | GPIO_BSRR_BS_11 | \
 | 
			
		||||
                                           GPIO_BSRR_BS_12 | GPIO_BSRR_BS_13 | GPIO_BSRR_BS_14 | \
 | 
			
		||||
                                           GPIO_BSRR_BS_15) /*!< Select all pins */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup GPIO_LL_EC_MODE Mode
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define LL_GPIO_MODE_INPUT                 (0x00000000U) /*!< Select input mode */
 | 
			
		||||
#define LL_GPIO_MODE_OUTPUT                GPIO_MODER_MODER0_0  /*!< Select output mode */
 | 
			
		||||
#define LL_GPIO_MODE_ALTERNATE             GPIO_MODER_MODER0_1  /*!< Select alternate function mode */
 | 
			
		||||
#define LL_GPIO_MODE_ANALOG                GPIO_MODER_MODER0    /*!< Select analog mode */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup GPIO_LL_EC_OUTPUT Output Type
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define LL_GPIO_OUTPUT_PUSHPULL            (0x00000000U) /*!< Select push-pull as output type */
 | 
			
		||||
#define LL_GPIO_OUTPUT_OPENDRAIN           GPIO_OTYPER_OT_0 /*!< Select open-drain as output type */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup GPIO_LL_EC_SPEED Output Speed
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define LL_GPIO_SPEED_FREQ_LOW             (0x00000000U) /*!< Select I/O low output speed    */
 | 
			
		||||
#define LL_GPIO_SPEED_FREQ_MEDIUM          GPIO_OSPEEDER_OSPEEDR0_0 /*!< Select I/O medium output speed */
 | 
			
		||||
#define LL_GPIO_SPEED_FREQ_HIGH            GPIO_OSPEEDER_OSPEEDR0   /*!< Select I/O high output speed   */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup GPIO_LL_EC_PULL Pull Up Pull Down
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define LL_GPIO_PULL_NO                    (0x00000000U) /*!< Select I/O no pull */
 | 
			
		||||
#define LL_GPIO_PULL_UP                    GPIO_PUPDR_PUPDR0_0 /*!< Select I/O pull up */
 | 
			
		||||
#define LL_GPIO_PULL_DOWN                  GPIO_PUPDR_PUPDR0_1 /*!< Select I/O pull down */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup GPIO_LL_EC_AF Alternate Function
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define LL_GPIO_AF_0                       (0x0000000U) /*!< Select alternate function 0 */
 | 
			
		||||
#define LL_GPIO_AF_1                       (0x0000001U) /*!< Select alternate function 1 */
 | 
			
		||||
#define LL_GPIO_AF_2                       (0x0000002U) /*!< Select alternate function 2 */
 | 
			
		||||
#define LL_GPIO_AF_3                       (0x0000003U) /*!< Select alternate function 3 */
 | 
			
		||||
#define LL_GPIO_AF_4                       (0x0000004U) /*!< Select alternate function 4 */
 | 
			
		||||
#define LL_GPIO_AF_5                       (0x0000005U) /*!< Select alternate function 5 */
 | 
			
		||||
#define LL_GPIO_AF_6                       (0x0000006U) /*!< Select alternate function 6 */
 | 
			
		||||
#define LL_GPIO_AF_7                       (0x0000007U) /*!< Select alternate function 7 */
 | 
			
		||||
#define LL_GPIO_AF_8                       (0x0000008U) /*!< Select alternate function 8 */
 | 
			
		||||
#define LL_GPIO_AF_9                       (0x0000009U) /*!< Select alternate function 9 */
 | 
			
		||||
#define LL_GPIO_AF_10                      (0x000000AU) /*!< Select alternate function 10 */
 | 
			
		||||
#define LL_GPIO_AF_11                      (0x000000BU) /*!< Select alternate function 11 */
 | 
			
		||||
#define LL_GPIO_AF_12                      (0x000000CU) /*!< Select alternate function 12 */
 | 
			
		||||
#define LL_GPIO_AF_13                      (0x000000DU) /*!< Select alternate function 13 */
 | 
			
		||||
#define LL_GPIO_AF_14                      (0x000000EU) /*!< Select alternate function 14 */
 | 
			
		||||
#define LL_GPIO_AF_15                      (0x000000FU) /*!< Select alternate function 15 */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported macro ------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup GPIO_LL_Exported_Macros GPIO Exported Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup GPIO_LL_EM_WRITE_READ Common Write and read registers Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Write a value in GPIO register
 | 
			
		||||
  * @param  __INSTANCE__ GPIO Instance
 | 
			
		||||
  * @param  __REG__ Register to be written
 | 
			
		||||
  * @param  __VALUE__ Value to be written in the register
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define LL_GPIO_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Read a value in GPIO register
 | 
			
		||||
  * @param  __INSTANCE__ GPIO Instance
 | 
			
		||||
  * @param  __REG__ Register to be read
 | 
			
		||||
  * @retval Register value
 | 
			
		||||
  */
 | 
			
		||||
#define LL_GPIO_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported functions --------------------------------------------------------*/
 | 
			
		||||
/** @defgroup GPIO_LL_Exported_Functions GPIO Exported Functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup GPIO_LL_EF_Port_Configuration Port Configuration
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Configure gpio mode for a dedicated pin on dedicated port.
 | 
			
		||||
  * @note   I/O mode can be Input mode, General purpose output, Alternate function mode or Analog.
 | 
			
		||||
  * @note   Warning: only one pin can be passed as parameter.
 | 
			
		||||
  * @rmtoll MODER        MODEy         LL_GPIO_SetPinMode
 | 
			
		||||
  * @param  GPIOx GPIO Port
 | 
			
		||||
  * @param  Pin This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_0
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_1
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_2
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_3
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_4
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_5
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_6
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_7
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_8
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_9
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_10
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_11
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_12
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_13
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_14
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_15
 | 
			
		||||
  * @param  Mode This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_MODE_INPUT
 | 
			
		||||
  *         @arg @ref LL_GPIO_MODE_OUTPUT
 | 
			
		||||
  *         @arg @ref LL_GPIO_MODE_ALTERNATE
 | 
			
		||||
  *         @arg @ref LL_GPIO_MODE_ANALOG
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_GPIO_SetPinMode(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Mode)
 | 
			
		||||
{
 | 
			
		||||
  MODIFY_REG(GPIOx->MODER, (GPIO_MODER_MODER0 << (POSITION_VAL(Pin) * 2U)), (Mode << (POSITION_VAL(Pin) * 2U)));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Return gpio mode for a dedicated pin on dedicated port.
 | 
			
		||||
  * @note   I/O mode can be Input mode, General purpose output, Alternate function mode or Analog.
 | 
			
		||||
  * @note   Warning: only one pin can be passed as parameter.
 | 
			
		||||
  * @rmtoll MODER        MODEy         LL_GPIO_GetPinMode
 | 
			
		||||
  * @param  GPIOx GPIO Port
 | 
			
		||||
  * @param  Pin This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_0
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_1
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_2
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_3
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_4
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_5
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_6
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_7
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_8
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_9
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_10
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_11
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_12
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_13
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_14
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_15
 | 
			
		||||
  * @retval Returned value can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_MODE_INPUT
 | 
			
		||||
  *         @arg @ref LL_GPIO_MODE_OUTPUT
 | 
			
		||||
  *         @arg @ref LL_GPIO_MODE_ALTERNATE
 | 
			
		||||
  *         @arg @ref LL_GPIO_MODE_ANALOG
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_GPIO_GetPinMode(GPIO_TypeDef *GPIOx, uint32_t Pin)
 | 
			
		||||
{
 | 
			
		||||
  return (uint32_t)(READ_BIT(GPIOx->MODER,
 | 
			
		||||
                             (GPIO_MODER_MODER0 << (POSITION_VAL(Pin) * 2U))) >> (POSITION_VAL(Pin) * 2U));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Configure gpio output type for several pins on dedicated port.
 | 
			
		||||
  * @note   Output type as to be set when gpio pin is in output or
 | 
			
		||||
  *         alternate modes. Possible type are Push-pull or Open-drain.
 | 
			
		||||
  * @rmtoll OTYPER       OTy           LL_GPIO_SetPinOutputType
 | 
			
		||||
  * @param  GPIOx GPIO Port
 | 
			
		||||
  * @param  PinMask This parameter can be a combination of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_0
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_1
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_2
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_3
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_4
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_5
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_6
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_7
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_8
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_9
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_10
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_11
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_12
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_13
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_14
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_15
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_ALL
 | 
			
		||||
  * @param  OutputType This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_OUTPUT_PUSHPULL
 | 
			
		||||
  *         @arg @ref LL_GPIO_OUTPUT_OPENDRAIN
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_GPIO_SetPinOutputType(GPIO_TypeDef *GPIOx, uint32_t PinMask, uint32_t OutputType)
 | 
			
		||||
{
 | 
			
		||||
  MODIFY_REG(GPIOx->OTYPER, PinMask, (PinMask * OutputType));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Return gpio output type for several pins on dedicated port.
 | 
			
		||||
  * @note   Output type as to be set when gpio pin is in output or
 | 
			
		||||
  *         alternate modes. Possible type are Push-pull or Open-drain.
 | 
			
		||||
  * @note   Warning: only one pin can be passed as parameter.
 | 
			
		||||
  * @rmtoll OTYPER       OTy           LL_GPIO_GetPinOutputType
 | 
			
		||||
  * @param  GPIOx GPIO Port
 | 
			
		||||
  * @param  Pin This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_0
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_1
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_2
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_3
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_4
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_5
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_6
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_7
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_8
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_9
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_10
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_11
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_12
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_13
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_14
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_15
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_ALL
 | 
			
		||||
  * @retval Returned value can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_OUTPUT_PUSHPULL
 | 
			
		||||
  *         @arg @ref LL_GPIO_OUTPUT_OPENDRAIN
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_GPIO_GetPinOutputType(GPIO_TypeDef *GPIOx, uint32_t Pin)
 | 
			
		||||
{
 | 
			
		||||
  return (uint32_t)(READ_BIT(GPIOx->OTYPER, Pin) >> POSITION_VAL(Pin));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Configure gpio speed for a dedicated pin on dedicated port.
 | 
			
		||||
  * @note   I/O speed can be Low, Medium, Fast or High speed.
 | 
			
		||||
  * @note   Warning: only one pin can be passed as parameter.
 | 
			
		||||
  * @note   Refer to datasheet for frequency specifications and the power
 | 
			
		||||
  *         supply and load conditions for each speed.
 | 
			
		||||
  * @rmtoll OSPEEDR      OSPEEDy       LL_GPIO_SetPinSpeed
 | 
			
		||||
  * @param  GPIOx GPIO Port
 | 
			
		||||
  * @param  Pin This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_0
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_1
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_2
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_3
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_4
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_5
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_6
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_7
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_8
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_9
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_10
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_11
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_12
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_13
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_14
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_15
 | 
			
		||||
  * @param  Speed This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_SPEED_FREQ_LOW
 | 
			
		||||
  *         @arg @ref LL_GPIO_SPEED_FREQ_MEDIUM
 | 
			
		||||
  *         @arg @ref LL_GPIO_SPEED_FREQ_HIGH
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_GPIO_SetPinSpeed(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t  Speed)
 | 
			
		||||
{
 | 
			
		||||
  MODIFY_REG(GPIOx->OSPEEDR, (GPIO_OSPEEDER_OSPEEDR0 << (POSITION_VAL(Pin) * 2U)),
 | 
			
		||||
             (Speed << (POSITION_VAL(Pin) * 2U)));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Return gpio speed for a dedicated pin on dedicated port.
 | 
			
		||||
  * @note   I/O speed can be Low, Medium, Fast or High speed.
 | 
			
		||||
  * @note   Warning: only one pin can be passed as parameter.
 | 
			
		||||
  * @note   Refer to datasheet for frequency specifications and the power
 | 
			
		||||
  *         supply and load conditions for each speed.
 | 
			
		||||
  * @rmtoll OSPEEDR      OSPEEDy       LL_GPIO_GetPinSpeed
 | 
			
		||||
  * @param  GPIOx GPIO Port
 | 
			
		||||
  * @param  Pin This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_0
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_1
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_2
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_3
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_4
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_5
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_6
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_7
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_8
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_9
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_10
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_11
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_12
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_13
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_14
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_15
 | 
			
		||||
  * @retval Returned value can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_SPEED_FREQ_LOW
 | 
			
		||||
  *         @arg @ref LL_GPIO_SPEED_FREQ_MEDIUM
 | 
			
		||||
  *         @arg @ref LL_GPIO_SPEED_FREQ_HIGH
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_GPIO_GetPinSpeed(GPIO_TypeDef *GPIOx, uint32_t Pin)
 | 
			
		||||
{
 | 
			
		||||
  return (uint32_t)(READ_BIT(GPIOx->OSPEEDR,
 | 
			
		||||
                             (GPIO_OSPEEDER_OSPEEDR0 << (POSITION_VAL(Pin) * 2U))) >> (POSITION_VAL(Pin) * 2U));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Configure gpio pull-up or pull-down for a dedicated pin on a dedicated port.
 | 
			
		||||
  * @note   Warning: only one pin can be passed as parameter.
 | 
			
		||||
  * @rmtoll PUPDR        PUPDy         LL_GPIO_SetPinPull
 | 
			
		||||
  * @param  GPIOx GPIO Port
 | 
			
		||||
  * @param  Pin This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_0
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_1
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_2
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_3
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_4
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_5
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_6
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_7
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_8
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_9
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_10
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_11
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_12
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_13
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_14
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_15
 | 
			
		||||
  * @param  Pull This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_PULL_NO
 | 
			
		||||
  *         @arg @ref LL_GPIO_PULL_UP
 | 
			
		||||
  *         @arg @ref LL_GPIO_PULL_DOWN
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_GPIO_SetPinPull(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Pull)
 | 
			
		||||
{
 | 
			
		||||
  MODIFY_REG(GPIOx->PUPDR, (GPIO_PUPDR_PUPDR0 << (POSITION_VAL(Pin) * 2U)), (Pull << (POSITION_VAL(Pin) * 2U)));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Return gpio pull-up or pull-down for a dedicated pin on a dedicated port
 | 
			
		||||
  * @note   Warning: only one pin can be passed as parameter.
 | 
			
		||||
  * @rmtoll PUPDR        PUPDy         LL_GPIO_GetPinPull
 | 
			
		||||
  * @param  GPIOx GPIO Port
 | 
			
		||||
  * @param  Pin This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_0
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_1
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_2
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_3
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_4
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_5
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_6
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_7
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_8
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_9
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_10
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_11
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_12
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_13
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_14
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_15
 | 
			
		||||
  * @retval Returned value can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_PULL_NO
 | 
			
		||||
  *         @arg @ref LL_GPIO_PULL_UP
 | 
			
		||||
  *         @arg @ref LL_GPIO_PULL_DOWN
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_GPIO_GetPinPull(GPIO_TypeDef *GPIOx, uint32_t Pin)
 | 
			
		||||
{
 | 
			
		||||
  return (uint32_t)(READ_BIT(GPIOx->PUPDR,
 | 
			
		||||
                             (GPIO_PUPDR_PUPDR0 << (POSITION_VAL(Pin) * 2U))) >> (POSITION_VAL(Pin) * 2U));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Configure gpio alternate function of a dedicated pin from 0 to 7 for a dedicated port.
 | 
			
		||||
  * @note   Possible values are from AF0 to AF15 depending on target.
 | 
			
		||||
  * @note   Warning: only one pin can be passed as parameter.
 | 
			
		||||
  * @rmtoll AFRL         AFSELy        LL_GPIO_SetAFPin_0_7
 | 
			
		||||
  * @param  GPIOx GPIO Port
 | 
			
		||||
  * @param  Pin This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_0
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_1
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_2
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_3
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_4
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_5
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_6
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_7
 | 
			
		||||
  * @param  Alternate This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_0
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_1
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_2
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_3
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_4
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_5
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_6
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_7
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_8
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_9
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_10
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_11
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_12
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_13
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_14
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_15
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_GPIO_SetAFPin_0_7(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Alternate)
 | 
			
		||||
{
 | 
			
		||||
  MODIFY_REG(GPIOx->AFR[0], (GPIO_AFRL_AFRL0 << (POSITION_VAL(Pin) * 4U)),
 | 
			
		||||
             (Alternate << (POSITION_VAL(Pin) * 4U)));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Return gpio alternate function of a dedicated pin from 0 to 7 for a dedicated port.
 | 
			
		||||
  * @rmtoll AFRL         AFSELy        LL_GPIO_GetAFPin_0_7
 | 
			
		||||
  * @param  GPIOx GPIO Port
 | 
			
		||||
  * @param  Pin This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_0
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_1
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_2
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_3
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_4
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_5
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_6
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_7
 | 
			
		||||
  * @retval Returned value can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_0
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_1
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_2
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_3
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_4
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_5
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_6
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_7
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_8
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_9
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_10
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_11
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_12
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_13
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_14
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_15
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_GPIO_GetAFPin_0_7(GPIO_TypeDef *GPIOx, uint32_t Pin)
 | 
			
		||||
{
 | 
			
		||||
  return (uint32_t)(READ_BIT(GPIOx->AFR[0],
 | 
			
		||||
                             (GPIO_AFRL_AFRL0 << (POSITION_VAL(Pin) * 4U))) >> (POSITION_VAL(Pin) * 4U));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Configure gpio alternate function of a dedicated pin from 8 to 15 for a dedicated port.
 | 
			
		||||
  * @note   Possible values are from AF0 to AF15 depending on target.
 | 
			
		||||
  * @note   Warning: only one pin can be passed as parameter.
 | 
			
		||||
  * @rmtoll AFRH         AFSELy        LL_GPIO_SetAFPin_8_15
 | 
			
		||||
  * @param  GPIOx GPIO Port
 | 
			
		||||
  * @param  Pin This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_8
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_9
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_10
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_11
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_12
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_13
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_14
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_15
 | 
			
		||||
  * @param  Alternate This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_0
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_1
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_2
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_3
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_4
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_5
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_6
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_7
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_8
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_9
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_10
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_11
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_12
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_13
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_14
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_15
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_GPIO_SetAFPin_8_15(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Alternate)
 | 
			
		||||
{
 | 
			
		||||
  MODIFY_REG(GPIOx->AFR[1], (GPIO_AFRH_AFRH0 << (POSITION_VAL(Pin >> 8U) * 4U)),
 | 
			
		||||
             (Alternate << (POSITION_VAL(Pin >> 8U) * 4U)));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Return gpio alternate function of a dedicated pin from 8 to 15 for a dedicated port.
 | 
			
		||||
  * @note   Possible values are from AF0 to AF15 depending on target.
 | 
			
		||||
  * @rmtoll AFRH         AFSELy        LL_GPIO_GetAFPin_8_15
 | 
			
		||||
  * @param  GPIOx GPIO Port
 | 
			
		||||
  * @param  Pin This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_8
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_9
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_10
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_11
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_12
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_13
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_14
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_15
 | 
			
		||||
  * @retval Returned value can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_0
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_1
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_2
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_3
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_4
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_5
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_6
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_7
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_8
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_9
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_10
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_11
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_12
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_13
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_14
 | 
			
		||||
  *         @arg @ref LL_GPIO_AF_15
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_GPIO_GetAFPin_8_15(GPIO_TypeDef *GPIOx, uint32_t Pin)
 | 
			
		||||
{
 | 
			
		||||
  return (uint32_t)(READ_BIT(GPIOx->AFR[1],
 | 
			
		||||
                             (GPIO_AFRH_AFRH0 << (POSITION_VAL(Pin >> 8U) * 4U))) >> (POSITION_VAL(Pin >> 8U) * 4U));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Lock configuration of several pins for a dedicated port.
 | 
			
		||||
  * @note   When the lock sequence has been applied on a port bit, the
 | 
			
		||||
  *         value of this port bit can no longer be modified until the
 | 
			
		||||
  *         next reset.
 | 
			
		||||
  * @note   Each lock bit freezes a specific configuration register
 | 
			
		||||
  *         (control and alternate function registers).
 | 
			
		||||
  * @rmtoll LCKR         LCKK          LL_GPIO_LockPin
 | 
			
		||||
  * @param  GPIOx GPIO Port
 | 
			
		||||
  * @param  PinMask This parameter can be a combination of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_0
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_1
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_2
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_3
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_4
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_5
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_6
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_7
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_8
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_9
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_10
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_11
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_12
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_13
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_14
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_15
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_ALL
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_GPIO_LockPin(GPIO_TypeDef *GPIOx, uint32_t PinMask)
 | 
			
		||||
{
 | 
			
		||||
  __IO uint32_t temp;
 | 
			
		||||
  WRITE_REG(GPIOx->LCKR, GPIO_LCKR_LCKK | PinMask);
 | 
			
		||||
  WRITE_REG(GPIOx->LCKR, PinMask);
 | 
			
		||||
  WRITE_REG(GPIOx->LCKR, GPIO_LCKR_LCKK | PinMask);
 | 
			
		||||
  temp = READ_REG(GPIOx->LCKR);
 | 
			
		||||
  (void) temp;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Return 1 if all pins passed as parameter, of a dedicated port, are locked. else Return 0.
 | 
			
		||||
  * @rmtoll LCKR         LCKy          LL_GPIO_IsPinLocked
 | 
			
		||||
  * @param  GPIOx GPIO Port
 | 
			
		||||
  * @param  PinMask This parameter can be a combination of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_0
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_1
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_2
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_3
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_4
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_5
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_6
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_7
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_8
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_9
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_10
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_11
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_12
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_13
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_14
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_15
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_ALL
 | 
			
		||||
  * @retval State of bit (1 or 0).
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_GPIO_IsPinLocked(GPIO_TypeDef *GPIOx, uint32_t PinMask)
 | 
			
		||||
{
 | 
			
		||||
  return (READ_BIT(GPIOx->LCKR, PinMask) == (PinMask));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Return 1 if one of the pin of a dedicated port is locked. else return 0.
 | 
			
		||||
  * @rmtoll LCKR         LCKK          LL_GPIO_IsAnyPinLocked
 | 
			
		||||
  * @param  GPIOx GPIO Port
 | 
			
		||||
  * @retval State of bit (1 or 0).
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_GPIO_IsAnyPinLocked(GPIO_TypeDef *GPIOx)
 | 
			
		||||
{
 | 
			
		||||
  return (READ_BIT(GPIOx->LCKR, GPIO_LCKR_LCKK) == (GPIO_LCKR_LCKK));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup GPIO_LL_EF_Data_Access Data Access
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Return full input data register value for a dedicated port.
 | 
			
		||||
  * @rmtoll IDR          IDy           LL_GPIO_ReadInputPort
 | 
			
		||||
  * @param  GPIOx GPIO Port
 | 
			
		||||
  * @retval Input data register value of port
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_GPIO_ReadInputPort(GPIO_TypeDef *GPIOx)
 | 
			
		||||
{
 | 
			
		||||
  return (uint32_t)(READ_REG(GPIOx->IDR));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Return if input data level for several pins of dedicated port is high or low.
 | 
			
		||||
  * @rmtoll IDR          IDy           LL_GPIO_IsInputPinSet
 | 
			
		||||
  * @param  GPIOx GPIO Port
 | 
			
		||||
  * @param  PinMask This parameter can be a combination of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_0
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_1
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_2
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_3
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_4
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_5
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_6
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_7
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_8
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_9
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_10
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_11
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_12
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_13
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_14
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_15
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_ALL
 | 
			
		||||
  * @retval State of bit (1 or 0).
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_GPIO_IsInputPinSet(GPIO_TypeDef *GPIOx, uint32_t PinMask)
 | 
			
		||||
{
 | 
			
		||||
  return (READ_BIT(GPIOx->IDR, PinMask) == (PinMask));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Write output data register for the port.
 | 
			
		||||
  * @rmtoll ODR          ODy           LL_GPIO_WriteOutputPort
 | 
			
		||||
  * @param  GPIOx GPIO Port
 | 
			
		||||
  * @param  PortValue Level value for each pin of the port
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_GPIO_WriteOutputPort(GPIO_TypeDef *GPIOx, uint32_t PortValue)
 | 
			
		||||
{
 | 
			
		||||
  WRITE_REG(GPIOx->ODR, PortValue);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Return full output data register value for a dedicated port.
 | 
			
		||||
  * @rmtoll ODR          ODy           LL_GPIO_ReadOutputPort
 | 
			
		||||
  * @param  GPIOx GPIO Port
 | 
			
		||||
  * @retval Output data register value of port
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_GPIO_ReadOutputPort(GPIO_TypeDef *GPIOx)
 | 
			
		||||
{
 | 
			
		||||
  return (uint32_t)(READ_REG(GPIOx->ODR));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Return if input data level for several pins of dedicated port is high or low.
 | 
			
		||||
  * @rmtoll ODR          ODy           LL_GPIO_IsOutputPinSet
 | 
			
		||||
  * @param  GPIOx GPIO Port
 | 
			
		||||
  * @param  PinMask This parameter can be a combination of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_0
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_1
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_2
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_3
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_4
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_5
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_6
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_7
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_8
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_9
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_10
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_11
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_12
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_13
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_14
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_15
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_ALL
 | 
			
		||||
  * @retval State of bit (1 or 0).
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_GPIO_IsOutputPinSet(GPIO_TypeDef *GPIOx, uint32_t PinMask)
 | 
			
		||||
{
 | 
			
		||||
  return (READ_BIT(GPIOx->ODR, PinMask) == (PinMask));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Set several pins to high level on dedicated gpio port.
 | 
			
		||||
  * @rmtoll BSRR         BSy           LL_GPIO_SetOutputPin
 | 
			
		||||
  * @param  GPIOx GPIO Port
 | 
			
		||||
  * @param  PinMask This parameter can be a combination of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_0
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_1
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_2
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_3
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_4
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_5
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_6
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_7
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_8
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_9
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_10
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_11
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_12
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_13
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_14
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_15
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_ALL
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_GPIO_SetOutputPin(GPIO_TypeDef *GPIOx, uint32_t PinMask)
 | 
			
		||||
{
 | 
			
		||||
  WRITE_REG(GPIOx->BSRR, PinMask);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Set several pins to low level on dedicated gpio port.
 | 
			
		||||
  * @rmtoll BRR          BRy           LL_GPIO_ResetOutputPin
 | 
			
		||||
  * @param  GPIOx GPIO Port
 | 
			
		||||
  * @param  PinMask This parameter can be a combination of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_0
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_1
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_2
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_3
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_4
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_5
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_6
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_7
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_8
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_9
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_10
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_11
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_12
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_13
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_14
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_15
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_ALL
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_GPIO_ResetOutputPin(GPIO_TypeDef *GPIOx, uint32_t PinMask)
 | 
			
		||||
{
 | 
			
		||||
  WRITE_REG(GPIOx->BRR, PinMask);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Toggle data value for several pin of dedicated port.
 | 
			
		||||
  * @rmtoll ODR          ODy           LL_GPIO_TogglePin
 | 
			
		||||
  * @param  GPIOx GPIO Port
 | 
			
		||||
  * @param  PinMask This parameter can be a combination of the following values:
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_0
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_1
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_2
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_3
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_4
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_5
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_6
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_7
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_8
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_9
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_10
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_11
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_12
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_13
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_14
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_15
 | 
			
		||||
  *         @arg @ref LL_GPIO_PIN_ALL
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_GPIO_TogglePin(GPIO_TypeDef *GPIOx, uint32_t PinMask)
 | 
			
		||||
{
 | 
			
		||||
  uint32_t odr = READ_REG(GPIOx->ODR);
 | 
			
		||||
  WRITE_REG(GPIOx->BSRR, ((odr & PinMask) << 16u) | (~odr & PinMask));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#if defined(USE_FULL_LL_DRIVER)
 | 
			
		||||
/** @defgroup GPIO_LL_EF_Init Initialization and de-initialization functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
ErrorStatus LL_GPIO_DeInit(GPIO_TypeDef *GPIOx);
 | 
			
		||||
ErrorStatus LL_GPIO_Init(GPIO_TypeDef *GPIOx, LL_GPIO_InitTypeDef *GPIO_InitStruct);
 | 
			
		||||
void        LL_GPIO_StructInit(LL_GPIO_InitTypeDef *GPIO_InitStruct);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
#endif /* USE_FULL_LL_DRIVER */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#endif /* defined (GPIOA) || defined (GPIOB) || defined (GPIOC) || defined (GPIOD) || defined (GPIOE) || defined (GPIOF) || defined (GPIOG) || defined (GPIOH) */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* __STM32F3xx_LL_GPIO_H */
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,551 @@
 | 
			
		||||
/**
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @file    stm32f3xx_ll_pwr.h
 | 
			
		||||
  * @author  MCD Application Team
 | 
			
		||||
  * @brief   Header file of PWR LL module.
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @attention
 | 
			
		||||
  *
 | 
			
		||||
  * Copyright (c) 2016 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 __STM32F3xx_LL_PWR_H
 | 
			
		||||
#define __STM32F3xx_LL_PWR_H
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Includes ------------------------------------------------------------------*/
 | 
			
		||||
#include "stm32f3xx.h"
 | 
			
		||||
 | 
			
		||||
/** @addtogroup STM32F3xx_LL_Driver
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#if defined(PWR)
 | 
			
		||||
 | 
			
		||||
/** @defgroup PWR_LL PWR
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Private types -------------------------------------------------------------*/
 | 
			
		||||
/* Private variables ---------------------------------------------------------*/
 | 
			
		||||
/* Private constants ---------------------------------------------------------*/
 | 
			
		||||
/* Private macros ------------------------------------------------------------*/
 | 
			
		||||
/* Exported types ------------------------------------------------------------*/
 | 
			
		||||
/* Exported constants --------------------------------------------------------*/
 | 
			
		||||
/** @defgroup PWR_LL_Exported_Constants PWR Exported Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup PWR_LL_EC_CLEAR_FLAG Clear Flags Defines
 | 
			
		||||
  * @brief    Flags defines which can be used with LL_PWR_WriteReg function
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define LL_PWR_CR_CSBF                     PWR_CR_CSBF            /*!< Clear standby flag */
 | 
			
		||||
#define LL_PWR_CR_CWUF                     PWR_CR_CWUF            /*!< Clear wakeup flag */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup PWR_LL_EC_GET_FLAG Get Flags Defines
 | 
			
		||||
  * @brief    Flags defines which can be used with LL_PWR_ReadReg function
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define LL_PWR_CSR_WUF                     PWR_CSR_WUF            /*!< Wakeup flag */
 | 
			
		||||
#define LL_PWR_CSR_SBF                     PWR_CSR_SBF            /*!< Standby flag */
 | 
			
		||||
#if defined(PWR_PVD_SUPPORT)
 | 
			
		||||
#define LL_PWR_CSR_PVDO                    PWR_CSR_PVDO           /*!< Power voltage detector output flag */
 | 
			
		||||
#endif /* PWR_PVD_SUPPORT */
 | 
			
		||||
#if defined(PWR_CSR_VREFINTRDYF)
 | 
			
		||||
#define LL_PWR_CSR_VREFINTRDYF             PWR_CSR_VREFINTRDYF    /*!< VREFINT ready flag */
 | 
			
		||||
#endif /* PWR_CSR_VREFINTRDYF */
 | 
			
		||||
#define LL_PWR_CSR_EWUP1                   PWR_CSR_EWUP1          /*!< Enable WKUP pin 1 */
 | 
			
		||||
#define LL_PWR_CSR_EWUP2                   PWR_CSR_EWUP2          /*!< Enable WKUP pin 2 */
 | 
			
		||||
#if defined(PWR_CSR_EWUP3)
 | 
			
		||||
#define LL_PWR_CSR_EWUP3                   PWR_CSR_EWUP3          /*!< Enable WKUP pin 3 */
 | 
			
		||||
#endif /* PWR_CSR_EWUP3 */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/** @defgroup PWR_LL_EC_MODE_PWR Mode Power
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define LL_PWR_MODE_STOP_MAINREGU             0x00000000U                    /*!< Enter Stop mode when the CPU enters deepsleep */
 | 
			
		||||
#define LL_PWR_MODE_STOP_LPREGU               (PWR_CR_LPDS)                  /*!< Enter Stop mode (with low power Regulator ON) when the CPU enters deepsleep */
 | 
			
		||||
#define LL_PWR_MODE_STANDBY                   (PWR_CR_PDDS)                  /*!< Enter Standby mode when the CPU enters deepsleep */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#if defined(PWR_CR_LPDS)
 | 
			
		||||
/** @defgroup PWR_LL_EC_REGU_MODE_DS_MODE  Regulator Mode In Deep Sleep Mode
 | 
			
		||||
 * @{
 | 
			
		||||
 */
 | 
			
		||||
#define LL_PWR_REGU_DSMODE_MAIN        0x00000000U           /*!< Voltage Regulator in main mode during deepsleep mode */
 | 
			
		||||
#define LL_PWR_REGU_DSMODE_LOW_POWER   (PWR_CR_LPDS)         /*!< Voltage Regulator in low-power mode during deepsleep mode */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
#endif /* PWR_CR_LPDS */
 | 
			
		||||
 | 
			
		||||
#if defined(PWR_PVD_SUPPORT)
 | 
			
		||||
/** @defgroup PWR_LL_EC_PVDLEVEL Power Voltage Detector Level
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define LL_PWR_PVDLEVEL_0                  (PWR_CR_PLS_LEV0)      /*!< Voltage threshold detected by PVD 2.2 V */
 | 
			
		||||
#define LL_PWR_PVDLEVEL_1                  (PWR_CR_PLS_LEV1)      /*!< Voltage threshold detected by PVD 2.3 V */
 | 
			
		||||
#define LL_PWR_PVDLEVEL_2                  (PWR_CR_PLS_LEV2)      /*!< Voltage threshold detected by PVD 2.4 V */
 | 
			
		||||
#define LL_PWR_PVDLEVEL_3                  (PWR_CR_PLS_LEV3)      /*!< Voltage threshold detected by PVD 2.5 V */
 | 
			
		||||
#define LL_PWR_PVDLEVEL_4                  (PWR_CR_PLS_LEV4)      /*!< Voltage threshold detected by PVD 2.6 V */
 | 
			
		||||
#define LL_PWR_PVDLEVEL_5                  (PWR_CR_PLS_LEV5)      /*!< Voltage threshold detected by PVD 2.7 V */
 | 
			
		||||
#define LL_PWR_PVDLEVEL_6                  (PWR_CR_PLS_LEV6)      /*!< Voltage threshold detected by PVD 2.8 V */
 | 
			
		||||
#define LL_PWR_PVDLEVEL_7                  (PWR_CR_PLS_LEV7)      /*!< Voltage threshold detected by PVD 2.9 V */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
#endif /* PWR_PVD_SUPPORT */
 | 
			
		||||
/** @defgroup PWR_LL_EC_WAKEUP_PIN  Wakeup Pins
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define LL_PWR_WAKEUP_PIN1                 (PWR_CSR_EWUP1)        /*!< WKUP pin 1 : PA0 */
 | 
			
		||||
#define LL_PWR_WAKEUP_PIN2                 (PWR_CSR_EWUP2)        /*!< WKUP pin 2 : PC13 */
 | 
			
		||||
#if defined(PWR_CSR_EWUP3)
 | 
			
		||||
#define LL_PWR_WAKEUP_PIN3                 (PWR_CSR_EWUP3)        /*!< WKUP pin 3 : PE6 or PA2 according to device */
 | 
			
		||||
#endif /* PWR_CSR_EWUP3 */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup PWR_LL_EC_SDADC_ANALOG_X SDADC Analogx
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#if defined(SDADC1)
 | 
			
		||||
#define LL_PWR_SDADC_ANALOG1              (PWR_CR_ENSD1)   /*!< Enable SDADC1 */
 | 
			
		||||
#endif /* SDADC1 */
 | 
			
		||||
#if defined(SDADC2)
 | 
			
		||||
#define LL_PWR_SDADC_ANALOG2              (PWR_CR_ENSD2)   /*!< Enable SDADC2 */
 | 
			
		||||
#endif /* SDADC2 */
 | 
			
		||||
#if defined(SDADC3)
 | 
			
		||||
#define LL_PWR_SDADC_ANALOG3              (PWR_CR_ENSD3)   /*!< Enable SDADC3 */
 | 
			
		||||
#endif /* SDADC3 */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Exported macro ------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup PWR_LL_Exported_Macros PWR Exported Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup PWR_LL_EM_WRITE_READ Common write and read registers Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Write a value in PWR register
 | 
			
		||||
  * @param  __REG__ Register to be written
 | 
			
		||||
  * @param  __VALUE__ Value to be written in the register
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
#define LL_PWR_WriteReg(__REG__, __VALUE__) WRITE_REG(PWR->__REG__, (__VALUE__))
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Read a value in PWR register
 | 
			
		||||
  * @param  __REG__ Register to be read
 | 
			
		||||
  * @retval Register value
 | 
			
		||||
  */
 | 
			
		||||
#define LL_PWR_ReadReg(__REG__) READ_REG(PWR->__REG__)
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported functions --------------------------------------------------------*/
 | 
			
		||||
/** @defgroup PWR_LL_Exported_Functions PWR Exported Functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup PWR_LL_EF_Configuration Configuration
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Enables the SDADC peripheral functionality
 | 
			
		||||
  * @rmtoll CR   ENSD1       LL_PWR_EnableSDADC\n
 | 
			
		||||
  *         CR   ENSD2       LL_PWR_EnableSDADC\n
 | 
			
		||||
  *         CR   ENSD3       LL_PWR_EnableSDADC
 | 
			
		||||
  * @param  Analogx This parameter can be a combination of the following values:
 | 
			
		||||
  *         @arg @ref LL_PWR_SDADC_ANALOG1
 | 
			
		||||
  *         @arg @ref LL_PWR_SDADC_ANALOG2
 | 
			
		||||
  *         @arg @ref LL_PWR_SDADC_ANALOG3
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_PWR_EnableSDADC(uint32_t Analogx)
 | 
			
		||||
{
 | 
			
		||||
  SET_BIT(PWR->CR, Analogx); 
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Disables the SDADC peripheral functionality
 | 
			
		||||
  * @rmtoll CR   ENSD1       LL_PWR_EnableSDADC\n
 | 
			
		||||
  *         CR   ENSD2       LL_PWR_EnableSDADC\n
 | 
			
		||||
  *         CR   ENSD3       LL_PWR_EnableSDADC
 | 
			
		||||
  * @param  Analogx This parameter can be a combination of the following values:
 | 
			
		||||
  *         @arg @ref LL_PWR_SDADC_ANALOG1
 | 
			
		||||
  *         @arg @ref LL_PWR_SDADC_ANALOG2
 | 
			
		||||
  *         @arg @ref LL_PWR_SDADC_ANALOG3
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_PWR_DisableSDADC(uint32_t Analogx)
 | 
			
		||||
{
 | 
			
		||||
  CLEAR_BIT(PWR->CR, Analogx);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Check if SDADCx has been enabled or not
 | 
			
		||||
  * @rmtoll CR   ENSD1       LL_PWR_IsEnabledSDADC\n
 | 
			
		||||
  *         CR   ENSD2       LL_PWR_IsEnabledSDADC\n
 | 
			
		||||
  *         CR   ENSD3       LL_PWR_IsEnabledSDADC
 | 
			
		||||
  * @param  Analogx This parameter can be a combination of the following values:
 | 
			
		||||
  *         @arg @ref LL_PWR_SDADC_ANALOG1
 | 
			
		||||
  *         @arg @ref LL_PWR_SDADC_ANALOG2
 | 
			
		||||
  *         @arg @ref LL_PWR_SDADC_ANALOG3
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_PWR_IsEnabledSDADC(uint32_t Analogx)
 | 
			
		||||
{
 | 
			
		||||
  return (READ_BIT(PWR->CR, Analogx) == (Analogx));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Enable access to the backup domain
 | 
			
		||||
  * @rmtoll CR    DBP       LL_PWR_EnableBkUpAccess
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_PWR_EnableBkUpAccess(void)
 | 
			
		||||
{
 | 
			
		||||
  SET_BIT(PWR->CR, PWR_CR_DBP);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Disable access to the backup domain
 | 
			
		||||
  * @rmtoll CR    DBP       LL_PWR_DisableBkUpAccess
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_PWR_DisableBkUpAccess(void)
 | 
			
		||||
{
 | 
			
		||||
  CLEAR_BIT(PWR->CR, PWR_CR_DBP);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Check if the backup domain is enabled
 | 
			
		||||
  * @rmtoll CR    DBP       LL_PWR_IsEnabledBkUpAccess
 | 
			
		||||
  * @retval State of bit (1 or 0).
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_PWR_IsEnabledBkUpAccess(void)
 | 
			
		||||
{
 | 
			
		||||
  return (READ_BIT(PWR->CR, PWR_CR_DBP) == (PWR_CR_DBP));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if defined(PWR_CR_LPDS)
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Set voltage Regulator mode during deep sleep mode
 | 
			
		||||
  * @rmtoll CR    LPDS         LL_PWR_SetRegulModeDS
 | 
			
		||||
  * @param  RegulMode This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_PWR_REGU_DSMODE_MAIN
 | 
			
		||||
  *         @arg @ref LL_PWR_REGU_DSMODE_LOW_POWER
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_PWR_SetRegulModeDS(uint32_t RegulMode)
 | 
			
		||||
{
 | 
			
		||||
  MODIFY_REG(PWR->CR, PWR_CR_LPDS, RegulMode);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Get voltage Regulator mode during deep sleep mode
 | 
			
		||||
  * @rmtoll CR    LPDS         LL_PWR_GetRegulModeDS
 | 
			
		||||
  * @retval Returned value can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_PWR_REGU_DSMODE_MAIN
 | 
			
		||||
  *         @arg @ref LL_PWR_REGU_DSMODE_LOW_POWER
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_PWR_GetRegulModeDS(void)
 | 
			
		||||
{
 | 
			
		||||
  return (uint32_t)(READ_BIT(PWR->CR, PWR_CR_LPDS));
 | 
			
		||||
}
 | 
			
		||||
#endif /* PWR_CR_LPDS */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Set Power Down mode when CPU enters deepsleep
 | 
			
		||||
  * @rmtoll CR    PDDS         LL_PWR_SetPowerMode\n
 | 
			
		||||
  * @rmtoll CR    LPDS         LL_PWR_SetPowerMode
 | 
			
		||||
  * @param  PDMode This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_PWR_MODE_STOP_MAINREGU
 | 
			
		||||
  *         @arg @ref LL_PWR_MODE_STOP_LPREGU
 | 
			
		||||
  *         @arg @ref LL_PWR_MODE_STANDBY
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_PWR_SetPowerMode(uint32_t PDMode)
 | 
			
		||||
{
 | 
			
		||||
  MODIFY_REG(PWR->CR, (PWR_CR_PDDS| PWR_CR_LPDS), PDMode);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Get Power Down mode when CPU enters deepsleep
 | 
			
		||||
  * @rmtoll CR    PDDS         LL_PWR_GetPowerMode\n
 | 
			
		||||
  * @rmtoll CR    LPDS         LL_PWR_GetPowerMode
 | 
			
		||||
  * @retval Returned value can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_PWR_MODE_STOP_MAINREGU
 | 
			
		||||
  *         @arg @ref LL_PWR_MODE_STOP_LPREGU
 | 
			
		||||
  *         @arg @ref LL_PWR_MODE_STANDBY
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_PWR_GetPowerMode(void)
 | 
			
		||||
{
 | 
			
		||||
  return (uint32_t)(READ_BIT(PWR->CR, (PWR_CR_PDDS| PWR_CR_LPDS)));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if defined(PWR_PVD_SUPPORT)
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Configure the voltage threshold detected by the Power Voltage Detector
 | 
			
		||||
  * @rmtoll CR    PLS       LL_PWR_SetPVDLevel
 | 
			
		||||
  * @param  PVDLevel This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_PWR_PVDLEVEL_0
 | 
			
		||||
  *         @arg @ref LL_PWR_PVDLEVEL_1
 | 
			
		||||
  *         @arg @ref LL_PWR_PVDLEVEL_2
 | 
			
		||||
  *         @arg @ref LL_PWR_PVDLEVEL_3
 | 
			
		||||
  *         @arg @ref LL_PWR_PVDLEVEL_4
 | 
			
		||||
  *         @arg @ref LL_PWR_PVDLEVEL_5
 | 
			
		||||
  *         @arg @ref LL_PWR_PVDLEVEL_6
 | 
			
		||||
  *         @arg @ref LL_PWR_PVDLEVEL_7
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_PWR_SetPVDLevel(uint32_t PVDLevel)
 | 
			
		||||
{
 | 
			
		||||
  MODIFY_REG(PWR->CR, PWR_CR_PLS, PVDLevel);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Get the voltage threshold detection
 | 
			
		||||
  * @rmtoll CR    PLS       LL_PWR_GetPVDLevel
 | 
			
		||||
  * @retval Returned value can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_PWR_PVDLEVEL_0
 | 
			
		||||
  *         @arg @ref LL_PWR_PVDLEVEL_1
 | 
			
		||||
  *         @arg @ref LL_PWR_PVDLEVEL_2
 | 
			
		||||
  *         @arg @ref LL_PWR_PVDLEVEL_3
 | 
			
		||||
  *         @arg @ref LL_PWR_PVDLEVEL_4
 | 
			
		||||
  *         @arg @ref LL_PWR_PVDLEVEL_5
 | 
			
		||||
  *         @arg @ref LL_PWR_PVDLEVEL_6
 | 
			
		||||
  *         @arg @ref LL_PWR_PVDLEVEL_7
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_PWR_GetPVDLevel(void)
 | 
			
		||||
{
 | 
			
		||||
  return (uint32_t)(READ_BIT(PWR->CR, PWR_CR_PLS));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Enable Power Voltage Detector
 | 
			
		||||
  * @rmtoll CR    PVDE       LL_PWR_EnablePVD
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_PWR_EnablePVD(void)
 | 
			
		||||
{
 | 
			
		||||
  SET_BIT(PWR->CR, PWR_CR_PVDE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Disable Power Voltage Detector
 | 
			
		||||
  * @rmtoll CR    PVDE       LL_PWR_DisablePVD
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_PWR_DisablePVD(void)
 | 
			
		||||
{
 | 
			
		||||
  CLEAR_BIT(PWR->CR, PWR_CR_PVDE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Check if Power Voltage Detector is enabled
 | 
			
		||||
  * @rmtoll CR    PVDE       LL_PWR_IsEnabledPVD
 | 
			
		||||
  * @retval State of bit (1 or 0).
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_PWR_IsEnabledPVD(void)
 | 
			
		||||
{
 | 
			
		||||
  return (READ_BIT(PWR->CR, PWR_CR_PVDE) == (PWR_CR_PVDE));
 | 
			
		||||
}
 | 
			
		||||
#endif /* PWR_PVD_SUPPORT */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Enable the WakeUp PINx functionality
 | 
			
		||||
  * @rmtoll CSR   EWUP1       LL_PWR_EnableWakeUpPin\n
 | 
			
		||||
  * @rmtoll CSR   EWUP2       LL_PWR_EnableWakeUpPin\n
 | 
			
		||||
  * @rmtoll CSR   EWUP3       LL_PWR_EnableWakeUpPin
 | 
			
		||||
  * @param  WakeUpPin This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_PWR_WAKEUP_PIN1
 | 
			
		||||
  *         @arg @ref LL_PWR_WAKEUP_PIN2
 | 
			
		||||
  *         @arg @ref LL_PWR_WAKEUP_PIN3 (*)
 | 
			
		||||
  *
 | 
			
		||||
  *         (*) not available on all devices
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_PWR_EnableWakeUpPin(uint32_t WakeUpPin)
 | 
			
		||||
{
 | 
			
		||||
  SET_BIT(PWR->CSR, WakeUpPin);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Disable the WakeUp PINx functionality
 | 
			
		||||
  * @rmtoll CSR   EWUP1       LL_PWR_DisableWakeUpPin\n
 | 
			
		||||
  * @rmtoll CSR   EWUP2       LL_PWR_DisableWakeUpPin\n
 | 
			
		||||
  * @rmtoll CSR   EWUP3       LL_PWR_DisableWakeUpPin
 | 
			
		||||
  * @param  WakeUpPin This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_PWR_WAKEUP_PIN1
 | 
			
		||||
  *         @arg @ref LL_PWR_WAKEUP_PIN2
 | 
			
		||||
  *         @arg @ref LL_PWR_WAKEUP_PIN3 (*)
 | 
			
		||||
  *
 | 
			
		||||
  *         (*) not available on all devices
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_PWR_DisableWakeUpPin(uint32_t WakeUpPin)
 | 
			
		||||
{
 | 
			
		||||
  CLEAR_BIT(PWR->CSR, WakeUpPin);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Check if the WakeUp PINx functionality is enabled
 | 
			
		||||
  * @rmtoll CSR   EWUP1       LL_PWR_IsEnabledWakeUpPin\n
 | 
			
		||||
  * @rmtoll CSR   EWUP2       LL_PWR_IsEnabledWakeUpPin\n
 | 
			
		||||
  * @rmtoll CSR   EWUP3       LL_PWR_IsEnabledWakeUpPin
 | 
			
		||||
  * @param  WakeUpPin This parameter can be one of the following values:
 | 
			
		||||
  *         @arg @ref LL_PWR_WAKEUP_PIN1
 | 
			
		||||
  *         @arg @ref LL_PWR_WAKEUP_PIN2
 | 
			
		||||
  *         @arg @ref LL_PWR_WAKEUP_PIN3 (*)
 | 
			
		||||
  *
 | 
			
		||||
  *         (*) not available on all devices
 | 
			
		||||
  * @retval State of bit (1 or 0).
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_PWR_IsEnabledWakeUpPin(uint32_t WakeUpPin)
 | 
			
		||||
{
 | 
			
		||||
  return (READ_BIT(PWR->CSR, WakeUpPin) == (WakeUpPin));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup PWR_LL_EF_FLAG_Management FLAG_Management
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Get Wake-up Flag
 | 
			
		||||
  * @rmtoll CSR   WUF       LL_PWR_IsActiveFlag_WU
 | 
			
		||||
  * @retval State of bit (1 or 0).
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU(void)
 | 
			
		||||
{
 | 
			
		||||
  return (READ_BIT(PWR->CSR, PWR_CSR_WUF) == (PWR_CSR_WUF));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Get Standby Flag
 | 
			
		||||
  * @rmtoll CSR   SBF       LL_PWR_IsActiveFlag_SB
 | 
			
		||||
  * @retval State of bit (1 or 0).
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_SB(void)
 | 
			
		||||
{
 | 
			
		||||
  return (READ_BIT(PWR->CSR, PWR_CSR_SBF) == (PWR_CSR_SBF));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if defined(PWR_PVD_SUPPORT)
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Indicate whether VDD voltage is below the selected PVD threshold
 | 
			
		||||
  * @rmtoll CSR   PVDO       LL_PWR_IsActiveFlag_PVDO
 | 
			
		||||
  * @retval State of bit (1 or 0).
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_PVDO(void)
 | 
			
		||||
{
 | 
			
		||||
  return (READ_BIT(PWR->CSR, PWR_CSR_PVDO) == (PWR_CSR_PVDO));
 | 
			
		||||
}
 | 
			
		||||
#endif /* PWR_PVD_SUPPORT */
 | 
			
		||||
 | 
			
		||||
#if defined(PWR_CSR_VREFINTRDYF)
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Get Internal Reference VrefInt Flag
 | 
			
		||||
  * @rmtoll CSR   VREFINTRDYF       LL_PWR_IsActiveFlag_VREFINTRDY
 | 
			
		||||
  * @retval State of bit (1 or 0).
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_VREFINTRDY(void)
 | 
			
		||||
{
 | 
			
		||||
  return (READ_BIT(PWR->CSR, PWR_CSR_VREFINTRDYF) == (PWR_CSR_VREFINTRDYF));
 | 
			
		||||
}
 | 
			
		||||
#endif /* PWR_CSR_VREFINTRDYF */
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Clear Standby Flag
 | 
			
		||||
  * @rmtoll CR   CSBF       LL_PWR_ClearFlag_SB
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_PWR_ClearFlag_SB(void)
 | 
			
		||||
{
 | 
			
		||||
  SET_BIT(PWR->CR, PWR_CR_CSBF);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Clear Wake-up Flags
 | 
			
		||||
  * @rmtoll CR   CWUF       LL_PWR_ClearFlag_WU
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_PWR_ClearFlag_WU(void)
 | 
			
		||||
{
 | 
			
		||||
  SET_BIT(PWR->CR, PWR_CR_CWUF);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#if defined(USE_FULL_LL_DRIVER)
 | 
			
		||||
/** @defgroup PWR_LL_EF_Init De-initialization function
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
ErrorStatus LL_PWR_DeInit(void);
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
#endif /* USE_FULL_LL_DRIVER */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#endif /* defined(PWR) */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* __STM32F3xx_LL_PWR_H */
 | 
			
		||||
							
								
								
									
										2839
									
								
								Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_rcc.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2839
									
								
								Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_rcc.h
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										1725
									
								
								Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_system.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1725
									
								
								Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_system.h
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										5061
									
								
								Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_tim.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5061
									
								
								Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_tim.h
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										3650
									
								
								Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_usart.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3650
									
								
								Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_usart.h
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -0,0 +1,280 @@
 | 
			
		||||
/**
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @file    stm32f3xx_ll_utils.h
 | 
			
		||||
  * @author  MCD Application Team
 | 
			
		||||
  * @brief   Header file of UTILS LL module.
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  * @attention
 | 
			
		||||
  *
 | 
			
		||||
  * Copyright (c) 2016 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.
 | 
			
		||||
  *
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  @verbatim
 | 
			
		||||
  ==============================================================================
 | 
			
		||||
                     ##### How to use this driver #####
 | 
			
		||||
  ==============================================================================
 | 
			
		||||
    [..]
 | 
			
		||||
    The LL UTILS driver contains a set of generic APIs that can be
 | 
			
		||||
    used by user:
 | 
			
		||||
      (+) Device electronic signature
 | 
			
		||||
      (+) Timing functions
 | 
			
		||||
      (+) PLL configuration functions
 | 
			
		||||
 | 
			
		||||
  @endverbatim
 | 
			
		||||
  ******************************************************************************
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Define to prevent recursive inclusion -------------------------------------*/
 | 
			
		||||
#ifndef __STM32F3xx_LL_UTILS_H
 | 
			
		||||
#define __STM32F3xx_LL_UTILS_H
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Includes ------------------------------------------------------------------*/
 | 
			
		||||
#include "stm32f3xx.h"
 | 
			
		||||
 | 
			
		||||
/** @addtogroup STM32F3xx_LL_Driver
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup UTILS_LL UTILS
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Private types -------------------------------------------------------------*/
 | 
			
		||||
/* Private variables ---------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/* Private constants ---------------------------------------------------------*/
 | 
			
		||||
/** @defgroup UTILS_LL_Private_Constants UTILS Private Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Max delay can be used in LL_mDelay */
 | 
			
		||||
#define LL_MAX_DELAY                  0xFFFFFFFFU
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @brief Unique device ID register base address
 | 
			
		||||
 */
 | 
			
		||||
#define UID_BASE_ADDRESS              UID_BASE
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @brief Flash size data register base address
 | 
			
		||||
 */
 | 
			
		||||
#define FLASHSIZE_BASE_ADDRESS        FLASHSIZE_BASE
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @brief Package data register base address
 | 
			
		||||
 */
 | 
			
		||||
#define PACKAGE_BASE_ADDRESS          PACKAGE_BASE
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Private macros ------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup UTILS_LL_Private_Macros UTILS Private Macros
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
/* Exported types ------------------------------------------------------------*/
 | 
			
		||||
/** @defgroup UTILS_LL_ES_INIT UTILS Exported structures
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  UTILS PLL structure definition
 | 
			
		||||
  */
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
  uint32_t PLLMul;   /*!< Multiplication factor for PLL VCO input clock.
 | 
			
		||||
                          This parameter can be a value of @ref RCC_LL_EC_PLL_MUL
 | 
			
		||||
 | 
			
		||||
                          This feature can be modified afterwards using unitary function
 | 
			
		||||
                          @ref LL_RCC_PLL_ConfigDomain_SYS(). */
 | 
			
		||||
 | 
			
		||||
#if defined(RCC_PLLSRC_PREDIV1_SUPPORT)
 | 
			
		||||
  uint32_t PLLDiv;   /*!< Division factor for PLL VCO output clock.
 | 
			
		||||
                          This parameter can be a value of @ref RCC_LL_EC_PREDIV_DIV 
 | 
			
		||||
  
 | 
			
		||||
                          This feature can be modified afterwards using unitary function
 | 
			
		||||
                          @ref LL_RCC_PLL_ConfigDomain_SYS(). */
 | 
			
		||||
#else
 | 
			
		||||
  uint32_t Prediv;   /*!< Division factor for HSE used as PLL clock source.
 | 
			
		||||
                          This parameter can be a value of @ref RCC_LL_EC_PREDIV_DIV 
 | 
			
		||||
  
 | 
			
		||||
                          This feature can be modified afterwards using unitary function
 | 
			
		||||
                          @ref LL_RCC_PLL_ConfigDomain_SYS(). */
 | 
			
		||||
#endif /* RCC_PLLSRC_PREDIV1_SUPPORT */
 | 
			
		||||
} LL_UTILS_PLLInitTypeDef;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  UTILS System, AHB and APB buses clock configuration structure definition
 | 
			
		||||
  */
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
  uint32_t AHBCLKDivider;         /*!< The AHB clock (HCLK) divider. This clock is derived from the system clock (SYSCLK).
 | 
			
		||||
                                       This parameter can be a value of @ref RCC_LL_EC_SYSCLK_DIV
 | 
			
		||||
 | 
			
		||||
                                       This feature can be modified afterwards using unitary function
 | 
			
		||||
                                       @ref LL_RCC_SetAHBPrescaler(). */
 | 
			
		||||
 | 
			
		||||
  uint32_t APB1CLKDivider;        /*!< The APB1 clock (PCLK1) divider. This clock is derived from the AHB clock (HCLK).
 | 
			
		||||
                                       This parameter can be a value of @ref RCC_LL_EC_APB1_DIV
 | 
			
		||||
 | 
			
		||||
                                       This feature can be modified afterwards using unitary function
 | 
			
		||||
                                       @ref LL_RCC_SetAPB1Prescaler(). */
 | 
			
		||||
 | 
			
		||||
  uint32_t APB2CLKDivider;        /*!< The APB2 clock (PCLK2) divider. This clock is derived from the AHB clock (HCLK).
 | 
			
		||||
                                       This parameter can be a value of @ref RCC_LL_EC_APB2_DIV
 | 
			
		||||
 | 
			
		||||
                                       This feature can be modified afterwards using unitary function
 | 
			
		||||
                                       @ref LL_RCC_SetAPB2Prescaler(). */
 | 
			
		||||
 | 
			
		||||
} LL_UTILS_ClkInitTypeDef;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported constants --------------------------------------------------------*/
 | 
			
		||||
/** @defgroup UTILS_LL_Exported_Constants UTILS Exported Constants
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup UTILS_EC_HSE_BYPASS HSE Bypass activation
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
#define LL_UTILS_HSEBYPASS_OFF        0x00000000U       /*!< HSE Bypass is not enabled                */
 | 
			
		||||
#define LL_UTILS_HSEBYPASS_ON         0x00000001U       /*!< HSE Bypass is enabled                    */
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/* Exported macro ------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/* Exported functions --------------------------------------------------------*/
 | 
			
		||||
/** @defgroup UTILS_LL_Exported_Functions UTILS Exported Functions
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup UTILS_EF_DEVICE_ELECTRONIC_SIGNATURE DEVICE ELECTRONIC SIGNATURE
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Get Word0 of the unique device identifier (UID based on 96 bits)
 | 
			
		||||
  * @retval UID[31:0]: X and Y coordinates on the wafer expressed in BCD format
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_GetUID_Word0(void)
 | 
			
		||||
{
 | 
			
		||||
  return (uint32_t)(READ_REG(*((uint32_t *)UID_BASE_ADDRESS)));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Get Word1 of the unique device identifier (UID based on 96 bits)
 | 
			
		||||
  * @retval UID[63:32]: Wafer number (UID[39:32]) & LOT_NUM[23:0] (UID[63:40])
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_GetUID_Word1(void)
 | 
			
		||||
{
 | 
			
		||||
  return (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE_ADDRESS + 4U))));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Get Word2 of the unique device identifier (UID based on 96 bits)
 | 
			
		||||
  * @retval UID[95:64]: Lot number (ASCII encoded) - LOT_NUM[55:24]
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_GetUID_Word2(void)
 | 
			
		||||
{
 | 
			
		||||
  return (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE_ADDRESS + 8U))));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  Get Flash memory size
 | 
			
		||||
  * @note   This bitfield indicates the size of the device Flash memory expressed in
 | 
			
		||||
  *         Kbytes. As an example, 0x040 corresponds to 64 Kbytes.
 | 
			
		||||
  * @retval FLASH_SIZE[15:0]: Flash memory size
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE uint32_t LL_GetFlashSize(void)
 | 
			
		||||
{
 | 
			
		||||
  return (uint16_t)(READ_REG(*((uint32_t *)FLASHSIZE_BASE_ADDRESS)));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup UTILS_LL_EF_DELAY DELAY
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @brief  This function configures the Cortex-M SysTick source of the time base.
 | 
			
		||||
  * @param  HCLKFrequency HCLK frequency in Hz (can be calculated thanks to RCC helper macro)
 | 
			
		||||
  * @note   When a RTOS is used, it is recommended to avoid changing the SysTick 
 | 
			
		||||
  *         configuration by calling this function, for a delay use rather osDelay RTOS service.
 | 
			
		||||
  * @param  Ticks Number of ticks
 | 
			
		||||
  * @retval None
 | 
			
		||||
  */
 | 
			
		||||
__STATIC_INLINE void LL_InitTick(uint32_t HCLKFrequency, uint32_t Ticks)
 | 
			
		||||
{
 | 
			
		||||
  /* Configure the SysTick to have interrupt in 1ms time base */
 | 
			
		||||
  SysTick->LOAD  = (uint32_t)((HCLKFrequency / Ticks) - 1UL);  /* set reload register */
 | 
			
		||||
  SysTick->VAL   = 0UL;                                       /* Load the SysTick Counter Value */
 | 
			
		||||
  SysTick->CTRL  = SysTick_CTRL_CLKSOURCE_Msk |
 | 
			
		||||
                   SysTick_CTRL_ENABLE_Msk;                   /* Enable the Systick Timer */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void        LL_Init1msTick(uint32_t HCLKFrequency);
 | 
			
		||||
void        LL_mDelay(uint32_t Delay);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/** @defgroup UTILS_EF_SYSTEM SYSTEM
 | 
			
		||||
  * @{
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
void        LL_SetSystemCoreClock(uint32_t HCLKFrequency);
 | 
			
		||||
#if defined(FLASH_ACR_LATENCY)
 | 
			
		||||
ErrorStatus LL_SetFlashLatency(uint32_t Frequency);
 | 
			
		||||
#endif /* FLASH_ACR_LATENCY */
 | 
			
		||||
ErrorStatus LL_PLL_ConfigSystemClock_HSI(LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct,
 | 
			
		||||
                                         LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct);
 | 
			
		||||
ErrorStatus LL_PLL_ConfigSystemClock_HSE(uint32_t HSEFrequency, uint32_t HSEBypass,
 | 
			
		||||
                                         LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct, LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  * @}
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* __STM32F3xx_LL_UTILS_H */
 | 
			
		||||
		Reference in New Issue
	
	Block a user