UINT32 LOS_HwiCreate ( HWI_HANDLE_T  uwHwiNum,
HWI_PRIOR_T  usHwiPrio,
HWI_MODE_T  usMode,
HWI_PROC_FUNC  pfnHandler,
HWI_ARG_T  uwArg  
)

Create a hardware interrupt.

Description:
This API is used to configure a hardware interrupt and register a hardware interrupt handling function.
注意:
  • The hardware interrupt module is usable only when the configuration item for hardware interrupt tailoring is enabled.
  • Hardware interrupt number value range: [OS_USER_HWI_MIN,OS_USER_HWI_MAX]. The value range applicable for a Cortex-A7 platform is [32,95].
  • OS_HWI_MAX_NUM specifies the maximum number of interrupts that can be created.
  • Before executing an interrupt on a platform, refer to the chip manual of the platform.
参数:
参数名称 描述
uwHwiNum  [IN] Type::HWI_HANDLE_T: hardware interrupt number. The value range applicable for a Cortex-A7 platform is [32,95].
usHwiPrio  [IN] Type::HWI_PRIOR_T: hardware interrupt priority. Ignore this parameter temporarily.
usMode  [IN] Type::HWI_MODE_T: hardware interrupt mode. Ignore this parameter temporarily.
pfnHandler  [IN] Type::HWI_PROC_FUNC: interrupt handler used when a hardware interrupt is triggered.
uwArg  [IN] Type::HWI_ARG_T: input parameter of the interrupt handler used when a hardware interrupt is triggered.
返回值:
返回值 描述
OS_ERRNO_HWI_PROC_FUNC_NULL  0x02000901: Null hardware interrupt handling function.
OS_ERRNO_HWI_NUM_INVALID  0x02000900: Invalid interrupt number.
OS_ERRNO_HWI_NO_MEMORY  0x02000903: Insufficient memory for hardware interrupt creation.
OS_ERRNO_HWI_ALREADY_CREATED  0x02000904: The interrupt handler being created has already been created.
LOS_OK  0, : The interrupt is successfully created.
Dependency:
  • los_hwi.h: the header file that contains the API declaration.
参见:
None.
自从:
Huawei LiteOS V100R001C00