Implemented first Hangar-Service

Dependencies:   CalibrateMagneto QuaternionMath

Fork of SML2 by TobyRich GmbH

I2CPeripheral.h

Committer:
pvaibhav
Date:
2015-02-12
Revision:
5:b9f2f62a8f90
Parent:
0:943820483318
Child:
7:604a8369b801

File content as of revision 5:b9f2f62a8f90:

#ifndef _H_I2CPERIPHERAL_H
#define _H_I2CPERIPHERAL_H

#include "mbed.h"

class I2CPeripheral
{
protected:
    I2C* mBus;
    uint8_t mAddress;
    
protected:
    void write_reg(const uint8_t reg, const uint8_t val);
    uint8_t read_reg(const uint8_t reg);
    void read_reg(const uint8_t reg, uint8_t* destination, const size_t nBytes = 1);

public:
    I2CPeripheral(I2C &i2c, const uint8_t address);
};

#endif//_H_I2CPERIPHERAL_H