/* Enable or disable the access control of the unit.  */
void MPU_UnitCmd(uint32_t u32Unit, en_functional_state_t enNewState)
/* Enable or disable the access control of the unit.  */
void MPU_UnitCmd(uint32_t u32Unit, en_functional_state_t enNewState)
{
    __IO uint32_t *CR;
    uint32_t u32UnitPos = 0UL;
    uint32_t u32Temp;
    DDL_ASSERT(IS_MPU_UNLOCK());
    DDL_ASSERT(IS_MPU_UNIT(u32Unit));
    DDL_ASSERT(IS_FUNCTIONAL_STATE(enNewState));
    u32Temp = u32Unit;
    while (0UL != u32Temp) {
        if (0UL != (u32Temp & 0x1UL)) {
            CR = MPU_CR_ADDR(u32UnitPos);
            if (DISABLE != enNewState) {
                SET_REG32_BIT(*CR, MPU_SCR_SMPUE);
            } else {
                CLR_REG32_BIT(*CR, MPU_SCR_SMPUE);
            }
        }
        u32Temp >>= 1UL;
        u32UnitPos++;
    }
}