forked from arduino/ArduinoCore-mbed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcamera.h
29 lines (26 loc) · 991 Bytes
/
camera.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "drivers/InterruptIn.h"
enum {
CAMERA_R160x120 = 0x00, /* QQVGA Resolution */
CAMERA_R320x240 = 0x01, /* QVGA Resolution */
CAMERA_R320x320 = 0x02, /* 320x320 Resolution */
CAMERA_RMAX
};
typedef void (*md_callback_t)();
class CameraClass {
private:
uint32_t resolution;
bool initialized;
mbed::InterruptIn md_irq;
void HIMAXIrqHandler();
public:
CameraClass(): initialized(false), md_irq(PC_15){}
int begin(uint32_t resolution = CAMERA_R320x240, uint32_t framerate = 30);
int framerate(uint32_t framerate);
int grab(uint8_t *buffer, uint32_t timeout=5000);
int standby(bool enable);
int motionDetection(bool enable, md_callback_t callback=NULL);
int motionDetectionWindow(uint32_t x, uint32_t y, uint32_t w, uint32_t h);
int motionDetectionThreshold(uint32_t threshold);
int motionDetected();
int testPattern(bool walking);
};