From https://github.com/STMicroelectronics/STM32CubeWB.git tag v1.6.0 Signed-off-by: Damien George <damien@micropython.org>work-f1-1.10.2
@@ -46,12 +46,12 @@ | |||
/** | |||
* @brief Configuration of the Cortex-M4 Processor and Core Peripherals | |||
*/ | |||
#define __CM4_REV 1 /*!< Core Revision r0p1 */ | |||
#define __MPU_PRESENT 1 /*!< M4 provides an MPU */ | |||
#define __VTOR_PRESENT 1 /*!< Vector Table Register supported */ | |||
#define __NVIC_PRIO_BITS 4 /*!< STM32WBxx uses 4 Bits for the Priority Levels */ | |||
#define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */ | |||
#define __FPU_PRESENT 1 /*!< FPU present */ | |||
#define __CM4_REV 1U /*!< Core Revision r0p1 */ | |||
#define __MPU_PRESENT 1U /*!< M4 provides an MPU */ | |||
#define __VTOR_PRESENT 1U /*!< Vector Table Register supported */ | |||
#define __NVIC_PRIO_BITS 4U /*!< STM32WBxx uses 4 Bits for the Priority Levels */ | |||
#define __Vendor_SysTickConfig 0U /*!< Set to 1 if different SysTick Config is used */ | |||
#define __FPU_PRESENT 1U /*!< FPU present */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -302,7 +302,7 @@ typedef struct | |||
typedef struct | |||
{ | |||
__IO uint32_t ACR; /*!< FLASH Access control register, Address offset: 0x00 */ | |||
__IO uint32_t PDKEYR; /*!< FLASH Power-down in run mode flash key Address offset: 0x04 */ | |||
__IO uint32_t RESERVED; /*!< Reserved, Address offset: 0x04 */ | |||
__IO uint32_t KEYR; /*!< FLASH Key register, Address offset: 0x08 */ | |||
__IO uint32_t OPTKEYR; /*!< FLASH Option Key register, Address offset: 0x0C */ | |||
__IO uint32_t SR; /*!< FLASH Status register, Address offset: 0x10 */ | |||
@@ -439,73 +439,72 @@ typedef struct | |||
__IO uint32_t PSMAR; /*!< QUADSPI Polling Status Match register, Address offset: 0x28 */ | |||
__IO uint32_t PIR; /*!< QUADSPI Polling Interval register, Address offset: 0x2C */ | |||
__IO uint32_t LPTR; /*!< QUADSPI Low Power Timeout register, Address offset: 0x30 */ | |||
} QUADSPI_TypeDef; | |||
} QUADSPI_TypeDef; | |||
/** | |||
* @brief Reset and Clock Control | |||
*/ | |||
typedef struct | |||
{ | |||
__IO uint32_t CR; /*!< RCC clock Control Register, Address offset: 0x00 */ | |||
__IO uint32_t ICSCR; /*!< RCC Internal Clock Sources Calibration Register, Address offset: 0x04 */ | |||
__IO uint32_t CFGR; /*!< RCC Clocks Configuration Register, Address offset: 0x08 */ | |||
__IO uint32_t PLLCFGR; /*!< RCC System PLL configuration Register, Address offset: 0x0C */ | |||
__IO uint32_t PLLSAI1CFGR; /*!< RCC PLL SAI1 configuration Register, Address offset: 0x10 */ | |||
uint32_t RESERVED0; /*!< Reserved, Address offset: 0x14 */ | |||
__IO uint32_t CIER; /*!< RCC Clock Interrupt Enable Register, Address offset: 0x18 */ | |||
__IO uint32_t CIFR; /*!< RCC Clock Interrupt Flag Register, Address offset: 0x1C */ | |||
__IO uint32_t CICR; /*!< RCC Clock Interrupt Clear Register, Address offset: 0x20 */ | |||
__IO uint32_t SMPSCR; /*!< RCC Clock Interrupt Clear Register, Address offset: 0x24 */ | |||
__IO uint32_t AHB1RSTR; /*!< RCC AHB1 peripheral reset register, Address offset: 0x28 */ | |||
__IO uint32_t AHB2RSTR; /*!< RCC AHB2 peripheral reset register, Address offset: 0x2C */ | |||
__IO uint32_t AHB3RSTR; /*!< RCC AHB3 & AHB4 peripheral reset register, Address offset: 0x30 */ | |||
uint32_t RESERVED1; /*!< Reserved, Address offset: 0x34 */ | |||
__IO uint32_t APB1RSTR1; /*!< RCC APB1 peripheral reset register 1, Address offset: 0x38 */ | |||
__IO uint32_t APB1RSTR2; /*!< RCC APB1 peripheral reset register 2, Address offset: 0x3C */ | |||
__IO uint32_t APB2RSTR; /*!< RCC APB2 peripheral reset register, Address offset: 0x40 */ | |||
__IO uint32_t APB3RSTR; /*!< RCC APB3 peripheral reset register, Address offset: 0x44 */ | |||
__IO uint32_t AHB1ENR; /*!< RCC AHB1 peripheral clocks enable register, Address offset: 0x48 */ | |||
__IO uint32_t AHB2ENR; /*!< RCC AHB2 peripheral clocks enable register, Address offset: 0x4C */ | |||
__IO uint32_t AHB3ENR; /*!< RCC AHB3 & AHB4 peripheral clocks enable register, Address offset: 0x50 */ | |||
uint32_t RESERVED2; /*!< Reserved, Address offset: 0x54 */ | |||
__IO uint32_t APB1ENR1; /*!< RCC APB1 peripheral clocks enable register 1, Address offset: 0x58 */ | |||
__IO uint32_t APB1ENR2; /*!< RCC APB1 peripheral clocks enable register 2, Address offset: 0x5C */ | |||
__IO uint32_t APB2ENR; /*!< RCC APB2 peripheral clocks enable register, Address offset: 0x60 */ | |||
uint32_t RESERVED3; /*!< Reserved, Address offset: 0x64 */ | |||
__IO uint32_t AHB1SMENR; /*!< RCC AHB1 peripheral clocks enable in sleep and stop modes register, Address offset: 0x68 */ | |||
__IO uint32_t AHB2SMENR; /*!< RCC AHB2 peripheral clocks enable in sleep and stop modes register, Address offset: 0x6C */ | |||
__IO uint32_t AHB3SMENR; /*!< RCC AHB3 & AHB4 peripheral clocks enable in sleep and stop modes register, Address offset: 0x70 */ | |||
uint32_t RESERVED4; /*!< Reserved, Address offset: 0x74 */ | |||
__IO uint32_t APB1SMENR1; /*!< RCC APB1 peripheral clocks enable in sleep mode and stop modes register 1, Address offset: 0x78 */ | |||
__IO uint32_t APB1SMENR2; /*!< RCC APB1 peripheral clocks enable in sleep mode and stop modes register 2, Address offset: 0x7C */ | |||
__IO uint32_t APB2SMENR; /*!< RCC APB2 peripheral clocks enable in sleep mode and stop modes register, Address offset: 0x80 */ | |||
uint32_t RESERVED5; /*!< Reserved, Address offset: 0x84 */ | |||
__IO uint32_t CCIPR; /*!< RCC Peripherals Clock Configuration Independent Register, Address offset: 0x88 */ | |||
uint32_t RESERVED6; /*!< Reserved, Address offset: 0x8C */ | |||
__IO uint32_t BDCR; /*!< RCC Backup Domain Control Register, Address offset: 0x90 */ | |||
__IO uint32_t CSR; /*!< RCC Control and Status Register, Address offset: 0x94 */ | |||
__IO uint32_t CRRCR; /*!< RCC Clock Recovery RC Register, Address offset: 0x98 */ | |||
__IO uint32_t HSECR; /*!< RCC HSE Clock Register, Address offset: 0x9C */ | |||
uint32_t RESERVED7[26]; /*!< Reserved, Address offset: 0xA0-0x104 */ | |||
__IO uint32_t EXTCFGR; /*!< RCC Extended Clock Recovery Register, Address offset: 0x108 */ | |||
__IO uint32_t RESERVED8[15]; /*!< Reserved, Address offset: 0x10C-0x144 */ | |||
__IO uint32_t C2AHB1ENR; /*!< RRCC AHB1 peripheral CPU2 clocks enable register, Address offset: 0x148 */ | |||
__IO uint32_t C2AHB2ENR; /*!< RCC AHB2 peripheral CPU2 clocks enable register, Address offset: 0x14C */ | |||
__IO uint32_t C2AHB3ENR; /*!< RCC AHB3 & AHB4 peripheral CPU2 clocks enable register,, Address offset: 0x150 */ | |||
uint32_t RESERVED9; /*!< Reserved, Address offset: 0x154 */ | |||
__IO uint32_t C2APB1ENR1; /*!< RCC APB1 peripheral CPU2 clocks enable register 1, Address offset: 0x158 */ | |||
__IO uint32_t C2APB1ENR2; /*!< RCC APB1 peripheral CPU2 clocks enable register 2, Address offset: 0x15C */ | |||
__IO uint32_t C2APB2ENR; /*!< RCC APB2 peripheral CPU2 clocks enable register 1, Address offset: 0x160 */ | |||
__IO uint32_t C2APB3ENR; /*!< RCC APB3 peripheral CPU2 clocks enable register 1, Address offset: 0x164 */ | |||
__IO uint32_t C2AHB1SMENR; /*!< RCC AHB1 peripheral CPU2 clocks enable in sleep and stop modes register, Address offset: 0x168 */ | |||
__IO uint32_t C2AHB2SMENR; /*!< RCC AHB2 peripheral CPU2 clocks enable in sleep and stop modes register, Address offset: 0x16C */ | |||
__IO uint32_t C2AHB3SMENR; /*!< RCC AHB3 & AHB4 peripheral CPU2 clocks enable in sleep and stop modes register, Address offset: 0x170 */ | |||
uint32_t RESERVED10; /*!< Reserved, */ | |||
__IO uint32_t C2APB1SMENR1;/*!< RCC APB1 peripheral CPU2 clocks enable in sleep mode and stop modes register 1, Address offset: 0x178 */ | |||
__IO uint32_t C2APB1SMENR2;/*!< RCC APB1 peripheral CPU2 clocks enable in sleep mode and stop modes register 2, Address offset: 0x17C */ | |||
__IO uint32_t C2APB2SMENR; /*!< RCC APB2 peripheral CPU2 clocks enable in sleep mode and stop modes register, Address offset: 0x180 */ | |||
__IO uint32_t C2APB3SMENR; /*!< RCC APB3 peripheral CPU2 clocks enable in sleep mode and stop modes register, Address offset: 0x184 */ | |||
__IO uint32_t CR; /*!< RCC clock Control Register, Address offset: 0x00 */ | |||
__IO uint32_t ICSCR; /*!< RCC Internal Clock Sources Calibration Register, Address offset: 0x04 */ | |||
__IO uint32_t CFGR; /*!< RCC Clocks Configuration Register, Address offset: 0x08 */ | |||
__IO uint32_t PLLCFGR; /*!< RCC System PLL configuration Register, Address offset: 0x0C */ | |||
__IO uint32_t PLLSAI1CFGR; /*!< RCC PLL SAI1 configuration Register, Address offset: 0x10 */ | |||
uint32_t RESERVED0; /*!< Reserved, Address offset: 0x14 */ | |||
__IO uint32_t CIER; /*!< RCC Clock Interrupt Enable Register, Address offset: 0x18 */ | |||
__IO uint32_t CIFR; /*!< RCC Clock Interrupt Flag Register, Address offset: 0x1C */ | |||
__IO uint32_t CICR; /*!< RCC Clock Interrupt Clear Register, Address offset: 0x20 */ | |||
__IO uint32_t SMPSCR; /*!< RCC SMPS step-down converter control register, Address offset: 0x24 */ | |||
__IO uint32_t AHB1RSTR; /*!< RCC AHB1 peripheral reset register, Address offset: 0x28 */ | |||
__IO uint32_t AHB2RSTR; /*!< RCC AHB2 peripheral reset register, Address offset: 0x2C */ | |||
__IO uint32_t AHB3RSTR; /*!< RCC AHB3 & AHB4 peripheral reset register, Address offset: 0x30 */ | |||
uint32_t RESERVED1; /*!< Reserved, Address offset: 0x34 */ | |||
__IO uint32_t APB1RSTR1; /*!< RCC APB1 peripheral reset register 1, Address offset: 0x38 */ | |||
__IO uint32_t APB1RSTR2; /*!< RCC APB1 peripheral reset register 2, Address offset: 0x3C */ | |||
__IO uint32_t APB2RSTR; /*!< RCC APB2 peripheral reset register, Address offset: 0x40 */ | |||
__IO uint32_t APB3RSTR; /*!< RCC APB3 peripheral reset register, Address offset: 0x44 */ | |||
__IO uint32_t AHB1ENR; /*!< RCC AHB1 peripheral clocks enable register, Address offset: 0x48 */ | |||
__IO uint32_t AHB2ENR; /*!< RCC AHB2 peripheral clocks enable register, Address offset: 0x4C */ | |||
__IO uint32_t AHB3ENR; /*!< RCC AHB3 & AHB4 peripheral clocks enable register, Address offset: 0x50 */ | |||
uint32_t RESERVED2; /*!< Reserved, Address offset: 0x54 */ | |||
__IO uint32_t APB1ENR1; /*!< RCC APB1 peripheral clocks enable register 1, Address offset: 0x58 */ | |||
__IO uint32_t APB1ENR2; /*!< RCC APB1 peripheral clocks enable register 2, Address offset: 0x5C */ | |||
__IO uint32_t APB2ENR; /*!< RCC APB2 peripheral clocks enable register, Address offset: 0x60 */ | |||
uint32_t RESERVED3; /*!< Reserved, Address offset: 0x64 */ | |||
__IO uint32_t AHB1SMENR; /*!< RCC AHB1 peripheral clocks enable in sleep and stop modes register, Address offset: 0x68 */ | |||
__IO uint32_t AHB2SMENR; /*!< RCC AHB2 peripheral clocks enable in sleep and stop modes register, Address offset: 0x6C */ | |||
__IO uint32_t AHB3SMENR; /*!< RCC AHB3 & AHB4 peripheral clocks enable in sleep and stop modes register, Address offset: 0x70 */ | |||
uint32_t RESERVED4; /*!< Reserved, Address offset: 0x74 */ | |||
__IO uint32_t APB1SMENR1; /*!< RCC APB1 peripheral clocks enable in sleep mode and stop modes register 1, Address offset: 0x78 */ | |||
__IO uint32_t APB1SMENR2; /*!< RCC APB1 peripheral clocks enable in sleep mode and stop modes register 2, Address offset: 0x7C */ | |||
__IO uint32_t APB2SMENR; /*!< RCC APB2 peripheral clocks enable in sleep mode and stop modes register, Address offset: 0x80 */ | |||
uint32_t RESERVED5; /*!< Reserved, Address offset: 0x84 */ | |||
__IO uint32_t CCIPR; /*!< RCC Peripherals Clock Configuration Independent Register, Address offset: 0x88 */ | |||
uint32_t RESERVED6; /*!< Reserved, Address offset: 0x8C */ | |||
__IO uint32_t BDCR; /*!< RCC Backup Domain Control Register, Address offset: 0x90 */ | |||
__IO uint32_t CSR; /*!< RCC Control and Status Register, Address offset: 0x94 */ | |||
__IO uint32_t CRRCR; /*!< RCC Clock Recovery RC Register, Address offset: 0x98 */ | |||
__IO uint32_t HSECR; /*!< RCC HSE Clock Register, Address offset: 0x9C */ | |||
uint32_t RESERVED7[26]; /*!< Reserved, Address offset: 0xA0-0x104 */ | |||
__IO uint32_t EXTCFGR; /*!< RCC Extended Clock Recovery Register, Address offset: 0x108 */ | |||
uint32_t RESERVED8[15]; /*!< Reserved, Address offset: 0x10C-0x144 */ | |||
__IO uint32_t C2AHB1ENR; /*!< RRCC AHB1 peripheral CPU2 clocks enable register, Address offset: 0x148 */ | |||
__IO uint32_t C2AHB2ENR; /*!< RCC AHB2 peripheral CPU2 clocks enable register, Address offset: 0x14C */ | |||
__IO uint32_t C2AHB3ENR; /*!< RCC AHB3 & AHB4 peripheral CPU2 clocks enable register,, Address offset: 0x150 */ | |||
uint32_t RESERVED9; /*!< Reserved, Address offset: 0x154 */ | |||
__IO uint32_t C2APB1ENR1; /*!< RCC APB1 peripheral CPU2 clocks enable register 1, Address offset: 0x158 */ | |||
__IO uint32_t C2APB1ENR2; /*!< RCC APB1 peripheral CPU2 clocks enable register 2, Address offset: 0x15C */ | |||
__IO uint32_t C2APB2ENR; /*!< RCC APB2 peripheral CPU2 clocks enable register 1, Address offset: 0x160 */ | |||
__IO uint32_t C2APB3ENR; /*!< RCC APB3 peripheral CPU2 clocks enable register 1, Address offset: 0x164 */ | |||
__IO uint32_t C2AHB1SMENR; /*!< RCC AHB1 peripheral CPU2 clocks enable in sleep and stop modes register, Address offset: 0x168 */ | |||
__IO uint32_t C2AHB2SMENR; /*!< RCC AHB2 peripheral CPU2 clocks enable in sleep and stop modes register, Address offset: 0x16C */ | |||
__IO uint32_t C2AHB3SMENR; /*!< RCC AHB3 & AHB4 peripheral CPU2 clocks enable in sleep and stop modes register, Address offset: 0x170 */ | |||
uint32_t RESERVED10; /*!< Reserved, */ | |||
__IO uint32_t C2APB1SMENR1; /*!< RCC APB1 peripheral CPU2 clocks enable in sleep mode and stop modes register 1, Address offset: 0x178 */ | |||
__IO uint32_t C2APB1SMENR2; /*!< RCC APB1 peripheral CPU2 clocks enable in sleep mode and stop modes register 2, Address offset: 0x17C */ | |||
__IO uint32_t C2APB2SMENR; /*!< RCC APB2 peripheral CPU2 clocks enable in sleep mode and stop modes register, Address offset: 0x180 */ | |||
__IO uint32_t C2APB3SMENR; /*!< RCC APB3 peripheral CPU2 clocks enable in sleep mode and stop modes register, Address offset: 0x184 */ | |||
} RCC_TypeDef; | |||
@@ -710,7 +709,6 @@ typedef struct | |||
__IO uint32_t DR; /*!< RNG data register, Address offset: 0x08 */ | |||
} RNG_TypeDef; | |||
/** | |||
* @brief Touch Sensing Controller (TSC) | |||
*/ | |||
@@ -732,7 +730,6 @@ typedef struct | |||
__IO uint32_t IOGXCR[7]; /*!< TSC I/O group x counter register, Address offset: 0x34-4C */ | |||
} TSC_TypeDef; | |||
/** | |||
* @brief LCD | |||
*/ | |||
@@ -794,7 +791,6 @@ typedef struct | |||
__IO uint32_t ICR; /*!< CRS interrupt flag clear register, Address offset: 0x0C */ | |||
} CRS_TypeDef; | |||
/** | |||
* @brief Inter-Processor Communication | |||
*/ | |||
@@ -936,7 +932,8 @@ typedef struct | |||
#define SRAM2A_BASE (SRAM_BASE + 0x00030000UL)/*!< SRAM2A(32 KB) base address */ | |||
#define SRAM2B_BASE (SRAM_BASE + 0x00038000UL)/*!< SRAM2B(32 KB) base address */ | |||
/* Size SRAMx */ | |||
/* Memory Size */ | |||
#define FLASH_SIZE (((uint32_t)(*((uint16_t *)FLASHSIZE_BASE)) & (0x07FFUL)) << 10U) | |||
#define SRAM1_SIZE 0x00030000UL /*!< SRAM1 default size : 192 kB */ | |||
#define SRAM2A_SIZE 0x00008000UL /*!< SRAM2a default size : 32 kB */ | |||
#define SRAM2B_SIZE 0x00008000UL /*!< SRAM2b default size : 32 kB */ | |||
@@ -3029,6 +3026,9 @@ typedef struct | |||
#define EXTI_RTSR1_RT16_Pos (16U) | |||
#define EXTI_RTSR1_RT16_Msk (0x1UL << EXTI_RTSR1_RT16_Pos) /*!< 0x00010000 */ | |||
#define EXTI_RTSR1_RT16 EXTI_RTSR1_RT16_Msk /*!< Rising trigger event configuration bit of line 16 */ | |||
#define EXTI_RTSR1_RT17_Pos (17U) | |||
#define EXTI_RTSR1_RT17_Msk (0x1UL << EXTI_RTSR1_RT17_Pos) /*!< 0x00020000 */ | |||
#define EXTI_RTSR1_RT17 EXTI_RTSR1_RT17_Msk /*!< Rising trigger event configuration bit of line 17 */ | |||
#define EXTI_RTSR1_RT18_Pos (18U) | |||
#define EXTI_RTSR1_RT18_Msk (0x1UL << EXTI_RTSR1_RT18_Pos) /*!< 0x00040000 */ | |||
#define EXTI_RTSR1_RT18 EXTI_RTSR1_RT18_Msk /*!< Rising trigger event configuration bit of line 18 */ | |||
@@ -3297,8 +3297,8 @@ typedef struct | |||
/****************** Bit definition for EXTI_SWIER2 register *****************/ | |||
#define EXTI_SWIER2_SWI_Pos (0U) | |||
#define EXTI_SWIER2_SWI_Msk (0x302UL << EXTI_SWIER2_SWI_Pos) /*!< 0x00000302 */ | |||
#define EXTI_SWIER2_SWI EXTI_SWIER2_SWIER_Msk /*!< Falling trigger event configuration bit */ | |||
#define EXTI_SWIER2_SWI_Msk (0x302UL << EXTI_SWIER2_SWI_Pos) /*!< 0x00000302 */ | |||
#define EXTI_SWIER2_SWI EXTI_SWIER2_SWI_Msk /*!< Falling trigger event configuration bit */ | |||
#define EXTI_SWIER2_SWI33_Pos (1U) | |||
#define EXTI_SWIER2_SWI33_Msk (0x1UL << EXTI_SWIER2_SWI33_Pos) /*!< 0x00000002 */ | |||
#define EXTI_SWIER2_SWI33 EXTI_SWIER2_SWI33_Msk /*!< Software Interrupt on line 33 */ | |||
@@ -3405,12 +3405,6 @@ typedef struct | |||
#define EXTI_IMR1_IM25_Pos (25U) | |||
#define EXTI_IMR1_IM25_Msk (0x1UL << EXTI_IMR1_IM25_Pos) /*!< 0x02000000 */ | |||
#define EXTI_IMR1_IM25 EXTI_IMR1_IM25_Msk /*!< CPU1 Interrupt Mask on line 25 */ | |||
#define EXTI_IMR1_IM26_Pos (26U) | |||
#define EXTI_IMR1_IM26_Msk (0x1UL << EXTI_IMR1_IM26_Pos) /*!< 0x04000000 */ | |||
#define EXTI_IMR1_IM26 EXTI_IMR1_IM26_Msk /*!< CPU1 Interrupt Mask on line 26 */ | |||
#define EXTI_IMR1_IM27_Pos (27U) | |||
#define EXTI_IMR1_IM27_Msk (0x1UL << EXTI_IMR1_IM27_Pos) /*!< 0x08000000 */ | |||
#define EXTI_IMR1_IM27 EXTI_IMR1_IM27_Msk /*!< CPU1 Interrupt Mask on line 27 */ | |||
#define EXTI_IMR1_IM28_Pos (28U) | |||
#define EXTI_IMR1_IM28_Msk (0x1UL << EXTI_IMR1_IM28_Pos) /*!< 0x10000000 */ | |||
#define EXTI_IMR1_IM28 EXTI_IMR1_IM28_Msk /*!< CPU1 Interrupt Mask on line 28 */ | |||
@@ -3496,18 +3490,9 @@ typedef struct | |||
#define EXTI_IMR2_Pos (0U) | |||
#define EXTI_IMR2_Msk (0x0001FFFFUL << EXTI_IMR2_Pos) /*!< 0x0001FFFF */ | |||
#define EXTI_IMR2_IM EXTI_IMR2_Msk /*!< CPU1 Interrupt Mask */ | |||
#define EXTI_IMR2_IM32_Pos (0U) | |||
#define EXTI_IMR2_IM32_Msk (0x1UL << EXTI_IMR2_IM32_Pos) /*!< 0x00000001 */ | |||
#define EXTI_IMR2_IM32 EXTI_IMR2_IM32_Msk /*!< CPU1 Interrupt Mask on line 32 */ | |||
#define EXTI_IMR2_IM33_Pos (1U) | |||
#define EXTI_IMR2_IM33_Msk (0x1UL << EXTI_IMR2_IM33_Pos) /*!< 0x00000002 */ | |||
#define EXTI_IMR2_IM33 EXTI_IMR2_IM33_Msk /*!< CPU1 Interrupt Mask on line 33 */ | |||
#define EXTI_IMR2_IM34_Pos (2U) | |||
#define EXTI_IMR2_IM34_Msk (0x1UL << EXTI_IMR2_IM34_Pos) /*!< 0x00000004 */ | |||
#define EXTI_IMR2_IM34 EXTI_IMR2_IM34_Msk /*!< CPU1 Interrupt Mask on line 34 */ | |||
#define EXTI_IMR2_IM35_Pos (3U) | |||
#define EXTI_IMR2_IM35_Msk (0x1UL << EXTI_IMR2_IM35_Pos) /*!< 0x00000008 */ | |||
#define EXTI_IMR2_IM35 EXTI_IMR2_IM35_Msk /*!< CPU1 Interrupt Mask on line 35 */ | |||
#define EXTI_IMR2_IM36_Pos (4U) | |||
#define EXTI_IMR2_IM36_Msk (0x1UL << EXTI_IMR2_IM36_Pos) /*!< 0x00000010 */ | |||
#define EXTI_IMR2_IM36 EXTI_IMR2_IM36_Msk /*!< CPU1 Interrupt Mask on line 36 */ | |||
@@ -3541,9 +3526,6 @@ typedef struct | |||
#define EXTI_IMR2_IM46_Pos (14U) | |||
#define EXTI_IMR2_IM46_Msk (0x1UL << EXTI_IMR2_IM46_Pos) /*!< 0x00004000 */ | |||
#define EXTI_IMR2_IM46 EXTI_IMR2_IM46_Msk /*!< CPU1 Interrupt Mask on line 46 */ | |||
#define EXTI_IMR2_IM47_Pos (15U) | |||
#define EXTI_IMR2_IM47_Msk (0x1UL << EXTI_IMR2_IM47_Pos) /*!< 0x00008000 */ | |||
#define EXTI_IMR2_IM47 EXTI_IMR2_IM47_Msk /*!< CPU1 Interrupt Mask on line 47 */ | |||
#define EXTI_IMR2_IM48_Pos (16U) | |||
#define EXTI_IMR2_IM48_Msk (0x1UL << EXTI_IMR2_IM48_Pos) /*!< 0x00010000 */ | |||
#define EXTI_IMR2_IM48 EXTI_IMR2_IM48_Msk /*!< CPU1 Interrupt Mask on line 48 */ | |||
@@ -3641,12 +3623,6 @@ typedef struct | |||
#define EXTI_C2IMR1_IM25_Pos (25U) | |||
#define EXTI_C2IMR1_IM25_Msk (0x1UL << EXTI_C2IMR1_IM25_Pos) /*!< 0x02000000 */ | |||
#define EXTI_C2IMR1_IM25 EXTI_C2IMR1_IM25_Msk /*!< CPU2 Interrupt Mask on line 25 */ | |||
#define EXTI_C2IMR1_IM26_Pos (26U) | |||
#define EXTI_C2IMR1_IM26_Msk (0x1UL << EXTI_C2IMR1_IM26_Pos) /*!< 0x04000000 */ | |||
#define EXTI_C2IMR1_IM26 EXTI_C2IMR1_IM26_Msk /*!< CPU2 Interrupt Mask on line 26 */ | |||
#define EXTI_C2IMR1_IM27_Pos (27U) | |||
#define EXTI_C2IMR1_IM27_Msk (0x1UL << EXTI_C2IMR1_IM27_Pos) /*!< 0x08000000 */ | |||
#define EXTI_C2IMR1_IM27 EXTI_C2IMR1_IM27_Msk /*!< CPU2 Interrupt Mask on line 27 */ | |||
#define EXTI_C2IMR1_IM28_Pos (28U) | |||
#define EXTI_C2IMR1_IM28_Msk (0x1UL << EXTI_C2IMR1_IM28_Pos) /*!< 0x10000000 */ | |||
#define EXTI_C2IMR1_IM28 EXTI_C2IMR1_IM28_Msk /*!< CPU2 Interrupt Mask on line 28 */ | |||
@@ -3659,7 +3635,6 @@ typedef struct | |||
#define EXTI_C2IMR1_IM31_Pos (31U) | |||
#define EXTI_C2IMR1_IM31_Msk (0x1UL << EXTI_C2IMR1_IM31_Pos) /*!< 0x80000000 */ | |||
#define EXTI_C2IMR1_IM31 EXTI_C2IMR1_IM31_Msk /*!< CPU2 Interrupt Mask on line 31 */ | |||
/******************** Bits definition for EXTI_C2EMR1 register **************/ | |||
#define EXTI_C2EMR1_Pos (0U) | |||
#define EXTI_C2EMR1_Msk (0x003EFFFFUL << EXTI_C2EMR1_Pos) /*!< 0xFFFFFFFF */ | |||
@@ -3732,18 +3707,9 @@ typedef struct | |||
#define EXTI_C2IMR2_Pos (0U) | |||
#define EXTI_C2IMR2_Msk (0x0001FFFFUL << EXTI_C2IMR2_Pos) /*!< 0x0001FFFF */ | |||
#define EXTI_C2IMR2_IM EXTI_C2IMR2_Msk /*!< CPU2 Interrupt Mask */ | |||
#define EXTI_C2IMR2_IM32_Pos (0U) | |||
#define EXTI_C2IMR2_IM32_Msk (0x1UL << EXTI_C2IMR2_IM32_Pos) /*!< 0x00000001 */ | |||
#define EXTI_C2IMR2_IM32 EXTI_C2IMR2_IM32_Msk /*!< CPU2 Interrupt Mask on line 32 */ | |||
#define EXTI_C2IMR2_IM33_Pos (1U) | |||
#define EXTI_C2IMR2_IM33_Msk (0x1UL << EXTI_C2IMR2_IM33_Pos) /*!< 0x00000002 */ | |||
#define EXTI_C2IMR2_IM33 EXTI_C2IMR2_IM33_Msk /*!< CPU2 Interrupt Mask on line 33 */ | |||
#define EXTI_C2IMR2_IM34_Pos (2U) | |||
#define EXTI_C2IMR2_IM34_Msk (0x1UL << EXTI_C2IMR2_IM34_Pos) /*!< 0x00000004 */ | |||
#define EXTI_C2IMR2_IM34 EXTI_C2IMR2_IM34_Msk /*!< CPU2 Interrupt Mask on line 34 */ | |||
#define EXTI_C2IMR2_IM35_Pos (3U) | |||
#define EXTI_C2IMR2_IM35_Msk (0x1UL << EXTI_C2IMR2_IM35_Pos) /*!< 0x00000008 */ | |||
#define EXTI_C2IMR2_IM35 EXTI_C2IMR2_IM35_Msk /*!< CPU2 Interrupt Mask on line 35 */ | |||
#define EXTI_C2IMR2_IM36_Pos (4U) | |||
#define EXTI_C2IMR2_IM36_Msk (0x1UL << EXTI_C2IMR2_IM36_Pos) /*!< 0x00000010 */ | |||
#define EXTI_C2IMR2_IM36 EXTI_C2IMR2_IM36_Msk /*!< CPU2 Interrupt Mask on line 36 */ | |||
@@ -3777,9 +3743,6 @@ typedef struct | |||
#define EXTI_C2IMR2_IM46_Pos (14U) | |||
#define EXTI_C2IMR2_IM46_Msk (0x1UL << EXTI_C2IMR2_IM46_Pos) /*!< 0x00004000 */ | |||
#define EXTI_C2IMR2_IM46 EXTI_C2IMR2_IM46_Msk /*!< CPU2 Interrupt Mask on line 46 */ | |||
#define EXTI_C2IMR2_IM47_Pos (15U) | |||
#define EXTI_C2IMR2_IM47_Msk (0x1UL << EXTI_C2IMR2_IM47_Pos) /*!< 0x00008000 */ | |||
#define EXTI_C2IMR2_IM47 EXTI_C2IMR2_IM47_Msk /*!< CPU2 Interrupt Mask on line 47 */ | |||
#define EXTI_C2IMR2_IM48_Pos (16U) | |||
#define EXTI_C2IMR2_IM48_Msk (0x1UL << EXTI_C2IMR2_IM48_Pos) /*!< 0x00010000 */ | |||
#define EXTI_C2IMR2_IM48 EXTI_C2IMR2_IM48_Msk /*!< CPU2 Interrupt Mask on line 48 */ | |||
@@ -3790,10 +3753,10 @@ typedef struct | |||
#define EXTI_C2EMR2_EM EXTI_C2EMR2_Msk /*!< CPU2 Interrupt Mask */ | |||
#define EXTI_C2EMR2_EM40_Pos (8U) | |||
#define EXTI_C2EMR2_EM40_Msk (0x1UL << EXTI_C2EMR2_EM40_Pos) /*!< 0x00000100 */ | |||
#define EXTI_C2EMR2_EM40 EXTI_C2EMR1_EM40_Msk /*!< CPU2 Event Mask on line 40 */ | |||
#define EXTI_C2EMR2_EM40 EXTI_C2EMR2_EM40_Msk /*!< CPU2 Event Mask on line 40 */ | |||
#define EXTI_C2EMR2_EM41_Pos (9U) | |||
#define EXTI_C2EMR2_EM41_Msk (0x1UL << EXTI_C2EMR1_EM41_Pos) /*!< 0x00000200 */ | |||
#define EXTI_C2EMR2_EM41 EXTI_C2EMR1_EM41_Msk /*!< CPU2 Event Mask on line 41 */ | |||
#define EXTI_C2EMR2_EM41_Msk (0x1UL << EXTI_C2EMR2_EM41_Pos) /*!< 0x00000200 */ | |||
#define EXTI_C2EMR2_EM41 EXTI_C2EMR2_EM41_Msk /*!< CPU2 Event Mask on line 41 */ | |||
/******************************************************************************/ | |||
/* */ | |||
@@ -4164,7 +4127,7 @@ typedef struct | |||
#define FLASH_CR_RDERRIE FLASH_CR_RDERRIE_Msk /*!< PCROP read error interrupt enable */ | |||
#define FLASH_CR_OBL_LAUNCH_Pos (27U) | |||
#define FLASH_CR_OBL_LAUNCH_Msk (0x1UL << FLASH_CR_OBL_LAUNCH_Pos) /*!< 0x08000000 */ | |||
#define FLASH_CR_OBL_LAUNCH FLASH_CR_OBL_LAUNCH_Msk /*!< Force the option bute loading */ | |||
#define FLASH_CR_OBL_LAUNCH FLASH_CR_OBL_LAUNCH_Msk /*!< Force the option byte loading */ | |||
#define FLASH_CR_OPTLOCK_Pos (30U) | |||
#define FLASH_CR_OPTLOCK_Msk (0x1UL << FLASH_CR_OPTLOCK_Pos) /*!< 0x40000000 */ | |||
#define FLASH_CR_OPTLOCK FLASH_CR_OPTLOCK_Msk /*!< Options lock */ | |||
@@ -6491,7 +6454,7 @@ typedef struct | |||
#define PWR_SR2_PVDO PWR_SR2_PVDO_Msk /*!< Power voltage detector output */ | |||
#define PWR_SR2_PVMO_Pos (12U) | |||
#define PWR_SR2_PVMO_Msk (0x5UL << PWR_SR2_PVMO_Pos) /*!< 0x0000F000 */ | |||
#define PWR_SR2_PVMO_Msk (0x5UL << PWR_SR2_PVMO_Pos) /*!< 0x00005000 */ | |||
#define PWR_SR2_PVMO PWR_SR2_PVMO_Msk /*!< Peripheral voltage monitor output for all power domains */ | |||
#define PWR_SR2_PVMO1_Pos (12U) | |||
#define PWR_SR2_PVMO1_Msk (0x1UL << PWR_SR2_PVMO1_Pos) /*!< 0x00001000 */ | |||
@@ -6502,7 +6465,7 @@ typedef struct | |||
/******************** Bit definition for PWR_SCR register ********************/ | |||
#define PWR_SCR_CWUF_Pos (0U) | |||
#define PWR_SCR_CWUF_Msk (0x1FUL << PWR_SCR_CWUF_Pos) /*!< 0x000000FF */ | |||
#define PWR_SCR_CWUF_Msk (0x1FUL << PWR_SCR_CWUF_Pos) /*!< 0x0000001F */ | |||
#define PWR_SCR_CWUF PWR_SCR_CWUF_Msk /*!< Clear Wake-up Flags for all pins */ | |||
#define PWR_SCR_CWUF1_Pos (0U) | |||
#define PWR_SCR_CWUF1_Msk (0x1UL << PWR_SCR_CWUF1_Pos) /*!< 0x00000001 */ | |||
@@ -6573,7 +6536,6 @@ typedef struct | |||
#define PWR_CR5_SMPSEN_Msk (0x1UL << PWR_CR5_SMPSEN_Pos) /*!< 0x00008000 */ | |||
#define PWR_CR5_SMPSEN PWR_CR5_SMPSEN_Msk /*!< Enable SMPS Step Down converter SMPS mode enable */ | |||
/******************** Bit definition for PWR_PUCRA register *****************/ | |||
#define PWR_PUCRA_PA0_Pos (0U) | |||
#define PWR_PUCRA_PA0_Msk (0x1UL << PWR_PUCRA_PA0_Pos) /*!< 0x00000001 */ | |||
@@ -7071,7 +7033,6 @@ typedef struct | |||
#define PWR_C2CR3_EIWUL_Msk (0x1UL << PWR_C2CR3_EIWUL_Pos) /*!< 0x00008000 */ | |||
#define PWR_C2CR3_EIWUL PWR_C2CR3_EIWUL_Msk /*!< Internal Wake-Up line interrupt for CPU2 */ | |||
/******************** Bit definition for PWR_EXTSCR register ********************/ | |||
#define PWR_EXTSCR_C1CSSF_Pos (0U) | |||
#define PWR_EXTSCR_C1CSSF_Msk (0x1UL << PWR_EXTSCR_C1CSSF_Pos) /*!< 0x00000001 */ | |||
@@ -7296,12 +7257,17 @@ typedef struct | |||
#define QUADSPI_LPTR_TIMEOUT_Msk (0xFFFFUL << QUADSPI_LPTR_TIMEOUT_Pos) /*!< 0x0000FFFF */ | |||
#define QUADSPI_LPTR_TIMEOUT QUADSPI_LPTR_TIMEOUT_Msk /*!< TIMEOUT[15:0]: Timeout period */ | |||
/******************************************************************************/ | |||
/* */ | |||
/* Reset and Clock Control */ | |||
/* */ | |||
/******************************************************************************/ | |||
/* | |||
* @brief Specific device feature definitions | |||
*/ | |||
#define RCC_SMPS_SUPPORT | |||
#define RCC_MCO3_SUPPORT | |||
#define RCC_LSCO3_SUPPORT | |||
/******************** Bit definition for RCC_CR register *****************/ | |||
#define RCC_CR_MSION_Pos (0U) | |||
@@ -7369,6 +7335,7 @@ typedef struct | |||
#define RCC_CR_PLLRDY_Pos (25U) | |||
#define RCC_CR_PLLRDY_Msk (0x1UL << RCC_CR_PLLRDY_Pos) /*!< 0x02000000 */ | |||
#define RCC_CR_PLLRDY RCC_CR_PLLRDY_Msk /*!< System PLL clock ready */ | |||
#define RCC_CR_PLLSAI1ON_Pos (26U) | |||
#define RCC_CR_PLLSAI1ON_Msk (0x1UL << RCC_CR_PLLSAI1ON_Pos) /*!< 0x04000000 */ | |||
#define RCC_CR_PLLSAI1ON RCC_CR_PLLSAI1ON_Msk /*!< SAI1 PLL enable */ | |||
@@ -7844,9 +7811,9 @@ typedef struct | |||
#define RCC_APB2RSTR_TIM17RST_Pos (18U) | |||
#define RCC_APB2RSTR_TIM17RST_Msk (0x1UL << RCC_APB2RSTR_TIM17RST_Pos) /*!< 0x00040000 */ | |||
#define RCC_APB2RSTR_TIM17RST RCC_APB2RSTR_TIM17RST_Msk | |||
#define RCC_APB2RSTR_SAI1RST_Pos (21U) | |||
#define RCC_APB2RSTR_SAI1RST_Msk (0x1UL << RCC_APB2RSTR_SAI1RST_Pos) /*!< 0x00200000 */ | |||
#define RCC_APB2RSTR_SAI1RST RCC_APB2RSTR_SAI1RST_Msk | |||
#define RCC_APB2RSTR_SAI1RST_Pos (21U) | |||
#define RCC_APB2RSTR_SAI1RST_Msk (0x1UL << RCC_APB2RSTR_SAI1RST_Pos) /*!< 0x00200000 */ | |||
#define RCC_APB2RSTR_SAI1RST RCC_APB2RSTR_SAI1RST_Msk | |||
/******************** Bit definition for RCC_APB3RSTR register **************/ | |||
#define RCC_APB3RSTR_RFRST_Pos (0U) | |||
@@ -7975,10 +7942,9 @@ typedef struct | |||
#define RCC_APB2ENR_TIM17EN_Pos (18U) | |||
#define RCC_APB2ENR_TIM17EN_Msk (0x1UL << RCC_APB2ENR_TIM17EN_Pos) /*!< 0x00040000 */ | |||
#define RCC_APB2ENR_TIM17EN RCC_APB2ENR_TIM17EN_Msk | |||
#define RCC_APB2ENR_SAI1EN_Pos (21U) | |||
#define RCC_APB2ENR_SAI1EN_Msk (0x1UL << RCC_APB2ENR_SAI1EN_Pos) /*!< 0x00200000 */ | |||
#define RCC_APB2ENR_SAI1EN RCC_APB2ENR_SAI1EN_Msk | |||
#define RCC_APB2ENR_SAI1EN_Pos (21U) | |||
#define RCC_APB2ENR_SAI1EN_Msk (0x1UL << RCC_APB2ENR_SAI1EN_Pos) /*!< 0x00200000 */ | |||
#define RCC_APB2ENR_SAI1EN RCC_APB2ENR_SAI1EN_Msk | |||
/******************** Bit definition for RCC_AHB1SMENR register ****************/ | |||
#define RCC_AHB1SMENR_DMA1SMEN_Pos (0U) | |||
@@ -8022,9 +7988,9 @@ typedef struct | |||
#define RCC_AHB2SMENR_ADCSMEN_Pos (13U) | |||
#define RCC_AHB2SMENR_ADCSMEN_Msk (0x1UL << RCC_AHB2SMENR_ADCSMEN_Pos) /*!< 0x00002000 */ | |||
#define RCC_AHB2SMENR_ADCSMEN RCC_AHB2SMENR_ADCSMEN_Msk | |||
#define RCC_AHB2SMENR_AES1SMEN_Pos (16U) | |||
#define RCC_AHB2SMENR_AES1SMEN_Msk (0x1UL << RCC_AHB2SMENR_AES1SMEN_Pos) /*!< 0x00010000 */ | |||
#define RCC_AHB2SMENR_AES1SMEN RCC_AHB2SMENR_AES1SMEN_Msk | |||
#define RCC_AHB2SMENR_AES1SMEN_Pos (16U) | |||
#define RCC_AHB2SMENR_AES1SMEN_Msk (0x1UL << RCC_AHB2SMENR_AES1SMEN_Pos) /*!< 0x00010000 */ | |||
#define RCC_AHB2SMENR_AES1SMEN RCC_AHB2SMENR_AES1SMEN_Msk | |||
/******************** Bit definition for RCC_AHB3SMENR register ***************/ | |||
#define RCC_AHB3SMENR_QUADSPISMEN_Pos (8U) | |||
@@ -8548,7 +8514,7 @@ typedef struct | |||
#define RCC_C2AHB3SMENR_SRAM2SMEN RCC_C2AHB3SMENR_SRAM2SMEN_Msk | |||
#define RCC_C2AHB3SMENR_FLASHSMEN_Pos (25U) | |||
#define RCC_C2AHB3SMENR_FLASHSMEN_Msk (0x1UL << RCC_C2AHB3SMENR_FLASHSMEN_Pos) /*!< 0x02000000 */ | |||
#define RCC_C2AHB3SMENR_FLASHSMEN RCC_C2AHB3SMENR_FLASHSMEN_Msk | |||
#define RCC_C2AHB3SMENR_FLASHSMEN RCC_C2AHB3SMENR_FLASHSMEN_Msk | |||
/******************** Bit definition for RCC_C2APB1SMENR1 register **************/ | |||
#define RCC_C2APB1SMENR1_TIM2SMEN_Pos (0U) | |||
@@ -9375,9 +9341,9 @@ typedef struct | |||
#define SPI_CR1_BR_Pos (3U) | |||
#define SPI_CR1_BR_Msk (0x7UL << SPI_CR1_BR_Pos) /*!< 0x00000038 */ | |||
#define SPI_CR1_BR SPI_CR1_BR_Msk /*!<BR[2:0] bits (Baud Rate Control) */ | |||
#define SPI_CR1_BR_0 (0x1U << SPI_CR1_BR_Pos) /*!< 0x00000008 */ | |||
#define SPI_CR1_BR_1 (0x2U << SPI_CR1_BR_Pos) /*!< 0x00000010 */ | |||
#define SPI_CR1_BR_2 (0x4U << SPI_CR1_BR_Pos) /*!< 0x00000020 */ | |||
#define SPI_CR1_BR_0 (0x1UL << SPI_CR1_BR_Pos) /*!< 0x00000008 */ | |||
#define SPI_CR1_BR_1 (0x2UL << SPI_CR1_BR_Pos) /*!< 0x00000010 */ | |||
#define SPI_CR1_BR_2 (0x4UL << SPI_CR1_BR_Pos) /*!< 0x00000020 */ | |||
#define SPI_CR1_SPE_Pos (6U) | |||
#define SPI_CR1_SPE_Msk (0x1UL << SPI_CR1_SPE_Pos) /*!< 0x00000040 */ | |||
@@ -9438,10 +9404,10 @@ typedef struct | |||
#define SPI_CR2_DS_Pos (8U) | |||
#define SPI_CR2_DS_Msk (0xFUL << SPI_CR2_DS_Pos) /*!< 0x00000F00 */ | |||
#define SPI_CR2_DS SPI_CR2_DS_Msk /*!< DS[3:0] Data Size */ | |||
#define SPI_CR2_DS_0 (0x1U << SPI_CR2_DS_Pos) /*!< 0x00000100 */ | |||
#define SPI_CR2_DS_1 (0x2U << SPI_CR2_DS_Pos) /*!< 0x00000200 */ | |||
#define SPI_CR2_DS_2 (0x4U << SPI_CR2_DS_Pos) /*!< 0x00000400 */ | |||
#define SPI_CR2_DS_3 (0x8U << SPI_CR2_DS_Pos) /*!< 0x00000800 */ | |||
#define SPI_CR2_DS_0 (0x1UL << SPI_CR2_DS_Pos) /*!< 0x00000100 */ | |||
#define SPI_CR2_DS_1 (0x2UL << SPI_CR2_DS_Pos) /*!< 0x00000200 */ | |||
#define SPI_CR2_DS_2 (0x4UL << SPI_CR2_DS_Pos) /*!< 0x00000400 */ | |||
#define SPI_CR2_DS_3 (0x8UL << SPI_CR2_DS_Pos) /*!< 0x00000800 */ | |||
#define SPI_CR2_FRXTH_Pos (12U) | |||
#define SPI_CR2_FRXTH_Msk (0x1UL << SPI_CR2_FRXTH_Pos) /*!< 0x00001000 */ | |||
#define SPI_CR2_FRXTH SPI_CR2_FRXTH_Msk /*!< FIFO reception Threshold */ | |||
@@ -9477,13 +9443,13 @@ typedef struct | |||
#define SPI_SR_FRLVL_Pos (9U) | |||
#define SPI_SR_FRLVL_Msk (0x3UL << SPI_SR_FRLVL_Pos) /*!< 0x00000600 */ | |||
#define SPI_SR_FRLVL SPI_SR_FRLVL_Msk /*!< FIFO Reception Level */ | |||
#define SPI_SR_FRLVL_0 (0x1U << SPI_SR_FRLVL_Pos) /*!< 0x00000200 */ | |||
#define SPI_SR_FRLVL_1 (0x2U << SPI_SR_FRLVL_Pos) /*!< 0x00000400 */ | |||
#define SPI_SR_FRLVL_0 (0x1UL << SPI_SR_FRLVL_Pos) /*!< 0x00000200 */ | |||
#define SPI_SR_FRLVL_1 (0x2UL << SPI_SR_FRLVL_Pos) /*!< 0x00000400 */ | |||
#define SPI_SR_FTLVL_Pos (11U) | |||
#define SPI_SR_FTLVL_Msk (0x3UL << SPI_SR_FTLVL_Pos) /*!< 0x00001800 */ | |||
#define SPI_SR_FTLVL SPI_SR_FTLVL_Msk /*!< FIFO Transmission Level */ | |||
#define SPI_SR_FTLVL_0 (0x1U << SPI_SR_FTLVL_Pos) /*!< 0x00000800 */ | |||
#define SPI_SR_FTLVL_1 (0x2U << SPI_SR_FTLVL_Pos) /*!< 0x00001000 */ | |||
#define SPI_SR_FTLVL_0 (0x1UL << SPI_SR_FTLVL_Pos) /*!< 0x00000800 */ | |||
#define SPI_SR_FTLVL_1 (0x2UL << SPI_SR_FTLVL_Pos) /*!< 0x00001000 */ | |||
/******************** Bit definition for SPI_DR register ********************/ | |||
#define SPI_DR_DR_Pos (0U) | |||
@@ -9992,7 +9958,6 @@ typedef struct | |||
#define TSC_IOGXCR_CNT_Msk (0x3FFFUL << TSC_IOGXCR_CNT_Pos) /*!< 0x00003FFF */ | |||
#define TSC_IOGXCR_CNT TSC_IOGXCR_CNT_Msk /*!< CNT[13:0] bits (Counter value) */ | |||
/******************************************************************************/ | |||
/* */ | |||
/* LCD Controller (LCD) */ | |||
@@ -13352,7 +13317,6 @@ typedef struct | |||
/*********************** UART Instances : Smard card mode *********************/ | |||
#define IS_SMARTCARD_INSTANCE(INSTANCE) ((INSTANCE) == USART1) | |||
/*********************** UART Instances : Driver Enable ***********************/ | |||
#define IS_UART_DRIVER_ENABLE_INSTANCE(INSTANCE) (((INSTANCE) == USART1)|| \ | |||
((INSTANCE) == LPUART1)) | |||
@@ -13363,7 +13327,6 @@ typedef struct | |||
/******************** LPUART Instance *****************************************/ | |||
#define IS_LPUART_INSTANCE(INSTANCE) ((INSTANCE) == LPUART1) | |||
/******************************* ADC Instances ********************************/ | |||
#define IS_ADC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == ADC1) | |||
@@ -13372,7 +13335,6 @@ typedef struct | |||
/******************************* AES Instances ********************************/ | |||
#define IS_AES_ALL_INSTANCE(INSTANCE) (((INSTANCE) == AES1) || ((INSTANCE) == AES2)) | |||
/******************************** COMP Instances ******************************/ | |||
#define IS_COMP_ALL_INSTANCE(INSTANCE) (((INSTANCE) == COMP1) || \ | |||
((INSTANCE) == COMP2)) | |||
@@ -13673,9 +13635,6 @@ typedef struct | |||
((INSTANCE) == TIM16) || \ | |||
((INSTANCE) == TIM17)) | |||
/****************** TIM Instances : supporting synchronization ****************/ | |||
#define IS_TIM_SYNCHRO_INSTANCE(INSTANCE) IS_TIM_MASTER_INSTANCE(INSTANCE) | |||
/****************** TIM Instances : supporting ADC triggering through TRGO2 ***/ | |||
#define IS_TIM_TRGO2_INSTANCE(INSTANCE) ((INSTANCE) == TIM1) | |||
@@ -69,7 +69,7 @@ | |||
* @brief CMSIS Device version number | |||
*/ | |||
#define __STM32WBxx_CMSIS_VERSION_MAIN (0x01U) /*!< [31:24] main version */ | |||
#define __STM32WBxx_CMSIS_VERSION_SUB1 (0x01U) /*!< [23:16] sub1 version */ | |||
#define __STM32WBxx_CMSIS_VERSION_SUB1 (0x04U) /*!< [23:16] sub1 version */ | |||
#define __STM32WBxx_CMSIS_VERSION_SUB2 (0x00U) /*!< [15:8] sub2 version */ | |||
#define __STM32WBxx_CMSIS_VERSION_RC (0x00U) /*!< [7:0] release candidate */ | |||
#define __STM32WBxx_CMSIS_DEVICE_VERSION ((__STM32WBxx_CMSIS_VERSION_MAIN << 24)\ | |||
@@ -87,10 +87,17 @@ | |||
#if defined(STM32WB55xx) | |||
#include "stm32wb55xx.h" | |||
#elif defined(STM32WB5Mxx) | |||
#include "stm32wb5mxx.h" | |||
#elif defined(STM32WB50xx) | |||
#include "stm32wb50xx.h" | |||
#elif defined(STM32WB35xx) | |||
#include "stm32wb35xx.h" | |||
#elif defined(STM32WB30xx) | |||
#include "stm32wb30xx.h" | |||
#else | |||
#error "Please select first the target STM32WBxx device used in your application, for instance xxx (in stm32wbxx.h file)" | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
@@ -64,7 +64,9 @@ extern const uint32_t AHBPrescTable[16]; /*!< AHB prescalers table values */ | |||
extern const uint32_t APBPrescTable[8]; /*!< APB prescalers table values */ | |||
extern const uint32_t MSIRangeTable[16]; /*!< MSI ranges table values */ | |||
#if defined(STM32WB55xx) || defined(STM32WB5Mxx) || defined(STM32WB35xx) | |||
extern const uint32_t SmpsPrescalerTable[4][6]; /*!< SMPS factor ranges table values */ | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
@@ -0,0 +1,330 @@ | |||
;****************************************************************************** | |||
;* File Name : startup_stm32wb30xx_cm4.s | |||
;* Author : MCD Application Team | |||
;* Description : STM32WB30xx devices vector table for MDK-ARM toolchain. | |||
;* This module performs: | |||
;* - Set the initial SP | |||
;* - Set the initial PC == Reset_Handler | |||
;* - Set the vector table entries with the exceptions ISR address | |||
;* - Branches to __main in the C library (which eventually | |||
;* calls main()). | |||
;* After Reset the CortexM4 processor is in Thread mode, | |||
;* priority is Privileged, and the Stack is set to Main. | |||
;* <<< Use Configuration Wizard in Context Menu >>> | |||
;****************************************************************************** | |||
;* @attention | |||
;* | |||
;* Copyright (c) 2019 STMicroelectronics. All rights reserved. | |||
;* | |||
;* This software component is licensed by ST under BSD 3-Clause license, | |||
;* the "License"; You may not use this file except in compliance with the | |||
;* License. You may obtain a copy of the License at: | |||
;* opensource.org/licenses/BSD-3-Clause | |||
;* | |||
;****************************************************************************** | |||
; Amount of memory (in bytes) allocated for Stack | |||
; Tailor this value to your application needs | |||
; <h> Stack Configuration | |||
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
; </h> | |||
Stack_Size EQU 0x00000400 | |||
AREA STACK, NOINIT, READWRITE, ALIGN=3 | |||
Stack_Mem SPACE Stack_Size | |||
__initial_sp | |||
; <h> Heap Configuration | |||
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
; </h> | |||
Heap_Size EQU 0x00000200 | |||
AREA HEAP, NOINIT, READWRITE, ALIGN=3 | |||
__heap_base | |||
Heap_Mem SPACE Heap_Size | |||
__heap_limit | |||
PRESERVE8 | |||
THUMB | |||
; Vector Table Mapped to Address 0 at Reset | |||
AREA RESET, DATA, READONLY | |||
EXPORT __Vectors | |||
EXPORT __Vectors_End | |||
EXPORT __Vectors_Size | |||
__Vectors DCD __initial_sp ; Top of Stack | |||
DCD Reset_Handler ; Reset Handler | |||
DCD NMI_Handler ; NMI Handler | |||
DCD HardFault_Handler ; Hard Fault Handler | |||
DCD MemManage_Handler ; MPU Fault Handler | |||
DCD BusFault_Handler ; Bus Fault Handler | |||
DCD UsageFault_Handler ; Usage Fault Handler | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD SVC_Handler ; SVCall Handler | |||
DCD DebugMon_Handler ; Debug Monitor Handler | |||
DCD 0 ; Reserved | |||
DCD PendSV_Handler ; PendSV Handler | |||
DCD SysTick_Handler ; SysTick Handler | |||
; External Interrupts | |||
DCD WWDG_IRQHandler ; Window WatchDog | |||
DCD PVD_PVM_IRQHandler ; PVD and PVM detector | |||
DCD TAMP_STAMP_LSECSS_IRQHandler ; RTC Tamper and TimeStamp Interrupts and LSECSS Interrupts | |||
DCD RTC_WKUP_IRQHandler ; RTC Wakeup Interrupt | |||
DCD FLASH_IRQHandler ; FLASH global Interrupt | |||
DCD RCC_IRQHandler ; RCC Interrupt | |||
DCD EXTI0_IRQHandler ; EXTI Line 0 Interrupt | |||
DCD EXTI1_IRQHandler ; EXTI Line 1 Interrupt | |||
DCD EXTI2_IRQHandler ; EXTI Line 2 Interrupt | |||
DCD EXTI3_IRQHandler ; EXTI Line 3 Interrup | |||
DCD EXTI4_IRQHandler ; EXTI Line 4 Interrupt | |||
DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 Interrupt | |||
DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2 Interrupt | |||
DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3 Interrupt | |||
DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4 Interrupt | |||
DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5 Interrupt | |||
DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6 Interrupt | |||
DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7 Interrupt | |||
DCD ADC1_IRQHandler ; ADC1 Interrupt | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD C2SEV_PWR_C2H_IRQHandler ; CPU M0+ SEV Interrupt | |||
DCD 0 ; Reserved | |||
DCD EXTI9_5_IRQHandler ; EXTI Lines [9:5] Interrupt | |||
DCD TIM1_BRK_IRQHandler ; TIM1 Break Interrupt | |||
DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16 global Interrupts | |||
DCD TIM1_TRG_COM_TIM17_IRQHandler ; TIM1 Trigger and Communication and TIM17 global Interrupts | |||
DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare Interrupt | |||
DCD TIM2_IRQHandler ; TIM2 Global Interrupt | |||
DCD PKA_IRQHandler ; PKA Interrupt | |||
DCD I2C1_EV_IRQHandler ; I2C1 Event Interrupt | |||
DCD I2C1_ER_IRQHandler ; I2C1 Error Interrupt | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD SPI1_IRQHandler ; SPI1 Interrupt | |||
DCD 0 ; Reserved | |||
DCD USART1_IRQHandler ; USART1 Interrupt | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD TSC_IRQHandler ; TSC Interrupt | |||
DCD EXTI15_10_IRQHandler ; EXTI Lines1[15:10 ]Interrupts | |||
DCD RTC_Alarm_IRQHandler ; RTC Alarms (A and B) Interrupt | |||
DCD 0 ; Reserved | |||
DCD PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler ; WKUP Interrupt from PWR | |||
DCD IPCC_C1_RX_IRQHandler ; IPCC CPU1 RX occupied interrupt | |||
DCD IPCC_C1_TX_IRQHandler ; IPCC CPU1 RX free interrupt | |||
DCD HSEM_IRQHandler ; HSEM0 Interrupt | |||
DCD LPTIM1_IRQHandler ; LPTIM1 Interrupt | |||
DCD LPTIM2_IRQHandler ; LPTIM2 Interrupt | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD AES2_IRQHandler ; AES2 Interrupt | |||
DCD RNG_IRQHandler ; RNG1 Interrupt | |||
DCD FPU_IRQHandler ; FPU Interrupt | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD DMAMUX1_OVR_IRQHandler ; DMAMUX overrun Interrupt | |||
__Vectors_End | |||
__Vectors_Size EQU __Vectors_End - __Vectors | |||
AREA |.text|, CODE, READONLY | |||
; Reset handler | |||
Reset_Handler PROC | |||
EXPORT Reset_Handler [WEAK] | |||
IMPORT SystemInit | |||
IMPORT __main | |||
LDR R0, =SystemInit | |||
BLX R0 | |||
LDR R0, =__main | |||
BX R0 | |||
ENDP | |||
; Dummy Exception Handlers (infinite loops which can be modified) | |||
NMI_Handler PROC | |||
EXPORT NMI_Handler [WEAK] | |||
B . | |||
ENDP | |||
HardFault_Handler\ | |||
PROC | |||
EXPORT HardFault_Handler [WEAK] | |||
B . | |||
ENDP | |||
MemManage_Handler\ | |||
PROC | |||
EXPORT MemManage_Handler [WEAK] | |||
B . | |||
ENDP | |||
BusFault_Handler\ | |||
PROC | |||
EXPORT BusFault_Handler [WEAK] | |||
B . | |||
ENDP | |||
UsageFault_Handler\ | |||
PROC | |||
EXPORT UsageFault_Handler [WEAK] | |||
B . | |||
ENDP | |||
SVC_Handler PROC | |||
EXPORT SVC_Handler [WEAK] | |||
B . | |||
ENDP | |||
DebugMon_Handler\ | |||
PROC | |||
EXPORT DebugMon_Handler [WEAK] | |||
B . | |||
ENDP | |||
PendSV_Handler PROC | |||
EXPORT PendSV_Handler [WEAK] | |||
B . | |||
ENDP | |||
SysTick_Handler PROC | |||
EXPORT SysTick_Handler [WEAK] | |||
B . | |||
ENDP | |||
Default_Handler PROC | |||
EXPORT WWDG_IRQHandler [WEAK] | |||
EXPORT PVD_PVM_IRQHandler [WEAK] | |||
EXPORT TAMP_STAMP_LSECSS_IRQHandler [WEAK] | |||
EXPORT RTC_WKUP_IRQHandler [WEAK] | |||
EXPORT FLASH_IRQHandler [WEAK] | |||
EXPORT RCC_IRQHandler [WEAK] | |||
EXPORT EXTI0_IRQHandler [WEAK] | |||
EXPORT EXTI1_IRQHandler [WEAK] | |||
EXPORT EXTI2_IRQHandler [WEAK] | |||
EXPORT EXTI3_IRQHandler [WEAK] | |||
EXPORT EXTI4_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel1_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel2_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel3_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel4_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel5_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel6_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel7_IRQHandler [WEAK] | |||
EXPORT ADC1_IRQHandler [WEAK] | |||
EXPORT C2SEV_PWR_C2H_IRQHandler [WEAK] | |||
EXPORT EXTI9_5_IRQHandler [WEAK] | |||
EXPORT TIM1_BRK_IRQHandler [WEAK] | |||
EXPORT TIM1_UP_TIM16_IRQHandler [WEAK] | |||
EXPORT TIM1_TRG_COM_TIM17_IRQHandler [WEAK] | |||
EXPORT TIM1_CC_IRQHandler [WEAK] | |||
EXPORT TIM2_IRQHandler [WEAK] | |||
EXPORT PKA_IRQHandler [WEAK] | |||
EXPORT I2C1_EV_IRQHandler [WEAK] | |||
EXPORT I2C1_ER_IRQHandler [WEAK] | |||
EXPORT SPI1_IRQHandler [WEAK] | |||
EXPORT USART1_IRQHandler [WEAK] | |||
EXPORT TSC_IRQHandler [WEAK] | |||
EXPORT EXTI15_10_IRQHandler [WEAK] | |||
EXPORT RTC_Alarm_IRQHandler [WEAK] | |||
EXPORT PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler [WEAK] | |||
EXPORT IPCC_C1_RX_IRQHandler [WEAK] | |||
EXPORT IPCC_C1_TX_IRQHandler [WEAK] | |||
EXPORT HSEM_IRQHandler [WEAK] | |||
EXPORT LPTIM1_IRQHandler [WEAK] | |||
EXPORT LPTIM2_IRQHandler [WEAK] | |||
EXPORT AES2_IRQHandler [WEAK] | |||
EXPORT RNG_IRQHandler [WEAK] | |||
EXPORT FPU_IRQHandler [WEAK] | |||
EXPORT DMAMUX1_OVR_IRQHandler [WEAK] | |||
WWDG_IRQHandler | |||
PVD_PVM_IRQHandler | |||
TAMP_STAMP_LSECSS_IRQHandler | |||
RTC_WKUP_IRQHandler | |||
FLASH_IRQHandler | |||
RCC_IRQHandler | |||
EXTI0_IRQHandler | |||
EXTI1_IRQHandler | |||
EXTI2_IRQHandler | |||
EXTI3_IRQHandler | |||
EXTI4_IRQHandler | |||
DMA1_Channel1_IRQHandler | |||
DMA1_Channel2_IRQHandler | |||
DMA1_Channel3_IRQHandler | |||
DMA1_Channel4_IRQHandler | |||
DMA1_Channel5_IRQHandler | |||
DMA1_Channel6_IRQHandler | |||
DMA1_Channel7_IRQHandler | |||
ADC1_IRQHandler | |||
C2SEV_PWR_C2H_IRQHandler | |||
EXTI9_5_IRQHandler | |||
TIM1_BRK_IRQHandler | |||
TIM1_UP_TIM16_IRQHandler | |||
TIM1_TRG_COM_TIM17_IRQHandler | |||
TIM1_CC_IRQHandler | |||
TIM2_IRQHandler | |||
PKA_IRQHandler | |||
I2C1_EV_IRQHandler | |||
I2C1_ER_IRQHandler | |||
SPI1_IRQHandler | |||
USART1_IRQHandler | |||
TSC_IRQHandler | |||
EXTI15_10_IRQHandler | |||
RTC_Alarm_IRQHandler | |||
PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler | |||
IPCC_C1_RX_IRQHandler | |||
IPCC_C1_TX_IRQHandler | |||
HSEM_IRQHandler | |||
LPTIM1_IRQHandler | |||
LPTIM2_IRQHandler | |||
AES2_IRQHandler | |||
RNG_IRQHandler | |||
FPU_IRQHandler | |||
DMAMUX1_OVR_IRQHandler | |||
B . | |||
ENDP | |||
ALIGN | |||
;******************************************************************************* | |||
; User Stack and Heap initialization | |||
;******************************************************************************* | |||
IF :DEF:__MICROLIB | |||
EXPORT __initial_sp | |||
EXPORT __heap_base | |||
EXPORT __heap_limit | |||
ELSE | |||
IMPORT __use_two_region_memory | |||
EXPORT __user_initial_stackheap | |||
__user_initial_stackheap | |||
LDR R0, = Heap_Mem | |||
LDR R1, =(Stack_Mem + Stack_Size) | |||
LDR R2, = (Heap_Mem + Heap_Size) | |||
LDR R3, = Stack_Mem | |||
BX LR | |||
ALIGN | |||
ENDIF | |||
END | |||
;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** |
@@ -0,0 +1,364 @@ | |||
;****************************************************************************** | |||
;* File Name : startup_stm32wb35xx_cm4.s | |||
;* Author : MCD Application Team | |||
;* Description : STM32WB35xx devices vector table for MDK-ARM toolchain. | |||
;* This module performs: | |||
;* - Set the initial SP | |||
;* - Set the initial PC == Reset_Handler | |||
;* - Set the vector table entries with the exceptions ISR address | |||
;* - Branches to __main in the C library (which eventually | |||
;* calls main()). | |||
;* After Reset the CortexM4 processor is in Thread mode, | |||
;* priority is Privileged, and the Stack is set to Main. | |||
;* <<< Use Configuration Wizard in Context Menu >>> | |||
;****************************************************************************** | |||
;* @attention | |||
;* | |||
;* Copyright (c) 2019 STMicroelectronics. All rights reserved. | |||
;* | |||
;* This software component is licensed by ST under BSD 3-Clause license, | |||
;* the "License"; You may not use this file except in compliance with the | |||
;* License. You may obtain a copy of the License at: | |||
;* opensource.org/licenses/BSD-3-Clause | |||
;* | |||
;****************************************************************************** | |||
; Amount of memory (in bytes) allocated for Stack | |||
; Tailor this value to your application needs | |||
; <h> Stack Configuration | |||
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
; </h> | |||
Stack_Size EQU 0x00000400 | |||
AREA STACK, NOINIT, READWRITE, ALIGN=3 | |||
Stack_Mem SPACE Stack_Size | |||
__initial_sp | |||
; <h> Heap Configuration | |||
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
; </h> | |||
Heap_Size EQU 0x00000200 | |||
AREA HEAP, NOINIT, READWRITE, ALIGN=3 | |||
__heap_base | |||
Heap_Mem SPACE Heap_Size | |||
__heap_limit | |||
PRESERVE8 | |||
THUMB | |||
; Vector Table Mapped to Address 0 at Reset | |||
AREA RESET, DATA, READONLY | |||
EXPORT __Vectors | |||
EXPORT __Vectors_End | |||
EXPORT __Vectors_Size | |||
__Vectors DCD __initial_sp ; Top of Stack | |||
DCD Reset_Handler ; Reset Handler | |||
DCD NMI_Handler ; NMI Handler | |||
DCD HardFault_Handler ; Hard Fault Handler | |||
DCD MemManage_Handler ; MPU Fault Handler | |||
DCD BusFault_Handler ; Bus Fault Handler | |||
DCD UsageFault_Handler ; Usage Fault Handler | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD SVC_Handler ; SVCall Handler | |||
DCD DebugMon_Handler ; Debug Monitor Handler | |||
DCD 0 ; Reserved | |||
DCD PendSV_Handler ; PendSV Handler | |||
DCD SysTick_Handler ; SysTick Handler | |||
; External Interrupts | |||
DCD WWDG_IRQHandler ; Window WatchDog | |||
DCD PVD_PVM_IRQHandler ; PVD and PVM detector | |||
DCD TAMP_STAMP_LSECSS_IRQHandler ; RTC Tamper and TimeStamp Interrupts and LSECSS Interrupts | |||
DCD RTC_WKUP_IRQHandler ; RTC Wakeup Interrupt | |||
DCD FLASH_IRQHandler ; FLASH global Interrupt | |||
DCD RCC_IRQHandler ; RCC Interrupt | |||
DCD EXTI0_IRQHandler ; EXTI Line 0 Interrupt | |||
DCD EXTI1_IRQHandler ; EXTI Line 1 Interrupt | |||
DCD EXTI2_IRQHandler ; EXTI Line 2 Interrupt | |||
DCD EXTI3_IRQHandler ; EXTI Line 3 Interrup | |||
DCD EXTI4_IRQHandler ; EXTI Line 4 Interrupt | |||
DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 Interrupt | |||
DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2 Interrupt | |||
DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3 Interrupt | |||
DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4 Interrupt | |||
DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5 Interrupt | |||
DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6 Interrupt | |||
DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7 Interrupt | |||
DCD ADC1_IRQHandler ; ADC1 Interrupt | |||
DCD USB_HP_IRQHandler ; USB High Priority Interrupt | |||
DCD USB_LP_IRQHandler ; USB Low Priority Interrupt | |||
DCD C2SEV_PWR_C2H_IRQHandler ; CPU M0+ SEV Interrupt | |||
DCD COMP_IRQHandler ; COMP1 and COMP2 Interrupts | |||
DCD EXTI9_5_IRQHandler ; EXTI Lines [9:5] Interrupt | |||
DCD TIM1_BRK_IRQHandler ; TIM1 Break Interrupt | |||
DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16 global Interrupts | |||
DCD TIM1_TRG_COM_TIM17_IRQHandler ; TIM1 Trigger and Communication and TIM17 global Interrupts | |||
DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare Interrupt | |||
DCD TIM2_IRQHandler ; TIM2 Global Interrupt | |||
DCD PKA_IRQHandler ; PKA Interrupt | |||
DCD I2C1_EV_IRQHandler ; I2C1 Event Interrupt | |||
DCD I2C1_ER_IRQHandler ; I2C1 Error Interrupt | |||
DCD I2C3_EV_IRQHandler ; I2C3 Event Interrupt | |||
DCD I2C3_ER_IRQHandler ; I2C3 Error Interrupt | |||
DCD SPI1_IRQHandler ; SPI1 Interrupt | |||
DCD SPI2_IRQHandler ; SPI2 Interrupt | |||
DCD USART1_IRQHandler ; USART1 Interrupt | |||
DCD LPUART1_IRQHandler ; LPUART1 Interrupt | |||
DCD 0 ; Reserved | |||
DCD TSC_IRQHandler ; TSC Interrupt | |||
DCD EXTI15_10_IRQHandler ; EXTI Lines1[15:10 ]Interrupts | |||
DCD RTC_Alarm_IRQHandler ; RTC Alarms (A and B) Interrupt | |||
DCD CRS_IRQHandler ; CRS interrupt | |||
DCD PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler ; WKUP Interrupt from PWR | |||
DCD IPCC_C1_RX_IRQHandler ; IPCC CPU1 RX occupied interrupt | |||
DCD IPCC_C1_TX_IRQHandler ; IPCC CPU1 RX free interrupt | |||
DCD HSEM_IRQHandler ; HSEM0 Interrupt | |||
DCD LPTIM1_IRQHandler ; LPTIM1 Interrupt | |||
DCD LPTIM2_IRQHandler ; LPTIM2 Interrupt | |||
DCD 0 ; Reserved | |||
DCD QUADSPI_IRQHandler ; QUADSPI Interrupt | |||
DCD AES1_IRQHandler ; AES1 Interrupt | |||
DCD AES2_IRQHandler ; AES2 Interrupt | |||
DCD RNG_IRQHandler ; RNG1 Interrupt | |||
DCD FPU_IRQHandler ; FPU Interrupt | |||
DCD DMA2_Channel1_IRQHandler ; DMA2 Channel 1 Interrupt | |||
DCD DMA2_Channel2_IRQHandler ; DMA2 Channel 2 Interrupt | |||
DCD DMA2_Channel3_IRQHandler ; DMA2 Channel 3 Interrupt | |||
DCD DMA2_Channel4_IRQHandler ; DMA2 Channel 4 Interrupt | |||
DCD DMA2_Channel5_IRQHandler ; DMA2 Channel 5 Interrupt | |||
DCD DMA2_Channel6_IRQHandler ; DMA2 Channel 6 Interrupt | |||
DCD DMA2_Channel7_IRQHandler ; DMA2 Channel 7 Interrupt | |||
DCD DMAMUX1_OVR_IRQHandler ; DMAMUX overrun Interrupt | |||
__Vectors_End | |||
__Vectors_Size EQU __Vectors_End - __Vectors | |||
AREA |.text|, CODE, READONLY | |||
; Reset handler | |||
Reset_Handler PROC | |||
EXPORT Reset_Handler [WEAK] | |||
IMPORT SystemInit | |||
IMPORT __main | |||
LDR R0, =SystemInit | |||
BLX R0 | |||
LDR R0, =__main | |||
BX R0 | |||
ENDP | |||
; Dummy Exception Handlers (infinite loops which can be modified) | |||
NMI_Handler PROC | |||
EXPORT NMI_Handler [WEAK] | |||
B . | |||
ENDP | |||
HardFault_Handler\ | |||
PROC | |||
EXPORT HardFault_Handler [WEAK] | |||
B . | |||
ENDP | |||
MemManage_Handler\ | |||
PROC | |||
EXPORT MemManage_Handler [WEAK] | |||
B . | |||
ENDP | |||
BusFault_Handler\ | |||
PROC | |||
EXPORT BusFault_Handler [WEAK] | |||
B . | |||
ENDP | |||
UsageFault_Handler\ | |||
PROC | |||
EXPORT UsageFault_Handler [WEAK] | |||
B . | |||
ENDP | |||
SVC_Handler PROC | |||
EXPORT SVC_Handler [WEAK] | |||
B . | |||
ENDP | |||
DebugMon_Handler\ | |||
PROC | |||
EXPORT DebugMon_Handler [WEAK] | |||
B . | |||
ENDP | |||
PendSV_Handler PROC | |||
EXPORT PendSV_Handler [WEAK] | |||
B . | |||
ENDP | |||
SysTick_Handler PROC | |||
EXPORT SysTick_Handler [WEAK] | |||
B . | |||
ENDP | |||
Default_Handler PROC | |||
EXPORT WWDG_IRQHandler [WEAK] | |||
EXPORT PVD_PVM_IRQHandler [WEAK] | |||
EXPORT TAMP_STAMP_LSECSS_IRQHandler [WEAK] | |||
EXPORT RTC_WKUP_IRQHandler [WEAK] | |||
EXPORT FLASH_IRQHandler [WEAK] | |||
EXPORT RCC_IRQHandler [WEAK] | |||
EXPORT EXTI0_IRQHandler [WEAK] | |||
EXPORT EXTI1_IRQHandler [WEAK] | |||
EXPORT EXTI2_IRQHandler [WEAK] | |||
EXPORT EXTI3_IRQHandler [WEAK] | |||
EXPORT EXTI4_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel1_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel2_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel3_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel4_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel5_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel6_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel7_IRQHandler [WEAK] | |||
EXPORT ADC1_IRQHandler [WEAK] | |||
EXPORT USB_HP_IRQHandler [WEAK] | |||
EXPORT USB_LP_IRQHandler [WEAK] | |||
EXPORT C2SEV_PWR_C2H_IRQHandler [WEAK] | |||
EXPORT COMP_IRQHandler [WEAK] | |||
EXPORT EXTI9_5_IRQHandler [WEAK] | |||
EXPORT TIM1_BRK_IRQHandler [WEAK] | |||
EXPORT TIM1_UP_TIM16_IRQHandler [WEAK] | |||
EXPORT TIM1_TRG_COM_TIM17_IRQHandler [WEAK] | |||
EXPORT TIM1_CC_IRQHandler [WEAK] | |||
EXPORT TIM2_IRQHandler [WEAK] | |||
EXPORT PKA_IRQHandler [WEAK] | |||
EXPORT I2C1_EV_IRQHandler [WEAK] | |||
EXPORT I2C1_ER_IRQHandler [WEAK] | |||
EXPORT I2C3_EV_IRQHandler [WEAK] | |||
EXPORT I2C3_ER_IRQHandler [WEAK] | |||
EXPORT SPI1_IRQHandler [WEAK] | |||
EXPORT SPI2_IRQHandler [WEAK] | |||
EXPORT USART1_IRQHandler [WEAK] | |||
EXPORT LPUART1_IRQHandler [WEAK] | |||
EXPORT TSC_IRQHandler [WEAK] | |||
EXPORT EXTI15_10_IRQHandler [WEAK] | |||
EXPORT RTC_Alarm_IRQHandler [WEAK] | |||
EXPORT CRS_IRQHandler [WEAK] | |||
EXPORT PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler [WEAK] | |||
EXPORT IPCC_C1_RX_IRQHandler [WEAK] | |||
EXPORT IPCC_C1_TX_IRQHandler [WEAK] | |||
EXPORT HSEM_IRQHandler [WEAK] | |||
EXPORT LPTIM1_IRQHandler [WEAK] | |||
EXPORT LPTIM2_IRQHandler [WEAK] | |||
EXPORT QUADSPI_IRQHandler [WEAK] | |||
EXPORT AES1_IRQHandler [WEAK] | |||
EXPORT AES2_IRQHandler [WEAK] | |||
EXPORT RNG_IRQHandler [WEAK] | |||
EXPORT FPU_IRQHandler [WEAK] | |||
EXPORT DMA2_Channel1_IRQHandler [WEAK] | |||
EXPORT DMA2_Channel2_IRQHandler [WEAK] | |||
EXPORT DMA2_Channel3_IRQHandler [WEAK] | |||
EXPORT DMA2_Channel4_IRQHandler [WEAK] | |||
EXPORT DMA2_Channel5_IRQHandler [WEAK] | |||
EXPORT DMA2_Channel6_IRQHandler [WEAK] | |||
EXPORT DMA2_Channel7_IRQHandler [WEAK] | |||
EXPORT DMAMUX1_OVR_IRQHandler [WEAK] | |||
WWDG_IRQHandler | |||
PVD_PVM_IRQHandler | |||
TAMP_STAMP_LSECSS_IRQHandler | |||
RTC_WKUP_IRQHandler | |||
FLASH_IRQHandler | |||
RCC_IRQHandler | |||
EXTI0_IRQHandler | |||
EXTI1_IRQHandler | |||
EXTI2_IRQHandler | |||
EXTI3_IRQHandler | |||
EXTI4_IRQHandler | |||
DMA1_Channel1_IRQHandler | |||
DMA1_Channel2_IRQHandler | |||
DMA1_Channel3_IRQHandler | |||
DMA1_Channel4_IRQHandler | |||
DMA1_Channel5_IRQHandler | |||
DMA1_Channel6_IRQHandler | |||
DMA1_Channel7_IRQHandler | |||
ADC1_IRQHandler | |||
USB_HP_IRQHandler | |||
USB_LP_IRQHandler | |||
C2SEV_PWR_C2H_IRQHandler | |||
COMP_IRQHandler | |||
EXTI9_5_IRQHandler | |||
TIM1_BRK_IRQHandler | |||
TIM1_UP_TIM16_IRQHandler | |||
TIM1_TRG_COM_TIM17_IRQHandler | |||
TIM1_CC_IRQHandler | |||
TIM2_IRQHandler | |||
PKA_IRQHandler | |||
I2C1_EV_IRQHandler | |||
I2C1_ER_IRQHandler | |||
I2C3_EV_IRQHandler | |||
I2C3_ER_IRQHandler | |||
SPI1_IRQHandler | |||
SPI2_IRQHandler | |||
USART1_IRQHandler | |||
LPUART1_IRQHandler | |||
TSC_IRQHandler | |||
EXTI15_10_IRQHandler | |||
RTC_Alarm_IRQHandler | |||
CRS_IRQHandler | |||
PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler | |||
IPCC_C1_RX_IRQHandler | |||
IPCC_C1_TX_IRQHandler | |||
HSEM_IRQHandler | |||
LPTIM1_IRQHandler | |||
LPTIM2_IRQHandler | |||
QUADSPI_IRQHandler | |||
AES1_IRQHandler | |||
AES2_IRQHandler | |||
RNG_IRQHandler | |||
FPU_IRQHandler | |||
DMA2_Channel1_IRQHandler | |||
DMA2_Channel2_IRQHandler | |||
DMA2_Channel3_IRQHandler | |||
DMA2_Channel4_IRQHandler | |||
DMA2_Channel5_IRQHandler | |||
DMA2_Channel6_IRQHandler | |||
DMA2_Channel7_IRQHandler | |||
DMAMUX1_OVR_IRQHandler | |||
B . | |||
ENDP | |||
ALIGN | |||
;******************************************************************************* | |||
; User Stack and Heap initialization | |||
;******************************************************************************* | |||
IF :DEF:__MICROLIB | |||
EXPORT __initial_sp | |||
EXPORT __heap_base | |||
EXPORT __heap_limit | |||
ELSE | |||
IMPORT __use_two_region_memory | |||
EXPORT __user_initial_stackheap | |||
__user_initial_stackheap | |||
LDR R0, = Heap_Mem | |||
LDR R1, =(Stack_Mem + Stack_Size) | |||
LDR R2, = (Heap_Mem + Heap_Size) | |||
LDR R3, = Stack_Mem | |||
BX LR | |||
ALIGN | |||
ENDIF | |||
END | |||
;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** |
@@ -0,0 +1,330 @@ | |||
;****************************************************************************** | |||
;* File Name : startup_stm32wb50xx_cm4.s | |||
;* Author : MCD Application Team | |||
;* Description : STM32WB50xx devices vector table for MDK-ARM toolchain. | |||
;* This module performs: | |||
;* - Set the initial SP | |||
;* - Set the initial PC == Reset_Handler | |||
;* - Set the vector table entries with the exceptions ISR address | |||
;* - Branches to __main in the C library (which eventually | |||
;* calls main()). | |||
;* After Reset the CortexM4 processor is in Thread mode, | |||
;* priority is Privileged, and the Stack is set to Main. | |||
;* <<< Use Configuration Wizard in Context Menu >>> | |||
;****************************************************************************** | |||
;* @attention | |||
;* | |||
;* Copyright (c) 2019 STMicroelectronics. All rights reserved. | |||
;* | |||
;* This software component is licensed by ST under BSD 3-Clause license, | |||
;* the "License"; You may not use this file except in compliance with the | |||
;* License. You may obtain a copy of the License at: | |||
;* opensource.org/licenses/BSD-3-Clause | |||
;* | |||
;****************************************************************************** | |||
; Amount of memory (in bytes) allocated for Stack | |||
; Tailor this value to your application needs | |||
; <h> Stack Configuration | |||
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
; </h> | |||
Stack_Size EQU 0x00000400 | |||
AREA STACK, NOINIT, READWRITE, ALIGN=3 | |||
Stack_Mem SPACE Stack_Size | |||
__initial_sp | |||
; <h> Heap Configuration | |||
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
; </h> | |||
Heap_Size EQU 0x00000200 | |||
AREA HEAP, NOINIT, READWRITE, ALIGN=3 | |||
__heap_base | |||
Heap_Mem SPACE Heap_Size | |||
__heap_limit | |||
PRESERVE8 | |||
THUMB | |||
; Vector Table Mapped to Address 0 at Reset | |||
AREA RESET, DATA, READONLY | |||
EXPORT __Vectors | |||
EXPORT __Vectors_End | |||
EXPORT __Vectors_Size | |||
__Vectors DCD __initial_sp ; Top of Stack | |||
DCD Reset_Handler ; Reset Handler | |||
DCD NMI_Handler ; NMI Handler | |||
DCD HardFault_Handler ; Hard Fault Handler | |||
DCD MemManage_Handler ; MPU Fault Handler | |||
DCD BusFault_Handler ; Bus Fault Handler | |||
DCD UsageFault_Handler ; Usage Fault Handler | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD SVC_Handler ; SVCall Handler | |||
DCD DebugMon_Handler ; Debug Monitor Handler | |||
DCD 0 ; Reserved | |||
DCD PendSV_Handler ; PendSV Handler | |||
DCD SysTick_Handler ; SysTick Handler | |||
; External Interrupts | |||
DCD WWDG_IRQHandler ; Window WatchDog | |||
DCD PVD_PVM_IRQHandler ; PVD and PVM detector | |||
DCD TAMP_STAMP_LSECSS_IRQHandler ; RTC Tamper and TimeStamp Interrupts and LSECSS Interrupts | |||
DCD RTC_WKUP_IRQHandler ; RTC Wakeup Interrupt | |||
DCD FLASH_IRQHandler ; FLASH global Interrupt | |||
DCD RCC_IRQHandler ; RCC Interrupt | |||
DCD EXTI0_IRQHandler ; EXTI Line 0 Interrupt | |||
DCD EXTI1_IRQHandler ; EXTI Line 1 Interrupt | |||
DCD EXTI2_IRQHandler ; EXTI Line 2 Interrupt | |||
DCD EXTI3_IRQHandler ; EXTI Line 3 Interrup | |||
DCD EXTI4_IRQHandler ; EXTI Line 4 Interrupt | |||
DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 Interrupt | |||
DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2 Interrupt | |||
DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3 Interrupt | |||
DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4 Interrupt | |||
DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5 Interrupt | |||
DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6 Interrupt | |||
DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7 Interrupt | |||
DCD ADC1_IRQHandler ; ADC1 Interrupt | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD C2SEV_PWR_C2H_IRQHandler ; CPU M0+ SEV Interrupt | |||
DCD 0 ; Reserved | |||
DCD EXTI9_5_IRQHandler ; EXTI Lines [9:5] Interrupt | |||
DCD TIM1_BRK_IRQHandler ; TIM1 Break Interrupt | |||
DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16 global Interrupts | |||
DCD TIM1_TRG_COM_TIM17_IRQHandler ; TIM1 Trigger and Communication and TIM17 global Interrupts | |||
DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare Interrupt | |||
DCD TIM2_IRQHandler ; TIM2 Global Interrupt | |||
DCD PKA_IRQHandler ; PKA Interrupt | |||
DCD I2C1_EV_IRQHandler ; I2C1 Event Interrupt | |||
DCD I2C1_ER_IRQHandler ; I2C1 Error Interrupt | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD SPI1_IRQHandler ; SPI1 Interrupt | |||
DCD 0 ; Reserved | |||
DCD USART1_IRQHandler ; USART1 Interrupt | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD TSC_IRQHandler ; TSC Interrupt | |||
DCD EXTI15_10_IRQHandler ; EXTI Lines1[15:10 ]Interrupts | |||
DCD RTC_Alarm_IRQHandler ; RTC Alarms (A and B) Interrupt | |||
DCD 0 ; Reserved | |||
DCD PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler ; WKUP Interrupt from PWR | |||
DCD IPCC_C1_RX_IRQHandler ; IPCC CPU1 RX occupied interrupt | |||
DCD IPCC_C1_TX_IRQHandler ; IPCC CPU1 RX free interrupt | |||
DCD HSEM_IRQHandler ; HSEM0 Interrupt | |||
DCD LPTIM1_IRQHandler ; LPTIM1 Interrupt | |||
DCD LPTIM2_IRQHandler ; LPTIM2 Interrupt | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD AES2_IRQHandler ; AES2 Interrupt | |||
DCD RNG_IRQHandler ; RNG1 Interrupt | |||
DCD FPU_IRQHandler ; FPU Interrupt | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD DMAMUX1_OVR_IRQHandler ; DMAMUX overrun Interrupt | |||
__Vectors_End | |||
__Vectors_Size EQU __Vectors_End - __Vectors | |||
AREA |.text|, CODE, READONLY | |||
; Reset handler | |||
Reset_Handler PROC | |||
EXPORT Reset_Handler [WEAK] | |||
IMPORT SystemInit | |||
IMPORT __main | |||
LDR R0, =SystemInit | |||
BLX R0 | |||
LDR R0, =__main | |||
BX R0 | |||
ENDP | |||
; Dummy Exception Handlers (infinite loops which can be modified) | |||
NMI_Handler PROC | |||
EXPORT NMI_Handler [WEAK] | |||
B . | |||
ENDP | |||
HardFault_Handler\ | |||
PROC | |||
EXPORT HardFault_Handler [WEAK] | |||
B . | |||
ENDP | |||
MemManage_Handler\ | |||
PROC | |||
EXPORT MemManage_Handler [WEAK] | |||
B . | |||
ENDP | |||
BusFault_Handler\ | |||
PROC | |||
EXPORT BusFault_Handler [WEAK] | |||
B . | |||
ENDP | |||
UsageFault_Handler\ | |||
PROC | |||
EXPORT UsageFault_Handler [WEAK] | |||
B . | |||
ENDP | |||
SVC_Handler PROC | |||
EXPORT SVC_Handler [WEAK] | |||
B . | |||
ENDP | |||
DebugMon_Handler\ | |||
PROC | |||
EXPORT DebugMon_Handler [WEAK] | |||
B . | |||
ENDP | |||
PendSV_Handler PROC | |||
EXPORT PendSV_Handler [WEAK] | |||
B . | |||
ENDP | |||
SysTick_Handler PROC | |||
EXPORT SysTick_Handler [WEAK] | |||
B . | |||
ENDP | |||
Default_Handler PROC | |||
EXPORT WWDG_IRQHandler [WEAK] | |||
EXPORT PVD_PVM_IRQHandler [WEAK] | |||
EXPORT TAMP_STAMP_LSECSS_IRQHandler [WEAK] | |||
EXPORT RTC_WKUP_IRQHandler [WEAK] | |||
EXPORT FLASH_IRQHandler [WEAK] | |||
EXPORT RCC_IRQHandler [WEAK] | |||
EXPORT EXTI0_IRQHandler [WEAK] | |||
EXPORT EXTI1_IRQHandler [WEAK] | |||
EXPORT EXTI2_IRQHandler [WEAK] | |||
EXPORT EXTI3_IRQHandler [WEAK] | |||
EXPORT EXTI4_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel1_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel2_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel3_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel4_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel5_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel6_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel7_IRQHandler [WEAK] | |||
EXPORT ADC1_IRQHandler [WEAK] | |||
EXPORT C2SEV_PWR_C2H_IRQHandler [WEAK] | |||
EXPORT EXTI9_5_IRQHandler [WEAK] | |||
EXPORT TIM1_BRK_IRQHandler [WEAK] | |||
EXPORT TIM1_UP_TIM16_IRQHandler [WEAK] | |||
EXPORT TIM1_TRG_COM_TIM17_IRQHandler [WEAK] | |||
EXPORT TIM1_CC_IRQHandler [WEAK] | |||
EXPORT TIM2_IRQHandler [WEAK] | |||
EXPORT PKA_IRQHandler [WEAK] | |||
EXPORT I2C1_EV_IRQHandler [WEAK] | |||
EXPORT I2C1_ER_IRQHandler [WEAK] | |||
EXPORT SPI1_IRQHandler [WEAK] | |||
EXPORT USART1_IRQHandler [WEAK] | |||
EXPORT TSC_IRQHandler [WEAK] | |||
EXPORT EXTI15_10_IRQHandler [WEAK] | |||
EXPORT RTC_Alarm_IRQHandler [WEAK] | |||
EXPORT PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler [WEAK] | |||
EXPORT IPCC_C1_RX_IRQHandler [WEAK] | |||
EXPORT IPCC_C1_TX_IRQHandler [WEAK] | |||
EXPORT HSEM_IRQHandler [WEAK] | |||
EXPORT LPTIM1_IRQHandler [WEAK] | |||
EXPORT LPTIM2_IRQHandler [WEAK] | |||
EXPORT AES2_IRQHandler [WEAK] | |||
EXPORT RNG_IRQHandler [WEAK] | |||
EXPORT FPU_IRQHandler [WEAK] | |||
EXPORT DMAMUX1_OVR_IRQHandler [WEAK] | |||
WWDG_IRQHandler | |||
PVD_PVM_IRQHandler | |||
TAMP_STAMP_LSECSS_IRQHandler | |||
RTC_WKUP_IRQHandler | |||
FLASH_IRQHandler | |||
RCC_IRQHandler | |||
EXTI0_IRQHandler | |||
EXTI1_IRQHandler | |||
EXTI2_IRQHandler | |||
EXTI3_IRQHandler | |||
EXTI4_IRQHandler | |||
DMA1_Channel1_IRQHandler | |||
DMA1_Channel2_IRQHandler | |||
DMA1_Channel3_IRQHandler | |||
DMA1_Channel4_IRQHandler | |||
DMA1_Channel5_IRQHandler | |||
DMA1_Channel6_IRQHandler | |||
DMA1_Channel7_IRQHandler | |||
ADC1_IRQHandler | |||
C2SEV_PWR_C2H_IRQHandler | |||
EXTI9_5_IRQHandler | |||
TIM1_BRK_IRQHandler | |||
TIM1_UP_TIM16_IRQHandler | |||
TIM1_TRG_COM_TIM17_IRQHandler | |||
TIM1_CC_IRQHandler | |||
TIM2_IRQHandler | |||
PKA_IRQHandler | |||
I2C1_EV_IRQHandler | |||
I2C1_ER_IRQHandler | |||
SPI1_IRQHandler | |||
USART1_IRQHandler | |||
TSC_IRQHandler | |||
EXTI15_10_IRQHandler | |||
RTC_Alarm_IRQHandler | |||
PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler | |||
IPCC_C1_RX_IRQHandler | |||
IPCC_C1_TX_IRQHandler | |||
HSEM_IRQHandler | |||
LPTIM1_IRQHandler | |||
LPTIM2_IRQHandler | |||
AES2_IRQHandler | |||
RNG_IRQHandler | |||
FPU_IRQHandler | |||
DMAMUX1_OVR_IRQHandler | |||
B . | |||
ENDP | |||
ALIGN | |||
;******************************************************************************* | |||
; User Stack and Heap initialization | |||
;******************************************************************************* | |||
IF :DEF:__MICROLIB | |||
EXPORT __initial_sp | |||
EXPORT __heap_base | |||
EXPORT __heap_limit | |||
ELSE | |||
IMPORT __use_two_region_memory | |||
EXPORT __user_initial_stackheap | |||
__user_initial_stackheap | |||
LDR R0, = Heap_Mem | |||
LDR R1, =(Stack_Mem + Stack_Size) | |||
LDR R2, = (Heap_Mem + Heap_Size) | |||
LDR R3, = Stack_Mem | |||
BX LR | |||
ALIGN | |||
ENDIF | |||
END | |||
;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** |
@@ -0,0 +1,368 @@ | |||
;****************************************************************************** | |||
;* File Name : startup_stm32wb5mxx_cm4.s | |||
;* Author : MCD Application Team | |||
;* Description : STM32WB5Mxx devices vector table for MDK-ARM toolchain. | |||
;* This module performs: | |||
;* - Set the initial SP | |||
;* - Set the initial PC == Reset_Handler | |||
;* - Set the vector table entries with the exceptions ISR address | |||
;* - Branches to __main in the C library (which eventually | |||
;* calls main()). | |||
;* After Reset the CortexM4 processor is in Thread mode, | |||
;* priority is Privileged, and the Stack is set to Main. | |||
;* <<< Use Configuration Wizard in Context Menu >>> | |||
;****************************************************************************** | |||
;* @attention | |||
;* | |||
;* Copyright (c) 2019 STMicroelectronics. All rights reserved. | |||
;* | |||
;* This software component is licensed by ST under BSD 3-Clause license, | |||
;* the "License"; You may not use this file except in compliance with the | |||
;* License. You may obtain a copy of the License at: | |||
;* opensource.org/licenses/BSD-3-Clause | |||
;* | |||
;****************************************************************************** | |||
; Amount of memory (in bytes) allocated for Stack | |||
; Tailor this value to your application needs | |||
; <h> Stack Configuration | |||
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
; </h> | |||
Stack_Size EQU 0x00000400 | |||
AREA STACK, NOINIT, READWRITE, ALIGN=3 | |||
Stack_Mem SPACE Stack_Size | |||
__initial_sp | |||
; <h> Heap Configuration | |||
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
; </h> | |||
Heap_Size EQU 0x00000200 | |||
AREA HEAP, NOINIT, READWRITE, ALIGN=3 | |||
__heap_base | |||
Heap_Mem SPACE Heap_Size | |||
__heap_limit | |||
PRESERVE8 | |||
THUMB | |||
; Vector Table Mapped to Address 0 at Reset | |||
AREA RESET, DATA, READONLY | |||
EXPORT __Vectors | |||
EXPORT __Vectors_End | |||
EXPORT __Vectors_Size | |||
__Vectors DCD __initial_sp ; Top of Stack | |||
DCD Reset_Handler ; Reset Handler | |||
DCD NMI_Handler ; NMI Handler | |||
DCD HardFault_Handler ; Hard Fault Handler | |||
DCD MemManage_Handler ; MPU Fault Handler | |||
DCD BusFault_Handler ; Bus Fault Handler | |||
DCD UsageFault_Handler ; Usage Fault Handler | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD SVC_Handler ; SVCall Handler | |||
DCD DebugMon_Handler ; Debug Monitor Handler | |||
DCD 0 ; Reserved | |||
DCD PendSV_Handler ; PendSV Handler | |||
DCD SysTick_Handler ; SysTick Handler | |||
; External Interrupts | |||
DCD WWDG_IRQHandler ; Window WatchDog | |||
DCD PVD_PVM_IRQHandler ; PVD and PVM detector | |||
DCD TAMP_STAMP_LSECSS_IRQHandler ; RTC Tamper and TimeStamp Interrupts and LSECSS Interrupts | |||
DCD RTC_WKUP_IRQHandler ; RTC Wakeup Interrupt | |||
DCD FLASH_IRQHandler ; FLASH global Interrupt | |||
DCD RCC_IRQHandler ; RCC Interrupt | |||
DCD EXTI0_IRQHandler ; EXTI Line 0 Interrupt | |||
DCD EXTI1_IRQHandler ; EXTI Line 1 Interrupt | |||
DCD EXTI2_IRQHandler ; EXTI Line 2 Interrupt | |||
DCD EXTI3_IRQHandler ; EXTI Line 3 Interrup | |||
DCD EXTI4_IRQHandler ; EXTI Line 4 Interrupt | |||
DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 Interrupt | |||
DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2 Interrupt | |||
DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3 Interrupt | |||
DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4 Interrupt | |||
DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5 Interrupt | |||
DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6 Interrupt | |||
DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7 Interrupt | |||
DCD ADC1_IRQHandler ; ADC1 Interrupt | |||
DCD USB_HP_IRQHandler ; USB High Priority Interrupt | |||
DCD USB_LP_IRQHandler ; USB Low Priority Interrupt | |||
DCD C2SEV_PWR_C2H_IRQHandler ; CPU M0+ SEV Interrupt | |||
DCD COMP_IRQHandler ; COMP1 and COMP2 Interrupts | |||
DCD EXTI9_5_IRQHandler ; EXTI Lines [9:5] Interrupt | |||
DCD TIM1_BRK_IRQHandler ; TIM1 Break Interrupt | |||
DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16 global Interrupts | |||
DCD TIM1_TRG_COM_TIM17_IRQHandler ; TIM1 Trigger and Communication and TIM17 global Interrupts | |||
DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare Interrupt | |||
DCD TIM2_IRQHandler ; TIM2 Global Interrupt | |||
DCD PKA_IRQHandler ; PKA Interrupt | |||
DCD I2C1_EV_IRQHandler ; I2C1 Event Interrupt | |||
DCD I2C1_ER_IRQHandler ; I2C1 Error Interrupt | |||
DCD I2C3_EV_IRQHandler ; I2C3 Event Interrupt | |||
DCD I2C3_ER_IRQHandler ; I2C3 Error Interrupt | |||
DCD SPI1_IRQHandler ; SPI1 Interrupt | |||
DCD SPI2_IRQHandler ; SPI2 Interrupt | |||
DCD USART1_IRQHandler ; USART1 Interrupt | |||
DCD LPUART1_IRQHandler ; LPUART1 Interrupt | |||
DCD SAI1_IRQHandler ; SAI Interrupt | |||
DCD TSC_IRQHandler ; TSC Interrupt | |||
DCD EXTI15_10_IRQHandler ; EXTI Lines1[15:10 ]Interrupts | |||
DCD RTC_Alarm_IRQHandler ; RTC Alarms (A and B) Interrupt | |||
DCD CRS_IRQHandler ; CRS interrupt | |||
DCD PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler ; WKUP Interrupt from PWR | |||
DCD IPCC_C1_RX_IRQHandler ; IPCC CPU1 RX occupied interrupt | |||
DCD IPCC_C1_TX_IRQHandler ; IPCC CPU1 RX free interrupt | |||
DCD HSEM_IRQHandler ; HSEM0 Interrupt | |||
DCD LPTIM1_IRQHandler ; LPTIM1 Interrupt | |||
DCD LPTIM2_IRQHandler ; LPTIM2 Interrupt | |||
DCD LCD_IRQHandler ; LCD Interrupt | |||
DCD QUADSPI_IRQHandler ; QUADSPI Interrupt | |||
DCD AES1_IRQHandler ; AES1 Interrupt | |||
DCD AES2_IRQHandler ; AES2 Interrupt | |||
DCD RNG_IRQHandler ; RNG1 Interrupt | |||
DCD FPU_IRQHandler ; FPU Interrupt | |||
DCD DMA2_Channel1_IRQHandler ; DMA2 Channel 1 Interrupt | |||
DCD DMA2_Channel2_IRQHandler ; DMA2 Channel 2 Interrupt | |||
DCD DMA2_Channel3_IRQHandler ; DMA2 Channel 3 Interrupt | |||
DCD DMA2_Channel4_IRQHandler ; DMA2 Channel 4 Interrupt | |||
DCD DMA2_Channel5_IRQHandler ; DMA2 Channel 5 Interrupt | |||
DCD DMA2_Channel6_IRQHandler ; DMA2 Channel 6 Interrupt | |||
DCD DMA2_Channel7_IRQHandler ; DMA2 Channel 7 Interrupt | |||
DCD DMAMUX1_OVR_IRQHandler ; DMAMUX overrun Interrupt | |||
__Vectors_End | |||
__Vectors_Size EQU __Vectors_End - __Vectors | |||
AREA |.text|, CODE, READONLY | |||
; Reset handler | |||
Reset_Handler PROC | |||
EXPORT Reset_Handler [WEAK] | |||
IMPORT SystemInit | |||
IMPORT __main | |||
LDR R0, =SystemInit | |||
BLX R0 | |||
LDR R0, =__main | |||
BX R0 | |||
ENDP | |||
; Dummy Exception Handlers (infinite loops which can be modified) | |||
NMI_Handler PROC | |||
EXPORT NMI_Handler [WEAK] | |||
B . | |||
ENDP | |||
HardFault_Handler\ | |||
PROC | |||
EXPORT HardFault_Handler [WEAK] | |||
B . | |||
ENDP | |||
MemManage_Handler\ | |||
PROC | |||
EXPORT MemManage_Handler [WEAK] | |||
B . | |||
ENDP | |||
BusFault_Handler\ | |||
PROC | |||
EXPORT BusFault_Handler [WEAK] | |||
B . | |||
ENDP | |||
UsageFault_Handler\ | |||
PROC | |||
EXPORT UsageFault_Handler [WEAK] | |||
B . | |||
ENDP | |||
SVC_Handler PROC | |||
EXPORT SVC_Handler [WEAK] | |||
B . | |||
ENDP | |||
DebugMon_Handler\ | |||
PROC | |||
EXPORT DebugMon_Handler [WEAK] | |||
B . | |||
ENDP | |||
PendSV_Handler PROC | |||
EXPORT PendSV_Handler [WEAK] | |||
B . | |||
ENDP | |||
SysTick_Handler PROC | |||
EXPORT SysTick_Handler [WEAK] | |||
B . | |||
ENDP | |||
Default_Handler PROC | |||
EXPORT WWDG_IRQHandler [WEAK] | |||
EXPORT PVD_PVM_IRQHandler [WEAK] | |||
EXPORT TAMP_STAMP_LSECSS_IRQHandler [WEAK] | |||
EXPORT RTC_WKUP_IRQHandler [WEAK] | |||
EXPORT FLASH_IRQHandler [WEAK] | |||
EXPORT RCC_IRQHandler [WEAK] | |||
EXPORT EXTI0_IRQHandler [WEAK] | |||
EXPORT EXTI1_IRQHandler [WEAK] | |||
EXPORT EXTI2_IRQHandler [WEAK] | |||
EXPORT EXTI3_IRQHandler [WEAK] | |||
EXPORT EXTI4_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel1_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel2_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel3_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel4_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel5_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel6_IRQHandler [WEAK] | |||
EXPORT DMA1_Channel7_IRQHandler [WEAK] | |||
EXPORT ADC1_IRQHandler [WEAK] | |||
EXPORT USB_HP_IRQHandler [WEAK] | |||
EXPORT USB_LP_IRQHandler [WEAK] | |||
EXPORT C2SEV_PWR_C2H_IRQHandler [WEAK] | |||
EXPORT COMP_IRQHandler [WEAK] | |||
EXPORT EXTI9_5_IRQHandler [WEAK] | |||
EXPORT TIM1_BRK_IRQHandler [WEAK] | |||
EXPORT TIM1_UP_TIM16_IRQHandler [WEAK] | |||
EXPORT TIM1_TRG_COM_TIM17_IRQHandler [WEAK] | |||
EXPORT TIM1_CC_IRQHandler [WEAK] | |||
EXPORT TIM2_IRQHandler [WEAK] | |||
EXPORT PKA_IRQHandler [WEAK] | |||
EXPORT I2C1_EV_IRQHandler [WEAK] | |||
EXPORT I2C1_ER_IRQHandler [WEAK] | |||
EXPORT I2C3_EV_IRQHandler [WEAK] | |||
EXPORT I2C3_ER_IRQHandler [WEAK] | |||
EXPORT SPI1_IRQHandler [WEAK] | |||
EXPORT SPI2_IRQHandler [WEAK] | |||
EXPORT USART1_IRQHandler [WEAK] | |||
EXPORT LPUART1_IRQHandler [WEAK] | |||
EXPORT SAI1_IRQHandler [WEAK] | |||
EXPORT TSC_IRQHandler [WEAK] | |||
EXPORT EXTI15_10_IRQHandler [WEAK] | |||
EXPORT RTC_Alarm_IRQHandler [WEAK] | |||
EXPORT CRS_IRQHandler [WEAK] | |||
EXPORT PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler [WEAK] | |||
EXPORT IPCC_C1_RX_IRQHandler [WEAK] | |||
EXPORT IPCC_C1_TX_IRQHandler [WEAK] | |||
EXPORT HSEM_IRQHandler [WEAK] | |||
EXPORT LPTIM1_IRQHandler [WEAK] | |||
EXPORT LPTIM2_IRQHandler [WEAK] | |||
EXPORT LCD_IRQHandler [WEAK] | |||
EXPORT QUADSPI_IRQHandler [WEAK] | |||
EXPORT AES1_IRQHandler [WEAK] | |||
EXPORT AES2_IRQHandler [WEAK] | |||
EXPORT RNG_IRQHandler [WEAK] | |||
EXPORT FPU_IRQHandler [WEAK] | |||
EXPORT DMA2_Channel1_IRQHandler [WEAK] | |||
EXPORT DMA2_Channel2_IRQHandler [WEAK] | |||
EXPORT DMA2_Channel3_IRQHandler [WEAK] | |||
EXPORT DMA2_Channel4_IRQHandler [WEAK] | |||
EXPORT DMA2_Channel5_IRQHandler [WEAK] | |||
EXPORT DMA2_Channel6_IRQHandler [WEAK] | |||
EXPORT DMA2_Channel7_IRQHandler [WEAK] | |||
EXPORT DMAMUX1_OVR_IRQHandler [WEAK] | |||
WWDG_IRQHandler | |||
PVD_PVM_IRQHandler | |||
TAMP_STAMP_LSECSS_IRQHandler | |||
RTC_WKUP_IRQHandler | |||
FLASH_IRQHandler | |||
RCC_IRQHandler | |||
EXTI0_IRQHandler | |||
EXTI1_IRQHandler | |||
EXTI2_IRQHandler | |||
EXTI3_IRQHandler | |||
EXTI4_IRQHandler | |||
DMA1_Channel1_IRQHandler | |||
DMA1_Channel2_IRQHandler | |||
DMA1_Channel3_IRQHandler | |||
DMA1_Channel4_IRQHandler | |||
DMA1_Channel5_IRQHandler | |||
DMA1_Channel6_IRQHandler | |||
DMA1_Channel7_IRQHandler | |||
ADC1_IRQHandler | |||
USB_HP_IRQHandler | |||
USB_LP_IRQHandler | |||
C2SEV_PWR_C2H_IRQHandler | |||
COMP_IRQHandler | |||
EXTI9_5_IRQHandler | |||
TIM1_BRK_IRQHandler | |||
TIM1_UP_TIM16_IRQHandler | |||
TIM1_TRG_COM_TIM17_IRQHandler | |||
TIM1_CC_IRQHandler | |||
TIM2_IRQHandler | |||
PKA_IRQHandler | |||
I2C1_EV_IRQHandler | |||
I2C1_ER_IRQHandler | |||
I2C3_EV_IRQHandler | |||
I2C3_ER_IRQHandler | |||
SPI1_IRQHandler | |||
SPI2_IRQHandler | |||
USART1_IRQHandler | |||
LPUART1_IRQHandler | |||
SAI1_IRQHandler | |||
TSC_IRQHandler | |||
EXTI15_10_IRQHandler | |||
RTC_Alarm_IRQHandler | |||
CRS_IRQHandler | |||
PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler | |||
IPCC_C1_RX_IRQHandler | |||
IPCC_C1_TX_IRQHandler | |||
HSEM_IRQHandler | |||
LPTIM1_IRQHandler | |||
LPTIM2_IRQHandler | |||
LCD_IRQHandler | |||
QUADSPI_IRQHandler | |||
AES1_IRQHandler | |||
AES2_IRQHandler | |||
RNG_IRQHandler | |||
FPU_IRQHandler | |||
DMA2_Channel1_IRQHandler | |||
DMA2_Channel2_IRQHandler | |||
DMA2_Channel3_IRQHandler | |||
DMA2_Channel4_IRQHandler | |||
DMA2_Channel5_IRQHandler | |||
DMA2_Channel6_IRQHandler | |||
DMA2_Channel7_IRQHandler | |||
DMAMUX1_OVR_IRQHandler | |||
B . | |||
ENDP | |||
ALIGN | |||
;******************************************************************************* | |||
; User Stack and Heap initialization | |||
;******************************************************************************* | |||
IF :DEF:__MICROLIB | |||
EXPORT __initial_sp | |||
EXPORT __heap_base | |||
EXPORT __heap_limit | |||
ELSE | |||
IMPORT __use_two_region_memory | |||
EXPORT __user_initial_stackheap | |||
__user_initial_stackheap | |||
LDR R0, = Heap_Mem | |||
LDR R1, =(Stack_Mem + Stack_Size) | |||
LDR R2, = (Heap_Mem + Heap_Size) | |||
LDR R3, = Stack_Mem | |||
BX LR | |||
ALIGN | |||
ENDIF | |||
END | |||
;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** |
@@ -0,0 +1,388 @@ | |||
/** | |||
****************************************************************************** | |||
* @file startup_stm32wb30xx_cm4.s | |||
* @author MCD Application Team | |||
* @brief STM32WB30xx devices vector table GCC toolchain. | |||
* This module performs: | |||
* - Set the initial SP | |||
* - Set the initial PC == Reset_Handler, | |||
* - Set the vector table entries with the exceptions ISR address | |||
* - Branches to main in the C library (which eventually | |||
* calls main()). | |||
* After Reset the Cortex-M4 processor is in Thread mode, | |||
* priority is Privileged, and the Stack is set to Main. | |||
****************************************************************************** | |||
* @attention | |||
* | |||
* <h2><center>© Copyright (c) 2019 STMicroelectronics. | |||
* All rights reserved.</center></h2> | |||
* | |||
* This software component is licensed by ST under BSD 3-Clause license, | |||
* the "License"; You may not use this file except in compliance with the | |||
* License. You may obtain a copy of the License at: | |||
* opensource.org/licenses/BSD-3-Clause | |||
* | |||
****************************************************************************** | |||
*/ | |||
.syntax unified | |||
.cpu cortex-m4 | |||
.fpu softvfp | |||
.thumb | |||
.global g_pfnVectors | |||
.global Default_Handler | |||
/* start address for the initialization values of the .data section. | |||
defined in linker script */ | |||
.word _sidata | |||
/* start address for the .data section. defined in linker script */ | |||
.word _sdata | |||
/* end address for the .data section. defined in linker script */ | |||
.word _edata | |||
/* start address for the .bss section. defined in linker script */ | |||
.word _sbss | |||
/* end address for the .bss section. defined in linker script */ | |||
.word _ebss | |||
/* start address for the .MB_MEM2 section. defined in linker script */ | |||
.word _sMB_MEM2 | |||
/* end address for the .MB_MEM2 section. defined in linker script */ | |||
.word _eMB_MEM2 | |||
/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */ | |||
.macro INIT_BSS start, end | |||
ldr r0, =\start | |||
ldr r1, =\end | |||
movs r3, #0 | |||
bl LoopFillZerobss | |||
.endm | |||
/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */ | |||
.macro INIT_DATA start, end, src | |||
ldr r0, =\start | |||
ldr r1, =\end | |||
ldr r2, =\src | |||
movs r3, #0 | |||
bl LoopCopyDataInit | |||
.endm | |||
.section .text.data_initializers | |||
CopyDataInit: | |||
ldr r4, [r2, r3] | |||
str r4, [r0, r3] | |||
adds r3, r3, #4 | |||
LoopCopyDataInit: | |||
adds r4, r0, r3 | |||
cmp r4, r1 | |||
bcc CopyDataInit | |||
bx lr | |||
FillZerobss: | |||
str r3, [r0] | |||
adds r0, r0, #4 | |||
LoopFillZerobss: | |||
cmp r0, r1 | |||
bcc FillZerobss | |||
bx lr | |||
.section .text.Reset_Handler | |||
.weak Reset_Handler | |||
.type Reset_Handler, %function | |||
Reset_Handler: | |||
ldr r0, =_estack | |||
mov sp, r0 /* set stack pointer */ | |||
/* Copy the data segment initializers from flash to SRAM */ | |||
INIT_DATA _sdata, _edata, _sidata | |||
/* Zero fill the bss segments. */ | |||
INIT_BSS _sbss, _ebss | |||
INIT_BSS _sMB_MEM2, _eMB_MEM2 | |||
/* Call the clock system intitialization function.*/ | |||
bl SystemInit | |||
/* Call static constructors */ | |||
bl __libc_init_array | |||
/* Call the application s entry point.*/ | |||
bl main | |||
LoopForever: | |||
b LoopForever | |||
.size Reset_Handler, .-Reset_Handler | |||
/** | |||
* @brief This is the code that gets called when the processor receives an | |||
* unexpected interrupt. This simply enters an infinite loop, preserving | |||
* the system state for examination by a debugger. | |||
* | |||
* @param None | |||
* @retval None | |||
*/ | |||
.section .text.Default_Handler,"ax",%progbits | |||
Default_Handler: | |||
Infinite_Loop: | |||
b Infinite_Loop | |||
.size Default_Handler, .-Default_Handler | |||
/****************************************************************************** | |||
* | |||
* The minimal vector table for a Cortex-M4. Note that the proper constructs | |||
* must be placed on this to ensure that it ends up at physical address | |||
* 0x0000.0000. | |||
* | |||
******************************************************************************/ | |||
.section .isr_vector,"a",%progbits | |||
.type g_pfnVectors, %object | |||
.size g_pfnVectors, .-g_pfnVectors | |||
g_pfnVectors: | |||
.word _estack | |||
.word Reset_Handler | |||
.word NMI_Handler | |||
.word HardFault_Handler | |||
.word MemManage_Handler | |||
.word BusFault_Handler | |||
.word UsageFault_Handler | |||
.word 0 | |||
.word 0 | |||
.word 0 | |||
.word 0 | |||
.word SVC_Handler | |||
.word DebugMon_Handler | |||
.word 0 | |||
.word PendSV_Handler | |||
.word SysTick_Handler | |||
.word WWDG_IRQHandler | |||
.word PVD_PVM_IRQHandler | |||
.word TAMP_STAMP_LSECSS_IRQHandler | |||
.word RTC_WKUP_IRQHandler | |||
.word FLASH_IRQHandler | |||
.word RCC_IRQHandler | |||
.word EXTI0_IRQHandler | |||
.word EXTI1_IRQHandler | |||
.word EXTI2_IRQHandler | |||
.word EXTI3_IRQHandler | |||
.word EXTI4_IRQHandler | |||
.word DMA1_Channel1_IRQHandler | |||
.word DMA1_Channel2_IRQHandler | |||
.word DMA1_Channel3_IRQHandler | |||
.word DMA1_Channel4_IRQHandler | |||
.word DMA1_Channel5_IRQHandler | |||
.word DMA1_Channel6_IRQHandler | |||
.word DMA1_Channel7_IRQHandler | |||
.word ADC1_IRQHandler | |||
.word 0 | |||
.word 0 | |||
.word C2SEV_PWR_C2H_IRQHandler | |||
.word 0 | |||
.word EXTI9_5_IRQHandler | |||
.word TIM1_BRK_IRQHandler | |||
.word TIM1_UP_TIM16_IRQHandler | |||
.word TIM1_TRG_COM_TIM17_IRQHandler | |||
.word TIM1_CC_IRQHandler | |||
.word TIM2_IRQHandler | |||
.word PKA_IRQHandler | |||
.word I2C1_EV_IRQHandler | |||
.word I2C1_ER_IRQHandler | |||
.word 0 | |||
.word 0 | |||
.word SPI1_IRQHandler | |||
.word 0 | |||
.word USART1_IRQHandler | |||
.word 0 | |||
.word 0 | |||
.word TSC_IRQHandler | |||
.word EXTI15_10_IRQHandler | |||
.word RTC_Alarm_IRQHandler | |||
.word 0 | |||
.word PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler | |||
.word IPCC_C1_RX_IRQHandler | |||
.word IPCC_C1_TX_IRQHandler | |||
.word HSEM_IRQHandler | |||
.word LPTIM1_IRQHandler | |||
.word LPTIM2_IRQHandler | |||
.word 0 | |||
.word 0 | |||
.word 0 | |||
.word AES2_IRQHandler | |||
.word RNG_IRQHandler | |||
.word FPU_IRQHandler | |||
.word 0 | |||
.word 0 | |||
.word 0 | |||
.word 0 | |||
.word 0 | |||
.word 0 | |||
.word 0 | |||
.word DMAMUX1_OVR_IRQHandler | |||
/******************************************************************************* | |||
* | |||
* Provide weak aliases for each Exception handler to the Default_Handler. | |||
* As they are weak aliases, any function with the same name will override | |||
* this definition. | |||
* | |||
*******************************************************************************/ | |||
.weak NMI_Handler | |||
.thumb_set NMI_Handler,Default_Handler | |||
.weak HardFault_Handler | |||
.thumb_set HardFault_Handler,Default_Handler | |||
.weak MemManage_Handler | |||
.thumb_set MemManage_Handler,Default_Handler | |||
.weak BusFault_Handler | |||
.thumb_set BusFault_Handler,Default_Handler | |||
.weak UsageFault_Handler | |||
.thumb_set UsageFault_Handler,Default_Handler | |||
.weak SVC_Handler | |||
.thumb_set SVC_Handler,Default_Handler | |||
.weak DebugMon_Handler | |||
.thumb_set DebugMon_Handler,Default_Handler | |||
.weak PendSV_Handler | |||
.thumb_set PendSV_Handler,Default_Handler | |||
.weak SysTick_Handler | |||
.thumb_set SysTick_Handler,Default_Handler | |||
.weak WWDG_IRQHandler | |||
.thumb_set WWDG_IRQHandler,Default_Handler | |||
.weak PVD_PVM_IRQHandler | |||
.thumb_set PVD_PVM_IRQHandler,Default_Handler | |||
.weak TAMP_STAMP_LSECSS_IRQHandler | |||
.thumb_set TAMP_STAMP_LSECSS_IRQHandler,Default_Handler | |||
.weak RTC_WKUP_IRQHandler | |||
.thumb_set RTC_WKUP_IRQHandler,Default_Handler | |||
.weak FLASH_IRQHandler | |||
.thumb_set FLASH_IRQHandler,Default_Handler | |||
.weak RCC_IRQHandler | |||
.thumb_set RCC_IRQHandler,Default_Handler | |||
.weak EXTI0_IRQHandler | |||
.thumb_set EXTI0_IRQHandler,Default_Handler | |||
.weak EXTI1_IRQHandler | |||
.thumb_set EXTI1_IRQHandler,Default_Handler | |||
.weak EXTI2_IRQHandler | |||
.thumb_set EXTI2_IRQHandler,Default_Handler | |||
.weak EXTI3_IRQHandler | |||
.thumb_set EXTI3_IRQHandler,Default_Handler | |||
.weak EXTI4_IRQHandler | |||
.thumb_set EXTI4_IRQHandler,Default_Handler | |||
.weak DMA1_Channel1_IRQHandler | |||
.thumb_set DMA1_Channel1_IRQHandler,Default_Handler | |||
.weak DMA1_Channel2_IRQHandler | |||
.thumb_set DMA1_Channel2_IRQHandler,Default_Handler | |||
.weak DMA1_Channel3_IRQHandler | |||
.thumb_set DMA1_Channel3_IRQHandler,Default_Handler | |||
.weak DMA1_Channel4_IRQHandler | |||
.thumb_set DMA1_Channel4_IRQHandler,Default_Handler | |||
.weak DMA1_Channel5_IRQHandler | |||
.thumb_set DMA1_Channel5_IRQHandler,Default_Handler | |||
.weak DMA1_Channel6_IRQHandler | |||
.thumb_set DMA1_Channel6_IRQHandler,Default_Handler | |||
.weak DMA1_Channel7_IRQHandler | |||
.thumb_set DMA1_Channel7_IRQHandler,Default_Handler | |||
.weak ADC1_IRQHandler | |||
.thumb_set ADC1_IRQHandler,Default_Handler | |||
.weak C2SEV_PWR_C2H_IRQHandler | |||
.thumb_set C2SEV_PWR_C2H_IRQHandler,Default_Handler | |||
.weak EXTI9_5_IRQHandler | |||
.thumb_set EXTI9_5_IRQHandler,Default_Handler | |||
.weak TIM1_BRK_IRQHandler | |||
.thumb_set TIM1_BRK_IRQHandler,Default_Handler | |||
.weak TIM1_UP_TIM16_IRQHandler | |||
.thumb_set TIM1_UP_TIM16_IRQHandler,Default_Handler | |||
.weak TIM1_TRG_COM_TIM17_IRQHandler | |||
.thumb_set TIM1_TRG_COM_TIM17_IRQHandler,Default_Handler | |||
.weak TIM1_CC_IRQHandler | |||
.thumb_set TIM1_CC_IRQHandler,Default_Handler | |||
.weak TIM2_IRQHandler | |||
.thumb_set TIM2_IRQHandler,Default_Handler | |||
.weak PKA_IRQHandler | |||
.thumb_set PKA_IRQHandler,Default_Handler | |||
.weak I2C1_EV_IRQHandler | |||
.thumb_set I2C1_EV_IRQHandler,Default_Handler | |||
.weak I2C1_ER_IRQHandler | |||
.thumb_set I2C1_ER_IRQHandler,Default_Handler | |||
.weak SPI1_IRQHandler | |||
.thumb_set SPI1_IRQHandler,Default_Handler | |||
.weak USART1_IRQHandler | |||
.thumb_set USART1_IRQHandler,Default_Handler | |||
.weak TSC_IRQHandler | |||
.thumb_set TSC_IRQHandler,Default_Handler | |||
.weak EXTI15_10_IRQHandler | |||
.thumb_set EXTI15_10_IRQHandler,Default_Handler | |||
.weak RTC_Alarm_IRQHandler | |||
.thumb_set RTC_Alarm_IRQHandler,Default_Handler | |||
.weak PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler | |||
.thumb_set PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler,Default_Handler | |||
.weak IPCC_C1_RX_IRQHandler | |||
.thumb_set IPCC_C1_RX_IRQHandler,Default_Handler | |||
.weak IPCC_C1_TX_IRQHandler | |||
.thumb_set IPCC_C1_TX_IRQHandler,Default_Handler | |||
.weak HSEM_IRQHandler | |||
.thumb_set HSEM_IRQHandler,Default_Handler | |||
.weak LPTIM1_IRQHandler | |||
.thumb_set LPTIM1_IRQHandler,Default_Handler | |||
.weak LPTIM2_IRQHandler | |||
.thumb_set LPTIM2_IRQHandler,Default_Handler | |||
.weak AES2_IRQHandler | |||
.thumb_set AES2_IRQHandler,Default_Handler | |||
.weak RNG_IRQHandler | |||
.thumb_set RNG_IRQHandler,Default_Handler | |||
.weak FPU_IRQHandler | |||
.thumb_set FPU_IRQHandler,Default_Handler | |||
.weak DMAMUX1_OVR_IRQHandler | |||
.thumb_set DMAMUX1_OVR_IRQHandler,Default_Handler | |||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
@@ -0,0 +1,439 @@ | |||
/** | |||
****************************************************************************** | |||
* @file startup_stm32wb35xx_cm4.s | |||
* @author MCD Application Team | |||
* @brief STM32WB35xx devices vector table GCC toolchain. | |||
* This module performs: | |||
* - Set the initial SP | |||
* - Set the initial PC == Reset_Handler, | |||
* - Set the vector table entries with the exceptions ISR address | |||
* - Branches to main in the C library (which eventually | |||
* calls main()). | |||
* After Reset the Cortex-M4 processor is in Thread mode, | |||
* priority is Privileged, and the Stack is set to Main. | |||
****************************************************************************** | |||
* @attention | |||
* | |||
* <h2><center>© Copyright (c) 2019 STMicroelectronics. | |||
* All rights reserved.</center></h2> | |||
* | |||
* This software component is licensed by ST under BSD 3-Clause license, | |||
* the "License"; You may not use this file except in compliance with the | |||
* License. You may obtain a copy of the License at: | |||
* opensource.org/licenses/BSD-3-Clause | |||
* | |||
****************************************************************************** | |||
*/ | |||
.syntax unified | |||
.cpu cortex-m4 | |||
.fpu softvfp | |||
.thumb | |||
.global g_pfnVectors | |||
.global Default_Handler | |||
/* start address for the initialization values of the .data section. | |||
defined in linker script */ | |||
.word _sidata | |||
/* start address for the .data section. defined in linker script */ | |||
.word _sdata | |||
/* end address for the .data section. defined in linker script */ | |||
.word _edata | |||
/* start address for the .bss section. defined in linker script */ | |||
.word _sbss | |||
/* end address for the .bss section. defined in linker script */ | |||
.word _ebss | |||
/* start address for the .MB_MEM2 section. defined in linker script */ | |||
.word _sMB_MEM2 | |||
/* end address for the .MB_MEM2 section. defined in linker script */ | |||
.word _eMB_MEM2 | |||
/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */ | |||
.macro INIT_BSS start, end | |||
ldr r0, =\start | |||
ldr r1, =\end | |||
movs r3, #0 | |||
bl LoopFillZerobss | |||
.endm | |||
/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */ | |||
.macro INIT_DATA start, end, src | |||
ldr r0, =\start | |||
ldr r1, =\end | |||
ldr r2, =\src | |||
movs r3, #0 | |||
bl LoopCopyDataInit | |||
.endm | |||
.section .text.data_initializers | |||
CopyDataInit: | |||
ldr r4, [r2, r3] | |||
str r4, [r0, r3] | |||
adds r3, r3, #4 | |||
LoopCopyDataInit: | |||
adds r4, r0, r3 | |||
cmp r4, r1 | |||
bcc CopyDataInit | |||
bx lr | |||
FillZerobss: | |||
str r3, [r0] | |||
adds r0, r0, #4 | |||
LoopFillZerobss: | |||
cmp r0, r1 | |||
bcc FillZerobss | |||
bx lr | |||
.section .text.Reset_Handler | |||
.weak Reset_Handler | |||
.type Reset_Handler, %function | |||
Reset_Handler: | |||
ldr r0, =_estack | |||
mov sp, r0 /* set stack pointer */ | |||
/* Copy the data segment initializers from flash to SRAM */ | |||
INIT_DATA _sdata, _edata, _sidata | |||
/* Zero fill the bss segments. */ | |||
INIT_BSS _sbss, _ebss | |||
INIT_BSS _sMB_MEM2, _eMB_MEM2 | |||
/* Call the clock system intitialization function.*/ | |||
bl SystemInit | |||
/* Call static constructors */ | |||
bl __libc_init_array | |||
/* Call the application s entry point.*/ | |||
bl main | |||
LoopForever: | |||
b LoopForever | |||
.size Reset_Handler, .-Reset_Handler | |||
/** | |||
* @brief This is the code that gets called when the processor receives an | |||
* unexpected interrupt. This simply enters an infinite loop, preserving | |||
* the system state for examination by a debugger. | |||
* | |||
* @param None | |||
* @retval None | |||
*/ | |||
.section .text.Default_Handler,"ax",%progbits | |||
Default_Handler: | |||
Infinite_Loop: | |||
b Infinite_Loop | |||
.size Default_Handler, .-Default_Handler | |||
/****************************************************************************** | |||
* | |||
* The minimal vector table for a Cortex-M4. Note that the proper constructs | |||
* must be placed on this to ensure that it ends up at physical address | |||
* 0x0000.0000. | |||
* | |||
******************************************************************************/ | |||
.section .isr_vector,"a",%progbits | |||
.type g_pfnVectors, %object | |||
.size g_pfnVectors, .-g_pfnVectors | |||
g_pfnVectors: | |||
.word _estack | |||
.word Reset_Handler | |||
.word NMI_Handler | |||
.word HardFault_Handler | |||
.word MemManage_Handler | |||
.word BusFault_Handler | |||
.word UsageFault_Handler | |||
.word 0 | |||
.word 0 | |||
.word 0 | |||
.word 0 | |||
.word SVC_Handler | |||
.word DebugMon_Handler | |||
.word 0 | |||
.word PendSV_Handler | |||
.word SysTick_Handler | |||
.word WWDG_IRQHandler | |||
.word PVD_PVM_IRQHandler | |||
.word TAMP_STAMP_LSECSS_IRQHandler | |||
.word RTC_WKUP_IRQHandler | |||
.word FLASH_IRQHandler | |||
.word RCC_IRQHandler | |||
.word EXTI0_IRQHandler | |||
.word EXTI1_IRQHandler | |||
.word EXTI2_IRQHandler | |||
.word EXTI3_IRQHandler | |||
.word EXTI4_IRQHandler | |||
.word DMA1_Channel1_IRQHandler | |||
.word DMA1_Channel2_IRQHandler | |||
.word DMA1_Channel3_IRQHandler | |||
.word DMA1_Channel4_IRQHandler | |||
.word DMA1_Channel5_IRQHandler | |||
.word DMA1_Channel6_IRQHandler | |||
.word DMA1_Channel7_IRQHandler | |||
.word ADC1_IRQHandler | |||
.word USB_HP_IRQHandler | |||
.word USB_LP_IRQHandler | |||
.word C2SEV_PWR_C2H_IRQHandler | |||
.word COMP_IRQHandler | |||
.word EXTI9_5_IRQHandler | |||
.word TIM1_BRK_IRQHandler | |||
.word TIM1_UP_TIM16_IRQHandler | |||
.word TIM1_TRG_COM_TIM17_IRQHandler | |||
.word TIM1_CC_IRQHandler | |||
.word TIM2_IRQHandler | |||
.word PKA_IRQHandler | |||
.word I2C1_EV_IRQHandler | |||
.word I2C1_ER_IRQHandler | |||
.word I2C3_EV_IRQHandler | |||
.word I2C3_ER_IRQHandler | |||
.word SPI1_IRQHandler | |||
.word SPI2_IRQHandler | |||
.word USART1_IRQHandler | |||
.word LPUART1_IRQHandler | |||
.word 0 | |||
.word TSC_IRQHandler | |||
.word EXTI15_10_IRQHandler | |||
.word RTC_Alarm_IRQHandler | |||
.word CRS_IRQHandler | |||
.word PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler | |||
.word IPCC_C1_RX_IRQHandler | |||
.word IPCC_C1_TX_IRQHandler | |||
.word HSEM_IRQHandler | |||
.word LPTIM1_IRQHandler | |||
.word LPTIM2_IRQHandler | |||
.word 0 | |||
.word QUADSPI_IRQHandler | |||
.word AES1_IRQHandler | |||
.word AES2_IRQHandler | |||
.word RNG_IRQHandler | |||
.word FPU_IRQHandler | |||
.word DMA2_Channel1_IRQHandler | |||
.word DMA2_Channel2_IRQHandler | |||
.word DMA2_Channel3_IRQHandler | |||
.word DMA2_Channel4_IRQHandler | |||
.word DMA2_Channel5_IRQHandler | |||
.word DMA2_Channel6_IRQHandler | |||
.word DMA2_Channel7_IRQHandler | |||
.word DMAMUX1_OVR_IRQHandler | |||
/******************************************************************************* | |||
* | |||
* Provide weak aliases for each Exception handler to the Default_Handler. | |||
* As they are weak aliases, any function with the same name will override | |||
* this definition. | |||
* | |||
*******************************************************************************/ | |||
.weak NMI_Handler | |||
.thumb_set NMI_Handler,Default_Handler | |||
.weak HardFault_Handler | |||
.thumb_set HardFault_Handler,Default_Handler | |||
.weak MemManage_Handler | |||
.thumb_set MemManage_Handler,Default_Handler | |||
.weak BusFault_Handler | |||
.thumb_set BusFault_Handler,Default_Handler | |||
.weak UsageFault_Handler | |||
.thumb_set UsageFault_Handler,Default_Handler | |||
.weak SVC_Handler | |||
.thumb_set SVC_Handler,Default_Handler | |||
.weak DebugMon_Handler | |||
.thumb_set DebugMon_Handler,Default_Handler | |||
.weak PendSV_Handler | |||
.thumb_set PendSV_Handler,Default_Handler | |||
.weak SysTick_Handler | |||
.thumb_set SysTick_Handler,Default_Handler | |||
.weak WWDG_IRQHandler | |||
.thumb_set WWDG_IRQHandler,Default_Handler | |||
.weak PVD_PVM_IRQHandler | |||
.thumb_set PVD_PVM_IRQHandler,Default_Handler | |||
.weak TAMP_STAMP_LSECSS_IRQHandler | |||
.thumb_set TAMP_STAMP_LSECSS_IRQHandler,Default_Handler | |||
.weak RTC_WKUP_IRQHandler | |||
.thumb_set RTC_WKUP_IRQHandler,Default_Handler | |||
.weak FLASH_IRQHandler | |||
.thumb_set FLASH_IRQHandler,Default_Handler | |||
.weak RCC_IRQHandler | |||
.thumb_set RCC_IRQHandler,Default_Handler | |||
.weak EXTI0_IRQHandler | |||
.thumb_set EXTI0_IRQHandler,Default_Handler | |||
.weak EXTI1_IRQHandler | |||
.thumb_set EXTI1_IRQHandler,Default_Handler | |||
.weak EXTI2_IRQHandler | |||
.thumb_set EXTI2_IRQHandler,Default_Handler | |||
.weak EXTI3_IRQHandler | |||
.thumb_set EXTI3_IRQHandler,Default_Handler | |||
.weak EXTI4_IRQHandler | |||
.thumb_set EXTI4_IRQHandler,Default_Handler | |||
.weak DMA1_Channel1_IRQHandler | |||
.thumb_set DMA1_Channel1_IRQHandler,Default_Handler | |||
.weak DMA1_Channel2_IRQHandler | |||
.thumb_set DMA1_Channel2_IRQHandler,Default_Handler | |||
.weak DMA1_Channel3_IRQHandler | |||
.thumb_set DMA1_Channel3_IRQHandler,Default_Handler | |||
.weak DMA1_Channel4_IRQHandler | |||
.thumb_set DMA1_Channel4_IRQHandler,Default_Handler | |||
.weak DMA1_Channel5_IRQHandler | |||
.thumb_set DMA1_Channel5_IRQHandler,Default_Handler | |||
.weak DMA1_Channel6_IRQHandler | |||
.thumb_set DMA1_Channel6_IRQHandler,Default_Handler | |||
.weak DMA1_Channel7_IRQHandler | |||
.thumb_set DMA1_Channel7_IRQHandler,Default_Handler | |||
.weak ADC1_IRQHandler | |||
.thumb_set ADC1_IRQHandler,Default_Handler | |||
.weak USB_HP_IRQHandler | |||
.thumb_set USB_HP_IRQHandler,Default_Handler | |||
.weak USB_LP_IRQHandler | |||
.thumb_set USB_LP_IRQHandler,Default_Handler | |||
.weak C2SEV_PWR_C2H_IRQHandler | |||
.thumb_set C2SEV_PWR_C2H_IRQHandler,Default_Handler | |||
.weak COMP_IRQHandler | |||
.thumb_set COMP_IRQHandler,Default_Handler | |||
.weak EXTI9_5_IRQHandler | |||
.thumb_set EXTI9_5_IRQHandler,Default_Handler | |||
.weak TIM1_BRK_IRQHandler | |||
.thumb_set TIM1_BRK_IRQHandler,Default_Handler | |||
.weak TIM1_UP_TIM16_IRQHandler | |||
.thumb_set TIM1_UP_TIM16_IRQHandler,Default_Handler | |||
.weak TIM1_TRG_COM_TIM17_IRQHandler | |||
.thumb_set TIM1_TRG_COM_TIM17_IRQHandler,Default_Handler | |||
.weak TIM1_CC_IRQHandler | |||
.thumb_set TIM1_CC_IRQHandler,Default_Handler | |||
.weak TIM2_IRQHandler | |||
.thumb_set TIM2_IRQHandler,Default_Handler | |||
.weak PKA_IRQHandler | |||
.thumb_set PKA_IRQHandler,Default_Handler | |||
.weak I2C1_EV_IRQHandler | |||
.thumb_set I2C1_EV_IRQHandler,Default_Handler | |||
.weak I2C1_ER_IRQHandler | |||
.thumb_set I2C1_ER_IRQHandler,Default_Handler | |||
.weak I2C3_EV_IRQHandler | |||
.thumb_set I2C3_EV_IRQHandler,Default_Handler | |||
.weak I2C3_ER_IRQHandler | |||
.thumb_set I2C3_ER_IRQHandler,Default_Handler | |||
.weak SPI1_IRQHandler | |||
.thumb_set SPI1_IRQHandler,Default_Handler | |||
.weak SPI2_IRQHandler | |||
.thumb_set SPI2_IRQHandler,Default_Handler | |||
.weak USART1_IRQHandler | |||
.thumb_set USART1_IRQHandler,Default_Handler | |||
.weak LPUART1_IRQHandler | |||
.thumb_set LPUART1_IRQHandler,Default_Handler | |||
.weak TSC_IRQHandler | |||
.thumb_set TSC_IRQHandler,Default_Handler | |||
.weak EXTI15_10_IRQHandler | |||
.thumb_set EXTI15_10_IRQHandler,Default_Handler | |||
.weak RTC_Alarm_IRQHandler | |||
.thumb_set RTC_Alarm_IRQHandler,Default_Handler | |||
.weak CRS_IRQHandler | |||
.thumb_set CRS_IRQHandler,Default_Handler | |||
.weak PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler | |||
.thumb_set PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler,Default_Handler | |||
.weak IPCC_C1_RX_IRQHandler | |||
.thumb_set IPCC_C1_RX_IRQHandler,Default_Handler | |||
.weak IPCC_C1_TX_IRQHandler | |||
.thumb_set IPCC_C1_TX_IRQHandler,Default_Handler | |||
.weak HSEM_IRQHandler | |||
.thumb_set HSEM_IRQHandler,Default_Handler | |||
.weak LPTIM1_IRQHandler | |||
.thumb_set LPTIM1_IRQHandler,Default_Handler | |||
.weak LPTIM2_IRQHandler | |||
.thumb_set LPTIM2_IRQHandler,Default_Handler | |||
.weak QUADSPI_IRQHandler | |||
.thumb_set QUADSPI_IRQHandler,Default_Handler | |||
.weak AES1_IRQHandler | |||
.thumb_set AES1_IRQHandler,Default_Handler | |||
.weak AES2_IRQHandler | |||
.thumb_set AES2_IRQHandler,Default_Handler | |||
.weak RNG_IRQHandler | |||
.thumb_set RNG_IRQHandler,Default_Handler | |||
.weak FPU_IRQHandler | |||
.thumb_set FPU_IRQHandler,Default_Handler | |||
.weak DMA2_Channel1_IRQHandler | |||
.thumb_set DMA2_Channel1_IRQHandler,Default_Handler | |||
.weak DMA2_Channel2_IRQHandler | |||
.thumb_set DMA2_Channel2_IRQHandler,Default_Handler | |||
.weak DMA2_Channel3_IRQHandler | |||
.thumb_set DMA2_Channel3_IRQHandler,Default_Handler | |||
.weak DMA2_Channel4_IRQHandler | |||
.thumb_set DMA2_Channel4_IRQHandler,Default_Handler | |||
.weak DMA2_Channel5_IRQHandler | |||
.thumb_set DMA2_Channel5_IRQHandler,Default_Handler | |||
.weak DMA2_Channel6_IRQHandler | |||
.thumb_set DMA2_Channel6_IRQHandler,Default_Handler | |||
.weak DMA2_Channel7_IRQHandler | |||
.thumb_set DMA2_Channel7_IRQHandler,Default_Handler | |||
.weak DMAMUX1_OVR_IRQHandler | |||
.thumb_set DMAMUX1_OVR_IRQHandler,Default_Handler | |||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
@@ -0,0 +1,388 @@ | |||
/** | |||
****************************************************************************** | |||
* @file startup_stm32wb50xx_cm4.s | |||
* @author MCD Application Team | |||
* @brief STM32WB50xx devices vector table GCC toolchain. | |||
* This module performs: | |||
* - Set the initial SP | |||
* - Set the initial PC == Reset_Handler, | |||
* - Set the vector table entries with the exceptions ISR address | |||
* - Branches to main in the C library (which eventually | |||
* calls main()). | |||
* After Reset the Cortex-M4 processor is in Thread mode, | |||
* priority is Privileged, and the Stack is set to Main. | |||
****************************************************************************** | |||
* @attention | |||
* | |||
* <h2><center>© Copyright (c) 2019 STMicroelectronics. | |||
* All rights reserved.</center></h2> | |||
* | |||
* This software component is licensed by ST under BSD 3-Clause license, | |||
* the "License"; You may not use this file except in compliance with the | |||
* License. You may obtain a copy of the License at: | |||
* opensource.org/licenses/BSD-3-Clause | |||
* | |||
****************************************************************************** | |||
*/ | |||
.syntax unified | |||
.cpu cortex-m4 | |||
.fpu softvfp | |||
.thumb | |||
.global g_pfnVectors | |||
.global Default_Handler | |||
/* start address for the initialization values of the .data section. | |||
defined in linker script */ | |||
.word _sidata | |||
/* start address for the .data section. defined in linker script */ | |||
.word _sdata | |||
/* end address for the .data section. defined in linker script */ | |||
.word _edata | |||
/* start address for the .bss section. defined in linker script */ | |||
.word _sbss | |||
/* end address for the .bss section. defined in linker script */ | |||
.word _ebss | |||
/* start address for the .MB_MEM2 section. defined in linker script */ | |||
.word _sMB_MEM2 | |||
/* end address for the .MB_MEM2 section. defined in linker script */ | |||
.word _eMB_MEM2 | |||
/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */ | |||
.macro INIT_BSS start, end | |||
ldr r0, =\start | |||
ldr r1, =\end | |||
movs r3, #0 | |||
bl LoopFillZerobss | |||
.endm | |||
/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */ | |||
.macro INIT_DATA start, end, src | |||
ldr r0, =\start | |||
ldr r1, =\end | |||
ldr r2, =\src | |||
movs r3, #0 | |||
bl LoopCopyDataInit | |||
.endm | |||
.section .text.data_initializers | |||
CopyDataInit: | |||
ldr r4, [r2, r3] | |||
str r4, [r0, r3] | |||
adds r3, r3, #4 | |||
LoopCopyDataInit: | |||
adds r4, r0, r3 | |||
cmp r4, r1 | |||
bcc CopyDataInit | |||
bx lr | |||
FillZerobss: | |||
str r3, [r0] | |||
adds r0, r0, #4 | |||
LoopFillZerobss: | |||
cmp r0, r1 | |||
bcc FillZerobss | |||
bx lr | |||
.section .text.Reset_Handler | |||
.weak Reset_Handler | |||
.type Reset_Handler, %function | |||
Reset_Handler: | |||
ldr r0, =_estack | |||
mov sp, r0 /* set stack pointer */ | |||
/* Copy the data segment initializers from flash to SRAM */ | |||
INIT_DATA _sdata, _edata, _sidata | |||
/* Zero fill the bss segments. */ | |||
INIT_BSS _sbss, _ebss | |||
INIT_BSS _sMB_MEM2, _eMB_MEM2 | |||
/* Call the clock system intitialization function.*/ | |||
bl SystemInit | |||
/* Call static constructors */ | |||
bl __libc_init_array | |||
/* Call the application s entry point.*/ | |||
bl main | |||
LoopForever: | |||
b LoopForever | |||
.size Reset_Handler, .-Reset_Handler | |||
/** | |||
* @brief This is the code that gets called when the processor receives an | |||
* unexpected interrupt. This simply enters an infinite loop, preserving | |||
* the system state for examination by a debugger. | |||
* | |||
* @param None | |||
* @retval None | |||
*/ | |||
.section .text.Default_Handler,"ax",%progbits | |||
Default_Handler: | |||
Infinite_Loop: | |||
b Infinite_Loop | |||
.size Default_Handler, .-Default_Handler | |||
/****************************************************************************** | |||
* | |||
* The minimal vector table for a Cortex-M4. Note that the proper constructs | |||
* must be placed on this to ensure that it ends up at physical address | |||
* 0x0000.0000. | |||
* | |||
******************************************************************************/ | |||
.section .isr_vector,"a",%progbits | |||
.type g_pfnVectors, %object | |||
.size g_pfnVectors, .-g_pfnVectors | |||
g_pfnVectors: | |||
.word _estack | |||
.word Reset_Handler | |||
.word NMI_Handler | |||
.word HardFault_Handler | |||
.word MemManage_Handler | |||
.word BusFault_Handler | |||
.word UsageFault_Handler | |||
.word 0 | |||
.word 0 | |||
.word 0 | |||
.word 0 | |||
.word SVC_Handler | |||
.word DebugMon_Handler | |||
.word 0 | |||
.word PendSV_Handler | |||
.word SysTick_Handler | |||
.word WWDG_IRQHandler | |||
.word PVD_PVM_IRQHandler | |||
.word TAMP_STAMP_LSECSS_IRQHandler | |||
.word RTC_WKUP_IRQHandler | |||
.word FLASH_IRQHandler | |||
.word RCC_IRQHandler | |||
.word EXTI0_IRQHandler | |||
.word EXTI1_IRQHandler | |||
.word EXTI2_IRQHandler | |||
.word EXTI3_IRQHandler | |||
.word EXTI4_IRQHandler | |||
.word DMA1_Channel1_IRQHandler | |||
.word DMA1_Channel2_IRQHandler | |||
.word DMA1_Channel3_IRQHandler | |||
.word DMA1_Channel4_IRQHandler | |||
.word DMA1_Channel5_IRQHandler | |||
.word DMA1_Channel6_IRQHandler | |||
.word DMA1_Channel7_IRQHandler | |||
.word ADC1_IRQHandler | |||
.word 0 | |||
.word 0 | |||
.word C2SEV_PWR_C2H_IRQHandler | |||
.word 0 | |||
.word EXTI9_5_IRQHandler | |||
.word TIM1_BRK_IRQHandler | |||
.word TIM1_UP_TIM16_IRQHandler | |||
.word TIM1_TRG_COM_TIM17_IRQHandler | |||
.word TIM1_CC_IRQHandler | |||
.word TIM2_IRQHandler | |||
.word PKA_IRQHandler | |||
.word I2C1_EV_IRQHandler | |||
.word I2C1_ER_IRQHandler | |||
.word 0 | |||
.word 0 | |||
.word SPI1_IRQHandler | |||
.word 0 | |||
.word USART1_IRQHandler | |||
.word LPUART1_IRQHandler | |||
.word 0 | |||
.word TSC_IRQHandler | |||
.word EXTI15_10_IRQHandler | |||
.word RTC_Alarm_IRQHandler | |||
.word 0 | |||
.word PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler | |||
.word IPCC_C1_RX_IRQHandler | |||
.word IPCC_C1_TX_IRQHandler | |||
.word HSEM_IRQHandler | |||
.word LPTIM1_IRQHandler | |||
.word LPTIM2_IRQHandler | |||
.word 0 | |||
.word 0 | |||
.word 0 | |||
.word AES2_IRQHandler | |||
.word RNG_IRQHandler | |||
.word FPU_IRQHandler | |||
.word 0 | |||
.word 0 | |||
.word 0 | |||
.word 0 | |||
.word 0 | |||
.word 0 | |||
.word 0 | |||
.word DMAMUX1_OVR_IRQHandler | |||
/******************************************************************************* | |||
* | |||
* Provide weak aliases for each Exception handler to the Default_Handler. | |||
* As they are weak aliases, any function with the same name will override | |||
* this definition. | |||
* | |||
*******************************************************************************/ | |||
.weak NMI_Handler | |||
.thumb_set NMI_Handler,Default_Handler | |||
.weak HardFault_Handler | |||
.thumb_set HardFault_Handler,Default_Handler | |||
.weak MemManage_Handler | |||
.thumb_set MemManage_Handler,Default_Handler | |||
.weak BusFault_Handler | |||
.thumb_set BusFault_Handler,Default_Handler | |||
.weak UsageFault_Handler | |||
.thumb_set UsageFault_Handler,Default_Handler | |||
.weak SVC_Handler | |||
.thumb_set SVC_Handler,Default_Handler | |||
.weak DebugMon_Handler | |||
.thumb_set DebugMon_Handler,Default_Handler | |||
.weak PendSV_Handler | |||
.thumb_set PendSV_Handler,Default_Handler | |||
.weak SysTick_Handler | |||
.thumb_set SysTick_Handler,Default_Handler | |||
.weak WWDG_IRQHandler | |||
.thumb_set WWDG_IRQHandler,Default_Handler | |||
.weak PVD_PVM_IRQHandler | |||
.thumb_set PVD_PVM_IRQHandler,Default_Handler | |||
.weak TAMP_STAMP_LSECSS_IRQHandler | |||
.thumb_set TAMP_STAMP_LSECSS_IRQHandler,Default_Handler | |||
.weak RTC_WKUP_IRQHandler | |||
.thumb_set RTC_WKUP_IRQHandler,Default_Handler | |||
.weak FLASH_IRQHandler | |||
.thumb_set FLASH_IRQHandler,Default_Handler | |||
.weak RCC_IRQHandler | |||
.thumb_set RCC_IRQHandler,Default_Handler | |||
.weak EXTI0_IRQHandler | |||
.thumb_set EXTI0_IRQHandler,Default_Handler | |||
.weak EXTI1_IRQHandler | |||
.thumb_set EXTI1_IRQHandler,Default_Handler | |||
.weak EXTI2_IRQHandler | |||
.thumb_set EXTI2_IRQHandler,Default_Handler | |||
.weak EXTI3_IRQHandler | |||
.thumb_set EXTI3_IRQHandler,Default_Handler | |||
.weak EXTI4_IRQHandler | |||
.thumb_set EXTI4_IRQHandler,Default_Handler | |||
.weak DMA1_Channel1_IRQHandler | |||
.thumb_set DMA1_Channel1_IRQHandler,Default_Handler | |||
.weak DMA1_Channel2_IRQHandler | |||
.thumb_set DMA1_Channel2_IRQHandler,Default_Handler | |||
.weak DMA1_Channel3_IRQHandler | |||
.thumb_set DMA1_Channel3_IRQHandler,Default_Handler | |||
.weak DMA1_Channel4_IRQHandler | |||
.thumb_set DMA1_Channel4_IRQHandler,Default_Handler | |||
.weak DMA1_Channel5_IRQHandler | |||
.thumb_set DMA1_Channel5_IRQHandler,Default_Handler | |||
.weak DMA1_Channel6_IRQHandler | |||
.thumb_set DMA1_Channel6_IRQHandler,Default_Handler | |||
.weak DMA1_Channel7_IRQHandler | |||
.thumb_set DMA1_Channel7_IRQHandler,Default_Handler | |||
.weak ADC1_IRQHandler | |||
.thumb_set ADC1_IRQHandler,Default_Handler | |||
.weak C2SEV_PWR_C2H_IRQHandler | |||
.thumb_set C2SEV_PWR_C2H_IRQHandler,Default_Handler | |||
.weak EXTI9_5_IRQHandler | |||
.thumb_set EXTI9_5_IRQHandler,Default_Handler | |||
.weak TIM1_BRK_IRQHandler | |||
.thumb_set TIM1_BRK_IRQHandler,Default_Handler | |||
.weak TIM1_UP_TIM16_IRQHandler | |||
.thumb_set TIM1_UP_TIM16_IRQHandler,Default_Handler | |||
.weak TIM1_TRG_COM_TIM17_IRQHandler | |||
.thumb_set TIM1_TRG_COM_TIM17_IRQHandler,Default_Handler | |||
.weak TIM1_CC_IRQHandler | |||
.thumb_set TIM1_CC_IRQHandler,Default_Handler | |||
.weak TIM2_IRQHandler | |||
.thumb_set TIM2_IRQHandler,Default_Handler | |||
.weak PKA_IRQHandler | |||
.thumb_set PKA_IRQHandler,Default_Handler | |||
.weak I2C1_EV_IRQHandler | |||
.thumb_set I2C1_EV_IRQHandler,Default_Handler | |||
.weak I2C1_ER_IRQHandler | |||
.thumb_set I2C1_ER_IRQHandler,Default_Handler | |||
.weak SPI1_IRQHandler | |||
.thumb_set SPI1_IRQHandler,Default_Handler | |||
.weak USART1_IRQHandler | |||
.thumb_set USART1_IRQHandler,Default_Handler | |||
.weak TSC_IRQHandler | |||
.thumb_set TSC_IRQHandler,Default_Handler | |||
.weak EXTI15_10_IRQHandler | |||
.thumb_set EXTI15_10_IRQHandler,Default_Handler | |||
.weak RTC_Alarm_IRQHandler | |||
.thumb_set RTC_Alarm_IRQHandler,Default_Handler | |||
.weak PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler | |||
.thumb_set PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler,Default_Handler | |||
.weak IPCC_C1_RX_IRQHandler | |||
.thumb_set IPCC_C1_RX_IRQHandler,Default_Handler | |||
.weak IPCC_C1_TX_IRQHandler | |||
.thumb_set IPCC_C1_TX_IRQHandler,Default_Handler | |||
.weak HSEM_IRQHandler | |||
.thumb_set HSEM_IRQHandler,Default_Handler | |||
.weak LPTIM1_IRQHandler | |||
.thumb_set LPTIM1_IRQHandler,Default_Handler | |||
.weak LPTIM2_IRQHandler | |||
.thumb_set LPTIM2_IRQHandler,Default_Handler | |||
.weak AES2_IRQHandler | |||
.thumb_set AES2_IRQHandler,Default_Handler | |||
.weak RNG_IRQHandler | |||
.thumb_set RNG_IRQHandler,Default_Handler | |||
.weak FPU_IRQHandler | |||
.thumb_set FPU_IRQHandler,Default_Handler | |||
.weak DMAMUX1_OVR_IRQHandler | |||
.thumb_set DMAMUX1_OVR_IRQHandler,Default_Handler | |||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
@@ -44,21 +44,29 @@ defined in linker script */ | |||
.word _sbss | |||
/* end address for the .bss section. defined in linker script */ | |||
.word _ebss | |||
.section .text.Reset_Handler | |||
.weak Reset_Handler | |||
.type Reset_Handler, %function | |||
Reset_Handler: | |||
ldr r0, =_estack | |||
mov sp, r0 /* set stack pointer */ | |||
/* Copy the data segment initializers from flash to SRAM */ | |||
ldr r0, =_sdata | |||
ldr r1, =_edata | |||
ldr r2, =_sidata | |||
/* start address for the .MB_MEM2 section. defined in linker script */ | |||
.word _sMB_MEM2 | |||
/* end address for the .MB_MEM2 section. defined in linker script */ | |||
.word _eMB_MEM2 | |||
/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */ | |||
.macro INIT_BSS start, end | |||
ldr r0, =\start | |||
ldr r1, =\end | |||
movs r3, #0 | |||
b LoopCopyDataInit | |||
bl LoopFillZerobss | |||
.endm | |||
/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */ | |||
.macro INIT_DATA start, end, src | |||
ldr r0, =\start | |||
ldr r1, =\end | |||
ldr r2, =\src | |||
movs r3, #0 | |||
bl LoopCopyDataInit | |||
.endm | |||
.section .text.data_initializers | |||
CopyDataInit: | |||
ldr r4, [r2, r3] | |||
str r4, [r0, r3] | |||
@@ -67,21 +75,31 @@ CopyDataInit: | |||
LoopCopyDataInit: | |||
adds r4, r0, r3 | |||
cmp r4, r1 | |||
bcc CopyDataInit | |||
/* Zero fill the bss segment. */ | |||
ldr r2, =_sbss | |||
ldr r4, =_ebss | |||
movs r3, #0 | |||
b LoopFillZerobss | |||
bcc CopyDataInit | |||
bx lr | |||
FillZerobss: | |||
str r3, [r2] | |||
adds r2, r2, #4 | |||
str r3, [r0] | |||
adds r0, r0, #4 | |||
LoopFillZerobss: | |||
cmp r2, r4 | |||
cmp r0, r1 | |||
bcc FillZerobss | |||
bx lr | |||
.section .text.Reset_Handler | |||
.weak Reset_Handler | |||
.type Reset_Handler, %function | |||
Reset_Handler: | |||
ldr r0, =_estack | |||
mov sp, r0 /* set stack pointer */ | |||
/* Copy the data segment initializers from flash to SRAM */ | |||
INIT_DATA _sdata, _edata, _sidata | |||
/* Zero fill the bss segments. */ | |||
INIT_BSS _sbss, _ebss | |||
INIT_BSS _sMB_MEM2, _eMB_MEM2 | |||
/* Call the clock system intitialization function.*/ | |||
bl SystemInit | |||
@@ -0,0 +1,445 @@ | |||
/** | |||
****************************************************************************** | |||
* @file startup_stm32wb5mxx_cm4.s | |||
* @author MCD Application Team | |||
* @brief STM32WB5Mxx devices vector table GCC toolchain. | |||
* This module performs: | |||
* - Set the initial SP | |||
* - Set the initial PC == Reset_Handler, | |||
* - Set the vector table entries with the exceptions ISR address | |||
* - Branches to main in the C library (which eventually | |||
* calls main()). | |||
* After Reset the Cortex-M4 processor is in Thread mode, | |||
* priority is Privileged, and the Stack is set to Main. | |||
****************************************************************************** | |||
* @attention | |||
* | |||
* <h2><center>© Copyright (c) 2019 STMicroelectronics. | |||
* All rights reserved.</center></h2> | |||
* | |||
* This software component is licensed by ST under BSD 3-Clause license, | |||
* the "License"; You may not use this file except in compliance with the | |||
* License. You may obtain a copy of the License at: | |||
* opensource.org/licenses/BSD-3-Clause | |||
* | |||
****************************************************************************** | |||
*/ | |||
.syntax unified | |||
.cpu cortex-m4 | |||
.fpu softvfp | |||
.thumb | |||
.global g_pfnVectors | |||
.global Default_Handler | |||
/* start address for the initialization values of the .data section. | |||
defined in linker script */ | |||
.word _sidata | |||
/* start address for the .data section. defined in linker script */ | |||
.word _sdata | |||
/* end address for the .data section. defined in linker script */ | |||
.word _edata | |||
/* start address for the .bss section. defined in linker script */ | |||
.word _sbss | |||
/* end address for the .bss section. defined in linker script */ | |||
.word _ebss | |||
/* start address for the .MB_MEM2 section. defined in linker script */ | |||
.word _sMB_MEM2 | |||
/* end address for the .MB_MEM2 section. defined in linker script */ | |||
.word _eMB_MEM2 | |||
/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */ | |||
.macro INIT_BSS start, end | |||
ldr r0, =\start | |||
ldr r1, =\end | |||
movs r3, #0 | |||
bl LoopFillZerobss | |||
.endm | |||
/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */ | |||
.macro INIT_DATA start, end, src | |||
ldr r0, =\start | |||
ldr r1, =\end | |||
ldr r2, =\src | |||
movs r3, #0 | |||
bl LoopCopyDataInit | |||
.endm | |||
.section .text.data_initializers | |||
CopyDataInit: | |||
ldr r4, [r2, r3] | |||
str r4, [r0, r3] | |||
adds r3, r3, #4 | |||
LoopCopyDataInit: | |||
adds r4, r0, r3 | |||
cmp r4, r1 | |||
bcc CopyDataInit | |||
bx lr | |||
FillZerobss: | |||
str r3, [r0] | |||
adds r0, r0, #4 | |||
LoopFillZerobss: | |||
cmp r0, r1 | |||
bcc FillZerobss | |||
bx lr | |||
.section .text.Reset_Handler | |||
.weak Reset_Handler | |||
.type Reset_Handler, %function | |||
Reset_Handler: | |||
ldr r0, =_estack | |||
mov sp, r0 /* set stack pointer */ | |||
/* Copy the data segment initializers from flash to SRAM */ | |||
INIT_DATA _sdata, _edata, _sidata | |||
/* Zero fill the bss segments. */ | |||
INIT_BSS _sbss, _ebss | |||
INIT_BSS _sMB_MEM2, _eMB_MEM2 | |||
/* Call the clock system intitialization function.*/ | |||
bl SystemInit | |||
/* Call static constructors */ | |||
bl __libc_init_array | |||
/* Call the application s entry point.*/ | |||
bl main | |||
LoopForever: | |||
b LoopForever | |||
.size Reset_Handler, .-Reset_Handler | |||
/** | |||
* @brief This is the code that gets called when the processor receives an | |||
* unexpected interrupt. This simply enters an infinite loop, preserving | |||
* the system state for examination by a debugger. | |||
* | |||
* @param None | |||
* @retval None | |||
*/ | |||
.section .text.Default_Handler,"ax",%progbits | |||
Default_Handler: | |||
Infinite_Loop: | |||
b Infinite_Loop | |||
.size Default_Handler, .-Default_Handler | |||
/****************************************************************************** | |||
* | |||
* The minimal vector table for a Cortex-M4. Note that the proper constructs | |||
* must be placed on this to ensure that it ends up at physical address | |||
* 0x0000.0000. | |||
* | |||
******************************************************************************/ | |||
.section .isr_vector,"a",%progbits | |||
.type g_pfnVectors, %object | |||
.size g_pfnVectors, .-g_pfnVectors | |||
g_pfnVectors: | |||
.word _estack | |||
.word Reset_Handler | |||
.word NMI_Handler | |||
.word HardFault_Handler | |||
.word MemManage_Handler | |||
.word BusFault_Handler | |||
.word UsageFault_Handler | |||
.word 0 | |||
.word 0 | |||
.word 0 | |||
.word 0 | |||
.word SVC_Handler | |||
.word DebugMon_Handler | |||
.word 0 | |||
.word PendSV_Handler | |||
.word SysTick_Handler | |||
.word WWDG_IRQHandler | |||
.word PVD_PVM_IRQHandler | |||
.word TAMP_STAMP_LSECSS_IRQHandler | |||
.word RTC_WKUP_IRQHandler | |||
.word FLASH_IRQHandler | |||
.word RCC_IRQHandler | |||
.word EXTI0_IRQHandler | |||
.word EXTI1_IRQHandler | |||
.word EXTI2_IRQHandler | |||
.word EXTI3_IRQHandler | |||
.word EXTI4_IRQHandler | |||
.word DMA1_Channel1_IRQHandler | |||
.word DMA1_Channel2_IRQHandler | |||
.word DMA1_Channel3_IRQHandler | |||
.word DMA1_Channel4_IRQHandler | |||
.word DMA1_Channel5_IRQHandler | |||
.word DMA1_Channel6_IRQHandler | |||
.word DMA1_Channel7_IRQHandler | |||
.word ADC1_IRQHandler | |||
.word USB_HP_IRQHandler | |||
.word USB_LP_IRQHandler | |||
.word C2SEV_PWR_C2H_IRQHandler | |||
.word COMP_IRQHandler | |||
.word EXTI9_5_IRQHandler | |||
.word TIM1_BRK_IRQHandler | |||
.word TIM1_UP_TIM16_IRQHandler | |||
.word TIM1_TRG_COM_TIM17_IRQHandler | |||
.word TIM1_CC_IRQHandler | |||
.word TIM2_IRQHandler | |||
.word PKA_IRQHandler | |||
.word I2C1_EV_IRQHandler | |||
.word I2C1_ER_IRQHandler | |||
.word I2C3_EV_IRQHandler | |||
.word I2C3_ER_IRQHandler | |||
.word SPI1_IRQHandler | |||
.word SPI2_IRQHandler | |||
.word USART1_IRQHandler | |||
.word LPUART1_IRQHandler | |||
.word SAI1_IRQHandler | |||
.word TSC_IRQHandler | |||
.word EXTI15_10_IRQHandler | |||
.word RTC_Alarm_IRQHandler | |||
.word CRS_IRQHandler | |||
.word PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler | |||
.word IPCC_C1_RX_IRQHandler | |||
.word IPCC_C1_TX_IRQHandler | |||
.word HSEM_IRQHandler | |||
.word LPTIM1_IRQHandler | |||
.word LPTIM2_IRQHandler | |||
.word LCD_IRQHandler | |||
.word QUADSPI_IRQHandler | |||
.word AES1_IRQHandler | |||
.word AES2_IRQHandler | |||
.word RNG_IRQHandler | |||
.word FPU_IRQHandler | |||
.word DMA2_Channel1_IRQHandler | |||
.word DMA2_Channel2_IRQHandler | |||
.word DMA2_Channel3_IRQHandler | |||
.word DMA2_Channel4_IRQHandler | |||
.word DMA2_Channel5_IRQHandler | |||
.word DMA2_Channel6_IRQHandler | |||
.word DMA2_Channel7_IRQHandler | |||
.word DMAMUX1_OVR_IRQHandler | |||
/******************************************************************************* | |||
* | |||
* Provide weak aliases for each Exception handler to the Default_Handler. | |||
* As they are weak aliases, any function with the same name will override | |||
* this definition. | |||
* | |||
*******************************************************************************/ | |||
.weak NMI_Handler | |||
.thumb_set NMI_Handler,Default_Handler | |||
.weak HardFault_Handler | |||
.thumb_set HardFault_Handler,Default_Handler | |||
.weak MemManage_Handler | |||
.thumb_set MemManage_Handler,Default_Handler | |||
.weak BusFault_Handler | |||
.thumb_set BusFault_Handler,Default_Handler | |||
.weak UsageFault_Handler | |||
.thumb_set UsageFault_Handler,Default_Handler | |||
.weak SVC_Handler | |||
.thumb_set SVC_Handler,Default_Handler | |||
.weak DebugMon_Handler | |||
.thumb_set DebugMon_Handler,Default_Handler | |||
.weak PendSV_Handler | |||
.thumb_set PendSV_Handler,Default_Handler | |||
.weak SysTick_Handler | |||
.thumb_set SysTick_Handler,Default_Handler | |||
.weak WWDG_IRQHandler | |||
.thumb_set WWDG_IRQHandler,Default_Handler | |||
.weak PVD_PVM_IRQHandler | |||
.thumb_set PVD_PVM_IRQHandler,Default_Handler | |||
.weak TAMP_STAMP_LSECSS_IRQHandler | |||
.thumb_set TAMP_STAMP_LSECSS_IRQHandler,Default_Handler | |||
.weak RTC_WKUP_IRQHandler | |||
.thumb_set RTC_WKUP_IRQHandler,Default_Handler | |||
.weak FLASH_IRQHandler | |||
.thumb_set FLASH_IRQHandler,Default_Handler | |||
.weak RCC_IRQHandler | |||
.thumb_set RCC_IRQHandler,Default_Handler | |||
.weak EXTI0_IRQHandler | |||
.thumb_set EXTI0_IRQHandler,Default_Handler | |||
.weak EXTI1_IRQHandler | |||
.thumb_set EXTI1_IRQHandler,Default_Handler | |||
.weak EXTI2_IRQHandler | |||
.thumb_set EXTI2_IRQHandler,Default_Handler | |||
.weak EXTI3_IRQHandler | |||
.thumb_set EXTI3_IRQHandler,Default_Handler | |||
.weak EXTI4_IRQHandler | |||
.thumb_set EXTI4_IRQHandler,Default_Handler | |||
.weak DMA1_Channel1_IRQHandler | |||
.thumb_set DMA1_Channel1_IRQHandler,Default_Handler | |||
.weak DMA1_Channel2_IRQHandler | |||
.thumb_set DMA1_Channel2_IRQHandler,Default_Handler | |||
.weak DMA1_Channel3_IRQHandler | |||
.thumb_set DMA1_Channel3_IRQHandler,Default_Handler | |||
.weak DMA1_Channel4_IRQHandler | |||
.thumb_set DMA1_Channel4_IRQHandler,Default_Handler | |||
.weak DMA1_Channel5_IRQHandler | |||
.thumb_set DMA1_Channel5_IRQHandler,Default_Handler | |||
.weak DMA1_Channel6_IRQHandler | |||
.thumb_set DMA1_Channel6_IRQHandler,Default_Handler | |||
.weak DMA1_Channel7_IRQHandler | |||
.thumb_set DMA1_Channel7_IRQHandler,Default_Handler | |||
.weak ADC1_IRQHandler | |||
.thumb_set ADC1_IRQHandler,Default_Handler | |||
.weak USB_HP_IRQHandler | |||
.thumb_set USB_HP_IRQHandler,Default_Handler | |||
.weak USB_LP_IRQHandler | |||
.thumb_set USB_LP_IRQHandler,Default_Handler | |||
.weak C2SEV_PWR_C2H_IRQHandler | |||
.thumb_set C2SEV_PWR_C2H_IRQHandler,Default_Handler | |||
.weak COMP_IRQHandler | |||
.thumb_set COMP_IRQHandler,Default_Handler | |||
.weak EXTI9_5_IRQHandler | |||
.thumb_set EXTI9_5_IRQHandler,Default_Handler | |||
.weak TIM1_BRK_IRQHandler | |||
.thumb_set TIM1_BRK_IRQHandler,Default_Handler | |||
.weak TIM1_UP_TIM16_IRQHandler | |||
.thumb_set TIM1_UP_TIM16_IRQHandler,Default_Handler | |||
.weak TIM1_TRG_COM_TIM17_IRQHandler | |||
.thumb_set TIM1_TRG_COM_TIM17_IRQHandler,Default_Handler | |||
.weak TIM1_CC_IRQHandler | |||
.thumb_set TIM1_CC_IRQHandler,Default_Handler | |||
.weak TIM2_IRQHandler | |||
.thumb_set TIM2_IRQHandler,Default_Handler | |||
.weak PKA_IRQHandler | |||
.thumb_set PKA_IRQHandler,Default_Handler | |||
.weak I2C1_EV_IRQHandler | |||
.thumb_set I2C1_EV_IRQHandler,Default_Handler | |||
.weak I2C1_ER_IRQHandler | |||
.thumb_set I2C1_ER_IRQHandler,Default_Handler | |||
.weak I2C3_EV_IRQHandler | |||
.thumb_set I2C3_EV_IRQHandler,Default_Handler | |||
.weak I2C3_ER_IRQHandler | |||
.thumb_set I2C3_ER_IRQHandler,Default_Handler | |||
.weak SPI1_IRQHandler | |||
.thumb_set SPI1_IRQHandler,Default_Handler | |||
.weak SPI2_IRQHandler | |||
.thumb_set SPI2_IRQHandler,Default_Handler | |||
.weak USART1_IRQHandler | |||
.thumb_set USART1_IRQHandler,Default_Handler | |||
.weak LPUART1_IRQHandler | |||
.thumb_set LPUART1_IRQHandler,Default_Handler | |||
.weak SAI1_IRQHandler | |||
.thumb_set SAI1_IRQHandler,Default_Handler | |||
.weak TSC_IRQHandler | |||
.thumb_set TSC_IRQHandler,Default_Handler | |||
.weak EXTI15_10_IRQHandler | |||
.thumb_set EXTI15_10_IRQHandler,Default_Handler | |||
.weak RTC_Alarm_IRQHandler | |||
.thumb_set RTC_Alarm_IRQHandler,Default_Handler | |||
.weak CRS_IRQHandler | |||
.thumb_set CRS_IRQHandler,Default_Handler | |||
.weak PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler | |||
.thumb_set PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler,Default_Handler | |||
.weak IPCC_C1_RX_IRQHandler | |||
.thumb_set IPCC_C1_RX_IRQHandler,Default_Handler | |||
.weak IPCC_C1_TX_IRQHandler | |||
.thumb_set IPCC_C1_TX_IRQHandler,Default_Handler | |||
.weak HSEM_IRQHandler | |||
.thumb_set HSEM_IRQHandler,Default_Handler | |||
.weak LPTIM1_IRQHandler | |||
.thumb_set LPTIM1_IRQHandler,Default_Handler | |||
.weak LPTIM2_IRQHandler | |||
.thumb_set LPTIM2_IRQHandler,Default_Handler | |||
.weak LCD_IRQHandler | |||
.thumb_set LCD_IRQHandler,Default_Handler | |||
.weak QUADSPI_IRQHandler | |||
.thumb_set QUADSPI_IRQHandler,Default_Handler | |||
.weak AES1_IRQHandler | |||
.thumb_set AES1_IRQHandler,Default_Handler | |||
.weak AES2_IRQHandler | |||
.thumb_set AES2_IRQHandler,Default_Handler | |||
.weak RNG_IRQHandler | |||
.thumb_set RNG_IRQHandler,Default_Handler | |||
.weak FPU_IRQHandler | |||
.thumb_set FPU_IRQHandler,Default_Handler | |||
.weak DMA2_Channel1_IRQHandler | |||
.thumb_set DMA2_Channel1_IRQHandler,Default_Handler | |||
.weak DMA2_Channel2_IRQHandler | |||
.thumb_set DMA2_Channel2_IRQHandler,Default_Handler | |||
.weak DMA2_Channel3_IRQHandler | |||
.thumb_set DMA2_Channel3_IRQHandler,Default_Handler | |||
.weak DMA2_Channel4_IRQHandler | |||
.thumb_set DMA2_Channel4_IRQHandler,Default_Handler | |||
.weak DMA2_Channel5_IRQHandler | |||
.thumb_set DMA2_Channel5_IRQHandler,Default_Handler | |||
.weak DMA2_Channel6_IRQHandler | |||
.thumb_set DMA2_Channel6_IRQHandler,Default_Handler | |||
.weak DMA2_Channel7_IRQHandler | |||
.thumb_set DMA2_Channel7_IRQHandler,Default_Handler | |||
.weak DMAMUX1_OVR_IRQHandler | |||
.thumb_set DMAMUX1_OVR_IRQHandler,Default_Handler | |||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
@@ -0,0 +1,422 @@ | |||
;****************************************************************************** | |||
;* File Name : startup_stm32wb30xx_cm4.s | |||
;* Author : MCD Application Team | |||
;* Description : M4 core vector table of the STM32WB30xx devices for the | |||
;* IAR (EWARM) toolchain. | |||
;* | |||
;* This module performs: | |||
;* - Set the initial SP | |||
;* - Set the initial PC == _iar_program_start, | |||
;* - Set the vector table entries with the exceptions ISR | |||
;* address. | |||
;* - Branches to main in the C library (which eventually | |||
;* calls main()). | |||
;* After Reset the Cortex-M4 processor is in Thread mode, | |||
;* priority is Privileged, and the Stack is set to Main. | |||
;****************************************************************************** | |||
;* @attention | |||
;* | |||
;* <h2><center>© Copyright (c) 2019 STMicroelectronics. | |||
;* All rights reserved.</center></h2> | |||
;* | |||
;* This software component is licensed by ST under BSD 3-Clause license, | |||
;* the "License"; You may not use this file except in compliance with the | |||
;* License. You may obtain a copy of the License at: | |||
;* opensource.org/licenses/BSD-3-Clause | |||
;* | |||
;****************************************************************************** | |||
; | |||
; | |||
; The modules in this file are included in the libraries, and may be replaced | |||
; by any user-defined modules that define the PUBLIC symbol _program_start or | |||
; a user defined start symbol. | |||
; To override the cstartup defined in the library, simply add your modified | |||
; version to the workbench project. | |||
; | |||
; The vector table is normally located at address 0. | |||
; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. | |||
; The name "__vector_table" has special meaning for C-SPY: | |||
; it is where the SP start value is found, and the NVIC vector | |||
; table register (VTOR) is initialized to this address if != 0. | |||
; | |||
; Cortex-M version | |||
; | |||
MODULE ?cstartup | |||
;; Forward declaration of sections. | |||
SECTION CSTACK:DATA:NOROOT(3) | |||
SECTION .intvec:CODE:NOROOT(2) | |||
EXTERN __iar_program_start | |||
EXTERN SystemInit | |||
PUBLIC __vector_table | |||
DATA | |||
__vector_table | |||
DCD sfe(CSTACK) | |||
DCD Reset_Handler ; Reset Handler | |||
DCD NMI_Handler ; NMI Handler | |||
DCD HardFault_Handler ; Hard Fault Handler | |||
DCD MemManage_Handler ; MPU Fault Handler | |||
DCD BusFault_Handler ; Bus Fault Handler | |||
DCD UsageFault_Handler ; Usage Fault Handler | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD SVC_Handler ; SVCall Handler | |||
DCD DebugMon_Handler ; Debug Monitor Handler | |||
DCD 0 ; Reserved | |||
DCD PendSV_Handler ; PendSV Handler | |||
DCD SysTick_Handler ; SysTick Handler | |||
; External Interrupts | |||
DCD WWDG_IRQHandler ; Window WatchDog | |||
DCD PVD_PVM_IRQHandler ; PVD and PVM Interrupt | |||
DCD TAMP_STAMP_LSECSS_IRQHandler ; RTC Tamper, TimeStamp Interrupts and LSECSS Interrupts | |||
DCD RTC_WKUP_IRQHandler ; RTC Wakeup Interrupt | |||
DCD FLASH_IRQHandler ; FLASH global Interrupt | |||
DCD RCC_IRQHandler ; RCC Interrupt | |||
DCD EXTI0_IRQHandler ; EXTI Line 0 Interrupt | |||
DCD EXTI1_IRQHandler ; EXTI Line 1 Interrupt | |||
DCD EXTI2_IRQHandler ; EXTI Line 2 Interrupt | |||
DCD EXTI3_IRQHandler ; EXTI Line 3 Interrup | |||
DCD EXTI4_IRQHandler ; EXTI Line 4 Interrupt | |||
DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 Interrupt | |||
DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2 Interrupt | |||
DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3 Interrupt | |||
DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4 Interrupt | |||
DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5 Interrupt | |||
DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6 Interrupt | |||
DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7 Interrupt | |||
DCD ADC1_IRQHandler ; ADC1 Interrupt | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD C2SEV_PWR_C2H_IRQHandler ; CPU M0+ SEV Interrupt | |||
DCD 0 ; Reserved | |||
DCD EXTI9_5_IRQHandler ; EXTI Lines [9:5] Interrupt | |||
DCD TIM1_BRK_IRQHandler ; TIM1 Break Interrupt | |||
DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16 global Interrupts | |||
DCD TIM1_TRG_COM_TIM17_IRQHandler ; TIM1 Trigger and Communication and TIM17 global Interrupts | |||
DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare Interrupt | |||
DCD TIM2_IRQHandler ; TIM2 Global Interrupt | |||
DCD PKA_IRQHandler ; PKA Interrupt | |||
DCD I2C1_EV_IRQHandler ; I2C1 Event Interrupt | |||
DCD I2C1_ER_IRQHandler ; I2C1 Error Interrupt | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD SPI1_IRQHandler ; SPI1 Interrupt | |||
DCD 0 ; Reserved | |||
DCD USART1_IRQHandler ; USART1 Interrupt | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD TSC_IRQHandler ; TSC Interrupt | |||
DCD EXTI15_10_IRQHandler ; EXTI Lines1[15:10 ]Interrupts | |||
DCD RTC_Alarm_IRQHandler ; RTC Alarms (A and B) Interrupt | |||
DCD 0 ; Reserved | |||
DCD PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler ; WKUP Interrupt from PWR | |||
DCD IPCC_C1_RX_IRQHandler ; IPCC CPU1 RX occupied interrupt | |||
DCD IPCC_C1_TX_IRQHandler ; IPCC CPU1 RX free interrupt | |||
DCD HSEM_IRQHandler ; HSEM0 Interrupt | |||
DCD LPTIM1_IRQHandler ; LPTIM1 Interrupt | |||
DCD LPTIM2_IRQHandler ; LPTIM2 Interrupt | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD AES2_IRQHandler ; AES2 Interrupt | |||
DCD RNG_IRQHandler ; RNG1 Interrupt | |||
DCD FPU_IRQHandler ; FPU Interrupt | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD DMAMUX1_OVR_IRQHandler ; DMAMUX overrun Interrupt | |||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |||
;; | |||
;; Default interrupt handlers. | |||
;; | |||
THUMB | |||
PUBWEAK Reset_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(2) | |||
Reset_Handler | |||
LDR R0, =SystemInit | |||
BLX R0 | |||
LDR R0, =__iar_program_start | |||
BX R0 | |||
PUBWEAK NMI_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
NMI_Handler | |||
B NMI_Handler | |||
PUBWEAK HardFault_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
HardFault_Handler | |||
B HardFault_Handler | |||
PUBWEAK MemManage_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
MemManage_Handler | |||
B MemManage_Handler | |||
PUBWEAK BusFault_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
BusFault_Handler | |||
B BusFault_Handler | |||
PUBWEAK UsageFault_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
UsageFault_Handler | |||
B UsageFault_Handler | |||
PUBWEAK SVC_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
SVC_Handler | |||
B SVC_Handler | |||
PUBWEAK DebugMon_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DebugMon_Handler | |||
B DebugMon_Handler | |||
PUBWEAK PendSV_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
PendSV_Handler | |||
B PendSV_Handler | |||
PUBWEAK SysTick_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
SysTick_Handler | |||
B SysTick_Handler | |||
PUBWEAK WWDG_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
WWDG_IRQHandler | |||
B WWDG_IRQHandler | |||
PUBWEAK PVD_PVM_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
PVD_PVM_IRQHandler | |||
B PVD_PVM_IRQHandler | |||
PUBWEAK TAMP_STAMP_LSECSS_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TAMP_STAMP_LSECSS_IRQHandler | |||
B TAMP_STAMP_LSECSS_IRQHandler | |||
PUBWEAK RTC_WKUP_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
RTC_WKUP_IRQHandler | |||
B RTC_WKUP_IRQHandler | |||
PUBWEAK FLASH_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
FLASH_IRQHandler | |||
B FLASH_IRQHandler | |||
PUBWEAK RCC_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
RCC_IRQHandler | |||
B RCC_IRQHandler | |||
PUBWEAK EXTI0_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI0_IRQHandler | |||
B EXTI0_IRQHandler | |||
PUBWEAK EXTI1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI1_IRQHandler | |||
B EXTI1_IRQHandler | |||
PUBWEAK EXTI2_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI2_IRQHandler | |||
B EXTI2_IRQHandler | |||
PUBWEAK EXTI3_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI3_IRQHandler | |||
B EXTI3_IRQHandler | |||
PUBWEAK EXTI4_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI4_IRQHandler | |||
B EXTI4_IRQHandler | |||
PUBWEAK DMA1_Channel1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel1_IRQHandler | |||
B DMA1_Channel1_IRQHandler | |||
PUBWEAK DMA1_Channel2_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel2_IRQHandler | |||
B DMA1_Channel2_IRQHandler | |||
PUBWEAK DMA1_Channel3_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel3_IRQHandler | |||
B DMA1_Channel3_IRQHandler | |||
PUBWEAK DMA1_Channel4_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel4_IRQHandler | |||
B DMA1_Channel4_IRQHandler | |||
PUBWEAK DMA1_Channel5_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel5_IRQHandler | |||
B DMA1_Channel5_IRQHandler | |||
PUBWEAK DMA1_Channel6_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel6_IRQHandler | |||
B DMA1_Channel6_IRQHandler | |||
PUBWEAK DMA1_Channel7_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel7_IRQHandler | |||
B DMA1_Channel7_IRQHandler | |||
PUBWEAK ADC1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
ADC1_IRQHandler | |||
B ADC1_IRQHandler | |||
PUBWEAK C2SEV_PWR_C2H_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
C2SEV_PWR_C2H_IRQHandler | |||
B C2SEV_PWR_C2H_IRQHandler | |||
PUBWEAK EXTI9_5_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI9_5_IRQHandler | |||
B EXTI9_5_IRQHandler | |||
PUBWEAK TIM1_BRK_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TIM1_BRK_IRQHandler | |||
B TIM1_BRK_IRQHandler | |||
PUBWEAK TIM1_UP_TIM16_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TIM1_UP_TIM16_IRQHandler | |||
B TIM1_UP_TIM16_IRQHandler | |||
PUBWEAK TIM1_TRG_COM_TIM17_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TIM1_TRG_COM_TIM17_IRQHandler | |||
B TIM1_TRG_COM_TIM17_IRQHandler | |||
PUBWEAK TIM1_CC_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TIM1_CC_IRQHandler | |||
B TIM1_CC_IRQHandler | |||
PUBWEAK TIM2_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TIM2_IRQHandler | |||
B TIM2_IRQHandler | |||
PUBWEAK PKA_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
PKA_IRQHandler | |||
B PKA_IRQHandler | |||
PUBWEAK I2C1_EV_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
I2C1_EV_IRQHandler | |||
B I2C1_EV_IRQHandler | |||
PUBWEAK I2C1_ER_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
I2C1_ER_IRQHandler | |||
B I2C1_ER_IRQHandler | |||
PUBWEAK SPI1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
SPI1_IRQHandler | |||
B SPI1_IRQHandler | |||
PUBWEAK USART1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
USART1_IRQHandler | |||
B USART1_IRQHandler | |||
PUBWEAK TSC_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TSC_IRQHandler | |||
B TSC_IRQHandler | |||
PUBWEAK EXTI15_10_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI15_10_IRQHandler | |||
B EXTI15_10_IRQHandler | |||
PUBWEAK RTC_Alarm_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
RTC_Alarm_IRQHandler | |||
B RTC_Alarm_IRQHandler | |||
PUBWEAK PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler | |||
B PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler | |||
PUBWEAK IPCC_C1_RX_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
IPCC_C1_RX_IRQHandler | |||
B IPCC_C1_RX_IRQHandler | |||
PUBWEAK IPCC_C1_TX_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
IPCC_C1_TX_IRQHandler | |||
B IPCC_C1_TX_IRQHandler | |||
PUBWEAK HSEM_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
HSEM_IRQHandler | |||
B HSEM_IRQHandler | |||
PUBWEAK LPTIM1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
LPTIM1_IRQHandler | |||
B LPTIM1_IRQHandler | |||
PUBWEAK LPTIM2_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
LPTIM2_IRQHandler | |||
B LPTIM2_IRQHandler | |||
PUBWEAK AES2_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
AES2_IRQHandler | |||
B AES2_IRQHandler | |||
PUBWEAK RNG_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
RNG_IRQHandler | |||
B RNG_IRQHandler | |||
PUBWEAK FPU_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
FPU_IRQHandler | |||
B FPU_IRQHandler | |||
PUBWEAK DMAMUX1_OVR_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMAMUX1_OVR_IRQHandler | |||
B DMAMUX1_OVR_IRQHandler | |||
END | |||
;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** |
@@ -0,0 +1,507 @@ | |||
;****************************************************************************** | |||
;* File Name : startup_stm32wb35xx_cm4.s | |||
;* Author : MCD Application Team | |||
;* Description : M4 core vector table of the STM32WB35xx devices for the | |||
;* IAR (EWARM) toolchain. | |||
;* | |||
;* This module performs: | |||
;* - Set the initial SP | |||
;* - Set the initial PC == _iar_program_start, | |||
;* - Set the vector table entries with the exceptions ISR | |||
;* address. | |||
;* - Branches to main in the C library (which eventually | |||
;* calls main()). | |||
;* After Reset the Cortex-M4 processor is in Thread mode, | |||
;* priority is Privileged, and the Stack is set to Main. | |||
;****************************************************************************** | |||
;* @attention | |||
;* | |||
;* <h2><center>© Copyright (c) 2019 STMicroelectronics. | |||
;* All rights reserved.</center></h2> | |||
;* | |||
;* This software component is licensed by ST under BSD 3-Clause license, | |||
;* the "License"; You may not use this file except in compliance with the | |||
;* License. You may obtain a copy of the License at: | |||
;* opensource.org/licenses/BSD-3-Clause | |||
;* | |||
;****************************************************************************** | |||
; | |||
; | |||
; The modules in this file are included in the libraries, and may be replaced | |||
; by any user-defined modules that define the PUBLIC symbol _program_start or | |||
; a user defined start symbol. | |||
; To override the cstartup defined in the library, simply add your modified | |||
; version to the workbench project. | |||
; | |||
; The vector table is normally located at address 0. | |||
; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. | |||
; The name "__vector_table" has special meaning for C-SPY: | |||
; it is where the SP start value is found, and the NVIC vector | |||
; table register (VTOR) is initialized to this address if != 0. | |||
; | |||
; Cortex-M version | |||
; | |||
MODULE ?cstartup | |||
;; Forward declaration of sections. | |||
SECTION CSTACK:DATA:NOROOT(3) | |||
SECTION .intvec:CODE:NOROOT(2) | |||
EXTERN __iar_program_start | |||
EXTERN SystemInit | |||
PUBLIC __vector_table | |||
DATA | |||
__vector_table | |||
DCD sfe(CSTACK) | |||
DCD Reset_Handler ; Reset Handler | |||
DCD NMI_Handler ; NMI Handler | |||
DCD HardFault_Handler ; Hard Fault Handler | |||
DCD MemManage_Handler ; MPU Fault Handler | |||
DCD BusFault_Handler ; Bus Fault Handler | |||
DCD UsageFault_Handler ; Usage Fault Handler | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD SVC_Handler ; SVCall Handler | |||
DCD DebugMon_Handler ; Debug Monitor Handler | |||
DCD 0 ; Reserved | |||
DCD PendSV_Handler ; PendSV Handler | |||
DCD SysTick_Handler ; SysTick Handler | |||
; External Interrupts | |||
DCD WWDG_IRQHandler ; Window WatchDog | |||
DCD PVD_PVM_IRQHandler ; PVD and PVM Interrupt | |||
DCD TAMP_STAMP_LSECSS_IRQHandler ; RTC Tamper, TimeStamp Interrupts and LSECSS Interrupts | |||
DCD RTC_WKUP_IRQHandler ; RTC Wakeup Interrupt | |||
DCD FLASH_IRQHandler ; FLASH global Interrupt | |||
DCD RCC_IRQHandler ; RCC Interrupt | |||
DCD EXTI0_IRQHandler ; EXTI Line 0 Interrupt | |||
DCD EXTI1_IRQHandler ; EXTI Line 1 Interrupt | |||
DCD EXTI2_IRQHandler ; EXTI Line 2 Interrupt | |||
DCD EXTI3_IRQHandler ; EXTI Line 3 Interrup | |||
DCD EXTI4_IRQHandler ; EXTI Line 4 Interrupt | |||
DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 Interrupt | |||
DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2 Interrupt | |||
DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3 Interrupt | |||
DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4 Interrupt | |||
DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5 Interrupt | |||
DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6 Interrupt | |||
DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7 Interrupt | |||
DCD ADC1_IRQHandler ; ADC1 Interrupt | |||
DCD USB_HP_IRQHandler ; USB High Priority Interrupt | |||
DCD USB_LP_IRQHandler ; USB Low Priority Interrupt | |||
DCD C2SEV_PWR_C2H_IRQHandler ; CPU M0+ SEV Interrupt | |||
DCD COMP_IRQHandler ; COMP1 and COMP2 Interrupts | |||
DCD EXTI9_5_IRQHandler ; EXTI Lines [9:5] Interrupt | |||
DCD TIM1_BRK_IRQHandler ; TIM1 Break Interrupt | |||
DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16 global Interrupts | |||
DCD TIM1_TRG_COM_TIM17_IRQHandler ; TIM1 Trigger and Communication and TIM17 global Interrupts | |||
DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare Interrupt | |||
DCD TIM2_IRQHandler ; TIM2 Global Interrupt | |||
DCD PKA_IRQHandler ; PKA Interrupt | |||
DCD I2C1_EV_IRQHandler ; I2C1 Event Interrupt | |||
DCD I2C1_ER_IRQHandler ; I2C1 Error Interrupt | |||
DCD I2C3_EV_IRQHandler ; I2C3 Event Interrupt | |||
DCD I2C3_ER_IRQHandler ; I2C3 Error Interrupt | |||
DCD SPI1_IRQHandler ; SPI1 Interrupt | |||
DCD SPI2_IRQHandler ; SPI2 Interrupt | |||
DCD USART1_IRQHandler ; USART1 Interrupt | |||
DCD LPUART1_IRQHandler ; LPUART1 Interrupt | |||
DCD 0 ; Reserved | |||
DCD TSC_IRQHandler ; TSC Interrupt | |||
DCD EXTI15_10_IRQHandler ; EXTI Lines1[15:10 ]Interrupts | |||
DCD RTC_Alarm_IRQHandler ; RTC Alarms (A and B) Interrupt | |||
DCD CRS_IRQHandler ; CRS interrupt | |||
DCD PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler ; WKUP Interrupt from PWR | |||
DCD IPCC_C1_RX_IRQHandler ; IPCC CPU1 RX occupied interrupt | |||
DCD IPCC_C1_TX_IRQHandler ; IPCC CPU1 RX free interrupt | |||
DCD HSEM_IRQHandler ; HSEM0 Interrupt | |||
DCD LPTIM1_IRQHandler ; LPTIM1 Interrupt | |||
DCD LPTIM2_IRQHandler ; LPTIM2 Interrupt | |||
DCD 0 ; Reserved | |||
DCD QUADSPI_IRQHandler ; QUADSPI Interrupt | |||
DCD AES1_IRQHandler ; AES1 Interrupt | |||
DCD AES2_IRQHandler ; AES2 Interrupt | |||
DCD RNG_IRQHandler ; RNG1 Interrupt | |||
DCD FPU_IRQHandler ; FPU Interrupt | |||
DCD DMA2_Channel1_IRQHandler ; DMA2 Channel 1 Interrupt | |||
DCD DMA2_Channel2_IRQHandler ; DMA2 Channel 2 Interrupt | |||
DCD DMA2_Channel3_IRQHandler ; DMA2 Channel 3 Interrupt | |||
DCD DMA2_Channel4_IRQHandler ; DMA2 Channel 4 Interrupt | |||
DCD DMA2_Channel5_IRQHandler ; DMA2 Channel 5 Interrupt | |||
DCD DMA2_Channel6_IRQHandler ; DMA2 Channel 6 Interrupt | |||
DCD DMA2_Channel7_IRQHandler ; DMA2 Channel 7 Interrupt | |||
DCD DMAMUX1_OVR_IRQHandler ; DMAMUX overrun Interrupt | |||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |||
;; | |||
;; Default interrupt handlers. | |||
;; | |||
THUMB | |||
PUBWEAK Reset_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(2) | |||
Reset_Handler | |||
LDR R0, =SystemInit | |||
BLX R0 | |||
LDR R0, =__iar_program_start | |||
BX R0 | |||
PUBWEAK NMI_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
NMI_Handler | |||
B NMI_Handler | |||
PUBWEAK HardFault_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
HardFault_Handler | |||
B HardFault_Handler | |||
PUBWEAK MemManage_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
MemManage_Handler | |||
B MemManage_Handler | |||
PUBWEAK BusFault_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
BusFault_Handler | |||
B BusFault_Handler | |||
PUBWEAK UsageFault_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
UsageFault_Handler | |||
B UsageFault_Handler | |||
PUBWEAK SVC_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
SVC_Handler | |||
B SVC_Handler | |||
PUBWEAK DebugMon_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DebugMon_Handler | |||
B DebugMon_Handler | |||
PUBWEAK PendSV_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
PendSV_Handler | |||
B PendSV_Handler | |||
PUBWEAK SysTick_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
SysTick_Handler | |||
B SysTick_Handler | |||
PUBWEAK WWDG_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
WWDG_IRQHandler | |||
B WWDG_IRQHandler | |||
PUBWEAK PVD_PVM_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
PVD_PVM_IRQHandler | |||
B PVD_PVM_IRQHandler | |||
PUBWEAK TAMP_STAMP_LSECSS_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TAMP_STAMP_LSECSS_IRQHandler | |||
B TAMP_STAMP_LSECSS_IRQHandler | |||
PUBWEAK RTC_WKUP_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
RTC_WKUP_IRQHandler | |||
B RTC_WKUP_IRQHandler | |||
PUBWEAK FLASH_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
FLASH_IRQHandler | |||
B FLASH_IRQHandler | |||
PUBWEAK RCC_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
RCC_IRQHandler | |||
B RCC_IRQHandler | |||
PUBWEAK EXTI0_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI0_IRQHandler | |||
B EXTI0_IRQHandler | |||
PUBWEAK EXTI1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI1_IRQHandler | |||
B EXTI1_IRQHandler | |||
PUBWEAK EXTI2_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI2_IRQHandler | |||
B EXTI2_IRQHandler | |||
PUBWEAK EXTI3_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI3_IRQHandler | |||
B EXTI3_IRQHandler | |||
PUBWEAK EXTI4_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI4_IRQHandler | |||
B EXTI4_IRQHandler | |||
PUBWEAK DMA1_Channel1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel1_IRQHandler | |||
B DMA1_Channel1_IRQHandler | |||
PUBWEAK DMA1_Channel2_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel2_IRQHandler | |||
B DMA1_Channel2_IRQHandler | |||
PUBWEAK DMA1_Channel3_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel3_IRQHandler | |||
B DMA1_Channel3_IRQHandler | |||
PUBWEAK DMA1_Channel4_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel4_IRQHandler | |||
B DMA1_Channel4_IRQHandler | |||
PUBWEAK DMA1_Channel5_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel5_IRQHandler | |||
B DMA1_Channel5_IRQHandler | |||
PUBWEAK DMA1_Channel6_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel6_IRQHandler | |||
B DMA1_Channel6_IRQHandler | |||
PUBWEAK DMA1_Channel7_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel7_IRQHandler | |||
B DMA1_Channel7_IRQHandler | |||
PUBWEAK ADC1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
ADC1_IRQHandler | |||
B ADC1_IRQHandler | |||
PUBWEAK USB_HP_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
USB_HP_IRQHandler | |||
B USB_HP_IRQHandler | |||
PUBWEAK USB_LP_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
USB_LP_IRQHandler | |||
B USB_LP_IRQHandler | |||
PUBWEAK C2SEV_PWR_C2H_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
C2SEV_PWR_C2H_IRQHandler | |||
B C2SEV_PWR_C2H_IRQHandler | |||
PUBWEAK COMP_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
COMP_IRQHandler | |||
B COMP_IRQHandler | |||
PUBWEAK EXTI9_5_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI9_5_IRQHandler | |||
B EXTI9_5_IRQHandler | |||
PUBWEAK TIM1_BRK_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TIM1_BRK_IRQHandler | |||
B TIM1_BRK_IRQHandler | |||
PUBWEAK TIM1_UP_TIM16_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TIM1_UP_TIM16_IRQHandler | |||
B TIM1_UP_TIM16_IRQHandler | |||
PUBWEAK TIM1_TRG_COM_TIM17_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TIM1_TRG_COM_TIM17_IRQHandler | |||
B TIM1_TRG_COM_TIM17_IRQHandler | |||
PUBWEAK TIM1_CC_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TIM1_CC_IRQHandler | |||
B TIM1_CC_IRQHandler | |||
PUBWEAK TIM2_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TIM2_IRQHandler | |||
B TIM2_IRQHandler | |||
PUBWEAK PKA_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
PKA_IRQHandler | |||
B PKA_IRQHandler | |||
PUBWEAK I2C1_EV_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
I2C1_EV_IRQHandler | |||
B I2C1_EV_IRQHandler | |||
PUBWEAK I2C1_ER_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
I2C1_ER_IRQHandler | |||
B I2C1_ER_IRQHandler | |||
PUBWEAK I2C3_EV_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
I2C3_EV_IRQHandler | |||
B I2C3_EV_IRQHandler | |||
PUBWEAK I2C3_ER_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
I2C3_ER_IRQHandler | |||
B I2C3_ER_IRQHandler | |||
PUBWEAK SPI1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
SPI1_IRQHandler | |||
B SPI1_IRQHandler | |||
PUBWEAK SPI2_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
SPI2_IRQHandler | |||
B SPI2_IRQHandler | |||
PUBWEAK USART1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
USART1_IRQHandler | |||
B USART1_IRQHandler | |||
PUBWEAK LPUART1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
LPUART1_IRQHandler | |||
B LPUART1_IRQHandler | |||
PUBWEAK TSC_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TSC_IRQHandler | |||
B TSC_IRQHandler | |||
PUBWEAK EXTI15_10_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI15_10_IRQHandler | |||
B EXTI15_10_IRQHandler | |||
PUBWEAK RTC_Alarm_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
RTC_Alarm_IRQHandler | |||
B RTC_Alarm_IRQHandler | |||
PUBWEAK CRS_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
CRS_IRQHandler | |||
B CRS_IRQHandler | |||
PUBWEAK PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler | |||
B PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler | |||
PUBWEAK IPCC_C1_RX_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
IPCC_C1_RX_IRQHandler | |||
B IPCC_C1_RX_IRQHandler | |||
PUBWEAK IPCC_C1_TX_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
IPCC_C1_TX_IRQHandler | |||
B IPCC_C1_TX_IRQHandler | |||
PUBWEAK HSEM_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
HSEM_IRQHandler | |||
B HSEM_IRQHandler | |||
PUBWEAK LPTIM1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
LPTIM1_IRQHandler | |||
B LPTIM1_IRQHandler | |||
PUBWEAK LPTIM2_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
LPTIM2_IRQHandler | |||
B LPTIM2_IRQHandler | |||
PUBWEAK QUADSPI_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
QUADSPI_IRQHandler | |||
B QUADSPI_IRQHandler | |||
PUBWEAK AES1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
AES1_IRQHandler | |||
B AES1_IRQHandler | |||
PUBWEAK AES2_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
AES2_IRQHandler | |||
B AES2_IRQHandler | |||
PUBWEAK RNG_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
RNG_IRQHandler | |||
B RNG_IRQHandler | |||
PUBWEAK FPU_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
FPU_IRQHandler | |||
B FPU_IRQHandler | |||
PUBWEAK DMA2_Channel1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA2_Channel1_IRQHandler | |||
B DMA2_Channel1_IRQHandler | |||
PUBWEAK DMA2_Channel2_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA2_Channel2_IRQHandler | |||
B DMA2_Channel2_IRQHandler | |||
PUBWEAK DMA2_Channel3_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA2_Channel3_IRQHandler | |||
B DMA2_Channel3_IRQHandler | |||
PUBWEAK DMA2_Channel4_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA2_Channel4_IRQHandler | |||
B DMA2_Channel4_IRQHandler | |||
PUBWEAK DMA2_Channel5_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA2_Channel5_IRQHandler | |||
B DMA2_Channel5_IRQHandler | |||
PUBWEAK DMA2_Channel6_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA2_Channel6_IRQHandler | |||
B DMA2_Channel6_IRQHandler | |||
PUBWEAK DMA2_Channel7_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA2_Channel7_IRQHandler | |||
B DMA2_Channel7_IRQHandler | |||
PUBWEAK DMAMUX1_OVR_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMAMUX1_OVR_IRQHandler | |||
B DMAMUX1_OVR_IRQHandler | |||
END | |||
;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** |
@@ -0,0 +1,422 @@ | |||
;****************************************************************************** | |||
;* File Name : startup_stm32wb50xx_cm4.s | |||
;* Author : MCD Application Team | |||
;* Description : M4 core vector table of the STM32WB50xx devices for the | |||
;* IAR (EWARM) toolchain. | |||
;* | |||
;* This module performs: | |||
;* - Set the initial SP | |||
;* - Set the initial PC == _iar_program_start, | |||
;* - Set the vector table entries with the exceptions ISR | |||
;* address. | |||
;* - Branches to main in the C library (which eventually | |||
;* calls main()). | |||
;* After Reset the Cortex-M4 processor is in Thread mode, | |||
;* priority is Privileged, and the Stack is set to Main. | |||
;****************************************************************************** | |||
;* @attention | |||
;* | |||
;* <h2><center>© Copyright (c) 2019 STMicroelectronics. | |||
;* All rights reserved.</center></h2> | |||
;* | |||
;* This software component is licensed by ST under BSD 3-Clause license, | |||
;* the "License"; You may not use this file except in compliance with the | |||
;* License. You may obtain a copy of the License at: | |||
;* opensource.org/licenses/BSD-3-Clause | |||
;* | |||
;****************************************************************************** | |||
; | |||
; | |||
; The modules in this file are included in the libraries, and may be replaced | |||
; by any user-defined modules that define the PUBLIC symbol _program_start or | |||
; a user defined start symbol. | |||
; To override the cstartup defined in the library, simply add your modified | |||
; version to the workbench project. | |||
; | |||
; The vector table is normally located at address 0. | |||
; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. | |||
; The name "__vector_table" has special meaning for C-SPY: | |||
; it is where the SP start value is found, and the NVIC vector | |||
; table register (VTOR) is initialized to this address if != 0. | |||
; | |||
; Cortex-M version | |||
; | |||
MODULE ?cstartup | |||
;; Forward declaration of sections. | |||
SECTION CSTACK:DATA:NOROOT(3) | |||
SECTION .intvec:CODE:NOROOT(2) | |||
EXTERN __iar_program_start | |||
EXTERN SystemInit | |||
PUBLIC __vector_table | |||
DATA | |||
__vector_table | |||
DCD sfe(CSTACK) | |||
DCD Reset_Handler ; Reset Handler | |||
DCD NMI_Handler ; NMI Handler | |||
DCD HardFault_Handler ; Hard Fault Handler | |||
DCD MemManage_Handler ; MPU Fault Handler | |||
DCD BusFault_Handler ; Bus Fault Handler | |||
DCD UsageFault_Handler ; Usage Fault Handler | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD SVC_Handler ; SVCall Handler | |||
DCD DebugMon_Handler ; Debug Monitor Handler | |||
DCD 0 ; Reserved | |||
DCD PendSV_Handler ; PendSV Handler | |||
DCD SysTick_Handler ; SysTick Handler | |||
; External Interrupts | |||
DCD WWDG_IRQHandler ; Window WatchDog | |||
DCD PVD_PVM_IRQHandler ; PVD and PVM Interrupt | |||
DCD TAMP_STAMP_LSECSS_IRQHandler ; RTC Tamper, TimeStamp Interrupts and LSECSS Interrupts | |||
DCD RTC_WKUP_IRQHandler ; RTC Wakeup Interrupt | |||
DCD FLASH_IRQHandler ; FLASH global Interrupt | |||
DCD RCC_IRQHandler ; RCC Interrupt | |||
DCD EXTI0_IRQHandler ; EXTI Line 0 Interrupt | |||
DCD EXTI1_IRQHandler ; EXTI Line 1 Interrupt | |||
DCD EXTI2_IRQHandler ; EXTI Line 2 Interrupt | |||
DCD EXTI3_IRQHandler ; EXTI Line 3 Interrup | |||
DCD EXTI4_IRQHandler ; EXTI Line 4 Interrupt | |||
DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 Interrupt | |||
DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2 Interrupt | |||
DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3 Interrupt | |||
DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4 Interrupt | |||
DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5 Interrupt | |||
DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6 Interrupt | |||
DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7 Interrupt | |||
DCD ADC1_IRQHandler ; ADC1 Interrupt | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD C2SEV_PWR_C2H_IRQHandler ; CPU M0+ SEV Interrupt | |||
DCD 0 ; Reserved | |||
DCD EXTI9_5_IRQHandler ; EXTI Lines [9:5] Interrupt | |||
DCD TIM1_BRK_IRQHandler ; TIM1 Break Interrupt | |||
DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16 global Interrupts | |||
DCD TIM1_TRG_COM_TIM17_IRQHandler ; TIM1 Trigger and Communication and TIM17 global Interrupts | |||
DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare Interrupt | |||
DCD TIM2_IRQHandler ; TIM2 Global Interrupt | |||
DCD PKA_IRQHandler ; PKA Interrupt | |||
DCD I2C1_EV_IRQHandler ; I2C1 Event Interrupt | |||
DCD I2C1_ER_IRQHandler ; I2C1 Error Interrupt | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD SPI1_IRQHandler ; SPI1 Interrupt | |||
DCD 0 ; Reserved | |||
DCD USART1_IRQHandler ; USART1 Interrupt | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD TSC_IRQHandler ; TSC Interrupt | |||
DCD EXTI15_10_IRQHandler ; EXTI Lines1[15:10 ]Interrupts | |||
DCD RTC_Alarm_IRQHandler ; RTC Alarms (A and B) Interrupt | |||
DCD 0 ; Reserved | |||
DCD PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler ; WKUP Interrupt from PWR | |||
DCD IPCC_C1_RX_IRQHandler ; IPCC CPU1 RX occupied interrupt | |||
DCD IPCC_C1_TX_IRQHandler ; IPCC CPU1 RX free interrupt | |||
DCD HSEM_IRQHandler ; HSEM0 Interrupt | |||
DCD LPTIM1_IRQHandler ; LPTIM1 Interrupt | |||
DCD LPTIM2_IRQHandler ; LPTIM2 Interrupt | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD AES2_IRQHandler ; AES2 Interrupt | |||
DCD RNG_IRQHandler ; RNG1 Interrupt | |||
DCD FPU_IRQHandler ; FPU Interrupt | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD DMAMUX1_OVR_IRQHandler ; DMAMUX overrun Interrupt | |||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |||
;; | |||
;; Default interrupt handlers. | |||
;; | |||
THUMB | |||
PUBWEAK Reset_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(2) | |||
Reset_Handler | |||
LDR R0, =SystemInit | |||
BLX R0 | |||
LDR R0, =__iar_program_start | |||
BX R0 | |||
PUBWEAK NMI_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
NMI_Handler | |||
B NMI_Handler | |||
PUBWEAK HardFault_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
HardFault_Handler | |||
B HardFault_Handler | |||
PUBWEAK MemManage_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
MemManage_Handler | |||
B MemManage_Handler | |||
PUBWEAK BusFault_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
BusFault_Handler | |||
B BusFault_Handler | |||
PUBWEAK UsageFault_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
UsageFault_Handler | |||
B UsageFault_Handler | |||
PUBWEAK SVC_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
SVC_Handler | |||
B SVC_Handler | |||
PUBWEAK DebugMon_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DebugMon_Handler | |||
B DebugMon_Handler | |||
PUBWEAK PendSV_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
PendSV_Handler | |||
B PendSV_Handler | |||
PUBWEAK SysTick_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
SysTick_Handler | |||
B SysTick_Handler | |||
PUBWEAK WWDG_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
WWDG_IRQHandler | |||
B WWDG_IRQHandler | |||
PUBWEAK PVD_PVM_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
PVD_PVM_IRQHandler | |||
B PVD_PVM_IRQHandler | |||
PUBWEAK TAMP_STAMP_LSECSS_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TAMP_STAMP_LSECSS_IRQHandler | |||
B TAMP_STAMP_LSECSS_IRQHandler | |||
PUBWEAK RTC_WKUP_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
RTC_WKUP_IRQHandler | |||
B RTC_WKUP_IRQHandler | |||
PUBWEAK FLASH_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
FLASH_IRQHandler | |||
B FLASH_IRQHandler | |||
PUBWEAK RCC_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
RCC_IRQHandler | |||
B RCC_IRQHandler | |||
PUBWEAK EXTI0_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI0_IRQHandler | |||
B EXTI0_IRQHandler | |||
PUBWEAK EXTI1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI1_IRQHandler | |||
B EXTI1_IRQHandler | |||
PUBWEAK EXTI2_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI2_IRQHandler | |||
B EXTI2_IRQHandler | |||
PUBWEAK EXTI3_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI3_IRQHandler | |||
B EXTI3_IRQHandler | |||
PUBWEAK EXTI4_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI4_IRQHandler | |||
B EXTI4_IRQHandler | |||
PUBWEAK DMA1_Channel1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel1_IRQHandler | |||
B DMA1_Channel1_IRQHandler | |||
PUBWEAK DMA1_Channel2_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel2_IRQHandler | |||
B DMA1_Channel2_IRQHandler | |||
PUBWEAK DMA1_Channel3_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel3_IRQHandler | |||
B DMA1_Channel3_IRQHandler | |||
PUBWEAK DMA1_Channel4_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel4_IRQHandler | |||
B DMA1_Channel4_IRQHandler | |||
PUBWEAK DMA1_Channel5_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel5_IRQHandler | |||
B DMA1_Channel5_IRQHandler | |||
PUBWEAK DMA1_Channel6_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel6_IRQHandler | |||
B DMA1_Channel6_IRQHandler | |||
PUBWEAK DMA1_Channel7_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel7_IRQHandler | |||
B DMA1_Channel7_IRQHandler | |||
PUBWEAK ADC1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
ADC1_IRQHandler | |||
B ADC1_IRQHandler | |||
PUBWEAK C2SEV_PWR_C2H_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
C2SEV_PWR_C2H_IRQHandler | |||
B C2SEV_PWR_C2H_IRQHandler | |||
PUBWEAK EXTI9_5_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI9_5_IRQHandler | |||
B EXTI9_5_IRQHandler | |||
PUBWEAK TIM1_BRK_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TIM1_BRK_IRQHandler | |||
B TIM1_BRK_IRQHandler | |||
PUBWEAK TIM1_UP_TIM16_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TIM1_UP_TIM16_IRQHandler | |||
B TIM1_UP_TIM16_IRQHandler | |||
PUBWEAK TIM1_TRG_COM_TIM17_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TIM1_TRG_COM_TIM17_IRQHandler | |||
B TIM1_TRG_COM_TIM17_IRQHandler | |||
PUBWEAK TIM1_CC_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TIM1_CC_IRQHandler | |||
B TIM1_CC_IRQHandler | |||
PUBWEAK TIM2_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TIM2_IRQHandler | |||
B TIM2_IRQHandler | |||
PUBWEAK PKA_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
PKA_IRQHandler | |||
B PKA_IRQHandler | |||
PUBWEAK I2C1_EV_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
I2C1_EV_IRQHandler | |||
B I2C1_EV_IRQHandler | |||
PUBWEAK I2C1_ER_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
I2C1_ER_IRQHandler | |||
B I2C1_ER_IRQHandler | |||
PUBWEAK SPI1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
SPI1_IRQHandler | |||
B SPI1_IRQHandler | |||
PUBWEAK USART1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
USART1_IRQHandler | |||
B USART1_IRQHandler | |||
PUBWEAK TSC_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TSC_IRQHandler | |||
B TSC_IRQHandler | |||
PUBWEAK EXTI15_10_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI15_10_IRQHandler | |||
B EXTI15_10_IRQHandler | |||
PUBWEAK RTC_Alarm_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
RTC_Alarm_IRQHandler | |||
B RTC_Alarm_IRQHandler | |||
PUBWEAK PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler | |||
B PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler | |||
PUBWEAK IPCC_C1_RX_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
IPCC_C1_RX_IRQHandler | |||
B IPCC_C1_RX_IRQHandler | |||
PUBWEAK IPCC_C1_TX_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
IPCC_C1_TX_IRQHandler | |||
B IPCC_C1_TX_IRQHandler | |||
PUBWEAK HSEM_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
HSEM_IRQHandler | |||
B HSEM_IRQHandler | |||
PUBWEAK LPTIM1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
LPTIM1_IRQHandler | |||
B LPTIM1_IRQHandler | |||
PUBWEAK LPTIM2_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
LPTIM2_IRQHandler | |||
B LPTIM2_IRQHandler | |||
PUBWEAK AES2_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
AES2_IRQHandler | |||
B AES2_IRQHandler | |||
PUBWEAK RNG_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
RNG_IRQHandler | |||
B RNG_IRQHandler | |||
PUBWEAK FPU_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
FPU_IRQHandler | |||
B FPU_IRQHandler | |||
PUBWEAK DMAMUX1_OVR_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMAMUX1_OVR_IRQHandler | |||
B DMAMUX1_OVR_IRQHandler | |||
END | |||
;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** |
@@ -0,0 +1,517 @@ | |||
;****************************************************************************** | |||
;* File Name : startup_stm32wb5mxx_cm4.s | |||
;* Author : MCD Application Team | |||
;* Description : M4 core vector table of the STM32WB5Mxx devices for the | |||
;* IAR (EWARM) toolchain. | |||
;* | |||
;* This module performs: | |||
;* - Set the initial SP | |||
;* - Set the initial PC == _iar_program_start, | |||
;* - Set the vector table entries with the exceptions ISR | |||
;* address. | |||
;* - Branches to main in the C library (which eventually | |||
;* calls main()). | |||
;* After Reset the Cortex-M4 processor is in Thread mode, | |||
;* priority is Privileged, and the Stack is set to Main. | |||
;****************************************************************************** | |||
;* @attention | |||
;* | |||
;* <h2><center>© Copyright (c) 2019 STMicroelectronics. | |||
;* All rights reserved.</center></h2> | |||
;* | |||
;* This software component is licensed by ST under BSD 3-Clause license, | |||
;* the "License"; You may not use this file except in compliance with the | |||
;* License. You may obtain a copy of the License at: | |||
;* opensource.org/licenses/BSD-3-Clause | |||
;* | |||
;****************************************************************************** | |||
; | |||
; | |||
; The modules in this file are included in the libraries, and may be replaced | |||
; by any user-defined modules that define the PUBLIC symbol _program_start or | |||
; a user defined start symbol. | |||
; To override the cstartup defined in the library, simply add your modified | |||
; version to the workbench project. | |||
; | |||
; The vector table is normally located at address 0. | |||
; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. | |||
; The name "__vector_table" has special meaning for C-SPY: | |||
; it is where the SP start value is found, and the NVIC vector | |||
; table register (VTOR) is initialized to this address if != 0. | |||
; | |||
; Cortex-M version | |||
; | |||
MODULE ?cstartup | |||
;; Forward declaration of sections. | |||
SECTION CSTACK:DATA:NOROOT(3) | |||
SECTION .intvec:CODE:NOROOT(2) | |||
EXTERN __iar_program_start | |||
EXTERN SystemInit | |||
PUBLIC __vector_table | |||
DATA | |||
__vector_table | |||
DCD sfe(CSTACK) | |||
DCD Reset_Handler ; Reset Handler | |||
DCD NMI_Handler ; NMI Handler | |||
DCD HardFault_Handler ; Hard Fault Handler | |||
DCD MemManage_Handler ; MPU Fault Handler | |||
DCD BusFault_Handler ; Bus Fault Handler | |||
DCD UsageFault_Handler ; Usage Fault Handler | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD 0 ; Reserved | |||
DCD SVC_Handler ; SVCall Handler | |||
DCD DebugMon_Handler ; Debug Monitor Handler | |||
DCD 0 ; Reserved | |||
DCD PendSV_Handler ; PendSV Handler | |||
DCD SysTick_Handler ; SysTick Handler | |||
; External Interrupts | |||
DCD WWDG_IRQHandler ; Window WatchDog | |||
DCD PVD_PVM_IRQHandler ; PVD and PVM Interrupt | |||
DCD TAMP_STAMP_LSECSS_IRQHandler ; RTC Tamper, TimeStamp Interrupts and LSECSS Interrupts | |||
DCD RTC_WKUP_IRQHandler ; RTC Wakeup Interrupt | |||
DCD FLASH_IRQHandler ; FLASH global Interrupt | |||
DCD RCC_IRQHandler ; RCC Interrupt | |||
DCD EXTI0_IRQHandler ; EXTI Line 0 Interrupt | |||
DCD EXTI1_IRQHandler ; EXTI Line 1 Interrupt | |||
DCD EXTI2_IRQHandler ; EXTI Line 2 Interrupt | |||
DCD EXTI3_IRQHandler ; EXTI Line 3 Interrup | |||
DCD EXTI4_IRQHandler ; EXTI Line 4 Interrupt | |||
DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 Interrupt | |||
DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2 Interrupt | |||
DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3 Interrupt | |||
DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4 Interrupt | |||
DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5 Interrupt | |||
DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6 Interrupt | |||
DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7 Interrupt | |||
DCD ADC1_IRQHandler ; ADC1 Interrupt | |||
DCD USB_HP_IRQHandler ; USB High Priority Interrupt | |||
DCD USB_LP_IRQHandler ; USB Low Priority Interrupt | |||
DCD C2SEV_PWR_C2H_IRQHandler ; CPU M0+ SEV Interrupt | |||
DCD COMP_IRQHandler ; COMP1 and COMP2 Interrupts | |||
DCD EXTI9_5_IRQHandler ; EXTI Lines [9:5] Interrupt | |||
DCD TIM1_BRK_IRQHandler ; TIM1 Break Interrupt | |||
DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16 global Interrupts | |||
DCD TIM1_TRG_COM_TIM17_IRQHandler ; TIM1 Trigger and Communication and TIM17 global Interrupts | |||
DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare Interrupt | |||
DCD TIM2_IRQHandler ; TIM2 Global Interrupt | |||
DCD PKA_IRQHandler ; PKA Interrupt | |||
DCD I2C1_EV_IRQHandler ; I2C1 Event Interrupt | |||
DCD I2C1_ER_IRQHandler ; I2C1 Error Interrupt | |||
DCD I2C3_EV_IRQHandler ; I2C3 Event Interrupt | |||
DCD I2C3_ER_IRQHandler ; I2C3 Error Interrupt | |||
DCD SPI1_IRQHandler ; SPI1 Interrupt | |||
DCD SPI2_IRQHandler ; SPI2 Interrupt | |||
DCD USART1_IRQHandler ; USART1 Interrupt | |||
DCD LPUART1_IRQHandler ; LPUART1 Interrupt | |||
DCD SAI1_IRQHandler ; SAI Interrupt | |||
DCD TSC_IRQHandler ; TSC Interrupt | |||
DCD EXTI15_10_IRQHandler ; EXTI Lines1[15:10 ]Interrupts | |||
DCD RTC_Alarm_IRQHandler ; RTC Alarms (A and B) Interrupt | |||
DCD CRS_IRQHandler ; CRS interrupt | |||
DCD PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler ; WKUP Interrupt from PWR | |||
DCD IPCC_C1_RX_IRQHandler ; IPCC CPU1 RX occupied interrupt | |||
DCD IPCC_C1_TX_IRQHandler ; IPCC CPU1 RX free interrupt | |||
DCD HSEM_IRQHandler ; HSEM0 Interrupt | |||
DCD LPTIM1_IRQHandler ; LPTIM1 Interrupt | |||
DCD LPTIM2_IRQHandler ; LPTIM2 Interrupt | |||
DCD LCD_IRQHandler ; LCD Interrupt | |||
DCD QUADSPI_IRQHandler ; QUADSPI Interrupt | |||
DCD AES1_IRQHandler ; AES1 Interrupt | |||
DCD AES2_IRQHandler ; AES2 Interrupt | |||
DCD RNG_IRQHandler ; RNG1 Interrupt | |||
DCD FPU_IRQHandler ; FPU Interrupt | |||
DCD DMA2_Channel1_IRQHandler ; DMA2 Channel 1 Interrupt | |||
DCD DMA2_Channel2_IRQHandler ; DMA2 Channel 2 Interrupt | |||
DCD DMA2_Channel3_IRQHandler ; DMA2 Channel 3 Interrupt | |||
DCD DMA2_Channel4_IRQHandler ; DMA2 Channel 4 Interrupt | |||
DCD DMA2_Channel5_IRQHandler ; DMA2 Channel 5 Interrupt | |||
DCD DMA2_Channel6_IRQHandler ; DMA2 Channel 6 Interrupt | |||
DCD DMA2_Channel7_IRQHandler ; DMA2 Channel 7 Interrupt | |||
DCD DMAMUX1_OVR_IRQHandler ; DMAMUX overrun Interrupt | |||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |||
;; | |||
;; Default interrupt handlers. | |||
;; | |||
THUMB | |||
PUBWEAK Reset_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(2) | |||
Reset_Handler | |||
LDR R0, =SystemInit | |||
BLX R0 | |||
LDR R0, =__iar_program_start | |||
BX R0 | |||
PUBWEAK NMI_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
NMI_Handler | |||
B NMI_Handler | |||
PUBWEAK HardFault_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
HardFault_Handler | |||
B HardFault_Handler | |||
PUBWEAK MemManage_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
MemManage_Handler | |||
B MemManage_Handler | |||
PUBWEAK BusFault_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
BusFault_Handler | |||
B BusFault_Handler | |||
PUBWEAK UsageFault_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
UsageFault_Handler | |||
B UsageFault_Handler | |||
PUBWEAK SVC_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
SVC_Handler | |||
B SVC_Handler | |||
PUBWEAK DebugMon_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DebugMon_Handler | |||
B DebugMon_Handler | |||
PUBWEAK PendSV_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
PendSV_Handler | |||
B PendSV_Handler | |||
PUBWEAK SysTick_Handler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
SysTick_Handler | |||
B SysTick_Handler | |||
PUBWEAK WWDG_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
WWDG_IRQHandler | |||
B WWDG_IRQHandler | |||
PUBWEAK PVD_PVM_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
PVD_PVM_IRQHandler | |||
B PVD_PVM_IRQHandler | |||
PUBWEAK TAMP_STAMP_LSECSS_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TAMP_STAMP_LSECSS_IRQHandler | |||
B TAMP_STAMP_LSECSS_IRQHandler | |||
PUBWEAK RTC_WKUP_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
RTC_WKUP_IRQHandler | |||
B RTC_WKUP_IRQHandler | |||
PUBWEAK FLASH_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
FLASH_IRQHandler | |||
B FLASH_IRQHandler | |||
PUBWEAK RCC_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
RCC_IRQHandler | |||
B RCC_IRQHandler | |||
PUBWEAK EXTI0_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI0_IRQHandler | |||
B EXTI0_IRQHandler | |||
PUBWEAK EXTI1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI1_IRQHandler | |||
B EXTI1_IRQHandler | |||
PUBWEAK EXTI2_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI2_IRQHandler | |||
B EXTI2_IRQHandler | |||
PUBWEAK EXTI3_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI3_IRQHandler | |||
B EXTI3_IRQHandler | |||
PUBWEAK EXTI4_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI4_IRQHandler | |||
B EXTI4_IRQHandler | |||
PUBWEAK DMA1_Channel1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel1_IRQHandler | |||
B DMA1_Channel1_IRQHandler | |||
PUBWEAK DMA1_Channel2_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel2_IRQHandler | |||
B DMA1_Channel2_IRQHandler | |||
PUBWEAK DMA1_Channel3_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel3_IRQHandler | |||
B DMA1_Channel3_IRQHandler | |||
PUBWEAK DMA1_Channel4_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel4_IRQHandler | |||
B DMA1_Channel4_IRQHandler | |||
PUBWEAK DMA1_Channel5_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel5_IRQHandler | |||
B DMA1_Channel5_IRQHandler | |||
PUBWEAK DMA1_Channel6_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel6_IRQHandler | |||
B DMA1_Channel6_IRQHandler | |||
PUBWEAK DMA1_Channel7_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA1_Channel7_IRQHandler | |||
B DMA1_Channel7_IRQHandler | |||
PUBWEAK ADC1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
ADC1_IRQHandler | |||
B ADC1_IRQHandler | |||
PUBWEAK USB_HP_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
USB_HP_IRQHandler | |||
B USB_HP_IRQHandler | |||
PUBWEAK USB_LP_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
USB_LP_IRQHandler | |||
B USB_LP_IRQHandler | |||
PUBWEAK C2SEV_PWR_C2H_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
C2SEV_PWR_C2H_IRQHandler | |||
B C2SEV_PWR_C2H_IRQHandler | |||
PUBWEAK COMP_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
COMP_IRQHandler | |||
B COMP_IRQHandler | |||
PUBWEAK EXTI9_5_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI9_5_IRQHandler | |||
B EXTI9_5_IRQHandler | |||
PUBWEAK TIM1_BRK_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TIM1_BRK_IRQHandler | |||
B TIM1_BRK_IRQHandler | |||
PUBWEAK TIM1_UP_TIM16_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TIM1_UP_TIM16_IRQHandler | |||
B TIM1_UP_TIM16_IRQHandler | |||
PUBWEAK TIM1_TRG_COM_TIM17_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TIM1_TRG_COM_TIM17_IRQHandler | |||
B TIM1_TRG_COM_TIM17_IRQHandler | |||
PUBWEAK TIM1_CC_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TIM1_CC_IRQHandler | |||
B TIM1_CC_IRQHandler | |||
PUBWEAK TIM2_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TIM2_IRQHandler | |||
B TIM2_IRQHandler | |||
PUBWEAK PKA_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
PKA_IRQHandler | |||
B PKA_IRQHandler | |||
PUBWEAK I2C1_EV_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
I2C1_EV_IRQHandler | |||
B I2C1_EV_IRQHandler | |||
PUBWEAK I2C1_ER_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
I2C1_ER_IRQHandler | |||
B I2C1_ER_IRQHandler | |||
PUBWEAK I2C3_EV_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
I2C3_EV_IRQHandler | |||
B I2C3_EV_IRQHandler | |||
PUBWEAK I2C3_ER_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
I2C3_ER_IRQHandler | |||
B I2C3_ER_IRQHandler | |||
PUBWEAK SPI1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
SPI1_IRQHandler | |||
B SPI1_IRQHandler | |||
PUBWEAK SPI2_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
SPI2_IRQHandler | |||
B SPI2_IRQHandler | |||
PUBWEAK USART1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
USART1_IRQHandler | |||
B USART1_IRQHandler | |||
PUBWEAK LPUART1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
LPUART1_IRQHandler | |||
B LPUART1_IRQHandler | |||
PUBWEAK SAI1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
SAI1_IRQHandler | |||
B SAI1_IRQHandler | |||
PUBWEAK TSC_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
TSC_IRQHandler | |||
B TSC_IRQHandler | |||
PUBWEAK EXTI15_10_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
EXTI15_10_IRQHandler | |||
B EXTI15_10_IRQHandler | |||
PUBWEAK RTC_Alarm_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
RTC_Alarm_IRQHandler | |||
B RTC_Alarm_IRQHandler | |||
PUBWEAK CRS_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
CRS_IRQHandler | |||
B CRS_IRQHandler | |||
PUBWEAK PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler | |||
B PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler | |||
PUBWEAK IPCC_C1_RX_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
IPCC_C1_RX_IRQHandler | |||
B IPCC_C1_RX_IRQHandler | |||
PUBWEAK IPCC_C1_TX_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
IPCC_C1_TX_IRQHandler | |||
B IPCC_C1_TX_IRQHandler | |||
PUBWEAK HSEM_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
HSEM_IRQHandler | |||
B HSEM_IRQHandler | |||
PUBWEAK LPTIM1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
LPTIM1_IRQHandler | |||
B LPTIM1_IRQHandler | |||
PUBWEAK LPTIM2_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
LPTIM2_IRQHandler | |||
B LPTIM2_IRQHandler | |||
PUBWEAK LCD_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
LCD_IRQHandler | |||
B LCD_IRQHandler | |||
PUBWEAK QUADSPI_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
QUADSPI_IRQHandler | |||
B QUADSPI_IRQHandler | |||
PUBWEAK AES1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
AES1_IRQHandler | |||
B AES1_IRQHandler | |||
PUBWEAK AES2_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
AES2_IRQHandler | |||
B AES2_IRQHandler | |||
PUBWEAK RNG_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
RNG_IRQHandler | |||
B RNG_IRQHandler | |||
PUBWEAK FPU_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
FPU_IRQHandler | |||
B FPU_IRQHandler | |||
PUBWEAK DMA2_Channel1_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA2_Channel1_IRQHandler | |||
B DMA2_Channel1_IRQHandler | |||
PUBWEAK DMA2_Channel2_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA2_Channel2_IRQHandler | |||
B DMA2_Channel2_IRQHandler | |||
PUBWEAK DMA2_Channel3_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA2_Channel3_IRQHandler | |||
B DMA2_Channel3_IRQHandler | |||
PUBWEAK DMA2_Channel4_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA2_Channel4_IRQHandler | |||
B DMA2_Channel4_IRQHandler | |||
PUBWEAK DMA2_Channel5_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA2_Channel5_IRQHandler | |||
B DMA2_Channel5_IRQHandler | |||
PUBWEAK DMA2_Channel6_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA2_Channel6_IRQHandler | |||
B DMA2_Channel6_IRQHandler | |||
PUBWEAK DMA2_Channel7_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMA2_Channel7_IRQHandler | |||
B DMA2_Channel7_IRQHandler | |||
PUBWEAK DMAMUX1_OVR_IRQHandler | |||
SECTION .text:CODE:NOROOT:REORDER(1) | |||
DMAMUX1_OVR_IRQHandler | |||
B DMAMUX1_OVR_IRQHandler | |||
END | |||
;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** |
@@ -161,10 +161,12 @@ | |||
const uint32_t MSIRangeTable[16UL] = {100000UL, 200000UL, 400000UL, 800000UL, 1000000UL, 2000000UL, \ | |||
4000000UL, 8000000UL, 16000000UL, 24000000UL, 32000000UL, 48000000UL, 0UL, 0UL, 0UL, 0UL}; /* 0UL values are incorrect cases */ | |||
#if defined(STM32WB55xx) || defined(STM32WB5Mxx) || defined(STM32WB35xx) | |||
const uint32_t SmpsPrescalerTable[4UL][6UL]={{1UL,3UL,2UL,2UL,1UL,2UL}, \ | |||
{2UL,6UL,4UL,3UL,2UL,4UL}, \ | |||
{4UL,12UL,8UL,6UL,4UL,8UL}, \ | |||
{4UL,12UL,8UL,6UL,4UL,8UL}}; | |||
#endif | |||
/** | |||
* @} | |||
@@ -221,8 +223,10 @@ void SystemInit(void) | |||
/* Reset PLLCFGR register */ | |||
RCC->PLLCFGR = 0x22041000U; | |||
#if defined(STM32WB55xx) || defined(STM32WB5Mxx) | |||
/* Reset PLLSAI1CFGR register */ | |||
RCC->PLLSAI1CFGR = 0x22041000U; | |||
#endif | |||
/* Reset HSEBYP bit */ | |||
RCC->CR &= 0xFFFBFFFFU; | |||
@@ -7,7 +7,7 @@ | |||
****************************************************************************** | |||
* @attention | |||
* | |||
* <h2><center>© Copyright (c) 2018 STMicroelectronics. | |||
* <h2><center>© Copyright (c) 2019 STMicroelectronics. | |||
* All rights reserved.</center></h2> | |||
* | |||
* This software component is licensed by ST under BSD 3-Clause license, | |||
@@ -236,12 +236,12 @@ | |||
#define DAC_WAVEGENERATION_NOISE DAC_WAVE_NOISE | |||
#define DAC_WAVEGENERATION_TRIANGLE DAC_WAVE_TRIANGLE | |||
#if defined(STM32G4) | |||
#define DAC_CHIPCONNECT_DISABLE (DAC_CHIPCONNECT_EXTERNAL | DAC_CHIPCONNECT_BOTH) | |||
#define DAC_CHIPCONNECT_ENABLE (DAC_CHIPCONNECT_INTERNAL | DAC_CHIPCONNECT_BOTH) | |||
#if defined(STM32G4) || defined(STM32H7) | |||
#define DAC_CHIPCONNECT_DISABLE DAC_CHIPCONNECT_EXTERNAL | |||
#define DAC_CHIPCONNECT_ENABLE DAC_CHIPCONNECT_INTERNAL | |||
#endif | |||
#if defined(STM32L1) || defined(STM32L4) || defined(STM32G0) | |||
#if defined(STM32L1) || defined(STM32L4) || defined(STM32G0) || defined(STM32L5) || defined(STM32H7) || defined(STM32F4) || defined(STM32G4) | |||
#define HAL_DAC_MSP_INIT_CB_ID HAL_DAC_MSPINIT_CB_ID | |||
#define HAL_DAC_MSP_DEINIT_CB_ID HAL_DAC_MSPDEINIT_CB_ID | |||
#endif | |||
@@ -306,8 +306,17 @@ | |||
#define HAL_DMAMUX_REQUEST_GEN_FALLING HAL_DMAMUX_REQ_GEN_FALLING | |||
#define HAL_DMAMUX_REQUEST_GEN_RISING_FALLING HAL_DMAMUX_REQ_GEN_RISING_FALLING | |||
#if defined(STM32L4R5xx) || defined(STM32L4R9xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx) | |||
#define DMA_REQUEST_DCMI_PSSI DMA_REQUEST_DCMI | |||
#endif | |||
#endif /* STM32L4 */ | |||
#if defined(STM32G0) | |||
#define DMA_REQUEST_DAC1_CHANNEL1 DMA_REQUEST_DAC1_CH1 | |||
#define DMA_REQUEST_DAC1_CHANNEL2 DMA_REQUEST_DAC1_CH2 | |||
#endif | |||
#if defined(STM32H7) | |||
#define DMA_REQUEST_DAC1 DMA_REQUEST_DAC1_CH1 | |||
@@ -365,6 +374,9 @@ | |||
#define DFSDM_FILTER_EXT_TRIG_LPTIM2 DFSDM_FILTER_EXT_TRIG_LPTIM2_OUT | |||
#define DFSDM_FILTER_EXT_TRIG_LPTIM3 DFSDM_FILTER_EXT_TRIG_LPTIM3_OUT | |||
#define DAC_TRIGGER_LP1_OUT DAC_TRIGGER_LPTIM1_OUT | |||
#define DAC_TRIGGER_LP2_OUT DAC_TRIGGER_LPTIM2_OUT | |||
#endif /* STM32H7 */ | |||
/** | |||
@@ -460,7 +472,9 @@ | |||
#define FLASH_FLAG_SNECCE_BANK2RR FLASH_FLAG_SNECCERR_BANK2 | |||
#define FLASH_FLAG_DBECCE_BANK2RR FLASH_FLAG_DBECCERR_BANK2 | |||
#define FLASH_FLAG_STRBER_BANK2R FLASH_FLAG_STRBERR_BANK2 | |||
#endif | |||
#define FLASH_FLAG_WDW FLASH_FLAG_WBNE | |||
#define OB_WRP_SECTOR_All OB_WRP_SECTOR_ALL | |||
#endif /* STM32H7 */ | |||
/** | |||
* @} | |||
@@ -564,7 +578,13 @@ | |||
#define GPIO_AF9_SDIO2 GPIO_AF9_SDMMC2 | |||
#define GPIO_AF10_SDIO2 GPIO_AF10_SDMMC2 | |||
#define GPIO_AF11_SDIO2 GPIO_AF11_SDMMC2 | |||
#endif | |||
#if defined (STM32H743xx) || defined (STM32H753xx) || defined (STM32H750xx) || defined (STM32H742xx) || defined (STM32H745xx) || defined (STM32H755xx) || defined (STM32H747xx) || defined (STM32H757xx) | |||
#define GPIO_AF10_OTG2_HS GPIO_AF10_OTG2_FS | |||
#define GPIO_AF10_OTG1_FS GPIO_AF10_OTG1_HS | |||
#define GPIO_AF12_OTG2_FS GPIO_AF12_OTG1_FS | |||
#endif /*STM32H743xx || STM32H753xx || STM32H750xx || STM32H742xx || STM32H745xx || STM32H755xx || STM32H747xx || STM32H757xx */ | |||
#endif /* STM32H7 */ | |||
#define GPIO_AF0_LPTIM GPIO_AF0_LPTIM1 | |||
#define GPIO_AF1_LPTIM GPIO_AF1_LPTIM1 | |||
@@ -623,6 +643,178 @@ | |||
#define HAL_HRTIM_ExternalEventCounterDisable HAL_HRTIM_ExtEventCounterDisable | |||
#define HAL_HRTIM_ExternalEventCounterReset HAL_HRTIM_ExtEventCounterReset | |||
#endif /* STM32G4 */ | |||
#if defined(STM32H7) | |||
#define HRTIM_OUTPUTSET_TIMAEV1_TIMBCMP1 HRTIM_OUTPUTSET_TIMEV_1 | |||
#define HRTIM_OUTPUTSET_TIMAEV2_TIMBCMP2 HRTIM_OUTPUTSET_TIMEV_2 | |||
#define HRTIM_OUTPUTSET_TIMAEV3_TIMCCMP2 HRTIM_OUTPUTSET_TIMEV_3 | |||
#define HRTIM_OUTPUTSET_TIMAEV4_TIMCCMP3 HRTIM_OUTPUTSET_TIMEV_4 | |||
#define HRTIM_OUTPUTSET_TIMAEV5_TIMDCMP1 HRTIM_OUTPUTSET_TIMEV_5 | |||
#define HRTIM_OUTPUTSET_TIMAEV6_TIMDCMP2 HRTIM_OUTPUTSET_TIMEV_6 | |||
#define HRTIM_OUTPUTSET_TIMAEV7_TIMECMP3 HRTIM_OUTPUTSET_TIMEV_7 | |||
#define HRTIM_OUTPUTSET_TIMAEV8_TIMECMP4 HRTIM_OUTPUTSET_TIMEV_8 | |||
#define HRTIM_OUTPUTSET_TIMAEV9_TIMFCMP4 HRTIM_OUTPUTSET_TIMEV_9 | |||
#define HRTIM_OUTPUTSET_TIMBEV1_TIMACMP1 HRTIM_OUTPUTSET_TIMEV_1 | |||
#define HRTIM_OUTPUTSET_TIMBEV2_TIMACMP2 HRTIM_OUTPUTSET_TIMEV_2 | |||
#define HRTIM_OUTPUTSET_TIMBEV3_TIMCCMP3 HRTIM_OUTPUTSET_TIMEV_3 | |||
#define HRTIM_OUTPUTSET_TIMBEV4_TIMCCMP4 HRTIM_OUTPUTSET_TIMEV_4 | |||
#define HRTIM_OUTPUTSET_TIMBEV5_TIMDCMP3 HRTIM_OUTPUTSET_TIMEV_5 | |||
#define HRTIM_OUTPUTSET_TIMBEV6_TIMDCMP4 HRTIM_OUTPUTSET_TIMEV_6 | |||
#define HRTIM_OUTPUTSET_TIMBEV7_TIMECMP1 HRTIM_OUTPUTSET_TIMEV_7 | |||
#define HRTIM_OUTPUTSET_TIMBEV8_TIMECMP2 HRTIM_OUTPUTSET_TIMEV_8 | |||
#define HRTIM_OUTPUTSET_TIMBEV9_TIMFCMP3 HRTIM_OUTPUTSET_TIMEV_9 | |||
#define HRTIM_OUTPUTSET_TIMCEV1_TIMACMP1 HRTIM_OUTPUTSET_TIMEV_1 | |||
#define HRTIM_OUTPUTSET_TIMCEV2_TIMACMP2 HRTIM_OUTPUTSET_TIMEV_2 | |||
#define HRTIM_OUTPUTSET_TIMCEV3_TIMBCMP2 HRTIM_OUTPUTSET_TIMEV_3 | |||
#define HRTIM_OUTPUTSET_TIMCEV4_TIMBCMP3 HRTIM_OUTPUTSET_TIMEV_4 | |||
#define HRTIM_OUTPUTSET_TIMCEV5_TIMDCMP2 HRTIM_OUTPUTSET_TIMEV_5 | |||
#define HRTIM_OUTPUTSET_TIMCEV6_TIMDCMP4 HRTIM_OUTPUTSET_TIMEV_6 | |||
#define HRTIM_OUTPUTSET_TIMCEV7_TIMECMP3 HRTIM_OUTPUTSET_TIMEV_7 | |||
#define HRTIM_OUTPUTSET_TIMCEV8_TIMECMP4 HRTIM_OUTPUTSET_TIMEV_8 | |||
#define HRTIM_OUTPUTSET_TIMCEV9_TIMFCMP2 HRTIM_OUTPUTSET_TIMEV_9 | |||
#define HRTIM_OUTPUTSET_TIMDEV1_TIMACMP1 HRTIM_OUTPUTSET_TIMEV_1 | |||
#define HRTIM_OUTPUTSET_TIMDEV2_TIMACMP4 HRTIM_OUTPUTSET_TIMEV_2 | |||
#define HRTIM_OUTPUTSET_TIMDEV3_TIMBCMP2 HRTIM_OUTPUTSET_TIMEV_3 | |||
#define HRTIM_OUTPUTSET_TIMDEV4_TIMBCMP4 HRTIM_OUTPUTSET_TIMEV_4 | |||
#define HRTIM_OUTPUTSET_TIMDEV5_TIMCCMP4 HRTIM_OUTPUTSET_TIMEV_5 | |||
#define HRTIM_OUTPUTSET_TIMDEV6_TIMECMP1 HRTIM_OUTPUTSET_TIMEV_6 | |||
#define HRTIM_OUTPUTSET_TIMDEV7_TIMECMP4 HRTIM_OUTPUTSET_TIMEV_7 | |||
#define HRTIM_OUTPUTSET_TIMDEV8_TIMFCMP1 HRTIM_OUTPUTSET_TIMEV_8 | |||
#define HRTIM_OUTPUTSET_TIMDEV9_TIMFCMP3 HRTIM_OUTPUTSET_TIMEV_9 | |||
#define HRTIM_OUTPUTSET_TIMEEV1_TIMACMP4 HRTIM_OUTPUTSET_TIMEV_1 | |||
#define HRTIM_OUTPUTSET_TIMEEV2_TIMBCMP3 HRTIM_OUTPUTSET_TIMEV_2 | |||
#define HRTIM_OUTPUTSET_TIMEEV3_TIMBCMP4 HRTIM_OUTPUTSET_TIMEV_3 | |||
#define HRTIM_OUTPUTSET_TIMEEV4_TIMCCMP1 HRTIM_OUTPUTSET_TIMEV_4 | |||
#define HRTIM_OUTPUTSET_TIMEEV5_TIMDCMP2 HRTIM_OUTPUTSET_TIMEV_5 | |||
#define HRTIM_OUTPUTSET_TIMEEV6_TIMDCMP1 HRTIM_OUTPUTSET_TIMEV_6 | |||
#define HRTIM_OUTPUTSET_TIMEEV7_TIMDCMP2 HRTIM_OUTPUTSET_TIMEV_7 | |||
#define HRTIM_OUTPUTSET_TIMEEV8_TIMFCMP3 HRTIM_OUTPUTSET_TIMEV_8 | |||
#define HRTIM_OUTPUTSET_TIMEEV9_TIMFCMP4 HRTIM_OUTPUTSET_TIMEV_9 | |||
#define HRTIM_OUTPUTSET_TIMFEV1_TIMACMP3 HRTIM_OUTPUTSET_TIMEV_1 | |||
#define HRTIM_OUTPUTSET_TIMFEV2_TIMBCMP1 HRTIM_OUTPUTSET_TIMEV_2 | |||
#define HRTIM_OUTPUTSET_TIMFEV3_TIMBCMP4 HRTIM_OUTPUTSET_TIMEV_3 | |||
#define HRTIM_OUTPUTSET_TIMFEV4_TIMCCMP1 HRTIM_OUTPUTSET_TIMEV_4 | |||
#define HRTIM_OUTPUTSET_TIMFEV5_TIMCCMP4 HRTIM_OUTPUTSET_TIMEV_5 | |||
#define HRTIM_OUTPUTSET_TIMFEV6_TIMDCMP3 HRTIM_OUTPUTSET_TIMEV_6 | |||
#define HRTIM_OUTPUTSET_TIMFEV7_TIMDCMP4 HRTIM_OUTPUTSET_TIMEV_7 | |||
#define HRTIM_OUTPUTSET_TIMFEV8_TIMECMP2 HRTIM_OUTPUTSET_TIMEV_8 | |||
#define HRTIM_OUTPUTSET_TIMFEV9_TIMECMP3 HRTIM_OUTPUTSET_TIMEV_9 | |||
#define HRTIM_OUTPUTRESET_TIMAEV1_TIMBCMP1 HRTIM_OUTPUTSET_TIMEV_1 | |||
#define HRTIM_OUTPUTRESET_TIMAEV2_TIMBCMP2 HRTIM_OUTPUTSET_TIMEV_2 | |||
#define HRTIM_OUTPUTRESET_TIMAEV3_TIMCCMP2 HRTIM_OUTPUTSET_TIMEV_3 | |||
#define HRTIM_OUTPUTRESET_TIMAEV4_TIMCCMP3 HRTIM_OUTPUTSET_TIMEV_4 | |||
#define HRTIM_OUTPUTRESET_TIMAEV5_TIMDCMP1 HRTIM_OUTPUTSET_TIMEV_5 | |||
#define HRTIM_OUTPUTRESET_TIMAEV6_TIMDCMP2 HRTIM_OUTPUTSET_TIMEV_6 | |||
#define HRTIM_OUTPUTRESET_TIMAEV7_TIMECMP3 HRTIM_OUTPUTSET_TIMEV_7 | |||
#define HRTIM_OUTPUTRESET_TIMAEV8_TIMECMP4 HRTIM_OUTPUTSET_TIMEV_8 | |||
#define HRTIM_OUTPUTRESET_TIMAEV9_TIMFCMP4 HRTIM_OUTPUTSET_TIMEV_9 | |||
#define HRTIM_OUTPUTRESET_TIMBEV1_TIMACMP1 HRTIM_OUTPUTSET_TIMEV_1 | |||
#define HRTIM_OUTPUTRESET_TIMBEV2_TIMACMP2 HRTIM_OUTPUTSET_TIMEV_2 | |||
#define HRTIM_OUTPUTRESET_TIMBEV3_TIMCCMP3 HRTIM_OUTPUTSET_TIMEV_3 | |||
#define HRTIM_OUTPUTRESET_TIMBEV4_TIMCCMP4 HRTIM_OUTPUTSET_TIMEV_4 | |||
#define HRTIM_OUTPUTRESET_TIMBEV5_TIMDCMP3 HRTIM_OUTPUTSET_TIMEV_5 | |||
#define HRTIM_OUTPUTRESET_TIMBEV6_TIMDCMP4 HRTIM_OUTPUTSET_TIMEV_6 | |||
#define HRTIM_OUTPUTRESET_TIMBEV7_TIMECMP1 HRTIM_OUTPUTSET_TIMEV_7 | |||
#define HRTIM_OUTPUTRESET_TIMBEV8_TIMECMP2 HRTIM_OUTPUTSET_TIMEV_8 | |||
#define HRTIM_OUTPUTRESET_TIMBEV9_TIMFCMP3 HRTIM_OUTPUTSET_TIMEV_9 | |||
#define HRTIM_OUTPUTRESET_TIMCEV1_TIMACMP1 HRTIM_OUTPUTSET_TIMEV_1 | |||
#define HRTIM_OUTPUTRESET_TIMCEV2_TIMACMP2 HRTIM_OUTPUTSET_TIMEV_2 | |||
#define HRTIM_OUTPUTRESET_TIMCEV3_TIMBCMP2 HRTIM_OUTPUTSET_TIMEV_3 | |||
#define HRTIM_OUTPUTRESET_TIMCEV4_TIMBCMP3 HRTIM_OUTPUTSET_TIMEV_4 | |||
#define HRTIM_OUTPUTRESET_TIMCEV5_TIMDCMP2 HRTIM_OUTPUTSET_TIMEV_5 | |||
#define HRTIM_OUTPUTRESET_TIMCEV6_TIMDCMP4 HRTIM_OUTPUTSET_TIMEV_6 | |||
#define HRTIM_OUTPUTRESET_TIMCEV7_TIMECMP3 HRTIM_OUTPUTSET_TIMEV_7 | |||
#define HRTIM_OUTPUTRESET_TIMCEV8_TIMECMP4 HRTIM_OUTPUTSET_TIMEV_8 | |||
#define HRTIM_OUTPUTRESET_TIMCEV9_TIMFCMP2 HRTIM_OUTPUTSET_TIMEV_9 | |||
#define HRTIM_OUTPUTRESET_TIMDEV1_TIMACMP1 HRTIM_OUTPUTSET_TIMEV_1 | |||
#define HRTIM_OUTPUTRESET_TIMDEV2_TIMACMP4 HRTIM_OUTPUTSET_TIMEV_2 | |||
#define HRTIM_OUTPUTRESET_TIMDEV3_TIMBCMP2 HRTIM_OUTPUTSET_TIMEV_3 | |||
#define HRTIM_OUTPUTRESET_TIMDEV4_TIMBCMP4 HRTIM_OUTPUTSET_TIMEV_4 | |||
#define HRTIM_OUTPUTRESET_TIMDEV5_TIMCCMP4 HRTIM_OUTPUTSET_TIMEV_5 | |||
#define HRTIM_OUTPUTRESET_TIMDEV6_TIMECMP1 HRTIM_OUTPUTSET_TIMEV_6 | |||
#define HRTIM_OUTPUTRESET_TIMDEV7_TIMECMP4 HRTIM_OUTPUTSET_TIMEV_7 | |||
#define HRTIM_OUTPUTRESET_TIMDEV8_TIMFCMP1 HRTIM_OUTPUTSET_TIMEV_8 | |||
#define HRTIM_OUTPUTRESET_TIMDEV9_TIMFCMP3 HRTIM_OUTPUTSET_TIMEV_9 | |||
#define HRTIM_OUTPUTRESET_TIMEEV1_TIMACMP4 HRTIM_OUTPUTSET_TIMEV_1 | |||
#define HRTIM_OUTPUTRESET_TIMEEV2_TIMBCMP3 HRTIM_OUTPUTSET_TIMEV_2 | |||
#define HRTIM_OUTPUTRESET_TIMEEV3_TIMBCMP4 HRTIM_OUTPUTSET_TIMEV_3 | |||
#define HRTIM_OUTPUTRESET_TIMEEV4_TIMCCMP1 HRTIM_OUTPUTSET_TIMEV_4 | |||
#define HRTIM_OUTPUTRESET_TIMEEV5_TIMDCMP2 HRTIM_OUTPUTSET_TIMEV_5 | |||
#define HRTIM_OUTPUTRESET_TIMEEV6_TIMDCMP1 HRTIM_OUTPUTSET_TIMEV_6 | |||
#define HRTIM_OUTPUTRESET_TIMEEV7_TIMDCMP2 HRTIM_OUTPUTSET_TIMEV_7 | |||
#define HRTIM_OUTPUTRESET_TIMEEV8_TIMFCMP3 HRTIM_OUTPUTSET_TIMEV_8 | |||
#define HRTIM_OUTPUTRESET_TIMEEV9_TIMFCMP4 HRTIM_OUTPUTSET_TIMEV_9 | |||
#define HRTIM_OUTPUTRESET_TIMFEV1_TIMACMP3 HRTIM_OUTPUTSET_TIMEV_1 | |||
#define HRTIM_OUTPUTRESET_TIMFEV2_TIMBCMP1 HRTIM_OUTPUTSET_TIMEV_2 | |||
#define HRTIM_OUTPUTRESET_TIMFEV3_TIMBCMP4 HRTIM_OUTPUTSET_TIMEV_3 | |||
#define HRTIM_OUTPUTRESET_TIMFEV4_TIMCCMP1 HRTIM_OUTPUTSET_TIMEV_4 | |||
#define HRTIM_OUTPUTRESET_TIMFEV5_TIMCCMP4 HRTIM_OUTPUTSET_TIMEV_5 | |||
#define HRTIM_OUTPUTRESET_TIMFEV6_TIMDCMP3 HRTIM_OUTPUTSET_TIMEV_6 | |||
#define HRTIM_OUTPUTRESET_TIMFEV7_TIMDCMP4 HRTIM_OUTPUTSET_TIMEV_7 | |||
#define HRTIM_OUTPUTRESET_TIMFEV8_TIMECMP2 HRTIM_OUTPUTSET_TIMEV_8 | |||
#define HRTIM_OUTPUTRESET_TIMFEV9_TIMECMP3 HRTIM_OUTPUTSET_TIMEV_9 | |||
#endif /* STM32H7 */ | |||
#if defined(STM32F3) | |||
/** @brief Constants defining available sources associated to external events. | |||
*/ | |||
#define HRTIM_EVENTSRC_1 (0x00000000U) | |||
#define HRTIM_EVENTSRC_2 (HRTIM_EECR1_EE1SRC_0) | |||
#define HRTIM_EVENTSRC_3 (HRTIM_EECR1_EE1SRC_1) | |||
#define HRTIM_EVENTSRC_4 (HRTIM_EECR1_EE1SRC_1 | HRTIM_EECR1_EE1SRC_0) | |||
/** @brief Constants defining the events that can be selected to configure the | |||
* set/reset crossbar of a timer output | |||
*/ | |||
#define HRTIM_OUTPUTSET_TIMEV_1 (HRTIM_SET1R_TIMEVNT1) | |||
#define HRTIM_OUTPUTSET_TIMEV_2 (HRTIM_SET1R_TIMEVNT2) | |||
#define HRTIM_OUTPUTSET_TIMEV_3 (HRTIM_SET1R_TIMEVNT3) | |||
#define HRTIM_OUTPUTSET_TIMEV_4 (HRTIM_SET1R_TIMEVNT4) | |||
#define HRTIM_OUTPUTSET_TIMEV_5 (HRTIM_SET1R_TIMEVNT5) | |||
#define HRTIM_OUTPUTSET_TIMEV_6 (HRTIM_SET1R_TIMEVNT6) | |||
#define HRTIM_OUTPUTSET_TIMEV_7 (HRTIM_SET1R_TIMEVNT7) | |||
#define HRTIM_OUTPUTSET_TIMEV_8 (HRTIM_SET1R_TIMEVNT8) | |||
#define HRTIM_OUTPUTSET_TIMEV_9 (HRTIM_SET1R_TIMEVNT9) | |||
#define HRTIM_OUTPUTRESET_TIMEV_1 (HRTIM_RST1R_TIMEVNT1) | |||
#define HRTIM_OUTPUTRESET_TIMEV_2 (HRTIM_RST1R_TIMEVNT2) | |||
#define HRTIM_OUTPUTRESET_TIMEV_3 (HRTIM_RST1R_TIMEVNT3) | |||
#define HRTIM_OUTPUTRESET_TIMEV_4 (HRTIM_RST1R_TIMEVNT4) | |||
#define HRTIM_OUTPUTRESET_TIMEV_5 (HRTIM_RST1R_TIMEVNT5) | |||
#define HRTIM_OUTPUTRESET_TIMEV_6 (HRTIM_RST1R_TIMEVNT6) | |||
#define HRTIM_OUTPUTRESET_TIMEV_7 (HRTIM_RST1R_TIMEVNT7) | |||
#define HRTIM_OUTPUTRESET_TIMEV_8 (HRTIM_RST1R_TIMEVNT8) | |||
#define HRTIM_OUTPUTRESET_TIMEV_9 (HRTIM_RST1R_TIMEVNT9) | |||
/** @brief Constants defining the event filtering applied to external events | |||
* by a timer | |||
*/ | |||
#define HRTIM_TIMEVENTFILTER_NONE (0x00000000U) | |||
#define HRTIM_TIMEVENTFILTER_BLANKINGCMP1 (HRTIM_EEFR1_EE1FLTR_0) | |||
#define HRTIM_TIMEVENTFILTER_BLANKINGCMP2 (HRTIM_EEFR1_EE1FLTR_1) | |||
#define HRTIM_TIMEVENTFILTER_BLANKINGCMP3 (HRTIM_EEFR1_EE1FLTR_1 | HRTIM_EEFR1_EE1FLTR_0) | |||
#define HRTIM_TIMEVENTFILTER_BLANKINGCMP4 (HRTIM_EEFR1_EE1FLTR_2) | |||
#define HRTIM_TIMEVENTFILTER_BLANKINGFLTR1 (HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_0) | |||
#define HRTIM_TIMEVENTFILTER_BLANKINGFLTR2 (HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_1) | |||
#define HRTIM_TIMEVENTFILTER_BLANKINGFLTR3 (HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_1 | HRTIM_EEFR1_EE1FLTR_0) | |||
#define HRTIM_TIMEVENTFILTER_BLANKINGFLTR4 (HRTIM_EEFR1_EE1FLTR_3) | |||
#define HRTIM_TIMEVENTFILTER_BLANKINGFLTR5 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_0) | |||
#define HRTIM_TIMEVENTFILTER_BLANKINGFLTR6 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_1) | |||
#define HRTIM_TIMEVENTFILTER_BLANKINGFLTR7 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_1 | HRTIM_EEFR1_EE1FLTR_0) | |||
#define HRTIM_TIMEVENTFILTER_BLANKINGFLTR8 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_2) | |||
#define HRTIM_TIMEVENTFILTER_WINDOWINGCMP2 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_0) | |||
#define HRTIM_TIMEVENTFILTER_WINDOWINGCMP3 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_1) | |||
#define HRTIM_TIMEVENTFILTER_WINDOWINGTIM (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_1 | HRTIM_EEFR1_EE1FLTR_0) | |||
/** @brief Constants defining the DLL calibration periods (in micro seconds) | |||
*/ | |||
#define HRTIM_CALIBRATIONRATE_7300 0x00000000U | |||
#define HRTIM_CALIBRATIONRATE_910 (HRTIM_DLLCR_CALRTE_0) | |||
#define HRTIM_CALIBRATIONRATE_114 (HRTIM_DLLCR_CALRTE_1) | |||
#define HRTIM_CALIBRATIONRATE_14 (HRTIM_DLLCR_CALRTE_1 | HRTIM_DLLCR_CALRTE_0) | |||
#endif /* STM32F3 */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -762,7 +954,7 @@ | |||
#define OPAMP_PGACONNECT_VM0 OPAMP_PGA_CONNECT_INVERTINGINPUT_IO0 | |||
#define OPAMP_PGACONNECT_VM1 OPAMP_PGA_CONNECT_INVERTINGINPUT_IO1 | |||
#if defined(STM32L1) || defined(STM32L4) | |||
#if defined(STM32L1) || defined(STM32L4) || defined(STM32L5) || defined(STM32H7) || defined(STM32G4) | |||
#define HAL_OPAMP_MSP_INIT_CB_ID HAL_OPAMP_MSPINIT_CB_ID | |||
#define HAL_OPAMP_MSP_DEINIT_CB_ID HAL_OPAMP_MSPDEINIT_CB_ID | |||
#endif | |||
@@ -853,6 +1045,16 @@ | |||
#define RTC_TAMPERPIN_PA0 RTC_TAMPERPIN_POS1 | |||
#define RTC_TAMPERPIN_PI8 RTC_TAMPERPIN_POS1 | |||
#if defined(STM32H7) | |||
#define RTC_TAMPCR_TAMPXE RTC_TAMPER_X | |||
#define RTC_TAMPCR_TAMPXIE RTC_TAMPER_X_INTERRUPT | |||
#define RTC_TAMPER1_INTERRUPT RTC_IT_TAMP1 | |||
#define RTC_TAMPER2_INTERRUPT RTC_IT_TAMP2 | |||
#define RTC_TAMPER3_INTERRUPT RTC_IT_TAMP3 | |||
#define RTC_ALL_TAMPER_INTERRUPT RTC_IT_TAMPALL | |||
#endif /* STM32H7 */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -1246,6 +1448,30 @@ | |||
#define HASH_HMACKeyType_ShortKey HASH_HMAC_KEYTYPE_SHORTKEY | |||
#define HASH_HMACKeyType_LongKey HASH_HMAC_KEYTYPE_LONGKEY | |||
#if defined(STM32L4) || defined(STM32L5) || defined(STM32F4) || defined(STM32F7) || defined(STM32H7) | |||
#define HAL_HASH_MD5_Accumulate HAL_HASH_MD5_Accmlt | |||
#define HAL_HASH_MD5_Accumulate_End HAL_HASH_MD5_Accmlt_End | |||
#define HAL_HASH_MD5_Accumulate_IT HAL_HASH_MD5_Accmlt_IT | |||
#define HAL_HASH_MD5_Accumulate_End_IT HAL_HASH_MD5_Accmlt_End_IT | |||
#define HAL_HASH_SHA1_Accumulate HAL_HASH_SHA1_Accmlt | |||
#define HAL_HASH_SHA1_Accumulate_End HAL_HASH_SHA1_Accmlt_End | |||
#define HAL_HASH_SHA1_Accumulate_IT HAL_HASH_SHA1_Accmlt_IT | |||
#define HAL_HASH_SHA1_Accumulate_End_IT HAL_HASH_SHA1_Accmlt_End_IT | |||
#define HAL_HASHEx_SHA224_Accumulate HAL_HASHEx_SHA224_Accmlt | |||
#define HAL_HASHEx_SHA224_Accumulate_End HAL_HASHEx_SHA224_Accmlt_End | |||
#define HAL_HASHEx_SHA224_Accumulate_IT HAL_HASHEx_SHA224_Accmlt_IT | |||
#define HAL_HASHEx_SHA224_Accumulate_End_IT HAL_HASHEx_SHA224_Accmlt_End_IT | |||
#define HAL_HASHEx_SHA256_Accumulate HAL_HASHEx_SHA256_Accmlt | |||
#define HAL_HASHEx_SHA256_Accumulate_End HAL_HASHEx_SHA256_Accmlt_End | |||
#define HAL_HASHEx_SHA256_Accumulate_IT HAL_HASHEx_SHA256_Accmlt_IT | |||
#define HAL_HASHEx_SHA256_Accumulate_End_IT HAL_HASHEx_SHA256_Accmlt_End_IT | |||
#endif /* STM32L4 || STM32L5 || STM32F4 || STM32F7 || STM32H7 */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -1268,6 +1494,13 @@ | |||
#endif | |||
#define HAL_ADC_EnableBuffer_Cmd(cmd) (((cmd)==ENABLE) ? HAL_ADCEx_EnableVREFINT() : HAL_ADCEx_DisableVREFINT()) | |||
#define HAL_ADC_EnableBufferSensor_Cmd(cmd) (((cmd)==ENABLE) ? HAL_ADCEx_EnableVREFINTTempSensor() : HAL_ADCEx_DisableVREFINTTempSensor()) | |||
#if defined(STM32H7A3xx) || defined(STM32H7B3xx) || defined(STM32H7B0xx) || defined(STM32H7A3xxQ) || defined(STM32H7B3xxQ) || defined(STM32H7B0xxQ) | |||
#define HAL_EnableSRDomainDBGStopMode HAL_EnableDomain3DBGStopMode | |||
#define HAL_DisableSRDomainDBGStopMode HAL_DisableDomain3DBGStopMode | |||
#define HAL_EnableSRDomainDBGStandbyMode HAL_EnableDomain3DBGStandbyMode | |||
#define HAL_DisableSRDomainDBGStandbyMode HAL_DisableDomain3DBGStandbyMode | |||
#endif /* STM32H7A3xx || STM32H7B3xx || STM32H7B0xx || STM32H7A3xxQ || STM32H7B3xxQ || STM32H7B0xxQ */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -1297,16 +1530,18 @@ | |||
#define HAL_I2CFastModePlusConfig(SYSCFG_I2CFastModePlus, cmd) (((cmd)==ENABLE)? HAL_I2CEx_EnableFastModePlus(SYSCFG_I2CFastModePlus): HAL_I2CEx_DisableFastModePlus(SYSCFG_I2CFastModePlus)) | |||
#if defined(STM32H7) || defined(STM32WB) || defined(STM32G0) || defined(STM32F4) || defined(STM32F7) || defined(STM32L0) || defined(STM32L4) | |||
#if defined(STM32H7) || defined(STM32WB) || defined(STM32G0) || defined(STM32F0) || defined(STM32F1) || defined(STM32F2) || defined(STM32F3) || defined(STM32F4) || defined(STM32F7) || defined(STM32L0) || defined(STM32L4) || defined(STM32L5) || defined(STM32G4) | |||
#define HAL_I2C_Master_Sequential_Transmit_IT HAL_I2C_Master_Seq_Transmit_IT | |||
#define HAL_I2C_Master_Sequential_Receive_IT HAL_I2C_Master_Seq_Receive_IT | |||
#define HAL_I2C_Slave_Sequential_Transmit_IT HAL_I2C_Slave_Seq_Transmit_IT | |||
#define HAL_I2C_Slave_Sequential_Receive_IT HAL_I2C_Slave_Seq_Receive_IT | |||
#endif /* STM32H7 || STM32WB || STM32G0 || STM32F0 || STM32F1 || STM32F2 || STM32F3 || STM32F4 || STM32F7 || STM32L0 || STM32L4 || STM32L5 || STM32G4 */ | |||
#if defined(STM32H7) || defined(STM32WB) || defined(STM32G0) || defined(STM32F4) || defined(STM32F7) || defined(STM32L0) || defined(STM32L4) || defined(STM32L5) || defined(STM32G4) | |||
#define HAL_I2C_Master_Sequential_Transmit_DMA HAL_I2C_Master_Seq_Transmit_DMA | |||
#define HAL_I2C_Master_Sequential_Receive_DMA HAL_I2C_Master_Seq_Receive_DMA | |||
#define HAL_I2C_Slave_Sequential_Transmit_DMA HAL_I2C_Slave_Seq_Transmit_DMA | |||
#define HAL_I2C_Slave_Sequential_Receive_DMA HAL_I2C_Slave_Seq_Receive_DMA | |||
#endif /* STM32H7 || STM32WB || STM32G0 || STM32F4 || STM32F7 || STM32L0 || STM32L4 */ | |||
#endif /* STM32H7 || STM32WB || STM32G0 || STM32F4 || STM32F7 || STM32L0 || STM32L4 || STM32L5 || STM32G4 */ | |||
#if defined(STM32F4) | |||
#define HAL_FMPI2C_Master_Sequential_Transmit_IT HAL_FMPI2C_Master_Seq_Transmit_IT | |||
@@ -1325,6 +1560,13 @@ | |||
/** @defgroup HAL_PWR_Aliased HAL PWR Aliased maintained for legacy purpose | |||
* @{ | |||
*/ | |||
#if defined(STM32G0) | |||
#define HAL_PWR_ConfigPVD HAL_PWREx_ConfigPVD | |||
#define HAL_PWR_EnablePVD HAL_PWREx_EnablePVD | |||
#define HAL_PWR_DisablePVD HAL_PWREx_DisablePVD | |||
#define HAL_PWR_PVD_IRQHandler HAL_PWREx_PVD_IRQHandler | |||
#endif | |||
#define HAL_PWR_PVDConfig HAL_PWR_ConfigPVD | |||
#define HAL_PWR_DisableBkUpReg HAL_PWREx_DisableBkUpReg | |||
#define HAL_PWR_DisableFlashPowerDown HAL_PWREx_DisableFlashPowerDown | |||
@@ -1397,14 +1639,14 @@ | |||
#define HAL_TIM_DMAError TIM_DMAError | |||
#define HAL_TIM_DMACaptureCplt TIM_DMACaptureCplt | |||
#define HAL_TIMEx_DMACommutationCplt TIMEx_DMACommutationCplt | |||
#if defined(STM32H7) || defined(STM32G0) || defined(STM32F7) || defined(STM32F4) || defined(STM32L0) | |||
#if defined(STM32H7) || defined(STM32G0) || defined(STM32F0) || defined(STM32F1) || defined(STM32F2) || defined(STM32F3) || defined(STM32F4) || defined(STM32F7) || defined(STM32L0) || defined(STM32L4) | |||
#define HAL_TIM_SlaveConfigSynchronization HAL_TIM_SlaveConfigSynchro | |||
#define HAL_TIM_SlaveConfigSynchronization_IT HAL_TIM_SlaveConfigSynchro_IT | |||
#define HAL_TIMEx_CommutationCallback HAL_TIMEx_CommutCallback | |||
#define HAL_TIMEx_ConfigCommutationEvent HAL_TIMEx_ConfigCommutEvent | |||
#define HAL_TIMEx_ConfigCommutationEvent_IT HAL_TIMEx_ConfigCommutEvent_IT | |||
#define HAL_TIMEx_ConfigCommutationEvent_DMA HAL_TIMEx_ConfigCommutEvent_DMA | |||
#endif /* STM32H7 || STM32G0 || STM32F7 || STM32F4 || STM32L0 */ | |||
#endif /* STM32H7 || STM32G0 || STM32F0 || STM32F1 || STM32F2 || STM32F3 || STM32F4 || STM32F7 || STM32L0 */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -3000,9 +3242,8 @@ | |||
#define RCC_MCOSOURCE_PLLCLK_NODIV RCC_MCO1SOURCE_PLLCLK | |||
#define RCC_MCOSOURCE_PLLCLK_DIV2 RCC_MCO1SOURCE_PLLCLK_DIV2 | |||
#if defined(STM32L4) | |||
#if defined(STM32L4) || defined(STM32WB) || defined(STM32G0) || defined(STM32G4) || defined(STM32L5) || defined(STM32WL) | |||
#define RCC_RTCCLKSOURCE_NO_CLK RCC_RTCCLKSOURCE_NONE | |||
#elif defined(STM32WB) || defined(STM32G0) || defined(STM32G4) | |||
#else | |||
#define RCC_RTCCLKSOURCE_NONE RCC_RTCCLKSOURCE_NO_CLK | |||
#endif | |||
@@ -3130,7 +3371,7 @@ | |||
/** @defgroup HAL_RTC_Aliased_Macros HAL RTC Aliased Macros maintained for legacy purpose | |||
* @{ | |||
*/ | |||
#if defined (STM32G0) || defined (STM32L412xx) || defined (STM32L422xx) || defined (STM32G4) | |||
#if defined (STM32G0) || defined (STM32L5) || defined (STM32L412xx) || defined (STM32L422xx) || defined (STM32L4P5xx) || defined (STM32L4Q5xx) || defined (STM32G4) || defined STM32WL | |||
#else | |||
#define __HAL_RTC_CLEAR_FLAG __HAL_RTC_EXTI_CLEAR_FLAG | |||
#endif | |||
@@ -3239,21 +3480,21 @@ | |||
#define __HAL_SD_SDIO_GET_IT __HAL_SD_SDMMC_GET_IT | |||
#define __HAL_SD_SDIO_CLEAR_IT __HAL_SD_SDMMC_CLEAR_IT | |||
#define SDIO_STATIC_FLAGS SDMMC_STATIC_FLAGS | |||
#define SDIO_CMD0TIMEOUT SDMMC_CMD0TIMEOUT | |||
#define SD_SDIO_SEND_IF_COND SD_SDMMC_SEND_IF_COND | |||
#define SDIO_CMD0TIMEOUT SDMMC_CMD0TIMEOUT | |||
#define SD_SDIO_SEND_IF_COND SD_SDMMC_SEND_IF_COND | |||
/* alias CMSIS for compatibilities */ | |||
#define SDIO_IRQn SDMMC1_IRQn | |||
#define SDIO_IRQHandler SDMMC1_IRQHandler | |||
#endif | |||
#if defined(STM32F7) || defined(STM32F4) || defined(STM32F2) || defined(STM32L4) | |||
#if defined(STM32F7) || defined(STM32F4) || defined(STM32F2) || defined(STM32L4) || defined(STM32H7) | |||
#define HAL_SD_CardCIDTypedef HAL_SD_CardCIDTypeDef | |||
#define HAL_SD_CardCSDTypedef HAL_SD_CardCSDTypeDef | |||
#define HAL_SD_CardStatusTypedef HAL_SD_CardStatusTypeDef | |||
#define HAL_SD_CardStateTypedef HAL_SD_CardStateTypeDef | |||
#endif | |||
#if defined(STM32H7) | |||
#if defined(STM32H7) || defined(STM32L5) | |||
#define HAL_MMCEx_Read_DMADoubleBuffer0CpltCallback HAL_MMCEx_Read_DMADoubleBuf0CpltCallback | |||
#define HAL_MMCEx_Read_DMADoubleBuffer1CpltCallback HAL_MMCEx_Read_DMADoubleBuf1CpltCallback | |||
#define HAL_MMCEx_Write_DMADoubleBuffer0CpltCallback HAL_MMCEx_Write_DMADoubleBuf0CpltCallback | |||
@@ -3494,12 +3735,12 @@ | |||
* @{ | |||
*/ | |||
#if defined (STM32H7) || defined (STM32G4) || defined (STM32F3) | |||
#define HAL_HRTIM_WaveformCounterStart_IT HAL_HRTIM_WaveformCountStart_IT | |||
#define HAL_HRTIM_WaveformCounterStart_DMA HAL_HRTIM_WaveformCountStart_DMA | |||
#define HAL_HRTIM_WaveformCounterStart HAL_HRTIM_WaveformCountStart | |||
#define HAL_HRTIM_WaveformCounterStop_IT HAL_HRTIM_WaveformCountStop_IT | |||
#define HAL_HRTIM_WaveformCounterStop_DMA HAL_HRTIM_WaveformCountStop_DMA | |||
#define HAL_HRTIM_WaveformCounterStop HAL_HRTIM_WaveformCountStop | |||
#define HAL_HRTIM_WaveformCounterStart_IT HAL_HRTIM_WaveformCountStart_IT | |||
#define HAL_HRTIM_WaveformCounterStart_DMA HAL_HRTIM_WaveformCountStart_DMA | |||
#define HAL_HRTIM_WaveformCounterStart HAL_HRTIM_WaveformCountStart | |||
#define HAL_HRTIM_WaveformCounterStop_IT HAL_HRTIM_WaveformCountStop_IT | |||
#define HAL_HRTIM_WaveformCounterStop_DMA HAL_HRTIM_WaveformCountStop_DMA | |||
#define HAL_HRTIM_WaveformCounterStop HAL_HRTIM_WaveformCountStop | |||
#endif | |||
/** | |||
* @} | |||
@@ -3508,9 +3749,9 @@ | |||
/** @defgroup HAL_QSPI_Aliased_Macros HAL QSPI Aliased Macros maintained for legacy purpose | |||
* @{ | |||
*/ | |||
#if defined (STM32L4) | |||
#if defined (STM32L4) || defined (STM32F4) || defined (STM32F7) || defined(STM32H7) | |||
#define HAL_QPSI_TIMEOUT_DEFAULT_VALUE HAL_QSPI_TIMEOUT_DEFAULT_VALUE | |||
#endif | |||
#endif /* STM32L4 || STM32F4 || STM32F7 */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -38,23 +38,26 @@ | |||
* @{ | |||
*/ | |||
/* Exported constants --------------------------------------------------------*/ | |||
/** @defgroup HAL_Exported_Constants HAL Exported Constants | |||
* @{ | |||
*/ | |||
/** @defgroup HAL_TICK_FREQ Tick Frequency | |||
* @{ | |||
*/ | |||
#define HAL_TICK_FREQ_10HZ 100U | |||
#define HAL_TICK_FREQ_100HZ 10U | |||
#define HAL_TICK_FREQ_1KHZ 1U | |||
#define HAL_TICK_FREQ_DEFAULT HAL_TICK_FREQ_1KHZ | |||
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; | |||
/** | |||
* @} | |||
*/ | |||
/* Exported constants --------------------------------------------------------*/ | |||
/** @defgroup HAL_Exported_Constants HAL Exported Constants | |||
* @{ | |||
*/ | |||
/** @defgroup SYSCFG_Exported_Constants SYSCFG Exported Constants | |||
* @{ | |||
*/ | |||
@@ -65,7 +68,9 @@ | |||
#define SYSCFG_BOOT_MAINFLASH LL_SYSCFG_REMAP_FLASH /*!< Main Flash memory mapped at 0x00000000 */ | |||
#define SYSCFG_BOOT_SYSTEMFLASH LL_SYSCFG_REMAP_SYSTEMFLASH /*!< System Flash memory mapped at 0x00000000 */ | |||
#define SYSCFG_BOOT_SRAM LL_SYSCFG_REMAP_SRAM /*!< SRAM1 mapped at 0x00000000 */ | |||
#if defined(LL_SYSCFG_REMAP_QUADSPI) | |||
#define SYSCFG_BOOT_QUADSPI LL_SYSCFG_REMAP_QUADSPI /*!< QUADSPI memory mapped at 0x00000000 */ | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
@@ -215,7 +220,9 @@ | |||
/** @defgroup Secure_IP_Write_Access Secure IP Write Access | |||
* @{ | |||
*/ | |||
#if defined(LL_SYSCFG_SECURE_ACCESS_AES1) | |||
#define HAL_SYSCFG_SECURE_ACCESS_AES1 LL_SYSCFG_SECURE_ACCESS_AES1 /*!< Enabling the security access of Advanced Encryption Standard 1 KEY[7:0] */ | |||
#endif | |||
#define HAL_SYSCFG_SECURE_ACCESS_AES2 LL_SYSCFG_SECURE_ACCESS_AES2 /*!< Enabling the security access of Advanced Encryption Standard 2 */ | |||
#define HAL_SYSCFG_SECURE_ACCESS_PKA LL_SYSCFG_SECURE_ACCESS_PKA /*!< Enabling the security access of Public Key Accelerator */ | |||
#define HAL_SYSCFG_SECURE_ACCESS_RNG LL_SYSCFG_SECURE_ACCESS_RNG /*!< Enabling the security access of Random Number Generator */ | |||
@@ -382,9 +389,11 @@ | |||
*/ | |||
#define __HAL_SYSCFG_REMAPMEMORY_SRAM() LL_SYSCFG_SetRemapMemory(LL_SYSCFG_REMAP_SRAM) | |||
#if defined(LL_SYSCFG_REMAP_QUADSPI) | |||
/** @brief QUADSPI mapped at 0x00000000. | |||
*/ | |||
#define __HAL_SYSCFG_REMAPMEMORY_QUADSPI() LL_SYSCFG_SetRemapMemory(LL_SYSCFG_REMAP_QUADSPI) | |||
#endif | |||
/** | |||
* @brief Return the boot mode as configured by user. | |||
@@ -393,7 +402,9 @@ | |||
* @arg @ref SYSCFG_BOOT_MAINFLASH | |||
* @arg @ref SYSCFG_BOOT_SYSTEMFLASH | |||
* @arg @ref SYSCFG_BOOT_SRAM | |||
#if defined(LL_SYSCFG_REMAP_QUADSPI) | |||
* @arg @ref SYSCFG_BOOT_QUADSPI | |||
#endif | |||
*/ | |||
#define __HAL_SYSCFG_GET_BOOT_MODE() LL_SYSCFG_GetRemapMemory() | |||
@@ -510,6 +521,7 @@ | |||
#define IS_SYSCFG_SRAM2WRP_PAGE(__PAGE__) (((__PAGE__) > 0U) && ((__PAGE__) <= 0xFFFFFFFFU)) | |||
#if defined(VREFBUF) | |||
#define IS_SYSCFG_VREFBUF_VOLTAGE_SCALE(__SCALE__) (((__SCALE__) == SYSCFG_VREFBUF_VOLTAGE_SCALE0) || \ | |||
((__SCALE__) == SYSCFG_VREFBUF_VOLTAGE_SCALE1)) | |||
@@ -517,16 +529,23 @@ | |||
((__VALUE__) == SYSCFG_VREFBUF_HIGH_IMPEDANCE_ENABLE)) | |||
#define IS_SYSCFG_VREFBUF_TRIMMING(__VALUE__) (((__VALUE__) > 0U) && ((__VALUE__) <= VREFBUF_CCR_TRIM)) | |||
#endif | |||
#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)) | |||
#if defined(LL_SYSCFG_SECURE_ACCESS_AES1) | |||
#define IS_SYSCFG_SECURITY_ACCESS(__VALUE__) ((((__VALUE__) & HAL_SYSCFG_SECURE_ACCESS_AES1) == HAL_SYSCFG_SECURE_ACCESS_AES1) || \ | |||
(((__VALUE__) & HAL_SYSCFG_SECURE_ACCESS_AES2) == HAL_SYSCFG_SECURE_ACCESS_AES2) || \ | |||
(((__VALUE__) & HAL_SYSCFG_SECURE_ACCESS_PKA) == HAL_SYSCFG_SECURE_ACCESS_PKA) || \ | |||
(((__VALUE__) & HAL_SYSCFG_SECURE_ACCESS_RNG) == HAL_SYSCFG_SECURE_ACCESS_RNG)) | |||
#else | |||
#define IS_SYSCFG_SECURITY_ACCESS(__VALUE__) ((((__VALUE__) & HAL_SYSCFG_SECURE_ACCESS_AES2) == HAL_SYSCFG_SECURE_ACCESS_AES2) || \ | |||
(((__VALUE__) & HAL_SYSCFG_SECURE_ACCESS_PKA) == HAL_SYSCFG_SECURE_ACCESS_PKA) || \ | |||
(((__VALUE__) & HAL_SYSCFG_SECURE_ACCESS_RNG) == HAL_SYSCFG_SECURE_ACCESS_RNG)) | |||
#endif | |||
/** | |||
* @} | |||
@@ -578,8 +597,8 @@ void HAL_IncTick(void); | |||
void HAL_Delay(uint32_t Delay); | |||
uint32_t HAL_GetTick(void); | |||
uint32_t HAL_GetTickPrio(void); | |||
HAL_StatusTypeDef HAL_SetTickFreq(uint32_t Freq); | |||
uint32_t HAL_GetTickFreq(void); | |||
HAL_StatusTypeDef HAL_SetTickFreq(HAL_TickFreqTypeDef Freq); | |||
HAL_TickFreqTypeDef HAL_GetTickFreq(void); | |||
void HAL_SuspendTick(void); | |||
void HAL_ResumeTick(void); | |||
uint32_t HAL_GetHalVersion(void); | |||
@@ -614,7 +633,7 @@ void HAL_DBGMCU_DisableDBGStandbyMode(void); | |||
*/ | |||
extern __IO uint32_t uwTick; | |||
extern uint32_t uwTickPrio; | |||
extern uint32_t uwTickFreq; | |||
extern HAL_TickFreqTypeDef uwTickFreq; | |||
/** | |||
* @} | |||
*/ | |||
@@ -628,11 +647,13 @@ void HAL_SYSCFG_SRAM2Erase(void); | |||
void HAL_SYSCFG_DisableSRAMFetch(void); | |||
uint32_t HAL_SYSCFG_IsEnabledSRAMFetch(void); | |||
#if defined(VREFBUF) | |||
void HAL_SYSCFG_VREFBUF_VoltageScalingConfig(uint32_t VoltageScaling); | |||
void HAL_SYSCFG_VREFBUF_HighImpedanceConfig(uint32_t Mode); | |||
void HAL_SYSCFG_VREFBUF_TrimmingConfig(uint32_t TrimmingValue); | |||
HAL_StatusTypeDef HAL_SYSCFG_EnableVREFBUF(void); | |||
void HAL_SYSCFG_DisableVREFBUF(void); | |||
#endif | |||
void HAL_SYSCFG_EnableIOBooster(void); | |||
void HAL_SYSCFG_DisableIOBooster(void); | |||
@@ -22,7 +22,7 @@ | |||
#define STM32WBxx_HAL_ADC_H | |||
#ifdef __cplusplus | |||
extern "C" { | |||
extern "C" { | |||
#endif | |||
/* Includes ------------------------------------------------------------------*/ | |||
@@ -66,7 +66,7 @@ typedef struct | |||
(the oversampling buffer is zeroed during injection sequence). | |||
This parameter can be a value of @ref ADC_HAL_EC_OVS_SCOPE_REG */ | |||
}ADC_OversamplingTypeDef; | |||
} ADC_OversamplingTypeDef; | |||
/** | |||
* @brief Structure definition of ADC instance and ADC group regular. | |||
@@ -89,6 +89,10 @@ typedef struct | |||
uint32_t ClockPrescaler; /*!< Select ADC clock source (synchronous clock derived from APB clock or asynchronous clock derived from system clock or PLL (Refer to reference manual for list of clocks available)) and clock prescaler. | |||
This parameter can be a value of @ref ADC_HAL_EC_COMMON_CLOCK_SOURCE. | |||
Note: The ADC clock configuration is common to all ADC instances. | |||
Note: ADC clock source and prescaler must be selected in function of system clock to not exceed ADC maximum frequency, depending on devices. | |||
Example: STM32WB55xx ADC maximum frequency is 64MHz (corresponding to 4.27Msmp/s maximum) | |||
Example: STM32WB50xx ADC maximum frequency is 32MHz (corresponding to 2.13Msmp/s maximum) | |||
For ADC maximum frequency, refer to datasheet of the selected device. | |||
Note: In case of usage of channels on injected group, ADC frequency should be lower than AHB clock frequency /4 for resolution 12 or 10 bits, | |||
AHB clock frequency /3 for resolution 8 bits, AHB clock frequency /2 for resolution 6 bits. | |||
Note: In case of synchronous clock mode based on HCLK/1, the configuration must be enabled only | |||
@@ -121,8 +125,8 @@ typedef struct | |||
This feature automatically adapts the frequency of ADC conversions triggers to the speed of the system that reads the data. Moreover, this avoids risk of overrun | |||
for low frequency applications. | |||
This parameter can be set to ENABLE or DISABLE. | |||
Note: Do not use with interruption or DMA (HAL_ADC_Start_IT(), HAL_ADC_Start_DMA()) since they clear immediately the EOC flag | |||
to free the IRQ vector sequencer. | |||
Note: It is not recommended to use with interruption or DMA (HAL_ADC_Start_IT(), HAL_ADC_Start_DMA()) since these modes have to clear immediately the EOC flag (by CPU to free the IRQ pending event or by DMA). | |||
Auto wait will work but fort a very short time, discarding its intended benefit (except specific case of high load of CPU or DMA transfers which can justify usage of auto wait). | |||
Do use with polling: 1. Start conversion with HAL_ADC_Start(), 2. Later on, when ADC conversion data is needed: | |||
use HAL_ADC_PollForConversion() to ensure that conversion is completed and HAL_ADC_GetValue() to retrieve conversion result and trig another conversion start. | |||
(in case of usage of ADC group injected, use the equivalent functions HAL_ADCExInjected_Start(), HAL_ADCEx_InjectedGetValue(), ...). */ | |||
@@ -179,7 +183,7 @@ typedef struct | |||
ADC_OversamplingTypeDef Oversampling; /*!< Specify the Oversampling parameters. | |||
Caution: this setting overwrites the previous oversampling configuration if oversampling is already enabled. */ | |||
}ADC_InitTypeDef; | |||
} ADC_InitTypeDef; | |||
/** | |||
* @brief Structure definition of ADC channel for regular group | |||
@@ -237,7 +241,7 @@ typedef struct | |||
Note: This parameter must be modified when no conversion is on going on both regular and injected groups (ADC disabled, or ADC enabled | |||
without continuous mode or external trigger that could launch a conversion). */ | |||
}ADC_ChannelConfTypeDef; | |||
} ADC_ChannelConfTypeDef; | |||
/** | |||
* @brief Structure definition of ADC analog watchdog | |||
@@ -284,7 +288,7 @@ typedef struct | |||
impacted: the comparison of analog watchdog thresholds is done on | |||
oversampling final computation (after ratio and shift application): | |||
ADC data register bitfield [15:4] (12 most significant bits). */ | |||
}ADC_AnalogWDGConfTypeDef; | |||
} ADC_AnalogWDGConfTypeDef; | |||
/** | |||
* @brief ADC group injected contexts queue configuration | |||
@@ -297,7 +301,7 @@ typedef struct | |||
JSQR register at HAL_ADCEx_InjectedConfigChannel() last call */ | |||
uint32_t ChannelCount; /*!< Number of channels in the injected sequence */ | |||
}ADC_InjectionConfigTypeDef; | |||
} ADC_InjectionConfigTypeDef; | |||
/** @defgroup ADC_States ADC States | |||
* @{ | |||
@@ -377,7 +381,7 @@ typedef struct | |||
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; | |||
} ADC_HandleTypeDef; | |||
#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1) | |||
/** | |||
@@ -969,10 +973,10 @@ typedef void (*pADC_CallbackTypeDef)(ADC_HandleTypeDef *hadc); /*!< pointer to | |||
#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) | |||
(__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) | |||
@@ -1129,7 +1133,7 @@ typedef void (*pADC_CallbackTypeDef)(ADC_HandleTypeDef *hadc); /*!< pointer to | |||
* @retval Value between Min_Data=0 and Max_Data=18 | |||
*/ | |||
#define __HAL_ADC_CHANNEL_TO_DECIMAL_NB(__CHANNEL__) \ | |||
__LL_ADC_CHANNEL_TO_DECIMAL_NB((__CHANNEL__)) | |||
__LL_ADC_CHANNEL_TO_DECIMAL_NB((__CHANNEL__)) | |||
/** | |||
* @brief Helper macro to get ADC channel in literal format ADC_CHANNEL_x | |||
@@ -1169,7 +1173,7 @@ typedef void (*pADC_CallbackTypeDef)(ADC_HandleTypeDef *hadc); /*!< pointer to | |||
* using helper macro @ref __LL_ADC_CHANNEL_INTERNAL_TO_EXTERNAL(). | |||
*/ | |||
#define __HAL_ADC_DECIMAL_NB_TO_CHANNEL(__DECIMAL_NB__) \ | |||
__LL_ADC_DECIMAL_NB_TO_CHANNEL((__DECIMAL_NB__)) | |||
__LL_ADC_DECIMAL_NB_TO_CHANNEL((__DECIMAL_NB__)) | |||
/** | |||
* @brief Helper macro to determine whether the selected channel | |||
@@ -1218,7 +1222,7 @@ typedef void (*pADC_CallbackTypeDef)(ADC_HandleTypeDef *hadc); /*!< pointer to | |||
* Value "1" if the channel corresponds to a parameter definition of a ADC internal channel. | |||
*/ | |||
#define __HAL_ADC_IS_CHANNEL_INTERNAL(__CHANNEL__) \ | |||
__LL_ADC_IS_CHANNEL_INTERNAL((__CHANNEL__)) | |||
__LL_ADC_IS_CHANNEL_INTERNAL((__CHANNEL__)) | |||
/** | |||
* @brief Helper macro to convert a channel defined from parameter | |||
@@ -1281,7 +1285,7 @@ typedef void (*pADC_CallbackTypeDef)(ADC_HandleTypeDef *hadc); /*!< pointer to | |||
* @arg @ref ADC_CHANNEL_18 | |||
*/ | |||
#define __HAL_ADC_CHANNEL_INTERNAL_TO_EXTERNAL(__CHANNEL__) \ | |||
__LL_ADC_CHANNEL_INTERNAL_TO_EXTERNAL((__CHANNEL__)) | |||
__LL_ADC_CHANNEL_INTERNAL_TO_EXTERNAL((__CHANNEL__)) | |||
/** | |||
* @brief Helper macro to determine whether the internal channel | |||
@@ -1305,7 +1309,7 @@ typedef void (*pADC_CallbackTypeDef)(ADC_HandleTypeDef *hadc); /*!< pointer to | |||
* Value "1" if the internal channel selected is available on the ADC instance selected. | |||
*/ | |||
#define __HAL_ADC_IS_CHANNEL_INTERNAL_AVAILABLE(__ADC_INSTANCE__, __CHANNEL__) \ | |||
__LL_ADC_IS_CHANNEL_INTERNAL_AVAILABLE((__ADC_INSTANCE__), (__CHANNEL__)) | |||
__LL_ADC_IS_CHANNEL_INTERNAL_AVAILABLE((__ADC_INSTANCE__), (__CHANNEL__)) | |||
/** | |||
* @brief Helper macro to select the ADC common instance | |||
@@ -1318,7 +1322,7 @@ typedef void (*pADC_CallbackTypeDef)(ADC_HandleTypeDef *hadc); /*!< pointer to | |||
* @retval ADC common register instance | |||
*/ | |||
#define __HAL_ADC_COMMON_INSTANCE(__ADCx__) \ | |||
__LL_ADC_COMMON_INSTANCE((__ADCx__)) | |||
__LL_ADC_COMMON_INSTANCE((__ADCx__)) | |||
/** | |||
* @brief Helper macro to check if all ADC instances sharing the same | |||
@@ -1338,7 +1342,7 @@ typedef void (*pADC_CallbackTypeDef)(ADC_HandleTypeDef *hadc); /*!< pointer to | |||
* is enabled. | |||
*/ | |||
#define __HAL_ADC_IS_ENABLED_ALL_COMMON_INSTANCE(__ADCXY_COMMON__) \ | |||
__LL_ADC_IS_ENABLED_ALL_COMMON_INSTANCE((__ADCXY_COMMON__)) | |||
__LL_ADC_IS_ENABLED_ALL_COMMON_INSTANCE((__ADCXY_COMMON__)) | |||
/** | |||
* @brief Helper macro to define the ADC conversion data full-scale digital | |||
@@ -1354,7 +1358,7 @@ typedef void (*pADC_CallbackTypeDef)(ADC_HandleTypeDef *hadc); /*!< pointer to | |||
* @retval ADC conversion data full-scale digital value | |||
*/ | |||
#define __HAL_ADC_DIGITAL_SCALE(__ADC_RESOLUTION__) \ | |||
__LL_ADC_DIGITAL_SCALE((__ADC_RESOLUTION__)) | |||
__LL_ADC_DIGITAL_SCALE((__ADC_RESOLUTION__)) | |||
/** | |||
* @brief Helper macro to convert the ADC conversion data from | |||
@@ -1377,9 +1381,9 @@ typedef void (*pADC_CallbackTypeDef)(ADC_HandleTypeDef *hadc); /*!< pointer to | |||
#define __HAL_ADC_CONVERT_DATA_RESOLUTION(__DATA__,\ | |||
__ADC_RESOLUTION_CURRENT__,\ | |||
__ADC_RESOLUTION_TARGET__) \ | |||
__LL_ADC_CONVERT_DATA_RESOLUTION((__DATA__),\ | |||
(__ADC_RESOLUTION_CURRENT__),\ | |||
(__ADC_RESOLUTION_TARGET__)) | |||
__LL_ADC_CONVERT_DATA_RESOLUTION((__DATA__), \ | |||
(__ADC_RESOLUTION_CURRENT__), \ | |||
(__ADC_RESOLUTION_TARGET__)) | |||
/** | |||
* @brief Helper macro to calculate the voltage (unit: mVolt) | |||
@@ -1400,9 +1404,9 @@ typedef void (*pADC_CallbackTypeDef)(ADC_HandleTypeDef *hadc); /*!< pointer to | |||
#define __HAL_ADC_CALC_DATA_TO_VOLTAGE(__VREFANALOG_VOLTAGE__,\ | |||
__ADC_DATA__,\ | |||
__ADC_RESOLUTION__) \ | |||
__LL_ADC_CALC_DATA_TO_VOLTAGE((__VREFANALOG_VOLTAGE__),\ | |||
(__ADC_DATA__),\ | |||
(__ADC_RESOLUTION__)) | |||
__LL_ADC_CALC_DATA_TO_VOLTAGE((__VREFANALOG_VOLTAGE__), \ | |||
(__ADC_DATA__), \ | |||
(__ADC_RESOLUTION__)) | |||
/** | |||
* @brief Helper macro to calculate analog reference voltage (Vref+) | |||
@@ -1431,8 +1435,8 @@ typedef void (*pADC_CallbackTypeDef)(ADC_HandleTypeDef *hadc); /*!< pointer to | |||
*/ | |||
#define __HAL_ADC_CALC_VREFANALOG_VOLTAGE(__VREFINT_ADC_DATA__,\ | |||
__ADC_RESOLUTION__) \ | |||
__LL_ADC_CALC_VREFANALOG_VOLTAGE((__VREFINT_ADC_DATA__),\ | |||
(__ADC_RESOLUTION__)) | |||
__LL_ADC_CALC_VREFANALOG_VOLTAGE((__VREFINT_ADC_DATA__), \ | |||
(__ADC_RESOLUTION__)) | |||
/** | |||
* @brief Helper macro to calculate the temperature (unit: degree Celsius) | |||
@@ -1482,9 +1486,9 @@ typedef void (*pADC_CallbackTypeDef)(ADC_HandleTypeDef *hadc); /*!< pointer to | |||
#define __HAL_ADC_CALC_TEMPERATURE(__VREFANALOG_VOLTAGE__,\ | |||
__TEMPSENSOR_ADC_DATA__,\ | |||
__ADC_RESOLUTION__) \ | |||
__LL_ADC_CALC_TEMPERATURE((__VREFANALOG_VOLTAGE__),\ | |||
(__TEMPSENSOR_ADC_DATA__),\ | |||
(__ADC_RESOLUTION__)) | |||
__LL_ADC_CALC_TEMPERATURE((__VREFANALOG_VOLTAGE__), \ | |||
(__TEMPSENSOR_ADC_DATA__), \ | |||
(__ADC_RESOLUTION__)) | |||
/** | |||
* @brief Helper macro to calculate the temperature (unit: degree Celsius) | |||
@@ -1536,12 +1540,12 @@ typedef void (*pADC_CallbackTypeDef)(ADC_HandleTypeDef *hadc); /*!< pointer to | |||
__VREFANALOG_VOLTAGE__,\ | |||
__TEMPSENSOR_ADC_DATA__,\ | |||
__ADC_RESOLUTION__) \ | |||
__LL_ADC_CALC_TEMPERATURE_TYP_PARAMS((__TEMPSENSOR_TYP_AVGSLOPE__),\ | |||
(__TEMPSENSOR_TYP_CALX_V__),\ | |||
(__TEMPSENSOR_CALX_TEMP__),\ | |||
(__VREFANALOG_VOLTAGE__),\ | |||
(__TEMPSENSOR_ADC_DATA__),\ | |||
(__ADC_RESOLUTION__)) | |||
__LL_ADC_CALC_TEMPERATURE_TYP_PARAMS((__TEMPSENSOR_TYP_AVGSLOPE__), \ | |||
(__TEMPSENSOR_TYP_CALX_V__), \ | |||
(__TEMPSENSOR_CALX_TEMP__), \ | |||
(__VREFANALOG_VOLTAGE__), \ | |||
(__TEMPSENSOR_ADC_DATA__), \ | |||
(__ADC_RESOLUTION__)) | |||
/** | |||
* @} | |||
@@ -1564,14 +1568,15 @@ typedef void (*pADC_CallbackTypeDef)(ADC_HandleTypeDef *hadc); /*!< pointer to | |||
* @{ | |||
*/ | |||
/* Initialization and de-initialization functions ****************************/ | |||
HAL_StatusTypeDef HAL_ADC_Init(ADC_HandleTypeDef* hadc); | |||
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); | |||
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_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 */ | |||
/** | |||
@@ -1585,39 +1590,39 @@ HAL_StatusTypeDef HAL_ADC_UnRegisterCallback(ADC_HandleTypeDef *hadc, HAL_ADC_Ca | |||
/* IO 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); | |||
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); | |||
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); | |||
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); | |||
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_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 | |||
* @brief Peripheral Control functions | |||
* @{ | |||
*/ | |||
* @brief 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); | |||
HAL_StatusTypeDef HAL_ADC_ConfigChannel(ADC_HandleTypeDef *hadc, ADC_ChannelConfTypeDef *sConfig); | |||
HAL_StatusTypeDef HAL_ADC_AnalogWDGConfig(ADC_HandleTypeDef *hadc, ADC_AnalogWDGConfTypeDef *AnalogWDGConfig); | |||
/** | |||
* @} | |||
@@ -1627,7 +1632,7 @@ HAL_StatusTypeDef HAL_ADC_AnalogWDGConfig(ADC_HandleTypeDef* hadc, ADC_Ana | |||
/** @addtogroup ADC_Exported_Functions_Group4 | |||
* @{ | |||
*/ | |||
uint32_t HAL_ADC_GetState(ADC_HandleTypeDef* hadc); | |||
uint32_t HAL_ADC_GetState(ADC_HandleTypeDef *hadc); | |||
uint32_t HAL_ADC_GetError(ADC_HandleTypeDef *hadc); | |||
/** | |||
@@ -1642,9 +1647,9 @@ uint32_t HAL_ADC_GetError(ADC_HandleTypeDef *hadc); | |||
/** @addtogroup ADC_Private_Functions ADC Private Functions | |||
* @{ | |||
*/ | |||
HAL_StatusTypeDef ADC_ConversionStop(ADC_HandleTypeDef* hadc, uint32_t ConversionGroup); | |||
HAL_StatusTypeDef ADC_Enable(ADC_HandleTypeDef* hadc); | |||
HAL_StatusTypeDef ADC_Disable(ADC_HandleTypeDef* hadc); | |||
HAL_StatusTypeDef ADC_ConversionStop(ADC_HandleTypeDef *hadc, uint32_t ConversionGroup); | |||
HAL_StatusTypeDef ADC_Enable(ADC_HandleTypeDef *hadc); | |||
HAL_StatusTypeDef ADC_Disable(ADC_HandleTypeDef *hadc); | |||
void ADC_DMAConvCplt(DMA_HandleTypeDef *hdma); | |||
void ADC_DMAHalfConvCplt(DMA_HandleTypeDef *hdma); | |||
void ADC_DMAError(DMA_HandleTypeDef *hdma); | |||
@@ -22,7 +22,7 @@ | |||
#define STM32WBxx_HAL_ADC_EX_H | |||
#ifdef __cplusplus | |||
extern "C" { | |||
extern "C" { | |||
#endif | |||
/* Includes ------------------------------------------------------------------*/ | |||
@@ -51,7 +51,7 @@ typedef struct | |||
uint32_t RightBitShift; /*!< Configures the division coefficient for the Oversampler. | |||
This parameter can be a value of @ref ADC_HAL_EC_OVS_SHIFT */ | |||
}ADC_InjOversamplingTypeDef; | |||
} ADC_InjOversamplingTypeDef; | |||
/** | |||
* @brief Structure definition of ADC group injected and ADC channel affected to ADC group injected | |||
@@ -169,7 +169,7 @@ typedef struct | |||
ADC_InjOversamplingTypeDef InjecOversampling; /*!< Specifies the Oversampling parameters. | |||
Caution: this setting overwrites the previous oversampling configuration if oversampling already enabled. | |||
Note: This parameter can be modified only if there is no conversion is ongoing (both ADSTART and JADSTART cleared). */ | |||
}ADC_InjectionConfTypeDef; | |||
} ADC_InjectionConfTypeDef; | |||
/** | |||
* @} | |||
@@ -386,7 +386,7 @@ typedef struct | |||
* @retval None | |||
*/ | |||
#define ADC_OFFSET_SHIFT_RESOLUTION(__HANDLE__, __OFFSET__) \ | |||
((__OFFSET__) << ((((__HANDLE__)->Instance->CFGR & ADC_CFGR_RES) >> 3UL) * 2UL)) | |||
((__OFFSET__) << ((((__HANDLE__)->Instance->CFGR & ADC_CFGR_RES) >> 3UL) * 2UL)) | |||
/** | |||
* @brief Shift the AWD1 threshold with respect to the selected ADC resolution. | |||
@@ -401,7 +401,7 @@ typedef struct | |||
* @retval None | |||
*/ | |||
#define ADC_AWD1THRESHOLD_SHIFT_RESOLUTION(__HANDLE__, __THRESHOLD__) \ | |||
((__THRESHOLD__) << ((((__HANDLE__)->Instance->CFGR & ADC_CFGR_RES) >> 3UL) * 2UL)) | |||
((__THRESHOLD__) << ((((__HANDLE__)->Instance->CFGR & ADC_CFGR_RES) >> 3UL) * 2UL)) | |||
/** | |||
* @brief Shift the AWD2 and AWD3 threshold with respect to the selected ADC resolution. | |||
@@ -416,8 +416,8 @@ typedef struct | |||
*/ | |||
#define ADC_AWD23THRESHOLD_SHIFT_RESOLUTION(__HANDLE__, __THRESHOLD__) \ | |||
((((__HANDLE__)->Instance->CFGR & ADC_CFGR_RES) != (ADC_CFGR_RES_1 | ADC_CFGR_RES_0)) ? \ | |||
((__THRESHOLD__) >> ((4UL - ((((__HANDLE__)->Instance->CFGR & ADC_CFGR_RES) >> 3UL) * 2UL)) & 0x1FUL)) : \ | |||
((__THRESHOLD__) << 2UL) \ | |||
((__THRESHOLD__) >> ((4UL - ((((__HANDLE__)->Instance->CFGR & ADC_CFGR_RES) >> 3UL) * 2UL)) & 0x1FUL)) : \ | |||
((__THRESHOLD__) << 2UL) \ | |||
) | |||
/** | |||
@@ -568,10 +568,10 @@ typedef struct | |||
* @param __EDGE__ programmed ADC edge trigger setting. | |||
* @retval SET (__EDGE__ is a valid value) or RESET (__EDGE__ is invalid) | |||
*/ | |||
#define IS_ADC_EXTTRIGINJEC_EDGE(__EDGE__) (((__EDGE__) == ADC_EXTERNALTRIGINJECCONV_EDGE_NONE) || \ | |||
((__EDGE__) == ADC_EXTERNALTRIGINJECCONV_EDGE_RISING) || \ | |||
((__EDGE__) == ADC_EXTERNALTRIGINJECCONV_EDGE_FALLING) || \ | |||
((__EDGE__) == ADC_EXTERNALTRIGINJECCONV_EDGE_RISINGFALLING) ) | |||
#define IS_ADC_EXTTRIGINJEC_EDGE(__EDGE__) (((__EDGE__) == ADC_EXTERNALTRIGINJECCONV_EDGE_NONE) || \ | |||
((__EDGE__) == ADC_EXTERNALTRIGINJECCONV_EDGE_RISING) || \ | |||
((__EDGE__) == ADC_EXTERNALTRIGINJECCONV_EDGE_FALLING) || \ | |||
((__EDGE__) == ADC_EXTERNALTRIGINJECCONV_EDGE_RISINGFALLING) ) | |||
/** | |||
* @brief Verify the ADC analog watchdog setting. | |||
@@ -600,21 +600,21 @@ typedef struct | |||
* @param __CONVERSION__ ADC conversion group. | |||
* @retval SET (__CONVERSION__ is valid) or RESET (__CONVERSION__ is invalid) | |||
*/ | |||
#define IS_ADC_CONVERSION_GROUP(__CONVERSION__) (((__CONVERSION__) == ADC_REGULAR_GROUP) || \ | |||
((__CONVERSION__) == ADC_INJECTED_GROUP) || \ | |||
((__CONVERSION__) == ADC_REGULAR_INJECTED_GROUP) ) | |||
#define IS_ADC_CONVERSION_GROUP(__CONVERSION__) (((__CONVERSION__) == ADC_REGULAR_GROUP) || \ | |||
((__CONVERSION__) == ADC_INJECTED_GROUP) || \ | |||
((__CONVERSION__) == ADC_REGULAR_INJECTED_GROUP) ) | |||
/** | |||
* @brief Verify the ADC event type. | |||
* @param __EVENT__ ADC event. | |||
* @retval SET (__EVENT__ is valid) or RESET (__EVENT__ is invalid) | |||
*/ | |||
#define IS_ADC_EVENT_TYPE(__EVENT__) (((__EVENT__) == ADC_EOSMP_EVENT) || \ | |||
((__EVENT__) == ADC_AWD_EVENT) || \ | |||
((__EVENT__) == ADC_AWD2_EVENT) || \ | |||
((__EVENT__) == ADC_AWD3_EVENT) || \ | |||
((__EVENT__) == ADC_OVR_EVENT) || \ | |||
((__EVENT__) == ADC_JQOVF_EVENT) ) | |||
#define IS_ADC_EVENT_TYPE(__EVENT__) (((__EVENT__) == ADC_EOSMP_EVENT) || \ | |||
((__EVENT__) == ADC_AWD_EVENT) || \ | |||
((__EVENT__) == ADC_AWD2_EVENT) || \ | |||
((__EVENT__) == ADC_AWD3_EVENT) || \ | |||
((__EVENT__) == ADC_OVR_EVENT) || \ | |||
((__EVENT__) == ADC_JQOVF_EVENT) ) | |||
/** | |||
* @brief Verify the ADC oversampling ratio. | |||
@@ -697,33 +697,34 @@ typedef struct | |||
/* IO operation functions *****************************************************/ | |||
/* ADC calibration */ | |||
HAL_StatusTypeDef HAL_ADCEx_Calibration_Start(ADC_HandleTypeDef* hadc, uint32_t SingleDiff); | |||
HAL_StatusTypeDef HAL_ADCEx_Calibration_Start(ADC_HandleTypeDef *hadc, uint32_t SingleDiff); | |||
uint32_t HAL_ADCEx_Calibration_GetValue(ADC_HandleTypeDef *hadc, uint32_t SingleDiff); | |||
HAL_StatusTypeDef HAL_ADCEx_Calibration_SetValue(ADC_HandleTypeDef *hadc, uint32_t SingleDiff, uint32_t CalibrationFactor); | |||
HAL_StatusTypeDef HAL_ADCEx_Calibration_SetValue(ADC_HandleTypeDef *hadc, uint32_t SingleDiff, | |||
uint32_t CalibrationFactor); | |||
/* Blocking mode: Polling */ | |||
HAL_StatusTypeDef HAL_ADCEx_InjectedStart(ADC_HandleTypeDef* hadc); | |||
HAL_StatusTypeDef HAL_ADCEx_InjectedStop(ADC_HandleTypeDef* hadc); | |||
HAL_StatusTypeDef HAL_ADCEx_InjectedPollForConversion(ADC_HandleTypeDef* hadc, uint32_t Timeout); | |||
HAL_StatusTypeDef HAL_ADCEx_InjectedStart(ADC_HandleTypeDef *hadc); | |||
HAL_StatusTypeDef HAL_ADCEx_InjectedStop(ADC_HandleTypeDef *hadc); | |||
HAL_StatusTypeDef HAL_ADCEx_InjectedPollForConversion(ADC_HandleTypeDef *hadc, uint32_t Timeout); | |||
/* Non-blocking mode: Interruption */ | |||
HAL_StatusTypeDef HAL_ADCEx_InjectedStart_IT(ADC_HandleTypeDef* hadc); | |||
HAL_StatusTypeDef HAL_ADCEx_InjectedStop_IT(ADC_HandleTypeDef* hadc); | |||
HAL_StatusTypeDef HAL_ADCEx_InjectedStart_IT(ADC_HandleTypeDef *hadc); | |||
HAL_StatusTypeDef HAL_ADCEx_InjectedStop_IT(ADC_HandleTypeDef *hadc); | |||
/* ADC retrieve conversion value intended to be used with polling or interruption */ | |||
uint32_t HAL_ADCEx_InjectedGetValue(ADC_HandleTypeDef* hadc, uint32_t InjectedRank); | |||
uint32_t HAL_ADCEx_InjectedGetValue(ADC_HandleTypeDef *hadc, uint32_t InjectedRank); | |||
/* ADC IRQHandler and Callbacks used in non-blocking modes (Interruption) */ | |||
void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef* hadc); | |||
void HAL_ADCEx_InjectedQueueOverflowCallback(ADC_HandleTypeDef* hadc); | |||
void HAL_ADCEx_LevelOutOfWindow2Callback(ADC_HandleTypeDef* hadc); | |||
void HAL_ADCEx_LevelOutOfWindow3Callback(ADC_HandleTypeDef* hadc); | |||
void HAL_ADCEx_EndOfSamplingCallback(ADC_HandleTypeDef* hadc); | |||
void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef *hadc); | |||
void HAL_ADCEx_InjectedQueueOverflowCallback(ADC_HandleTypeDef *hadc); | |||
void HAL_ADCEx_LevelOutOfWindow2Callback(ADC_HandleTypeDef *hadc); | |||
void HAL_ADCEx_LevelOutOfWindow3Callback(ADC_HandleTypeDef *hadc); | |||
void HAL_ADCEx_EndOfSamplingCallback(ADC_HandleTypeDef *hadc); | |||
/* ADC group regular conversions stop */ | |||
HAL_StatusTypeDef HAL_ADCEx_RegularStop(ADC_HandleTypeDef* hadc); | |||
HAL_StatusTypeDef HAL_ADCEx_RegularStop_IT(ADC_HandleTypeDef* hadc); | |||
HAL_StatusTypeDef HAL_ADCEx_RegularStop_DMA(ADC_HandleTypeDef* hadc); | |||
HAL_StatusTypeDef HAL_ADCEx_RegularStop(ADC_HandleTypeDef *hadc); | |||
HAL_StatusTypeDef HAL_ADCEx_RegularStop_IT(ADC_HandleTypeDef *hadc); | |||
HAL_StatusTypeDef HAL_ADCEx_RegularStop_DMA(ADC_HandleTypeDef *hadc); | |||
/** | |||
* @} | |||
*/ | |||
@@ -732,11 +733,11 @@ HAL_StatusTypeDef HAL_ADCEx_RegularStop_DMA(ADC_HandleTypeDef* hadc); | |||
* @{ | |||
*/ | |||
/* Peripheral Control functions ***********************************************/ | |||
HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef* hadc,ADC_InjectionConfTypeDef* sConfigInjected); | |||
HAL_StatusTypeDef HAL_ADCEx_EnableInjectedQueue(ADC_HandleTypeDef* hadc); | |||
HAL_StatusTypeDef HAL_ADCEx_DisableInjectedQueue(ADC_HandleTypeDef* hadc); | |||
HAL_StatusTypeDef HAL_ADCEx_DisableVoltageRegulator(ADC_HandleTypeDef* hadc); | |||
HAL_StatusTypeDef HAL_ADCEx_EnterADCDeepPowerDownMode(ADC_HandleTypeDef* hadc); | |||
HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef *hadc,ADC_InjectionConfTypeDef* sConfigInjected); | |||
HAL_StatusTypeDef HAL_ADCEx_EnableInjectedQueue(ADC_HandleTypeDef *hadc); | |||
HAL_StatusTypeDef HAL_ADCEx_DisableInjectedQueue(ADC_HandleTypeDef *hadc); | |||
HAL_StatusTypeDef HAL_ADCEx_DisableVoltageRegulator(ADC_HandleTypeDef *hadc); | |||
HAL_StatusTypeDef HAL_ADCEx_EnterADCDeepPowerDownMode(ADC_HandleTypeDef *hadc); | |||
/** | |||
* @} | |||
@@ -32,7 +32,7 @@ extern "C" { | |||
/** @addtogroup STM32WBxx_HAL_Driver | |||
* @{ | |||
*/ | |||
#if defined (COMP1) || defined (COMP2) | |||
/** @addtogroup COMP | |||
* @{ | |||
@@ -697,7 +697,7 @@ uint32_t HAL_COMP_GetError(COMP_HandleTypeDef *hcomp); | |||
/** | |||
* @} | |||
*/ | |||
#endif /* COMP1 || COMP2 */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -174,17 +174,17 @@ | |||
*/ | |||
#define VDD_VALUE (3300UL) /*!< Value of VDD in mv */ | |||
#define TICK_INT_PRIORITY ((1UL<<__NVIC_PRIO_BITS) - 1UL) /*!< tick interrupt priority (lowest by default) */ | |||
#define USE_RTOS 0 | |||
#define PREFETCH_ENABLE 0 | |||
#define INSTRUCTION_CACHE_ENABLE 1 | |||
#define DATA_CACHE_ENABLE 1 | |||
#define USE_RTOS 0U | |||
#define PREFETCH_ENABLE 0U | |||
#define INSTRUCTION_CACHE_ENABLE 1U | |||
#define DATA_CACHE_ENABLE 1U | |||
/* ########################## Assert Selection ############################## */ | |||
/** | |||
* @brief Uncomment the line below to expanse the "assert_param" macro in the | |||
* HAL drivers code | |||
*/ | |||
/* #define USE_FULL_ASSERT 1 */ | |||
/* #define USE_FULL_ASSERT 1U */ | |||
/* ################## SPI peripheral configuration ########################## */ | |||
@@ -27,7 +27,6 @@ | |||
/* Includes ------------------------------------------------------------------*/ | |||
#include "stm32wbxx_hal_def.h" | |||
#include "stm32wb55xx.h" | |||
/** @addtogroup STM32WBxx_HAL_Driver | |||
* @{ | |||
@@ -182,10 +182,12 @@ typedef struct | |||
uint32_t Key_saved[8]; /*!< copy of key registers */ | |||
uint32_t Size_saved; /*!< copy of input buffer size */ | |||
uint16_t Size_saved; /*!< copy of input buffer size */ | |||
uint16_t CrypHeaderCount_saved; /*!< copy of CRYP header data counter when processing is suspended */ | |||
uint32_t SizesSum_saved; /*!< copy of SizesSum when processing is suspended */ | |||
uint32_t ResumingFlag; /*!< resumption flag to bypass steps already carried out */ | |||
FunctionalState AutoKeyDerivation_saved; /*!< copy of CRYP handle auto key derivation parameter */ | |||
@@ -565,6 +567,12 @@ uint32_t HAL_CRYP_GetError(CRYP_HandleTypeDef *hcryp); | |||
#define IS_CRYP_INIT(CONFIG)(((CONFIG) == CRYP_KEYIVCONFIG_ALWAYS) || \ | |||
((CONFIG) == CRYP_KEYIVCONFIG_ONCE)) | |||
#define IS_CRYP_BUFFERSIZE(ALGO, DATAWIDTH, SIZE) \ | |||
(((((ALGO) == CRYP_AES_ECB) || ((ALGO) == CRYP_AES_CBC) || ((ALGO) == CRYP_AES_CTR)) && \ | |||
((((DATAWIDTH) == CRYP_DATAWIDTHUNIT_WORD) && (((SIZE) % 4U) == 0U)) || \ | |||
(((DATAWIDTH) == CRYP_DATAWIDTHUNIT_BYTE) && (((SIZE) % 16U) == 0U)))) || \ | |||
(((ALGO)== CRYP_AES_GCM_GMAC) || ((ALGO) == CRYP_AES_CCM))) | |||
/** | |||
* @} | |||
*/ | |||
@@ -204,8 +204,10 @@ typedef struct __DMA_HandleTypeDef | |||
#define DMA_REQUEST_LPUART1_RX LL_DMAMUX_REQ_LPUART1_RX /*!< DMAMUX LP_UART1_RX request */ | |||
#define DMA_REQUEST_LPUART1_TX LL_DMAMUX_REQ_LPUART1_TX /*!< DMAMUX LP_UART1_RX request */ | |||
#if defined (SAI1) | |||
#define DMA_REQUEST_SAI1_A LL_DMAMUX_REQ_SAI1_A /*!< DMAMUX SAI1 A request */ | |||
#define DMA_REQUEST_SAI1_B LL_DMAMUX_REQ_SAI1_B /*!< DMAMUX SAI1 B request */ | |||
#endif /* SAI1 */ | |||
#define DMA_REQUEST_QUADSPI LL_DMAMUX_REQ_QUADSPI /*!< DMAMUX QUADSPI request */ | |||
@@ -361,7 +363,7 @@ typedef struct __DMA_HandleTypeDef | |||
* @{ | |||
*/ | |||
/** @brief Reset DMA handle state | |||
/** @brief Reset DMA handle state. | |||
* @param __HANDLE__ DMA handle | |||
* @retval None | |||
*/ | |||
@@ -385,11 +387,12 @@ typedef struct __DMA_HandleTypeDef | |||
/* Interrupt & Flag management */ | |||
/** | |||
* @brief Returns the current DMA Channel transfer complete flag. | |||
* @brief Return the current DMA Channel transfer complete flag. | |||
* @param __HANDLE__ DMA handle | |||
* @retval The specified transfer complete flag index. | |||
*/ | |||
#if defined(DMA2) | |||
#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)DMA2_Channel1))? DMA_FLAG_TC1 :\ | |||
@@ -404,12 +407,23 @@ typedef struct __DMA_HandleTypeDef | |||
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_TC6 :\ | |||
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel6))? DMA_FLAG_TC6 :\ | |||
DMA_FLAG_TC7) | |||
#else | |||
#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) | |||
#endif | |||
/** | |||
* @brief Returns the current DMA Channel half transfer complete flag. | |||
* @brief Return the current DMA Channel half transfer complete flag. | |||
* @param __HANDLE__ DMA handle | |||
* @retval The specified half transfer complete flag index. | |||
*/ | |||
#if defined(DMA2) | |||
#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)DMA2_Channel1))? DMA_FLAG_HT1 :\ | |||
@@ -424,12 +438,23 @@ typedef struct __DMA_HandleTypeDef | |||
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_HT6 :\ | |||
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel6))? DMA_FLAG_HT6 :\ | |||
DMA_FLAG_HT7) | |||
#else | |||
#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) | |||
#endif | |||
/** | |||
* @brief Returns the current DMA Channel transfer error flag. | |||
* @brief Return the current DMA Channel transfer error flag. | |||
* @param __HANDLE__ DMA handle | |||
* @retval The specified transfer error flag index. | |||
*/ | |||
#if defined(DMA2) | |||
#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)DMA2_Channel1))? DMA_FLAG_TE1 :\ | |||
@@ -444,12 +469,23 @@ typedef struct __DMA_HandleTypeDef | |||
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_TE6 :\ | |||
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel6))? DMA_FLAG_TE6 :\ | |||
DMA_FLAG_TE7) | |||
#else | |||
#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) | |||
#endif | |||
/** | |||
* @brief Returns the current DMA Channel Global interrupt flag. | |||
* @brief Return the current DMA Channel Global interrupt flag. | |||
* @param __HANDLE__ DMA handle | |||
* @retval The specified transfer error flag index. | |||
*/ | |||
#if defined(DMA2) | |||
#define __HAL_DMA_GET_GI_FLAG_INDEX(__HANDLE__)\ | |||
(((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_ISR_GIF1 :\ | |||
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel1))? DMA_ISR_GIF1 :\ | |||
@@ -464,6 +500,16 @@ typedef struct __DMA_HandleTypeDef | |||
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_ISR_GIF6 :\ | |||
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel6))? DMA_ISR_GIF6 :\ | |||
DMA_ISR_GIF7) | |||
#else | |||
#define __HAL_DMA_GET_GI_FLAG_INDEX(__HANDLE__)\ | |||
(((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_ISR_GIF1 :\ | |||
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_ISR_GIF2 :\ | |||
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_ISR_GIF3 :\ | |||
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_ISR_GIF4 :\ | |||
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_ISR_GIF5 :\ | |||
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_ISR_GIF6 :\ | |||
DMA_ISR_GIF7) | |||
#endif | |||
/** | |||
* @brief Get the DMA Channel pending flags. | |||
@@ -477,8 +523,12 @@ typedef struct __DMA_HandleTypeDef | |||
* Where x can be from 1 to 7 to select the DMA Channel x flag. | |||
* @retval The state of FLAG (SET or RESET). | |||
*/ | |||
#if defined(DMA2) | |||
#define __HAL_DMA_GET_FLAG(__HANDLE__, __FLAG__) (((uint32_t)((__HANDLE__)->Instance) > ((uint32_t)DMA1_Channel7))? \ | |||
(DMA2->ISR & (__FLAG__)) : (DMA1->ISR & (__FLAG__))) | |||
#else | |||
#define __HAL_DMA_GET_FLAG(__HANDLE__, __FLAG__) (DMA1->ISR & (__FLAG__)) | |||
#endif | |||
/** | |||
* @brief Clear the DMA Channel pending flags. | |||
@@ -492,8 +542,12 @@ typedef struct __DMA_HandleTypeDef | |||
* Where x can be from 1 to 7 to select the DMA Channel x flag. | |||
* @retval None | |||
*/ | |||
#if defined(DMA2) | |||
#define __HAL_DMA_CLEAR_FLAG(__HANDLE__, __FLAG__) (((uint32_t)((__HANDLE__)->Instance) > ((uint32_t)DMA1_Channel7))? \ | |||
(DMA2->IFCR = (__FLAG__)) : (DMA1->IFCR = (__FLAG__))) | |||
#else | |||
#define __HAL_DMA_CLEAR_FLAG(__HANDLE__, __FLAG__) (DMA1->IFCR = (__FLAG__)) | |||
#endif | |||
/** | |||
* @brief Enable the specified DMA Channel interrupts. | |||
@@ -532,7 +586,7 @@ typedef struct __DMA_HandleTypeDef | |||
#define __HAL_DMA_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CCR & (__INTERRUPT__))) | |||
/** | |||
* @brief Returns the number of remaining data units in the current DMA Channel transfer. | |||
* @brief Return the number of remaining data units in the current DMA Channel transfer. | |||
* @param __HANDLE__ DMA handle | |||
* @retval The number of remaining data units in the current DMA Channel transfer. | |||
*/ | |||
@@ -105,18 +105,39 @@ typedef struct | |||
#define EXTI_LINE_17 (EXTI_CONFIG | EXTI_EVENT | EXTI_REG1 | 0x11u) | |||
#define EXTI_LINE_18 (EXTI_CONFIG | EXTI_EVENT | EXTI_REG1 | 0x12u) | |||
#define EXTI_LINE_19 (EXTI_CONFIG | EXTI_EVENT | EXTI_REG1 | 0x13u) | |||
#if defined (STM32WB55xx) || defined (STM32WB5Mxx) || defined (STM32WB35xx) | |||
#define EXTI_LINE_20 (EXTI_CONFIG | EXTI_EVENT | EXTI_REG1 | 0x14u) | |||
#define EXTI_LINE_21 (EXTI_CONFIG | EXTI_EVENT | EXTI_REG1 | 0x15u) | |||
#else | |||
#define EXTI_LINE_20 (EXTI_RESERVED | EXTI_REG1 | 0x14u) | |||
#define EXTI_LINE_21 (EXTI_RESERVED | EXTI_REG1 | 0x15u) | |||
#endif | |||
#define EXTI_LINE_22 (EXTI_DIRECT | EXTI_REG1 | 0x16u) | |||
#if defined (STM32WB55xx) || defined (STM32WB5Mxx) || defined (STM32WB35xx) | |||
#define EXTI_LINE_23 (EXTI_DIRECT | EXTI_REG1 | 0x17u) | |||
#else | |||
#define EXTI_LINE_23 (EXTI_RESERVED | EXTI_REG1 | 0x17u) | |||
#endif | |||
#define EXTI_LINE_24 (EXTI_DIRECT | EXTI_REG1 | 0x18u) | |||
#if defined (STM32WB55xx) || defined (STM32WB5Mxx) || defined (STM32WB35xx) | |||
#define EXTI_LINE_25 (EXTI_DIRECT | EXTI_REG1 | 0x19u) | |||
#else | |||
#define EXTI_LINE_25 (EXTI_RESERVED | EXTI_REG1 | 0x19u) | |||
#endif | |||
#define EXTI_LINE_26 (EXTI_RESERVED | EXTI_REG1 | 0x1Au) | |||
#define EXTI_LINE_27 (EXTI_RESERVED | EXTI_REG1 | 0x1Bu) | |||
#if defined (STM32WB55xx) || defined (STM32WB5Mxx) || defined (STM32WB35xx) | |||
#define EXTI_LINE_28 (EXTI_DIRECT | EXTI_REG1 | 0x1Cu) | |||
#else | |||
#define EXTI_LINE_28 (EXTI_RESERVED | EXTI_REG1 | 0x1Cu) | |||
#endif | |||
#define EXTI_LINE_29 (EXTI_DIRECT | EXTI_REG1 | 0x1Du) | |||
#define EXTI_LINE_30 (EXTI_DIRECT | EXTI_REG1 | 0x1Eu) | |||
#if defined (STM32WB55xx) || defined (STM32WB5Mxx) || defined (STM32WB35xx) | |||
#define EXTI_LINE_31 (EXTI_CONFIG | EXTI_REG1 | 0x1Fu) | |||
#else | |||
#define EXTI_LINE_31 (EXTI_RESERVED | EXTI_REG1 | 0x1Fu) | |||
#endif | |||
#define EXTI_LINE_32 (EXTI_RESERVED | EXTI_REG2 | 0x00u) | |||
#define EXTI_LINE_33 (EXTI_CONFIG | EXTI_REG2 | 0x01u) | |||
#define EXTI_LINE_34 (EXTI_RESERVED | EXTI_REG2 | 0x02u) | |||
@@ -128,7 +149,11 @@ typedef struct | |||
#define EXTI_LINE_40 (EXTI_CONFIG | EXTI_EVENT | EXTI_REG2 | 0x08u) | |||
#define EXTI_LINE_41 (EXTI_CONFIG | EXTI_EVENT | EXTI_REG2 | 0x09u) | |||
#define EXTI_LINE_42 (EXTI_DIRECT | EXTI_REG2 | 0x0Au) | |||
#if defined (STM32WB55xx) || defined (STM32WB5Mxx) | |||
#define EXTI_LINE_43 (EXTI_DIRECT | EXTI_REG2 | 0x0Bu) | |||
#else | |||
#define EXTI_LINE_43 (EXTI_RESERVED | EXTI_REG2 | 0x0Bu) | |||
#endif | |||
#define EXTI_LINE_44 (EXTI_DIRECT | EXTI_REG2 | 0x0Cu) | |||
#define EXTI_LINE_45 (EXTI_DIRECT | EXTI_REG2 | 0x0Du) | |||
#define EXTI_LINE_46 (EXTI_DIRECT | EXTI_REG2 | 0x0Eu) | |||
@@ -166,7 +191,9 @@ typedef struct | |||
#define EXTI_GPIOA 0x00000000u | |||
#define EXTI_GPIOB 0x00000001u | |||
#define EXTI_GPIOC 0x00000002u | |||
#if defined (STM32WB55xx) || defined (STM32WB5Mxx) | |||
#define EXTI_GPIOD 0x00000003u | |||
#endif | |||
#define EXTI_GPIOE 0x00000004u | |||
#define EXTI_GPIOH 0x00000007u | |||
/** | |||
@@ -255,12 +282,20 @@ typedef struct | |||
#define IS_EXTI_CONFIG_LINE(__LINE__) (((__LINE__) & EXTI_CONFIG) != 0x00u) | |||
#if defined (STM32WB55xx) || defined (STM32WB5Mxx) | |||
#define IS_EXTI_GPIO_PORT(__PORT__) (((__PORT__) == EXTI_GPIOA) || \ | |||
((__PORT__) == EXTI_GPIOB) || \ | |||
((__PORT__) == EXTI_GPIOC) || \ | |||
((__PORT__) == EXTI_GPIOD) || \ | |||
((__PORT__) == EXTI_GPIOE) || \ | |||
((__PORT__) == EXTI_GPIOH)) | |||
#else | |||
#define IS_EXTI_GPIO_PORT(__PORT__) (((__PORT__) == EXTI_GPIOA) || \ | |||
((__PORT__) == EXTI_GPIOB) || \ | |||
((__PORT__) == EXTI_GPIOC) || \ | |||
((__PORT__) == EXTI_GPIOE) || \ | |||
((__PORT__) == EXTI_GPIOH)) | |||
#endif | |||
#define IS_EXTI_GPIO_PIN(__PIN__) ((__PIN__) < 16u) | |||
@@ -46,7 +46,7 @@ extern "C" { | |||
*/ | |||
typedef struct | |||
{ | |||
uint32_t TypeErase; /*!< Mass erase or page erase. | |||
uint32_t TypeErase; /*!< Page erase. | |||
This parameter can be a value of @ref FLASH_TYPE_ERASE */ | |||
uint32_t Page; /*!< Initial Flash page to erase when page erase is enabled | |||
This parameter must be a value between 0 and (FLASH_PAGE_NB - 1) */ | |||
@@ -150,10 +150,10 @@ typedef struct | |||
/** @defgroup FLASH_LATENCY FLASH Latency | |||
* @{ | |||
*/ | |||
#define FLASH_LATENCY_0 0x00000000UL /*!< FLASH Zero wait state */ | |||
#define FLASH_LATENCY_1 FLASH_ACR_LATENCY_0 /*!< FLASH One wait state */ | |||
#define FLASH_LATENCY_2 FLASH_ACR_LATENCY_1 /*!< FLASH Two wait states */ | |||
#define FLASH_LATENCY_3 FLASH_ACR_LATENCY_2 /*!< FLASH Three wait states */ | |||
#define FLASH_LATENCY_0 FLASH_ACR_LATENCY_0WS /*!< FLASH Zero wait state */ | |||
#define FLASH_LATENCY_1 FLASH_ACR_LATENCY_1WS /*!< FLASH One wait state */ | |||
#define FLASH_LATENCY_2 FLASH_ACR_LATENCY_2WS /*!< FLASH Two wait states */ | |||
#define FLASH_LATENCY_3 FLASH_ACR_LATENCY_3WS /*!< FLASH Three wait states */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -179,12 +179,14 @@ typedef struct | |||
#define FLASH_FLAG_ECCC FLASH_ECCR_ECCC /*!< FLASH ECC correction */ | |||
#define FLASH_FLAG_ECCD FLASH_ECCR_ECCD /*!< FLASH ECC detection */ | |||
#define FLASH_FLAG_SR_ERROR (FLASH_FLAG_OPERR | FLASH_FLAG_PROGERR | FLASH_FLAG_WRPERR | \ | |||
#define FLASH_FLAG_SR_ERRORS (FLASH_FLAG_OPERR | FLASH_FLAG_PROGERR | FLASH_FLAG_WRPERR | \ | |||
FLASH_FLAG_PGAERR | FLASH_FLAG_SIZERR | FLASH_FLAG_PGSERR | \ | |||
FLASH_FLAG_MISERR | FLASH_FLAG_FASTERR | FLASH_FLAG_RDERR | \ | |||
FLASH_FLAG_OPTVERR) /*!< All SR error flags */ | |||
#define FLASH_FLAG_ALL_ERRORS (FLASH_FLAG_SR_ERROR | FLASH_FLAG_ECCC | FLASH_FLAG_ECCD) | |||
#define FLASH_FLAG_ECCR_ERRORS (FLASH_FLAG_ECCC | FLASH_FLAG_ECCD) | |||
#define FLASH_FLAG_ALL_ERRORS (FLASH_FLAG_SR_ERRORS | FLASH_FLAG_ECCR_ERRORS) | |||
/** @defgroup FLASH_INTERRUPT_DEFINITION FLASH Interrupts Definition | |||
* @brief FLASH Interrupt definition | |||
@@ -212,7 +214,6 @@ typedef struct | |||
#define HAL_FLASH_ERROR_FAST FLASH_FLAG_FASTERR | |||
#define HAL_FLASH_ERROR_RD FLASH_FLAG_RDERR | |||
#define HAL_FLASH_ERROR_OPTV FLASH_FLAG_OPTVERR | |||
#define HAL_FLASH_ERROR_ECCD FLASH_FLAG_ECCD | |||
/** | |||
* @} | |||
*/ | |||
@@ -221,7 +222,6 @@ typedef struct | |||
* @{ | |||
*/ | |||
#define FLASH_TYPEERASE_PAGES FLASH_CR_PER /*!< Pages erase only*/ | |||
#define FLASH_TYPEERASE_MASSERASE FLASH_CR_MER /*!< Flash mass erase activation*/ | |||
/** | |||
* @} | |||
*/ | |||
@@ -480,39 +480,39 @@ typedef struct | |||
* @{ | |||
*/ | |||
#define SRAM2A_START_SECURE_ADDR_0 0x20030000U /* When in secure mode 0x20030000 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_1 0x20030400U /* When in secure mode 0x20030400 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_2 0x20030800U /* When in secure mode 0x20030800 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_3 0x20030C00U /* When in secure mode 0x20030C00 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_4 0x20031000U /* When in secure mode 0x20031000 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_5 0x20031400U /* When in secure mode 0x20031400 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_6 0x20031800U /* When in secure mode 0x20031800 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_7 0x20031C00U /* When in secure mode 0x20031C00 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_8 0x20032000U /* When in secure mode 0x20032000 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_9 0x20032400U /* When in secure mode 0x20032400 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_10 0x20032800U /* When in secure mode 0x20032800 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_11 0x20032C00U /* When in secure mode 0x20032C00 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_12 0x20033000U /* When in secure mode 0x20033000 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_13 0x20033400U /* When in secure mode 0x20033400 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_14 0x20033800U /* When in secure mode 0x20033800 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_15 0x20033C00U /* When in secure mode 0x20033C00 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_16 0x20034000U /* When in secure mode 0x20034000 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_17 0x20034400U /* When in secure mode 0x20034400 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_18 0x20034800U /* When in secure mode 0x20034800 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_19 0x20034C00U /* When in secure mode 0x20034C00 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_20 0x20035000U /* When in secure mode 0x20035000 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_21 0x20035400U /* When in secure mode 0x20035400 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_22 0x20035800U /* When in secure mode 0x20035800 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_23 0x20035C00U /* When in secure mode 0x20035C00 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_24 0x20036000U /* When in secure mode 0x20036000 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_25 0x20036400U /* When in secure mode 0x20036400 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_26 0x20036800U /* When in secure mode 0x20036800 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_27 0x20036C00U /* When in secure mode 0x20036C00 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_28 0x20037000U /* When in secure mode 0x20037000 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_29 0x20037400U /* When in secure mode 0x20037400 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_30 0x20037800U /* When in secure mode 0x20037800 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_31 0x20037C00U /* When in secure mode 0x20037C00 - 0x20037FFF is accessible only by M0 Plus */ | |||
#define SRAM2A_FULL_UNSECURE 0x20040000U /* The RAM2A is accessible to M0 Plus and M4 */ | |||
#define SRAM2A_START_SECURE_ADDR_0 (SRAM2A_BASE + 0x0000U) /* When in secure mode (SRAM2A_BASE + 0x0000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_1 (SRAM2A_BASE + 0x0400U) /* When in secure mode (SRAM2A_BASE + 0x0400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_2 (SRAM2A_BASE + 0x0800U) /* When in secure mode (SRAM2A_BASE + 0x0800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_3 (SRAM2A_BASE + 0x0C00U) /* When in secure mode (SRAM2A_BASE + 0x0C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_4 (SRAM2A_BASE + 0x1000U) /* When in secure mode (SRAM2A_BASE + 0x1000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_5 (SRAM2A_BASE + 0x1400U) /* When in secure mode (SRAM2A_BASE + 0x1400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_6 (SRAM2A_BASE + 0x1800U) /* When in secure mode (SRAM2A_BASE + 0x1800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_7 (SRAM2A_BASE + 0x1C00U) /* When in secure mode (SRAM2A_BASE + 0x1C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_8 (SRAM2A_BASE + 0x2000U) /* When in secure mode (SRAM2A_BASE + 0x2000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_9 (SRAM2A_BASE + 0x2400U) /* When in secure mode (SRAM2A_BASE + 0x2400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_10 (SRAM2A_BASE + 0x2800U) /* When in secure mode (SRAM2A_BASE + 0x2800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_11 (SRAM2A_BASE + 0x2C00U) /* When in secure mode (SRAM2A_BASE + 0x2C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_12 (SRAM2A_BASE + 0x3000U) /* When in secure mode (SRAM2A_BASE + 0x3000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_13 (SRAM2A_BASE + 0x3400U) /* When in secure mode (SRAM2A_BASE + 0x3400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_14 (SRAM2A_BASE + 0x3800U) /* When in secure mode (SRAM2A_BASE + 0x3800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_15 (SRAM2A_BASE + 0x3C00U) /* When in secure mode (SRAM2A_BASE + 0x3C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_16 (SRAM2A_BASE + 0x4000U) /* When in secure mode (SRAM2A_BASE + 0x4000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_17 (SRAM2A_BASE + 0x4400U) /* When in secure mode (SRAM2A_BASE + 0x4400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_18 (SRAM2A_BASE + 0x4800U) /* When in secure mode (SRAM2A_BASE + 0x4800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_19 (SRAM2A_BASE + 0x4C00U) /* When in secure mode (SRAM2A_BASE + 0x4C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_20 (SRAM2A_BASE + 0x5000U) /* When in secure mode (SRAM2A_BASE + 0x5000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_21 (SRAM2A_BASE + 0x5400U) /* When in secure mode (SRAM2A_BASE + 0x5400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_22 (SRAM2A_BASE + 0x5800U) /* When in secure mode (SRAM2A_BASE + 0x5800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_23 (SRAM2A_BASE + 0x5C00U) /* When in secure mode (SRAM2A_BASE + 0x5C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_24 (SRAM2A_BASE + 0x6000U) /* When in secure mode (SRAM2A_BASE + 0x6000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_25 (SRAM2A_BASE + 0x6400U) /* When in secure mode (SRAM2A_BASE + 0x6400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_26 (SRAM2A_BASE + 0x6800U) /* When in secure mode (SRAM2A_BASE + 0x6800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_27 (SRAM2A_BASE + 0x6C00U) /* When in secure mode (SRAM2A_BASE + 0x6C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_28 (SRAM2A_BASE + 0x7000U) /* When in secure mode (SRAM2A_BASE + 0x7000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_29 (SRAM2A_BASE + 0x7400U) /* When in secure mode (SRAM2A_BASE + 0x7400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_30 (SRAM2A_BASE + 0x7800U) /* When in secure mode (SRAM2A_BASE + 0x7800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_START_SECURE_ADDR_31 (SRAM2A_BASE + 0x7C00U) /* When in secure mode (SRAM2A_BASE + 0x7C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2A_FULL_UNSECURE (SRAM2A_BASE + 0x8000U) /* The RAM2A is accessible to M0 Plus and M4 */ | |||
/** | |||
* @} | |||
@@ -522,39 +522,39 @@ typedef struct | |||
* @{ | |||
*/ | |||
#define SRAM2B_START_SECURE_ADDR_0 0x20038000U /* When in secure mode 0x20038000 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_1 0x20038400U /* When in secure mode 0x20038400 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_2 0x20038800U /* When in secure mode 0x20038800 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_3 0x20038C00U /* When in secure mode 0x20038C00 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_4 0x20039000U /* When in secure mode 0x20039000 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_5 0x20039400U /* When in secure mode 0x20039400 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_6 0x20039800U /* When in secure mode 0x20039800 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_7 0x20039C00U /* When in secure mode 0x20039C00 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_8 0x2003A000U /* When in secure mode 0x2003A000 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_9 0x2003A400U /* When in secure mode 0x2003A400 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_10 0x2003A800U /* When in secure mode 0x2003A800 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_11 0x2003AC00U /* When in secure mode 0x2003AC00 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_12 0x2003B000U /* When in secure mode 0x2003B000 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_13 0x2003B400U /* When in secure mode 0x2003B400 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_14 0x2003B800U /* When in secure mode 0x2003B800 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_15 0x2003BC00U /* When in secure mode 0x2003BC00 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_16 0x2003C000U /* When in secure mode 0x2003C000 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_17 0x2003C400U /* When in secure mode 0x2003C400 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_18 0x2003C800U /* When in secure mode 0x2003C800 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_19 0x2003CC00U /* When in secure mode 0x2003CC00 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_20 0x2003D000U /* When in secure mode 0x2003D000 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_21 0x2003D400U /* When in secure mode 0x2003D400 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_22 0x2003D800U /* When in secure mode 0x2003D800 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_23 0x2003DC00U /* When in secure mode 0x2003DC00 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_24 0x2003E000U /* When in secure mode 0x2003E000 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_25 0x2003E400U /* When in secure mode 0x2003E400 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_26 0x2003E800U /* When in secure mode 0x2003E800 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_27 0x2003EC00U /* When in secure mode 0x2003EC00 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_28 0x2003F000U /* When in secure mode 0x2003F000 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_29 0x2003F400U /* When in secure mode 0x2003F400 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_30 0x2003F800U /* When in secure mode 0x2003F800 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_31 0x2003FC00U /* When in secure mode 0x2003FC00 - 0x2003FFFF is accessible only by M0 Plus */ | |||
#define SRAM2B_FULL_UNSECURE 0x2003FF00U /* The RAM2B is accessible to M0 Plus and M4 */ | |||
#define SRAM2B_START_SECURE_ADDR_0 (SRAM2B_BASE + 0x0000U) /* When in secure mode (SRAM2B_BASE + 0x0000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_1 (SRAM2B_BASE + 0x0400U) /* When in secure mode (SRAM2B_BASE + 0x0400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_2 (SRAM2B_BASE + 0x0800U) /* When in secure mode (SRAM2B_BASE + 0x0800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_3 (SRAM2B_BASE + 0x0C00U) /* When in secure mode (SRAM2B_BASE + 0x0C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_4 (SRAM2B_BASE + 0x1000U) /* When in secure mode (SRAM2B_BASE + 0x1000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_5 (SRAM2B_BASE + 0x1400U) /* When in secure mode (SRAM2B_BASE + 0x1400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_6 (SRAM2B_BASE + 0x1800U) /* When in secure mode (SRAM2B_BASE + 0x1800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_7 (SRAM2B_BASE + 0x1C00U) /* When in secure mode (SRAM2B_BASE + 0x1C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_8 (SRAM2B_BASE + 0x2000U) /* When in secure mode (SRAM2B_BASE + 0x2000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_9 (SRAM2B_BASE + 0x2400U) /* When in secure mode (SRAM2B_BASE + 0x2400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_10 (SRAM2B_BASE + 0x2800U) /* When in secure mode (SRAM2B_BASE + 0x2800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_11 (SRAM2B_BASE + 0x2C00U) /* When in secure mode (SRAM2B_BASE + 0x2C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_12 (SRAM2B_BASE + 0x3000U) /* When in secure mode (SRAM2B_BASE + 0x3000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_13 (SRAM2B_BASE + 0x3400U) /* When in secure mode (SRAM2B_BASE + 0x3400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_14 (SRAM2B_BASE + 0x3800U) /* When in secure mode (SRAM2B_BASE + 0x3800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_15 (SRAM2B_BASE + 0x3C00U) /* When in secure mode (SRAM2B_BASE + 0x3C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_16 (SRAM2B_BASE + 0x4000U) /* When in secure mode (SRAM2B_BASE + 0x4000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_17 (SRAM2B_BASE + 0x4400U) /* When in secure mode (SRAM2B_BASE + 0x4400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_18 (SRAM2B_BASE + 0x4800U) /* When in secure mode (SRAM2B_BASE + 0x4800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_19 (SRAM2B_BASE + 0x4C00U) /* When in secure mode (SRAM2B_BASE + 0x4C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_20 (SRAM2B_BASE + 0x5000U) /* When in secure mode (SRAM2B_BASE + 0x5000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_21 (SRAM2B_BASE + 0x5400U) /* When in secure mode (SRAM2B_BASE + 0x5400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_22 (SRAM2B_BASE + 0x5800U) /* When in secure mode (SRAM2B_BASE + 0x5800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_23 (SRAM2B_BASE + 0x5C00U) /* When in secure mode (SRAM2B_BASE + 0x5C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_24 (SRAM2B_BASE + 0x6000U) /* When in secure mode (SRAM2B_BASE + 0x6000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_25 (SRAM2B_BASE + 0x6400U) /* When in secure mode (SRAM2B_BASE + 0x6400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_26 (SRAM2B_BASE + 0x6800U) /* When in secure mode (SRAM2B_BASE + 0x6800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_27 (SRAM2B_BASE + 0x6C00U) /* When in secure mode (SRAM2B_BASE + 0x6C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_28 (SRAM2B_BASE + 0x7000U) /* When in secure mode (SRAM2B_BASE + 0x7000) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_29 (SRAM2B_BASE + 0x7400U) /* When in secure mode (SRAM2B_BASE + 0x7400) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_30 (SRAM2B_BASE + 0x7800U) /* When in secure mode (SRAM2B_BASE + 0x7800) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_START_SECURE_ADDR_31 (SRAM2B_BASE + 0x7C00U) /* When in secure mode (SRAM2B_BASE + 0x7C00) -> SRAM2B_END_ADDR is accessible only by M0 Plus */ | |||
#define SRAM2B_FULL_UNSECURE (SRAM2B_BASE + 0x8000U) /* The RAM2B is accessible to M0 Plus and M4 */ | |||
/** | |||
* @} | |||
@@ -707,7 +707,7 @@ typedef struct | |||
* @arg @ref FLASH_FLAG_ECCD FLASH two ECC errors have been detected | |||
* @retval The new state of FLASH_FLAG (SET or RESET). | |||
*/ | |||
#define __HAL_FLASH_GET_FLAG(__FLAG__) ((((__FLAG__) & (FLASH_FLAG_ECCC | FLASH_FLAG_ECCD)) != 0U) ? \ | |||
#define __HAL_FLASH_GET_FLAG(__FLAG__) ((((__FLAG__) & (FLASH_FLAG_ECCR_ERRORS)) != 0U) ? \ | |||
(READ_BIT(FLASH->ECCR, (__FLAG__)) == (__FLAG__)) : \ | |||
(READ_BIT(FLASH->SR, (__FLAG__)) == (__FLAG__))) | |||
/** | |||
@@ -727,11 +727,13 @@ typedef struct | |||
* @arg @ref FLASH_FLAG_OPTVERR FLASH Option validity error flag | |||
* @arg @ref FLASH_FLAG_ECCC FLASH one ECC error has been detected and corrected | |||
* @arg @ref FLASH_FLAG_ECCD FLASH two ECC errors have been detected | |||
* @arg @ref FLASH_FLAG_SR_ERRORS FLASH All SR errors flags | |||
* @arg @ref FLASH_FLAG_ECCR_ERRORS FLASH All ECCR errors flags | |||
* @arg @ref FLASH_FLAG_ALL_ERRORS FLASH All errors flags | |||
* @retval None | |||
*/ | |||
#define __HAL_FLASH_CLEAR_FLAG(__FLAG__) do { if(((__FLAG__) & (FLASH_FLAG_ECCC | FLASH_FLAG_ECCD)) != 0U) { SET_BIT(FLASH->ECCR, ((__FLAG__) & (FLASH_FLAG_ECCC | FLASH_FLAG_ECCD))); }\ | |||
if(((__FLAG__) & ~(FLASH_FLAG_ECCC | FLASH_FLAG_ECCD)) != 0U) { WRITE_REG(FLASH->SR, ((__FLAG__) & ~(FLASH_FLAG_ECCC | FLASH_FLAG_ECCD))); }\ | |||
#define __HAL_FLASH_CLEAR_FLAG(__FLAG__) do { if(((__FLAG__) & (FLASH_FLAG_ECCR_ERRORS)) != 0U) { SET_BIT(FLASH->ECCR, ((__FLAG__) & (FLASH_FLAG_ECCR_ERRORS))); }\ | |||
if(((__FLAG__) & ~(FLASH_FLAG_ECCR_ERRORS)) != 0U) { WRITE_REG(FLASH->SR, ((__FLAG__) & ~(FLASH_FLAG_ECCR_ERRORS))); }\ | |||
} while(0) | |||
/** | |||
* @} | |||
@@ -808,12 +810,11 @@ HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout); | |||
/** @defgroup FLASH_Private_Constants FLASH Private Constants | |||
* @{ | |||
*/ | |||
#define FLASH_SIZE (((uint32_t)(*((uint16_t *)FLASHSIZE_BASE)) & (0x07FFUL)) << 10U) | |||
#define FLASH_END_ADDR (FLASH_BASE + FLASH_SIZE - 1U) | |||
#define FLASH_BANK_SIZE FLASH_SIZE /*!< FLASH Bank Size */ | |||
#define FLASH_PAGE_SIZE 0x00001000U /*!< FLASH Page Size, 4 KBytes */ | |||
#define FLASH_PAGE_NB 128U | |||
#define FLASH_PAGE_NB (FLASH_SIZE / FLASH_PAGE_SIZE) | |||
#define FLASH_TIMEOUT_VALUE 1000U /*!< FLASH Execution Timeout, 1 s */ | |||
#define FLASH_PCROP_GRANULARITY_OFFSET 11U /*!< FLASH Code Readout Protection granularity offset */ | |||
@@ -851,8 +852,7 @@ HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout); | |||
#define IS_ADDR_ALIGNED_64BITS(__VALUE__) (((__VALUE__) & 0x7U) == (0x00UL)) | |||
#define IS_FLASH_TYPEERASE(__VALUE__) (((__VALUE__) == FLASH_TYPEERASE_PAGES) || \ | |||
((__VALUE__) == FLASH_TYPEERASE_MASSERASE)) | |||
#define IS_FLASH_TYPEERASE(__VALUE__) ((__VALUE__) == FLASH_TYPEERASE_PAGES) | |||
#define IS_FLASH_TYPEPROGRAM(__VALUE__) (((__VALUE__) == FLASH_TYPEPROGRAM_DOUBLEWORD) || \ | |||
((__VALUE__) == FLASH_TYPEPROGRAM_FAST)) | |||
@@ -53,7 +53,9 @@ | |||
* | |||
*/ | |||
/* | AF0 | AF1 | AF2 | AF3 | AF4 | AF5 | AF6 | AF7 | | |||
#if defined (STM32WB55xx) || defined (STM32WB5Mxx) || defined (STM32WB50xx) | |||
/* | AF0 | AF1 | AF2 | AF3 | AF4 | AF5 | AF6 | AF7 | | |||
*_____________________________________________________________________________________________ | |||
* |SYS_AF |TIM |TIM |SPI/SAI/TI|I2C | I2C | RF | USART | | |||
*_____________________________________________________________________________________________ | |||
@@ -353,11 +355,248 @@ | |||
/** | |||
* @brief AF 15 selection | |||
*/ | |||
#define GPIO_AF15_EVENTOUT ((uint8_t)0x0f) /*!< EVENTOUT Alternate Function mapping */ | |||
#define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0f) | |||
#endif | |||
#if defined (STM32WB35xx) | |||
/** | |||
* @brief AF 0 selection | |||
*/ | |||
#define GPIO_AF0_MCO ((uint8_t)0x00) /*!< MCO Alternate Function mapping */ | |||
#define GPIO_AF0_LSCO ((uint8_t)0x00) /*!< LSCO Alternate Function mapping */ | |||
#define GPIO_AF0_JTMS_SWDIO ((uint8_t)0x00) /*!< JTMS-SWDIO Alternate Function mapping */ | |||
#define GPIO_AF0_JTCK_SWCLK ((uint8_t)0x00) /*!< JTCK-SWCLK Alternate Function mapping */ | |||
#define GPIO_AF0_JTDI ((uint8_t)0x00) /*!< JTDI Alternate Function mapping */ | |||
#define GPIO_AF0_RTC_OUT ((uint8_t)0x00) /*!< RCT_OUT Alternate Function mapping */ | |||
#define GPIO_AF0_JTD_TRACE ((uint8_t)0x00) /*!< JTDO-TRACESWO Alternate Function mapping */ | |||
#define GPIO_AF0_NJTRST ((uint8_t)0x00) /*!< NJTRST Alternate Function mapping */ | |||
#define GPIO_AF0_TRACED0 ((uint8_t)0x00) /*!< TRACED0 Alternate Function mapping */ | |||
#define GPIO_AF0_TRACED1 ((uint8_t)0x00) /*!< TRACED1 Alternate Function mapping */ | |||
#define GPIO_AF0_TRACED2 ((uint8_t)0x00) /*!< TRACED2 Alternate Function mapping */ | |||
#define GPIO_AF0_TRACED3 ((uint8_t)0x00) /*!< TRACED3 Alternate Function mapping */ | |||
/** | |||
* @brief AF 1 selection | |||
*/ | |||
#define GPIO_AF1_TIM1 ((uint8_t)0x01) /*!< TIM1 Alternate Function mapping */ | |||
#define GPIO_AF1_TIM2 ((uint8_t)0x01) /*!< TIM2 Alternate Function mapping */ | |||
#define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /*!< LPTIM1 Alternate Function mapping */ | |||
/** | |||
* @brief AF 2 selection | |||
*/ | |||
#define GPIO_AF2_TIM1 ((uint8_t)0x02) /*!< TIM1 Alternate Function mapping */ | |||
#define GPIO_AF2_TIM2 ((uint8_t)0x02) /*!< TIM2 Alternate Function mapping */ | |||
/** | |||
* @brief AF 3 selection | |||
*/ | |||
#define GPIO_AF3_SPI1 ((uint8_t)0x03) /*!< SPI1 Alternate Function mapping */ | |||
#define GPIO_AF3_SPI2 ((uint8_t)0x03) /*!< SPI2 Alternate Function mapping */ | |||
#define GPIO_AF3_TIM1 ((uint8_t)0x03) /*!< TIM1 Alternate Function mapping */ | |||
/** | |||
* @brief AF 4 selection | |||
*/ | |||
#define GPIO_AF4_I2C1 ((uint8_t)0x04) /*!< I2C1 Alternate Function mapping */ | |||
#define GPIO_AF4_I2C3 ((uint8_t)0x04) /*!< I2C3 Alternate Function mapping */ | |||
#define GPIO_AF4_SPI1 ((uint8_t)0x04) /*!< SPI1 Alternate Function mapping */ | |||
/** | |||
* @brief AF 5 selection | |||
*/ | |||
#define GPIO_AF5_SPI1 ((uint8_t)0x05) /*!< SPI1 Alternate Function mapping */ | |||
#define GPIO_AF5_SPI2 ((uint8_t)0x05) /*!< SPI2 Alternate Function mapping */ | |||
/** | |||
* @brief AF 6 selection | |||
*/ | |||
#define GPIO_AF6_MCO ((uint8_t)0x06) /*!< MCO Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB0 ((uint8_t)0x06) /*!< RF_DTB0 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB1 ((uint8_t)0x06) /*!< RF_DTB1 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB2 ((uint8_t)0x06) /*!< RF_DTB2 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB3 ((uint8_t)0x06) /*!< RF_DTB3 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB4 ((uint8_t)0x06) /*!< RF_DTB4 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB5 ((uint8_t)0x06) /*!< RF_DTB5 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB6 ((uint8_t)0x06) /*!< RF_DTB6 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB7 ((uint8_t)0x06) /*!< RF_DTB7 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB8 ((uint8_t)0x06) /*!< RF_DTB8 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB9 ((uint8_t)0x06) /*!< RF_DTB9 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB10 ((uint8_t)0x06) /*!< RF_DTB10 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB11 ((uint8_t)0x06) /*!< RF_DTB11 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB12 ((uint8_t)0x06) /*!< RF_DTB12 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB13 ((uint8_t)0x06) /*!< RF_DTB13 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB14 ((uint8_t)0x06) /*!< RF_DTB14 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB15 ((uint8_t)0x06) /*!< RF_DTB15 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB16 ((uint8_t)0x06) /*!< RF_DTB16 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB17 ((uint8_t)0x06) /*!< RF_DTB17 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB18 ((uint8_t)0x06) /*!< RF_DTB18 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_MISO ((uint8_t)0x06) /*!< RF_MISO Alternate Function mapping */ | |||
#define GPIO_AF6_RF_MOSI ((uint8_t)0x06) /*!< RF_MOSI Alternate Function mapping */ | |||
#define GPIO_AF6_RF_SCK ((uint8_t)0x06) /*!< RF_SCK Alternate Function mapping */ | |||
#define GPIO_AF6_RF_NSS ((uint8_t)0x06) /*!< RF_NSS Alternate Function mapping */ | |||
/** | |||
* @brief AF 7 selection | |||
*/ | |||
#define GPIO_AF7_USART1 ((uint8_t)0x07) /*!< USART1 Alternate Function mapping */ | |||
/** | |||
* @brief AF 8 selection | |||
*/ | |||
#define GPIO_AF8_IR ((uint8_t)0x08) /*!< IR Alternate Function mapping */ | |||
#define GPIO_AF8_LPUART1 ((uint8_t)0x08) /*!< LPUART1 Alternate Function mapping */ | |||
/** | |||
* @brief AF 9 selection | |||
*/ | |||
#define GPIO_AF9_TSC ((uint8_t)0x09) /*!< TSC Alternate Function mapping */ | |||
/** | |||
* @brief AF 10 selection | |||
*/ | |||
#define GPIO_AF10_QUADSPI ((uint8_t)0x0A) /*!< QUADSPI Alternate Function mapping */ | |||
#define GPIO_AF10_USB ((uint8_t)0x0A) /*!< USB Alternate Function mapping */ | |||
/** | |||
* @brief AF 12 selection | |||
*/ | |||
#define GPIO_AF12_COMP1 ((uint8_t)0x0C) /*!< COMP1 Alternate Function mapping */ | |||
#define GPIO_AF12_COMP2 ((uint8_t)0x0C) /*!< COMP2 Alternate Function mapping */ | |||
#define GPIO_AF12_TIM1 ((uint8_t)0x0C) /*!< TIM1 Alternate Function mapping */ | |||
/** | |||
* @brief AF 14 selection | |||
*/ | |||
#define GPIO_AF14_LPTIM2 ((uint8_t)0x0E) /*!< LPTIM2 Alternate Function mapping */ | |||
#define GPIO_AF14_TIM2 ((uint8_t)0x0E) /*!< TIM2 Alternate Function mapping */ | |||
#define GPIO_AF14_TIM16 ((uint8_t)0x0E) /*!< TIM16 Alternate Function mapping */ | |||
#define GPIO_AF14_TIM17 ((uint8_t)0x0E) /*!< TIM17 Alternate Function mapping */ | |||
/** | |||
* @brief AF 15 selection | |||
*/ | |||
#define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /*!< EVENTOUT Alternate Function mapping */ | |||
#define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0F) && ((AF) != (uint8_t)0x0B) && ((AF) != (uint8_t)0x0D)) | |||
#endif | |||
#if defined (STM32WB30xx) | |||
/** | |||
* @brief AF 0 selection | |||
*/ | |||
#define GPIO_AF0_MCO ((uint8_t)0x00) /*!< MCO Alternate Function mapping */ | |||
#define GPIO_AF0_LSCO ((uint8_t)0x00) /*!< LSCO Alternate Function mapping */ | |||
#define GPIO_AF0_JTMS_SWDIO ((uint8_t)0x00) /*!< JTMS-SWDIO Alternate Function mapping */ | |||
#define GPIO_AF0_JTCK_SWCLK ((uint8_t)0x00) /*!< JTCK-SWCLK Alternate Function mapping */ | |||
#define GPIO_AF0_JTDI ((uint8_t)0x00) /*!< JTDI Alternate Function mapping */ | |||
#define GPIO_AF0_RTC_OUT ((uint8_t)0x00) /*!< RCT_OUT Alternate Function mapping */ | |||
#define GPIO_AF0_JTD_TRACE ((uint8_t)0x00) /*!< JTDO-TRACESWO Alternate Function mapping */ | |||
#define GPIO_AF0_NJTRST ((uint8_t)0x00) /*!< NJTRST Alternate Function mapping */ | |||
#define GPIO_AF0_TRACED0 ((uint8_t)0x00) /*!< TRACED0 Alternate Function mapping */ | |||
#define GPIO_AF0_TRACED1 ((uint8_t)0x00) /*!< TRACED1 Alternate Function mapping */ | |||
#define GPIO_AF0_TRACED2 ((uint8_t)0x00) /*!< TRACED2 Alternate Function mapping */ | |||
#define GPIO_AF0_TRACED3 ((uint8_t)0x00) /*!< TRACED3 Alternate Function mapping */ | |||
/** | |||
* @brief AF 1 selection | |||
*/ | |||
#define GPIO_AF1_TIM1 ((uint8_t)0x01) /*!< TIM1 Alternate Function mapping */ | |||
#define GPIO_AF1_TIM2 ((uint8_t)0x01) /*!< TIM2 Alternate Function mapping */ | |||
#define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /*!< LPTIM1 Alternate Function mapping */ | |||
/** | |||
* @brief AF 2 selection | |||
*/ | |||
#define GPIO_AF2_TIM1 ((uint8_t)0x02) /*!< TIM1 Alternate Function mapping */ | |||
#define GPIO_AF2_TIM2 ((uint8_t)0x02) /*!< TIM2 Alternate Function mapping */ | |||
/** | |||
* @brief AF 3 selection | |||
*/ | |||
#define GPIO_AF3_TIM1 ((uint8_t)0x03) /*!< TIM1 Alternate Function mapping */ | |||
/** | |||
* @brief AF 4 selection | |||
*/ | |||
#define GPIO_AF4_I2C1 ((uint8_t)0x04) /*!< I2C1 Alternate Function mapping */ | |||
#define GPIO_AF4_SPI1 ((uint8_t)0x04) /*!< SPI1 Alternate Function mapping */ | |||
/** | |||
* @brief AF 5 selection | |||
*/ | |||
#define GPIO_AF5_SPI1 ((uint8_t)0x05) /*!< SPI1 Alternate Function mapping */ | |||
/** | |||
* @brief AF 6 selection | |||
*/ | |||
#define GPIO_AF6_MCO ((uint8_t)0x06) /*!< MCO Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB0 ((uint8_t)0x06) /*!< RF_DTB0 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB1 ((uint8_t)0x06) /*!< RF_DTB1 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB2 ((uint8_t)0x06) /*!< RF_DTB2 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB3 ((uint8_t)0x06) /*!< RF_DTB3 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB4 ((uint8_t)0x06) /*!< RF_DTB4 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB5 ((uint8_t)0x06) /*!< RF_DTB5 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB6 ((uint8_t)0x06) /*!< RF_DTB6 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB7 ((uint8_t)0x06) /*!< RF_DTB7 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB8 ((uint8_t)0x06) /*!< RF_DTB8 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB9 ((uint8_t)0x06) /*!< RF_DTB9 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB10 ((uint8_t)0x06) /*!< RF_DTB10 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB11 ((uint8_t)0x06) /*!< RF_DTB11 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB12 ((uint8_t)0x06) /*!< RF_DTB12 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB13 ((uint8_t)0x06) /*!< RF_DTB13 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB14 ((uint8_t)0x06) /*!< RF_DTB14 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB15 ((uint8_t)0x06) /*!< RF_DTB15 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB16 ((uint8_t)0x06) /*!< RF_DTB16 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB17 ((uint8_t)0x06) /*!< RF_DTB17 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_DTB18 ((uint8_t)0x06) /*!< RF_DTB18 Alternate Function mapping */ | |||
#define GPIO_AF6_RF_MISO ((uint8_t)0x06) /*!< RF_MISO Alternate Function mapping */ | |||
#define GPIO_AF6_RF_MOSI ((uint8_t)0x06) /*!< RF_MOSI Alternate Function mapping */ | |||
#define GPIO_AF6_RF_SCK ((uint8_t)0x06) /*!< RF_SCK Alternate Function mapping */ | |||
#define GPIO_AF6_RF_NSS ((uint8_t)0x06) /*!< RF_NSS Alternate Function mapping */ | |||
/** | |||
* @brief AF 7 selection | |||
*/ | |||
#define GPIO_AF7_USART1 ((uint8_t)0x07) /*!< USART1 Alternate Function mapping */ | |||
/** | |||
* @brief AF 8 selection | |||
*/ | |||
#define GPIO_AF8_IR ((uint8_t)0x08) /*!< IR Alternate Function mapping */ | |||
/** | |||
* @brief AF 9 selection | |||
*/ | |||
#define GPIO_AF9_TSC ((uint8_t)0x09) /*!< TSC Alternate Function mapping */ | |||
/** | |||
* @brief AF 12 selection | |||
*/ | |||
#define GPIO_AF12_TIM1 ((uint8_t)0x0C) /*!< TIM1 Alternate Function mapping */ | |||
/** | |||
* @brief AF 14 selection | |||
*/ | |||
#define GPIO_AF14_LPTIM2 ((uint8_t)0x0E) /*!< LPTIM2 Alternate Function mapping */ | |||
#define GPIO_AF14_TIM2 ((uint8_t)0x0E) /*!< TIM2 Alternate Function mapping */ | |||
#define GPIO_AF14_TIM16 ((uint8_t)0x0E) /*!< TIM16 Alternate Function mapping */ | |||
#define GPIO_AF14_TIM17 ((uint8_t)0x0E) /*!< TIM17 Alternate Function mapping */ | |||
/** | |||
* @brief AF 15 selection | |||
*/ | |||
#define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /*!< EVENTOUT Alternate Function mapping */ | |||
#define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0F) && ((AF) != (uint8_t)0x0A) && ((AF) != (uint8_t)0x0B) && ((AF) != (uint8_t)0x0D)) | |||
#endif | |||
/** | |||
* @} | |||
@@ -375,13 +614,18 @@ | |||
/** @defgroup GPIOEx_Get_Port_Index GPIOEx Get Port Index | |||
* @{ | |||
*/ | |||
#if defined (STM32WB55xx) || defined (STM32WB5Mxx) | |||
#define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0uL :\ | |||
((__GPIOx__) == (GPIOB))? 1uL :\ | |||
((__GPIOx__) == (GPIOC))? 2uL :\ | |||
((__GPIOx__) == (GPIOD))? 3uL :\ | |||
((__GPIOx__) == (GPIOE))? 4uL : 7uL) | |||
#else | |||
#define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0uL :\ | |||
((__GPIOx__) == (GPIOB))? 1uL :\ | |||
((__GPIOx__) == (GPIOC))? 2uL :\ | |||
((__GPIOx__) == (GPIOE))? 4uL : 7uL) | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
@@ -55,12 +55,17 @@ extern "C" { | |||
/** @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_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 | |||
/** | |||
* @} | |||
*/ | |||
@@ -113,6 +118,9 @@ void HAL_I2CEx_DisableFastModePlus(uint32_t ConfigFastModePlus); | |||
(((__CONFIG__) & (I2C_FASTMODEPLUS_PB9)) == I2C_FASTMODEPLUS_PB9) || \ | |||
(((__CONFIG__) & (I2C_FASTMODEPLUS_I2C1)) == I2C_FASTMODEPLUS_I2C1) || \ | |||
(((__CONFIG__) & (I2C_FASTMODEPLUS_I2C3)) == I2C_FASTMODEPLUS_I2C3)) | |||
/** | |||
* @} | |||
*/ | |||
@@ -0,0 +1,546 @@ | |||
/** | |||
****************************************************************************** | |||
* @file stm32wbxx_hal_i2s.h | |||
* @author MCD Application Team | |||
* @brief Header file of I2S HAL module. | |||
****************************************************************************** | |||
* @attention | |||
* | |||
* <h2><center>© Copyright (c) 2019 STMicroelectronics. | |||
* All rights reserved.</center></h2> | |||
* | |||
* This software component is licensed by ST under BSD 3-Clause license, | |||
* the "License"; You may not use this file except in compliance with the | |||
* License. You may obtain a copy of the License at: | |||
* opensource.org/licenses/BSD-3-Clause | |||
* | |||
****************************************************************************** | |||
*/ | |||
/* Define to prevent recursive inclusion -------------------------------------*/ | |||
#ifndef STM32WBxx_HAL_I2S_H | |||
#define STM32WBxx_HAL_I2S_H | |||
#ifdef __cplusplus | |||
extern "C" { | |||
#endif | |||
/* Includes ------------------------------------------------------------------*/ | |||
#include "stm32wbxx_hal_def.h" | |||
#if defined(SPI_I2S_SUPPORT) | |||
/** @addtogroup STM32WBxx_HAL_Driver | |||
* @{ | |||
*/ | |||
/** @addtogroup I2S | |||
* @{ | |||
*/ | |||
/* Exported types ------------------------------------------------------------*/ | |||
/** @defgroup I2S_Exported_Types I2S Exported Types | |||
* @{ | |||
*/ | |||
/** | |||
* @brief I2S Init structure definition | |||
*/ | |||
typedef struct | |||
{ | |||
uint32_t Mode; /*!< Specifies the I2S operating mode. | |||
This parameter can be a value of @ref I2S_Mode */ | |||
uint32_t Standard; /*!< Specifies the standard used for the I2S communication. | |||
This parameter can be a value of @ref I2S_Standard */ | |||
uint32_t DataFormat; /*!< Specifies the data format for the I2S communication. | |||
This parameter can be a value of @ref I2S_Data_Format */ | |||
uint32_t MCLKOutput; /*!< Specifies whether the I2S MCLK output is enabled or not. | |||
This parameter can be a value of @ref I2S_MCLK_Output */ | |||
uint32_t AudioFreq; /*!< Specifies the frequency selected for the I2S communication. | |||
This parameter can be a value of @ref I2S_Audio_Frequency */ | |||
uint32_t CPOL; /*!< Specifies the idle state of the I2S clock. | |||
This parameter can be a value of @ref I2S_Clock_Polarity */ | |||
} I2S_InitTypeDef; | |||
/** | |||
* @brief HAL State structures definition | |||
*/ | |||
typedef enum | |||
{ | |||
HAL_I2S_STATE_RESET = 0x00U, /*!< I2S not yet initialized or disabled */ | |||
HAL_I2S_STATE_READY = 0x01U, /*!< I2S initialized and ready for use */ | |||
HAL_I2S_STATE_BUSY = 0x02U, /*!< I2S internal process is ongoing */ | |||
HAL_I2S_STATE_BUSY_TX = 0x03U, /*!< Data Transmission process is ongoing */ | |||
HAL_I2S_STATE_BUSY_RX = 0x04U, /*!< Data Reception process is ongoing */ | |||
HAL_I2S_STATE_TIMEOUT = 0x06U, /*!< I2S timeout state */ | |||
HAL_I2S_STATE_ERROR = 0x07U /*!< I2S error state */ | |||
} HAL_I2S_StateTypeDef; | |||
/** | |||
* @brief I2S handle Structure definition | |||
*/ | |||
#if (USE_HAL_I2S_REGISTER_CALLBACKS == 1) | |||
typedef struct __I2S_HandleTypeDef | |||
#else | |||
typedef struct | |||
#endif /* USE_HAL_I2S_REGISTER_CALLBACKS */ | |||
{ | |||
SPI_TypeDef *Instance; /*!< I2S registers base address */ | |||
I2S_InitTypeDef Init; /*!< I2S communication parameters */ | |||
uint16_t *pTxBuffPtr; /*!< Pointer to I2S Tx transfer buffer */ | |||
__IO uint16_t TxXferSize; /*!< I2S Tx transfer size */ | |||
__IO uint16_t TxXferCount; /*!< I2S Tx transfer Counter */ | |||
uint16_t *pRxBuffPtr; /*!< Pointer to I2S Rx transfer buffer */ | |||
__IO uint16_t RxXferSize; /*!< I2S Rx transfer size */ | |||
__IO uint16_t RxXferCount; /*!< I2S Rx transfer counter | |||
(This field is initialized at the | |||
same value as transfer size at the | |||
beginning of the transfer and | |||
decremented when a sample is received | |||
NbSamplesReceived = RxBufferSize-RxBufferCount) */ | |||
DMA_HandleTypeDef *hdmatx; /*!< I2S Tx DMA handle parameters */ | |||
DMA_HandleTypeDef *hdmarx; /*!< I2S Rx DMA handle parameters */ | |||
__IO HAL_LockTypeDef Lock; /*!< I2S locking object */ | |||
__IO HAL_I2S_StateTypeDef State; /*!< I2S communication state */ | |||
__IO uint32_t ErrorCode; /*!< I2S Error code | |||
This parameter can be a value of @ref I2S_Error */ | |||
#if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U) | |||
void (* TxCpltCallback)(struct __I2S_HandleTypeDef *hi2s); /*!< I2S Tx Completed callback */ | |||
void (* RxCpltCallback)(struct __I2S_HandleTypeDef *hi2s); /*!< I2S Rx Completed callback */ | |||
void (* TxHalfCpltCallback)(struct __I2S_HandleTypeDef *hi2s); /*!< I2S Tx Half Completed callback */ | |||
void (* RxHalfCpltCallback)(struct __I2S_HandleTypeDef *hi2s); /*!< I2S Rx Half Completed callback */ | |||
void (* ErrorCallback)(struct __I2S_HandleTypeDef *hi2s); /*!< I2S Error callback */ | |||
void (* MspInitCallback)(struct __I2S_HandleTypeDef *hi2s); /*!< I2S Msp Init callback */ | |||
void (* MspDeInitCallback)(struct __I2S_HandleTypeDef *hi2s); /*!< I2S Msp DeInit callback */ | |||
#endif /* USE_HAL_I2S_REGISTER_CALLBACKS */ | |||
} I2S_HandleTypeDef; | |||
#if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U) | |||
/** | |||
* @brief HAL I2S Callback ID enumeration definition | |||
*/ | |||
typedef enum | |||
{ | |||
HAL_I2S_TX_COMPLETE_CB_ID = 0x00U, /*!< I2S Tx Completed callback ID */ | |||
HAL_I2S_RX_COMPLETE_CB_ID = 0x01U, /*!< I2S Rx Completed callback ID */ | |||
HAL_I2S_TX_HALF_COMPLETE_CB_ID = 0x03U, /*!< I2S Tx Half Completed callback ID */ | |||
HAL_I2S_RX_HALF_COMPLETE_CB_ID = 0x04U, /*!< I2S Rx Half Completed callback ID */ | |||
HAL_I2S_ERROR_CB_ID = 0x06U, /*!< I2S Error callback ID */ | |||
HAL_I2S_MSPINIT_CB_ID = 0x07U, /*!< I2S Msp Init callback ID */ | |||
HAL_I2S_MSPDEINIT_CB_ID = 0x08U /*!< I2S Msp DeInit callback ID */ | |||
} HAL_I2S_CallbackIDTypeDef; | |||
/** | |||
* @brief HAL I2S Callback pointer definition | |||
*/ | |||
typedef void (*pI2S_CallbackTypeDef)(I2S_HandleTypeDef *hi2s); /*!< pointer to an I2S callback function */ | |||
#endif /* USE_HAL_I2S_REGISTER_CALLBACKS */ | |||
/** | |||
* @} | |||
*/ | |||
/* Exported constants --------------------------------------------------------*/ | |||
/** @defgroup I2S_Exported_Constants I2S Exported Constants | |||
* @{ | |||
*/ | |||
/** @defgroup I2S_Error I2S Error | |||
* @{ | |||
*/ | |||
#define HAL_I2S_ERROR_NONE (0x00000000U) /*!< No error */ | |||
#define HAL_I2S_ERROR_TIMEOUT (0x00000001U) /*!< Timeout error */ | |||
#define HAL_I2S_ERROR_OVR (0x00000002U) /*!< OVR error */ | |||
#define HAL_I2S_ERROR_UDR (0x00000004U) /*!< UDR error */ | |||
#define HAL_I2S_ERROR_DMA (0x00000008U) /*!< DMA transfer error */ | |||
#define HAL_I2S_ERROR_PRESCALER (0x00000010U) /*!< Prescaler Calculation error */ | |||
#if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U) | |||
#define HAL_I2S_ERROR_INVALID_CALLBACK (0x00000020U) /*!< Invalid Callback error */ | |||
#endif /* USE_HAL_I2S_REGISTER_CALLBACKS */ | |||
/** | |||
* @} | |||
*/ | |||
/** @defgroup I2S_Mode I2S Mode | |||
* @{ | |||
*/ | |||
#define I2S_MODE_SLAVE_TX (0x00000000U) | |||
#define I2S_MODE_SLAVE_RX (SPI_I2SCFGR_I2SCFG_0) | |||
#define I2S_MODE_MASTER_TX (SPI_I2SCFGR_I2SCFG_1) | |||
#define I2S_MODE_MASTER_RX ((SPI_I2SCFGR_I2SCFG_0 | SPI_I2SCFGR_I2SCFG_1)) | |||
/** | |||
* @} | |||
*/ | |||
/** @defgroup I2S_Standard I2S Standard | |||
* @{ | |||
*/ | |||
#define I2S_STANDARD_PHILIPS (0x00000000U) | |||
#define I2S_STANDARD_MSB (SPI_I2SCFGR_I2SSTD_0) | |||
#define I2S_STANDARD_LSB (SPI_I2SCFGR_I2SSTD_1) | |||
#define I2S_STANDARD_PCM_SHORT ((SPI_I2SCFGR_I2SSTD_0 | SPI_I2SCFGR_I2SSTD_1)) | |||
#define I2S_STANDARD_PCM_LONG ((SPI_I2SCFGR_I2SSTD_0 | SPI_I2SCFGR_I2SSTD_1 | SPI_I2SCFGR_PCMSYNC)) | |||
/** | |||
* @} | |||
*/ | |||
/** @defgroup I2S_Data_Format I2S Data Format | |||
* @{ | |||
*/ | |||
#define I2S_DATAFORMAT_16B (0x00000000U) | |||
#define I2S_DATAFORMAT_16B_EXTENDED (SPI_I2SCFGR_CHLEN) | |||
#define I2S_DATAFORMAT_24B ((SPI_I2SCFGR_CHLEN | SPI_I2SCFGR_DATLEN_0)) | |||
#define I2S_DATAFORMAT_32B ((SPI_I2SCFGR_CHLEN | SPI_I2SCFGR_DATLEN_1)) | |||
/** | |||
* @} | |||
*/ | |||
/** @defgroup I2S_MCLK_Output I2S MCLK Output | |||
* @{ | |||
*/ | |||
#define I2S_MCLKOUTPUT_ENABLE (SPI_I2SPR_MCKOE) | |||
#define I2S_MCLKOUTPUT_DISABLE (0x00000000U) | |||
/** | |||
* @} | |||
*/ | |||
/** @defgroup I2S_Audio_Frequency I2S Audio Frequency | |||
* @{ | |||
*/ | |||
#define I2S_AUDIOFREQ_192K (192000U) | |||
#define I2S_AUDIOFREQ_96K (96000U) | |||
#define I2S_AUDIOFREQ_48K (48000U) | |||
#define I2S_AUDIOFREQ_44K (44100U) | |||
#define I2S_AUDIOFREQ_32K (32000U) | |||
#define I2S_AUDIOFREQ_22K (22050U) | |||
#define I2S_AUDIOFREQ_16K (16000U) | |||
#define I2S_AUDIOFREQ_11K (11025U) | |||
#define I2S_AUDIOFREQ_8K (8000U) | |||
#define I2S_AUDIOFREQ_DEFAULT (2U) | |||
/** | |||
* @} | |||
*/ | |||
/** @defgroup I2S_Clock_Polarity I2S Clock Polarity | |||
* @{ | |||
*/ | |||
#define I2S_CPOL_LOW (0x00000000U) | |||
#define I2S_CPOL_HIGH (SPI_I2SCFGR_CKPOL) | |||
/** | |||
* @} | |||
*/ | |||
/** @defgroup I2S_Interrupts_Definition I2S Interrupts Definition | |||
* @{ | |||
*/ | |||
#define I2S_IT_TXE SPI_CR2_TXEIE | |||
#define I2S_IT_RXNE SPI_CR2_RXNEIE | |||
#define I2S_IT_ERR SPI_CR2_ERRIE | |||
/** | |||
* @} | |||
*/ | |||
/** @defgroup I2S_Flags_Definition I2S Flags Definition | |||
* @{ | |||
*/ | |||
#define I2S_FLAG_TXE SPI_SR_TXE | |||
#define I2S_FLAG_RXNE SPI_SR_RXNE | |||
#define I2S_FLAG_UDR SPI_SR_UDR | |||
#define I2S_FLAG_OVR SPI_SR_OVR | |||
#define I2S_FLAG_FRE SPI_SR_FRE | |||
#define I2S_FLAG_CHSIDE SPI_SR_CHSIDE | |||
#define I2S_FLAG_BSY SPI_SR_BSY | |||
#define I2S_FLAG_MASK (SPI_SR_RXNE\ | |||
| SPI_SR_TXE | SPI_SR_UDR | SPI_SR_OVR | SPI_SR_FRE | SPI_SR_CHSIDE | SPI_SR_BSY) | |||
/** | |||
* @} | |||
*/ | |||
/** | |||
* @} | |||
*/ | |||
/* Exported macros -----------------------------------------------------------*/ | |||
/** @defgroup I2S_Exported_macros I2S Exported Macros | |||
* @{ | |||
*/ | |||
/** @brief Reset I2S handle state | |||
* @param __HANDLE__ specifies the I2S Handle. | |||
* @retval None | |||
*/ | |||
#if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U) | |||
#define __HAL_I2S_RESET_HANDLE_STATE(__HANDLE__) do{ \ | |||
(__HANDLE__)->State = HAL_I2S_STATE_RESET; \ | |||
(__HANDLE__)->MspInitCallback = NULL; \ | |||
(__HANDLE__)->MspDeInitCallback = NULL; \ | |||
} while(0) | |||
#else | |||
#define __HAL_I2S_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_I2S_STATE_RESET) | |||
#endif /* USE_HAL_I2S_REGISTER_CALLBACKS */ | |||
/** @brief Enable the specified SPI peripheral (in I2S mode). | |||
* @param __HANDLE__ specifies the I2S Handle. | |||
* @retval None | |||
*/ | |||
#define __HAL_I2S_ENABLE(__HANDLE__) (SET_BIT((__HANDLE__)->Instance->I2SCFGR, SPI_I2SCFGR_I2SE)) | |||
/** @brief Disable the specified SPI peripheral (in I2S mode). | |||
* @param __HANDLE__ specifies the I2S Handle. | |||
* @retval None | |||
*/ | |||
#define __HAL_I2S_DISABLE(__HANDLE__) (CLEAR_BIT((__HANDLE__)->Instance->I2SCFGR, SPI_I2SCFGR_I2SE)) | |||
/** @brief Enable the specified I2S interrupts. | |||
* @param __HANDLE__ specifies the I2S Handle. | |||
* @param __INTERRUPT__ specifies the interrupt source to enable or disable. | |||
* This parameter can be one of the following values: | |||
* @arg I2S_IT_TXE: Tx buffer empty interrupt enable | |||
* @arg I2S_IT_RXNE: RX buffer not empty interrupt enable | |||
* @arg I2S_IT_ERR: Error interrupt enable | |||
* @retval None | |||
*/ | |||
#define __HAL_I2S_ENABLE_IT(__HANDLE__, __INTERRUPT__) (SET_BIT((__HANDLE__)->Instance->CR2,(__INTERRUPT__))) | |||
/** @brief Disable the specified I2S interrupts. | |||
* @param __HANDLE__ specifies the I2S Handle. | |||
* @param __INTERRUPT__ specifies the interrupt source to enable or disable. | |||
* This parameter can be one of the following values: | |||
* @arg I2S_IT_TXE: Tx buffer empty interrupt enable | |||
* @arg I2S_IT_RXNE: RX buffer not empty interrupt enable | |||
* @arg I2S_IT_ERR: Error interrupt enable | |||
* @retval None | |||
*/ | |||
#define __HAL_I2S_DISABLE_IT(__HANDLE__, __INTERRUPT__) (CLEAR_BIT((__HANDLE__)->Instance->CR2,(__INTERRUPT__))) | |||
/** @brief Checks if the specified I2S interrupt source is enabled or disabled. | |||
* @param __HANDLE__ specifies the I2S Handle. | |||
* This parameter can be I2S where x: 1, 2, or 3 to select the I2S peripheral. | |||
* @param __INTERRUPT__ specifies the I2S interrupt source to check. | |||
* This parameter can be one of the following values: | |||
* @arg I2S_IT_TXE: Tx buffer empty interrupt enable | |||
* @arg I2S_IT_RXNE: RX buffer not empty interrupt enable | |||
* @arg I2S_IT_ERR: Error interrupt enable | |||
* @retval The new state of __IT__ (TRUE or FALSE). | |||
*/ | |||
#define __HAL_I2S_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->CR2\ | |||
& (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET) | |||
/** @brief Checks whether the specified I2S flag is set or not. | |||
* @param __HANDLE__ specifies the I2S Handle. | |||
* @param __FLAG__ specifies the flag to check. | |||
* This parameter can be one of the following values: | |||
* @arg I2S_FLAG_RXNE: Receive buffer not empty flag | |||
* @arg I2S_FLAG_TXE: Transmit buffer empty flag | |||
* @arg I2S_FLAG_UDR: Underrun flag | |||
* @arg I2S_FLAG_OVR: Overrun flag | |||
* @arg I2S_FLAG_FRE: Frame error flag | |||
* @arg I2S_FLAG_CHSIDE: Channel Side flag | |||
* @arg I2S_FLAG_BSY: Busy flag | |||
* @retval The new state of __FLAG__ (TRUE or FALSE). | |||
*/ | |||
#define __HAL_I2S_GET_FLAG(__HANDLE__, __FLAG__) ((((__HANDLE__)->Instance->SR) & (__FLAG__)) == (__FLAG__)) | |||
/** @brief Clears the I2S OVR pending flag. | |||
* @param __HANDLE__ specifies the I2S Handle. | |||
* @retval None | |||
*/ | |||
#define __HAL_I2S_CLEAR_OVRFLAG(__HANDLE__) do{ \ | |||
__IO uint32_t tmpreg_ovr = 0x00U; \ | |||
tmpreg_ovr = (__HANDLE__)->Instance->DR; \ | |||
tmpreg_ovr = (__HANDLE__)->Instance->SR; \ | |||
UNUSED(tmpreg_ovr); \ | |||
}while(0U) | |||
/** @brief Clears the I2S UDR pending flag. | |||
* @param __HANDLE__ specifies the I2S Handle. | |||
* @retval None | |||
*/ | |||
#define __HAL_I2S_CLEAR_UDRFLAG(__HANDLE__) do{\ | |||
__IO uint32_t tmpreg_udr = 0x00U;\ | |||
tmpreg_udr = ((__HANDLE__)->Instance->SR);\ | |||
UNUSED(tmpreg_udr); \ | |||
}while(0U) | |||
/** | |||
* @} | |||
*/ | |||
/* Exported functions --------------------------------------------------------*/ | |||
/** @addtogroup I2S_Exported_Functions | |||
* @{ | |||
*/ | |||
/** @addtogroup I2S_Exported_Functions_Group1 | |||
* @{ | |||
*/ | |||
/* Initialization/de-initialization functions ********************************/ | |||
HAL_StatusTypeDef HAL_I2S_Init(I2S_HandleTypeDef *hi2s); | |||
HAL_StatusTypeDef HAL_I2S_DeInit(I2S_HandleTypeDef *hi2s); | |||
void HAL_I2S_MspInit(I2S_HandleTypeDef *hi2s); | |||
void HAL_I2S_MspDeInit(I2S_HandleTypeDef *hi2s); | |||
/* Callbacks Register/UnRegister functions ***********************************/ | |||
#if (USE_HAL_I2S_REGISTER_CALLBACKS == 1U) | |||
HAL_StatusTypeDef HAL_I2S_RegisterCallback(I2S_HandleTypeDef *hi2s, HAL_I2S_CallbackIDTypeDef CallbackID, | |||
pI2S_CallbackTypeDef pCallback); | |||
HAL_StatusTypeDef HAL_I2S_UnRegisterCallback(I2S_HandleTypeDef *hi2s, HAL_I2S_CallbackIDTypeDef CallbackID); | |||
#endif /* USE_HAL_I2S_REGISTER_CALLBACKS */ | |||
/** | |||
* @} | |||
*/ | |||
/** @addtogroup I2S_Exported_Functions_Group2 | |||
* @{ | |||
*/ | |||
/* I/O operation functions ***************************************************/ | |||
/* Blocking mode: Polling */ | |||
HAL_StatusTypeDef HAL_I2S_Transmit(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size, uint32_t Timeout); | |||
HAL_StatusTypeDef HAL_I2S_Receive(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size, uint32_t Timeout); | |||
/* Non-Blocking mode: Interrupt */ | |||
HAL_StatusTypeDef HAL_I2S_Transmit_IT(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size); | |||
HAL_StatusTypeDef HAL_I2S_Receive_IT(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size); | |||
void HAL_I2S_IRQHandler(I2S_HandleTypeDef *hi2s); | |||
/* Non-Blocking mode: DMA */ | |||
HAL_StatusTypeDef HAL_I2S_Transmit_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size); | |||
HAL_StatusTypeDef HAL_I2S_Receive_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size); | |||
HAL_StatusTypeDef HAL_I2S_DMAPause(I2S_HandleTypeDef *hi2s); | |||
HAL_StatusTypeDef HAL_I2S_DMAResume(I2S_HandleTypeDef *hi2s); | |||
HAL_StatusTypeDef HAL_I2S_DMAStop(I2S_HandleTypeDef *hi2s); | |||
/* Callbacks used in non blocking modes (Interrupt and DMA) *******************/ | |||
void HAL_I2S_TxHalfCpltCallback(I2S_HandleTypeDef *hi2s); | |||
void HAL_I2S_TxCpltCallback(I2S_HandleTypeDef *hi2s); | |||
void HAL_I2S_RxHalfCpltCallback(I2S_HandleTypeDef *hi2s); | |||
void HAL_I2S_RxCpltCallback(I2S_HandleTypeDef *hi2s); | |||
void HAL_I2S_ErrorCallback(I2S_HandleTypeDef *hi2s); | |||
/** | |||
* @} | |||
*/ | |||
/** @addtogroup I2S_Exported_Functions_Group3 | |||
* @{ | |||
*/ | |||
/* Peripheral Control and State functions ************************************/ | |||
HAL_I2S_StateTypeDef HAL_I2S_GetState(I2S_HandleTypeDef *hi2s); | |||
uint32_t HAL_I2S_GetError(I2S_HandleTypeDef *hi2s); | |||
/** | |||
* @} | |||
*/ | |||
/** | |||
* @} | |||
*/ | |||
/* Private types -------------------------------------------------------------*/ | |||
/* Private variables ---------------------------------------------------------*/ | |||
/* Private constants ---------------------------------------------------------*/ | |||
/* Private macros ------------------------------------------------------------*/ | |||
/** @defgroup I2S_Private_Macros I2S Private Macros | |||
* @{ | |||
*/ | |||
/** @brief Check whether the specified SPI flag is set or not. | |||
* @param __SR__ copy of I2S SR regsiter. | |||
* @param __FLAG__ specifies the flag to check. | |||
* This parameter can be one of the following values: | |||
* @arg I2S_FLAG_RXNE: Receive buffer not empty flag | |||
* @arg I2S_FLAG_TXE: Transmit buffer empty flag | |||
* @arg I2S_FLAG_UDR: Underrun error flag | |||
* @arg I2S_FLAG_OVR: Overrun flag | |||
* @arg I2S_FLAG_CHSIDE: Channel side flag | |||
* @arg I2S_FLAG_BSY: Busy flag | |||
* @retval SET or RESET. | |||
*/ | |||
#define I2S_CHECK_FLAG(__SR__, __FLAG__) ((((__SR__)\ | |||
& ((__FLAG__) & I2S_FLAG_MASK)) == ((__FLAG__) & I2S_FLAG_MASK)) ? SET : RESET) | |||
/** @brief Check whether the specified SPI Interrupt is set or not. | |||
* @param __CR2__ copy of I2S CR2 regsiter. | |||
* @param __INTERRUPT__ specifies the SPI interrupt source to check. | |||
* This parameter can be one of the following values: | |||
* @arg I2S_IT_TXE: Tx buffer empty interrupt enable | |||
* @arg I2S_IT_RXNE: RX buffer not empty interrupt enable | |||
* @arg I2S_IT_ERR: Error interrupt enable | |||
* @retval SET or RESET. | |||
*/ | |||
#define I2S_CHECK_IT_SOURCE(__CR2__, __INTERRUPT__) ((((__CR2__)\ | |||
& (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET) | |||
/** @brief Checks if I2S Mode parameter is in allowed range. | |||
* @param __MODE__ specifies the I2S Mode. | |||
* This parameter can be a value of @ref I2S_Mode | |||
* @retval None | |||
*/ | |||
#define IS_I2S_MODE(__MODE__) (((__MODE__) == I2S_MODE_SLAVE_TX) || \ | |||
((__MODE__) == I2S_MODE_SLAVE_RX) || \ | |||
((__MODE__) == I2S_MODE_MASTER_TX) || \ | |||
((__MODE__) == I2S_MODE_MASTER_RX)) | |||
#define IS_I2S_STANDARD(__STANDARD__) (((__STANDARD__) == I2S_STANDARD_PHILIPS) || \ | |||
((__STANDARD__) == I2S_STANDARD_MSB) || \ | |||
((__STANDARD__) == I2S_STANDARD_LSB) || \ | |||
((__STANDARD__) == I2S_STANDARD_PCM_SHORT) || \ | |||
((__STANDARD__) == I2S_STANDARD_PCM_LONG)) | |||
#define IS_I2S_DATA_FORMAT(__FORMAT__) (((__FORMAT__) == I2S_DATAFORMAT_16B) || \ | |||
((__FORMAT__) == I2S_DATAFORMAT_16B_EXTENDED) || \ | |||
((__FORMAT__) == I2S_DATAFORMAT_24B) || \ | |||
((__FORMAT__) == I2S_DATAFORMAT_32B)) | |||
#define IS_I2S_MCLK_OUTPUT(__OUTPUT__) (((__OUTPUT__) == I2S_MCLKOUTPUT_ENABLE) || \ | |||
((__OUTPUT__) == I2S_MCLKOUTPUT_DISABLE)) | |||
#define IS_I2S_AUDIO_FREQ(__FREQ__) ((((__FREQ__) >= I2S_AUDIOFREQ_8K) && \ | |||
((__FREQ__) <= I2S_AUDIOFREQ_192K)) || \ | |||
((__FREQ__) == I2S_AUDIOFREQ_DEFAULT)) | |||
/** @brief Checks if I2S Serial clock steady state parameter is in allowed range. | |||
* @param __CPOL__ specifies the I2S serial clock steady state. | |||
* This parameter can be a value of @ref I2S_Clock_Polarity | |||
* @retval None | |||
*/ | |||
#define IS_I2S_CPOL(__CPOL__) (((__CPOL__) == I2S_CPOL_LOW) || \ | |||
((__CPOL__) == I2S_CPOL_HIGH)) | |||
/** | |||
* @} | |||
*/ | |||
/** | |||
* @} | |||
*/ | |||
/** | |||
* @} | |||
*/ | |||
#endif /* SPI_I2S_SUPPORT */ | |||
#ifdef __cplusplus | |||
} | |||
#endif | |||
#endif /* STM32WBxx_HAL_I2S_H */ | |||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
@@ -28,6 +28,7 @@ extern "C" { | |||
/* Includes ------------------------------------------------------------------*/ | |||
#include "stm32wbxx_hal_def.h" | |||
#if defined(IPCC) | |||
/** @addtogroup STM32WBxx_HAL_Driver | |||
* @{ | |||
@@ -253,6 +254,7 @@ void HAL_IPCC_RxCallback(IPCC_HandleTypeDef *hipcc, uint32_t ChannelIndex, IPCC_ | |||
/** | |||
* @} | |||
*/ | |||
#endif /* IPCC */ | |||
#ifdef __cplusplus | |||
} | |||
@@ -119,7 +119,7 @@ typedef struct | |||
/** | |||
* @brief Reload IWDG counter with value defined in the reload register | |||
* (write access to IWDG_PR, IWDG_RLR & IWDG_WINR registers disabled). | |||
* (write access to IWDG_PR, IWDG_RLR and IWDG_WINR registers disabled). | |||
* @param __HANDLE__ IWDG handle | |||
* @retval None | |||
*/ | |||
@@ -219,6 +219,7 @@ HAL_StatusTypeDef HAL_IWDG_Refresh(IWDG_HandleTypeDef *hiwdg); | |||
*/ | |||
#define IS_IWDG_WINDOW(__WINDOW__) ((__WINDOW__) <= IWDG_WINR_WIN) | |||
/** | |||
* @} | |||
*/ | |||
@@ -33,6 +33,8 @@ extern "C" { | |||
* @{ | |||
*/ | |||
#if defined (LCD) | |||
/** @addtogroup LCD | |||
* @{ | |||
*/ | |||
@@ -755,6 +757,8 @@ HAL_StatusTypeDef LCD_WaitForSynchro(LCD_HandleTypeDef *hlcd); | |||
* @} | |||
*/ | |||
#endif /* LCD */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -42,6 +42,8 @@ extern "C" { | |||
/** @defgroup LPTIM_Exported_Types LPTIM Exported Types | |||
* @{ | |||
*/ | |||
#define LPTIM_EXTI_LINE_LPTIM1 EXTI_IMR1_IM29 /*!< External interrupt line 29 Connected to the LPTIM1 EXTI Line */ | |||
#define LPTIM_EXTI_LINE_LPTIM2 EXTI_IMR1_IM30 /*!< External interrupt line 30 Connected to the LPTIM2 EXTI Line */ | |||
/** | |||
* @brief LPTIM Clock configuration definition | |||
@@ -397,6 +399,8 @@ typedef void (*pLPTIM_CallbackTypeDef)(LPTIM_HandleTypeDef *hlptim); /*!< poin | |||
* @note The following sequence is required to solve LPTIM disable HW limitation. | |||
* Please check Errata Sheet ES0335 for more details under "MCU may remain | |||
* stuck in LPTIM interrupt when entering Stop mode" section. | |||
* @note Please call @ref HAL_LPTIM_GetState() after a call to __HAL_LPTIM_DISABLE to | |||
* check for TIMEOUT. | |||
* @retval None | |||
*/ | |||
#define __HAL_LPTIM_DISABLE(__HANDLE__) LPTIM_Disable(__HANDLE__) | |||
@@ -433,6 +437,7 @@ typedef void (*pLPTIM_CallbackTypeDef)(LPTIM_HandleTypeDef *hlptim); /*!< poin | |||
* @param __HANDLE__ LPTIM handle | |||
* @param __VALUE__ Autoreload value | |||
* @retval None | |||
* @note The ARR register can only be modified when the LPTIM instance is enabled. | |||
*/ | |||
#define __HAL_LPTIM_AUTORELOAD_SET(__HANDLE__ , __VALUE__) ((__HANDLE__)->Instance->ARR = (__VALUE__)) | |||
@@ -441,6 +446,7 @@ typedef void (*pLPTIM_CallbackTypeDef)(LPTIM_HandleTypeDef *hlptim); /*!< poin | |||
* @param __HANDLE__ LPTIM handle | |||
* @param __VALUE__ Compare value | |||
* @retval None | |||
* @note The CMP register can only be modified when the LPTIM instance is enabled. | |||
*/ | |||
#define __HAL_LPTIM_COMPARE_SET(__HANDLE__ , __VALUE__) ((__HANDLE__)->Instance->CMP = (__VALUE__)) | |||
@@ -489,6 +495,7 @@ typedef void (*pLPTIM_CallbackTypeDef)(LPTIM_HandleTypeDef *hlptim); /*!< poin | |||
* @arg LPTIM_IT_ARRM : Autoreload match Interrupt. | |||
* @arg LPTIM_IT_CMPM : Compare match Interrupt. | |||
* @retval None. | |||
* @note The LPTIM interrupts can only be enabled when the LPTIM instance is disabled. | |||
*/ | |||
#define __HAL_LPTIM_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER |= (__INTERRUPT__)) | |||
@@ -505,6 +512,7 @@ typedef void (*pLPTIM_CallbackTypeDef)(LPTIM_HandleTypeDef *hlptim); /*!< poin | |||
* @arg LPTIM_IT_ARRM : Autoreload match Interrupt. | |||
* @arg LPTIM_IT_CMPM : Compare match Interrupt. | |||
* @retval None. | |||
* @note The LPTIM interrupts can only be disabled when the LPTIM instance is disabled. | |||
*/ | |||
#define __HAL_LPTIM_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IER &= (~(__INTERRUPT__))) | |||
@@ -525,6 +533,56 @@ typedef void (*pLPTIM_CallbackTypeDef)(LPTIM_HandleTypeDef *hlptim); /*!< poin | |||
#define __HAL_LPTIM_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->IER & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET) | |||
/** | |||
* @brief Enable the LPTIM1 EXTI line in interrupt mode. | |||
* @retval None | |||
*/ | |||
#define __HAL_LPTIM_LPTIM1_EXTI_ENABLE_IT() (EXTI->IMR1 |= LPTIM_EXTI_LINE_LPTIM1) | |||
/** | |||
* @brief Disable the LPTIM1 EXTI line in interrupt mode. | |||
* @retval None | |||
*/ | |||
#define __HAL_LPTIM_LPTIM1_EXTI_DISABLE_IT() (EXTI->IMR1 &= ~(LPTIM_EXTI_LINE_LPTIM1)) | |||
/** | |||
* @brief Enable the LPTIM1 EXTI line in event mode. | |||
* @retval None | |||
*/ | |||
#define __HAL_LPTIM_LPTIM1_EXTI_ENABLE_EVENT() (EXTI->EMR1 |= LPTIM_EXTI_LINE_LPTIM1) | |||
/** | |||
* @brief Disable the LPTIM1 EXTI line in event mode. | |||
* @retval None | |||
*/ | |||
#define __HAL_LPTIM_LPTIM1_EXTI_DISABLE_EVENT() (EXTI->EMR1 &= ~(LPTIM_EXTI_LINE_LPTIM1)) | |||
/** | |||
* @brief Enable the LPTIM2 EXTI line in interrupt mode. | |||
* @retval None | |||
*/ | |||
#define __HAL_LPTIM_LPTIM2_EXTI_ENABLE_IT() (EXTI->IMR1 |= LPTIM_EXTI_LINE_LPTIM2) | |||
/** | |||
* @brief Disable the LPTIM2 EXTI line in interrupt mode. | |||
* @retval None | |||
*/ | |||
#define __HAL_LPTIM_LPTIM2_EXTI_DISABLE_IT() (EXTI->IMR1 &= ~(LPTIM_EXTI_LINE_LPTIM2)) | |||
/** | |||
* @brief Enable the LPTIM2 EXTI line in event mode. | |||
* @retval None | |||
*/ | |||
#define __HAL_LPTIM_LPTIM2_EXTI_ENABLE_EVENT() (EXTI->EMR1 |= LPTIM_EXTI_LINE_LPTIM2) | |||
/** | |||
* @brief Disable the LPTIM2 EXTI line in event mode. | |||
* @retval None | |||
*/ | |||
#define __HAL_LPTIM_LPTIM2_EXTI_DISABLE_EVENT() (EXTI->EMR1 &= ~(LPTIM_EXTI_LINE_LPTIM2)) | |||
/** | |||
* @} | |||
*/ | |||
@@ -534,6 +592,10 @@ typedef void (*pLPTIM_CallbackTypeDef)(LPTIM_HandleTypeDef *hlptim); /*!< poin | |||
* @{ | |||
*/ | |||
/** @addtogroup LPTIM_Exported_Functions_Group1 | |||
* @brief Initialization and Configuration functions. | |||
* @{ | |||
*/ | |||
/* Initialization/de-initialization functions ********************************/ | |||
HAL_StatusTypeDef HAL_LPTIM_Init(LPTIM_HandleTypeDef *hlptim); | |||
HAL_StatusTypeDef HAL_LPTIM_DeInit(LPTIM_HandleTypeDef *hlptim); | |||
@@ -541,7 +603,14 @@ HAL_StatusTypeDef HAL_LPTIM_DeInit(LPTIM_HandleTypeDef *hlptim); | |||
/* MSP functions *************************************************************/ | |||
void HAL_LPTIM_MspInit(LPTIM_HandleTypeDef *hlptim); | |||
void HAL_LPTIM_MspDeInit(LPTIM_HandleTypeDef *hlptim); | |||
/** | |||
* @} | |||
*/ | |||
/** @addtogroup LPTIM_Exported_Functions_Group2 | |||
* @brief Start-Stop operation functions. | |||
* @{ | |||
*/ | |||
/* Start/Stop operation functions *********************************************/ | |||
/* ################################# PWM Mode ################################*/ | |||
/* Blocking mode: Polling */ | |||
@@ -590,12 +659,26 @@ HAL_StatusTypeDef HAL_LPTIM_Counter_Stop(LPTIM_HandleTypeDef *hlptim); | |||
/* Non-Blocking mode: Interrupt */ | |||
HAL_StatusTypeDef HAL_LPTIM_Counter_Start_IT(LPTIM_HandleTypeDef *hlptim, uint32_t Period); | |||
HAL_StatusTypeDef HAL_LPTIM_Counter_Stop_IT(LPTIM_HandleTypeDef *hlptim); | |||
/** | |||
* @} | |||
*/ | |||
/** @addtogroup LPTIM_Exported_Functions_Group3 | |||
* @brief Read operation functions. | |||
* @{ | |||
*/ | |||
/* Reading operation functions ************************************************/ | |||
uint32_t HAL_LPTIM_ReadCounter(LPTIM_HandleTypeDef *hlptim); | |||
uint32_t HAL_LPTIM_ReadAutoReload(LPTIM_HandleTypeDef *hlptim); | |||
uint32_t HAL_LPTIM_ReadCompare(LPTIM_HandleTypeDef *hlptim); | |||
/** | |||
* @} | |||
*/ | |||
/** @addtogroup LPTIM_Exported_Functions_Group4 | |||
* @brief LPTIM IRQ handler and callback functions. | |||
* @{ | |||
*/ | |||
/* LPTIM IRQ functions *******************************************************/ | |||
void HAL_LPTIM_IRQHandler(LPTIM_HandleTypeDef *hlptim); | |||
@@ -613,9 +696,19 @@ void HAL_LPTIM_DirectionDownCallback(LPTIM_HandleTypeDef *hlptim); | |||
HAL_StatusTypeDef HAL_LPTIM_RegisterCallback(LPTIM_HandleTypeDef *lphtim, HAL_LPTIM_CallbackIDTypeDef CallbackID, pLPTIM_CallbackTypeDef pCallback); | |||
HAL_StatusTypeDef HAL_LPTIM_UnRegisterCallback(LPTIM_HandleTypeDef *lphtim, HAL_LPTIM_CallbackIDTypeDef CallbackID); | |||
#endif /* USE_HAL_LPTIM_REGISTER_CALLBACKS */ | |||
/** | |||
* @} | |||
*/ | |||
/** @addtogroup LPTIM_Group5 | |||
* @brief Peripheral State functions. | |||
* @{ | |||
*/ | |||
/* Peripheral State functions ************************************************/ | |||
HAL_LPTIM_StateTypeDef HAL_LPTIM_GetState(LPTIM_HandleTypeDef *hlptim); | |||
/** | |||
* @} | |||
*/ | |||
/** | |||
* @} | |||
@@ -737,7 +830,7 @@ HAL_LPTIM_StateTypeDef HAL_LPTIM_GetState(LPTIM_HandleTypeDef *hlptim); | |||
/** @defgroup LPTIM_Private_Functions LPTIM Private Functions | |||
* @{ | |||
*/ | |||
void LPTIM_Disable(LPTIM_HandleTypeDef *lptim); | |||
void LPTIM_Disable(LPTIM_HandleTypeDef *hlptim); | |||
/** | |||
* @} | |||
*/ | |||
@@ -155,7 +155,7 @@ typedef struct | |||
/** @defgroup PCD_Speed PCD Speed | |||
* @{ | |||
*/ | |||
#define PCD_SPEED_FULL 2U | |||
#define PCD_SPEED_FULL USBD_FS_SPEED | |||
/** | |||
* @} | |||
*/ | |||
@@ -99,7 +99,11 @@ typedef enum | |||
* @brief PKA handle Structure definition | |||
* @{ | |||
*/ | |||
#if (USE_HAL_PKA_REGISTER_CALLBACKS == 1) | |||
typedef struct __PKA_HandleTypeDef | |||
#else | |||
typedef struct | |||
#endif /* USE_HAL_PKA_REGISTER_CALLBACKS */ | |||
{ | |||
PKA_TypeDef *Instance; /*!< Register base address */ | |||
__IO HAL_PKA_StateTypeDef State; /*!< PKA state */ | |||
@@ -220,6 +224,7 @@ typedef struct | |||
uint8_t *ptY; /*!< Pointer to point P coordinate yP (Array of modulusSize elements) */ | |||
} PKA_ECDSASignOutExtParamTypeDef, PKA_ECCMulOutTypeDef; | |||
typedef struct | |||
{ | |||
uint32_t expSize; /*!< Number of element in pExp array */ | |||
@@ -229,6 +234,7 @@ typedef struct | |||
const uint8_t *pMod; /*!< Pointer to modulus (Array of OpSize elements) */ | |||
} PKA_ModExpInTypeDef; | |||
typedef struct | |||
{ | |||
uint32_t expSize; /*!< Number of element in pExp and pMontgomeryParam arrays */ | |||
@@ -320,6 +326,7 @@ typedef struct | |||
#define PKA_IT_PROCEND PKA_CR_PROCENDIE | |||
#define PKA_IT_ADDRERR PKA_CR_ADDRERRIE | |||
#define PKA_IT_RAMERR PKA_CR_RAMERRIE | |||
/** | |||
* @} | |||
*/ | |||
@@ -330,6 +337,7 @@ typedef struct | |||
#define PKA_FLAG_PROCEND PKA_SR_PROCENDF | |||
#define PKA_FLAG_ADDRERR PKA_SR_ADDRERRF | |||
#define PKA_FLAG_RAMERR PKA_SR_RAMERRF | |||
/** | |||
* @} | |||
*/ | |||
@@ -516,6 +524,7 @@ HAL_StatusTypeDef HAL_PKA_MontgomeryParam(PKA_HandleTypeDef *hpka, PKA_Montgomer | |||
HAL_StatusTypeDef HAL_PKA_MontgomeryParam_IT(PKA_HandleTypeDef *hpka, PKA_MontgomeryParamInTypeDef *in); | |||
void HAL_PKA_MontgomeryParam_GetResult(PKA_HandleTypeDef *hpka, uint32_t *pRes); | |||
HAL_StatusTypeDef HAL_PKA_Abort(PKA_HandleTypeDef *hpka); | |||
void HAL_PKA_RAMReset(PKA_HandleTypeDef *hpka); | |||
void HAL_PKA_OperationCpltCallback(PKA_HandleTypeDef *hpka); | |||
@@ -235,12 +235,22 @@ typedef struct | |||
* | |||
* @retval The new state of __FLAG__ (TRUE or FALSE). | |||
*/ | |||
#define __HAL_PWR_GET_FLAG(__FLAG__) ( ((((uint8_t)(__FLAG__)) >> 5U) == 1U) ?\ | |||
(PWR->SR1 & (1U << ((__FLAG__) & 31U))) :\ | |||
((((((uint8_t)(__FLAG__)) >> 5U) == 2U)) ?\ | |||
(PWR->SR2 & (1U << ((__FLAG__) & 31U))) :\ | |||
(PWR->EXTSCR & (1U << ((__FLAG__) & 31U))) ) ) | |||
#define __HAL_PWR_GET_FLAG(__FLAG__) ((((__FLAG__) & PWR_FLAG_REG_MASK) == PWR_FLAG_REG_SR1) ? \ | |||
( \ | |||
PWR->SR1 & (1UL << ((__FLAG__) & 31UL)) \ | |||
) \ | |||
: \ | |||
( \ | |||
(((__FLAG__) & PWR_FLAG_REG_MASK) == PWR_FLAG_REG_SR2) ? \ | |||
( \ | |||
PWR->SR2 & (1UL << ((__FLAG__) & 31UL)) \ | |||
) \ | |||
: \ | |||
( \ | |||
PWR->EXTSCR & (1UL << ((__FLAG__) & 31UL)) \ | |||
) \ | |||
) \ | |||
) | |||
/** @brief Clear a specific PWR flag. | |||
* @note Clearing of flags {PWR_FLAG_STOP, PWR_FLAG_SB} | |||
@@ -280,12 +290,17 @@ typedef struct | |||
* | |||
* @retval None | |||
*/ | |||
#define __HAL_PWR_CLEAR_FLAG(__FLAG__) ( ((((uint8_t)(__FLAG__)) >> 5U) == 1U) ?\ | |||
( (((uint8_t)(__FLAG__)) == PWR_FLAG_WU) ?\ | |||
(PWR->SCR = (__FLAG__)) : (PWR->SCR = (1U << ((__FLAG__) & 31U))) ) :\ | |||
( (((uint8_t)(__FLAG__)) == PWR_FLAG_CRITICAL_RF_PHASE) ?\ | |||
SET_BIT (PWR->EXTSCR, PWR_EXTSCR_CCRPF) : ( ((((uint8_t)((__FLAG__)) & 31U) <= PWR_EXTSCR_C1STOPF_Pos) ?\ | |||
SET_BIT (PWR->EXTSCR, PWR_EXTSCR_C1CSSF): SET_BIT (PWR->EXTSCR, PWR_EXTSCR_C2CSSF)) ) )) | |||
#define __HAL_PWR_CLEAR_FLAG(__FLAG__) ((((__FLAG__) & PWR_FLAG_REG_MASK) == PWR_FLAG_REG_EXTSCR) ? \ | |||
( \ | |||
PWR->EXTSCR = (1UL << (((__FLAG__) & PWR_FLAG_EXTSCR_CLR_MASK) >> PWR_FLAG_EXTSCR_CLR_POS)) \ | |||
) \ | |||
: \ | |||
( \ | |||
(((__FLAG__)) == PWR_FLAG_WU) ? \ | |||
(PWR->SCR = PWR_SCR_CWUF) : \ | |||
(PWR->SCR = (1UL << ((__FLAG__) & 31UL))) \ | |||
) \ | |||
) | |||
/** | |||
* @brief Enable the PVD Extended Interrupt C1 Line. | |||
@@ -61,6 +61,7 @@ typedef struct | |||
This parameter can be a value of @ref PWREx_WakeUpTarget_Definition */ | |||
}PWR_PVMTypeDef; | |||
#if defined(PWR_CR5_SMPSEN) | |||
/** | |||
* @brief PWR SMPS step down configuration structure definition | |||
*/ | |||
@@ -72,6 +73,7 @@ typedef struct | |||
uint32_t OutputVoltage; /*!< SMPS step down converter output voltage scaling voltage level. | |||
This parameter can be a value of @ref PWREx_SMPS_OUTPUT_VOLTAGE_LEVEL */ | |||
}PWR_SMPSTypeDef; | |||
#endif | |||
/** | |||
* @} | |||
@@ -96,26 +98,44 @@ typedef struct | |||
* @{ | |||
*/ | |||
#define PWR_WAKEUP_PIN1_HIGH PWR_CR3_EWUP1 /*!< Wakeup pin 1 (with high level polarity) */ | |||
#if defined(PWR_CR3_EWUP2) | |||
#define PWR_WAKEUP_PIN2_HIGH PWR_CR3_EWUP2 /*!< Wakeup pin 2 (with high level polarity) */ | |||
#endif | |||
#if defined(PWR_CR3_EWUP3) | |||
#define PWR_WAKEUP_PIN3_HIGH PWR_CR3_EWUP3 /*!< Wakeup pin 3 (with high level polarity) */ | |||
#endif | |||
#define PWR_WAKEUP_PIN4_HIGH PWR_CR3_EWUP4 /*!< Wakeup pin 4 (with high level polarity) */ | |||
#if defined(PWR_CR3_EWUP5) | |||
#define PWR_WAKEUP_PIN5_HIGH PWR_CR3_EWUP5 /*!< Wakeup pin 5 (with high level polarity) */ | |||
#endif | |||
#define PWR_WAKEUP_PIN1_LOW ((PWR_CR4_WP1<<PWR_WUP_POLARITY_SHIFT) | PWR_CR3_EWUP1) /*!< Wakeup pin 1 (with low level polarity) */ | |||
#if defined(PWR_CR3_EWUP2) | |||
#define PWR_WAKEUP_PIN2_LOW ((PWR_CR4_WP2<<PWR_WUP_POLARITY_SHIFT) | PWR_CR3_EWUP2) /*!< Wakeup pin 2 (with low level polarity) */ | |||
#endif | |||
#if defined(PWR_CR3_EWUP3) | |||
#define PWR_WAKEUP_PIN3_LOW ((PWR_CR4_WP3<<PWR_WUP_POLARITY_SHIFT) | PWR_CR3_EWUP3) /*!< Wakeup pin 3 (with low level polarity) */ | |||
#endif | |||
#define PWR_WAKEUP_PIN4_LOW ((PWR_CR4_WP4<<PWR_WUP_POLARITY_SHIFT) | PWR_CR3_EWUP4) /*!< Wakeup pin 4 (with low level polarity) */ | |||
#if defined(PWR_CR3_EWUP5) | |||
#define PWR_WAKEUP_PIN5_LOW ((PWR_CR4_WP5<<PWR_WUP_POLARITY_SHIFT) | PWR_CR3_EWUP5) /*!< Wakeup pin 5 (with low level polarity) */ | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
/* Literals kept for legacy purpose */ | |||
#define PWR_WAKEUP_PIN1 PWR_CR3_EWUP1 /*!< Wakeup pin 1 (with high level polarity) */ | |||
#if defined(PWR_CR3_EWUP2) | |||
#define PWR_WAKEUP_PIN2 PWR_CR3_EWUP2 /*!< Wakeup pin 2 (with high level polarity) */ | |||
#endif | |||
#if defined(PWR_CR3_EWUP3) | |||
#define PWR_WAKEUP_PIN3 PWR_CR3_EWUP3 /*!< Wakeup pin 3 (with high level polarity) */ | |||
#endif | |||
#define PWR_WAKEUP_PIN4 PWR_CR3_EWUP4 /*!< Wakeup pin 4 (with high level polarity) */ | |||
#if defined(PWR_CR3_EWUP5) | |||
#define PWR_WAKEUP_PIN5 PWR_CR3_EWUP5 /*!< Wakeup pin 5 (with high level polarity) */ | |||
#endif | |||
/** @defgroup PWREx_PIN_Polarity PWREx Pin Polarity configuration | |||
* @{ | |||
@@ -129,7 +149,9 @@ typedef struct | |||
/** @defgroup PWREx_PVM_Type Peripheral Voltage Monitoring type | |||
* @{ | |||
*/ | |||
#if defined(PWR_CR2_PVME1) | |||
#define PWR_PVM_1 PWR_CR2_PVME1 /*!< Peripheral Voltage Monitoring 1 enable: VDDUSB versus 1.2 V (applicable when USB feature is supported) */ | |||
#endif | |||
#define PWR_PVM_3 PWR_CR2_PVME3 /*!< Peripheral Voltage Monitoring 3 enable: VDDA versus 1.62 V */ | |||
/** | |||
* @} | |||
@@ -163,8 +185,12 @@ typedef struct | |||
/** @defgroup PWREx_Regulator_Voltage_Scale PWR Regulator voltage scale | |||
* @{ | |||
*/ | |||
#if defined(PWR_CR1_VOS) | |||
#define PWR_REGULATOR_VOLTAGE_SCALE1 PWR_CR1_VOS_0 /*!< Regulator voltage output range 1 mode, typical output voltage at 1.2 V, system frequency up to 64 MHz */ | |||
#define PWR_REGULATOR_VOLTAGE_SCALE2 PWR_CR1_VOS_1 /*!< Regulator voltage output range 2 mode, typical output voltage at 1.0 V, system frequency up to 16 MHz */ | |||
#else | |||
#define PWR_REGULATOR_VOLTAGE_SCALE1 (0x00000200UL) /*!< Regulator voltage output range 1 mode, typical output voltage at 1.2 V, system frequency up to 64 MHz */ | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
@@ -191,20 +217,20 @@ typedef struct | |||
/** @defgroup PWREx_GPIO_Bit_Number GPIO bit number for I/O setting in standby/shutdown mode | |||
* @{ | |||
*/ | |||
#define PWR_GPIO_BIT_0 PWR_PUCRC_PC0 /*!< GPIO port I/O pin 0 */ | |||
#define PWR_GPIO_BIT_1 PWR_PUCRC_PC1 /*!< GPIO port I/O pin 1 */ | |||
#define PWR_GPIO_BIT_2 PWR_PUCRC_PC2 /*!< GPIO port I/O pin 2 */ | |||
#define PWR_GPIO_BIT_3 PWR_PUCRC_PC3 /*!< GPIO port I/O pin 3 */ | |||
#define PWR_GPIO_BIT_4 PWR_PUCRC_PC4 /*!< GPIO port I/O pin 4 */ | |||
#define PWR_GPIO_BIT_5 PWR_PUCRC_PC5 /*!< GPIO port I/O pin 5 */ | |||
#define PWR_GPIO_BIT_6 PWR_PUCRC_PC6 /*!< GPIO port I/O pin 6 */ | |||
#define PWR_GPIO_BIT_7 PWR_PUCRC_PC7 /*!< GPIO port I/O pin 7 */ | |||
#define PWR_GPIO_BIT_8 PWR_PUCRC_PC8 /*!< GPIO port I/O pin 8 */ | |||
#define PWR_GPIO_BIT_9 PWR_PUCRC_PC9 /*!< GPIO port I/O pin 9 */ | |||
#define PWR_GPIO_BIT_10 PWR_PUCRC_PC10 /*!< GPIO port I/O pin 10 */ | |||
#define PWR_GPIO_BIT_11 PWR_PUCRC_PC11 /*!< GPIO port I/O pin 11 */ | |||
#define PWR_GPIO_BIT_12 PWR_PUCRC_PC12 /*!< GPIO port I/O pin 12 */ | |||
#define PWR_GPIO_BIT_13 PWR_PUCRC_PC13 /*!< GPIO port I/O pin 14 */ | |||
#define PWR_GPIO_BIT_0 PWR_PUCRA_PA0 /*!< GPIO port I/O pin 0 */ | |||
#define PWR_GPIO_BIT_1 PWR_PUCRA_PA1 /*!< GPIO port I/O pin 1 */ | |||
#define PWR_GPIO_BIT_2 PWR_PUCRA_PA2 /*!< GPIO port I/O pin 2 */ | |||
#define PWR_GPIO_BIT_3 PWR_PUCRA_PA3 /*!< GPIO port I/O pin 3 */ | |||
#define PWR_GPIO_BIT_4 PWR_PUCRA_PA4 /*!< GPIO port I/O pin 4 */ | |||
#define PWR_GPIO_BIT_5 PWR_PUCRA_PA5 /*!< GPIO port I/O pin 5 */ | |||
#define PWR_GPIO_BIT_6 PWR_PUCRA_PA6 /*!< GPIO port I/O pin 6 */ | |||
#define PWR_GPIO_BIT_7 PWR_PUCRA_PA7 /*!< GPIO port I/O pin 7 */ | |||
#define PWR_GPIO_BIT_8 PWR_PUCRA_PA8 /*!< GPIO port I/O pin 8 */ | |||
#define PWR_GPIO_BIT_9 PWR_PUCRA_PA9 /*!< GPIO port I/O pin 9 */ | |||
#define PWR_GPIO_BIT_10 PWR_PUCRA_PA10 /*!< GPIO port I/O pin 10 */ | |||
#define PWR_GPIO_BIT_11 PWR_PUCRA_PA11 /*!< GPIO port I/O pin 11 */ | |||
#define PWR_GPIO_BIT_12 PWR_PUCRA_PA12 /*!< GPIO port I/O pin 12 */ | |||
#define PWR_GPIO_BIT_13 PWR_PUCRA_PA13 /*!< GPIO port I/O pin 14 */ | |||
#define PWR_GPIO_BIT_14 PWR_PDCRC_PC14 /*!< GPIO port I/O pin 14 */ | |||
#define PWR_GPIO_BIT_15 PWR_PUCRC_PC15 /*!< GPIO port I/O pin 15 */ | |||
/** | |||
@@ -217,13 +243,16 @@ typedef struct | |||
#define PWR_GPIO_A 0x00000000U /*!< GPIO port A */ | |||
#define PWR_GPIO_B 0x00000001U /*!< GPIO port B */ | |||
#define PWR_GPIO_C 0x00000002U /*!< GPIO port C */ | |||
#if defined(GPIOD) | |||
#define PWR_GPIO_D 0x00000003U /*!< GPIO port D */ | |||
#endif | |||
#define PWR_GPIO_E 0x00000004U /*!< GPIO port E */ | |||
#define PWR_GPIO_H 0x00000007U /*!< GPIO port H */ | |||
/** | |||
* @} | |||
*/ | |||
#if defined(PWR_CR5_SMPSEN) | |||
/** @defgroup PWREx_BOR_CONFIGURATION BOR configuration | |||
* @{ | |||
*/ | |||
@@ -286,6 +315,7 @@ typedef struct | |||
/** | |||
* @} | |||
*/ | |||
#endif | |||
/** @defgroup PWREx_Flag PWR Status Flags | |||
* Elements values convention: 0000 0000 0XXY YYYYb | |||
@@ -293,51 +323,62 @@ typedef struct | |||
* - XX : Status register (2 bits) | |||
* - 01: SR1 register | |||
* - 10: SR2 register | |||
* - 11: C2_SCR register | |||
* - 11: EXTSCR register | |||
* The only exception is PWR_FLAG_WUF, encompassing all | |||
* wake-up flags and set to PWR_SR1_WUF. | |||
* @{ | |||
*/ | |||
/*--------------------------------SR1-------------------------------*/ | |||
#define PWR_FLAG_WUF1 (0x0020U) /*!< Wakeup event on wakeup pin 1 */ | |||
#define PWR_FLAG_WUF2 (0x0021U) /*!< Wakeup event on wakeup pin 2 */ | |||
#define PWR_FLAG_WUF3 (0x0022U) /*!< Wakeup event on wakeup pin 3 */ | |||
#define PWR_FLAG_WUF4 (0x0023U) /*!< Wakeup event on wakeup pin 4 */ | |||
#define PWR_FLAG_WUF5 (0x0024U) /*!< Wakeup event on wakeup pin 5 */ | |||
#define PWR_FLAG_WU PWR_SR1_WUF /*!< Encompass wakeup event on all wakeup pins */ | |||
#define PWR_FLAG_BHWF (0x0028U) /*!< BLE_Host WakeUp Flag */ | |||
#define PWR_FLAG_FRCBYPI (0x0029U) /*!< SMPS Forced in Bypass Interrupt Flag */ | |||
#define PWR_FLAG_RFPHASEI (0x002BU) /*!< Radio Phase Interrupt Flag */ | |||
#define PWR_FLAG_BLEACTI (0x002CU) /*!< BLE Activity Interrupt Flag */ | |||
#define PWR_FLAG_802ACTI (0x002DU) /*!< 802.15.4 Activity Interrupt Flag */ | |||
#define PWR_FLAG_HOLDC2I (0x002EU) /*!< CPU2 on-Hold Interrupt Flag */ | |||
#define PWR_FLAG_WUFI (0x002FU) /*!< Wakeup on internal wakeup line */ | |||
#define PWR_FLAG_WUF1 (PWR_FLAG_REG_SR1 | PWR_SR1_WUF1_Pos) /*!< Wakeup event on wakeup pin 1 */ | |||
#if defined(PWR_CR3_EWUP2) | |||
#define PWR_FLAG_WUF2 (PWR_FLAG_REG_SR1 | PWR_SR1_WUF2_Pos) /*!< Wakeup event on wakeup pin 2 */ | |||
#endif | |||
#if defined(PWR_CR3_EWUP3) | |||
#define PWR_FLAG_WUF3 (PWR_FLAG_REG_SR1 | PWR_SR1_WUF3_Pos) /*!< Wakeup event on wakeup pin 3 */ | |||
#endif | |||
#define PWR_FLAG_WUF4 (PWR_FLAG_REG_SR1 | PWR_SR1_WUF4_Pos) /*!< Wakeup event on wakeup pin 4 */ | |||
#if defined(PWR_CR3_EWUP5) | |||
#define PWR_FLAG_WUF5 (PWR_FLAG_REG_SR1 | PWR_SR1_WUF5_Pos) /*!< Wakeup event on wakeup pin 5 */ | |||
#endif | |||
#define PWR_FLAG_WU (PWR_FLAG_REG_SR1 | PWR_SR1_WUF) /*!< Encompass wakeup event on all wakeup pins */ | |||
#if defined(PWR_CR5_SMPSEN) | |||
#define PWR_FLAG_FRCBYPI (PWR_FLAG_REG_SR1 | PWR_SR1_SMPSFBF_Pos) /*!< SMPS Forced in Bypass Interrupt Flag */ | |||
#endif | |||
#define PWR_FLAG_BHWF (PWR_FLAG_REG_SR1 | PWR_SR1_BLEWUF_Pos) /*!< BLE_Host WakeUp Flag */ | |||
#define PWR_FLAG_RFPHASEI (PWR_FLAG_REG_SR1 | PWR_SR1_CRPEF_Pos) /*!< Radio Phase Interrupt Flag */ | |||
#define PWR_FLAG_BLEACTI (PWR_FLAG_REG_SR1 | PWR_SR1_BLEAF_Pos) /*!< BLE Activity Interrupt Flag */ | |||
#define PWR_FLAG_802ACTI (PWR_FLAG_REG_SR1 | PWR_SR1_802AF_Pos) /*!< 802.15.4 Activity Interrupt Flag */ | |||
#define PWR_FLAG_HOLDC2I (PWR_FLAG_REG_SR1 | PWR_SR1_C2HF_Pos) /*!< CPU2 on-Hold Interrupt Flag */ | |||
#define PWR_FLAG_WUFI (PWR_FLAG_REG_SR1 | PWR_SR1_WUFI_Pos) /*!< Wakeup on internal wakeup line */ | |||
/*--------------------------------SR2-------------------------------*/ | |||
#define PWR_FLAG_SMPSRDYF (0x0040U) /*!< SMPS Ready Flag */ | |||
#define PWR_FLAG_SMPSBYPF (0x0041U) /*!< SMPS Bypass Flag */ | |||
#if defined(PWR_CR5_SMPSEN) | |||
#define PWR_FLAG_SMPSRDYF (PWR_FLAG_REG_SR2 | PWR_SR2_SMPSBF_Pos) /*!< SMPS Ready Flag */ | |||
#define PWR_FLAG_SMPSBYPF (PWR_FLAG_REG_SR2 | PWR_SR2_SMPSF_Pos) /*!< SMPS Bypass Flag */ | |||
#endif | |||
#define PWR_FLAG_REGLPS (0x0048U) /*!< Low-power regulator start flag */ | |||
#define PWR_FLAG_REGLPF (0x0049U) /*!< Low-power regulator flag */ | |||
#define PWR_FLAG_REGLPS (PWR_FLAG_REG_SR2 | PWR_SR2_REGLPS_Pos) /*!< Low-power regulator start flag */ | |||
#define PWR_FLAG_REGLPF (PWR_FLAG_REG_SR2 | PWR_SR2_REGLPF_Pos) /*!< Low-power regulator flag */ | |||
#define PWR_FLAG_VOSF (0x004AU) /*!< Voltage scaling flag */ | |||
#define PWR_FLAG_PVDO (0x004BU) /*!< Power Voltage Detector output flag */ | |||
#if defined(PWR_CR1_VOS) | |||
#define PWR_FLAG_VOSF (PWR_FLAG_REG_SR2 | PWR_SR2_VOSF_Pos) /*!< Voltage scaling flag */ | |||
#endif | |||
#define PWR_FLAG_PVDO (PWR_FLAG_REG_SR2 | PWR_SR2_PVDO_Pos) /*!< Power Voltage Detector output flag */ | |||
#define PWR_FLAG_PVMO1 (0x004CU) /*!< Power Voltage Monitoring 1 output flag */ | |||
#define PWR_FLAG_PVMO3 (0x004EU) /*!< Power Voltage Monitoring 3 output flag */ | |||
#define PWR_FLAG_PVMO1 (PWR_FLAG_REG_SR2 | PWR_SR2_PVMO1_Pos) /*!< Power Voltage Monitoring 1 output flag */ | |||
#define PWR_FLAG_PVMO3 (PWR_FLAG_REG_SR2 | PWR_SR2_PVMO3_Pos) /*!< Power Voltage Monitoring 3 output flag */ | |||
/*------------------------------EXTSCR---------------------------*/ | |||
#define PWR_FLAG_SB (0x0068U) /*!< System Standby flag for CPU1 */ | |||
#define PWR_FLAG_STOP (0x0069U) /*!< System Stop flag for CPU1 */ | |||
#define PWR_FLAG_SB (PWR_FLAG_REG_EXTSCR | PWR_EXTSCR_C1SBF_Pos | (PWR_EXTSCR_C1CSSF_Pos << PWR_FLAG_EXTSCR_CLR_POS)) /*!< System Standby flag for CPU1 */ | |||
#define PWR_FLAG_STOP (PWR_FLAG_REG_EXTSCR | PWR_EXTSCR_C1STOPF_Pos | (PWR_EXTSCR_C1CSSF_Pos << PWR_FLAG_EXTSCR_CLR_POS)) /*!< System Stop flag for CPU1 */ | |||
#define PWR_FLAG_C2SB (0x006AU) /*!< System Standby flag for CPU2 */ | |||
#define PWR_FLAG_C2STOP (0x006BU) /*!< System Stop flag for CPU2 */ | |||
#define PWR_FLAG_C2SB (PWR_FLAG_REG_EXTSCR | PWR_EXTSCR_C2SBF_Pos | (PWR_EXTSCR_C2CSSF_Pos << PWR_FLAG_EXTSCR_CLR_POS)) /*!< System Standby flag for CPU2 */ | |||
#define PWR_FLAG_C2STOP (PWR_FLAG_REG_EXTSCR | PWR_EXTSCR_C2STOPF_Pos | (PWR_EXTSCR_C2CSSF_Pos << PWR_FLAG_EXTSCR_CLR_POS)) /*!< System Stop flag for CPU2 */ | |||
#define PWR_FLAG_CRITICAL_RF_PHASE (0x006DU) /*!< Critical radio system phase flag */ | |||
#define PWR_FLAG_C1DEEPSLEEP (0x006EU) /*!< CPU1 DeepSleep Flag */ | |||
#define PWR_FLAG_C2DEEPSLEEP (0x006FU) /*!< CPU2 DeepSleep Flag */ | |||
#define PWR_FLAG_CRITICAL_RF_PHASE (PWR_FLAG_REG_EXTSCR | PWR_EXTSCR_CRPF_Pos | (PWR_EXTSCR_CCRPF_Pos << PWR_FLAG_EXTSCR_CLR_POS)) /*!< Critical radio system phase flag */ | |||
#define PWR_FLAG_C1DEEPSLEEP (PWR_FLAG_REG_EXTSCR | PWR_EXTSCR_C1DS_Pos) /*!< CPU1 DeepSleep Flag */ | |||
#define PWR_FLAG_C2DEEPSLEEP (PWR_FLAG_REG_EXTSCR | PWR_EXTSCR_C2DS_Pos) /*!< CPU2 DeepSleep Flag */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -373,7 +414,9 @@ typedef struct | |||
/** @defgroup PWREx_PVM_EXTI_LINE PWR PVM external interrupts lines | |||
* @{ | |||
*/ | |||
#if defined(PWR_CR2_PVME1) | |||
#define PWR_EXTI_LINE_PVM1 (LL_EXTI_LINE_31) /*!< External interrupt line 31 Connected to PVM1 */ | |||
#endif | |||
#define PWR_EXTI_LINE_PVM3 (LL_EXTI_LINE_33) /*!< External interrupt line 33 Connected to PVM3 */ | |||
/** | |||
* @} | |||
@@ -393,6 +436,19 @@ typedef struct | |||
* @} | |||
*/ | |||
/** @defgroup PWR_FLAG_REG PWR flag register | |||
* @{ | |||
*/ | |||
#define PWR_FLAG_REG_SR1 (0x20UL) /* Bitfield to indicate PWR flag located in register PWR_SR1 */ | |||
#define PWR_FLAG_REG_SR2 (0x40UL) /* Bitfield to indicate PWR flag located in register PWR_SR2 */ | |||
#define PWR_FLAG_REG_EXTSCR (0x60UL) /* Bitfield to indicate PWR flag located in register PWR_EXTSCR */ | |||
#define PWR_FLAG_REG_MASK (PWR_FLAG_REG_SR1 | PWR_FLAG_REG_SR2 | PWR_FLAG_REG_EXTSCR) /* Bitfield mask to indicate PWR flag location in PWR register */ | |||
#define PWR_FLAG_EXTSCR_CLR_POS (16UL) /* Bitfield for register PWR_EXTSCR clearable bits positions: position of bitfield in flag literals */ | |||
#define PWR_FLAG_EXTSCR_CLR_MASK ((PWR_EXTSCR_C1CSSF_Pos | PWR_EXTSCR_C2CSSF_Pos | PWR_EXTSCR_CCRPF_Pos) << PWR_FLAG_EXTSCR_CLR_POS) /* Bitfield for register PWR_EXTSCR clearable bits positions: mask of bitfield in flag literals */ | |||
/** | |||
* @} | |||
*/ | |||
/** | |||
* @} | |||
*/ | |||
@@ -402,6 +458,7 @@ typedef struct | |||
* @{ | |||
*/ | |||
#if defined(PWR_CR2_PVME1) | |||
/** | |||
* @brief Enable the PVM1 Extended Interrupt C1 Line. | |||
* @retval None | |||
@@ -521,6 +578,7 @@ typedef struct | |||
*/ | |||
#define __HAL_PWR_PVM1_EXTI_CLEAR_FLAG() LL_EXTI_ClearFlag_0_31(PWR_EXTI_LINE_PVM1) | |||
#endif | |||
/** | |||
* @brief Enable the PVM3 Extended Interrupt C1 Line. | |||
@@ -641,7 +699,7 @@ typedef struct | |||
*/ | |||
#define __HAL_PWR_PVM3_EXTI_CLEAR_FLAG() LL_EXTI_ClearFlag_32_63(PWR_EXTI_LINE_PVM3) | |||
#if defined(PWR_CR1_VOS) | |||
/** | |||
* @brief Configure the main internal regulator output voltage. | |||
* @param __REGULATOR__ specifies the regulator output voltage to achieve | |||
@@ -665,6 +723,7 @@ typedef struct | |||
tmpreg = READ_BIT(PWR->CR1, PWR_CR1_VOS); \ | |||
UNUSED(tmpreg); \ | |||
} while(0) | |||
#endif | |||
/** | |||
* @brief Wakeup BLE controller from its sleep mode | |||
@@ -690,7 +749,7 @@ typedef struct | |||
/** @addtogroup PWREx_Private_Macros PWR Extended Private Macros | |||
* @{ | |||
*/ | |||
#if defined(PWR_CR3_EWUP2) | |||
#define IS_PWR_WAKEUP_PIN(PIN) (((PIN) == PWR_WAKEUP_PIN1_HIGH) || \ | |||
((PIN) == PWR_WAKEUP_PIN2_HIGH) || \ | |||
((PIN) == PWR_WAKEUP_PIN3_HIGH) || \ | |||
@@ -701,13 +760,22 @@ typedef struct | |||
((PIN) == PWR_WAKEUP_PIN3_LOW) || \ | |||
((PIN) == PWR_WAKEUP_PIN4_LOW) || \ | |||
((PIN) == PWR_WAKEUP_PIN5_LOW)) | |||
#else | |||
#define IS_PWR_WAKEUP_PIN(PIN) (((PIN) == PWR_WAKEUP_PIN1_HIGH) || \ | |||
((PIN) == PWR_WAKEUP_PIN4_HIGH) || \ | |||
((PIN) == PWR_WAKEUP_PIN1_LOW) || \ | |||
((PIN) == PWR_WAKEUP_PIN4_LOW)) | |||
#endif | |||
#define IS_PWR_WAKEUP_PIN_POLARITY(POLARITY) (((POLARITY) == PWR_PIN_POLARITY_HIGH) || \ | |||
((POLARITY) == PWR_PIN_POLARITY_LOW)) | |||
#if defined(PWR_CR2_PVME1) | |||
#define IS_PWR_PVM_TYPE(TYPE) (((TYPE) == PWR_PVM_1) ||\ | |||
((TYPE) == PWR_PVM_3)) | |||
#else | |||
#define IS_PWR_PVM_TYPE(TYPE) ((TYPE) == PWR_PVM_3) | |||
#endif | |||
#define IS_PWR_PVM_MODE(MODE) (((MODE) == PWR_PVM_MODE_NORMAL) ||\ | |||
((MODE) == PWR_PVM_MODE_IT_RISING) ||\ | |||
@@ -720,9 +788,10 @@ typedef struct | |||
#define IS_PWR_FLASH_POWERDOWN(__MODE__) ((((__MODE__) & (PWR_FLASHPD_LPRUN | PWR_FLASHPD_LPSLEEP)) != 0x00u) && \ | |||
(((__MODE__) & ~(PWR_FLASHPD_LPRUN | PWR_FLASHPD_LPSLEEP)) == 0x00u)) | |||
#if defined(PWR_CR1_VOS) | |||
#define IS_PWR_VOLTAGE_SCALING_RANGE(RANGE) (((RANGE) == PWR_REGULATOR_VOLTAGE_SCALE1) || \ | |||
((RANGE) == PWR_REGULATOR_VOLTAGE_SCALE2)) | |||
#endif | |||
#define IS_PWR_BATTERY_RESISTOR_SELECT(RESISTOR) (((RESISTOR) == PWR_BATTERY_CHARGING_RESISTOR_5) ||\ | |||
((RESISTOR) == PWR_BATTERY_CHARGING_RESISTOR_1_5)) | |||
@@ -733,13 +802,22 @@ typedef struct | |||
#define IS_PWR_GPIO_BIT_NUMBER(BIT_NUMBER) (((BIT_NUMBER) & GPIO_PIN_MASK) != (uint32_t)0x00) | |||
#if defined(GPIOD) | |||
#define IS_PWR_GPIO(GPIO) (((GPIO) == PWR_GPIO_A) ||\ | |||
((GPIO) == PWR_GPIO_B) ||\ | |||
((GPIO) == PWR_GPIO_C) ||\ | |||
((GPIO) == PWR_GPIO_D) ||\ | |||
((GPIO) == PWR_GPIO_E) ||\ | |||
((GPIO) == PWR_GPIO_H)) | |||
#else | |||
#define IS_PWR_GPIO(GPIO) (((GPIO) == PWR_GPIO_A) ||\ | |||
((GPIO) == PWR_GPIO_B) ||\ | |||
((GPIO) == PWR_GPIO_C) ||\ | |||
((GPIO) == PWR_GPIO_E) ||\ | |||
((GPIO) == PWR_GPIO_H)) | |||
#endif | |||
#if defined(PWR_CR5_SMPSEN) | |||
#define IS_PWR_SMPS_MODE(SMPS_MODE) (((SMPS_MODE) == PWR_SMPS_BYPASS) ||\ | |||
((SMPS_MODE) == PWR_SMPS_STEP_DOWN)) | |||
@@ -767,6 +845,7 @@ typedef struct | |||
((SMPS_OUTPUT_VOLTAGE) == PWR_SMPS_OUTPUT_VOLTAGE_1V80) ||\ | |||
((SMPS_OUTPUT_VOLTAGE) == PWR_SMPS_OUTPUT_VOLTAGE_1V85) ||\ | |||
((SMPS_OUTPUT_VOLTAGE) == PWR_SMPS_OUTPUT_VOLTAGE_1V90)) | |||
#endif | |||
#define IS_PWR_CORE(CPU) (((CPU) == PWR_CORE_CPU1) || ((CPU) == PWR_CORE_CPU2)) | |||
@@ -785,7 +864,6 @@ typedef struct | |||
* @{ | |||
*/ | |||
/* Peripheral Control functions **********************************************/ | |||
uint32_t HAL_PWREx_GetVoltageRange(void); | |||
HAL_StatusTypeDef HAL_PWREx_ControlVoltageScaling(uint32_t VoltageScaling); | |||
@@ -799,8 +877,10 @@ void HAL_PWREx_DisableVddUSB(void); | |||
void HAL_PWREx_EnableInternalWakeUpLine(void); | |||
void HAL_PWREx_DisableInternalWakeUpLine(void); | |||
#if defined(PWR_CR5_SMPSEN) | |||
void HAL_PWREx_EnableBORH_SMPSBypassIT(void); | |||
void HAL_PWREx_DisableBORH_SMPSBypassIT(void); | |||
#endif | |||
void HAL_PWREx_EnableRFPhaseIT(void); | |||
void HAL_PWREx_DisableRFPhaseIT(void); | |||
void HAL_PWREx_EnableBLEActivityIT(void); | |||
@@ -820,8 +900,10 @@ HAL_StatusTypeDef HAL_PWREx_DisableGPIOPullDown(uint32_t GPIO, uint32_t GPIONumb | |||
void HAL_PWREx_EnablePullUpPullDownConfig(void); | |||
void HAL_PWREx_DisablePullUpPullDownConfig(void); | |||
#if defined(PWR_CR5_SMPSEN) | |||
void HAL_PWREx_SetBORConfig(uint32_t BORConfiguration); | |||
uint32_t HAL_PWREx_GetBORConfig(void); | |||
#endif | |||
void HAL_PWREx_EnableSRAMRetention(void); | |||
void HAL_PWREx_DisableSRAMRetention(void); | |||
@@ -829,17 +911,21 @@ void HAL_PWREx_DisableSRAMRetention(void); | |||
void HAL_PWREx_EnableFlashPowerDown(uint32_t PowerMode); | |||
void HAL_PWREx_DisableFlashPowerDown(uint32_t PowerMode); | |||
#if defined(PWR_CR2_PVME1) | |||
void HAL_PWREx_EnablePVM1(void); | |||
void HAL_PWREx_DisablePVM1(void); | |||
#endif | |||
void HAL_PWREx_EnablePVM3(void); | |||
void HAL_PWREx_DisablePVM3(void); | |||
HAL_StatusTypeDef HAL_PWREx_ConfigPVM(PWR_PVMTypeDef *sConfigPVM); | |||
#if defined(PWR_CR5_SMPSEN) | |||
HAL_StatusTypeDef HAL_PWREx_ConfigSMPS(PWR_SMPSTypeDef *sConfigSMPS); | |||
void HAL_PWREx_SMPS_SetMode(uint32_t OperatingMode); | |||
uint32_t HAL_PWREx_SMPS_GetEffectiveMode(void); | |||
#endif | |||
/* WakeUp pins configuration functions ****************************************/ | |||
void HAL_PWREx_EnableWakeUpPin(uint32_t WakeUpPinPolarity, uint32_t wakeupTarget); | |||
@@ -857,7 +943,9 @@ void HAL_PWREx_EnterSHUTDOWNMode(void); | |||
void HAL_PWREx_PVD_PVM_IRQHandler(void); | |||
#if defined(PWR_CR2_PVME1) | |||
void HAL_PWREx_PVM1Callback(void); | |||
#endif | |||
void HAL_PWREx_PVM3Callback(void); | |||
/** | |||
@@ -27,7 +27,7 @@ | |||
/* Includes ------------------------------------------------------------------*/ | |||
#include "stm32wbxx_hal_def.h" | |||
#if defined(QUADSPI) || defined(QUADSPI1) || defined(QUADSPI2) | |||
#if defined(QUADSPI) | |||
/** @addtogroup STM32WBxx_HAL_Driver | |||
* @{ | |||
@@ -408,7 +408,7 @@ typedef void (*pQSPI_CallbackTypeDef)(QSPI_HandleTypeDef *hqspi); | |||
* @brief QSPI Timeout definition | |||
* @{ | |||
*/ | |||
#define HAL_QPSI_TIMEOUT_DEFAULT_VALUE 5000U /* 5 s */ | |||
#define HAL_QSPI_TIMEOUT_DEFAULT_VALUE 5000U /* 5 s */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -48,6 +48,8 @@ extern "C" { | |||
/* CRS Flag Error Mask */ | |||
#define RCC_CRS_FLAG_ERROR_MASK ((uint32_t)(RCC_CRS_FLAG_TRIMOVF | RCC_CRS_FLAG_SYNCERR | RCC_CRS_FLAG_SYNCMISS)) | |||
/* RNG closk selection CLK48 clock mask */ | |||
#define CLK48_MASK 0x10000000U | |||
/** | |||
* @} | |||
*/ | |||
@@ -57,16 +59,23 @@ extern "C" { | |||
/** @addtogroup RCCEx_Private_Macros | |||
* @{ | |||
*/ | |||
#define IS_RCC_LSCO(__LSCOX__) ( ((__LSCOX__) == RCC_LSCO1) || ((__LSCOX__) == RCC_LSCO2) || ((__LSCOX__) == RCC_LSCO3) ) | |||
#if defined(RCC_LSCO3_SUPPORT) | |||
#define IS_RCC_LSCO(__LSCOX__) (((__LSCOX__) == RCC_LSCO1) || \ | |||
((__LSCOX__) == RCC_LSCO2) || \ | |||
((__LSCOX__) == RCC_LSCO3)) | |||
#else | |||
#define IS_RCC_LSCO(__LSCOX__) (((__LSCOX__) == RCC_LSCO1) || \ | |||
((__LSCOX__) == RCC_LSCO2)) | |||
#endif | |||
#define IS_RCC_LSCOSOURCE(__SOURCE__) (((__SOURCE__) == RCC_LSCOSOURCE_LSI) || \ | |||
((__SOURCE__) == RCC_LSCOSOURCE_LSE)) | |||
#if defined(LPUART1) && defined(I2C3) && defined(SAI1) && defined(USB) && defined(RCC_SMPS_SUPPORT) | |||
#define IS_RCC_PERIPHCLOCK(__SELECTION__) \ | |||
((((__SELECTION__) & RCC_PERIPHCLK_USART1) == RCC_PERIPHCLK_USART1) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_LPUART1) == RCC_PERIPHCLK_LPUART1) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_I2C1) == RCC_PERIPHCLK_I2C1) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_LPUART1) == RCC_PERIPHCLK_LPUART1) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_I2C1) == RCC_PERIPHCLK_I2C1) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_I2C3) == RCC_PERIPHCLK_I2C3) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_LPTIM1) == RCC_PERIPHCLK_LPTIM1) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_LPTIM2) == RCC_PERIPHCLK_LPTIM2) || \ | |||
@@ -77,6 +86,32 @@ extern "C" { | |||
(((__SELECTION__) & RCC_PERIPHCLK_RTC) == RCC_PERIPHCLK_RTC) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_RFWAKEUP) == RCC_PERIPHCLK_RFWAKEUP)|| \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_SMPS) == RCC_PERIPHCLK_SMPS)) | |||
#elif defined(LPUART1) && defined(USB) && defined(RCC_SMPS_SUPPORT) && defined(SPI_I2S_SUPPORT) | |||
#define IS_RCC_PERIPHCLOCK(__SELECTION__) \ | |||
((((__SELECTION__) & RCC_PERIPHCLK_USART1) == RCC_PERIPHCLK_USART1) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_LPUART1) == RCC_PERIPHCLK_LPUART1) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_I2C1) == RCC_PERIPHCLK_I2C1) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_I2C3) == RCC_PERIPHCLK_I2C3) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_LPTIM1) == RCC_PERIPHCLK_LPTIM1) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_LPTIM2) == RCC_PERIPHCLK_LPTIM2) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_USB) == RCC_PERIPHCLK_USB) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_RNG) == RCC_PERIPHCLK_RNG) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_ADC) == RCC_PERIPHCLK_ADC) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_RTC) == RCC_PERIPHCLK_RTC) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_RFWAKEUP) == RCC_PERIPHCLK_RFWAKEUP)|| \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_SMPS) == RCC_PERIPHCLK_SMPS) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_I2S) == RCC_PERIPHCLK_I2S)) | |||
#else | |||
#define IS_RCC_PERIPHCLOCK(__SELECTION__) \ | |||
((((__SELECTION__) & RCC_PERIPHCLK_USART1) == RCC_PERIPHCLK_USART1) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_I2C1) == RCC_PERIPHCLK_I2C1) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_LPTIM1) == RCC_PERIPHCLK_LPTIM1) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_LPTIM2) == RCC_PERIPHCLK_LPTIM2) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_RNG) == RCC_PERIPHCLK_RNG) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_ADC) == RCC_PERIPHCLK_ADC) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_RTC) == RCC_PERIPHCLK_RTC) || \ | |||
(((__SELECTION__) & RCC_PERIPHCLK_RFWAKEUP) == RCC_PERIPHCLK_RFWAKEUP)) | |||
#endif | |||
#define IS_RCC_USART1CLKSOURCE(__SOURCE__) \ | |||
(((__SOURCE__) == RCC_USART1CLKSOURCE_PCLK2) || \ | |||
@@ -84,31 +119,33 @@ extern "C" { | |||
((__SOURCE__) == RCC_USART1CLKSOURCE_LSE) || \ | |||
((__SOURCE__) == RCC_USART1CLKSOURCE_HSI)) | |||
#if defined(LPUART1) | |||
#define IS_RCC_LPUART1CLKSOURCE(__SOURCE__) \ | |||
(((__SOURCE__) == RCC_LPUART1CLKSOURCE_PCLK1) || \ | |||
((__SOURCE__) == RCC_LPUART1CLKSOURCE_SYSCLK) || \ | |||
((__SOURCE__) == RCC_LPUART1CLKSOURCE_LSE) || \ | |||
((__SOURCE__) == RCC_LPUART1CLKSOURCE_HSI)) | |||
#endif | |||
#define IS_RCC_I2C1CLKSOURCE(__SOURCE__) \ | |||
(((__SOURCE__) == RCC_I2C1CLKSOURCE_PCLK1) || \ | |||
((__SOURCE__) == RCC_I2C1CLKSOURCE_SYSCLK)|| \ | |||
((__SOURCE__) == RCC_I2C1CLKSOURCE_HSI)) | |||
#if defined(I2C3) | |||
#define IS_RCC_I2C3CLKSOURCE(__SOURCE__) \ | |||
(((__SOURCE__) == RCC_I2C3CLKSOURCE_PCLK1) || \ | |||
((__SOURCE__) == RCC_I2C3CLKSOURCE_SYSCLK)|| \ | |||
((__SOURCE__) == RCC_I2C3CLKSOURCE_HSI)) | |||
#endif | |||
#define IS_RCC_SAI1CLK(__SOURCE__) \ | |||
#if defined(SAI1) | |||
#define IS_RCC_SAI1CLK(__SOURCE__) \ | |||
(((__SOURCE__) == RCC_SAI1CLKSOURCE_PLLSAI1) || \ | |||
((__SOURCE__) == RCC_SAI1CLKSOURCE_PLL) || \ | |||
((__SOURCE__) == RCC_SAI1CLKSOURCE_PLL) || \ | |||
((__SOURCE__) == RCC_SAI1CLKSOURCE_HSI) || \ | |||
((__SOURCE__) == RCC_SAI1CLKSOURCE_PIN)) | |||
#endif | |||
#define IS_RCC_LPTIM1CLK(__SOURCE__) \ | |||
(((__SOURCE__) == RCC_LPTIM1CLKSOURCE_PCLK1) || \ | |||
@@ -123,22 +160,46 @@ extern "C" { | |||
((__SOURCE__) == RCC_LPTIM2CLKSOURCE_LSE)) | |||
#define IS_RCC_RNGCLKSOURCE(__SOURCE__) \ | |||
(((__SOURCE__) == RCC_RNGCLKSOURCE_CLK48) || \ | |||
((__SOURCE__) == RCC_RNGCLKSOURCE_LSI) || \ | |||
(((__SOURCE__) == RCC_RNGCLKSOURCE_HSI48) || \ | |||
((__SOURCE__) == RCC_RNGCLKSOURCE_PLL) || \ | |||
((__SOURCE__) == RCC_RNGCLKSOURCE_MSI) || \ | |||
((__SOURCE__) == RCC_RNGCLKSOURCE_CLK48) || \ | |||
((__SOURCE__) == RCC_RNGCLKSOURCE_LSI) || \ | |||
((__SOURCE__) == RCC_RNGCLKSOURCE_LSE)) | |||
#if defined(USB) | |||
#if defined(SAI1) | |||
#define IS_RCC_USBCLKSOURCE(__SOURCE__) \ | |||
(((__SOURCE__) == RCC_USBCLKSOURCE_HSI48) || \ | |||
((__SOURCE__) == RCC_USBCLKSOURCE_PLLSAI1) || \ | |||
((__SOURCE__) == RCC_USBCLKSOURCE_PLL) || \ | |||
((__SOURCE__) == RCC_USBCLKSOURCE_MSI)) | |||
#else | |||
#define IS_RCC_USBCLKSOURCE(__SOURCE__) \ | |||
(((__SOURCE__) == RCC_USBCLKSOURCE_HSI48) || \ | |||
((__SOURCE__) == RCC_USBCLKSOURCE_PLL) || \ | |||
((__SOURCE__) == RCC_USBCLKSOURCE_MSI)) | |||
#endif | |||
#endif | |||
#if defined(STM32WB55xx) || defined (STM32WB5Mxx) | |||
#define IS_RCC_ADCCLKSOURCE(__SOURCE__) \ | |||
(((__SOURCE__) == RCC_ADCCLKSOURCE_NONE) || \ | |||
((__SOURCE__) == RCC_ADCCLKSOURCE_PLL) || \ | |||
(((__SOURCE__) == RCC_ADCCLKSOURCE_NONE) || \ | |||
((__SOURCE__) == RCC_ADCCLKSOURCE_PLL) || \ | |||
((__SOURCE__) == RCC_ADCCLKSOURCE_PLLSAI1) || \ | |||
((__SOURCE__) == RCC_ADCCLKSOURCE_SYSCLK)) | |||
#elif defined(STM32WB35xx) | |||
#define IS_RCC_ADCCLKSOURCE(__SOURCE__) \ | |||
(((__SOURCE__) == RCC_ADCCLKSOURCE_NONE) || \ | |||
((__SOURCE__) == RCC_ADCCLKSOURCE_PLL) || \ | |||
((__SOURCE__) == RCC_ADCCLKSOURCE_HSI) || \ | |||
((__SOURCE__) == RCC_ADCCLKSOURCE_SYSCLK)) | |||
#else | |||
#define IS_RCC_ADCCLKSOURCE(__SOURCE__) \ | |||
(((__SOURCE__) == RCC_ADCCLKSOURCE_NONE) || \ | |||
((__SOURCE__) == RCC_ADCCLKSOURCE_PLL) || \ | |||
((__SOURCE__) == RCC_ADCCLKSOURCE_SYSCLK)) | |||
#endif | |||
#define IS_RCC_RFWKPCLKSOURCE(__SOURCE__) \ | |||
(((__SOURCE__) == RCC_RFWKPCLKSOURCE_NONE) || \ | |||
@@ -146,6 +207,7 @@ extern "C" { | |||
((__SOURCE__) == RCC_RFWKPCLKSOURCE_LSI) || \ | |||
((__SOURCE__) == RCC_RFWKPCLKSOURCE_HSE_DIV1024)) | |||
#if defined(RCC_SMPS_SUPPORT) | |||
#define IS_RCC_SMPSCLKDIV(__DIV__) \ | |||
(((__DIV__) == RCC_SMPSCLKDIV_RANGE0) || \ | |||
((__DIV__) == RCC_SMPSCLKDIV_RANGE1) || \ | |||
@@ -156,17 +218,29 @@ extern "C" { | |||
(((__SOURCE__) == RCC_SMPSCLKSOURCE_HSI) || \ | |||
((__SOURCE__) == RCC_SMPSCLKSOURCE_MSI) || \ | |||
((__SOURCE__) == RCC_SMPSCLKSOURCE_HSE)) | |||
#endif | |||
#if defined(SPI_I2S_SUPPORT) | |||
#define IS_RCC_I2SCLKSOURCE(__SOURCE__) \ | |||
(((__SOURCE__) == RCC_I2SCLKSOURCE_NONE) || \ | |||
((__SOURCE__) == RCC_I2SCLKSOURCE_HSI) || \ | |||
((__SOURCE__) == RCC_I2SCLKSOURCE_PLL) || \ | |||
((__SOURCE__) == RCC_I2SCLKSOURCE_PIN)) | |||
#endif | |||
#define IS_RCC_PLLSAI1N_VALUE(__VALUE__) ((8U <= (__VALUE__)) && ((__VALUE__) <= 86U)) | |||
#if defined(SAI1) | |||
#define IS_RCC_PLLSAI1N_VALUE(__VALUE__) ((6U <= (__VALUE__)) && ((__VALUE__) <= 127U)) | |||
#define IS_RCC_PLLSAI1P_VALUE(__VALUE__) ((RCC_PLLP_DIV2 <= (__VALUE__)) && ((__VALUE__) <= RCC_PLLP_DIV32)) | |||
#define IS_RCC_PLLSAI1Q_VALUE(__VALUE__) ((RCC_PLLQ_DIV2 <= (__VALUE__)) && ((__VALUE__) <= RCC_PLLQ_DIV8)) | |||
#define IS_RCC_PLLSAI1R_VALUE(__VALUE__) ((RCC_PLLR_DIV2 <= (__VALUE__)) && ((__VALUE__) <= RCC_PLLR_DIV8)) | |||
#endif | |||
#define IS_RCC_TRIMOSC(__VALUE__) ((__VALUE__) == RCC_OSCILLATORTYPE_LSI2) | |||
#if defined(CRS) | |||
#define IS_RCC_CRS_SYNC_SOURCE(__SOURCE__) (((__SOURCE__) == RCC_CRS_SYNC_SOURCE_GPIO) || \ | |||
((__SOURCE__) == RCC_CRS_SYNC_SOURCE_LSE) || \ | |||
((__SOURCE__) == RCC_CRS_SYNC_SOURCE_USB)) | |||
@@ -187,7 +261,7 @@ extern "C" { | |||
#define IS_RCC_CRS_FREQERRORDIR(__DIR__) (((__DIR__) == RCC_CRS_FREQERRORDIR_UP) || \ | |||
((__DIR__) == RCC_CRS_FREQERRORDIR_DOWN)) | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
@@ -198,6 +272,7 @@ extern "C" { | |||
* @{ | |||
*/ | |||
#if defined(SAI1) | |||
/** | |||
* @brief PLLSAI1 Clock structure definition | |||
*/ | |||
@@ -205,7 +280,7 @@ typedef struct | |||
{ | |||
uint32_t PLLN; /*!< PLLN: specifies the multiplication factor for PLLSAI1 VCO output clock. | |||
This parameter must be a number between Min_Data=8 and Max_Data=86. */ | |||
This parameter must be a number between Min_Data=6 and Max_Data=127. */ | |||
uint32_t PLLP; /*!< PLLP: specifies the division factor for SAI clock. | |||
This parameter must be a value of @ref RCC_PLLP_Clock_Divider */ | |||
@@ -219,7 +294,7 @@ typedef struct | |||
uint32_t PLLSAI1ClockOut; /*!< PLLSAI1ClockOut: specifies PLLSAI1 output clock to be enabled. | |||
This parameter must be a value of @ref RCC_PLLSAI1_Clock_Output */ | |||
} RCC_PLLSAI1InitTypeDef; | |||
#endif | |||
/** | |||
* @brief RCC extended clocks structure definition | |||
@@ -229,23 +304,27 @@ typedef struct | |||
uint32_t PeriphClockSelection; /*!< The Extended Clock to be configured. | |||
This parameter can be a value of @ref RCCEx_Periph_Clock_Selection */ | |||
#if defined(SAI1) | |||
RCC_PLLSAI1InitTypeDef PLLSAI1; /*!< PLLSAI1 structure parameters. | |||
This parameter will be used only when PLLSAI1 is selected as Clock | |||
Source for SAI, USB/RNG or ADC */ | |||
#endif | |||
uint32_t Usart1ClockSelection; /*!< Specifies USART1 clock source. | |||
This parameter can be a value of @ref RCCEx_USART1_Clock_Source */ | |||
#if defined(LPUART1) | |||
uint32_t Lpuart1ClockSelection; /*!< Specifies LPUART1 clock source. | |||
This parameter can be a value of @ref RCCEx_LPUART1_Clock_Source */ | |||
#endif | |||
uint32_t I2c1ClockSelection; /*!< Specifies I2C1 clock source. | |||
This parameter can be a value of @ref RCCEx_I2C1_Clock_Source */ | |||
#if defined(I2C3) | |||
uint32_t I2c3ClockSelection; /*!< Specifies I2C3 clock source. | |||
This parameter can be a value of @ref RCCEx_I2C3_Clock_Source */ | |||
#endif | |||
uint32_t Lptim1ClockSelection; /*!< Specifies LPTIM1 clock source. | |||
This parameter can be a value of @ref RCCEx_LPTIM1_Clock_Source */ | |||
@@ -253,12 +332,15 @@ typedef struct | |||
uint32_t Lptim2ClockSelection; /*!< Specifies LPTIM2 clock source. | |||
This parameter can be a value of @ref RCCEx_LPTIM2_Clock_Source */ | |||
#if defined(SAI1) | |||
uint32_t Sai1ClockSelection; /*!< Specifies SAI1 clock source. | |||
This parameter can be a value of @ref RCCEx_SAI1_Clock_Source */ | |||
#endif | |||
#if defined(USB) | |||
uint32_t UsbClockSelection; /*!< Specifies USB clock source (warning: same source for RNG). | |||
This parameter can be a value of @ref RCCEx_USB_Clock_Source */ | |||
#endif | |||
uint32_t RngClockSelection; /*!< Specifies RNG clock source (warning: same source for USB). | |||
This parameter can be a value of @ref RCCEx_RNG_Clock_Source */ | |||
@@ -273,15 +355,22 @@ typedef struct | |||
uint32_t RFWakeUpClockSelection; /*!< Specifies RF Wake-up clock source. | |||
This parameter can be a value of @ref RCCEx_RFWKP_Clock_Source */ | |||
#if defined(RCC_SMPS_SUPPORT) | |||
uint32_t SmpsClockSelection; /*!< Specifies SMPS clock source. | |||
This parameter can be a value of @ref RCCEx_SMPS_Clock_Source */ | |||
uint32_t SmpsDivSelection; /*!< Specifies SMPS clock division factor. | |||
This parameter can be a value of @ref RCCEx_SMPS_Clock_Divider */ | |||
#endif | |||
#if defined(SPI_I2S_SUPPORT) | |||
uint32_t I2sClockSelection; /*!< Specifies I2s clock source. | |||
This parameter can be a value of @ref RCCEx_I2s_Clock_Source */ | |||
#endif | |||
} RCC_PeriphCLKInitTypeDef; | |||
#if defined(CRS) | |||
/** | |||
* @brief RCC_CRS Init structure definition | |||
*/ | |||
@@ -329,7 +418,7 @@ typedef struct | |||
This parameter must be a value of @ref RCCEx_CRS_FreqErrorDirection*/ | |||
} RCC_CRSSynchroInfoTypeDef; | |||
#endif | |||
/** | |||
* @} | |||
@@ -345,7 +434,9 @@ typedef struct | |||
*/ | |||
#define RCC_LSCO1 0x00000000U /*!< LSCO1 index */ | |||
#define RCC_LSCO2 0x00000001U /*!< LSCO2 index */ | |||
#if defined(RCC_LSCO3_SUPPORT) | |||
#define RCC_LSCO3 0x00000002U /*!< LSCO3 index */ | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
@@ -364,25 +455,36 @@ typedef struct | |||
* @{ | |||
*/ | |||
#define RCC_PERIPHCLK_USART1 0x00000001U /*!< USART1 Peripheral Clock Selection */ | |||
#if defined(LPUART1) | |||
#define RCC_PERIPHCLK_LPUART1 0x00000002U /*!< LPUART1 Peripheral Clock Selection */ | |||
#endif | |||
#define RCC_PERIPHCLK_I2C1 0x00000004U /*!< I2C1 Peripheral Clock Selection */ | |||
#if defined(I2C3) | |||
#define RCC_PERIPHCLK_I2C3 0x00000008U /*!< I2C3 Peripheral Clock Selection */ | |||
#endif | |||
#define RCC_PERIPHCLK_LPTIM1 0x00000010U /*!< LPTIM1 Peripheral Clock Selection */ | |||
#define RCC_PERIPHCLK_LPTIM2 0x00000020U /*!< LPTIM2 Peripheral Clock Selection */ | |||
#if defined(SAI1) | |||
#define RCC_PERIPHCLK_SAI1 0x00000040U /*!< SAI1 Peripheral Clock Selection */ | |||
#define RCC_PERIPHCLK_USB 0x00000100U /*!< USB Peripheral Clock Selection */ | |||
#endif | |||
#define RCC_PERIPHCLK_CLK48SEL 0x00000100U /*!< 48 MHz clock source selection */ | |||
#if defined(USB) | |||
#define RCC_PERIPHCLK_USB RCC_PERIPHCLK_CLK48SEL /*!< USB Peripheral Clock Selection */ | |||
#endif | |||
#define RCC_PERIPHCLK_RNG 0x00000200U /*!< RNG Peripheral Clock Selection */ | |||
#define RCC_PERIPHCLK_ADC 0x00000400U /*!< ADC Peripheral Clock Selection */ | |||
#define RCC_PERIPHCLK_RTC 0x00000800U /*!< RTC Peripheral Clock Selection */ | |||
#define RCC_PERIPHCLK_RFWAKEUP 0x00001000U /*!< RF Wakeup Peripheral Clock Selection */ | |||
#define RCC_PERIPHCLK_SMPS 0x00002000U /*!< SMPSS Peripheral Clock Selection */ | |||
#if defined(RCC_SMPS_SUPPORT) | |||
#define RCC_PERIPHCLK_SMPS 0x00002000U /*!< SMPS Peripheral Clock Selection */ | |||
#endif | |||
#if defined(SPI_I2S_SUPPORT) | |||
#define RCC_PERIPHCLK_I2S 0x00004000U /*!< I2S Peripheral Clock Selection */ | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
/** @defgroup RCCEx_USART1_Clock_Source USART1 Clock Source | |||
* @{ | |||
*/ | |||
@@ -394,7 +496,7 @@ typedef struct | |||
* @} | |||
*/ | |||
#if defined(LPUART1) | |||
/** @defgroup RCCEx_LPUART1_Clock_Source LPUART1 Clock Source | |||
* @{ | |||
*/ | |||
@@ -405,6 +507,7 @@ typedef struct | |||
/** | |||
* @} | |||
*/ | |||
#endif | |||
/** @defgroup RCCEx_I2C1_Clock_Source I2C1 Clock Source | |||
* @{ | |||
@@ -416,7 +519,7 @@ typedef struct | |||
* @} | |||
*/ | |||
#if defined(I2C3) | |||
/** @defgroup RCCEx_I2C3_Clock_Source I2C3 Clock Source | |||
* @{ | |||
*/ | |||
@@ -426,8 +529,9 @@ typedef struct | |||
/** | |||
* @} | |||
*/ | |||
#endif | |||
#if defined(SAI1) | |||
/** @defgroup RCCEx_SAI1_Clock_Source SAI1 Clock Source | |||
* @{ | |||
*/ | |||
@@ -438,6 +542,7 @@ typedef struct | |||
/** | |||
* @} | |||
*/ | |||
#endif | |||
/** @defgroup RCCEx_LPTIM1_Clock_Source LPTIM1 Clock Source | |||
* @{ | |||
@@ -454,9 +559,9 @@ typedef struct | |||
* @{ | |||
*/ | |||
#define RCC_LPTIM2CLKSOURCE_PCLK1 LL_RCC_LPTIM2_CLKSOURCE_PCLK1 /*!< APB1 clock selected as LPTIM2 clock */ | |||
#define RCC_LPTIM2CLKSOURCE_LSI LL_RCC_LPTIM2_CLKSOURCE_LSI /*!< LSI clock selected as LPTIM1 clock */ | |||
#define RCC_LPTIM2CLKSOURCE_HSI LL_RCC_LPTIM2_CLKSOURCE_HSI /*!< HSI clock selected as LPTIM1 clock */ | |||
#define RCC_LPTIM2CLKSOURCE_LSE LL_RCC_LPTIM2_CLKSOURCE_LSE /*!< LSE clock selected as LPTIM1 clock */ | |||
#define RCC_LPTIM2CLKSOURCE_LSI LL_RCC_LPTIM2_CLKSOURCE_LSI /*!< LSI clock selected as LPTIM2 clock */ | |||
#define RCC_LPTIM2CLKSOURCE_HSI LL_RCC_LPTIM2_CLKSOURCE_HSI /*!< HSI clock selected as LPTIM2 clock */ | |||
#define RCC_LPTIM2CLKSOURCE_LSE LL_RCC_LPTIM2_CLKSOURCE_LSE /*!< LSE clock selected as LPTIM2 clock */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -464,32 +569,41 @@ typedef struct | |||
/** @defgroup RCCEx_RNG_Clock_Source RNG Clock Source | |||
* @{ | |||
*/ | |||
#define RCC_RNGCLKSOURCE_CLK48 LL_RCC_RNG_CLKSOURCE_CLK48 /*!< CLK48 divided by 3 selected as RNG Clock */ | |||
#define RCC_RNGCLKSOURCE_LSI LL_RCC_RNG_CLKSOURCE_LSI /*!< LSI selected as ADC clock*/ | |||
#define RCC_RNGCLKSOURCE_LSE LL_RCC_RNG_CLKSOURCE_LSE /*!< LSE selected as ADC clock*/ | |||
#define RCC_RNGCLKSOURCE_HSI48 (CLK48_MASK | LL_RCC_CLK48_CLKSOURCE_HSI48) /*!< HSI48 clock divided by 3 selected as RNG clock */ | |||
#define RCC_RNGCLKSOURCE_PLL (CLK48_MASK | LL_RCC_CLK48_CLKSOURCE_PLL) /*!< PLL "Q" clock divided by 3 selected as RNG clock */ | |||
#define RCC_RNGCLKSOURCE_MSI (CLK48_MASK | LL_RCC_CLK48_CLKSOURCE_MSI) /*!< MSI clock divided by 3 selected as RNG clock */ | |||
#define RCC_RNGCLKSOURCE_CLK48 LL_RCC_RNG_CLKSOURCE_CLK48 /*!< CLK48 divided by 3 selected as RNG Clock */ | |||
#define RCC_RNGCLKSOURCE_LSI LL_RCC_RNG_CLKSOURCE_LSI /*!< LSI clock selected as RNG clock */ | |||
#define RCC_RNGCLKSOURCE_LSE LL_RCC_RNG_CLKSOURCE_LSE /*!< LSE clock selected as RNG clock */ | |||
/** | |||
* @} | |||
*/ | |||
#if defined(USB) | |||
/** @defgroup RCCEx_USB_Clock_Source USB Clock Source | |||
* @{ | |||
*/ | |||
#define RCC_USBCLKSOURCE_HSI48 LL_RCC_USB_CLKSOURCE_HSI48 /*!< HSI48 clock selected as USB clock */ | |||
#if defined(SAI1) | |||
#define RCC_USBCLKSOURCE_PLLSAI1 LL_RCC_USB_CLKSOURCE_PLLSAI1 /*!< PLLSAI1 "Q" clock selected as USB clock */ | |||
#endif | |||
#define RCC_USBCLKSOURCE_PLL LL_RCC_USB_CLKSOURCE_PLL /*!< PLL "Q" clock selected as USB clock */ | |||
#define RCC_USBCLKSOURCE_MSI LL_RCC_USB_CLKSOURCE_MSI /*!< MSI clock selected as USB clock */ | |||
/** | |||
* @} | |||
*/ | |||
#endif | |||
/** @defgroup RCCEx_ADC_Clock_Source ADC Clock Source | |||
* @{ | |||
*/ | |||
#define RCC_ADCCLKSOURCE_NONE LL_RCC_ADC_CLKSOURCE_NONE /*!< None clock selected as ADC clock */ | |||
#if defined(STM32WB55xx) || defined (STM32WB5Mxx) | |||
#define RCC_ADCCLKSOURCE_PLLSAI1 LL_RCC_ADC_CLKSOURCE_PLLSAI1 /*!< PLLSAI1 "R" clock selected as ADC clock */ | |||
#elif defined(STM32WB35xx) | |||
#define RCC_ADCCLKSOURCE_HSI LL_RCC_ADC_CLKSOURCE_HSI /*!< HSI clock selected as ADC clock */ | |||
#endif | |||
#define RCC_ADCCLKSOURCE_PLL LL_RCC_ADC_CLKSOURCE_PLL /*!< PLL "P" clock selected as ADC clock */ | |||
#define RCC_ADCCLKSOURCE_SYSCLK LL_RCC_ADC_CLKSOURCE_SYSCLK /*!< SYSCLK clock selected as ADC clock */ | |||
@@ -522,45 +636,51 @@ typedef struct | |||
*/ | |||
#if defined(RCC_SMPS_SUPPORT) | |||
/** @defgroup RCCEx_SMPS_Clock_Source SMPS Clock Source | |||
* @{ | |||
*/ | |||
#define RCC_SMPSCLKSOURCE_HSI LL_RCC_SMPS_CLKSOURCE_HSI /*!< HSI selection as smps clock */ | |||
#define RCC_SMPSCLKSOURCE_MSI LL_RCC_SMPS_CLKSOURCE_MSI /*!< MSI selection as smps clock */ | |||
#define RCC_SMPSCLKSOURCE_HSE LL_RCC_SMPS_CLKSOURCE_HSE /*!< HSE selection as smps clock */ | |||
/** | |||
* @} | |||
*/ | |||
/** @defgroup RCC_System_Clock_Source_Status System Clock Source Status | |||
* @{ | |||
*/ | |||
#define RCC_SMPSCLKSOURCE_STATUS_HSI LL_RCC_SMPS_CLKSOURCE_STATUS_HSI /*!< HSI selection as smps clock */ | |||
#define RCC_SMPSCLKSOURCE_STATUS_MSI LL_RCC_SMPS_CLKSOURCE_STATUS_MSI /*!< MSI selection as smps clock */ | |||
#define RCC_SMPSCLKSOURCE_STATUS_HSE LL_RCC_SMPS_CLKSOURCE_STATUS_HSE /*!< HSE selection as smps clock */ | |||
/** | |||
* @} | |||
*/ | |||
/** @defgroup RCCEx_SMPS_Clock_Divider SMPS Clock Division Factor | |||
* @{ | |||
*/ | |||
#define RCC_SMPSCLKDIV_RANGE0 LL_RCC_SMPS_DIV_0 /*!< PLLM division factor = 0 */ | |||
#define RCC_SMPSCLKDIV_RANGE1 LL_RCC_SMPS_DIV_1 /*!< PLLM division factor = 1 */ | |||
#define RCC_SMPSCLKDIV_RANGE2 LL_RCC_SMPS_DIV_2 /*!< PLLM division factor = 2 */ | |||
#define RCC_SMPSCLKDIV_RANGE3 LL_RCC_SMPS_DIV_3 /*!< PLLM division factor = 3 */ | |||
/** | |||
* @} | |||
*/ | |||
#endif | |||
#if defined(SPI_I2S_SUPPORT) | |||
/** @defgroup RCCEx_I2S_Clock_Source I2S Clock Source | |||
* @{ | |||
*/ | |||
#define RCC_I2SCLKSOURCE_NONE LL_RCC_I2S_CLKSOURCE_NONE /*!< No clock selected as I2S clock */ | |||
#define RCC_I2SCLKSOURCE_PLL LL_RCC_I2S_CLKSOURCE_PLL /*!< PLL "Q" clock selected as I2S clock source */ | |||
#define RCC_I2SCLKSOURCE_HSI LL_RCC_I2S_CLKSOURCE_HSI /*!< HSI clock selected as I2S clock */ | |||
#define RCC_I2SCLKSOURCE_PIN LL_RCC_I2S_CLKSOURCE_PIN /*!< External clock selected as I2S clock */ | |||
/** | |||
* @} | |||
*/ | |||
#endif | |||
/** @defgroup RCCEx_EXTI_LINE_LSECSS RCC LSE CSS external interrupt line | |||
* @{ | |||
@@ -572,6 +692,7 @@ typedef struct | |||
*/ | |||
#if defined(CRS) | |||
/** @defgroup RCCEx_CRS_Status RCCEx CRS Status | |||
* @{ | |||
*/ | |||
@@ -685,6 +806,7 @@ typedef struct | |||
/** | |||
* @} | |||
*/ | |||
#endif | |||
/** | |||
* @} | |||
@@ -697,6 +819,7 @@ typedef struct | |||
/*================================================================================================================*/ | |||
#if defined(SAI1) | |||
/** | |||
* @brief Macro to configure the PLLSAI1 clock multiplication and division factors. | |||
* | |||
@@ -705,9 +828,9 @@ typedef struct | |||
* @ref __HAL_RCC_PLL_CONFIG() macro) | |||
* | |||
* @param __PLLN__ specifies the multiplication factor for PLLSAI1 VCO output clock. | |||
* This parameter must be a number between 4 and 86. | |||
* This parameter must be a number between 6 and 127. | |||
* @note You have to set the PLLN parameter correctly to ensure that the VCO | |||
* output frequency is between 64 and 344 MHz. | |||
* output frequency is between 96 and 344 MHz. | |||
* PLLSAI1 clock frequency = f(PLLSAI1) multiplied by PLLN | |||
* | |||
* @param __PLLP__ specifies the division factor for SAI clock. | |||
@@ -737,9 +860,9 @@ typedef struct | |||
* @ref __HAL_RCC_PLL_CONFIG() macro) | |||
* | |||
* @param __PLLN__ specifies the multiplication factor for PLLSAI1 VCO output clock. | |||
* This parameter must be a number between Min_Data=4 and Max_Data=86. | |||
* This parameter must be a number between Min_Data=6 and Max_Data=127. | |||
* @note You have to set the PLLN parameter correctly to ensure that the VCO | |||
* output frequency is between 64 and 344 MHz. | |||
* output frequency is between 96 and 344 MHz. | |||
* Use to set PLLSAI1 clock frequency = f(PLLSAI1) multiplied by PLLN | |||
* | |||
* @retval None | |||
@@ -817,7 +940,6 @@ typedef struct | |||
* @arg @ref RCC_PLLSAI1_SAI1CLK This clock is used to generate an accurate clock to achieve high-quality audio performance on SAI interface | |||
* @arg @ref RCC_PLLSAI1_ADCCLK Clock used to clock ADC peripheral | |||
* @arg @ref RCC_PLLSAI1_USBCLK This clock is used to generate the clock for the USB Device (48 MHz) | |||
* @arg @ref RCC_PLLSAI1_RNGCLK same as RCC_PLLSAI1_USBCLK | |||
* | |||
* @retval None | |||
*/ | |||
@@ -832,7 +954,6 @@ typedef struct | |||
* @arg @ref RCC_PLLSAI1_SAI1CLK This clock is used to generate an accurate clock to achieve high-quality audio performance on SAI interface | |||
* @arg @ref RCC_PLLSAI1_ADCCLK Clock used to clock ADC peripheral | |||
* @arg @ref RCC_PLLSAI1_USBCLK This clock is used to generate the clock for the USB Device (48 MHz) | |||
* @arg @ref RCC_PLLSAI1_RNGCLK same as RCC_PLLSAI1_USBCLK | |||
* | |||
* @retval None | |||
*/ | |||
@@ -845,7 +966,6 @@ typedef struct | |||
* @arg @ref RCC_PLLSAI1_SAI1CLK This clock is used to generate an accurate clock to achieve high-quality audio performance on SAI interface | |||
* @arg @ref RCC_PLLSAI1_ADCCLK Clock used to clock ADC peripheral | |||
* @arg @ref RCC_PLLSAI1_USBCLK This clock is used to generate the clock for the USB Device (48 MHz) | |||
* @arg @ref RCC_PLLSAI1_RNGCLK same as RCC_PLLSAI1_USBCLK | |||
* @retval SET / RESET | |||
*/ | |||
#define __HAL_RCC_GET_PLLSAI1CLKOUT_CONFIG(__PLLSAI1_CLOCKOUT__) READ_BIT(RCC->PLLSAI1CFGR, (__PLLSAI1_CLOCKOUT__)) | |||
@@ -876,6 +996,7 @@ typedef struct | |||
* @retval None | |||
*/ | |||
#define __HAL_RCC_GET_SAI1_SOURCE() LL_RCC_GetSAIClockSource(LL_RCC_SAI1_CLKSOURCE) | |||
#endif | |||
/** @brief Macro to configure the I2C1 clock (I2C1CLK). | |||
* | |||
@@ -896,6 +1017,7 @@ typedef struct | |||
*/ | |||
#define __HAL_RCC_GET_I2C1_SOURCE() LL_RCC_GetI2CClockSource(LL_RCC_I2C1_CLKSOURCE) | |||
#if defined(I2C3) | |||
/** @brief Macro to configure the I2C3 clock (I2C3CLK). | |||
* | |||
* @param __I2C3_CLKSOURCE__ specifies the I2C3 clock source. | |||
@@ -914,6 +1036,7 @@ typedef struct | |||
* @arg @ref RCC_I2C3CLKSOURCE_SYSCLK System Clock selected as I2C3 clock | |||
*/ | |||
#define __HAL_RCC_GET_I2C3_SOURCE() LL_RCC_GetI2CClockSource(LL_RCC_I2C3_CLKSOURCE) | |||
#endif | |||
/** @brief Macro to configure the USART1 clock (USART1CLK). | |||
* | |||
@@ -936,6 +1059,7 @@ typedef struct | |||
*/ | |||
#define __HAL_RCC_GET_USART1_SOURCE() LL_RCC_GetUSARTClockSource(LL_RCC_USART1_CLKSOURCE) | |||
#if defined(LPUART1) | |||
/** @brief Macro to configure the LPUART clock (LPUARTCLK). | |||
* | |||
* @param __LPUART_CLKSOURCE__ specifies the LPUART clock source. | |||
@@ -956,6 +1080,7 @@ typedef struct | |||
* @arg @ref RCC_LPUART1CLKSOURCE_LSE LSE selected as LPUART1 clock | |||
*/ | |||
#define __HAL_RCC_GET_LPUART1_SOURCE() LL_RCC_GetLPUARTClockSource(LL_RCC_LPUART1_CLKSOURCE) | |||
#endif | |||
/** @brief Macro to configure the LPTIM1 clock (LPTIM1CLK). | |||
* | |||
@@ -1006,19 +1131,41 @@ typedef struct | |||
* | |||
* @param __RNG_CLKSOURCE__ specifies the RNG clock source. | |||
* This parameter can be one of the following values: | |||
* @arg @ref RCC_RNGCLKSOURCE_CLK48 CLK48 divided by 3 selected as RNG Clock | |||
* @arg @ref RCC_RNGCLKSOURCE_LSI LSI selected as RNG clock | |||
* @arg @ref RCC_RNGCLKSOURCE_LSE LSE selected as RNG clock | |||
* @arg @ref RCC_RNGCLKSOURCE_HSI48 HSI48 clock divided by 3 selected as RNG clock | |||
* @arg @ref RCC_RNGCLKSOURCE_PLL PLL "Q" clock divided by 3 selected as RNG clock | |||
* @arg @ref RCC_RNGCLKSOURCE_MSI MSI clock divided by 3 selected as RNG clock | |||
* @arg @ref RCC_RNGCLKSOURCE_CLK48 CLK48 divided by 3 selected as RNG Clock (default HSI48) | |||
* @arg @ref RCC_RNGCLKSOURCE_LSI LSI clock selected as RNG clock | |||
* @arg @ref RCC_RNGCLKSOURCE_LSE LSE clock selected as RNG clock | |||
* @retval None | |||
*/ | |||
#define __HAL_RCC_RNG_CONFIG(__RNG_CLKSOURCE__) LL_RCC_SetRNGClockSource(__RNG_CLKSOURCE__) | |||
/** @brief Macro to get the RNG clock. * @retval The clock source can be one of the following values: | |||
#define __HAL_RCC_RNG_CONFIG(__RNG_CLKSOURCE__) \ | |||
do { \ | |||
if (((__RNG_CLKSOURCE__) == RCC_RNGCLKSOURCE_LSI) \ | |||
|| ((__RNG_CLKSOURCE__) == RCC_RNGCLKSOURCE_LSE) \ | |||
|| ((__RNG_CLKSOURCE__) == RCC_RNGCLKSOURCE_CLK48)) \ | |||
{ \ | |||
LL_RCC_SetRNGClockSource((__RNG_CLKSOURCE__)); \ | |||
} \ | |||
else \ | |||
{ \ | |||
uint32_t tmp = (__RNG_CLKSOURCE__) &(~CLK48_MASK); \ | |||
LL_RCC_SetRNGClockSource(RCC_RNGCLKSOURCE_CLK48); \ | |||
LL_RCC_SetCLK48ClockSource(tmp); \ | |||
} \ | |||
} while(0U) | |||
/** @brief Macro to get the direct RNG clock. | |||
* @note @ref HAL_RCCEx_GetRngCLKSource can also be called to get direct | |||
* of indirect (48 MHz clock source) RNG clock source. | |||
* @retval The RNG clock source can be one of the following values: | |||
* @arg @ref RCC_RNGCLKSOURCE_CLK48 CLK48 divided by 3 selected as RNG Clock | |||
* @arg @ref RCC_RNGCLKSOURCE_LSI LSI selected as RNG clock | |||
* @arg @ref RCC_RNGCLKSOURCE_LSE LSE selected as RNG clock | |||
*/ | |||
#define __HAL_RCC_GET_RNG_SOURCE() LL_RCC_GetRNGClockSource(LL_RCC_RNG_CLKSOURCE) | |||
#if defined(USB) | |||
/** @brief Macro to configure the USB clock (USBCLK). | |||
* | |||
* @note USB and RNG peripherals share the same 48MHz clock source. | |||
@@ -1041,14 +1188,17 @@ typedef struct | |||
* @arg @ref RCC_USBCLKSOURCE_PLL PLL "Q" clock (PLL48M1CLK) selected as USB clock | |||
*/ | |||
#define __HAL_RCC_GET_USB_SOURCE() LL_RCC_GetUSBClockSource(LL_RCC_USB_CLKSOURCE) | |||
#endif | |||
/** @brief Macro to configure the ADC interface clock. | |||
* @param __ADC_CLKSOURCE__ specifies the ADC digital interface clock source. | |||
* This parameter can be one of the following values: | |||
* @arg @ref RCC_ADCCLKSOURCE_NONE No clock selected as ADC clock | |||
* @arg @ref RCC_ADCCLKSOURCE_PLLSAI1 PLLSAI1 Clock selected as ADC clock | |||
* @arg @ref RCC_ADCCLKSOURCE_PLLSAI1 PLLSAI1 Clock selected as ADC clock (*) | |||
* @arg @ref RCC_ADCCLKSOURCE_PLL PLL Clock selected as ADC clock | |||
* @arg @ref RCC_ADCCLKSOURCE_SYSCLK System Clock selected as ADC clock | |||
* @arg @ref RCC_ADCCLKSOURCE_HSI HSI Clock selected as ADC clock (*) | |||
* @note (*) Value not defined for all devices | |||
* @retval None | |||
*/ | |||
#define __HAL_RCC_ADC_CONFIG(__ADC_CLKSOURCE__) LL_RCC_SetADCClockSource(__ADC_CLKSOURCE__) | |||
@@ -1056,9 +1206,11 @@ typedef struct | |||
/** @brief Macro to get the ADC clock source. | |||
* @retval The clock source can be one of the following values: | |||
* @arg @ref RCC_ADCCLKSOURCE_NONE No clock selected as ADC clock | |||
* @arg @ref RCC_ADCCLKSOURCE_PLLSAI1 PLLSAI1 Clock selected as ADC clock | |||
* @arg @ref RCC_ADCCLKSOURCE_PLLSAI1 PLLSAI1 Clock selected as ADC clock (*) | |||
* @arg @ref RCC_ADCCLKSOURCE_PLL PLL Clock selected as ADC clock | |||
* @arg @ref RCC_ADCCLKSOURCE_SYSCLK System Clock selected as ADC clock | |||
* @arg @ref RCC_ADCCLKSOURCE_HSI HSI Clock selected as ADC clock (*) | |||
* @note (*) Value not defined for all devices | |||
*/ | |||
#define __HAL_RCC_GET_ADC_SOURCE() LL_RCC_GetADCClockSource(LL_RCC_ADC_CLKSOURCE) | |||
@@ -1082,6 +1234,7 @@ typedef struct | |||
*/ | |||
#define __HAL_RCC_GET_RFWAKEUP_SOURCE() LL_RCC_GetRFWKPClockSource() | |||
#if defined(RCC_SMPS_SUPPORT) | |||
/** @brief Macro to configure the SMPS clock division factor. | |||
* | |||
* @param __SMPSCLKDIV__ specifies the division factor for SMPS clock. | |||
@@ -1134,12 +1287,36 @@ typedef struct | |||
* @arg @ref RCC_SMPSCLKSOURCE_STATUS_HSE HSE Clock selected as SMPS clock | |||
*/ | |||
#define __HAL_RCC_GET_SMPS_SOURCE_STATUS() LL_RCC_GetSMPSClockSource() | |||
#endif | |||
/** @defgroup RCCEx_Flags_Interrupts_Management Flags Interrupts Management | |||
* @brief macros to manage the specified RCC Flags and interrupts. | |||
* @{ | |||
*/ | |||
#if defined(SPI_I2S_SUPPORT) | |||
/** @brief Macro to configure the I2S clock (I2SCLK). | |||
* @param __I2S_CLKSOURCE__ specifies the I2S clock source. | |||
* This parameter can be one of the following values: | |||
* @arg @ref RCC_I2SCLKSOURCE_NONE No clock selected as I2S clock | |||
* @arg @ref RCC_I2SCLKSOURCE_PLL PLL "Q" selected as I2S clock | |||
* @arg @ref RCC_I2SCLKSOURCE_HSI HSI selected as I2S clock | |||
* @arg @ref RCC_I2SCLKSOURCE_PIN External clock selected as I2S clock | |||
* @retval None | |||
*/ | |||
#define __HAL_RCC_I2S_CONFIG(__I2S_CLKSOURCE__) LL_RCC_SetI2SClockSource(__I2S_CLKSOURCE__) | |||
/** @brief Macro to get the I2S clock source. | |||
* @retval The clock source can be one of the following values: | |||
* @arg @ref RCC_I2SCLKSOURCE_NONE No clock selected as I2S clock | |||
* @arg @ref RCC_I2SCLKSOURCE_PLL PLL "Q" selected as I2S clock | |||
* @arg @ref RCC_I2SCLKSOURCE_HSI HSI selected as I2S clock | |||
* @arg @ref RCC_I2SCLKSOURCE_PIN External clock selected as I2S clock | |||
*/ | |||
#define __HAL_RCC_GET_I2S_SOURCE() LL_RCC_GetI2SClockSource(LL_RCC_I2S_CLKSOURCE) | |||
#endif | |||
#if defined(SAI1) | |||
/** @brief Enable PLLSAI1RDY interrupt. | |||
* @retval None | |||
*/ | |||
@@ -1164,6 +1341,7 @@ typedef struct | |||
* @retval TRUE or FALSE. | |||
*/ | |||
#define __HAL_RCC_PLLSAI1_GET_FLAG() LL_RCC_PLLSAI1_IsReady() | |||
#endif | |||
/** | |||
* @brief Enable the RCC LSE CSS Extended Interrupt C1 Line. | |||
@@ -1275,6 +1453,7 @@ typedef struct | |||
*/ | |||
#define __HAL_RCC_LSECSS_EXTI_GENERATE_SWIT() LL_EXTI_GenerateSWI_0_31(RCC_EXTI_LINE_LSECSS) | |||
#if defined(CRS) | |||
/** | |||
* @brief Enable the specified CRS interrupts. | |||
* @param __INTERRUPT__ specifies the CRS interrupt sources to be enabled. | |||
@@ -1371,12 +1550,13 @@ typedef struct | |||
WRITE_REG(CRS->ICR, (__FLAG__)); \ | |||
} \ | |||
} while(0) | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
#if defined(CRS) | |||
/** @defgroup RCCEx_CRS_Extended_Features RCCEx CRS Extended Features | |||
* @{ | |||
*/ | |||
@@ -1421,6 +1601,7 @@ typedef struct | |||
/** | |||
* @} | |||
*/ | |||
#endif | |||
/** | |||
* @} | |||
@@ -1438,6 +1619,7 @@ typedef struct | |||
HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit); | |||
void HAL_RCCEx_GetPeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit); | |||
uint32_t HAL_RCCEx_GetPeriphCLKFreq(uint32_t PeriphClk); | |||
uint32_t HAL_RCCEx_GetRngCLKSource(void); | |||
/** | |||
* @} | |||
@@ -1447,8 +1629,10 @@ uint32_t HAL_RCCEx_GetPeriphCLKFreq(uint32_t PeriphClk); | |||
* @{ | |||
*/ | |||
#if defined(SAI1) | |||
HAL_StatusTypeDef HAL_RCCEx_EnablePLLSAI1(RCC_PLLSAI1InitTypeDef *PLLSAI1Init); | |||
HAL_StatusTypeDef HAL_RCCEx_DisablePLLSAI1(void); | |||
#endif | |||
void HAL_RCCEx_WakeUpStopCLKConfig(uint32_t WakeUpClk); | |||
@@ -1471,6 +1655,7 @@ HAL_StatusTypeDef HAL_RCCEx_TrimOsc(uint32_t OscillatorType); | |||
* @} | |||
*/ | |||
#if defined(CRS) | |||
/** @addtogroup RCCEx_Exported_Functions_Group3 | |||
@@ -1491,8 +1676,7 @@ void HAL_RCCEx_CRS_ErrorCallback(uint32_t Error); | |||
* @} | |||
*/ | |||
#endif /* CRS */ | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
@@ -176,7 +176,9 @@ typedef void (*pRNG_ReadyDataCallbackTypeDef)(RNG_HandleTypeDef *hrng, uint32_t | |||
#define HAL_RNG_ERROR_INVALID_CALLBACK 0x00000001U /*!< Invalid Callback error */ | |||
#endif /* USE_HAL_RNG_REGISTER_CALLBACKS */ | |||
#define HAL_RNG_ERROR_TIMEOUT 0x00000002U /*!< Timeout error */ | |||
#define HAL_RNG_ERROR_BUSY 0x00000004U /*!< Busy error */ | |||
#define HAL_RNG_ERROR_SEED 0x00000008U /*!< Seed error */ | |||
#define HAL_RNG_ERROR_CLOCK 0x00000010U /*!< Clock error */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -213,9 +213,13 @@ typedef enum | |||
HAL_RTC_ALARM_B_EVENT_CB_ID = 0x01U, /*!< RTC Alarm B Event Callback ID */ | |||
HAL_RTC_TIMESTAMP_EVENT_CB_ID = 0x02U, /*!< RTC TimeStamp Event Callback ID */ | |||
HAL_RTC_WAKEUPTIMER_EVENT_CB_ID = 0x03U, /*!< RTC WakeUp Timer Event Callback ID */ | |||
#if defined(RTC_TAMPER1_SUPPORT) | |||
HAL_RTC_TAMPER1_EVENT_CB_ID = 0x04U, /*!< RTC Tamper 1 Callback ID */ | |||
#endif | |||
HAL_RTC_TAMPER2_EVENT_CB_ID = 0x05U, /*!< RTC Tamper 2 Callback ID */ | |||
#if defined(RTC_TAMPER3_SUPPORT) | |||
HAL_RTC_TAMPER3_EVENT_CB_ID = 0x06U, /*!< RTC Tamper 3 Callback ID */ | |||
#endif | |||
HAL_RTC_MSPINIT_CB_ID = 0x0EU, /*!< RTC Msp Init callback ID */ | |||
HAL_RTC_MSPDEINIT_CB_ID = 0x0FU /*!< RTC Msp DeInit callback ID */ | |||
}HAL_RTC_CallbackIDTypeDef; | |||
@@ -731,44 +731,18 @@ typedef struct | |||
/**************************************************************************************************/ | |||
#if defined(RTC_TAMPER1_SUPPORT) && defined(RTC_TAMPER3_SUPPORT) | |||
/** | |||
* @brief Enable the RTC Tamper interrupt. | |||
* @param __HANDLE__ specifies the RTC handle. | |||
* @param __INTERRUPT__ specifies the RTC Tamper interrupt sources to be enabled. | |||
* This parameter can be any combination of the following values: | |||
* @arg RTC_IT_TAMP: All tampers interrupts | |||
* @arg RTC_IT_TAMP1: Tamper1 interrupt | |||
* @arg RTC_IT_TAMP2: Tamper2 interrupt | |||
* @arg RTC_IT_TAMP3: Tamper3 interrupt | |||
* @retval None | |||
*/ | |||
#define __HAL_RTC_TAMPER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->TAMPCR |= (__INTERRUPT__)) | |||
/** | |||
* @brief Disable the RTC Tamper interrupt. | |||
* @param __HANDLE__ specifies the RTC handle. | |||
* @param __INTERRUPT__ specifies the RTC Tamper interrupt sources to be disabled. | |||
* This parameter can be any combination of the following values: | |||
* @arg RTC_IT_TAMP: All tampers interrupts | |||
* @arg RTC_IT_TAMP1: Tamper1 interrupt | |||
* @arg RTC_IT_TAMP2: Tamper2 interrupt | |||
* @arg RTC_IT_TAMP3: Tamper3 interrupt | |||
* @retval None | |||
*/ | |||
#define __HAL_RTC_TAMPER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->TAMPCR &= ~(__INTERRUPT__)) | |||
#elif defined(RTC_TAMPER1_SUPPORT) | |||
/** | |||
* @brief Enable the RTC Tamper interrupt. | |||
* @param __HANDLE__ specifies the RTC handle. | |||
* @param __INTERRUPT__ specifies the RTC Tamper interrupt sources to be enabled. | |||
* This parameter can be any combination of the following values: | |||
* @arg RTC_IT_TAMP: All tampers interrupts | |||
* @arg RTC_IT_TAMP1: Tamper1 interrupt | |||
* @arg RTC_IT_TAMP1: Tamper1 interrupt (*) | |||
* @arg RTC_IT_TAMP2: Tamper2 interrupt | |||
* @arg RTC_IT_TAMP3: Tamper3 interrupt (*) | |||
* | |||
* (*) Value not defined in all devices. \n | |||
* | |||
* @retval None | |||
*/ | |||
#define __HAL_RTC_TAMPER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->TAMPCR |= (__INTERRUPT__)) | |||
@@ -778,181 +752,54 @@ typedef struct | |||
* @param __HANDLE__ specifies the RTC handle. | |||
* @param __INTERRUPT__ specifies the RTC Tamper interrupt sources to be disabled. | |||
* This parameter can be any combination of the following values: | |||
* @arg RTC_IT_TAMP: All tampers interrupts | |||
* @arg RTC_IT_TAMP1: Tamper1 interrupt | |||
* @arg RTC_IT_TAMP2: Tamper2 interrupt | |||
* @retval None | |||
*/ | |||
#define __HAL_RTC_TAMPER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->TAMPCR &= ~(__INTERRUPT__)) | |||
#elif defined(RTC_TAMPER3_SUPPORT) | |||
/** | |||
* @brief Enable the RTC Tamper interrupt. | |||
* @param __HANDLE__ specifies the RTC handle. | |||
* @param __INTERRUPT__ specifies the RTC Tamper interrupt sources to be enabled. | |||
* This parameter can be any combination of the following values: | |||
* @arg RTC_IT_TAMP: All tampers interrupts | |||
* @arg RTC_IT_TAMP1: Tamper1 interrupt (*) | |||
* @arg RTC_IT_TAMP2: Tamper2 interrupt | |||
* @arg RTC_IT_TAMP3: Tamper3 interrupt | |||
* @retval None | |||
*/ | |||
#define __HAL_RTC_TAMPER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->TAMPCR |= (__INTERRUPT__)) | |||
/** | |||
* @brief Disable the RTC Tamper interrupt. | |||
* @param __HANDLE__ specifies the RTC handle. | |||
* @param __INTERRUPT__ specifies the RTC Tamper interrupt sources to be disabled. | |||
* This parameter can be any combination of the following values: | |||
* @arg RTC_IT_TAMP: All tampers interrupts | |||
* @arg RTC_IT_TAMP2: Tamper2 interrupt | |||
* @arg RTC_IT_TAMP3: Tamper3 interrupt | |||
* @arg RTC_IT_TAMP3: Tamper3 interrupt (*) | |||
* | |||
* (*) Value not defined in all devices. \n | |||
* | |||
* @retval None | |||
*/ | |||
#define __HAL_RTC_TAMPER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->TAMPCR &= ~(__INTERRUPT__)) | |||
#endif | |||
/**************************************************************************************************/ | |||
#if defined(RTC_TAMPER1_SUPPORT) && defined(RTC_TAMPER3_SUPPORT) | |||
/** | |||
* @brief Check whether the specified RTC Tamper interrupt has occurred or not. | |||
* @param __HANDLE__ specifies the RTC handle. | |||
* @param __INTERRUPT__ specifies the RTC Tamper interrupt to check. | |||
* This parameter can be: | |||
* @arg RTC_IT_TAMP1: Tamper1 interrupt | |||
* @arg RTC_IT_TAMP2: Tamper2 interrupt | |||
* @arg RTC_IT_TAMP3: Tamper3 interrupt | |||
* @arg RTC_IT_TAMP1: Tamper1 interrupt (*) | |||
* @arg RTC_IT_TAMP2: Tamper2 interrupt | |||
* @arg RTC_IT_TAMP3: Tamper3 interrupt (*) | |||
* | |||
* (*) Value not defined in all devices. \n | |||
* | |||
* @retval None | |||
*/ | |||
#if defined(RTC_TAMPER1_SUPPORT) && defined(RTC_TAMPER3_SUPPORT) | |||
#define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) (((__INTERRUPT__) == RTC_IT_TAMP1) ? (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 3U)) != 0U) ? 1U : 0U) : \ | |||
((__INTERRUPT__) == RTC_IT_TAMP2) ? (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 5U)) != 0U) ? 1U : 0U) : \ | |||
((__INTERRUPT__) == RTC_IT_TAMP3) ? (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 7U)) != 0U) ? 1U : 0U)) | |||
#elif defined(RTC_TAMPER1_SUPPORT) | |||
/** | |||
* @brief Check whether the specified RTC Tamper interrupt has occurred or not. | |||
* @param __HANDLE__ specifies the RTC handle. | |||
* @param __INTERRUPT__ specifies the RTC Tamper interrupt to check. | |||
* This parameter can be: | |||
* @arg RTC_IT_TAMP1: Tamper1 interrupt | |||
* @arg RTC_IT_TAMP2: Tamper2 interrupt | |||
* @retval None | |||
*/ | |||
#define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) (((__INTERRUPT__) == RTC_IT_TAMP1) ? (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 3U)) != 0U) ? 1U : 0U) : \ | |||
((__INTERRUPT__) == RTC_IT_TAMP2) ? (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 5U)) != 0U) ? 1U : 0U)) | |||
#elif defined(RTC_TAMPER3_SUPPORT) | |||
/** | |||
* @brief Check whether the specified RTC Tamper interrupt has occurred or not. | |||
* @param __HANDLE__ specifies the RTC handle. | |||
* @param __INTERRUPT__ specifies the RTC Tamper interrupt to check. | |||
* This parameter can be: | |||
* @arg RTC_IT_TAMP2: Tamper2 interrupt | |||
* @arg RTC_IT_TAMP3: Tamper3 interrupt | |||
* @retval None | |||
*/ | |||
#define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) (((__INTERRUPT__) == RTC_IT_TAMP2) ? (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 5U)) != 0U) ? 1U : 0U) : \ | |||
((__INTERRUPT__) == RTC_IT_TAMP3) ? (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 7U)) != 0U) ? 1U : 0U)) | |||
#else | |||
#define __HAL_RTC_TAMPER_GET_IT(__HANDLE__, __INTERRUPT__) (((__INTERRUPT__) == RTC_IT_TAMP1) ? (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 3U)) != 0U) ? 1U : 0U)) | |||
#endif | |||
/**************************************************************************************************/ | |||
#if defined(RTC_TAMPER1_SUPPORT) && defined(RTC_TAMPER3_SUPPORT) | |||
/** | |||
* @brief Check whether the specified RTC Tamper interrupt has been enabled or not. | |||
* @param __HANDLE__ specifies the RTC handle. | |||
* @param __INTERRUPT__ specifies the RTC Tamper interrupt source to check. | |||
* This parameter can be: | |||
* @arg RTC_IT_TAMP: All tampers interrupts | |||
* @arg RTC_IT_TAMP1: Tamper1 interrupt | |||
* @arg RTC_IT_TAMP2: Tamper2 interrupt | |||
* @arg RTC_IT_TAMP3: Tamper3 interrupt | |||
* @retval None | |||
*/ | |||
#define __HAL_RTC_TAMPER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->TAMPCR) & (__INTERRUPT__)) != 0U) ? 1U : 0U) | |||
/** | |||
* @brief Get the selected RTC Tamper's flag status. | |||
* @param __HANDLE__ specifies the RTC handle. | |||
* @param __FLAG__ specifies the RTC Tamper Flag is pending or not. | |||
* This parameter can be: | |||
* @arg RTC_FLAG_TAMP1F: Tamper1 flag | |||
* @arg RTC_FLAG_TAMP2F: Tamper2 flag | |||
* @arg RTC_FLAG_TAMP3F: Tamper3 flag | |||
* @retval None | |||
*/ | |||
#define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != 0U) ? 1U : 0U) | |||
/** | |||
* @brief Clear the RTC Tamper's pending flags. | |||
* @param __HANDLE__ specifies the RTC handle. | |||
* @param __FLAG__ specifies the RTC Tamper Flag to clear. | |||
* This parameter can be: | |||
* @arg RTC_FLAG_TAMP1F: Tamper1 flag | |||
* @arg RTC_FLAG_TAMP2F: Tamper2 flag | |||
* @arg RTC_FLAG_TAMP3F: Tamper3 flag | |||
* @retval None | |||
*/ | |||
#define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) | |||
#elif defined(RTC_TAMPER1_SUPPORT) | |||
/** | |||
* @brief Check whether the specified RTC Tamper interrupt has been enabled or not. | |||
* @param __HANDLE__ specifies the RTC handle. | |||
* @param __INTERRUPT__ specifies the RTC Tamper interrupt source to check. | |||
* This parameter can be: | |||
* @arg RTC_IT_TAMP: All tampers interrupts | |||
* @arg RTC_IT_TAMP1: Tamper1 interrupt | |||
* @arg RTC_IT_TAMP2: Tamper2 interrupt | |||
* @retval None | |||
*/ | |||
#define __HAL_RTC_TAMPER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->TAMPCR) & (__INTERRUPT__)) != 0U) ? 1U : 0U) | |||
/** | |||
* @brief Get the selected RTC Tamper's flag status. | |||
* @param __HANDLE__ specifies the RTC handle. | |||
* @param __FLAG__ specifies the RTC Tamper Flag is pending or not. | |||
* This parameter can be: | |||
* @arg RTC_FLAG_TAMP1F: Tamper1 flag | |||
* @arg RTC_FLAG_TAMP2F: Tamper2 flag | |||
* @retval None | |||
*/ | |||
#define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != 0U) ? 1U : 0U) | |||
/** | |||
* @brief Clear the RTC Tamper's pending flags. | |||
* @param __HANDLE__ specifies the RTC handle. | |||
* @param __FLAG__ specifies the RTC Tamper Flag to clear. | |||
* This parameter can be: | |||
* @arg RTC_FLAG_TAMP1F: Tamper1 flag | |||
* @arg RTC_FLAG_TAMP2F: Tamper2 flag | |||
* @retval None | |||
*/ | |||
#define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) | |||
#elif defined(RTC_TAMPER3_SUPPORT) | |||
/** | |||
* @brief Check whether the specified RTC Tamper interrupt has been enabled or not. | |||
* @param __HANDLE__ specifies the RTC handle. | |||
* @param __INTERRUPT__ specifies the RTC Tamper interrupt source to check. | |||
* This parameter can be: | |||
* @arg RTC_IT_TAMP: All tampers interrupts | |||
* @arg RTC_IT_TAMP2: Tamper2 interrupt | |||
* @arg RTC_IT_TAMP3: Tamper3 interrupt | |||
* @arg RTC_IT_TAMP1: Tamper1 interrupt (*) | |||
* @arg RTC_IT_TAMP2: Tamper2 interrupt | |||
* @arg RTC_IT_TAMP3: Tamper3 interrupt (*) | |||
* | |||
* (*) Value not defined in all devices. \n | |||
* | |||
* @retval None | |||
*/ | |||
#define __HAL_RTC_TAMPER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->TAMPCR) & (__INTERRUPT__)) != 0U) ? 1U : 0U) | |||
@@ -963,8 +810,12 @@ typedef struct | |||
* @param __HANDLE__ specifies the RTC handle. | |||
* @param __FLAG__ specifies the RTC Tamper Flag is pending or not. | |||
* This parameter can be: | |||
* @arg RTC_FLAG_TAMP1F: Tamper1 flag (*) | |||
* @arg RTC_FLAG_TAMP2F: Tamper2 flag | |||
* @arg RTC_FLAG_TAMP3F: Tamper3 flag | |||
* @arg RTC_FLAG_TAMP3F: Tamper3 flag (*) | |||
* | |||
* (*) Value not defined in all devices. \n | |||
* | |||
* @retval None | |||
*/ | |||
#define __HAL_RTC_TAMPER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != 0U) ? 1U : 0U) | |||
@@ -974,14 +825,16 @@ typedef struct | |||
* @param __HANDLE__ specifies the RTC handle. | |||
* @param __FLAG__ specifies the RTC Tamper Flag to clear. | |||
* This parameter can be: | |||
* @arg RTC_FLAG_TAMP1F: Tamper1 flag (*) | |||
* @arg RTC_FLAG_TAMP2F: Tamper2 flag | |||
* @arg RTC_FLAG_TAMP3F: Tamper3 flag | |||
* @arg RTC_FLAG_TAMP3F: Tamper3 flag (*) | |||
* | |||
* (*) Value not defined in all devices. \n | |||
* | |||
* @retval None | |||
*/ | |||
#define __HAL_RTC_TAMPER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~((__FLAG__) | RTC_ISR_INIT)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT)) | |||
#endif | |||
/**************************************************************************************************/ | |||
@@ -1332,31 +1185,18 @@ HAL_StatusTypeDef HAL_RTCEx_PollForAlarmBEvent(RTC_HandleTypeDef *hrtc, uint32_t | |||
#define RTC_TAMPCR_TAMPXIE ((uint32_t) (RTC_TAMPER1_INTERRUPT | RTC_TAMPER2_INTERRUPT | \ | |||
RTC_TAMPER3_INTERRUPT | RTC_ALL_TAMPER_INTERRUPT)) | |||
#elif defined(RTC_TAMPER1_SUPPORT) | |||
#else | |||
#define RTC_FLAGS_MASK ((uint32_t) (RTC_FLAG_RECALPF | RTC_FLAG_TAMP2F | RTC_FLAG_TAMP1F| \ | |||
#define RTC_FLAGS_MASK ((uint32_t) (RTC_FLAG_RECALPF | RTC_FLAG_TAMP2F | \ | |||
RTC_FLAG_TSOVF | RTC_FLAG_TSF | RTC_FLAG_WUTF | \ | |||
RTC_FLAG_ALRBF | RTC_FLAG_ALRAF | \ | |||
RTC_FLAG_INITF | RTC_FLAG_RSF | RTC_FLAG_INITS | \ | |||
RTC_FLAG_SHPF | RTC_FLAG_WUTWF |RTC_FLAG_ALRBWF | \ | |||
RTC_FLAG_ALRAWF)) | |||
#define RTC_TAMPCR_TAMPXE ((uint32_t) (RTC_TAMPCR_TAMP2E | RTC_TAMPCR_TAMP1E)) | |||
#define RTC_TAMPCR_TAMPXIE ((uint32_t) (RTC_TAMPER1_INTERRUPT | RTC_TAMPER2_INTERRUPT | \ | |||
RTC_ALL_TAMPER_INTERRUPT)) | |||
#elif defined(RTC_TAMPER3_SUPPORT) | |||
#define RTC_FLAGS_MASK ((uint32_t) (RTC_FLAG_RECALPF | RTC_FLAG_TAMP3F | RTC_FLAG_TAMP2F | \ | |||
RTC_FLAG_TSOVF | RTC_FLAG_TSF | \ | |||
RTC_FLAG_WUTF | RTC_FLAG_ALRBF | RTC_FLAG_ALRAF | \ | |||
RTC_FLAG_INITF | RTC_FLAG_RSF | \ | |||
RTC_FLAG_INITS | RTC_FLAG_SHPF | RTC_FLAG_WUTWF | \ | |||
RTC_FLAG_ALRBWF | RTC_FLAG_ALRAWF)) | |||
#define RTC_TAMPCR_TAMPXE ((uint32_t) (RTC_TAMPCR_TAMP2E)) | |||
#define RTC_TAMPCR_TAMPXIE ((uint32_t) (RTC_TAMPER2_INTERRUPT | RTC_ALL_TAMPER_INTERRUPT)) | |||
#define RTC_TAMPCR_TAMPXE ((uint32_t) (RTC_TAMPCR_TAMP3E | RTC_TAMPCR_TAMP2E)) | |||
#define RTC_TAMPCR_TAMPXIE ((uint32_t) (RTC_TAMPER2_INTERRUPT | \ | |||
RTC_TAMPER3_INTERRUPT | RTC_ALL_TAMPER_INTERRUPT)) | |||
#endif | |||
#define RTC_EXTI_LINE_TAMPER_TIMESTAMP_EVENT (EXTI_IMR1_IM18) /*!< External interrupt line 18 Connected to the RTC Tamper and Time Stamp events */ | |||
@@ -32,6 +32,8 @@ extern "C" { | |||
* @{ | |||
*/ | |||
#if defined (SAI1) | |||
/** @addtogroup SAI | |||
* @{ | |||
*/ | |||
@@ -153,6 +155,7 @@ typedef struct | |||
/** @defgroup SAI_Frame_Structure_definition SAI Frame Structure definition | |||
* @brief SAI Frame Init structure definition | |||
* @note For SPDIF and AC97 protocol, these parameters are not used (set by hardware). | |||
* @{ | |||
*/ | |||
typedef struct | |||
@@ -185,6 +188,8 @@ typedef struct | |||
/** @defgroup SAI_Slot_Structure_definition SAI Slot Structure definition | |||
* @brief SAI Block Slot Init Structure definition | |||
* @note For SPDIF protocol, these parameters are not used (set by hardware). | |||
* @note For AC97 protocol, only SlotActive parameter is used (the others are set by hardware). | |||
* @{ | |||
*/ | |||
typedef struct | |||
@@ -948,6 +953,8 @@ uint32_t HAL_SAI_GetError(SAI_HandleTypeDef *hsai); | |||
* @} | |||
*/ | |||
#endif /* SAI1 */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -32,6 +32,8 @@ extern "C" { | |||
* @{ | |||
*/ | |||
#if defined (SAI1) | |||
/** @addtogroup SAIEx | |||
* @{ | |||
*/ | |||
@@ -92,10 +94,11 @@ HAL_StatusTypeDef HAL_SAIEx_ConfigPdmMicDelay(SAI_HandleTypeDef *hsai, SAIEx_Pdm | |||
* @} | |||
*/ | |||
#endif /* SAI1 */ | |||
/** | |||
* @} | |||
*/ | |||
#ifdef __cplusplus | |||
} | |||
#endif | |||
@@ -383,7 +383,8 @@ typedef void (*pSPI_CallbackTypeDef)(SPI_HandleTypeDef *hspi); /*!< pointer to | |||
#define SPI_FLAG_FRE SPI_SR_FRE /* SPI Error flag: TI mode frame format error flag */ | |||
#define SPI_FLAG_FTLVL SPI_SR_FTLVL /* SPI fifo transmission level */ | |||
#define SPI_FLAG_FRLVL SPI_SR_FRLVL /* SPI fifo reception level */ | |||
#define SPI_FLAG_MASK (SPI_SR_RXNE | SPI_SR_TXE | SPI_SR_BSY | SPI_SR_CRCERR | SPI_SR_MODF | SPI_SR_OVR | SPI_SR_FRE | SPI_SR_FTLVL | SPI_SR_FRLVL) | |||
#define SPI_FLAG_MASK (SPI_SR_RXNE | SPI_SR_TXE | SPI_SR_BSY | SPI_SR_CRCERR\ | |||
| SPI_SR_MODF | SPI_SR_OVR | SPI_SR_FRE | SPI_SR_FTLVL | SPI_SR_FRLVL) | |||
/** | |||
* @} | |||
*/ | |||
@@ -433,7 +434,7 @@ typedef void (*pSPI_CallbackTypeDef)(SPI_HandleTypeDef *hspi); /*!< pointer to | |||
} while(0) | |||
#else | |||
#define __HAL_SPI_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_SPI_STATE_RESET) | |||
#endif | |||
#endif /* USE_HAL_SPI_REGISTER_CALLBACKS */ | |||
/** @brief Enable the specified SPI interrupts. | |||
* @param __HANDLE__ specifies the SPI Handle. | |||
@@ -469,7 +470,8 @@ typedef void (*pSPI_CallbackTypeDef)(SPI_HandleTypeDef *hspi); /*!< pointer to | |||
* @arg SPI_IT_ERR: Error interrupt enable | |||
* @retval The new state of __IT__ (TRUE or FALSE). | |||
*/ | |||
#define __HAL_SPI_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->CR2 & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET) | |||
#define __HAL_SPI_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->CR2\ | |||
& (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET) | |||
/** @brief Check whether the specified SPI flag is set or not. | |||
* @param __HANDLE__ specifies the SPI Handle. | |||
@@ -529,9 +531,9 @@ typedef void (*pSPI_CallbackTypeDef)(SPI_HandleTypeDef *hspi); /*!< pointer to | |||
*/ | |||
#define __HAL_SPI_CLEAR_FREFLAG(__HANDLE__) \ | |||
do{ \ | |||
__IO uint32_t tmpreg_fre = 0x00U; \ | |||
tmpreg_fre = (__HANDLE__)->Instance->SR; \ | |||
UNUSED(tmpreg_fre); \ | |||
__IO uint32_t tmpreg_fre = 0x00U; \ | |||
tmpreg_fre = (__HANDLE__)->Instance->SR; \ | |||
UNUSED(tmpreg_fre); \ | |||
}while(0U) | |||
/** @brief Enable the SPI peripheral. | |||
@@ -167,7 +167,7 @@ typedef struct | |||
This parameter can be a value of @ref TIM_Encoder_Mode */ | |||
uint32_t IC1Polarity; /*!< Specifies the active edge of the input signal. | |||
This parameter can be a value of @ref TIM_Input_Capture_Polarity */ | |||
This parameter can be a value of @ref TIM_Encoder_Input_Polarity */ | |||
uint32_t IC1Selection; /*!< Specifies the input. | |||
This parameter can be a value of @ref TIM_Input_Capture_Selection */ | |||
@@ -179,7 +179,7 @@ typedef struct | |||
This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */ | |||
uint32_t IC2Polarity; /*!< Specifies the active edge of the input signal. | |||
This parameter can be a value of @ref TIM_Input_Capture_Polarity */ | |||
This parameter can be a value of @ref TIM_Encoder_Input_Polarity */ | |||
uint32_t IC2Selection; /*!< Specifies the input. | |||
This parameter can be a value of @ref TIM_Input_Capture_Selection */ | |||
@@ -235,7 +235,12 @@ typedef struct | |||
uint32_t MasterOutputTrigger2; /*!< Trigger output2 (TRGO2) selection | |||
This parameter can be a value of @ref TIM_Master_Mode_Selection_2 */ | |||
uint32_t MasterSlaveMode; /*!< Master/slave mode selection | |||
This parameter can be a value of @ref TIM_Master_Slave_Mode */ | |||
This parameter can be a value of @ref TIM_Master_Slave_Mode | |||
@note When the Master/slave mode is enabled, the effect of | |||
an event on the trigger input (TRGI) is delayed to allow a | |||
perfect synchronization between the current timer and its | |||
slaves (through TRGO). It is not mandatory in case of timer | |||
synchronization mode. */ | |||
} TIM_MasterConfigTypeDef; | |||
/** | |||
@@ -518,6 +523,15 @@ typedef void (*pTIM_CallbackTypeDef)(TIM_HandleTypeDef *htim); /*!< pointer to | |||
* @} | |||
*/ | |||
/** @defgroup TIM_Update_Interrupt_Flag_Remap TIM Update Interrupt Flag Remap | |||
* @{ | |||
*/ | |||
#define TIM_UIFREMAP_DISABLE 0x00000000U /*!< Update interrupt flag remap disabled */ | |||
#define TIM_UIFREMAP_ENABLE TIM_CR1_UIFREMAP /*!< Update interrupt flag remap enabled */ | |||
/** | |||
* @} | |||
*/ | |||
/** @defgroup TIM_ClockDivision TIM Clock Division | |||
* @{ | |||
*/ | |||
@@ -611,6 +625,15 @@ typedef void (*pTIM_CallbackTypeDef)(TIM_HandleTypeDef *htim); /*!< pointer to | |||
* @} | |||
*/ | |||
/** @defgroup TIM_Encoder_Input_Polarity TIM Encoder Input Polarity | |||
* @{ | |||
*/ | |||
#define TIM_ENCODERINPUTPOLARITY_RISING TIM_INPUTCHANNELPOLARITY_RISING /*!< Encoder input with rising edge polarity */ | |||
#define TIM_ENCODERINPUTPOLARITY_FALLING TIM_INPUTCHANNELPOLARITY_FALLING /*!< Encoder input with falling edge polarity */ | |||
/** | |||
* @} | |||
*/ | |||
/** @defgroup TIM_Input_Capture_Selection TIM Input Capture Selection | |||
* @{ | |||
*/ | |||
@@ -1298,6 +1321,31 @@ typedef void (*pTIM_CallbackTypeDef)(TIM_HandleTypeDef *htim); /*!< pointer to | |||
*/ | |||
#define __HAL_TIM_CLEAR_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->SR = ~(__INTERRUPT__)) | |||
/** | |||
* @brief Force a continuous copy of the update interrupt flag (UIF) into the timer counter register (bit 31). | |||
* @note This allows both the counter value and a potential roll-over condition signalled by the UIFCPY flag to be read in an atomic way. | |||
* @param __HANDLE__ TIM handle. | |||
* @retval None | |||
mode. | |||
*/ | |||
#define __HAL_TIM_UIFREMAP_ENABLE(__HANDLE__) (((__HANDLE__)->Instance->CR1 |= TIM_CR1_UIFREMAP)) | |||
/** | |||
* @brief Disable update interrupt flag (UIF) remapping. | |||
* @param __HANDLE__ TIM handle. | |||
* @retval None | |||
mode. | |||
*/ | |||
#define __HAL_TIM_UIFREMAP_DISABLE(__HANDLE__) (((__HANDLE__)->Instance->CR1 &= ~TIM_CR1_UIFREMAP)) | |||
/** | |||
* @brief Get update interrupt flag (UIF) copy status. | |||
* @param __COUNTER__ Counter value. | |||
* @retval The state of UIFCPY (TRUE or FALSE). | |||
mode. | |||
*/ | |||
#define __HAL_TIM_GET_UIFCPY(__COUNTER__) (((__COUNTER__) & (TIM_CNT_UIFCPY)) == (TIM_CNT_UIFCPY)) | |||
/** | |||
* @brief Indicates whether or not the TIM Counter is used as downcounter. | |||
* @param __HANDLE__ TIM handle. | |||
@@ -1317,6 +1365,8 @@ mode. | |||
/** | |||
* @brief Set the TIM Counter Register value on runtime. | |||
* Note Please check if the bit 31 of CNT register is used as UIF copy or not, this may affect the counter range in case of 32 bits counter TIM instance. | |||
* Bit 31 of CNT can be enabled/disabled using __HAL_TIM_UIFREMAP_ENABLE()/__HAL_TIM_UIFREMAP_DISABLE() macros. | |||
* @param __HANDLE__ TIM handle. | |||
* @param __COUNTER__ specifies the Counter register new value. | |||
* @retval None | |||
@@ -1498,12 +1548,62 @@ mode. | |||
* @retval None | |||
*/ | |||
#define __HAL_TIM_DISABLE_OCxPRELOAD(__HANDLE__, __CHANNEL__) \ | |||
(((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 &= (uint16_t)~TIM_CCMR1_OC1PE) :\ | |||
((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 &= (uint16_t)~TIM_CCMR1_OC2PE) :\ | |||
((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 &= (uint16_t)~TIM_CCMR2_OC3PE) :\ | |||
((__CHANNEL__) == TIM_CHANNEL_4) ? ((__HANDLE__)->Instance->CCMR2 &= (uint16_t)~TIM_CCMR2_OC4PE) :\ | |||
((__CHANNEL__) == TIM_CHANNEL_5) ? ((__HANDLE__)->Instance->CCMR3 &= (uint16_t)~TIM_CCMR3_OC5PE) :\ | |||
((__HANDLE__)->Instance->CCMR3 &= (uint16_t)~TIM_CCMR3_OC6PE)) | |||
(((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 &= ~TIM_CCMR1_OC1PE) :\ | |||
((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 &= ~TIM_CCMR1_OC2PE) :\ | |||
((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 &= ~TIM_CCMR2_OC3PE) :\ | |||
((__CHANNEL__) == TIM_CHANNEL_4) ? ((__HANDLE__)->Instance->CCMR2 &= ~TIM_CCMR2_OC4PE) :\ | |||
((__CHANNEL__) == TIM_CHANNEL_5) ? ((__HANDLE__)->Instance->CCMR3 &= ~TIM_CCMR3_OC5PE) :\ | |||
((__HANDLE__)->Instance->CCMR3 &= ~TIM_CCMR3_OC6PE)) | |||
/** | |||
* @brief Enable fast mode for a given channel. | |||
* @param __HANDLE__ TIM handle. | |||
* @param __CHANNEL__ TIM Channels to be configured. | |||
* This parameter can be one of the following values: | |||
* @arg TIM_CHANNEL_1: TIM Channel 1 selected | |||
* @arg TIM_CHANNEL_2: TIM Channel 2 selected | |||
* @arg TIM_CHANNEL_3: TIM Channel 3 selected | |||
* @arg TIM_CHANNEL_4: TIM Channel 4 selected | |||
* @arg TIM_CHANNEL_5: TIM Channel 5 selected | |||
* @arg TIM_CHANNEL_6: TIM Channel 6 selected | |||
* @note When fast mode is enabled an active edge on the trigger input acts | |||
* like a compare match on CCx output. Delay to sample the trigger | |||
* input and to activate CCx output is reduced to 3 clock cycles. | |||
* @note Fast mode acts only if the channel is configured in PWM1 or PWM2 mode. | |||
* @retval None | |||
*/ | |||
#define __HAL_TIM_ENABLE_OCxFAST(__HANDLE__, __CHANNEL__) \ | |||
(((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 |= TIM_CCMR1_OC1FE) :\ | |||
((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 |= TIM_CCMR1_OC2FE) :\ | |||
((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 |= TIM_CCMR2_OC3FE) :\ | |||
((__CHANNEL__) == TIM_CHANNEL_4) ? ((__HANDLE__)->Instance->CCMR2 |= TIM_CCMR2_OC4FE) :\ | |||
((__CHANNEL__) == TIM_CHANNEL_5) ? ((__HANDLE__)->Instance->CCMR3 |= TIM_CCMR3_OC5FE) :\ | |||
((__HANDLE__)->Instance->CCMR3 |= TIM_CCMR3_OC6FE)) | |||
/** | |||
* @brief Disable fast mode for a given channel. | |||
* @param __HANDLE__ TIM handle. | |||
* @param __CHANNEL__ TIM Channels to be configured. | |||
* This parameter can be one of the following values: | |||
* @arg TIM_CHANNEL_1: TIM Channel 1 selected | |||
* @arg TIM_CHANNEL_2: TIM Channel 2 selected | |||
* @arg TIM_CHANNEL_3: TIM Channel 3 selected | |||
* @arg TIM_CHANNEL_4: TIM Channel 4 selected | |||
* @arg TIM_CHANNEL_5: TIM Channel 5 selected | |||
* @arg TIM_CHANNEL_6: TIM Channel 6 selected | |||
* @note When fast mode is disabled CCx output behaves normally depending | |||
* on counter and CCRx values even when the trigger is ON. The minimum | |||
* delay to activate CCx output when an active edge occurs on the | |||
* trigger input is 5 clock cycles. | |||
* @retval None | |||
*/ | |||
#define __HAL_TIM_DISABLE_OCxFAST(__HANDLE__, __CHANNEL__) \ | |||
(((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 &= ~TIM_CCMR1_OC1FE) :\ | |||
((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 &= ~TIM_CCMR1_OC2FE) :\ | |||
((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 &= ~TIM_CCMR2_OC3FE) :\ | |||
((__CHANNEL__) == TIM_CHANNEL_4) ? ((__HANDLE__)->Instance->CCMR2 &= ~TIM_CCMR2_OC4FE) :\ | |||
((__CHANNEL__) == TIM_CHANNEL_5) ? ((__HANDLE__)->Instance->CCMR3 &= ~TIM_CCMR3_OC5FE) :\ | |||
((__HANDLE__)->Instance->CCMR3 &= ~TIM_CCMR3_OC6FE)) | |||
/** | |||
* @brief Set the Update Request Source (URS) bit of the TIMx_CR1 register. | |||
@@ -1576,29 +1676,29 @@ mode. | |||
((__MODE__) == TIM_CLEARINPUTSOURCE_COMP2) || \ | |||
((__MODE__) == TIM_CLEARINPUTSOURCE_NONE)) | |||
#define IS_TIM_DMA_BASE(__BASE__) (((__BASE__) == TIM_DMABASE_CR1) || \ | |||
((__BASE__) == TIM_DMABASE_CR2) || \ | |||
((__BASE__) == TIM_DMABASE_SMCR) || \ | |||
((__BASE__) == TIM_DMABASE_DIER) || \ | |||
((__BASE__) == TIM_DMABASE_SR) || \ | |||
((__BASE__) == TIM_DMABASE_EGR) || \ | |||
((__BASE__) == TIM_DMABASE_CCMR1) || \ | |||
((__BASE__) == TIM_DMABASE_CCMR2) || \ | |||
((__BASE__) == TIM_DMABASE_CCER) || \ | |||
((__BASE__) == TIM_DMABASE_CNT) || \ | |||
((__BASE__) == TIM_DMABASE_PSC) || \ | |||
((__BASE__) == TIM_DMABASE_ARR) || \ | |||
((__BASE__) == TIM_DMABASE_RCR) || \ | |||
((__BASE__) == TIM_DMABASE_CCR1) || \ | |||
((__BASE__) == TIM_DMABASE_CCR2) || \ | |||
((__BASE__) == TIM_DMABASE_CCR3) || \ | |||
((__BASE__) == TIM_DMABASE_CCR4) || \ | |||
((__BASE__) == TIM_DMABASE_BDTR) || \ | |||
((__BASE__) == TIM_DMABASE_OR) || \ | |||
((__BASE__) == TIM_DMABASE_CCMR3) || \ | |||
((__BASE__) == TIM_DMABASE_CCR5) || \ | |||
((__BASE__) == TIM_DMABASE_CCR6) || \ | |||
((__BASE__) == TIM_DMABASE_AF1) || \ | |||
#define IS_TIM_DMA_BASE(__BASE__) (((__BASE__) == TIM_DMABASE_CR1) || \ | |||
((__BASE__) == TIM_DMABASE_CR2) || \ | |||
((__BASE__) == TIM_DMABASE_SMCR) || \ | |||
((__BASE__) == TIM_DMABASE_DIER) || \ | |||
((__BASE__) == TIM_DMABASE_SR) || \ | |||
((__BASE__) == TIM_DMABASE_EGR) || \ | |||
((__BASE__) == TIM_DMABASE_CCMR1) || \ | |||
((__BASE__) == TIM_DMABASE_CCMR2) || \ | |||
((__BASE__) == TIM_DMABASE_CCER) || \ | |||
((__BASE__) == TIM_DMABASE_CNT) || \ | |||
((__BASE__) == TIM_DMABASE_PSC) || \ | |||
((__BASE__) == TIM_DMABASE_ARR) || \ | |||
((__BASE__) == TIM_DMABASE_RCR) || \ | |||
((__BASE__) == TIM_DMABASE_CCR1) || \ | |||
((__BASE__) == TIM_DMABASE_CCR2) || \ | |||
((__BASE__) == TIM_DMABASE_CCR3) || \ | |||
((__BASE__) == TIM_DMABASE_CCR4) || \ | |||
((__BASE__) == TIM_DMABASE_BDTR) || \ | |||
((__BASE__) == TIM_DMABASE_OR) || \ | |||
((__BASE__) == TIM_DMABASE_CCMR3) || \ | |||
((__BASE__) == TIM_DMABASE_CCR5) || \ | |||
((__BASE__) == TIM_DMABASE_CCR6) || \ | |||
((__BASE__) == TIM_DMABASE_AF1) || \ | |||
((__BASE__) == TIM_DMABASE_AF2)) | |||
#define IS_TIM_EVENT_SOURCE(__SOURCE__) ((((__SOURCE__) & 0xFFFFFE00U) == 0x00000000U) && ((__SOURCE__) != 0x00000000U)) | |||
@@ -1609,6 +1709,9 @@ mode. | |||
((__MODE__) == TIM_COUNTERMODE_CENTERALIGNED2) || \ | |||
((__MODE__) == TIM_COUNTERMODE_CENTERALIGNED3)) | |||
#define IS_TIM_UIFREMAP_MODE(__MODE__) (((__MODE__) == TIM_UIFREMAP_DISABLE) || \ | |||
((__MODE__) == TIM_UIFREMAP_ENALE)) | |||
#define IS_TIM_CLOCKDIVISION_DIV(__DIV__) (((__DIV__) == TIM_CLOCKDIVISION_DIV1) || \ | |||
((__DIV__) == TIM_CLOCKDIVISION_DIV2) || \ | |||
((__DIV__) == TIM_CLOCKDIVISION_DIV4)) | |||
@@ -1631,6 +1734,9 @@ mode. | |||
#define IS_TIM_OCNIDLE_STATE(__STATE__) (((__STATE__) == TIM_OCNIDLESTATE_SET) || \ | |||
((__STATE__) == TIM_OCNIDLESTATE_RESET)) | |||
#define IS_TIM_ENCODERINPUT_POLARITY(__POLARITY__) (((__POLARITY__) == TIM_ENCODERINPUTPOLARITY_RISING) || \ | |||
((__POLARITY__) == TIM_ENCODERINPUTPOLARITY_FALLING)) | |||
#define IS_TIM_IC_POLARITY(__POLARITY__) (((__POLARITY__) == TIM_ICPOLARITY_RISING) || \ | |||
((__POLARITY__) == TIM_ICPOLARITY_FALLING) || \ | |||
((__POLARITY__) == TIM_ICPOLARITY_BOTHEDGE)) | |||
@@ -1855,10 +1961,10 @@ mode. | |||
((__HANDLE__)->Instance->CCMR2 |= ((__ICPSC__) << 8U))) | |||
#define TIM_RESET_ICPRESCALERVALUE(__HANDLE__, __CHANNEL__) \ | |||
(((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 &= (uint16_t)~TIM_CCMR1_IC1PSC) :\ | |||
((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 &= (uint16_t)~TIM_CCMR1_IC2PSC) :\ | |||
((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 &= (uint16_t)~TIM_CCMR2_IC3PSC) :\ | |||
((__HANDLE__)->Instance->CCMR2 &= (uint16_t)~TIM_CCMR2_IC4PSC)) | |||
(((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 &= ~TIM_CCMR1_IC1PSC) :\ | |||
((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 &= ~TIM_CCMR1_IC2PSC) :\ | |||
((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 &= ~TIM_CCMR2_IC3PSC) :\ | |||
((__HANDLE__)->Instance->CCMR2 &= ~TIM_CCMR2_IC4PSC)) | |||
#define TIM_SET_CAPTUREPOLARITY(__HANDLE__, __CHANNEL__, __POLARITY__) \ | |||
(((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCER |= (__POLARITY__)) :\ | |||
@@ -1867,10 +1973,10 @@ mode. | |||
((__HANDLE__)->Instance->CCER |= (((__POLARITY__) << 12U)))) | |||
#define TIM_RESET_CAPTUREPOLARITY(__HANDLE__, __CHANNEL__) \ | |||
(((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCER &= (uint16_t)~(TIM_CCER_CC1P | TIM_CCER_CC1NP)) :\ | |||
((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCER &= (uint16_t)~(TIM_CCER_CC2P | TIM_CCER_CC2NP)) :\ | |||
((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCER &= (uint16_t)~(TIM_CCER_CC3P | TIM_CCER_CC3NP)) :\ | |||
((__HANDLE__)->Instance->CCER &= (uint16_t)~(TIM_CCER_CC4P | TIM_CCER_CC4NP))) | |||
(((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCER &= ~(TIM_CCER_CC1P | TIM_CCER_CC1NP)) :\ | |||
((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCER &= ~(TIM_CCER_CC2P | TIM_CCER_CC2NP)) :\ | |||
((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCER &= ~(TIM_CCER_CC3P | TIM_CCER_CC3NP)) :\ | |||
((__HANDLE__)->Instance->CCER &= ~(TIM_CCER_CC4P | TIM_CCER_CC4NP))) | |||
/** | |||
* @} | |||
@@ -91,24 +91,40 @@ TIMEx_BreakInputConfigTypeDef; | |||
#define TIM_TIM1_ETR_ADC1_AWD1 TIM1_OR_ETR_ADC1_RMP_0 /* !< TIM1_ETR is connected to ADC1 AWD1 */ | |||
#define TIM_TIM1_ETR_ADC1_AWD2 TIM1_OR_ETR_ADC1_RMP_1 /* !< TIM1_ETR is connected to ADC1 AWD2 */ | |||
#define TIM_TIM1_ETR_ADC1_AWD3 (TIM1_OR_ETR_ADC1_RMP_0 | TIM1_OR_ETR_ADC1_RMP_1) /* !< TIM1_ETR is connected to ADC1 AWD3 */ | |||
#if defined(COMP1) | |||
#define TIM_TIM1_ETR_COMP1 TIM1_AF1_ETRSEL_0 /* !< TIM1_ETR is connected to COMP1 output */ | |||
#endif /* COMP1 */ | |||
#if defined(COMP2) | |||
#define TIM_TIM1_ETR_COMP2 TIM1_AF1_ETRSEL_1 /* !< TIM1_ETR is connected to COMP2 output */ | |||
#endif /* COMP2 */ | |||
#define TIM_TIM1_TI1_GPIO 0x00000000U /* !< TIM1 Input capture 1 is connected to I/0 */ | |||
#define TIM_TIM1_TI1_COMP1 TIM1_OR_TI1_RMP /* !< TIM1 Input capture 1is connected to COMP1 OUT */ | |||
#define TIM_TIM2_ITR_NC 0x00000000U /* !< TIM2 Internal trigger ITR is not connected */ | |||
#if defined(USB) | |||
#define TIM_TIM2_ITR_USB TIM2_OR_ITR1_RMP /* !< TIM2 Internal trigger ITR is connected to USBFS SOF */ | |||
#endif /* USB */ | |||
#define TIM_TIM2_ETR_GPIO 0x00000000U /* !< TIM2 External trigger ETR is connected to I/O */ | |||
#define TIM_TIM2_ETR_LSE TIM2_OR_ETR_RMP /* !< TIM2 External trigger ETR is connected to LSE */ | |||
#if defined(COMP1) | |||
#define TIM_TIM2_ETR_COMP1 TIM2_AF1_ETRSEL_0 /* !< TIM2_ETR is connected to COMP1 output */ | |||
#endif /* COMP1 */ | |||
#if defined(COMP2) | |||
#define TIM_TIM2_ETR_COMP2 TIM2_AF1_ETRSEL_1 /* !< TIM2_ETR is connected to COMP2 output */ | |||
#endif /* COMP2 */ | |||
#define TIM_TIM2_TI4_GPIO 0x00000000U /* !< TIM2_TI4 is connected to I/O */ | |||
#if defined(COMP1) | |||
#define TIM_TIM2_TI4_COMP1 TIM2_OR_TI4_RMP_0 /* !< TIM2_TI4 is connected to COMP1 OUT */ | |||
#endif /* COMP1 */ | |||
#if defined(COMP2) | |||
#define TIM_TIM2_TI4_COMP2 TIM2_OR_TI4_RMP_1 /* !< TIM2_TI4 is connected to COMP1 OUT */ | |||
#endif /* COMP2 */ | |||
#if defined(COMP1) && defined(COMP2) | |||
#define TIM_TIM2_TI4_COMP1_COMP2 (TIM2_OR_TI4_RMP_0 | TIM2_OR_TI4_RMP_1) /* !< TIM2_TI4 is connected to COMP1 and COMP2 OUT */ | |||
#endif /* COMP1 && COMP2 */ | |||
#define TIM_TIM16_TI1_GPIO 0x00000000U /* !< TIM16_TI1 is connected to I/O */ | |||
#define TIM_TIM16_TI1_LSI TIM16_OR_TI1_RMP_0 /* !< TIM16_TI1 is connected to LSI Clock */ | |||
@@ -136,8 +152,12 @@ TIMEx_BreakInputConfigTypeDef; | |||
* @{ | |||
*/ | |||
#define TIM_BREAKINPUTSOURCE_BKIN 0x00000001U /* !< An external source (GPIO) is connected to the BKIN pin */ | |||
#if defined(COMP1) | |||
#define TIM_BREAKINPUTSOURCE_COMP1 0x00000002U /* !< The COMP1 output is connected to the break input */ | |||
#endif /* COMP1 */ | |||
#if defined(COMP2) | |||
#define TIM_BREAKINPUTSOURCE_COMP2 0x00000004U /* !< The COMP2 output is connected to the break input */ | |||
#endif /* COMP2 */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -189,10 +209,15 @@ TIMEx_BreakInputConfigTypeDef; | |||
(((__BREAKINPUT__) == TIM_BREAKINPUT_BRK) || \ | |||
((__BREAKINPUT__) == TIM_BREAKINPUT_BRK2)) | |||
#if defined(COMP1) && defined(COMP2) | |||
#define IS_TIM_BREAKINPUTSOURCE(__SOURCE__) \ | |||
(((__SOURCE__) == TIM_BREAKINPUTSOURCE_BKIN) || \ | |||
((__SOURCE__) == TIM_BREAKINPUTSOURCE_COMP1) || \ | |||
((__SOURCE__) == TIM_BREAKINPUTSOURCE_COMP2)) | |||
#else | |||
#define IS_TIM_BREAKINPUTSOURCE(__SOURCE__) \ | |||
(((__SOURCE__) == TIM_BREAKINPUTSOURCE_BKIN)) | |||
#endif | |||
#define IS_TIM_BREAKINPUTSOURCE_STATE(__STATE__) \ | |||
(((__STATE__) == TIM_BREAKINPUTSOURCE_DISABLE) || \ | |||
@@ -28,6 +28,8 @@ extern "C" { | |||
/* Includes ------------------------------------------------------------------*/ | |||
#include "stm32wbxx_hal_def.h" | |||
#if defined(TSC) | |||
/** @addtogroup STM32WBxx_HAL_Driver | |||
* @{ | |||
*/ | |||
@@ -106,13 +108,17 @@ typedef struct | |||
/** | |||
* @brief TSC handle Structure definition | |||
*/ | |||
#if (USE_HAL_TSC_REGISTER_CALLBACKS == 1) | |||
typedef struct __TSC_HandleTypeDef | |||
#else | |||
typedef struct | |||
#endif /* USE_HAL_TSC_REGISTER_CALLBACKS */ | |||
{ | |||
TSC_TypeDef *Instance; /*!< Register base address */ | |||
TSC_InitTypeDef Init; /*!< Initialization parameters */ | |||
__IO HAL_TSC_StateTypeDef State; /*!< Peripheral state */ | |||
HAL_LockTypeDef Lock; /*!< Lock feature */ | |||
__IO uint32_t ErrorCode; /*!< I2C Error code */ | |||
__IO uint32_t ErrorCode; /*!< TSC Error code */ | |||
#if (USE_HAL_TSC_REGISTER_CALLBACKS == 1) | |||
void (* ConvCpltCallback)(struct __TSC_HandleTypeDef *htsc); /*!< TSC Conversion complete callback */ | |||
@@ -640,7 +646,8 @@ typedef void (*pTSC_CallbackTypeDef)(TSC_HandleTypeDef *htsc); /*!< pointer to | |||
#define IS_TSC_GROUP_INDEX(__VALUE__) (((__VALUE__) == 0UL) || (((__VALUE__) > 0UL) && ((__VALUE__) < (uint32_t)TSC_NB_OF_GROUPS))) | |||
#define IS_TSC_GROUP(__VALUE__) ((((__VALUE__) & TSC_GROUP1_IO1) == TSC_GROUP1_IO1) ||\ | |||
#define IS_TSC_GROUP(__VALUE__) (((__VALUE__) == 0UL) ||\ | |||
(((__VALUE__) & TSC_GROUP1_IO1) == TSC_GROUP1_IO1) ||\ | |||
(((__VALUE__) & TSC_GROUP1_IO2) == TSC_GROUP1_IO2) ||\ | |||
(((__VALUE__) & TSC_GROUP1_IO3) == TSC_GROUP1_IO3) ||\ | |||
(((__VALUE__) & TSC_GROUP1_IO4) == TSC_GROUP1_IO4) ||\ | |||
@@ -751,6 +758,7 @@ void HAL_TSC_ErrorCallback(TSC_HandleTypeDef *htsc); | |||
/** | |||
* @} | |||
*/ | |||
#endif /* TSC */ | |||
#ifdef __cplusplus | |||
} | |||
@@ -48,12 +48,14 @@ typedef struct | |||
{ | |||
uint32_t BaudRate; /*!< This member configures the UART communication baud rate. | |||
The baud rate register is computed using the following formula: | |||
#if defined(LPUART1) | |||
LPUART: | |||
======= | |||
Baud Rate Register = ((256 * lpuart_ker_ckpres) / ((huart->Init.BaudRate))) | |||
where lpuart_ker_ck_pres is the UART input clock divided by a prescaler | |||
UART: | |||
===== | |||
#endif | |||
- If oversampling is 16 or in LIN mode, | |||
Baud Rate Register = ((uart_ker_ckpres) / ((huart->Init.BaudRate))) | |||
- If oversampling is 8, | |||
@@ -104,10 +106,10 @@ typedef struct | |||
This parameter can be a value of @ref UART_Advanced_Features_Initialization_Type. */ | |||
uint32_t TxPinLevelInvert; /*!< Specifies whether the TX pin active level is inverted. | |||
This parameter can be a value of @ref UART_Tx_Inv. */ | |||
This parameter can be a value of @ref UART_Tx_Inv. */ | |||
uint32_t RxPinLevelInvert; /*!< Specifies whether the RX pin active level is inverted. | |||
This parameter can be a value of @ref UART_Rx_Inv. */ | |||
This parameter can be a value of @ref UART_Rx_Inv. */ | |||
uint32_t DataInvert; /*!< Specifies whether data are inverted (positive/direct logic | |||
vs negative/inverted logic). | |||
@@ -133,8 +135,6 @@ typedef struct | |||
This parameter can be a value of @ref UART_MSB_First. */ | |||
} UART_AdvFeatureInitTypeDef; | |||
/** | |||
* @brief HAL UART State definition | |||
* @note HAL UART State value is a combination of 2 different substates: gState and RxState (see @ref UART_State_Definition). | |||
@@ -221,9 +221,9 @@ typedef struct __UART_HandleTypeDef | |||
uint16_t NbTxDataToProcess; /*!< Number of data to process during TX ISR execution */ | |||
void (*RxISR)(struct __UART_HandleTypeDef *huart); /*!< Function pointer on Rx IRQ handler */ | |||
void (*RxISR)(struct __UART_HandleTypeDef *huart); /*!< Function pointer on Rx IRQ handler */ | |||
void (*TxISR)(struct __UART_HandleTypeDef *huart); /*!< Function pointer on Tx IRQ handler */ | |||
void (*TxISR)(struct __UART_HandleTypeDef *huart); /*!< Function pointer on Tx IRQ handler */ | |||
DMA_HandleTypeDef *hdmatx; /*!< UART Tx DMA Handle parameters */ | |||
@@ -331,8 +331,10 @@ typedef void (*pUART_CallbackTypeDef)(UART_HandleTypeDef *huart); /*!< pointer | |||
#define HAL_UART_ERROR_FE ((uint32_t)0x00000004U) /*!< Frame error */ | |||
#define HAL_UART_ERROR_ORE ((uint32_t)0x00000008U) /*!< Overrun error */ | |||
#define HAL_UART_ERROR_DMA ((uint32_t)0x00000010U) /*!< DMA transfer error */ | |||
#define HAL_UART_ERROR_RTO ((uint32_t)0x00000020U) /*!< Receiver Timeout error */ | |||
#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) | |||
#define HAL_UART_ERROR_INVALID_CALLBACK ((uint32_t)0x00000020U) /*!< Invalid Callback error */ | |||
#define HAL_UART_ERROR_INVALID_CALLBACK ((uint32_t)0x00000040U) /*!< Invalid Callback error */ | |||
#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ | |||
/** | |||
* @} | |||
@@ -422,7 +424,6 @@ typedef void (*pUART_CallbackTypeDef)(UART_HandleTypeDef *huart); /*!< pointer | |||
#define UART_PRESCALER_DIV64 0x00000009U /*!< fclk_pres = fclk/64 */ | |||
#define UART_PRESCALER_DIV128 0x0000000AU /*!< fclk_pres = fclk/128 */ | |||
#define UART_PRESCALER_DIV256 0x0000000BU /*!< fclk_pres = fclk/256 */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -438,11 +439,11 @@ typedef void (*pUART_CallbackTypeDef)(UART_HandleTypeDef *huart); /*!< pointer | |||
* @} | |||
*/ | |||
/** @defgroup UART_Receiver_TimeOut UART Receiver TimeOut | |||
/** @defgroup UART_Receiver_Timeout UART Receiver Timeout | |||
* @{ | |||
*/ | |||
#define UART_RECEIVER_TIMEOUT_DISABLE 0x00000000U /*!< UART receiver timeout disable */ | |||
#define UART_RECEIVER_TIMEOUT_ENABLE USART_CR2_RTOEN /*!< UART receiver timeout enable */ | |||
#define UART_RECEIVER_TIMEOUT_DISABLE 0x00000000U /*!< UART Receiver Timeout disable */ | |||
#define UART_RECEIVER_TIMEOUT_ENABLE USART_CR2_RTOEN /*!< UART Receiver Timeout enable */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -696,6 +697,7 @@ typedef void (*pUART_CallbackTypeDef)(UART_HandleTypeDef *huart); /*!< pointer | |||
#define UART_FLAG_BUSY USART_ISR_BUSY /*!< UART busy flag */ | |||
#define UART_FLAG_ABRF USART_ISR_ABRF /*!< UART auto Baud rate flag */ | |||
#define UART_FLAG_ABRE USART_ISR_ABRE /*!< UART auto Baud rate error */ | |||
#define UART_FLAG_RTOF USART_ISR_RTOF /*!< UART receiver timeout flag */ | |||
#define UART_FLAG_CTS USART_ISR_CTS /*!< UART clear to send flag */ | |||
#define UART_FLAG_CTSIF USART_ISR_CTSIF /*!< UART clear to send interrupt flag */ | |||
#define UART_FLAG_LBDF USART_ISR_LBDF /*!< UART LIN break detection flag */ | |||
@@ -746,17 +748,10 @@ typedef void (*pUART_CallbackTypeDef)(UART_HandleTypeDef *huart); /*!< pointer | |||
#define UART_IT_TXFE 0x173EU /*!< UART TXFIFO empty interruption */ | |||
#define UART_IT_RXFT 0x1A7CU /*!< UART RXFIFO threshold reached interruption */ | |||
#define UART_IT_TXFT 0x1B77U /*!< UART TXFIFO threshold reached interruption */ | |||
#define UART_IT_RTO 0x0B3AU /*!< UART receiver timeout interruption */ | |||
/* Elements values convention: 000000000XXYYYYYb | |||
- YYYYY : Interrupt source position in the XX register (5bits) | |||
- XX : Interrupt source register (2bits) | |||
- 01: CR1 register | |||
- 10: CR2 register | |||
- 11: CR3 register */ | |||
#define UART_IT_ERR 0x0060U /*!< UART error interruption */ | |||
/* Elements values convention: 0000ZZZZ00000000b | |||
- ZZZZ : Flag position in the ISR register(4bits) */ | |||
#define UART_IT_ORE 0x0300U /*!< UART overrun error interruption */ | |||
#define UART_IT_NE 0x0200U /*!< UART noise error interruption */ | |||
#define UART_IT_FE 0x0100U /*!< UART frame error interruption */ | |||
@@ -778,6 +773,7 @@ typedef void (*pUART_CallbackTypeDef)(UART_HandleTypeDef *huart); /*!< pointer | |||
#define UART_CLEAR_CTSF USART_ICR_CTSCF /*!< CTS Interrupt Clear Flag */ | |||
#define UART_CLEAR_CMF USART_ICR_CMCF /*!< Character Match Clear Flag */ | |||
#define UART_CLEAR_WUF USART_ICR_WUCF /*!< Wake Up from stop mode Clear Flag */ | |||
#define UART_CLEAR_RTOF USART_ICR_RTOCF /*!< UART receiver timeout clear flag */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -816,9 +812,9 @@ typedef void (*pUART_CallbackTypeDef)(UART_HandleTypeDef *huart); /*!< pointer | |||
*/ | |||
#define __HAL_UART_FLUSH_DRREGISTER(__HANDLE__) \ | |||
do{ \ | |||
SET_BIT((__HANDLE__)->Instance->RQR, UART_RXDATA_FLUSH_REQUEST); \ | |||
SET_BIT((__HANDLE__)->Instance->RQR, UART_TXDATA_FLUSH_REQUEST); \ | |||
} while(0U) | |||
SET_BIT((__HANDLE__)->Instance->RQR, UART_RXDATA_FLUSH_REQUEST); \ | |||
SET_BIT((__HANDLE__)->Instance->RQR, UART_TXDATA_FLUSH_REQUEST); \ | |||
} while(0U) | |||
/** @brief Clear the specified UART pending flag. | |||
* @param __HANDLE__ specifies the UART Handle. | |||
@@ -831,6 +827,7 @@ typedef void (*pUART_CallbackTypeDef)(UART_HandleTypeDef *huart); /*!< pointer | |||
* @arg @ref UART_CLEAR_IDLEF IDLE line detected Clear Flag | |||
* @arg @ref UART_CLEAR_TXFECF TXFIFO empty clear Flag | |||
* @arg @ref UART_CLEAR_TCF Transmission Complete Clear Flag | |||
* @arg @ref UART_CLEAR_RTOF Receiver Timeout clear flag | |||
* @arg @ref UART_CLEAR_LBDF LIN Break Detection Clear Flag | |||
* @arg @ref UART_CLEAR_CTSF CTS Interrupt Clear Flag | |||
* @arg @ref UART_CLEAR_CMF Character Match Clear Flag | |||
@@ -899,6 +896,7 @@ typedef void (*pUART_CallbackTypeDef)(UART_HandleTypeDef *huart); /*!< pointer | |||
* @arg @ref UART_FLAG_TC Transmission Complete flag | |||
* @arg @ref UART_FLAG_RXNE Receive data register not empty flag | |||
* @arg @ref UART_FLAG_RXFNE UART RXFIFO not empty flag | |||
* @arg @ref UART_FLAG_RTOF Receiver Timeout flag | |||
* @arg @ref UART_FLAG_IDLE Idle Line detection flag | |||
* @arg @ref UART_FLAG_ORE Overrun Error flag | |||
* @arg @ref UART_FLAG_NE Noise Error flag | |||
@@ -925,6 +923,7 @@ typedef void (*pUART_CallbackTypeDef)(UART_HandleTypeDef *huart); /*!< pointer | |||
* @arg @ref UART_IT_TC Transmission complete interrupt | |||
* @arg @ref UART_IT_RXNE Receive Data register not empty interrupt | |||
* @arg @ref UART_IT_RXFNE RXFIFO not empty interrupt | |||
* @arg @ref UART_IT_RTO Receive Timeout interrupt | |||
* @arg @ref UART_IT_IDLE Idle line detection interrupt | |||
* @arg @ref UART_IT_PE Parity Error interrupt | |||
* @arg @ref UART_IT_ERR Error interrupt (frame error, noise error, overrun error) | |||
@@ -952,6 +951,7 @@ typedef void (*pUART_CallbackTypeDef)(UART_HandleTypeDef *huart); /*!< pointer | |||
* @arg @ref UART_IT_TC Transmission complete interrupt | |||
* @arg @ref UART_IT_RXNE Receive Data register not empty interrupt | |||
* @arg @ref UART_IT_RXFNE RXFIFO not empty interrupt | |||
* @arg @ref UART_IT_RTO Receive Timeout interrupt | |||
* @arg @ref UART_IT_IDLE Idle line detection interrupt | |||
* @arg @ref UART_IT_PE Parity Error interrupt | |||
* @arg @ref UART_IT_ERR Error interrupt (Frame error, noise error, overrun error) | |||
@@ -978,12 +978,14 @@ typedef void (*pUART_CallbackTypeDef)(UART_HandleTypeDef *huart); /*!< pointer | |||
* @arg @ref UART_IT_TC Transmission complete interrupt | |||
* @arg @ref UART_IT_RXNE Receive Data register not empty interrupt | |||
* @arg @ref UART_IT_RXFNE RXFIFO not empty interrupt | |||
* @arg @ref UART_IT_RTO Receive Timeout interrupt | |||
* @arg @ref UART_IT_IDLE Idle line detection interrupt | |||
* @arg @ref UART_IT_PE Parity Error interrupt | |||
* @arg @ref UART_IT_ERR Error interrupt (Frame error, noise error, overrun error) | |||
* @retval The new state of __INTERRUPT__ (SET or RESET). | |||
*/ | |||
#define __HAL_UART_GET_IT(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->ISR & (1U << ((__INTERRUPT__)>> 8U))) != RESET) ? SET : RESET) | |||
#define __HAL_UART_GET_IT(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->ISR\ | |||
& (1U << ((__INTERRUPT__)>> 8U))) != RESET) ? SET : RESET) | |||
/** @brief Check whether the specified UART interrupt source is enabled or not. | |||
* @param __HANDLE__ specifies the UART Handle. | |||
@@ -1002,14 +1004,15 @@ typedef void (*pUART_CallbackTypeDef)(UART_HandleTypeDef *huart); /*!< pointer | |||
* @arg @ref UART_IT_TC Transmission complete interrupt | |||
* @arg @ref UART_IT_RXNE Receive Data register not empty interrupt | |||
* @arg @ref UART_IT_RXFNE RXFIFO not empty interrupt | |||
* @arg @ref UART_IT_RTO Receive Timeout interrupt | |||
* @arg @ref UART_IT_IDLE Idle line detection interrupt | |||
* @arg @ref UART_IT_PE Parity Error interrupt | |||
* @arg @ref UART_IT_ERR Error interrupt (Frame error, noise error, overrun error) | |||
* @retval The new state of __INTERRUPT__ (SET or RESET). | |||
*/ | |||
#define __HAL_UART_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((((((uint8_t)(__INTERRUPT__)) >> 5U) == 1U) ? (__HANDLE__)->Instance->CR1 : \ | |||
(((((uint8_t)(__INTERRUPT__)) >> 5U) == 2U) ? (__HANDLE__)->Instance->CR2 : \ | |||
(__HANDLE__)->Instance->CR3)) & (1U << (((uint16_t)(__INTERRUPT__)) & UART_IT_MASK))) != RESET) ? SET : RESET) | |||
(((((uint8_t)(__INTERRUPT__)) >> 5U) == 2U) ? (__HANDLE__)->Instance->CR2 : \ | |||
(__HANDLE__)->Instance->CR3)) & (1U << (((uint16_t)(__INTERRUPT__)) & UART_IT_MASK))) != RESET) ? SET : RESET) | |||
/** @brief Clear the specified UART ISR flag, in setting the proper ICR register flag. | |||
* @param __HANDLE__ specifies the UART Handle. | |||
@@ -1021,6 +1024,7 @@ typedef void (*pUART_CallbackTypeDef)(UART_HandleTypeDef *huart); /*!< pointer | |||
* @arg @ref UART_CLEAR_NEF Noise detected Clear Flag | |||
* @arg @ref UART_CLEAR_OREF Overrun Error Clear Flag | |||
* @arg @ref UART_CLEAR_IDLEF IDLE line detected Clear Flag | |||
* @arg @ref UART_CLEAR_RTOF Receiver timeout clear flag | |||
* @arg @ref UART_CLEAR_TXFECF TXFIFO empty Clear Flag | |||
* @arg @ref UART_CLEAR_TCF Transmission Complete Clear Flag | |||
* @arg @ref UART_CLEAR_LBDF LIN Break Detection Clear Flag | |||
@@ -1165,13 +1169,16 @@ typedef void (*pUART_CallbackTypeDef)(UART_HandleTypeDef *huart); /*!< pointer | |||
((__CLOCKPRESCALER__) == UART_PRESCALER_DIV128) ? 128U : \ | |||
((__CLOCKPRESCALER__) == UART_PRESCALER_DIV256) ? 256U : 1U) | |||
#if defined(LPUART1) | |||
/** @brief BRR division operation to set BRR register with LPUART. | |||
* @param __PCLK__ LPUART clock. | |||
* @param __BAUD__ Baud rate set by the user. | |||
* @param __CLOCKPRESCALER__ UART prescaler value. | |||
* @retval Division result | |||
*/ | |||
#define UART_DIV_LPUART(__PCLK__, __BAUD__, __CLOCKPRESCALER__) ((uint32_t)(((((uint64_t)(__PCLK__)/UART_GET_DIV_FACTOR((__CLOCKPRESCALER__)))*256U) + (uint32_t)((__BAUD__)/2U)) / (__BAUD__))) | |||
#define UART_DIV_LPUART(__PCLK__, __BAUD__, __CLOCKPRESCALER__) ((uint32_t)(((((uint64_t)(__PCLK__)/UART_GET_DIV_FACTOR((__CLOCKPRESCALER__)))*256U)\ | |||
+ (uint32_t)((__BAUD__)/2U)) / (__BAUD__))) | |||
#endif | |||
/** @brief BRR division operation to set BRR register in 8-bit oversampling mode. | |||
* @param __PCLK__ UART clock. | |||
@@ -1179,7 +1186,8 @@ typedef void (*pUART_CallbackTypeDef)(UART_HandleTypeDef *huart); /*!< pointer | |||
* @param __CLOCKPRESCALER__ UART prescaler value. | |||
* @retval Division result | |||
*/ | |||
#define UART_DIV_SAMPLING8(__PCLK__, __BAUD__, __CLOCKPRESCALER__) (((((__PCLK__)/UART_GET_DIV_FACTOR((__CLOCKPRESCALER__)))*2U) + ((__BAUD__)/2U)) / (__BAUD__)) | |||
#define UART_DIV_SAMPLING8(__PCLK__, __BAUD__, __CLOCKPRESCALER__) (((((__PCLK__)/UART_GET_DIV_FACTOR((__CLOCKPRESCALER__)))*2U)\ | |||
+ ((__BAUD__)/2U)) / (__BAUD__)) | |||
/** @brief BRR division operation to set BRR register in 16-bit oversampling mode. | |||
* @param __PCLK__ UART clock. | |||
@@ -1187,13 +1195,16 @@ typedef void (*pUART_CallbackTypeDef)(UART_HandleTypeDef *huart); /*!< pointer | |||
* @param __CLOCKPRESCALER__ UART prescaler value. | |||
* @retval Division result | |||
*/ | |||
#define UART_DIV_SAMPLING16(__PCLK__, __BAUD__, __CLOCKPRESCALER__) ((((__PCLK__)/UART_GET_DIV_FACTOR((__CLOCKPRESCALER__))) + ((__BAUD__)/2U)) / (__BAUD__)) | |||
#define UART_DIV_SAMPLING16(__PCLK__, __BAUD__, __CLOCKPRESCALER__) ((((__PCLK__)/UART_GET_DIV_FACTOR((__CLOCKPRESCALER__)))\ | |||
+ ((__BAUD__)/2U)) / (__BAUD__)) | |||
#if defined(LPUART1) | |||
/** @brief Check whether or not UART instance is Low Power UART. | |||
* @param __HANDLE__ specifies the UART Handle. | |||
* @retval SET (instance is LPUART) or RESET (instance isn't LPUART) | |||
*/ | |||
#define UART_INSTANCE_LOWPOWER(__HANDLE__) (IS_LPUART_INSTANCE((__HANDLE__)->Instance)) | |||
#endif | |||
/** @brief Check UART Baud rate. | |||
* @param __BAUDRATE__ Baudrate specified by the user. | |||
@@ -1225,6 +1236,7 @@ typedef void (*pUART_CallbackTypeDef)(UART_HandleTypeDef *huart); /*!< pointer | |||
((__STOPBITS__) == UART_STOPBITS_1_5) || \ | |||
((__STOPBITS__) == UART_STOPBITS_2)) | |||
#if defined(LPUART1) | |||
/** | |||
* @brief Ensure that LPUART frame number of stop bits is valid. | |||
* @param __STOPBITS__ LPUART frame number of stop bits. | |||
@@ -1232,6 +1244,7 @@ typedef void (*pUART_CallbackTypeDef)(UART_HandleTypeDef *huart); /*!< pointer | |||
*/ | |||
#define IS_LPUART_STOPBITS(__STOPBITS__) (((__STOPBITS__) == UART_STOPBITS_1) || \ | |||
((__STOPBITS__) == UART_STOPBITS_2)) | |||
#endif | |||
/** | |||
* @brief Ensure that UART frame parity is valid. | |||
@@ -1248,10 +1261,10 @@ typedef void (*pUART_CallbackTypeDef)(UART_HandleTypeDef *huart); /*!< pointer | |||
* @retval SET (__CONTROL__ is valid) or RESET (__CONTROL__ is invalid) | |||
*/ | |||
#define IS_UART_HARDWARE_FLOW_CONTROL(__CONTROL__)\ | |||
(((__CONTROL__) == UART_HWCONTROL_NONE) || \ | |||
((__CONTROL__) == UART_HWCONTROL_RTS) || \ | |||
((__CONTROL__) == UART_HWCONTROL_CTS) || \ | |||
((__CONTROL__) == UART_HWCONTROL_RTS_CTS)) | |||
(((__CONTROL__) == UART_HWCONTROL_NONE) || \ | |||
((__CONTROL__) == UART_HWCONTROL_RTS) || \ | |||
((__CONTROL__) == UART_HWCONTROL_CTS) || \ | |||
((__CONTROL__) == UART_HWCONTROL_RTS_CTS)) | |||
/** | |||
* @brief Ensure that UART communication mode is valid. | |||
@@ -1299,8 +1312,15 @@ typedef void (*pUART_CallbackTypeDef)(UART_HandleTypeDef *huart); /*!< pointer | |||
* @param __TIMEOUT__ UART receiver timeout setting. | |||
* @retval SET (__TIMEOUT__ is valid) or RESET (__TIMEOUT__ is invalid) | |||
*/ | |||
#define IS_UART_RECEIVER_TIMEOUT(__TIMEOUT__) (((__TIMEOUT__) == UART_RECEIVER_TIMEOUT_DISABLE) || \ | |||
((__TIMEOUT__) == UART_RECEIVER_TIMEOUT_ENABLE)) | |||
#define IS_UART_RECEIVER_TIMEOUT(__TIMEOUT__) (((__TIMEOUT__) == UART_RECEIVER_TIMEOUT_DISABLE) || \ | |||
((__TIMEOUT__) == UART_RECEIVER_TIMEOUT_ENABLE)) | |||
/** @brief Check the receiver timeout value. | |||
* @note The maximum UART receiver timeout value is 0xFFFFFF. | |||
* @param __TIMEOUTVALUE__ receiver timeout value. | |||
* @retval Test result (TRUE or FALSE) | |||
*/ | |||
#define IS_UART_RECEIVER_TIMEOUT_VALUE(__TIMEOUTVALUE__) ((__TIMEOUTVALUE__) <= 0xFFFFFFU) | |||
/** | |||
* @brief Ensure that UART LIN state is valid. | |||
@@ -1519,7 +1539,8 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef *huart); | |||
/* Callbacks Register/UnRegister functions ***********************************/ | |||
#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) | |||
HAL_StatusTypeDef HAL_UART_RegisterCallback(UART_HandleTypeDef *huart, HAL_UART_CallbackIDTypeDef CallbackID, pUART_CallbackTypeDef pCallback); | |||
HAL_StatusTypeDef HAL_UART_RegisterCallback(UART_HandleTypeDef *huart, HAL_UART_CallbackIDTypeDef CallbackID, | |||
pUART_CallbackTypeDef pCallback); | |||
HAL_StatusTypeDef HAL_UART_UnRegisterCallback(UART_HandleTypeDef *huart, HAL_UART_CallbackIDTypeDef CallbackID); | |||
#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ | |||
@@ -1568,12 +1589,17 @@ void HAL_UART_AbortReceiveCpltCallback(UART_HandleTypeDef *huart); | |||
*/ | |||
/* Peripheral Control functions ************************************************/ | |||
void HAL_UART_ReceiverTimeout_Config(UART_HandleTypeDef *huart, uint32_t TimeoutValue); | |||
HAL_StatusTypeDef HAL_UART_EnableReceiverTimeout(UART_HandleTypeDef *huart); | |||
HAL_StatusTypeDef HAL_UART_DisableReceiverTimeout(UART_HandleTypeDef *huart); | |||
HAL_StatusTypeDef HAL_LIN_SendBreak(UART_HandleTypeDef *huart); | |||
HAL_StatusTypeDef HAL_MultiProcessor_EnableMuteMode(UART_HandleTypeDef *huart); | |||
HAL_StatusTypeDef HAL_MultiProcessor_DisableMuteMode(UART_HandleTypeDef *huart); | |||
void HAL_MultiProcessor_EnterMuteMode(UART_HandleTypeDef *huart); | |||
HAL_StatusTypeDef HAL_HalfDuplex_EnableTransmitter(UART_HandleTypeDef *huart); | |||
HAL_StatusTypeDef HAL_HalfDuplex_EnableReceiver(UART_HandleTypeDef *huart); | |||
/** | |||
* @} | |||
*/ | |||
@@ -1598,13 +1624,13 @@ uint32_t HAL_UART_GetError(UART_HandleTypeDef *huart); | |||
/** @addtogroup UART_Private_Functions UART Private Functions | |||
* @{ | |||
*/ | |||
#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) | |||
void UART_InitCallbacksToDefault(UART_HandleTypeDef *huart); | |||
#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ | |||
HAL_StatusTypeDef UART_SetConfig(UART_HandleTypeDef *huart); | |||
HAL_StatusTypeDef UART_CheckIdleState(UART_HandleTypeDef *huart); | |||
HAL_StatusTypeDef UART_WaitOnFlagUntilTimeout(UART_HandleTypeDef *huart, uint32_t Flag, FlagStatus Status, uint32_t Tickstart, uint32_t Timeout); | |||
HAL_StatusTypeDef UART_WaitOnFlagUntilTimeout(UART_HandleTypeDef *huart, uint32_t Flag, FlagStatus Status, | |||
uint32_t Tickstart, uint32_t Timeout); | |||
void UART_AdvFeatureConfig(UART_HandleTypeDef *huart); | |||
/** | |||
@@ -69,9 +69,9 @@ typedef struct | |||
/** @defgroup UARTEx_Word_Length UARTEx Word Length | |||
* @{ | |||
*/ | |||
#define UART_WORDLENGTH_7B USART_CR1_M1 /*!< 7-bit long UART frame */ | |||
#define UART_WORDLENGTH_8B 0x00000000U /*!< 8-bit long UART frame */ | |||
#define UART_WORDLENGTH_9B USART_CR1_M0 /*!< 9-bit long UART frame */ | |||
#define UART_WORDLENGTH_7B USART_CR1_M1 /*!< 7-bit long UART frame */ | |||
#define UART_WORDLENGTH_8B 0x00000000U /*!< 8-bit long UART frame */ | |||
#define UART_WORDLENGTH_9B USART_CR1_M0 /*!< 9-bit long UART frame */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -79,8 +79,8 @@ typedef struct | |||
/** @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 */ | |||
#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 */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -89,8 +89,8 @@ typedef struct | |||
* @brief UART FIFO mode | |||
* @{ | |||
*/ | |||
#define UART_FIFOMODE_DISABLE 0x00000000U /*!< FIFO mode disable */ | |||
#define UART_FIFOMODE_ENABLE USART_CR1_FIFOEN /*!< FIFO mode enable */ | |||
#define UART_FIFOMODE_DISABLE 0x00000000U /*!< FIFO mode disable */ | |||
#define UART_FIFOMODE_ENABLE USART_CR1_FIFOEN /*!< FIFO mode enable */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -138,7 +138,8 @@ typedef struct | |||
*/ | |||
/* Initialization and de-initialization functions ****************************/ | |||
HAL_StatusTypeDef HAL_RS485Ex_Init(UART_HandleTypeDef *huart, uint32_t Polarity, uint32_t AssertionTime, uint32_t DeassertionTime); | |||
HAL_StatusTypeDef HAL_RS485Ex_Init(UART_HandleTypeDef *huart, uint32_t Polarity, uint32_t AssertionTime, | |||
uint32_t DeassertionTime); | |||
/** | |||
* @} | |||
@@ -165,7 +166,9 @@ void HAL_UARTEx_TxFifoEmptyCallback(UART_HandleTypeDef *huart); | |||
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_EnableFifoMode(UART_HandleTypeDef *huart); | |||
HAL_StatusTypeDef HAL_UARTEx_DisableFifoMode(UART_HandleTypeDef *huart); | |||
HAL_StatusTypeDef HAL_UARTEx_SetTxFifoThreshold(UART_HandleTypeDef *huart, uint32_t Threshold); | |||
@@ -189,12 +192,13 @@ HAL_StatusTypeDef HAL_UARTEx_SetRxFifoThreshold(UART_HandleTypeDef *huart, uint3 | |||
* @param __CLOCKSOURCE__ output variable. | |||
* @retval UART clocking source, written in __CLOCKSOURCE__. | |||
*/ | |||
#if defined (LPUART1) | |||
#define UART_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \ | |||
do { \ | |||
if((__HANDLE__)->Instance == USART1) \ | |||
{ \ | |||
switch(__HAL_RCC_GET_USART1_SOURCE()) \ | |||
{ \ | |||
switch(__HAL_RCC_GET_USART1_SOURCE()) \ | |||
{ \ | |||
case RCC_USART1CLKSOURCE_PCLK2: \ | |||
(__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK2; \ | |||
break; \ | |||
@@ -210,12 +214,12 @@ HAL_StatusTypeDef HAL_UARTEx_SetRxFifoThreshold(UART_HandleTypeDef *huart, uint3 | |||
default: \ | |||
(__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED; \ | |||
break; \ | |||
} \ | |||
} \ | |||
} \ | |||
else if((__HANDLE__)->Instance == LPUART1) \ | |||
{ \ | |||
switch(__HAL_RCC_GET_LPUART1_SOURCE()) \ | |||
{ \ | |||
switch(__HAL_RCC_GET_LPUART1_SOURCE()) \ | |||
{ \ | |||
case RCC_LPUART1CLKSOURCE_PCLK1: \ | |||
(__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1; \ | |||
break; \ | |||
@@ -231,13 +235,43 @@ HAL_StatusTypeDef HAL_UARTEx_SetRxFifoThreshold(UART_HandleTypeDef *huart, uint3 | |||
default: \ | |||
(__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED; \ | |||
break; \ | |||
} \ | |||
} \ | |||
} \ | |||
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 \ | |||
{ \ | |||
(__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED; \ | |||
} \ | |||
} while(0U) | |||
#endif /* LPUART1 */ | |||
/** @brief Report the UART mask to apply to retrieve the received data | |||
* according to the word length and to the parity bits activation. | |||
@@ -250,44 +284,44 @@ HAL_StatusTypeDef HAL_UARTEx_SetRxFifoThreshold(UART_HandleTypeDef *huart, uint3 | |||
*/ | |||
#define UART_MASK_COMPUTATION(__HANDLE__) \ | |||
do { \ | |||
if ((__HANDLE__)->Init.WordLength == UART_WORDLENGTH_9B) \ | |||
{ \ | |||
if ((__HANDLE__)->Init.Parity == UART_PARITY_NONE) \ | |||
{ \ | |||
if ((__HANDLE__)->Init.WordLength == UART_WORDLENGTH_9B) \ | |||
{ \ | |||
if ((__HANDLE__)->Init.Parity == UART_PARITY_NONE) \ | |||
{ \ | |||
(__HANDLE__)->Mask = 0x01FFU ; \ | |||
} \ | |||
else \ | |||
{ \ | |||
} \ | |||
else \ | |||
{ \ | |||
(__HANDLE__)->Mask = 0x00FFU ; \ | |||
} \ | |||
} \ | |||
else if ((__HANDLE__)->Init.WordLength == UART_WORDLENGTH_8B) \ | |||
{ \ | |||
if ((__HANDLE__)->Init.Parity == UART_PARITY_NONE) \ | |||
{ \ | |||
} \ | |||
} \ | |||
else if ((__HANDLE__)->Init.WordLength == UART_WORDLENGTH_8B) \ | |||
{ \ | |||
if ((__HANDLE__)->Init.Parity == UART_PARITY_NONE) \ | |||
{ \ | |||
(__HANDLE__)->Mask = 0x00FFU ; \ | |||
} \ | |||
else \ | |||
{ \ | |||
} \ | |||
else \ | |||
{ \ | |||
(__HANDLE__)->Mask = 0x007FU ; \ | |||
} \ | |||
} \ | |||
else if ((__HANDLE__)->Init.WordLength == UART_WORDLENGTH_7B) \ | |||
{ \ | |||
if ((__HANDLE__)->Init.Parity == UART_PARITY_NONE) \ | |||
{ \ | |||
} \ | |||
} \ | |||
else if ((__HANDLE__)->Init.WordLength == UART_WORDLENGTH_7B) \ | |||
{ \ | |||
if ((__HANDLE__)->Init.Parity == UART_PARITY_NONE) \ | |||
{ \ | |||
(__HANDLE__)->Mask = 0x007FU ; \ | |||
} \ | |||
else \ | |||
{ \ | |||
} \ | |||
else \ | |||
{ \ | |||
(__HANDLE__)->Mask = 0x003FU ; \ | |||
} \ | |||
} \ | |||
else \ | |||
{ \ | |||
(__HANDLE__)->Mask = 0x0000U; \ | |||
} \ | |||
} while(0U) | |||
} \ | |||
} \ | |||
else \ | |||
{ \ | |||
(__HANDLE__)->Mask = 0x0000U; \ | |||
} \ | |||
} while(0U) | |||
/** | |||
* @brief Ensure that UART frame length is valid. | |||
@@ -22,7 +22,7 @@ | |||
#define STM32WBxx_HAL_WWDG_H | |||
#ifdef __cplusplus | |||
extern "C" { | |||
extern "C" { | |||
#endif | |||
/* Includes ------------------------------------------------------------------*/ | |||
@@ -89,12 +89,12 @@ typedef enum | |||
{ | |||
HAL_WWDG_EWI_CB_ID = 0x00u, /*!< WWDG EWI callback ID */ | |||
HAL_WWDG_MSPINIT_CB_ID = 0x01u, /*!< WWDG MspInit callback ID */ | |||
}HAL_WWDG_CallbackIDTypeDef; | |||
} HAL_WWDG_CallbackIDTypeDef; | |||
/** | |||
* @brief HAL WWDG Callback pointer definition | |||
*/ | |||
typedef void (*pWWDG_CallbackTypeDef)(WWDG_HandleTypeDef * hppp); /*!< pointer to a WWDG common callback functions */ | |||
typedef void (*pWWDG_CallbackTypeDef)(WWDG_HandleTypeDef *hppp); /*!< pointer to a WWDG common callback functions */ | |||
#endif | |||
/** | |||
@@ -247,7 +247,8 @@ typedef void (*pWWDG_CallbackTypeDef)(WWDG_HandleTypeDef * hppp); /*!< pointer t | |||
* @arg WWDG_IT_EWI: Early Wakeup Interrupt | |||
* @retval state of __INTERRUPT__ (TRUE or FALSE). | |||
*/ | |||
#define __HAL_WWDG_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CFR & (__INTERRUPT__)) == (__INTERRUPT__)) | |||
#define __HAL_WWDG_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CFR\ | |||
& (__INTERRUPT__)) == (__INTERRUPT__)) | |||
/** | |||
* @} | |||
@@ -145,10 +145,10 @@ extern "C" { | |||
/* Mask containing trigger source masks for each of possible */ | |||
/* trigger edge selection duplicated with shifts [0; 4; 8; 12] */ | |||
/* corresponding to {SW start; ext trigger; ext trigger; ext trigger}. */ | |||
#define ADC_INJ_TRIG_SOURCE_MASK (((LL_ADC_INJ_TRIG_SOFTWARE & ADC_JSQR_JEXTSEL) << (4U * 0UL)) | \ | |||
((ADC_JSQR_JEXTSEL) << (4U * 1UL)) | \ | |||
((ADC_JSQR_JEXTSEL) << (4U * 2UL)) | \ | |||
((ADC_JSQR_JEXTSEL) << (4U * 3UL)) ) | |||
#define ADC_INJ_TRIG_SOURCE_MASK (((LL_ADC_INJ_TRIG_SOFTWARE & ADC_JSQR_JEXTSEL) << (4U * 0UL)) | \ | |||
((ADC_JSQR_JEXTSEL) << (4U * 1UL)) | \ | |||
((ADC_JSQR_JEXTSEL) << (4U * 2UL)) | \ | |||
((ADC_JSQR_JEXTSEL) << (4U * 3UL)) ) | |||
/* Mask containing trigger edge masks for each of possible */ | |||
/* trigger edge selection duplicated with shifts [0; 4; 8; 12] */ | |||
@@ -367,7 +367,7 @@ extern "C" { | |||
* @retval Pointer to register address | |||
*/ | |||
#define __ADC_PTR_REG_OFFSET(__REG__, __REG_OFFFSET__) \ | |||
((__IO uint32_t *)((uint32_t) ((uint32_t)(&(__REG__)) + ((__REG_OFFFSET__) << 2UL)))) | |||
((__IO uint32_t *)((uint32_t) ((uint32_t)(&(__REG__)) + ((__REG_OFFFSET__) << 2UL)))) | |||
/** | |||
* @} | |||
@@ -762,8 +762,8 @@ typedef struct | |||
*/ | |||
/** @defgroup ADC_LL_EC_REG_CONTINUOUS_MODE ADC group regular - Continuous mode | |||
* @{ | |||
*/ | |||
* @{ | |||
*/ | |||
#define LL_ADC_REG_CONV_SINGLE (0x00000000UL) /*!< ADC conversions are performed in single mode: one conversion per trigger */ | |||
#define LL_ADC_REG_CONV_CONTINUOUS (ADC_CFGR_CONT) /*!< ADC conversions are performed in continuous mode: after the first trigger, following conversions launched successively automatically */ | |||
/** | |||
@@ -783,8 +783,8 @@ typedef struct | |||
/** @defgroup ADC_LL_EC_REG_OVR_DATA_BEHAVIOR ADC group regular - Overrun behavior on conversion data | |||
* @{ | |||
*/ | |||
* @{ | |||
*/ | |||
#define LL_ADC_REG_OVR_DATA_PRESERVED (0x00000000UL) /*!< ADC group regular behavior in case of overrun: data preserved */ | |||
#define LL_ADC_REG_OVR_DATA_OVERWRITTEN (ADC_CFGR_OVRMOD) /*!< ADC group regular behavior in case of overrun: data overwritten */ | |||
/** | |||
@@ -878,8 +878,8 @@ typedef struct | |||
*/ | |||
/** @defgroup ADC_LL_EC_INJ_TRIG_AUTO ADC group injected - Automatic trigger mode | |||
* @{ | |||
*/ | |||
* @{ | |||
*/ | |||
#define LL_ADC_INJ_TRIG_INDEPENDENT (0x00000000UL) /*!< ADC group injected conversion trigger independent. Setting mandatory if ADC group injected injected trigger source is set to an external trigger. */ | |||
#define LL_ADC_INJ_TRIG_FROM_GRP_REGULAR (ADC_CFGR_JAUTO) /*!< ADC group injected conversion trigger from ADC group regular. Setting compliant only with group injected trigger source set to SW start, without any further action on ADC group injected conversion start or stop: in this case, ADC group injected is controlled only from ADC group regular. */ | |||
/** | |||
@@ -1236,13 +1236,13 @@ typedef struct | |||
*/ | |||
#define __LL_ADC_CHANNEL_TO_DECIMAL_NB(__CHANNEL__) \ | |||
((((__CHANNEL__) & ADC_CHANNEL_ID_BITFIELD_MASK) == 0UL) \ | |||
? ( \ | |||
? ( \ | |||
((__CHANNEL__) & ADC_CHANNEL_ID_NUMBER_MASK) >> ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS \ | |||
) \ | |||
: \ | |||
( \ | |||
) \ | |||
: \ | |||
( \ | |||
(uint32_t)POSITION_VAL((__CHANNEL__)) \ | |||
) \ | |||
) \ | |||
) | |||
/** | |||
@@ -1272,7 +1272,7 @@ typedef struct | |||
* @arg @ref LL_ADC_CHANNEL_16 | |||
* @arg @ref LL_ADC_CHANNEL_17 | |||
* @arg @ref LL_ADC_CHANNEL_18 | |||
* @arg @ref LL_ADC_CHANNEL_VREFINT (1) | |||
* @arg @ref LL_ADC_CHANNEL_VREFINT (4) | |||
* @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (4) | |||
* @arg @ref LL_ADC_CHANNEL_VBAT (4) | |||
* | |||
@@ -1284,17 +1284,17 @@ typedef struct | |||
*/ | |||
#define __LL_ADC_DECIMAL_NB_TO_CHANNEL(__DECIMAL_NB__) \ | |||
(((__DECIMAL_NB__) <= 9UL) \ | |||
? ( \ | |||
? ( \ | |||
((__DECIMAL_NB__) << ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS) | \ | |||
(ADC_AWD2CR_AWD2CH_0 << (__DECIMAL_NB__)) | \ | |||
(ADC_SMPR1_REGOFFSET | (((3UL * (__DECIMAL_NB__))) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) \ | |||
) \ | |||
: \ | |||
( \ | |||
) \ | |||
: \ | |||
( \ | |||
((__DECIMAL_NB__) << ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS) | \ | |||
(ADC_AWD2CR_AWD2CH_0 << (__DECIMAL_NB__)) | \ | |||
(ADC_SMPR2_REGOFFSET | (((3UL * ((__DECIMAL_NB__) - 10UL))) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) \ | |||
) \ | |||
) \ | |||
) | |||
/** | |||
@@ -1466,7 +1466,7 @@ typedef struct | |||
* @arg @ref LL_ADC_CHANNEL_16 | |||
* @arg @ref LL_ADC_CHANNEL_17 | |||
* @arg @ref LL_ADC_CHANNEL_18 | |||
* @arg @ref LL_ADC_CHANNEL_VREFINT (1) | |||
* @arg @ref LL_ADC_CHANNEL_VREFINT (4) | |||
* @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (4) | |||
* @arg @ref LL_ADC_CHANNEL_VBAT (4) | |||
* | |||
@@ -1555,12 +1555,12 @@ typedef struct | |||
*/ | |||
#define __LL_ADC_ANALOGWD_CHANNEL_GROUP(__CHANNEL__, __GROUP__) \ | |||
(((__GROUP__) == LL_ADC_GROUP_REGULAR) \ | |||
? (((__CHANNEL__) & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) \ | |||
: \ | |||
((__GROUP__) == LL_ADC_GROUP_INJECTED) \ | |||
? (((__CHANNEL__) & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) \ | |||
: \ | |||
(((__CHANNEL__) & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) \ | |||
? (((__CHANNEL__) & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) \ | |||
: \ | |||
((__GROUP__) == LL_ADC_GROUP_INJECTED) \ | |||
? (((__CHANNEL__) & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) \ | |||
: \ | |||
(((__CHANNEL__) & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) \ | |||
) | |||
/** | |||
@@ -1784,10 +1784,9 @@ typedef struct | |||
#define __LL_ADC_CALC_VREFANALOG_VOLTAGE(__VREFINT_ADC_DATA__,\ | |||
__ADC_RESOLUTION__) \ | |||
(((uint32_t)(*VREFINT_CAL_ADDR) * VREFINT_CAL_VREF) \ | |||
/ __LL_ADC_CONVERT_DATA_RESOLUTION((__VREFINT_ADC_DATA__), \ | |||
(__ADC_RESOLUTION__), \ | |||
LL_ADC_RESOLUTION_12B) \ | |||
) | |||
/ __LL_ADC_CONVERT_DATA_RESOLUTION((__VREFINT_ADC_DATA__), \ | |||
(__ADC_RESOLUTION__), \ | |||
LL_ADC_RESOLUTION_12B)) | |||
/** | |||
* @brief Helper macro to calculate the temperature (unit: degree Celsius) | |||
@@ -1975,6 +1974,10 @@ __STATIC_INLINE uint32_t LL_ADC_DMA_GetRegAddr(ADC_TypeDef *ADCx, uint32_t Regis | |||
/** | |||
* @brief Set parameter common to several ADC: Clock source and prescaler. | |||
* @note ADC clock source and prescaler must be selected in function of system clock to not exceed ADC maximum frequency, depending on devices. | |||
* Example: STM32WB55xx ADC maximum frequency is 64MHz (corresponding to 4.27Msmp/s maximum) | |||
* Example: STM32WB50xx ADC maximum frequency is 32MHz (corresponding to 2.13Msmp/s maximum) | |||
* For ADC maximum frequency, refer to datasheet of the selected device. | |||
* @note On this STM32 serie, if ADC group injected is used, some | |||
* clock ratio constraints between ADC clock and AHB clock | |||
* must be respected. | |||
@@ -2041,11 +2044,13 @@ __STATIC_INLINE uint32_t LL_ADC_GetCommonClock(ADC_Common_TypeDef *ADCxy_COMMON) | |||
} | |||
/** | |||
* @brief Set parameter common to several ADC: measurement path to internal | |||
* channels (VrefInt, temperature sensor, ...). | |||
* @brief Set parameter common to several ADC: measurement path to | |||
* internal channels (VrefInt, temperature sensor, ...). | |||
* Configure all paths (overwrite current configuration). | |||
* @note One or several values can be selected. | |||
* Example: (LL_ADC_PATH_INTERNAL_VREFINT | | |||
* LL_ADC_PATH_INTERNAL_TEMPSENSOR) | |||
* The values not selected are removed from configuration. | |||
* @note Stabilization time of measurement path to internal channel: | |||
* After enabling internal paths, before starting ADC conversion, | |||
* a delay is required for internal voltage reference and | |||
@@ -2080,6 +2085,77 @@ __STATIC_INLINE void LL_ADC_SetCommonPathInternalCh(ADC_Common_TypeDef *ADCxy_CO | |||
MODIFY_REG(ADCxy_COMMON->CCR, ADC_CCR_VREFEN | ADC_CCR_TSEN | ADC_CCR_VBATEN, PathInternal); | |||
} | |||
/** | |||
* @brief Set parameter common to several ADC: measurement path to | |||
* internal channels (VrefInt, temperature sensor, ...). | |||
* Add paths to the current configuration. | |||
* @note One or several values can be selected. | |||
* Example: (LL_ADC_PATH_INTERNAL_VREFINT | | |||
* LL_ADC_PATH_INTERNAL_TEMPSENSOR) | |||
* @note Stabilization time of measurement path to internal channel: | |||
* After enabling internal paths, before starting ADC conversion, | |||
* a delay is required for internal voltage reference and | |||
* temperature sensor stabilization time. | |||
* Refer to device datasheet. | |||
* Refer to literal @ref LL_ADC_DELAY_VREFINT_STAB_US. | |||
* Refer to literal @ref LL_ADC_DELAY_TEMPSENSOR_STAB_US. | |||
* @note ADC internal channel sampling time constraint: | |||
* For ADC conversion of internal channels, | |||
* a sampling time minimum value is required. | |||
* Refer to device datasheet. | |||
* @note On this STM32 serie, setting of this feature is conditioned to | |||
* ADC state: | |||
* All ADC instances of the ADC common group must be disabled. | |||
* This check can be done with function @ref LL_ADC_IsEnabled() for each | |||
* ADC instance or by using helper macro helper macro | |||
* @ref __LL_ADC_IS_ENABLED_ALL_COMMON_INSTANCE(). | |||
* @rmtoll CCR VREFEN LL_ADC_SetCommonPathInternalChAdd\n | |||
* CCR TSEN LL_ADC_SetCommonPathInternalChAdd\n | |||
* CCR VBATEN LL_ADC_SetCommonPathInternalChAdd | |||
* @param ADCxy_COMMON ADC common instance | |||
* (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) | |||
* @param PathInternal This parameter can be a combination of the following values: | |||
* @arg @ref LL_ADC_PATH_INTERNAL_NONE | |||
* @arg @ref LL_ADC_PATH_INTERNAL_VREFINT | |||
* @arg @ref LL_ADC_PATH_INTERNAL_TEMPSENSOR | |||
* @arg @ref LL_ADC_PATH_INTERNAL_VBAT | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_ADC_SetCommonPathInternalChAdd(ADC_Common_TypeDef *ADCxy_COMMON, uint32_t PathInternal) | |||
{ | |||
SET_BIT(ADCxy_COMMON->CCR, PathInternal); | |||
} | |||
/** | |||
* @brief Set parameter common to several ADC: measurement path to | |||
* internal channels (VrefInt, temperature sensor, ...). | |||
* Remove paths to the current configuration. | |||
* @note One or several values can be selected. | |||
* Example: (LL_ADC_PATH_INTERNAL_VREFINT | | |||
* LL_ADC_PATH_INTERNAL_TEMPSENSOR) | |||
* @note On this STM32 serie, setting of this feature is conditioned to | |||
* ADC state: | |||
* All ADC instances of the ADC common group must be disabled. | |||
* This check can be done with function @ref LL_ADC_IsEnabled() for each | |||
* ADC instance or by using helper macro helper macro | |||
* @ref __LL_ADC_IS_ENABLED_ALL_COMMON_INSTANCE(). | |||
* @rmtoll CCR VREFEN LL_ADC_SetCommonPathInternalChRem\n | |||
* CCR TSEN LL_ADC_SetCommonPathInternalChRem\n | |||
* CCR VBATEN LL_ADC_SetCommonPathInternalChRem | |||
* @param ADCxy_COMMON ADC common instance | |||
* (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) | |||
* @param PathInternal This parameter can be a combination of the following values: | |||
* @arg @ref LL_ADC_PATH_INTERNAL_NONE | |||
* @arg @ref LL_ADC_PATH_INTERNAL_VREFINT | |||
* @arg @ref LL_ADC_PATH_INTERNAL_TEMPSENSOR | |||
* @arg @ref LL_ADC_PATH_INTERNAL_VBAT | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_ADC_SetCommonPathInternalChRem(ADC_Common_TypeDef *ADCxy_COMMON, uint32_t PathInternal) | |||
{ | |||
CLEAR_BIT(ADCxy_COMMON->CCR, PathInternal); | |||
} | |||
/** | |||
* @brief Get parameter common to several ADC: measurement path to internal | |||
* channels (VrefInt, temperature sensor, ...). | |||
@@ -2264,9 +2340,12 @@ __STATIC_INLINE uint32_t LL_ADC_GetDataAlignment(ADC_TypeDef *ADCx) | |||
* Moreover, this avoids risk of overrun for low frequency | |||
* applications. | |||
* How to use this low power mode: | |||
* - Do not use with interruption or DMA since these modes | |||
* have to clear immediately the EOC flag to free the | |||
* IRQ vector sequencer. | |||
* - It is not recommended to use with interruption or DMA | |||
* since these modes have to clear immediately the EOC flag | |||
* (by CPU to free the IRQ pending event or by DMA). | |||
* Auto wait will work but fort a very short time, discarding | |||
* its intended benefit (except specific case of high load of CPU | |||
* or DMA transfers which can justify usage of auto wait). | |||
* - Do use with polling: 1. Start conversion, | |||
* 2. Later on, when conversion data is needed: poll for end of | |||
* conversion to ensure that conversion is completed and | |||
@@ -2317,9 +2396,12 @@ __STATIC_INLINE void LL_ADC_SetLowPowerMode(ADC_TypeDef *ADCx, uint32_t LowPower | |||
* Moreover, this avoids risk of overrun for low frequency | |||
* applications. | |||
* How to use this low power mode: | |||
* - Do not use with interruption or DMA since these modes | |||
* have to clear immediately the EOC flag to free the | |||
* IRQ vector sequencer. | |||
* - It is not recommended to use with interruption or DMA | |||
* since these modes have to clear immediately the EOC flag | |||
* (by CPU to free the IRQ pending event or by DMA). | |||
* Auto wait will work but fort a very short time, discarding | |||
* its intended benefit (except specific case of high load of CPU | |||
* or DMA transfers which can justify usage of auto wait). | |||
* - Do use with polling: 1. Start conversion, | |||
* 2. Later on, when conversion data is needed: poll for end of | |||
* conversion to ensure that conversion is completed and | |||
@@ -2473,7 +2555,7 @@ __STATIC_INLINE void LL_ADC_SetOffset(ADC_TypeDef *ADCx, uint32_t Offsety, uint3 | |||
* @arg @ref LL_ADC_CHANNEL_16 | |||
* @arg @ref LL_ADC_CHANNEL_17 | |||
* @arg @ref LL_ADC_CHANNEL_18 | |||
* @arg @ref LL_ADC_CHANNEL_VREFINT (1) | |||
* @arg @ref LL_ADC_CHANNEL_VREFINT (4) | |||
* @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (4) | |||
* @arg @ref LL_ADC_CHANNEL_VBAT (4) | |||
* | |||
@@ -3050,7 +3132,7 @@ __STATIC_INLINE void LL_ADC_REG_SetSequencerRanks(ADC_TypeDef *ADCx, uint32_t Ra | |||
* @arg @ref LL_ADC_CHANNEL_16 | |||
* @arg @ref LL_ADC_CHANNEL_17 | |||
* @arg @ref LL_ADC_CHANNEL_18 | |||
* @arg @ref LL_ADC_CHANNEL_VREFINT (1) | |||
* @arg @ref LL_ADC_CHANNEL_VREFINT (4) | |||
* @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (4) | |||
* @arg @ref LL_ADC_CHANNEL_VBAT (4) | |||
* | |||
@@ -3064,10 +3146,10 @@ __STATIC_INLINE uint32_t LL_ADC_REG_GetSequencerRanks(ADC_TypeDef *ADCx, uint32_ | |||
{ | |||
register const __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->SQR1, ((Rank & ADC_REG_SQRX_REGOFFSET_MASK) >> ADC_SQRX_REGOFFSET_POS)); | |||
return (uint32_t) ((READ_BIT(*preg, | |||
return (uint32_t)((READ_BIT(*preg, | |||
ADC_CHANNEL_ID_NUMBER_MASK_POSBIT0 << (Rank & ADC_REG_RANK_ID_SQRX_MASK)) | |||
>> (Rank & ADC_REG_RANK_ID_SQRX_MASK)) << ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS | |||
); | |||
); | |||
} | |||
/** | |||
@@ -3545,7 +3627,7 @@ __STATIC_INLINE void LL_ADC_INJ_SetSequencerRanks(ADC_TypeDef *ADCx, uint32_t Ra | |||
* @arg @ref LL_ADC_CHANNEL_16 | |||
* @arg @ref LL_ADC_CHANNEL_17 | |||
* @arg @ref LL_ADC_CHANNEL_18 | |||
* @arg @ref LL_ADC_CHANNEL_VREFINT (1) | |||
* @arg @ref LL_ADC_CHANNEL_VREFINT (4) | |||
* @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (4) | |||
* @arg @ref LL_ADC_CHANNEL_VBAT (4) | |||
* | |||
@@ -3558,8 +3640,8 @@ __STATIC_INLINE void LL_ADC_INJ_SetSequencerRanks(ADC_TypeDef *ADCx, uint32_t Ra | |||
__STATIC_INLINE uint32_t LL_ADC_INJ_GetSequencerRanks(ADC_TypeDef *ADCx, uint32_t Rank) | |||
{ | |||
return (uint32_t)((READ_BIT(ADCx->JSQR, | |||
(ADC_CHANNEL_ID_NUMBER_MASK >> ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS) << (Rank & ADC_INJ_RANK_ID_JSQR_MASK)) | |||
>> (Rank & ADC_INJ_RANK_ID_JSQR_MASK)) << ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS | |||
(ADC_CHANNEL_ID_NUMBER_MASK >> ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS) << (Rank & ADC_INJ_RANK_ID_JSQR_MASK)) | |||
>> (Rank & ADC_INJ_RANK_ID_JSQR_MASK)) << ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS | |||
); | |||
} | |||
@@ -3850,15 +3932,15 @@ __STATIC_INLINE void LL_ADC_INJ_ConfigQueueContext(ADC_TypeDef *ADCx, | |||
/* If parameter "TriggerSource" is set to SW start, then parameter */ | |||
/* "ExternalTriggerEdge" is discarded. */ | |||
register uint32_t is_trigger_not_sw = (uint32_t)((TriggerSource != LL_ADC_INJ_TRIG_SOFTWARE) ? 1UL : 0UL); | |||
MODIFY_REG(ADCx->JSQR , | |||
MODIFY_REG(ADCx->JSQR, | |||
ADC_JSQR_JEXTSEL | | |||
ADC_JSQR_JEXTEN | | |||
ADC_JSQR_JSQ4 | | |||
ADC_JSQR_JSQ3 | | |||
ADC_JSQR_JSQ2 | | |||
ADC_JSQR_JSQ1 | | |||
ADC_JSQR_JL , | |||
TriggerSource | | |||
ADC_JSQR_JL, | |||
(TriggerSource & ADC_JSQR_JEXTSEL) | | |||
(ExternalTriggerEdge * (is_trigger_not_sw)) | | |||
(((Rank4_Channel & ADC_CHANNEL_ID_NUMBER_MASK) >> ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS) << (LL_ADC_INJ_RANK_4 & ADC_INJ_RANK_ID_JSQR_MASK)) | | |||
(((Rank3_Channel & ADC_CHANNEL_ID_NUMBER_MASK) >> ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS) << (LL_ADC_INJ_RANK_3 & ADC_INJ_RANK_ID_JSQR_MASK)) | | |||
@@ -4287,7 +4369,7 @@ __STATIC_INLINE void LL_ADC_SetAnalogWDMonitChannels(ADC_TypeDef *ADCx, uint32_t | |||
/* Parameters "AWDChannelGroup" and "AWDy" are used with masks because */ | |||
/* containing other bits reserved for other purpose. */ | |||
register __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->CFGR, ((AWDy & ADC_AWD_CRX_REGOFFSET_MASK) >> ADC_AWD_CRX_REGOFFSET_POS) | |||
+ ((AWDy & ADC_AWD_CR12_REGOFFSETGAP_MASK) * ADC_AWD_CR12_REGOFFSETGAP_VAL)); | |||
+ ((AWDy & ADC_AWD_CR12_REGOFFSETGAP_MASK) * ADC_AWD_CR12_REGOFFSETGAP_VAL)); | |||
MODIFY_REG(*preg, | |||
(AWDy & ADC_AWD_CR_ALL_CHANNEL_MASK), | |||
@@ -4419,7 +4501,7 @@ __STATIC_INLINE void LL_ADC_SetAnalogWDMonitChannels(ADC_TypeDef *ADCx, uint32_t | |||
__STATIC_INLINE uint32_t LL_ADC_GetAnalogWDMonitChannels(ADC_TypeDef *ADCx, uint32_t AWDy) | |||
{ | |||
register const __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->CFGR, ((AWDy & ADC_AWD_CRX_REGOFFSET_MASK) >> ADC_AWD_CRX_REGOFFSET_POS) | |||
+ ((AWDy & ADC_AWD_CR12_REGOFFSETGAP_MASK) * ADC_AWD_CR12_REGOFFSETGAP_VAL)); | |||
+ ((AWDy & ADC_AWD_CR12_REGOFFSETGAP_MASK) * ADC_AWD_CR12_REGOFFSETGAP_VAL)); | |||
register uint32_t AnalogWDMonitChannels = (READ_BIT(*preg, AWDy) & AWDy & ADC_AWD_CR_ALL_CHANNEL_MASK); | |||
@@ -4427,14 +4509,14 @@ __STATIC_INLINE uint32_t LL_ADC_GetAnalogWDMonitChannels(ADC_TypeDef *ADCx, uint | |||
/* (parameter value LL_ADC_AWD_DISABLE). */ | |||
/* Else, the selected AWD is enabled and is monitoring a group of channels */ | |||
/* or a single channel. */ | |||
if(AnalogWDMonitChannels != 0UL) | |||
if (AnalogWDMonitChannels != 0UL) | |||
{ | |||
if(AWDy == LL_ADC_AWD1) | |||
if (AWDy == LL_ADC_AWD1) | |||
{ | |||
if((AnalogWDMonitChannels & ADC_CFGR_AWD1SGL) == 0UL) | |||
if ((AnalogWDMonitChannels & ADC_CFGR_AWD1SGL) == 0UL) | |||
{ | |||
/* AWD monitoring a group of channels */ | |||
AnalogWDMonitChannels = (( AnalogWDMonitChannels | |||
AnalogWDMonitChannels = ((AnalogWDMonitChannels | |||
| (ADC_AWD_CR23_CHANNEL_MASK) | |||
) | |||
& (~(ADC_CFGR_AWD1CH)) | |||
@@ -4450,10 +4532,10 @@ __STATIC_INLINE uint32_t LL_ADC_GetAnalogWDMonitChannels(ADC_TypeDef *ADCx, uint | |||
} | |||
else | |||
{ | |||
if((AnalogWDMonitChannels & ADC_AWD_CR23_CHANNEL_MASK) == ADC_AWD_CR23_CHANNEL_MASK) | |||
if ((AnalogWDMonitChannels & ADC_AWD_CR23_CHANNEL_MASK) == ADC_AWD_CR23_CHANNEL_MASK) | |||
{ | |||
/* AWD monitoring a group of channels */ | |||
AnalogWDMonitChannels = ( ADC_AWD_CR23_CHANNEL_MASK | |||
AnalogWDMonitChannels = (ADC_AWD_CR23_CHANNEL_MASK | |||
| ((ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN)) | |||
); | |||
} | |||
@@ -4461,7 +4543,7 @@ __STATIC_INLINE uint32_t LL_ADC_GetAnalogWDMonitChannels(ADC_TypeDef *ADCx, uint | |||
{ | |||
/* AWD monitoring a single channel */ | |||
/* AWD monitoring a group of channels */ | |||
AnalogWDMonitChannels = ( AnalogWDMonitChannels | |||
AnalogWDMonitChannels = (AnalogWDMonitChannels | |||
| (ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) | |||
| (__LL_ADC_CHANNEL_TO_DECIMAL_NB(AnalogWDMonitChannels) << ADC_CFGR_AWD1CH_Pos) | |||
); | |||
@@ -4524,7 +4606,8 @@ __STATIC_INLINE uint32_t LL_ADC_GetAnalogWDMonitChannels(ADC_TypeDef *ADCx, uint | |||
* @param AWDThresholdLowValue Value between Min_Data=0x000 and Max_Data=0xFFF | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_ADC_ConfigAnalogWDThresholds(ADC_TypeDef *ADCx, uint32_t AWDy, uint32_t AWDThresholdHighValue, uint32_t AWDThresholdLowValue) | |||
__STATIC_INLINE void LL_ADC_ConfigAnalogWDThresholds(ADC_TypeDef *ADCx, uint32_t AWDy, uint32_t AWDThresholdHighValue, | |||
uint32_t AWDThresholdLowValue) | |||
{ | |||
/* Set bits with content of parameter "AWDThresholdxxxValue" with bits */ | |||
/* position in register and register position depending on parameter */ | |||
@@ -4592,7 +4675,8 @@ __STATIC_INLINE void LL_ADC_ConfigAnalogWDThresholds(ADC_TypeDef *ADCx, uint32_t | |||
* @param AWDThresholdValue Value between Min_Data=0x000 and Max_Data=0xFFF | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_ADC_SetAnalogWDThresholds(ADC_TypeDef *ADCx, uint32_t AWDy, uint32_t AWDThresholdsHighLow, uint32_t AWDThresholdValue) | |||
__STATIC_INLINE void LL_ADC_SetAnalogWDThresholds(ADC_TypeDef *ADCx, uint32_t AWDy, uint32_t AWDThresholdsHighLow, | |||
uint32_t AWDThresholdValue) | |||
{ | |||
/* Set bits with content of parameter "AWDThresholdValue" with bits */ | |||
/* position in register and register position depending on parameters */ | |||
@@ -4633,7 +4717,7 @@ __STATIC_INLINE void LL_ADC_SetAnalogWDThresholds(ADC_TypeDef *ADCx, uint32_t AW | |||
* @arg @ref LL_ADC_AWD_THRESHOLD_LOW | |||
* @arg @ref LL_ADC_AWD_THRESHOLDS_HIGH_LOW | |||
* @retval Value between Min_Data=0x000 and Max_Data=0xFFF | |||
*/ | |||
*/ | |||
__STATIC_INLINE uint32_t LL_ADC_GetAnalogWDThresholds(ADC_TypeDef *ADCx, uint32_t AWDy, uint32_t AWDThresholdsHighLow) | |||
{ | |||
register const __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->TR1, ((AWDy & ADC_AWD_TRX_REGOFFSET_MASK) >> ADC_AWD_TRX_REGOFFSET_POS)); | |||
@@ -4806,7 +4890,7 @@ __STATIC_INLINE void LL_ADC_ConfigOverSamplingRatioShift(ADC_TypeDef *ADCx, uint | |||
* @arg @ref LL_ADC_OVS_RATIO_64 | |||
* @arg @ref LL_ADC_OVS_RATIO_128 | |||
* @arg @ref LL_ADC_OVS_RATIO_256 | |||
*/ | |||
*/ | |||
__STATIC_INLINE uint32_t LL_ADC_GetOverSamplingRatio(ADC_TypeDef *ADCx) | |||
{ | |||
return (uint32_t)(READ_BIT(ADCx->CFGR2, ADC_CFGR2_OVSR)); | |||
@@ -4827,7 +4911,7 @@ __STATIC_INLINE uint32_t LL_ADC_GetOverSamplingRatio(ADC_TypeDef *ADCx) | |||
* @arg @ref LL_ADC_OVS_SHIFT_RIGHT_6 | |||
* @arg @ref LL_ADC_OVS_SHIFT_RIGHT_7 | |||
* @arg @ref LL_ADC_OVS_SHIFT_RIGHT_8 | |||
*/ | |||
*/ | |||
__STATIC_INLINE uint32_t LL_ADC_GetOverSamplingShift(ADC_TypeDef *ADCx) | |||
{ | |||
return (uint32_t)(READ_BIT(ADCx->CFGR2, ADC_CFGR2_OVSS)); | |||
@@ -5291,7 +5375,7 @@ __STATIC_INLINE uint32_t LL_ADC_INJ_IsStopConversionOngoing(ADC_TypeDef *ADCx) | |||
} | |||
/** | |||
* @brief Get ADC group regular conversion data, range fit for | |||
* @brief Get ADC group injected conversion data, range fit for | |||
* all ADC configurations: all ADC resolutions and | |||
* all oversampling increased data width (for devices | |||
* with feature oversampling). | |||
@@ -73,8 +73,11 @@ extern "C" { | |||
* @{ | |||
*/ | |||
#define LL_AHB1_GRP1_PERIPH_ALL (0xFFFFFFFFU) | |||
#define LL_AHB1_GRP1_PERIPH_DMA1 RCC_AHB1ENR_DMA1EN | |||
#if defined(DMA2) | |||
#define LL_AHB1_GRP1_PERIPH_DMA2 RCC_AHB1ENR_DMA2EN | |||
#endif | |||
#define LL_AHB1_GRP1_PERIPH_DMAMUX1 RCC_AHB1ENR_DMAMUX1EN | |||
#define LL_AHB1_GRP1_PERIPH_SRAM1 RCC_AHB1SMENR_SRAM1SMEN | |||
#define LL_AHB1_GRP1_PERIPH_CRC RCC_AHB1ENR_CRCEN | |||
@@ -87,14 +90,19 @@ extern "C" { | |||
* @{ | |||
*/ | |||
#define LL_AHB2_GRP1_PERIPH_ALL (0xFFFFFFFFU) | |||
#define LL_AHB2_GRP1_PERIPH_GPIOA RCC_AHB2ENR_GPIOAEN | |||
#define LL_AHB2_GRP1_PERIPH_GPIOB RCC_AHB2ENR_GPIOBEN | |||
#define LL_AHB2_GRP1_PERIPH_GPIOC RCC_AHB2ENR_GPIOCEN | |||
#if defined(GPIOD) | |||
#define LL_AHB2_GRP1_PERIPH_GPIOD RCC_AHB2ENR_GPIODEN | |||
#endif | |||
#define LL_AHB2_GRP1_PERIPH_GPIOE RCC_AHB2ENR_GPIOEEN | |||
#define LL_AHB2_GRP1_PERIPH_GPIOH RCC_AHB2ENR_GPIOHEN | |||
#define LL_AHB2_GRP1_PERIPH_ADC RCC_AHB2ENR_ADCEN | |||
#if defined(AES1) | |||
#define LL_AHB2_GRP1_PERIPH_AES1 RCC_AHB2ENR_AES1EN | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
@@ -103,7 +111,9 @@ extern "C" { | |||
* @{ | |||
*/ | |||
#define LL_AHB3_GRP1_PERIPH_ALL (0xFFFFFFFFU) | |||
#if defined(QUADSPI) | |||
#define LL_AHB3_GRP1_PERIPH_QUADSPI RCC_AHB3ENR_QUADSPIEN | |||
#endif | |||
#define LL_AHB3_GRP1_PERIPH_PKA RCC_AHB3ENR_PKAEN | |||
#define LL_AHB3_GRP1_PERIPH_AES2 RCC_AHB3ENR_AES2EN | |||
#define LL_AHB3_GRP1_PERIPH_RNG RCC_AHB3ENR_RNGEN | |||
@@ -120,14 +130,24 @@ extern "C" { | |||
*/ | |||
#define LL_APB1_GRP1_PERIPH_ALL (0xFFFFFFFFU) | |||
#define LL_APB1_GRP1_PERIPH_TIM2 RCC_APB1ENR1_TIM2EN | |||
#if defined(LCD) | |||
#define LL_APB1_GRP1_PERIPH_LCD RCC_APB1ENR1_LCDEN | |||
#endif | |||
#define LL_APB1_GRP1_PERIPH_RTCAPB RCC_APB1ENR1_RTCAPBEN | |||
#define LL_APB1_GRP1_PERIPH_WWDG RCC_APB1ENR1_WWDGEN | |||
#if defined(SPI2) | |||
#define LL_APB1_GRP1_PERIPH_SPI2 RCC_APB1ENR1_SPI2EN | |||
#endif | |||
#define LL_APB1_GRP1_PERIPH_I2C1 RCC_APB1ENR1_I2C1EN | |||
#if defined(I2C3) | |||
#define LL_APB1_GRP1_PERIPH_I2C3 RCC_APB1ENR1_I2C3EN | |||
#endif | |||
#if defined(CRS) | |||
#define LL_APB1_GRP1_PERIPH_CRS RCC_APB1ENR1_CRSEN | |||
#endif | |||
#if defined(USB) | |||
#define LL_APB1_GRP1_PERIPH_USB RCC_APB1ENR1_USBEN | |||
#endif | |||
#define LL_APB1_GRP1_PERIPH_LPTIM1 RCC_APB1ENR1_LPTIM1EN | |||
/** | |||
* @} | |||
@@ -138,7 +158,10 @@ extern "C" { | |||
* @{ | |||
*/ | |||
#define LL_APB1_GRP2_PERIPH_ALL (0xFFFFFFFFU) | |||
#if defined(LPUART1) | |||
#define LL_APB1_GRP2_PERIPH_LPUART1 RCC_APB1ENR2_LPUART1EN | |||
#endif | |||
#define LL_APB1_GRP2_PERIPH_LPTIM2 RCC_APB1ENR2_LPTIM2EN | |||
/** | |||
* @} | |||
@@ -148,12 +171,15 @@ extern "C" { | |||
* @{ | |||
*/ | |||
#define LL_APB2_GRP1_PERIPH_ALL (0xFFFFFFFFU) | |||
#define LL_APB2_GRP1_PERIPH_TIM1 RCC_APB2ENR_TIM1EN | |||
#define LL_APB2_GRP1_PERIPH_SPI1 RCC_APB2ENR_SPI1EN | |||
#define LL_APB2_GRP1_PERIPH_USART1 RCC_APB2ENR_USART1EN | |||
#define LL_APB2_GRP1_PERIPH_TIM16 RCC_APB2ENR_TIM16EN | |||
#define LL_APB2_GRP1_PERIPH_TIM17 RCC_APB2ENR_TIM17EN | |||
#if defined(SAI1) | |||
#define LL_APB2_GRP1_PERIPH_SAI1 RCC_APB2ENR_SAI1EN | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
@@ -172,7 +198,9 @@ extern "C" { | |||
* @{ | |||
*/ | |||
#define LL_C2_AHB1_GRP1_PERIPH_DMA1 RCC_C2AHB1ENR_DMA1EN | |||
#if defined(DMA2) | |||
#define LL_C2_AHB1_GRP1_PERIPH_DMA2 RCC_C2AHB1ENR_DMA2EN | |||
#endif | |||
#define LL_C2_AHB1_GRP1_PERIPH_DMAMUX1 RCC_C2AHB1ENR_DMAMUX1EN | |||
#define LL_C2_AHB1_GRP1_PERIPH_SRAM1 RCC_C2AHB1ENR_SRAM1EN | |||
#define LL_C2_AHB1_GRP1_PERIPH_CRC RCC_C2AHB1ENR_CRCEN | |||
@@ -188,11 +216,15 @@ extern "C" { | |||
#define LL_C2_AHB2_GRP1_PERIPH_GPIOA RCC_C2AHB2ENR_GPIOAEN | |||
#define LL_C2_AHB2_GRP1_PERIPH_GPIOB RCC_C2AHB2ENR_GPIOBEN | |||
#define LL_C2_AHB2_GRP1_PERIPH_GPIOC RCC_C2AHB2ENR_GPIOCEN | |||
#if defined(GPIOD) | |||
#define LL_C2_AHB2_GRP1_PERIPH_GPIOD RCC_C2AHB2ENR_GPIODEN | |||
#endif | |||
#define LL_C2_AHB2_GRP1_PERIPH_GPIOE RCC_C2AHB2ENR_GPIOEEN | |||
#define LL_C2_AHB2_GRP1_PERIPH_GPIOH RCC_C2AHB2ENR_GPIOHEN | |||
#define LL_C2_AHB2_GRP1_PERIPH_ADC RCC_C2AHB2ENR_ADCEN | |||
#if defined(AES1) | |||
#define LL_C2_AHB2_GRP1_PERIPH_AES1 RCC_C2AHB2ENR_AES1EN | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
@@ -217,13 +249,19 @@ extern "C" { | |||
* @{ | |||
*/ | |||
#define LL_C2_APB1_GRP1_PERIPH_TIM2 RCC_C2APB1ENR1_TIM2EN | |||
#if defined(LCD) | |||
#define LL_C2_APB1_GRP1_PERIPH_LCD RCC_C2APB1ENR1_LCDEN | |||
#endif | |||
#define LL_C2_APB1_GRP1_PERIPH_RTCAPB RCC_C2APB1ENR1_RTCAPBEN | |||
#if defined(SPI2) | |||
#define LL_C2_APB1_GRP1_PERIPH_SPI2 RCC_C2APB1ENR1_SPI2EN | |||
#endif | |||
#define LL_C2_APB1_GRP1_PERIPH_I2C1 RCC_C2APB1ENR1_I2C1EN | |||
#if defined(I2C3) | |||
#define LL_C2_APB1_GRP1_PERIPH_I2C3 RCC_C2APB1ENR1_I2C3EN | |||
#define LL_C2_APB1_GRP1_PERIPH_CRS RCC_C2APB1ENR1_CRSEN | |||
#define LL_C2_APB1_GRP1_PERIPH_USB RCC_C2APB1ENR1_USBEN | |||
#endif | |||
#define LL_C2_APB1_GRP1_PERIPH_LPTIM1 RCC_C2APB1ENR1_LPTIM1EN | |||
/** | |||
* @} | |||
@@ -233,7 +271,9 @@ extern "C" { | |||
/** @defgroup BUS_LL_EC_C2_APB1_GRP2_PERIPH C2 APB1 GRP2 PERIPH | |||
* @{ | |||
*/ | |||
#if defined(LPUART1) | |||
#define LL_C2_APB1_GRP2_PERIPH_LPUART1 RCC_C2APB1ENR2_LPUART1EN | |||
#endif | |||
#define LL_C2_APB1_GRP2_PERIPH_LPTIM2 RCC_C2APB1ENR2_LPTIM2EN | |||
/** | |||
* @} | |||
@@ -248,7 +288,9 @@ extern "C" { | |||
#define LL_C2_APB2_GRP1_PERIPH_USART1 RCC_C2APB2ENR_USART1EN | |||
#define LL_C2_APB2_GRP1_PERIPH_TIM16 RCC_C2APB2ENR_TIM16EN | |||
#define LL_C2_APB2_GRP1_PERIPH_TIM17 RCC_C2APB2ENR_TIM17EN | |||
#if defined(SAI1) | |||
#define LL_C2_APB2_GRP1_PERIPH_SAI1 RCC_C2APB2ENR_SAI1EN | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
@@ -32,7 +32,7 @@ extern "C" { | |||
* @{ | |||
*/ | |||
#if defined (COMP1) || defined (COMP2) | |||
/** @defgroup COMP_LL COMP | |||
* @{ | |||
@@ -53,6 +53,14 @@ extern "C" { | |||
*/ | |||
/* Private macros ------------------------------------------------------------*/ | |||
/** @defgroup COMP_LL_Private_Macros COMP Private Macros | |||
* @{ | |||
*/ | |||
/** | |||
* @} | |||
*/ | |||
/* Exported types ------------------------------------------------------------*/ | |||
#if defined(USE_FULL_LL_DRIVER) | |||
/** @defgroup COMP_LL_ES_INIT COMP Exported Init structure | |||
@@ -285,7 +293,7 @@ typedef struct | |||
/** | |||
* @brief Set window mode of a pair of comparators instances | |||
* (2 consecutive COMP instances odd and even COMP<x> and COMP<x+1>). | |||
* (2 consecutive COMP instances COMP<x> and COMP<x+1>). | |||
* @rmtoll CSR WINMODE LL_COMP_SetCommonWindowMode | |||
* @param COMPxy_COMMON Comparator common instance | |||
* (can be set directly from CMSIS definition or by using helper macro @ref __LL_COMP_COMMON_INSTANCE() ) | |||
@@ -303,7 +311,7 @@ __STATIC_INLINE void LL_COMP_SetCommonWindowMode(COMP_Common_TypeDef *COMPxy_COM | |||
/** | |||
* @brief Get window mode of a pair of comparators instances | |||
* (2 consecutive COMP instances odd and even COMP<x> and COMP<x+1>). | |||
* (2 consecutive COMP instances COMP<x> and COMP<x+1>). | |||
* @rmtoll CSR WINMODE LL_COMP_GetCommonWindowMode | |||
* @param COMPxy_COMMON Comparator common instance | |||
* (can be set directly from CMSIS definition or by using helper macro @ref __LL_COMP_COMMON_INSTANCE() ) | |||
@@ -747,7 +755,7 @@ void LL_COMP_StructInit(LL_COMP_InitTypeDef *COMP_InitStruct); | |||
* @} | |||
*/ | |||
#endif /* COMP1 || COMP2 */ | |||
/** | |||
* @} | |||
@@ -53,19 +53,31 @@ extern "C" { | |||
* @param __CHANNEL_INDEX__ 0 to 6 to map DMAx_Channel1 to DMAx_Channel7 | |||
* @retval Pointer to the DMA channel | |||
*/ | |||
#if defined (DMA2) | |||
#define __LL_DMA_INSTANCE_TO_CHANNEL(__DMA_INSTANCE__, __CHANNEL_INDEX__) \ | |||
(((__DMA_INSTANCE__) == DMA1) ? (DMA1_Channel1 + (__CHANNEL_INDEX__)) : (DMA2_Channel1 + (__CHANNEL_INDEX__))) | |||
#else | |||
#define __LL_DMA_INSTANCE_TO_CHANNEL(__DMA_INSTANCE__, __CHANNEL_INDEX__) \ | |||
(DMA1_Channel1 + (__CHANNEL_INDEX__)) | |||
#endif | |||
/** | |||
* @brief Helper macro to convert DMA Instance and index into DMAMUX channel | |||
* @note DMAMUX channel 0 to 6 are mapped to DMA1 channel 1 to 7. | |||
#if defined (DMA2) | |||
* DMAMUX channel 7 to 13 are mapped to DMA2 channel 1 to 7. | |||
#endif | |||
* @param __DMA_INSTANCE__ DMAx | |||
* @param __CHANNEL_INDEX__ 0 to 6 to map DMAx_Channel1 to DMAx_Channel7 | |||
* @retval Pointer to the DMA channel | |||
*/ | |||
#if defined (DMA2) | |||
#define __LL_DMA_INSTANCE_TO_DMAMUX_CCR(__DMA_INSTANCE__, __CHANNEL_INDEX__)\ | |||
(((__DMA_INSTANCE__) == DMA1) ? (DMAMUX1_Channel0 + (__CHANNEL_INDEX__)) : (DMAMUX1_Channel7 + (__CHANNEL_INDEX__))) | |||
#else | |||
#define __LL_DMA_INSTANCE_TO_DMAMUX_CCR(__DMA_INSTANCE__, __CHANNEL_INDEX__)\ | |||
(DMAMUX1_Channel0 + (__CHANNEL_INDEX__)) | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
@@ -1157,7 +1169,9 @@ __STATIC_INLINE uint32_t LL_DMA_GetM2MDstAddress(DMA_TypeDef *DMAx, uint32_t Cha | |||
/** | |||
* @brief Set DMA request for DMA Channels on DMAMUX Channel x. | |||
* @note DMAMUX channel 0 to 6 are mapped to DMA1 channel 1 to 7. | |||
#if defined(DMA2) | |||
* DMAMUX channel 7 to 13 are mapped to DMA2 channel 1 to 7. | |||
#endif | |||
* @rmtoll CxCR DMAREQ_ID LL_DMA_SetPeriphRequest | |||
* @param DMAx DMAx Instance | |||
* @param Channel This parameter can be one of the following values: | |||
@@ -1220,7 +1234,9 @@ __STATIC_INLINE void LL_DMA_SetPeriphRequest(DMA_TypeDef *DMAx, uint32_t Channel | |||
/** | |||
* @brief Get DMA request for DMA Channels on DMAMUX Channel x. | |||
* @note DMAMUX channel 0 to 6 are mapped to DMA1 channel 1 to 7. | |||
#if defined(DMA2) | |||
* DMAMUX channel 7 to 13 are mapped to DMA2 channel 1 to 7. | |||
#endif | |||
* @rmtoll CxCR DMAREQ_ID LL_DMA_GetPeriphRequest | |||
* @param DMAx DMAx Instance | |||
* @param Channel This parameter can be one of the following values: | |||
@@ -70,6 +70,7 @@ extern "C" { | |||
#define LL_DMAMUX_CFR_CSOF4 DMAMUX_CFR_CSOF4 /*!< Synchronization Event Overrun Flag Channel 4 */ | |||
#define LL_DMAMUX_CFR_CSOF5 DMAMUX_CFR_CSOF5 /*!< Synchronization Event Overrun Flag Channel 5 */ | |||
#define LL_DMAMUX_CFR_CSOF6 DMAMUX_CFR_CSOF6 /*!< Synchronization Event Overrun Flag Channel 6 */ | |||
#if defined(DMA2) | |||
#define LL_DMAMUX_CFR_CSOF7 DMAMUX_CFR_CSOF7 /*!< Synchronization Event Overrun Flag Channel 7 */ | |||
#define LL_DMAMUX_CFR_CSOF8 DMAMUX_CFR_CSOF8 /*!< Synchronization Event Overrun Flag Channel 8 */ | |||
#define LL_DMAMUX_CFR_CSOF9 DMAMUX_CFR_CSOF9 /*!< Synchronization Event Overrun Flag Channel 9 */ | |||
@@ -77,6 +78,7 @@ extern "C" { | |||
#define LL_DMAMUX_CFR_CSOF11 DMAMUX_CFR_CSOF11 /*!< Synchronization Event Overrun Flag Channel 11 */ | |||
#define LL_DMAMUX_CFR_CSOF12 DMAMUX_CFR_CSOF12 /*!< Synchronization Event Overrun Flag Channel 12 */ | |||
#define LL_DMAMUX_CFR_CSOF13 DMAMUX_CFR_CSOF13 /*!< Synchronization Event Overrun Flag Channel 13 */ | |||
#endif | |||
#define LL_DMAMUX_RGCFR_RGCOF0 DMAMUX_RGCFR_COF0 /*!< Request Generator 0 Trigger Event Overrun Flag */ | |||
#define LL_DMAMUX_RGCFR_RGCOF1 DMAMUX_RGCFR_COF1 /*!< Request Generator 1 Trigger Event Overrun Flag */ | |||
#define LL_DMAMUX_RGCFR_RGCOF2 DMAMUX_RGCFR_COF2 /*!< Request Generator 2 Trigger Event Overrun Flag */ | |||
@@ -96,6 +98,7 @@ extern "C" { | |||
#define LL_DMAMUX_CSR_SOF4 DMAMUX_CSR_SOF4 /*!< Synchronization Event Overrun Flag Channel 4 */ | |||
#define LL_DMAMUX_CSR_SOF5 DMAMUX_CSR_SOF5 /*!< Synchronization Event Overrun Flag Channel 5 */ | |||
#define LL_DMAMUX_CSR_SOF6 DMAMUX_CSR_SOF6 /*!< Synchronization Event Overrun Flag Channel 6 */ | |||
#if defined(DMA2) | |||
#define LL_DMAMUX_CSR_SOF7 DMAMUX_CSR_SOF7 /*!< Synchronization Event Overrun Flag Channel 7 */ | |||
#define LL_DMAMUX_CSR_SOF8 DMAMUX_CSR_SOF8 /*!< Synchronization Event Overrun Flag Channel 8 */ | |||
#define LL_DMAMUX_CSR_SOF9 DMAMUX_CSR_SOF9 /*!< Synchronization Event Overrun Flag Channel 9 */ | |||
@@ -103,6 +106,7 @@ extern "C" { | |||
#define LL_DMAMUX_CSR_SOF11 DMAMUX_CSR_SOF11 /*!< Synchronization Event Overrun Flag Channel 11 */ | |||
#define LL_DMAMUX_CSR_SOF12 DMAMUX_CSR_SOF12 /*!< Synchronization Event Overrun Flag Channel 12 */ | |||
#define LL_DMAMUX_CSR_SOF13 DMAMUX_CSR_SOF13 /*!< Synchronization Event Overrun Flag Channel 13 */ | |||
#endif | |||
#define LL_DMAMUX_RGSR_RGOF0 DMAMUX_RGSR_OF0 /*!< Request Generator 0 Trigger Event Overrun Flag */ | |||
#define LL_DMAMUX_RGSR_RGOF1 DMAMUX_RGSR_OF1 /*!< Request Generator 1 Trigger Event Overrun Flag */ | |||
#define LL_DMAMUX_RGSR_RGOF2 DMAMUX_RGSR_OF2 /*!< Request Generator 2 Trigger Event Overrun Flag */ | |||
@@ -132,19 +136,29 @@ extern "C" { | |||
#define LL_DMAMUX_REQ_ADC1 0x00000005U /*!< DMAMUX ADC1 request */ | |||
#define LL_DMAMUX_REQ_SPI1_RX 0x00000006U /*!< DMAMUX SPI1 RX request */ | |||
#define LL_DMAMUX_REQ_SPI1_TX 0x00000007U /*!< DMAMUX SPI1 TX request */ | |||
#if defined(SPI2) | |||
#define LL_DMAMUX_REQ_SPI2_RX 0x00000008U /*!< DMAMUX SPI2 RX request */ | |||
#define LL_DMAMUX_REQ_SPI2_TX 0x00000009U /*!< DMAMUX SPI2 TX request */ | |||
#endif | |||
#define LL_DMAMUX_REQ_I2C1_RX 0x0000000AU /*!< DMAMUX I2C1 RX request */ | |||
#define LL_DMAMUX_REQ_I2C1_TX 0x0000000BU /*!< DMAMUX I2C1 TX request */ | |||
#if defined(I2C3) | |||
#define LL_DMAMUX_REQ_I2C3_RX 0x0000000CU /*!< DMAMUX I2C3 RX request */ | |||
#define LL_DMAMUX_REQ_I2C3_TX 0x0000000DU /*!< DMAMUX I2C3 TX request */ | |||
#endif | |||
#define LL_DMAMUX_REQ_USART1_RX 0x0000000EU /*!< DMAMUX USART1 RX request */ | |||
#define LL_DMAMUX_REQ_USART1_TX 0x0000000FU /*!< DMAMUX USART1 TX request */ | |||
#if defined(LPUART1) | |||
#define LL_DMAMUX_REQ_LPUART1_RX 0x00000010U /*!< DMAMUX LPUART1 RX request */ | |||
#define LL_DMAMUX_REQ_LPUART1_TX 0x00000011U /*!< DMAMUX LPUART1 TX request */ | |||
#endif | |||
#if defined(SAI1) | |||
#define LL_DMAMUX_REQ_SAI1_A 0x00000012U /*!< DMAMUX SAI1 A request */ | |||
#define LL_DMAMUX_REQ_SAI1_B 0x00000013U /*!< DMAMUX SAI1 B request */ | |||
#endif | |||
#if defined(QUADSPI) | |||
#define LL_DMAMUX_REQ_QUADSPI 0x00000014U /*!< DMAMUX QUADSPI request */ | |||
#endif | |||
#define LL_DMAMUX_REQ_TIM1_CH1 0x00000015U /*!< DMAMUX TIM1 CH1 request */ | |||
#define LL_DMAMUX_REQ_TIM1_CH2 0x00000016U /*!< DMAMUX TIM1 CH2 request */ | |||
#define LL_DMAMUX_REQ_TIM1_CH3 0x00000017U /*!< DMAMUX TIM1 CH3 request */ | |||
@@ -161,8 +175,10 @@ extern "C" { | |||
#define LL_DMAMUX_REQ_TIM16_UP 0x00000022U /*!< DMAMUX TIM16 UP request */ | |||
#define LL_DMAMUX_REQ_TIM17_CH1 0x00000023U /*!< DMAMUX TIM17 CH1 request */ | |||
#define LL_DMAMUX_REQ_TIM17_UP 0x00000024U /*!< DMAMUX TIM17 UP request */ | |||
#if defined(AES1) | |||
#define LL_DMAMUX_REQ_AES1_IN 0x00000025U /*!< DMAMUX AES1_IN request */ | |||
#define LL_DMAMUX_REQ_AES1_OUT 0x00000026U /*!< DMAMUX AES1_OUT request */ | |||
#endif | |||
#define LL_DMAMUX_REQ_AES2_IN 0x00000027U /*!< DMAMUX AES2_IN request */ | |||
#define LL_DMAMUX_REQ_AES2_OUT 0x00000028U /*!< DMAMUX AES2_OUT request */ | |||
/** | |||
@@ -179,6 +195,7 @@ extern "C" { | |||
#define LL_DMAMUX_CHANNEL_4 0x00000004U /*!< DMAMUX Channel 4 connected to DMA1 Channel 5 */ | |||
#define LL_DMAMUX_CHANNEL_5 0x00000005U /*!< DMAMUX Channel 5 connected to DMA1 Channel 6 */ | |||
#define LL_DMAMUX_CHANNEL_6 0x00000006U /*!< DMAMUX Channel 6 connected to DMA1 Channel 7 */ | |||
#if defined(DMA2) | |||
#define LL_DMAMUX_CHANNEL_7 0x00000007U /*!< DMAMUX Channel 7 connected to DMA2 Channel 1 */ | |||
#define LL_DMAMUX_CHANNEL_8 0x00000008U /*!< DMAMUX Channel 8 connected to DMA2 Channel 2 */ | |||
#define LL_DMAMUX_CHANNEL_9 0x00000009U /*!< DMAMUX Channel 9 connected to DMA2 Channel 3 */ | |||
@@ -186,6 +203,7 @@ extern "C" { | |||
#define LL_DMAMUX_CHANNEL_11 0x0000000BU /*!< DMAMUX Channel 11 connected to DMA2 Channel 5 */ | |||
#define LL_DMAMUX_CHANNEL_12 0x0000000CU /*!< DMAMUX Channel 12 connected to DMA2 Channel 6 */ | |||
#define LL_DMAMUX_CHANNEL_13 0x0000000DU /*!< DMAMUX Channel 13 connected to DMA2 Channel 7 */ | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
@@ -324,7 +342,9 @@ extern "C" { | |||
/** | |||
* @brief Set DMAMUX request ID for DMAMUX Channel x. | |||
* @note DMAMUX channel 0 to 6 are mapped to DMA1 channel 1 to 7. | |||
#if defined(DMA2) | |||
* DMAMUX channel 7 to 13 are mapped to DMA2 channel 1 to 7. | |||
#endif | |||
* @rmtoll CxCR DMAREQ_ID LL_DMAMUX_SetRequestID | |||
* @param DMAMUXx DMAMUXx Instance | |||
* @param Channel This parameter can be one of the following values: | |||
@@ -335,6 +355,7 @@ extern "C" { | |||
* @arg @ref LL_DMAMUX_CHANNEL_4 | |||
* @arg @ref LL_DMAMUX_CHANNEL_5 | |||
* @arg @ref LL_DMAMUX_CHANNEL_6 | |||
#if defined(DMA2) | |||
* @arg @ref LL_DMAMUX_CHANNEL_7 | |||
* @arg @ref LL_DMAMUX_CHANNEL_8 | |||
* @arg @ref LL_DMAMUX_CHANNEL_9 | |||
@@ -342,6 +363,7 @@ extern "C" { | |||
* @arg @ref LL_DMAMUX_CHANNEL_11 | |||
* @arg @ref LL_DMAMUX_CHANNEL_12 | |||
* @arg @ref LL_DMAMUX_CHANNEL_13 | |||
#endif | |||
* @param Request This parameter can be one of the following values: | |||
* @arg @ref LL_DMAMUX_REQ_MEM2MEM | |||
* @arg @ref LL_DMAMUX_REQ_GENERATOR0 | |||
@@ -395,7 +417,9 @@ __STATIC_INLINE void LL_DMAMUX_SetRequestID(DMAMUX_Channel_TypeDef* DMAMUXx, uin | |||
/** | |||
* @brief Get DMAMUX request ID for DMAMUX Channel x. | |||
* @note DMAMUX channel 0 to 6 are mapped to DMA1 channel 1 to 7. | |||
#if defined(DMA2) | |||
* DMAMUX channel 7 to 13 are mapped to DMA2 channel 1 to 7. | |||
#endif | |||
* @rmtoll CxCR DMAREQ_ID LL_DMAMUX_GetRequestID | |||
* @param DMAMUXx DMAMUXx Instance | |||
* @param Channel This parameter can be one of the following values: | |||
@@ -561,6 +585,7 @@ __STATIC_INLINE void LL_DMAMUX_SetSyncPolarity(DMAMUX_Channel_TypeDef *DMAMUXx, | |||
* @arg @ref LL_DMAMUX_CHANNEL_4 | |||
* @arg @ref LL_DMAMUX_CHANNEL_5 | |||
* @arg @ref LL_DMAMUX_CHANNEL_6 | |||
#if defined(DMA2) | |||
* @arg @ref LL_DMAMUX_CHANNEL_7 | |||
* @arg @ref LL_DMAMUX_CHANNEL_8 | |||
* @arg @ref LL_DMAMUX_CHANNEL_9 | |||
@@ -568,6 +593,7 @@ __STATIC_INLINE void LL_DMAMUX_SetSyncPolarity(DMAMUX_Channel_TypeDef *DMAMUXx, | |||
* @arg @ref LL_DMAMUX_CHANNEL_11 | |||
* @arg @ref LL_DMAMUX_CHANNEL_12 | |||
* @arg @ref LL_DMAMUX_CHANNEL_13 | |||
#endif | |||
* @retval Returned value can be one of the following values: | |||
* @arg @ref LL_DMAMUX_SYNC_NO_EVENT | |||
* @arg @ref LL_DMAMUX_SYNC_POL_RISING | |||
@@ -592,6 +618,7 @@ __STATIC_INLINE uint32_t LL_DMAMUX_GetSyncPolarity(DMAMUX_Channel_TypeDef *DMAMU | |||
* @arg @ref LL_DMAMUX_CHANNEL_4 | |||
* @arg @ref LL_DMAMUX_CHANNEL_5 | |||
* @arg @ref LL_DMAMUX_CHANNEL_6 | |||
#if defined(DMA2) | |||
* @arg @ref LL_DMAMUX_CHANNEL_7 | |||
* @arg @ref LL_DMAMUX_CHANNEL_8 | |||
* @arg @ref LL_DMAMUX_CHANNEL_9 | |||
@@ -599,6 +626,7 @@ __STATIC_INLINE uint32_t LL_DMAMUX_GetSyncPolarity(DMAMUX_Channel_TypeDef *DMAMU | |||
* @arg @ref LL_DMAMUX_CHANNEL_11 | |||
* @arg @ref LL_DMAMUX_CHANNEL_12 | |||
* @arg @ref LL_DMAMUX_CHANNEL_13 | |||
#endif | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_DMAMUX_EnableEventGeneration(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel) | |||
@@ -619,6 +647,7 @@ __STATIC_INLINE void LL_DMAMUX_EnableEventGeneration(DMAMUX_Channel_TypeDef *DMA | |||
* @arg @ref LL_DMAMUX_CHANNEL_4 | |||
* @arg @ref LL_DMAMUX_CHANNEL_5 | |||
* @arg @ref LL_DMAMUX_CHANNEL_6 | |||
#if defined(DMA2) | |||
* @arg @ref LL_DMAMUX_CHANNEL_7 | |||
* @arg @ref LL_DMAMUX_CHANNEL_8 | |||
* @arg @ref LL_DMAMUX_CHANNEL_9 | |||
@@ -626,6 +655,7 @@ __STATIC_INLINE void LL_DMAMUX_EnableEventGeneration(DMAMUX_Channel_TypeDef *DMA | |||
* @arg @ref LL_DMAMUX_CHANNEL_11 | |||
* @arg @ref LL_DMAMUX_CHANNEL_12 | |||
* @arg @ref LL_DMAMUX_CHANNEL_13 | |||
#endif | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_DMAMUX_DisableEventGeneration(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel) | |||
@@ -646,6 +676,7 @@ __STATIC_INLINE void LL_DMAMUX_DisableEventGeneration(DMAMUX_Channel_TypeDef *DM | |||
* @arg @ref LL_DMAMUX_CHANNEL_4 | |||
* @arg @ref LL_DMAMUX_CHANNEL_5 | |||
* @arg @ref LL_DMAMUX_CHANNEL_6 | |||
#if defined(DMA2) | |||
* @arg @ref LL_DMAMUX_CHANNEL_7 | |||
* @arg @ref LL_DMAMUX_CHANNEL_8 | |||
* @arg @ref LL_DMAMUX_CHANNEL_9 | |||
@@ -653,6 +684,7 @@ __STATIC_INLINE void LL_DMAMUX_DisableEventGeneration(DMAMUX_Channel_TypeDef *DM | |||
* @arg @ref LL_DMAMUX_CHANNEL_11 | |||
* @arg @ref LL_DMAMUX_CHANNEL_12 | |||
* @arg @ref LL_DMAMUX_CHANNEL_13 | |||
#endif | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_DMAMUX_IsEnabledEventGeneration(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel) | |||
@@ -673,6 +705,7 @@ __STATIC_INLINE uint32_t LL_DMAMUX_IsEnabledEventGeneration(DMAMUX_Channel_TypeD | |||
* @arg @ref LL_DMAMUX_CHANNEL_4 | |||
* @arg @ref LL_DMAMUX_CHANNEL_5 | |||
* @arg @ref LL_DMAMUX_CHANNEL_6 | |||
#if defined(DMA2) | |||
* @arg @ref LL_DMAMUX_CHANNEL_7 | |||
* @arg @ref LL_DMAMUX_CHANNEL_8 | |||
* @arg @ref LL_DMAMUX_CHANNEL_9 | |||
@@ -680,6 +713,7 @@ __STATIC_INLINE uint32_t LL_DMAMUX_IsEnabledEventGeneration(DMAMUX_Channel_TypeD | |||
* @arg @ref LL_DMAMUX_CHANNEL_11 | |||
* @arg @ref LL_DMAMUX_CHANNEL_12 | |||
* @arg @ref LL_DMAMUX_CHANNEL_13 | |||
#endif | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_DMAMUX_EnableSync(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel) | |||
@@ -700,6 +734,7 @@ __STATIC_INLINE void LL_DMAMUX_EnableSync(DMAMUX_Channel_TypeDef *DMAMUXx, uint3 | |||
* @arg @ref LL_DMAMUX_CHANNEL_4 | |||
* @arg @ref LL_DMAMUX_CHANNEL_5 | |||
* @arg @ref LL_DMAMUX_CHANNEL_6 | |||
#if defined(DMA2) | |||
* @arg @ref LL_DMAMUX_CHANNEL_7 | |||
* @arg @ref LL_DMAMUX_CHANNEL_8 | |||
* @arg @ref LL_DMAMUX_CHANNEL_9 | |||
@@ -707,6 +742,7 @@ __STATIC_INLINE void LL_DMAMUX_EnableSync(DMAMUX_Channel_TypeDef *DMAMUXx, uint3 | |||
* @arg @ref LL_DMAMUX_CHANNEL_11 | |||
* @arg @ref LL_DMAMUX_CHANNEL_12 | |||
* @arg @ref LL_DMAMUX_CHANNEL_13 | |||
#endif | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_DMAMUX_DisableSync(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel) | |||
@@ -727,6 +763,7 @@ __STATIC_INLINE void LL_DMAMUX_DisableSync(DMAMUX_Channel_TypeDef *DMAMUXx, uint | |||
* @arg @ref LL_DMAMUX_CHANNEL_4 | |||
* @arg @ref LL_DMAMUX_CHANNEL_5 | |||
* @arg @ref LL_DMAMUX_CHANNEL_6 | |||
#if defined(DMA2) | |||
* @arg @ref LL_DMAMUX_CHANNEL_7 | |||
* @arg @ref LL_DMAMUX_CHANNEL_8 | |||
* @arg @ref LL_DMAMUX_CHANNEL_9 | |||
@@ -734,6 +771,7 @@ __STATIC_INLINE void LL_DMAMUX_DisableSync(DMAMUX_Channel_TypeDef *DMAMUXx, uint | |||
* @arg @ref LL_DMAMUX_CHANNEL_11 | |||
* @arg @ref LL_DMAMUX_CHANNEL_12 | |||
* @arg @ref LL_DMAMUX_CHANNEL_13 | |||
#endif | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_DMAMUX_IsEnabledSync(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel) | |||
@@ -754,6 +792,7 @@ __STATIC_INLINE uint32_t LL_DMAMUX_IsEnabledSync(DMAMUX_Channel_TypeDef *DMAMUXx | |||
* @arg @ref LL_DMAMUX_CHANNEL_4 | |||
* @arg @ref LL_DMAMUX_CHANNEL_5 | |||
* @arg @ref LL_DMAMUX_CHANNEL_6 | |||
#if defined(DMA2) | |||
* @arg @ref LL_DMAMUX_CHANNEL_7 | |||
* @arg @ref LL_DMAMUX_CHANNEL_8 | |||
* @arg @ref LL_DMAMUX_CHANNEL_9 | |||
@@ -761,6 +800,7 @@ __STATIC_INLINE uint32_t LL_DMAMUX_IsEnabledSync(DMAMUX_Channel_TypeDef *DMAMUXx | |||
* @arg @ref LL_DMAMUX_CHANNEL_11 | |||
* @arg @ref LL_DMAMUX_CHANNEL_12 | |||
* @arg @ref LL_DMAMUX_CHANNEL_13 | |||
#endif | |||
* @param SyncID This parameter can be one of the following values: | |||
* @arg @ref LL_DMAMUX_SYNC_EXTI_LINE0 | |||
* @arg @ref LL_DMAMUX_SYNC_EXTI_LINE1 | |||
@@ -802,6 +842,7 @@ __STATIC_INLINE void LL_DMAMUX_SetSyncID(DMAMUX_Channel_TypeDef *DMAMUXx, uint32 | |||
* @arg @ref LL_DMAMUX_CHANNEL_4 | |||
* @arg @ref LL_DMAMUX_CHANNEL_5 | |||
* @arg @ref LL_DMAMUX_CHANNEL_6 | |||
#if defined(DMA2) | |||
* @arg @ref LL_DMAMUX_CHANNEL_7 | |||
* @arg @ref LL_DMAMUX_CHANNEL_8 | |||
* @arg @ref LL_DMAMUX_CHANNEL_9 | |||
@@ -809,6 +850,7 @@ __STATIC_INLINE void LL_DMAMUX_SetSyncID(DMAMUX_Channel_TypeDef *DMAMUXx, uint32 | |||
* @arg @ref LL_DMAMUX_CHANNEL_11 | |||
* @arg @ref LL_DMAMUX_CHANNEL_12 | |||
* @arg @ref LL_DMAMUX_CHANNEL_13 | |||
#endif | |||
* @retval Returned value can be one of the following values: | |||
* @arg @ref LL_DMAMUX_SYNC_EXTI_LINE0 | |||
* @arg @ref LL_DMAMUX_SYNC_EXTI_LINE1 | |||
@@ -1502,6 +1544,7 @@ __STATIC_INLINE void LL_DMAMUX_ClearFlag_RGO3(DMAMUX_Channel_TypeDef *DMAMUXx) | |||
* @arg @ref LL_DMAMUX_CHANNEL_4 | |||
* @arg @ref LL_DMAMUX_CHANNEL_5 | |||
* @arg @ref LL_DMAMUX_CHANNEL_6 | |||
#if defined(DMA2) | |||
* @arg @ref LL_DMAMUX_CHANNEL_7 | |||
* @arg @ref LL_DMAMUX_CHANNEL_8 | |||
* @arg @ref LL_DMAMUX_CHANNEL_9 | |||
@@ -1509,6 +1552,7 @@ __STATIC_INLINE void LL_DMAMUX_ClearFlag_RGO3(DMAMUX_Channel_TypeDef *DMAMUXx) | |||
* @arg @ref LL_DMAMUX_CHANNEL_11 | |||
* @arg @ref LL_DMAMUX_CHANNEL_12 | |||
* @arg @ref LL_DMAMUX_CHANNEL_13 | |||
#endif | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_DMAMUX_EnableIT_SO(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel) | |||
@@ -1529,6 +1573,7 @@ __STATIC_INLINE void LL_DMAMUX_EnableIT_SO(DMAMUX_Channel_TypeDef *DMAMUXx, uint | |||
* @arg @ref LL_DMAMUX_CHANNEL_4 | |||
* @arg @ref LL_DMAMUX_CHANNEL_5 | |||
* @arg @ref LL_DMAMUX_CHANNEL_6 | |||
#if defined(DMA2) | |||
* @arg @ref LL_DMAMUX_CHANNEL_7 | |||
* @arg @ref LL_DMAMUX_CHANNEL_8 | |||
* @arg @ref LL_DMAMUX_CHANNEL_9 | |||
@@ -1536,6 +1581,7 @@ __STATIC_INLINE void LL_DMAMUX_EnableIT_SO(DMAMUX_Channel_TypeDef *DMAMUXx, uint | |||
* @arg @ref LL_DMAMUX_CHANNEL_11 | |||
* @arg @ref LL_DMAMUX_CHANNEL_12 | |||
* @arg @ref LL_DMAMUX_CHANNEL_13 | |||
#endif | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_DMAMUX_DisableIT_SO(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel) | |||
@@ -1556,6 +1602,7 @@ __STATIC_INLINE void LL_DMAMUX_DisableIT_SO(DMAMUX_Channel_TypeDef *DMAMUXx, uin | |||
* @arg @ref LL_DMAMUX_CHANNEL_4 | |||
* @arg @ref LL_DMAMUX_CHANNEL_5 | |||
* @arg @ref LL_DMAMUX_CHANNEL_6 | |||
#if defined(DMA2) | |||
* @arg @ref LL_DMAMUX_CHANNEL_7 | |||
* @arg @ref LL_DMAMUX_CHANNEL_8 | |||
* @arg @ref LL_DMAMUX_CHANNEL_9 | |||
@@ -1563,6 +1610,7 @@ __STATIC_INLINE void LL_DMAMUX_DisableIT_SO(DMAMUX_Channel_TypeDef *DMAMUXx, uin | |||
* @arg @ref LL_DMAMUX_CHANNEL_11 | |||
* @arg @ref LL_DMAMUX_CHANNEL_12 | |||
* @arg @ref LL_DMAMUX_CHANNEL_13 | |||
#endif | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_DMAMUX_IsEnabledIT_SO(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel) | |||
@@ -107,24 +107,48 @@ typedef struct | |||
#define LL_EXTI_LINE_17 EXTI_IMR1_IM17 /*!< Extended line 17 */ | |||
#define LL_EXTI_LINE_18 EXTI_IMR1_IM18 /*!< Extended line 18 */ | |||
#define LL_EXTI_LINE_19 EXTI_IMR1_IM19 /*!< Extended line 19 */ | |||
#if defined (STM32WB55xx) || defined (STM32WB5Mxx) || defined (STM32WB35xx) | |||
#define LL_EXTI_LINE_20 EXTI_IMR1_IM20 /*!< Extended line 20 */ | |||
#define LL_EXTI_LINE_21 EXTI_IMR1_IM21 /*!< Extended line 21 */ | |||
#endif | |||
#define LL_EXTI_LINE_22 EXTI_IMR1_IM22 /*!< Extended line 22 */ | |||
#if defined (STM32WB55xx) || defined (STM32WB5Mxx) || defined (STM32WB35xx) | |||
#define LL_EXTI_LINE_23 EXTI_IMR1_IM23 /*!< Extended line 23 */ | |||
#endif | |||
#define LL_EXTI_LINE_24 EXTI_IMR1_IM24 /*!< Extended line 24 */ | |||
#if defined (STM32WB55xx) || defined (STM32WB5Mxx) || defined (STM32WB35xx) | |||
#define LL_EXTI_LINE_25 EXTI_IMR1_IM25 /*!< Extended line 25 */ | |||
#define LL_EXTI_LINE_26 EXTI_IMR1_IM26 /*!< Extended line 26 */ | |||
#define LL_EXTI_LINE_27 EXTI_IMR1_IM27 /*!< Extended line 27 */ | |||
#define LL_EXTI_LINE_28 EXTI_IMR1_IM28 /*!< Extended line 28 */ | |||
#endif | |||
#define LL_EXTI_LINE_29 EXTI_IMR1_IM29 /*!< Extended line 29 */ | |||
#define LL_EXTI_LINE_30 EXTI_IMR1_IM30 /*!< Extended line 30 */ | |||
#if defined (STM32WB55xx) || defined (STM32WB5Mxx) || defined (STM32WB35xx) | |||
#define LL_EXTI_LINE_31 EXTI_IMR1_IM31 /*!< Extended line 31 */ | |||
#define LL_EXTI_LINE_ALL_0_31 EXTI_IMR1_IM /*!< All Extended line not reserved*/ | |||
#endif | |||
#if defined (STM32WB55xx) || defined (STM32WB5Mxx) || defined (STM32WB35xx) | |||
#define LL_EXTI_LINE_ALL_0_31 (LL_EXTI_LINE_0 | LL_EXTI_LINE_1 | LL_EXTI_LINE_2 | \ | |||
LL_EXTI_LINE_3 | LL_EXTI_LINE_4 | LL_EXTI_LINE_5 | \ | |||
LL_EXTI_LINE_6 | LL_EXTI_LINE_7 | LL_EXTI_LINE_8 | \ | |||
LL_EXTI_LINE_9 | LL_EXTI_LINE_10 | LL_EXTI_LINE_11 | \ | |||
LL_EXTI_LINE_12 | LL_EXTI_LINE_13 | LL_EXTI_LINE_14 | \ | |||
LL_EXTI_LINE_15 | LL_EXTI_LINE_16 | LL_EXTI_LINE_17 | \ | |||
LL_EXTI_LINE_18 | LL_EXTI_LINE_19 | LL_EXTI_LINE_20 | \ | |||
LL_EXTI_LINE_21 | LL_EXTI_LINE_22 | LL_EXTI_LINE_23 | \ | |||
LL_EXTI_LINE_24 | LL_EXTI_LINE_25 | LL_EXTI_LINE_28 | \ | |||
LL_EXTI_LINE_29 | LL_EXTI_LINE_30 | LL_EXTI_LINE_31) /*!< All Extended line not reserved*/ | |||
#else | |||
#define LL_EXTI_LINE_ALL_0_31 (LL_EXTI_LINE_0 | LL_EXTI_LINE_1 | LL_EXTI_LINE_2 | \ | |||
LL_EXTI_LINE_3 | LL_EXTI_LINE_4 | LL_EXTI_LINE_5 | \ | |||
LL_EXTI_LINE_6 | LL_EXTI_LINE_7 | LL_EXTI_LINE_8 | \ | |||
LL_EXTI_LINE_9 | LL_EXTI_LINE_10 | LL_EXTI_LINE_11 | \ | |||
LL_EXTI_LINE_12 | LL_EXTI_LINE_13 | LL_EXTI_LINE_14 | \ | |||
LL_EXTI_LINE_15 | LL_EXTI_LINE_16 | LL_EXTI_LINE_17 | \ | |||
LL_EXTI_LINE_18 | LL_EXTI_LINE_19 | LL_EXTI_LINE_22 | \ | |||
LL_EXTI_LINE_24 | LL_EXTI_LINE_29 | LL_EXTI_LINE_30) /*!< All Extended line not reserved*/ | |||
#endif | |||
#define LL_EXTI_LINE_32 EXTI_IMR2_IM32 /*!< Extended line 32 */ | |||
#define LL_EXTI_LINE_33 EXTI_IMR2_IM33 /*!< Extended line 33 */ | |||
#define LL_EXTI_LINE_34 EXTI_IMR2_IM34 /*!< Extended line 34 */ | |||
#define LL_EXTI_LINE_35 EXTI_IMR2_IM35 /*!< Extended line 35 */ | |||
#define LL_EXTI_LINE_36 EXTI_IMR2_IM36 /*!< Extended line 36 */ | |||
#define LL_EXTI_LINE_37 EXTI_IMR2_IM37 /*!< Extended line 37 */ | |||
#define LL_EXTI_LINE_38 EXTI_IMR2_IM38 /*!< Extended line 38 */ | |||
@@ -132,13 +156,25 @@ typedef struct | |||
#define LL_EXTI_LINE_40 EXTI_IMR2_IM40 /*!< Extended line 40 */ | |||
#define LL_EXTI_LINE_41 EXTI_IMR2_IM41 /*!< Extended line 41 */ | |||
#define LL_EXTI_LINE_42 EXTI_IMR2_IM42 /*!< Extended line 42 */ | |||
#if defined (STM32WB55xx) || defined (STM32WB5Mxx) | |||
#define LL_EXTI_LINE_43 EXTI_IMR2_IM43 /*!< Extended line 43 */ | |||
#endif | |||
#define LL_EXTI_LINE_44 EXTI_IMR2_IM44 /*!< Extended line 44 */ | |||
#define LL_EXTI_LINE_45 EXTI_IMR2_IM45 /*!< Extended line 45 */ | |||
#define LL_EXTI_LINE_46 EXTI_IMR2_IM46 /*!< Extended line 46 */ | |||
#define LL_EXTI_LINE_47 EXTI_IMR2_IM47 /*!< Extended line 47 */ | |||
#define LL_EXTI_LINE_48 EXTI_IMR2_IM48 /*!< Extended line 48 */ | |||
#define LL_EXTI_LINE_ALL_32_63 EXTI_IMR2_IM /*!< All Extended line not reserved*/ | |||
#if defined (STM32WB55xx) || defined (STM32WB5Mxx) | |||
#define LL_EXTI_LINE_ALL_32_63 (LL_EXTI_LINE_33 | LL_EXTI_LINE_36 | LL_EXTI_LINE_37 | \ | |||
LL_EXTI_LINE_38 | LL_EXTI_LINE_39 | LL_EXTI_LINE_40 | \ | |||
LL_EXTI_LINE_41 | LL_EXTI_LINE_42 | LL_EXTI_LINE_43 | \ | |||
LL_EXTI_LINE_44 | LL_EXTI_LINE_45 | LL_EXTI_LINE_46 | \ | |||
LL_EXTI_LINE_48) /*!< All Extended line not reserved*/ | |||
#else | |||
#define LL_EXTI_LINE_ALL_32_63 (LL_EXTI_LINE_33 | LL_EXTI_LINE_36 | LL_EXTI_LINE_37 | \ | |||
LL_EXTI_LINE_38 | LL_EXTI_LINE_39 | LL_EXTI_LINE_40 | \ | |||
LL_EXTI_LINE_41 | LL_EXTI_LINE_42 | LL_EXTI_LINE_44 | \ | |||
LL_EXTI_LINE_45 | LL_EXTI_LINE_46 | LL_EXTI_LINE_48) /*!< All Extended line not reserved*/ | |||
#endif | |||
#define LL_EXTI_LINE_ALL (0xFFFFFFFFU) /*!< All Extended line */ | |||
@@ -227,7 +263,7 @@ typedef struct | |||
/** | |||
* @brief Enable ExtiLine Interrupt request for Lines in range 0 to 31 | |||
* @rmtoll IMR1 IMx LL_EXTI_EnableIT_0_31 | |||
* @param ExtiLine This parameter can be one of the following values: | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_0 | |||
* @arg @ref LL_EXTI_LINE_1 | |||
* @arg @ref LL_EXTI_LINE_2 | |||
@@ -248,19 +284,18 @@ typedef struct | |||
* @arg @ref LL_EXTI_LINE_17 | |||
* @arg @ref LL_EXTI_LINE_18 | |||
* @arg @ref LL_EXTI_LINE_19 | |||
* @arg @ref LL_EXTI_LINE_20 | |||
* @arg @ref LL_EXTI_LINE_21 | |||
* @arg @ref LL_EXTI_LINE_20 (*) | |||
* @arg @ref LL_EXTI_LINE_21 (*) | |||
* @arg @ref LL_EXTI_LINE_22 | |||
* @arg @ref LL_EXTI_LINE_23 | |||
* @arg @ref LL_EXTI_LINE_23 (*) | |||
* @arg @ref LL_EXTI_LINE_24 | |||
* @arg @ref LL_EXTI_LINE_25 | |||
* @arg @ref LL_EXTI_LINE_26 | |||
* @arg @ref LL_EXTI_LINE_27 | |||
* @arg @ref LL_EXTI_LINE_28 | |||
* @arg @ref LL_EXTI_LINE_25 (*) | |||
* @arg @ref LL_EXTI_LINE_28 (*) | |||
* @arg @ref LL_EXTI_LINE_29 | |||
* @arg @ref LL_EXTI_LINE_30 | |||
* @arg @ref LL_EXTI_LINE_31 | |||
* @arg @ref LL_EXTI_LINE_31 (*) | |||
* @arg @ref LL_EXTI_LINE_ALL_0_31 | |||
* (*) value not defined in all devices | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_EXTI_EnableIT_0_31(uint32_t ExtiLine) | |||
@@ -271,7 +306,7 @@ __STATIC_INLINE void LL_EXTI_EnableIT_0_31(uint32_t ExtiLine) | |||
/** | |||
* @brief Enable ExtiLine Interrupt request for Lines in range 0 to 31 for cpu2 | |||
* @rmtoll C2IMR1 IMx LL_C2_EXTI_EnableIT_0_31 | |||
* @param ExtiLine This parameter can be one of the following values: | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_0 | |||
* @arg @ref LL_EXTI_LINE_1 | |||
* @arg @ref LL_EXTI_LINE_2 | |||
@@ -292,19 +327,18 @@ __STATIC_INLINE void LL_EXTI_EnableIT_0_31(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_17 | |||
* @arg @ref LL_EXTI_LINE_18 | |||
* @arg @ref LL_EXTI_LINE_19 | |||
* @arg @ref LL_EXTI_LINE_20 | |||
* @arg @ref LL_EXTI_LINE_21 | |||
* @arg @ref LL_EXTI_LINE_20 (*) | |||
* @arg @ref LL_EXTI_LINE_21 (*) | |||
* @arg @ref LL_EXTI_LINE_22 | |||
* @arg @ref LL_EXTI_LINE_23 | |||
* @arg @ref LL_EXTI_LINE_23 (*) | |||
* @arg @ref LL_EXTI_LINE_24 | |||
* @arg @ref LL_EXTI_LINE_25 | |||
* @arg @ref LL_EXTI_LINE_26 | |||
* @arg @ref LL_EXTI_LINE_27 | |||
* @arg @ref LL_EXTI_LINE_28 | |||
* @arg @ref LL_EXTI_LINE_25 (*) | |||
* @arg @ref LL_EXTI_LINE_28 (*) | |||
* @arg @ref LL_EXTI_LINE_29 | |||
* @arg @ref LL_EXTI_LINE_30 | |||
* @arg @ref LL_EXTI_LINE_31 | |||
* @arg @ref LL_EXTI_LINE_31 (*) | |||
* @arg @ref LL_EXTI_LINE_ALL_0_31 | |||
* (*) value not defined in all devices | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_C2_EXTI_EnableIT_0_31(uint32_t ExtiLine) | |||
@@ -315,11 +349,8 @@ __STATIC_INLINE void LL_C2_EXTI_EnableIT_0_31(uint32_t ExtiLine) | |||
/** | |||
* @brief Enable ExtiLine Interrupt request for Lines in range 32 to 63 | |||
* @rmtoll IMR2 IMx LL_EXTI_EnableIT_32_63 | |||
* @param ExtiLine This parameter can be one of the following values: | |||
* @arg @ref LL_EXTI_LINE_32 | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_33 | |||
* @arg @ref LL_EXTI_LINE_34 | |||
* @arg @ref LL_EXTI_LINE_35 | |||
* @arg @ref LL_EXTI_LINE_36 | |||
* @arg @ref LL_EXTI_LINE_37 | |||
* @arg @ref LL_EXTI_LINE_38 | |||
@@ -327,13 +358,13 @@ __STATIC_INLINE void LL_C2_EXTI_EnableIT_0_31(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_40 | |||
* @arg @ref LL_EXTI_LINE_41 | |||
* @arg @ref LL_EXTI_LINE_42 | |||
* @arg @ref LL_EXTI_LINE_43 | |||
* @arg @ref LL_EXTI_LINE_43 (*) | |||
* @arg @ref LL_EXTI_LINE_44 | |||
* @arg @ref LL_EXTI_LINE_45 | |||
* @arg @ref LL_EXTI_LINE_46 | |||
* @arg @ref LL_EXTI_LINE_47 | |||
* @arg @ref LL_EXTI_LINE_48 | |||
* @arg @ref LL_EXTI_LINE_ALL_32_63 | |||
* (*) value not defined in all devices | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_EXTI_EnableIT_32_63(uint32_t ExtiLine) | |||
@@ -344,11 +375,8 @@ __STATIC_INLINE void LL_EXTI_EnableIT_32_63(uint32_t ExtiLine) | |||
/** | |||
* @brief Enable ExtiLine Interrupt request for Lines in range 32 to 63 for cpu2 | |||
* @rmtoll C2IMR2 IMx LL_C2_EXTI_EnableIT_32_63 | |||
* @param ExtiLine This parameter can be one of the following values: | |||
* @arg @ref LL_EXTI_LINE_32 | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_33 | |||
* @arg @ref LL_EXTI_LINE_34 | |||
* @arg @ref LL_EXTI_LINE_35 | |||
* @arg @ref LL_EXTI_LINE_36 | |||
* @arg @ref LL_EXTI_LINE_37 | |||
* @arg @ref LL_EXTI_LINE_38 | |||
@@ -356,13 +384,13 @@ __STATIC_INLINE void LL_EXTI_EnableIT_32_63(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_40 | |||
* @arg @ref LL_EXTI_LINE_41 | |||
* @arg @ref LL_EXTI_LINE_42 | |||
* @arg @ref LL_EXTI_LINE_43 | |||
* @arg @ref LL_EXTI_LINE_43 (*) | |||
* @arg @ref LL_EXTI_LINE_44 | |||
* @arg @ref LL_EXTI_LINE_45 | |||
* @arg @ref LL_EXTI_LINE_46 | |||
* @arg @ref LL_EXTI_LINE_47 | |||
* @arg @ref LL_EXTI_LINE_48 | |||
* @arg @ref LL_EXTI_LINE_ALL_32_63 | |||
* (*) value not defined in all devices | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_C2_EXTI_EnableIT_32_63(uint32_t ExtiLine) | |||
@@ -373,7 +401,7 @@ __STATIC_INLINE void LL_C2_EXTI_EnableIT_32_63(uint32_t ExtiLine) | |||
/** | |||
* @brief Disable ExtiLine Interrupt request for Lines in range 0 to 31 | |||
* @rmtoll IMR1 IMx LL_EXTI_DisableIT_0_31 | |||
* @param ExtiLine This parameter can be one of the following values: | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_0 | |||
* @arg @ref LL_EXTI_LINE_1 | |||
* @arg @ref LL_EXTI_LINE_2 | |||
@@ -394,19 +422,18 @@ __STATIC_INLINE void LL_C2_EXTI_EnableIT_32_63(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_17 | |||
* @arg @ref LL_EXTI_LINE_18 | |||
* @arg @ref LL_EXTI_LINE_19 | |||
* @arg @ref LL_EXTI_LINE_20 | |||
* @arg @ref LL_EXTI_LINE_21 | |||
* @arg @ref LL_EXTI_LINE_20 (*) | |||
* @arg @ref LL_EXTI_LINE_21 (*) | |||
* @arg @ref LL_EXTI_LINE_22 | |||
* @arg @ref LL_EXTI_LINE_23 | |||
* @arg @ref LL_EXTI_LINE_23 (*) | |||
* @arg @ref LL_EXTI_LINE_24 | |||
* @arg @ref LL_EXTI_LINE_25 | |||
* @arg @ref LL_EXTI_LINE_26 | |||
* @arg @ref LL_EXTI_LINE_27 | |||
* @arg @ref LL_EXTI_LINE_28 | |||
* @arg @ref LL_EXTI_LINE_25 (*) | |||
* @arg @ref LL_EXTI_LINE_28 (*) | |||
* @arg @ref LL_EXTI_LINE_29 | |||
* @arg @ref LL_EXTI_LINE_30 | |||
* @arg @ref LL_EXTI_LINE_31 | |||
* @arg @ref LL_EXTI_LINE_31 (*) | |||
* @arg @ref LL_EXTI_LINE_ALL_0_31 | |||
* (*) value not defined in all devices | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_EXTI_DisableIT_0_31(uint32_t ExtiLine) | |||
@@ -417,7 +444,7 @@ __STATIC_INLINE void LL_EXTI_DisableIT_0_31(uint32_t ExtiLine) | |||
/** | |||
* @brief Disable ExtiLine Interrupt request for Lines in range 0 to 31 for cpu2 | |||
* @rmtoll C2IMR1 IMx LL_C2_EXTI_DisableIT_0_31 | |||
* @param ExtiLine This parameter can be one of the following values: | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_0 | |||
* @arg @ref LL_EXTI_LINE_1 | |||
* @arg @ref LL_EXTI_LINE_2 | |||
@@ -438,19 +465,18 @@ __STATIC_INLINE void LL_EXTI_DisableIT_0_31(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_17 | |||
* @arg @ref LL_EXTI_LINE_18 | |||
* @arg @ref LL_EXTI_LINE_19 | |||
* @arg @ref LL_EXTI_LINE_20 | |||
* @arg @ref LL_EXTI_LINE_21 | |||
* @arg @ref LL_EXTI_LINE_20 (*) | |||
* @arg @ref LL_EXTI_LINE_21 (*) | |||
* @arg @ref LL_EXTI_LINE_22 | |||
* @arg @ref LL_EXTI_LINE_23 | |||
* @arg @ref LL_EXTI_LINE_23 (*) | |||
* @arg @ref LL_EXTI_LINE_24 | |||
* @arg @ref LL_EXTI_LINE_25 | |||
* @arg @ref LL_EXTI_LINE_26 | |||
* @arg @ref LL_EXTI_LINE_27 | |||
* @arg @ref LL_EXTI_LINE_28 | |||
* @arg @ref LL_EXTI_LINE_25 (*) | |||
* @arg @ref LL_EXTI_LINE_28 (*) | |||
* @arg @ref LL_EXTI_LINE_29 | |||
* @arg @ref LL_EXTI_LINE_30 | |||
* @arg @ref LL_EXTI_LINE_31 | |||
* @arg @ref LL_EXTI_LINE_31 (*) | |||
* @arg @ref LL_EXTI_LINE_ALL_0_31 | |||
* (*) value not defined in all devices | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_C2_EXTI_DisableIT_0_31(uint32_t ExtiLine) | |||
@@ -461,11 +487,8 @@ __STATIC_INLINE void LL_C2_EXTI_DisableIT_0_31(uint32_t ExtiLine) | |||
/** | |||
* @brief Disable ExtiLine Interrupt request for Lines in range 32 to 63 | |||
* @rmtoll IMR2 IMx LL_EXTI_DisableIT_32_63 | |||
* @param ExtiLine This parameter can be one of the following values: | |||
* @arg @ref LL_EXTI_LINE_32 | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_33 | |||
* @arg @ref LL_EXTI_LINE_34 | |||
* @arg @ref LL_EXTI_LINE_35 | |||
* @arg @ref LL_EXTI_LINE_36 | |||
* @arg @ref LL_EXTI_LINE_37 | |||
* @arg @ref LL_EXTI_LINE_38 | |||
@@ -473,13 +496,13 @@ __STATIC_INLINE void LL_C2_EXTI_DisableIT_0_31(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_40 | |||
* @arg @ref LL_EXTI_LINE_41 | |||
* @arg @ref LL_EXTI_LINE_42 | |||
* @arg @ref LL_EXTI_LINE_43 | |||
* @arg @ref LL_EXTI_LINE_43 (*) | |||
* @arg @ref LL_EXTI_LINE_44 | |||
* @arg @ref LL_EXTI_LINE_45 | |||
* @arg @ref LL_EXTI_LINE_46 | |||
* @arg @ref LL_EXTI_LINE_47 | |||
* @arg @ref LL_EXTI_LINE_48 | |||
* @arg @ref LL_EXTI_LINE_ALL_32_63 | |||
* (*) value not defined in all devices | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_EXTI_DisableIT_32_63(uint32_t ExtiLine) | |||
@@ -490,11 +513,8 @@ __STATIC_INLINE void LL_EXTI_DisableIT_32_63(uint32_t ExtiLine) | |||
/** | |||
* @brief Disable ExtiLine Interrupt request for Lines in range 32 to 63 for cpu2 | |||
* @rmtoll C2IMR2 IMx LL_C2_EXTI_DisableIT_32_63 | |||
* @param ExtiLine This parameter can be one of the following values: | |||
* @arg @ref LL_EXTI_LINE_32 | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_33 | |||
* @arg @ref LL_EXTI_LINE_34 | |||
* @arg @ref LL_EXTI_LINE_35 | |||
* @arg @ref LL_EXTI_LINE_36 | |||
* @arg @ref LL_EXTI_LINE_37 | |||
* @arg @ref LL_EXTI_LINE_38 | |||
@@ -502,13 +522,13 @@ __STATIC_INLINE void LL_EXTI_DisableIT_32_63(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_40 | |||
* @arg @ref LL_EXTI_LINE_41 | |||
* @arg @ref LL_EXTI_LINE_42 | |||
* @arg @ref LL_EXTI_LINE_43 | |||
* @arg @ref LL_EXTI_LINE_43 (*) | |||
* @arg @ref LL_EXTI_LINE_44 | |||
* @arg @ref LL_EXTI_LINE_45 | |||
* @arg @ref LL_EXTI_LINE_46 | |||
* @arg @ref LL_EXTI_LINE_47 | |||
* @arg @ref LL_EXTI_LINE_48 | |||
* @arg @ref LL_EXTI_LINE_ALL_32_63 | |||
* (*) value not defined in all devices | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_C2_EXTI_DisableIT_32_63(uint32_t ExtiLine) | |||
@@ -519,7 +539,7 @@ __STATIC_INLINE void LL_C2_EXTI_DisableIT_32_63(uint32_t ExtiLine) | |||
/** | |||
* @brief Indicate if ExtiLine Interrupt request is enabled for Lines in range 0 to 31 | |||
* @rmtoll IMR1 IMx LL_EXTI_IsEnabledIT_0_31 | |||
* @param ExtiLine This parameter can be one of the following values: | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_0 | |||
* @arg @ref LL_EXTI_LINE_1 | |||
* @arg @ref LL_EXTI_LINE_2 | |||
@@ -540,19 +560,18 @@ __STATIC_INLINE void LL_C2_EXTI_DisableIT_32_63(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_17 | |||
* @arg @ref LL_EXTI_LINE_18 | |||
* @arg @ref LL_EXTI_LINE_19 | |||
* @arg @ref LL_EXTI_LINE_20 | |||
* @arg @ref LL_EXTI_LINE_21 | |||
* @arg @ref LL_EXTI_LINE_20 (*) | |||
* @arg @ref LL_EXTI_LINE_21 (*) | |||
* @arg @ref LL_EXTI_LINE_22 | |||
* @arg @ref LL_EXTI_LINE_23 | |||
* @arg @ref LL_EXTI_LINE_23 (*) | |||
* @arg @ref LL_EXTI_LINE_24 | |||
* @arg @ref LL_EXTI_LINE_25 | |||
* @arg @ref LL_EXTI_LINE_26 | |||
* @arg @ref LL_EXTI_LINE_27 | |||
* @arg @ref LL_EXTI_LINE_28 | |||
* @arg @ref LL_EXTI_LINE_25 (*) | |||
* @arg @ref LL_EXTI_LINE_28 (*) | |||
* @arg @ref LL_EXTI_LINE_29 | |||
* @arg @ref LL_EXTI_LINE_30 | |||
* @arg @ref LL_EXTI_LINE_31 | |||
* @arg @ref LL_EXTI_LINE_31 (*) | |||
* @arg @ref LL_EXTI_LINE_ALL_0_31 | |||
* (*) value not defined in all devices | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_EXTI_IsEnabledIT_0_31(uint32_t ExtiLine) | |||
@@ -563,7 +582,7 @@ __STATIC_INLINE uint32_t LL_EXTI_IsEnabledIT_0_31(uint32_t ExtiLine) | |||
/** | |||
* @brief Indicate if ExtiLine Interrupt request is enabled for Lines in range 0 to 31 for cpu2 | |||
* @rmtoll C2IMR1 IMx LL_C2_EXTI_IsEnabledIT_0_31 | |||
* @param ExtiLine This parameter can be one of the following values: | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_0 | |||
* @arg @ref LL_EXTI_LINE_1 | |||
* @arg @ref LL_EXTI_LINE_2 | |||
@@ -584,19 +603,18 @@ __STATIC_INLINE uint32_t LL_EXTI_IsEnabledIT_0_31(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_17 | |||
* @arg @ref LL_EXTI_LINE_18 | |||
* @arg @ref LL_EXTI_LINE_19 | |||
* @arg @ref LL_EXTI_LINE_20 | |||
* @arg @ref LL_EXTI_LINE_21 | |||
* @arg @ref LL_EXTI_LINE_20 (*) | |||
* @arg @ref LL_EXTI_LINE_21 (*) | |||
* @arg @ref LL_EXTI_LINE_22 | |||
* @arg @ref LL_EXTI_LINE_23 | |||
* @arg @ref LL_EXTI_LINE_23 (*) | |||
* @arg @ref LL_EXTI_LINE_24 | |||
* @arg @ref LL_EXTI_LINE_25 | |||
* @arg @ref LL_EXTI_LINE_26 | |||
* @arg @ref LL_EXTI_LINE_27 | |||
* @arg @ref LL_EXTI_LINE_28 | |||
* @arg @ref LL_EXTI_LINE_25 (*) | |||
* @arg @ref LL_EXTI_LINE_28 (*) | |||
* @arg @ref LL_EXTI_LINE_29 | |||
* @arg @ref LL_EXTI_LINE_30 | |||
* @arg @ref LL_EXTI_LINE_31 | |||
* @arg @ref LL_EXTI_LINE_31 (*) | |||
* @arg @ref LL_EXTI_LINE_ALL_0_31 | |||
* (*) value not defined in all devices | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_C2_EXTI_IsEnabledIT_0_31(uint32_t ExtiLine) | |||
@@ -607,11 +625,8 @@ __STATIC_INLINE uint32_t LL_C2_EXTI_IsEnabledIT_0_31(uint32_t ExtiLine) | |||
/** | |||
* @brief Indicate if ExtiLine Interrupt request is enabled for Lines in range 32 to 63 | |||
* @rmtoll IMR2 IMx LL_EXTI_IsEnabledIT_32_63 | |||
* @param ExtiLine This parameter can be one of the following values: | |||
* @arg @ref LL_EXTI_LINE_32 | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_33 | |||
* @arg @ref LL_EXTI_LINE_34 | |||
* @arg @ref LL_EXTI_LINE_35 | |||
* @arg @ref LL_EXTI_LINE_36 | |||
* @arg @ref LL_EXTI_LINE_37 | |||
* @arg @ref LL_EXTI_LINE_38 | |||
@@ -619,13 +634,13 @@ __STATIC_INLINE uint32_t LL_C2_EXTI_IsEnabledIT_0_31(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_40 | |||
* @arg @ref LL_EXTI_LINE_41 | |||
* @arg @ref LL_EXTI_LINE_42 | |||
* @arg @ref LL_EXTI_LINE_43 | |||
* @arg @ref LL_EXTI_LINE_43 (*) | |||
* @arg @ref LL_EXTI_LINE_44 | |||
* @arg @ref LL_EXTI_LINE_45 | |||
* @arg @ref LL_EXTI_LINE_46 | |||
* @arg @ref LL_EXTI_LINE_47 | |||
* @arg @ref LL_EXTI_LINE_48 | |||
* @arg @ref LL_EXTI_LINE_ALL_32_63 | |||
* (*) value not defined in all devices | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_EXTI_IsEnabledIT_32_63(uint32_t ExtiLine) | |||
@@ -636,11 +651,8 @@ __STATIC_INLINE uint32_t LL_EXTI_IsEnabledIT_32_63(uint32_t ExtiLine) | |||
/** | |||
* @brief Indicate if ExtiLine Interrupt request is enabled for Lines in range 32 to 63 for cpu2 | |||
* @rmtoll C2IMR2 IMx LL_C2_EXTI_IsEnabledIT_32_63 | |||
* @param ExtiLine This parameter can be one of the following values: | |||
* @arg @ref LL_EXTI_LINE_32 | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_33 | |||
* @arg @ref LL_EXTI_LINE_34 | |||
* @arg @ref LL_EXTI_LINE_35 | |||
* @arg @ref LL_EXTI_LINE_36 | |||
* @arg @ref LL_EXTI_LINE_37 | |||
* @arg @ref LL_EXTI_LINE_38 | |||
@@ -648,13 +660,13 @@ __STATIC_INLINE uint32_t LL_EXTI_IsEnabledIT_32_63(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_40 | |||
* @arg @ref LL_EXTI_LINE_41 | |||
* @arg @ref LL_EXTI_LINE_42 | |||
* @arg @ref LL_EXTI_LINE_43 | |||
* @arg @ref LL_EXTI_LINE_43 (*) | |||
* @arg @ref LL_EXTI_LINE_44 | |||
* @arg @ref LL_EXTI_LINE_45 | |||
* @arg @ref LL_EXTI_LINE_46 | |||
* @arg @ref LL_EXTI_LINE_47 | |||
* @arg @ref LL_EXTI_LINE_48 | |||
* @arg @ref LL_EXTI_LINE_ALL_32_63 | |||
* (*) value not defined in all devices | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_C2_EXTI_IsEnabledIT_32_63(uint32_t ExtiLine) | |||
@@ -673,7 +685,7 @@ __STATIC_INLINE uint32_t LL_C2_EXTI_IsEnabledIT_32_63(uint32_t ExtiLine) | |||
/** | |||
* @brief Enable ExtiLine Event request for Lines in range 0 to 31 | |||
* @rmtoll EMR1 EMx LL_EXTI_EnableEvent_0_31 | |||
* @param ExtiLine This parameter can be one of the following values: | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_0 | |||
* @arg @ref LL_EXTI_LINE_1 | |||
* @arg @ref LL_EXTI_LINE_2 | |||
@@ -693,9 +705,9 @@ __STATIC_INLINE uint32_t LL_C2_EXTI_IsEnabledIT_32_63(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_17 | |||
* @arg @ref LL_EXTI_LINE_18 | |||
* @arg @ref LL_EXTI_LINE_19 | |||
* @arg @ref LL_EXTI_LINE_20 | |||
* @arg @ref LL_EXTI_LINE_21 | |||
* @arg @ref LL_EXTI_LINE_ALL_0_31 | |||
* @arg @ref LL_EXTI_LINE_20 (*) | |||
* @arg @ref LL_EXTI_LINE_21 (*) | |||
* (*) value not defined in all devices | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_EXTI_EnableEvent_0_31(uint32_t ExtiLine) | |||
@@ -706,7 +718,7 @@ __STATIC_INLINE void LL_EXTI_EnableEvent_0_31(uint32_t ExtiLine) | |||
/** | |||
* @brief Enable ExtiLine Event request for Lines in range 0 to 31 for cpu2 | |||
* @rmtoll C2EMR1 EMx LL_C2_EXTI_EnableEvent_0_31 | |||
* @param ExtiLine This parameter can be one of the following values: | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_0 | |||
* @arg @ref LL_EXTI_LINE_1 | |||
* @arg @ref LL_EXTI_LINE_2 | |||
@@ -726,9 +738,9 @@ __STATIC_INLINE void LL_EXTI_EnableEvent_0_31(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_17 | |||
* @arg @ref LL_EXTI_LINE_18 | |||
* @arg @ref LL_EXTI_LINE_19 | |||
* @arg @ref LL_EXTI_LINE_20 | |||
* @arg @ref LL_EXTI_LINE_21 | |||
* @arg @ref LL_EXTI_LINE_ALL_0_31 | |||
* @arg @ref LL_EXTI_LINE_20 (*) | |||
* @arg @ref LL_EXTI_LINE_21 (*) | |||
* (*) value not defined in all devices | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_C2_EXTI_EnableEvent_0_31(uint32_t ExtiLine) | |||
@@ -742,7 +754,6 @@ __STATIC_INLINE void LL_C2_EXTI_EnableEvent_0_31(uint32_t ExtiLine) | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_40 | |||
* @arg @ref LL_EXTI_LINE_41 | |||
* @arg @ref LL_EXTI_LINE_ALL_32_63 | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_EXTI_EnableEvent_32_63(uint32_t ExtiLine) | |||
@@ -756,7 +767,6 @@ __STATIC_INLINE void LL_EXTI_EnableEvent_32_63(uint32_t ExtiLine) | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_40 | |||
* @arg @ref LL_EXTI_LINE_41 | |||
* @arg @ref LL_EXTI_LINE_ALL_32_63 | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_C2_EXTI_EnableEvent_32_63(uint32_t ExtiLine) | |||
@@ -767,7 +777,7 @@ __STATIC_INLINE void LL_C2_EXTI_EnableEvent_32_63(uint32_t ExtiLine) | |||
/** | |||
* @brief Disable ExtiLine Event request for Lines in range 0 to 31 | |||
* @rmtoll EMR1 EMx LL_EXTI_DisableEvent_0_31 | |||
* @param ExtiLine This parameter can be one of the following values: | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_0 | |||
* @arg @ref LL_EXTI_LINE_1 | |||
* @arg @ref LL_EXTI_LINE_2 | |||
@@ -787,9 +797,8 @@ __STATIC_INLINE void LL_C2_EXTI_EnableEvent_32_63(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_17 | |||
* @arg @ref LL_EXTI_LINE_18 | |||
* @arg @ref LL_EXTI_LINE_19 | |||
* @arg @ref LL_EXTI_LINE_20 | |||
* @arg @ref LL_EXTI_LINE_21 | |||
* @arg @ref LL_EXTI_LINE_ALL_0_31 | |||
* @arg @ref LL_EXTI_LINE_20 (*) | |||
* @arg @ref LL_EXTI_LINE_21 (*) | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_EXTI_DisableEvent_0_31(uint32_t ExtiLine) | |||
@@ -800,7 +809,7 @@ __STATIC_INLINE void LL_EXTI_DisableEvent_0_31(uint32_t ExtiLine) | |||
/** | |||
* @brief Disable ExtiLine Event request for Lines in range 0 to 31 for cpu2 | |||
* @rmtoll C2EMR1 EMx LL_C2_EXTI_DisableEvent_0_31 | |||
* @param ExtiLine This parameter can be one of the following values: | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_0 | |||
* @arg @ref LL_EXTI_LINE_1 | |||
* @arg @ref LL_EXTI_LINE_2 | |||
@@ -820,9 +829,9 @@ __STATIC_INLINE void LL_EXTI_DisableEvent_0_31(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_17 | |||
* @arg @ref LL_EXTI_LINE_18 | |||
* @arg @ref LL_EXTI_LINE_19 | |||
* @arg @ref LL_EXTI_LINE_20 | |||
* @arg @ref LL_EXTI_LINE_21 | |||
* @arg @ref LL_EXTI_LINE_ALL_0_31 | |||
* @arg @ref LL_EXTI_LINE_20 (*) | |||
* @arg @ref LL_EXTI_LINE_21 (*) | |||
* (*) value not defined in all devices | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_C2_EXTI_DisableEvent_0_31(uint32_t ExtiLine) | |||
@@ -836,7 +845,7 @@ __STATIC_INLINE void LL_C2_EXTI_DisableEvent_0_31(uint32_t ExtiLine) | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_40 | |||
* @arg @ref LL_EXTI_LINE_41 | |||
* @arg @ref LL_EXTI_LINE_ALL_32_63 | |||
* (*) value not defined in all devices | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_EXTI_DisableEvent_32_63(uint32_t ExtiLine) | |||
@@ -850,7 +859,6 @@ __STATIC_INLINE void LL_EXTI_DisableEvent_32_63(uint32_t ExtiLine) | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_40 | |||
* @arg @ref LL_EXTI_LINE_41 | |||
* @arg @ref LL_EXTI_LINE_ALL_32_63 | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_C2_EXTI_DisableEvent_32_63(uint32_t ExtiLine) | |||
@@ -861,7 +869,7 @@ __STATIC_INLINE void LL_C2_EXTI_DisableEvent_32_63(uint32_t ExtiLine) | |||
/** | |||
* @brief Indicate if ExtiLine Event request is enabled for Lines in range 0 to 31 | |||
* @rmtoll EMR1 EMx LL_EXTI_IsEnabledEvent_0_31 | |||
* @param ExtiLine This parameter can be one of the following values: | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_0 | |||
* @arg @ref LL_EXTI_LINE_1 | |||
* @arg @ref LL_EXTI_LINE_2 | |||
@@ -881,9 +889,9 @@ __STATIC_INLINE void LL_C2_EXTI_DisableEvent_32_63(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_17 | |||
* @arg @ref LL_EXTI_LINE_18 | |||
* @arg @ref LL_EXTI_LINE_19 | |||
* @arg @ref LL_EXTI_LINE_20 | |||
* @arg @ref LL_EXTI_LINE_21 | |||
* @arg @ref LL_EXTI_LINE_ALL_0_31 | |||
* @arg @ref LL_EXTI_LINE_20 (*) | |||
* @arg @ref LL_EXTI_LINE_21 (*) | |||
* (*) value not defined in all devices | |||
* @note Please check each device line mapping for EXTI Line availability | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
@@ -895,7 +903,7 @@ __STATIC_INLINE uint32_t LL_EXTI_IsEnabledEvent_0_31(uint32_t ExtiLine) | |||
/** | |||
* @brief Indicate if ExtiLine Event request is enabled for Lines in range 0 to 31 for cpu2 | |||
* @rmtoll C2EMR1 EMx LL_C2_EXTI_IsEnabledEvent_0_31 | |||
* @param ExtiLine This parameter can be one of the following values: | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_0 | |||
* @arg @ref LL_EXTI_LINE_1 | |||
* @arg @ref LL_EXTI_LINE_2 | |||
@@ -915,9 +923,9 @@ __STATIC_INLINE uint32_t LL_EXTI_IsEnabledEvent_0_31(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_17 | |||
* @arg @ref LL_EXTI_LINE_18 | |||
* @arg @ref LL_EXTI_LINE_19 | |||
* @arg @ref LL_EXTI_LINE_20 | |||
* @arg @ref LL_EXTI_LINE_21 | |||
* @arg @ref LL_EXTI_LINE_ALL_0_31 | |||
* @arg @ref LL_EXTI_LINE_20 (*) | |||
* @arg @ref LL_EXTI_LINE_21 (*) | |||
* (*) value not defined in all devices | |||
* @note Please check each device line mapping for EXTI Line availability | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
@@ -932,7 +940,6 @@ __STATIC_INLINE uint32_t LL_C2_EXTI_IsEnabledEvent_0_31(uint32_t ExtiLine) | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_40 | |||
* @arg @ref LL_EXTI_LINE_41 | |||
* @arg @ref LL_EXTI_LINE_ALL_32_63 | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_EXTI_IsEnabledEvent_32_63(uint32_t ExtiLine) | |||
@@ -946,7 +953,6 @@ __STATIC_INLINE uint32_t LL_EXTI_IsEnabledEvent_32_63(uint32_t ExtiLine) | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_40 | |||
* @arg @ref LL_EXTI_LINE_41 | |||
* @arg @ref LL_EXTI_LINE_ALL_32_63 | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_C2_EXTI_IsEnabledEvent_32_63(uint32_t ExtiLine) | |||
@@ -993,9 +999,10 @@ __STATIC_INLINE uint32_t LL_C2_EXTI_IsEnabledEvent_32_63(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_17 | |||
* @arg @ref LL_EXTI_LINE_18 | |||
* @arg @ref LL_EXTI_LINE_19 | |||
* @arg @ref LL_EXTI_LINE_20 | |||
* @arg @ref LL_EXTI_LINE_21 | |||
* @arg @ref LL_EXTI_LINE_31 | |||
* @arg @ref LL_EXTI_LINE_20 (*) | |||
* @arg @ref LL_EXTI_LINE_21 (*) | |||
* @arg @ref LL_EXTI_LINE_31 (*) | |||
* (*) value not defined in all devices | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_EXTI_EnableRisingTrig_0_31(uint32_t ExtiLine) | |||
@@ -1014,9 +1021,10 @@ __STATIC_INLINE void LL_EXTI_EnableRisingTrig_0_31(uint32_t ExtiLine) | |||
* condition. | |||
* @rmtoll RTSR2 RTx LL_EXTI_EnableRisingTrig_32_63 | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_33 | |||
* @arg @ref LL_EXTI_LINE_33 (*) | |||
* @arg @ref LL_EXTI_LINE_40 | |||
* @arg @ref LL_EXTI_LINE_41 | |||
* (*) value not defined in all devices | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_EXTI_EnableRisingTrig_32_63(uint32_t ExtiLine) | |||
@@ -1055,9 +1063,10 @@ __STATIC_INLINE void LL_EXTI_EnableRisingTrig_32_63(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_17 | |||
* @arg @ref LL_EXTI_LINE_18 | |||
* @arg @ref LL_EXTI_LINE_19 | |||
* @arg @ref LL_EXTI_LINE_20 | |||
* @arg @ref LL_EXTI_LINE_21 | |||
* @arg @ref LL_EXTI_LINE_31 | |||
* @arg @ref LL_EXTI_LINE_20 (*) | |||
* @arg @ref LL_EXTI_LINE_21 (*) | |||
* @arg @ref LL_EXTI_LINE_31 (*) | |||
* (*) value not defined in all devices | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_EXTI_DisableRisingTrig_0_31(uint32_t ExtiLine) | |||
@@ -1077,9 +1086,10 @@ __STATIC_INLINE void LL_EXTI_DisableRisingTrig_0_31(uint32_t ExtiLine) | |||
* condition. | |||
* @rmtoll RTSR2 RTx LL_EXTI_DisableRisingTrig_32_63 | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_33 | |||
* @arg @ref LL_EXTI_LINE_33 (*) | |||
* @arg @ref LL_EXTI_LINE_40 | |||
* @arg @ref LL_EXTI_LINE_41 | |||
* (*) value not defined in all devices | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_EXTI_DisableRisingTrig_32_63(uint32_t ExtiLine) | |||
@@ -1111,9 +1121,10 @@ __STATIC_INLINE void LL_EXTI_DisableRisingTrig_32_63(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_17 | |||
* @arg @ref LL_EXTI_LINE_18 | |||
* @arg @ref LL_EXTI_LINE_19 | |||
* @arg @ref LL_EXTI_LINE_20 | |||
* @arg @ref LL_EXTI_LINE_21 | |||
* @arg @ref LL_EXTI_LINE_31 | |||
* @arg @ref LL_EXTI_LINE_20 (*) | |||
* @arg @ref LL_EXTI_LINE_21 (*) | |||
* @arg @ref LL_EXTI_LINE_31 (*) | |||
* (*) value not defined in all devices | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_EXTI_IsEnabledRisingTrig_0_31(uint32_t ExtiLine) | |||
@@ -1125,9 +1136,10 @@ __STATIC_INLINE uint32_t LL_EXTI_IsEnabledRisingTrig_0_31(uint32_t ExtiLine) | |||
* @brief Check if rising edge trigger is enabled for Lines in range 32 to 63 | |||
* @rmtoll RTSR2 RTx LL_EXTI_IsEnabledRisingTrig_32_63 | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_33 | |||
* @arg @ref LL_EXTI_LINE_33 (*) | |||
* @arg @ref LL_EXTI_LINE_40 | |||
* @arg @ref LL_EXTI_LINE_41 | |||
* (*) value not defined in all devices | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_EXTI_IsEnabledRisingTrig_32_63(uint32_t ExtiLine) | |||
@@ -1171,14 +1183,13 @@ __STATIC_INLINE uint32_t LL_EXTI_IsEnabledRisingTrig_32_63(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_14 | |||
* @arg @ref LL_EXTI_LINE_15 | |||
* @arg @ref LL_EXTI_LINE_16 | |||
* @arg @ref LL_EXTI_LINE_17 | |||
* @arg @ref LL_EXTI_LINE_18 | |||
* @arg @ref LL_EXTI_LINE_19 | |||
* @arg @ref LL_EXTI_LINE_20 | |||
* @arg @ref LL_EXTI_LINE_21 | |||
* @arg @ref LL_EXTI_LINE_22 | |||
* @arg @ref LL_EXTI_LINE_29 | |||
* @arg @ref LL_EXTI_LINE_30 | |||
* @arg @ref LL_EXTI_LINE_31 | |||
* @arg @ref LL_EXTI_LINE_20 (*) | |||
* @arg @ref LL_EXTI_LINE_21 (*) | |||
* @arg @ref LL_EXTI_LINE_31 (*) | |||
* (*) value not defined in all devices | |||
* @note Please check each device line mapping for EXTI Line availability | |||
* @retval None | |||
*/ | |||
@@ -1198,10 +1209,10 @@ __STATIC_INLINE void LL_EXTI_EnableFallingTrig_0_31(uint32_t ExtiLine) | |||
* condition. | |||
* @rmtoll FTSR2 FTx LL_EXTI_EnableFallingTrig_32_63 | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_35 | |||
* @arg @ref LL_EXTI_LINE_36 | |||
* @arg @ref LL_EXTI_LINE_37 | |||
* @arg @ref LL_EXTI_LINE_38 | |||
* @arg @ref LL_EXTI_LINE_33 (*) | |||
* @arg @ref LL_EXTI_LINE_40 | |||
* @arg @ref LL_EXTI_LINE_41 | |||
* (*) value not defined in all devices | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_EXTI_EnableFallingTrig_32_63(uint32_t ExtiLine) | |||
@@ -1236,14 +1247,13 @@ __STATIC_INLINE void LL_EXTI_EnableFallingTrig_32_63(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_14 | |||
* @arg @ref LL_EXTI_LINE_15 | |||
* @arg @ref LL_EXTI_LINE_16 | |||
* @arg @ref LL_EXTI_LINE_17 | |||
* @arg @ref LL_EXTI_LINE_18 | |||
* @arg @ref LL_EXTI_LINE_19 | |||
* @arg @ref LL_EXTI_LINE_20 | |||
* @arg @ref LL_EXTI_LINE_21 | |||
* @arg @ref LL_EXTI_LINE_22 | |||
* @arg @ref LL_EXTI_LINE_29 | |||
* @arg @ref LL_EXTI_LINE_30 | |||
* @arg @ref LL_EXTI_LINE_31 | |||
* @arg @ref LL_EXTI_LINE_20 (*) | |||
* @arg @ref LL_EXTI_LINE_21 (*) | |||
* @arg @ref LL_EXTI_LINE_31 (*) | |||
* (*) value not defined in all devices | |||
* @note Please check each device line mapping for EXTI Line availability | |||
* @retval None | |||
*/ | |||
@@ -1262,10 +1272,10 @@ __STATIC_INLINE void LL_EXTI_DisableFallingTrig_0_31(uint32_t ExtiLine) | |||
* In this case, both generate a trigger condition. | |||
* @rmtoll FTSR2 FTx LL_EXTI_DisableFallingTrig_32_63 | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_35 | |||
* @arg @ref LL_EXTI_LINE_36 | |||
* @arg @ref LL_EXTI_LINE_37 | |||
* @arg @ref LL_EXTI_LINE_38 | |||
* @arg @ref LL_EXTI_LINE_33 (*) | |||
* @arg @ref LL_EXTI_LINE_40 | |||
* @arg @ref LL_EXTI_LINE_41 | |||
* (*) value not defined in all devices | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_EXTI_DisableFallingTrig_32_63(uint32_t ExtiLine) | |||
@@ -1294,14 +1304,13 @@ __STATIC_INLINE void LL_EXTI_DisableFallingTrig_32_63(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_14 | |||
* @arg @ref LL_EXTI_LINE_15 | |||
* @arg @ref LL_EXTI_LINE_16 | |||
* @arg @ref LL_EXTI_LINE_17 | |||
* @arg @ref LL_EXTI_LINE_18 | |||
* @arg @ref LL_EXTI_LINE_19 | |||
* @arg @ref LL_EXTI_LINE_20 | |||
* @arg @ref LL_EXTI_LINE_21 | |||
* @arg @ref LL_EXTI_LINE_22 | |||
* @arg @ref LL_EXTI_LINE_29 | |||
* @arg @ref LL_EXTI_LINE_30 | |||
* @arg @ref LL_EXTI_LINE_31 | |||
* @arg @ref LL_EXTI_LINE_20 (*) | |||
* @arg @ref LL_EXTI_LINE_21 (*) | |||
* @arg @ref LL_EXTI_LINE_31 (*) | |||
* (*) value not defined in all devices | |||
* @note Please check each device line mapping for EXTI Line availability | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
@@ -1314,10 +1323,9 @@ __STATIC_INLINE uint32_t LL_EXTI_IsEnabledFallingTrig_0_31(uint32_t ExtiLine) | |||
* @brief Check if falling edge trigger is enabled for Lines in range 32 to 63 | |||
* @rmtoll FTSR2 FTx LL_EXTI_IsEnabledFallingTrig_32_63 | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_35 | |||
* @arg @ref LL_EXTI_LINE_36 | |||
* @arg @ref LL_EXTI_LINE_37 | |||
* @arg @ref LL_EXTI_LINE_38 | |||
* @arg @ref LL_EXTI_LINE_33 (*) | |||
* @arg @ref LL_EXTI_LINE_40 | |||
* @arg @ref LL_EXTI_LINE_41 | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_EXTI_IsEnabledFallingTrig_32_63(uint32_t ExtiLine) | |||
@@ -1359,14 +1367,13 @@ __STATIC_INLINE uint32_t LL_EXTI_IsEnabledFallingTrig_32_63(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_14 | |||
* @arg @ref LL_EXTI_LINE_15 | |||
* @arg @ref LL_EXTI_LINE_16 | |||
* @arg @ref LL_EXTI_LINE_17 | |||
* @arg @ref LL_EXTI_LINE_18 | |||
* @arg @ref LL_EXTI_LINE_19 | |||
* @arg @ref LL_EXTI_LINE_20 | |||
* @arg @ref LL_EXTI_LINE_21 | |||
* @arg @ref LL_EXTI_LINE_22 | |||
* @arg @ref LL_EXTI_LINE_29 | |||
* @arg @ref LL_EXTI_LINE_30 | |||
* @arg @ref LL_EXTI_LINE_31 | |||
* @arg @ref LL_EXTI_LINE_20 (*) | |||
* @arg @ref LL_EXTI_LINE_21 (*) | |||
* @arg @ref LL_EXTI_LINE_31 (*) | |||
* (*) value not defined in all devices | |||
* @note Please check each device line mapping for EXTI Line availability | |||
* @retval None | |||
*/ | |||
@@ -1384,10 +1391,10 @@ __STATIC_INLINE void LL_EXTI_GenerateSWI_0_31(uint32_t ExtiLine) | |||
* register (by writing a 1 into the bit) | |||
* @rmtoll SWIER2 SWIx LL_EXTI_GenerateSWI_32_63 | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_35 | |||
* @arg @ref LL_EXTI_LINE_36 | |||
* @arg @ref LL_EXTI_LINE_37 | |||
* @arg @ref LL_EXTI_LINE_38 | |||
* @arg @ref LL_EXTI_LINE_33 (*) | |||
* @arg @ref LL_EXTI_LINE_40 | |||
* @arg @ref LL_EXTI_LINE_41 | |||
* (*) value not defined in all devices | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_EXTI_GenerateSWI_32_63(uint32_t ExtiLine) | |||
@@ -1426,11 +1433,13 @@ __STATIC_INLINE void LL_EXTI_GenerateSWI_32_63(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_14 | |||
* @arg @ref LL_EXTI_LINE_15 | |||
* @arg @ref LL_EXTI_LINE_16 | |||
* @arg @ref LL_EXTI_LINE_17 | |||
* @arg @ref LL_EXTI_LINE_18 | |||
* @arg @ref LL_EXTI_LINE_19 | |||
* @arg @ref LL_EXTI_LINE_20 | |||
* @arg @ref LL_EXTI_LINE_21 | |||
* @arg @ref LL_EXTI_LINE_31 | |||
* @arg @ref LL_EXTI_LINE_20 (*) | |||
* @arg @ref LL_EXTI_LINE_21 (*) | |||
* @arg @ref LL_EXTI_LINE_31 (*) | |||
* (*) value not defined in all devices | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_EXTI_IsActiveFlag_0_31(uint32_t ExtiLine) | |||
@@ -1444,9 +1453,10 @@ __STATIC_INLINE uint32_t LL_EXTI_IsActiveFlag_0_31(uint32_t ExtiLine) | |||
* line. This bit is cleared by writing a 1 to the bit. | |||
* @rmtoll PR2 PIFx LL_EXTI_IsActiveFlag_32_63 | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_33 | |||
* @arg @ref LL_EXTI_LINE_33 (*) | |||
* @arg @ref LL_EXTI_LINE_40 | |||
* @arg @ref LL_EXTI_LINE_41 | |||
* (*) value not defined in all devices | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_EXTI_IsActiveFlag_32_63(uint32_t ExtiLine) | |||
@@ -1477,11 +1487,13 @@ __STATIC_INLINE uint32_t LL_EXTI_IsActiveFlag_32_63(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_14 | |||
* @arg @ref LL_EXTI_LINE_15 | |||
* @arg @ref LL_EXTI_LINE_16 | |||
* @arg @ref LL_EXTI_LINE_17 | |||
* @arg @ref LL_EXTI_LINE_18 | |||
* @arg @ref LL_EXTI_LINE_19 | |||
* @arg @ref LL_EXTI_LINE_20 | |||
* @arg @ref LL_EXTI_LINE_21 | |||
* @arg @ref LL_EXTI_LINE_31 | |||
* @arg @ref LL_EXTI_LINE_20 (*) | |||
* @arg @ref LL_EXTI_LINE_21 (*) | |||
* @arg @ref LL_EXTI_LINE_31 (*) | |||
* (*) value not defined in all devices | |||
* @retval @note This bit is set when the selected edge event arrives on the interrupt | |||
*/ | |||
__STATIC_INLINE uint32_t LL_EXTI_ReadFlag_0_31(uint32_t ExtiLine) | |||
@@ -1495,9 +1507,10 @@ __STATIC_INLINE uint32_t LL_EXTI_ReadFlag_0_31(uint32_t ExtiLine) | |||
* line. This bit is cleared by writing a 1 to the bit. | |||
* @rmtoll PR2 PIFx LL_EXTI_ReadFlag_32_63 | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_33 | |||
* @arg @ref LL_EXTI_LINE_33 (*) | |||
* @arg @ref LL_EXTI_LINE_40 | |||
* @arg @ref LL_EXTI_LINE_41 | |||
* (*) value not defined in all devices | |||
* @retval @note This bit is set when the selected edge event arrives on the interrupt | |||
*/ | |||
__STATIC_INLINE uint32_t LL_EXTI_ReadFlag_32_63(uint32_t ExtiLine) | |||
@@ -1528,11 +1541,13 @@ __STATIC_INLINE uint32_t LL_EXTI_ReadFlag_32_63(uint32_t ExtiLine) | |||
* @arg @ref LL_EXTI_LINE_14 | |||
* @arg @ref LL_EXTI_LINE_15 | |||
* @arg @ref LL_EXTI_LINE_16 | |||
* @arg @ref LL_EXTI_LINE_17 | |||
* @arg @ref LL_EXTI_LINE_18 | |||
* @arg @ref LL_EXTI_LINE_19 | |||
* @arg @ref LL_EXTI_LINE_20 | |||
* @arg @ref LL_EXTI_LINE_21 | |||
* @arg @ref LL_EXTI_LINE_31 | |||
* @arg @ref LL_EXTI_LINE_20 (*) | |||
* @arg @ref LL_EXTI_LINE_21 (*) | |||
* @arg @ref LL_EXTI_LINE_31 (*) | |||
* (*) value not defined in all devices | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_EXTI_ClearFlag_0_31(uint32_t ExtiLine) | |||
@@ -1546,9 +1561,10 @@ __STATIC_INLINE void LL_EXTI_ClearFlag_0_31(uint32_t ExtiLine) | |||
* line. This bit is cleared by writing a 1 to the bit. | |||
* @rmtoll PR2 PIFx LL_EXTI_ClearFlag_32_63 | |||
* @param ExtiLine This parameter can be a combination of the following values: | |||
* @arg @ref LL_EXTI_LINE_33 | |||
* @arg @ref LL_EXTI_LINE_33 (*) | |||
* @arg @ref LL_EXTI_LINE_40 | |||
* @arg @ref LL_EXTI_LINE_41 | |||
* (*) value not defined in all devices | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_EXTI_ClearFlag_32_63(uint32_t ExtiLine) | |||
@@ -695,6 +695,18 @@ __STATIC_INLINE uint32_t LL_C2_IPCC_IsActiveFlag_CHx(IPCC_TypeDef const *const | |||
return ((READ_BIT(IPCCx->C2TOC1SR, Channel) == (Channel)) ? 1UL : 0UL); | |||
} | |||
/** | |||
* @brief Get the number of supported channels. | |||
* @param IPCCx IPCC Instance. | |||
* @retval Number of supported channels. | |||
*/ | |||
__STATIC_INLINE uint32_t LL_IPCC_GetChannelNumber(IPCC_TypeDef *IPCCx) | |||
{ | |||
/* Added for compatibility with other STM32 series */ | |||
(void)(IPCCx); /* To avoid gcc/g++ warnings */ | |||
return 6U; | |||
} | |||
/** | |||
* @} | |||
*/ | |||
@@ -191,11 +191,19 @@ typedef struct | |||
#define LL_LPTIM_TRIG_SOURCE_GPIO 0x00000000U /*!<External input trigger is connected to TIMx_ETR input*/ | |||
#define LL_LPTIM_TRIG_SOURCE_RTCALARMA LPTIM_CFGR_TRIGSEL_0 /*!<External input trigger is connected to RTC Alarm A*/ | |||
#define LL_LPTIM_TRIG_SOURCE_RTCALARMB LPTIM_CFGR_TRIGSEL_1 /*!<External input trigger is connected to RTC Alarm B*/ | |||
#if defined(RTC_TAMPER1_SUPPORT) | |||
#define LL_LPTIM_TRIG_SOURCE_RTCTAMP1 (LPTIM_CFGR_TRIGSEL_1 | LPTIM_CFGR_TRIGSEL_0) /*!<External input trigger is connected to RTC Tamper 1*/ | |||
#endif /* RTC_TAMPER1_SUPPORT */ | |||
#define LL_LPTIM_TRIG_SOURCE_RTCTAMP2 LPTIM_CFGR_TRIGSEL_2 /*!<External input trigger is connected to RTC Tamper 2*/ | |||
#if defined(RTC_TAMPER3_SUPPORT) | |||
#define LL_LPTIM_TRIG_SOURCE_RTCTAMP3 (LPTIM_CFGR_TRIGSEL_2 | LPTIM_CFGR_TRIGSEL_0) /*!<External input trigger is connected to RTC Tamper 3*/ | |||
#endif /* RTC_TAMPER3_SUPPORT */ | |||
#if defined(COMP1) | |||
#define LL_LPTIM_TRIG_SOURCE_COMP1 (LPTIM_CFGR_TRIGSEL_2 | LPTIM_CFGR_TRIGSEL_1) /*!<External input trigger is connected to COMP1 output*/ | |||
#endif /* COMP1 */ | |||
#if defined(COMP2) | |||
#define LL_LPTIM_TRIG_SOURCE_COMP2 LPTIM_CFGR_TRIGSEL /*!<External input trigger is connected to COMP2 output*/ | |||
#endif /* COMP2 */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -281,7 +289,6 @@ typedef struct | |||
* @} | |||
*/ | |||
/** | |||
* @} | |||
*/ | |||
@@ -302,7 +309,7 @@ typedef struct | |||
* @param __VALUE__ Value to be written in the register | |||
* @retval None | |||
*/ | |||
#define LL_LPTIM_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG((__INSTANCE__)->(__REG__), (__VALUE__)) | |||
#define LL_LPTIM_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG((__INSTANCE__)->__REG__, (__VALUE__)) | |||
/** | |||
* @brief Read a value in LPTIM register | |||
@@ -310,7 +317,7 @@ typedef struct | |||
* @param __REG__ Register to be read | |||
* @retval Register value | |||
*/ | |||
#define LL_LPTIM_ReadReg(__INSTANCE__, __REG__) READ_REG((__INSTANCE__)->(__REG__)) | |||
#define LL_LPTIM_ReadReg(__INSTANCE__, __REG__) READ_REG((__INSTANCE__)->__REG__) | |||
/** | |||
* @} | |||
*/ | |||
@@ -363,7 +370,7 @@ __STATIC_INLINE void LL_LPTIM_Enable(LPTIM_TypeDef *LPTIMx) | |||
*/ | |||
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabled(LPTIM_TypeDef *LPTIMx) | |||
{ | |||
return (((READ_BIT(LPTIMx->CR, LPTIM_CR_ENABLE) == LPTIM_CR_ENABLE)? 1UL : 0UL)); | |||
return (((READ_BIT(LPTIMx->CR, LPTIM_CR_ENABLE) == LPTIM_CR_ENABLE) ? 1UL : 0UL)); | |||
} | |||
/** | |||
@@ -416,7 +423,7 @@ __STATIC_INLINE void LL_LPTIM_DisableResetAfterRead(LPTIM_TypeDef *LPTIMx) | |||
*/ | |||
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabledResetAfterRead(LPTIM_TypeDef *LPTIMx) | |||
{ | |||
return (((READ_BIT(LPTIMx->CR, LPTIM_CR_RSTARE) == LPTIM_CR_RSTARE)? 1UL : 0UL)); | |||
return (((READ_BIT(LPTIMx->CR, LPTIM_CR_RSTARE) == LPTIM_CR_RSTARE) ? 1UL : 0UL)); | |||
} | |||
/** | |||
@@ -467,7 +474,7 @@ __STATIC_INLINE uint32_t LL_LPTIM_GetUpdateMode(LPTIM_TypeDef *LPTIMx) | |||
* @note The LPTIMx_ARR register content must only be modified when the LPTIM is enabled | |||
* @note After a write to the LPTIMx_ARR register a new write operation to the | |||
* same register can only be performed when the previous write operation | |||
* is completed. Any successive write before the ARROK flag be set, will | |||
* is completed. Any successive write before the ARROK flag is set, will | |||
* lead to unpredictable results. | |||
* @note autoreload value be strictly greater than the compare value. | |||
* @rmtoll ARR ARR LL_LPTIM_SetAutoReload | |||
@@ -495,7 +502,7 @@ __STATIC_INLINE uint32_t LL_LPTIM_GetAutoReload(LPTIM_TypeDef *LPTIMx) | |||
* @brief Set the compare value | |||
* @note After a write to the LPTIMx_CMP register a new write operation to the | |||
* same register can only be performed when the previous write operation | |||
* is completed. Any successive write before the CMPOK flag be set, will | |||
* is completed. Any successive write before the CMPOK flag is set, will | |||
* lead to unpredictable results. | |||
* @rmtoll CMP CMP LL_LPTIM_SetCompare | |||
* @param LPTIMx Low-Power Timer instance | |||
@@ -683,8 +690,7 @@ __STATIC_INLINE uint32_t LL_LPTIM_GetPrescaler(LPTIM_TypeDef *LPTIMx) | |||
/** | |||
* @brief Set LPTIM input 1 source (default GPIO). | |||
* @rmtoll OR OR_0 LL_LPTIM_SetInput1Src | |||
* @rmtoll OR OR_1 LL_LPTIM_SetInput1Src | |||
* @rmtoll OR OR LL_LPTIM_SetInput1Src | |||
* @param LPTIMx Low-Power Timer instance | |||
* @param Src This parameter can be one of the following values: | |||
* @arg @ref LL_LPTIM_INPUT1_SRC_GPIO | |||
@@ -695,12 +701,12 @@ __STATIC_INLINE uint32_t LL_LPTIM_GetPrescaler(LPTIM_TypeDef *LPTIMx) | |||
*/ | |||
__STATIC_INLINE void LL_LPTIM_SetInput1Src(LPTIM_TypeDef *LPTIMx, uint32_t Src) | |||
{ | |||
WRITE_REG(LPTIMx->OR, Src); | |||
MODIFY_REG(LPTIMx->OR, LPTIM_OR_OR, Src); | |||
} | |||
/** | |||
* @brief Set LPTIM input 2 source (default GPIO). | |||
* @rmtoll OR OR_0 LL_LPTIM_SetInput2Src | |||
* @rmtoll OR OR LL_LPTIM_SetInput2Src | |||
* @param LPTIMx Low-Power Timer instance | |||
* @param Src This parameter can be one of the following values: | |||
* @arg @ref LL_LPTIM_INPUT2_SRC_GPIO | |||
@@ -709,7 +715,7 @@ __STATIC_INLINE void LL_LPTIM_SetInput1Src(LPTIM_TypeDef *LPTIMx, uint32_t Src) | |||
*/ | |||
__STATIC_INLINE void LL_LPTIM_SetInput2Src(LPTIM_TypeDef *LPTIMx, uint32_t Src) | |||
{ | |||
WRITE_REG(LPTIMx->OR, Src); | |||
MODIFY_REG(LPTIMx->OR, LPTIM_OR_OR, Src); | |||
} | |||
/** | |||
@@ -759,7 +765,7 @@ __STATIC_INLINE void LL_LPTIM_DisableTimeout(LPTIM_TypeDef *LPTIMx) | |||
*/ | |||
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabledTimeout(LPTIM_TypeDef *LPTIMx) | |||
{ | |||
return (((READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_TIMOUT) == LPTIM_CFGR_TIMOUT)? 1UL : 0UL)); | |||
return (((READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_TIMOUT) == LPTIM_CFGR_TIMOUT) ? 1UL : 0UL)); | |||
} | |||
/** | |||
@@ -787,11 +793,14 @@ __STATIC_INLINE void LL_LPTIM_TrigSw(LPTIM_TypeDef *LPTIMx) | |||
* @arg @ref LL_LPTIM_TRIG_SOURCE_GPIO | |||
* @arg @ref LL_LPTIM_TRIG_SOURCE_RTCALARMA | |||
* @arg @ref LL_LPTIM_TRIG_SOURCE_RTCALARMB | |||
* @arg @ref LL_LPTIM_TRIG_SOURCE_RTCTAMP1 | |||
* @arg @ref LL_LPTIM_TRIG_SOURCE_RTCTAMP1 (*) | |||
* @arg @ref LL_LPTIM_TRIG_SOURCE_RTCTAMP2 | |||
* @arg @ref LL_LPTIM_TRIG_SOURCE_RTCTAMP3 | |||
* @arg @ref LL_LPTIM_TRIG_SOURCE_COMP1 | |||
* @arg @ref LL_LPTIM_TRIG_SOURCE_COMP2 | |||
* @arg @ref LL_LPTIM_TRIG_SOURCE_RTCTAMP3 (*) | |||
* @arg @ref LL_LPTIM_TRIG_SOURCE_COMP1 (*) | |||
* @arg @ref LL_LPTIM_TRIG_SOURCE_COMP2 (*) | |||
* | |||
* (*) Value not defined in all devices. \n | |||
* | |||
* @param Filter This parameter can be one of the following values: | |||
* @arg @ref LL_LPTIM_TRIG_FILTER_NONE | |||
* @arg @ref LL_LPTIM_TRIG_FILTER_2 | |||
@@ -816,11 +825,14 @@ __STATIC_INLINE void LL_LPTIM_ConfigTrigger(LPTIM_TypeDef *LPTIMx, uint32_t Sour | |||
* @arg @ref LL_LPTIM_TRIG_SOURCE_GPIO | |||
* @arg @ref LL_LPTIM_TRIG_SOURCE_RTCALARMA | |||
* @arg @ref LL_LPTIM_TRIG_SOURCE_RTCALARMB | |||
* @arg @ref LL_LPTIM_TRIG_SOURCE_RTCTAMP1 | |||
* @arg @ref LL_LPTIM_TRIG_SOURCE_RTCTAMP1 (*) | |||
* @arg @ref LL_LPTIM_TRIG_SOURCE_RTCTAMP2 | |||
* @arg @ref LL_LPTIM_TRIG_SOURCE_RTCTAMP3 | |||
* @arg @ref LL_LPTIM_TRIG_SOURCE_COMP1 | |||
* @arg @ref LL_LPTIM_TRIG_SOURCE_COMP2 | |||
* @arg @ref LL_LPTIM_TRIG_SOURCE_RTCTAMP3 (*) | |||
* @arg @ref LL_LPTIM_TRIG_SOURCE_COMP1 (*) | |||
* @arg @ref LL_LPTIM_TRIG_SOURCE_COMP2 (*) | |||
* | |||
* (*) Value not defined in all devices. \n | |||
* | |||
*/ | |||
__STATIC_INLINE uint32_t LL_LPTIM_GetTriggerSource(LPTIM_TypeDef *LPTIMx) | |||
{ | |||
@@ -1022,7 +1034,7 @@ __STATIC_INLINE void LL_LPTIM_DisableEncoderMode(LPTIM_TypeDef *LPTIMx) | |||
*/ | |||
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabledEncoderMode(LPTIM_TypeDef *LPTIMx) | |||
{ | |||
return (((READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_ENC) == LPTIM_CFGR_ENC)? 1UL : 0UL)); | |||
return (((READ_BIT(LPTIMx->CFGR, LPTIM_CFGR_ENC) == LPTIM_CFGR_ENC) ? 1UL : 0UL)); | |||
} | |||
/** | |||
@@ -1052,7 +1064,7 @@ __STATIC_INLINE void LL_LPTIM_ClearFLAG_CMPM(LPTIM_TypeDef *LPTIMx) | |||
*/ | |||
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_CMPM(LPTIM_TypeDef *LPTIMx) | |||
{ | |||
return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_CMPM) == LPTIM_ISR_CMPM)? 1UL : 0UL)); | |||
return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_CMPM) == LPTIM_ISR_CMPM) ? 1UL : 0UL)); | |||
} | |||
/** | |||
@@ -1067,14 +1079,14 @@ __STATIC_INLINE void LL_LPTIM_ClearFLAG_ARRM(LPTIM_TypeDef *LPTIMx) | |||
} | |||
/** | |||
* @brief Inform application whether a autoreload match interrupt has occured. | |||
* @brief Inform application whether a autoreload match interrupt has occurred. | |||
* @rmtoll ISR ARRM LL_LPTIM_IsActiveFlag_ARRM | |||
* @param LPTIMx Low-Power Timer instance | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_ARRM(LPTIM_TypeDef *LPTIMx) | |||
{ | |||
return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_ARRM) == LPTIM_ISR_ARRM)? 1UL : 0UL)); | |||
return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_ARRM) == LPTIM_ISR_ARRM) ? 1UL : 0UL)); | |||
} | |||
/** | |||
@@ -1096,7 +1108,7 @@ __STATIC_INLINE void LL_LPTIM_ClearFlag_EXTTRIG(LPTIM_TypeDef *LPTIMx) | |||
*/ | |||
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_EXTTRIG(LPTIM_TypeDef *LPTIMx) | |||
{ | |||
return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_EXTTRIG) == LPTIM_ISR_EXTTRIG)? 1UL : 0UL)); | |||
return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_EXTTRIG) == LPTIM_ISR_EXTTRIG) ? 1UL : 0UL)); | |||
} | |||
/** | |||
@@ -1118,7 +1130,7 @@ __STATIC_INLINE void LL_LPTIM_ClearFlag_CMPOK(LPTIM_TypeDef *LPTIMx) | |||
*/ | |||
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_CMPOK(LPTIM_TypeDef *LPTIMx) | |||
{ | |||
return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_CMPOK) == LPTIM_ISR_CMPOK)? 1UL : 0UL)); | |||
return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_CMPOK) == LPTIM_ISR_CMPOK) ? 1UL : 0UL)); | |||
} | |||
/** | |||
@@ -1140,7 +1152,7 @@ __STATIC_INLINE void LL_LPTIM_ClearFlag_ARROK(LPTIM_TypeDef *LPTIMx) | |||
*/ | |||
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_ARROK(LPTIM_TypeDef *LPTIMx) | |||
{ | |||
return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_ARROK) == LPTIM_ISR_ARROK)? 1UL : 0UL)); | |||
return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_ARROK) == LPTIM_ISR_ARROK) ? 1UL : 0UL)); | |||
} | |||
/** | |||
@@ -1162,7 +1174,7 @@ __STATIC_INLINE void LL_LPTIM_ClearFlag_UP(LPTIM_TypeDef *LPTIMx) | |||
*/ | |||
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_UP(LPTIM_TypeDef *LPTIMx) | |||
{ | |||
return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_UP) == LPTIM_ISR_UP)? 1UL : 0UL)); | |||
return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_UP) == LPTIM_ISR_UP) ? 1UL : 0UL)); | |||
} | |||
/** | |||
@@ -1184,7 +1196,7 @@ __STATIC_INLINE void LL_LPTIM_ClearFlag_DOWN(LPTIM_TypeDef *LPTIMx) | |||
*/ | |||
__STATIC_INLINE uint32_t LL_LPTIM_IsActiveFlag_DOWN(LPTIM_TypeDef *LPTIMx) | |||
{ | |||
return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_DOWN) == LPTIM_ISR_DOWN)? 1UL : 0UL)); | |||
return (((READ_BIT(LPTIMx->ISR, LPTIM_ISR_DOWN) == LPTIM_ISR_DOWN) ? 1UL : 0UL)); | |||
} | |||
/** | |||
@@ -1225,7 +1237,7 @@ __STATIC_INLINE void LL_LPTIM_DisableIT_CMPM(LPTIM_TypeDef *LPTIMx) | |||
*/ | |||
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_CMPM(LPTIM_TypeDef *LPTIMx) | |||
{ | |||
return (((READ_BIT(LPTIMx->IER, LPTIM_IER_CMPMIE) == LPTIM_IER_CMPMIE)? 1UL : 0UL)); | |||
return (((READ_BIT(LPTIMx->IER, LPTIM_IER_CMPMIE) == LPTIM_IER_CMPMIE) ? 1UL : 0UL)); | |||
} | |||
/** | |||
@@ -1258,7 +1270,7 @@ __STATIC_INLINE void LL_LPTIM_DisableIT_ARRM(LPTIM_TypeDef *LPTIMx) | |||
*/ | |||
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_ARRM(LPTIM_TypeDef *LPTIMx) | |||
{ | |||
return (((READ_BIT(LPTIMx->IER, LPTIM_IER_ARRMIE) == LPTIM_IER_ARRMIE)? 1UL : 0UL)); | |||
return (((READ_BIT(LPTIMx->IER, LPTIM_IER_ARRMIE) == LPTIM_IER_ARRMIE) ? 1UL : 0UL)); | |||
} | |||
/** | |||
@@ -1291,7 +1303,7 @@ __STATIC_INLINE void LL_LPTIM_DisableIT_EXTTRIG(LPTIM_TypeDef *LPTIMx) | |||
*/ | |||
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_EXTTRIG(LPTIM_TypeDef *LPTIMx) | |||
{ | |||
return (((READ_BIT(LPTIMx->IER, LPTIM_IER_EXTTRIGIE) == LPTIM_IER_EXTTRIGIE)? 1UL : 0UL)); | |||
return (((READ_BIT(LPTIMx->IER, LPTIM_IER_EXTTRIGIE) == LPTIM_IER_EXTTRIGIE) ? 1UL : 0UL)); | |||
} | |||
/** | |||
@@ -1324,7 +1336,7 @@ __STATIC_INLINE void LL_LPTIM_DisableIT_CMPOK(LPTIM_TypeDef *LPTIMx) | |||
*/ | |||
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_CMPOK(LPTIM_TypeDef *LPTIMx) | |||
{ | |||
return (((READ_BIT(LPTIMx->IER, LPTIM_IER_CMPOKIE) == LPTIM_IER_CMPOKIE)? 1UL : 0UL)); | |||
return (((READ_BIT(LPTIMx->IER, LPTIM_IER_CMPOKIE) == LPTIM_IER_CMPOKIE) ? 1UL : 0UL)); | |||
} | |||
/** | |||
@@ -1353,11 +1365,11 @@ __STATIC_INLINE void LL_LPTIM_DisableIT_ARROK(LPTIM_TypeDef *LPTIMx) | |||
* @brief Indicates whether the autoreload register write completed interrupt (ARROKIE) is enabled. | |||
* @rmtoll IER ARROKIE LL_LPTIM_IsEnabledIT_ARROK | |||
* @param LPTIMx Low-Power Timer instance | |||
* @retval State of bit (1 or 0). | |||
* @retval State of bit(1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_ARROK(LPTIM_TypeDef *LPTIMx) | |||
{ | |||
return (((READ_BIT(LPTIMx->IER, LPTIM_IER_ARROKIE) == LPTIM_IER_ARROKIE)? 1UL : 0UL)); | |||
return (((READ_BIT(LPTIMx->IER, LPTIM_IER_ARROKIE) == LPTIM_IER_ARROKIE) ? 1UL : 0UL)); | |||
} | |||
/** | |||
@@ -1386,11 +1398,11 @@ __STATIC_INLINE void LL_LPTIM_DisableIT_UP(LPTIM_TypeDef *LPTIMx) | |||
* @brief Indicates whether the direction change to up interrupt (UPIE) is enabled. | |||
* @rmtoll IER UPIE LL_LPTIM_IsEnabledIT_UP | |||
* @param LPTIMx Low-Power Timer instance | |||
* @retval State of bit (1 or 0). | |||
* @retval State of bit(1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_UP(LPTIM_TypeDef *LPTIMx) | |||
{ | |||
return (((READ_BIT(LPTIMx->IER, LPTIM_IER_UPIE) == LPTIM_IER_UPIE)? 1UL : 0UL)); | |||
return (((READ_BIT(LPTIMx->IER, LPTIM_IER_UPIE) == LPTIM_IER_UPIE) ? 1UL : 0UL)); | |||
} | |||
/** | |||
@@ -1419,11 +1431,11 @@ __STATIC_INLINE void LL_LPTIM_DisableIT_DOWN(LPTIM_TypeDef *LPTIMx) | |||
* @brief Indicates whether the direction change to down interrupt (DOWNIE) is enabled. | |||
* @rmtoll IER DOWNIE LL_LPTIM_IsEnabledIT_DOWN | |||
* @param LPTIMx Low-Power Timer instance | |||
* @retval State of bit (1 or 0). | |||
* @retval State of bit(1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_LPTIM_IsEnabledIT_DOWN(LPTIM_TypeDef *LPTIMx) | |||
{ | |||
return ((READ_BIT(LPTIMx->IER, LPTIM_IER_DOWNIE) == LPTIM_IER_DOWNIE)? 1UL : 0UL); | |||
return ((READ_BIT(LPTIMx->IER, LPTIM_IER_DOWNIE) == LPTIM_IER_DOWNIE) ? 1UL : 0UL); | |||
} | |||
/** | |||
@@ -442,7 +442,8 @@ typedef struct | |||
* @param __BAUDRATE__ Baud Rate value to achieve | |||
* @retval LPUARTDIV value to be used for BRR register filling | |||
*/ | |||
#define __LL_LPUART_DIV(__PERIPHCLK__, __PRESCALER__, __BAUDRATE__) (uint32_t)((((((uint64_t)(__PERIPHCLK__)/(uint64_t)(LPUART_PRESCALER_TAB[(uint16_t)(__PRESCALER__)])) * LPUART_LPUARTDIV_FREQ_MUL) + (uint32_t)((__BAUDRATE__)/2U))/(__BAUDRATE__)) & LPUART_BRR_MASK) | |||
#define __LL_LPUART_DIV(__PERIPHCLK__, __PRESCALER__, __BAUDRATE__) (uint32_t)((((((uint64_t)(__PERIPHCLK__)/(uint64_t)(LPUART_PRESCALER_TAB[(uint16_t)(__PRESCALER__)])) * LPUART_LPUARTDIV_FREQ_MUL)\ | |||
+ (uint32_t)((__BAUDRATE__)/2U))/(__BAUDRATE__)) & LPUART_BRR_MASK) | |||
/** | |||
* @} | |||
@@ -1341,9 +1342,10 @@ __STATIC_INLINE uint32_t LL_LPUART_GetWKUPType(USART_TypeDef *LPUARTx) | |||
* @param BaudRate Baud Rate | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_LPUART_SetBaudRate(USART_TypeDef *LPUARTx, uint32_t PeriphClk, uint32_t PrescalerValue, uint32_t BaudRate) | |||
__STATIC_INLINE void LL_LPUART_SetBaudRate(USART_TypeDef *LPUARTx, uint32_t PeriphClk, uint32_t PrescalerValue, | |||
uint32_t BaudRate) | |||
{ | |||
LPUARTx->BRR = __LL_LPUART_DIV(PeriphClk, (uint16_t)PrescalerValue, BaudRate); | |||
LPUARTx->BRR = __LL_LPUART_DIV(PeriphClk, PrescalerValue, BaudRate); | |||
} | |||
/** | |||
@@ -2485,12 +2487,12 @@ __STATIC_INLINE uint32_t LL_LPUART_DMA_GetRegAddr(USART_TypeDef *LPUARTx, uint32 | |||
if (Direction == LL_LPUART_DMA_REG_DATA_TRANSMIT) | |||
{ | |||
/* return address of TDR register */ | |||
data_reg_addr = (uint32_t) & (LPUARTx->TDR); | |||
data_reg_addr = (uint32_t) &(LPUARTx->TDR); | |||
} | |||
else | |||
{ | |||
/* return address of RDR register */ | |||
data_reg_addr = (uint32_t) & (LPUARTx->RDR); | |||
data_reg_addr = (uint32_t) &(LPUARTx->RDR); | |||
} | |||
return data_reg_addr; | |||
@@ -2566,7 +2568,7 @@ __STATIC_INLINE void LL_LPUART_TransmitData9(USART_TypeDef *LPUARTx, uint16_t Va | |||
*/ | |||
__STATIC_INLINE void LL_LPUART_RequestBreakSending(USART_TypeDef *LPUARTx) | |||
{ | |||
SET_BIT(LPUARTx->RQR, USART_RQR_SBKRQ); | |||
SET_BIT(LPUARTx->RQR, (uint16_t)USART_RQR_SBKRQ); | |||
} | |||
/** | |||
@@ -2577,7 +2579,7 @@ __STATIC_INLINE void LL_LPUART_RequestBreakSending(USART_TypeDef *LPUARTx) | |||
*/ | |||
__STATIC_INLINE void LL_LPUART_RequestEnterMuteMode(USART_TypeDef *LPUARTx) | |||
{ | |||
SET_BIT(LPUARTx->RQR, USART_RQR_MMRQ); | |||
SET_BIT(LPUARTx->RQR, (uint16_t)USART_RQR_MMRQ); | |||
} | |||
/** | |||
@@ -2590,7 +2592,7 @@ __STATIC_INLINE void LL_LPUART_RequestEnterMuteMode(USART_TypeDef *LPUARTx) | |||
*/ | |||
__STATIC_INLINE void LL_LPUART_RequestRxDataFlush(USART_TypeDef *LPUARTx) | |||
{ | |||
SET_BIT(LPUARTx->RQR, USART_RQR_RXFRQ); | |||
SET_BIT(LPUARTx->RQR, (uint16_t)USART_RQR_RXFRQ); | |||
} | |||
/** | |||
@@ -115,6 +115,7 @@ typedef struct | |||
#define LL_PKA_MODE_MODULAR_ADD ((uint32_t)0x0000000EU) /*!< Modular addition */ | |||
#define LL_PKA_MODE_MODULAR_SUB ((uint32_t)0x0000000FU) /*!< Modular subtraction */ | |||
#define LL_PKA_MODE_MONTGOMERY_MUL ((uint32_t)0x00000010U) /*!< Montgomery multiplication */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -328,6 +329,7 @@ __STATIC_INLINE void LL_PKA_EnableIT_RAMERR(PKA_TypeDef *PKAx) | |||
SET_BIT(PKAx->CR, PKA_CR_RAMERRIE); | |||
} | |||
/** | |||
* @brief Enable end of operation interrupt. | |||
* @rmtoll CR PROCENDIE LL_PKA_EnableIT_PROCEND | |||
@@ -394,6 +396,7 @@ __STATIC_INLINE uint32_t LL_PKA_IsEnabledIT_RAMERR(PKA_TypeDef *PKAx) | |||
return ((READ_BIT(PKAx->CR, PKA_CR_RAMERRIE) == (PKA_CR_RAMERRIE)) ? 1UL : 0UL); | |||
} | |||
/** | |||
* @brief Check if end of operation interrupt is enabled. | |||
* @rmtoll CR PROCENDIE LL_PKA_IsEnabledIT_PROCEND | |||
@@ -435,6 +438,7 @@ __STATIC_INLINE uint32_t LL_PKA_IsActiveFlag_RAMERR(PKA_TypeDef *PKAx) | |||
return ((READ_BIT(PKAx->SR, PKA_SR_RAMERRF) == (PKA_SR_RAMERRF)) ? 1UL : 0UL); | |||
} | |||
/** | |||
* @brief Get PKA end of operation flag. | |||
* @rmtoll SR PROCENDF LL_PKA_IsActiveFlag_PROCEND | |||
@@ -479,6 +483,7 @@ __STATIC_INLINE void LL_PKA_ClearFlag_RAMERR(PKA_TypeDef *PKAx) | |||
SET_BIT(PKAx->CLRFR, PKA_CLRFR_RAMERRFC); | |||
} | |||
/** | |||
* @brief Clear PKA end of operation flag. | |||
* @rmtoll CLRFR PROCENDFC LL_PKA_ClearFlag_PROCEND | |||
@@ -45,6 +45,8 @@ extern "C" { | |||
/** @defgroup PWR_LL_Private_Constants PWR Private Constants | |||
* @{ | |||
*/ | |||
#if defined(PWR_CR5_SMPSEN) | |||
/** @defgroup PWR_SMPS_Calibration PWR SMPS calibration | |||
* @{ | |||
*/ | |||
@@ -57,6 +59,7 @@ extern "C" { | |||
/** | |||
* @} | |||
*/ | |||
#endif | |||
/** | |||
* @} | |||
@@ -75,10 +78,16 @@ extern "C" { | |||
* @{ | |||
*/ | |||
#define LL_PWR_SCR_CWUF PWR_SCR_CWUF | |||
#if defined(PWR_CR3_EWUP2) | |||
#define LL_PWR_SCR_CWUF5 PWR_SCR_CWUF5 | |||
#endif | |||
#define LL_PWR_SCR_CWUF4 PWR_SCR_CWUF4 | |||
#if defined(PWR_CR3_EWUP3) | |||
#define LL_PWR_SCR_CWUF3 PWR_SCR_CWUF3 | |||
#endif | |||
#if defined(PWR_CR3_EWUP2) | |||
#define LL_PWR_SCR_CWUF2 PWR_SCR_CWUF2 | |||
#endif | |||
#define LL_PWR_SCR_CWUF1 PWR_SCR_CWUF1 | |||
#define LL_PWR_SCR_CC2HF PWR_SCR_CC2HF | |||
#define LL_PWR_SCR_C802AF PWR_SCR_C802AF | |||
@@ -86,8 +95,10 @@ extern "C" { | |||
#define LL_PWR_SCR_CCRPEF PWR_SCR_CCRPEF | |||
#define LL_PWR_SCR_C802WUF PWR_SCR_C802WUF | |||
#define LL_PWR_SCR_CBLEWUF PWR_SCR_CBLEWUF | |||
#if defined(PWR_CR5_SMPSEN) | |||
#define LL_PWR_SCR_CBORHF PWR_SCR_CBORHF | |||
#define LL_PWR_SCR_CSMPSFBF PWR_SCR_CSMPSFBF | |||
#endif | |||
#define LL_PWR_EXTSCR_CCRPF PWR_EXTSCR_CCRPF | |||
#define LL_PWR_EXTSCR_C2CSSF PWR_EXTSCR_C2CSSF | |||
#define LL_PWR_EXTSCR_C1CSSF PWR_EXTSCR_C1CSSF | |||
@@ -100,25 +111,37 @@ extern "C" { | |||
* @{ | |||
*/ | |||
#define LL_PWR_SR1_WUFI PWR_SR1_WUFI | |||
#if defined(PWR_CR3_EWUP5) | |||
#define LL_PWR_SR1_WUF5 PWR_SR1_WUF5 | |||
#endif | |||
#define LL_PWR_SR1_WUF4 PWR_SR1_WUF4 | |||
#if defined(PWR_CR3_EWUP3) | |||
#define LL_PWR_SR1_WUF3 PWR_SR1_WUF3 | |||
#endif | |||
#if defined(PWR_CR3_EWUP2) | |||
#define LL_PWR_SR1_WUF2 PWR_SR1_WUF2 | |||
#endif | |||
#define LL_PWR_SR1_WUF1 PWR_SR1_WUF1 | |||
#define LL_PWR_SR2_PVMO3 PWR_SR2_PVMO3 | |||
#if defined(PWR_CR2_PVME1) | |||
#define LL_PWR_SR2_PVMO1 PWR_SR2_PVMO1 | |||
#endif | |||
#define LL_PWR_SR2_PVDO PWR_SR2_PVDO | |||
#if defined(PWR_CR1_VOS) | |||
#define LL_PWR_SR2_VOSF PWR_SR2_VOSF | |||
#endif | |||
#define LL_PWR_SR2_REGLPF PWR_SR2_REGLPF | |||
#define LL_PWR_SR2_REGLPS PWR_SR2_REGLPS | |||
/* BOR flags */ | |||
#define LL_PWR_FLAG_BORH PWR_SR1_BORHF /* BORH interrupt flag */ | |||
#if defined(PWR_CR5_SMPSEN) | |||
/* SMPS flags */ | |||
#define LL_PWR_FLAG_SMPS PWR_SR2_SMPSF /* SMPS step down converter ready flag */ | |||
#define LL_PWR_FLAG_SMPSB PWR_SR2_SMPSBF /* SMPS step down converter in bypass mode flag */ | |||
#define LL_PWR_FLAG_SMPSFB PWR_SR1_SMPSFB /* SMPS step down converter forced in bypass mode interrupt flag */ | |||
#endif | |||
/* Radio (BLE or 802.15.4) flags */ | |||
#define LL_PWR_FLAG_BLEWU PWR_SR1_BLEWUF /* BLE wakeup interrupt flag */ | |||
@@ -140,6 +163,7 @@ extern "C" { | |||
* @} | |||
*/ | |||
#if defined(PWR_CR1_VOS) | |||
/** @defgroup PWR_LL_EC_REGU_VOLTAGE REGU VOLTAGE | |||
* @{ | |||
*/ | |||
@@ -148,6 +172,7 @@ extern "C" { | |||
/** | |||
* @} | |||
*/ | |||
#endif | |||
/** @defgroup PWR_LL_EC_MODE_PWR MODE PWR | |||
* @{ | |||
@@ -179,10 +204,12 @@ extern "C" { | |||
* @} | |||
*/ | |||
/** @defgroup PWR_LL_EC_PVM_VDDUSB_1 Peripheral voltage monitoring | |||
/** @defgroup PWR_LL_EC_PVM Peripheral voltage monitoring | |||
* @{ | |||
*/ | |||
#if defined(PWR_CR2_PVME1) | |||
#define LL_PWR_PVM_VDDUSB_1_2V (PWR_CR2_PVME1) /* Monitoring VDDUSB vs. 1.2V */ | |||
#endif | |||
#define LL_PWR_PVM_VDDA_1_62V (PWR_CR2_PVME3) /* Monitoring VDDA vs. 1.62V */ | |||
/** | |||
* @} | |||
@@ -207,10 +234,16 @@ extern "C" { | |||
* @{ | |||
*/ | |||
#define LL_PWR_WAKEUP_PIN1 (PWR_CR3_EWUP1) | |||
#if defined(PWR_CR3_EWUP2) | |||
#define LL_PWR_WAKEUP_PIN2 (PWR_CR3_EWUP2) | |||
#endif | |||
#if defined(PWR_CR3_EWUP3) | |||
#define LL_PWR_WAKEUP_PIN3 (PWR_CR3_EWUP3) | |||
#endif | |||
#define LL_PWR_WAKEUP_PIN4 (PWR_CR3_EWUP4) | |||
#if defined(PWR_CR3_EWUP5) | |||
#define LL_PWR_WAKEUP_PIN5 (PWR_CR3_EWUP5) | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
@@ -240,6 +273,7 @@ extern "C" { | |||
/** @defgroup PWR_LL_EC_GPIO_BIT GPIO BIT | |||
* @{ | |||
*/ | |||
#if defined(PWR_PUCRC_PC0) | |||
/* Note: LL_PWR_GPIO_BIT_x defined from port C because all pins are available */ | |||
/* for PWR pull-up and pull-down. */ | |||
#define LL_PWR_GPIO_BIT_0 (PWR_PUCRC_PC0) | |||
@@ -258,10 +292,29 @@ extern "C" { | |||
#define LL_PWR_GPIO_BIT_13 (PWR_PUCRC_PC13) | |||
#define LL_PWR_GPIO_BIT_14 (PWR_PUCRC_PC14) | |||
#define LL_PWR_GPIO_BIT_15 (PWR_PUCRC_PC15) | |||
#else | |||
#define LL_PWR_GPIO_BIT_0 (PWR_PUCRA_PA0) | |||
#define LL_PWR_GPIO_BIT_1 (PWR_PUCRA_PA1) | |||
#define LL_PWR_GPIO_BIT_2 (PWR_PUCRA_PA2) | |||
#define LL_PWR_GPIO_BIT_3 (PWR_PUCRA_PA3) | |||
#define LL_PWR_GPIO_BIT_4 (PWR_PUCRA_PA4) | |||
#define LL_PWR_GPIO_BIT_5 (PWR_PUCRA_PA5) | |||
#define LL_PWR_GPIO_BIT_6 (PWR_PUCRA_PA6) | |||
#define LL_PWR_GPIO_BIT_7 (PWR_PUCRA_PA7) | |||
#define LL_PWR_GPIO_BIT_8 (PWR_PUCRA_PA8) | |||
#define LL_PWR_GPIO_BIT_9 (PWR_PUCRA_PA9) | |||
#define LL_PWR_GPIO_BIT_10 (PWR_PUCRA_PA10) | |||
#define LL_PWR_GPIO_BIT_11 (PWR_PUCRA_PA11) | |||
#define LL_PWR_GPIO_BIT_12 (PWR_PUCRA_PA12) | |||
#define LL_PWR_GPIO_BIT_13 (PWR_PUCRA_PA13) | |||
#define LL_PWR_GPIO_BIT_14 (PWR_PUCRC_PC14) | |||
#define LL_PWR_GPIO_BIT_15 (PWR_PUCRC_PC15) | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
#if defined(PWR_CR5_SMPSEN) | |||
/** @defgroup PWR_LL_EC_BOR_CONFIGURATION BOR configuration | |||
* @{ | |||
*/ | |||
@@ -324,6 +377,7 @@ extern "C" { | |||
/** | |||
* @} | |||
*/ | |||
#endif | |||
/** | |||
* @} | |||
@@ -400,6 +454,7 @@ __STATIC_INLINE uint32_t LL_PWR_IsEnabledLowPowerRunMode(void) | |||
return ((READ_BIT(PWR->CR1, PWR_CR1_LPR) == (PWR_CR1_LPR)) ? 1UL : 0UL); | |||
} | |||
#if defined(PWR_CR1_VOS) | |||
/** | |||
* @brief Set the main internal regulator output voltage | |||
* @note A delay is required for the internal regulator to be ready | |||
@@ -428,6 +483,7 @@ __STATIC_INLINE uint32_t LL_PWR_GetRegulVoltageScaling(void) | |||
{ | |||
return (uint32_t)(READ_BIT(PWR->CR1, PWR_CR1_VOS)); | |||
} | |||
#endif | |||
/** | |||
* @brief Enable access to the backup domain | |||
@@ -544,6 +600,7 @@ __STATIC_INLINE uint32_t LL_PWR_GetFlashPowerModeSleep(void) | |||
return (uint32_t)(READ_BIT(PWR->CR1, PWR_CR1_FPDS)); | |||
} | |||
#if defined(PWR_CR2_PVME1) | |||
/** | |||
* @brief Enable VDDUSB supply | |||
* @rmtoll CR2 USV LL_PWR_EnableVddUSB | |||
@@ -573,15 +630,17 @@ __STATIC_INLINE uint32_t LL_PWR_IsEnabledVddUSB(void) | |||
{ | |||
return ((READ_BIT(PWR->CR2, PWR_CR2_USV) == (PWR_CR2_USV)) ? 1UL : 0UL); | |||
} | |||
#endif | |||
/** | |||
* @brief Enable the Power Voltage Monitoring on a peripheral | |||
* @rmtoll CR2 PVME1 LL_PWR_EnablePVM\n | |||
* CR2 PVME3 LL_PWR_EnablePVM | |||
* @param PeriphVoltage This parameter can be one of the following values: | |||
* @arg @ref LL_PWR_PVM_VDDUSB_1_2V | |||
* @arg @ref LL_PWR_PVM_VDDUSB_1_2V (*) | |||
* @arg @ref LL_PWR_PVM_VDDA_1_62V | |||
* | |||
* (*) Not available on devices STM32WB50xx | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_PWR_EnablePVM(uint32_t PeriphVoltage) | |||
@@ -594,8 +653,10 @@ __STATIC_INLINE void LL_PWR_EnablePVM(uint32_t PeriphVoltage) | |||
* @rmtoll CR2 PVME1 LL_PWR_DisablePVM\n | |||
* CR2 PVME3 LL_PWR_DisablePVM | |||
* @param PeriphVoltage This parameter can be one of the following values: | |||
* @arg @ref LL_PWR_PVM_VDDUSB_1_2V | |||
* @arg @ref LL_PWR_PVM_VDDUSB_1_2V (*) | |||
* @arg @ref LL_PWR_PVM_VDDA_1_62V | |||
* | |||
* (*) Not available on devices STM32WB50xx | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_PWR_DisablePVM(uint32_t PeriphVoltage) | |||
@@ -608,8 +669,10 @@ __STATIC_INLINE void LL_PWR_DisablePVM(uint32_t PeriphVoltage) | |||
* @rmtoll CR2 PVME1 LL_PWR_IsEnabledPVM\n | |||
* CR2 PVME3 LL_PWR_IsEnabledPVM | |||
* @param PeriphVoltage This parameter can be one of the following values: | |||
* @arg @ref LL_PWR_PVM_VDDUSB_1_2V | |||
* @arg @ref LL_PWR_PVM_VDDUSB_1_2V (*) | |||
* @arg @ref LL_PWR_PVM_VDDA_1_62V | |||
* | |||
* (*) Not available on devices STM32WB50xx | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_PWR_IsEnabledPVM(uint32_t PeriphVoltage) | |||
@@ -783,10 +846,12 @@ __STATIC_INLINE uint32_t LL_PWR_IsEnabledSRAM2Retention(void) | |||
* CR3 EWUP5 LL_PWR_EnableWakeUpPin\n | |||
* @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 | |||
* @arg @ref LL_PWR_WAKEUP_PIN2 (*) | |||
* @arg @ref LL_PWR_WAKEUP_PIN3 (*) | |||
* @arg @ref LL_PWR_WAKEUP_PIN4 | |||
* @arg @ref LL_PWR_WAKEUP_PIN5 | |||
* @arg @ref LL_PWR_WAKEUP_PIN5 (*) | |||
* | |||
* (*) Not available on devices STM32WB50xx | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_PWR_EnableWakeUpPin(uint32_t WakeUpPin) | |||
@@ -803,10 +868,12 @@ __STATIC_INLINE void LL_PWR_EnableWakeUpPin(uint32_t WakeUpPin) | |||
* CR3 EWUP5 LL_PWR_DisableWakeUpPin\n | |||
* @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 | |||
* @arg @ref LL_PWR_WAKEUP_PIN2 (*) | |||
* @arg @ref LL_PWR_WAKEUP_PIN3 (*) | |||
* @arg @ref LL_PWR_WAKEUP_PIN4 | |||
* @arg @ref LL_PWR_WAKEUP_PIN5 | |||
* @arg @ref LL_PWR_WAKEUP_PIN5 (*) | |||
* | |||
* (*) Not available on devices STM32WB50xx | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_PWR_DisableWakeUpPin(uint32_t WakeUpPin) | |||
@@ -823,10 +890,12 @@ __STATIC_INLINE void LL_PWR_DisableWakeUpPin(uint32_t WakeUpPin) | |||
* CR3 EWUP5 LL_PWR_IsEnabledWakeUpPin\n | |||
* @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 | |||
* @arg @ref LL_PWR_WAKEUP_PIN2 (*) | |||
* @arg @ref LL_PWR_WAKEUP_PIN3 (*) | |||
* @arg @ref LL_PWR_WAKEUP_PIN4 | |||
* @arg @ref LL_PWR_WAKEUP_PIN5 | |||
* @arg @ref LL_PWR_WAKEUP_PIN5 (*) | |||
* | |||
* (*) Not available on devices STM32WB50xx | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_PWR_IsEnabledWakeUpPin(uint32_t WakeUpPin) | |||
@@ -898,10 +967,12 @@ __STATIC_INLINE uint32_t LL_PWR_IsEnabledBatteryCharging(void) | |||
* CR4 WP5 LL_PWR_SetWakeUpPinPolarityLow | |||
* @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 | |||
* @arg @ref LL_PWR_WAKEUP_PIN2 (*) | |||
* @arg @ref LL_PWR_WAKEUP_PIN3 (*) | |||
* @arg @ref LL_PWR_WAKEUP_PIN4 | |||
* @arg @ref LL_PWR_WAKEUP_PIN5 | |||
* @arg @ref LL_PWR_WAKEUP_PIN5 (*) | |||
* | |||
* (*) Not available on devices STM32WB50xx | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_PWR_SetWakeUpPinPolarityLow(uint32_t WakeUpPin) | |||
@@ -918,10 +989,12 @@ __STATIC_INLINE void LL_PWR_SetWakeUpPinPolarityLow(uint32_t WakeUpPin) | |||
* CR4 WP5 LL_PWR_SetWakeUpPinPolarityHigh | |||
* @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 | |||
* @arg @ref LL_PWR_WAKEUP_PIN2 (*) | |||
* @arg @ref LL_PWR_WAKEUP_PIN3 (*) | |||
* @arg @ref LL_PWR_WAKEUP_PIN4 | |||
* @arg @ref LL_PWR_WAKEUP_PIN5 | |||
* @arg @ref LL_PWR_WAKEUP_PIN5 (*) | |||
* | |||
* (*) Not available on devices STM32WB50xx | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_PWR_SetWakeUpPinPolarityHigh(uint32_t WakeUpPin) | |||
@@ -938,10 +1011,12 @@ __STATIC_INLINE void LL_PWR_SetWakeUpPinPolarityHigh(uint32_t WakeUpPin) | |||
* CR4 WP5 LL_PWR_IsWakeUpPinPolarityLow | |||
* @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 | |||
* @arg @ref LL_PWR_WAKEUP_PIN2 (*) | |||
* @arg @ref LL_PWR_WAKEUP_PIN3 (*) | |||
* @arg @ref LL_PWR_WAKEUP_PIN4 | |||
* @arg @ref LL_PWR_WAKEUP_PIN5 | |||
* @arg @ref LL_PWR_WAKEUP_PIN5 (*) | |||
* | |||
* (*) Not available on devices STM32WB50xx | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_PWR_IsWakeUpPinPolarityLow(uint32_t WakeUpPin) | |||
@@ -987,7 +1062,7 @@ __STATIC_INLINE uint32_t LL_PWR_IsWakeUpPinPolarityLow(uint32_t WakeUpPin) | |||
*/ | |||
__STATIC_INLINE void LL_PWR_EnableGPIOPullUp(uint32_t GPIO, uint32_t GPIONumber) | |||
{ | |||
SET_BIT(*((uint32_t *)GPIO), GPIONumber); | |||
SET_BIT(*((__IO uint32_t *)GPIO), GPIONumber); | |||
} | |||
/** | |||
@@ -1028,7 +1103,7 @@ __STATIC_INLINE void LL_PWR_EnableGPIOPullUp(uint32_t GPIO, uint32_t GPIONumber) | |||
*/ | |||
__STATIC_INLINE void LL_PWR_DisableGPIOPullUp(uint32_t GPIO, uint32_t GPIONumber) | |||
{ | |||
CLEAR_BIT(*((uint32_t *)GPIO), GPIONumber); | |||
CLEAR_BIT(*((__IO uint32_t *)GPIO), GPIONumber); | |||
} | |||
/** | |||
@@ -1067,7 +1142,7 @@ __STATIC_INLINE void LL_PWR_DisableGPIOPullUp(uint32_t GPIO, uint32_t GPIONumber | |||
*/ | |||
__STATIC_INLINE uint32_t LL_PWR_IsEnabledGPIOPullUp(uint32_t GPIO, uint32_t GPIONumber) | |||
{ | |||
return ((READ_BIT(*((uint32_t *)(GPIO)), GPIONumber) == (GPIONumber)) ? 1UL : 0UL); | |||
return ((READ_BIT(*((__IO uint32_t *)GPIO), GPIONumber) == (GPIONumber)) ? 1UL : 0UL); | |||
} | |||
/** | |||
@@ -1108,8 +1183,7 @@ __STATIC_INLINE uint32_t LL_PWR_IsEnabledGPIOPullUp(uint32_t GPIO, uint32_t GPIO | |||
*/ | |||
__STATIC_INLINE void LL_PWR_EnableGPIOPullDown(uint32_t GPIO, uint32_t GPIONumber) | |||
{ | |||
register __IO uint32_t temp = (uint32_t)(GPIO) + 4UL; | |||
SET_BIT(*((uint32_t *)(temp)), GPIONumber); | |||
SET_BIT(*((__IO uint32_t *)(GPIO + 4UL)), GPIONumber); | |||
} | |||
/** | |||
@@ -1150,8 +1224,7 @@ __STATIC_INLINE void LL_PWR_EnableGPIOPullDown(uint32_t GPIO, uint32_t GPIONumbe | |||
*/ | |||
__STATIC_INLINE void LL_PWR_DisableGPIOPullDown(uint32_t GPIO, uint32_t GPIONumber) | |||
{ | |||
register __IO uint32_t temp = (uint32_t)(GPIO) + 4UL; | |||
CLEAR_BIT(*((uint32_t *)(temp)), GPIONumber); | |||
CLEAR_BIT(*((__IO uint32_t *)(GPIO + 4UL)), GPIONumber); | |||
} | |||
/** | |||
@@ -1190,10 +1263,10 @@ __STATIC_INLINE void LL_PWR_DisableGPIOPullDown(uint32_t GPIO, uint32_t GPIONumb | |||
*/ | |||
__STATIC_INLINE uint32_t LL_PWR_IsEnabledGPIOPullDown(uint32_t GPIO, uint32_t GPIONumber) | |||
{ | |||
register __IO uint32_t temp = (uint32_t)(GPIO) + 4UL; | |||
return ((READ_BIT(*((uint32_t *)(temp)), GPIONumber) == (GPIONumber)) ? 1UL : 0UL); | |||
return ((READ_BIT(*((__IO uint32_t *)(GPIO + 4UL)), GPIONumber) == (GPIONumber)) ? 1UL : 0UL); | |||
} | |||
#if defined(PWR_CR5_SMPSEN) | |||
/** | |||
* @brief Set BOR configuration | |||
* @rmtoll CR5 BORHC LL_PWR_SetBORConfig | |||
@@ -1217,11 +1290,13 @@ __STATIC_INLINE uint32_t LL_PWR_GetBORConfig(void) | |||
{ | |||
return (uint32_t)(READ_BIT(PWR->CR5, PWR_CR5_BORHC)); | |||
} | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
#if defined(PWR_CR5_SMPSEN) | |||
/** @defgroup PWR_LL_EF_Configuration_SMPS Configuration of SMPS | |||
* @{ | |||
*/ | |||
@@ -1434,12 +1509,12 @@ __STATIC_INLINE void LL_PWR_SMPS_SetOutputVoltageLevel(uint32_t OutputVoltageLev | |||
{ | |||
OutputVoltageLevelTrimmed = 0; | |||
} | |||
else if(OutputVoltageLevelTrimmed > (int32_t)PWR_CR5_SMPSVOS) | |||
{ | |||
OutputVoltageLevelTrimmed = (int32_t)PWR_CR5_SMPSVOS; | |||
} | |||
else | |||
{ | |||
if(OutputVoltageLevelTrimmed > (int32_t)PWR_CR5_SMPSVOS) | |||
{ | |||
OutputVoltageLevelTrimmed = (int32_t)PWR_CR5_SMPSVOS; | |||
} | |||
} | |||
/* Update register */ | |||
@@ -1495,12 +1570,12 @@ __STATIC_INLINE uint32_t LL_PWR_SMPS_GetOutputVoltageLevel(void) | |||
{ | |||
OutputVoltageLevelTrimmed = (int32_t)LL_PWR_SMPS_OUTPUT_VOLTAGE_1V20; | |||
} | |||
else if(OutputVoltageLevelTrimmed > (int32_t)PWR_CR5_SMPSVOS) | |||
{ | |||
OutputVoltageLevelTrimmed = (int32_t)LL_PWR_SMPS_OUTPUT_VOLTAGE_1V90; | |||
} | |||
else | |||
{ | |||
if(OutputVoltageLevelTrimmed > (int32_t)PWR_CR5_SMPSVOS) | |||
{ | |||
OutputVoltageLevelTrimmed = (int32_t)LL_PWR_SMPS_OUTPUT_VOLTAGE_1V90; | |||
} | |||
} | |||
return (uint32_t)OutputVoltageLevelTrimmed; | |||
@@ -1510,6 +1585,7 @@ __STATIC_INLINE uint32_t LL_PWR_SMPS_GetOutputVoltageLevel(void) | |||
/** | |||
* @} | |||
*/ | |||
#endif | |||
/** @defgroup PWR_LL_EF_Configuration_Multicore Configuration of multicore, intended to be executed by CPU1 | |||
* @{ | |||
@@ -1680,10 +1756,12 @@ __STATIC_INLINE uint32_t LL_C2_PWR_IsEnabledInternWU(void) | |||
* C2CR3 EWUP5 LL_C2_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 | |||
* @arg @ref LL_PWR_WAKEUP_PIN2 (*) | |||
* @arg @ref LL_PWR_WAKEUP_PIN3 (*) | |||
* @arg @ref LL_PWR_WAKEUP_PIN4 | |||
* @arg @ref LL_PWR_WAKEUP_PIN5 | |||
* @arg @ref LL_PWR_WAKEUP_PIN5 (*) | |||
* | |||
* (*) Not available on devices STM32WB50xx | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_C2_PWR_EnableWakeUpPin(uint32_t WakeUpPin) | |||
@@ -1700,10 +1778,12 @@ __STATIC_INLINE void LL_C2_PWR_EnableWakeUpPin(uint32_t WakeUpPin) | |||
* C2CR3 EWUP5 LL_C2_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 | |||
* @arg @ref LL_PWR_WAKEUP_PIN2 (*) | |||
* @arg @ref LL_PWR_WAKEUP_PIN3 (*) | |||
* @arg @ref LL_PWR_WAKEUP_PIN4 | |||
* @arg @ref LL_PWR_WAKEUP_PIN5 | |||
* @arg @ref LL_PWR_WAKEUP_PIN5 (*) | |||
* | |||
* (*) Not available on devices STM32WB50xx | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_C2_PWR_DisableWakeUpPin(uint32_t WakeUpPin) | |||
@@ -1720,10 +1800,12 @@ __STATIC_INLINE void LL_C2_PWR_DisableWakeUpPin(uint32_t WakeUpPin) | |||
* C2CR3 EWUP5 LL_C2_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 | |||
* @arg @ref LL_PWR_WAKEUP_PIN2 (*) | |||
* @arg @ref LL_PWR_WAKEUP_PIN3 (*) | |||
* @arg @ref LL_PWR_WAKEUP_PIN4 | |||
* @arg @ref LL_PWR_WAKEUP_PIN5 | |||
* @arg @ref LL_PWR_WAKEUP_PIN5 (*) | |||
* | |||
* (*) Not available on devices STM32WB50xx | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE uint32_t LL_C2_PWR_IsEnabledWakeUpPin(uint32_t WakeUpPin) | |||
@@ -1833,6 +1915,7 @@ __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_InternWU(void) | |||
return ((READ_BIT(PWR->SR1, PWR_SR1_WUFI) == (PWR_SR1_WUFI)) ? 1UL : 0UL); | |||
} | |||
#if defined(PWR_CR3_EWUP5) | |||
/** | |||
* @brief Get Wake-up Flag 5 | |||
* @rmtoll SR1 WUF5 LL_PWR_IsActiveFlag_WU5 | |||
@@ -1842,6 +1925,7 @@ __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU5(void) | |||
{ | |||
return ((READ_BIT(PWR->SR1, PWR_SR1_WUF5) == (PWR_SR1_WUF5)) ? 1UL : 0UL); | |||
} | |||
#endif | |||
/** | |||
* @brief Get Wake-up Flag 4 | |||
@@ -1853,6 +1937,7 @@ __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU4(void) | |||
return ((READ_BIT(PWR->SR1, PWR_SR1_WUF4) == (PWR_SR1_WUF4)) ? 1UL : 0UL); | |||
} | |||
#if defined(PWR_CR3_EWUP3) | |||
/** | |||
* @brief Get Wake-up Flag 3 | |||
* @rmtoll SR1 WUF3 LL_PWR_IsActiveFlag_WU3 | |||
@@ -1862,7 +1947,9 @@ __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU3(void) | |||
{ | |||
return ((READ_BIT(PWR->SR1, PWR_SR1_WUF3) == (PWR_SR1_WUF3)) ? 1UL : 0UL); | |||
} | |||
#endif | |||
#if defined(PWR_CR3_EWUP2) | |||
/** | |||
* @brief Get Wake-up Flag 2 | |||
* @rmtoll SR1 WUF2 LL_PWR_IsActiveFlag_WU2 | |||
@@ -1872,6 +1959,7 @@ __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU2(void) | |||
{ | |||
return ((READ_BIT(PWR->SR1, PWR_SR1_WUF2) == (PWR_SR1_WUF2)) ? 1UL : 0UL); | |||
} | |||
#endif | |||
/** | |||
* @brief Get Wake-up Flag 1 | |||
@@ -1893,6 +1981,7 @@ __STATIC_INLINE void LL_PWR_ClearFlag_WU(void) | |||
WRITE_REG(PWR->SCR, PWR_SCR_CWUF); | |||
} | |||
#if defined(PWR_CR3_EWUP5) | |||
/** | |||
* @brief Clear Wake-up Flag 5 | |||
* @rmtoll SCR CWUF5 LL_PWR_ClearFlag_WU5 | |||
@@ -1902,6 +1991,7 @@ __STATIC_INLINE void LL_PWR_ClearFlag_WU5(void) | |||
{ | |||
WRITE_REG(PWR->SCR, PWR_SCR_CWUF5); | |||
} | |||
#endif | |||
/** | |||
* @brief Clear Wake-up Flag 4 | |||
@@ -1913,6 +2003,7 @@ __STATIC_INLINE void LL_PWR_ClearFlag_WU4(void) | |||
WRITE_REG(PWR->SCR, PWR_SCR_CWUF4); | |||
} | |||
#if defined(PWR_CR3_EWUP3) | |||
/** | |||
* @brief Clear Wake-up Flag 3 | |||
* @rmtoll SCR CWUF3 LL_PWR_ClearFlag_WU3 | |||
@@ -1922,7 +2013,9 @@ __STATIC_INLINE void LL_PWR_ClearFlag_WU3(void) | |||
{ | |||
WRITE_REG(PWR->SCR, PWR_SCR_CWUF3); | |||
} | |||
#endif | |||
#if defined(PWR_CR3_EWUP2) | |||
/** | |||
* @brief Clear Wake-up Flag 2 | |||
* @rmtoll SCR CWUF2 LL_PWR_ClearFlag_WU2 | |||
@@ -1932,6 +2025,7 @@ __STATIC_INLINE void LL_PWR_ClearFlag_WU2(void) | |||
{ | |||
WRITE_REG(PWR->SCR, PWR_SCR_CWUF2); | |||
} | |||
#endif | |||
/** | |||
* @brief Clear Wake-up Flag 1 | |||
@@ -1954,7 +2048,7 @@ __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_PVMO3(void) | |||
return ((READ_BIT(PWR->SR2, PWR_SR2_PVMO3) == (PWR_SR2_PVMO3)) ? 1UL : 0UL); | |||
} | |||
#if defined(PWR_CR2_PVME1) | |||
/** | |||
* @brief Indicate whether VDDUSB voltage is below or above PVM1 threshold | |||
* @rmtoll SR2 PVMO1 LL_PWR_IsActiveFlag_PVMO1 | |||
@@ -1964,6 +2058,7 @@ __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_PVMO1(void) | |||
{ | |||
return ((READ_BIT(PWR->SR2, PWR_SR2_PVMO1) == (PWR_SR2_PVMO1)) ? 1UL : 0UL); | |||
} | |||
#endif | |||
/** | |||
* @brief Indicate whether VDD voltage is below or above the selected PVD threshold | |||
@@ -1975,6 +2070,7 @@ __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_PVDO(void) | |||
return ((READ_BIT(PWR->SR2, PWR_SR2_PVDO) == (PWR_SR2_PVDO)) ? 1UL : 0UL); | |||
} | |||
#if defined(PWR_CR1_VOS) | |||
/** | |||
* @brief Indicate whether the regulator is ready in the selected voltage range or if its output voltage is still changing to the required voltage level | |||
* @rmtoll SR2 VOSF LL_PWR_IsActiveFlag_VOS | |||
@@ -1984,6 +2080,7 @@ __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_VOS(void) | |||
{ | |||
return ((READ_BIT(PWR->SR2, PWR_SR2_VOSF) == (PWR_SR2_VOSF)) ? 1UL : 0UL); | |||
} | |||
#endif | |||
/** | |||
* @brief Indicate whether the regulator is ready in main mode or is in low-power mode | |||
@@ -2030,6 +2127,7 @@ __STATIC_INLINE void LL_PWR_ClearFlag_BORH(void) | |||
* @} | |||
*/ | |||
#if defined(PWR_CR5_SMPSEN) | |||
/** @defgroup PWR_LL_EF_FLAG_Management_SMPS FLAG management for SMPS | |||
* @{ | |||
*/ | |||
@@ -2065,6 +2163,7 @@ __STATIC_INLINE void LL_PWR_ClearFlag_SMPSFB(void) | |||
/** | |||
* @} | |||
*/ | |||
#endif | |||
/** @defgroup PWR_LL_EF_FLAG_Management_Radio FLAG management for radio (BLE or 802.15.4) | |||
* @{ | |||
@@ -2301,6 +2400,7 @@ __STATIC_INLINE void LL_PWR_ClearFlag_C2STOP_C2STB(void) | |||
* @} | |||
*/ | |||
#if defined(PWR_CR5_SMPSEN) | |||
/** @defgroup PWR_LL_EF_IT_Management_SMPS PWR IT management for SMPS | |||
* @{ | |||
*/ | |||
@@ -2345,6 +2445,7 @@ __STATIC_INLINE uint32_t LL_PWR_IsEnabledIT_BORH_SMPSFB(void) | |||
/** | |||
* @} | |||
*/ | |||
#endif | |||
/** @defgroup PWR_LL_EF_IT_Management_Radio PWR IT management for radio (BLE or 802.15.4) | |||
* @{ | |||
@@ -124,6 +124,12 @@ typedef struct | |||
#if !defined (HSI48_VALUE) | |||
#define HSI48_VALUE 48000000U /*!< Value of the HSI48 oscillator in Hz */ | |||
#endif /* HSI48_VALUE */ | |||
#if defined(SPI_I2S_SUPPORT) | |||
#if !defined (EXTERNAL_CLOCK_VALUE) | |||
#define EXTERNAL_CLOCK_VALUE 48000U /*!< Value of the I2S_CKIN external oscillator in Hz */ | |||
#endif /* EXTERNAL_CLOCK_VALUE */ | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
@@ -140,7 +146,9 @@ typedef struct | |||
#define LL_RCC_CICR_HSERDYC RCC_CICR_HSERDYC /*!< HSE Ready Interrupt Clear */ | |||
#define LL_RCC_CICR_PLLRDYC RCC_CICR_PLLRDYC /*!< PLL Ready Interrupt Clear */ | |||
#define LL_RCC_CICR_HSI48RDYC RCC_CICR_HSI48RDYC /*!< HSI48 Ready Interrupt Clear */ | |||
#if defined(SAI1) | |||
#define LL_RCC_CICR_PLLSAI1RDYC RCC_CICR_PLLSAI1RDYC /*!< PLLSAI1 Ready Interrupt Clear */ | |||
#endif | |||
#define LL_RCC_CICR_LSECSSC RCC_CICR_LSECSSC /*!< LSE Clock Security System Interrupt Clear */ | |||
#define LL_RCC_CICR_CSSC RCC_CICR_CSSC /*!< Clock Security System Interrupt Clear */ | |||
/** | |||
@@ -159,7 +167,9 @@ typedef struct | |||
#define LL_RCC_CIFR_HSERDYF RCC_CIFR_HSERDYF /*!< HSE Ready Interrupt flag */ | |||
#define LL_RCC_CIFR_PLLRDYF RCC_CIFR_PLLRDYF /*!< PLL Ready Interrupt flag */ | |||
#define LL_RCC_CIFR_HSI48RDYF RCC_CIFR_HSI48RDYF /*!< HSI48 Ready Interrupt flag */ | |||
#if defined(SAI1) | |||
#define LL_RCC_CIFR_PLLSAI1RDYF RCC_CIFR_PLLSAI1RDYF /*!< PLLSAI1 Ready Interrupt flag */ | |||
#endif | |||
#define LL_RCC_CIFR_LSECSSF RCC_CIFR_LSECSSF /*!< LSE Clock Security System Interrupt flag */ | |||
#define LL_RCC_CIFR_CSSF RCC_CIFR_CSSF /*!< Clock Security System Interrupt flag */ | |||
#define LL_RCC_CSR_LPWRRSTF RCC_CSR_LPWRRSTF /*!< Low-Power reset flag */ | |||
@@ -185,7 +195,9 @@ typedef struct | |||
#define LL_RCC_CIER_HSERDYIE RCC_CIER_HSERDYIE /*!< HSE Ready Interrupt Enable */ | |||
#define LL_RCC_CIER_PLLRDYIE RCC_CIER_PLLRDYIE /*!< PLL Ready Interrupt Enable */ | |||
#define LL_RCC_CIER_HSI48RDYIE RCC_CIER_HSI48RDYIE /*!< HSI48 Ready Interrupt Enable */ | |||
#if defined(SAI1) | |||
#define LL_RCC_CIER_PLLSAI1RDYIE RCC_CIER_PLLSAI1RDYIE /*!< PLLSAI1 Ready Interrupt Enable */ | |||
#endif | |||
#define LL_RCC_CIER_LSECSSIE RCC_CIER_LSECSSIE /*!< LSE CSS Interrupt Enable */ | |||
/** | |||
* @} | |||
@@ -286,7 +298,6 @@ typedef struct | |||
* @} | |||
*/ | |||
/** @defgroup RCC_LL_EC_SYSCLK_DIV AHB prescaler | |||
* @{ | |||
*/ | |||
@@ -371,13 +382,13 @@ typedef struct | |||
* @} | |||
*/ | |||
#if defined(RCC_SMPS_SUPPORT) | |||
/** @defgroup RCC_LL_EC_SMPS_CLKSOURCE SMPS clock switch | |||
* @{ | |||
*/ | |||
#define LL_RCC_SMPS_CLKSOURCE_HSI 0x00000000U /*!< HSI selection as SMPS clock */ | |||
#define LL_RCC_SMPS_CLKSOURCE_MSI RCC_SMPSCR_SMPSSEL_0 /*!< MSI selection as SMPS clock */ | |||
#define LL_RCC_SMPS_CLKSOURCE_HSE RCC_SMPSCR_SMPSSEL_1 /*!< HSE selection as SMPS clock */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -389,7 +400,6 @@ typedef struct | |||
#define LL_RCC_SMPS_CLKSOURCE_STATUS_MSI RCC_SMPSCR_SMPSSWS_0 /*!< MSI used as SMPS clock */ | |||
#define LL_RCC_SMPS_CLKSOURCE_STATUS_HSE RCC_SMPSCR_SMPSSWS_1 /*!< HSE used as SMPS clock */ | |||
#define LL_RCC_SMPS_CLKSOURCE_STATUS_NO_CLOCK (RCC_SMPSCR_SMPSSWS_0|RCC_SMPSCR_SMPSSWS_1) /*!< No Clock used as SMPS clock */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -401,13 +411,10 @@ typedef struct | |||
#define LL_RCC_SMPS_DIV_1 RCC_SMPSCR_SMPSDIV_0 /*!< SMPS clock division 1 */ | |||
#define LL_RCC_SMPS_DIV_2 RCC_SMPSCR_SMPSDIV_1 /*!< SMPS clock division 2 */ | |||
#define LL_RCC_SMPS_DIV_3 (RCC_SMPSCR_SMPSDIV_0|RCC_SMPSCR_SMPSDIV_1) /*!< SMPS clock division 3 */ | |||
/** | |||
* @} | |||
*/ | |||
#endif | |||
#if defined(USE_FULL_LL_DRIVER) | |||
/** @defgroup RCC_LL_EC_PERIPH_FREQUENCY Peripheral clock frequency | |||
@@ -431,6 +438,7 @@ typedef struct | |||
* @} | |||
*/ | |||
#if defined(LPUART1) | |||
/** @defgroup RCC_LL_EC_LPUART1_CLKSOURCE LPUART1 CLKSOURCE | |||
* @{ | |||
*/ | |||
@@ -441,6 +449,7 @@ typedef struct | |||
/** | |||
* @} | |||
*/ | |||
#endif | |||
/** @defgroup RCC_LL_EC_I2Cx_CLKSOURCE I2Cx CLKSOURCE | |||
* @{ | |||
@@ -448,9 +457,11 @@ typedef struct | |||
#define LL_RCC_I2C1_CLKSOURCE_PCLK1 (uint32_t)((RCC_CCIPR_I2C1SEL << 4) | (0x00000000U >> 4)) /*!< PCLK1 selected as I2C1 clock */ | |||
#define LL_RCC_I2C1_CLKSOURCE_SYSCLK (uint32_t)((RCC_CCIPR_I2C1SEL << 4) | (RCC_CCIPR_I2C1SEL_0 >> 4)) /*!< SYSCLK selected as I2C1 clock */ | |||
#define LL_RCC_I2C1_CLKSOURCE_HSI (uint32_t)((RCC_CCIPR_I2C1SEL << 4) | (RCC_CCIPR_I2C1SEL_1 >> 4)) /*!< HSI selected as I2C1 clock */ | |||
#if defined(I2C3) | |||
#define LL_RCC_I2C3_CLKSOURCE_PCLK1 (uint32_t)((RCC_CCIPR_I2C3SEL << 4) | (0x00000000U >> 4)) /*!< PCLK1 selected as I2C3 clock */ | |||
#define LL_RCC_I2C3_CLKSOURCE_SYSCLK (uint32_t)((RCC_CCIPR_I2C3SEL << 4) | (RCC_CCIPR_I2C3SEL_0 >> 4)) /*!< SYSCLK selected as I2C3 clock */ | |||
#define LL_RCC_I2C3_CLKSOURCE_HSI (uint32_t)((RCC_CCIPR_I2C3SEL << 4) | (RCC_CCIPR_I2C3SEL_1 >> 4)) /*!< HSI selected as I2C3 clock */ | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
@@ -470,6 +481,7 @@ typedef struct | |||
* @} | |||
*/ | |||
#if defined(SAI1) | |||
/** @defgroup RCC_LL_EC_SAI1_CLKSOURCE SAI1 CLKSOURCE | |||
* @{ | |||
*/ | |||
@@ -480,12 +492,15 @@ typedef struct | |||
/** | |||
* @} | |||
*/ | |||
#endif | |||
/** @defgroup RCC_LL_EC_CLK48_CLKSOURCE CLK48 CLKSOURCE | |||
* @{ | |||
*/ | |||
#define LL_RCC_CLK48_CLKSOURCE_HSI48 0x00000000U /*!< HSI48 selected as CLK48 clock*/ | |||
#if defined(SAI1) | |||
#define LL_RCC_CLK48_CLKSOURCE_PLLSAI1 RCC_CCIPR_CLK48SEL_0 /*!< PLLSAI1 selected as CLK48 clock*/ | |||
#endif | |||
#define LL_RCC_CLK48_CLKSOURCE_PLL RCC_CCIPR_CLK48SEL_1 /*!< PLL selected as CLK48 clock*/ | |||
#define LL_RCC_CLK48_CLKSOURCE_MSI RCC_CCIPR_CLK48SEL /*!< MSI selected as CLK48 clock*/ | |||
/** | |||
@@ -496,7 +511,9 @@ typedef struct | |||
* @{ | |||
*/ | |||
#define LL_RCC_USB_CLKSOURCE_HSI48 LL_RCC_CLK48_CLKSOURCE_HSI48 /*!< HSI48 selected as USB clock*/ | |||
#if defined(SAI1) | |||
#define LL_RCC_USB_CLKSOURCE_PLLSAI1 LL_RCC_CLK48_CLKSOURCE_PLLSAI1 /*!< PLLSAI1 selected as USB clock*/ | |||
#endif | |||
#define LL_RCC_USB_CLKSOURCE_PLL LL_RCC_CLK48_CLKSOURCE_PLL /*!< PLL selected as USB clock*/ | |||
#define LL_RCC_USB_CLKSOURCE_MSI LL_RCC_CLK48_CLKSOURCE_MSI /*!< MSI selected as USB clock*/ | |||
/** | |||
@@ -507,7 +524,11 @@ typedef struct | |||
* @{ | |||
*/ | |||
#define LL_RCC_ADC_CLKSOURCE_NONE 0x00000000U /*!< no Clock used as ADC clock*/ | |||
#if defined(STM32WB55xx) || defined (STM32WB5Mxx) | |||
#define LL_RCC_ADC_CLKSOURCE_PLLSAI1 RCC_CCIPR_ADCSEL_0 /*!< PLLSAI1 selected as ADC clock*/ | |||
#elif defined(STM32WB35xx) | |||
#define LL_RCC_ADC_CLKSOURCE_HSI RCC_CCIPR_ADCSEL_0 /*!< HSI selected as ADC clock*/ | |||
#endif | |||
#define LL_RCC_ADC_CLKSOURCE_PLL RCC_CCIPR_ADCSEL_1 /*!< PLL selected as ADC clock*/ | |||
#define LL_RCC_ADC_CLKSOURCE_SYSCLK RCC_CCIPR_ADCSEL /*!< SYSCLK selected as ADC clock*/ | |||
/** | |||
@@ -524,6 +545,19 @@ typedef struct | |||
* @} | |||
*/ | |||
#if defined(SPI_I2S_SUPPORT) | |||
/** @defgroup RCC_LL_EC_I2SCLKSOURCE Peripheral I2S clock source selection | |||
* @{ | |||
*/ | |||
#define LL_RCC_I2S_CLKSOURCE_NONE 0x00000000U /*!< no Clock used as I2S clock*/ | |||
#define LL_RCC_I2S_CLKSOURCE_HSI RCC_CCIPR_I2SSEL_0 /*!< HSI clock used as I2S clock source */ | |||
#define LL_RCC_I2S_CLKSOURCE_PLL RCC_CCIPR_I2SSEL_1 /*!< PLL clock used as I2S clock source */ | |||
#define LL_RCC_I2S_CLKSOURCE_PIN RCC_CCIPR_I2SSEL /*!< External clock used as I2S clock source */ | |||
/** | |||
* @} | |||
*/ | |||
#endif | |||
/** @defgroup RCC_LL_EC_USART1 USART1 | |||
* @{ | |||
*/ | |||
@@ -532,6 +566,7 @@ typedef struct | |||
* @} | |||
*/ | |||
#if defined(LPUART1) | |||
/** @defgroup RCC_LL_EC_LPUART1 LPUART1 | |||
* @{ | |||
*/ | |||
@@ -539,6 +574,7 @@ typedef struct | |||
/** | |||
* @} | |||
*/ | |||
#endif | |||
/** @defgroup RCC_LL_EC_I2C1 I2C1 | |||
* @{ | |||
@@ -558,6 +594,7 @@ typedef struct | |||
* @} | |||
*/ | |||
#if defined(SAI1) | |||
/** @defgroup RCC_LL_EC_SAI1 SAI1 | |||
* @{ | |||
*/ | |||
@@ -565,16 +602,16 @@ typedef struct | |||
/** | |||
* @} | |||
*/ | |||
#endif | |||
/** @defgroup RCC_LL_EC_CLK48 CLK48 | |||
* @{ | |||
*/ | |||
#define LL_RCC_CLK48_CLKSOURCE RCC_CCIPR_CLK48SEL /*!< USB clock source selection bits */ | |||
#define LL_RCC_CLK48_CLKSOURCE RCC_CCIPR_CLK48SEL /*!< CLK48 clock source selection bits */ | |||
/** | |||
* @} | |||
*/ | |||
/** @defgroup RCC_LL_EC_USB USB | |||
* @{ | |||
*/ | |||
@@ -599,6 +636,16 @@ typedef struct | |||
* @} | |||
*/ | |||
#if defined(SPI_I2S_SUPPORT) | |||
/** @defgroup RCC_LL_EC_I2S I2S | |||
* @{ | |||
*/ | |||
#define LL_RCC_I2S_CLKSOURCE RCC_CCIPR_I2SSEL /*!< I2S clock source selection bits */ | |||
/** | |||
* @} | |||
*/ | |||
#endif | |||
/** @defgroup RCC_LL_EC_RTC_CLKSOURCE RTC clock source selection | |||
* @{ | |||
*/ | |||
@@ -717,6 +764,7 @@ typedef struct | |||
*/ | |||
#if defined(SAI1) | |||
/** @defgroup RCC_LL_EC_PLLSAI1Q PLLSAI1 division factor (PLLQ) | |||
* @{ | |||
*/ | |||
@@ -782,6 +830,7 @@ typedef struct | |||
/** | |||
* @} | |||
*/ | |||
#endif | |||
/** | |||
* @} | |||
@@ -832,7 +881,7 @@ typedef struct | |||
* @arg @ref LL_RCC_PLLM_DIV_6 | |||
* @arg @ref LL_RCC_PLLM_DIV_7 | |||
* @arg @ref LL_RCC_PLLM_DIV_8 | |||
* @param __PLLN__ Between Min_Data = 8 and Max_Data = 86 | |||
* @param __PLLN__ Between Min_Data = 6 and Max_Data = 127 | |||
* @param __PLLR__ This parameter can be one of the following values: | |||
* @arg @ref LL_RCC_PLLR_DIV_2 | |||
* @arg @ref LL_RCC_PLLR_DIV_3 | |||
@@ -846,6 +895,7 @@ typedef struct | |||
#define __LL_RCC_CALC_PLLCLK_FREQ(__INPUTFREQ__, __PLLM__, __PLLN__, __PLLR__) ((__INPUTFREQ__) * (__PLLN__) / ((((__PLLM__)>> RCC_PLLCFGR_PLLM_Pos) + 1U)) / \ | |||
(((__PLLR__) >> RCC_PLLCFGR_PLLR_Pos) + 1U)) | |||
#if defined(SAI1) | |||
/** | |||
* @brief Helper macro to calculate the PLLPCLK frequency used on SAI domain | |||
* @note ex: @ref __LL_RCC_CALC_PLLCLK_SAI_FREQ (HSE_VALUE,@ref LL_RCC_PLL_GetDivider (), | |||
@@ -860,7 +910,7 @@ typedef struct | |||
* @arg @ref LL_RCC_PLLM_DIV_6 | |||
* @arg @ref LL_RCC_PLLM_DIV_7 | |||
* @arg @ref LL_RCC_PLLM_DIV_8 | |||
* @param __PLLN__ Between Min_Data = 8 and Max_Data = 86 | |||
* @param __PLLN__ Between Min_Data = 6 and Max_Data = 127 | |||
* @param __PLLP__ This parameter can be one of the following values: | |||
* @arg @ref LL_RCC_PLLP_DIV_2 | |||
* @arg @ref LL_RCC_PLLP_DIV_3 | |||
@@ -896,7 +946,7 @@ typedef struct | |||
*/ | |||
#define __LL_RCC_CALC_PLLCLK_SAI_FREQ(__INPUTFREQ__, __PLLM__, __PLLN__, __PLLP__) ((__INPUTFREQ__) * (__PLLN__) / ((((__PLLM__)>> RCC_PLLCFGR_PLLM_Pos) + 1U))/ \ | |||
(((__PLLP__) >> RCC_PLLCFGR_PLLP_Pos) + 1U)) | |||
#endif | |||
/** | |||
* @brief Helper macro to calculate the PLLPCLK frequency used on ADC domain | |||
@@ -912,7 +962,7 @@ typedef struct | |||
* @arg @ref LL_RCC_PLLM_DIV_6 | |||
* @arg @ref LL_RCC_PLLM_DIV_7 | |||
* @arg @ref LL_RCC_PLLM_DIV_8 | |||
* @param __PLLN__ Between Min_Data = 8 and Max_Data = 86 | |||
* @param __PLLN__ Between Min_Data = 6 and Max_Data = 127 | |||
* @param __PLLP__ This parameter can be one of the following values: | |||
* @arg @ref LL_RCC_PLLP_DIV_2 | |||
* @arg @ref LL_RCC_PLLP_DIV_3 | |||
@@ -950,6 +1000,60 @@ typedef struct | |||
#define __LL_RCC_CALC_PLLCLK_ADC_FREQ(__INPUTFREQ__, __PLLM__, __PLLN__, __PLLP__) ((__INPUTFREQ__) * (__PLLN__) / ((((__PLLM__)>> RCC_PLLCFGR_PLLM_Pos) + 1U)) / \ | |||
(((__PLLP__) >> RCC_PLLCFGR_PLLP_Pos) + 1U)) | |||
#if defined(SPI_I2S_SUPPORT) | |||
/** | |||
* @brief Helper macro to calculate the PLLPCLK frequency used on I2S domain | |||
* @note ex: @ref __LL_RCC_CALC_PLLCLK_I2S_FREQ (HSE_VALUE,@ref LL_RCC_PLL_GetDivider (), | |||
* @ref LL_RCC_PLL_GetN (), @ref LL_RCC_PLL_GetP ()); | |||
* @param __INPUTFREQ__ PLL Input frequency (based on HSE/HSI) | |||
* @param __PLLM__ This parameter can be one of the following values: | |||
* @arg @ref LL_RCC_PLLM_DIV_1 | |||
* @arg @ref LL_RCC_PLLM_DIV_2 | |||
* @arg @ref LL_RCC_PLLM_DIV_3 | |||
* @arg @ref LL_RCC_PLLM_DIV_4 | |||
* @arg @ref LL_RCC_PLLM_DIV_5 | |||
* @arg @ref LL_RCC_PLLM_DIV_6 | |||
* @arg @ref LL_RCC_PLLM_DIV_7 | |||
* @arg @ref LL_RCC_PLLM_DIV_8 | |||
* @param __PLLN__ Between Min_Data = 8 and Max_Data = 86 | |||
* @param __PLLP__ This parameter can be one of the following values: | |||
* @arg @ref LL_RCC_PLLP_DIV_2 | |||
* @arg @ref LL_RCC_PLLP_DIV_3 | |||
* @arg @ref LL_RCC_PLLP_DIV_4 | |||
* @arg @ref LL_RCC_PLLP_DIV_5 | |||
* @arg @ref LL_RCC_PLLP_DIV_6 | |||
* @arg @ref LL_RCC_PLLP_DIV_7 | |||
* @arg @ref LL_RCC_PLLP_DIV_8 | |||
* @arg @ref LL_RCC_PLLP_DIV_9 | |||
* @arg @ref LL_RCC_PLLP_DIV_10 | |||
* @arg @ref LL_RCC_PLLP_DIV_11 | |||
* @arg @ref LL_RCC_PLLP_DIV_12 | |||
* @arg @ref LL_RCC_PLLP_DIV_13 | |||
* @arg @ref LL_RCC_PLLP_DIV_14 | |||
* @arg @ref LL_RCC_PLLP_DIV_15 | |||
* @arg @ref LL_RCC_PLLP_DIV_16 | |||
* @arg @ref LL_RCC_PLLP_DIV_17 | |||
* @arg @ref LL_RCC_PLLP_DIV_18 | |||
* @arg @ref LL_RCC_PLLP_DIV_19 | |||
* @arg @ref LL_RCC_PLLP_DIV_20 | |||
* @arg @ref LL_RCC_PLLP_DIV_21 | |||
* @arg @ref LL_RCC_PLLP_DIV_22 | |||
* @arg @ref LL_RCC_PLLP_DIV_23 | |||
* @arg @ref LL_RCC_PLLP_DIV_24 | |||
* @arg @ref LL_RCC_PLLP_DIV_25 | |||
* @arg @ref LL_RCC_PLLP_DIV_26 | |||
* @arg @ref LL_RCC_PLLP_DIV_27 | |||
* @arg @ref LL_RCC_PLLP_DIV_28 | |||
* @arg @ref LL_RCC_PLLP_DIV_29 | |||
* @arg @ref LL_RCC_PLLP_DIV_30 | |||
* @arg @ref LL_RCC_PLLP_DIV_31 | |||
* @arg @ref LL_RCC_PLLP_DIV_32 | |||
* @retval PLL clock frequency (in Hz) | |||
*/ | |||
#define __LL_RCC_CALC_PLLCLK_I2S_FREQ(__INPUTFREQ__, __PLLM__, __PLLN__, __PLLP__) ((__INPUTFREQ__) * (__PLLN__) / ((((__PLLM__)>> RCC_PLLCFGR_PLLM_Pos) + 1U)) / \ | |||
(((__PLLP__) >> RCC_PLLCFGR_PLLP_Pos) + 1U)) | |||
#endif | |||
/** | |||
* @brief Helper macro to calculate the PLLQCLK frequency used on 48M domain | |||
* @note ex: @ref __LL_RCC_CALC_PLLCLK_48M_FREQ (HSE_VALUE,@ref LL_RCC_PLL_GetDivider (), | |||
@@ -964,7 +1068,7 @@ typedef struct | |||
* @arg @ref LL_RCC_PLLM_DIV_6 | |||
* @arg @ref LL_RCC_PLLM_DIV_7 | |||
* @arg @ref LL_RCC_PLLM_DIV_8 | |||
* @param __PLLN__ Between Min_Data = 8 and Max_Data = 86 | |||
* @param __PLLN__ Between Min_Data = 6 and Max_Data = 127 | |||
* @param __PLLQ__ This parameter can be one of the following values: | |||
* @arg @ref LL_RCC_PLLQ_DIV_2 | |||
* @arg @ref LL_RCC_PLLQ_DIV_3 | |||
@@ -978,6 +1082,7 @@ typedef struct | |||
#define __LL_RCC_CALC_PLLCLK_48M_FREQ(__INPUTFREQ__, __PLLM__, __PLLN__, __PLLQ__) ((__INPUTFREQ__) * (__PLLN__) / ((((__PLLM__)>> RCC_PLLCFGR_PLLM_Pos) + 1U)) / \ | |||
(((__PLLQ__) >> RCC_PLLCFGR_PLLQ_Pos) + 1U)) | |||
#if defined(SAI1) | |||
/** | |||
* @brief Helper macro to calculate the PLLSAI1PCLK frequency used for SAI domain | |||
* @note ex: @ref __LL_RCC_CALC_PLLSAI1_SAI_FREQ (HSE_VALUE,@ref LL_RCC_PLL_GetDivider (), | |||
@@ -992,7 +1097,7 @@ typedef struct | |||
* @arg @ref LL_RCC_PLLM_DIV_6 | |||
* @arg @ref LL_RCC_PLLM_DIV_7 | |||
* @arg @ref LL_RCC_PLLM_DIV_8 | |||
* @param __PLLSAI1N__ Between 8 and 86 | |||
* @param __PLLSAI1N__ Between 6 and 127 | |||
* @param __PLLSAI1P__ This parameter can be one of the following values: | |||
* @arg @ref LL_RCC_PLLSAI1P_DIV_2 | |||
* @arg @ref LL_RCC_PLLSAI1P_DIV_3 | |||
@@ -1045,7 +1150,7 @@ typedef struct | |||
* @arg @ref LL_RCC_PLLM_DIV_6 | |||
* @arg @ref LL_RCC_PLLM_DIV_7 | |||
* @arg @ref LL_RCC_PLLM_DIV_8 | |||
* @param __PLLSAI1N__ Between 8 and 86 | |||
* @param __PLLSAI1N__ Between 6 and 127 | |||
* @param __PLLSAI1Q__ This parameter can be one of the following values: | |||
* @arg @ref LL_RCC_PLLSAI1Q_DIV_2 | |||
* @arg @ref LL_RCC_PLLSAI1Q_DIV_3 | |||
@@ -1074,7 +1179,7 @@ typedef struct | |||
* @arg @ref LL_RCC_PLLM_DIV_6 | |||
* @arg @ref LL_RCC_PLLM_DIV_7 | |||
* @arg @ref LL_RCC_PLLM_DIV_8 | |||
* @param __PLLSAI1N__ Between 8 and 86 | |||
* @param __PLLSAI1N__ Between 6 and 127 | |||
* @param __PLLSAI1R__ This parameter can be one of the following values: | |||
* @arg @ref LL_RCC_PLLSAI1R_DIV_2 | |||
* @arg @ref LL_RCC_PLLSAI1R_DIV_3 | |||
@@ -1088,6 +1193,7 @@ typedef struct | |||
#define __LL_RCC_CALC_PLLSAI1_ADC_FREQ(__INPUTFREQ__, __PLLM__, __PLLSAI1N__, __PLLSAI1R__) \ | |||
((__INPUTFREQ__) * (__PLLSAI1N__) / ((((__PLLM__)>> RCC_PLLCFGR_PLLM_Pos) + 1U)) / \ | |||
(((__PLLSAI1R__) >> RCC_PLLSAI1CFGR_PLLR_Pos) + 1U)) | |||
#endif | |||
/** | |||
* @brief Helper macro to calculate the HCLK1 frequency | |||
@@ -1908,7 +2014,7 @@ __STATIC_INLINE void LL_RCC_MSI_SetRange(uint32_t Range) | |||
__STATIC_INLINE uint32_t LL_RCC_MSI_GetRange(void) | |||
{ | |||
uint32_t msiRange = READ_BIT(RCC->CR, RCC_CR_MSIRANGE); | |||
if(msiRange > LL_RCC_MSIRANGE_11) | |||
if (msiRange > LL_RCC_MSIRANGE_11) | |||
{ | |||
msiRange = LL_RCC_MSIRANGE_11; | |||
} | |||
@@ -2081,11 +2187,11 @@ __STATIC_INLINE uint32_t LL_RCC_GetRFWKPClockSource(void) | |||
return (uint32_t)(READ_BIT(RCC->CSR, RCC_CSR_RFWKPSEL)); | |||
} | |||
/** | |||
* @brief Check if Radio System is reset. | |||
* @rmtoll CSR RFRSTS LL_RCC_IsRFUnderReset | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
/** | |||
* @brief Check if Radio System is reset. | |||
* @rmtoll CSR RFRSTS LL_RCC_IsRFUnderReset | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_RCC_IsRFUnderReset(void) | |||
{ | |||
return ((READ_BIT(RCC->CSR, RCC_CSR_RFRSTS) == (RCC_CSR_RFRSTS)) ? 1UL : 0UL); | |||
@@ -2329,6 +2435,7 @@ __STATIC_INLINE uint32_t LL_RCC_GetClkAfterWakeFromStop(void) | |||
* @} | |||
*/ | |||
#if defined(RCC_SMPS_SUPPORT) | |||
/** @defgroup RCC_LL_EF_SMPS SMPS | |||
* @{ | |||
*/ | |||
@@ -2411,7 +2518,7 @@ __STATIC_INLINE uint32_t LL_RCC_GetSMPSPrescaler(void) | |||
/** | |||
* @} | |||
*/ | |||
#endif | |||
/** @defgroup RCC_LL_EF_MCO MCO | |||
* @{ | |||
@@ -2469,6 +2576,7 @@ __STATIC_INLINE void LL_RCC_SetUSARTClockSource(uint32_t USARTxSource) | |||
MODIFY_REG(RCC->CCIPR, RCC_CCIPR_USART1SEL, USARTxSource); | |||
} | |||
#if defined(LPUART1) | |||
/** | |||
* @brief Configure LPUART1x clock source | |||
* @rmtoll CCIPR LPUART1SEL LL_RCC_SetLPUARTClockSource | |||
@@ -2483,6 +2591,7 @@ __STATIC_INLINE void LL_RCC_SetLPUARTClockSource(uint32_t LPUARTxSource) | |||
{ | |||
MODIFY_REG(RCC->CCIPR, RCC_CCIPR_LPUART1SEL, LPUARTxSource); | |||
} | |||
#endif | |||
/** | |||
* @brief Configure I2Cx clock source | |||
@@ -2520,6 +2629,7 @@ __STATIC_INLINE void LL_RCC_SetLPTIMClockSource(uint32_t LPTIMxSource) | |||
MODIFY_REG(RCC->CCIPR, (LPTIMxSource & 0xFFFF0000U), (LPTIMxSource << 16)); | |||
} | |||
#if defined(SAI1) | |||
/** | |||
* @brief Configure SAIx clock source | |||
* @rmtoll CCIPR SAI1SEL LL_RCC_SetSAIClockSource | |||
@@ -2534,6 +2644,7 @@ __STATIC_INLINE void LL_RCC_SetSAIClockSource(uint32_t SAIxSource) | |||
{ | |||
MODIFY_REG(RCC->CCIPR, RCC_CCIPR_SAI1SEL, SAIxSource); | |||
} | |||
#endif | |||
/** | |||
* @brief Configure RNG clock source | |||
@@ -2555,9 +2666,10 @@ __STATIC_INLINE void LL_RCC_SetRNGClockSource(uint32_t RNGxSource) | |||
* @rmtoll CCIPR CLK48SEL LL_RCC_SetCLK48ClockSource | |||
* @param CLK48xSource This parameter can be one of the following values: | |||
* @arg @ref LL_RCC_CLK48_CLKSOURCE_HSI48 | |||
* @arg @ref LL_RCC_CLK48_CLKSOURCE_PLLSAI1 | |||
* @arg @ref LL_RCC_CLK48_CLKSOURCE_PLLSAI1 (*) | |||
* @arg @ref LL_RCC_CLK48_CLKSOURCE_PLL | |||
* @arg @ref LL_RCC_CLK48_CLKSOURCE_MSI | |||
* @note (*) Value not defined for all devices | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_RCC_SetCLK48ClockSource(uint32_t CLK48xSource) | |||
@@ -2565,7 +2677,7 @@ __STATIC_INLINE void LL_RCC_SetCLK48ClockSource(uint32_t CLK48xSource) | |||
MODIFY_REG(RCC->CCIPR, RCC_CCIPR_CLK48SEL, CLK48xSource); | |||
} | |||
#if defined(USB) | |||
/** | |||
* @brief Configure USB clock source | |||
* @rmtoll CCIPR CLK48SEL LL_RCC_SetUSBClockSource | |||
@@ -2580,6 +2692,7 @@ __STATIC_INLINE void LL_RCC_SetUSBClockSource(uint32_t USBxSource) | |||
{ | |||
LL_RCC_SetCLK48ClockSource(USBxSource); | |||
} | |||
#endif | |||
/** | |||
* @brief Configure RNG clock source | |||
@@ -2593,10 +2706,10 @@ __STATIC_INLINE void LL_RCC_SetUSBClockSource(uint32_t USBxSource) | |||
* @arg @ref LL_RCC_RNG_CLKSOURCE_LSE | |||
* @param CLK48xSource This parameter can be one of the following values: | |||
* @arg @ref LL_RCC_CLK48_CLKSOURCE_HSI48 | |||
* @arg @ref LL_RCC_CLK48_CLKSOURCE_PLLSAI1 | |||
* @arg @ref LL_RCC_CLK48_CLKSOURCE_PLLSAI1 (*) | |||
* @arg @ref LL_RCC_CLK48_CLKSOURCE_PLL | |||
* @arg @ref LL_RCC_CLK48_CLKSOURCE_MSI | |||
* @note (*) Value not defined for all devices | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_RCC_ConfigRNGClockSource(uint32_t RNGxSource, uint32_t CLK48xSource) | |||
@@ -2614,9 +2727,11 @@ __STATIC_INLINE void LL_RCC_ConfigRNGClockSource(uint32_t RNGxSource, uint32_t C | |||
* @rmtoll CCIPR ADCSEL LL_RCC_SetADCClockSource | |||
* @param ADCxSource This parameter can be one of the following values: | |||
* @arg @ref LL_RCC_ADC_CLKSOURCE_NONE | |||
* @arg @ref LL_RCC_ADC_CLKSOURCE_PLLSAI1 | |||
* @arg @ref LL_RCC_ADC_CLKSOURCE_PLLSAI1 (*) | |||
* @arg @ref LL_RCC_ADC_CLKSOURCE_PLL | |||
* @arg @ref LL_RCC_ADC_CLKSOURCE_SYSCLK | |||
* @arg @ref LL_RCC_ADC_CLKSOURCE_HSI (*) | |||
* @note (*) Value not defined for all devices | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_RCC_SetADCClockSource(uint32_t ADCxSource) | |||
@@ -2624,6 +2739,23 @@ __STATIC_INLINE void LL_RCC_SetADCClockSource(uint32_t ADCxSource) | |||
MODIFY_REG(RCC->CCIPR, RCC_CCIPR_ADCSEL, ADCxSource); | |||
} | |||
#if defined(SPI_I2S_SUPPORT) | |||
/** | |||
* @brief Configure I2Sx clock source | |||
* @rmtoll CCIPR I2SSEL LL_RCC_SetI2SClockSource | |||
* @param I2SxSource This parameter can be one of the following values: | |||
* @arg @ref LL_RCC_I2S_CLKSOURCE_NONE | |||
* @arg @ref LL_RCC_I2S_CLKSOURCE_PLL | |||
* @arg @ref LL_RCC_I2S_CLKSOURCE_HSI | |||
* @arg @ref LL_RCC_I2S_CLKSOURCE_PIN | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_RCC_SetI2SClockSource(uint32_t I2SxSource) | |||
{ | |||
MODIFY_REG(RCC->CCIPR, RCC_CCIPR_I2SSEL, I2SxSource); | |||
} | |||
#endif | |||
/** | |||
* @brief Get USARTx clock source | |||
* @rmtoll CCIPR USART1SEL LL_RCC_GetUSARTClockSource | |||
@@ -2640,6 +2772,7 @@ __STATIC_INLINE uint32_t LL_RCC_GetUSARTClockSource(uint32_t USARTx) | |||
return (uint32_t)(READ_BIT(RCC->CCIPR, USARTx)); | |||
} | |||
#if defined(LPUART1) | |||
/** | |||
* @brief Get LPUARTx clock source | |||
* @rmtoll CCIPR LPUART1SEL LL_RCC_GetLPUARTClockSource | |||
@@ -2655,6 +2788,7 @@ __STATIC_INLINE uint32_t LL_RCC_GetLPUARTClockSource(uint32_t LPUARTx) | |||
{ | |||
return (uint32_t)(READ_BIT(RCC->CCIPR, LPUARTx)); | |||
} | |||
#endif | |||
/** | |||
* @brief Get I2Cx clock source | |||
@@ -2696,6 +2830,7 @@ __STATIC_INLINE uint32_t LL_RCC_GetLPTIMClockSource(uint32_t LPTIMx) | |||
return (uint32_t)((READ_BIT(RCC->CCIPR, LPTIMx) >> 16) | LPTIMx); | |||
} | |||
#if defined(SAI1) | |||
/** | |||
* @brief Get SAIx clock source | |||
* @rmtoll CCIPR SAI1SEL LL_RCC_GetSAIClockSource | |||
@@ -2711,6 +2846,7 @@ __STATIC_INLINE uint32_t LL_RCC_GetSAIClockSource(uint32_t SAIx) | |||
{ | |||
return (uint32_t)(READ_BIT(RCC->CCIPR, SAIx)); | |||
} | |||
#endif | |||
/** | |||
* @brief Get RNGx clock source | |||
@@ -2733,17 +2869,18 @@ __STATIC_INLINE uint32_t LL_RCC_GetRNGClockSource(uint32_t RNGx) | |||
* @param CLK48x This parameter can be one of the following values: | |||
* @arg @ref LL_RCC_CLK48_CLKSOURCE | |||
* @retval Returned value can be one of the following values: | |||
* @arg @ref LL_RCC_USB_CLKSOURCE_HSI48 | |||
* @arg @ref LL_RCC_USB_CLKSOURCE_PLLSAI1 | |||
* @arg @ref LL_RCC_USB_CLKSOURCE_PLL | |||
* @arg @ref LL_RCC_USB_CLKSOURCE_MSI | |||
* @arg @ref LL_RCC_CLK48_CLKSOURCE_HSI48 | |||
* @arg @ref LL_RCC_CLK48_CLKSOURCE_PLLSAI1 (*) | |||
* @arg @ref LL_RCC_CLK48_CLKSOURCE_PLL | |||
* @arg @ref LL_RCC_CLK48_CLKSOURCE_MSI | |||
* @note (*) Value not defined for all devices | |||
*/ | |||
__STATIC_INLINE uint32_t LL_RCC_GetCLK48ClockSource(uint32_t CLK48x) | |||
{ | |||
return (uint32_t)(READ_BIT(RCC->CCIPR, CLK48x)); | |||
} | |||
#if defined(USB) | |||
/** | |||
* @brief Get USBx clock source | |||
* @rmtoll CCIPR CLK48SEL LL_RCC_GetUSBClockSource | |||
@@ -2759,6 +2896,7 @@ __STATIC_INLINE uint32_t LL_RCC_GetUSBClockSource(uint32_t USBx) | |||
{ | |||
return LL_RCC_GetCLK48ClockSource(USBx); | |||
} | |||
#endif | |||
/** | |||
* @brief Get ADCx clock source | |||
@@ -2767,15 +2905,34 @@ __STATIC_INLINE uint32_t LL_RCC_GetUSBClockSource(uint32_t USBx) | |||
* @arg @ref LL_RCC_ADC_CLKSOURCE | |||
* @retval Returned value can be one of the following values: | |||
* @arg @ref LL_RCC_ADC_CLKSOURCE_NONE | |||
* @arg @ref LL_RCC_ADC_CLKSOURCE_PLLSAI1 | |||
* @arg @ref LL_RCC_ADC_CLKSOURCE_PLLSAI1 (*) | |||
* @arg @ref LL_RCC_ADC_CLKSOURCE_PLL | |||
* @arg @ref LL_RCC_ADC_CLKSOURCE_SYSCLK | |||
* @arg @ref LL_RCC_ADC_CLKSOURCE_HSI (*) | |||
* @note (*) Value not defined for all devices | |||
*/ | |||
__STATIC_INLINE uint32_t LL_RCC_GetADCClockSource(uint32_t ADCx) | |||
{ | |||
return (uint32_t)(READ_BIT(RCC->CCIPR, ADCx)); | |||
} | |||
#if defined(SPI_I2S_SUPPORT) | |||
/** | |||
* @brief Get I2Sx clock source | |||
* @rmtoll CCIPR I2SSEL LL_RCC_GetI2SClockSource | |||
* @param I2Sx This parameter can be one of the following values: | |||
* @arg @ref LL_RCC_I2S_CLKSOURCE | |||
* @retval Returned value can be one of the following values: | |||
* @arg @ref LL_RCC_I2S_CLKSOURCE_NONE | |||
* @arg @ref LL_RCC_I2S_CLKSOURCE_PLL | |||
* @arg @ref LL_RCC_I2S_CLKSOURCE_HSI | |||
* @arg @ref LL_RCC_I2S_CLKSOURCE_PIN | |||
*/ | |||
__STATIC_INLINE uint32_t LL_RCC_GetI2SClockSource(uint32_t I2Sx) | |||
{ | |||
return (uint32_t)(READ_BIT(RCC->CCIPR, I2Sx)); | |||
} | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
@@ -2929,7 +3086,7 @@ __STATIC_INLINE uint32_t LL_RCC_PLL_IsReady(void) | |||
* @arg @ref LL_RCC_PLLM_DIV_6 | |||
* @arg @ref LL_RCC_PLLM_DIV_7 | |||
* @arg @ref LL_RCC_PLLM_DIV_8 | |||
* @param PLLN Between 8 and 86 | |||
* @param PLLN Between 6 and 127 | |||
* @param PLLR This parameter can be one of the following values: | |||
* @arg @ref LL_RCC_PLLR_DIV_2 | |||
* @arg @ref LL_RCC_PLLR_DIV_4 | |||
@@ -2943,6 +3100,7 @@ __STATIC_INLINE void LL_RCC_PLL_ConfigDomain_SYS(uint32_t Source, uint32_t PLLM, | |||
Source | PLLM | (PLLN << RCC_PLLCFGR_PLLN_Pos) | PLLR); | |||
} | |||
#if defined(SAI1) | |||
/** | |||
* @brief Configure PLL used for SAI domain clock | |||
* @note PLL Source and PLLM Divider can be written only when PLL is disabled | |||
@@ -2966,7 +3124,7 @@ __STATIC_INLINE void LL_RCC_PLL_ConfigDomain_SYS(uint32_t Source, uint32_t PLLM, | |||
* @arg @ref LL_RCC_PLLM_DIV_6 | |||
* @arg @ref LL_RCC_PLLM_DIV_7 | |||
* @arg @ref LL_RCC_PLLM_DIV_8 | |||
* @param PLLN Between 8 and 86 | |||
* @param PLLN Between 6 and 127 | |||
* @param PLLP This parameter can be one of the following values: | |||
* @arg @ref LL_RCC_PLLP_DIV_2 | |||
* @arg @ref LL_RCC_PLLP_DIV_3 | |||
@@ -3006,6 +3164,7 @@ __STATIC_INLINE void LL_RCC_PLL_ConfigDomain_SAI(uint32_t Source, uint32_t PLLM, | |||
MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC | RCC_PLLCFGR_PLLM | RCC_PLLCFGR_PLLN | RCC_PLLCFGR_PLLP, | |||
Source | PLLM | (PLLN << RCC_PLLCFGR_PLLN_Pos) | PLLP); | |||
} | |||
#endif | |||
/** | |||
* @brief Configure PLL used for ADC domain clock | |||
@@ -3030,7 +3189,7 @@ __STATIC_INLINE void LL_RCC_PLL_ConfigDomain_SAI(uint32_t Source, uint32_t PLLM, | |||
* @arg @ref LL_RCC_PLLM_DIV_6 | |||
* @arg @ref LL_RCC_PLLM_DIV_7 | |||
* @arg @ref LL_RCC_PLLM_DIV_8 | |||
* @param PLLN Between 8 and 86 | |||
* @param PLLN Between 6 and 127 | |||
* @param PLLP This parameter can be one of the following values: | |||
* @arg @ref LL_RCC_PLLP_DIV_2 | |||
* @arg @ref LL_RCC_PLLP_DIV_3 | |||
@@ -3095,7 +3254,7 @@ __STATIC_INLINE void LL_RCC_PLL_ConfigDomain_ADC(uint32_t Source, uint32_t PLLM, | |||
* @arg @ref LL_RCC_PLLM_DIV_6 | |||
* @arg @ref LL_RCC_PLLM_DIV_7 | |||
* @arg @ref LL_RCC_PLLM_DIV_8 | |||
* @param PLLN Between 8 and 86 | |||
* @param PLLN Between 6 and 127 | |||
* @param PLLQ This parameter can be one of the following values: | |||
* @arg @ref LL_RCC_PLLQ_DIV_2 | |||
* @arg @ref LL_RCC_PLLQ_DIV_3 | |||
@@ -3115,7 +3274,7 @@ __STATIC_INLINE void LL_RCC_PLL_ConfigDomain_48M(uint32_t Source, uint32_t PLLM, | |||
/** | |||
* @brief Get Main PLL multiplication factor for VCO | |||
* @rmtoll PLLCFGR PLLN LL_RCC_PLL_GetN | |||
* @retval Between 8 and 86 | |||
* @retval Between 6 and 127 | |||
*/ | |||
__STATIC_INLINE uint32_t LL_RCC_PLL_GetN(void) | |||
{ | |||
@@ -3218,6 +3377,7 @@ __STATIC_INLINE uint32_t LL_RCC_PLL_GetDivider(void) | |||
return (uint32_t)(READ_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLM)); | |||
} | |||
#if defined(SAI1) | |||
/** | |||
* @brief Enable PLL output mapped on SAI domain clock | |||
* @rmtoll PLLCFGR PLLPEN LL_RCC_PLL_EnableDomain_SAI | |||
@@ -3239,6 +3399,7 @@ __STATIC_INLINE void LL_RCC_PLL_DisableDomain_SAI(void) | |||
{ | |||
CLEAR_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLPEN); | |||
} | |||
#endif | |||
/** | |||
* @brief Enable PLL output mapped on ADC domain clock | |||
@@ -3312,6 +3473,7 @@ __STATIC_INLINE void LL_RCC_PLL_DisableDomain_SYS(void) | |||
* @} | |||
*/ | |||
#if defined(SAI1) | |||
/** @defgroup RCC_LL_EF_PLLSAI1 PLLSAI1 | |||
* @{ | |||
*/ | |||
@@ -3370,7 +3532,7 @@ __STATIC_INLINE uint32_t LL_RCC_PLLSAI1_IsReady(void) | |||
* @arg @ref LL_RCC_PLLM_DIV_6 | |||
* @arg @ref LL_RCC_PLLM_DIV_7 | |||
* @arg @ref LL_RCC_PLLM_DIV_8 | |||
* @param PLLN Between 8 and 86 | |||
* @param PLLN Between 6 and 127 | |||
* @param PLLQ This parameter can be one of the following values: | |||
* @arg @ref LL_RCC_PLLSAI1Q_DIV_2 | |||
* @arg @ref LL_RCC_PLLSAI1Q_DIV_3 | |||
@@ -3411,7 +3573,7 @@ __STATIC_INLINE void LL_RCC_PLLSAI1_ConfigDomain_48M(uint32_t Source, uint32_t P | |||
* @arg @ref LL_RCC_PLLM_DIV_6 | |||
* @arg @ref LL_RCC_PLLM_DIV_7 | |||
* @arg @ref LL_RCC_PLLM_DIV_8 | |||
* @param PLLN Between 8 and 86 | |||
* @param PLLN Between 6 and 127 | |||
* @param PLLP This parameter can be one of the following values: | |||
* @arg @ref LL_RCC_PLLSAI1P_DIV_2 | |||
* @arg @ref LL_RCC_PLLSAI1P_DIV_3 | |||
@@ -3477,7 +3639,7 @@ __STATIC_INLINE void LL_RCC_PLLSAI1_ConfigDomain_SAI(uint32_t Source, uint32_t P | |||
* @arg @ref LL_RCC_PLLM_DIV_6 | |||
* @arg @ref LL_RCC_PLLM_DIV_7 | |||
* @arg @ref LL_RCC_PLLM_DIV_8 | |||
* @param PLLN Between 8 and 86 | |||
* @param PLLN Between 6 and 127 | |||
* @param PLLR This parameter can be one of the following values: | |||
* @arg @ref LL_RCC_PLLSAI1R_DIV_2 | |||
* @arg @ref LL_RCC_PLLSAI1R_DIV_3 | |||
@@ -3494,38 +3656,10 @@ __STATIC_INLINE void LL_RCC_PLLSAI1_ConfigDomain_ADC(uint32_t Source, uint32_t P | |||
MODIFY_REG(RCC->PLLSAI1CFGR, RCC_PLLSAI1CFGR_PLLN | RCC_PLLSAI1CFGR_PLLR, (PLLN << RCC_PLLSAI1CFGR_PLLN_Pos) | PLLR); | |||
} | |||
/** | |||
* @brief Configure PLL clock source | |||
* @rmtoll PLLCFGR PLLSRC LL_RCC_PLL_SetMainSource | |||
* @param PLLSource This parameter can be one of the following values: | |||
* @arg @ref LL_RCC_PLLSOURCE_MSI | |||
* @arg @ref LL_RCC_PLLSOURCE_HSI | |||
* @arg @ref LL_RCC_PLLSOURCE_HSE | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_RCC_PLL_SetMainSource(uint32_t PLLSource) | |||
{ | |||
MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC, PLLSource); | |||
} | |||
/** | |||
* @brief Get the oscillator used as PLL clock source. | |||
* @rmtoll PLLCFGR PLLSRC LL_RCC_PLL_GetMainSource | |||
* @retval Returned value can be one of the following values: | |||
* @arg @ref LL_RCC_PLLSOURCE_NONE | |||
* @arg @ref LL_RCC_PLLSOURCE_MSI | |||
* @arg @ref LL_RCC_PLLSOURCE_HSI | |||
* @arg @ref LL_RCC_PLLSOURCE_HSE | |||
*/ | |||
__STATIC_INLINE uint32_t LL_RCC_PLL_GetMainSource(void) | |||
{ | |||
return (uint32_t)(READ_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC)); | |||
} | |||
/** | |||
* @brief Get SAI1PLL multiplication factor for VCO | |||
* @rmtoll PLLSAI1CFGR PLLN LL_RCC_PLLSAI1_GetN | |||
* @retval Between 8 and 86 | |||
* @retval Between 6 and 127 | |||
*/ | |||
__STATIC_INLINE uint32_t LL_RCC_PLLSAI1_GetN(void) | |||
{ | |||
@@ -3676,6 +3810,7 @@ __STATIC_INLINE void LL_RCC_PLLSAI1_DisableDomain_ADC(void) | |||
{ | |||
CLEAR_BIT(RCC->PLLSAI1CFGR, RCC_PLLSAI1CFGR_PLLREN); | |||
} | |||
#endif | |||
/** | |||
* @} | |||
@@ -3747,6 +3882,34 @@ __STATIC_INLINE void LL_RCC_ClearFlag_HSERDY(void) | |||
SET_BIT(RCC->CICR, RCC_CICR_HSERDYC); | |||
} | |||
/** | |||
* @brief Configure PLL clock source | |||
* @rmtoll PLLCFGR PLLSRC LL_RCC_PLL_SetMainSource | |||
* @param PLLSource This parameter can be one of the following values: | |||
* @arg @ref LL_RCC_PLLSOURCE_MSI | |||
* @arg @ref LL_RCC_PLLSOURCE_HSI | |||
* @arg @ref LL_RCC_PLLSOURCE_HSE | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_RCC_PLL_SetMainSource(uint32_t PLLSource) | |||
{ | |||
MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC, PLLSource); | |||
} | |||
/** | |||
* @brief Get the oscillator used as PLL clock source. | |||
* @rmtoll PLLCFGR PLLSRC LL_RCC_PLL_GetMainSource | |||
* @retval Returned value can be one of the following values: | |||
* @arg @ref LL_RCC_PLLSOURCE_NONE | |||
* @arg @ref LL_RCC_PLLSOURCE_MSI | |||
* @arg @ref LL_RCC_PLLSOURCE_HSI | |||
* @arg @ref LL_RCC_PLLSOURCE_HSE | |||
*/ | |||
__STATIC_INLINE uint32_t LL_RCC_PLL_GetMainSource(void) | |||
{ | |||
return (uint32_t)(READ_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC)); | |||
} | |||
/** | |||
* @brief Clear PLL ready interrupt flag | |||
* @rmtoll CICR PLLRDYC LL_RCC_ClearFlag_PLLRDY | |||
@@ -3767,6 +3930,7 @@ __STATIC_INLINE void LL_RCC_ClearFlag_HSI48RDY(void) | |||
SET_BIT(RCC->CICR, RCC_CICR_HSI48RDYC); | |||
} | |||
#if defined(SAI1) | |||
/** | |||
* @brief Clear PLLSAI1 ready interrupt flag | |||
* @rmtoll CICR PLLSAI1RDYC LL_RCC_ClearFlag_PLLSAI1RDY | |||
@@ -3776,6 +3940,7 @@ __STATIC_INLINE void LL_RCC_ClearFlag_PLLSAI1RDY(void) | |||
{ | |||
SET_BIT(RCC->CICR, RCC_CICR_PLLSAI1RDYC); | |||
} | |||
#endif | |||
/** | |||
* @brief Clear Clock security system interrupt flag | |||
@@ -3877,6 +4042,7 @@ __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_HSI48RDY(void) | |||
return ((READ_BIT(RCC->CIFR, RCC_CIFR_HSI48RDYF) == (RCC_CIFR_HSI48RDYF)) ? 1UL : 0UL); | |||
} | |||
#if defined(SAI1) | |||
/** | |||
* @brief Check if PLLSAI1 ready interrupt occurred or not | |||
* @rmtoll CIFR PLLSAI1RDYF LL_RCC_IsActiveFlag_PLLSAI1RDY | |||
@@ -3886,6 +4052,7 @@ __STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_PLLSAI1RDY(void) | |||
{ | |||
return ((READ_BIT(RCC->CIFR, RCC_CIFR_PLLSAI1RDYF) == (RCC_CIFR_PLLSAI1RDYF)) ? 1UL : 0UL); | |||
} | |||
#endif | |||
/** | |||
* @brief Check if Clock security system interrupt occurred or not | |||
@@ -4125,6 +4292,7 @@ __STATIC_INLINE void LL_RCC_EnableIT_HSI48RDY(void) | |||
SET_BIT(RCC->CIER, RCC_CIER_HSI48RDYIE); | |||
} | |||
#if defined(SAI1) | |||
/** | |||
* @brief Enable PLLSAI1 ready interrupt | |||
* @rmtoll CIER PLLSAI1RDYIE LL_RCC_EnableIT_PLLSAI1RDY | |||
@@ -4134,6 +4302,7 @@ __STATIC_INLINE void LL_RCC_EnableIT_PLLSAI1RDY(void) | |||
{ | |||
SET_BIT(RCC->CIER, RCC_CIER_PLLSAI1RDYIE); | |||
} | |||
#endif | |||
/** | |||
* @brief Enable LSE clock security system interrupt | |||
@@ -4224,6 +4393,7 @@ __STATIC_INLINE void LL_RCC_DisableIT_HSI48RDY(void) | |||
CLEAR_BIT(RCC->CIER, RCC_CIER_HSI48RDYIE); | |||
} | |||
#if defined(SAI1) | |||
/** | |||
* @brief Disable PLLSAI1 ready interrupt | |||
* @rmtoll CIER PLLSAI1RDYIE LL_RCC_DisableIT_PLLSAI1RDY | |||
@@ -4233,6 +4403,7 @@ __STATIC_INLINE void LL_RCC_DisableIT_PLLSAI1RDY(void) | |||
{ | |||
CLEAR_BIT(RCC->CIER, RCC_CIER_PLLSAI1RDYIE); | |||
} | |||
#endif | |||
/** | |||
* @brief Disable LSE clock security system interrupt | |||
@@ -4323,6 +4494,7 @@ __STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_HSI48RDY(void) | |||
return ((READ_BIT(RCC->CIER, RCC_CIER_HSI48RDYIE) == (RCC_CIER_HSI48RDYIE)) ? 1UL : 0UL); | |||
} | |||
#if defined(SAI1) | |||
/** | |||
* @brief Checks if PLLSAI1 ready interrupt source is enabled or disabled. | |||
* @rmtoll CIER PLLSAI1RDYIE LL_RCC_IsEnabledIT_PLLSAI1RDY | |||
@@ -4332,6 +4504,7 @@ __STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_PLLSAI1RDY(void) | |||
{ | |||
return ((READ_BIT(RCC->CIER, RCC_CIER_PLLSAI1RDYIE) == (RCC_CIER_PLLSAI1RDYIE)) ? 1UL : 0UL); | |||
} | |||
#endif | |||
/** | |||
* @brief Checks if LSECSS interrupt source is enabled or disabled. | |||
@@ -4360,18 +4533,29 @@ ErrorStatus LL_RCC_DeInit(void); | |||
* @{ | |||
*/ | |||
void LL_RCC_GetSystemClocksFreq(LL_RCC_ClocksTypeDef *RCC_Clocks); | |||
#if defined(RCC_SMPS_SUPPORT) | |||
uint32_t LL_RCC_GetSMPSClockFreq(void); | |||
#endif | |||
uint32_t LL_RCC_GetUSARTClockFreq(uint32_t USARTxSource); | |||
uint32_t LL_RCC_GetI2CClockFreq(uint32_t I2CxSource); | |||
#if defined(LPUART1) | |||
uint32_t LL_RCC_GetLPUARTClockFreq(uint32_t LPUARTxSource); | |||
#endif | |||
uint32_t LL_RCC_GetLPTIMClockFreq(uint32_t LPTIMxSource); | |||
#if defined(SAI1) | |||
uint32_t LL_RCC_GetSAIClockFreq(uint32_t SAIxSource); | |||
#endif | |||
uint32_t LL_RCC_GetCLK48ClockFreq(uint32_t CLK48xSource); | |||
uint32_t LL_RCC_GetRNGClockFreq(uint32_t RNGxSource); | |||
#if defined(USB) | |||
uint32_t LL_RCC_GetUSBClockFreq(uint32_t USBxSource); | |||
#endif | |||
uint32_t LL_RCC_GetADCClockFreq(uint32_t ADCxSource); | |||
uint32_t LL_RCC_GetRTCClockFreq(void); | |||
uint32_t LL_RCC_GetRFWKPClockFreq(void); | |||
#if defined(SPI_I2S_SUPPORT) | |||
uint32_t LL_RCC_GetI2SClockFreq(uint32_t I2SxSource); | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
@@ -234,9 +234,15 @@ typedef struct | |||
*/ | |||
#define LL_RTC_ISR_ITSF RTC_ISR_ITSF | |||
#define LL_RTC_ISR_RECALPF RTC_ISR_RECALPF | |||
#if defined(RTC_TAMPER3_SUPPORT) | |||
#define LL_RTC_ISR_TAMP3F RTC_ISR_TAMP3F | |||
#endif | |||
#if defined(RTC_TAMPER2_SUPPORT) | |||
#define LL_RTC_ISR_TAMP2F RTC_ISR_TAMP2F | |||
#endif | |||
#if defined(RTC_TAMPER1_SUPPORT) | |||
#define LL_RTC_ISR_TAMP1F RTC_ISR_TAMP1F | |||
#endif | |||
#define LL_RTC_ISR_TSOVF RTC_ISR_TSOVF | |||
#define LL_RTC_ISR_TSF RTC_ISR_TSF | |||
#define LL_RTC_ISR_WUTF RTC_ISR_WUTF | |||
@@ -261,9 +267,15 @@ typedef struct | |||
#define LL_RTC_CR_WUTIE RTC_CR_WUTIE | |||
#define LL_RTC_CR_ALRBIE RTC_CR_ALRBIE | |||
#define LL_RTC_CR_ALRAIE RTC_CR_ALRAIE | |||
#if defined(RTC_TAMPER3_SUPPORT) | |||
#define LL_RTC_TAMPCR_TAMP3IE RTC_TAMPCR_TAMP3IE | |||
#endif | |||
#if defined(RTC_TAMPER2_SUPPORT) | |||
#define LL_RTC_TAMPCR_TAMP2IE RTC_TAMPCR_TAMP2IE | |||
#endif | |||
#if defined(RTC_TAMPER1_SUPPORT) | |||
#define LL_RTC_TAMPCR_TAMP1IE RTC_TAMPCR_TAMP1IE | |||
#endif | |||
#define LL_RTC_TAMPCR_TAMPIE RTC_TAMPCR_TAMPIE | |||
/** | |||
* @} | |||
@@ -427,7 +439,9 @@ typedef struct | |||
#define LL_RTC_TAMPER_1 RTC_TAMPCR_TAMP1E /*!< RTC_TAMP1 input detection */ | |||
#endif /* RTC_TAMPER1_SUPPORT */ | |||
#if defined(RTC_TAMPER2_SUPPORT) | |||
#if defined(RTC_TAMPER2_SUPPORT) | |||
#define LL_RTC_TAMPER_2 RTC_TAMPCR_TAMP2E /*!< RTC_TAMP2 input detection */ | |||
#endif | |||
#endif /* RTC_TAMPER2_SUPPORT */ | |||
#if defined(RTC_TAMPER3_SUPPORT) | |||
#define LL_RTC_TAMPER_3 RTC_TAMPCR_TAMP3E /*!< RTC_TAMP3 input detection */ | |||
@@ -2641,9 +2655,11 @@ __STATIC_INLINE void LL_RTC_TS_DisableOnTamper(RTC_TypeDef *RTCx) | |||
* TAMPCR TAMP3E LL_RTC_TAMPER_Enable | |||
* @param RTCx RTC Instance | |||
* @param Tamper This parameter can be a combination of the following values: | |||
* @arg @ref LL_RTC_TAMPER_1 | |||
* @arg @ref LL_RTC_TAMPER_1 (*) | |||
* @arg @ref LL_RTC_TAMPER_2 | |||
* @arg @ref LL_RTC_TAMPER_3 | |||
* @arg @ref LL_RTC_TAMPER_3 (*) | |||
* | |||
* (*) Value not defined in all devices. \n | |||
* | |||
* @retval None | |||
*/ | |||
@@ -2659,9 +2675,11 @@ __STATIC_INLINE void LL_RTC_TAMPER_Enable(RTC_TypeDef *RTCx, uint32_t Tamper) | |||
* TAMPCR TAMP3E LL_RTC_TAMPER_Disable | |||
* @param RTCx RTC Instance | |||
* @param Tamper This parameter can be a combination of the following values: | |||
* @arg @ref LL_RTC_TAMPER_1 | |||
* @arg @ref LL_RTC_TAMPER_1 (*) | |||
* @arg @ref LL_RTC_TAMPER_2 | |||
* @arg @ref LL_RTC_TAMPER_3 | |||
* @arg @ref LL_RTC_TAMPER_3 (*) | |||
* | |||
* (*) Value not defined in all devices. \n | |||
* | |||
* @retval None | |||
*/ | |||
@@ -2678,9 +2696,11 @@ __STATIC_INLINE void LL_RTC_TAMPER_Disable(RTC_TypeDef *RTCx, uint32_t Tamper) | |||
* TAMPCR TAMP3MF LL_RTC_TAMPER_EnableMask | |||
* @param RTCx RTC Instance | |||
* @param Mask This parameter can be a combination of the following values: | |||
* @arg @ref LL_RTC_TAMPER_MASK_TAMPER1 | |||
* @arg @ref LL_RTC_TAMPER_MASK_TAMPER1 (*) | |||
* @arg @ref LL_RTC_TAMPER_MASK_TAMPER2 | |||
* @arg @ref LL_RTC_TAMPER_MASK_TAMPER3 | |||
* @arg @ref LL_RTC_TAMPER_MASK_TAMPER3 (*) | |||
* | |||
* (*) Value not defined in all devices. \n | |||
* | |||
* @retval None | |||
*/ | |||
@@ -2696,9 +2716,11 @@ __STATIC_INLINE void LL_RTC_TAMPER_EnableMask(RTC_TypeDef *RTCx, uint32_t Mask) | |||
* TAMPCR TAMP3MF LL_RTC_TAMPER_DisableMask | |||
* @param RTCx RTC Instance | |||
* @param Mask This parameter can be a combination of the following values: | |||
* @arg @ref LL_RTC_TAMPER_MASK_TAMPER1 | |||
* @arg @ref LL_RTC_TAMPER_MASK_TAMPER1 (*) | |||
* @arg @ref LL_RTC_TAMPER_MASK_TAMPER2 | |||
* @arg @ref LL_RTC_TAMPER_MASK_TAMPER3 | |||
* @arg @ref LL_RTC_TAMPER_MASK_TAMPER3 (*) | |||
* | |||
* (*) Value not defined in all devices. \n | |||
* | |||
* @retval None | |||
*/ | |||
@@ -2714,9 +2736,11 @@ __STATIC_INLINE void LL_RTC_TAMPER_DisableMask(RTC_TypeDef *RTCx, uint32_t Mask) | |||
* TAMPCR TAMP3NOERASE LL_RTC_TAMPER_EnableEraseBKP | |||
* @param RTCx RTC Instance | |||
* @param Tamper This parameter can be a combination of the following values: | |||
* @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER1 | |||
* @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER1 (*) | |||
* @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER2 | |||
* @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER3 | |||
* @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER3 (*) | |||
* | |||
* (*) Value not defined in all devices. \n | |||
* | |||
* @retval None | |||
*/ | |||
@@ -2732,9 +2756,11 @@ __STATIC_INLINE void LL_RTC_TAMPER_EnableEraseBKP(RTC_TypeDef *RTCx, uint32_t Ta | |||
* TAMPCR TAMP3NOERASE LL_RTC_TAMPER_DisableEraseBKP | |||
* @param RTCx RTC Instance | |||
* @param Tamper This parameter can be a combination of the following values: | |||
* @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER1 | |||
* @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER1 (*) | |||
* @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER2 | |||
* @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER3 | |||
* @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER3 (*) | |||
* | |||
* (*) Value not defined in all devices. \n | |||
* | |||
* @retval None | |||
*/ | |||
@@ -1314,7 +1314,7 @@ __STATIC_INLINE uint32_t LL_SPI_GetDMAParity_TX(SPI_TypeDef *SPIx) | |||
*/ | |||
__STATIC_INLINE uint32_t LL_SPI_DMA_GetRegAddr(SPI_TypeDef *SPIx) | |||
{ | |||
return (uint32_t) & (SPIx->DR); | |||
return (uint32_t) &(SPIx->DR); | |||
} | |||
/** | |||
@@ -1361,7 +1361,7 @@ __STATIC_INLINE void LL_SPI_TransmitData8(SPI_TypeDef *SPIx, uint8_t TxData) | |||
*spidr = TxData; | |||
#else | |||
*((__IO uint8_t *)&SPIx->DR) = TxData; | |||
#endif | |||
#endif /* __GNUC__ */ | |||
} | |||
/** | |||
@@ -1378,7 +1378,7 @@ __STATIC_INLINE void LL_SPI_TransmitData16(SPI_TypeDef *SPIx, uint16_t TxData) | |||
*spidr = TxData; | |||
#else | |||
SPIx->DR = TxData; | |||
#endif | |||
#endif /* __GNUC__ */ | |||
} | |||
/** | |||
@@ -1405,6 +1405,872 @@ void LL_SPI_StructInit(LL_SPI_InitTypeDef *SPI_InitStruct); | |||
* @} | |||
*/ | |||
#if defined(SPI_I2S_SUPPORT) | |||
/** @defgroup I2S_LL I2S | |||
* @{ | |||
*/ | |||
/* Private variables ---------------------------------------------------------*/ | |||
/* Private constants ---------------------------------------------------------*/ | |||
/* Private macros ------------------------------------------------------------*/ | |||
/* Exported types ------------------------------------------------------------*/ | |||
#if defined(USE_FULL_LL_DRIVER) | |||
/** @defgroup I2S_LL_ES_INIT I2S Exported Init structure | |||
* @{ | |||
*/ | |||
/** | |||
* @brief I2S Init structure definition | |||
*/ | |||
typedef struct | |||
{ | |||
uint32_t Mode; /*!< Specifies the I2S operating mode. | |||
This parameter can be a value of @ref I2S_LL_EC_MODE | |||
This feature can be modified afterwards using unitary function @ref LL_I2S_SetTransferMode().*/ | |||
uint32_t Standard; /*!< Specifies the standard used for the I2S communication. | |||
This parameter can be a value of @ref I2S_LL_EC_STANDARD | |||
This feature can be modified afterwards using unitary function @ref LL_I2S_SetStandard().*/ | |||
uint32_t DataFormat; /*!< Specifies the data format for the I2S communication. | |||
This parameter can be a value of @ref I2S_LL_EC_DATA_FORMAT | |||
This feature can be modified afterwards using unitary function @ref LL_I2S_SetDataFormat().*/ | |||
uint32_t MCLKOutput; /*!< Specifies whether the I2S MCLK output is enabled or not. | |||
This parameter can be a value of @ref I2S_LL_EC_MCLK_OUTPUT | |||
This feature can be modified afterwards using unitary functions @ref LL_I2S_EnableMasterClock() or @ref LL_I2S_DisableMasterClock.*/ | |||
uint32_t AudioFreq; /*!< Specifies the frequency selected for the I2S communication. | |||
This parameter can be a value of @ref I2S_LL_EC_AUDIO_FREQ | |||
Audio Frequency can be modified afterwards using Reference manual formulas to calculate Prescaler Linear, Parity | |||
and unitary functions @ref LL_I2S_SetPrescalerLinear() and @ref LL_I2S_SetPrescalerParity() to set it.*/ | |||
uint32_t ClockPolarity; /*!< Specifies the idle state of the I2S clock. | |||
This parameter can be a value of @ref I2S_LL_EC_POLARITY | |||
This feature can be modified afterwards using unitary function @ref LL_I2S_SetClockPolarity().*/ | |||
} LL_I2S_InitTypeDef; | |||
/** | |||
* @} | |||
*/ | |||
#endif /*USE_FULL_LL_DRIVER*/ | |||
/* Exported constants --------------------------------------------------------*/ | |||
/** @defgroup I2S_LL_Exported_Constants I2S Exported Constants | |||
* @{ | |||
*/ | |||
/** @defgroup I2S_LL_EC_GET_FLAG Get Flags Defines | |||
* @brief Flags defines which can be used with LL_I2S_ReadReg function | |||
* @{ | |||
*/ | |||
#define LL_I2S_SR_RXNE LL_SPI_SR_RXNE /*!< Rx buffer not empty flag */ | |||
#define LL_I2S_SR_TXE LL_SPI_SR_TXE /*!< Tx buffer empty flag */ | |||
#define LL_I2S_SR_BSY LL_SPI_SR_BSY /*!< Busy flag */ | |||
#define LL_I2S_SR_UDR SPI_SR_UDR /*!< Underrun flag */ | |||
#define LL_I2S_SR_OVR LL_SPI_SR_OVR /*!< Overrun flag */ | |||
#define LL_I2S_SR_FRE LL_SPI_SR_FRE /*!< TI mode frame format error flag */ | |||
/** | |||
* @} | |||
*/ | |||
/** @defgroup SPI_LL_EC_IT IT Defines | |||
* @brief IT defines which can be used with LL_SPI_ReadReg and LL_SPI_WriteReg functions | |||
* @{ | |||
*/ | |||
#define LL_I2S_CR2_RXNEIE LL_SPI_CR2_RXNEIE /*!< Rx buffer not empty interrupt enable */ | |||
#define LL_I2S_CR2_TXEIE LL_SPI_CR2_TXEIE /*!< Tx buffer empty interrupt enable */ | |||
#define LL_I2S_CR2_ERRIE LL_SPI_CR2_ERRIE /*!< Error interrupt enable */ | |||
/** | |||
* @} | |||
*/ | |||
/** @defgroup I2S_LL_EC_DATA_FORMAT Data format | |||
* @{ | |||
*/ | |||
#define LL_I2S_DATAFORMAT_16B 0x00000000U /*!< Data length 16 bits, Channel lenght 16bit */ | |||
#define LL_I2S_DATAFORMAT_16B_EXTENDED (SPI_I2SCFGR_CHLEN) /*!< Data length 16 bits, Channel lenght 32bit */ | |||
#define LL_I2S_DATAFORMAT_24B (SPI_I2SCFGR_CHLEN | SPI_I2SCFGR_DATLEN_0) /*!< Data length 24 bits, Channel lenght 32bit */ | |||
#define LL_I2S_DATAFORMAT_32B (SPI_I2SCFGR_CHLEN | SPI_I2SCFGR_DATLEN_1) /*!< Data length 16 bits, Channel lenght 32bit */ | |||
/** | |||
* @} | |||
*/ | |||
/** @defgroup I2S_LL_EC_POLARITY Clock Polarity | |||
* @{ | |||
*/ | |||
#define LL_I2S_POLARITY_LOW 0x00000000U /*!< Clock steady state is low level */ | |||
#define LL_I2S_POLARITY_HIGH (SPI_I2SCFGR_CKPOL) /*!< Clock steady state is high level */ | |||
/** | |||
* @} | |||
*/ | |||
/** @defgroup I2S_LL_EC_STANDARD I2s Standard | |||
* @{ | |||
*/ | |||
#define LL_I2S_STANDARD_PHILIPS 0x00000000U /*!< I2S standard philips */ | |||
#define LL_I2S_STANDARD_MSB (SPI_I2SCFGR_I2SSTD_0) /*!< MSB justified standard (left justified) */ | |||
#define LL_I2S_STANDARD_LSB (SPI_I2SCFGR_I2SSTD_1) /*!< LSB justified standard (right justified) */ | |||
#define LL_I2S_STANDARD_PCM_SHORT (SPI_I2SCFGR_I2SSTD_0 | SPI_I2SCFGR_I2SSTD_1) /*!< PCM standard, short frame synchronization */ | |||
#define LL_I2S_STANDARD_PCM_LONG (SPI_I2SCFGR_I2SSTD_0 | SPI_I2SCFGR_I2SSTD_1 | SPI_I2SCFGR_PCMSYNC) /*!< PCM standard, long frame synchronization */ | |||
/** | |||
* @} | |||
*/ | |||
/** @defgroup I2S_LL_EC_MODE Operation Mode | |||
* @{ | |||
*/ | |||
#define LL_I2S_MODE_SLAVE_TX 0x00000000U /*!< Slave Tx configuration */ | |||
#define LL_I2S_MODE_SLAVE_RX (SPI_I2SCFGR_I2SCFG_0) /*!< Slave Rx configuration */ | |||
#define LL_I2S_MODE_MASTER_TX (SPI_I2SCFGR_I2SCFG_1) /*!< Master Tx configuration */ | |||
#define LL_I2S_MODE_MASTER_RX (SPI_I2SCFGR_I2SCFG_0 | SPI_I2SCFGR_I2SCFG_1) /*!< Master Rx configuration */ | |||
/** | |||
* @} | |||
*/ | |||
/** @defgroup I2S_LL_EC_PRESCALER_FACTOR Prescaler Factor | |||
* @{ | |||
*/ | |||
#define LL_I2S_PRESCALER_PARITY_EVEN 0x00000000U /*!< Odd factor: Real divider value is = I2SDIV * 2 */ | |||
#define LL_I2S_PRESCALER_PARITY_ODD (SPI_I2SPR_ODD >> 8U) /*!< Odd factor: Real divider value is = (I2SDIV * 2)+1 */ | |||
/** | |||
* @} | |||
*/ | |||
#if defined(USE_FULL_LL_DRIVER) | |||
/** @defgroup I2S_LL_EC_MCLK_OUTPUT MCLK Output | |||
* @{ | |||
*/ | |||
#define LL_I2S_MCLK_OUTPUT_DISABLE 0x00000000U /*!< Master clock output is disabled */ | |||
#define LL_I2S_MCLK_OUTPUT_ENABLE (SPI_I2SPR_MCKOE) /*!< Master clock output is enabled */ | |||
/** | |||
* @} | |||
*/ | |||
/** @defgroup I2S_LL_EC_AUDIO_FREQ Audio Frequency | |||
* @{ | |||
*/ | |||
#define LL_I2S_AUDIOFREQ_192K 192000U /*!< Audio Frequency configuration 192000 Hz */ | |||
#define LL_I2S_AUDIOFREQ_96K 96000U /*!< Audio Frequency configuration 96000 Hz */ | |||
#define LL_I2S_AUDIOFREQ_48K 48000U /*!< Audio Frequency configuration 48000 Hz */ | |||
#define LL_I2S_AUDIOFREQ_44K 44100U /*!< Audio Frequency configuration 44100 Hz */ | |||
#define LL_I2S_AUDIOFREQ_32K 32000U /*!< Audio Frequency configuration 32000 Hz */ | |||
#define LL_I2S_AUDIOFREQ_22K 22050U /*!< Audio Frequency configuration 22050 Hz */ | |||
#define LL_I2S_AUDIOFREQ_16K 16000U /*!< Audio Frequency configuration 16000 Hz */ | |||
#define LL_I2S_AUDIOFREQ_11K 11025U /*!< Audio Frequency configuration 11025 Hz */ | |||
#define LL_I2S_AUDIOFREQ_8K 8000U /*!< Audio Frequency configuration 8000 Hz */ | |||
#define LL_I2S_AUDIOFREQ_DEFAULT 2U /*!< Audio Freq not specified. Register I2SDIV = 2 */ | |||
/** | |||
* @} | |||
*/ | |||
#endif /* USE_FULL_LL_DRIVER */ | |||
/** | |||
* @} | |||
*/ | |||
/* Exported macro ------------------------------------------------------------*/ | |||
/** @defgroup I2S_LL_Exported_Macros I2S Exported Macros | |||
* @{ | |||
*/ | |||
/** @defgroup I2S_LL_EM_WRITE_READ Common Write and read registers Macros | |||
* @{ | |||
*/ | |||
/** | |||
* @brief Write a value in I2S register | |||
* @param __INSTANCE__ I2S Instance | |||
* @param __REG__ Register to be written | |||
* @param __VALUE__ Value to be written in the register | |||
* @retval None | |||
*/ | |||
#define LL_I2S_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__)) | |||
/** | |||
* @brief Read a value in I2S register | |||
* @param __INSTANCE__ I2S Instance | |||
* @param __REG__ Register to be read | |||
* @retval Register value | |||
*/ | |||
#define LL_I2S_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__) | |||
/** | |||
* @} | |||
*/ | |||
/** | |||
* @} | |||
*/ | |||
/* Exported functions --------------------------------------------------------*/ | |||
/** @defgroup I2S_LL_Exported_Functions I2S Exported Functions | |||
* @{ | |||
*/ | |||
/** @defgroup I2S_LL_EF_Configuration Configuration | |||
* @{ | |||
*/ | |||
/** | |||
* @brief Select I2S mode and Enable I2S peripheral | |||
* @rmtoll I2SCFGR I2SMOD LL_I2S_Enable\n | |||
* I2SCFGR I2SE LL_I2S_Enable | |||
* @param SPIx SPI Instance | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_Enable(SPI_TypeDef *SPIx) | |||
{ | |||
SET_BIT(SPIx->I2SCFGR, SPI_I2SCFGR_I2SMOD | SPI_I2SCFGR_I2SE); | |||
} | |||
/** | |||
* @brief Disable I2S peripheral | |||
* @rmtoll I2SCFGR I2SE LL_I2S_Disable | |||
* @param SPIx SPI Instance | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_Disable(SPI_TypeDef *SPIx) | |||
{ | |||
CLEAR_BIT(SPIx->I2SCFGR, SPI_I2SCFGR_I2SMOD | SPI_I2SCFGR_I2SE); | |||
} | |||
/** | |||
* @brief Check if I2S peripheral is enabled | |||
* @rmtoll I2SCFGR I2SE LL_I2S_IsEnabled | |||
* @param SPIx SPI Instance | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_I2S_IsEnabled(SPI_TypeDef *SPIx) | |||
{ | |||
return ((READ_BIT(SPIx->I2SCFGR, SPI_I2SCFGR_I2SE) == (SPI_I2SCFGR_I2SE)) ? 1UL : 0UL); | |||
} | |||
/** | |||
* @brief Set I2S data frame length | |||
* @rmtoll I2SCFGR DATLEN LL_I2S_SetDataFormat\n | |||
* I2SCFGR CHLEN LL_I2S_SetDataFormat | |||
* @param SPIx SPI Instance | |||
* @param DataFormat This parameter can be one of the following values: | |||
* @arg @ref LL_I2S_DATAFORMAT_16B | |||
* @arg @ref LL_I2S_DATAFORMAT_16B_EXTENDED | |||
* @arg @ref LL_I2S_DATAFORMAT_24B | |||
* @arg @ref LL_I2S_DATAFORMAT_32B | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_SetDataFormat(SPI_TypeDef *SPIx, uint32_t DataFormat) | |||
{ | |||
MODIFY_REG(SPIx->I2SCFGR, SPI_I2SCFGR_DATLEN | SPI_I2SCFGR_CHLEN, DataFormat); | |||
} | |||
/** | |||
* @brief Get I2S data frame length | |||
* @rmtoll I2SCFGR DATLEN LL_I2S_GetDataFormat\n | |||
* I2SCFGR CHLEN LL_I2S_GetDataFormat | |||
* @param SPIx SPI Instance | |||
* @retval Returned value can be one of the following values: | |||
* @arg @ref LL_I2S_DATAFORMAT_16B | |||
* @arg @ref LL_I2S_DATAFORMAT_16B_EXTENDED | |||
* @arg @ref LL_I2S_DATAFORMAT_24B | |||
* @arg @ref LL_I2S_DATAFORMAT_32B | |||
*/ | |||
__STATIC_INLINE uint32_t LL_I2S_GetDataFormat(SPI_TypeDef *SPIx) | |||
{ | |||
return (uint32_t)(READ_BIT(SPIx->I2SCFGR, SPI_I2SCFGR_DATLEN | SPI_I2SCFGR_CHLEN)); | |||
} | |||
/** | |||
* @brief Set I2S clock polarity | |||
* @rmtoll I2SCFGR CKPOL LL_I2S_SetClockPolarity | |||
* @param SPIx SPI Instance | |||
* @param ClockPolarity This parameter can be one of the following values: | |||
* @arg @ref LL_I2S_POLARITY_LOW | |||
* @arg @ref LL_I2S_POLARITY_HIGH | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_SetClockPolarity(SPI_TypeDef *SPIx, uint32_t ClockPolarity) | |||
{ | |||
SET_BIT(SPIx->I2SCFGR, ClockPolarity); | |||
} | |||
/** | |||
* @brief Get I2S clock polarity | |||
* @rmtoll I2SCFGR CKPOL LL_I2S_GetClockPolarity | |||
* @param SPIx SPI Instance | |||
* @retval Returned value can be one of the following values: | |||
* @arg @ref LL_I2S_POLARITY_LOW | |||
* @arg @ref LL_I2S_POLARITY_HIGH | |||
*/ | |||
__STATIC_INLINE uint32_t LL_I2S_GetClockPolarity(SPI_TypeDef *SPIx) | |||
{ | |||
return (uint32_t)(READ_BIT(SPIx->I2SCFGR, SPI_I2SCFGR_CKPOL)); | |||
} | |||
/** | |||
* @brief Set I2S standard protocol | |||
* @rmtoll I2SCFGR I2SSTD LL_I2S_SetStandard\n | |||
* I2SCFGR PCMSYNC LL_I2S_SetStandard | |||
* @param SPIx SPI Instance | |||
* @param Standard This parameter can be one of the following values: | |||
* @arg @ref LL_I2S_STANDARD_PHILIPS | |||
* @arg @ref LL_I2S_STANDARD_MSB | |||
* @arg @ref LL_I2S_STANDARD_LSB | |||
* @arg @ref LL_I2S_STANDARD_PCM_SHORT | |||
* @arg @ref LL_I2S_STANDARD_PCM_LONG | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_SetStandard(SPI_TypeDef *SPIx, uint32_t Standard) | |||
{ | |||
MODIFY_REG(SPIx->I2SCFGR, SPI_I2SCFGR_I2SSTD | SPI_I2SCFGR_PCMSYNC, Standard); | |||
} | |||
/** | |||
* @brief Get I2S standard protocol | |||
* @rmtoll I2SCFGR I2SSTD LL_I2S_GetStandard\n | |||
* I2SCFGR PCMSYNC LL_I2S_GetStandard | |||
* @param SPIx SPI Instance | |||
* @retval Returned value can be one of the following values: | |||
* @arg @ref LL_I2S_STANDARD_PHILIPS | |||
* @arg @ref LL_I2S_STANDARD_MSB | |||
* @arg @ref LL_I2S_STANDARD_LSB | |||
* @arg @ref LL_I2S_STANDARD_PCM_SHORT | |||
* @arg @ref LL_I2S_STANDARD_PCM_LONG | |||
*/ | |||
__STATIC_INLINE uint32_t LL_I2S_GetStandard(SPI_TypeDef *SPIx) | |||
{ | |||
return (uint32_t)(READ_BIT(SPIx->I2SCFGR, SPI_I2SCFGR_I2SSTD | SPI_I2SCFGR_PCMSYNC)); | |||
} | |||
/** | |||
* @brief Set I2S transfer mode | |||
* @rmtoll I2SCFGR I2SCFG LL_I2S_SetTransferMode | |||
* @param SPIx SPI Instance | |||
* @param Mode This parameter can be one of the following values: | |||
* @arg @ref LL_I2S_MODE_SLAVE_TX | |||
* @arg @ref LL_I2S_MODE_SLAVE_RX | |||
* @arg @ref LL_I2S_MODE_MASTER_TX | |||
* @arg @ref LL_I2S_MODE_MASTER_RX | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_SetTransferMode(SPI_TypeDef *SPIx, uint32_t Mode) | |||
{ | |||
MODIFY_REG(SPIx->I2SCFGR, SPI_I2SCFGR_I2SCFG, Mode); | |||
} | |||
/** | |||
* @brief Get I2S transfer mode | |||
* @rmtoll I2SCFGR I2SCFG LL_I2S_GetTransferMode | |||
* @param SPIx SPI Instance | |||
* @retval Returned value can be one of the following values: | |||
* @arg @ref LL_I2S_MODE_SLAVE_TX | |||
* @arg @ref LL_I2S_MODE_SLAVE_RX | |||
* @arg @ref LL_I2S_MODE_MASTER_TX | |||
* @arg @ref LL_I2S_MODE_MASTER_RX | |||
*/ | |||
__STATIC_INLINE uint32_t LL_I2S_GetTransferMode(SPI_TypeDef *SPIx) | |||
{ | |||
return (uint32_t)(READ_BIT(SPIx->I2SCFGR, SPI_I2SCFGR_I2SCFG)); | |||
} | |||
/** | |||
* @brief Set I2S linear prescaler | |||
* @rmtoll I2SPR I2SDIV LL_I2S_SetPrescalerLinear | |||
* @param SPIx SPI Instance | |||
* @param PrescalerLinear Value between Min_Data=0x02 and Max_Data=0xFF | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_SetPrescalerLinear(SPI_TypeDef *SPIx, uint8_t PrescalerLinear) | |||
{ | |||
MODIFY_REG(SPIx->I2SPR, SPI_I2SPR_I2SDIV, PrescalerLinear); | |||
} | |||
/** | |||
* @brief Get I2S linear prescaler | |||
* @rmtoll I2SPR I2SDIV LL_I2S_GetPrescalerLinear | |||
* @param SPIx SPI Instance | |||
* @retval PrescalerLinear Value between Min_Data=0x02 and Max_Data=0xFF | |||
*/ | |||
__STATIC_INLINE uint32_t LL_I2S_GetPrescalerLinear(SPI_TypeDef *SPIx) | |||
{ | |||
return (uint32_t)(READ_BIT(SPIx->I2SPR, SPI_I2SPR_I2SDIV)); | |||
} | |||
/** | |||
* @brief Set I2S parity prescaler | |||
* @rmtoll I2SPR ODD LL_I2S_SetPrescalerParity | |||
* @param SPIx SPI Instance | |||
* @param PrescalerParity This parameter can be one of the following values: | |||
* @arg @ref LL_I2S_PRESCALER_PARITY_EVEN | |||
* @arg @ref LL_I2S_PRESCALER_PARITY_ODD | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_SetPrescalerParity(SPI_TypeDef *SPIx, uint32_t PrescalerParity) | |||
{ | |||
MODIFY_REG(SPIx->I2SPR, SPI_I2SPR_ODD, PrescalerParity << 8U); | |||
} | |||
/** | |||
* @brief Get I2S parity prescaler | |||
* @rmtoll I2SPR ODD LL_I2S_GetPrescalerParity | |||
* @param SPIx SPI Instance | |||
* @retval Returned value can be one of the following values: | |||
* @arg @ref LL_I2S_PRESCALER_PARITY_EVEN | |||
* @arg @ref LL_I2S_PRESCALER_PARITY_ODD | |||
*/ | |||
__STATIC_INLINE uint32_t LL_I2S_GetPrescalerParity(SPI_TypeDef *SPIx) | |||
{ | |||
return (uint32_t)(READ_BIT(SPIx->I2SPR, SPI_I2SPR_ODD) >> 8U); | |||
} | |||
/** | |||
* @brief Enable the master clock ouput (Pin MCK) | |||
* @rmtoll I2SPR MCKOE LL_I2S_EnableMasterClock | |||
* @param SPIx SPI Instance | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_EnableMasterClock(SPI_TypeDef *SPIx) | |||
{ | |||
SET_BIT(SPIx->I2SPR, SPI_I2SPR_MCKOE); | |||
} | |||
/** | |||
* @brief Disable the master clock ouput (Pin MCK) | |||
* @rmtoll I2SPR MCKOE LL_I2S_DisableMasterClock | |||
* @param SPIx SPI Instance | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_DisableMasterClock(SPI_TypeDef *SPIx) | |||
{ | |||
CLEAR_BIT(SPIx->I2SPR, SPI_I2SPR_MCKOE); | |||
} | |||
/** | |||
* @brief Check if the master clock ouput (Pin MCK) is enabled | |||
* @rmtoll I2SPR MCKOE LL_I2S_IsEnabledMasterClock | |||
* @param SPIx SPI Instance | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_I2S_IsEnabledMasterClock(SPI_TypeDef *SPIx) | |||
{ | |||
return ((READ_BIT(SPIx->I2SPR, SPI_I2SPR_MCKOE) == (SPI_I2SPR_MCKOE)) ? 1UL : 0UL); | |||
} | |||
#if defined(SPI_I2SCFGR_ASTRTEN) | |||
/** | |||
* @brief Enable asynchronous start | |||
* @rmtoll I2SCFGR ASTRTEN LL_I2S_EnableAsyncStart | |||
* @param SPIx SPI Instance | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_EnableAsyncStart(SPI_TypeDef *SPIx) | |||
{ | |||
SET_BIT(SPIx->I2SCFGR, SPI_I2SCFGR_ASTRTEN); | |||
} | |||
/** | |||
* @brief Disable asynchronous start | |||
* @rmtoll I2SCFGR ASTRTEN LL_I2S_DisableAsyncStart | |||
* @param SPIx SPI Instance | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_DisableAsyncStart(SPI_TypeDef *SPIx) | |||
{ | |||
CLEAR_BIT(SPIx->I2SCFGR, SPI_I2SCFGR_ASTRTEN); | |||
} | |||
/** | |||
* @brief Check if asynchronous start is enabled | |||
* @rmtoll I2SCFGR ASTRTEN LL_I2S_IsEnabledAsyncStart | |||
* @param SPIx SPI Instance | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_I2S_IsEnabledAsyncStart(SPI_TypeDef *SPIx) | |||
{ | |||
return ((READ_BIT(SPIx->I2SCFGR, SPI_I2SCFGR_ASTRTEN) == (SPI_I2SCFGR_ASTRTEN)) ? 1UL : 0UL); | |||
} | |||
#endif /* SPI_I2SCFGR_ASTRTEN */ | |||
/** | |||
* @} | |||
*/ | |||
/** @defgroup I2S_LL_EF_FLAG FLAG Management | |||
* @{ | |||
*/ | |||
/** | |||
* @brief Check if Rx buffer is not empty | |||
* @rmtoll SR RXNE LL_I2S_IsActiveFlag_RXNE | |||
* @param SPIx SPI Instance | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_I2S_IsActiveFlag_RXNE(SPI_TypeDef *SPIx) | |||
{ | |||
return LL_SPI_IsActiveFlag_RXNE(SPIx); | |||
} | |||
/** | |||
* @brief Check if Tx buffer is empty | |||
* @rmtoll SR TXE LL_I2S_IsActiveFlag_TXE | |||
* @param SPIx SPI Instance | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_I2S_IsActiveFlag_TXE(SPI_TypeDef *SPIx) | |||
{ | |||
return LL_SPI_IsActiveFlag_TXE(SPIx); | |||
} | |||
/** | |||
* @brief Get busy flag | |||
* @rmtoll SR BSY LL_I2S_IsActiveFlag_BSY | |||
* @param SPIx SPI Instance | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_I2S_IsActiveFlag_BSY(SPI_TypeDef *SPIx) | |||
{ | |||
return LL_SPI_IsActiveFlag_BSY(SPIx); | |||
} | |||
/** | |||
* @brief Get overrun error flag | |||
* @rmtoll SR OVR LL_I2S_IsActiveFlag_OVR | |||
* @param SPIx SPI Instance | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_I2S_IsActiveFlag_OVR(SPI_TypeDef *SPIx) | |||
{ | |||
return LL_SPI_IsActiveFlag_OVR(SPIx); | |||
} | |||
/** | |||
* @brief Get underrun error flag | |||
* @rmtoll SR UDR LL_I2S_IsActiveFlag_UDR | |||
* @param SPIx SPI Instance | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_I2S_IsActiveFlag_UDR(SPI_TypeDef *SPIx) | |||
{ | |||
return ((READ_BIT(SPIx->SR, SPI_SR_UDR) == (SPI_SR_UDR)) ? 1UL : 0UL); | |||
} | |||
/** | |||
* @brief Get frame format error flag | |||
* @rmtoll SR FRE LL_I2S_IsActiveFlag_FRE | |||
* @param SPIx SPI Instance | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_I2S_IsActiveFlag_FRE(SPI_TypeDef *SPIx) | |||
{ | |||
return LL_SPI_IsActiveFlag_FRE(SPIx); | |||
} | |||
/** | |||
* @brief Get channel side flag. | |||
* @note 0: Channel Left has to be transmitted or has been received\n | |||
* 1: Channel Right has to be transmitted or has been received\n | |||
* It has no significance in PCM mode. | |||
* @rmtoll SR CHSIDE LL_I2S_IsActiveFlag_CHSIDE | |||
* @param SPIx SPI Instance | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_I2S_IsActiveFlag_CHSIDE(SPI_TypeDef *SPIx) | |||
{ | |||
return ((READ_BIT(SPIx->SR, SPI_SR_CHSIDE) == (SPI_SR_CHSIDE)) ? 1UL : 0UL); | |||
} | |||
/** | |||
* @brief Clear overrun error flag | |||
* @rmtoll SR OVR LL_I2S_ClearFlag_OVR | |||
* @param SPIx SPI Instance | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_ClearFlag_OVR(SPI_TypeDef *SPIx) | |||
{ | |||
LL_SPI_ClearFlag_OVR(SPIx); | |||
} | |||
/** | |||
* @brief Clear underrun error flag | |||
* @rmtoll SR UDR LL_I2S_ClearFlag_UDR | |||
* @param SPIx SPI Instance | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_ClearFlag_UDR(SPI_TypeDef *SPIx) | |||
{ | |||
__IO uint32_t tmpreg; | |||
tmpreg = SPIx->SR; | |||
(void)tmpreg; | |||
} | |||
/** | |||
* @brief Clear frame format error flag | |||
* @rmtoll SR FRE LL_I2S_ClearFlag_FRE | |||
* @param SPIx SPI Instance | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_ClearFlag_FRE(SPI_TypeDef *SPIx) | |||
{ | |||
LL_SPI_ClearFlag_FRE(SPIx); | |||
} | |||
/** | |||
* @} | |||
*/ | |||
/** @defgroup I2S_LL_EF_IT Interrupt Management | |||
* @{ | |||
*/ | |||
/** | |||
* @brief Enable error IT | |||
* @note This bit controls the generation of an interrupt when an error condition occurs (OVR, UDR and FRE in I2S mode). | |||
* @rmtoll CR2 ERRIE LL_I2S_EnableIT_ERR | |||
* @param SPIx SPI Instance | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_EnableIT_ERR(SPI_TypeDef *SPIx) | |||
{ | |||
LL_SPI_EnableIT_ERR(SPIx); | |||
} | |||
/** | |||
* @brief Enable Rx buffer not empty IT | |||
* @rmtoll CR2 RXNEIE LL_I2S_EnableIT_RXNE | |||
* @param SPIx SPI Instance | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_EnableIT_RXNE(SPI_TypeDef *SPIx) | |||
{ | |||
LL_SPI_EnableIT_RXNE(SPIx); | |||
} | |||
/** | |||
* @brief Enable Tx buffer empty IT | |||
* @rmtoll CR2 TXEIE LL_I2S_EnableIT_TXE | |||
* @param SPIx SPI Instance | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_EnableIT_TXE(SPI_TypeDef *SPIx) | |||
{ | |||
LL_SPI_EnableIT_TXE(SPIx); | |||
} | |||
/** | |||
* @brief Disable error IT | |||
* @note This bit controls the generation of an interrupt when an error condition occurs (OVR, UDR and FRE in I2S mode). | |||
* @rmtoll CR2 ERRIE LL_I2S_DisableIT_ERR | |||
* @param SPIx SPI Instance | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_DisableIT_ERR(SPI_TypeDef *SPIx) | |||
{ | |||
LL_SPI_DisableIT_ERR(SPIx); | |||
} | |||
/** | |||
* @brief Disable Rx buffer not empty IT | |||
* @rmtoll CR2 RXNEIE LL_I2S_DisableIT_RXNE | |||
* @param SPIx SPI Instance | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_DisableIT_RXNE(SPI_TypeDef *SPIx) | |||
{ | |||
LL_SPI_DisableIT_RXNE(SPIx); | |||
} | |||
/** | |||
* @brief Disable Tx buffer empty IT | |||
* @rmtoll CR2 TXEIE LL_I2S_DisableIT_TXE | |||
* @param SPIx SPI Instance | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_DisableIT_TXE(SPI_TypeDef *SPIx) | |||
{ | |||
LL_SPI_DisableIT_TXE(SPIx); | |||
} | |||
/** | |||
* @brief Check if ERR IT is enabled | |||
* @rmtoll CR2 ERRIE LL_I2S_IsEnabledIT_ERR | |||
* @param SPIx SPI Instance | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_I2S_IsEnabledIT_ERR(SPI_TypeDef *SPIx) | |||
{ | |||
return LL_SPI_IsEnabledIT_ERR(SPIx); | |||
} | |||
/** | |||
* @brief Check if RXNE IT is enabled | |||
* @rmtoll CR2 RXNEIE LL_I2S_IsEnabledIT_RXNE | |||
* @param SPIx SPI Instance | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_I2S_IsEnabledIT_RXNE(SPI_TypeDef *SPIx) | |||
{ | |||
return LL_SPI_IsEnabledIT_RXNE(SPIx); | |||
} | |||
/** | |||
* @brief Check if TXE IT is enabled | |||
* @rmtoll CR2 TXEIE LL_I2S_IsEnabledIT_TXE | |||
* @param SPIx SPI Instance | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_I2S_IsEnabledIT_TXE(SPI_TypeDef *SPIx) | |||
{ | |||
return LL_SPI_IsEnabledIT_TXE(SPIx); | |||
} | |||
/** | |||
* @} | |||
*/ | |||
/** @defgroup I2S_LL_EF_DMA DMA Management | |||
* @{ | |||
*/ | |||
/** | |||
* @brief Enable DMA Rx | |||
* @rmtoll CR2 RXDMAEN LL_I2S_EnableDMAReq_RX | |||
* @param SPIx SPI Instance | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_EnableDMAReq_RX(SPI_TypeDef *SPIx) | |||
{ | |||
LL_SPI_EnableDMAReq_RX(SPIx); | |||
} | |||
/** | |||
* @brief Disable DMA Rx | |||
* @rmtoll CR2 RXDMAEN LL_I2S_DisableDMAReq_RX | |||
* @param SPIx SPI Instance | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_DisableDMAReq_RX(SPI_TypeDef *SPIx) | |||
{ | |||
LL_SPI_DisableDMAReq_RX(SPIx); | |||
} | |||
/** | |||
* @brief Check if DMA Rx is enabled | |||
* @rmtoll CR2 RXDMAEN LL_I2S_IsEnabledDMAReq_RX | |||
* @param SPIx SPI Instance | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_I2S_IsEnabledDMAReq_RX(SPI_TypeDef *SPIx) | |||
{ | |||
return LL_SPI_IsEnabledDMAReq_RX(SPIx); | |||
} | |||
/** | |||
* @brief Enable DMA Tx | |||
* @rmtoll CR2 TXDMAEN LL_I2S_EnableDMAReq_TX | |||
* @param SPIx SPI Instance | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_EnableDMAReq_TX(SPI_TypeDef *SPIx) | |||
{ | |||
LL_SPI_EnableDMAReq_TX(SPIx); | |||
} | |||
/** | |||
* @brief Disable DMA Tx | |||
* @rmtoll CR2 TXDMAEN LL_I2S_DisableDMAReq_TX | |||
* @param SPIx SPI Instance | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_DisableDMAReq_TX(SPI_TypeDef *SPIx) | |||
{ | |||
LL_SPI_DisableDMAReq_TX(SPIx); | |||
} | |||
/** | |||
* @brief Check if DMA Tx is enabled | |||
* @rmtoll CR2 TXDMAEN LL_I2S_IsEnabledDMAReq_TX | |||
* @param SPIx SPI Instance | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_I2S_IsEnabledDMAReq_TX(SPI_TypeDef *SPIx) | |||
{ | |||
return LL_SPI_IsEnabledDMAReq_TX(SPIx); | |||
} | |||
/** | |||
* @} | |||
*/ | |||
/** @defgroup I2S_LL_EF_DATA DATA Management | |||
* @{ | |||
*/ | |||
/** | |||
* @brief Read 16-Bits in data register | |||
* @rmtoll DR DR LL_I2S_ReceiveData16 | |||
* @param SPIx SPI Instance | |||
* @retval RxData Value between Min_Data=0x0000 and Max_Data=0xFFFF | |||
*/ | |||
__STATIC_INLINE uint16_t LL_I2S_ReceiveData16(SPI_TypeDef *SPIx) | |||
{ | |||
return LL_SPI_ReceiveData16(SPIx); | |||
} | |||
/** | |||
* @brief Write 16-Bits in data register | |||
* @rmtoll DR DR LL_I2S_TransmitData16 | |||
* @param SPIx SPI Instance | |||
* @param TxData Value between Min_Data=0x0000 and Max_Data=0xFFFF | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_I2S_TransmitData16(SPI_TypeDef *SPIx, uint16_t TxData) | |||
{ | |||
LL_SPI_TransmitData16(SPIx, TxData); | |||
} | |||
/** | |||
* @} | |||
*/ | |||
#if defined(USE_FULL_LL_DRIVER) | |||
/** @defgroup I2S_LL_EF_Init Initialization and de-initialization functions | |||
* @{ | |||
*/ | |||
ErrorStatus LL_I2S_DeInit(SPI_TypeDef *SPIx); | |||
ErrorStatus LL_I2S_Init(SPI_TypeDef *SPIx, LL_I2S_InitTypeDef *I2S_InitStruct); | |||
void LL_I2S_StructInit(LL_I2S_InitTypeDef *I2S_InitStruct); | |||
void LL_I2S_ConfigPrescaler(SPI_TypeDef *SPIx, uint32_t PrescalerLinear, uint32_t PrescalerParity); | |||
/** | |||
* @} | |||
*/ | |||
#endif /* USE_FULL_LL_DRIVER */ | |||
/** | |||
* @} | |||
*/ | |||
/** | |||
* @} | |||
*/ | |||
#endif /* SPI_I2S_SUPPORT */ | |||
#endif /* defined (SPI1) || defined (SPI2) */ | |||
/** | |||
@@ -58,6 +58,16 @@ extern "C" { | |||
/** @defgroup SYSTEM_LL_Private_Constants SYSTEM Private Constants | |||
* @{ | |||
*/ | |||
/** | |||
* @brief VREFBUF VREF_SC0 & VREF_SC1 calibration values | |||
*/ | |||
#define VREFBUF_SC0_CAL_ADDR ((uint8_t*) (0x1FFF75F0UL)) /*!< Address of VREFBUF trimming value for VRS=0, | |||
VREF_SC0 in STM32WB datasheet */ | |||
#define VREFBUF_SC1_CAL_ADDR ((uint8_t*) (0x1FFF7530UL)) /*!< Address of VREFBUF trimming value for VRS=1, | |||
VREF_SC1 in STM32WB datasheet */ | |||
/** | |||
* @} | |||
*/ | |||
/** | |||
* @} | |||
@@ -77,7 +87,9 @@ extern "C" { | |||
#define LL_SYSCFG_REMAP_FLASH 0x00000000U /*!< Main Flash memory mapped at 0x00000000 */ | |||
#define LL_SYSCFG_REMAP_SYSTEMFLASH SYSCFG_MEMRMP_MEM_MODE_0 /*!< System Flash memory mapped at 0x00000000 */ | |||
#define LL_SYSCFG_REMAP_SRAM (SYSCFG_MEMRMP_MEM_MODE_1 | SYSCFG_MEMRMP_MEM_MODE_0) /*!< SRAM1 mapped at 0x00000000 */ | |||
#if defined(QUADSPI) | |||
#define LL_SYSCFG_REMAP_QUADSPI (SYSCFG_MEMRMP_MEM_MODE_2 | SYSCFG_MEMRMP_MEM_MODE_1) /*!< QUADSPI memory mapped at 0x00000000 */ | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
@@ -90,7 +102,9 @@ extern "C" { | |||
#define LL_SYSCFG_I2C_FASTMODEPLUS_PB8 SYSCFG_CFGR1_I2C_PB8_FMP /*!< Enable Fast Mode Plus on PB8 */ | |||
#define LL_SYSCFG_I2C_FASTMODEPLUS_PB9 SYSCFG_CFGR1_I2C_PB9_FMP /*!< Enable Fast Mode Plus on PB9 */ | |||
#define LL_SYSCFG_I2C_FASTMODEPLUS_I2C1 SYSCFG_CFGR1_I2C1_FMP /*!< Enable Fast Mode Plus on I2C1 pins */ | |||
#if defined(I2C3) | |||
#define LL_SYSCFG_I2C_FASTMODEPLUS_I2C3 SYSCFG_CFGR1_I2C3_FMP /*!< Enable Fast Mode Plus on I2C3 pins */ | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
@@ -238,7 +252,9 @@ extern "C" { | |||
#define LL_SYSCFG_GRP1_EXTI14 SYSCFG_IMR1_EXTI14IM /*!< Enabling of interrupt from External Interrupt Line 14 to CPU1 */ | |||
#define LL_SYSCFG_GRP1_EXTI15 SYSCFG_IMR1_EXTI15IM /*!< Enabling of interrupt from External Interrupt Line 15 to CPU1 */ | |||
#if defined(SYSCFG_IMR2_PVM1IM) | |||
#define LL_SYSCFG_GRP2_PVM1 SYSCFG_IMR2_PVM1IM /*!< Enabling of interrupt from Power Voltage Monitoring 1 to CPU1 */ | |||
#endif | |||
#define LL_SYSCFG_GRP2_PVM3 SYSCFG_IMR2_PVM3IM /*!< Enabling of interrupt from Power Voltage Monitoring 3 to CPU1 */ | |||
#define LL_SYSCFG_GRP2_PVD SYSCFG_IMR2_PVDIM /*!< Enabling of interrupt from Power Voltage Detector to CPU1 */ | |||
/** | |||
@@ -256,8 +272,12 @@ extern "C" { | |||
#define LL_C2_SYSCFG_GRP1_FLASH SYSCFG_C2IMR1_FLASHIM /*!< Enabling of interrupt from FLASH to CPU2 */ | |||
#define LL_C2_SYSCFG_GRP1_PKA SYSCFG_C2IMR1_PKAIM /*!< Enabling of interrupt from Public Key Accelerator to CPU2 */ | |||
#define LL_C2_SYSCFG_GRP1_RNG SYSCFG_C2IMR1_RNGIM /*!< Enabling of interrupt from Random Number Generator to CPU2 */ | |||
#if defined(AES1) | |||
#define LL_C2_SYSCFG_GRP1_AES1 SYSCFG_C2IMR1_AES1IM /*!< Enabling of interrupt from Advanced Encryption Standard 1 to CPU2 */ | |||
#endif | |||
#if defined(COMP1) | |||
#define LL_C2_SYSCFG_GRP1_COMP SYSCFG_C2IMR1_COMPIM /*!< Enabling of interrupt from Comparator to CPU2 */ | |||
#endif | |||
#define LL_C2_SYSCFG_GRP1_ADC SYSCFG_C2IMR1_ADCIM /*!< Enabling of interrupt from Analog Digital Converter to CPU2 */ | |||
#define LL_C2_SYSCFG_GRP1_EXTI0 SYSCFG_C2IMR1_EXTI0IM /*!< Enabling of interrupt from External Interrupt Line 0 to CPU2 */ | |||
@@ -285,6 +305,7 @@ extern "C" { | |||
#define LL_C2_SYSCFG_GRP2_DMA1CH6 SYSCFG_C2IMR2_DMA1CH6IM /*!< Enabling of interrupt from DMA1 Channel 6 to CPU2 */ | |||
#define LL_C2_SYSCFG_GRP2_DMA1CH7 SYSCFG_C2IMR2_DMA1CH7IM /*!< Enabling of interrupt from DMA1 Channel 7 to CPU2 */ | |||
#if defined(DMA2) | |||
#define LL_C2_SYSCFG_GRP2_DMA2CH1 SYSCFG_C2IMR2_DMA2CH1IM /*!< Enabling of interrupt from DMA2 Channel 1 to CPU2 */ | |||
#define LL_C2_SYSCFG_GRP2_DMA2CH2 SYSCFG_C2IMR2_DMA2CH2IM /*!< Enabling of interrupt from DMA2 Channel 2 to CPU2 */ | |||
#define LL_C2_SYSCFG_GRP2_DMA2CH3 SYSCFG_C2IMR2_DMA2CH3IM /*!< Enabling of interrupt from DMA2 Channel 3 to CPU2 */ | |||
@@ -292,13 +313,18 @@ extern "C" { | |||
#define LL_C2_SYSCFG_GRP2_DMA2CH5 SYSCFG_C2IMR2_DMA2CH5IM /*!< Enabling of interrupt from DMA2 Channel 5 to CPU2 */ | |||
#define LL_C2_SYSCFG_GRP2_DMA2CH6 SYSCFG_C2IMR2_DMA2CH6IM /*!< Enabling of interrupt from DMA2 Channel 6 to CPU2 */ | |||
#define LL_C2_SYSCFG_GRP2_DMA2CH7 SYSCFG_C2IMR2_DMA2CH7IM /*!< Enabling of interrupt from DMA2 Channel 7 to CPU2 */ | |||
#endif | |||
#define LL_C2_SYSCFG_GRP2_DMAMUX1 SYSCFG_C2IMR2_DMAMUX1IM /*!< Enabling of interrupt from DMAMUX1 to CPU2 */ | |||
#if defined(SYSCFG_C2IMR2_PVM1IM) | |||
#define LL_C2_SYSCFG_GRP2_PVM1 SYSCFG_C2IMR2_PVM1IM /*!< Enabling of interrupt from Power Voltage Monitoring 1 to CPU2 */ | |||
#endif | |||
#define LL_C2_SYSCFG_GRP2_PVM3 SYSCFG_C2IMR2_PVM3IM /*!< Enabling of interrupt from Power Voltage Monitoring 3 to CPU2 */ | |||
#define LL_C2_SYSCFG_GRP2_PVD SYSCFG_C2IMR2_PVDIM /*!< Enabling of interrupt from Power Voltage Detector to CPU2 */ | |||
#define LL_C2_SYSCFG_GRP2_TSC SYSCFG_C2IMR2_TSCIM /*!< Enabling of interrupt from Touch Sensing Controller to CPU2 */ | |||
#if defined(LCD) | |||
#define LL_C2_SYSCFG_GRP2_LCD SYSCFG_C2IMR2_LCDIM /*!< Enabling of interrupt from Liquid Crystal Display to CPU2 */ | |||
#endif | |||
/** | |||
* @} | |||
*/ | |||
@@ -306,7 +332,9 @@ extern "C" { | |||
/** @defgroup SYSTEM_LL_EC_SECURE_IP_ACCESS SYSCFG SECURE IP ACCESS | |||
* @{ | |||
*/ | |||
#if defined(AES1) | |||
#define LL_SYSCFG_SECURE_ACCESS_AES1 SYSCFG_SIPCR_SAES1 /*!< Enabling the security access of Advanced Encryption Standard 1 KEY[7:0] */ | |||
#endif | |||
#define LL_SYSCFG_SECURE_ACCESS_AES2 SYSCFG_SIPCR_SAES2 /*!< Enabling the security access of Advanced Encryption Standard 2 */ | |||
#define LL_SYSCFG_SECURE_ACCESS_PKA SYSCFG_SIPCR_SPKA /*!< Enabling the security access of Public Key Accelerator */ | |||
#define LL_SYSCFG_SECURE_ACCESS_RNG SYSCFG_SIPCR_SRNG /*!< Enabling the security access of Random Number Generator */ | |||
@@ -322,7 +350,9 @@ extern "C" { | |||
#define LL_DBGMCU_APB1_GRP1_WWDG_STOP DBGMCU_APB1FZR1_DBG_WWDG_STOP /*!< The window watchdog counter clock is stopped when the core is halted */ | |||
#define LL_DBGMCU_APB1_GRP1_IWDG_STOP DBGMCU_APB1FZR1_DBG_IWDG_STOP /*!< The independent watchdog counter clock is stopped when the core is halted */ | |||
#define LL_DBGMCU_APB1_GRP1_I2C1_STOP DBGMCU_APB1FZR1_DBG_I2C1_STOP /*!< The I2C1 SMBus timeout is frozen */ | |||
#if defined(I2C3) | |||
#define LL_DBGMCU_APB1_GRP1_I2C3_STOP DBGMCU_APB1FZR1_DBG_I2C3_STOP /*!< The I2C3 SMBus timeout is frozen */ | |||
#endif | |||
#define LL_DBGMCU_APB1_GRP1_LPTIM1_STOP DBGMCU_APB1FZR1_DBG_LPTIM1_STOP /*!< The counter clock of LPTIM1 is stopped when the core is halted */ | |||
/** | |||
* @} | |||
@@ -335,7 +365,9 @@ extern "C" { | |||
#define LL_C2_DBGMCU_APB1_GRP1_RTC_STOP DBGMCU_C2APB1FZR1_DBG_RTC_STOP /*!< The clock of the RTC counter is stopped when the core is halted */ | |||
#define LL_C2_DBGMCU_APB1_GRP1_IWDG_STOP DBGMCU_C2APB1FZR1_DBG_IWDG_STOP /*!< The independent watchdog counter clock is stopped when the core is halted */ | |||
#define LL_C2_DBGMCU_APB1_GRP1_I2C1_STOP DBGMCU_C2APB1FZR1_DBG_I2C1_STOP /*!< The I2C1 SMBus timeout is frozen */ | |||
#if defined(I2C3) | |||
#define LL_C2_DBGMCU_APB1_GRP1_I2C3_STOP DBGMCU_C2APB1FZR1_DBG_I2C3_STOP /*!< The I2C3 SMBus timeout is frozen */ | |||
#endif | |||
#define LL_C2_DBGMCU_APB1_GRP1_LPTIM1_STOP DBGMCU_C2APB1FZR1_DBG_LPTIM1_STOP /*!< The counter clock of LPTIM1 is stopped when the core is halted */ | |||
/** | |||
* @} | |||
@@ -1854,6 +1886,24 @@ __STATIC_INLINE uint32_t LL_VREFBUF_GetVoltageScaling(void) | |||
return (uint32_t)(READ_BIT(VREFBUF->CSR, VREFBUF_CSR_VRS)); | |||
} | |||
/** | |||
* @brief Get the VREFBUF trimming value for VRS=0 (VREF_SC0) | |||
* @retval Between 0 and 0x3F | |||
*/ | |||
__STATIC_INLINE uint32_t LL_VREFBUF_SC0_GetCalibration(void) | |||
{ | |||
return (uint32_t)(*VREFBUF_SC0_CAL_ADDR); | |||
} | |||
/** | |||
* @brief Get the VREFBUF trimming value for VRS=1 (VREF_SC1) | |||
* @retval Between 0 and 0x3F | |||
*/ | |||
__STATIC_INLINE uint32_t LL_VREFBUF_SC1_GetCalibration(void) | |||
{ | |||
return (uint32_t)(*VREFBUF_SC1_CAL_ADDR); | |||
} | |||
/** | |||
* @brief Check if Voltage reference buffer is ready | |||
* @rmtoll VREFBUF_CSR VRR LL_VREFBUF_IsVREFReady | |||
@@ -1876,6 +1926,11 @@ __STATIC_INLINE uint32_t LL_VREFBUF_GetTrimming(void) | |||
/** | |||
* @brief Set the trimming code for VREFBUF calibration (Tune the internal reference buffer voltage) | |||
* @note Each VrefBuf voltage scale is calibrated in production for each device, | |||
* data stored in flash memory. | |||
* Functions @ref LL_VREFBUF_SC0_GetCalibration and | |||
* @ref LL_VREFBUF_SC0_GetCalibration can be used to retrieve | |||
* these calibration data. | |||
* @rmtoll VREFBUF_CCR TRIM LL_VREFBUF_SetTrimming | |||
* @param Value Between 0 and 0x3F | |||
* @retval None | |||
@@ -2160,8 +2215,8 @@ __STATIC_INLINE uint32_t LL_FLASH_GetUDN(void) | |||
* @brief Return the Device ID | |||
* @note The 64-bit UID64 may be used by Firmware to derive BLE 48-bit Device Address EUI-48 or | |||
* 802.15.4 64-bit Device Address EUI-64. | |||
* For STM32WBxxxx devices, the device ID is 0x05 | |||
* @retval Values between Min_Data=0x00 and Max_Data=0xFF (ex: Device ID is 0x05) | |||
* For STM32WBxxxx devices, the device ID is 0x26 | |||
* @retval Values between Min_Data=0x00 and Max_Data=0xFF (ex: Device ID is 0x26 fo STM32WB55x) | |||
*/ | |||
__STATIC_INLINE uint32_t LL_FLASH_GetDeviceID(void) | |||
{ | |||
@@ -120,22 +120,9 @@ static const uint8_t SHIFT_TAB_OISx[] = | |||
#define TIM_POSITION_BRK_SOURCE (POSITION_VAL(Source) & 0x1FUL) | |||
/* Generic bit definitions for TIMx_AF1 register */ | |||
#define TIMx_AF1_BKINE TIM1_AF1_BKINE /*!< BRK BKIN input enable */ | |||
#define TIMx_AF1_BKCOMP1E TIM1_AF1_BKCMP1E /*!< BRK COMP1 enable */ | |||
#define TIMx_AF1_BKCOMP2E TIM1_AF1_BKCMP2E /*!< BRK COMP2 enable */ | |||
#define TIMx_AF1_BKINP TIM1_AF1_BKINP /*!< BRK BKIN input polarity */ | |||
#define TIMx_AF1_BKCOMP1P TIM1_AF1_BKCMP1P /*!< BRK COMP1 input polarity */ | |||
#define TIMx_AF1_BKCOMP2P TIM1_AF1_BKCMP2P /*!< BRK COMP2 input polarity */ | |||
#define TIMx_AF1_ETRSEL TIM1_AF1_ETRSEL /*!< TIMx ETR source selection */ | |||
/* Generic bit definitions for TIMx_AF2 register */ | |||
#define TIMx_AF2_BK2INE TIM1_AF2_BK2INE /*!< BRK2 BKIN2 input enable */ | |||
#define TIMx_AF2_BK2COMP1E TIM1_AF2_BK2CMP1E /*!< BRK2 COMP1 enable */ | |||
#define TIMx_AF2_BK2COMP2E TIM1_AF2_BK2CMP2E /*!< BRK2 COMP2 enable */ | |||
#define TIMx_AF2_BK2INP TIM1_AF2_BK2INP /*!< BRK2 BKIN2 input polarity */ | |||
#define TIMx_AF2_BK2COMP1P TIM1_AF2_BK2CMP1P /*!< BRK2 COMP1 input polarity */ | |||
#define TIMx_AF2_BK2COMP2P TIM1_AF2_BK2CMP2P /*!< BRK2 COMP2 input polarity */ | |||
/* Remap mask definitions */ | |||
#define TIMx_OR_RMP_SHIFT 16U | |||
#define TIMx_OR_RMP_MASK 0x0000FFFFU | |||
@@ -244,13 +231,14 @@ typedef struct | |||
This feature can be modified afterwards using unitary function @ref LL_TIM_SetClockDivision().*/ | |||
uint8_t RepetitionCounter; /*!< Specifies the repetition counter value. Each time the RCR downcounter | |||
uint32_t RepetitionCounter; /*!< Specifies the repetition counter value. Each time the RCR downcounter | |||
reaches zero, an update event is generated and counting restarts | |||
from the RCR value (N). | |||
This means in PWM mode that (N+1) corresponds to: | |||
- the number of PWM periods in edge-aligned mode | |||
- the number of half PWM period in center-aligned mode | |||
This parameter must be a number between 0x00 and 0xFF. | |||
GP timers: this parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. | |||
Advanced timers: this parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. | |||
This feature can be modified afterwards using unitary function @ref LL_TIM_SetRepetitionCounter().*/ | |||
} LL_TIM_InitTypeDef; | |||
@@ -916,12 +904,15 @@ typedef struct | |||
/** @defgroup TIM_LL_EC_ETRSOURCE External Trigger Source | |||
* @{ | |||
*/ | |||
#define LL_TIM_ETRSOURCE_GPIO 0x00000000U /*!< ETR input is connected to GPIO */ | |||
#define LL_TIM_ETRSOURCE_LEGACY 0x00000000U /*!< ETR legacy mode */ | |||
#if defined(COMP1) && defined(COMP2) | |||
#define LL_TIM_ETRSOURCE_COMP1 TIM1_AF1_ETRSEL_0 /*!< ETR input is connected to COMP1_OUT */ | |||
#define LL_TIM_ETRSOURCE_COMP2 TIM1_AF1_ETRSEL_1 /*!< ETR input is connected to COMP2_OUT */ | |||
#define LL_TIM_ETRSOURCE_ADC1_AWD1 (TIM1_AF1_ETRSEL_1 | TIM1_AF1_ETRSEL_0) /*!< ETR input is connected to ADC1 analog watchdog 1 */ | |||
#define LL_TIM_ETRSOURCE_ADC1_AWD2 TIM1_AF1_ETRSEL_2 /*!< ETR input is connected to ADC1 analog watchdog 2 */ | |||
#define LL_TIM_ETRSOURCE_ADC1_AWD3 (TIM1_AF1_ETRSEL_2 | TIM1_AF1_ETRSEL_0) /*!< ETR input is connected to ADC1 analog watchdog 3 */ | |||
#endif /* COMP1 && COMP2 */ | |||
#define LL_TIM_ETRSOURCE_GPIO LL_TIM_ETRSOURCE_LEGACY /*!< ETR input is connected to GPIO through TIMx ETR remapping capability */ | |||
#define LL_TIM_ETRSOURCE_ADC1_AWD1 LL_TIM_ETRSOURCE_LEGACY /*!< ETR input is connected to ADC1 analog watchdog 1 through TIMx ETR remapping capability */ | |||
#define LL_TIM_ETRSOURCE_ADC1_AWD2 LL_TIM_ETRSOURCE_LEGACY /*!< ETR input is connected to ADC1 analog watchdog 2 through TIMx ETR remapping capability */ | |||
#define LL_TIM_ETRSOURCE_ADC1_AWD3 LL_TIM_ETRSOURCE_LEGACY /*!< ETR input is connected to ADC1 analog watchdog 3 through TIMx ETR remapping capability */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -1109,7 +1100,9 @@ typedef struct | |||
* @{ | |||
*/ | |||
#define LL_TIM_TIM1_TI1_RMP_GPIO TIM1_OR_RMP_MASK /*!< TIM1 input capture 1 is connected to GPIO */ | |||
#if defined(COMP1) | |||
#define LL_TIM_TIM1_TI1_RMP_COMP1 (TIM1_OR_TI1_RMP | TIM1_OR_RMP_MASK) /*!< TIM1 input capture 1 is connected to COMP1 output */ | |||
#endif /* COMP1 */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -1117,8 +1110,10 @@ typedef struct | |||
/** @defgroup TIM_LL_EC_TIM2_ITR1_RMP TIM2 Internal Trigger1 Remap | |||
* @{ | |||
*/ | |||
#define LL_TIM_TIM2_ITR1_RMP_NONE 0x00000000U /* !< No internal trigger on TIM2_ITR1 */ | |||
#define LL_TIM_TIM2_ITR1_RMP_NONE TIM2_OR_RMP_MASK /* !< No internal trigger on TIM2_ITR1 */ | |||
#if defined(USB) | |||
#define LL_TIM_TIM2_ITR1_RMP_USB_SOF (TIM2_OR_ITR1_RMP) /* !< TIM2_ITR1 is connected to USB SOF */ | |||
#endif /* USB */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -1126,7 +1121,7 @@ typedef struct | |||
/** @defgroup TIM_LL_EC_TIM2_ETR_RMP TIM2 External Trigger Remap | |||
* @{ | |||
*/ | |||
#define LL_TIM_TIM2_ETR_RMP_GPIO TIM2_OR_RMP_MASK /*!< TIM2_ETR is connected to GPIO */ | |||
#define LL_TIM_TIM2_ETR_RMP_GPIO TIM2_OR_RMP_MASK /*!< TIM2_ETR is connected to GPIO */ | |||
#define LL_TIM_TIM2_ETR_RMP_LSE (TIM2_OR_ETR_RMP | TIM2_OR_RMP_MASK) /*!< TIM2_ETR is connected to LSE */ | |||
/** | |||
* @} | |||
@@ -1136,9 +1131,11 @@ typedef struct | |||
* @{ | |||
*/ | |||
#define LL_TIM_TIM2_TI4_RMP_GPIO TIM2_OR_RMP_MASK /*!< TIM2 input capture 4 is connected to GPIO */ | |||
#if defined(COMP1) && defined(COMP2) | |||
#define LL_TIM_TIM2_TI4_RMP_COMP1 (TIM2_OR_TI4_RMP_0 | TIM2_OR_RMP_MASK) /*!< TIM2 input capture 4 is connected to COMP1_OUT */ | |||
#define LL_TIM_TIM2_TI4_RMP_COMP2 (TIM2_OR_TI4_RMP_1 | TIM2_OR_RMP_MASK) /*!< TIM2 input capture 4 is connected to COMP2_OUT */ | |||
#define LL_TIM_TIM2_TI4_RMP_COMP1_COMP2 (TIM2_OR_TI4_RMP | TIM2_OR_RMP_MASK) /*!< TIM2 input capture 4 is connected to logical OR between COMP1_OUT and COMP2_OUT */ | |||
#endif /* COMP1 && COMP2 */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -1451,7 +1448,7 @@ __STATIC_INLINE uint32_t LL_TIM_GetOnePulseMode(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Set the timer counter counting mode. | |||
* @note Macro @ref IS_TIM_COUNTER_MODE_SELECT_INSTANCE(TIMx) can be used to | |||
* @note Macro IS_TIM_COUNTER_MODE_SELECT_INSTANCE(TIMx) can be used to | |||
* check whether or not the counter mode selection feature is supported | |||
* by a timer instance. | |||
* @note Switching from Center Aligned counter mode to Edge counter mode (or reverse) | |||
@@ -1475,7 +1472,7 @@ __STATIC_INLINE void LL_TIM_SetCounterMode(TIM_TypeDef *TIMx, uint32_t CounterMo | |||
/** | |||
* @brief Get actual counter mode. | |||
* @note Macro @ref IS_TIM_COUNTER_MODE_SELECT_INSTANCE(TIMx) can be used to | |||
* @note Macro IS_TIM_COUNTER_MODE_SELECT_INSTANCE(TIMx) can be used to | |||
* check whether or not the counter mode selection feature is supported | |||
* by a timer instance. | |||
* @rmtoll CR1 DIR LL_TIM_GetCounterMode\n | |||
@@ -1528,7 +1525,7 @@ __STATIC_INLINE uint32_t LL_TIM_IsEnabledARRPreload(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Set the division ratio between the timer clock and the sampling clock used by the dead-time generators (when supported) and the digital filters. | |||
* @note Macro @ref IS_TIM_CLOCK_DIVISION_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_CLOCK_DIVISION_INSTANCE(TIMx) can be used to check | |||
* whether or not the clock division feature is supported by the timer | |||
* instance. | |||
* @rmtoll CR1 CKD LL_TIM_SetClockDivision | |||
@@ -1546,7 +1543,7 @@ __STATIC_INLINE void LL_TIM_SetClockDivision(TIM_TypeDef *TIMx, uint32_t ClockDi | |||
/** | |||
* @brief Get the actual division ratio between the timer clock and the sampling clock used by the dead-time generators (when supported) and the digital filters. | |||
* @note Macro @ref IS_TIM_CLOCK_DIVISION_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_CLOCK_DIVISION_INSTANCE(TIMx) can be used to check | |||
* whether or not the clock division feature is supported by the timer | |||
* instance. | |||
* @rmtoll CR1 CKD LL_TIM_GetClockDivision | |||
@@ -1563,7 +1560,7 @@ __STATIC_INLINE uint32_t LL_TIM_GetClockDivision(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Set the counter value. | |||
* @note Macro @ref IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance supports a 32 bits counter. | |||
* @rmtoll CNT CNT LL_TIM_SetCounter | |||
* @param TIMx Timer instance | |||
@@ -1577,7 +1574,7 @@ __STATIC_INLINE void LL_TIM_SetCounter(TIM_TypeDef *TIMx, uint32_t Counter) | |||
/** | |||
* @brief Get the counter value. | |||
* @note Macro @ref IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance supports a 32 bits counter. | |||
* @rmtoll CNT CNT LL_TIM_GetCounter | |||
* @param TIMx Timer instance | |||
@@ -1631,7 +1628,7 @@ __STATIC_INLINE uint32_t LL_TIM_GetPrescaler(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Set the auto-reload value. | |||
* @note The counter is blocked while the auto-reload value is null. | |||
* @note Macro @ref IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance supports a 32 bits counter. | |||
* @note Helper macro @ref __LL_TIM_CALC_ARR can be used to calculate the AutoReload parameter | |||
* @rmtoll ARR ARR LL_TIM_SetAutoReload | |||
@@ -1647,7 +1644,7 @@ __STATIC_INLINE void LL_TIM_SetAutoReload(TIM_TypeDef *TIMx, uint32_t AutoReload | |||
/** | |||
* @brief Get the auto-reload value. | |||
* @rmtoll ARR ARR LL_TIM_GetAutoReload | |||
* @note Macro @ref IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance supports a 32 bits counter. | |||
* @param TIMx Timer instance | |||
* @retval Auto-reload value | |||
@@ -1660,11 +1657,11 @@ __STATIC_INLINE uint32_t LL_TIM_GetAutoReload(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Set the repetition counter value. | |||
* @note For advanced timer instances RepetitionCounter can be up to 65535. | |||
* @note Macro @ref IS_TIM_REPETITION_COUNTER_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_REPETITION_COUNTER_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance supports a repetition counter. | |||
* @rmtoll RCR REP LL_TIM_SetRepetitionCounter | |||
* @param TIMx Timer instance | |||
* @param RepetitionCounter between Min_Data=0 and Max_Data=255 | |||
* @param RepetitionCounter between Min_Data=0 and Max_Data=255 or 65535 for advanced timer. | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_TIM_SetRepetitionCounter(TIM_TypeDef *TIMx, uint32_t RepetitionCounter) | |||
@@ -1674,7 +1671,7 @@ __STATIC_INLINE void LL_TIM_SetRepetitionCounter(TIM_TypeDef *TIMx, uint32_t Rep | |||
/** | |||
* @brief Get the repetition counter value. | |||
* @note Macro @ref IS_TIM_REPETITION_COUNTER_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_REPETITION_COUNTER_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance supports a repetition counter. | |||
* @rmtoll RCR REP LL_TIM_GetRepetitionCounter | |||
* @param TIMx Timer instance | |||
@@ -1708,6 +1705,16 @@ __STATIC_INLINE void LL_TIM_DisableUIFRemap(TIM_TypeDef *TIMx) | |||
CLEAR_BIT(TIMx->CR1, TIM_CR1_UIFREMAP); | |||
} | |||
/** | |||
* @brief Indicate whether update interrupt flag (UIF) copy is set. | |||
* @param Counter Counter value | |||
* @retval State of bit (1 or 0). | |||
*/ | |||
__STATIC_INLINE uint32_t LL_TIM_IsActiveUIFCPY(uint32_t Counter) | |||
{ | |||
return (((Counter & TIM_CNT_UIFCPY) == (TIM_CNT_UIFCPY)) ? 1UL : 0UL); | |||
} | |||
/** | |||
* @} | |||
*/ | |||
@@ -1720,7 +1727,7 @@ __STATIC_INLINE void LL_TIM_DisableUIFRemap(TIM_TypeDef *TIMx) | |||
* @note CCxE, CCxNE and OCxM bits are preloaded, after having been written, | |||
* they are updated only when a commutation event (COM) occurs. | |||
* @note Only on channels that have a complementary output. | |||
* @note Macro @ref IS_TIM_COMMUTATION_EVENT_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_COMMUTATION_EVENT_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance is able to generate a commutation event. | |||
* @rmtoll CR2 CCPC LL_TIM_CC_EnablePreload | |||
* @param TIMx Timer instance | |||
@@ -1733,7 +1740,7 @@ __STATIC_INLINE void LL_TIM_CC_EnablePreload(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Disable the capture/compare control bits (CCxE, CCxNE and OCxM) preload. | |||
* @note Macro @ref IS_TIM_COMMUTATION_EVENT_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_COMMUTATION_EVENT_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance is able to generate a commutation event. | |||
* @rmtoll CR2 CCPC LL_TIM_CC_DisablePreload | |||
* @param TIMx Timer instance | |||
@@ -1746,7 +1753,7 @@ __STATIC_INLINE void LL_TIM_CC_DisablePreload(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Set the updated source of the capture/compare control bits (CCxE, CCxNE and OCxM). | |||
* @note Macro @ref IS_TIM_COMMUTATION_EVENT_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_COMMUTATION_EVENT_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance is able to generate a commutation event. | |||
* @rmtoll CR2 CCUS LL_TIM_CC_SetUpdate | |||
* @param TIMx Timer instance | |||
@@ -1790,7 +1797,7 @@ __STATIC_INLINE uint32_t LL_TIM_CC_GetDMAReqTrigger(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Set the lock level to freeze the | |||
* configuration of several capture/compare parameters. | |||
* @note Macro @ref IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not | |||
* the lock mechanism is supported by a timer instance. | |||
* @rmtoll BDTR LOCK LL_TIM_CC_SetLockLevel | |||
* @param TIMx Timer instance | |||
@@ -2092,7 +2099,7 @@ __STATIC_INLINE uint32_t LL_TIM_OC_GetPolarity(TIM_TypeDef *TIMx, uint32_t Chann | |||
/** | |||
* @brief Set the IDLE state of an output channel | |||
* @note This function is significant only for the timer instances | |||
* supporting the break feature. Macro @ref IS_TIM_BREAK_INSTANCE(TIMx) | |||
* supporting the break feature. Macro IS_TIM_BREAK_INSTANCE(TIMx) | |||
* can be used to check whether or not a timer instance provides | |||
* a break input. | |||
* @rmtoll CR2 OIS1 LL_TIM_OC_SetIdleState\n | |||
@@ -2316,7 +2323,7 @@ __STATIC_INLINE uint32_t LL_TIM_OC_IsEnabledPreload(TIM_TypeDef *TIMx, uint32_t | |||
/** | |||
* @brief Enable clearing the output channel on an external event. | |||
* @note This function can only be used in Output compare and PWM modes. It does not work in Forced mode. | |||
* @note Macro @ref IS_TIM_OCXREF_CLEAR_INSTANCE(TIMx) can be used to check whether | |||
* @note Macro IS_TIM_OCXREF_CLEAR_INSTANCE(TIMx) can be used to check whether | |||
* or not a timer instance can clear the OCxREF signal on an external event. | |||
* @rmtoll CCMR1 OC1CE LL_TIM_OC_EnableClear\n | |||
* CCMR1 OC2CE LL_TIM_OC_EnableClear\n | |||
@@ -2343,7 +2350,7 @@ __STATIC_INLINE void LL_TIM_OC_EnableClear(TIM_TypeDef *TIMx, uint32_t Channel) | |||
/** | |||
* @brief Disable clearing the output channel on an external event. | |||
* @note Macro @ref IS_TIM_OCXREF_CLEAR_INSTANCE(TIMx) can be used to check whether | |||
* @note Macro IS_TIM_OCXREF_CLEAR_INSTANCE(TIMx) can be used to check whether | |||
* or not a timer instance can clear the OCxREF signal on an external event. | |||
* @rmtoll CCMR1 OC1CE LL_TIM_OC_DisableClear\n | |||
* CCMR1 OC2CE LL_TIM_OC_DisableClear\n | |||
@@ -2372,7 +2379,7 @@ __STATIC_INLINE void LL_TIM_OC_DisableClear(TIM_TypeDef *TIMx, uint32_t Channel) | |||
* @brief Indicates clearing the output channel on an external event is enabled for the output channel. | |||
* @note This function enables clearing the output channel on an external event. | |||
* @note This function can only be used in Output compare and PWM modes. It does not work in Forced mode. | |||
* @note Macro @ref IS_TIM_OCXREF_CLEAR_INSTANCE(TIMx) can be used to check whether | |||
* @note Macro IS_TIM_OCXREF_CLEAR_INSTANCE(TIMx) can be used to check whether | |||
* or not a timer instance can clear the OCxREF signal on an external event. | |||
* @rmtoll CCMR1 OC1CE LL_TIM_OC_IsEnabledClear\n | |||
* CCMR1 OC2CE LL_TIM_OC_IsEnabledClear\n | |||
@@ -2400,7 +2407,7 @@ __STATIC_INLINE uint32_t LL_TIM_OC_IsEnabledClear(TIM_TypeDef *TIMx, uint32_t Ch | |||
/** | |||
* @brief Set the dead-time delay (delay inserted between the rising edge of the OCxREF signal and the rising edge of the Ocx and OCxN signals). | |||
* @note Macro @ref IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not | |||
* dead-time insertion feature is supported by a timer instance. | |||
* @note Helper macro @ref __LL_TIM_CALC_DEADTIME can be used to calculate the DeadTime parameter | |||
* @rmtoll BDTR DTG LL_TIM_OC_SetDeadTime | |||
@@ -2416,9 +2423,9 @@ __STATIC_INLINE void LL_TIM_OC_SetDeadTime(TIM_TypeDef *TIMx, uint32_t DeadTime) | |||
/** | |||
* @brief Set compare value for output channel 1 (TIMx_CCR1). | |||
* @note In 32-bit timer implementations compare value can be between 0x00000000 and 0xFFFFFFFF. | |||
* @note Macro @ref IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance supports a 32 bits counter. | |||
* @note Macro @ref IS_TIM_CC1_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_CC1_INSTANCE(TIMx) can be used to check whether or not | |||
* output channel 1 is supported by a timer instance. | |||
* @rmtoll CCR1 CCR1 LL_TIM_OC_SetCompareCH1 | |||
* @param TIMx Timer instance | |||
@@ -2433,9 +2440,9 @@ __STATIC_INLINE void LL_TIM_OC_SetCompareCH1(TIM_TypeDef *TIMx, uint32_t Compare | |||
/** | |||
* @brief Set compare value for output channel 2 (TIMx_CCR2). | |||
* @note In 32-bit timer implementations compare value can be between 0x00000000 and 0xFFFFFFFF. | |||
* @note Macro @ref IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance supports a 32 bits counter. | |||
* @note Macro @ref IS_TIM_CC2_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_CC2_INSTANCE(TIMx) can be used to check whether or not | |||
* output channel 2 is supported by a timer instance. | |||
* @rmtoll CCR2 CCR2 LL_TIM_OC_SetCompareCH2 | |||
* @param TIMx Timer instance | |||
@@ -2450,9 +2457,9 @@ __STATIC_INLINE void LL_TIM_OC_SetCompareCH2(TIM_TypeDef *TIMx, uint32_t Compare | |||
/** | |||
* @brief Set compare value for output channel 3 (TIMx_CCR3). | |||
* @note In 32-bit timer implementations compare value can be between 0x00000000 and 0xFFFFFFFF. | |||
* @note Macro @ref IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance supports a 32 bits counter. | |||
* @note Macro @ref IS_TIM_CC3_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_CC3_INSTANCE(TIMx) can be used to check whether or not | |||
* output channel is supported by a timer instance. | |||
* @rmtoll CCR3 CCR3 LL_TIM_OC_SetCompareCH3 | |||
* @param TIMx Timer instance | |||
@@ -2467,9 +2474,9 @@ __STATIC_INLINE void LL_TIM_OC_SetCompareCH3(TIM_TypeDef *TIMx, uint32_t Compare | |||
/** | |||
* @brief Set compare value for output channel 4 (TIMx_CCR4). | |||
* @note In 32-bit timer implementations compare value can be between 0x00000000 and 0xFFFFFFFF. | |||
* @note Macro @ref IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance supports a 32 bits counter. | |||
* @note Macro @ref IS_TIM_CC4_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_CC4_INSTANCE(TIMx) can be used to check whether or not | |||
* output channel 4 is supported by a timer instance. | |||
* @rmtoll CCR4 CCR4 LL_TIM_OC_SetCompareCH4 | |||
* @param TIMx Timer instance | |||
@@ -2483,7 +2490,7 @@ __STATIC_INLINE void LL_TIM_OC_SetCompareCH4(TIM_TypeDef *TIMx, uint32_t Compare | |||
/** | |||
* @brief Set compare value for output channel 5 (TIMx_CCR5). | |||
* @note Macro @ref IS_TIM_CC5_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_CC5_INSTANCE(TIMx) can be used to check whether or not | |||
* output channel 5 is supported by a timer instance. | |||
* @rmtoll CCR5 CCR5 LL_TIM_OC_SetCompareCH5 | |||
* @param TIMx Timer instance | |||
@@ -2497,7 +2504,7 @@ __STATIC_INLINE void LL_TIM_OC_SetCompareCH5(TIM_TypeDef *TIMx, uint32_t Compare | |||
/** | |||
* @brief Set compare value for output channel 6 (TIMx_CCR6). | |||
* @note Macro @ref IS_TIM_CC6_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_CC6_INSTANCE(TIMx) can be used to check whether or not | |||
* output channel 6 is supported by a timer instance. | |||
* @rmtoll CCR6 CCR6 LL_TIM_OC_SetCompareCH6 | |||
* @param TIMx Timer instance | |||
@@ -2512,9 +2519,9 @@ __STATIC_INLINE void LL_TIM_OC_SetCompareCH6(TIM_TypeDef *TIMx, uint32_t Compare | |||
/** | |||
* @brief Get compare value (TIMx_CCR1) set for output channel 1. | |||
* @note In 32-bit timer implementations returned compare value can be between 0x00000000 and 0xFFFFFFFF. | |||
* @note Macro @ref IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance supports a 32 bits counter. | |||
* @note Macro @ref IS_TIM_CC1_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_CC1_INSTANCE(TIMx) can be used to check whether or not | |||
* output channel 1 is supported by a timer instance. | |||
* @rmtoll CCR1 CCR1 LL_TIM_OC_GetCompareCH1 | |||
* @param TIMx Timer instance | |||
@@ -2528,9 +2535,9 @@ __STATIC_INLINE uint32_t LL_TIM_OC_GetCompareCH1(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Get compare value (TIMx_CCR2) set for output channel 2. | |||
* @note In 32-bit timer implementations returned compare value can be between 0x00000000 and 0xFFFFFFFF. | |||
* @note Macro @ref IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance supports a 32 bits counter. | |||
* @note Macro @ref IS_TIM_CC2_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_CC2_INSTANCE(TIMx) can be used to check whether or not | |||
* output channel 2 is supported by a timer instance. | |||
* @rmtoll CCR2 CCR2 LL_TIM_OC_GetCompareCH2 | |||
* @param TIMx Timer instance | |||
@@ -2544,9 +2551,9 @@ __STATIC_INLINE uint32_t LL_TIM_OC_GetCompareCH2(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Get compare value (TIMx_CCR3) set for output channel 3. | |||
* @note In 32-bit timer implementations returned compare value can be between 0x00000000 and 0xFFFFFFFF. | |||
* @note Macro @ref IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance supports a 32 bits counter. | |||
* @note Macro @ref IS_TIM_CC3_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_CC3_INSTANCE(TIMx) can be used to check whether or not | |||
* output channel 3 is supported by a timer instance. | |||
* @rmtoll CCR3 CCR3 LL_TIM_OC_GetCompareCH3 | |||
* @param TIMx Timer instance | |||
@@ -2560,9 +2567,9 @@ __STATIC_INLINE uint32_t LL_TIM_OC_GetCompareCH3(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Get compare value (TIMx_CCR4) set for output channel 4. | |||
* @note In 32-bit timer implementations returned compare value can be between 0x00000000 and 0xFFFFFFFF. | |||
* @note Macro @ref IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance supports a 32 bits counter. | |||
* @note Macro @ref IS_TIM_CC4_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_CC4_INSTANCE(TIMx) can be used to check whether or not | |||
* output channel 4 is supported by a timer instance. | |||
* @rmtoll CCR4 CCR4 LL_TIM_OC_GetCompareCH4 | |||
* @param TIMx Timer instance | |||
@@ -2575,7 +2582,7 @@ __STATIC_INLINE uint32_t LL_TIM_OC_GetCompareCH4(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Get compare value (TIMx_CCR5) set for output channel 5. | |||
* @note Macro @ref IS_TIM_CC5_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_CC5_INSTANCE(TIMx) can be used to check whether or not | |||
* output channel 5 is supported by a timer instance. | |||
* @rmtoll CCR5 CCR5 LL_TIM_OC_GetCompareCH5 | |||
* @param TIMx Timer instance | |||
@@ -2588,7 +2595,7 @@ __STATIC_INLINE uint32_t LL_TIM_OC_GetCompareCH5(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Get compare value (TIMx_CCR6) set for output channel 6. | |||
* @note Macro @ref IS_TIM_CC6_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_CC6_INSTANCE(TIMx) can be used to check whether or not | |||
* output channel 6 is supported by a timer instance. | |||
* @rmtoll CCR6 CCR6 LL_TIM_OC_GetCompareCH6 | |||
* @param TIMx Timer instance | |||
@@ -2601,7 +2608,7 @@ __STATIC_INLINE uint32_t LL_TIM_OC_GetCompareCH6(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Select on which reference signal the OC5REF is combined to. | |||
* @note Macro @ref IS_TIM_COMBINED3PHASEPWM_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_COMBINED3PHASEPWM_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance supports the combined 3-phase PWM mode. | |||
* @rmtoll CCR5 GC5C3 LL_TIM_SetCH5CombinedChannels\n | |||
* CCR5 GC5C2 LL_TIM_SetCH5CombinedChannels\n | |||
@@ -2905,7 +2912,7 @@ __STATIC_INLINE uint32_t LL_TIM_IC_GetPolarity(TIM_TypeDef *TIMx, uint32_t Chann | |||
/** | |||
* @brief Connect the TIMx_CH1, CH2 and CH3 pins to the TI1 input (XOR combination). | |||
* @note Macro @ref IS_TIM_XOR_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_XOR_INSTANCE(TIMx) can be used to check whether or not | |||
* a timer instance provides an XOR input. | |||
* @rmtoll CR2 TI1S LL_TIM_IC_EnableXORCombination | |||
* @param TIMx Timer instance | |||
@@ -2918,7 +2925,7 @@ __STATIC_INLINE void LL_TIM_IC_EnableXORCombination(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Disconnect the TIMx_CH1, CH2 and CH3 pins from the TI1 input. | |||
* @note Macro @ref IS_TIM_XOR_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_XOR_INSTANCE(TIMx) can be used to check whether or not | |||
* a timer instance provides an XOR input. | |||
* @rmtoll CR2 TI1S LL_TIM_IC_DisableXORCombination | |||
* @param TIMx Timer instance | |||
@@ -2931,7 +2938,7 @@ __STATIC_INLINE void LL_TIM_IC_DisableXORCombination(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Indicates whether the TIMx_CH1, CH2 and CH3 pins are connectected to the TI1 input. | |||
* @note Macro @ref IS_TIM_XOR_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_XOR_INSTANCE(TIMx) can be used to check whether or not | |||
* a timer instance provides an XOR input. | |||
* @rmtoll CR2 TI1S LL_TIM_IC_IsEnabledXORCombination | |||
* @param TIMx Timer instance | |||
@@ -2945,9 +2952,9 @@ __STATIC_INLINE uint32_t LL_TIM_IC_IsEnabledXORCombination(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Get captured value for input channel 1. | |||
* @note In 32-bit timer implementations returned captured value can be between 0x00000000 and 0xFFFFFFFF. | |||
* @note Macro @ref IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance supports a 32 bits counter. | |||
* @note Macro @ref IS_TIM_CC1_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_CC1_INSTANCE(TIMx) can be used to check whether or not | |||
* input channel 1 is supported by a timer instance. | |||
* @rmtoll CCR1 CCR1 LL_TIM_IC_GetCaptureCH1 | |||
* @param TIMx Timer instance | |||
@@ -2961,9 +2968,9 @@ __STATIC_INLINE uint32_t LL_TIM_IC_GetCaptureCH1(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Get captured value for input channel 2. | |||
* @note In 32-bit timer implementations returned captured value can be between 0x00000000 and 0xFFFFFFFF. | |||
* @note Macro @ref IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance supports a 32 bits counter. | |||
* @note Macro @ref IS_TIM_CC2_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_CC2_INSTANCE(TIMx) can be used to check whether or not | |||
* input channel 2 is supported by a timer instance. | |||
* @rmtoll CCR2 CCR2 LL_TIM_IC_GetCaptureCH2 | |||
* @param TIMx Timer instance | |||
@@ -2977,9 +2984,9 @@ __STATIC_INLINE uint32_t LL_TIM_IC_GetCaptureCH2(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Get captured value for input channel 3. | |||
* @note In 32-bit timer implementations returned captured value can be between 0x00000000 and 0xFFFFFFFF. | |||
* @note Macro @ref IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance supports a 32 bits counter. | |||
* @note Macro @ref IS_TIM_CC3_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_CC3_INSTANCE(TIMx) can be used to check whether or not | |||
* input channel 3 is supported by a timer instance. | |||
* @rmtoll CCR3 CCR3 LL_TIM_IC_GetCaptureCH3 | |||
* @param TIMx Timer instance | |||
@@ -2993,9 +3000,9 @@ __STATIC_INLINE uint32_t LL_TIM_IC_GetCaptureCH3(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Get captured value for input channel 4. | |||
* @note In 32-bit timer implementations returned captured value can be between 0x00000000 and 0xFFFFFFFF. | |||
* @note Macro @ref IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance supports a 32 bits counter. | |||
* @note Macro @ref IS_TIM_CC4_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_CC4_INSTANCE(TIMx) can be used to check whether or not | |||
* input channel 4 is supported by a timer instance. | |||
* @rmtoll CCR4 CCR4 LL_TIM_IC_GetCaptureCH4 | |||
* @param TIMx Timer instance | |||
@@ -3016,7 +3023,7 @@ __STATIC_INLINE uint32_t LL_TIM_IC_GetCaptureCH4(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Enable external clock mode 2. | |||
* @note When external clock mode 2 is enabled the counter is clocked by any active edge on the ETRF signal. | |||
* @note Macro @ref IS_TIM_CLOCKSOURCE_ETRMODE2_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_CLOCKSOURCE_ETRMODE2_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance supports external clock mode2. | |||
* @rmtoll SMCR ECE LL_TIM_EnableExternalClock | |||
* @param TIMx Timer instance | |||
@@ -3029,7 +3036,7 @@ __STATIC_INLINE void LL_TIM_EnableExternalClock(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Disable external clock mode 2. | |||
* @note Macro @ref IS_TIM_CLOCKSOURCE_ETRMODE2_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_CLOCKSOURCE_ETRMODE2_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance supports external clock mode2. | |||
* @rmtoll SMCR ECE LL_TIM_DisableExternalClock | |||
* @param TIMx Timer instance | |||
@@ -3042,7 +3049,7 @@ __STATIC_INLINE void LL_TIM_DisableExternalClock(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Indicate whether external clock mode 2 is enabled. | |||
* @note Macro @ref IS_TIM_CLOCKSOURCE_ETRMODE2_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_CLOCKSOURCE_ETRMODE2_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance supports external clock mode2. | |||
* @rmtoll SMCR ECE LL_TIM_IsEnabledExternalClock | |||
* @param TIMx Timer instance | |||
@@ -3059,9 +3066,9 @@ __STATIC_INLINE uint32_t LL_TIM_IsEnabledExternalClock(TIM_TypeDef *TIMx) | |||
* the external clock is applied is selected by calling the @ref LL_TIM_SetTriggerInput() | |||
* function. This timer input must be configured by calling | |||
* the @ref LL_TIM_IC_Config() function. | |||
* @note Macro @ref IS_TIM_CLOCKSOURCE_ETRMODE1_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_CLOCKSOURCE_ETRMODE1_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance supports external clock mode1. | |||
* @note Macro @ref IS_TIM_CLOCKSOURCE_ETRMODE2_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_CLOCKSOURCE_ETRMODE2_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance supports external clock mode2. | |||
* @rmtoll SMCR SMS LL_TIM_SetClockSource\n | |||
* SMCR ECE LL_TIM_SetClockSource | |||
@@ -3079,7 +3086,7 @@ __STATIC_INLINE void LL_TIM_SetClockSource(TIM_TypeDef *TIMx, uint32_t ClockSour | |||
/** | |||
* @brief Set the encoder interface mode. | |||
* @note Macro @ref IS_TIM_ENCODER_INTERFACE_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_ENCODER_INTERFACE_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance supports the encoder mode. | |||
* @rmtoll SMCR SMS LL_TIM_SetEncoderMode | |||
* @param TIMx Timer instance | |||
@@ -3103,7 +3110,7 @@ __STATIC_INLINE void LL_TIM_SetEncoderMode(TIM_TypeDef *TIMx, uint32_t EncoderMo | |||
*/ | |||
/** | |||
* @brief Set the trigger output (TRGO) used for timer synchronization . | |||
* @note Macro @ref IS_TIM_MASTER_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_MASTER_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance can operate as a master timer. | |||
* @rmtoll CR2 MMS LL_TIM_SetTriggerOutput | |||
* @param TIMx Timer instance | |||
@@ -3125,7 +3132,7 @@ __STATIC_INLINE void LL_TIM_SetTriggerOutput(TIM_TypeDef *TIMx, uint32_t TimerSy | |||
/** | |||
* @brief Set the trigger output 2 (TRGO2) used for ADC synchronization . | |||
* @note Macro @ref IS_TIM_TRGO2_INSTANCE(TIMx) can be used to check | |||
* @note Macro IS_TIM_TRGO2_INSTANCE(TIMx) can be used to check | |||
* whether or not a timer instance can be used for ADC synchronization. | |||
* @rmtoll CR2 MMS2 LL_TIM_SetTriggerOutput2 | |||
* @param TIMx Timer Instance | |||
@@ -3155,7 +3162,7 @@ __STATIC_INLINE void LL_TIM_SetTriggerOutput2(TIM_TypeDef *TIMx, uint32_t ADCSyn | |||
/** | |||
* @brief Set the synchronization mode of a slave timer. | |||
* @note Macro @ref IS_TIM_SLAVE_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_SLAVE_INSTANCE(TIMx) can be used to check whether or not | |||
* a timer instance can operate as a slave timer. | |||
* @rmtoll SMCR SMS LL_TIM_SetSlaveMode | |||
* @param TIMx Timer instance | |||
@@ -3174,7 +3181,7 @@ __STATIC_INLINE void LL_TIM_SetSlaveMode(TIM_TypeDef *TIMx, uint32_t SlaveMode) | |||
/** | |||
* @brief Set the selects the trigger input to be used to synchronize the counter. | |||
* @note Macro @ref IS_TIM_SLAVE_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_SLAVE_INSTANCE(TIMx) can be used to check whether or not | |||
* a timer instance can operate as a slave timer. | |||
* @rmtoll SMCR TS LL_TIM_SetTriggerInput | |||
* @param TIMx Timer instance | |||
@@ -3196,7 +3203,7 @@ __STATIC_INLINE void LL_TIM_SetTriggerInput(TIM_TypeDef *TIMx, uint32_t TriggerI | |||
/** | |||
* @brief Enable the Master/Slave mode. | |||
* @note Macro @ref IS_TIM_SLAVE_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_SLAVE_INSTANCE(TIMx) can be used to check whether or not | |||
* a timer instance can operate as a slave timer. | |||
* @rmtoll SMCR MSM LL_TIM_EnableMasterSlaveMode | |||
* @param TIMx Timer instance | |||
@@ -3209,7 +3216,7 @@ __STATIC_INLINE void LL_TIM_EnableMasterSlaveMode(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Disable the Master/Slave mode. | |||
* @note Macro @ref IS_TIM_SLAVE_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_SLAVE_INSTANCE(TIMx) can be used to check whether or not | |||
* a timer instance can operate as a slave timer. | |||
* @rmtoll SMCR MSM LL_TIM_DisableMasterSlaveMode | |||
* @param TIMx Timer instance | |||
@@ -3222,7 +3229,7 @@ __STATIC_INLINE void LL_TIM_DisableMasterSlaveMode(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Indicates whether the Master/Slave mode is enabled. | |||
* @note Macro @ref IS_TIM_SLAVE_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_SLAVE_INSTANCE(TIMx) can be used to check whether or not | |||
* a timer instance can operate as a slave timer. | |||
* @rmtoll SMCR MSM LL_TIM_IsEnabledMasterSlaveMode | |||
* @param TIMx Timer instance | |||
@@ -3235,7 +3242,7 @@ __STATIC_INLINE uint32_t LL_TIM_IsEnabledMasterSlaveMode(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Configure the external trigger (ETR) input. | |||
* @note Macro @ref IS_TIM_ETR_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_ETR_INSTANCE(TIMx) can be used to check whether or not | |||
* a timer instance provides an external trigger input. | |||
* @rmtoll SMCR ETP LL_TIM_ConfigETR\n | |||
* SMCR ETPS LL_TIM_ConfigETR\n | |||
@@ -3276,17 +3283,21 @@ __STATIC_INLINE void LL_TIM_ConfigETR(TIM_TypeDef *TIMx, uint32_t ETRPolarity, u | |||
/** | |||
* @brief Select the external trigger (ETR) input source. | |||
* @note Macro @ref IS_TIM_ETRSEL_INSTANCE(TIMx) can be used to check whether or | |||
* @note Macro IS_TIM_ETRSEL_INSTANCE(TIMx) can be used to check whether or | |||
* not a timer instance supports ETR source selection. | |||
* @note When this function is called with LL_TIM_ETRSOURCE_GPIO, | |||
* LL_TIM_ETRSOURCE_ADC1_AWD1, LL_TIM_ETRSOURCE_ADC1_AWD2 or | |||
* LL_TIM_ETRSOURCE_ADC1_AWD3, ETR source relies on TIMx ETR remapping | |||
* capability configured through the function @ref LL_TIM_SetRemap(). | |||
* @rmtoll AF1 ETRSEL LL_TIM_SetETRSource | |||
* @param TIMx Timer instance | |||
* @param ETRSource This parameter can be one of the following values: | |||
* @arg @ref LL_TIM_ETRSOURCE_GPIO | |||
* @arg @ref LL_TIM_ETRSOURCE_COMP1 | |||
* @arg @ref LL_TIM_ETRSOURCE_COMP2 | |||
* @arg @ref LL_TIM_ETRSOURCE_ADC1_AWD1 | |||
* @arg @ref LL_TIM_ETRSOURCE_ADC1_AWD2 | |||
* @arg @ref LL_TIM_ETRSOURCE_ADC1_AWD3 | |||
* @arg @ref LL_TIM_ETRSOURCE_COMP1 | |||
* @arg @ref LL_TIM_ETRSOURCE_COMP2 | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_TIM_SetETRSource(TIM_TypeDef *TIMx, uint32_t ETRSource) | |||
@@ -3304,7 +3315,7 @@ __STATIC_INLINE void LL_TIM_SetETRSource(TIM_TypeDef *TIMx, uint32_t ETRSource) | |||
*/ | |||
/** | |||
* @brief Enable the break function. | |||
* @note Macro @ref IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not | |||
* a timer instance provides a break input. | |||
* @rmtoll BDTR BKE LL_TIM_EnableBRK | |||
* @param TIMx Timer instance | |||
@@ -3319,7 +3330,7 @@ __STATIC_INLINE void LL_TIM_EnableBRK(TIM_TypeDef *TIMx) | |||
* @brief Disable the break function. | |||
* @rmtoll BDTR BKE LL_TIM_DisableBRK | |||
* @param TIMx Timer instance | |||
* @note Macro @ref IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not | |||
* a timer instance provides a break input. | |||
* @retval None | |||
*/ | |||
@@ -3330,7 +3341,7 @@ __STATIC_INLINE void LL_TIM_DisableBRK(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Configure the break input. | |||
* @note Macro @ref IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not | |||
* a timer instance provides a break input. | |||
* @rmtoll BDTR BKP LL_TIM_ConfigBRK\n | |||
* BDTR BKF LL_TIM_ConfigBRK | |||
@@ -3365,7 +3376,7 @@ __STATIC_INLINE void LL_TIM_ConfigBRK(TIM_TypeDef *TIMx, uint32_t BreakPolarity, | |||
/** | |||
* @brief Enable the break 2 function. | |||
* @note Macro @ref IS_TIM_BKIN2_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_BKIN2_INSTANCE(TIMx) can be used to check whether or not | |||
* a timer instance provides a second break input. | |||
* @rmtoll BDTR BK2E LL_TIM_EnableBRK2 | |||
* @param TIMx Timer instance | |||
@@ -3378,7 +3389,7 @@ __STATIC_INLINE void LL_TIM_EnableBRK2(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Disable the break 2 function. | |||
* @note Macro @ref IS_TIM_BKIN2_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_BKIN2_INSTANCE(TIMx) can be used to check whether or not | |||
* a timer instance provides a second break input. | |||
* @rmtoll BDTR BK2E LL_TIM_DisableBRK2 | |||
* @param TIMx Timer instance | |||
@@ -3391,7 +3402,7 @@ __STATIC_INLINE void LL_TIM_DisableBRK2(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Configure the break 2 input. | |||
* @note Macro @ref IS_TIM_BKIN2_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_BKIN2_INSTANCE(TIMx) can be used to check whether or not | |||
* a timer instance provides a second break input. | |||
* @rmtoll BDTR BK2P LL_TIM_ConfigBRK2\n | |||
* BDTR BK2F LL_TIM_ConfigBRK2 | |||
@@ -3425,7 +3436,7 @@ __STATIC_INLINE void LL_TIM_ConfigBRK2(TIM_TypeDef *TIMx, uint32_t Break2Polarit | |||
/** | |||
* @brief Select the outputs off state (enabled v.s. disabled) in Idle and Run modes. | |||
* @note Macro @ref IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not | |||
* a timer instance provides a break input. | |||
* @rmtoll BDTR OSSI LL_TIM_SetOffStates\n | |||
* BDTR OSSR LL_TIM_SetOffStates | |||
@@ -3445,7 +3456,7 @@ __STATIC_INLINE void LL_TIM_SetOffStates(TIM_TypeDef *TIMx, uint32_t OffStateIdl | |||
/** | |||
* @brief Enable automatic output (MOE can be set by software or automatically when a break input is active). | |||
* @note Macro @ref IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not | |||
* a timer instance provides a break input. | |||
* @rmtoll BDTR AOE LL_TIM_EnableAutomaticOutput | |||
* @param TIMx Timer instance | |||
@@ -3458,7 +3469,7 @@ __STATIC_INLINE void LL_TIM_EnableAutomaticOutput(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Disable automatic output (MOE can be set only by software). | |||
* @note Macro @ref IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not | |||
* a timer instance provides a break input. | |||
* @rmtoll BDTR AOE LL_TIM_DisableAutomaticOutput | |||
* @param TIMx Timer instance | |||
@@ -3471,7 +3482,7 @@ __STATIC_INLINE void LL_TIM_DisableAutomaticOutput(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Indicate whether automatic output is enabled. | |||
* @note Macro @ref IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not | |||
* a timer instance provides a break input. | |||
* @rmtoll BDTR AOE LL_TIM_IsEnabledAutomaticOutput | |||
* @param TIMx Timer instance | |||
@@ -3486,7 +3497,7 @@ __STATIC_INLINE uint32_t LL_TIM_IsEnabledAutomaticOutput(TIM_TypeDef *TIMx) | |||
* @brief Enable the outputs (set the MOE bit in TIMx_BDTR register). | |||
* @note The MOE bit in TIMx_BDTR register allows to enable /disable the outputs by | |||
* software and is reset in case of break or break2 event | |||
* @note Macro @ref IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not | |||
* a timer instance provides a break input. | |||
* @rmtoll BDTR MOE LL_TIM_EnableAllOutputs | |||
* @param TIMx Timer instance | |||
@@ -3501,7 +3512,7 @@ __STATIC_INLINE void LL_TIM_EnableAllOutputs(TIM_TypeDef *TIMx) | |||
* @brief Disable the outputs (reset the MOE bit in TIMx_BDTR register). | |||
* @note The MOE bit in TIMx_BDTR register allows to enable /disable the outputs by | |||
* software and is reset in case of break or break2 event. | |||
* @note Macro @ref IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not | |||
* a timer instance provides a break input. | |||
* @rmtoll BDTR MOE LL_TIM_DisableAllOutputs | |||
* @param TIMx Timer instance | |||
@@ -3514,7 +3525,7 @@ __STATIC_INLINE void LL_TIM_DisableAllOutputs(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Indicates whether outputs are enabled. | |||
* @note Macro @ref IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not | |||
* a timer instance provides a break input. | |||
* @rmtoll BDTR MOE LL_TIM_IsEnabledAllOutputs | |||
* @param TIMx Timer instance | |||
@@ -3527,22 +3538,24 @@ __STATIC_INLINE uint32_t LL_TIM_IsEnabledAllOutputs(TIM_TypeDef *TIMx) | |||
/** | |||
* @brief Enable the signals connected to the designated timer break input. | |||
* @note Macro @ref IS_TIM_BREAKSOURCE_INSTANCE(TIMx) can be used to check whether | |||
* @note Macro IS_TIM_BREAKSOURCE_INSTANCE(TIMx) can be used to check whether | |||
* or not a timer instance allows for break input selection. | |||
* @rmtoll AF1 BKINE LL_TIM_EnableBreakInputSource\n | |||
* AF1 BKCMP1E LL_TIM_EnableBreakInputSource\n | |||
* AF1 BKCMP2E LL_TIM_EnableBreakInputSource\n | |||
* AF2 BKINE LL_TIM_EnableBreakInputSource\n | |||
* AF2 BKCMP1E LL_TIM_EnableBreakInputSource\n | |||
* AF2 BKCMP2E LL_TIM_EnableBreakInputSource\n | |||
* AF2 BK2INE LL_TIM_EnableBreakInputSource\n | |||
* AF2 BK2CMP1E LL_TIM_EnableBreakInputSource\n | |||
* AF2 BK2CMP2E LL_TIM_EnableBreakInputSource | |||
* @param TIMx Timer instance | |||
* @param BreakInput This parameter can be one of the following values: | |||
* @arg @ref LL_TIM_BREAK_INPUT_BKIN | |||
* @arg @ref LL_TIM_BREAK_INPUT_BKIN2 | |||
* @param Source This parameter can be one of the following values: | |||
* @arg @ref LL_TIM_BKIN_SOURCE_BKIN | |||
* @arg @ref LL_TIM_BKIN_SOURCE_BKCOMP1 | |||
* @arg @ref LL_TIM_BKIN_SOURCE_BKCOMP2 | |||
* @arg @ref LL_TIM_BKIN_SOURCE_BKCOMP1 (*) | |||
* @arg @ref LL_TIM_BKIN_SOURCE_BKCOMP2 (*) | |||
* | |||
* (*) Value not defined in all devices. | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_TIM_EnableBreakInputSource(TIM_TypeDef *TIMx, uint32_t BreakInput, uint32_t Source) | |||
@@ -3553,22 +3566,24 @@ __STATIC_INLINE void LL_TIM_EnableBreakInputSource(TIM_TypeDef *TIMx, uint32_t B | |||
/** | |||
* @brief Disable the signals connected to the designated timer break input. | |||
* @note Macro @ref IS_TIM_BREAKSOURCE_INSTANCE(TIMx) can be used to check whether | |||
* @note Macro IS_TIM_BREAKSOURCE_INSTANCE(TIMx) can be used to check whether | |||
* or not a timer instance allows for break input selection. | |||
* @rmtoll AF1 BKINE LL_TIM_DisableBreakInputSource\n | |||
* AF1 BKCMP1E LL_TIM_DisableBreakInputSource\n | |||
* AF1 BKCMP2E LL_TIM_DisableBreakInputSource\n | |||
* AF2 BKINE LL_TIM_DisableBreakInputSource\n | |||
* AF2 BKCMP1E LL_TIM_DisableBreakInputSource\n | |||
* AF2 BKCMP2E LL_TIM_DisableBreakInputSource\n | |||
* AF2 BK2INE LL_TIM_DisableBreakInputSource\n | |||
* AF2 BK2CMP1E LL_TIM_DisableBreakInputSource\n | |||
* AF2 BK2CMP2E LL_TIM_DisableBreakInputSource | |||
* @param TIMx Timer instance | |||
* @param BreakInput This parameter can be one of the following values: | |||
* @arg @ref LL_TIM_BREAK_INPUT_BKIN | |||
* @arg @ref LL_TIM_BREAK_INPUT_BKIN2 | |||
* @param Source This parameter can be one of the following values: | |||
* @arg @ref LL_TIM_BKIN_SOURCE_BKIN | |||
* @arg @ref LL_TIM_BKIN_SOURCE_BKCOMP1 | |||
* @arg @ref LL_TIM_BKIN_SOURCE_BKCOMP2 | |||
* @arg @ref LL_TIM_BKIN_SOURCE_BKCOMP1 (*) | |||
* @arg @ref LL_TIM_BKIN_SOURCE_BKCOMP2 (*) | |||
* | |||
* (*) Value not defined in all devices. | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_TIM_DisableBreakInputSource(TIM_TypeDef *TIMx, uint32_t BreakInput, uint32_t Source) | |||
@@ -3579,7 +3594,7 @@ __STATIC_INLINE void LL_TIM_DisableBreakInputSource(TIM_TypeDef *TIMx, uint32_t | |||
/** | |||
* @brief Set the polarity of the break signal for the timer break input. | |||
* @note Macro @ref IS_TIM_BREAKSOURCE_INSTANCE(TIMx) can be used to check whether | |||
* @note Macro IS_TIM_BREAKSOURCE_INSTANCE(TIMx) can be used to check whether | |||
* or not a timer instance allows for break input selection. | |||
* @rmtoll AF1 BKINP LL_TIM_SetBreakInputSourcePolarity\n | |||
* AF1 BKCMP1P LL_TIM_SetBreakInputSourcePolarity\n | |||
@@ -3593,11 +3608,13 @@ __STATIC_INLINE void LL_TIM_DisableBreakInputSource(TIM_TypeDef *TIMx, uint32_t | |||
* @arg @ref LL_TIM_BREAK_INPUT_BKIN2 | |||
* @param Source This parameter can be one of the following values: | |||
* @arg @ref LL_TIM_BKIN_SOURCE_BKIN | |||
* @arg @ref LL_TIM_BKIN_SOURCE_BKCOMP1 | |||
* @arg @ref LL_TIM_BKIN_SOURCE_BKCOMP2 | |||
* @arg @ref LL_TIM_BKIN_SOURCE_BKCOMP1 (*) | |||
* @arg @ref LL_TIM_BKIN_SOURCE_BKCOMP2 (*) | |||
* @param Polarity This parameter can be one of the following values: | |||
* @arg @ref LL_TIM_BKIN_POLARITY_LOW | |||
* @arg @ref LL_TIM_BKIN_POLARITY_HIGH | |||
* | |||
* (*) Value not defined in all devices. | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_TIM_SetBreakInputSourcePolarity(TIM_TypeDef *TIMx, uint32_t BreakInput, uint32_t Source, | |||
@@ -3615,7 +3632,7 @@ __STATIC_INLINE void LL_TIM_SetBreakInputSourcePolarity(TIM_TypeDef *TIMx, uint3 | |||
*/ | |||
/** | |||
* @brief Configures the timer DMA burst feature. | |||
* @note Macro @ref IS_TIM_DMABURST_INSTANCE(TIMx) can be used to check whether or | |||
* @note Macro IS_TIM_DMABURST_INSTANCE(TIMx) can be used to check whether or | |||
* not a timer instance supports the DMA burst mode. | |||
* @rmtoll DCR DBL LL_TIM_ConfigDMABurst\n | |||
* DCR DBA LL_TIM_ConfigDMABurst | |||
@@ -3680,7 +3697,7 @@ __STATIC_INLINE void LL_TIM_ConfigDMABurst(TIM_TypeDef *TIMx, uint32_t DMABurstB | |||
*/ | |||
/** | |||
* @brief Remap TIM inputs (input channel, internal/external triggers). | |||
* @note Macro @ref IS_TIM_REMAP_INSTANCE(TIMx) can be used to check whether or not | |||
* @note Macro IS_TIM_REMAP_INSTANCE(TIMx) can be used to check whether or not | |||
* a some timer inputs can be remapped. | |||
* @rmtoll TIM1_OR ETR_ADC1_RMP LL_TIM_SetRemap\n | |||
* TIM1_OR TI1_RMP LL_TIM_SetRemap\n | |||
@@ -3688,7 +3705,7 @@ __STATIC_INLINE void LL_TIM_ConfigDMABurst(TIM_TypeDef *TIMx, uint32_t DMABurstB | |||
* TIM2_OR TI4_RMP LL_TIM_SetRemap\n | |||
* TIM2_OR TI1_RMP LL_TIM_SetRemap\n | |||
* TIM16_OR TI1_RMP LL_TIM_SetRemap\n | |||
* TIM17_OR TI1_RMP LL_TIM_SetRemap\n | |||
* TIM17_OR TI1_RMP LL_TIM_SetRemap | |||
* @param TIMx Timer instance | |||
* @param Remap Remap param depends on the TIMx. Description available only | |||
* in CHM version of the User Manual (not in .pdf). | |||
@@ -3706,13 +3723,13 @@ __STATIC_INLINE void LL_TIM_ConfigDMABurst(TIM_TypeDef *TIMx, uint32_t DMABurstB | |||
* | |||
* . . TI1_RMP can be one of the following values | |||
* @arg @ref LL_TIM_TIM1_TI1_RMP_GPIO | |||
* @arg @ref LL_TIM_TIM1_TI1_RMP_COMP1 | |||
* @arg @ref LL_TIM_TIM1_TI1_RMP_COMP1 (*) | |||
* | |||
* TIM2: any combination of ITR1_RMP, ETR1_RMP, TI4_RMP where | |||
* | |||
* ITR1_RMP can be one of the following values | |||
* @arg @ref LL_TIM_TIM2_ITR1_RMP_NONE | |||
* @arg @ref LL_TIM_TIM2_ITR1_RMP_USB_SOF | |||
* @arg @ref LL_TIM_TIM2_ITR1_RMP_USB_SOF (*) | |||
* | |||
* . . ETR1_RMP can be one of the following values | |||
* @arg @ref LL_TIM_TIM2_ETR_RMP_GPIO | |||
@@ -3720,9 +3737,9 @@ __STATIC_INLINE void LL_TIM_ConfigDMABurst(TIM_TypeDef *TIMx, uint32_t DMABurstB | |||
* | |||
* . . TI4_RMP can be one of the following values | |||
* @arg @ref LL_TIM_TIM2_TI4_RMP_GPIO | |||
* @arg @ref LL_TIM_TIM2_TI4_RMP_COMP1 | |||
* @arg @ref LL_TIM_TIM2_TI4_RMP_COMP2 | |||
* @arg @ref LL_TIM_TIM2_TI4_RMP_COMP1_COMP2 | |||
* @arg @ref LL_TIM_TIM2_TI4_RMP_COMP1 (*) | |||
* @arg @ref LL_TIM_TIM2_TI4_RMP_COMP2 (*) | |||
* @arg @ref LL_TIM_TIM2_TI4_RMP_COMP1_COMP2 (*) | |||
* | |||
* TIM16: one of the following values | |||
* | |||
@@ -3737,6 +3754,8 @@ __STATIC_INLINE void LL_TIM_ConfigDMABurst(TIM_TypeDef *TIMx, uint32_t DMABurstB | |||
* @arg @ref LL_TIM_TIM17_TI1_RMP_MSI | |||
* @arg @ref LL_TIM_TIM17_TI1_RMP_HSE_32 | |||
* @arg @ref LL_TIM_TIM17_TI1_RMP_MCO | |||
* | |||
* (*) Value not defined in all devices. \n | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_TIM_SetRemap(TIM_TypeDef *TIMx, uint32_t Remap) | |||
@@ -151,6 +151,14 @@ typedef struct | |||
* @} | |||
*/ | |||
/** @defgroup USB_LL Device Speed | |||
* @{ | |||
*/ | |||
#define USBD_FS_SPEED 2U | |||
/** | |||
* @} | |||
*/ | |||
#define BTABLE_ADDRESS 0x000U | |||
#define PMA_ACCESS 1U | |||
@@ -101,7 +101,7 @@ typedef struct | |||
@ref LL_RCC_PLL_ConfigDomain_SYS(). */ | |||
uint32_t PLLN; /*!< Multiplication factor for PLL VCO output clock. | |||
This parameter must be a number between Min_Data = 8 and Max_Data = 86 | |||
This parameter must be a number between Min_Data = 6 and Max_Data = 127 | |||
This feature can be modified afterwards using unitary function | |||
@ref LL_RCC_PLL_ConfigDomain_SYS(). */ | |||
@@ -195,59 +195,59 @@ typedef struct | |||
/** @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 (uint32_t)(READ_REG(*((uint32_t *)FLASHSIZE_BASE_ADDRESS)) & 0x0000FFFFUL); | |||
} | |||
/** | |||
* @brief Get Package type | |||
* @retval Returned value can be one of the following values: | |||
* @arg @ref LL_UTILS_PACKAGETYPE_CSP100 | |||
* @arg @ref LL_UTILS_PACKAGETYPE_CSP100_C | |||
* @arg @ref LL_UTILS_PACKAGETYPE_QFN68 | |||
* @arg @ref LL_UTILS_PACKAGETYPE_QFN68_C | |||
* @arg @ref LL_UTILS_PACKAGETYPE_QFN48 | |||
* @arg @ref LL_UTILS_PACKAGETYPE_QFN48_C | |||
* | |||
*/ | |||
__STATIC_INLINE uint32_t LL_GetPackageType(void) | |||
{ | |||
return (uint32_t)(READ_REG(*((uint32_t *)PACKAGE_BASE_ADDRESS)) & 0x1FU); | |||
} | |||
/** | |||
* @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 (uint32_t)(READ_REG(*((uint32_t *)FLASHSIZE_BASE_ADDRESS)) & 0x0000FFFFUL); | |||
} | |||
/** | |||
* @brief Get Package type | |||
* @retval Returned value can be one of the following values: | |||
* @arg @ref LL_UTILS_PACKAGETYPE_CSP100 | |||
* @arg @ref LL_UTILS_PACKAGETYPE_CSP100_C | |||
* @arg @ref LL_UTILS_PACKAGETYPE_QFN68 | |||
* @arg @ref LL_UTILS_PACKAGETYPE_QFN68_C | |||
* @arg @ref LL_UTILS_PACKAGETYPE_QFN48 | |||
* @arg @ref LL_UTILS_PACKAGETYPE_QFN48_C | |||
* | |||
*/ | |||
__STATIC_INLINE uint32_t LL_GetPackageType(void) | |||
{ | |||
return (uint32_t)(READ_REG(*((uint32_t *)PACKAGE_BASE_ADDRESS)) & 0x1FU); | |||
} | |||
/** | |||
* @} | |||
@@ -58,8 +58,8 @@ extern "C" { | |||
*/ | |||
/** @defgroup WWDG_LL_EC_PRESCALER PRESCALER | |||
* @{ | |||
*/ | |||
* @{ | |||
*/ | |||
#define LL_WWDG_PRESCALER_1 0x00000000u /*!< WWDG counter clock = (PCLK1/4096)/1 */ | |||
#define LL_WWDG_PRESCALER_2 WWDG_CFR_WDGTB_0 /*!< WWDG counter clock = (PCLK1/4096)/2 */ | |||
#define LL_WWDG_PRESCALER_4 WWDG_CFR_WDGTB_1 /*!< WWDG counter clock = (PCLK1/4096)/4 */ | |||
@@ -183,7 +183,7 @@ __STATIC_INLINE uint32_t LL_WWDG_GetCounter(WWDG_TypeDef *WWDGx) | |||
* @arg @ref LL_WWDG_PRESCALER_32 | |||
* @arg @ref LL_WWDG_PRESCALER_64 | |||
* @arg @ref LL_WWDG_PRESCALER_128 | |||
* @retval None | |||
* @retval None | |||
*/ | |||
__STATIC_INLINE void LL_WWDG_SetPrescaler(WWDG_TypeDef *WWDGx, uint32_t Prescaler) | |||
{ | |||
@@ -56,7 +56,7 @@ | |||
* @brief STM32WBxx HAL Driver version number | |||
*/ | |||
#define __STM32WBxx_HAL_VERSION_MAIN (0x01U) /*!< [31:24] main version */ | |||
#define __STM32WBxx_HAL_VERSION_SUB1 (0x01U) /*!< [23:16] sub1 version */ | |||
#define __STM32WBxx_HAL_VERSION_SUB1 (0x05U) /*!< [23:16] sub1 version */ | |||
#define __STM32WBxx_HAL_VERSION_SUB2 (0x00U) /*!< [15:8] sub2 version */ | |||
#define __STM32WBxx_HAL_VERSION_RC (0x00U) /*!< [7:0] release candidate */ | |||
#define __STM32WBxx_HAL_VERSION ((__STM32WBxx_HAL_VERSION_MAIN << 24U)\ | |||
@@ -64,7 +64,9 @@ | |||
|(__STM32WBxx_HAL_VERSION_SUB2 << 8U )\ | |||
|(__STM32WBxx_HAL_VERSION_RC)) | |||
#if defined(VREFBUF) | |||
#define VREFBUF_TIMEOUT_VALUE 10U /* 10 ms */ | |||
#endif | |||
/** | |||
* @} | |||
@@ -77,7 +79,7 @@ | |||
*/ | |||
__IO uint32_t uwTick; | |||
uint32_t uwTickPrio = (1UL << __NVIC_PRIO_BITS); /* Invalid PRIO */ | |||
uint32_t uwTickFreq = HAL_TICK_FREQ_DEFAULT; /* 1KHz */ | |||
HAL_TickFreqTypeDef uwTickFreq = HAL_TICK_FREQ_DEFAULT; /* 1KHz */ | |||
/** | |||
* @} | |||
*/ | |||
@@ -344,17 +346,29 @@ uint32_t HAL_GetTickPrio(void) | |||
* @brief Set new tick Freq. | |||
* @retval Status | |||
*/ | |||
HAL_StatusTypeDef HAL_SetTickFreq(uint32_t Freq) | |||
HAL_StatusTypeDef HAL_SetTickFreq(HAL_TickFreqTypeDef Freq) | |||
{ | |||
HAL_StatusTypeDef status = HAL_OK; | |||
HAL_TickFreqTypeDef prevTickFreq; | |||
assert_param(IS_TICKFREQ(Freq)); | |||
if (uwTickFreq != Freq) | |||
{ | |||
/* Back up uwTickFreq frequency */ | |||
prevTickFreq = uwTickFreq; | |||
/* Update uwTickFreq global variable used by HAL_InitTick() */ | |||
uwTickFreq = Freq; | |||
/* Apply the new tick Freq */ | |||
status = HAL_InitTick(uwTickPrio); | |||
if (status != HAL_OK) | |||
{ | |||
/* Restore previous tick frequency */ | |||
uwTickFreq = prevTickFreq; | |||
} | |||
} | |||
return status; | |||
@@ -364,7 +378,7 @@ HAL_StatusTypeDef HAL_SetTickFreq(uint32_t Freq) | |||
* @brief Return tick frequency. | |||
* @retval tick period in Hz | |||
*/ | |||
uint32_t HAL_GetTickFreq(void) | |||
HAL_TickFreqTypeDef HAL_GetTickFreq(void) | |||
{ | |||
return uwTickFreq; | |||
} | |||
@@ -575,6 +589,7 @@ void HAL_DBGMCU_DisableDBGStandbyMode(void) | |||
(+) Enable/Disable the Voltage reference buffer | |||
(+) Enable/Disable the I/O analog switch voltage booster | |||
(+) Enable/Disable the access for security IP (AES1, AES2, PKA, RNG) | |||
(+) Enable/Disable the access for security IP (AES2, PKA, RNG) | |||
@endverbatim | |||
* @{ | |||
@@ -614,6 +629,7 @@ uint32_t HAL_SYSCFG_IsEnabledSRAMFetch(void) | |||
return (LL_SYSCFG_IsEnabledSRAMFetch()); | |||
} | |||
#if defined(VREFBUF) | |||
/** | |||
* @brief Configure the internal voltage reference buffer voltage scale. | |||
* @param VoltageScaling specifies the output voltage to achieve | |||
@@ -622,14 +638,31 @@ uint32_t HAL_SYSCFG_IsEnabledSRAMFetch(void) | |||
* This requires VDDA equal to or higher than 2.4 V. | |||
* @arg @ref SYSCFG_VREFBUF_VOLTAGE_SCALE1 : VREF_OUT1 around 2.5 V. | |||
* This requires VDDA equal to or higher than 2.8 V. | |||
* @note Retrieve the TrimmingValue from factory located at | |||
* VREFBUF_SC0_CAL_ADDR or VREFBUF_SC1_CAL_ADDR addresses. | |||
* @retval None | |||
*/ | |||
void HAL_SYSCFG_VREFBUF_VoltageScalingConfig(uint32_t VoltageScaling) | |||
{ | |||
uint32_t TrimmingValue; | |||
/* Check the parameters */ | |||
assert_param(IS_SYSCFG_VREFBUF_VOLTAGE_SCALE(VoltageScaling)); | |||
LL_VREFBUF_SetVoltageScaling(VoltageScaling); | |||
/* Restrieve Calibration data and store them into trimming field */ | |||
if (VoltageScaling == SYSCFG_VREFBUF_VOLTAGE_SCALE0) | |||
{ | |||
TrimmingValue = ((uint32_t) *VREFBUF_SC0_CAL_ADDR) & 0x3FU; | |||
} | |||
else | |||
{ | |||
TrimmingValue = ((uint32_t) *VREFBUF_SC1_CAL_ADDR) & 0x3FU; | |||
} | |||
assert_param(IS_SYSCFG_VREFBUF_TRIMMING(TrimmingValue)); | |||
HAL_SYSCFG_VREFBUF_TrimmingConfig(TrimmingValue); | |||
} | |||
/** | |||
@@ -651,6 +684,12 @@ void HAL_SYSCFG_VREFBUF_HighImpedanceConfig(uint32_t Mode) | |||
/** | |||
* @brief Tune the Internal Voltage Reference buffer (VREFBUF). | |||
* @note Each VrefBuf voltage scale is calibrated in production for each device, | |||
* data stored in flash memory. | |||
* Function @ref HAL_SYSCFG_VREFBUF_VoltageScalingConfig retrieves and | |||
* applies this calibration data as trimming value at each scale change. | |||
* Therefore, optionally, function @ref HAL_SYSCFG_VREFBUF_TrimmingConfig | |||
* can be used in a second time to fine tune the trimming. | |||
* @param TrimmingValue specifies trimming code for VREFBUF calibration | |||
* This parameter can be a number between Min_Data = 0x00 and Max_Data = 0x3F | |||
* @retval None | |||
@@ -698,6 +737,7 @@ void HAL_SYSCFG_DisableVREFBUF(void) | |||
{ | |||
LL_VREFBUF_Disable(); | |||
} | |||
#endif /* VREFBUF */ | |||
/** | |||
* @brief Enable the I/O analog switch voltage booster | |||
@@ -121,7 +121,7 @@ | |||
* @arg @ref ADC_DIFFERENTIAL_ENDED Channel in mode input differential ended | |||
* @retval HAL status | |||
*/ | |||
HAL_StatusTypeDef HAL_ADCEx_Calibration_Start(ADC_HandleTypeDef* hadc, uint32_t SingleDiff) | |||
HAL_StatusTypeDef HAL_ADCEx_Calibration_Start(ADC_HandleTypeDef *hadc, uint32_t SingleDiff) | |||
{ | |||
HAL_StatusTypeDef tmp_hal_status; | |||
__IO uint32_t wait_loop_index = 0UL; | |||
@@ -150,7 +150,7 @@ HAL_StatusTypeDef HAL_ADCEx_Calibration_Start(ADC_HandleTypeDef* hadc, uint32_t | |||
LL_ADC_StartCalibration(hadc->Instance, SingleDiff); | |||
/* Wait for calibration completion */ | |||
while(LL_ADC_IsCalibrationOnGoing(hadc->Instance) != 0UL) | |||
while (LL_ADC_IsCalibrationOnGoing(hadc->Instance) != 0UL) | |||
{ | |||
wait_loop_index++; | |||
if (wait_loop_index >= ADC_CALIBRATION_TIMEOUT) | |||
@@ -195,14 +195,14 @@ HAL_StatusTypeDef HAL_ADCEx_Calibration_Start(ADC_HandleTypeDef* hadc, uint32_t | |||
* @arg @ref ADC_DIFFERENTIAL_ENDED Channel in mode input differential ended | |||
* @retval Calibration value. | |||
*/ | |||
uint32_t HAL_ADCEx_Calibration_GetValue(ADC_HandleTypeDef* hadc, uint32_t SingleDiff) | |||
uint32_t HAL_ADCEx_Calibration_GetValue(ADC_HandleTypeDef *hadc, uint32_t SingleDiff) | |||
{ | |||
/* Check the parameters */ | |||
assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); | |||
assert_param(IS_ADC_SINGLE_DIFFERENTIAL(SingleDiff)); | |||
/* Return the selected ADC calibration value */ | |||
return LL_ADC_GetCalibrationFactor(hadc->Instance, SingleDiff); | |||
return LL_ADC_GetCalibrationFactor(hadc->Instance, SingleDiff); | |||
} | |||
/** | |||
@@ -215,7 +215,7 @@ uint32_t HAL_ADCEx_Calibration_GetValue(ADC_HandleTypeDef* hadc, uint32_t Single | |||
* @param CalibrationFactor Calibration factor (coded on 7 bits maximum) | |||
* @retval HAL state | |||
*/ | |||
HAL_StatusTypeDef HAL_ADCEx_Calibration_SetValue(ADC_HandleTypeDef* hadc, uint32_t SingleDiff, uint32_t CalibrationFactor) | |||
HAL_StatusTypeDef HAL_ADCEx_Calibration_SetValue(ADC_HandleTypeDef *hadc, uint32_t SingleDiff, uint32_t CalibrationFactor) | |||
{ | |||
HAL_StatusTypeDef tmp_hal_status = HAL_OK; | |||
uint32_t tmp_adc_is_conversion_on_going_regular; | |||
@@ -234,7 +234,7 @@ HAL_StatusTypeDef HAL_ADCEx_Calibration_SetValue(ADC_HandleTypeDef* hadc, uint32 | |||
tmp_adc_is_conversion_on_going_regular = LL_ADC_REG_IsConversionOngoing(hadc->Instance); | |||
tmp_adc_is_conversion_on_going_injected = LL_ADC_INJ_IsConversionOngoing(hadc->Instance); | |||
if ( (LL_ADC_IsEnabled(hadc->Instance) != 0UL) | |||
if ((LL_ADC_IsEnabled(hadc->Instance) != 0UL) | |||
&& (tmp_adc_is_conversion_on_going_regular == 0UL) | |||
&& (tmp_adc_is_conversion_on_going_injected == 0UL) | |||
) | |||
@@ -266,7 +266,7 @@ HAL_StatusTypeDef HAL_ADCEx_Calibration_SetValue(ADC_HandleTypeDef* hadc, uint32 | |||
* @param hadc ADC handle. | |||
* @retval HAL status | |||
*/ | |||
HAL_StatusTypeDef HAL_ADCEx_InjectedStart(ADC_HandleTypeDef* hadc) | |||
HAL_StatusTypeDef HAL_ADCEx_InjectedStart(ADC_HandleTypeDef *hadc) | |||
{ | |||
HAL_StatusTypeDef tmp_hal_status; | |||
uint32_t tmp_config_injected_queue; | |||
@@ -289,7 +289,7 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedStart(ADC_HandleTypeDef* hadc) | |||
the queue is empty */ | |||
tmp_config_injected_queue = READ_BIT(hadc->Instance->CFGR, ADC_CFGR_JQDIS); | |||
if ( (READ_BIT(hadc->Instance->JSQR, ADC_JSQR_JEXTEN) == 0UL) | |||
if ((READ_BIT(hadc->Instance->JSQR, ADC_JSQR_JEXTEN) == 0UL) | |||
&& (tmp_config_injected_queue == 0UL) | |||
) | |||
{ | |||
@@ -367,7 +367,7 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedStart(ADC_HandleTypeDef* hadc) | |||
* @param hadc ADC handle. | |||
* @retval HAL status | |||
*/ | |||
HAL_StatusTypeDef HAL_ADCEx_InjectedStop(ADC_HandleTypeDef* hadc) | |||
HAL_StatusTypeDef HAL_ADCEx_InjectedStop(ADC_HandleTypeDef *hadc) | |||
{ | |||
HAL_StatusTypeDef tmp_hal_status; | |||
@@ -422,7 +422,7 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedStop(ADC_HandleTypeDef* hadc) | |||
* checked and cleared depending on AUTDLY bit status. | |||
* @retval HAL status | |||
*/ | |||
HAL_StatusTypeDef HAL_ADCEx_InjectedPollForConversion(ADC_HandleTypeDef* hadc, uint32_t Timeout) | |||
HAL_StatusTypeDef HAL_ADCEx_InjectedPollForConversion(ADC_HandleTypeDef *hadc, uint32_t Timeout) | |||
{ | |||
uint32_t tickstart; | |||
uint32_t tmp_Flag_End; | |||
@@ -446,13 +446,13 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedPollForConversion(ADC_HandleTypeDef* hadc, u | |||
/* Get timeout */ | |||
tickstart = HAL_GetTick(); | |||
/* Wait until End of Conversion or Sequence flag is raised */ | |||
while((hadc->Instance->ISR & tmp_Flag_End) == 0UL) | |||
/* Wait until End of Conversion or Sequence flag is raised */ | |||
while ((hadc->Instance->ISR & tmp_Flag_End) == 0UL) | |||
{ | |||
/* Check if timeout is disabled (set to infinite wait) */ | |||
if(Timeout != HAL_MAX_DELAY) | |||
if (Timeout != HAL_MAX_DELAY) | |||
{ | |||
if(((HAL_GetTick() - tickstart) > Timeout) || (Timeout == 0UL)) | |||
if (((HAL_GetTick() - tickstart) > Timeout) || (Timeout == 0UL)) | |||
{ | |||
/* Update ADC state machine to timeout */ | |||
SET_BIT(hadc->State, HAL_ADC_STATE_TIMEOUT); | |||
@@ -476,13 +476,13 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedPollForConversion(ADC_HandleTypeDef* hadc, u | |||
/* Determine whether any further conversion upcoming on group injected */ | |||
/* by external trigger or by automatic injected conversion */ | |||
/* from group regular. */ | |||
if((tmp_adc_inj_is_trigger_source_sw_start != 0UL) || | |||
((READ_BIT (tmp_cfgr, ADC_CFGR_JAUTO) == 0UL) && | |||
((tmp_adc_reg_is_trigger_source_sw_start != 0UL) && | |||
(READ_BIT (tmp_cfgr, ADC_CFGR_CONT) == 0UL) ) ) ) | |||
if ((tmp_adc_inj_is_trigger_source_sw_start != 0UL) || | |||
((READ_BIT(tmp_cfgr, ADC_CFGR_JAUTO) == 0UL) && | |||
((tmp_adc_reg_is_trigger_source_sw_start != 0UL) && | |||
(READ_BIT(tmp_cfgr, ADC_CFGR_CONT) == 0UL)))) | |||
{ | |||
/* Check whether end of sequence is reached */ | |||
if( __HAL_ADC_GET_FLAG(hadc, ADC_FLAG_JEOS) ) | |||
if (__HAL_ADC_GET_FLAG(hadc, ADC_FLAG_JEOS)) | |||
{ | |||
/* Particular case if injected contexts queue is enabled: */ | |||
/* when the last context has been fully processed, JSQR is reset */ | |||
@@ -490,12 +490,12 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedPollForConversion(ADC_HandleTypeDef* hadc, u | |||
/* (queue empty, triggers are ignored), it can start again */ | |||
/* immediately after setting a new context (JADSTART is still set). */ | |||
/* Therefore, state of HAL ADC injected group is kept to busy. */ | |||
if(READ_BIT(hadc->Instance->CFGR, ADC_CFGR_JQM) == 0UL) | |||
if (READ_BIT(hadc->Instance->CFGR, ADC_CFGR_JQM) == 0UL) | |||
{ | |||
/* Set ADC state */ | |||
CLEAR_BIT(hadc->State, HAL_ADC_STATE_INJ_BUSY); | |||
if((hadc->State & HAL_ADC_STATE_REG_BUSY) == 0UL) | |||
if ((hadc->State & HAL_ADC_STATE_REG_BUSY) == 0UL) | |||
{ | |||
SET_BIT(hadc->State, HAL_ADC_STATE_READY); | |||
} | |||
@@ -531,7 +531,7 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedPollForConversion(ADC_HandleTypeDef* hadc, u | |||
* @param hadc ADC handle. | |||
* @retval HAL status. | |||
*/ | |||
HAL_StatusTypeDef HAL_ADCEx_InjectedStart_IT(ADC_HandleTypeDef* hadc) | |||
HAL_StatusTypeDef HAL_ADCEx_InjectedStart_IT(ADC_HandleTypeDef *hadc) | |||
{ | |||
HAL_StatusTypeDef tmp_hal_status; | |||
uint32_t tmp_config_injected_queue; | |||
@@ -554,7 +554,7 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedStart_IT(ADC_HandleTypeDef* hadc) | |||
the queue is empty */ | |||
tmp_config_injected_queue = READ_BIT(hadc->Instance->CFGR, ADC_CFGR_JQDIS); | |||
if ( (READ_BIT(hadc->Instance->JSQR, ADC_JSQR_JEXTEN) == 0UL) | |||
if ((READ_BIT(hadc->Instance->JSQR, ADC_JSQR_JEXTEN) == 0UL) | |||
&& (tmp_config_injected_queue == 0UL) | |||
) | |||
{ | |||
@@ -607,7 +607,7 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedStart_IT(ADC_HandleTypeDef* hadc) | |||
} | |||
/* Enable ADC end of conversion interrupt */ | |||
switch(hadc->Init.EOCSelection) | |||
switch (hadc->Init.EOCSelection) | |||
{ | |||
case ADC_EOC_SEQ_CONV: | |||
__HAL_ADC_DISABLE_IT(hadc, ADC_IT_JEOC); | |||
@@ -655,7 +655,7 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedStart_IT(ADC_HandleTypeDef* hadc) | |||
* @param hadc ADC handle | |||
* @retval HAL status | |||
*/ | |||
HAL_StatusTypeDef HAL_ADCEx_InjectedStop_IT(ADC_HandleTypeDef* hadc) | |||
HAL_StatusTypeDef HAL_ADCEx_InjectedStop_IT(ADC_HandleTypeDef *hadc) | |||
{ | |||
HAL_StatusTypeDef tmp_hal_status; | |||
@@ -734,7 +734,7 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedStop_IT(ADC_HandleTypeDef* hadc) | |||
* @arg @ref ADC_INJECTED_RANK_4 ADC group injected rank 4 | |||
* @retval ADC group injected conversion data | |||
*/ | |||
uint32_t HAL_ADCEx_InjectedGetValue(ADC_HandleTypeDef* hadc, uint32_t InjectedRank) | |||
uint32_t HAL_ADCEx_InjectedGetValue(ADC_HandleTypeDef *hadc, uint32_t InjectedRank) | |||
{ | |||
uint32_t tmp_jdr; | |||
@@ -743,7 +743,7 @@ uint32_t HAL_ADCEx_InjectedGetValue(ADC_HandleTypeDef* hadc, uint32_t InjectedRa | |||
assert_param(IS_ADC_INJECTED_RANK(InjectedRank)); | |||
/* Get ADC converted value */ | |||
switch(InjectedRank) | |||
switch (InjectedRank) | |||
{ | |||
case ADC_INJECTED_RANK_4: | |||
tmp_jdr = hadc->Instance->JDR4; | |||
@@ -769,7 +769,7 @@ uint32_t HAL_ADCEx_InjectedGetValue(ADC_HandleTypeDef* hadc, uint32_t InjectedRa | |||
* @param hadc ADC handle | |||
* @retval None | |||
*/ | |||
__weak void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef* hadc) | |||
__weak void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef *hadc) | |||
{ | |||
/* Prevent unused argument(s) compilation warning */ | |||
UNUSED(hadc); | |||
@@ -788,7 +788,7 @@ __weak void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef* hadc) | |||
* @param hadc ADC handle | |||
* @retval None | |||
*/ | |||
__weak void HAL_ADCEx_InjectedQueueOverflowCallback(ADC_HandleTypeDef* hadc) | |||
__weak void HAL_ADCEx_InjectedQueueOverflowCallback(ADC_HandleTypeDef *hadc) | |||
{ | |||
/* Prevent unused argument(s) compilation warning */ | |||
UNUSED(hadc); | |||
@@ -803,7 +803,7 @@ __weak void HAL_ADCEx_InjectedQueueOverflowCallback(ADC_HandleTypeDef* hadc) | |||
* @param hadc ADC handle | |||
* @retval None | |||
*/ | |||
__weak void HAL_ADCEx_LevelOutOfWindow2Callback(ADC_HandleTypeDef* hadc) | |||
__weak void HAL_ADCEx_LevelOutOfWindow2Callback(ADC_HandleTypeDef *hadc) | |||
{ | |||
/* Prevent unused argument(s) compilation warning */ | |||
UNUSED(hadc); | |||
@@ -818,7 +818,7 @@ __weak void HAL_ADCEx_LevelOutOfWindow2Callback(ADC_HandleTypeDef* hadc) | |||
* @param hadc ADC handle | |||
* @retval None | |||
*/ | |||
__weak void HAL_ADCEx_LevelOutOfWindow3Callback(ADC_HandleTypeDef* hadc) | |||
__weak void HAL_ADCEx_LevelOutOfWindow3Callback(ADC_HandleTypeDef *hadc) | |||
{ | |||
/* Prevent unused argument(s) compilation warning */ | |||
UNUSED(hadc); | |||
@@ -834,7 +834,7 @@ __weak void HAL_ADCEx_LevelOutOfWindow3Callback(ADC_HandleTypeDef* hadc) | |||
* @param hadc ADC handle | |||
* @retval None | |||
*/ | |||
__weak void HAL_ADCEx_EndOfSamplingCallback(ADC_HandleTypeDef* hadc) | |||
__weak void HAL_ADCEx_EndOfSamplingCallback(ADC_HandleTypeDef *hadc) | |||
{ | |||
/* Prevent unused argument(s) compilation warning */ | |||
UNUSED(hadc); | |||
@@ -851,7 +851,7 @@ __weak void HAL_ADCEx_EndOfSamplingCallback(ADC_HandleTypeDef* hadc) | |||
* @param hadc ADC handle | |||
* @retval HAL status. | |||
*/ | |||
HAL_StatusTypeDef HAL_ADCEx_RegularStop(ADC_HandleTypeDef* hadc) | |||
HAL_StatusTypeDef HAL_ADCEx_RegularStop(ADC_HandleTypeDef *hadc) | |||
{ | |||
HAL_StatusTypeDef tmp_hal_status; | |||
@@ -909,7 +909,7 @@ HAL_StatusTypeDef HAL_ADCEx_RegularStop(ADC_HandleTypeDef* hadc) | |||
* @param hadc ADC handle | |||
* @retval HAL status. | |||
*/ | |||
HAL_StatusTypeDef HAL_ADCEx_RegularStop_IT(ADC_HandleTypeDef* hadc) | |||
HAL_StatusTypeDef HAL_ADCEx_RegularStop_IT(ADC_HandleTypeDef *hadc) | |||
{ | |||
HAL_StatusTypeDef tmp_hal_status; | |||
@@ -966,7 +966,7 @@ HAL_StatusTypeDef HAL_ADCEx_RegularStop_IT(ADC_HandleTypeDef* hadc) | |||
* @param hadc ADC handle | |||
* @retval HAL status. | |||
*/ | |||
HAL_StatusTypeDef HAL_ADCEx_RegularStop_DMA(ADC_HandleTypeDef* hadc) | |||
HAL_StatusTypeDef HAL_ADCEx_RegularStop_DMA(ADC_HandleTypeDef *hadc) | |||
{ | |||
HAL_StatusTypeDef tmp_hal_status; | |||
@@ -1094,7 +1094,7 @@ HAL_StatusTypeDef HAL_ADCEx_RegularStop_DMA(ADC_HandleTypeDef* hadc) | |||
* injected group. | |||
* @retval HAL status | |||
*/ | |||
HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef* hadc, ADC_InjectionConfTypeDef* sConfigInjected) | |||
HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef *hadc, ADC_InjectionConfTypeDef *sConfigInjected) | |||
{ | |||
HAL_StatusTypeDef tmp_hal_status = HAL_OK; | |||
uint32_t tmpOffsetShifted; | |||
@@ -1117,7 +1117,7 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef* hadc, ADC_I | |||
assert_param(IS_ADC_RANGE(ADC_GET_RESOLUTION(hadc), sConfigInjected->InjectedOffset)); | |||
assert_param(IS_FUNCTIONAL_STATE(sConfigInjected->InjecOversamplingMode)); | |||
if(hadc->Init.ScanConvMode != ADC_SCAN_DISABLE) | |||
if (hadc->Init.ScanConvMode != ADC_SCAN_DISABLE) | |||
{ | |||
assert_param(IS_ADC_INJECTED_RANK(sConfigInjected->InjectedRank)); | |||
assert_param(IS_ADC_INJECTED_NB_CONV(sConfigInjected->InjectedNbrOfConversion)); | |||
@@ -1138,7 +1138,7 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef* hadc, ADC_I | |||
/* Verification of channel number */ | |||
if (sConfigInjected->InjectedSingleDiff != ADC_DIFFERENTIAL_ENDED) | |||
{ | |||
assert_param(IS_ADC_CHANNEL(hadc, sConfigInjected->InjectedChannel)); | |||
assert_param(IS_ADC_CHANNEL(hadc, sConfigInjected->InjectedChannel)); | |||
} | |||
else | |||
{ | |||
@@ -1170,7 +1170,7 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef* hadc, ADC_I | |||
/* by software for alignment over all STM32 devices. */ | |||
if ((hadc->Init.ScanConvMode == ADC_SCAN_DISABLE) || | |||
(sConfigInjected->InjectedNbrOfConversion == 1U) ) | |||
(sConfigInjected->InjectedNbrOfConversion == 1U)) | |||
{ | |||
/* Configuration of context register JSQR: */ | |||
/* - number of ranks in injected group sequencer: fixed to 1st rank */ | |||
@@ -1188,14 +1188,14 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef* hadc, ADC_I | |||
/* software start. */ | |||
if (sConfigInjected->ExternalTrigInjecConv != ADC_INJECTED_SOFTWARE_START) | |||
{ | |||
tmp_JSQR_ContextQueueBeingBuilt = ( ADC_JSQR_RK(sConfigInjected->InjectedChannel, ADC_INJECTED_RANK_1) | |||
| (sConfigInjected->ExternalTrigInjecConv & ADC_JSQR_JEXTSEL) | |||
| sConfigInjected->ExternalTrigInjecConvEdge | |||
); | |||
tmp_JSQR_ContextQueueBeingBuilt = (ADC_JSQR_RK(sConfigInjected->InjectedChannel, ADC_INJECTED_RANK_1) | |||
| (sConfigInjected->ExternalTrigInjecConv & ADC_JSQR_JEXTSEL) | |||
| sConfigInjected->ExternalTrigInjecConvEdge | |||
); | |||
} | |||
else | |||
{ | |||
tmp_JSQR_ContextQueueBeingBuilt = ( ADC_JSQR_RK(sConfigInjected->InjectedChannel, ADC_INJECTED_RANK_1) ); | |||
tmp_JSQR_ContextQueueBeingBuilt = (ADC_JSQR_RK(sConfigInjected->InjectedChannel, ADC_INJECTED_RANK_1)); | |||
} | |||
MODIFY_REG(hadc->Instance->JSQR, ADC_JSQR_FIELDS, tmp_JSQR_ContextQueueBeingBuilt); | |||
@@ -1224,7 +1224,7 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef* hadc, ADC_I | |||
/* Handle hadc saves the context under build up over each HAL_ADCEx_InjectedConfigChannel() | |||
call, this context will be written in JSQR register at the last call. | |||
At this point, the context is merely reset */ | |||
hadc->InjectionConfig.ContextQueue = 0x00000000U; | |||
hadc->InjectionConfig.ContextQueue = 0x00000000U; | |||
/* Configuration of context register JSQR: */ | |||
/* - number of ranks in injected group sequencer */ | |||
@@ -1238,14 +1238,14 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef* hadc, ADC_I | |||
/* software start. */ | |||
if (sConfigInjected->ExternalTrigInjecConv != ADC_INJECTED_SOFTWARE_START) | |||
{ | |||
tmp_JSQR_ContextQueueBeingBuilt = ( (sConfigInjected->InjectedNbrOfConversion - 1U) | |||
| (sConfigInjected->ExternalTrigInjecConv & ADC_JSQR_JEXTSEL) | |||
| sConfigInjected->ExternalTrigInjecConvEdge | |||
); | |||
tmp_JSQR_ContextQueueBeingBuilt = ((sConfigInjected->InjectedNbrOfConversion - 1U) | |||
| (sConfigInjected->ExternalTrigInjecConv & ADC_JSQR_JEXTSEL) | |||
| sConfigInjected->ExternalTrigInjecConvEdge | |||
); | |||
} | |||
else | |||
{ | |||
tmp_JSQR_ContextQueueBeingBuilt = ((sConfigInjected->InjectedNbrOfConversion - 1U) ); | |||
tmp_JSQR_ContextQueueBeingBuilt = ((sConfigInjected->InjectedNbrOfConversion - 1U)); | |||
} | |||
} | |||
@@ -1289,7 +1289,7 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef* hadc, ADC_I | |||
MODIFY_REG(hadc->Instance->CFGR, | |||
ADC_CFGR_JQM | ADC_CFGR_JDISCEN, | |||
ADC_CFGR_INJECT_CONTEXT_QUEUE((uint32_t)sConfigInjected->QueueInjectedContext) | | |||
ADC_CFGR_INJECT_DISCCONTINUOUS((uint32_t)sConfigInjected->InjectedDiscontinuousConvMode) ); | |||
ADC_CFGR_INJECT_DISCCONTINUOUS((uint32_t)sConfigInjected->InjectedDiscontinuousConvMode)); | |||
} | |||
/* If auto-injected mode is enabled: Injected discontinuous setting is */ | |||
/* discarded. */ | |||
@@ -1297,7 +1297,7 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef* hadc, ADC_I | |||
{ | |||
MODIFY_REG(hadc->Instance->CFGR, | |||
ADC_CFGR_JQM | ADC_CFGR_JDISCEN, | |||
ADC_CFGR_INJECT_CONTEXT_QUEUE((uint32_t)sConfigInjected->QueueInjectedContext) ); | |||
ADC_CFGR_INJECT_CONTEXT_QUEUE((uint32_t)sConfigInjected->QueueInjectedContext)); | |||
} | |||
} | |||
@@ -1312,23 +1312,23 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef* hadc, ADC_I | |||
tmp_adc_is_conversion_on_going_regular = LL_ADC_REG_IsConversionOngoing(hadc->Instance); | |||
tmp_adc_is_conversion_on_going_injected = LL_ADC_INJ_IsConversionOngoing(hadc->Instance); | |||
if ( (tmp_adc_is_conversion_on_going_regular == 0UL) | |||
if ((tmp_adc_is_conversion_on_going_regular == 0UL) | |||
&& (tmp_adc_is_conversion_on_going_injected == 0UL) | |||
) | |||
{ | |||
/* If injected group external triggers are disabled (set to injected */ | |||
/* software start): no constraint */ | |||
if ((sConfigInjected->ExternalTrigInjecConv == ADC_INJECTED_SOFTWARE_START) | |||
|| (sConfigInjected->ExternalTrigInjecConvEdge == ADC_EXTERNALTRIGINJECCONV_EDGE_NONE)) | |||
|| (sConfigInjected->ExternalTrigInjecConvEdge == ADC_EXTERNALTRIGINJECCONV_EDGE_NONE)) | |||
{ | |||
if (sConfigInjected->AutoInjectedConv == ENABLE) | |||
{ | |||
SET_BIT(hadc->Instance->CFGR, ADC_CFGR_JAUTO); | |||
} | |||
else | |||
{ | |||
CLEAR_BIT(hadc->Instance->CFGR, ADC_CFGR_JAUTO); | |||
} | |||
if (sConfigInjected->AutoInjectedConv == ENABLE) | |||
{ | |||
SET_BIT(hadc->Instance->CFGR, ADC_CFGR_JAUTO); | |||
} | |||
else | |||
{ | |||
CLEAR_BIT(hadc->Instance->CFGR, ADC_CFGR_JAUTO); | |||
} | |||
} | |||
/* If Automatic injected conversion was intended to be set and could not */ | |||
/* due to injected group external triggers enabled, error is reported. */ | |||
@@ -1353,26 +1353,26 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef* hadc, ADC_I | |||
assert_param(IS_ADC_RIGHT_BIT_SHIFT(sConfigInjected->InjecOversampling.RightBitShift)); | |||
/* JOVSE must be reset in case of triggered regular mode */ | |||
assert_param(!(READ_BIT(hadc->Instance->CFGR2, ADC_CFGR2_ROVSE|ADC_CFGR2_TROVS) == (ADC_CFGR2_ROVSE|ADC_CFGR2_TROVS))); | |||
assert_param(!(READ_BIT(hadc->Instance->CFGR2, ADC_CFGR2_ROVSE | ADC_CFGR2_TROVS) == (ADC_CFGR2_ROVSE | ADC_CFGR2_TROVS))); | |||
/* Configuration of Injected Oversampler: */ | |||
/* - Oversampling Ratio */ | |||
/* - Right bit shift */ | |||
/* Enable OverSampling mode */ | |||
MODIFY_REG(hadc->Instance->CFGR2, | |||
ADC_CFGR2_JOVSE | | |||
ADC_CFGR2_OVSR | | |||
ADC_CFGR2_OVSS, | |||
ADC_CFGR2_JOVSE | | |||
sConfigInjected->InjecOversampling.Ratio | | |||
sConfigInjected->InjecOversampling.RightBitShift | |||
); | |||
MODIFY_REG(hadc->Instance->CFGR2, | |||
ADC_CFGR2_JOVSE | | |||
ADC_CFGR2_OVSR | | |||
ADC_CFGR2_OVSS, | |||
ADC_CFGR2_JOVSE | | |||
sConfigInjected->InjecOversampling.Ratio | | |||
sConfigInjected->InjecOversampling.RightBitShift | |||
); | |||
} | |||
else | |||
{ | |||
/* Disable Regular OverSampling */ | |||
CLEAR_BIT( hadc->Instance->CFGR2, ADC_CFGR2_JOVSE); | |||
CLEAR_BIT(hadc->Instance->CFGR2, ADC_CFGR2_JOVSE); | |||
} | |||
/* Set sampling time of the selected ADC channel */ | |||
@@ -1384,10 +1384,11 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef* hadc, ADC_I | |||
/* Offset has to be left-aligned on bit 11, the LSB (right bits) are set to 0 */ | |||
tmpOffsetShifted = ADC_OFFSET_SHIFT_RESOLUTION(hadc, sConfigInjected->InjectedOffset); | |||
if(sConfigInjected->InjectedOffsetNumber != ADC_OFFSET_NONE) | |||
if (sConfigInjected->InjectedOffsetNumber != ADC_OFFSET_NONE) | |||
{ | |||
/* Set ADC selected offset number */ | |||
LL_ADC_SetOffset(hadc->Instance, sConfigInjected->InjectedOffsetNumber, sConfigInjected->InjectedChannel, tmpOffsetShifted); | |||
LL_ADC_SetOffset(hadc->Instance, sConfigInjected->InjectedOffsetNumber, sConfigInjected->InjectedChannel, | |||
tmpOffsetShifted); | |||
} | |||
else | |||
@@ -1396,19 +1397,19 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef* hadc, ADC_I | |||
/* If this is the case, the corresponding offset number is disabled. */ | |||
if(__LL_ADC_CHANNEL_TO_DECIMAL_NB(LL_ADC_GetOffsetChannel(hadc->Instance, LL_ADC_OFFSET_1)) == __LL_ADC_CHANNEL_TO_DECIMAL_NB(sConfigInjected->InjectedChannel)) | |||
{ | |||
LL_ADC_SetOffsetState(hadc->Instance, LL_ADC_OFFSET_1, LL_ADC_OFFSET_DISABLE); | |||
LL_ADC_SetOffsetState(hadc->Instance, LL_ADC_OFFSET_1, LL_ADC_OFFSET_DISABLE); | |||
} | |||
if(__LL_ADC_CHANNEL_TO_DECIMAL_NB(LL_ADC_GetOffsetChannel(hadc->Instance, LL_ADC_OFFSET_2)) == __LL_ADC_CHANNEL_TO_DECIMAL_NB(sConfigInjected->InjectedChannel)) | |||
{ | |||
LL_ADC_SetOffsetState(hadc->Instance, LL_ADC_OFFSET_2, LL_ADC_OFFSET_DISABLE); | |||
LL_ADC_SetOffsetState(hadc->Instance, LL_ADC_OFFSET_2, LL_ADC_OFFSET_DISABLE); | |||
} | |||
if(__LL_ADC_CHANNEL_TO_DECIMAL_NB(LL_ADC_GetOffsetChannel(hadc->Instance, LL_ADC_OFFSET_3)) == __LL_ADC_CHANNEL_TO_DECIMAL_NB(sConfigInjected->InjectedChannel)) | |||
{ | |||
LL_ADC_SetOffsetState(hadc->Instance, LL_ADC_OFFSET_3, LL_ADC_OFFSET_DISABLE); | |||
LL_ADC_SetOffsetState(hadc->Instance, LL_ADC_OFFSET_3, LL_ADC_OFFSET_DISABLE); | |||
} | |||
if(__LL_ADC_CHANNEL_TO_DECIMAL_NB(LL_ADC_GetOffsetChannel(hadc->Instance, LL_ADC_OFFSET_4)) == __LL_ADC_CHANNEL_TO_DECIMAL_NB(sConfigInjected->InjectedChannel)) | |||
{ | |||
LL_ADC_SetOffsetState(hadc->Instance, LL_ADC_OFFSET_4, LL_ADC_OFFSET_DISABLE); | |||
LL_ADC_SetOffsetState(hadc->Instance, LL_ADC_OFFSET_4, LL_ADC_OFFSET_DISABLE); | |||
} | |||
} | |||
@@ -1515,7 +1516,7 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef* hadc, ADC_I | |||
* @param hadc ADC handle | |||
* @retval HAL status | |||
*/ | |||
HAL_StatusTypeDef HAL_ADCEx_EnableInjectedQueue(ADC_HandleTypeDef* hadc) | |||
HAL_StatusTypeDef HAL_ADCEx_EnableInjectedQueue(ADC_HandleTypeDef *hadc) | |||
{ | |||
HAL_StatusTypeDef tmp_hal_status; | |||
uint32_t tmp_adc_is_conversion_on_going_regular; | |||
@@ -1528,7 +1529,7 @@ HAL_StatusTypeDef HAL_ADCEx_EnableInjectedQueue(ADC_HandleTypeDef* hadc) | |||
tmp_adc_is_conversion_on_going_injected = LL_ADC_INJ_IsConversionOngoing(hadc->Instance); | |||
/* Parameter can be set only if no conversion is on-going */ | |||
if ( (tmp_adc_is_conversion_on_going_regular == 0UL) | |||
if ((tmp_adc_is_conversion_on_going_regular == 0UL) | |||
&& (tmp_adc_is_conversion_on_going_injected == 0UL) | |||
) | |||
{ | |||
@@ -1556,7 +1557,7 @@ HAL_StatusTypeDef HAL_ADCEx_EnableInjectedQueue(ADC_HandleTypeDef* hadc) | |||
* @param hadc ADC handle | |||
* @retval HAL status | |||
*/ | |||
HAL_StatusTypeDef HAL_ADCEx_DisableInjectedQueue(ADC_HandleTypeDef* hadc) | |||
HAL_StatusTypeDef HAL_ADCEx_DisableInjectedQueue(ADC_HandleTypeDef *hadc) | |||
{ | |||
HAL_StatusTypeDef tmp_hal_status; | |||
uint32_t tmp_adc_is_conversion_on_going_regular; | |||
@@ -1569,7 +1570,7 @@ HAL_StatusTypeDef HAL_ADCEx_DisableInjectedQueue(ADC_HandleTypeDef* hadc) | |||
tmp_adc_is_conversion_on_going_injected = LL_ADC_INJ_IsConversionOngoing(hadc->Instance); | |||
/* Parameter can be set only if no conversion is on-going */ | |||
if ( (tmp_adc_is_conversion_on_going_regular == 0UL) | |||
if ((tmp_adc_is_conversion_on_going_regular == 0UL) | |||
&& (tmp_adc_is_conversion_on_going_injected == 0UL) | |||
) | |||
{ | |||
@@ -1593,7 +1594,7 @@ HAL_StatusTypeDef HAL_ADCEx_DisableInjectedQueue(ADC_HandleTypeDef* hadc) | |||
* @param hadc ADC handle | |||
* @retval HAL status | |||
*/ | |||
HAL_StatusTypeDef HAL_ADCEx_DisableVoltageRegulator(ADC_HandleTypeDef* hadc) | |||
HAL_StatusTypeDef HAL_ADCEx_DisableVoltageRegulator(ADC_HandleTypeDef *hadc) | |||
{ | |||
HAL_StatusTypeDef tmp_hal_status; | |||
@@ -1630,7 +1631,7 @@ HAL_StatusTypeDef HAL_ADCEx_DisableVoltageRegulator(ADC_HandleTypeDef* hadc) | |||
* @param hadc ADC handle | |||
* @retval HAL status | |||
*/ | |||
HAL_StatusTypeDef HAL_ADCEx_EnterADCDeepPowerDownMode(ADC_HandleTypeDef* hadc) | |||
HAL_StatusTypeDef HAL_ADCEx_EnterADCDeepPowerDownMode(ADC_HandleTypeDef *hadc) | |||
{ | |||
HAL_StatusTypeDef tmp_hal_status; | |||
@@ -168,7 +168,7 @@ | |||
#ifdef HAL_COMP_MODULE_ENABLED | |||
#if defined (COMP1) || defined (COMP2) | |||
/** @defgroup COMP COMP | |||
* @brief COMP HAL module driver | |||
@@ -981,7 +981,7 @@ uint32_t HAL_COMP_GetError(COMP_HandleTypeDef *hcomp) | |||
* @} | |||
*/ | |||
#endif /* COMP1 || COMP2 */ | |||
#endif /* HAL_COMP_MODULE_ENABLED */ | |||
@@ -189,13 +189,15 @@ | |||
(##) Final phase: peripheral generates the authenticated tag (T) using the last block of data. | |||
*** Callback registration *** | |||
============================================= | |||
============================= | |||
[..] | |||
The compilation define USE_HAL_CRYP_REGISTER_CALLBACKS when set to 1 | |||
allows the user to configure dynamically the driver callbacks. | |||
Use Functions @ref HAL_CRYP_RegisterCallback() or HAL_CRYP_RegisterXXXCallback() | |||
to register an interrupt callback. | |||
[..] | |||
Function @ref HAL_CRYP_RegisterCallback() allows to register following callbacks: | |||
(+) InCpltCallback : Input FIFO transfer completed callback. | |||
(+) OutCpltCallback : Output FIFO transfer completed callback. | |||
@@ -205,6 +207,7 @@ | |||
This function takes as parameters the HAL peripheral handle, the Callback ID | |||
and a pointer to the user callback function. | |||
[..] | |||
Use function @ref HAL_CRYP_UnRegisterCallback() to reset a callback to the default | |||
weak function. | |||
@ref HAL_CRYP_UnRegisterCallback() takes as parameters the HAL peripheral handle, | |||
@@ -216,6 +219,7 @@ | |||
(+) MspInitCallback : CRYP MspInit. | |||
(+) MspDeInitCallback : CRYP MspDeInit. | |||
[..] | |||
By default, after the @ref HAL_CRYP_Init() and when the state is HAL_CRYP_STATE_RESET | |||
all callbacks are set to the corresponding weak functions : | |||
examples @ref HAL_CRYP_InCpltCallback() , @ref HAL_CRYP_OutCpltCallback(). | |||
@@ -225,6 +229,7 @@ | |||
if not, MspInit or MspDeInit are not null, the @ref HAL_CRYP_Init() / @ref HAL_CRYP_DeInit() | |||
keep and use the user MspInit/MspDeInit functions (registered beforehand) | |||
[..] | |||
Callbacks can be registered/unregistered in HAL_CRYP_STATE_READY state only. | |||
Exception done MspInit/MspDeInit callbacks that can be registered/unregistered | |||
in HAL_CRYP_STATE_READY or HAL_CRYP_STATE_RESET state, | |||
@@ -233,14 +238,16 @@ | |||
using @ref HAL_CRYP_RegisterCallback() before calling @ref HAL_CRYP_DeInit() | |||
or @ref HAL_CRYP_Init() function. | |||
[..] | |||
When The compilation define USE_HAL_CRYP_REGISTER_CALLBACKS is set to 0 or | |||
not defined, the callback registration feature is not available and all callbacks | |||
are set to the corresponding weak functions. | |||
*** Suspend/Resume feature *** | |||
============================================= | |||
============================== | |||
[..] | |||
The compilation define USE_HAL_CRYP_SUSPEND_RESUME when set to 1 | |||
allows the user to resort to the suspend/resume feature. | |||
A low priority block processing can be suspended to process a high priority block | |||
@@ -915,11 +922,15 @@ void HAL_CRYP_ProcessSuspend(CRYP_HandleTypeDef *hcryp) | |||
*/ | |||
HAL_StatusTypeDef HAL_CRYP_Suspend(CRYP_HandleTypeDef *hcryp) | |||
{ | |||
HAL_CRYP_STATETypeDef state; | |||
/* Request suspension */ | |||
HAL_CRYP_ProcessSuspend(hcryp); | |||
while ((HAL_CRYP_GetState(hcryp) != HAL_CRYP_STATE_SUSPENDED) && \ | |||
(HAL_CRYP_GetState(hcryp) != HAL_CRYP_STATE_READY)); | |||
do | |||
{ | |||
state = HAL_CRYP_GetState(hcryp); | |||
} while ((state != HAL_CRYP_STATE_SUSPENDED) && (state != HAL_CRYP_STATE_READY)); | |||
if (HAL_CRYP_GetState(hcryp) == HAL_CRYP_STATE_READY) | |||
{ | |||
@@ -953,7 +964,8 @@ HAL_StatusTypeDef HAL_CRYP_Suspend(CRYP_HandleTypeDef *hcryp) | |||
hcryp->CrypOutCount_saved = hcryp->CrypOutCount; | |||
hcryp->Phase_saved = hcryp->Phase; | |||
hcryp->State_saved = hcryp->State; | |||
hcryp->Size_saved = ( (hcryp->Init.DataWidthUnit == CRYP_DATAWIDTHUNIT_WORD) ? hcryp->Size /4 : hcryp->Size); | |||
hcryp->Size_saved = ( (hcryp->Init.DataWidthUnit == CRYP_DATAWIDTHUNIT_WORD) ? (hcryp->Size /4U) : hcryp->Size); | |||
hcryp->SizesSum_saved = hcryp->SizesSum; | |||
hcryp->AutoKeyDerivation_saved = hcryp->AutoKeyDerivation; | |||
hcryp->CrypHeaderCount_saved = hcryp->CrypHeaderCount; | |||
hcryp->SuspendRequest = HAL_CRYP_SUSPEND_NONE; | |||
@@ -983,6 +995,12 @@ HAL_StatusTypeDef HAL_CRYP_Suspend(CRYP_HandleTypeDef *hcryp) | |||
*/ | |||
HAL_StatusTypeDef HAL_CRYP_Resume(CRYP_HandleTypeDef *hcryp) | |||
{ | |||
/* Check the CRYP handle allocation */ | |||
if (hcryp == NULL) | |||
{ | |||
return HAL_ERROR; | |||
} | |||
if (hcryp->State_saved != HAL_CRYP_STATE_SUSPENDED) | |||
{ | |||
/* CRYP was not suspended */ | |||
@@ -1009,16 +1027,14 @@ HAL_StatusTypeDef HAL_CRYP_Resume(CRYP_HandleTypeDef *hcryp) | |||
hcryp->Init.pInitVect = hcryp->IV_saved; | |||
} | |||
__HAL_CRYP_DISABLE(hcryp); | |||
if (HAL_CRYP_Init(hcryp) != HAL_OK) | |||
{ | |||
return HAL_ERROR; | |||
} | |||
(void) HAL_CRYP_Init(hcryp); | |||
} | |||
else /* Authentication algorithms case */ | |||
{ | |||
/* Restore low-priority block CRYP handle parameters */ | |||
hcryp->Phase = hcryp->Phase_saved; | |||
hcryp->CrypHeaderCount = hcryp->CrypHeaderCount_saved; | |||
hcryp->SizesSum = hcryp->SizesSum_saved; | |||
/* Disable AES and write-back SUSPxR registers */; | |||
__HAL_CRYP_DISABLE(hcryp); | |||
@@ -1028,8 +1044,6 @@ HAL_StatusTypeDef HAL_CRYP_Resume(CRYP_HandleTypeDef *hcryp) | |||
hcryp->Instance->CR = hcryp->CR_saved; | |||
CRYP_Write_KeyRegisters(hcryp, hcryp->Key_saved, hcryp->Init.KeySize); | |||
CRYP_Write_IVRegisters(hcryp, hcryp->IV_saved); | |||
__HAL_CRYP_ENABLE_IT(hcryp,CRYP_IT_CCFIE | CRYP_IT_ERRIE); | |||
__HAL_CRYP_ENABLE(hcryp); | |||
/* At the same time, set handle state back to READY to be able to resume the AES calculations | |||
without the processing APIs returning HAL_BUSY when called. */ | |||
@@ -1180,6 +1194,12 @@ HAL_StatusTypeDef HAL_CRYP_Encrypt(CRYP_HandleTypeDef *hcryp, uint32_t *Input, u | |||
{ | |||
uint32_t algo; | |||
HAL_StatusTypeDef status; | |||
#ifdef USE_FULL_ASSERT | |||
uint32_t algo_assert = (hcryp->Instance->CR) & AES_CR_CHMOD; | |||
/* Check input buffer size */ | |||
assert_param(IS_CRYP_BUFFERSIZE(algo_assert, hcryp->Init.DataWidthUnit, Size)); | |||
#endif | |||
if (hcryp->State == HAL_CRYP_STATE_READY) | |||
{ | |||
@@ -1274,6 +1294,12 @@ HAL_StatusTypeDef HAL_CRYP_Decrypt(CRYP_HandleTypeDef *hcryp, uint32_t *Input, u | |||
{ | |||
HAL_StatusTypeDef status; | |||
uint32_t algo; | |||
#ifdef USE_FULL_ASSERT | |||
uint32_t algo_assert = (hcryp->Instance->CR) & AES_CR_CHMOD; | |||
/* Check input buffer size */ | |||
assert_param(IS_CRYP_BUFFERSIZE(algo_assert, hcryp->Init.DataWidthUnit, Size)); | |||
#endif | |||
if (hcryp->State == HAL_CRYP_STATE_READY) | |||
{ | |||
@@ -1367,6 +1393,12 @@ HAL_StatusTypeDef HAL_CRYP_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint32_t *Input | |||
{ | |||
HAL_StatusTypeDef status; | |||
uint32_t algo; | |||
#ifdef USE_FULL_ASSERT | |||
uint32_t algo_assert = (hcryp->Instance->CR) & AES_CR_CHMOD; | |||
/* Check input buffer size */ | |||
assert_param(IS_CRYP_BUFFERSIZE(algo_assert, hcryp->Init.DataWidthUnit, Size)); | |||
#endif | |||
if (hcryp->State == HAL_CRYP_STATE_READY) | |||
{ | |||
@@ -1383,8 +1415,8 @@ HAL_StatusTypeDef HAL_CRYP_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint32_t *Input | |||
hcryp->ResumingFlag = 0U; | |||
if (hcryp->Phase != CRYP_PHASE_HEADER_SUSPENDED) | |||
{ | |||
hcryp->CrypInCount = hcryp->CrypInCount_saved; | |||
hcryp->CrypOutCount = hcryp->CrypOutCount_saved; | |||
hcryp->CrypInCount = (uint16_t) hcryp->CrypInCount_saved; | |||
hcryp->CrypOutCount = (uint16_t) hcryp->CrypOutCount_saved; | |||
} | |||
else | |||
{ | |||
@@ -1471,6 +1503,12 @@ HAL_StatusTypeDef HAL_CRYP_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint32_t *Input | |||
{ | |||
HAL_StatusTypeDef status; | |||
uint32_t algo; | |||
#ifdef USE_FULL_ASSERT | |||
uint32_t algo_assert = (hcryp->Instance->CR) & AES_CR_CHMOD; | |||
/* Check input buffer size */ | |||
assert_param(IS_CRYP_BUFFERSIZE(algo_assert, hcryp->Init.DataWidthUnit, Size)); | |||
#endif | |||
if (hcryp->State == HAL_CRYP_STATE_READY) | |||
{ | |||
@@ -1487,8 +1525,8 @@ HAL_StatusTypeDef HAL_CRYP_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint32_t *Input | |||
hcryp->ResumingFlag = 0U; | |||
if (hcryp->Phase != CRYP_PHASE_HEADER_SUSPENDED) | |||
{ | |||
hcryp->CrypInCount = hcryp->CrypInCount_saved; | |||
hcryp->CrypOutCount = hcryp->CrypOutCount_saved; | |||
hcryp->CrypInCount = (uint16_t) hcryp->CrypInCount_saved; | |||
hcryp->CrypOutCount = (uint16_t) hcryp->CrypOutCount_saved; | |||
} | |||
else | |||
{ | |||
@@ -1575,6 +1613,12 @@ HAL_StatusTypeDef HAL_CRYP_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint32_t *Inpu | |||
HAL_StatusTypeDef status; | |||
uint32_t algo; | |||
uint32_t DoKeyIVConfig = 1U; /* By default, carry out peripheral Key and IV configuration */ | |||
#ifdef USE_FULL_ASSERT | |||
uint32_t algo_assert = (hcryp->Instance->CR) & AES_CR_CHMOD; | |||
/* Check input buffer size */ | |||
assert_param(IS_CRYP_BUFFERSIZE(algo_assert, hcryp->Init.DataWidthUnit, Size)); | |||
#endif | |||
if (hcryp->State == HAL_CRYP_STATE_READY) | |||
{ | |||
@@ -1695,6 +1739,12 @@ HAL_StatusTypeDef HAL_CRYP_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint32_t *Inpu | |||
{ | |||
HAL_StatusTypeDef status; | |||
uint32_t algo; | |||
#ifdef USE_FULL_ASSERT | |||
uint32_t algo_assert = (hcryp->Instance->CR) & AES_CR_CHMOD; | |||
/* Check input buffer size */ | |||
assert_param(IS_CRYP_BUFFERSIZE(algo_assert, hcryp->Init.DataWidthUnit, Size)); | |||
#endif | |||
if (hcryp->State == HAL_CRYP_STATE_READY) | |||
{ | |||
@@ -5015,7 +5065,7 @@ static void CRYP_Read_SuspendRegisters(CRYP_HandleTypeDef *hcryp, uint32_t* Outp | |||
__IO uint32_t count = 0U; | |||
/* In case of GCM payload phase encryption, check that suspension can be carried out */ | |||
if (READ_BIT(hcryp->Instance->CR, (AES_CR_CHMOD|AES_CR_GCMPH|AES_CR_MODE)) == (CRYP_AES_GCM_GMAC|AES_CR_GCMPH_1|0x0)) | |||
if (READ_BIT(hcryp->Instance->CR, (AES_CR_CHMOD|AES_CR_GCMPH|AES_CR_MODE)) == (CRYP_AES_GCM_GMAC|AES_CR_GCMPH_1|0x0U)) | |||
{ | |||
/* Wait for BUSY flag to be cleared */ | |||
@@ -5153,21 +5203,21 @@ static void CRYP_Write_KeyRegisters(CRYP_HandleTypeDef *hcryp, uint32_t* Input, | |||
if (KeySize == CRYP_KEYSIZE_256B) | |||
{ | |||
hcryp->Instance->KEYR7 = *(uint32_t*)(keyaddr); | |||
keyaddr+=4; | |||
keyaddr+=4U; | |||
hcryp->Instance->KEYR6 = *(uint32_t*)(keyaddr); | |||
keyaddr+=4; | |||
keyaddr+=4U; | |||
hcryp->Instance->KEYR5 = *(uint32_t*)(keyaddr); | |||
keyaddr+=4; | |||
keyaddr+=4U; | |||
hcryp->Instance->KEYR4 = *(uint32_t*)(keyaddr); | |||
keyaddr+=4; | |||
keyaddr+=4U; | |||
} | |||
hcryp->Instance->KEYR3 = *(uint32_t*)(keyaddr); | |||
keyaddr+=4; | |||
keyaddr+=4U; | |||
hcryp->Instance->KEYR2 = *(uint32_t*)(keyaddr); | |||
keyaddr+=4; | |||
keyaddr+=4U; | |||
hcryp->Instance->KEYR1 = *(uint32_t*)(keyaddr); | |||
keyaddr+=4; | |||
keyaddr+=4U; | |||
hcryp->Instance->KEYR0 = *(uint32_t*)(keyaddr); | |||
} | |||
@@ -5179,9 +5229,19 @@ static void CRYP_Write_KeyRegisters(CRYP_HandleTypeDef *hcryp, uint32_t* Input, | |||
*/ | |||
static void CRYP_PhaseProcessingResume(CRYP_HandleTypeDef *hcryp) | |||
{ | |||
uint32_t loopcounter = 0U; | |||
uint32_t lastwordsize =0; | |||
uint32_t npblb = 0U ; | |||
uint32_t loopcounter; | |||
uint16_t lastwordsize; | |||
uint16_t npblb; | |||
uint32_t cr_temp; | |||
__HAL_CRYP_CLEAR_FLAG(hcryp, CRYP_ERR_CLEAR | CRYP_CCF_CLEAR); | |||
/* Enable computation complete flag and error interrupts */ | |||
__HAL_CRYP_ENABLE_IT(hcryp, CRYP_IT_CCFIE | CRYP_IT_ERRIE); | |||
/* Enable the CRYP peripheral */ | |||
__HAL_CRYP_ENABLE(hcryp); | |||
/* Case of header phase resumption =================================================*/ | |||
if (hcryp->Phase == CRYP_PHASE_HEADER_SUSPENDED) | |||
@@ -5192,7 +5252,7 @@ static void CRYP_PhaseProcessingResume(CRYP_HandleTypeDef *hcryp) | |||
/* Select header phase */ | |||
CRYP_SET_PHASE(hcryp, CRYP_PHASE_HEADER); | |||
if (((hcryp->Init.HeaderSize) - (hcryp->CrypHeaderCount) >= 4U)) | |||
if ((((hcryp->Init.HeaderSize) - (hcryp->CrypHeaderCount)) >= 4U)) | |||
{ | |||
/* Write the input block in the IN FIFO */ | |||
hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount ); | |||
@@ -5221,73 +5281,77 @@ static void CRYP_PhaseProcessingResume(CRYP_HandleTypeDef *hcryp) | |||
} | |||
} | |||
/* Case of payload phase resumption =================================================*/ | |||
else if (hcryp->Phase == CRYP_PHASE_PAYLOAD_SUSPENDED) | |||
else | |||
{ | |||
if (hcryp->Phase == CRYP_PHASE_PAYLOAD_SUSPENDED) | |||
{ | |||
/* Set the phase */ | |||
hcryp->Phase = CRYP_PHASE_PROCESS; | |||
/* Set the phase */ | |||
hcryp->Phase = CRYP_PHASE_PROCESS; | |||
/* Select payload phase once the header phase is performed */ | |||
MODIFY_REG(hcryp->Instance->CR, AES_CR_GCMPH, CRYP_PHASE_PAYLOAD); | |||
/* Select payload phase once the header phase is performed */ | |||
MODIFY_REG(hcryp->Instance->CR, AES_CR_GCMPH, CRYP_PHASE_PAYLOAD); | |||
/* Set to 0 the number of non-valid bytes using NPBLB register*/ | |||
MODIFY_REG(hcryp->Instance->CR, AES_CR_NPBLB, 0U); | |||
/* Set to 0 the number of non-valid bytes using NPBLB register*/ | |||
MODIFY_REG(hcryp->Instance->CR, AES_CR_NPBLB, 0U); | |||
if ((hcryp->Size/4) - (hcryp->CrypInCount) >= 4U) | |||
{ | |||
/* Write the input block in the IN FIFO */ | |||
hcryp->Instance->DINR = *(uint32_t *)(hcryp->pCrypInBuffPtr + hcryp->CrypInCount ); | |||
hcryp->CrypInCount++; | |||
hcryp->Instance->DINR = *(uint32_t *)(hcryp->pCrypInBuffPtr + hcryp->CrypInCount ); | |||
hcryp->CrypInCount++; | |||
hcryp->Instance->DINR = *(uint32_t *)(hcryp->pCrypInBuffPtr + hcryp->CrypInCount ); | |||
hcryp->CrypInCount++; | |||
hcryp->Instance->DINR = *(uint32_t *)(hcryp->pCrypInBuffPtr + hcryp->CrypInCount ); | |||
hcryp->CrypInCount++; | |||
if((hcryp->CrypInCount == hcryp->Size) && (hcryp->Init.Algorithm == CRYP_AES_GCM_GMAC)) | |||
if (((hcryp->Size/4U) - (hcryp->CrypInCount)) >= 4U) | |||
{ | |||
/* Call output transfer complete callback */ | |||
/* Write the input block in the IN FIFO */ | |||
hcryp->Instance->DINR = *(uint32_t *)(hcryp->pCrypInBuffPtr + hcryp->CrypInCount ); | |||
hcryp->CrypInCount++; | |||
hcryp->Instance->DINR = *(uint32_t *)(hcryp->pCrypInBuffPtr + hcryp->CrypInCount ); | |||
hcryp->CrypInCount++; | |||
hcryp->Instance->DINR = *(uint32_t *)(hcryp->pCrypInBuffPtr + hcryp->CrypInCount ); | |||
hcryp->CrypInCount++; | |||
hcryp->Instance->DINR = *(uint32_t *)(hcryp->pCrypInBuffPtr + hcryp->CrypInCount ); | |||
hcryp->CrypInCount++; | |||
if((hcryp->CrypInCount == hcryp->Size) && (hcryp->Init.Algorithm == CRYP_AES_GCM_GMAC)) | |||
{ | |||
/* Call output transfer complete callback */ | |||
#if (USE_HAL_CRYP_REGISTER_CALLBACKS == 1) | |||
/*Call registered Input complete callback*/ | |||
hcryp->InCpltCallback(hcryp); | |||
/*Call registered Input complete callback*/ | |||
hcryp->InCpltCallback(hcryp); | |||
#else | |||
/*Call legacy weak Input complete callback*/ | |||
HAL_CRYP_InCpltCallback(hcryp); | |||
/*Call legacy weak Input complete callback*/ | |||
HAL_CRYP_InCpltCallback(hcryp); | |||
#endif /* USE_HAL_CRYP_REGISTER_CALLBACKS */ | |||
} | |||
} | |||
} | |||
else /* Last block of payload < 128bit*/ | |||
{ | |||
/* Compute the number of padding bytes in last block of payload */ | |||
npblb = ((hcryp->Size/16U)+1U)*16U- (hcryp->Size); | |||
if((((hcryp->Instance->CR & AES_CR_MODE) == CRYP_OPERATINGMODE_ENCRYPT) && (hcryp->Init.Algorithm == CRYP_AES_GCM_GMAC)) || | |||
(((hcryp->Instance->CR & AES_CR_MODE) == CRYP_OPERATINGMODE_DECRYPT) && (hcryp->Init.Algorithm == CRYP_AES_CCM))) | |||
else /* Last block of payload < 128bit*/ | |||
{ | |||
/* Specify the number of non-valid bytes using NPBLB register*/ | |||
MODIFY_REG(hcryp->Instance->CR, AES_CR_NPBLB, npblb<< 20U); | |||
} | |||
/* Compute the number of padding bytes in last block of payload */ | |||
npblb = (((hcryp->Size/16U)+1U)*16U) - (hcryp->Size); | |||
cr_temp = hcryp->Instance->CR; | |||
if((((cr_temp & AES_CR_MODE) == CRYP_OPERATINGMODE_ENCRYPT) && (hcryp->Init.Algorithm == CRYP_AES_GCM_GMAC)) || | |||
(((cr_temp& AES_CR_MODE) == CRYP_OPERATINGMODE_DECRYPT) && (hcryp->Init.Algorithm == CRYP_AES_CCM))) | |||
{ | |||
/* Specify the number of non-valid bytes using NPBLB register*/ | |||
MODIFY_REG(hcryp->Instance->CR, AES_CR_NPBLB, ((uint32_t)npblb)<< 20U); | |||
} | |||
/* Number of valid words (lastwordsize) in last block */ | |||
if (npblb % 4U ==0U) | |||
{ | |||
lastwordsize = (16U-npblb)/4U; | |||
} | |||
else | |||
{ | |||
lastwordsize = (16U-npblb)/4U +1U; | |||
} | |||
/* Number of valid words (lastwordsize) in last block */ | |||
if ((npblb % 4U) ==0U) | |||
{ | |||
lastwordsize = (16U-npblb)/4U; | |||
} | |||
else | |||
{ | |||
lastwordsize = ((16U-npblb)/4U) +1U; | |||
} | |||
/* Last block optionally pad the data with zeros*/ | |||
for(loopcounter = 0U; loopcounter < lastwordsize; loopcounter++) | |||
{ | |||
hcryp->Instance->DINR = *(uint32_t *)(hcryp->pCrypInBuffPtr + hcryp->CrypInCount ); | |||
hcryp->CrypInCount++; | |||
} | |||
while(loopcounter < 4U ) | |||
{ | |||
/* pad the data with zeros to have a complete block */ | |||
hcryp->Instance->DINR = 0x0U; | |||
loopcounter++; | |||
/* Last block optionally pad the data with zeros*/ | |||
for(loopcounter = 0U; loopcounter < lastwordsize; loopcounter++) | |||
{ | |||
hcryp->Instance->DINR = *(uint32_t *)(hcryp->pCrypInBuffPtr + hcryp->CrypInCount ); | |||
hcryp->CrypInCount++; | |||
} | |||
while(loopcounter < 4U ) | |||
{ | |||
/* pad the data with zeros to have a complete block */ | |||
hcryp->Instance->DINR = 0x0U; | |||
loopcounter++; | |||
} | |||
} | |||
} | |||
} | |||
@@ -18,17 +18,15 @@ | |||
necessary). Please refer to the Reference manual for connection between peripherals | |||
and DMA requests. | |||
__HAL_RCC_DMAMUX1_CLK_ENABLE | |||
(#) For a given Channel, program the required configuration through the following parameters: | |||
Channel request, Transfer Direction, Source and Destination data formats, | |||
Circular or Normal mode, Channel Priority level, Source and Destination Increment mode | |||
using HAL_DMA_Init() function. | |||
Prior to HAL_DMA_Init the CLK shall be enabled for both DMA & DMAMUX | |||
Prior to HAL_DMA_Init the peripheral clock shall be enabled for both DMA & DMAMUX | |||
thanks to: | |||
DMA1 or DMA2: __HAL_RCC_DMA1_CLK_ENABLE() or __HAL_RCC_DMA2_CLK_ENABLE() ; | |||
DMAMUX1: __HAL_RCC_DMAMUX1_CLK_ENABLE(); | |||
(##) DMA1 or DMA2: __HAL_RCC_DMA1_CLK_ENABLE() or __HAL_RCC_DMA2_CLK_ENABLE() ; | |||
(##) DMAMUX1: __HAL_RCC_DMAMUX1_CLK_ENABLE(); | |||
(#) Use HAL_DMA_GetState() function to return the DMA state and HAL_DMA_GetError() in case of error | |||
detection. | |||
@@ -36,6 +34,7 @@ | |||
(#) Use HAL_DMA_Abort() function to abort the current transfer | |||
-@- In Memory-to-Memory transfer mode, Circular mode is not allowed. | |||
*** Polling mode IO operation *** | |||
================================= | |||
[..] | |||
@@ -54,13 +53,12 @@ | |||
In this case the DMA interrupt is configured | |||
(+) Use HAL_DMA_IRQHandler() called under DMA_IRQHandler() Interrupt subroutine | |||
(+) At the end of data transfer HAL_DMA_IRQHandler() function is executed and user can | |||
add his own function by customization of function pointer XferCpltCallback and | |||
XferErrorCallback (i.e. a member of DMA handle structure). | |||
add his own function to register callbacks with HAL_DMA_RegisterCallback(). | |||
*** DMA HAL driver macros list *** | |||
============================================= | |||
[..] | |||
Below the list of most used macros in DMA HAL driver. | |||
Below the list of macros in DMA HAL driver. | |||
(+) __HAL_DMA_ENABLE: Enable the specified DMA Channel. | |||
(+) __HAL_DMA_DISABLE: Disable the specified DMA Channel. | |||
@@ -68,7 +66,7 @@ | |||
(+) __HAL_DMA_CLEAR_FLAG: Clear the DMA Channel pending flags. | |||
(+) __HAL_DMA_ENABLE_IT: Enable the specified DMA Channel interrupts. | |||
(+) __HAL_DMA_DISABLE_IT: Disable the specified DMA Channel interrupts. | |||
(+) __HAL_DMA_GET_IT_SOURCE: Check whether the specified DMA Channel interrupt has occurred or not. | |||
(+) __HAL_DMA_GET_IT_SOURCE: Check whether the specified DMA Channel interrupt is enabled or not. | |||
[..] | |||
(@) You can refer to the DMA HAL driver header file for more useful macros | |||
@@ -172,19 +170,25 @@ HAL_StatusTypeDef HAL_DMA_Init(DMA_HandleTypeDef *hdma) | |||
assert_param(IS_DMA_ALL_REQUEST(hdma->Init.Request)); | |||
#if defined(DMA2) | |||
/* Compute the channel index */ | |||
if ((uint32_t)(hdma->Instance) < (uint32_t)(DMA2_Channel1)) | |||
{ | |||
/* DMA1 */ | |||
hdma->ChannelIndex = (((uint32_t)hdma->Instance - (uint32_t)DMA1_Channel1) / ((uint32_t)DMA1_Channel2 - (uint32_t)DMA1_Channel1)) << 2; | |||
hdma->ChannelIndex = (((uint32_t)hdma->Instance - (uint32_t)DMA1_Channel1) / ((uint32_t)DMA1_Channel2 - (uint32_t)DMA1_Channel1)) << 2U; | |||
hdma->DmaBaseAddress = DMA1; | |||
} | |||
else | |||
{ | |||
/* DMA2 */ | |||
hdma->ChannelIndex = (((uint32_t)hdma->Instance - (uint32_t)DMA2_Channel1) / ((uint32_t)DMA2_Channel2 - (uint32_t)DMA2_Channel1)) << 2; | |||
hdma->ChannelIndex = (((uint32_t)hdma->Instance - (uint32_t)DMA2_Channel1) / ((uint32_t)DMA2_Channel2 - (uint32_t)DMA2_Channel1)) << 2U; | |||
hdma->DmaBaseAddress = DMA2; | |||
} | |||
#else | |||
/* DMA1 */ | |||
hdma->ChannelIndex = (((uint32_t)hdma->Instance - (uint32_t)DMA1_Channel1) / ((uint32_t)DMA1_Channel2 - (uint32_t)DMA1_Channel1)) << 2U; | |||
hdma->DmaBaseAddress = DMA1; | |||
#endif | |||
/* Change DMA peripheral state */ | |||
hdma->State = HAL_DMA_STATE_BUSY; | |||
@@ -263,6 +267,7 @@ HAL_StatusTypeDef HAL_DMA_Init(DMA_HandleTypeDef *hdma) | |||
*/ | |||
HAL_StatusTypeDef HAL_DMA_DeInit(DMA_HandleTypeDef *hdma) | |||
{ | |||
/* Check the DMA handle allocation */ | |||
if (NULL == hdma) | |||
{ | |||
@@ -275,19 +280,25 @@ HAL_StatusTypeDef HAL_DMA_DeInit(DMA_HandleTypeDef *hdma) | |||
/* Disable the selected DMA Channelx */ | |||
__HAL_DMA_DISABLE(hdma); | |||
#if defined(DMA2) | |||
/* Compute the channel index */ | |||
if ((uint32_t)(hdma->Instance) < (uint32_t)(DMA2_Channel1)) | |||
{ | |||
/* DMA1 */ | |||
hdma->ChannelIndex = (((uint32_t)hdma->Instance - (uint32_t)DMA1_Channel1) / ((uint32_t)DMA1_Channel2 - (uint32_t)DMA1_Channel1)) << 2; | |||
hdma->ChannelIndex = (((uint32_t)hdma->Instance - (uint32_t)DMA1_Channel1) / ((uint32_t)DMA1_Channel2 - (uint32_t)DMA1_Channel1)) << 2U; | |||
hdma->DmaBaseAddress = DMA1; | |||
} | |||
else | |||
{ | |||
/* DMA2 */ | |||
hdma->ChannelIndex = (((uint32_t)hdma->Instance - (uint32_t)DMA2_Channel1) / ((uint32_t)DMA2_Channel2 - (uint32_t)DMA2_Channel1)) << 2; | |||
hdma->ChannelIndex = (((uint32_t)hdma->Instance - (uint32_t)DMA2_Channel1) / ((uint32_t)DMA2_Channel2 - (uint32_t)DMA2_Channel1)) << 2U; | |||
hdma->DmaBaseAddress = DMA2; | |||
} | |||
#else | |||
/* DMA1 */ | |||
hdma->ChannelIndex = (((uint32_t)hdma->Instance - (uint32_t)DMA1_Channel1) / ((uint32_t)DMA1_Channel2 - (uint32_t)DMA1_Channel1)) << 2U; | |||
hdma->DmaBaseAddress = DMA1; | |||
#endif | |||
/* Reset DMA Channel control register */ | |||
hdma->Instance->CCR = 0U; | |||
@@ -645,9 +656,9 @@ HAL_StatusTypeDef HAL_DMA_PollForTransfer(DMA_HandleTypeDef *hdma, HAL_DMA_Level | |||
/* Get tick */ | |||
tickstart = HAL_GetTick(); | |||
while (0U == (hdma->DmaBaseAddress->ISR & temp)) | |||
while((hdma->DmaBaseAddress->ISR & temp) == 0U) | |||
{ | |||
if ((0U != (hdma->DmaBaseAddress->ISR & (DMA_FLAG_TE1 << (hdma->ChannelIndex & 0x1cU))))) | |||
if((hdma->DmaBaseAddress->ISR & (DMA_FLAG_TE1 << (hdma->ChannelIndex& 0x1CU))) != 0U) | |||
{ | |||
/* When a DMA transfer error occurs */ | |||
/* A hardware clear of its EN bits is performed */ | |||
@@ -753,7 +764,7 @@ void HAL_DMA_IRQHandler(DMA_HandleTypeDef *hdma) | |||
__HAL_DMA_DISABLE_IT(hdma, DMA_IT_HT); | |||
} | |||
/* Clear the half transfer complete flag */ | |||
hdma->DmaBaseAddress->IFCR = (DMA_ISR_HTIF1 << (hdma->ChannelIndex & 0x1cU)); | |||
hdma->DmaBaseAddress->IFCR = (DMA_ISR_HTIF1 << (hdma->ChannelIndex & 0x1CU)); | |||
/* DMA peripheral state is not updated in Half Transfer */ | |||
/* but in Transfer Complete case */ | |||
@@ -766,7 +777,7 @@ void HAL_DMA_IRQHandler(DMA_HandleTypeDef *hdma) | |||
} | |||
/* Transfer Complete Interrupt management ***********************************/ | |||
else if ((0U != (flag_it & (DMA_FLAG_TC1 << (hdma->ChannelIndex & 0x1cU)))) && (0U != (source_it & DMA_IT_TC))) | |||
else if (((flag_it & (DMA_FLAG_TC1 << (hdma->ChannelIndex & 0x1cU))) != 0U) && ((source_it & DMA_IT_TC) != 0U)) | |||
{ | |||
if ((hdma->Instance->CCR & DMA_CCR_CIRC) == 0U) | |||
{ | |||
@@ -956,7 +967,7 @@ HAL_StatusTypeDef HAL_DMA_UnRegisterCallback(DMA_HandleTypeDef *hdma, HAL_DMA_Ca | |||
*/ | |||
/** | |||
* @brief Return the DMA hande state. | |||
* @brief Return the DMA handle state. | |||
* @param hdma Pointer to a DMA_HandleTypeDef structure that contains | |||
* the configuration information for the specified DMA Channel. | |||
* @retval HAL state | |||
@@ -1016,7 +1027,7 @@ static void DMA_SetConfig(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t | |||
/* Configure DMA Channel data length */ | |||
hdma->Instance->CNDTR = DataLength; | |||
/* Peripheral to Memory */ | |||
/* Memory to Peripheral */ | |||
if ((hdma->Init.Direction) == DMA_MEMORY_TO_PERIPH) | |||
{ | |||
/* Configure DMA Channel destination address */ | |||
@@ -1025,7 +1036,7 @@ static void DMA_SetConfig(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t | |||
/* Configure DMA Channel source address */ | |||
hdma->Instance->CMAR = SrcAddress; | |||
} | |||
/* Memory to Peripheral */ | |||
/* Peripheral to Memory */ | |||
else | |||
{ | |||
/* Configure DMA Channel source address */ | |||
@@ -1037,9 +1048,9 @@ static void DMA_SetConfig(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t | |||
} | |||
/** | |||
* @brief Updates the DMA handle with the DMAMUX channel and status mask depending on stream number | |||
* @brief Updates the DMA handle with the DMAMUX channel and status mask depending on channel number | |||
* @param hdma Pointer to a DMA_HandleTypeDef structure that contains | |||
* the configuration information for the specified DMA Stream. | |||
* the configuration information for the specified DMA Channel. | |||
* @retval None | |||
*/ | |||
static void DMA_CalcDMAMUXChannelBaseAndMask(DMA_HandleTypeDef *hdma) | |||
@@ -1047,6 +1058,7 @@ static void DMA_CalcDMAMUXChannelBaseAndMask(DMA_HandleTypeDef *hdma) | |||
uint32_t channel_number; | |||
/* check if instance is not outside the DMA channel range */ | |||
#if defined(DMA2) | |||
if ((uint32_t)hdma->Instance < (uint32_t)DMA2_Channel1) | |||
{ | |||
/* DMA1 */ | |||
@@ -1057,6 +1069,10 @@ static void DMA_CalcDMAMUXChannelBaseAndMask(DMA_HandleTypeDef *hdma) | |||
/* DMA2 */ | |||
hdma->DMAmuxChannel = (DMAMUX1_Channel7 + (hdma->ChannelIndex >> 2U)); | |||
} | |||
#else | |||
/* DMA1 */ | |||
hdma->DMAmuxChannel = (DMAMUX1_Channel0 + (hdma->ChannelIndex >> 2U)); | |||
#endif | |||
channel_number = (((uint32_t)hdma->Instance & 0xFFU) - 8U) / 20U; | |||
hdma->DMAmuxChannelStatus = DMAMUX1_ChannelStatus; | |||
hdma->DMAmuxChannelStatusMask = 1UL << (channel_number & 0x1cU); | |||
@@ -1065,7 +1081,7 @@ static void DMA_CalcDMAMUXChannelBaseAndMask(DMA_HandleTypeDef *hdma) | |||
/** | |||
* @brief Updates the DMA handle with the DMAMUX request generator params | |||
* @param hdma Pointer to a DMA_HandleTypeDef structure that contains | |||
* the configuration information for the specified DMA Stream. | |||
* the configuration information for the specified DMA Channel. | |||
* @retval None | |||
*/ | |||
@@ -1078,7 +1094,7 @@ static void DMA_CalcDMAMUXRequestGenBaseAndMask(DMA_HandleTypeDef *hdma) | |||
hdma->DMAmuxRequestGenStatus = DMAMUX1_RequestGenStatus; | |||
/* here "Request" is either DMA_REQUEST_GENERATOR0 to 4, i.e. <= 4*/ | |||
/* here "Request" is either DMA_REQUEST_GENERATOR0 to DMA_REQUEST_GENERATOR3, i.e. <= 4*/ | |||
hdma->DMAmuxRequestGenStatusMask = 1UL << ((request - 1U) & 0x3U); | |||
} | |||
@@ -76,8 +76,8 @@ | |||
=============================================================================== | |||
[..] This section provides functions allowing to: | |||
(+) Configure the DMA_MUX Synchronization Block using HAL_DMAEx_ConfigMuxSync function. | |||
(+) Configure the DMA_MUX Request Generator Block using HAL_DMAEx_ConfigMuxRequestGenerator function. | |||
(+) Configure the DMAMUX Synchronization Block using HAL_DMAEx_ConfigMuxSync function. | |||
(+) Configure the DMAMUX Request Generator Block using HAL_DMAEx_ConfigMuxRequestGenerator function. | |||
Functions HAL_DMAEx_EnableMuxRequestGenerator and HAL_DMAEx_DisableMuxRequestGenerator can then be used | |||
to respectively enable/disable the request generator. | |||
@@ -269,7 +269,7 @@ HAL_StatusTypeDef HAL_FLASH_Program_IT(uint32_t TypeProgram, uint32_t Address, u | |||
pFlash.Address = Address; | |||
/* Enable End of Operation and Error interrupts */ | |||
__HAL_FLASH_ENABLE_IT(FLASH_IT_EOP | FLASH_IT_OPERR | FLASH_IT_ECCC); | |||
__HAL_FLASH_ENABLE_IT(FLASH_IT_EOP | FLASH_IT_OPERR); | |||
if (TypeProgram == FLASH_TYPEPROGRAM_DOUBLEWORD) | |||
{ | |||
@@ -302,13 +302,11 @@ void HAL_FLASH_IRQHandler(void) | |||
uint32_t param = 0xFFFFFFFFU; | |||
uint32_t error; | |||
/* Save flash errors. Only ECC detection can be checked here as ECCC | |||
generates NMI */ | |||
error = (FLASH->SR & FLASH_FLAG_SR_ERROR); | |||
/* Check FLASH operation error flags */ | |||
error = (FLASH->SR & FLASH_FLAG_SR_ERRORS); | |||
/* Clear Current operation */ | |||
CLEAR_BIT(FLASH->CR, pFlash.ProcedureOnGoing); | |||
error |= (FLASH->ECCR & FLASH_FLAG_ECCC); | |||
/* A] Set parameter for user or error callbacks */ | |||
/* check operation was a program or erase */ | |||
@@ -317,9 +315,9 @@ void HAL_FLASH_IRQHandler(void) | |||
/* return adress being programmed */ | |||
param = pFlash.Address; | |||
} | |||
else if ((pFlash.ProcedureOnGoing & (FLASH_TYPEERASE_MASSERASE | FLASH_TYPEERASE_PAGES)) != 0U) | |||
else if ((pFlash.ProcedureOnGoing & (FLASH_TYPEERASE_PAGES)) != 0U) | |||
{ | |||
/* return page number being erased (0 for mass erase) */ | |||
/* return page number being erased */ | |||
param = pFlash.Page; | |||
} | |||
else | |||
@@ -381,7 +379,7 @@ void HAL_FLASH_IRQHandler(void) | |||
if (pFlash.ProcedureOnGoing == FLASH_TYPENONE) | |||
{ | |||
/* Disable End of Operation and Error interrupts */ | |||
__HAL_FLASH_DISABLE_IT(FLASH_IT_EOP | FLASH_IT_OPERR | FLASH_IT_ECCC); | |||
__HAL_FLASH_DISABLE_IT(FLASH_IT_EOP | FLASH_IT_OPERR); | |||
/* Process Unlocked */ | |||
__HAL_UNLOCK(&pFlash); | |||
@@ -391,7 +389,6 @@ void HAL_FLASH_IRQHandler(void) | |||
/** | |||
* @brief FLASH end of operation interrupt callback. | |||
* @param ReturnValue The value saved in this parameter depends on the ongoing procedure | |||
* Mass Erase: 0 | |||
* Page Erase: Page which has been erased | |||
* Program: Address which was selected for data program | |||
* @retval None | |||
@@ -409,7 +406,6 @@ __weak void HAL_FLASH_EndOfOperationCallback(uint32_t ReturnValue) | |||
/** | |||
* @brief FLASH operation error interrupt callback. | |||
* @param ReturnValue The value saved in this parameter depends on the ongoing procedure | |||
* Mass Erase: 0 | |||
* Page Erase: Page number which returned an error | |||
* Program: Address which was selected for data program | |||
* @retval None | |||
@@ -581,7 +577,6 @@ HAL_StatusTypeDef HAL_FLASH_OB_Launch(void) | |||
* @arg @ref HAL_FLASH_ERROR_FAST FLASH Fast programming error | |||
* @arg @ref HAL_FLASH_ERROR_RD FLASH Read Protection error (PCROP) | |||
* @arg @ref HAL_FLASH_ERROR_OPTV FLASH Option validity error | |||
* @arg @ref HAL_FLASH_ERROR_ECCD FLASH two ECC errors have been detected | |||
*/ | |||
uint32_t HAL_FLASH_GetError(void) | |||
{ | |||
@@ -623,8 +618,7 @@ HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout) | |||
} | |||
} | |||
/* check flash errors. Only ECC correction can be checked here as ECCD | |||
generates NMI */ | |||
/* Check FLASH operation error flags */ | |||
error = FLASH->SR; | |||
/* Check FLASH End of Operation flag */ | |||
@@ -635,10 +629,7 @@ HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout) | |||
} | |||
/* Now update error variable to only error value */ | |||
error &= FLASH_FLAG_SR_ERROR; | |||
/* Update error with ECC error value */ | |||
error |= (FLASH->ECCR & FLASH_FLAG_ECCC); | |||
error &= FLASH_FLAG_SR_ERRORS; | |||
/* clear error flags */ | |||
__HAL_FLASH_CLEAR_FLAG(error); | |||
@@ -98,7 +98,6 @@ | |||
/** @defgroup FLASHEx_Private_Functions FLASHEx Private Functions | |||
* @{ | |||
*/ | |||
static void FLASH_MassErase(void); | |||
static void FLASH_AcknowledgePageErase(void); | |||
static void FLASH_FlushCaches(void); | |||
static void FLASH_OB_WRPConfig(uint32_t WRPArea, uint32_t WRPStartOffset, uint32_t WRDPEndOffset); | |||
@@ -139,7 +138,7 @@ static HAL_StatusTypeDef FLASH_OB_ProceedWriteOperation(void); | |||
* @{ | |||
*/ | |||
/** | |||
* @brief Perform a mass erase or erase the specified FLASH memory pages. | |||
* @brief Perform an erase of the specified FLASH memory pages. | |||
* @note Before any operation, it is possible to check there is no operation suspended | |||
* by call HAL_FLASHEx_IsOperationSuspended() | |||
* @param[in] pEraseInit Pointer to an @ref FLASH_EraseInitTypeDef structure that | |||
@@ -168,17 +167,7 @@ HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t | |||
if (status == HAL_OK) | |||
{ | |||
if (pEraseInit->TypeErase == FLASH_TYPEERASE_MASSERASE) | |||
{ | |||
/* Mass erase to be done */ | |||
FLASH_MassErase(); | |||
/* Wait for last operation to be completed */ | |||
status = FLASH_WaitForLastOperation(FLASH_TIMEOUT_VALUE); | |||
/* If operation is completed or interrupted, no need to clear the Mass Erase Bit */ | |||
} | |||
else | |||
if (pEraseInit->TypeErase == FLASH_TYPEERASE_PAGES) | |||
{ | |||
/*Initialization of PageError variable*/ | |||
*PageError = 0xFFFFFFFFU; | |||
@@ -214,7 +203,7 @@ HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t | |||
} | |||
/** | |||
* @brief Perform a mass erase or erase the specified FLASH memory pages with interrupt enabled. | |||
* @brief Perform an erase of the specified FLASH memory pages with interrupt enabled. | |||
* @note Before any operation, it is possible to check there is no operation suspended | |||
* by call HAL_FLASHEx_IsOperationSuspended() | |||
* @param pEraseInit Pointer to an @ref FLASH_EraseInitTypeDef structure that | |||
@@ -250,15 +239,7 @@ HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit) | |||
/* Enable End of Operation and Error interrupts */ | |||
__HAL_FLASH_ENABLE_IT(FLASH_IT_EOP | FLASH_IT_OPERR); | |||
if (pEraseInit->TypeErase == FLASH_TYPEERASE_MASSERASE) | |||
{ | |||
/* Set Page to 0 for Interrupt callback managment */ | |||
pFlash.Page = 0; | |||
/* Proceed to Mass Erase */ | |||
FLASH_MassErase(); | |||
} | |||
else | |||
if (pEraseInit->TypeErase == FLASH_TYPEERASE_PAGES) | |||
{ | |||
/* Erase by page to be done */ | |||
pFlash.NbPagesToErase = pEraseInit->NbPages; | |||
@@ -513,16 +494,6 @@ uint32_t HAL_FLASHEx_IsOperationSuspended(void) | |||
* @{ | |||
*/ | |||
/** | |||
* @brief Mass erase of FLASH memory. | |||
* @retval None | |||
*/ | |||
static void FLASH_MassErase(void) | |||
{ | |||
/* Set the Mass Erase Bit and start bit */ | |||
SET_BIT(FLASH->CR, (FLASH_CR_MER | FLASH_CR_STRT)); | |||
} | |||
/** | |||
* @brief Erase the specified FLASH memory page. | |||
* @param Page FLASH page to erase | |||
@@ -188,26 +188,6 @@ void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init) | |||
if (iocurrent != 0x00u) | |||
{ | |||
/*--------------------- GPIO Mode Configuration ------------------------*/ | |||
/* In case of Alternate function mode selection */ | |||
if((GPIO_Init->Mode == GPIO_MODE_AF_PP) || (GPIO_Init->Mode == GPIO_MODE_AF_OD)) | |||
{ | |||
/* Check the Alternate function parameters */ | |||
assert_param(IS_GPIO_AF_INSTANCE(GPIOx)); | |||
assert_param(IS_GPIO_AF(GPIO_Init->Alternate)); | |||
/* Configure Alternate function mapped with the current IO */ | |||
temp = GPIOx->AFR[position >> 3u]; | |||
temp &= ~(0xFu << ((position & 0x07u) * 4u)); | |||
temp |= ((GPIO_Init->Alternate) << ((position & 0x07u) * 4u)); | |||
GPIOx->AFR[position >> 3u] = temp; | |||
} | |||
/* Configure IO Direction mode (Input, Output, Alternate or Analog) */ | |||
temp = GPIOx->MODER; | |||
temp &= ~(GPIO_MODER_MODE0 << (position * 2u)); | |||
temp |= ((GPIO_Init->Mode & GPIO_MODE) << (position * 2u)); | |||
GPIOx->MODER = temp; | |||
/* In case of Output or Alternate function mode selection */ | |||
if((GPIO_Init->Mode == GPIO_MODE_OUTPUT_PP) || (GPIO_Init->Mode == GPIO_MODE_AF_PP) || | |||
(GPIO_Init->Mode == GPIO_MODE_OUTPUT_OD) || (GPIO_Init->Mode == GPIO_MODE_AF_OD)) | |||
@@ -233,6 +213,26 @@ void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init) | |||
temp |= ((GPIO_Init->Pull) << (position * 2u)); | |||
GPIOx->PUPDR = temp; | |||
/* In case of Alternate function mode selection */ | |||
if((GPIO_Init->Mode == GPIO_MODE_AF_PP) || (GPIO_Init->Mode == GPIO_MODE_AF_OD)) | |||
{ | |||
/* Check the Alternate function parameters */ | |||
assert_param(IS_GPIO_AF_INSTANCE(GPIOx)); | |||
assert_param(IS_GPIO_AF(GPIO_Init->Alternate)); | |||
/* Configure Alternate function mapped with the current IO */ | |||
temp = GPIOx->AFR[position >> 3u]; | |||
temp &= ~(0xFu << ((position & 0x07u) * 4u)); | |||
temp |= ((GPIO_Init->Alternate) << ((position & 0x07u) * 4u)); | |||
GPIOx->AFR[position >> 3u] = temp; | |||
} | |||
/* Configure IO Direction mode (Input, Output, Alternate or Analog) */ | |||
temp = GPIOx->MODER; | |||
temp &= ~(GPIO_MODER_MODE0 << (position * 2u)); | |||
temp |= ((GPIO_Init->Mode & GPIO_MODE) << (position * 2u)); | |||
GPIOx->MODER = temp; | |||
/*--------------------- EXTI Mode Configuration ------------------------*/ | |||
/* Configure the External Interrupt or event for the current IO */ | |||
if((GPIO_Init->Mode & EXTI_MODE) == EXTI_MODE) | |||
@@ -314,9 +314,6 @@ void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin) | |||
tmp &= (0x0FUL << (4u * (position & 0x03u))); | |||
if (tmp == (GPIO_GET_INDEX(GPIOx) << (4u * (position & 0x03u)))) | |||
{ | |||
tmp = 0x0FuL << (4u * (position & 0x03u)); | |||
SYSCFG->EXTICR[position >> 2u] &= ~tmp; | |||
/* Clear EXTI line configuration */ | |||
EXTI->IMR1 &= ~(iocurrent); | |||
EXTI->EMR1 &= ~(iocurrent); | |||
@@ -324,6 +321,9 @@ void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin) | |||
/* Clear Rising Falling edge configuration */ | |||
EXTI->RTSR1 &= ~(iocurrent); | |||
EXTI->FTSR1 &= ~(iocurrent); | |||
tmp = 0x0FuL << (4u * (position & 0x03u)); | |||
SYSCFG->EXTICR[position >> 2u] &= ~tmp; | |||
} | |||
/*------------------------- GPIO Mode Configuration --------------------*/ | |||
@@ -333,14 +333,14 @@ void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin) | |||
/* Configure the default Alternate Function in current IO */ | |||
GPIOx->AFR[position >> 3u] &= ~(0xFu << ((position & 0x07u) * 4u)) ; | |||
/* Configure the default value for IO Speed */ | |||
GPIOx->OSPEEDR &= ~(GPIO_OSPEEDR_OSPEED0 << (position * 2u)); | |||
/* Deactivate the Pull-up and Pull-down resistor for the current IO */ | |||
GPIOx->PUPDR &= ~(GPIO_PUPDR_PUPD0 << (position * 2u)); | |||
/* Configure the default value IO Output Type */ | |||
GPIOx->OTYPER &= ~(GPIO_OTYPER_OT0 << position) ; | |||
/* Deactivate the Pull-up and Pull-down resistor for the current IO */ | |||
GPIOx->PUPDR &= ~(GPIO_PUPDR_PUPD0 << (position * 2u)); | |||
/* Configure the default value for IO Speed */ | |||
GPIOx->OSPEEDR &= ~(GPIO_OSPEEDR_OSPEED0 << (position * 2u)); | |||
} | |||
position++; | |||
@@ -351,13 +351,13 @@ | |||
/* Private define to centralize the enable/disable of Interrupts */ | |||
#define I2C_XFER_TX_IT (0x00000001U) | |||
#define I2C_XFER_RX_IT (0x00000002U) | |||
#define I2C_XFER_LISTEN_IT (0x00000004U) | |||
#define I2C_XFER_TX_IT (uint16_t)(0x0001U) /* Bit field can be combinated with @ref I2C_XFER_LISTEN_IT */ | |||
#define I2C_XFER_RX_IT (uint16_t)(0x0002U) /* Bit field can be combinated with @ref I2C_XFER_LISTEN_IT */ | |||
#define I2C_XFER_LISTEN_IT (uint16_t)(0x8000U) /* Bit field can be combinated with @ref I2C_XFER_TX_IT and @ref I2C_XFER_RX_IT */ | |||
#define I2C_XFER_ERROR_IT (0x00000011U) | |||
#define I2C_XFER_CPLT_IT (0x00000012U) | |||
#define I2C_XFER_RELOAD_IT (0x00000012U) | |||
#define I2C_XFER_ERROR_IT (uint16_t)(0x0010U) /* Bit definition to manage addition of global Error and NACK treatment */ | |||
#define I2C_XFER_CPLT_IT (uint16_t)(0x0020U) /* Bit definition to manage only STOP evenement */ | |||
#define I2C_XFER_RELOAD_IT (uint16_t)(0x0040U) /* Bit definition to manage only Reload of NBYTE */ | |||
/* Private define Sequential Transfer Options default/reset value */ | |||
#define I2C_NO_OPTION_FRAME (0xFFFF0000U) | |||
@@ -410,6 +410,9 @@ static HAL_StatusTypeDef I2C_IsAcknowledgeFailed(I2C_HandleTypeDef *hi2c, uint32 | |||
static void I2C_Enable_IRQ(I2C_HandleTypeDef *hi2c, uint16_t InterruptRequest); | |||
static void I2C_Disable_IRQ(I2C_HandleTypeDef *hi2c, uint16_t InterruptRequest); | |||
/* Private function to treat different error callback */ | |||
static void I2C_TreatErrorCallback(I2C_HandleTypeDef *hi2c); | |||
/* Private function to flush TXDR register */ | |||
static void I2C_Flush_TXDR(I2C_HandleTypeDef *hi2c); | |||
@@ -4251,9 +4254,21 @@ HAL_StatusTypeDef HAL_I2C_Master_Abort_IT(I2C_HandleTypeDef *hi2c, uint16_t DevA | |||
/* Process Locked */ | |||
__HAL_LOCK(hi2c); | |||
/* Disable Interrupts */ | |||
I2C_Disable_IRQ(hi2c, I2C_XFER_RX_IT); | |||
I2C_Disable_IRQ(hi2c, I2C_XFER_TX_IT); | |||
/* Disable Interrupts and Store Previous state */ | |||
if (hi2c->State == HAL_I2C_STATE_BUSY_TX) | |||
{ | |||
I2C_Disable_IRQ(hi2c, I2C_XFER_TX_IT); | |||
hi2c->PreviousState = I2C_STATE_MASTER_BUSY_TX; | |||
} | |||
else if (hi2c->State == HAL_I2C_STATE_BUSY_RX) | |||
{ | |||
I2C_Disable_IRQ(hi2c, I2C_XFER_RX_IT); | |||
hi2c->PreviousState = I2C_STATE_MASTER_BUSY_RX; | |||
} | |||
else | |||
{ | |||
/* Do nothing */ | |||
} | |||
/* Set State at HAL_I2C_STATE_ABORT */ | |||
hi2c->State = HAL_I2C_STATE_ABORT; | |||
@@ -4737,6 +4752,13 @@ static HAL_StatusTypeDef I2C_Slave_ISR_IT(struct __I2C_HandleTypeDef *hi2c, uint | |||
/* Process locked */ | |||
__HAL_LOCK(hi2c); | |||
/* Check if STOPF is set */ | |||
if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_STOPF) != RESET) && (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_STOPI) != RESET)) | |||
{ | |||
/* Call I2C Slave complete process */ | |||
I2C_ITSlaveCplt(hi2c, tmpITFlags); | |||
} | |||
if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_AF) != RESET) && (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_NACKI) != RESET)) | |||
{ | |||
/* Check that I2C transfer finished */ | |||
@@ -4788,9 +4810,6 @@ static HAL_StatusTypeDef I2C_Slave_ISR_IT(struct __I2C_HandleTypeDef *hi2c, uint | |||
{ | |||
if (hi2c->XferCount > 0U) | |||
{ | |||
/* Remove RXNE flag on temporary variable as read done */ | |||
tmpITFlags &= ~I2C_FLAG_RXNE; | |||
/* Read data from RXDR */ | |||
*hi2c->pBuffPtr = (uint8_t)hi2c->Instance->RXDR; | |||
@@ -4844,13 +4863,6 @@ static HAL_StatusTypeDef I2C_Slave_ISR_IT(struct __I2C_HandleTypeDef *hi2c, uint | |||
/* Nothing to do */ | |||
} | |||
/* Check if STOPF is set */ | |||
if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_STOPF) != RESET) && (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_STOPI) != RESET)) | |||
{ | |||
/* Call I2C Slave complete process */ | |||
I2C_ITSlaveCplt(hi2c, tmpITFlags); | |||
} | |||
/* Process Unlocked */ | |||
__HAL_UNLOCK(hi2c); | |||
@@ -5004,10 +5016,18 @@ static HAL_StatusTypeDef I2C_Slave_ISR_DMA(struct __I2C_HandleTypeDef *hi2c, uin | |||
{ | |||
uint32_t tmpoptions = hi2c->XferOptions; | |||
uint32_t treatdmanack = 0U; | |||
HAL_I2C_StateTypeDef tmpstate; | |||
/* Process locked */ | |||
__HAL_LOCK(hi2c); | |||
/* Check if STOPF is set */ | |||
if ((I2C_CHECK_FLAG(ITFlags, I2C_FLAG_STOPF) != RESET) && (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_STOPI) != RESET)) | |||
{ | |||
/* Call I2C Slave complete process */ | |||
I2C_ITSlaveCplt(hi2c, ITFlags); | |||
} | |||
if ((I2C_CHECK_FLAG(ITFlags, I2C_FLAG_AF) != RESET) && (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_NACKI) != RESET)) | |||
{ | |||
/* Check that I2C transfer finished */ | |||
@@ -5075,8 +5095,24 @@ static HAL_StatusTypeDef I2C_Slave_ISR_DMA(struct __I2C_HandleTypeDef *hi2c, uin | |||
/* Set ErrorCode corresponding to a Non-Acknowledge */ | |||
hi2c->ErrorCode |= HAL_I2C_ERROR_AF; | |||
/* Store current hi2c->State, solve MISRA2012-Rule-13.5 */ | |||
tmpstate = hi2c->State; | |||
if ((tmpoptions == I2C_FIRST_FRAME) || (tmpoptions == I2C_NEXT_FRAME)) | |||
{ | |||
if ((tmpstate == HAL_I2C_STATE_BUSY_TX) || (tmpstate == HAL_I2C_STATE_BUSY_TX_LISTEN)) | |||
{ | |||
hi2c->PreviousState = I2C_STATE_SLAVE_BUSY_TX; | |||
} | |||
else if ((tmpstate == HAL_I2C_STATE_BUSY_RX) || (tmpstate == HAL_I2C_STATE_BUSY_RX_LISTEN)) | |||
{ | |||
hi2c->PreviousState = I2C_STATE_SLAVE_BUSY_RX; | |||
} | |||
else | |||
{ | |||
/* Do nothing */ | |||
} | |||
/* Call the corresponding callback to inform upper layer of End of Transfer */ | |||
I2C_ITError(hi2c, hi2c->ErrorCode); | |||
} | |||
@@ -5092,11 +5128,6 @@ static HAL_StatusTypeDef I2C_Slave_ISR_DMA(struct __I2C_HandleTypeDef *hi2c, uin | |||
{ | |||
I2C_ITAddrCplt(hi2c, ITFlags); | |||
} | |||
else if ((I2C_CHECK_FLAG(ITFlags, I2C_FLAG_STOPF) != RESET) && (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_STOPI) != RESET)) | |||
{ | |||
/* Call I2C Slave complete process */ | |||
I2C_ITSlaveCplt(hi2c, ITFlags); | |||
} | |||
else | |||
{ | |||
/* Nothing to do */ | |||
@@ -5370,9 +5401,27 @@ static void I2C_ITMasterSeqCplt(I2C_HandleTypeDef *hi2c) | |||
*/ | |||
static void I2C_ITSlaveSeqCplt(I2C_HandleTypeDef *hi2c) | |||
{ | |||
uint32_t tmpcr1value = READ_REG(hi2c->Instance->CR1); | |||
/* Reset I2C handle mode */ | |||
hi2c->Mode = HAL_I2C_MODE_NONE; | |||
/* If a DMA is ongoing, Update handle size context */ | |||
if (I2C_CHECK_IT_SOURCE(tmpcr1value, I2C_CR1_TXDMAEN) != RESET) | |||
{ | |||
/* Disable DMA Request */ | |||
hi2c->Instance->CR1 &= ~I2C_CR1_TXDMAEN; | |||
} | |||
else if (I2C_CHECK_IT_SOURCE(tmpcr1value, I2C_CR1_RXDMAEN) != RESET) | |||
{ | |||
/* Disable DMA Request */ | |||
hi2c->Instance->CR1 &= ~I2C_CR1_RXDMAEN; | |||
} | |||
else | |||
{ | |||
/* Do nothing */ | |||
} | |||
if (hi2c->State == HAL_I2C_STATE_BUSY_TX_LISTEN) | |||
{ | |||
/* Remove HAL_I2C_STATE_SLAVE_BUSY_TX, keep only HAL_I2C_STATE_LISTEN */ | |||
@@ -5427,19 +5476,36 @@ static void I2C_ITSlaveSeqCplt(I2C_HandleTypeDef *hi2c) | |||
static void I2C_ITMasterCplt(I2C_HandleTypeDef *hi2c, uint32_t ITFlags) | |||
{ | |||
uint32_t tmperror; | |||
uint32_t tmpITFlags = ITFlags; | |||
__IO uint32_t tmpreg; | |||
/* Clear STOP Flag */ | |||
__HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_STOPF); | |||
/* Disable Interrupts and Store Previous state */ | |||
if (hi2c->State == HAL_I2C_STATE_BUSY_TX) | |||
{ | |||
I2C_Disable_IRQ(hi2c, I2C_XFER_TX_IT); | |||
hi2c->PreviousState = I2C_STATE_MASTER_BUSY_TX; | |||
} | |||
else if (hi2c->State == HAL_I2C_STATE_BUSY_RX) | |||
{ | |||
I2C_Disable_IRQ(hi2c, I2C_XFER_RX_IT); | |||
hi2c->PreviousState = I2C_STATE_MASTER_BUSY_RX; | |||
} | |||
else | |||
{ | |||
/* Do nothing */ | |||
} | |||
/* Clear Configuration Register 2 */ | |||
I2C_RESET_CR2(hi2c); | |||
/* Reset handle parameters */ | |||
hi2c->PreviousState = I2C_STATE_NONE; | |||
hi2c->XferISR = NULL; | |||
hi2c->XferOptions = I2C_NO_OPTION_FRAME; | |||
if (I2C_CHECK_FLAG(ITFlags, I2C_FLAG_AF) != RESET) | |||
if (I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_AF) != RESET) | |||
{ | |||
/* Clear NACK Flag */ | |||
__HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF); | |||
@@ -5448,12 +5514,17 @@ static void I2C_ITMasterCplt(I2C_HandleTypeDef *hi2c, uint32_t ITFlags) | |||
hi2c->ErrorCode |= HAL_I2C_ERROR_AF; | |||
} | |||
/* Fetch Last receive data if any */ | |||
if ((hi2c->State == HAL_I2C_STATE_ABORT) && (I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_RXNE) != RESET)) | |||
{ | |||
/* Read data from RXDR */ | |||
tmpreg = (uint8_t)hi2c->Instance->RXDR; | |||
UNUSED(tmpreg); | |||
} | |||
/* Flush TX register */ | |||
I2C_Flush_TXDR(hi2c); | |||
/* Disable Interrupts */ | |||
I2C_Disable_IRQ(hi2c, I2C_XFER_TX_IT | I2C_XFER_RX_IT); | |||
/* Store current volatile hi2c->ErrorCode, misra rule */ | |||
tmperror = hi2c->ErrorCode; | |||
@@ -5467,6 +5538,7 @@ static void I2C_ITMasterCplt(I2C_HandleTypeDef *hi2c, uint32_t ITFlags) | |||
else if (hi2c->State == HAL_I2C_STATE_BUSY_TX) | |||
{ | |||
hi2c->State = HAL_I2C_STATE_READY; | |||
hi2c->PreviousState = I2C_STATE_NONE; | |||
if (hi2c->Mode == HAL_I2C_MODE_MEM) | |||
{ | |||
@@ -5501,6 +5573,7 @@ static void I2C_ITMasterCplt(I2C_HandleTypeDef *hi2c, uint32_t ITFlags) | |||
else if (hi2c->State == HAL_I2C_STATE_BUSY_RX) | |||
{ | |||
hi2c->State = HAL_I2C_STATE_READY; | |||
hi2c->PreviousState = I2C_STATE_NONE; | |||
if (hi2c->Mode == HAL_I2C_MODE_MEM) | |||
{ | |||
@@ -5547,12 +5620,26 @@ static void I2C_ITSlaveCplt(I2C_HandleTypeDef *hi2c, uint32_t ITFlags) | |||
{ | |||
uint32_t tmpcr1value = READ_REG(hi2c->Instance->CR1); | |||
uint32_t tmpITFlags = ITFlags; | |||
HAL_I2C_StateTypeDef tmpstate = hi2c->State; | |||
/* Clear STOP Flag */ | |||
__HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_STOPF); | |||
/* Disable all interrupts */ | |||
I2C_Disable_IRQ(hi2c, I2C_XFER_LISTEN_IT | I2C_XFER_TX_IT | I2C_XFER_RX_IT); | |||
/* Disable Interrupts and Store Previous state */ | |||
if ((tmpstate == HAL_I2C_STATE_BUSY_TX) || (tmpstate == HAL_I2C_STATE_BUSY_TX_LISTEN)) | |||
{ | |||
I2C_Disable_IRQ(hi2c, I2C_XFER_LISTEN_IT | I2C_XFER_TX_IT); | |||
hi2c->PreviousState = I2C_STATE_SLAVE_BUSY_TX; | |||
} | |||
else if ((tmpstate == HAL_I2C_STATE_BUSY_RX) || (tmpstate == HAL_I2C_STATE_BUSY_RX_LISTEN)) | |||
{ | |||
I2C_Disable_IRQ(hi2c, I2C_XFER_LISTEN_IT | I2C_XFER_RX_IT); | |||
hi2c->PreviousState = I2C_STATE_SLAVE_BUSY_RX; | |||
} | |||
else | |||
{ | |||
/* Do nothing */ | |||
} | |||
/* Disable Address Acknowledge */ | |||
hi2c->Instance->CR2 |= I2C_CR2_NACK; | |||
@@ -5566,6 +5653,9 @@ static void I2C_ITSlaveCplt(I2C_HandleTypeDef *hi2c, uint32_t ITFlags) | |||
/* If a DMA is ongoing, Update handle size context */ | |||
if (I2C_CHECK_IT_SOURCE(tmpcr1value, I2C_CR1_TXDMAEN) != RESET) | |||
{ | |||
/* Disable DMA Request */ | |||
hi2c->Instance->CR1 &= ~I2C_CR1_TXDMAEN; | |||
if (hi2c->hdmatx != NULL) | |||
{ | |||
hi2c->XferCount = (uint16_t)__HAL_DMA_GET_COUNTER(hi2c->hdmatx); | |||
@@ -5573,6 +5663,9 @@ static void I2C_ITSlaveCplt(I2C_HandleTypeDef *hi2c, uint32_t ITFlags) | |||
} | |||
else if (I2C_CHECK_IT_SOURCE(tmpcr1value, I2C_CR1_RXDMAEN) != RESET) | |||
{ | |||
/* Disable DMA Request */ | |||
hi2c->Instance->CR1 &= ~I2C_CR1_RXDMAEN; | |||
if (hi2c->hdmarx != NULL) | |||
{ | |||
hi2c->XferCount = (uint16_t)__HAL_DMA_GET_COUNTER(hi2c->hdmarx); | |||
@@ -5609,7 +5702,6 @@ static void I2C_ITSlaveCplt(I2C_HandleTypeDef *hi2c, uint32_t ITFlags) | |||
hi2c->ErrorCode |= HAL_I2C_ERROR_AF; | |||
} | |||
hi2c->PreviousState = I2C_STATE_NONE; | |||
hi2c->Mode = HAL_I2C_MODE_NONE; | |||
hi2c->XferISR = NULL; | |||
@@ -5632,6 +5724,7 @@ static void I2C_ITSlaveCplt(I2C_HandleTypeDef *hi2c, uint32_t ITFlags) | |||
hi2c->XferOptions = I2C_NO_OPTION_FRAME; | |||
hi2c->State = HAL_I2C_STATE_READY; | |||
hi2c->PreviousState = I2C_STATE_NONE; | |||
/* Process Unlocked */ | |||
__HAL_UNLOCK(hi2c); | |||
@@ -5647,6 +5740,7 @@ static void I2C_ITSlaveCplt(I2C_HandleTypeDef *hi2c, uint32_t ITFlags) | |||
else if (hi2c->State == HAL_I2C_STATE_BUSY_RX) | |||
{ | |||
hi2c->State = HAL_I2C_STATE_READY; | |||
hi2c->PreviousState = I2C_STATE_NONE; | |||
/* Process Unlocked */ | |||
__HAL_UNLOCK(hi2c); | |||
@@ -5661,6 +5755,7 @@ static void I2C_ITSlaveCplt(I2C_HandleTypeDef *hi2c, uint32_t ITFlags) | |||
else | |||
{ | |||
hi2c->State = HAL_I2C_STATE_READY; | |||
hi2c->PreviousState = I2C_STATE_NONE; | |||
/* Process Unlocked */ | |||
__HAL_UNLOCK(hi2c); | |||
@@ -5734,6 +5829,7 @@ static void I2C_ITListenCplt(I2C_HandleTypeDef *hi2c, uint32_t ITFlags) | |||
static void I2C_ITError(I2C_HandleTypeDef *hi2c, uint32_t ErrorCode) | |||
{ | |||
HAL_I2C_StateTypeDef tmpstate = hi2c->State; | |||
uint32_t tmppreviousstate; | |||
/* Reset handle parameters */ | |||
hi2c->Mode = HAL_I2C_MODE_NONE; | |||
@@ -5753,7 +5849,6 @@ static void I2C_ITError(I2C_HandleTypeDef *hi2c, uint32_t ErrorCode) | |||
/* keep HAL_I2C_STATE_LISTEN if set */ | |||
hi2c->State = HAL_I2C_STATE_LISTEN; | |||
hi2c->PreviousState = I2C_STATE_NONE; | |||
hi2c->XferISR = I2C_Slave_ISR_IT; | |||
} | |||
else | |||
@@ -5768,16 +5863,19 @@ static void I2C_ITError(I2C_HandleTypeDef *hi2c, uint32_t ErrorCode) | |||
/* Set HAL_I2C_STATE_READY */ | |||
hi2c->State = HAL_I2C_STATE_READY; | |||
} | |||
hi2c->PreviousState = I2C_STATE_NONE; | |||
hi2c->XferISR = NULL; | |||
} | |||
/* Abort DMA TX transfer if any */ | |||
if ((hi2c->Instance->CR1 & I2C_CR1_TXDMAEN) == I2C_CR1_TXDMAEN) | |||
tmppreviousstate = hi2c->PreviousState; | |||
if ((hi2c->hdmatx != NULL) && ((tmppreviousstate == I2C_STATE_MASTER_BUSY_TX) || (tmppreviousstate == I2C_STATE_SLAVE_BUSY_TX))) | |||
{ | |||
hi2c->Instance->CR1 &= ~I2C_CR1_TXDMAEN; | |||
if ((hi2c->Instance->CR1 & I2C_CR1_TXDMAEN) == I2C_CR1_TXDMAEN) | |||
{ | |||
hi2c->Instance->CR1 &= ~I2C_CR1_TXDMAEN; | |||
} | |||
if (hi2c->hdmatx != NULL) | |||
if (HAL_DMA_GetState(hi2c->hdmatx) != HAL_DMA_STATE_READY) | |||
{ | |||
/* Set the I2C DMA Abort callback : | |||
will lead to call HAL_I2C_ErrorCallback() at end of DMA abort procedure */ | |||
@@ -5793,13 +5891,20 @@ static void I2C_ITError(I2C_HandleTypeDef *hi2c, uint32_t ErrorCode) | |||
hi2c->hdmatx->XferAbortCallback(hi2c->hdmatx); | |||
} | |||
} | |||
else | |||
{ | |||
I2C_TreatErrorCallback(hi2c); | |||
} | |||
} | |||
/* Abort DMA RX transfer if any */ | |||
else if ((hi2c->Instance->CR1 & I2C_CR1_RXDMAEN) == I2C_CR1_RXDMAEN) | |||
else if ((hi2c->hdmarx != NULL) && ((tmppreviousstate == I2C_STATE_MASTER_BUSY_RX) || (tmppreviousstate == I2C_STATE_SLAVE_BUSY_RX))) | |||
{ | |||
hi2c->Instance->CR1 &= ~I2C_CR1_RXDMAEN; | |||
if ((hi2c->Instance->CR1 & I2C_CR1_RXDMAEN) == I2C_CR1_RXDMAEN) | |||
{ | |||
hi2c->Instance->CR1 &= ~I2C_CR1_RXDMAEN; | |||
} | |||
if (hi2c->hdmarx != NULL) | |||
if (HAL_DMA_GetState(hi2c->hdmarx) != HAL_DMA_STATE_READY) | |||
{ | |||
/* Set the I2C DMA Abort callback : | |||
will lead to call HAL_I2C_ErrorCallback() at end of DMA abort procedure */ | |||
@@ -5815,10 +5920,28 @@ static void I2C_ITError(I2C_HandleTypeDef *hi2c, uint32_t ErrorCode) | |||
hi2c->hdmarx->XferAbortCallback(hi2c->hdmarx); | |||
} | |||
} | |||
else | |||
{ | |||
I2C_TreatErrorCallback(hi2c); | |||
} | |||
} | |||
else | |||
{ | |||
I2C_TreatErrorCallback(hi2c); | |||
} | |||
else if (hi2c->State == HAL_I2C_STATE_ABORT) | |||
} | |||
/** | |||
* @brief I2C Error callback treatment. | |||
* @param hi2c I2C handle. | |||
* @retval None | |||
*/ | |||
static void I2C_TreatErrorCallback(I2C_HandleTypeDef *hi2c) | |||
{ | |||
if (hi2c->State == HAL_I2C_STATE_ABORT) | |||
{ | |||
hi2c->State = HAL_I2C_STATE_READY; | |||
hi2c->PreviousState = I2C_STATE_NONE; | |||
/* Process Unlocked */ | |||
__HAL_UNLOCK(hi2c); | |||
@@ -5832,6 +5955,8 @@ static void I2C_ITError(I2C_HandleTypeDef *hi2c, uint32_t ErrorCode) | |||
} | |||
else | |||
{ | |||
hi2c->PreviousState = I2C_STATE_NONE; | |||
/* Process Unlocked */ | |||
__HAL_UNLOCK(hi2c); | |||
@@ -6042,30 +6167,16 @@ static void I2C_DMAAbort(DMA_HandleTypeDef *hdma) | |||
I2C_HandleTypeDef *hi2c = (I2C_HandleTypeDef *)(((DMA_HandleTypeDef *)hdma)->Parent); /* Derogation MISRAC2012-Rule-11.5 */ | |||
/* Reset AbortCpltCallback */ | |||
hi2c->hdmatx->XferAbortCallback = NULL; | |||
hi2c->hdmarx->XferAbortCallback = NULL; | |||
/* Check if come from abort from user */ | |||
if (hi2c->State == HAL_I2C_STATE_ABORT) | |||
if (hi2c->hdmatx != NULL) | |||
{ | |||
hi2c->State = HAL_I2C_STATE_READY; | |||
/* Call the corresponding callback to inform upper layer of End of Transfer */ | |||
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) | |||
hi2c->AbortCpltCallback(hi2c); | |||
#else | |||
HAL_I2C_AbortCpltCallback(hi2c); | |||
#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ | |||
hi2c->hdmatx->XferAbortCallback = NULL; | |||
} | |||
else | |||
if (hi2c->hdmarx != NULL) | |||
{ | |||
/* Call the corresponding callback to inform upper layer of End of Transfer */ | |||
#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) | |||
hi2c->ErrorCallback(hi2c); | |||
#else | |||
HAL_I2C_ErrorCallback(hi2c); | |||
#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ | |||
hi2c->hdmarx->XferAbortCallback = NULL; | |||
} | |||
I2C_TreatErrorCallback(hi2c); | |||
} | |||
/** | |||
@@ -6342,19 +6453,19 @@ static void I2C_Enable_IRQ(I2C_HandleTypeDef *hi2c, uint16_t InterruptRequest) | |||
tmpisr |= I2C_IT_ADDRI | I2C_IT_STOPI | I2C_IT_NACKI | I2C_IT_ERRI; | |||
} | |||
if ((InterruptRequest & I2C_XFER_ERROR_IT) == I2C_XFER_ERROR_IT) | |||
if (InterruptRequest == I2C_XFER_ERROR_IT) | |||
{ | |||
/* Enable ERR and NACK interrupts */ | |||
tmpisr |= I2C_IT_ERRI | I2C_IT_NACKI; | |||
} | |||
if ((InterruptRequest & I2C_XFER_CPLT_IT) == I2C_XFER_CPLT_IT) | |||
if (InterruptRequest == I2C_XFER_CPLT_IT) | |||
{ | |||
/* Enable STOP interrupts */ | |||
tmpisr |= I2C_IT_STOPI; | |||
tmpisr |= (I2C_IT_STOPI | I2C_IT_TCI); | |||
} | |||
if ((InterruptRequest & I2C_XFER_RELOAD_IT) == I2C_XFER_RELOAD_IT) | |||
if (InterruptRequest == I2C_XFER_RELOAD_IT) | |||
{ | |||
/* Enable TC interrupts */ | |||
tmpisr |= I2C_IT_TCI; | |||
@@ -6380,7 +6491,7 @@ static void I2C_Enable_IRQ(I2C_HandleTypeDef *hi2c, uint16_t InterruptRequest) | |||
tmpisr |= I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | I2C_IT_RXI; | |||
} | |||
if ((InterruptRequest & I2C_XFER_CPLT_IT) == I2C_XFER_CPLT_IT) | |||
if (InterruptRequest == I2C_XFER_CPLT_IT) | |||
{ | |||
/* Enable STOP interrupts */ | |||
tmpisr |= I2C_IT_STOPI; | |||
@@ -6434,19 +6545,19 @@ static void I2C_Disable_IRQ(I2C_HandleTypeDef *hi2c, uint16_t InterruptRequest) | |||
tmpisr |= I2C_IT_ADDRI | I2C_IT_STOPI | I2C_IT_NACKI | I2C_IT_ERRI; | |||
} | |||
if ((InterruptRequest & I2C_XFER_ERROR_IT) == I2C_XFER_ERROR_IT) | |||
if (InterruptRequest == I2C_XFER_ERROR_IT) | |||
{ | |||
/* Enable ERR and NACK interrupts */ | |||
tmpisr |= I2C_IT_ERRI | I2C_IT_NACKI; | |||
} | |||
if ((InterruptRequest & I2C_XFER_CPLT_IT) == I2C_XFER_CPLT_IT) | |||
if (InterruptRequest == I2C_XFER_CPLT_IT) | |||
{ | |||
/* Enable STOP interrupts */ | |||
tmpisr |= I2C_IT_STOPI; | |||
} | |||
if ((InterruptRequest & I2C_XFER_RELOAD_IT) == I2C_XFER_RELOAD_IT) | |||
if (InterruptRequest == I2C_XFER_RELOAD_IT) | |||
{ | |||
/* Enable TC interrupts */ | |||
tmpisr |= I2C_IT_TCI; | |||
@@ -55,6 +55,7 @@ | |||
/* Includes ------------------------------------------------------------------*/ | |||
#include "stm32wbxx_hal.h" | |||
#if defined(IPCC) | |||
/** @addtogroup STM32WBxx_HAL_Driver | |||
* @{ | |||
*/ | |||
@@ -742,5 +743,5 @@ void IPCC_Reset_Register(IPCC_CommonTypeDef *Instance) | |||
/** | |||
* @} | |||
*/ | |||
#endif /* IPCC */ | |||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
@@ -113,8 +113,8 @@ | |||
allows the user to configure dynamically the driver callbacks. | |||
[..] | |||
Use Function @ref HAL_IRDA_RegisterCallback() to register a user callback. | |||
Function @ref HAL_IRDA_RegisterCallback() allows to register following callbacks: | |||
Use Function HAL_IRDA_RegisterCallback() to register a user callback. | |||
Function HAL_IRDA_RegisterCallback() allows to register following callbacks: | |||
(+) TxHalfCpltCallback : Tx Half Complete Callback. | |||
(+) TxCpltCallback : Tx Complete Callback. | |||
(+) RxHalfCpltCallback : Rx Half Complete Callback. | |||
@@ -129,9 +129,9 @@ | |||
and a pointer to the user callback function. | |||
[..] | |||
Use function @ref HAL_IRDA_UnRegisterCallback() to reset a callback to the default | |||
Use function HAL_IRDA_UnRegisterCallback() to reset a callback to the default | |||
weak (surcharged) function. | |||
@ref HAL_IRDA_UnRegisterCallback() takes as parameters the HAL peripheral handle, | |||
HAL_IRDA_UnRegisterCallback() takes as parameters the HAL peripheral handle, | |||
and the Callback ID. | |||
This function allows to reset following callbacks: | |||
(+) TxHalfCpltCallback : Tx Half Complete Callback. | |||
@@ -146,13 +146,13 @@ | |||
(+) MspDeInitCallback : IRDA MspDeInit. | |||
[..] | |||
By default, after the @ref HAL_IRDA_Init() and when the state is HAL_IRDA_STATE_RESET | |||
By default, after the HAL_IRDA_Init() and when the state is HAL_IRDA_STATE_RESET | |||
all callbacks are set to the corresponding weak (surcharged) functions: | |||
examples @ref HAL_IRDA_TxCpltCallback(), @ref HAL_IRDA_RxHalfCpltCallback(). | |||
examples HAL_IRDA_TxCpltCallback(), HAL_IRDA_RxHalfCpltCallback(). | |||
Exception done for MspInit and MspDeInit functions that are respectively | |||
reset to the legacy weak (surcharged) functions in the @ref HAL_IRDA_Init() | |||
and @ref HAL_IRDA_DeInit() only when these callbacks are null (not registered beforehand). | |||
If not, MspInit or MspDeInit are not null, the @ref HAL_IRDA_Init() and @ref HAL_IRDA_DeInit() | |||
reset to the legacy weak (surcharged) functions in the HAL_IRDA_Init() | |||
and HAL_IRDA_DeInit() only when these callbacks are null (not registered beforehand). | |||
If not, MspInit or MspDeInit are not null, the HAL_IRDA_Init() and HAL_IRDA_DeInit() | |||
keep and use the user MspInit/MspDeInit callbacks (registered beforehand). | |||
[..] | |||
@@ -161,8 +161,8 @@ | |||
in HAL_IRDA_STATE_READY or HAL_IRDA_STATE_RESET state, thus registered (user) | |||
MspInit/DeInit callbacks can be used during the Init/DeInit. | |||
In that case first register the MspInit/MspDeInit user callbacks | |||
using @ref HAL_IRDA_RegisterCallback() before calling @ref HAL_IRDA_DeInit() | |||
or @ref HAL_IRDA_Init() function. | |||
using HAL_IRDA_RegisterCallback() before calling HAL_IRDA_DeInit() | |||
or HAL_IRDA_Init() function. | |||
[..] | |||
When The compilation define USE_HAL_IRDA_REGISTER_CALLBACKS is set to 0 or | |||
@@ -753,28 +753,28 @@ HAL_StatusTypeDef HAL_IRDA_UnRegisterCallback(IRDA_HandleTypeDef *hirda, HAL_IRD | |||
(++) HAL_IRDA_ErrorCallback() | |||
(#) Non-Blocking mode transfers could be aborted using Abort API's : | |||
(+) HAL_IRDA_Abort() | |||
(+) HAL_IRDA_AbortTransmit() | |||
(+) HAL_IRDA_AbortReceive() | |||
(+) HAL_IRDA_Abort_IT() | |||
(+) HAL_IRDA_AbortTransmit_IT() | |||
(+) HAL_IRDA_AbortReceive_IT() | |||
(++) HAL_IRDA_Abort() | |||
(++) HAL_IRDA_AbortTransmit() | |||
(++) HAL_IRDA_AbortReceive() | |||
(++) HAL_IRDA_Abort_IT() | |||
(++) HAL_IRDA_AbortTransmit_IT() | |||
(++) HAL_IRDA_AbortReceive_IT() | |||
(#) For Abort services based on interrupts (HAL_IRDA_Abortxxx_IT), a set of Abort Complete Callbacks are provided: | |||
(+) HAL_IRDA_AbortCpltCallback() | |||
(+) HAL_IRDA_AbortTransmitCpltCallback() | |||
(+) HAL_IRDA_AbortReceiveCpltCallback() | |||
(++) HAL_IRDA_AbortCpltCallback() | |||
(++) HAL_IRDA_AbortTransmitCpltCallback() | |||
(++) HAL_IRDA_AbortReceiveCpltCallback() | |||
(#) In Non-Blocking mode transfers, possible errors are split into 2 categories. | |||
Errors are handled as follows : | |||
(+) Error is considered as Recoverable and non blocking : Transfer could go till end, but error severity is | |||
to be evaluated by user : this concerns Frame Error, Parity Error or Noise Error in Interrupt mode reception . | |||
Received character is then retrieved and stored in Rx buffer, Error code is set to allow user to identify error type, | |||
and HAL_IRDA_ErrorCallback() user callback is executed. Transfer is kept ongoing on IRDA side. | |||
If user wants to abort it, Abort services should be called by user. | |||
(+) Error is considered as Blocking : Transfer could not be completed properly and is aborted. | |||
This concerns Overrun Error In Interrupt mode reception and all errors in DMA mode. | |||
Error code is set to allow user to identify error type, and HAL_IRDA_ErrorCallback() user callback is executed. | |||
(++) Error is considered as Recoverable and non blocking : Transfer could go till end, but error severity is | |||
to be evaluated by user : this concerns Frame Error, Parity Error or Noise Error in Interrupt mode reception . | |||
Received character is then retrieved and stored in Rx buffer, Error code is set to allow user to identify error type, | |||
and HAL_IRDA_ErrorCallback() user callback is executed. Transfer is kept ongoing on IRDA side. | |||
If user wants to abort it, Abort services should be called by user. | |||
(++) Error is considered as Blocking : Transfer could not be completed properly and is aborted. | |||
This concerns Overrun Error In Interrupt mode reception and all errors in DMA mode. | |||
Error code is set to allow user to identify error type, and HAL_IRDA_ErrorCallback() user callback is executed. | |||
@endverbatim | |||
* @{ | |||
@@ -782,10 +782,13 @@ HAL_StatusTypeDef HAL_IRDA_UnRegisterCallback(IRDA_HandleTypeDef *hirda, HAL_IRD | |||
/** | |||
* @brief Send an amount of data in blocking mode. | |||
* @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01), | |||
* the sent data is handled as a set of u16. In this case, Size must reflect the number | |||
* of u16 available through pData. | |||
* @param hirda Pointer to a IRDA_HandleTypeDef structure that contains | |||
* the configuration information for the specified IRDA module. | |||
* @param pData Pointer to data buffer. | |||
* @param Size Amount of data to be sent. | |||
* @param pData Pointer to data buffer (u8 or u16 data elements). | |||
* @param Size Amount of data elements (u8 or u16) to be sent. | |||
* @param Timeout Specify timeout value. | |||
* @retval HAL status | |||
*/ | |||
@@ -868,10 +871,13 @@ HAL_StatusTypeDef HAL_IRDA_Transmit(IRDA_HandleTypeDef *hirda, uint8_t *pData, u | |||
/** | |||
* @brief Receive an amount of data in blocking mode. | |||
* @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01), | |||
* the received data is handled as a set of u16. In this case, Size must reflect the number | |||
* of u16 available through pData. | |||
* @param hirda Pointer to a IRDA_HandleTypeDef structure that contains | |||
* the configuration information for the specified IRDA module. | |||
* @param pData Pointer to data buffer. | |||
* @param Size Amount of data to be received. | |||
* @param pData Pointer to data buffer (u8 or u16 data elements). | |||
* @param Size Amount of data elements (u8 or u16) to be received. | |||
* @param Timeout Specify timeout value. | |||
* @retval HAL status | |||
*/ | |||
@@ -956,10 +962,13 @@ HAL_StatusTypeDef HAL_IRDA_Receive(IRDA_HandleTypeDef *hirda, uint8_t *pData, ui | |||
/** | |||
* @brief Send an amount of data in interrupt mode. | |||
* @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01), | |||
* the sent data is handled as a set of u16. In this case, Size must reflect the number | |||
* of u16 available through pData. | |||
* @param hirda Pointer to a IRDA_HandleTypeDef structure that contains | |||
* the configuration information for the specified IRDA module. | |||
* @param pData Pointer to data buffer. | |||
* @param Size Amount of data to be sent. | |||
* @param pData Pointer to data buffer (u8 or u16 data elements). | |||
* @param Size Amount of data elements (u8 or u16) to be sent. | |||
* @retval HAL status | |||
*/ | |||
HAL_StatusTypeDef HAL_IRDA_Transmit_IT(IRDA_HandleTypeDef *hirda, uint8_t *pData, uint16_t Size) | |||
@@ -998,10 +1007,13 @@ HAL_StatusTypeDef HAL_IRDA_Transmit_IT(IRDA_HandleTypeDef *hirda, uint8_t *pData | |||
/** | |||
* @brief Receive an amount of data in interrupt mode. | |||
* @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01), | |||
* the received data is handled as a set of u16. In this case, Size must reflect the number | |||
* of u16 available through pData. | |||
* @param hirda Pointer to a IRDA_HandleTypeDef structure that contains | |||
* the configuration information for the specified IRDA module. | |||
* @param pData Pointer to data buffer. | |||
* @param Size Amount of data to be received. | |||
* @param pData Pointer to data buffer (u8 or u16 data elements). | |||
* @param Size Amount of data elements (u8 or u16) to be received. | |||
* @retval HAL status | |||
*/ | |||
HAL_StatusTypeDef HAL_IRDA_Receive_IT(IRDA_HandleTypeDef *hirda, uint8_t *pData, uint16_t Size) | |||
@@ -1047,10 +1059,13 @@ HAL_StatusTypeDef HAL_IRDA_Receive_IT(IRDA_HandleTypeDef *hirda, uint8_t *pData, | |||
/** | |||
* @brief Send an amount of data in DMA mode. | |||
* @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01), | |||
* the sent data is handled as a set of u16. In this case, Size must reflect the number | |||
* of u16 available through pData. | |||
* @param hirda Pointer to a IRDA_HandleTypeDef structure that contains | |||
* the configuration information for the specified IRDA module. | |||
* @param pData pointer to data buffer. | |||
* @param Size amount of data to be sent. | |||
* @param pData pointer to data buffer (u8 or u16 data elements). | |||
* @param Size Amount of data elements (u8 or u16) to be sent. | |||
* @retval HAL status | |||
*/ | |||
HAL_StatusTypeDef HAL_IRDA_Transmit_DMA(IRDA_HandleTypeDef *hirda, uint8_t *pData, uint16_t Size) | |||
@@ -1122,12 +1137,15 @@ HAL_StatusTypeDef HAL_IRDA_Transmit_DMA(IRDA_HandleTypeDef *hirda, uint8_t *pDat | |||
/** | |||
* @brief Receive an amount of data in DMA mode. | |||
* @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01), | |||
* the received data is handled as a set of u16. In this case, Size must reflect the number | |||
* of u16 available through pData. | |||
* @note When the IRDA parity is enabled (PCE = 1), the received data contains | |||
* the parity bit (MSB position). | |||
* @param hirda Pointer to a IRDA_HandleTypeDef structure that contains | |||
* the configuration information for the specified IRDA module. | |||
* @param pData Pointer to data buffer. | |||
* @param Size Amount of data to be received. | |||
* @param pData Pointer to data buffer (u8 or u16 data elements). | |||
* @param Size Amount of data elements (u8 or u16) to be received. | |||
* @retval HAL status | |||
*/ | |||
HAL_StatusTypeDef HAL_IRDA_Receive_DMA(IRDA_HandleTypeDef *hirda, uint8_t *pData, uint16_t Size) | |||
@@ -2213,6 +2231,7 @@ static HAL_StatusTypeDef IRDA_SetConfig(IRDA_HandleTypeDef *hirda) | |||
IRDA_ClockSourceTypeDef clocksource; | |||
HAL_StatusTypeDef ret = HAL_OK; | |||
const uint16_t IRDAPrescTable[12] = {1U, 2U, 4U, 6U, 8U, 10U, 12U, 16U, 32U, 64U, 128U, 256U}; | |||
uint32_t pclk; | |||
/* Check the communication parameters */ | |||
assert_param(IS_IRDA_BAUDRATE(hirda->Init.BaudRate)); | |||
@@ -2241,7 +2260,7 @@ static HAL_StatusTypeDef IRDA_SetConfig(IRDA_HandleTypeDef *hirda) | |||
MODIFY_REG(hirda->Instance->PRESC, USART_PRESC_PRESCALER, hirda->Init.ClockPrescaler); | |||
/*-------------------------- USART GTPR Configuration ----------------------*/ | |||
MODIFY_REG(hirda->Instance->GTPR, USART_GTPR_PSC, hirda->Init.Prescaler); | |||
MODIFY_REG(hirda->Instance->GTPR, (uint16_t)USART_GTPR_PSC, (uint16_t)hirda->Init.Prescaler); | |||
/*-------------------------- USART BRR Configuration -----------------------*/ | |||
IRDA_GETCLOCKSOURCE(hirda, clocksource); | |||
@@ -2249,13 +2268,15 @@ static HAL_StatusTypeDef IRDA_SetConfig(IRDA_HandleTypeDef *hirda) | |||
switch (clocksource) | |||
{ | |||
case IRDA_CLOCKSOURCE_PCLK2: | |||
tmpreg = (uint16_t)(IRDA_DIV_SAMPLING16(HAL_RCC_GetPCLK2Freq(), hirda->Init.BaudRate, hirda->Init.ClockPrescaler)); | |||
pclk = HAL_RCC_GetPCLK2Freq(); | |||
tmpreg = (uint16_t)(IRDA_DIV_SAMPLING16(pclk, hirda->Init.BaudRate, hirda->Init.ClockPrescaler)); | |||
break; | |||
case IRDA_CLOCKSOURCE_HSI: | |||
tmpreg = (uint16_t)(IRDA_DIV_SAMPLING16(HSI_VALUE, hirda->Init.BaudRate, hirda->Init.ClockPrescaler)); | |||
break; | |||
case IRDA_CLOCKSOURCE_SYSCLK: | |||
tmpreg = (uint16_t)(IRDA_DIV_SAMPLING16(HAL_RCC_GetSysClockFreq(), hirda->Init.BaudRate, hirda->Init.ClockPrescaler)); | |||
pclk = HAL_RCC_GetSysClockFreq(); | |||
tmpreg = (uint16_t)(IRDA_DIV_SAMPLING16(pclk, hirda->Init.BaudRate, hirda->Init.ClockPrescaler)); | |||
break; | |||
case IRDA_CLOCKSOURCE_LSE: | |||
tmpreg = (uint16_t)(IRDA_DIV_SAMPLING16((uint32_t)LSE_VALUE, hirda->Init.BaudRate, hirda->Init.ClockPrescaler)); | |||
@@ -36,7 +36,7 @@ | |||
(+) Debug mode : When the microcontroller enters debug mode (core halted), | |||
the IWDG counter either continues to work normally or stops, depending | |||
on DBG_IWDG_STOP configuration bit in DBG module, accessible through | |||
__HAL_DBGMCU_FREEZE_IWDG() and __HAL_DBGMCU_UNFREEZE_IWDG() macros | |||
__HAL_DBGMCU_FREEZE_IWDG() and __HAL_DBGMCU_UNFREEZE_IWDG() macros. | |||
[..] Min-max timeout value @32KHz (LSI): ~125us / ~32.7s | |||
The IWDG timeout may vary due to LSI frequency dispersion. STM32WBxx | |||
@@ -49,17 +49,17 @@ | |||
[..] | |||
(#) Use IWDG using HAL_IWDG_Init() function to : | |||
(++) Enable instance by writing Start keyword in IWDG_KEY register. LSI | |||
clock is forced ON and IWDG counter starts downcounting. | |||
(++) Enable write access to configuration register: IWDG_PR, IWDG_RLR & | |||
IWDG_WINR. | |||
clock is forced ON and IWDG counter starts counting down. | |||
(++) Enable write access to configuration registers: | |||
IWDG_PR, IWDG_RLR and IWDG_WINR. | |||
(++) Configure the IWDG prescaler and counter reload value. This reload | |||
value will be loaded in the IWDG counter each time the watchdog is | |||
reloaded, then the IWDG will start counting down from this value. | |||
(++) wait for status flags to be reset | |||
(++) Wait for status flags to be reset. | |||
(++) Depending on window parameter: | |||
(+++) If Window Init parameter is same as Window register value, | |||
nothing more is done but reload counter value in order to exit | |||
function withy exact time base. | |||
function with exact time base. | |||
(+++) Else modify Window register. This will automatically reload | |||
watchdog counter. | |||
@@ -167,7 +167,7 @@ HAL_StatusTypeDef HAL_IWDG_Init(IWDG_HandleTypeDef *hiwdg) | |||
assert_param(IS_IWDG_RELOAD(hiwdg->Init.Reload)); | |||
assert_param(IS_IWDG_WINDOW(hiwdg->Init.Window)); | |||
/* Enable IWDG. LSI is turned on automaticaly */ | |||
/* Enable IWDG. LSI is turned on automatically */ | |||
__HAL_IWDG_START(hiwdg); | |||
/* Enable write access to IWDG_PR, IWDG_RLR and IWDG_WINR registers by writing | |||
@@ -89,6 +89,8 @@ | |||
#ifdef HAL_LCD_MODULE_ENABLED | |||
#if defined (LCD) | |||
/** @defgroup LCD LCD | |||
* @brief LCD HAL module driver | |||
* @{ | |||
@@ -597,6 +599,8 @@ HAL_StatusTypeDef LCD_WaitForSynchro(LCD_HandleTypeDef *hlcd) | |||
* @} | |||
*/ | |||
#endif /* LCD */ | |||
#endif /* HAL_LCD_MODULE_ENABLED */ | |||
/** | |||
@@ -1714,7 +1714,10 @@ static HAL_StatusTypeDef PCD_EP_ISR_Handler(PCD_HandleTypeDef *hpcd) | |||
{ | |||
/* Get SETUP Packet*/ | |||
ep->xfer_count = PCD_GET_EP_RX_CNT(hpcd->Instance, ep->num); | |||
USB_ReadPMA(hpcd->Instance, (uint8_t *)hpcd->Setup, ep->pmaadress, (uint16_t)ep->xfer_count); | |||
USB_ReadPMA(hpcd->Instance, (uint8_t *)hpcd->Setup, | |||
ep->pmaadress, (uint16_t)ep->xfer_count); | |||
/* SETUP bit kept frozen while CTR_RX = 1*/ | |||
PCD_CLEAR_RX_EP_CTR(hpcd->Instance, PCD_ENDP0); | |||
@@ -1729,21 +1732,24 @@ static HAL_StatusTypeDef PCD_EP_ISR_Handler(PCD_HandleTypeDef *hpcd) | |||
else if ((wEPVal & USB_EP_CTR_RX) != 0U) | |||
{ | |||
PCD_CLEAR_RX_EP_CTR(hpcd->Instance, PCD_ENDP0); | |||
/* Get Control Data OUT Packet*/ | |||
ep->xfer_count = PCD_GET_EP_RX_CNT(hpcd->Instance, ep->num); | |||
if (ep->xfer_count != 0U) | |||
if ((ep->xfer_count != 0U) && (ep->xfer_buff != 0U)) | |||
{ | |||
USB_ReadPMA(hpcd->Instance, ep->xfer_buff, ep->pmaadress, (uint16_t)ep->xfer_count); | |||
USB_ReadPMA(hpcd->Instance, ep->xfer_buff, | |||
ep->pmaadress, (uint16_t)ep->xfer_count); | |||
ep->xfer_buff += ep->xfer_count; | |||
} | |||
/* Process Control Data OUT Packet*/ | |||
/* Process Control Data OUT Packet*/ | |||
#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) | |||
hpcd->DataOutStageCallback(hpcd, 0U); | |||
hpcd->DataOutStageCallback(hpcd, 0U); | |||
#else | |||
HAL_PCD_DataOutStageCallback(hpcd, 0U); | |||
HAL_PCD_DataOutStageCallback(hpcd, 0U); | |||
#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ | |||
} | |||
PCD_SET_EP_RX_CNT(hpcd->Instance, PCD_ENDP0, ep->maxpacket); | |||
PCD_SET_EP_RX_STATUS(hpcd->Instance, PCD_ENDP0, USB_EP_RX_VALID); | |||
@@ -125,6 +125,9 @@ HAL_StatusTypeDef HAL_PCDEx_ActivateBCD(PCD_HandleTypeDef *hpcd) | |||
USB_TypeDef *USBx = hpcd->Instance; | |||
hpcd->battery_charging_active = 1U; | |||
/* Enable BCD feature */ | |||
USBx->BCDR |= USB_BCDR_BCDEN; | |||
/* Enable DCD : Data Contact Detect */ | |||
USBx->BCDR &= ~(USB_BCDR_PDEN); | |||
USBx->BCDR &= ~(USB_BCDR_SDEN); | |||
@@ -143,6 +146,7 @@ HAL_StatusTypeDef HAL_PCDEx_DeActivateBCD(PCD_HandleTypeDef *hpcd) | |||
USB_TypeDef *USBx = hpcd->Instance; | |||
hpcd->battery_charging_active = 0U; | |||
/* Disable BCD feature */ | |||
USBx->BCDR &= ~(USB_BCDR_BCDEN); | |||
return HAL_OK; | |||
@@ -80,6 +80,7 @@ | |||
(++) HAL_PKA_ECCMulFastMode_IT(). | |||
(++) HAL_PKA_ECCMul_GetResult() to retrieve the result of the operation. | |||
*** Low level operation *** | |||
================================= | |||
[..] | |||
@@ -142,8 +143,6 @@ | |||
(++) HAL_PKA_MontgomeryParam(). | |||
(++) HAL_PKA_MontgomeryParam_IT(). | |||
(++) HAL_PKA_MontgomeryParam_GetResult() to retrieve the result of the operation. | |||
(+) You can save computation time by storing this parameter for a later usage. | |||
Use it again with HAL_PKA_MontgomeryParam_Set(); | |||
*** Polling mode operation *** | |||
=================================== | |||
@@ -263,11 +262,15 @@ | |||
* @{ | |||
*/ | |||
#define PKA_RAM_SIZE 894U | |||
/* Private macro -------------------------------------------------------------*/ | |||
#define __PKA_RAM_PARAM_END(TAB,INDEX) do{ \ | |||
TAB[INDEX] = 0UL; \ | |||
} while(0) | |||
/** | |||
* @} | |||
*/ | |||
/* Private macro -------------------------------------------------------------*/ | |||
/* Private variables ---------------------------------------------------------*/ | |||
/* Private function prototypes -----------------------------------------------*/ | |||
/** @defgroup PKA_Private_Functions PKA Private Functions | |||
@@ -320,9 +323,7 @@ void PKA_ARI_Set(PKA_HandleTypeDef *hpka, const uint32_t size, const uint32_t *p | |||
(+) User must implement HAL_PKA_MspInit() function in which he configures | |||
all related peripherals resources (CLOCK, IT and NVIC ). | |||
(+) Call the function HAL_PKA_Init() to configure the selected device with | |||
the selected configuration: | |||
(++) Security level | |||
(+) Call the function HAL_PKA_Init() to configure the device. | |||
(+) Call the function HAL_PKA_DeInit() to restore the default configuration | |||
of the selected PKAx peripheral. | |||
@@ -689,6 +690,7 @@ HAL_StatusTypeDef HAL_PKA_UnRegisterCallback(PKA_HandleTypeDef *hpka, HAL_PKA_Ca | |||
(++) HAL_PKA_ECCMulFastMode() | |||
(++) HAL_PKA_ECCMul_GetResult(); | |||
(++) HAL_PKA_Add() | |||
(++) HAL_PKA_Sub() | |||
(++) HAL_PKA_Cmp() | |||
@@ -807,6 +809,7 @@ HAL_StatusTypeDef HAL_PKA_ModExpFastMode_IT(PKA_HandleTypeDef *hpka, PKA_ModExpF | |||
return PKA_Process_IT(hpka, PKA_MODE_MODULAR_EXP_FAST_MODE); | |||
} | |||
/** | |||
* @brief Retrieve operation result. | |||
* @param hpka PKA handle | |||
@@ -859,7 +862,7 @@ HAL_StatusTypeDef HAL_PKA_ECDSASign_IT(PKA_HandleTypeDef *hpka, PKA_ECDSASignInT | |||
* @brief Retrieve operation result. | |||
* @param hpka PKA handle | |||
* @param out Output information | |||
* @param outExt Additionnal Output information (facultative) | |||
* @param outExt Additional Output information (facultative) | |||
*/ | |||
void HAL_PKA_ECDSASign_GetResult(PKA_HandleTypeDef *hpka, PKA_ECDSASignOutTypeDef *out, PKA_ECDSASignOutExtParamTypeDef *outExt) | |||
{ | |||
@@ -873,7 +876,7 @@ void HAL_PKA_ECDSASign_GetResult(PKA_HandleTypeDef *hpka, PKA_ECDSASignOutTypeDe | |||
PKA_Memcpy_u32_to_u8(out->SSign, &hpka->Instance->RAM[PKA_ECDSA_SIGN_OUT_SIGNATURE_S], size); | |||
} | |||
/* If user requires the additionnal information */ | |||
/* If user requires the additional information */ | |||
if (outExt != NULL) | |||
{ | |||
/* Move the result to appropriate location (indicated in outExt parameter) */ | |||
@@ -1009,8 +1012,9 @@ HAL_StatusTypeDef HAL_PKA_PointCheck_IT(PKA_HandleTypeDef *hpka, PKA_PointCheckI | |||
*/ | |||
uint32_t HAL_PKA_PointCheck_IsOnCurve(PKA_HandleTypeDef const *const hpka) | |||
{ | |||
#define PKA_POINT_IS_ON_CURVE 0UL | |||
/* Invert the value of the PKA RAM containig the result of the operation */ | |||
return (hpka->Instance->RAM[PKA_POINT_CHECK_OUT_ERROR] == 0UL) ? 1UL : 0UL; | |||
return (hpka->Instance->RAM[PKA_POINT_CHECK_OUT_ERROR] == PKA_POINT_IS_ON_CURVE) ? 1UL : 0UL; | |||
} | |||
/** | |||
@@ -1043,7 +1047,6 @@ HAL_StatusTypeDef HAL_PKA_ECCMul_IT(PKA_HandleTypeDef *hpka, PKA_ECCMulInTypeDef | |||
/* Start the operation */ | |||
return PKA_Process_IT(hpka, PKA_MODE_ECC_MUL); | |||
} | |||
/** | |||
* @brief ECC scalar multiplication in blocking mode. | |||
* @param hpka PKA handle | |||
@@ -1074,7 +1077,6 @@ HAL_StatusTypeDef HAL_PKA_ECCMulFastMode_IT(PKA_HandleTypeDef *hpka, PKA_ECCMulF | |||
/* Start the operation */ | |||
return PKA_Process_IT(hpka, PKA_MODE_ECC_MUL_FAST_MODE); | |||
} | |||
/** | |||
* @brief Retrieve operation result. | |||
* @param hpka PKA handle | |||
@@ -1469,6 +1471,7 @@ HAL_StatusTypeDef HAL_PKA_MontgomeryParam_IT(PKA_HandleTypeDef *hpka, PKA_Montgo | |||
return PKA_Process_IT(hpka, PKA_MODE_MONTGOMERY_PARAM); | |||
} | |||
/** | |||
* @brief Retrieve operation result. | |||
* @param hpka PKA handle | |||
@@ -1568,7 +1571,6 @@ void HAL_PKA_IRQHandler(PKA_HandleTypeDef *hpka) | |||
hpka->ErrorCode |= HAL_PKA_ERROR_OPERATION; | |||
} | |||
} | |||
/* Trigger the error callback if an error is present */ | |||
if (hpka->ErrorCode != HAL_PKA_ERROR_NONE) | |||
{ | |||
@@ -1738,8 +1740,9 @@ uint32_t PKA_CheckError(PKA_HandleTypeDef *hpka, uint32_t mode) | |||
/* Check the operation success in case of ECDSA signature */ | |||
if (mode == PKA_MODE_ECDSA_SIGNATURE) | |||
{ | |||
/* If error output result is different from 0, ecsa sign operation need to be repeated */ | |||
if (hpka->Instance->RAM[PKA_ECDSA_SIGN_OUT_ERROR] != 0UL) | |||
#define EDCSA_SIGN_NOERROR 0UL | |||
/* If error output result is different from no error, ecsa sign operation need to be repeated */ | |||
if (hpka->Instance->RAM[PKA_ECDSA_SIGN_OUT_ERROR] != EDCSA_SIGN_NOERROR) | |||
{ | |||
err |= HAL_PKA_ERROR_OPERATION; | |||
} | |||
@@ -2026,15 +2029,15 @@ void PKA_ModExp_Set(PKA_HandleTypeDef *hpka, PKA_ModExpInTypeDef *in) | |||
/* Move the input parameters pOp1 to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_MODULAR_EXP_IN_EXPONENT_BASE], in->pOp1, in->OpSize); | |||
hpka->Instance->RAM[PKA_MODULAR_EXP_IN_EXPONENT_BASE + (in->OpSize / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_MODULAR_EXP_IN_EXPONENT_BASE + (in->OpSize / 4UL)); | |||
/* Move the exponent to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_MODULAR_EXP_IN_EXPONENT], in->pExp, in->expSize); | |||
hpka->Instance->RAM[PKA_MODULAR_EXP_IN_EXPONENT + (in->expSize / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_MODULAR_EXP_IN_EXPONENT + (in->expSize / 4UL)); | |||
/* Move the modulus to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_MODULAR_EXP_IN_MODULUS], in->pMod, in->OpSize); | |||
hpka->Instance->RAM[PKA_MODULAR_EXP_IN_MODULUS + (in->OpSize / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_MODULAR_EXP_IN_MODULUS + (in->OpSize / 4UL)); | |||
} | |||
/** | |||
@@ -2052,21 +2055,22 @@ void PKA_ModExpFastMode_Set(PKA_HandleTypeDef *hpka, PKA_ModExpFastModeInTypeDef | |||
/* Move the input parameters pOp1 to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_MODULAR_EXP_IN_EXPONENT_BASE], in->pOp1, in->OpSize); | |||
hpka->Instance->RAM[PKA_MODULAR_EXP_IN_EXPONENT_BASE + (in->OpSize / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_MODULAR_EXP_IN_EXPONENT_BASE + (in->OpSize / 4UL)); | |||
/* Move the exponent to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_MODULAR_EXP_IN_EXPONENT], in->pExp, in->expSize); | |||
hpka->Instance->RAM[PKA_MODULAR_EXP_IN_EXPONENT + (in->expSize / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_MODULAR_EXP_IN_EXPONENT + (in->expSize / 4UL)); | |||
/* Move the modulus to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_MODULAR_EXP_IN_MODULUS], in->pMod, in->OpSize); | |||
hpka->Instance->RAM[PKA_MODULAR_EXP_IN_MODULUS + (in->OpSize / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_MODULAR_EXP_IN_MODULUS + (in->OpSize / 4UL)); | |||
/* Move the Montgomery parameter to PKA RAM */ | |||
PKA_Memcpy_u32_to_u32(&hpka->Instance->RAM[PKA_MODULAR_EXP_IN_MONTGOMERY_PARAM], in->pMontgomeryParam, in->expSize / 4UL); | |||
hpka->Instance->RAM[PKA_MODULAR_EXP_IN_MONTGOMERY_PARAM + (in->expSize / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_MODULAR_EXP_IN_MONTGOMERY_PARAM + (in->expSize / 4UL)); | |||
} | |||
/** | |||
* @brief Set input parameters. | |||
* @param hpka PKA handle | |||
@@ -2085,35 +2089,35 @@ void PKA_ECDSASign_Set(PKA_HandleTypeDef *hpka, PKA_ECDSASignInTypeDef *in) | |||
/* Move the input parameters coefficient |a| to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_ECDSA_SIGN_IN_A_COEFF], in->coef, in->modulusSize); | |||
hpka->Instance->RAM[PKA_ECDSA_SIGN_IN_A_COEFF + ((in->modulusSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ECDSA_SIGN_IN_A_COEFF + ((in->modulusSize + 3UL) / 4UL)); | |||
/* Move the input parameters modulus value p to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_ECDSA_SIGN_IN_MOD_GF], in->modulus, in->modulusSize); | |||
hpka->Instance->RAM[PKA_ECDSA_SIGN_IN_MOD_GF + ((in->modulusSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ECDSA_SIGN_IN_MOD_GF + ((in->modulusSize + 3UL) / 4UL)); | |||
/* Move the input parameters integer k to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_ECDSA_SIGN_IN_K], in->integer, in->primeOrderSize); | |||
hpka->Instance->RAM[PKA_ECDSA_SIGN_IN_K + ((in->primeOrderSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ECDSA_SIGN_IN_K + ((in->primeOrderSize + 3UL) / 4UL)); | |||
/* Move the input parameters base point G coordinate x to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_ECDSA_SIGN_IN_INITIAL_POINT_X], in->basePointX, in->modulusSize); | |||
hpka->Instance->RAM[PKA_ECDSA_SIGN_IN_INITIAL_POINT_X + ((in->modulusSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ECDSA_SIGN_IN_INITIAL_POINT_X + ((in->modulusSize + 3UL) / 4UL)); | |||
/* Move the input parameters base point G coordinate y to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_ECDSA_SIGN_IN_INITIAL_POINT_Y], in->basePointY, in->modulusSize); | |||
hpka->Instance->RAM[PKA_ECDSA_SIGN_IN_INITIAL_POINT_Y + ((in->modulusSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ECDSA_SIGN_IN_INITIAL_POINT_Y + ((in->modulusSize + 3UL) / 4UL)); | |||
/* Move the input parameters hash of message z to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_ECDSA_SIGN_IN_HASH_E], in->hash, in->primeOrderSize); | |||
hpka->Instance->RAM[PKA_ECDSA_SIGN_IN_HASH_E + ((in->primeOrderSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ECDSA_SIGN_IN_HASH_E + ((in->primeOrderSize + 3UL) / 4UL)); | |||
/* Move the input parameters private key d to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_ECDSA_SIGN_IN_PRIVATE_KEY_D], in->privateKey, in->primeOrderSize); | |||
hpka->Instance->RAM[PKA_ECDSA_SIGN_IN_PRIVATE_KEY_D + ((in->primeOrderSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ECDSA_SIGN_IN_PRIVATE_KEY_D + ((in->primeOrderSize + 3UL) / 4UL)); | |||
/* Move the input parameters prime order n to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_ECDSA_SIGN_IN_ORDER_N], in->primeOrder, in->primeOrderSize); | |||
hpka->Instance->RAM[PKA_ECDSA_SIGN_IN_ORDER_N + ((in->primeOrderSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ECDSA_SIGN_IN_ORDER_N + ((in->primeOrderSize + 3UL) / 4UL)); | |||
} | |||
/** | |||
@@ -2134,43 +2138,43 @@ void PKA_ECDSAVerif_Set(PKA_HandleTypeDef *hpka, PKA_ECDSAVerifInTypeDef *in) | |||
/* Move the input parameters coefficient |a| to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_ECDSA_VERIF_IN_A_COEFF], in->coef, in->modulusSize); | |||
hpka->Instance->RAM[PKA_ECDSA_VERIF_IN_A_COEFF + ((in->modulusSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ECDSA_VERIF_IN_A_COEFF + ((in->modulusSize + 3UL) / 4UL)); | |||
/* Move the input parameters modulus value p to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_ECDSA_VERIF_IN_MOD_GF], in->modulus, in->modulusSize); | |||
hpka->Instance->RAM[PKA_ECDSA_VERIF_IN_MOD_GF + ((in->modulusSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ECDSA_VERIF_IN_MOD_GF + ((in->modulusSize + 3UL) / 4UL)); | |||
/* Move the input parameters base point G coordinate x to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_ECDSA_VERIF_IN_INITIAL_POINT_X], in->basePointX, in->modulusSize); | |||
hpka->Instance->RAM[PKA_ECDSA_VERIF_IN_INITIAL_POINT_X + ((in->modulusSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ECDSA_VERIF_IN_INITIAL_POINT_X + ((in->modulusSize + 3UL) / 4UL)); | |||
/* Move the input parameters base point G coordinate y to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_ECDSA_VERIF_IN_INITIAL_POINT_Y], in->basePointY, in->modulusSize); | |||
hpka->Instance->RAM[PKA_ECDSA_VERIF_IN_INITIAL_POINT_Y + ((in->modulusSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ECDSA_VERIF_IN_INITIAL_POINT_Y + ((in->modulusSize + 3UL) / 4UL)); | |||
/* Move the input parameters public-key curve point Q coordinate xQ to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_ECDSA_VERIF_IN_PUBLIC_KEY_POINT_X], in->pPubKeyCurvePtX, in->modulusSize); | |||
hpka->Instance->RAM[PKA_ECDSA_VERIF_IN_PUBLIC_KEY_POINT_X + ((in->modulusSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ECDSA_VERIF_IN_PUBLIC_KEY_POINT_X + ((in->modulusSize + 3UL) / 4UL)); | |||
/* Move the input parameters public-key curve point Q coordinate xQ to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_ECDSA_VERIF_IN_PUBLIC_KEY_POINT_Y], in->pPubKeyCurvePtY, in->modulusSize); | |||
hpka->Instance->RAM[PKA_ECDSA_VERIF_IN_PUBLIC_KEY_POINT_Y + ((in->modulusSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ECDSA_VERIF_IN_PUBLIC_KEY_POINT_Y + ((in->modulusSize + 3UL) / 4UL)); | |||
/* Move the input parameters signature part r to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_ECDSA_VERIF_IN_SIGNATURE_R], in->RSign, in->primeOrderSize); | |||
hpka->Instance->RAM[PKA_ECDSA_VERIF_IN_SIGNATURE_R + ((in->primeOrderSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ECDSA_VERIF_IN_SIGNATURE_R + ((in->primeOrderSize + 3UL) / 4UL)); | |||
/* Move the input parameters signature part s to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_ECDSA_VERIF_IN_SIGNATURE_S], in->SSign, in->primeOrderSize); | |||
hpka->Instance->RAM[PKA_ECDSA_VERIF_IN_SIGNATURE_S + ((in->primeOrderSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ECDSA_VERIF_IN_SIGNATURE_S + ((in->primeOrderSize + 3UL) / 4UL)); | |||
/* Move the input parameters hash of message z to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_ECDSA_VERIF_IN_HASH_E], in->hash, in->primeOrderSize); | |||
hpka->Instance->RAM[PKA_ECDSA_VERIF_IN_HASH_E + ((in->primeOrderSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ECDSA_VERIF_IN_HASH_E + ((in->primeOrderSize + 3UL) / 4UL)); | |||
/* Move the input parameters curve prime order n to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_ECDSA_VERIF_IN_ORDER_N], in->primeOrder, in->primeOrderSize); | |||
hpka->Instance->RAM[PKA_ECDSA_VERIF_IN_ORDER_N + ((in->primeOrderSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ECDSA_VERIF_IN_ORDER_N + ((in->primeOrderSize + 3UL) / 4UL)); | |||
} | |||
/** | |||
@@ -2185,27 +2189,27 @@ void PKA_RSACRTExp_Set(PKA_HandleTypeDef *hpka, PKA_RSACRTExpInTypeDef *in) | |||
/* Move the input parameters operand dP to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_RSA_CRT_EXP_IN_DP_CRT], in->pOpDp, in->size / 2UL); | |||
hpka->Instance->RAM[PKA_RSA_CRT_EXP_IN_DP_CRT + (in->size / 8UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_RSA_CRT_EXP_IN_DP_CRT + (in->size / 8UL)); | |||
/* Move the input parameters operand dQ to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_RSA_CRT_EXP_IN_DQ_CRT], in->pOpDq, in->size / 2UL); | |||
hpka->Instance->RAM[PKA_RSA_CRT_EXP_IN_DQ_CRT + (in->size / 8UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_RSA_CRT_EXP_IN_DQ_CRT + (in->size / 8UL)); | |||
/* Move the input parameters operand qinv to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_RSA_CRT_EXP_IN_QINV_CRT], in->pOpQinv, in->size / 2UL); | |||
hpka->Instance->RAM[PKA_RSA_CRT_EXP_IN_QINV_CRT + (in->size / 8UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_RSA_CRT_EXP_IN_QINV_CRT + (in->size / 8UL)); | |||
/* Move the input parameters prime p to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_RSA_CRT_EXP_IN_PRIME_P], in->pPrimeP, in->size / 2UL); | |||
hpka->Instance->RAM[PKA_RSA_CRT_EXP_IN_PRIME_P + (in->size / 8UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_RSA_CRT_EXP_IN_PRIME_P + (in->size / 8UL)); | |||
/* Move the input parameters prime q to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_RSA_CRT_EXP_IN_PRIME_Q], in->pPrimeQ, in->size / 2UL); | |||
hpka->Instance->RAM[PKA_RSA_CRT_EXP_IN_PRIME_Q + (in->size / 8UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_RSA_CRT_EXP_IN_PRIME_Q + (in->size / 8UL)); | |||
/* Move the input parameters operand A to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_RSA_CRT_EXP_IN_EXPONENT_BASE], in->popA, in->size); | |||
hpka->Instance->RAM[PKA_RSA_CRT_EXP_IN_EXPONENT_BASE + (in->size / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_RSA_CRT_EXP_IN_EXPONENT_BASE + (in->size / 4UL)); | |||
} | |||
/** | |||
@@ -2223,23 +2227,23 @@ void PKA_PointCheck_Set(PKA_HandleTypeDef *hpka, PKA_PointCheckInTypeDef *in) | |||
/* Move the input parameters coefficient |a| to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_POINT_CHECK_IN_A_COEFF], in->coefA, in->modulusSize); | |||
hpka->Instance->RAM[PKA_POINT_CHECK_IN_A_COEFF + ((in->modulusSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_POINT_CHECK_IN_A_COEFF + ((in->modulusSize + 3UL) / 4UL)); | |||
/* Move the input parameters coefficient b to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_POINT_CHECK_IN_B_COEFF], in->coefB, in->modulusSize); | |||
hpka->Instance->RAM[PKA_POINT_CHECK_IN_B_COEFF + ((in->modulusSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_POINT_CHECK_IN_B_COEFF + ((in->modulusSize + 3UL) / 4UL)); | |||
/* Move the input parameters modulus value p to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_POINT_CHECK_IN_MOD_GF], in->modulus, in->modulusSize); | |||
hpka->Instance->RAM[PKA_POINT_CHECK_IN_MOD_GF + ((in->modulusSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_POINT_CHECK_IN_MOD_GF + ((in->modulusSize + 3UL) / 4UL)); | |||
/* Move the input parameters Point P coordinate x to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_POINT_CHECK_IN_INITIAL_POINT_X], in->pointX, in->modulusSize); | |||
hpka->Instance->RAM[PKA_POINT_CHECK_IN_INITIAL_POINT_X + ((in->modulusSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_POINT_CHECK_IN_INITIAL_POINT_X + ((in->modulusSize + 3UL) / 4UL)); | |||
/* Move the input parameters Point P coordinate y to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_POINT_CHECK_IN_INITIAL_POINT_Y], in->pointY, in->modulusSize); | |||
hpka->Instance->RAM[PKA_POINT_CHECK_IN_INITIAL_POINT_Y + ((in->modulusSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_POINT_CHECK_IN_INITIAL_POINT_Y + ((in->modulusSize + 3UL) / 4UL)); | |||
} | |||
/** | |||
@@ -2260,25 +2264,28 @@ void PKA_ECCMul_Set(PKA_HandleTypeDef *hpka, PKA_ECCMulInTypeDef *in) | |||
/* Move the input parameters coefficient |a| to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_ECC_SCALAR_MUL_IN_A_COEFF], in->coefA, in->modulusSize); | |||
hpka->Instance->RAM[PKA_ECC_SCALAR_MUL_IN_A_COEFF + ((in->modulusSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ECC_SCALAR_MUL_IN_A_COEFF + ((in->modulusSize + 3UL) / 4UL)); | |||
/* Move the input parameters modulus value p to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_ECC_SCALAR_MUL_IN_MOD_GF], in->modulus, in->modulusSize); | |||
hpka->Instance->RAM[PKA_ECC_SCALAR_MUL_IN_MOD_GF + ((in->modulusSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ECC_SCALAR_MUL_IN_MOD_GF + ((in->modulusSize + 3UL) / 4UL)); | |||
/* Move the input parameters scalar multiplier k to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_ECC_SCALAR_MUL_IN_K], in->scalarMul, in->scalarMulSize); | |||
hpka->Instance->RAM[PKA_ECC_SCALAR_MUL_IN_K + ((in->scalarMulSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ECC_SCALAR_MUL_IN_K + ((in->scalarMulSize + 3UL) / 4UL)); | |||
/* Move the input parameters Point P coordinate x to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_POINT_CHECK_IN_INITIAL_POINT_X], in->pointX, in->modulusSize); | |||
hpka->Instance->RAM[PKA_POINT_CHECK_IN_INITIAL_POINT_X + ((in->modulusSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_POINT_CHECK_IN_INITIAL_POINT_X + ((in->modulusSize + 3UL) / 4UL)); | |||
/* Move the input parameters Point P coordinate y to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_POINT_CHECK_IN_INITIAL_POINT_Y], in->pointY, in->modulusSize); | |||
hpka->Instance->RAM[PKA_POINT_CHECK_IN_INITIAL_POINT_Y + ((in->modulusSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_POINT_CHECK_IN_INITIAL_POINT_Y + ((in->modulusSize + 3UL) / 4UL)); | |||
} | |||
/** | |||
* @brief Set input parameters. | |||
* @param hpka PKA handle | |||
@@ -2297,29 +2304,28 @@ void PKA_ECCMulFastMode_Set(PKA_HandleTypeDef *hpka, PKA_ECCMulFastModeInTypeDef | |||
/* Move the input parameters coefficient |a| to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_ECC_SCALAR_MUL_IN_A_COEFF], in->coefA, in->modulusSize); | |||
hpka->Instance->RAM[PKA_ECC_SCALAR_MUL_IN_A_COEFF + ((in->modulusSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ECC_SCALAR_MUL_IN_A_COEFF + ((in->modulusSize + 3UL) / 4UL)); | |||
/* Move the input parameters modulus value p to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_ECC_SCALAR_MUL_IN_MOD_GF], in->modulus, in->modulusSize); | |||
hpka->Instance->RAM[PKA_ECC_SCALAR_MUL_IN_MOD_GF + ((in->modulusSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ECC_SCALAR_MUL_IN_MOD_GF + ((in->modulusSize + 3UL) / 4UL)); | |||
/* Move the input parameters scalar multiplier k to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_ECC_SCALAR_MUL_IN_K], in->scalarMul, in->scalarMulSize); | |||
hpka->Instance->RAM[PKA_ECC_SCALAR_MUL_IN_K + ((in->scalarMulSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ECC_SCALAR_MUL_IN_K + ((in->scalarMulSize + 3UL) / 4UL)); | |||
/* Move the input parameters Point P coordinate x to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_POINT_CHECK_IN_INITIAL_POINT_X], in->pointX, in->modulusSize); | |||
hpka->Instance->RAM[PKA_POINT_CHECK_IN_INITIAL_POINT_X + ((in->modulusSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_POINT_CHECK_IN_INITIAL_POINT_X + ((in->modulusSize + 3UL) / 4UL)); | |||
/* Move the input parameters Point P coordinate y to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_POINT_CHECK_IN_INITIAL_POINT_Y], in->pointY, in->modulusSize); | |||
hpka->Instance->RAM[PKA_POINT_CHECK_IN_INITIAL_POINT_Y + ((in->modulusSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_POINT_CHECK_IN_INITIAL_POINT_Y + ((in->modulusSize + 3UL) / 4UL)); | |||
/* Move the Montgomery parameter to PKA RAM */ | |||
PKA_Memcpy_u32_to_u32(&hpka->Instance->RAM[PKA_ECC_SCALAR_MUL_IN_MONTGOMERY_PARAM], in->pMontgomeryParam, (in->modulusSize + 3UL) / 4UL); | |||
hpka->Instance->RAM[PKA_ECC_SCALAR_MUL_IN_MONTGOMERY_PARAM + ((in->modulusSize + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ECC_SCALAR_MUL_IN_MONTGOMERY_PARAM + ((in->modulusSize + 3UL) / 4UL)); | |||
} | |||
/** | |||
* @brief Set input parameters. | |||
* @param hpka PKA handle | |||
@@ -2332,11 +2338,11 @@ void PKA_ModInv_Set(PKA_HandleTypeDef *hpka, PKA_ModInvInTypeDef *in) | |||
/* Move the input parameters operand A to PKA RAM */ | |||
PKA_Memcpy_u32_to_u32(&hpka->Instance->RAM[PKA_MODULAR_INV_IN_OP1], in->pOp1, in->size); | |||
hpka->Instance->RAM[PKA_MODULAR_INV_IN_OP1 + in->size] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_MODULAR_INV_IN_OP1 + in->size); | |||
/* Move the input parameters modulus value n to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_MODULAR_INV_IN_OP2_MOD], in->pMod, in->size * 4UL); | |||
hpka->Instance->RAM[PKA_MODULAR_INV_IN_OP2_MOD + in->size] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_MODULAR_INV_IN_OP2_MOD + in->size); | |||
} | |||
/** | |||
@@ -2354,11 +2360,11 @@ void PKA_ModRed_Set(PKA_HandleTypeDef *hpka, PKA_ModRedInTypeDef *in) | |||
/* Move the input parameters operand A to PKA RAM */ | |||
PKA_Memcpy_u32_to_u32(&hpka->Instance->RAM[PKA_MODULAR_REDUC_IN_OPERAND], in->pOp1, in->OpSize); | |||
hpka->Instance->RAM[PKA_MODULAR_REDUC_IN_OPERAND + in->OpSize] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_MODULAR_REDUC_IN_OPERAND + in->OpSize); | |||
/* Move the input parameters modulus value n to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_MODULAR_REDUC_IN_MODULUS], in->pMod, in->modSize); | |||
hpka->Instance->RAM[PKA_MODULAR_REDUC_IN_MODULUS + (in->modSize / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_MODULAR_REDUC_IN_MODULUS + (in->modSize / 4UL)); | |||
} | |||
/** | |||
@@ -2376,7 +2382,7 @@ void PKA_MontgomeryParam_Set(PKA_HandleTypeDef *hpka, const uint32_t size, const | |||
/* Move the input parameters pOp1 to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_MONTGOMERY_PARAM_IN_MODULUS], pOp1, size); | |||
hpka->Instance->RAM[PKA_MONTGOMERY_PARAM_IN_MODULUS + ((size + 3UL) / 4UL)] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_MONTGOMERY_PARAM_IN_MODULUS + ((size + 3UL) / 4UL)); | |||
} | |||
} | |||
@@ -2397,21 +2403,21 @@ void PKA_ARI_Set(PKA_HandleTypeDef *hpka, const uint32_t size, const uint32_t *p | |||
{ | |||
/* Move the input parameters pOp1 to PKA RAM */ | |||
PKA_Memcpy_u32_to_u32(&hpka->Instance->RAM[PKA_ARITHMETIC_ALL_OPS_IN_OP1], pOp1, size); | |||
hpka->Instance->RAM[PKA_ARITHMETIC_ALL_OPS_IN_OP1 + size] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ARITHMETIC_ALL_OPS_IN_OP1 + size); | |||
} | |||
if (pOp2 != NULL) | |||
{ | |||
/* Move the input parameters pOp2 to PKA RAM */ | |||
PKA_Memcpy_u32_to_u32(&hpka->Instance->RAM[PKA_ARITHMETIC_ALL_OPS_IN_OP2], pOp2, size); | |||
hpka->Instance->RAM[PKA_ARITHMETIC_ALL_OPS_IN_OP2 + size] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ARITHMETIC_ALL_OPS_IN_OP2 + size); | |||
} | |||
if (pOp3 != NULL) | |||
{ | |||
/* Move the input parameters pOp3 to PKA RAM */ | |||
PKA_Memcpy_u8_to_u32(&hpka->Instance->RAM[PKA_ARITHMETIC_ALL_OPS_IN_OP3], pOp3, size * 4UL); | |||
hpka->Instance->RAM[PKA_ARITHMETIC_ALL_OPS_IN_OP3 + size] = 0UL; | |||
__PKA_RAM_PARAM_END(hpka->Instance->RAM, PKA_ARITHMETIC_ALL_OPS_IN_OP3 + size); | |||
} | |||
} | |||
@@ -114,8 +114,10 @@ void HAL_PWR_DeInit(void) | |||
LL_PWR_WriteReg(PDCRB, PWR_PDCRB_RESET_VALUE); | |||
LL_PWR_WriteReg(PUCRC, PWR_PUCRC_RESET_VALUE); | |||
LL_PWR_WriteReg(PDCRC, PWR_PDCRC_RESET_VALUE); | |||
#if defined(GPIOD) | |||
LL_PWR_WriteReg(PUCRD, PWR_PUCRD_RESET_VALUE); | |||
LL_PWR_WriteReg(PDCRD, PWR_PDCRD_RESET_VALUE); | |||
#endif | |||
LL_PWR_WriteReg(PUCRE, PWR_PUCRE_RESET_VALUE); | |||
LL_PWR_WriteReg(PDCRE, PWR_PDCRE_RESET_VALUE); | |||
LL_PWR_WriteReg(PUCRH, PWR_PUCRH_RESET_VALUE); | |||
@@ -131,8 +133,10 @@ void HAL_PWR_DeInit(void) | |||
| LL_PWR_SCR_CCRPEF | |||
| LL_PWR_SCR_C802WUF | |||
| LL_PWR_SCR_CBLEWUF | |||
#if defined(PWR_CR5_SMPSEN) | |||
| LL_PWR_SCR_CBORHF | |||
| LL_PWR_SCR_CSMPSFBF | |||
#endif | |||
| LL_PWR_SCR_CWUF | |||
); | |||
@@ -556,6 +560,8 @@ void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry) | |||
* startup delay is incurred when waking up. | |||
* By keeping the internal regulator ON during Stop mode (Stop 0), the consumption | |||
* is higher although the startup time is reduced. | |||
* @note Case of Stop0 mode with SMPS: Before entering Stop 0 mode with SMPS Step Down converter enabled, | |||
* the HSI16 must be kept on by enabling HSI kernel clock (set HSIKERON register bit). | |||
* @note According to system power policy, system entering in Stop mode | |||
* is depending on other CPU power mode. | |||
* @param Regulator Specifies the regulator state in Stop mode. | |||
@@ -79,6 +79,7 @@ | |||
*/ | |||
#if defined(PWR_CR1_VOS) | |||
/** | |||
* @brief Return Voltage Scaling Range. | |||
* @retval VOS bit field (PWR_REGULATOR_VOLTAGE_RANGE1 or PWR_REGULATOR_VOLTAGE_RANGE2) | |||
@@ -146,6 +147,7 @@ HAL_StatusTypeDef HAL_PWREx_ControlVoltageScaling(uint32_t VoltageScaling) | |||
return HAL_OK; | |||
} | |||
#endif | |||
/****************************************************************************/ | |||
@@ -179,7 +181,7 @@ void HAL_PWREx_DisableBatteryCharging(void) | |||
} | |||
/****************************************************************************/ | |||
#if defined(PWR_CR2_PVME1) | |||
/** | |||
* @brief Enable VDDUSB supply. | |||
* @note Remove VDDUSB electrical and logical isolation, once VDDUSB supply is present. | |||
@@ -198,6 +200,7 @@ void HAL_PWREx_DisableVddUSB(void) | |||
{ | |||
CLEAR_BIT(PWR->CR2, PWR_CR2_USV); | |||
} | |||
#endif | |||
/****************************************************************************/ | |||
@@ -219,7 +222,7 @@ void HAL_PWREx_DisableInternalWakeUpLine(void) | |||
CLEAR_BIT(PWR->CR3, PWR_CR3_EIWUL); | |||
} | |||
#if defined(PWR_CR5_SMPSEN) | |||
/** | |||
* @brief Enable BORH and SMPS step down converter forced in bypass mode | |||
* interrupt for CPU1 | |||
@@ -239,7 +242,7 @@ void HAL_PWREx_DisableBORH_SMPSBypassIT(void) | |||
{ | |||
CLEAR_BIT(PWR->CR3, PWR_CR3_EBORHSMPSFB); | |||
} | |||
#endif | |||
/** | |||
* @brief Enable RF Phase interrupt. | |||
@@ -359,10 +362,12 @@ HAL_StatusTypeDef HAL_PWREx_EnableGPIOPullUp(uint32_t GPIO, uint32_t GPIONumber) | |||
SET_BIT(PWR->PUCRC, GPIONumber); | |||
CLEAR_BIT(PWR->PDCRC, GPIONumber); | |||
break; | |||
#if defined(GPIOD) | |||
case PWR_GPIO_D: | |||
SET_BIT(PWR->PUCRD, GPIONumber); | |||
CLEAR_BIT(PWR->PDCRD, GPIONumber); | |||
break; | |||
#endif | |||
case PWR_GPIO_E: | |||
SET_BIT(PWR->PUCRE, (GPIONumber & PWR_PORTE_AVAILABLE_PINS)); | |||
CLEAR_BIT(PWR->PDCRE, (GPIONumber & PWR_PORTE_AVAILABLE_PINS)); | |||
@@ -412,9 +417,11 @@ HAL_StatusTypeDef HAL_PWREx_DisableGPIOPullUp(uint32_t GPIO, uint32_t GPIONumber | |||
case PWR_GPIO_C: | |||
CLEAR_BIT(PWR->PUCRC, GPIONumber); | |||
break; | |||
#if defined(GPIOD) | |||
case PWR_GPIO_D: | |||
CLEAR_BIT(PWR->PUCRD, GPIONumber); | |||
break; | |||
#endif | |||
case PWR_GPIO_E: | |||
CLEAR_BIT(PWR->PUCRE, (GPIONumber & PWR_PORTE_AVAILABLE_PINS)); | |||
break; | |||
@@ -473,10 +480,12 @@ HAL_StatusTypeDef HAL_PWREx_EnableGPIOPullDown(uint32_t GPIO, uint32_t GPIONumbe | |||
SET_BIT(PWR->PDCRC, GPIONumber); | |||
CLEAR_BIT(PWR->PUCRC, GPIONumber); | |||
break; | |||
#if defined(GPIOD) | |||
case PWR_GPIO_D: | |||
SET_BIT(PWR->PDCRD, GPIONumber); | |||
CLEAR_BIT(PWR->PUCRD, GPIONumber); | |||
break; | |||
#endif | |||
case PWR_GPIO_E: | |||
SET_BIT(PWR->PDCRE, (GPIONumber & PWR_PORTE_AVAILABLE_PINS)); | |||
CLEAR_BIT(PWR->PUCRE, (GPIONumber & PWR_PORTE_AVAILABLE_PINS)); | |||
@@ -526,9 +535,11 @@ HAL_StatusTypeDef HAL_PWREx_DisableGPIOPullDown(uint32_t GPIO, uint32_t GPIONumb | |||
case PWR_GPIO_C: | |||
CLEAR_BIT(PWR->PDCRC, GPIONumber); | |||
break; | |||
#if defined(GPIOD) | |||
case PWR_GPIO_D: | |||
CLEAR_BIT(PWR->PDCRD, GPIONumber); | |||
break; | |||
#endif | |||
case PWR_GPIO_E: | |||
CLEAR_BIT(PWR->PDCRE, (GPIONumber & PWR_PORTE_AVAILABLE_PINS)); | |||
break; | |||
@@ -571,6 +582,7 @@ void HAL_PWREx_DisablePullUpPullDownConfig(void) | |||
/****************************************************************************/ | |||
#if defined(PWR_CR5_SMPSEN) | |||
/** | |||
* @brief Set BOR configuration | |||
* @param BORConfiguration This parameter can be one of the following values: | |||
@@ -592,6 +604,7 @@ uint32_t HAL_PWREx_GetBORConfig(void) | |||
{ | |||
return LL_PWR_GetBORConfig(); | |||
} | |||
#endif | |||
/****************************************************************************/ | |||
/** | |||
@@ -690,6 +703,7 @@ void HAL_PWREx_DisableFlashPowerDown(uint32_t PowerMode) | |||
} | |||
/****************************************************************************/ | |||
#if defined(PWR_CR2_PVME1) | |||
/** | |||
* @brief Enable the Power Voltage Monitoring 1: VDDUSB versus 1.2V. | |||
* @retval None | |||
@@ -707,6 +721,8 @@ void HAL_PWREx_DisablePVM1(void) | |||
{ | |||
CLEAR_BIT(PWR->CR2, PWR_PVM_1); | |||
} | |||
#endif | |||
/** | |||
* @brief Enable the Power Voltage Monitoring 3: VDDA versus 1.62V. | |||
* @retval None | |||
@@ -753,6 +769,7 @@ HAL_StatusTypeDef HAL_PWREx_ConfigPVM(PWR_PVMTypeDef *sConfigPVM) | |||
configure the corresponding EXTI line accordingly. */ | |||
switch (sConfigPVM->PVMType) | |||
{ | |||
#if defined(PWR_CR2_PVME1) | |||
case PWR_PVM_1: | |||
/* Clear any previous config. Keep it clear if no event or IT mode is selected */ | |||
__HAL_PWR_PVM1_EXTI_DISABLE_EVENT(); | |||
@@ -783,6 +800,7 @@ HAL_StatusTypeDef HAL_PWREx_ConfigPVM(PWR_PVMTypeDef *sConfigPVM) | |||
__HAL_PWR_PVM1_EXTI_ENABLE_FALLING_EDGE(); | |||
} | |||
break; | |||
#endif | |||
case PWR_PVM_3: | |||
/* Clear any previous config. Keep it clear if no event or IT mode is selected */ | |||
@@ -824,6 +842,7 @@ HAL_StatusTypeDef HAL_PWREx_ConfigPVM(PWR_PVMTypeDef *sConfigPVM) | |||
return status; | |||
} | |||
#if defined(PWR_CR5_SMPSEN) | |||
/** | |||
* @brief Configure the SMPS step down converter. | |||
* @note SMPS output voltage is calibrated in production, | |||
@@ -867,13 +886,13 @@ HAL_StatusTypeDef HAL_PWREx_ConfigSMPS(PWR_SMPSTypeDef *sConfigSMPS) | |||
OutputVoltageLevelTrimmed = 0; | |||
status = HAL_ERROR; | |||
} | |||
else if(OutputVoltageLevelTrimmed > (int32_t)PWR_CR5_SMPSVOS) | |||
{ | |||
OutputVoltageLevelTrimmed = (int32_t)PWR_CR5_SMPSVOS; | |||
status = HAL_ERROR; | |||
} | |||
else | |||
{ | |||
if(OutputVoltageLevelTrimmed > (int32_t)PWR_CR5_SMPSVOS) | |||
{ | |||
OutputVoltageLevelTrimmed = (int32_t)PWR_CR5_SMPSVOS; | |||
status = HAL_ERROR; | |||
} | |||
} | |||
/* Update register */ | |||
@@ -923,6 +942,7 @@ uint32_t HAL_PWREx_SMPS_GetEffectiveMode(void) | |||
{ | |||
return (uint32_t)(READ_BIT(PWR->SR2, (PWR_SR2_SMPSF | PWR_SR2_SMPSBF))); | |||
} | |||
#endif | |||
/****************************************************************************/ | |||
@@ -1069,6 +1089,8 @@ HAL_StatusTypeDef HAL_PWREx_DisableLowPowerRunMode(void) | |||
* is set; the MSI oscillator is selected if STOPWUCK is cleared. | |||
* @note By keeping the internal regulator ON during Stop 0 mode, the consumption | |||
* is higher although the startup time is reduced. | |||
* @note Case of Stop0 mode with SMPS: Before entering Stop 0 mode with SMPS Step Down converter enabled, | |||
* the HSI16 must be kept on by enabling HSI kernel clock (set HSIKERON register bit). | |||
* @note According to system power policy, system entering in Stop mode | |||
* is depending on other CPU power mode. | |||
* @param STOPEntry specifies if Stop mode in entered with WFI or WFE instruction. | |||
@@ -1177,6 +1199,15 @@ void HAL_PWREx_EnterSTOP1Mode(uint8_t STOPEntry) | |||
* @note When exiting Stop 2 mode by issuing an interrupt or a wakeup event, | |||
* the HSI RC oscillator is selected as system clock if STOPWUCK bit in RCC_CFGR register | |||
* is set; the MSI oscillator is selected if STOPWUCK is cleared. | |||
* @note Case of Stop2 mode and debugger probe attached: a workaround should be applied. | |||
* Issue specified in "ES0394 - STM32WB55Cx/Rx/Vx device errata": | |||
* 2.2.9 Incomplete Stop 2 mode entry after a wakeup from debug upon EXTI line 48 event | |||
* "With the JTAG debugger enabled on GPIO pins and after a wakeup from debug triggered by an event on EXTI | |||
* line 48 (CDBGPWRUPREQ), the device may enter in a state in which attempts to enter Stop 2 mode are not fully | |||
* effective ..." | |||
* Workaround implementation example using LL driver: | |||
* LL_EXTI_DisableIT_32_63(LL_EXTI_LINE_48); | |||
* LL_C2_EXTI_DisableIT_32_63(LL_EXTI_LINE_48); | |||
* @note According to system power policy, system entering in Stop mode | |||
* is depending on other CPU power mode. | |||
* @param STOPEntry specifies if Stop mode in entered with WFI or WFE instruction. | |||
@@ -1270,7 +1301,7 @@ void HAL_PWREx_PVD_PVM_IRQHandler(void) | |||
__HAL_PWR_PVD_EXTI_CLEAR_FLAG(); | |||
} | |||
#if defined(PWR_CR2_PVME1) | |||
/* Next, successively check PVMx exti flags */ | |||
if(__HAL_PWR_PVM1_EXTI_GET_FLAG() != 0U) | |||
{ | |||
@@ -1280,6 +1311,7 @@ void HAL_PWREx_PVD_PVM_IRQHandler(void) | |||
/* Clear PVM1 exti pending bit */ | |||
__HAL_PWR_PVM1_EXTI_CLEAR_FLAG(); | |||
} | |||
#endif | |||
if(__HAL_PWR_PVM3_EXTI_GET_FLAG() != 0U) | |||
{ | |||
@@ -1291,7 +1323,7 @@ void HAL_PWREx_PVD_PVM_IRQHandler(void) | |||
} | |||
} | |||
#if defined(PWR_CR2_PVME1) | |||
/** | |||
* @brief PWR PVM1 interrupt callback | |||
* @retval None | |||
@@ -1302,6 +1334,7 @@ __weak void HAL_PWREx_PVM1Callback(void) | |||
HAL_PWREx_PVM1Callback() API can be implemented in the user file | |||
*/ | |||
} | |||
#endif | |||
/** | |||
* @brief PWR PVM3 interrupt callback | |||
@@ -208,7 +208,7 @@ | |||
/* Includes ------------------------------------------------------------------*/ | |||
#include "stm32wbxx_hal.h" | |||
#if defined(QUADSPI) || defined(QUADSPI1) || defined(QUADSPI2) | |||
#if defined(QUADSPI) | |||
/** @addtogroup STM32WBxx_HAL_Driver | |||
* @{ | |||
@@ -340,7 +340,7 @@ HAL_StatusTypeDef HAL_QSPI_Init(QSPI_HandleTypeDef *hqspi) | |||
#endif | |||
/* Configure the default timeout for the QSPI memory access */ | |||
HAL_QSPI_SetTimeout(hqspi, HAL_QPSI_TIMEOUT_DEFAULT_VALUE); | |||
HAL_QSPI_SetTimeout(hqspi, HAL_QSPI_TIMEOUT_DEFAULT_VALUE); | |||
} | |||
/* Configure QSPI FIFO Threshold */ | |||