/* * @brief CMSIS Peripheral Access Layer for NV32 * * CMSIS Peripheral Access Layer for NV32 */ #if !defined(NV32_H_) #define NV32_H_ /**< Symbol preventing repeated inclusion */ /** Memory map major version (memory maps with equal major version number are * compatible) */ #define MCU_MEM_MAP_VERSION 0x0100u /** Memory map minor version */ #define MCU_MEM_MAP_VERSION_MINOR 0x0004u /* ---------------------------------------------------------------------------- -- Interrupt vector numbers ---------------------------------------------------------------------------- */ /*! * @addtogroup Interrupt_vector_numbers Interrupt vector numbers * @{ */ /** Interrupt Number Definitions */ typedef enum IRQn { /* Core interrupts */ NonMaskableInt_IRQn = -14, /**< Non Maskable Interrupt */ HardFault_IRQn = -13, /**< Cortex-M0 SV Hard Fault Interrupt */ SVCall_IRQn = -5, /**< Cortex-M0 SV Call Interrupt */ PendSV_IRQn = -2, /**< Cortex-M0 Pend SV Interrupt */ SysTick_IRQn = -1, /**< Cortex-M0 System Tick Interrupt */ /* Device specific interrupts */ Reserved16_IRQn = 0, /**< Reserved interrupt 16 */ Reserved17_IRQn = 1, /**< Reserved interrupt 17 */ Reserved18_IRQn = 2, /**< Reserved interrupt 18 */ Reserved19_IRQn = 3, /**< Reserved interrupt 19 */ Reserved20_IRQn = 4, /**< Reserved interrupt 20 */ ETMRH_IRQn = 5, /**< ETMRH command complete/read collision interrupt */ LVD_LVW_IRQn = 6, /**< Low Voltage Detect, Low Voltage Warning */ IRQ_IRQn = 7, /**< External interrupt */ I2C0_IRQn = 8, /**< I2C0 interrupt */ Reserved25_IRQn = 9, /**< Reserved interrupt 25 */ SPI0_IRQn = 10, /**< SPI0 interrupt */ SPI1_IRQn = 11, /**< SPI1 interrupt */ UART0_IRQn = 12, /**< UART0 status/error interrupt */ UART1_IRQn = 13, /**< UART1 status/error interrupt */ UART2_IRQn = 14, /**< UART2 status/error interrupt */ ADC0_IRQn = 15, /**< ADC0 interrupt */ ACMP0_IRQn = 16, /**< ACMP0 interrupt */ ETM0_IRQn = 17, /**< ETM0 Single interrupt vector for all sources */ ETM1_IRQn = 18, /**< ETM1 Single interrupt vector for all sources */ ETM2_IRQn = 19, /**< ETM2 Single interrupt vector for all sources */ RTC_IRQn = 20, /**< RTC overflow */ ACMP1_IRQn = 21, /**< ACMP1 interrupt */ PIT_CH0_IRQn = 22, /**< PIT CH0 overflow */ PIT_CH1_IRQn = 23, /**< PIT CH1 overflow */ KBI0_IRQn = 24, /**< Keyboard interrupt 0 */ KBI1_IRQn = 25, /**< Keyboard interrupt 1 */ Reserved42_IRQn = 26, /**< Reserved interrupt 42 */ ICS_IRQn = 27, /**< ICS interrupt */ Watchdog_IRQn = 28, /**< WDOG Interrupt */ Reserved45_IRQn = 29, /**< Reserved interrupt 45 */ Reserved46_IRQn = 30, /**< Reserved interrupt 46 */ Reserved47_IRQn = 31 /**< Reserved interrupt 47 */ } IRQn_Type; /*! * @} */ /* end of group Interrupt_vector_numbers */ /* ---------------------------------------------------------------------------- -- Cortex M0 Core Configuration ---------------------------------------------------------------------------- */ /*! * @addtogroup Cortex_Core_Configuration Cortex M0 Core Configuration * @{ */ #define __CM0PLUS_REV 0x0000 /**< Core revision r0p0 */ #define __MPU_PRESENT 0 /**< Defines if an MPU is present or not */ #define __VTOR_PRESENT 1 /**< Defines if an MPU is present or not */ #define __NVIC_PRIO_BITS 2 /**< Number of priority bits implemented in the NVIC */ #define __Vendor_SysTickConfig 0 /**< Vendor specific implementation of SysTickConfig is defined */ #include "core_cm0plus.h" /* Core Peripheral Access Layer */ //#include "system_nv32.h" /* Device specific configuration file */ /*! * @} */ /* end of group Cortex_Core_Configuration */ /* ---------------------------------------------------------------------------- -- Device Peripheral Access Layer ---------------------------------------------------------------------------- */ /*! * @addtogroup Peripheral_access_layer Device Peripheral Access Layer * @{ */ /* ** Start of section using anonymous unions */ #if defined(__ARMCC_VERSION) #pragma push #pragma anon_unions #elif defined(__CWCC__) #pragma push #pragma cpp_extensions on #elif defined(__GNUC__) /* anonymous unions are enabled by default */ #elif defined(__IAR_SYSTEMS_ICC__) #pragma language=extended #else #error Not supported compiler type #endif /* ---------------------------------------------------------------------------- -- ACMP Peripheral Access Layer ---------------------------------------------------------------------------- */ /*! * @addtogroup ACMP_Peripheral_Access_Layer ACMP Peripheral Access Layer * @{ */ /** ACMP - Register Layout Typedef */ typedef struct { __IO uint8_t CS; /**< ACMP Control and Status Register, offset: 0x0 */ __IO uint8_t C0; /**< ACMP Control Register 0, offset: 0x1 */ __IO uint8_t C1; /**< ACMP Control Register 1, offset: 0x2 */ __IO uint8_t C2; /**< ACMP Control Register 2, offset: 0x3 */ } ACMP_Type; /* ---------------------------------------------------------------------------- -- ACMP Register Masks ---------------------------------------------------------------------------- */ /*! * @addtogroup ACMP_Register_Masks ACMP Register Masks * @{ */ /* CS Bit Fields */ #define ACMP_CS_ACMOD_MASK 0x3u #define ACMP_CS_ACMOD_SHIFT 0 #define ACMP_CS_ACMOD(x) (((uint8_t)(((uint8_t)(x))<EFMCR) #define EFM_SEC0_reg(base) ((base)->EFMSEC0) #define EFM_SEC1_reg(base) ((base)->EFMSEC1) #define EFM_SEC2_reg(base) ((base)->EFMSEC2) #define EFM_ETM0_reg(base) ((base)->EFMETM0) #define EFM_ETM1_reg(base) ((base)->EFMETM1) #define EFM_CMD_reg(base) ((base)->EFMCMD) /** Peripheral Map **/ #define ETMRH ((ETMRH_MemMapPtr)0x40020000u) #define ETMRH_FCLKDIV_FDIVLD_MASK 0x80u #define ETMRH_FSTAT_CCIF_MASK 0x80u #define ETMRH_FSTAT_ACCERR_MASK 0x20u #define ETMRH_FSTAT_FPVIOL_MASK 0x10u #define ETMRH_FSTAT_MGSTAT_MASK 0x3u #define ETMRH_ERROR (ETMRH_FSTAT_ACCERR_MASK | ETMRH_FSTAT_FPVIOL_MASK | ETMRH_FSTAT_MGSTAT_MASK) #define ETMRH_FCCOB *((volatile uint16_t *)(0x0a + 0x40020000)) #define EFMCR EFM_CR_reg(ETMRH) #define EFMSEC0 EFM_SEC0_reg(ETMRH) #define EFMSEC1 EFM_SEC1_reg(ETMRH) #define EFMSEC2 EFM_SEC2_reg(ETMRH) #define EFMETM0 EFM_ETM0_reg(ETMRH) #define EFMETM1 EFM_ETM1_reg(ETMRH) #define EFMCMD EFM_CMD_reg(ETMRH) typedef struct NVR_BKDOOR_MemMap{ volatile unsigned long Custombkd; } *NVR_BKDOOR_MemMapPtr; #define Custombkd_reg(base) ((base)->Custombkd) #define NVR_BKDOOR ((NVR_BKDOOR_MemMapPtr)0x40020038u) #define Custombkd Custombkd_reg(NVR_BKDOOR) /*! * @} */ /* end of group ETMRH_Peripheral_Access_Layer */ /* ---------------------------------------------------------------------------- -- GPIO Peripheral Access Layer ---------------------------------------------------------------------------- */ /*! * @addtogroup GPIO_Peripheral_Access_Layer GPIO Peripheral Access Layer * @{ */ /** GPIO - Register Layout Typedef */ typedef struct { __IO uint32_t PDOR; /**< Port Data Output Register, offset: 0x0 */ __O uint32_t PSOR; /**< Port Set Output Register, offset: 0x4 */ __O uint32_t PCOR; /**< Port Clear Output Register, offset: 0x8 */ __O uint32_t PTOR; /**< Port Toggle Output Register, offset: 0xC */ __I uint32_t PDIR; /**< Port Data Input Register, offset: 0x10 */ __IO uint32_t PDDR; /**< Port Data Direction Register, offset: 0x14 */ __IO uint32_t PIDR; /**< Port Input Disable Register, offset: 0x18 */ } GPIO_Type; /* ---------------------------------------------------------------------------- -- GPIO Register Masks ---------------------------------------------------------------------------- */ /*! * @addtogroup GPIO_Register_Masks GPIO Register Masks * @{ */ /* PDOR Bit Fields */ #define GPIO_PDOR_PDO_MASK 0xFFFFFFFFu #define GPIO_PDOR_PDO_SHIFT 0 #define GPIO_PDOR_PDO(x) (((uint32_t)(((uint32_t)(x))<