Lines Matching refs:monkey

70     lv_monkey_t * monkey = lv_mem_alloc(sizeof(lv_monkey_t));  in lv_monkey_create()  local
71 LV_ASSERT_MALLOC(monkey); in lv_monkey_create()
73 lv_memset_00(monkey, sizeof(lv_monkey_t)); in lv_monkey_create()
75 monkey->config = *config; in lv_monkey_create()
77 lv_indev_drv_t * drv = &monkey->indev_drv; in lv_monkey_create()
81 drv->user_data = monkey; in lv_monkey_create()
83 monkey->timer = lv_timer_create(lv_monkey_timer_cb, monkey->config.period_range.min, monkey); in lv_monkey_create()
84 lv_timer_pause(monkey->timer); in lv_monkey_create()
86 monkey->indev = lv_indev_drv_register(drv); in lv_monkey_create()
88 return monkey; in lv_monkey_create()
91 lv_indev_t * lv_monkey_get_indev(lv_monkey_t * monkey) in lv_monkey_get_indev() argument
93 LV_ASSERT_NULL(monkey); in lv_monkey_get_indev()
94 return monkey->indev; in lv_monkey_get_indev()
97 void lv_monkey_set_enable(lv_monkey_t * monkey, bool en) in lv_monkey_set_enable() argument
99 LV_ASSERT_NULL(monkey); in lv_monkey_set_enable()
100 en ? lv_timer_resume(monkey->timer) : lv_timer_pause(monkey->timer); in lv_monkey_set_enable()
103 bool lv_monkey_get_enable(lv_monkey_t * monkey) in lv_monkey_get_enable() argument
105 LV_ASSERT_NULL(monkey); in lv_monkey_get_enable()
106 return !monkey->timer->paused; in lv_monkey_get_enable()
111 void lv_monkey_set_user_data(lv_monkey_t * monkey, void * user_data) in lv_monkey_set_user_data() argument
113 LV_ASSERT_NULL(monkey); in lv_monkey_set_user_data()
114 monkey->user_data = user_data; in lv_monkey_set_user_data()
117 void * lv_monkey_get_user_data(lv_monkey_t * monkey) in lv_monkey_get_user_data() argument
119 LV_ASSERT_NULL(monkey); in lv_monkey_get_user_data()
120 return monkey->user_data; in lv_monkey_get_user_data()
125 void lv_monkey_del(lv_monkey_t * monkey) in lv_monkey_del() argument
127 LV_ASSERT_NULL(monkey); in lv_monkey_del()
129 lv_timer_del(monkey->timer); in lv_monkey_del()
130 lv_indev_delete(monkey->indev); in lv_monkey_del()
131 lv_mem_free(monkey); in lv_monkey_del()
140 lv_monkey_t * monkey = indev_drv->user_data; in lv_monkey_read_cb() local
142 data->btn_id = monkey->indev_data.btn_id; in lv_monkey_read_cb()
143 data->point = monkey->indev_data.point; in lv_monkey_read_cb()
144 data->enc_diff = monkey->indev_data.enc_diff; in lv_monkey_read_cb()
145 data->state = monkey->indev_data.state; in lv_monkey_read_cb()
159 lv_monkey_t * monkey = timer->user_data; in lv_monkey_timer_cb() local
160 lv_indev_data_t * data = &monkey->indev_data; in lv_monkey_timer_cb()
162 switch(monkey->indev_drv.type) { in lv_monkey_timer_cb()
168 …data->enc_diff = (int16_t)lv_monkey_random(monkey->config.input_range.min, monkey->config.input_ra… in lv_monkey_timer_cb()
171 …data->btn_id = (uint32_t)lv_monkey_random(monkey->config.input_range.min, monkey->config.input_ran… in lv_monkey_timer_cb()
184 …lv_timer_set_period(monkey->timer, lv_monkey_random(monkey->config.period_range.min, monkey->confi… in lv_monkey_timer_cb()