/*
 * Copyright (c) 2022, Shenzhen CVA Innovation CO.,LTD
 * All rights reserved.
 *
 * Shenzhen CVA Innovation CO.,LTD (CVA chip) is supplying this file for use
 * exclusively with CVA's microcontroller products. This file can be freely
 * distributed within development tools that are supporting such microcontroller
 * products.
 *
 * THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED
 * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
 * CVA SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
 * OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
 */

#ifndef _RCM_REG_H_
#define _RCM_REG_H_

/*! \brief Contains public interface to various functions related
 *         to the RCM Registers
 */

/*******************************************************************************
 * the includes
 ******************************************************************************/

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

/*******************************************************************************
 * the defines
 ******************************************************************************/

/* RST_FLAG Bit Fields */
#define RCM_RST_FLAG_POR_RST_F_MASK        (0x2000u)
#define RCM_RST_FLAG_POR_RST_F_SHIFT       (13u)
#define RCM_RST_FLAG_POR_RST_F_WIDTH       (1u)
#define RCM_RST_FLAG_LVR_RST_F_MASK        (0x1000u)
#define RCM_RST_FLAG_LVR_RST_F_SHIFT       (12u)
#define RCM_RST_FLAG_LVR_RST_F_WIDTH       (1u)
#define RCM_RST_FLAG_FLS_INITIAL_F_MASK    (0x800u)
#define RCM_RST_FLAG_FLS_INITIAL_F_SHIFT   (11u)
#define RCM_RST_FLAG_FLS_INITIAL_F_WIDTH   (1u)
#define RCM_RST_FLAG_STDBY_EXIT_F_MASK     (0x400u)
#define RCM_RST_FLAG_STDBY_EXIT_F_SHIFT    (10u)
#define RCM_RST_FLAG_STDBY_EXIT_F_WIDTH    (1u)
#define RCM_RST_FLAG_FHU_RESET_F_MASK      (0x200u)
#define RCM_RST_FLAG_FHU_RESET_F_SHIFT     (9u)
#define RCM_RST_FLAG_FHU_RESET_F_WIDTH     (1u)
#define RCM_RST_FLAG_CMU_SOSC_F_MASK       (0x100u)
#define RCM_RST_FLAG_CMU_SOSC_F_SHIFT      (8u)
#define RCM_RST_FLAG_CMU_SOSC_F_WIDTH      (1u)
#define RCM_RST_FLAG_CMU_PLL_F_MASK        (0x80u)
#define RCM_RST_FLAG_CMU_PLL_F_SHIFT       (7u)
#define RCM_RST_FLAG_CMU_PLL_F_WIDTH       (1u)
#define RCM_RST_FLAG_PLL_LOSS_F_MASK       (0x20u)
#define RCM_RST_FLAG_PLL_LOSS_F_SHIFT      (5u)
#define RCM_RST_FLAG_PLL_LOSS_F_WIDTH      (1u)
#define RCM_RST_FLAG_MDMAP_RST_F_MASK      (0x10u)
#define RCM_RST_FLAG_MDMAP_RST_F_SHIFT     (4u)
#define RCM_RST_FLAG_MDMAP_RST_F_WIDTH     (1u)
#define RCM_RST_FLAG_PIN_RST_F_MASK        (0x8u)
#define RCM_RST_FLAG_PIN_RST_F_SHIFT       (3u)
#define RCM_RST_FLAG_PIN_RST_F_WIDTH       (1u)
#define RCM_RST_FLAG_LOCKUP_RST_F_MASK     (0x4u)
#define RCM_RST_FLAG_LOCKUP_RST_F_SHIFT    (2u)
#define RCM_RST_FLAG_LOCKUP_RST_F_WIDTH    (1u)
#define RCM_RST_FLAG_SYS_RST_F_MASK        (0x2u)
#define RCM_RST_FLAG_SYS_RST_F_SHIFT       (1u)
#define RCM_RST_FLAG_SYS_RST_F_WIDTH       (1u)
#define RCM_RST_FLAG_WDG_RST_F_MASK        (0x1u)
#define RCM_RST_FLAG_WDG_RST_F_SHIFT       (0u)
#define RCM_RST_FLAG_WDG_RST_F_WIDTH       (1u)

/* RST_SFLAG Bit Fields */
#define RCM_RST_SFLAG_POR_RST_SF_MASK      (0x2000u)
#define RCM_RST_SFLAG_POR_RST_SF_SHIFT     (13u)
#define RCM_RST_SFLAG_POR_RST_SF_WIDTH     (1u)
#define RCM_RST_SFLAG_LVR_RST_SF_MASK      (0x1000u)
#define RCM_RST_SFLAG_LVR_RST_SF_SHIFT     (12u)
#define RCM_RST_SFLAG_LVR_RST_SF_WIDTH     (1u)
#define RCM_RST_SFLAG_FLS_INITIAL_SF_MASK  (0x800u)
#define RCM_RST_SFLAG_FLS_INITIAL_SF_SHIFT (11u)
#define RCM_RST_SFLAG_FLS_INITIAL_SF_WIDTH (1u)
#define RCM_RST_SFLAG_STDBY_EXIT_SF_MASK   (0x400u)
#define RCM_RST_SFLAG_STDBY_EXIT_SF_SHIFT  (10u)
#define RCM_RST_SFLAG_STDBY_EXIT_SF_WIDTH  (1u)
#define RCM_RST_SFLAG_FHU_RESET_SF_MASK    (0x200u)
#define RCM_RST_SFLAG_FHU_RESET_SF_SHIFT   (9u)
#define RCM_RST_SFLAG_FHU_RESET_SF_WIDTH   (1u)
#define RCM_RST_SFLAG_CMU_SOSC_SF_MASK     (0x100u)
#define RCM_RST_SFLAG_CMU_SOSC_SF_SHIFT    (8u)
#define RCM_RST_SFLAG_CMU_SOSC_SF_WIDTH    (1u)
#define RCM_RST_SFLAG_CMU_PLL_SF_MASK      (0x80u)
#define RCM_RST_SFLAG_CMU_PLL_SF_SHIFT     (7u)
#define RCM_RST_SFLAG_CMU_PLL_SF_WIDTH     (1u)
#define RCM_RST_SFLAG_PLL_LOSS_SF_MASK     (0x20u)
#define RCM_RST_SFLAG_PLL_LOSS_SF_SHIFT    (5u)
#define RCM_RST_SFLAG_PLL_LOSS_SF_WIDTH    (1u)
#define RCM_RST_SFLAG_MDMAP_RST_SF_MASK    (0x10u)
#define RCM_RST_SFLAG_MDMAP_RST_SF_SHIFT   (4u)
#define RCM_RST_SFLAG_MDMAP_RST_SF_WIDTH   (1u)
#define RCM_RST_SFLAG_PIN_RST_SF_MASK      (0x8u)
#define RCM_RST_SFLAG_PIN_RST_SF_SHIFT     (3u)
#define RCM_RST_SFLAG_PIN_RST_SF_WIDTH     (1u)
#define RCM_RST_SFLAG_LOCKUP_RST_SF_MASK   (0x4u)
#define RCM_RST_SFLAG_LOCKUP_RST_SF_SHIFT  (2u)
#define RCM_RST_SFLAG_LOCKUP_RST_SF_WIDTH  (1u)
#define RCM_RST_SFLAG_SYS_RST_SF_MASK      (0x2u)
#define RCM_RST_SFLAG_SYS_RST_SF_SHIFT     (1u)
#define RCM_RST_SFLAG_SYS_RST_SF_WIDTH     (1u)
#define RCM_RST_SFLAG_WDG_RST_SF_MASK      (0x1u)
#define RCM_RST_SFLAG_WDG_RST_SF_SHIFT     (0u)
#define RCM_RST_SFLAG_WDG_RST_SF_WIDTH     (1u)

