CMSIS-RTOS2 文檔翻譯 之 參考(RTX5 特定的 API 之 事件功能(定時器函數))

定時器函數

事件功能

定時器函數生成的事件。更多...

函數

void  EvrRtxTimerError (osTimerId_t timer_id, int32_t status)
  計時器錯誤事件(錯誤)更多...
 
void  EvrRtxTimerCallback (osTimerFunc_t func, void *argument)
  定時器回調函數(Op)上的事件 更多...
 
void  EvrRtxTimerNew (osTimerFunc_t func, osTimerType_t type, void *argument, const osTimerAttr_t *attr)
  計時器上的事件創建和初始化(API)更多...
 
void  EvrRtxTimerCreated (osTimerId_t timer_id, const char *name)
  成功計時器創建活動(Op)更多...
 
void  EvrRtxTimerGetName (osTimerId_t timer_id, const char *name)
  計時器名稱檢索(API)上的事件 更多...
 
void  EvrRtxTimerStart (osTimerId_t timer_id, uint32_t ticks)
  計時器啓動事件(API)更多...
 
void  EvrRtxTimerStarted (osTimerId_t timer_id)
  成功定時器啓動事件(Op)更多......
 
void  EvrRtxTimerStop (osTimerId_t timer_id)
  計時器停止事件(API)更多...
 
void  EvrRtxTimerStopped (osTimerId_t timer_id)
  成功定時器停止事件(Op)更多...
 
void  EvrRtxTimerIsRunning (osTimerId_t timer_id, uint32_t running)
  計時器運行狀態檢查(API)上的事件 更多...
 
void  EvrRtxTimerDelete (osTimerId_t timer_id)
  計時器刪除事件(API)更多...
 
void  EvrRtxTimerDestroyed (osTimerId_t timer_id)
  成功定時刪除事件(Op)更多...
 

 

描述

函數文檔

void EvrRtxTimerError ( osTimerId_t  timer_id,
    int32_t  status 
  )    

參數

[in] timer_id osTimerNew 獲取的計時器 ID,ID 未知時爲 NULL。
[in] status 擴展執行狀態。

當定時器管理例程由於錯誤而完成執行時,會生成 TimerError 事件。

status 參數指示執行狀態,可以是 osStatus_t 代碼之一,也可以是下表中彙總的擴展執行狀態代碼之一。

擴展狀態代碼 描述
osRtxErrorKernelNotReady 內核調度程序未處於就緒狀態。
osRtxErrorKernelNotRunning 內核調度程序沒有執行 - 沒有正在運行的線程。
osRtxErrorInvalidControlBlock 指定了具有無效對齊或大小的對象控制塊。
osRtxErrorInvalidDataMemory 指定了無效對齊或大小的對象數據存儲器。
osRtxErrorInvalidThreadStack 指定了無效對齊或大小的線程堆棧內存。
osRtxErrorInvalidPriority 指定了無效的線程優先級。
osRtxErrorThreadNotJoinable 指定的線程不可連接。
osRtxErrorMutexNotOwned 指定的互斥鎖不歸當前運行的線程所有。
osRtxErrorMutexNotLocked 指定的互斥鎖未鎖定。
osRtxErrorMutexLockLimit 達到的最大遞歸互斥鎖數。
osRtxErrorSemaphoreCountLimit 達到了信號量計數限制。
osRtxErrorTZ_InitContext_S 安全上下文內存系統初始化失敗
osRtxErrorTZ_AllocContext_S 安全上下文內存分配失敗。
osRtxErrorTZ_FreeContext_S 安全上下文內存釋放失敗。
osRtxErrorTZ_LoadContext_S 安全上下文加載失敗。
osRtxErrorTZ_SaveContext_S 安全上下文保存失敗。

事件記錄器中的值顯示:

  • timer_id : 計時器 ID。
  • status : 執行狀態代碼。

 

void EvrRtxTimerCallback ( osTimerFunc_t  func,
    void *  argument 
  )    

參數

[in] func 計時器回調函數的起始地址。
[in] argument 定時器回調函數的參數。

調用定時器回調函數時會生成 TimerCallback 事件。

事件記錄器中的值顯示:

  • func : 計時器回調函數的起始地址。
  • argument : 定時器回調函數的參數的內存地址。

 

