Plese use this class with my "i2cmaster" class.
Dependents: 2016_slave_rorikon_2 2016_slave_cylinder 2016_slave_MD 2016_slave_MD_rorikon ... more
i2cslave.h
- Committer:
- sgrsn
- Date:
- 2019-12-17
- Revision:
- 3:6e9ecf7b83e3
- Parent:
- 2:0dff052266ca
File content as of revision 3:6e9ecf7b83e3:
#ifndef MBED_I2CSLAVE_H #define MBED_I2CSLAVE_H #include "mbed.h" namespace mbed { class i2cslave : public I2CSlave { public: int32_t *Registar; i2cslave(PinName sda, PinName scl, int32_t *Registar); void getdata(); void attach(void (*fptr)(void)); template<typename T> void attach(T* tptr, void (T::*mptr)(void)) { fp.attach(tptr, mptr); enable_attach(); } void enable_attach(); void disable_attach(); static void func_call(uint32_t id, uint8_t addr, uint8_t state); protected: FunctionPointer fp; }; } #endif