/* RST_CTRL Bit Fields */
#define RCM_RST_CTRL_LOCKUP_EN_MASK        (0x20000u)
#define RCM_RST_CTRL_LOCKUP_EN_SHIFT       (17u)
#define RCM_RST_CTRL_LOCKUP_EN_WIDTH       (1u)
#define RCM_RST_CTRL_PLL_LOSS_EN_MASK      (0x10000u)
#define RCM_RST_CTRL_PLL_LOSS_EN_SHIFT     (16u)
#define RCM_RST_CTRL_PLL_LOSS_EN_WIDTH     (1u)
#define RCM_RST_CTRL_CMU_SOSC_IE_MASK      (0x1000u)
#define RCM_RST_CTRL_CMU_SOSC_IE_SHIFT     (12u)
#define RCM_RST_CTRL_CMU_SOSC_IE_WIDTH     (1u)
#define RCM_RST_CTRL_CMU_PLL_IE_MASK       (0x800u)
#define RCM_RST_CTRL_CMU_PLL_IE_SHIFT      (11u)
#define RCM_RST_CTRL_CMU_PLL_IE_WIDTH      (1u)
#define RCM_RST_CTRL_PLL_LOSS_IE_MASK      (0x200u)
#define RCM_RST_CTRL_PLL_LOSS_IE_SHIFT     (9u)
#define RCM_RST_CTRL_PLL_LOSS_IE_WIDTH     (1u)
#define RCM_RST_CTRL_MDMAP_RST_IE_MASK     (0x100u)
#define RCM_RST_CTRL_MDMAP_RST_IE_SHIFT    (8u)
#define RCM_RST_CTRL_MDMAP_RST_IE_WIDTH    (1u)
#define RCM_RST_CTRL_PIN_RST_IE_MASK       (0x80u)
#define RCM_RST_CTRL_PIN_RST_IE_SHIFT      (7u)
#define RCM_RST_CTRL_PIN_RST_IE_WIDTH      (1u)
#define RCM_RST_CTRL_SYS_RST_IE_MASK       (0x20u)
#define RCM_RST_CTRL_SYS_RST_IE_SHIFT      (5u)
#define RCM_RST_CTRL_SYS_RST_IE_WIDTH      (1u)
#define RCM_RST_CTRL_WDG_RST_IE_MASK       (0x10u)
#define RCM_RST_CTRL_WDG_RST_IE_SHIFT      (4u)
#define RCM_RST_CTRL_WDG_RST_IE_WIDTH      (1u)
#define RCM_RST_CTRL_GLOBAL_IE_MASK        (0x4u)
#define RCM_RST_CTRL_GLOBAL_IE_SHIFT       (2u)
#define RCM_RST_CTRL_GLOBAL_IE_WIDTH       (1u)
#define RCM_RST_CTRL_RST_DELAY_MASK        (0x3u)
#define RCM_RST_CTRL_RST_DELAY_SHIFT       (0u)
#define RCM_RST_CTRL_RST_DELAY_WIDTH       (2u)

/* EXTRST Bit Fields */
#define RCM_EXTRST_FLT_LEN_MASK            (0x1F00u)
#define RCM_EXTRST_FLT_LEN_SHIFT           (8u)
#define RCM_EXTRST_FLT_LEN_WIDTH           (5u)
#define RCM_EXTRST_FLT_CK_MASK             (0x10u)
#define RCM_EXTRST_FLT_CK_SHIFT            (4u)
#define RCM_EXTRST_FLT_CK_WIDTH            (1u)
#define RCM_EXTRST_FLT_EN_MASK             (0x1u)
#define RCM_EXTRST_FLT_EN_SHIFT            (0u)
#define RCM_EXTRST_FLT_EN_WIDTH            (1u)

/* RST_IRQ Bit Fields */
#define RCM_RST_IRQ_CMU_SOSC_MASK          (0x1000u)
#define RCM_RST_IRQ_CMU_SOSC_SHIFT         (12u)
#define RCM_RST_IRQ_CMU_SOSC_WIDTH         (1u)
#define RCM_RST_IRQ_CMU_PLL_MASK           (0x800u)
#define RCM_RST_IRQ_CMU_PLL_SHIFT          (11u)
#define RCM_RST_IRQ_CMU_PLL_WIDTH          (1u)
#define RCM_RST_IRQ_PLL_LOSS_MASK          (0x200u)
#define RCM_RST_IRQ_PLL_LOSS_SHIFT         (9u)
#define RCM_RST_IRQ_PLL_LOSS_WIDTH         (1u)
#define RCM_RST_IRQ_MDMAP_MASK             (0x100u)
#define RCM_RST_IRQ_MDMAP_SHIFT            (8u)
#define RCM_RST_IRQ_MDMAP_WIDTH            (1u)
#define RCM_RST_IRQ_PIN_MASK               (0x80u)
#define RCM_RST_IRQ_PIN_SHIFT              (7u)
#define RCM_RST_IRQ_PIN_WIDTH              (1u)
#define RCM_RST_IRQ_SYS_MASK               (0x20u)
#define RCM_RST_IRQ_SYS_SHIFT              (5u)
#define RCM_RST_IRQ_SYS_WIDTH              (1u)
#define RCM_RST_IRQ_WDG_MASK               (0x10u)
#define RCM_RST_IRQ_WDG_SHIFT              (4u)
#define RCM_RST_IRQ_WDG_WIDTH              (1u)

/* KEY Bit Fields */
#define RCM_KEY_KEY_MASK                   (0xFFFFFFFFu)
#define RCM_KEY_KEY_SHIFT                  (0u)
#define RCM_KEY_KEY_WIDTH                  (32u)

/* LOCK Bit Fields */
#define RCM_LOCK_LOCK_MASK                 (0x1u)
#define RCM_LOCK_LOCK_SHIFT                (0u)
#define RCM_LOCK_LOCK_WIDTH                (1u)

/*******************************************************************************
 * the typedefs
 ******************************************************************************/

/*! \brief The definition of RCM registers
 */
typedef struct _RcmRegType_
{
    const volatile uint32_t RST_FLAG;      /*!< Recent reset flag, offset: 0x0 */
    volatile uint32_t       RST_SFLAG;     /*!< Sticky reset flag, offset: 0x4 */
    volatile uint32_t       RST_CTRL;      /*!< Reset control register, offset: 0x8 */
    volatile uint32_t       EXTRST;        /*!< External reset register, offset: 0xC */
    const volatile uint32_t RST_IRQ;       /*!< Reset interrupt status register, offset: 0x10 */
    uint32_t                RESERVED0[27]; /*!< Reserved register, offset: 0x14 */
    volatile uint32_t       KEY;           /*!< RCM lock/unlock key register, offset: 0x80 */
    const volatile uint32_t LOCK;          /*!< RCM unlock/lock flag, offset: 0x84 */
} RcmRegType;

/*******************************************************************************
 * the globals
 ******************************************************************************/

/*******************************************************************************
 * the function prototypes
 ******************************************************************************/

