13d0407baSopenharmony_ci/* 23d0407baSopenharmony_ci * Copyright (c) 2022 FuZhou Lockzhiner Electronic Co., Ltd. All rights reserved. 33d0407baSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 43d0407baSopenharmony_ci * you may not use this file except in compliance with the License. 53d0407baSopenharmony_ci * You may obtain a copy of the License at 63d0407baSopenharmony_ci * 73d0407baSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 83d0407baSopenharmony_ci * 93d0407baSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 103d0407baSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 113d0407baSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 123d0407baSopenharmony_ci * See the License for the specific language governing permissions and 133d0407baSopenharmony_ci * limitations under the License. 143d0407baSopenharmony_ci */ 153d0407baSopenharmony_ci 163d0407baSopenharmony_ci/** 173d0407baSopenharmony_ci * @addtogroup Lockzhiner 183d0407baSopenharmony_ci * 193d0407baSopenharmony_ci * @file interrupt.h 203d0407baSopenharmony_ci */ 213d0407baSopenharmony_ci 223d0407baSopenharmony_ci#ifndef LZ_HARDWARE_INTERRUPT_H 233d0407baSopenharmony_ci#define LZ_HARDWARE_INTERRUPT_H 243d0407baSopenharmony_ci 253d0407baSopenharmony_citypedef void (*ProcFunc)(void *arg); 263d0407baSopenharmony_ci 273d0407baSopenharmony_ci/** 283d0407baSopenharmony_ci * @brief Create a hardware interrupt. 293d0407baSopenharmony_ci * 303d0407baSopenharmony_ci * 313d0407baSopenharmony_ci * 323d0407baSopenharmony_ci * @param irq Indicates hardware interrupt number. 333d0407baSopenharmony_ci * @param irq Indicates interrupt handler used when a hardware interrupt is triggered. 343d0407baSopenharmony_ci * @param arg Indicates input parameter of the interrupt handler used when a hardware interrupt is triggered. 353d0407baSopenharmony_ci * @return Returns {@link HAL_SUCCESS} if the irq is requested successfully; 363d0407baSopenharmony_ci * returns {@link HAL_FAILURE} otherwise. For details about other return values. 373d0407baSopenharmony_ci */ 383d0407baSopenharmony_ciint RequestIrq(unsigned int irq, ProcFunc isr, void *arg); 393d0407baSopenharmony_ci 403d0407baSopenharmony_ci/** 413d0407baSopenharmony_ci * @brief Delete hardware interrupt. 423d0407baSopenharmony_ci * 433d0407baSopenharmony_ci * 443d0407baSopenharmony_ci * 453d0407baSopenharmony_ci * @param irq Indicates hardware interrupt number. 463d0407baSopenharmony_ci * @return Returns {@link HAL_SUCCESS} if the irq is free successfully; 473d0407baSopenharmony_ci * returns {@link HAL_FAILURE} otherwise. For details about other return values, see the chip description. 483d0407baSopenharmony_ci */ 493d0407baSopenharmony_ci 503d0407baSopenharmony_ciint FreeIrq(unsigned int irq); 513d0407baSopenharmony_ci 523d0407baSopenharmony_ci#endif 533d0407baSopenharmony_ci 54