Reference firmware for PixArt's PAA5101 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.

Welcome to the code repository for PixArt's PAA5101 sensor and evaluation board.

For general information about this product, please visit this product's components page here:
https://os.mbed.com/components/PAA5101-Floor-Tracking-Sensor-with-Wide-/

For guides and tips on how to setup and evaluate the PAA5101 sensor with the Nordic nRF52-DK microcontroller using this reference code, please visit this guide:
https://os.mbed.com/teams/PixArt/code/5101_referenceCode/wiki/Guide-for-nRF52-DK-Platform

For guides and tips on how to setup and evaluate the PAA5101 sensor with any microcontroller using this reference code, please visit this guide:
https://os.mbed.com/teams/PixArt/code/5101_referenceCode/wiki/Guide-for-Any-Platform

Committer:
PixArtVY
Date:
Wed Jul 18 18:36:47 2018 +0000
Revision:
5:e6cc13f2fc8b
Parent:
0:2c144b6813d1
Added Apache License notice.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
PixArtVY 0:2c144b6813d1 1 const uint8_t initialize[][2] = {
PixArtVY 0:2c144b6813d1 2 { 0x7F,0x00 }, // Bank0, not allowed to perform SPIWriteRead
PixArtVY 0:2c144b6813d1 3 { 0x05,0xA8 },
PixArtVY 0:2c144b6813d1 4 { 0x07,0xCC },
PixArtVY 0:2c144b6813d1 5 { 0x0A,0x17 },
PixArtVY 0:2c144b6813d1 6 { 0x0D,0x05 },
PixArtVY 0:2c144b6813d1 7 { 0x0E,0x05 },
PixArtVY 0:2c144b6813d1 8 { 0x1B,0x43 },
PixArtVY 0:2c144b6813d1 9 { 0x25,0x2E },
PixArtVY 0:2c144b6813d1 10 { 0x26,0x35 },
PixArtVY 0:2c144b6813d1 11 { 0x2E,0x40 },
PixArtVY 0:2c144b6813d1 12 { 0x32,0x40 },
PixArtVY 0:2c144b6813d1 13 { 0x33,0x02 },
PixArtVY 0:2c144b6813d1 14 { 0x34,0x00 },
PixArtVY 0:2c144b6813d1 15 { 0x36,0xE0 },
PixArtVY 0:2c144b6813d1 16 { 0x3E,0x14 },
PixArtVY 0:2c144b6813d1 17 { 0x44,0x02 },
PixArtVY 0:2c144b6813d1 18 { 0x51,0x06 },
PixArtVY 0:2c144b6813d1 19 { 0x52,0x0C },
PixArtVY 0:2c144b6813d1 20 { 0x57,0x05 },
PixArtVY 0:2c144b6813d1 21 { 0x59,0x03 },
PixArtVY 0:2c144b6813d1 22 { 0x5B,0x04 },
PixArtVY 0:2c144b6813d1 23 { 0x5D,0x3B },
PixArtVY 0:2c144b6813d1 24 { 0x7C,0xC8 },
PixArtVY 0:2c144b6813d1 25
PixArtVY 0:2c144b6813d1 26 { 0x7F,0x01 }, // Bank1, not allowed to perform SPIWriteRead
PixArtVY 0:2c144b6813d1 27 { 0x00,0x2F },
PixArtVY 0:2c144b6813d1 28 { 0x08,0x1C },
PixArtVY 0:2c144b6813d1 29 { 0x0A,0x02 },
PixArtVY 0:2c144b6813d1 30 { 0x19,0x40 },
PixArtVY 0:2c144b6813d1 31 { 0x1B,0x10 },
PixArtVY 0:2c144b6813d1 32 { 0x1D,0x18 },
PixArtVY 0:2c144b6813d1 33 { 0x1F,0x12 },
PixArtVY 0:2c144b6813d1 34 { 0x20,0x00 },
PixArtVY 0:2c144b6813d1 35 { 0x21,0x80 },
PixArtVY 0:2c144b6813d1 36 { 0x23,0x60 },
PixArtVY 0:2c144b6813d1 37 { 0x25,0x64 },
PixArtVY 0:2c144b6813d1 38 { 0x27,0x64 },
PixArtVY 0:2c144b6813d1 39 { 0x2B,0x78 },
PixArtVY 0:2c144b6813d1 40 { 0x2F,0x78 },
PixArtVY 0:2c144b6813d1 41 { 0x39,0x78 },
PixArtVY 0:2c144b6813d1 42 { 0x3B,0x78 },
PixArtVY 0:2c144b6813d1 43 { 0x3D,0x78 },
PixArtVY 0:2c144b6813d1 44 { 0x3F,0x78 },
PixArtVY 0:2c144b6813d1 45 { 0x44,0x7E },
PixArtVY 0:2c144b6813d1 46 { 0x45,0xF4 },
PixArtVY 0:2c144b6813d1 47 { 0x46,0x01 },
PixArtVY 0:2c144b6813d1 48 { 0x47,0x2C },
PixArtVY 0:2c144b6813d1 49 { 0x49,0x90 },
PixArtVY 0:2c144b6813d1 50 { 0x4A,0x05 },
PixArtVY 0:2c144b6813d1 51 { 0x4B,0xDC },
PixArtVY 0:2c144b6813d1 52 { 0x4C,0x07 },
PixArtVY 0:2c144b6813d1 53 { 0x4D,0x08 },
PixArtVY 0:2c144b6813d1 54 { 0x51,0x02 },
PixArtVY 0:2c144b6813d1 55 { 0x52,0xBC },
PixArtVY 0:2c144b6813d1 56 { 0x53,0x02 },
PixArtVY 0:2c144b6813d1 57 { 0x54,0xBC },
PixArtVY 0:2c144b6813d1 58 { 0x55,0x07 },
PixArtVY 0:2c144b6813d1 59 { 0x56,0x08 },
PixArtVY 0:2c144b6813d1 60 { 0x57,0x07 },
PixArtVY 0:2c144b6813d1 61 { 0x58,0x08 },
PixArtVY 0:2c144b6813d1 62 { 0x59,0x08 },
PixArtVY 0:2c144b6813d1 63 { 0x5A,0x08 },
PixArtVY 0:2c144b6813d1 64
PixArtVY 0:2c144b6813d1 65 { 0x7F,0x02 }, // Bank2, not allowed to perform SPIWriteRead
PixArtVY 0:2c144b6813d1 66 { 0x07,0x1B },
PixArtVY 0:2c144b6813d1 67 { 0x08,0x1F },
PixArtVY 0:2c144b6813d1 68 { 0x09,0x23 },
PixArtVY 0:2c144b6813d1 69 { 0x51,0x01 },
PixArtVY 0:2c144b6813d1 70
PixArtVY 0:2c144b6813d1 71 { 0x7F,0x03 }, // Bank3, not allowed to perform SPIWriteRead
PixArtVY 0:2c144b6813d1 72 { 0x07,0x07 },
PixArtVY 0:2c144b6813d1 73 { 0x08,0x06 },
PixArtVY 0:2c144b6813d1 74 { 0x2F,0x00 },
PixArtVY 0:2c144b6813d1 75 { 0x30,0x20 },
PixArtVY 0:2c144b6813d1 76 { 0x32,0x59 },
PixArtVY 0:2c144b6813d1 77 { 0x33,0xD8 },
PixArtVY 0:2c144b6813d1 78 { 0x34,0x4E },
PixArtVY 0:2c144b6813d1 79 { 0x35,0x20 },
PixArtVY 0:2c144b6813d1 80 { 0x36,0x5B },
PixArtVY 0:2c144b6813d1 81 { 0x37,0xCC },
PixArtVY 0:2c144b6813d1 82 { 0x38,0x50 },
PixArtVY 0:2c144b6813d1 83 { 0x39,0x14 },
PixArtVY 0:2c144b6813d1 84
PixArtVY 0:2c144b6813d1 85 { 0x7F,0x04 }, // Bank4, not allowed to perform SPIWriteRead
PixArtVY 0:2c144b6813d1 86 { 0x05,0x01 },
PixArtVY 0:2c144b6813d1 87 { 0x2C,0x06 },
PixArtVY 0:2c144b6813d1 88 { 0x2E,0x0C },
PixArtVY 0:2c144b6813d1 89 { 0x30,0x0C },
PixArtVY 0:2c144b6813d1 90 { 0x32,0x06 },
PixArtVY 0:2c144b6813d1 91 { 0x34,0x03 },
PixArtVY 0:2c144b6813d1 92 { 0x38,0x17 },
PixArtVY 0:2c144b6813d1 93 { 0x39,0x71 },
PixArtVY 0:2c144b6813d1 94 { 0x3A,0x18 },
PixArtVY 0:2c144b6813d1 95 { 0x3B,0x4D },
PixArtVY 0:2c144b6813d1 96 { 0x3C,0x18 },
PixArtVY 0:2c144b6813d1 97 { 0x3D,0x4D },
PixArtVY 0:2c144b6813d1 98 { 0x3E,0x14 },
PixArtVY 0:2c144b6813d1 99 { 0x3F,0xD1 },
PixArtVY 0:2c144b6813d1 100 { 0x40,0x14 },
PixArtVY 0:2c144b6813d1 101 { 0x41,0xDD },
PixArtVY 0:2c144b6813d1 102 { 0x42,0x0A },
PixArtVY 0:2c144b6813d1 103 { 0x43,0x6C },
PixArtVY 0:2c144b6813d1 104 { 0x44,0x08 },
PixArtVY 0:2c144b6813d1 105 { 0x45,0xAD },
PixArtVY 0:2c144b6813d1 106 { 0x46,0x06 },
PixArtVY 0:2c144b6813d1 107 { 0x47,0xF2 },
PixArtVY 0:2c144b6813d1 108 { 0x48,0x06 },
PixArtVY 0:2c144b6813d1 109 { 0x49,0xEC },
PixArtVY 0:2c144b6813d1 110 { 0x4A,0x06 },
PixArtVY 0:2c144b6813d1 111 { 0x4B,0xEC },
PixArtVY 0:2c144b6813d1 112 { 0x53,0x08 },
PixArtVY 0:2c144b6813d1 113
PixArtVY 0:2c144b6813d1 114 { 0x7F,0x05 }, // Bank5, not allowed to perform SPIWriteRead
PixArtVY 0:2c144b6813d1 115 { 0x03,0x00 },
PixArtVY 0:2c144b6813d1 116 { 0x09,0x01 },
PixArtVY 0:2c144b6813d1 117 { 0x0B,0xFF },
PixArtVY 0:2c144b6813d1 118 { 0x0D,0xFF },
PixArtVY 0:2c144b6813d1 119 { 0x0F,0xFF },
PixArtVY 0:2c144b6813d1 120 { 0x11,0xFF },
PixArtVY 0:2c144b6813d1 121 { 0x12,0xD2 },
PixArtVY 0:2c144b6813d1 122 { 0x13,0xD2 },
PixArtVY 0:2c144b6813d1 123 { 0x19,0xFF },
PixArtVY 0:2c144b6813d1 124 { 0x1B,0xFF },
PixArtVY 0:2c144b6813d1 125 { 0x1D,0xFF },
PixArtVY 0:2c144b6813d1 126 { 0x1F,0xFF },
PixArtVY 0:2c144b6813d1 127 { 0x20,0xD2 },
PixArtVY 0:2c144b6813d1 128 { 0x21,0xD2 },
PixArtVY 0:2c144b6813d1 129 { 0x2F,0x7C },
PixArtVY 0:2c144b6813d1 130 { 0x30,0x05 },
PixArtVY 0:2c144b6813d1 131 { 0x41,0x02 },
PixArtVY 0:2c144b6813d1 132 { 0x53,0xFF },
PixArtVY 0:2c144b6813d1 133 { 0x5F,0x02 },
PixArtVY 0:2c144b6813d1 134
PixArtVY 0:2c144b6813d1 135 { 0x7F,0x06 }, // Bank6, not allowed to perform SPIWriteRead
PixArtVY 0:2c144b6813d1 136 { 0x2A,0x05 }, // Write ONLY address, not allowed to perform SPIWriteRead
PixArtVY 0:2c144b6813d1 137 { 0x35,0x19 },
PixArtVY 0:2c144b6813d1 138
PixArtVY 0:2c144b6813d1 139 { 0x7F,0x07 }, // Bank7, not allowed to perform SPIWriteRead
PixArtVY 0:2c144b6813d1 140 { 0x00,0x01 },
PixArtVY 0:2c144b6813d1 141 { 0x14,0x03 },
PixArtVY 0:2c144b6813d1 142 { 0x15,0x14 },
PixArtVY 0:2c144b6813d1 143 { 0x46,0x03 },
PixArtVY 0:2c144b6813d1 144
PixArtVY 0:2c144b6813d1 145 { 0x7F,0x00 }, // Bank0, not allowed to perform SPIWriteRead
PixArtVY 0:2c144b6813d1 146 };
PixArtVY 0:2c144b6813d1 147 #define initialize_size (sizeof(initialize)/sizeof(initialize[0]))
PixArtVY 0:2c144b6813d1 148
PixArtVY 0:2c144b6813d1 149
PixArtVY 0:2c144b6813d1 150
PixArtVY 0:2c144b6813d1 151 const uint8_t modeLaser[][2] = {
PixArtVY 0:2c144b6813d1 152 { 0x7F, 0x00 }, // Bank0, not allowed to perform SPIWriteRead
PixArtVY 0:2c144b6813d1 153 { 0x09, 0x5A }, // disable write protect
PixArtVY 0:2c144b6813d1 154 { 0x53, 0x01 },
PixArtVY 0:2c144b6813d1 155 { 0x07, 0xCC },
PixArtVY 0:2c144b6813d1 156 { 0x0D, 0x05 },
PixArtVY 0:2c144b6813d1 157 { 0x0E, 0x05 },
PixArtVY 0:2c144b6813d1 158 { 0x19, 0x24 },
PixArtVY 0:2c144b6813d1 159 { 0x7F, 0x01 }, // Bank1, not allowed to perform SPIWriteRead
PixArtVY 0:2c144b6813d1 160 { 0x1D, 0x18 },
PixArtVY 0:2c144b6813d1 161 { 0x1F, 0x12 },
PixArtVY 0:2c144b6813d1 162 { 0x42, 0x40 },
PixArtVY 0:2c144b6813d1 163 { 0x37, 0x60 },
PixArtVY 0:2c144b6813d1 164 { 0x43, 0x0A },
PixArtVY 0:2c144b6813d1 165 { 0x7F, 0x04 }, // Bank4, not allowed to perform SPIWriteRead
PixArtVY 0:2c144b6813d1 166 { 0x06, 0x03 },
PixArtVY 0:2c144b6813d1 167 { 0x7F, 0x05 }, // Bank5, not allowed to perform SPIWriteRead
PixArtVY 0:2c144b6813d1 168 { 0x2E, 0x02 },
PixArtVY 0:2c144b6813d1 169 { 0x48, 0x00 },
PixArtVY 0:2c144b6813d1 170 { 0x3E, 0x05 },
PixArtVY 0:2c144b6813d1 171 { 0x7F, 0x06 }, // Bank6, not allowed to perform SPIWriteRead
PixArtVY 0:2c144b6813d1 172 { 0x34, 0x01 },
PixArtVY 0:2c144b6813d1 173 { 0x7F, 0x00 }, // Bank0, not allowed to perform SPIWriteRead
PixArtVY 0:2c144b6813d1 174 { 0x09, 0x00 }, // enable write protect
PixArtVY 0:2c144b6813d1 175 };
PixArtVY 0:2c144b6813d1 176 #define modeLaser_size (sizeof(modeLaser)/sizeof(modeLaser[0]))
PixArtVY 0:2c144b6813d1 177
PixArtVY 0:2c144b6813d1 178
PixArtVY 0:2c144b6813d1 179
PixArtVY 0:2c144b6813d1 180 const uint8_t modeLED[][2] = {
PixArtVY 0:2c144b6813d1 181 { 0x7F, 0x00 }, // Bank0, not allowed to perform SPIWriteRead
PixArtVY 0:2c144b6813d1 182 { 0x09, 0x5A }, // disable write protect
PixArtVY 0:2c144b6813d1 183 { 0x07, 0x55 },
PixArtVY 0:2c144b6813d1 184 { 0x0D, 0x7D },
PixArtVY 0:2c144b6813d1 185 { 0x0E, 0x7D },
PixArtVY 0:2c144b6813d1 186 { 0x19, 0x3C },
PixArtVY 0:2c144b6813d1 187 { 0x7F, 0x01 }, // Bank1, not allowed to perform SPIWriteRead
PixArtVY 0:2c144b6813d1 188 { 0x1D, 0x00 },
PixArtVY 0:2c144b6813d1 189 { 0x1F, 0x00 },
PixArtVY 0:2c144b6813d1 190 { 0x42, 0x20 },
PixArtVY 0:2c144b6813d1 191 { 0x37, 0x18 },
PixArtVY 0:2c144b6813d1 192 { 0x43, 0x02 },
PixArtVY 0:2c144b6813d1 193 { 0x7F, 0x04 }, // Bank4, not allowed to perform SPIWriteRead
PixArtVY 0:2c144b6813d1 194 { 0x06, 0x00 },
PixArtVY 0:2c144b6813d1 195 { 0x7F, 0x05 }, // Bank5, not allowed to perform SPIWriteRead
PixArtVY 0:2c144b6813d1 196 { 0x2E, 0x08 },
PixArtVY 0:2c144b6813d1 197 { 0x48, 0x02 },
PixArtVY 0:2c144b6813d1 198 { 0x3E, 0x85 },
PixArtVY 0:2c144b6813d1 199 { 0x7F, 0x06 }, // Bank6, not allowed to perform SPIWriteRead
PixArtVY 0:2c144b6813d1 200 { 0x34, 0x09 },
PixArtVY 0:2c144b6813d1 201 { 0x7F, 0x00 }, // Bank0, not allowed to perform SPIWriteRead
PixArtVY 0:2c144b6813d1 202 { 0x53, 0x00 },
PixArtVY 0:2c144b6813d1 203 { 0x09, 0x00 }, // enable write protect
PixArtVY 0:2c144b6813d1 204 };
PixArtVY 0:2c144b6813d1 205 #define modeLED_size (sizeof(modeLED)/sizeof(modeLED[0]))