/*! \brief Gets the power up reset flag
 *
 * This function gets the current power up reset flag.
 * Indicates a reset has been caused by power up reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return power up reset flag
 *         - 0b : Reset not caused by power up reset
 *         - 1b : Reset caused by power up reset
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstFlagPor(const RcmRegType *obj)
{
    return ((obj->RST_FLAG & RCM_RST_FLAG_POR_RST_F_MASK) >> RCM_RST_FLAG_POR_RST_F_SHIFT);
}

/*! \brief Gets the low power reset flag
 *
 * This function gets the current low power reset flag.
 * Indicates a reset has been caused by low power reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return low power reset flag
 *         - 0b : Reset not caused by low power reset
 *         - 1b : Reset caused by low power reset
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstFlagLvr(const RcmRegType *obj)
{
    return ((obj->RST_FLAG & RCM_RST_FLAG_LVR_RST_F_MASK) >> RCM_RST_FLAG_LVR_RST_F_SHIFT);
}

/*! \brief Gets the Flash initial reset flag
 *
 * This function gets the current Flash initial reset flag.
 * Indicates a reset has been caused by Flash initial reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return Flash initial reset flag
 *         - 0b : Reset not caused by Flash initial reset
 *         - 1b : Reset caused by Flash initial reset
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstFlagFlsInitial(const RcmRegType *obj)
{
    return ((obj->RST_FLAG & RCM_RST_FLAG_FLS_INITIAL_F_MASK) >> RCM_RST_FLAG_FLS_INITIAL_F_SHIFT);
}

/*! \brief Gets the exit standby mode reset flag
 *
 * This function gets the current exit standby mode reset flag.
 * Indicates a reset has been caused by standby exit reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return exit standby mode reset flag
 *         - 0b : Reset not caused by standby exit reset
 *         - 1b : Reset caused by standby exit reset
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstFlagStdbyExit(const RcmRegType *obj)
{
    return ((obj->RST_FLAG & RCM_RST_FLAG_STDBY_EXIT_F_MASK) >> RCM_RST_FLAG_STDBY_EXIT_F_SHIFT);
}

/*! \brief Gets the FHU reset flag
 *
 * This function gets the current FHU reset flag.
 * Indicates a reset has been caused by FHU reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return FHU reset flag
 *         - 0b : Reset not caused by FHU reset
 *         - 1b : Reset caused by FHU reset
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstFlagFhu(const RcmRegType *obj)
{
    return ((obj->RST_FLAG & RCM_RST_FLAG_FHU_RESET_F_MASK) >> RCM_RST_FLAG_FHU_RESET_F_SHIFT);
}

/*! \brief Gets the SOSC clock monitor reset flag
 *
 * This function gets the current SOSC clock monitor reset flag.
 * Indicates a reset has been caused by CMU SOSC reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return SOSC clock monitor reset flag
 *         - 0b : Reset not caused by CMU SOSC reset
 *         - 1b : Reset caused by CMU SOSC reset
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstFlagCmuSosc(const RcmRegType *obj)
{
    return ((obj->RST_FLAG & RCM_RST_FLAG_CMU_SOSC_F_MASK) >> RCM_RST_FLAG_CMU_SOSC_F_SHIFT);
}

/*! \brief Gets the PLL clock monitor reset flag
 *
 * This function gets the current PLL clock monitor reset flag.
 * Indicates a reset has been caused by CMU PLL reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return PLL clock monitor reset flag
 *         - 0b : Reset not caused by CMU PLL reset
 *         - 1b : Reset caused by CMU PLL reset
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstFlagCmuPll(const RcmRegType *obj)
{
    return ((obj->RST_FLAG & RCM_RST_FLAG_CMU_PLL_F_MASK) >> RCM_RST_FLAG_CMU_PLL_F_SHIFT);
}

/*! \brief Gets the PLL lock loss reset flag
 *
 * This function gets the current PLL lock loss reset flag.
 * Indicates a reset has been caused by PLL loss lock reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return PLL lock loss reset flag
 *         - 0b : Reset not caused by PLL lock loss reset
 *         - 1b : Reset caused by PLL lock loss reset
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstFlagPllLoss(const RcmRegType *obj)
{
    return ((obj->RST_FLAG & RCM_RST_FLAG_PLL_LOSS_F_MASK) >> RCM_RST_FLAG_PLL_LOSS_F_SHIFT);
}

/*! \brief Gets the MDMAP reset flag
 *
 * This function gets the current MDMAP reset flag.
 * Indicates a reset has been caused by MDMAP system reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return MDMAP reset flag
 *         - 0b : Reset not caused by MDMAP system reset
 *         - 1b : Reset caused by MDMAP system reset
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstFlagMdmap(const RcmRegType *obj)
{
    return ((obj->RST_FLAG & RCM_RST_FLAG_MDMAP_RST_F_MASK) >> RCM_RST_FLAG_MDMAP_RST_F_SHIFT);
}

/*! \brief Gets the External PIN reset flag
 *
 * This function gets the current External PIN reset flag.
 * Indicates a reset has been caused by an active-low level on the external RESET (RESET_b) pin.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return External PIN reset flag
 *         - 0b : Reset not caused by external reset pin
 *         - 1b : Reset caused by external reset pin
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstFlagPin(const RcmRegType *obj)
{
    return ((obj->RST_FLAG & RCM_RST_FLAG_PIN_RST_F_MASK) >> RCM_RST_FLAG_PIN_RST_F_SHIFT);
}

/*! \brief Gets the Core Lockup reset flag
 *
 * This function gets the current Core Lockup reset flag.
 * Indicates a reset has been caused by the Arm core indication of a LOCKUP event.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return Core Lockup reset flag
 *         - 0b : Reset not caused by core LOCKUP event
 *         - 1b : Reset caused by core LOCKUP event
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstFlagLockup(const RcmRegType *obj)
{
    return ((obj->RST_FLAG & RCM_RST_FLAG_LOCKUP_RST_F_MASK) >> RCM_RST_FLAG_LOCKUP_RST_F_SHIFT);
}

/*! \brief Gets the CPU Software reset flag
 *
 * This function gets the current CPU Software reset flag.
 * Indicates a reset has been caused by software setting of SYSRESETREQ bit in
 * Application Interrupt and Reset Control Register in the Arm core.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return CPU Software reset flag
 *         - 0b : Reset not caused by software setting of SYSRESETREQ bit
 *         - 1b : Reset caused by software setting of SYSRESETREQ bit
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstFlagSys(const RcmRegType *obj)
{
    return ((obj->RST_FLAG & RCM_RST_FLAG_SYS_RST_F_MASK) >> RCM_RST_FLAG_SYS_RST_F_SHIFT);
}

/*! \brief Gets the Watchdog reset flag
 *
 * This function gets the current Watchdog reset flag.
 * Indicates a reset has been caused by the watchdog timer timing out.
 * This reset source can be blocked by disabling the watchdog.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return Watchdog reset flag
 *         - 0b : Reset not caused by watchdog timeout
 *         - 1b : Reset caused by watchdog timeout
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstFlagWdg(const RcmRegType *obj)
{
    return ((obj->RST_FLAG & RCM_RST_FLAG_WDG_RST_F_MASK) >> RCM_RST_FLAG_WDG_RST_F_SHIFT);
}

/*! \brief Gets the Sticky power up reset flag
 *
 * This function gets the current Sticky power up reset flag.
 * Indicates a reset has been caused by power up reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return Sticky power up reset flag
 *         - 0b : Reset not caused by power up reset
 *         - 1b : Reset caused by power up reset
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstSFlagPor(const RcmRegType *obj)
{
    return ((obj->RST_SFLAG & RCM_RST_SFLAG_POR_RST_SF_MASK) >> RCM_RST_SFLAG_POR_RST_SF_SHIFT);
}

/*! \brief Sets the Sticky power up reset flag
 *
 * This function sets the Sticky power up reset flag.
 * Indicates a reset has been caused by power up reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of Sticky power up reset flag
 *                    - 0b : Reset not caused by power up reset
 *                    - 1b : Reset caused by power up reset
 */
__attribute__((always_inline)) static inline void RcmReg_SetRstSFlagPor(RcmRegType *obj, uint8_t value)
{
    /* Clear the affected bit-field and write '0' to the w1c bits to avoid side-effects */
    uint32_t tmp = 0;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_RST_SFLAG_POR_RST_SF_SHIFT)) & RCM_RST_SFLAG_POR_RST_SF_MASK);
    obj->RST_SFLAG = tmp;
}

