I2CSlave test program. I2CSlave library has some improper behavior, so this program is able to watch that. The workaround for this behavior, only for NXP device, is wrote in 'I2CSlave_mod_NXP.cpp'.

Dependencies:   mbed

First, write this program to the microcontroller which you want to check. Second, send I2C data to the microcontroller from the other one. Anything is enough for the transmission data, but the data length is made 8, 9, 10 and 11 bytes and confirm each reply.

I2CSlave_mod/I2CSlave_mod_NXP.h

Committer:
oks486
Date:
2016-04-15
Revision:
1:bd94bb3170b6

File content as of revision 1:bd94bb3170b6:

#ifndef I2C_SLAVE_NXP_MOD_H
#define I2C_SLAVE_NXP_MOD_H

#include "mbed.h"

class I2CSlave_mod : public I2CSlave {
public:
    I2CSlave_mod(PinName sda, PinName scl);
    int read(char *data, int length);       // hiding read function of parent class

protected:
    int i2c_slave_read_mod(i2c_t *obj, char *data, int length);
};

#endif