WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
Hardware interrupt
Hardware interrupt 的协作图:

结构体

struct  tagIrqParam
 

宏定义

#define OS_HWI_PRIO_HIGHEST   0
 
#define OS_HWI_PRIO_LOWEST   7
 
#define OS_SYS_VECTOR_CNT   16
 
#define OS_NVIC_AIRCR_PRIGROUP   7
 
#define OS_SYSTICK_CONTROL_REG   0xE000E010
 
#define OS_NVIC_PRI_BASE   0xE000E400
 
#define OS_NVIC_SETENA_BASE   0xE000E100
 
#define OS_NVIC_SETPEND_BASE   0xE000E200
 
#define OS_NVIC_INT_ACT_BASE   0xE000E300
 
#define OS_NVIC_CLRENA_BASE   0xE000E180
 
#define OS_NVIC_INT_CTRL   0xE000ED04
 
#define OS_NVIC_VTOR   0xE000ED08
 
#define OS_NVIC_AIRCR   0xE000ED0C
 
#define OS_NVIC_EXCPRI_BASE   0xE000ED18
 
#define OS_EXC_RESET   1
 
#define OS_EXC_NMI   2
 
#define OS_EXC_HARD_FAULT   3
 
#define OS_EXC_MPU_FAULT   4
 
#define OS_EXC_BUS_FAULT   5
 
#define OS_EXC_USAGE_FAULT   6
 
#define OS_EXC_SVC_CALL   11
 
#define OS_EXC_DBG_MONITOR   12
 
#define OS_EXC_PEND_SV   14
 
#define OS_INT_ACTIVE   IntActive()
 
#define OS_INT_INACTIVE   (!(OS_INT_ACTIVE))
 
#define OS_HWI_PRIO_HIGHEST   0
 
#define OS_HWI_PRIO_LOWEST   (LOSCFG_HWI_PRIO_LIMIT - 1)
 
#define HWI_PRI_VALID(pri)   ((pri) <= OS_HWI_PRIO_LOWEST)
 
#define LOS_ERRNO_HWI_NUM_INVALID   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x00)
 
#define LOS_ERRNO_HWI_PROC_FUNC_NULL   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x01)
 
#define OS_ERRNO_HWI_CB_UNAVAILABLE   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x02)
 
#define LOS_ERRNO_HWI_NO_MEMORY   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x03)
 
#define LOS_ERRNO_HWI_ALREADY_CREATED   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x04)
 
#define LOS_ERRNO_HWI_PRIO_INVALID   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x05)
 
#define OS_ERRNO_HWI_MODE_INVALID   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x06)
 
#define OS_ERRNO_HWI_FASTMODE_ALREADY_CREATED   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x07)
 
#define LOS_ERRNO_HWI_INTERR   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x08)
 
#define LOS_ERRNO_HWI_SHARED_ERROR   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x09)
 
#define OS_ERRNO_HWI_ARG_INVALID   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x0a)
 
#define LOS_ERRNO_HWI_HWINUM_UNCREATE   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x0b)
 
#define LOS_ERRNO_HWI_NO_CPUP_MEMORY   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x0c)
 
#define LOS_ERRNO_HWI_NOT_INTERRUPT_CONTEXT   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x0d)
 
#define LOS_ERRNO_HWI_PTR_NULL   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x0e)
 
#define LOS_ERRNO_HWI_ARG_NOT_ENABLED   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x0f)
 
#define IRQF_SHARED   0x8000U
 

类型定义

typedef UINT32 HWI_HANDLE_T
 
typedef UINT16 HWI_PRIOR_T
 
typedef UINT16 HWI_MODE_T
 
typedef UINTPTR HWI_ARG_T
 
typedef void(* HWI_PROC_FUNC) (void)
 Define the type of a hardware interrupt handling function.
 
typedef void(* HWI_BOTTOM_HALF_FUNC) (void *)
 Define the type of an interrupt bottom half function.
 
