Error Unidentified type in core_cm4.h referring to IRQ_type


We are working to build our own SPI module code on nRF52832 in Segger IDE without Using SDK. But we are stuck at this point of error in core_cm4.h.

Unknown Type name at code line 1630 in core_cm4.h. 

And after wasting so much time I had to check the original SDK 15.3.0  spi example,

under core_cm4.h file at code line 1630 - __STATIC_INLINE void NVIC_ENABLEIRQ(IRQ_Type IRQ)  from this when I tried to find out where IRQ_Type  is referred to, I found that it does not go anywhere.

After a long fight, we figured out that(IRQ_Type) it is there in nrf52.h as typedef enum{} IRQ_Type.

Here I am dazzled, why because in core_cm4.h file there is no nrf52 header file included, but why it did not show any error while compiling spi example from SDK.?

Share some insights!

nrf52 SDK is fuzzy!

Snippet from core_cm4.h   (line no : 1630)

  NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));