| Line 10... |
Line 10... |
| 10 |
uint8_t buffer[8];
|
10 |
uint8_t buffer[8];
|
| 11 |
|
11 |
|
| 12 |
buffer[0] = 0x00; // Starting register address
|
12 |
buffer[0] = 0x00; // Starting register address
|
| 13 |
buffer[1] = 0xFF; // IODIR, Set all pins as inputs
|
13 |
buffer[1] = 0xFF; // IODIR, Set all pins as inputs
|
| 14 |
buffer[2] = 0xFF; // IPOL, Reported values are inverted
|
14 |
buffer[2] = 0xFF; // IPOL, Reported values are inverted
|
| 15 |
buffer[3] = 0xFF; // GPINTEN, Enable interrupt-on-change
|
15 |
// buffer[3] = 0xFF; // GPINTEN, Enable interrupt-on-change
|
| - |
|
16 |
buffer[3] = 0x00; // GPINTEN, Disable interrupt-on-change
|
| 16 |
buffer[4] = 0x00; // DEFVAL, IOC default values
|
17 |
buffer[4] = 0x00; // DEFVAL, IOC default values
|
| 17 |
buffer[5] = 0x00; // INTCON, IOC compare to previous value
|
18 |
buffer[5] = 0x00; // INTCON, IOC compare to previous value
|
| 18 |
buffer[6] = 0x00; // IOCON, Incrementing address, active-low interrupt cleared on GPIO read
|
19 |
buffer[6] = 0x00; // IOCON, Incrementing address, active-low interrupt cleared on GPIO read
|
| 19 |
buffer[7] = 0xFF; // GPPU, Enable pull-ups on all pins
|
20 |
buffer[7] = 0xFF; // GPPU, Enable pull-ups on all pins
|
| 20 |
|
21 |
|