「App:Library:LVGL:docs:Others:Monkey」の版間の差分
提供: robot-jp wiki
ナビゲーションに移動検索に移動31行目: | 31行目: | ||
== Example == | == Example == | ||
− | + | {| class="wikitable" | |
+ | !英文 | ||
+ | !自動翻訳 | ||
+ | |- | ||
+ | | | ||
=== Touchpad monkey example === | === Touchpad monkey example === | ||
− | |||
+ | [[file:LVGL docs others gridnav 03.png|lin=https://docs.lvgl.io/8.2/others/monkey.html]] | ||
+ | | | ||
+ | |- | ||
=== Encoder monkey example === | === Encoder monkey example === | ||
+ | [[file:LVGL docs others gridnav 03.png|lin=https://docs.lvgl.io/8.2/others/monkey.html]] | ||
+ | | | ||
+ | |- | ||
=== Button monkey example === | === Button monkey example === | ||
+ | |||
+ | [[file:LVGL docs others gridnav 03.png|lin=https://docs.lvgl.io/8.2/others/monkey.html]] | ||
+ | | | ||
+ | |} | ||
== API == | == API == |
2022年6月22日 (水) 20:47時点における版
https://docs.lvgl.io/8.2/others/monkey.html
英文 | 自動翻訳 |
---|---|
Monkey
A simple monkey test. Use random input to stress test the application.
Usage
Enable LV_USE_MONKEY
in lv_conf.h
.
First configure monkey, use lv_monkey_config_t
to define the configuration structure, set the type
(check input devices for the supported types), and then set the range of period_range
and input_range
, the monkey will output random operations at random times within this range. Call lv_monkey_create
to create monkey. Finally call lv_monkey_set_enable(monkey, true)
to enable monkey.
If you want to pause the monkey, call lv_monkey_set_enable(monkey, false)
. To delete the monkey, call lv_monkey_del(monkey)
.
Note that input_range
has different meanings in different type
:
LV_INDEV_TYPE_POINTER
No effect, click randomly within the pixels of the screen resolution.LV_INDEV_TYPE_ENCODER
The minimum and maximum values ofenc_diff
.LV_INDEV_TYPE_BUTTON
The minimum and maximum values ofbtn_id
. Uselv_monkey_get_indev()
to get the input device, and uselv_indev_set_button_points()
to map the key ID to the coordinates.LV_INDEV_TYPE_KEYPAD
No effect, Send random Keys.
Example
Encoder monkey example
Button monkey example
英文 | 自動翻訳 |
---|---|
Touchpad monkey example |
|
API
Typedefs
- typedef struct _lv_monkey lv_monkey_t[1]
Functions
- void lv_monkey_c[2]onfig_init(lv_monkey_config_t *config)[3]
- Initialize a monkey config with default values
- [4]Parameters
- config -- pointer to 'lv_monkey_config_t' variable to initialize
- lv_monkey_t *lv_monkey_create(const lv_monkey_config_t *config)[5]
- Create monkey for test
- Parameters
- config -- pointer t[6]o 'lv_monkey_config_t' variable
- Returns
- pointer to the created monkey
- lv_indev_t *lv_monkey_get_indev(lv_monkey_t *monkey)[7]
- Get monkey input device
- Parameters
- monkey [8]-- pointer to a monkey
- Returns
- pointer to the input device
- void lv_monkey_set_enable(lv_monkey_t *monkey, bool en)[9]
- Enable monkey
- Parameters
-
- monkey -- pointer [10]to a monkey
- en -- set to true to enable
- bool lv_monkey_get_enable(lv_monkey_t *monkey)[11]
- Get whether monkey is enabled
- Parameter[12]s
- monkey -- pointer to a monkey
- Returns
- return true if monkey enabled
- void lv_monkey_set_user_data(lv_monkey_t *monkey, void *user_data)[13]
- Set the user_data field of the monkey
- Parameters
-
- monke[14]y -- pointer to a monkey
- user_data -- pointer to the new user_data.
- void *lv_monkey_get_user_data(lv_monkey_t *monkey)[15]
- Get the user_data field of the monkey
- Param[16]eters
- monkey -- pointer to a monkey
- Returns
- the pointer to the user_data of the monkey
- void lv_monkey_del(lv_monkey_t *monkey)[17]
- Delete monkey
- Parameters
- monk[18]ey -- pointer to monkey
- struct lv_monkey_config_t[19]
- Public Members