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.
Diff: MARY_CAMERA.cpp
- Revision:
- 1:1e51936de820
- Parent:
- 0:f4584dba3bac
--- a/MARY_CAMERA.cpp Fri Feb 14 14:19:49 2014 +0000 +++ b/MARY_CAMERA.cpp Sat Feb 15 01:04:30 2014 +0000 @@ -1,6 +1,23 @@ #include "mbed.h" #include "MARY_CAMERA.h" +#define PARAM_NUM 99 +#define CAM_I2C_ADDR 0x42 + +#define COMMAND_WRITE 0x00 +#define COMMAND_READ 0x80 +#define COMMAND_ADDR_INCREMENT 0x20 + +#define MEMORY_ADDR_LOW__REGISTER 0x0 +#define MEMORY_ADDR_MID__REGISTER 0x1 +#define MEMORY_ADDR_HIGH_REGISTER 0x2 +#define CAMERA_DATA_REGISTER 0x8 +#define CONTROL_DATA_REGISTER 0x3 +#define STATUS_REGISTER 0x4 + +#define CONTROL__PAUSE_BUFFER_UPDATE 0x01 +#define CONTROL__RESUME_BUFFER_UPDATE 0x00 + const char param[2][PARAM_NUM] = { { 0x01,0x02,0x03,0x0c,0x0e,0x0f,0x11,0x12,0x15,0x16,0x17,0x18,0x19,0x1a,0x1e,0x21,0x22, @@ -41,8 +58,8 @@ PinName cam_reset, PinName i2c_sda, PinName i2c_scl -) : -spi( spi_mosi, spi_miso, spi_sck ), +) : + spi( spi_mosi, spi_miso, spi_sck ), cs( spi_cs ), vsync( cam_vsync ), reset( cam_reset ), @@ -53,6 +70,8 @@ + + /** initialiation * * Performs reset and initialization