|
WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
|

结构体 | |
| struct | tagIrqParam |
类型定义 | |
| 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. | |
| #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.
| #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.
| #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.
| #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.
| #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.
| #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.
| #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.
| #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.
| #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.
| #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.
| #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.
| #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.
| #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.
| #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.
| #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.
| #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.
| #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.
| #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.
| #define OS_EXC_BUS_FAULT 5 |
Interrupt No. 5 :Bus fault.
| #define OS_EXC_DBG_MONITOR 12 |
Interrupt No. 12 :Debug monitor.
| #define OS_EXC_HARD_FAULT 3 |
Interrupt No. 3 :(hard)fault.
| #define OS_EXC_MPU_FAULT 4 |
Interrupt No. 4 :MemManage fault.
| #define OS_EXC_NMI 2 |
Interrupt No. 2 :Non-Maskable Interrupt.
| #define OS_EXC_PEND_SV 14 |
Interrupt No. 14 :PendSV.
| #define OS_EXC_RESET 1 |
Interrupt No. 1 :reset.
| #define OS_EXC_SVC_CALL 11 |
Interrupt No. 11 :SVCall.
| #define OS_EXC_USAGE_FAULT 6 |
Interrupt No. 6 :Usage fault.
| #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].
| #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].
| #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.
| #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.
| #define OS_INT_ACTIVE IntActive() |
It is used to check whether there are active interrupts or not.
| #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.
| #define OS_NVIC_AIRCR 0xE000ED0C |
Application interrupt and reset control register
| #define OS_NVIC_AIRCR_PRIGROUP 7 |
AIRCR register priority group parameter .
| #define OS_NVIC_CLRENA_BASE 0xE000E180 |
Interrupt disable register for 0-31.
| #define OS_NVIC_EXCPRI_BASE 0xE000ED18 |
System exception priority register.
| #define OS_NVIC_INT_ACT_BASE 0xE000E300 |
interrupt activity status register
| #define OS_NVIC_INT_CTRL 0xE000ED04 |
Interrupt control and status register.
| #define OS_NVIC_PRI_BASE 0xE000E400 |
Interrupt Priority-Level Registers.
| #define OS_NVIC_SETENA_BASE 0xE000E100 |
Interrupt enable register for 0-31.
| #define OS_NVIC_SETPEND_BASE 0xE000E200 |
interrupt pending register.
| #define OS_NVIC_VTOR 0xE000ED08 |
Vector table offset register.
| #define OS_SYS_VECTOR_CNT 16 |
Count of M-Core system interrupt vector.
| #define OS_SYSTICK_CONTROL_REG 0xE000E010 |
SysTick control and status register.
Define the type HWI_ARG_T for the parameter used for the hardware interrupt creation function. The function of this parameter varies among platforms.
| typedef void(* HWI_BOTTOM_HALF_FUNC) (void *) |
Define the type of an interrupt bottom half function.
| None. |
| None. |
| typedef UINT32 HWI_HANDLE_T |
Define the type HWI_HANDLE_T for a hardware interrupt number, the type is an unsigned int.
| typedef struct tagIrqParam HWI_IRQ_PARAM_S |
The hardware interrupt parameter for LOS_HwiDelete and interrupt handler in LOS_HwiCreate.
| typedef UINT16 HWI_MODE_T |
Define the type HWI_MODE_T for hardware interrupt mode configurations, the type is an unsigned short.
| typedef UINT16 HWI_PRIOR_T |
Define the type HWI_PRIOR_T for a hardware interrupt priority, the type is an unsigned short.
| typedef void(* HWI_PROC_FUNC) (void) |
Define the type of a hardware interrupt handling function.
| None. |
| None. |
|
extern |
create a interrupt bottom half work.
| 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_NULL | Null hardware interrupt bottom half handling function. |
| LOS_ERRNO_HWI_NOT_INTERRUPT_CONTEXT | Not in interrupt context |
| LOS_ERRNO_HWI_NO_MEMORY | Insufficient memory for interrupt bottom half. |
| LOS_OK | The interrupt bottom half work is successfully registered. |
|
extern |
clear interrupts.
| hwiNum | [IN] Type HWI_HANDLE_T. The hardware interrupt number. |
| LOS_ERRNO_HWI_NUM_INVALID | Invalid interrupt number. |
| LOS_ERRNO_HWI_PROC_FUNC_NULL | Not supported by the interrupt controller. |
| LOS_OK | The interrupt is successfully cleared. |
|
extern |
Create a hardware interrupt.
| 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_NULL | Null hardware interrupt handling function. |
| LOS_ERRNO_HWI_NUM_INVALID | Invalid interrupt number. |
| LOS_ERRNO_HWI_NO_MEMORY | Insufficient memory for hardware interrupt creation. |
| LOS_ERRNO_HWI_ALREADY_CREATED | The interrupt handler being created has already been created. |
| LOS_ERRNO_HWI_SHARED_ERROR | The 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_MEMORY | No enough cpup control block resources for data record. |
| LOS_ERRNO_HWI_ARG_NOT_ENABLED | Passed non-NULL to irqParam and LOSCFG_HWI_WITH_ARG not enabled. |
| LOS_OK | The interrupt is successfully created. |
|
extern |
delete a hardware interrupt.
| 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_INVALID | Invalid interrupt number. |
| LOS_ERRNO_HWI_SHARED_ERROR | The interrupt number is a shared interrupt, but the device ID of the shared interrupt to be deleted is not specified. |
| LOS_ERRNO_HWI_HWINUM_UNCREATE | The 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_NULL | Not supported disable interrupt. |
| LOS_OK | The interrupt is successfully deleted. |
|
extern |
Disable interrupts.
| hwiNum | [IN] Type HWI_HANDLE_T. The hardware interrupt number. |
| LOS_ERRNO_HWI_NUM_INVALID | Invalid interrupt number. |
| LOS_ERRNO_HWI_PROC_FUNC_NULL | Not supported by the interrupt controller. |
| LOS_OK | The interrupt is successfully disabled. |
|
extern |
Enable interrupts.
| hwiNum | [IN] Type HWI_HANDLE_T. The hardware interrupt number. |
| LOS_ERRNO_HWI_NUM_INVALID | Invalid interrupt number. |
| LOS_ERRNO_HWI_PROC_FUNC_NULL | Not supported by the interrupt controller. |
| LOS_OK | The interrupt is successfully enabled. |
|
extern |
Get the number of interrupt responses.
| 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_NULL | The passed-in respCount value is NULL. |
| LOS_ERRNO_HWI_NUM_INVALID | Invalid interrupt number. |
| LOS_OK | Number of times that interrupt responses are successfully obtained. |
|
extern |
Send inter-core interrupts to designated cores.
| hwiNum | [IN] Type HWI_HANDLE_T: hardware interrupt number. |
| cpuMask | [IN] Type UINT32: CPU number. |
| LOS_ERRNO_HWI_NUM_INVALID | Invalid interrupt number. |
| LOS_ERRNO_HWI_PROC_FUNC_NULL | Not supported by the interrupt controller. |
| LOS_OK | Inter-core interrupt sent successfully. |
|
extern |
Interrupt response specified CPU processing.
| hwiNum | [IN] Type HWI_HANDLE_T. The hardware interrupt number. |
| cpuMask | [IN] Type UINT32. The CPU number. |
| LOS_ERRNO_HWI_NUM_INVALID | Invalid interrupt number. |
| LOS_ERRNO_HWI_PROC_FUNC_NULL | Not supported by the interrupt controller. |
| LOS_OK | The interrupt is successfully set affinity. |
|
extern |
Set interrupts priority.
| hwiNum | [IN] Type HWI_HANDLE_T: hardware interrupt number. |
| priority | [IN] Type HWI_PRIOR_T: interrupt priority to be set. |
| LOS_ERRNO_HWI_NUM_INVALID | Invalid interrupt number. |
| LOS_ERRNO_HWI_PRIO_INVALID | Invalid interrupt priority. |
| LOS_ERRNO_HWI_PROC_FUNC_NULL | Not supported by the interrupt controller. |
| LOS_OK | The interrupt is successfully set priority. |
|
extern |
Trigger interrupts.
| hwiNum | [IN] Type HWI_HANDLE_T. The hardware interrupt number. |
| LOS_ERRNO_HWI_NUM_INVALID | Invalid interrupt number. |
| LOS_ERRNO_HWI_PROC_FUNC_NULL | Not supported by the interrupt controller. |
| LOS_OK | The interrupt is successfully triggered. |