/* This function is used to get the total number of regions that are supported by the MPU, including regions that are already programmed. */
uint32_t MPURegionCountGet(void)
/* This function is used to get the total number of regions that are supported by the MPU, including regions that are already programmed. */
uint32_t MPURegionCountGet(void)
{
    return ((HWREG(NVIC_MPU_TYPE) & NVIC_MPU_TYPE_DREGION_M) >>
            NVIC_MPU_TYPE_DREGION_S);
}