globals.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef GLOBALS_H
  2. #define GLOBALS_H
  3. #include <stdint.h>
  4. // Define Pin numbers used by the camera.
  5. #define FLASH_GPIO_NUM 4
  6. #define HREF_GPIO_NUM 23
  7. #define PCLK_GPIO_NUM 22
  8. #define PWDN_GPIO_NUM 32
  9. #define RESET_GPIO_NUM -1
  10. #define SIOC_GPIO_NUM 27
  11. #define SIOD_GPIO_NUM 26
  12. #define VSYNC_GPIO_NUM 25
  13. #define XCLK_GPIO_NUM 0
  14. #define Y2_GPIO_NUM 5
  15. #define Y3_GPIO_NUM 18
  16. #define Y4_GPIO_NUM 19
  17. #define Y5_GPIO_NUM 21
  18. #define Y6_GPIO_NUM 36
  19. #define Y7_GPIO_NUM 39
  20. #define Y8_GPIO_NUM 34
  21. #define Y9_GPIO_NUM 35
  22. /**
  23. * The dithering algorithms available.
  24. */
  25. enum DitheringAlgorithm : uint8_t
  26. {
  27. FLOYD_STEINBERG,
  28. JARVIS_JUDICE_NINKE,
  29. STUCKI
  30. };
  31. typedef struct CameraModel
  32. {
  33. /**
  34. * Flag to enable or disable dithering.
  35. */
  36. bool isDitheringDisabled;
  37. /**
  38. * Flag to represent the flash state when saving pictures to the Flipper.
  39. */
  40. bool isFlashEnabled;
  41. /**
  42. * Flag to invert pixel colors.
  43. */
  44. bool isInverted;
  45. /**
  46. * Flag to stop or start the stream.
  47. */
  48. bool isStreamEnabled;
  49. /**
  50. * Holds the currently selected dithering algorithm.
  51. */
  52. DitheringAlgorithm ditherAlgorithm;
  53. } CameraModel;
  54. #endif