/*! \brief Gets the Sticky low power reset flag
 *
 * This function gets the current Sticky low power reset flag.
 * Indicates a reset has been caused by low power reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return Sticky low power reset flag
 *         - 0b : Reset not caused by low power reset
 *         - 1b : Reset caused by low power reset
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstSFlagLvr(const RcmRegType *obj)
{
    return ((obj->RST_SFLAG & RCM_RST_SFLAG_LVR_RST_SF_MASK) >> RCM_RST_SFLAG_LVR_RST_SF_SHIFT);
}

/*! \brief Sets the Sticky low power reset flag
 *
 * This function sets the Sticky low power reset flag.
 * Indicates a reset has been caused by low power reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of Sticky low power reset flag
 *                    - 0b : Reset not caused by low power reset
 *                    - 1b : Reset caused by low power reset
 */
__attribute__((always_inline)) static inline void RcmReg_SetRstSFlagLvr(RcmRegType *obj, uint8_t value)
{
    /* Clear the affected bit-field and write '0' to the w1c bits to avoid side-effects */
    uint32_t tmp = 0;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_RST_SFLAG_LVR_RST_SF_SHIFT)) & RCM_RST_SFLAG_LVR_RST_SF_MASK);
    obj->RST_SFLAG = tmp;
}

/*! \brief Gets the Sticky Flash initial reset flag
 *
 * This function gets the current Sticky Flash initial reset flag.
 * Indicates a reset has been caused by Flash initial reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return Sticky Flash initial reset flag
 *         - 0b : Reset not caused by Flash initial reset
 *         - 1b : Reset caused by Flash initial reset
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstSFlagFlsInitial(const RcmRegType *obj)
{
    return ((obj->RST_SFLAG & RCM_RST_SFLAG_FLS_INITIAL_SF_MASK) >> RCM_RST_SFLAG_FLS_INITIAL_SF_SHIFT);
}

/*! \brief Sets the Sticky Flash initial reset flag
 *
 * This function sets the Sticky Flash initial reset flag.
 * Indicates a reset has been caused by Flash initial reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of Sticky Flash initial reset flag
 *                    - 0b : Reset not caused by Flash initial reset
 *                    - 1b : Reset caused by Flash initial reset
 */
__attribute__((always_inline)) static inline void RcmReg_SetRstSFlagFlsInitial(RcmRegType *obj, uint8_t value)
{
    /* Clear the affected bit-field and write '0' to the w1c bits to avoid side-effects */
    uint32_t tmp = 0;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_RST_SFLAG_FLS_INITIAL_SF_SHIFT)) & RCM_RST_SFLAG_FLS_INITIAL_SF_MASK);
    obj->RST_SFLAG = tmp;
}

/*! \brief Gets the Sticky exit standby mode reset flag
 *
 * This function gets the current Sticky exit standby mode reset flag.
 * Indicates a reset has been caused by standby exit reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return Sticky exit standby mode reset flag
 *         - 0b : Reset not caused by standby exit reset
 *         - 1b : Reset caused by standby exit reset
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstSFlagStdbyExit(const RcmRegType *obj)
{
    return ((obj->RST_SFLAG & RCM_RST_SFLAG_STDBY_EXIT_SF_MASK) >> RCM_RST_SFLAG_STDBY_EXIT_SF_SHIFT);
}

/*! \brief Sets the Sticky exit standby mode reset flag
 *
 * This function sets the Sticky exit standby mode reset flag.
 * Indicates a reset has been caused by standby exit reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of Sticky exit standby mode reset flag
 *                    - 0b : Reset not caused by standby exit reset
 *                    - 1b : Reset caused by standby exit reset
 */
__attribute__((always_inline)) static inline void RcmReg_SetRstSFlagStdbyExit(RcmRegType *obj, uint8_t value)
{
    /* Clear the affected bit-field and write '0' to the w1c bits to avoid side-effects */
    uint32_t tmp = 0;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_RST_SFLAG_STDBY_EXIT_SF_SHIFT)) & RCM_RST_SFLAG_STDBY_EXIT_SF_MASK);
    obj->RST_SFLAG = tmp;
}

/*! \brief Gets the Sticky FHU reset flag
 *
 * This function gets the current Sticky FHU reset flag.
 * Indicates a reset has been caused by FHU reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return Sticky FHU reset flag
 *         - 0b : Reset not caused by FHU reset
 *         - 1b : Reset caused by FHU reset
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstSFlagFhu(const RcmRegType *obj)
{
    return ((obj->RST_SFLAG & RCM_RST_SFLAG_FHU_RESET_SF_MASK) >> RCM_RST_SFLAG_FHU_RESET_SF_SHIFT);
}

/*! \brief Sets the Sticky FHU reset flag
 *
 * This function sets the Sticky FHU reset flag.
 * Indicates a reset has been caused by FHU reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of Sticky FHU reset flag
 *                    - 0b : Reset not caused by FHU reset
 *                    - 1b : Reset caused by FHU reset
 */
__attribute__((always_inline)) static inline void RcmReg_SetRstSFlagFhu(RcmRegType *obj, uint8_t value)
{
    /* Clear the affected bit-field and write '0' to the w1c bits to avoid side-effects */
    uint32_t tmp = 0;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_RST_SFLAG_FHU_RESET_SF_SHIFT)) & RCM_RST_SFLAG_FHU_RESET_SF_MASK);
    obj->RST_SFLAG = tmp;
}

/*! \brief Gets the Sticky SOSC clock monitor reset flag
 *
 * This function gets the current Sticky SOSC clock monitor reset flag.
 * Indicates a reset has been caused by CMU SOSC reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return Sticky SOSC clock monitor reset flag
 *         - 0b : Reset not caused by CMU SOSC reset
 *         - 1b : Reset caused by CMU SOSC reset
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstSFlagCmuSosc(const RcmRegType *obj)
{
    return ((obj->RST_SFLAG & RCM_RST_SFLAG_CMU_SOSC_SF_MASK) >> RCM_RST_SFLAG_CMU_SOSC_SF_SHIFT);
}

/*! \brief Sets the Sticky SOSC clock monitor reset flag
 *
 * This function sets the Sticky SOSC clock monitor reset flag.
 * Indicates a reset has been caused by CMU SOSC reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of Sticky SOSC clock monitor reset flag
 *                    - 0b : Reset not caused by CMU SOSC reset
 *                    - 1b : Reset caused by CMU SOSC reset
 */
__attribute__((always_inline)) static inline void RcmReg_SetRstSFlagCmuSosc(RcmRegType *obj, uint8_t value)
{
    /* Clear the affected bit-field and write '0' to the w1c bits to avoid side-effects */
    uint32_t tmp = 0;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_RST_SFLAG_CMU_SOSC_SF_SHIFT)) & RCM_RST_SFLAG_CMU_SOSC_SF_MASK);
    obj->RST_SFLAG = tmp;
}

/*! \brief Gets the Sticky PLL clock monitor reset flag
 *
 * This function gets the current Sticky PLL clock monitor reset flag.
 * Indicates a reset has been caused by CMU PLL reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return Sticky PLL clock monitor reset flag
 *         - 0b : Reset not caused by CMU PLL reset
 *         - 1b : Reset caused by CMU PLL reset
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstSFlagCmuPll(const RcmRegType *obj)
{
    return ((obj->RST_SFLAG & RCM_RST_SFLAG_CMU_PLL_SF_MASK) >> RCM_RST_SFLAG_CMU_PLL_SF_SHIFT);
}

/*! \brief Sets the Sticky PLL clock monitor reset flag
 *
 * This function sets the Sticky PLL clock monitor reset flag.
 * Indicates a reset has been caused by CMU PLL reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of Sticky PLL clock monitor reset flag
 *                    - 0b : Reset not caused by CMU PLL reset
 *                    - 1b : Reset caused by CMU PLL reset
 */