void EvrRtxTimerNew ( osTimerFunc_t  func,
    osTimerType_t  type,
    void *  argument,
    const osTimerAttr_t attr 
  )    

參數

[in] func 計時器回調函數的起始地址。
[in] type osTimerOnce 用於一次性或 osTimerPeriodic 用於定期行爲。
[in] argument 定時器回調函數的參數。
[in] attr 計時器屬性。

調用函數 osTimerNew 時會生成事件 TimerNew

事件記錄器中的值顯示:

  • func : 計時器回調函數的起始地址。
  • type : 計時器類型:用於一次性的 osTimerOnce 或用於週期性行爲的 osTimerPeriodic。
  • argument : 定時器回調函數的參數的內存地址。
  • attr : 定時器屬性的內存地址,如果未指定,則爲 0。

如果在 API 調用中提供了計時器屬性,則它們也會在事件記錄器中詳細說明。

 

void EvrRtxTimerCreated ( osTimerId_t  timer_id,
    const char *  name 
  )    

參數

[in] timer_id osTimerNew 獲取的計時器 ID。
[in] name 指向計時器對象名稱的指針

當函數 osTimerNew 成功創建計時器對象時,將生成事件 TimerCreated

事件記錄器中的值顯示:

  • timer_id : 計時器 ID。

 

void EvrRtxTimerGetName ( osTimerId_t  timer_id,
    const char *  name 
  )    

參數

[in] timer_id osTimerNew 獲取的計時器 ID。
[in] name 指向計時器對象名稱的指針

調用函數 osTimerGetName 並且其執行結果已知時,將生成事件 TimerGetName

事件記錄器中的值顯示:

  • timer_id : 計時器 ID。
  • name : 檢索名稱字符串的內存地址(如果發生故障,則爲 0)。

 

void EvrRtxTimerStart ( osTimerId_t  timer_id,
    uint32_t  ticks 
  )    

參數

[in] timer_id osTimerNew 獲取的計時器 ID。
[in] ticks 時間滴答計時器的值。

調用函數 osTimerStart 時會生成事件 TimerStart

事件記錄器中的值顯示:

  • timer_id : 計時器 ID。
  • ticks : 時間滴答計時器的值。

 

void EvrRtxTimerStarted ( osTimerId_t  timer_id )  

參數

[in] timer_id osTimerNew 獲取的計時器 ID。

當函數 osTimerStart 成功啓動或重新啓動計時器操作時,將生成事件 TimerStarted

事件記錄器中的值顯示:

  • timer_id : 計時器 ID。

 

void EvrRtxTimerStop ( osTimerId_t  timer_id )  

參數

[in] timer_id osTimerNew 獲取的計時器 ID。

調用函數 osTimerStop 時會生成 TimerStop 事件。

事件記錄器中的值顯示:

  • timer_id : 計時器 ID。

 

void EvrRtxTimerStopped ( osTimerId_t  timer_id )  

參數

[in] timer_id osTimerNew 獲取的計時器 ID。

當函數 osTimerStop 成功停止計時器操作時,將生成 TimerStopped 事件。

事件記錄器中的值顯示:

  • timer_id : 計時器 ID。

 

void EvrRtxTimerIsRunning ( osTimerId_t  timer_id,
    uint32_t  running 
  )    

參數

[in] timer_id osTimerNew 獲取的計時器 ID。
[in] running 運行狀態:0 未運行,1 運行。

調用函數 osTimerIsRunning 並且其執行結果已知時,將生成事件 TimerIsRunning

事件記錄器中的值顯示:

  • timer_id : 計時器 ID。
  • running : 定時器運行狀態:0 未運行,1 運行。

 

void EvrRtxTimerDelete ( osTimerId_t  timer_id )  

參數

[in] timer_id osTimerNew 獲取的計時器 ID。

調用函數 osTimerDelete 時會生成事件 TimerDelete

事件記錄器中的值顯示:

  • timer_id : 計時器 ID。

 

void EvrRtxTimerDestroyed ( osTimerId_t  timer_id )  

參數

[in] timer_id osTimerNew 獲取的計時器 ID。

當函數 osTimerDelete 成功刪除計時器對象時,將生成 TimerDestroyed 事件。

事件記錄器中的值顯示:

  • timer_id : 計時器 ID。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章