同步操作将从 OpenHarmony/docs 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Defines the kernel adaptation layer (KAL), which provides compatible interfaces across different types of OpenHarmony devices.
Since:
1.0
Version:
1.0
Defines the kernel adaptation layer (KAL), which provides compatible interfaces across different types of OpenHarmony devices. |
KalTimerType { KAL_TIMER_ONCE = 0, KAL_TIMER_PERIODIC = 1 } |
|
KalErrCode { KAL_OK = 0, KAL_ERR_PARA = 1, KAL_ERR_INNER = 2, KAL_ERR_TIMER_STATE = 0x100 } |
KalThreadGetInfo (unsigned int threadId, ThreadInfo *info) |
|
KalDelayUs (unsigned int us) |
|
KalTimerCreate (KalTimerProc func, KalTimerType type, void *arg, unsigned int ticks) |
|
KalTimerStart (KalTimerId timerId) |
|
KalTimerChange (KalTimerId timerId, unsigned int ticks) |
|
KalTimerStop (KalTimerId timerId) |
|
KalTimerDelete (KalTimerId timerId) |
|
KalTimerIsRunning (KalTimerId timerId) |
|
KalTickToMs (unsigned int ticks) |
|
KalMsToTick (unsigned int millisec) |
|
KalGetMemInfo (MemInfo *pmemInfo) |
enum [KalErrCode](KAL.md#ga595e811b5dcad5dc834be507d6839c36)
Description:
Enumerates return values of the KAL function.
enum [KalTimerType](KAL.md#gacde4b0c553c297f66311b87c4bbbb27d)
Description:
Enumerates timer types.
void KalDelayUs (unsigned int us)
Description:
Delays a thread.
The delay unit is microsecond. The actual delay precision can reach only the tick level.
Parameters:
Indicates the number of microseconds to delay. The actual delay precision is one tick. |
[KalErrCode](KAL.md#ga595e811b5dcad5dc834be507d6839c36) KalGetMemInfo ([MemInfo](MemInfo.md) * pmemInfo)
Description:
Obtains memory information.
Parameters:
Returns:
Returns an enumerated value defined by KalErrCode, where KAL_OK indicates a success.
unsigned int KalMsToTick (unsigned int millisec)
Description:
Converts milliseconds into system ticks.
Parameters:
Returns:
Returns the system ticks generated.
unsigned int KalThreadGetInfo (unsigned int threadId, [ThreadInfo](ThreadInfo.md) * info )
Description:
Obtains thread information.
Parameters:
Indicates the pointer to the buffer for storing the obtained thread information. |
Returns:
Returns 0 if the thread information is obtained; returns a negative value otherwise.
unsigned int KalTickToMs (unsigned int ticks)
Description:
Converts system ticks into milliseconds.
Parameters:
Returns:
Returns the milliseconds generated.
[KalErrCode](KAL.md#ga595e811b5dcad5dc834be507d6839c36) KalTimerChange (KalTimerId timerId, unsigned int ticks )
Description:
Changes the duration of a timer.
The timer duration can be changed only before the timer is started.
Parameters:
Indicates the ID of the timer whose duration is to change, which is the value returned by KalTimerCreate. |
|
Returns:
Returns an enumerated value defined by KalErrCode, where KAL_OK indicates a success.
KalTimerId KalTimerCreate (KalTimerProc func, [KalTimerType](KAL.md#gacde4b0c553c297f66311b87c4bbbb27d) type, void * arg, unsigned int ticks )
Description:
Creates a timer.
Parameters:
Indicates the entry to timer callback. The callback is triggered when the timer expires. |
|
Indicates the pointer to the argument used in timer callback. |
|
Returns:
Returns the timer ID; returns NULL in the case of an error.
[KalErrCode](KAL.md#ga595e811b5dcad5dc834be507d6839c36) KalTimerDelete (KalTimerId timerId)
Description:
Deletes a timer.
Parameters:
Indicates the ID of the timer to delete, which is the value returned by KalTimerCreate. |
Returns:
Returns an enumerated value defined by KalErrCode, where KAL_OK indicates a success.
unsigned int KalTimerIsRunning (KalTimerId timerId)
Description:
Checks whether a timer is running.
Parameters:
Indicates the ID of the timer to check, which is the value returned by KalTimerCreate. |
Returns:
Returns 1 if the timer is running; returns 0 if the timer is not running or the input parameter is incorrect.
[KalErrCode](KAL.md#ga595e811b5dcad5dc834be507d6839c36) KalTimerStart (KalTimerId timerId)
Description:
Starts a timer.
Parameters:
Indicates the ID of the timer to start, which is the value returned by KalTimerCreate. |
Returns:
Returns an enumerated value defined by KalErrCode, where KAL_OK indicates a success.
[KalErrCode](KAL.md#ga595e811b5dcad5dc834be507d6839c36) KalTimerStop (KalTimerId timerId)
Description:
Stops a timer.
Parameters:
Indicates the ID of the timer to stop, which is the value returned by KalTimerCreate. |
Returns:
Returns an enumerated value defined by KalErrCode, where KAL_OK indicates a success.
unsigned int ThreadInfo::bottomOfStack
Description:
Thread stack bottom
unsigned int ThreadInfo::currUsed
Description:
Current stack space usage
unsigned int ThreadInfo::eventMask
Description:
Thread event mask
unsigned int ThreadInfo::eventStru[3]
Description:
Thread event
unsigned int MemInfo::free
Description:
Available space of the memory pool, in bytes
unsigned int MemInfo::freeLmp
Description:
Available space of the small memory pool, in bytes
unsigned int MemInfo::freeNodeNum
Description:
Number of available nodes in the memory pool
unsigned int ThreadInfo::id
Description:
Thread ID
unsigned int MemInfo::mallocFailCount
Description:
Number of memory allocation failures
unsigned int MemInfo::maxFreeNodeSize
Description:
Size of the largest available node in the memory pool, in bytes
unsigned int ThreadInfo::mepc
Description:
Current thread MEPC
unsigned int ThreadInfo::mstatus
Description:
Current thread status
char ThreadInfo::name[[KAL_TASK_NAME_LEN](KAL.md#ga5c36b53bd6e8cbdbcd79f702eda94fdc)]
Description:
Thread name
unsigned int ThreadInfo::overflowFlag
Description:
Thread stack overflow flag
unsigned int ThreadInfo::peakUsed
Description:
Peak stack space usage
unsigned int MemInfo::peekSize
Description:
Peak memory usage of the memory pool
unsigned short ThreadInfo::priority
Description:
Thread priority
unsigned int ThreadInfo::ra
Description:
Current thread RA
unsigned int ThreadInfo::sp
Description:
Thread stack pointer
unsigned int ThreadInfo::stackSize
Description:
Thread stack size
unsigned short ThreadInfo::status
Description:
Thread status
void* ThreadInfo::taskMutex
Description:
Thread mutex
void* ThreadInfo::taskSem
Description:
Thread semaphore
unsigned int ThreadInfo::topOfStack
Description:
Thread stack top
unsigned int MemInfo::total
Description:
Total space of the memory pool, in bytes
unsigned int MemInfo::totalLmp
Description:
Total space of the small memory pool, in bytes
unsigned int ThreadInfo::tp
Description:
Current thread TP
unsigned int MemInfo::used
Description:
Used space of the memory pool, in bytes
unsigned int MemInfo::usedLmp
Description:
Used space of the small memory pool, in bytes
unsigned int MemInfo::usedNodeNum
Description:
Number of used nodes in the memory pool
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。