__attribute__((always_inline)) static inline void RcmReg_SetRstSFlagCmuPll(RcmRegType *obj, uint8_t value)
{
    /* Clear the affected bit-field and write '0' to the w1c bits to avoid side-effects */
    uint32_t tmp = 0;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_RST_SFLAG_CMU_PLL_SF_SHIFT)) & RCM_RST_SFLAG_CMU_PLL_SF_MASK);
    obj->RST_SFLAG = tmp;
}

/*! \brief Gets the Sticky PLL lock loss reset flag
 *
 * This function gets the current Sticky PLL lock loss reset flag.
 * Indicates a reset has been caused by PLL loss lock reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return Sticky PLL lock loss reset flag
 *         - 0b : Reset not caused by PLL lock loss reset
 *         - 1b : Reset caused by PLL lock loss reset
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstSFlagPllLoss(const RcmRegType *obj)
{
    return ((obj->RST_SFLAG & RCM_RST_SFLAG_PLL_LOSS_SF_MASK) >> RCM_RST_SFLAG_PLL_LOSS_SF_SHIFT);
}

/*! \brief Sets the Sticky PLL lock loss reset flag
 *
 * This function sets the Sticky PLL lock loss reset flag.
 * Indicates a reset has been caused by PLL loss lock reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of Sticky PLL lock loss reset flag
 *                    - 0b : Reset not caused by PLL lock loss reset
 *                    - 1b : Reset caused by PLL lock loss reset
 */
__attribute__((always_inline)) static inline void RcmReg_SetRstSFlagPllLoss(RcmRegType *obj, uint8_t value)
{
    /* Clear the affected bit-field and write '0' to the w1c bits to avoid side-effects */
    uint32_t tmp = 0;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_RST_SFLAG_PLL_LOSS_SF_SHIFT)) & RCM_RST_SFLAG_PLL_LOSS_SF_MASK);
    obj->RST_SFLAG = tmp;
}

/*! \brief Gets the Sticky MDMAP reset flag
 *
 * This function gets the current Sticky MDMAP reset flag.
 * Indicates a reset has been caused by MDMAP system reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return Sticky MDMAP reset flag
 *         - 0b : Reset not caused by MDMAP system reset
 *         - 1b : Reset caused by MDMAP system reset
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstSFlagMdmap(const RcmRegType *obj)
{
    return ((obj->RST_SFLAG & RCM_RST_SFLAG_MDMAP_RST_SF_MASK) >> RCM_RST_SFLAG_MDMAP_RST_SF_SHIFT);
}

/*! \brief Sets the Sticky MDMAP reset flag
 *
 * This function sets the Sticky MDMAP reset flag.
 * Indicates a reset has been caused by MDMAP system reset.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of Sticky MDMAP reset flag
 *                    - 0b : Reset not caused by MDMAP system reset
 *                    - 1b : Reset caused by MDMAP system reset
 */
__attribute__((always_inline)) static inline void RcmReg_SetRstSFlagMdmap(RcmRegType *obj, uint8_t value)
{
    /* Clear the affected bit-field and write '0' to the w1c bits to avoid side-effects */
    uint32_t tmp = 0;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_RST_SFLAG_MDMAP_RST_SF_SHIFT)) & RCM_RST_SFLAG_MDMAP_RST_SF_MASK);
    obj->RST_SFLAG = tmp;
}

/*! \brief Gets the Sticky External PIN reset flag
 *
 * This function gets the current Sticky External PIN reset flag.
 * Indicates a reset has been caused by an active-low level on the external RESET (RESET_b) pin.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return Sticky External PIN reset flag
 *         - 0b : Reset not caused by external reset pin
 *         - 1b : Reset caused by external reset pin
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstSFlagPin(const RcmRegType *obj)
{
    return ((obj->RST_SFLAG & RCM_RST_SFLAG_PIN_RST_SF_MASK) >> RCM_RST_SFLAG_PIN_RST_SF_SHIFT);
}

/*! \brief Sets the Sticky External PIN reset flag
 *
 * This function sets the Sticky External PIN reset flag.
 * Indicates a reset has been caused by an active-low level on the external RESET (RESET_b) pin.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of Sticky External PIN reset flag
 *                    - 0b : Reset not caused by external reset pin
 *                    - 1b : Reset caused by external reset pin
 */
__attribute__((always_inline)) static inline void RcmReg_SetRstSFlagPin(RcmRegType *obj, uint8_t value)
{
    /* Clear the affected bit-field and write '0' to the w1c bits to avoid side-effects */
    uint32_t tmp = 0;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_RST_SFLAG_PIN_RST_SF_SHIFT)) & RCM_RST_SFLAG_PIN_RST_SF_MASK);
    obj->RST_SFLAG = tmp;
}

/*! \brief Gets the Sticky Core Lockup reset flag
 *
 * This function gets the current Sticky Core Lockup reset flag.
 * Indicates a reset has been caused by the Arm core indication of a LOCKUP event.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return Sticky Core Lockup reset flag
 *         - 0b : Reset not caused by core LOCKUP event
 *         - 1b : Reset caused by core LOCKUP event
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstSFlagLockup(const RcmRegType *obj)
{
    return ((obj->RST_SFLAG & RCM_RST_SFLAG_LOCKUP_RST_SF_MASK) >> RCM_RST_SFLAG_LOCKUP_RST_SF_SHIFT);
}

/*! \brief Sets the Sticky Core Lockup reset flag
 *
 * This function sets the Sticky Core Lockup reset flag.
 * Indicates a reset has been caused by the Arm core indication of a LOCKUP event.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of Sticky Core Lockup reset flag
 *                    - 0b : Reset not caused by core LOCKUP event
 *                    - 1b : Reset caused by core LOCKUP event
 */
__attribute__((always_inline)) static inline void RcmReg_SetRstSFlagLockup(RcmRegType *obj, uint8_t value)
{
    /* Clear the affected bit-field and write '0' to the w1c bits to avoid side-effects */
    uint32_t tmp = 0;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_RST_SFLAG_LOCKUP_RST_SF_SHIFT)) & RCM_RST_SFLAG_LOCKUP_RST_SF_MASK);
    obj->RST_SFLAG = tmp;
}

/*! \brief Gets the Sticky CPU Software reset flag
 *
 * This function gets the current Sticky CPU Software reset flag.
 * Indicates a reset has been caused by software setting of SYSRESETREQ bit in Application Interrupt
 * and Reset Control Register in the Arm core.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return Sticky CPU Software reset flag
 *         - 0b : Reset not caused by software setting of SYSRESETREQ bit
 *         - 1b : Reset caused by software setting of SYSRESETREQ bit
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstSFlagSys(const RcmRegType *obj)
{
    return ((obj->RST_SFLAG & RCM_RST_SFLAG_SYS_RST_SF_MASK) >> RCM_RST_SFLAG_SYS_RST_SF_SHIFT);
}

/*! \brief Sets the Sticky CPU Software reset flag
 *
 * This function sets the Sticky CPU Software reset flag.
 * Indicates a reset has been caused by software setting of SYSRESETREQ bit in Application Interrupt
 * and Reset Control Register in the Arm core.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of Sticky CPU Software reset flag
 *                    - 0b : Reset not caused by software setting of SYSRESETREQ bit
 *                    - 1b : Reset caused by software setting of SYSRESETREQ bit
 */
__attribute__((always_inline)) static inline void RcmReg_SetRstSFlagSys(RcmRegType *obj, uint8_t value)
{
    /* Clear the affected bit-field and write '0' to the w1c bits to avoid side-effects */
    uint32_t tmp = 0;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_RST_SFLAG_SYS_RST_SF_SHIFT)) & RCM_RST_SFLAG_SYS_RST_SF_MASK);
    obj->RST_SFLAG = tmp;
}

