Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:05

0001 /*
0002  * Copyright (c) 2013 Chris Nott.  All rights reserved.
0003  *
0004  *  Virtual Logic
0005  *  21-25 King St.
0006  *  Rockdale NSW 2216
0007  *  Australia
0008  *  <rtems@vl.com.au>
0009  *
0010  * The license and distribution terms for this file may be
0011  * found in the file LICENSE in this distribution or at
0012  * http://www.rtems.org/license/LICENSE.
0013  */
0014 
0015 #ifndef LIBBSP_ARM_STM32F4_STM32F4XXXX_PWR_H
0016 #define LIBBSP_ARM_STM32F4_STM32F4XXXX_PWR_H
0017 
0018 #include <bsp/utility.h>
0019 
0020 struct stm32f4_pwr_s {
0021 
0022   uint32_t cr;    // Control register
0023 #define STM32F4_PWR_CR_VOS        BSP_BIT32(14) // Regulator scaling output selection
0024 #define STM32F4_PWR_CR_FPDS       BSP_BIT32(9)  // Flash power-down in stop mode
0025 #define STM32F4_PWR_CR_DBP        BSP_BIT32(8)  // Disable backup domain write protection
0026 #define STM32F4_PWR_CR_PLS  BSP_FLD32(val, 5, 7)  // PVD level selection
0027 #define STM32F4_PWR_CR_PLS_GET(reg) BSP_FLD32GET(reg, 5, 7)
0028 #define STM32F4_PWR_CR_PLS_SET(reg, val)  BSP_FLD32SET(reg, val, 5, 7)
0029 #define STM32F4_PWR_CR_PVDE       BSP_BIT32(4)  // Power voltage detector enable
0030 #define STM32F4_PWR_CR_CSBF       BSP_BIT32(3)  // Clear standby flag
0031 #define STM32F4_PWR_CR_CWUF       BSP_BIT32(2)  // Clear wakeup flag
0032 #define STM32F4_PWR_CR_PDDS       BSP_BIT32(1)  // Power-down deepsleep
0033 #define STM32F4_PWR_CR_LPDS       BSP_BIT32(0)  // Low-power deepsleep
0034 
0035   uint32_t csr;   // Control / status register
0036 #define STM32F4_PWR_CSR_VOSRDY    BSP_BIT32(14) // Regulator voltage scaling output selection ready bit
0037 #define STM32F4_PWR_CSR_BRE       BSP_BIT32(9)  // Backup domain regulator enable
0038 #define STM32F4_PWR_CSR_EWUP      BSP_BIT32(8)  // Enable WKUP pin
0039 #define STM32F4_PWR_CSR_BRR       BSP_BIT32(3)  // Backup regulator ready
0040 #define STM32F4_PWR_CSR_PVDO      BSP_BIT32(2)  // PVD output
0041 #define STM32F4_PWR_CSR_SBF       BSP_BIT32(1)  // Standby flag
0042 #define STM32F4_PWR_CSR_WUF       BSP_BIT32(0)  // Wakeup flag
0043 
0044 } __attribute__ ((packed));
0045 typedef struct stm32f4_pwr_s stm32f4_pwr;
0046 
0047 #endif /* LIBBSP_ARM_STM32F4_STM32F4XXXX_PWR_H */