while(1) { msg[0] = 2; // Length of 2 msg[1] = 3; // Get last infrared value MSP430_send(hHandle, msg, 2); OSK5912_waitusec(100); MSP430_recv(hHandle, msg, 4); OSK5912_waitusec(100); } I2C Address = 0x23 ----- 0 ----- setRTC() - Set RTC parameters I2C Write 9 bytes [0] = 9 ; Message length [1] = 0 ; Command index [2] = year (LSB) [3] = year (MSB) [4] = month [5] = day [6] = hour [7] = minute [8] = second Wait 100 microseconds ----- 1 ----- getRTC() - Get RTC parameters I2C Write 2 bytes [0] = 2 ; Message length [1] = 1 ; Command index Wait 100 microseconds I2C Read 9 bytes [0] = 9 [1] = 1 [2] = year (LSB) [3] = year (MSB) [4] = month [5] = day [6] = hour [7] = minute [8] = second Wait 100 microseconds ----- 2 ----- getIRData - Get entire infrared buffer I2C Write 2 bytes [0] = 2 ; Message length [1] = 2 ; Command index Wait 100 microseconds I2C Read [variable length] [0] = message length [1] = 2 [2] = First IR value (LSB) [3] = First IR value (MSB) [4] = Second IR value (LSB) [5] = Second IR value (MSB) ... Wait 100 microseconds ----- 3 ----- getIRVal() - Get last IR value I2C Write 2 bytes [0] = 2 ; Message length [1] = 3 ; Command index Wait 100 microseconds I2C Read 4 bytes [0] = 4 [1] = 3 [2] = Last IR value (LSB) [3] = Last IR value (MSB) Wait 100 microseconds ----- 4 ----- getInputState() - Get port 2 and port 3 input state I2C Write 2 bytes [0] = 2 ; Message length [1] = 4 ; Command index Wait 100 microseconds I2C Read 4 bytes [0] = 4 [1] = 4 [2] = Port 2 I/O values (unsigned 8-bit field) [3] = Port 3 I/O values (unsigned 8-bit field) Wait 100 microseconds ----- 5 ----- getEvent() - Get outstanding events I2C Write 2 bytes [0] = 2 ; Message length [1] = 5 ; Command index Wait 100 microseconds I2C Read 4 bytes [0] = 3 [1] = 5 [2] = Events (unsigned 8-bit field) Wait 100 microseconds ----- 6 ----- setOutputState() - Set port 2 and port3 output state I2C Write 4 bytes [0] = 4 ; Message length [1] = 6 ; Command index [2] = P2 state ; All bits are ignored [3] = P3 state ; Bit 0 = SM_CE, Bit 3 = CF_PWR_ON