typedef struct tagIrqParam HWI_IRQ_PARAM_S
 

函数

UINT32 LOS_HwiCreate (HWI_HANDLE_T hwiNum, HWI_PRIOR_T hwiPrio, HWI_MODE_T hwiMode, HWI_PROC_FUNC hwiHandler, HWI_IRQ_PARAM_S *irqParam)
 Create a hardware interrupt.
 
UINT32 LOS_HwiDelete (HWI_HANDLE_T hwiNum, HWI_IRQ_PARAM_S *irqParam)
 delete a hardware interrupt.
 
UINT32 LOS_HwiTrigger (HWI_HANDLE_T hwiNum)
 Trigger interrupts.
 
UINT32 LOS_HwiClear (HWI_HANDLE_T hwiNum)
 clear interrupts.
 
UINT32 LOS_HwiEnable (HWI_HANDLE_T hwiNum)
 Enable interrupts.
 
UINT32 LOS_HwiDisable (HWI_HANDLE_T hwiNum)
 Disable interrupts.
 
UINT32 LOS_HwiBhworkAdd (HWI_BOTTOM_HALF_FUNC bhHandler, void *data)
 create a interrupt bottom half work.
 
UINT32 LOS_HwiSendIpi (HWI_HANDLE_T hwiNum, UINT32 cpuMask)
 Send inter-core interrupts to designated cores.
 
UINT32 LOS_HwiSetAffinity (HWI_HANDLE_T hwiNum, UINT32 cpuMask)
 Interrupt response specified CPU processing.
 
UINT32 LOS_HwiSetPriority (HWI_HANDLE_T hwiNum, HWI_PRIOR_T priority)
 Set interrupts priority.
 
UINT32 LOS_HwiRespCntGet (HWI_HANDLE_T hwiNum, UINT32 *respCount)
 Get the number of interrupt responses.
 

详细描述

宏定义说明

◆ HWI_PRI_VALID

#define HWI_PRI_VALID (   pri)    ((pri) <= OS_HWI_PRIO_LOWEST)

The lower priority number, the higher priority, so OS_HWI_PRIO_LOWEST big than OS_HWI_PRIO_HIGHEST.

◆ IRQF_SHARED

#define IRQF_SHARED   0x8000U

The flag means the IRQ is allowed to share among several devices.

The flag only used by the kernel as part of the IRQ handling routines.

◆ LOS_ERRNO_HWI_ALREADY_CREATED

#define LOS_ERRNO_HWI_ALREADY_CREATED   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x04)

Hardware interrupt error code: The interrupt has already been created.

Value: 0x02000904.

Solution: Check whether the interrupt specified by the passed-in interrupt number has already been created.

注意
  • Please use macros starting with LOS, and macros starting with OS will not be supported.

◆ LOS_ERRNO_HWI_ARG_NOT_ENABLED

#define LOS_ERRNO_HWI_ARG_NOT_ENABLED   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x0f)

Hardware interrupt error code: create hwi with arg when LOSCFG_HWI_WITH_ARG not enabled.

Value: 0x0200090f.

Solution: Pass NULL to the last parameter of LOS_HwiCreate or enable LOSCFG_HWI_WITH_ARG.

注意
  • None.

◆ LOS_ERRNO_HWI_HWINUM_UNCREATE

#define LOS_ERRNO_HWI_HWINUM_UNCREATE   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x0b)

Hardware interrupt error code: The interrupt corresponded to the hardware interrupt number or devid has not been created.

Value: 0x0200090b.

Solution: Check the irqParam->pDevId of LOS_HwiDelete, make sure the devid need to delete.

注意
  • Please use macros starting with LOS, and macros starting with OS will not be supported.

◆ LOS_ERRNO_HWI_INTERR

#define LOS_ERRNO_HWI_INTERR   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x08)

Hardware interrupt error code: The API is called during an interrupt, which is not allowed.

Value: 0x02000908.

