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
Hardwares/OV7725RegProg.h@35:ac4fcca21560, 2017-03-13 (annotated)
- Committer:
- hazheng
- Date:
- Mon Mar 13 02:43:53 2017 +0000
- Revision:
- 35:ac4fcca21560
- Child:
- 36:7e747e19f660
Added More test code for camera.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hazheng | 35:ac4fcca21560 | 1 | #pragma once |
hazheng | 35:ac4fcca21560 | 2 | #ifndef OV7725_REG_PROG_H |
hazheng | 35:ac4fcca21560 | 3 | #define OV7725_REG_PROG_H |
hazheng | 35:ac4fcca21560 | 4 | |
hazheng | 35:ac4fcca21560 | 5 | #include "CamRegDefinitions.h" |
hazheng | 35:ac4fcca21560 | 6 | |
hazheng | 35:ac4fcca21560 | 7 | #define OV7725_WRITE 0x42 |
hazheng | 35:ac4fcca21560 | 8 | #define OV7725_READ 0x43 |
hazheng | 35:ac4fcca21560 | 9 | |
hazheng | 35:ac4fcca21560 | 10 | #define OV7725_PID_VALUE 0x77 |
hazheng | 35:ac4fcca21560 | 11 | #define OV7725_VER_VALUE 0x21 |
hazheng | 35:ac4fcca21560 | 12 | |
hazheng | 35:ac4fcca21560 | 13 | #define OV7725_PID_ADDR 0x0A |
hazheng | 35:ac4fcca21560 | 14 | #define OV7725_VER_ADDR 0x0B |
hazheng | 35:ac4fcca21560 | 15 | |
hazheng | 35:ac4fcca21560 | 16 | namespace OV7725Prog |
hazheng | 35:ac4fcca21560 | 17 | { |
hazheng | 35:ac4fcca21560 | 18 | |
hazheng | 35:ac4fcca21560 | 19 | //#if (defined(RESOLUTION_WIDTH) && RESOLUTION_WIDTH == 320) && (defined(RESOLUTION_HEIGHT) && RESOLUTION_HEIGHT == 240) |
hazheng | 35:ac4fcca21560 | 20 | const struct sensor_reg QVGA[] = |
hazheng | 35:ac4fcca21560 | 21 | { |
hazheng | 35:ac4fcca21560 | 22 | {0x32,0x00}, |
hazheng | 35:ac4fcca21560 | 23 | {0x2a,0x00}, |
hazheng | 35:ac4fcca21560 | 24 | {0x11,0x02}, |
hazheng | 35:ac4fcca21560 | 25 | {0x12,0x46},//QVGA RGB565 |
hazheng | 35:ac4fcca21560 | 26 | {0x12,0x06}, |
hazheng | 35:ac4fcca21560 | 27 | |
hazheng | 35:ac4fcca21560 | 28 | |
hazheng | 35:ac4fcca21560 | 29 | {0x42,0x7f}, |
hazheng | 35:ac4fcca21560 | 30 | {0x4d,0x00},//0x09 |
hazheng | 35:ac4fcca21560 | 31 | {0x63,0xf0}, |
hazheng | 35:ac4fcca21560 | 32 | {0x64,0xff}, |
hazheng | 35:ac4fcca21560 | 33 | {0x65,0x20}, |
hazheng | 35:ac4fcca21560 | 34 | {0x66,0x00}, |
hazheng | 35:ac4fcca21560 | 35 | {0x67,0x00}, |
hazheng | 35:ac4fcca21560 | 36 | {0x69,0x5d}, |
hazheng | 35:ac4fcca21560 | 37 | |
hazheng | 35:ac4fcca21560 | 38 | |
hazheng | 35:ac4fcca21560 | 39 | {0x13,0xff}, |
hazheng | 35:ac4fcca21560 | 40 | {0x0d,0x81},//PLL |
hazheng | 35:ac4fcca21560 | 41 | {0x0f,0xc5}, |
hazheng | 35:ac4fcca21560 | 42 | {0x14,0x11}, |
hazheng | 35:ac4fcca21560 | 43 | {0x22,0xFF},//7f |
hazheng | 35:ac4fcca21560 | 44 | {0x23,0x01}, |
hazheng | 35:ac4fcca21560 | 45 | {0x24,0x34}, |
hazheng | 35:ac4fcca21560 | 46 | {0x25,0x3c}, |
hazheng | 35:ac4fcca21560 | 47 | {0x26,0xa1}, |
hazheng | 35:ac4fcca21560 | 48 | {0x2b,0x00}, |
hazheng | 35:ac4fcca21560 | 49 | {0x6b,0xaa}, |
hazheng | 35:ac4fcca21560 | 50 | {0x13,0xff}, |
hazheng | 35:ac4fcca21560 | 51 | |
hazheng | 35:ac4fcca21560 | 52 | {0x90,0x0a},// |
hazheng | 35:ac4fcca21560 | 53 | {0x91,0x01},// |
hazheng | 35:ac4fcca21560 | 54 | {0x92,0x01},// |
hazheng | 35:ac4fcca21560 | 55 | {0x93,0x01}, |
hazheng | 35:ac4fcca21560 | 56 | |
hazheng | 35:ac4fcca21560 | 57 | {0x94,0x5f}, |
hazheng | 35:ac4fcca21560 | 58 | {0x95,0x53}, |
hazheng | 35:ac4fcca21560 | 59 | {0x96,0x11}, |
hazheng | 35:ac4fcca21560 | 60 | {0x97,0x1a}, |
hazheng | 35:ac4fcca21560 | 61 | {0x98,0x3d}, |
hazheng | 35:ac4fcca21560 | 62 | {0x99,0x5a}, |
hazheng | 35:ac4fcca21560 | 63 | {0x9a,0x1e}, |
hazheng | 35:ac4fcca21560 | 64 | |
hazheng | 35:ac4fcca21560 | 65 | {0x9b,0x00},//set luma |
hazheng | 35:ac4fcca21560 | 66 | {0x9c,0x25},//set contrast |
hazheng | 35:ac4fcca21560 | 67 | {0xa7,0x65},//set saturation |
hazheng | 35:ac4fcca21560 | 68 | {0xa8,0x65},//set saturation |
hazheng | 35:ac4fcca21560 | 69 | {0xa9,0x80},//set hue |
hazheng | 35:ac4fcca21560 | 70 | {0xaa,0x80},//set hue |
hazheng | 35:ac4fcca21560 | 71 | |
hazheng | 35:ac4fcca21560 | 72 | {0x9e,0x81}, |
hazheng | 35:ac4fcca21560 | 73 | {0xa6,0x06}, |
hazheng | 35:ac4fcca21560 | 74 | |
hazheng | 35:ac4fcca21560 | 75 | {0x7e,0x0c}, |
hazheng | 35:ac4fcca21560 | 76 | {0x7f,0x16}, |
hazheng | 35:ac4fcca21560 | 77 | {0x80,0x2a}, |
hazheng | 35:ac4fcca21560 | 78 | {0x81,0x4e}, |
hazheng | 35:ac4fcca21560 | 79 | {0x82,0x61}, |
hazheng | 35:ac4fcca21560 | 80 | {0x83,0x6f}, |
hazheng | 35:ac4fcca21560 | 81 | {0x84,0x7b}, |
hazheng | 35:ac4fcca21560 | 82 | {0x85,0x86}, |
hazheng | 35:ac4fcca21560 | 83 | {0x86,0x8e}, |
hazheng | 35:ac4fcca21560 | 84 | {0x87,0x97}, |
hazheng | 35:ac4fcca21560 | 85 | {0x88,0xa4}, |
hazheng | 35:ac4fcca21560 | 86 | {0x89,0xaf}, |
hazheng | 35:ac4fcca21560 | 87 | {0x8a,0xc5}, |
hazheng | 35:ac4fcca21560 | 88 | {0x8b,0xd7}, |
hazheng | 35:ac4fcca21560 | 89 | {0x8c,0xe8}, |
hazheng | 35:ac4fcca21560 | 90 | {0x8d,0x20}, |
hazheng | 35:ac4fcca21560 | 91 | |
hazheng | 35:ac4fcca21560 | 92 | {0x33,0x00}, |
hazheng | 35:ac4fcca21560 | 93 | {0x22,0x99}, |
hazheng | 35:ac4fcca21560 | 94 | {0x23,0x03}, |
hazheng | 35:ac4fcca21560 | 95 | {0x4a,0x00}, |
hazheng | 35:ac4fcca21560 | 96 | {0x49,0x13}, |
hazheng | 35:ac4fcca21560 | 97 | {0x47,0x08}, |
hazheng | 35:ac4fcca21560 | 98 | {0x4b,0x14}, |
hazheng | 35:ac4fcca21560 | 99 | {0x4c,0x17}, |
hazheng | 35:ac4fcca21560 | 100 | {0x46,0x05}, |
hazheng | 35:ac4fcca21560 | 101 | {0x0e,0x75}, |
hazheng | 35:ac4fcca21560 | 102 | {0x0c,0x90}, |
hazheng | 35:ac4fcca21560 | 103 | {0x00,0xf0}, |
hazheng | 35:ac4fcca21560 | 104 | |
hazheng | 35:ac4fcca21560 | 105 | #if (defined(RESOLUTION_WIDTH) && RESOLUTION_WIDTH == 320) && (defined(RESOLUTION_HEIGHT) && RESOLUTION_HEIGHT == 240) |
hazheng | 35:ac4fcca21560 | 106 | {0x29, 0x50}, //Zoom |
hazheng | 35:ac4fcca21560 | 107 | {0x2C, 0x78}, //Zoom |
hazheng | 35:ac4fcca21560 | 108 | #endif |
hazheng | 35:ac4fcca21560 | 109 | |
hazheng | 35:ac4fcca21560 | 110 | #if (defined(RESOLUTION_WIDTH) && RESOLUTION_WIDTH == 160) && (defined(RESOLUTION_HEIGHT) && RESOLUTION_HEIGHT == 120) |
hazheng | 35:ac4fcca21560 | 111 | {0x29, 0x28}, //Zoom |
hazheng | 35:ac4fcca21560 | 112 | {0x2C, 0x3C}, //Zoom |
hazheng | 35:ac4fcca21560 | 113 | #endif |
hazheng | 35:ac4fcca21560 | 114 | // {0x29,0x50}, |
hazheng | 35:ac4fcca21560 | 115 | // {0x2C,0x78}, |
hazheng | 35:ac4fcca21560 | 116 | |
hazheng | 35:ac4fcca21560 | 117 | {0xff, 0xff}, |
hazheng | 35:ac4fcca21560 | 118 | |
hazheng | 35:ac4fcca21560 | 119 | |
hazheng | 35:ac4fcca21560 | 120 | }; |
hazheng | 35:ac4fcca21560 | 121 | //#endif //320 X 240 |
hazheng | 35:ac4fcca21560 | 122 | |
hazheng | 35:ac4fcca21560 | 123 | } |
hazheng | 35:ac4fcca21560 | 124 | |
hazheng | 35:ac4fcca21560 | 125 | |
hazheng | 35:ac4fcca21560 | 126 | |
hazheng | 35:ac4fcca21560 | 127 | #endif //OV7725_REG_PROG_H |