/*! \brief Gets the Sticky Watchdog reset flag
 *
 * This function gets the current Sticky Watchdog reset flag.
 * Indicates a reset has been caused by the watchdog timer timing out.
 * This reset source can be blocked by disabling the watchdog.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return Sticky Watchdog reset flag
 *         - 0b : Reset not caused by watchdog timeout
 *         - 1b : Reset caused by watchdog timeout
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstSFlagWdg(const RcmRegType *obj)
{
    return ((obj->RST_SFLAG & RCM_RST_SFLAG_WDG_RST_SF_MASK) >> RCM_RST_SFLAG_WDG_RST_SF_SHIFT);
}

/*! \brief Sets the Sticky Watchdog reset flag
 *
 * This function sets the Sticky Watchdog reset flag.
 * Indicates a reset has been caused by the watchdog timer timing out.
 * This reset source can be blocked by disabling the watchdog.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of Sticky Watchdog reset flag
 *                    - 0b : Reset not caused by watchdog timeout
 *                    - 1b : Reset caused by watchdog timeout
 */
__attribute__((always_inline)) static inline void RcmReg_SetRstSFlagWdg(RcmRegType *obj, uint8_t value)
{
    /* Clear the affected bit-field and write '0' to the w1c bits to avoid side-effects */
    uint32_t tmp = 0;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_RST_SFLAG_WDG_RST_SF_SHIFT)) & RCM_RST_SFLAG_WDG_RST_SF_MASK);
    obj->RST_SFLAG = tmp;
}

/*! \brief Gets the lockup reset enable
 *
 * This function gets the current lockup reset enable.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return lockup reset enable
 *         - 0b : No reset or interrupt will be caused by LOCKUP.
 *         - 1b : Reset or interrupt will be caused by LOCKUP.
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstCtrlLockupEn(const RcmRegType *obj)
{
    return ((obj->RST_CTRL & RCM_RST_CTRL_LOCKUP_EN_MASK) >> RCM_RST_CTRL_LOCKUP_EN_SHIFT);
}

/*! \brief Sets the lockup reset enable
 *
 * This function sets the lockup reset enable.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of lockup reset enable
 *                    - 0b : No reset or interrupt will be caused by LOCKUP.
 *                    - 1b : Reset or interrupt will be caused by LOCKUP.
 */
__attribute__((always_inline)) static inline void RcmReg_SetRstCtrlLockupEn(RcmRegType *obj, uint8_t value)
{
    uint32_t tmp = obj->RST_CTRL;

    tmp &= ~RCM_RST_CTRL_LOCKUP_EN_MASK;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_RST_CTRL_LOCKUP_EN_SHIFT)) & RCM_RST_CTRL_LOCKUP_EN_MASK);
    obj->RST_CTRL = tmp;
}

/*! \brief Gets the PLL lock loss reset enable
 *
 * This function gets the current PLL lock loss reset enable.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return PLL lock loss reset enable
 *         - 0b : No reset or interrupt will be caused by PLL lock loss.
 *         - 1b : Reset or interrupt will be caused by PLL lock loss.
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstCtrlPllLossEn(const RcmRegType *obj)
{
    return ((obj->RST_CTRL & RCM_RST_CTRL_PLL_LOSS_EN_MASK) >> RCM_RST_CTRL_PLL_LOSS_EN_SHIFT);
}

/*! \brief Sets the PLL lock loss reset enable
 *
 * This function sets the PLL lock loss reset enable.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of PLL lock loss reset enable
 *                    - 0b : No reset or interrupt will be caused by PLL lock loss.
 *                    - 1b : Reset or interrupt will be caused by PLL lock loss.
 */
__attribute__((always_inline)) static inline void RcmReg_SetRstCtrlPllLossEn(RcmRegType *obj, uint8_t value)
{
    uint32_t tmp = obj->RST_CTRL;

    tmp &= ~RCM_RST_CTRL_PLL_LOSS_EN_MASK;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_RST_CTRL_PLL_LOSS_EN_SHIFT)) & RCM_RST_CTRL_PLL_LOSS_EN_MASK);
    obj->RST_CTRL = tmp;
}

/*! \brief Gets the SOSC clock monitor interrupt enable
 *
 * This function gets the current SOSC clock monitor interrupt enable.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return SOSC clock monitor interrupt enable
 *         - 0b : disable
 *         - 1b : enable
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstCtrlCmuSoscIE(const RcmRegType *obj)
{
    return ((obj->RST_CTRL & RCM_RST_CTRL_CMU_SOSC_IE_MASK) >> RCM_RST_CTRL_CMU_SOSC_IE_SHIFT);
}

/*! \brief Sets the SOSC clock monitor interrupt enable
 *
 * This function sets the SOSC clock monitor interrupt enable.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of SOSC clock monitor interrupt enable
 *                    - 0b : disable
 *                    - 1b : enable
 */
__attribute__((always_inline)) static inline void RcmReg_SetRstCtrlCmuSoscIE(RcmRegType *obj, uint8_t value)
{
    uint32_t tmp = obj->RST_CTRL;

    tmp &= ~RCM_RST_CTRL_CMU_SOSC_IE_MASK;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_RST_CTRL_CMU_SOSC_IE_SHIFT)) & RCM_RST_CTRL_CMU_SOSC_IE_MASK);
    obj->RST_CTRL = tmp;
}

/*! \brief Gets the PLL clock monitor interrupt enable
 *
 * This function gets the current PLL clock monitor interrupt enable.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return PLL clock monitor interrupt enable
 *         - 0b : disable
 *         - 1b : enable
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstCtrlCmuPllIE(const RcmRegType *obj)
{
    return ((obj->RST_CTRL & RCM_RST_CTRL_CMU_PLL_IE_MASK) >> RCM_RST_CTRL_CMU_PLL_IE_SHIFT);
}

/*! \brief Sets the PLL clock monitor interrupt enable
 *
 * This function sets the PLL clock monitor interrupt enable.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of PLL clock monitor interrupt enable
 *                    - 0b : disable
 *                    - 1b : enable
 */
__attribute__((always_inline)) static inline void RcmReg_SetRstCtrlCmuPllIE(RcmRegType *obj, uint8_t value)
{
    uint32_t tmp = obj->RST_CTRL;

    tmp &= ~RCM_RST_CTRL_CMU_PLL_IE_MASK;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_RST_CTRL_CMU_PLL_IE_SHIFT)) & RCM_RST_CTRL_CMU_PLL_IE_MASK);
    obj->RST_CTRL = tmp;
}

/*! \brief Gets the PLL loss reset interrupt enable
 *
 * This function gets the current PLL loss reset interrupt enable.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return PLL loss reset interrupt enable
 *         - 0b : disable
 *         - 1b : enable
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstCtrlPllLossIE(const RcmRegType *obj)
{
    return ((obj->RST_CTRL & RCM_RST_CTRL_PLL_LOSS_IE_MASK) >> RCM_RST_CTRL_PLL_LOSS_IE_SHIFT);
}

/*! \brief Sets the PLL loss reset interrupt enable
 *
 * This function sets the PLL loss reset interrupt enable.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of PLL loss reset interrupt enable
 *                    - 0b : disable
 *                    - 1b : enable
 */
__attribute__((always_inline)) static inline void RcmReg_SetRstCtrlPllLossIE(RcmRegType *obj, uint8_t value)
{
    uint32_t tmp = obj->RST_CTRL;

    tmp &= ~RCM_RST_CTRL_PLL_LOSS_IE_MASK;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_RST_CTRL_PLL_LOSS_IE_SHIFT)) & RCM_RST_CTRL_PLL_LOSS_IE_MASK);
    obj->RST_CTRL = tmp;
}