Solution: This error code is not in use temporarily.

注意
  • Please use macros starting with LOS, and macros starting with OS will not be supported.

◆ LOS_ERRNO_HWI_NO_CPUP_MEMORY

#define LOS_ERRNO_HWI_NO_CPUP_MEMORY   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x0c)

Hardware interrupt error code: Insufficient memory for cpup control block of hardware interrupt.

Value: 0x0200090c.

Solution: Expand the configured memory.

注意
  • None.

◆ LOS_ERRNO_HWI_NO_MEMORY

#define LOS_ERRNO_HWI_NO_MEMORY   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x03)

Hardware interrupt error code: Insufficient memory for hardware interrupt initialization.

Value: 0x02000903.

Solution: Expand the configured memory.

注意
  • Please use macros starting with LOS, and macros starting with OS will not be supported.

◆ LOS_ERRNO_HWI_NOT_INTERRUPT_CONTEXT

#define LOS_ERRNO_HWI_NOT_INTERRUPT_CONTEXT   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x0d)

interrupt bottom half error code: The caller is not in interrupt context.

Value: 0x0200090d.

Solution: Check the caller of LOS_HwiBhworkAdd, make sure the caller in interrupt context, rather than task context.

注意
  • None.

◆ LOS_ERRNO_HWI_NUM_INVALID

#define LOS_ERRNO_HWI_NUM_INVALID   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x00)

Hardware interrupt error code: Invalid interrupt number.

Value: 0x02000900.

Solution: Ensure that the interrupt number is valid.

注意
  • Please use macros starting with LOS, and macros starting with OS will not be supported.

◆ LOS_ERRNO_HWI_PRIO_INVALID

#define LOS_ERRNO_HWI_PRIO_INVALID   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x05)

Hardware interrupt error code: Invalid interrupt priority.

Value: 0x02000905.

Solution: Ensure that the interrupt priority is valid.

注意
  • Please use macros starting with LOS, and macros starting with OS will not be supported.

◆ LOS_ERRNO_HWI_PROC_FUNC_NULL

#define LOS_ERRNO_HWI_PROC_FUNC_NULL   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x01)

Hardware interrupt error code: Null hardware interrupt handling function.

Value: 0x02000901.

Solution: Pass in a valid non-null hardware interrupt handling function.

注意
  • Please use macros starting with LOS, and macros starting with OS will not be supported.

◆ LOS_ERRNO_HWI_PTR_NULL

#define LOS_ERRNO_HWI_PTR_NULL   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x0e)

Hardware interrupt error code: Null pointer.

Value: 0x0200090e.

Solution: Change the passed-in null pointer to a valid non-null pointer.

注意
  • None.

◆ LOS_ERRNO_HWI_SHARED_ERROR

#define LOS_ERRNO_HWI_SHARED_ERROR   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x09)

Hardware interrupt error code: the hardware interrupt supports SHARED error.

Value: 0x02000909.

Solution: Check the input params hwiMode and irqParam of LOS_HwiCreate or LOS_HwiDelete whether adapt the current hardware interrupt.

注意
  • Please use macros starting with LOS, and macros starting with OS will not be supported.

◆ OS_ERRNO_HWI_ARG_INVALID

#define OS_ERRNO_HWI_ARG_INVALID   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x0a)

Hardware interrupt error code: Invalid interrupt Arg when interrupt mode is IRQF_SHARED.

Value: 0x0200090a.

Solution: This error code is not in use temporarily.

弃用:
This error code is obsolete since LiteOS 5.0.0.

◆ OS_ERRNO_HWI_CB_UNAVAILABLE

#define OS_ERRNO_HWI_CB_UNAVAILABLE   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x02)

Hardware interrupt error code: Insufficient interrupt resources for hardware interrupt creation.

Value: 0x02000902.

Solution: This error code is not in use temporarily.

弃用:
This error code is obsolete since LiteOS 5.0.0.

