luat_camera.h 1014 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /******************************************************************************
  2. * CAMERA设备操作抽象层
  3. * @author Dozingfiretruck
  4. * @since 0.0.1
  5. *****************************************************************************/
  6. #ifndef Luat_CAMERA_H
  7. #define Luat_CAMERA_H
  8. #include "luat_base.h"
  9. #include "luat_lcd.h"
  10. typedef struct luat_camera_conf
  11. {
  12. uint8_t id;
  13. uint8_t zbar_scan;
  14. uint8_t draw_lcd;
  15. uint8_t i2c_id;
  16. uint8_t i2c_addr;
  17. uint8_t pwm_id;
  18. size_t pwm_period;
  19. uint8_t pwm_pulse;
  20. uint16_t sensor_width;
  21. uint16_t sensor_height;
  22. uint8_t color_bit;
  23. uint8_t id_reg;
  24. uint8_t id_value;
  25. size_t init_cmd_size;
  26. uint8_t *init_cmd;
  27. luat_lcd_conf_t* lcd_conf;
  28. } luat_camera_conf_t;
  29. int l_camera_handler(lua_State *L, void* ptr);
  30. int luat_camera_init(luat_camera_conf_t *conf);
  31. int luat_camera_start(int id);
  32. int luat_camera_stop(int id);
  33. int luat_camera_close(int id);
  34. int luat_camera_capture(int id, uint8_t quality, const char *path);
  35. #endif