Lines Matching +full:sync +full:- +full:mode
5 * SPDX-License-Identifier: Apache-2.0
65 return &mb_font[' ' - MB_FONT_START]; in get_font()
68 return &mb_font[ch - MB_FONT_START]; in get_font()
91 if (disp->msb) { in update_content()
93 tmp_img.row[i] = flip_pixels(img->row[i]); in update_content()
96 ret = display_write(disp->lm_dev, 0, 0, &buf_desc, &tmp_img); in update_content()
98 ret = display_write(disp->lm_dev, 0, 0, &buf_desc, img); in update_content()
106 LOG_DBG("Image duration %d", disp->duration); in update_content()
107 if (disp->duration != SYS_FOREVER_MS) { in update_content()
108 k_work_reschedule(&disp->dwork, K_MSEC(disp->duration)); in update_content()
118 ret = display_blanking_off(disp->lm_dev); in start_image()
131 disp->str = NULL; in reset_display()
132 disp->cur_img = 0U; in reset_display()
133 disp->img = NULL; in reset_display()
134 disp->img_count = 0U; in reset_display()
135 disp->scroll = SCROLL_OFF; in reset_display()
137 ret = display_blanking_on(disp->lm_dev); in reset_display()
147 if (disp->scroll && disp->first) { in current_img()
151 if (disp->text) { in current_img()
152 return get_font(disp->str[disp->cur_img]); in current_img()
154 return &disp->img[disp->cur_img]; in current_img()
160 if (disp->text) { in next_img()
161 if (disp->first) { in next_img()
162 return get_font(disp->str[0]); in next_img()
163 } else if (disp->str[disp->cur_img]) { in next_img()
164 return get_font(disp->str[disp->cur_img + 1]); in next_img()
169 if (disp->first) { in next_img()
170 return &disp->img[0]; in next_img()
171 } else if (disp->cur_img < (disp->img_count - 1)) { in next_img()
172 return &disp->img[disp->cur_img + 1]; in next_img()
181 if (disp->text) { in last_frame()
182 return (disp->str[disp->cur_img] == '\0'); in last_frame()
184 return (disp->cur_img >= disp->img_count); in last_frame()
190 return MB_DISP_XRES + disp->img_sep; in scroll_steps()
195 if (disp->scroll < scroll_steps(disp)) { in update_scroll()
202 img.row[i] = ((i1->row[i] >> disp->scroll) | in update_scroll()
203 (i2->row[i] << (scroll_steps(disp) - in update_scroll()
204 disp->scroll))); in update_scroll()
207 disp->scroll++; in update_scroll()
210 if (disp->first) { in update_scroll()
211 disp->first = 0U; in update_scroll()
213 disp->cur_img++; in update_scroll()
217 if (!disp->loop) { in update_scroll()
221 disp->cur_img = 0U; in update_scroll()
222 disp->first = 1U; in update_scroll()
225 disp->scroll = SCROLL_START; in update_scroll()
232 disp->cur_img++; in update_image()
235 if (!disp->loop) { in update_image()
239 disp->cur_img = 0U; in update_image()
251 if (disp->scroll) { in update_display_work()
264 disp->duration = duration / scroll_steps(disp); in start_scroll()
266 disp->duration = SCROLL_DEFAULT_DURATION_MS; in start_scroll()
269 disp->scroll = SCROLL_START; in start_scroll()
270 disp->first = 1U; in start_scroll()
271 disp->cur_img = 0U; in start_scroll()
277 disp->duration = duration; in start_single()
279 if (disp->text) { in start_single()
280 return start_image(disp, get_font(disp->str[0])); in start_single()
282 return start_image(disp, disp->img); in start_single()
288 struct k_work_sync sync; in mb_display_stop() local
291 k_work_cancel_delayable_sync(&disp->dwork, &sync); in mb_display_stop()
297 void mb_display_image(struct mb_display *disp, uint32_t mode, int32_t duration, in mb_display_image() argument
306 disp->text = 0U; in mb_display_image()
307 disp->img_count = img_count; in mb_display_image()
308 disp->img = img; in mb_display_image()
309 disp->img_sep = 0U; in mb_display_image()
310 disp->cur_img = 0U; in mb_display_image()
311 disp->loop = !!(mode & MB_DISPLAY_FLAG_LOOP); in mb_display_image()
313 switch (mode & MODE_MASK) { in mb_display_image()
317 __ASSERT(ret == 0, "Failed to start single mode"); in mb_display_image()
321 __ASSERT(ret == 0, "Failed to start scroll mode"); in mb_display_image()
324 __ASSERT(0, "Invalid display mode"); in mb_display_image()
328 void mb_display_print(struct mb_display *disp, uint32_t mode, in mb_display_print() argument
337 vsnprintk(disp->str_buf, sizeof(disp->str_buf), fmt, ap); in mb_display_print()
340 if (disp->str_buf[0] == '\0') { in mb_display_print()
344 disp->str = disp->str_buf; in mb_display_print()
345 disp->text = 1U; in mb_display_print()
346 disp->img_sep = 1U; in mb_display_print()
347 disp->cur_img = 0U; in mb_display_print()
348 disp->loop = !!(mode & MB_DISPLAY_FLAG_LOOP); in mb_display_print()
350 switch (mode & MODE_MASK) { in mb_display_print()
354 __ASSERT(ret == 0, "Failed to start scroll mode"); in mb_display_print()
358 __ASSERT(ret == 0, "Failed to start single mode"); in mb_display_print()
361 __ASSERT(0, "Invalid display mode"); in mb_display_print()
370 display_get_capabilities(disp->lm_dev, &caps); in mb_display_init()
374 return -ENOTSUP; in mb_display_init()
378 disp->msb = 1U; in mb_display_init()
381 ret = display_set_brightness(disp->lm_dev, 0xFF); in mb_display_init()
387 k_work_init_delayable(&disp->dwork, update_display_work); in mb_display_init()
405 return -ENODEV; in mb_display_init_on_boot()