◆ OS_ERRNO_HWI_FASTMODE_ALREADY_CREATED

#define OS_ERRNO_HWI_FASTMODE_ALREADY_CREATED   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x07)

Hardware interrupt error code: The interrupt has already been created as a fast interrupt.

Value: 0x02000907.

Solution: This error code is not in use temporarily.

弃用:
This error code is obsolete since LiteOS 5.0.0.

◆ OS_ERRNO_HWI_MODE_INVALID

#define OS_ERRNO_HWI_MODE_INVALID   LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x06)

Hardware interrupt error code: Incorrect interrupt creation mode.

Value: 0x02000906.

Solution: This error code is not in use temporarily.

弃用:
This error code is obsolete since LiteOS 5.0.0.

◆ OS_EXC_BUS_FAULT

#define OS_EXC_BUS_FAULT   5

Interrupt No. 5 :Bus fault.

◆ OS_EXC_DBG_MONITOR

#define OS_EXC_DBG_MONITOR   12

Interrupt No. 12 :Debug monitor.

◆ OS_EXC_HARD_FAULT

#define OS_EXC_HARD_FAULT   3

Interrupt No. 3 :(hard)fault.

◆ OS_EXC_MPU_FAULT

#define OS_EXC_MPU_FAULT   4

Interrupt No. 4 :MemManage fault.

◆ OS_EXC_NMI

#define OS_EXC_NMI   2

Interrupt No. 2 :Non-Maskable Interrupt.

◆ OS_EXC_PEND_SV

#define OS_EXC_PEND_SV   14

Interrupt No. 14 :PendSV.

◆ OS_EXC_RESET

#define OS_EXC_RESET   1

Interrupt No. 1 :reset.

◆ OS_EXC_SVC_CALL

#define OS_EXC_SVC_CALL   11

Interrupt No. 11 :SVCall.

◆ OS_EXC_USAGE_FAULT

#define OS_EXC_USAGE_FAULT   6

Interrupt No. 6 :Usage fault.

◆ OS_HWI_PRIO_HIGHEST [1/2]

#define OS_HWI_PRIO_HIGHEST   0

Highest priority of a hardware interrupt.

Highest priority of a hardware interrupt.This is an external parameter. The priority range is [OS_HWI_PRIO_HIGHEST, OS_HWI_PRIO_HIGHEST + LOSCFG_HWI_PRIO_LIMIT - 1].

◆ OS_HWI_PRIO_HIGHEST [2/2]

#define OS_HWI_PRIO_HIGHEST   0

Highest priority of a hardware interrupt.This is an external parameter. The priority range is [OS_HWI_PRIO_HIGHEST, OS_HWI_PRIO_HIGHEST + LOSCFG_HWI_PRIO_LIMIT - 1].

◆ OS_HWI_PRIO_LOWEST [1/2]

#define OS_HWI_PRIO_LOWEST   7

Lowest priority of a hardware interrupt.

This represents the interrupt priority range, the larger number, the lower priority, the interrupt processor is modified uniformly.

◆ OS_HWI_PRIO_LOWEST [2/2]

#define OS_HWI_PRIO_LOWEST   (LOSCFG_HWI_PRIO_LIMIT - 1)

This represents the interrupt priority range, the larger number, the lower priority, the interrupt processor is modified uniformly.

◆ OS_INT_ACTIVE

#define OS_INT_ACTIVE   IntActive()

It is used to check whether there are active interrupts or not.

参见
OS_INT_INACTIVE

◆ OS_INT_INACTIVE

#define OS_INT_INACTIVE   (!(OS_INT_ACTIVE))

Check whether there are active interrupts or not. The API returns a boolean value. True means no active interrupts on the current CPU. False means that there are active interrupts on the current CPU.

参见
OS_INT_ACTIVE

◆ OS_NVIC_AIRCR

#define OS_NVIC_AIRCR   0xE000ED0C

Application interrupt and reset control register

