SmartWheels self-driving race car. Designed for NXP Cup. Uses FRDM-KL25Z, area-scan camera, and simple image processing to detect and navigate any NXP spec track.

Dependencies:   TSI USBDevice mbed-dev

Fork of SmartWheels by haofan Zheng

Committer:
hazheng
Date:
Tue Mar 14 23:36:13 2017 +0000
Revision:
37:7074a6118d03
Child:
46:a5eb9bd3bb55
Added support for OV7670.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hazheng 37:7074a6118d03 1 #pragma once
hazheng 37:7074a6118d03 2 #ifndef OV7670_REG_PROG_H
hazheng 37:7074a6118d03 3 #define OV7670_REG_PROG_H
hazheng 37:7074a6118d03 4
hazheng 37:7074a6118d03 5 #include "CamRegDefinitions.h"
hazheng 37:7074a6118d03 6
hazheng 37:7074a6118d03 7 #if defined(ARDUCAM_OV7670)
hazheng 37:7074a6118d03 8
hazheng 37:7074a6118d03 9 #define CAM_SCCB_WRITE 0x42
hazheng 37:7074a6118d03 10 #define CAM_SCCB_READ 0x43
hazheng 37:7074a6118d03 11
hazheng 37:7074a6118d03 12 #define CAM_PID_VALUE 0x76
hazheng 37:7074a6118d03 13 #define CAM_VER_VALUE 0x73
hazheng 37:7074a6118d03 14
hazheng 37:7074a6118d03 15 #define CAM_PID_ADDR 0x0A
hazheng 37:7074a6118d03 16 #define CAM_VER_ADDR 0x0B
hazheng 37:7074a6118d03 17
hazheng 37:7074a6118d03 18 #if !defined(RESOLUTION_WIDTH) || !defined(RESOLUTION_WIDTH)
hazheng 37:7074a6118d03 19 #error Must pick one valid resolution!!
hazheng 37:7074a6118d03 20 #endif
hazheng 37:7074a6118d03 21
hazheng 37:7074a6118d03 22 namespace OV7670Prog
hazheng 37:7074a6118d03 23 {
hazheng 37:7074a6118d03 24
hazheng 37:7074a6118d03 25 const struct sensor_reg ResetProg[] =
hazheng 37:7074a6118d03 26 {
hazheng 37:7074a6118d03 27 {0x12, 0x80},
hazheng 37:7074a6118d03 28 {0xff, 0xff},
hazheng 37:7074a6118d03 29 };
hazheng 37:7074a6118d03 30
hazheng 37:7074a6118d03 31 #if (defined(RESOLUTION_WIDTH) && RESOLUTION_WIDTH == 320) && (defined(RESOLUTION_HEIGHT) && RESOLUTION_HEIGHT == 240)
hazheng 37:7074a6118d03 32 const struct sensor_reg QVGA[] =
hazheng 37:7074a6118d03 33 {
hazheng 37:7074a6118d03 34 {0x3a, 0x04},
hazheng 37:7074a6118d03 35 {0x40, 0xd0},
hazheng 37:7074a6118d03 36 {0x12, 0x14},
hazheng 37:7074a6118d03 37 {0x32, 0x80},
hazheng 37:7074a6118d03 38 {0x17, 0x16},
hazheng 37:7074a6118d03 39 {0x18, 0x04},
hazheng 37:7074a6118d03 40 {0x19, 0x02},
hazheng 37:7074a6118d03 41 {0x1a, 0x7b},
hazheng 37:7074a6118d03 42 {0x03, 0x06},
hazheng 37:7074a6118d03 43 {0x0c, 0x00},
hazheng 37:7074a6118d03 44 {0x3e, 0x00},
hazheng 37:7074a6118d03 45 {0x70, 0x00},
hazheng 37:7074a6118d03 46 {0x71, 0x00},
hazheng 37:7074a6118d03 47 {0x72, 0x11},
hazheng 37:7074a6118d03 48 {0x73, 0x00},
hazheng 37:7074a6118d03 49 {0xa2, 0x02},
hazheng 37:7074a6118d03 50 {0x11, 0x81},
hazheng 37:7074a6118d03 51 {0x7a, 0x20},
hazheng 37:7074a6118d03 52 {0x7b, 0x1c},
hazheng 37:7074a6118d03 53 {0x7c, 0x28},
hazheng 37:7074a6118d03 54 {0x7d, 0x3c},
hazheng 37:7074a6118d03 55 {0x7e, 0x55},
hazheng 37:7074a6118d03 56 {0x7f, 0x68},
hazheng 37:7074a6118d03 57 {0x80, 0x76},
hazheng 37:7074a6118d03 58 {0x81, 0x80},
hazheng 37:7074a6118d03 59 {0x82, 0x88},
hazheng 37:7074a6118d03 60 {0x83, 0x8f},
hazheng 37:7074a6118d03 61 {0x84, 0x96},
hazheng 37:7074a6118d03 62 {0x85, 0xa3},
hazheng 37:7074a6118d03 63 {0x86, 0xaf},
hazheng 37:7074a6118d03 64 {0x87, 0xc4},
hazheng 37:7074a6118d03 65 {0x88, 0xd7},
hazheng 37:7074a6118d03 66 {0x89, 0xe8},
hazheng 37:7074a6118d03 67 {0x13, 0xe0},
hazheng 37:7074a6118d03 68 {0x00, 0x00},
hazheng 37:7074a6118d03 69 {0x10, 0x00},
hazheng 37:7074a6118d03 70 {0x0d, 0x00},
hazheng 37:7074a6118d03 71 {0x14, 0x28},
hazheng 37:7074a6118d03 72 {0xa5, 0x05},
hazheng 37:7074a6118d03 73 {0xab, 0x07},
hazheng 37:7074a6118d03 74 {0x24, 0x75},
hazheng 37:7074a6118d03 75 {0x25, 0x63},
hazheng 37:7074a6118d03 76 {0x26, 0xA5},
hazheng 37:7074a6118d03 77 {0x9f, 0x78},
hazheng 37:7074a6118d03 78 {0xa0, 0x68},
hazheng 37:7074a6118d03 79 {0xa1, 0x03},
hazheng 37:7074a6118d03 80 {0xa6, 0xdf},
hazheng 37:7074a6118d03 81 {0xa7, 0xdf},
hazheng 37:7074a6118d03 82 {0xa8, 0xf0},
hazheng 37:7074a6118d03 83 {0xa9, 0x90},
hazheng 37:7074a6118d03 84 {0xaa, 0x94},
hazheng 37:7074a6118d03 85 {0x13, 0xe5},
hazheng 37:7074a6118d03 86 {0x0e, 0x61},
hazheng 37:7074a6118d03 87 {0x0f, 0x4b},
hazheng 37:7074a6118d03 88 {0x16, 0x02},
hazheng 37:7074a6118d03 89 {0x1e, 0x37}, //Mirroring
hazheng 37:7074a6118d03 90 {0x21, 0x02},
hazheng 37:7074a6118d03 91 {0x22, 0x91},
hazheng 37:7074a6118d03 92 {0x29, 0x07},
hazheng 37:7074a6118d03 93 {0x33, 0x0b},
hazheng 37:7074a6118d03 94 {0x35, 0x0b},
hazheng 37:7074a6118d03 95 {0x37, 0x1d},
hazheng 37:7074a6118d03 96 {0x38, 0x71},
hazheng 37:7074a6118d03 97 {0x39, 0x2a},
hazheng 37:7074a6118d03 98 {0x3c, 0x78},
hazheng 37:7074a6118d03 99 {0x4d, 0x40},
hazheng 37:7074a6118d03 100 {0x4e, 0x20},
hazheng 37:7074a6118d03 101 {0x69, 0x00},
hazheng 37:7074a6118d03 102 {0x6b, 0x00},
hazheng 37:7074a6118d03 103 {0x74, 0x19},
hazheng 37:7074a6118d03 104 {0x8d, 0x4f},
hazheng 37:7074a6118d03 105 {0x8e, 0x00},
hazheng 37:7074a6118d03 106 {0x8f, 0x00},
hazheng 37:7074a6118d03 107 {0x90, 0x00},
hazheng 37:7074a6118d03 108 {0x91, 0x00},
hazheng 37:7074a6118d03 109 {0x92, 0x00},
hazheng 37:7074a6118d03 110 {0x96, 0x00},
hazheng 37:7074a6118d03 111 {0x9a, 0x80},
hazheng 37:7074a6118d03 112 {0xb0, 0x84},
hazheng 37:7074a6118d03 113 {0xb1, 0x0c},
hazheng 37:7074a6118d03 114 {0xb2, 0x0e},
hazheng 37:7074a6118d03 115 {0xb3, 0x82},
hazheng 37:7074a6118d03 116 {0xb8, 0x0a},
hazheng 37:7074a6118d03 117 {0x43, 0x14},
hazheng 37:7074a6118d03 118 {0x44, 0xf0},
hazheng 37:7074a6118d03 119 {0x45, 0x34},
hazheng 37:7074a6118d03 120 {0x46, 0x58},
hazheng 37:7074a6118d03 121 {0x47, 0x28},
hazheng 37:7074a6118d03 122 {0x48, 0x3a},
hazheng 37:7074a6118d03 123 {0x59, 0x88},
hazheng 37:7074a6118d03 124 {0x5a, 0x88},
hazheng 37:7074a6118d03 125 {0x5b, 0x44},
hazheng 37:7074a6118d03 126 {0x5c, 0x67},
hazheng 37:7074a6118d03 127 {0x5d, 0x49},
hazheng 37:7074a6118d03 128 {0x5e, 0x0e},
hazheng 37:7074a6118d03 129 {0x64, 0x04},
hazheng 37:7074a6118d03 130 {0x65, 0x20},
hazheng 37:7074a6118d03 131 {0x66, 0x05},
hazheng 37:7074a6118d03 132 {0x94, 0x04},
hazheng 37:7074a6118d03 133 {0x95, 0x08},
hazheng 37:7074a6118d03 134 {0x6c, 0x0a},
hazheng 37:7074a6118d03 135 {0x6d, 0x55},
hazheng 37:7074a6118d03 136 {0x6e, 0x11},
hazheng 37:7074a6118d03 137 {0x6f, 0x9f},
hazheng 37:7074a6118d03 138 {0x6a, 0x40},
hazheng 37:7074a6118d03 139 {0x01, 0x40},
hazheng 37:7074a6118d03 140 {0x02, 0x40},
hazheng 37:7074a6118d03 141 {0x13, 0xe7},
hazheng 37:7074a6118d03 142 {0x15, 0x02},
hazheng 37:7074a6118d03 143 {0x4f, 0x80},
hazheng 37:7074a6118d03 144 {0x50, 0x80},
hazheng 37:7074a6118d03 145 {0x51, 0x00},
hazheng 37:7074a6118d03 146 {0x52, 0x22},
hazheng 37:7074a6118d03 147 {0x53, 0x5e},
hazheng 37:7074a6118d03 148 {0x54, 0x80},
hazheng 37:7074a6118d03 149 {0x58, 0x9e},
hazheng 37:7074a6118d03 150 {0x41, 0x08},
hazheng 37:7074a6118d03 151 {0x3f, 0x00},
hazheng 37:7074a6118d03 152 {0x75, 0x05},
hazheng 37:7074a6118d03 153 {0x76, 0xe1},
hazheng 37:7074a6118d03 154 {0x4c, 0x00},
hazheng 37:7074a6118d03 155 {0x77, 0x01},
hazheng 37:7074a6118d03 156 {0x3d, 0xc2},
hazheng 37:7074a6118d03 157 {0x4b, 0x09},
hazheng 37:7074a6118d03 158 {0xc9, 0x60},
hazheng 37:7074a6118d03 159 {0x41, 0x38},
hazheng 37:7074a6118d03 160 {0x56, 0x40},
hazheng 37:7074a6118d03 161 {0x34, 0x11},
hazheng 37:7074a6118d03 162 {0x3b, 0x02},
hazheng 37:7074a6118d03 163 {0xa4, 0x89},
hazheng 37:7074a6118d03 164 {0x96, 0x00},
hazheng 37:7074a6118d03 165 {0x97, 0x30},
hazheng 37:7074a6118d03 166 {0x98, 0x20},
hazheng 37:7074a6118d03 167 {0x99, 0x30},
hazheng 37:7074a6118d03 168 {0x9a, 0x84},
hazheng 37:7074a6118d03 169 {0x9b, 0x29},
hazheng 37:7074a6118d03 170 {0x9c, 0x03},
hazheng 37:7074a6118d03 171 {0x9d, 0x4c},
hazheng 37:7074a6118d03 172 {0x9e, 0x3f},
hazheng 37:7074a6118d03 173 {0x78, 0x04},
hazheng 37:7074a6118d03 174 {0x79, 0x01},
hazheng 37:7074a6118d03 175 {0xc8, 0xf0},
hazheng 37:7074a6118d03 176 {0x79, 0x0f},
hazheng 37:7074a6118d03 177 {0xc8, 0x00},
hazheng 37:7074a6118d03 178 {0x79, 0x10},
hazheng 37:7074a6118d03 179 {0xc8, 0x7e},
hazheng 37:7074a6118d03 180 {0x79, 0x0a},
hazheng 37:7074a6118d03 181 {0xc8, 0x80},
hazheng 37:7074a6118d03 182 {0x79, 0x0b},
hazheng 37:7074a6118d03 183 {0xc8, 0x01},
hazheng 37:7074a6118d03 184 {0x79, 0x0c},
hazheng 37:7074a6118d03 185 {0xc8, 0x0f},
hazheng 37:7074a6118d03 186 {0x79, 0x0d},
hazheng 37:7074a6118d03 187 {0xc8, 0x20},
hazheng 37:7074a6118d03 188 {0x79, 0x09},
hazheng 37:7074a6118d03 189 {0xc8, 0x80},
hazheng 37:7074a6118d03 190 {0x79, 0x02},
hazheng 37:7074a6118d03 191 {0xc8, 0xc0},
hazheng 37:7074a6118d03 192 {0x79, 0x03},
hazheng 37:7074a6118d03 193 {0xc8, 0x40},
hazheng 37:7074a6118d03 194 {0x79, 0x05},
hazheng 37:7074a6118d03 195 {0xc8, 0x30},
hazheng 37:7074a6118d03 196 {0x79, 0x26},
hazheng 37:7074a6118d03 197 {0x09, 0x03},
hazheng 37:7074a6118d03 198 {0x3b, 0x42},
hazheng 37:7074a6118d03 199 {0xff, 0xff},
hazheng 37:7074a6118d03 200
hazheng 37:7074a6118d03 201 };
hazheng 37:7074a6118d03 202 #endif //320 X 240
hazheng 37:7074a6118d03 203
hazheng 37:7074a6118d03 204 }
hazheng 37:7074a6118d03 205
hazheng 37:7074a6118d03 206
hazheng 37:7074a6118d03 207
hazheng 37:7074a6118d03 208 #endif //ARDUCAM_OV7670
hazheng 37:7074a6118d03 209
hazheng 37:7074a6118d03 210 #endif //OV7670_REG_PROG_H