Hortau / Mbed 2 deprecated Tensiometer_Simulator_waterbench

Dependencies:   mbed

I2CSlaveComm.h

Committer:
eboily1
Date:
2018-10-31
Revision:
1:85afd4bd4651
Parent:
0:265fff2cfb0a
Child:
2:d0308b3aaf69

File content as of revision 1:85afd4bd4651:

#ifndef __I2C_SLAVE_COMM__
#define __I2C_SLAVE_COMM__

#define MAX_WRITE_SIZE 8
#include "mbed.h"


class I2CSlaveCustom : public I2CSlave
{
    public:

    I2CSlaveCustom(PinName sda, PinName scl) : I2CSlave(sda, scl)
    {

    }

    int getCount()
    {
        int result = _i2c.i2c.handle.XferSize;
        if (result > MAX_WRITE_SIZE || result < 0)
            return 0;
        return result;
    }


};


void InitI2CSlaveComm();
void I2CSlaveProcess();
void setADC(unsigned short value);

#endif