◆ OS_NVIC_AIRCR_PRIGROUP

#define OS_NVIC_AIRCR_PRIGROUP   7

AIRCR register priority group parameter .

◆ OS_NVIC_CLRENA_BASE

#define OS_NVIC_CLRENA_BASE   0xE000E180

Interrupt disable register for 0-31.

◆ OS_NVIC_EXCPRI_BASE

#define OS_NVIC_EXCPRI_BASE   0xE000ED18

System exception priority register.

◆ OS_NVIC_INT_ACT_BASE

#define OS_NVIC_INT_ACT_BASE   0xE000E300

interrupt activity status register

◆ OS_NVIC_INT_CTRL

#define OS_NVIC_INT_CTRL   0xE000ED04

Interrupt control and status register.

◆ OS_NVIC_PRI_BASE

#define OS_NVIC_PRI_BASE   0xE000E400

Interrupt Priority-Level Registers.

◆ OS_NVIC_SETENA_BASE

#define OS_NVIC_SETENA_BASE   0xE000E100

Interrupt enable register for 0-31.

◆ OS_NVIC_SETPEND_BASE

#define OS_NVIC_SETPEND_BASE   0xE000E200

interrupt pending register.

◆ OS_NVIC_VTOR

#define OS_NVIC_VTOR   0xE000ED08

Vector table offset register.

◆ OS_SYS_VECTOR_CNT

#define OS_SYS_VECTOR_CNT   16

Count of M-Core system interrupt vector.

◆ OS_SYSTICK_CONTROL_REG

#define OS_SYSTICK_CONTROL_REG   0xE000E010

SysTick control and status register.

类型定义说明

◆ HWI_ARG_T

typedef UINTPTR HWI_ARG_T

Define the type HWI_ARG_T for the parameter used for the hardware interrupt creation function. The function of this parameter varies among platforms.

◆ HWI_BOTTOM_HALF_FUNC

typedef void(* HWI_BOTTOM_HALF_FUNC) (void *)

Define the type of an interrupt bottom half function.

Description:
This definition is used to declare the type of an interrupt bottom half handling function. It will be used when calling LOS_HwiBhworkAdd.
注意
None.
参数
None.
返回值
None.
Dependency:
  • los_hwi.h: the header file that contains the API declaration.
参见
LOS_HwiBhworkAdd
自从
Huawei LiteOS 207.0.0

◆ HWI_HANDLE_T

Define the type HWI_HANDLE_T for a hardware interrupt number, the type is an unsigned int.

◆ HWI_IRQ_PARAM_S

typedef struct tagIrqParam HWI_IRQ_PARAM_S

The hardware interrupt parameter for LOS_HwiDelete and interrupt handler in LOS_HwiCreate.

◆ HWI_MODE_T

typedef UINT16 HWI_MODE_T

Define the type HWI_MODE_T for hardware interrupt mode configurations, the type is an unsigned short.

◆ HWI_PRIOR_T

Define the type HWI_PRIOR_T for a hardware interrupt priority, the type is an unsigned short.

◆ HWI_PROC_FUNC

typedef void(* HWI_PROC_FUNC) (void)

Define the type of a hardware interrupt handling function.

Description:
This definition is used to declare the type of a hardware interrupt handling function. It will be used when calling LOS_HwiCreate.
注意
None.
参数
None.
返回值
None.
Dependency:
  • los_hwi.h: the header file that contains the API declaration.
参见
LOS_HwiCreate
自从
Huawei LiteOS V100R001C00

函数说明

◆ LOS_HwiBhworkAdd()

UINT32 LOS_HwiBhworkAdd ( HWI_BOTTOM_HALF_FUNC  bhHandler,
void *  data 
)
extern

create a interrupt bottom half work.

