ESP_IOT v2.5
IOT ESP Coding
OV2640.h
Go to the documentation of this file.
1#ifndef OV2640_H_
2#define OV2640_H_
3
4#include "../../../Defines.h"
5
6#ifdef USE_CAMERA_MODULE
7
8#include <Arduino.h>
9#include <pgmspace.h>
10#include <stdio.h>
11#include "esp_log.h"
12#include "esp_attr.h"
13#include "esp_camera.h"
14
15extern camera_config_t esp32cam_config, esp32cam_aithinker_config, esp32cam_ttgo_t_config;
16
17class OV2640
18{
19public:
20 OV2640(){
21 fb = NULL;
22 };
23 ~OV2640(){
24 };
25 esp_err_t init(camera_config_t config);
26 void run(void);
27 size_t getSize(void);
28 uint8_t *getfb(void);
29 int getWidth(void);
30 int getHeight(void);
31 framesize_t getFrameSize(void);
32 pixformat_t getPixelFormat(void);
33
34 void setFrameSize(framesize_t size);
35 void setPixelFormat(pixformat_t format);
36
37private:
38 void runIfNeeded(); // grab a frame if we don't already have one
39
40 // camera_framesize_t _frame_size;
41 // camera_pixelformat_t _pixel_format;
42 camera_config_t _cam_config;
43
44 camera_fb_t *fb;
45};
46#endif
47
48#endif //OV2640_H_