App:Library:LVGL:docs:Porting:Tick interface

提供: robot-jp wiki
ナビゲーションに移動検索に移動

https://docs.lvgl.io/8.2/porting/tick.html

Tick interface

英文 自動翻訳

LVGL needs a system tick to know elapsed time for animations and other tasks.

You need to call the lv_tick_inc(tick_period) function periodically and provide the call period in milliseconds.

For example, lv_tick_inc(1) when calling every millisecond.

lv_tick_inc should be called in a higher priority routine than lv_task_handler() (e.g. in an interrupt) to precisely know the elapsed milliseconds even if the execution of lv_task_handler takes more time.


With FreeRTOS lv_tick_inc can be called in vApplicationTickHook.

On Linux based operating systems (e.g. on Raspberry Pi) lv_tick_inc can be called in a thread like below:

 void * tick_thread (void *args)
 {
       while(1) {
         usleep(5*1000);   /*Sleep for 5 millisecond*/
         lv_tick_inc(5);      /*Tell LVGL that 5 milliseconds were elapsed*/
     }
 }


LVGLには、アニメーションやその他のタスクの経過時間を知るためのシステムティックが必要です。


関数lv_tick_inc(tick_period)を定期的に呼び出し、呼び出し期間をミリ秒単位で指定する必要があります。

たとえば、1ミリ秒ごとに呼び出す場合lv_tick_inc(1)


経過したミリ秒を正確に知るには、lv_task_handlerの実行に時間がかかる場合でも、lv_tick_inclv_task_handler()より優先度の高いルーチン(割り込みなど)で呼び出す必要があります。


FreeRTOSを使用すると、lv_tick_incvApplicationTickHookで呼び出すことができます。

Linuxベースのオペレーティングシステム(Raspberry Piなど)では、lv_tick_incは次のようなスレッドで呼び出すことができます。

  void  *  tick_thread  void  * args 
  { 
        while 1  { 
          usleep 5 * 1000 ;    /*5ミリ秒スリープ*/ 
          lv_tick_inc 5 ;       /*5ミリ秒が経過したことをLVGLに通知します*/ 
      } 
  }
戻る : Previous


API

英文 自動翻訳

Provide access to the system tick with 1 millisecond resolution

Functions

uint32_t lv_tick_get(void)
Get the elapsed milliseconds since start up
Returns
the elapsed milliseconds
uint32_t lv_tick_elaps(uint32_t prev_tick)
Get the elapsed milliseconds since a previous time stamp
Parameters
prev_tick -- a previous time stamp (return value of lv_tick_get() )
Returns
the elapsed milliseconds since 'prev_tick'


1ミリ秒の分解能でsystem tickへのアクセスを提供します

Functions

uint32_t lv_tick_get(void)
起動してからの経過ミリ秒を取得します
戻り値
経過ミリ秒
uint32_t lv_tick_elaps(uint32_t prev_tick)
前のタイムスタンプから経過したミリ秒を取得します
パラメーター
prev_tick-以前のタイムスタンプ(lv_tick_get()の戻り値)
戻り値
'prev_tick'からの経過ミリ秒
戻る : Previous