/* param base Key Manager peripheral address. param select select source for OTFAD2 key. param lock setting for lock OTFAD2 key. return status of OTFAD2 key control operation  */
status_t KEYMGR_OTFAD2KeyControll(KEY_MANAGER_Type *base, keymgr_select_t select, keymgr_lock_t lock)
/* param base Key Manager peripheral address. param select select source for OTFAD2 key. param lock setting for lock OTFAD2 key. return status of OTFAD2 key control operation  */
status_t KEYMGR_OTFAD2KeyControll(KEY_MANAGER_Type *base, keymgr_select_t select, keymgr_lock_t lock)
{
    if ((select != (uint8_t)(KEYMGR_SEL_OCOTP)) && (select != (uint8_t)(KEYMGR_SEL_PUF)))
    {
        return kStatus_InvalidArgument;
    }
    base->OTFAD2_KEY_CTRL &= ~KEY_MANAGER_OTFAD2_KEY_CTRL_SELECT_MASK;
    base->OTFAD2_KEY_CTRL |= KEY_MANAGER_OTFAD2_KEY_CTRL_SELECT(select) | KEY_MANAGER_OTFAD2_KEY_CTRL_LOCK(lock);
    return kStatus_Success;
}