Description:
This API is used to configure a bottom half work and register a interrupt bottom half handling function.
注意
The input data could be NULL if it's not necessary for bhHandler This function is defined only when LOSCFG_HWI_BOTTOM_HALF is defined.
参数
bhHandler[IN] Type HWI_BOTTOM_HALF_FUNC. Bottom half interrupt handler.
data[IN] Type VOID *. The input parameter of the interrupt bottom half handler.
返回值
LOS_ERRNO_HWI_PROC_FUNC_NULLNull hardware interrupt bottom half handling function.
LOS_ERRNO_HWI_NOT_INTERRUPT_CONTEXTNot in interrupt context
LOS_ERRNO_HWI_NO_MEMORYInsufficient memory for interrupt bottom half.
LOS_OKThe interrupt bottom half work is successfully registered.
Dependency:
  • los_hwi.h: the header file that contains the API declaration.
自从
Huawei LiteOS 207.0.0

◆ LOS_HwiClear()

UINT32 LOS_HwiClear ( HWI_HANDLE_T  hwiNum)
extern

clear interrupts.

Description:
Clear the status bit of the interrupt number corresponding to the interrupt controller.
注意
This function depends on the hardware implementation of the interrupt controller.
参数
hwiNum[IN] Type HWI_HANDLE_T. The hardware interrupt number.
返回值
LOS_ERRNO_HWI_NUM_INVALIDInvalid interrupt number.
LOS_ERRNO_HWI_PROC_FUNC_NULLNot supported by the interrupt controller.
LOS_OKThe interrupt is successfully cleared.
Dependency:
  • los_hwi.h: the header file that contains the API declaration.
自从
Huawei LiteOS V200R005C00

◆ LOS_HwiCreate()

UINT32 LOS_HwiCreate ( HWI_HANDLE_T  hwiNum,
HWI_PRIOR_T  hwiPrio,
HWI_MODE_T  hwiMode,
HWI_PROC_FUNC  hwiHandler,
HWI_IRQ_PARAM_S irqParam 
)
extern

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.
  • Before executing an interrupt on a platform, refer to the chip manual of the platform.
  • The parameter handler of this interface is a interrupt handler, it should be correct, otherwise, the system may be abnormal.
  • The input irqParam could be NULL, if not, it should be address which point to a struct HWI_IRQ_PARAM_S, the parameter pDenId and pName should be constant.
  • A smaller value indicates a higher interrupt priority, the interrupt processor is modified uniformly.
参数
hwiNum[IN] Type HWI_HANDLE_T. The hardware interrupt number. The value range is [OS_USER_HWI_MIN, OS_USER_HWI_MAX].
hwiPrio[IN] Type HWI_PRIOR_T. The hardware interrupt priority. The value range is [OS_HWI_PRIO_HIGHEST, OS_HWI_PRIO_LOWEST].
hwiMode[IN] Type HWI_MODE_T. The hardware interrupt mode.
hwiHandler[IN] Type HWI_PROC_FUNC. The interrupt handler used when a hardware interrupt is triggered.
irqParam[IN] Type HWI_IRQ_PARAM_S. The input parameter of the interrupt handler used when a hardware interrupt is triggered.
返回值
LOS_ERRNO_HWI_PROC_FUNC_NULLNull hardware interrupt handling function.
LOS_ERRNO_HWI_NUM_INVALIDInvalid interrupt number.
LOS_ERRNO_HWI_NO_MEMORYInsufficient memory for hardware interrupt creation.
LOS_ERRNO_HWI_ALREADY_CREATEDThe interrupt handler being created has already been created.
LOS_ERRNO_HWI_SHARED_ERRORThe interrupt can not be shared. The interrupt number has been registered as a non-shared interrupt, or a shared interrupt is specified to be created, but the device ID is empty.
LOS_ERRNO_HWI_NO_CPUP_MEMORYNo enough cpup control block resources for data record.
LOS_ERRNO_HWI_ARG_NOT_ENABLEDPassed non-NULL to irqParam and LOSCFG_HWI_WITH_ARG not enabled.
LOS_OKThe interrupt is successfully created.
Dependency:
  • los_hwi.h: the header file that contains the API declaration.
