de_device.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright (c) 2020 Actions Technology Co., Ltd
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef ZEPHYR_DRIVERS_DISPLAY_ENGINE_DE_DEVICE_H_
  7. #define ZEPHYR_DRIVERS_DISPLAY_ENGINE_DE_DEVICE_H_
  8. #include <kernel.h>
  9. #include <drivers/display/display_engine.h>
  10. struct de_data {
  11. int open_count;
  12. /* For display */
  13. uint32_t display_format; /* enum display_pixel_format */
  14. uint8_t display_bytes_per_pixel;
  15. uint8_t display_sync_en;
  16. uint8_t op_mode; /* enum display_engine_mode_type */
  17. display_engine_prepare_display_t prepare_fn;
  18. void *prepare_fn_arg;
  19. display_engine_start_display_t start_fn;
  20. void *start_fn_arg;
  21. int cmd_num; /* number of commands not completed yet */
  22. int cmd_status;
  23. sys_snode_t *cmd_node; /* current command */
  24. sys_slist_t cmd_list; /* normal priority command list */
  25. #ifdef CONFIG_DISPLAY_ENGINE_HIHG_PRIO_INSTANCE
  26. sys_slist_t high_cmd_list; /* high priority command list */
  27. #endif
  28. uint8_t preconfiged : 1; /* regs are pre-configured ? */
  29. uint8_t waiting : 1; /* waiting on wait_sem ? */
  30. struct k_sem wait_sem;
  31. struct k_mutex mutex;
  32. struct k_work_delayable timeout_work;
  33. };
  34. extern const struct display_engine_driver_api de_drv_api;
  35. extern struct de_data de_drv_data;
  36. #ifdef CONFIG_PM_DEVICE
  37. int de_pm_control(const struct device *dev, enum pm_device_action action);
  38. #endif
  39. int de_init(const struct device *dev);
  40. void de_isr(const void *arg);
  41. void de_dump(void);
  42. void nor_xip_set_locked(bool locked);
  43. #endif /* ZEPHYR_DRIVERS_DISPLAY_ENGINE_DE_DEVICE_H_ */