i2c slave class to RaspberryPi with interrupt
Fork of i2cslave by
i2cslave.h
- Committer:
- sgrsn
- Date:
- 2018-07-12
- Revision:
- 2:0dff052266ca
- Parent:
- 0:69b088a9899b
- Child:
- 3:5d19d3a231b3
File content as of revision 2:0dff052266ca:
#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