参见
LOS_HwiDelete
自从
Huawei LiteOS V100R001C00

◆ LOS_HwiDelete()

UINT32 LOS_HwiDelete ( HWI_HANDLE_T  hwiNum,
HWI_IRQ_PARAM_S irqParam 
)
extern

delete a hardware interrupt.

Description:
This API is used to delete a hardware interrupt.
注意
  • 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].
  • Before executing an interrupt on a platform, refer to the chip manual of the platform.
  • Do not call this API in interrupt handler, otherwise, invalid memory may be accessed in interrupt share mode.
参数
hwiNum[IN] Type HWI_HANDLE_T. The hardware interrupt number.
irqParam[IN] Type HWI_IRQ_PARAM_S *. ID of hardware interrupt which will base on when delete the hardware interrupt.
返回值
LOS_ERRNO_HWI_NUM_INVALIDInvalid interrupt number.
LOS_ERRNO_HWI_SHARED_ERRORThe interrupt number is a shared interrupt, but the device ID of the shared interrupt to be deleted is not specified.
LOS_ERRNO_HWI_HWINUM_UNCREATEThe interrupt corresponded to the hwiNum( the hardware interrupt number) or irqParam->pDevId(the interrupt device id) has not been created.
LOS_ERRNO_HWI_PROC_FUNC_NULLNot supported disable interrupt.
LOS_OKThe interrupt is successfully deleted.
Dependency:
  • los_hwi.h: the header file that contains the API declaration.
参见
LOS_HwiCreate
自从
Huawei LiteOS V100R001C00

◆ LOS_HwiDisable()

UINT32 LOS_HwiDisable ( HWI_HANDLE_T  hwiNum)
extern

Disable interrupts.

Description:
Disable the corresponding interrupt mask of the interrupt controller, so that the interrupt source can be sent to the CPU.
注意
This function depends on the hardware implementation of the interrupt controller.
参数
hwiNum[IN] Type HWI_HANDLE_T. The hardware interrupt number.
返回值
LOS_ERRNO_HWI_NUM_INVALIDInvalid interrupt number.
LOS_ERRNO_HWI_PROC_FUNC_NULLNot supported by the interrupt controller.
LOS_OKThe interrupt is successfully disabled.
Dependency:
  • los_hwi.h: the header file that contains the API declaration.
参见
LOS_HwiEnable
自从
Huawei LiteOS V200R005C00

◆ LOS_HwiEnable()

UINT32 LOS_HwiEnable ( HWI_HANDLE_T  hwiNum)
extern

Enable interrupts.

Description:
Enable the corresponding interrupt mask of the interrupt controller, so that the interrupt source can be sent to the CPU.
注意
This function depends on the hardware implementation of the interrupt controller.
参数
hwiNum[IN] Type HWI_HANDLE_T. The hardware interrupt number.
返回值
LOS_ERRNO_HWI_NUM_INVALIDInvalid interrupt number.
LOS_ERRNO_HWI_PROC_FUNC_NULLNot supported by the interrupt controller.
LOS_OKThe interrupt is successfully enabled.
Dependency:
  • los_hwi.h: the header file that contains the API declaration.
参见
LOS_HwiDisable
自从
Huawei LiteOS V200R005C00

◆ LOS_HwiRespCntGet()

UINT32 LOS_HwiRespCntGet ( HWI_HANDLE_T  hwiNum,
UINT32 respCount 
)
extern

Get the number of interrupt responses.

Description:
Get the number of responses to a specified interrupt.
注意
The number of interrupt responses is always changed, so this API just provides a reference value. The type of interrupt response is UINT32, which may cause data overflow.
参数
hwiNum[IN] Type HWI_HANDLE_T: hardware interrupt number.
respCount[OUT] Type UINT32 *: A pointer is used to store the number of interrupt responses.
返回值
LOS_ERRNO_HWI_PTR_NULLThe passed-in respCount value is NULL.
LOS_ERRNO_HWI_NUM_INVALIDInvalid interrupt number.
LOS_OKNumber of times that interrupt responses are successfully obtained.
Dependency:
  • los_hwi.h: the header file that contains the API declaration.
