From 968175516877714bec5adf5b5381c1254dad0deb Mon Sep 17 00:00:00 2001 From: Steins7 Date: Sat, 13 Jul 2024 13:19:17 +0200 Subject: [PATCH] Define PWR module's registers --- drv/pwr_regs.h | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 drv/pwr_regs.h diff --git a/drv/pwr_regs.h b/drv/pwr_regs.h new file mode 100644 index 0000000..d84f4ac --- /dev/null +++ b/drv/pwr_regs.h @@ -0,0 +1,56 @@ +/** @file pwr_regs.h + * Module defining Power control (PWR) registers. + * + * Mainly made to be used by the pwr module. It is recommanded to go through + * the functions provided by that module instead of directly using the registers + * defined here. + */ + +#ifndef _PWR_REGS_H_ +#define _PWR_REGS_H_ + +//--includes-------------------------------------------------------------------- + +#include "stdint.h" + + +//--type definitions------------------------------------------------------------ + +#define PWR_BASE_ADDRESS 0x40007000 + +union PWR_CR { + struct { + uint32_t LPDS:1; + uint32_t LDDS:1; + uint32_t CWUF:1; + uint32_t CSBF:1; + uint32_t PVDE:1; + uint32_t PLS:3; + uint32_t DBP:1; + uint32_t reserved1:23; + }; + uint32_t word; +}; + +union PWR_CSR { + struct { + uint32_t WUF:1; + uint32_t SBF:1; + uint32_t PVDO:1; + uint32_t reserved1:5; + uint32_t EWUP:1; + uint32_t reserved2:23; + }; + uint32_t word; +}; + +struct PWR { + union PWR_CR CR; + union PWR_CSR CSR; +}; + + +//--functions------------------------------------------------------------------- + +#endif //_PWR_REGS_H_ +