Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
I2CSlaveComm.h
- Committer:
- gmfortier
- Date:
- 2019-05-06
- Revision:
- 8:e82e5b78dbbd
- Parent:
- 3:29925a0f88da
File content as of revision 8:e82e5b78dbbd:
#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 setTension(double value); void flow(); void cycle(); void commandselect(); void setStartingValue(); void resetCycle(); #endif