/*! \brief Gets the MDMAP system reset interrupt enable
 *
 * This function gets the current MDMAP system reset interrupt enable.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return MDMAP system reset interrupt enable
 *         - 0b : disable
 *         - 1b : enable
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstCtrlMdmapRstIE(const RcmRegType *obj)
{
    return ((obj->RST_CTRL & RCM_RST_CTRL_MDMAP_RST_IE_MASK) >> RCM_RST_CTRL_MDMAP_RST_IE_SHIFT);
}

/*! \brief Sets the MDMAP system reset interrupt enable
 *
 * This function sets the MDMAP system reset interrupt enable.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of MDMAP system reset interrupt enable
 *                    - 0b : disable
 *                    - 1b : enable
 */
__attribute__((always_inline)) static inline void RcmReg_SetRstCtrlMdmapRstIE(RcmRegType *obj, uint8_t value)
{
    uint32_t tmp = obj->RST_CTRL;

    tmp &= ~RCM_RST_CTRL_MDMAP_RST_IE_MASK;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_RST_CTRL_MDMAP_RST_IE_SHIFT)) & RCM_RST_CTRL_MDMAP_RST_IE_MASK);
    obj->RST_CTRL = tmp;
}

/*! \brief Gets the external reset pin interrupt enable
 *
 * This function gets the current external reset pin interrupt enable.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return external reset pin interrupt enable
 *         - 0b : disable
 *         - 1b : enable
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstCtrlPinRstIE(const RcmRegType *obj)
{
    return ((obj->RST_CTRL & RCM_RST_CTRL_PIN_RST_IE_MASK) >> RCM_RST_CTRL_PIN_RST_IE_SHIFT);
}

/*! \brief Sets the external reset pin interrupt enable
 *
 * This function sets the external reset pin interrupt enable.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of external reset pin interrupt enable
 *                    - 0b : disable
 *                    - 1b : enable
 */
__attribute__((always_inline)) static inline void RcmReg_SetRstCtrlPinRstIE(RcmRegType *obj, uint8_t value)
{
    uint32_t tmp = obj->RST_CTRL;

    tmp &= ~RCM_RST_CTRL_PIN_RST_IE_MASK;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_RST_CTRL_PIN_RST_IE_SHIFT)) & RCM_RST_CTRL_PIN_RST_IE_MASK);
    obj->RST_CTRL = tmp;
}

/*! \brief Gets the CPU system reset interrupt enable
 *
 * This function gets the current CPU system reset interrupt enable.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return CPU system reset interrupt enable
 *         - 0b : disable
 *         - 1b : enable
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstCtrlSysRstIE(const RcmRegType *obj)
{
    return ((obj->RST_CTRL & RCM_RST_CTRL_SYS_RST_IE_MASK) >> RCM_RST_CTRL_SYS_RST_IE_SHIFT);
}

/*! \brief Sets the CPU system reset interrupt enable
 *
 * This function sets the CPU system reset interrupt enable.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of CPU system reset interrupt enable
 *                    - 0b : disable
 *                    - 1b : enable
 */
__attribute__((always_inline)) static inline void RcmReg_SetRstCtrlSysRstIE(RcmRegType *obj, uint8_t value)
{
    uint32_t tmp = obj->RST_CTRL;

    tmp &= ~RCM_RST_CTRL_SYS_RST_IE_MASK;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_RST_CTRL_SYS_RST_IE_SHIFT)) & RCM_RST_CTRL_SYS_RST_IE_MASK);
    obj->RST_CTRL = tmp;
}

/*! \brief Gets the watchdog reset interrupt enable
 *
 * This function gets the current watchdog reset interrupt enable.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return watchdog reset interrupt enable
 *         - 0b : disable
 *         - 1b : enable
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstCtrlWdgRstIE(const RcmRegType *obj)
{
    return ((obj->RST_CTRL & RCM_RST_CTRL_WDG_RST_IE_MASK) >> RCM_RST_CTRL_WDG_RST_IE_SHIFT);
}

/*! \brief Sets the watchdog reset interrupt enable
 *
 * This function sets the watchdog reset interrupt enable.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of watchdog reset interrupt enable
 *                    - 0b : disable
 *                    - 1b : enable
 */
__attribute__((always_inline)) static inline void RcmReg_SetRstCtrlWdgRstIE(RcmRegType *obj, uint8_t value)
{
    uint32_t tmp = obj->RST_CTRL;

    tmp &= ~RCM_RST_CTRL_WDG_RST_IE_MASK;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_RST_CTRL_WDG_RST_IE_SHIFT)) & RCM_RST_CTRL_WDG_RST_IE_MASK);
    obj->RST_CTRL = tmp;
}

/*! \brief Gets the Global Interrupt Enable
 *
 * This function gets the current Global Interrupt Enable.
 *
 * \note The individual interrupt-enable bits still need to be set to generate interrupts
 *
 * \param[in] obj : pointer to RCM register instance
 * \return Global Interrupt Enable
 *         - 0b : All interrupt sources disabled.
 *         - 1b : All interrupt sources enabled.
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstCtrlGlobalIE(const RcmRegType *obj)
{
    return ((obj->RST_CTRL & RCM_RST_CTRL_GLOBAL_IE_MASK) >> RCM_RST_CTRL_GLOBAL_IE_SHIFT);
}

/*! \brief Sets the Global Interrupt Enable
 *
 * This function sets the Global Interrupt Enable.
 *
 * \note The individual interrupt-enable bits still need to be set to generate interrupts
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of Global Interrupt Enable
 *                    - 0b : All interrupt sources disabled.
 *                    - 1b : All interrupt sources enabled.
 */
__attribute__((always_inline)) static inline void RcmReg_SetRstCtrlGlobalIE(RcmRegType *obj, uint8_t value)
{
    uint32_t tmp = obj->RST_CTRL;

    tmp &= ~RCM_RST_CTRL_GLOBAL_IE_MASK;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_RST_CTRL_GLOBAL_IE_SHIFT)) & RCM_RST_CTRL_GLOBAL_IE_MASK);
    obj->RST_CTRL = tmp;
}

/*! \brief Gets the Reset Delay Time
 *
 * This function gets the current Reset Delay Time.
 * Configures the maximum reset delay time from when the interrupt is asserted and the system reset occurs.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return Reset Delay Time
 *         - 00b : 10 LPO cycles
 *         - 01b : 34 LPO cycles
 *         - 10b : 130 LPO cycles
 *         - 11b : 514 LPO cycles
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstCtrlRstDelay(const RcmRegType *obj)
{
    return ((obj->RST_CTRL & RCM_RST_CTRL_RST_DELAY_MASK) >> RCM_RST_CTRL_RST_DELAY_SHIFT);
}

/*! \brief Sets the Reset Delay Time
 *
 * This function sets the Reset Delay Time.
 * Configures the maximum reset delay time from when the interrupt is asserted and the system reset occurs.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of Reset Delay Time
 *                    - 00b : 10 LPO cycles
 *                    - 01b : 34 LPO cycles
 *                    - 10b : 130 LPO cycles
 *                    - 11b : 514 LPO cycles
 */
__attribute__((always_inline)) static inline void RcmReg_SetRstCtrlRstDelay(RcmRegType *obj, uint8_t value)
{
    uint32_t tmp = obj->RST_CTRL;

    tmp &= ~RCM_RST_CTRL_RST_DELAY_MASK;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_RST_CTRL_RST_DELAY_SHIFT)) & RCM_RST_CTRL_RST_DELAY_MASK);
    obj->RST_CTRL = tmp;
}

/*! \brief Gets the external reset input digital filter length
 *
 * This function gets the current external reset input digital filter length.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return external reset input digital filter length
 *         - 00h : 1
 *         - 01h : 2
 *         - 02h : 3
 *            ...
 *         - 1Fh : 32
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetExtRstFltLen(const RcmRegType *obj)
{
    return ((obj->EXTRST & RCM_EXTRST_FLT_LEN_MASK) >> RCM_EXTRST_FLT_LEN_SHIFT);
}

/*! \brief Sets the external reset input digital filter length
 *
 * This function sets the external reset input digital filter length.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of external reset input digital filter length
 *                    - 00h : 1
 *                    - 01h : 2
 *                    - 02h : 3
 *                       ...
 *                    - 1Fh : 32
 */
