/* param base Key Manager peripheral address. param select select source for Master key. param lock setting for lock Master key. return status of Master key control operation  */
status_t KEYMGR_MasterKeyControll(KEY_MANAGER_Type *base, keymgr_select_t select, keymgr_lock_t lock)
/* param base Key Manager peripheral address. param select select source for Master key. param lock setting for lock Master key. return status of Master key control operation  */
status_t KEYMGR_MasterKeyControll(KEY_MANAGER_Type *base, keymgr_select_t select, keymgr_lock_t lock)
{
    if ((select != (uint8_t)(KEYMGR_SEL_UDF)) && (select != (uint8_t)(KEYMGR_SEL_PUF)))
    {
        return kStatus_InvalidArgument;
    }
    base->MASTER_KEY_CTRL &= ~KEY_MANAGER_MASTER_KEY_CTRL_SELECT_MASK;
    base->MASTER_KEY_CTRL |= KEY_MANAGER_MASTER_KEY_CTRL_SELECT(select) | KEY_MANAGER_MASTER_KEY_CTRL_LOCK(lock);
    return kStatus_Success;
}