1 /*
2  * Copyright (c) 2024 Microchip
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef _MICROCHIP_PIC32CXSG_RSTC_COMPONENT_FIXUP_H_
8 #define _MICROCHIP_PIC32CXSG_RSTC_COMPONENT_FIXUP_H_
9 
10 /* -------- RSTC_RCAUSE : (RSTC Offset: 0x00) ( R/ 8) Reset Cause -------- */
11 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
12 typedef union {
13   struct {
14     uint8_t  POR:1;            /*!< bit:      0  Power On Reset                     */
15     uint8_t  BODCORE:1;        /*!< bit:      1  Brown Out CORE Detector Reset      */
16     uint8_t  BODVDD:1;         /*!< bit:      2  Brown Out VDD Detector Reset       */
17     uint8_t  NVM:1;            /*!< bit:      3  NVM Reset                          */
18     uint8_t  EXT:1;            /*!< bit:      4  External Reset                     */
19     uint8_t  WDT_RST:1;        /*!< bit:      5  Watchdog Reset                     */
20     uint8_t  SYST:1;           /*!< bit:      6  System Reset Request               */
21     uint8_t  BACKUP:1;         /*!< bit:      7  Backup Reset                       */
22   } bit;                       /*!< Structure used for bit  access                  */
23   uint8_t reg;                 /*!< Type      used for register access              */
24 } RSTC_RCAUSE_Type;
25 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
26 
27 /* -------- RSTC_BKUPEXIT : (RSTC Offset: 0x02) ( R/ 8) Backup Exit Source -------- */
28 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
29 typedef union {
30   struct {
31     uint8_t  :1;               /*!< bit:      0  Reserved                           */
32     uint8_t  RTC_INT:1;        /*!< bit:      1  Real Timer Counter Interrupt       */
33     uint8_t  BBPS:1;           /*!< bit:      2  Battery Backup Power Switch        */
34     uint8_t  :4;               /*!< bit:  3.. 6  Reserved                           */
35     uint8_t  HIB:1;            /*!< bit:      7  Hibernate                          */
36   } bit;                       /*!< Structure used for bit  access                  */
37   uint8_t reg;                 /*!< Type      used for register access              */
38 } RSTC_BKUPEXIT_Type;
39 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
40 
41 /** \brief RSTC hardware registers */
42 #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
43 typedef struct {
44   __I  RSTC_RCAUSE_Type          RCAUSE;      /**< \brief Offset: 0x00 (R/   8) Reset Cause */
45        RoReg8                    Reserved1[0x1];
46   __I  RSTC_BKUPEXIT_Type        BKUPEXIT;    /**< \brief Offset: 0x02 (R/   8) Backup Exit Source */
47 } Rstc;
48 #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
49 
50 #endif /* _MICROCHIP_PIC32CXSG_RSTC_COMPONENT_FIXUP_H_ */
51