__attribute__((always_inline)) static inline void RcmReg_SetExtRstFltLen(RcmRegType *obj, uint8_t value)
{
    uint32_t tmp = obj->EXTRST;

    tmp &= ~RCM_EXTRST_FLT_LEN_MASK;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_EXTRST_FLT_LEN_SHIFT)) & RCM_EXTRST_FLT_LEN_MASK);
    obj->EXTRST = tmp;
}

/*! \brief Gets the clock source of PIN Reset digital filter
 *
 * This function gets the current clock source of PIN Reset digital filter.
 * This register should be changed after the clock is disabled at least 2 pre-changed clock cycles
 * and 2 after-changed clock cycles.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return clock source of PIN Reset digital filter
 *         - 0b : clk_apb
 *         - 1b : clk_lpo128
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetExtRstFltCk(const RcmRegType *obj)
{
    return ((obj->EXTRST & RCM_EXTRST_FLT_CK_MASK) >> RCM_EXTRST_FLT_CK_SHIFT);
}

/*! \brief Sets the clock source of PIN Reset digital filter
 *
 * This function sets the clock source of PIN Reset digital filter.
 * This register should be changed after the clock is disabled at least 2 pre-changed clock cycles
 * and 2 after-changed clock cycles.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of clock source of PIN Reset digital filter
 *                    - 0b : clk_apb
 *                    - 1b : clk_lpo128
 */
__attribute__((always_inline)) static inline void RcmReg_SetExtRstFltCk(RcmRegType *obj, uint8_t value)
{
    uint32_t tmp = obj->EXTRST;

    tmp &= ~RCM_EXTRST_FLT_CK_MASK;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_EXTRST_FLT_CK_SHIFT)) & RCM_EXTRST_FLT_CK_MASK);
    obj->EXTRST = tmp;
}

/*! \brief Gets the external reset input digital filter enable
 *
 * This function gets the current external reset input digital filter enable.
 * Reset by Chip Por only
 *
 * \param[in] obj : pointer to RCM register instance
 * \return external reset input digital filter enable
 *         - 0b : disable
 *         - 1b : enable
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetExtRstFltEn(const RcmRegType *obj)
{
    return ((obj->EXTRST & RCM_EXTRST_FLT_EN_MASK) >> RCM_EXTRST_FLT_EN_SHIFT);
}

/*! \brief Sets the external reset input digital filter enable
 *
 * This function sets the external reset input digital filter enable.
 * Reset by Chip Por only
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of external reset input digital filter enable
 *                    - 0b : disable
 *                    - 1b : enable
 */
__attribute__((always_inline)) static inline void RcmReg_SetExtRstFltEn(RcmRegType *obj, uint8_t value)
{
    uint32_t tmp = obj->EXTRST;

    tmp &= ~RCM_EXTRST_FLT_EN_MASK;
    tmp |= (((uint32_t)(((uint32_t)(value)) << RCM_EXTRST_FLT_EN_SHIFT)) & RCM_EXTRST_FLT_EN_MASK);
    obj->EXTRST = tmp;
}

/*! \brief Gets the SOSC clock monitor interrupt status
 *
 * This function gets the current SOSC clock monitor interrupt status.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return SOSC clock monitor interrupt status
 *         - 0b : no interrupt
 *         - 1b : interrupt
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstIrqCmuSosc(const RcmRegType *obj)
{
    return ((obj->RST_IRQ & RCM_RST_IRQ_CMU_SOSC_MASK) >> RCM_RST_IRQ_CMU_SOSC_SHIFT);
}

/*! \brief Gets the PLL clock monitor interrupt status
 *
 * This function gets the current PLL clock monitor interrupt status.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return PLL clock monitor interrupt status
 *         - 0b : no interrupt
 *         - 1b : interrupt
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstIrqCmuPll(const RcmRegType *obj)
{
    return ((obj->RST_IRQ & RCM_RST_IRQ_CMU_PLL_MASK) >> RCM_RST_IRQ_CMU_PLL_SHIFT);
}

/*! \brief Gets the PLL loss reset interrupt status
 *
 * This function gets the current PLL loss reset interrupt status.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return PLL loss reset interrupt status
 *         - 0b : no interrupt
 *         - 1b : interrupt
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstIrqPllLoss(const RcmRegType *obj)
{
    return ((obj->RST_IRQ & RCM_RST_IRQ_PLL_LOSS_MASK) >> RCM_RST_IRQ_PLL_LOSS_SHIFT);
}

/*! \brief Gets the MDMAP system reset interrupt status
 *
 * This function gets the current MDMAP system reset interrupt status.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return MDMAP system reset interrupt status
 *         - 0b : no interrupt
 *         - 1b : interrupt
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstIrqMdmap(const RcmRegType *obj)
{
    return ((obj->RST_IRQ & RCM_RST_IRQ_MDMAP_MASK) >> RCM_RST_IRQ_MDMAP_SHIFT);
}

/*! \brief Gets the external reset pin interrupt status
 *
 * This function gets the current external reset pin interrupt status.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return external reset pin interrupt status
 *         - 0b : no interrupt
 *         - 1b : interrupt
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstIrqPin(const RcmRegType *obj)
{
    return ((obj->RST_IRQ & RCM_RST_IRQ_PIN_MASK) >> RCM_RST_IRQ_PIN_SHIFT);
}

/*! \brief Gets the CPU system reset interrupt status
 *
 * This function gets the current CPU system reset interrupt status.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return CPU system reset interrupt status
 *         - 0b : no interrupt
 *         - 1b : interrupt
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstIrqSys(const RcmRegType *obj)
{
    return ((obj->RST_IRQ & RCM_RST_IRQ_SYS_MASK) >> RCM_RST_IRQ_SYS_SHIFT);
}

/*! \brief Gets the watchdog reset interrupt status
 *
 * This function gets the current watchdog reset interrupt status.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return watchdog reset interrupt status
 *         - 0b : no interrupt
 *         - 1b : interrupt
 */
__attribute__((always_inline)) static inline uint8_t RcmReg_GetRstIrqWdg(const RcmRegType *obj)
{
    return ((obj->RST_IRQ & RCM_RST_IRQ_WDG_MASK) >> RCM_RST_IRQ_WDG_SHIFT);
}

/*! \brief Sets the unlock key
 *
 * This function sets the unlock key.
 * The RST/SCG/PCC registers in ALON power domain is locked by default.
 * Before writing registers, write unlock key to this register.
 *
 * \param[in] obj : pointer to RCM register instance
 * \param[in] value : the value of unlock key
 *                    - 0x52434D4B : unlock
 *                    - other : lock
 */
__attribute__((always_inline)) static inline void RcmReg_SetKey(RcmRegType *obj, uint32_t value)
{
    obj->KEY = value;
}

/*! \brief Gets the RCM register lock flag
 *
 * This function gets the current RCM register lock flag.
 * Registers in RCM is locked by default. Before writing registers in rcm, write unlock key.
 *
 * \param[in] obj : pointer to RCM register instance
 * \return RCM register lock flag
 *         - 0b : unlock
 *         - 1b : lock
 */
__attribute__((always_inline)) static inline uint32_t RcmReg_GetLock(const RcmRegType *obj)
{
    return ((obj->LOCK & RCM_LOCK_LOCK_MASK) >> RCM_LOCK_LOCK_SHIFT);
}

#ifdef __cplusplus
}
#endif /* extern "C" */

#endif /* _RCM_REG_H_ */