参见
None

◆ LOS_HwiSendIpi()

UINT32 LOS_HwiSendIpi ( HWI_HANDLE_T  hwiNum,
UINT32  cpuMask 
)
extern

Send inter-core interrupts to designated cores.

Description:
Send inter-core interrupts to designated cores.
注意
This function depends on the hardware implementation of the interrupt controller and CPU architecture, Only used in SMP architecture.
参数
hwiNum[IN] Type HWI_HANDLE_T: hardware interrupt number.
cpuMask[IN] Type UINT32: CPU number.
返回值
LOS_ERRNO_HWI_NUM_INVALIDInvalid interrupt number.
LOS_ERRNO_HWI_PROC_FUNC_NULLNot supported by the interrupt controller.
LOS_OKInter-core interrupt sent successfully.
Dependency:
  • los_hwi.h: the header file that contains the API declaration.
自从
Huawei LiteOS V200R005C00

◆ LOS_HwiSetAffinity()

UINT32 LOS_HwiSetAffinity ( HWI_HANDLE_T  hwiNum,
UINT32  cpuMask 
)
extern

Interrupt response specified CPU processing.

Description:
Interrupt response specified CPU processing.
注意
This function depends on the hardware implementation of the interrupt controller and CPU architecture, Only used in SMP architecture.
参数
hwiNum[IN] Type HWI_HANDLE_T. The hardware interrupt number.
cpuMask[IN] Type UINT32. The CPU number.
返回值
LOS_ERRNO_HWI_NUM_INVALIDInvalid interrupt number.
LOS_ERRNO_HWI_PROC_FUNC_NULLNot supported by the interrupt controller.
LOS_OKThe interrupt is successfully set affinity.
Dependency:
  • los_hwi.h: the header file that contains the API declaration.
自从
Huawei LiteOS V200R005C00

◆ LOS_HwiSetPriority()

UINT32 LOS_HwiSetPriority ( HWI_HANDLE_T  hwiNum,
HWI_PRIOR_T  priority 
)
extern

Set interrupts priority.

Description:
Set interrupts priority.
注意
This function depends on the hardware implementation of the interrupt controller and CPU architecture.
参数
hwiNum[IN] Type HWI_HANDLE_T: hardware interrupt number.
priority[IN] Type HWI_PRIOR_T: interrupt priority to be set.
返回值
LOS_ERRNO_HWI_NUM_INVALIDInvalid interrupt number.
LOS_ERRNO_HWI_PRIO_INVALIDInvalid interrupt priority.
LOS_ERRNO_HWI_PROC_FUNC_NULLNot supported by the interrupt controller.
LOS_OKThe interrupt is successfully set priority.
Dependency:
  • los_hwi.h: the header file that contains the API declaration.
参见
None
自从
Huawei LiteOS V200R005C00

◆ LOS_HwiTrigger()

UINT32 LOS_HwiTrigger ( HWI_HANDLE_T  hwiNum)
extern

Trigger interrupts.

Description:
The generation of external hardware interrupts is simulated by writing the relevant registers of the interrupt controller.
注意
This function depends on the hardware implementation of the interrupt controller.
参数
hwiNum[IN] Type HWI_HANDLE_T. The hardware interrupt number.
返回值
LOS_ERRNO_HWI_NUM_INVALIDInvalid interrupt number.
LOS_ERRNO_HWI_PROC_FUNC_NULLNot supported by the interrupt controller.
LOS_OKThe interrupt is successfully triggered.
Dependency:
  • los_hwi.h: the header file that contains the API declaration.
自从
Huawei LiteOS V200R005C00