Reference firmware for PixArt's PAT9130EW sensor and evaluation board. "Hello World" and "Library" contain the exact same files. Please import just one of the two into your mBed compiler as a new program and not as a library.
Diff: commHeaders/registerArrays.h
- Revision:
- 0:5a34a4387fb0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/commHeaders/registerArrays.h Fri Apr 20 22:33:08 2018 +0000 @@ -0,0 +1,97 @@ +const uint8_t initialize[][2] = { + { 0x7F, 0x00 }, // switch to bank0, not allowed to perform SPIWriteRead + { 0x05, 0xA8 }, // sleep mode disabled + { 0x09, 0x5A }, // disable write protect + { 0x51, 0x06 }, // set LD current source to 6 + { 0x0D, 0x1F }, // CPI resolution setting for X-direction + { 0x0E, 0x1F }, // CPI resolution setting for Y-direction + { 0x07, 0x00 }, + { 0x1B, 0x42 }, + { 0x2E, 0x40 }, + { 0x32, 0x40 }, + { 0x33, 0x02 }, + { 0x34, 0x00 }, + { 0x36, 0xE0 }, + { 0x38, 0xA0 }, + { 0x39, 0x01 }, + { 0x3E, 0x14 }, + { 0x44, 0x02 }, + { 0x4A, 0xE0 }, + { 0x4F, 0x02 }, + { 0x52, 0x0D }, // Turn off internal VDDA + { 0x57, 0x03 }, + { 0x59, 0x03 }, + { 0x5B, 0x03 }, + { 0x5C, 0xFF }, + + { 0x7F, 0x01 }, // switch to bank1, not allowed to perform SPIWriteRead + { 0x00, 0x25 }, + { 0x07, 0x78 }, + { 0x20, 0x00 }, + { 0x21, 0x40 }, + { 0x23, 0x00 }, + { 0x2F, 0x64 }, + { 0x37, 0x30 }, + { 0x3B, 0x64 }, + { 0x43, 0x0A }, + { 0x59, 0x01 }, + { 0x5A, 0x01 }, + { 0x5C, 0x04 }, + { 0x5E, 0x04 }, + + { 0x7F, 0x02 }, // switch to bank2, not allowed to perform SPIWriteRead + { 0x51, 0x02 }, + + { 0x7F, 0x03 }, // switch to bank3, not allowed to perform SPIWriteRead + { 0x05, 0x0C }, + { 0x06, 0x0C }, + { 0x07, 0x0C }, + { 0x08, 0x0C }, + + { 0x7F, 0x04 }, // switch to bank4, not allowed to perform SPIWriteRead + { 0x05, 0x01 }, + { 0x53, 0x08 }, + + { 0x7F, 0x05 }, // switch to bank5, not allowed to perform SPIWriteRead + { 0x00, 0x02 }, + { 0x09, 0x01 }, + { 0x0A, 0x1C }, + { 0x0B, 0x24 }, + { 0x0C, 0x1C }, + { 0x0D, 0x24 }, + { 0x12, 0x08 }, + { 0x14, 0x02 }, + { 0x16, 0x02 }, + { 0x18, 0x1C }, + { 0x19, 0x24 }, + { 0x1A, 0x1C }, + { 0x1B, 0x24 }, + { 0x20, 0x08 }, + { 0x22, 0x02 }, + { 0x24, 0x02 }, + { 0x26, 0x88 }, + { 0x2F, 0x7C }, + { 0x30, 0x07 }, + { 0x3D, 0x00 }, + { 0x3E, 0x98 }, + + { 0x7F, 0x06 }, // switch to bank6, not allowed to perform SPIWriteRead + { 0x34, 0x03 }, + + { 0x7F, 0x07 }, // switch to bank7, not allowed to perform SPIWriteRead + { 0x00, 0x01 }, + { 0x02, 0xC4 }, + { 0x03, 0x13 }, + { 0x06, 0x0C }, + { 0x0F, 0x0A }, + { 0x14, 0x02 }, + { 0x35, 0x39 }, + { 0x36, 0x3F }, + { 0x46, 0x03 }, + { 0x47, 0x0F }, + { 0x4B, 0x97 }, + + { 0x7F, 0x00 }, // switch to bank0, not allowed to perform SPIWriteRead + { 0x09, 0x00 }, // enable write protect +}; +#define initialize_size (sizeof(initialize)/sizeof(initialize[0])) \ No newline at end of file