Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
camera.h@0:78595d38d985, 2014-05-23 (annotated)
- Committer:
- ollyhicks
- Date:
- Fri May 23 20:48:07 2014 +0000
- Revision:
- 0:78595d38d985
Sort of working (terrible image)
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| ollyhicks | 0:78595d38d985 | 1 | #include "mbed.h" |
| ollyhicks | 0:78595d38d985 | 2 | |
| ollyhicks | 0:78595d38d985 | 3 | /* |
| ollyhicks | 0:78595d38d985 | 4 | * Links |
| ollyhicks | 0:78595d38d985 | 5 | * https://gist.github.com/franciscospaeth/8503747 |
| ollyhicks | 0:78595d38d985 | 6 | * http://embeddedprogrammer.blogspot.co.uk/2012/07/hacking-ov7670-camera-module-sccb-cheat.html |
| ollyhicks | 0:78595d38d985 | 7 | * http://www.voti.nl/docs/OV7670.pdf |
| ollyhicks | 0:78595d38d985 | 8 | */ |
| ollyhicks | 0:78595d38d985 | 9 | |
| ollyhicks | 0:78595d38d985 | 10 | #define CAMERA_W 176 |
| ollyhicks | 0:78595d38d985 | 11 | #define CAMERA_H 144 |
| ollyhicks | 0:78595d38d985 | 12 | #define CAMERA_BPX 2 // bits per pixel |
| ollyhicks | 0:78595d38d985 | 13 | #define CAMERA_CLK_PERIOD 1e-6 |
| ollyhicks | 0:78595d38d985 | 14 | |
| ollyhicks | 0:78595d38d985 | 15 | #define CAMERA_I2C_FREQ 40000 |
| ollyhicks | 0:78595d38d985 | 16 | #define CAMERA_I2C_READ_ADDR 0x43 |
| ollyhicks | 0:78595d38d985 | 17 | #define CAMERA_I2C_WRITE_ADDR 0x42 |
| ollyhicks | 0:78595d38d985 | 18 | #define CAMERA_I2C_NOACK 0 |
| ollyhicks | 0:78595d38d985 | 19 | #define CAMERA_I2C_REGMAX 201 |
| ollyhicks | 0:78595d38d985 | 20 | |
| ollyhicks | 0:78595d38d985 | 21 | |
| ollyhicks | 0:78595d38d985 | 22 | #define CAMERA_I2C_REG_COM3 0x0C |
| ollyhicks | 0:78595d38d985 | 23 | #define CAMERA_I2C_REG_COM4 0x0D |
| ollyhicks | 0:78595d38d985 | 24 | #define CAMERA_I2C_REG_COM5 0x0E |
| ollyhicks | 0:78595d38d985 | 25 | #define CAMERA_I2C_REG_COM6 0x0F |
| ollyhicks | 0:78595d38d985 | 26 | #define CAMERA_I2C_REG_AECH 0x10 |
| ollyhicks | 0:78595d38d985 | 27 | #define CAMERA_I2C_REG_CLKRC 0x11 |
| ollyhicks | 0:78595d38d985 | 28 | #define CAMERA_I2C_REG_COM7 0x12 |
| ollyhicks | 0:78595d38d985 | 29 | #define CAMERA_I2C_REG_COM8 0x13 |
| ollyhicks | 0:78595d38d985 | 30 | #define CAMERA_I2C_REG_COM9 0x14 |
| ollyhicks | 0:78595d38d985 | 31 | #define CAMERA_I2C_REG_COM10 0x15 |
| ollyhicks | 0:78595d38d985 | 32 | #define CAMERA_I2C_REG_COM11 0x3B |
| ollyhicks | 0:78595d38d985 | 33 | #define CAMERA_I2C_REG_COM12 0x3C |
| ollyhicks | 0:78595d38d985 | 34 | #define CAMERA_I2C_REG_COM13 0x3D |
| ollyhicks | 0:78595d38d985 | 35 | #define CAMERA_I2C_REG_COM14 0x3E |
| ollyhicks | 0:78595d38d985 | 36 | |
| ollyhicks | 0:78595d38d985 | 37 | #define CAMERA_I2C_OF_CIF 32 |
| ollyhicks | 0:78595d38d985 | 38 | #define CAMERA_I2C_OF_QVGA 16 |
| ollyhicks | 0:78595d38d985 | 39 | #define CAMERA_I2C_OF_QCIF 8 // 176 x 144 |
| ollyhicks | 0:78595d38d985 | 40 | #define CAMERA_I2C_OF_RGB 4 |
| ollyhicks | 0:78595d38d985 | 41 | #define CAMERA_I2C_OF_YUV 0 |
| ollyhicks | 0:78595d38d985 | 42 | |
| ollyhicks | 0:78595d38d985 | 43 | void camera_setup(); |
| ollyhicks | 0:78595d38d985 | 44 | int camera_i2c_read(int addr); |
| ollyhicks | 0:78595d38d985 | 45 | void camera_i2c_write(int addr, int val); |
| ollyhicks | 0:78595d38d985 | 46 | void camera_set_freq_scaler(int prescaler); |
| ollyhicks | 0:78595d38d985 | 47 | void camera_set_output_format(int output_format); |
| ollyhicks | 0:78595d38d985 | 48 | void camera_grab(FILE *fp); |
| ollyhicks | 0:78595d38d985 | 49 | |
| ollyhicks | 0:78595d38d985 | 50 | |
| ollyhicks | 0:78595d38d985 | 51 | void wait_posedge(DigitalIn pin); |
| ollyhicks | 0:78595d38d985 | 52 | void wait_negedge(DigitalIn pin); |