Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for overriding TwoWire class's internal functions #2245

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions wiring/inc/spark_wiring_i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class WireTransmission {

class TwoWire : public Stream
{
private:
protected:
hal_i2c_interface_t _i2c;

public:
Expand All @@ -96,29 +96,29 @@ class TwoWire : public Stream
void setSpeed(uint32_t);
void enableDMAMode(bool);
void stretchClock(bool);
void begin();
void begin(uint8_t);
void begin(int);
void beginTransmission(uint8_t);
void beginTransmission(int);
void beginTransmission(const WireTransmission& transfer);
void end();
uint8_t endTransmission(void);
uint8_t endTransmission(uint8_t);
size_t requestFrom(uint8_t, size_t);
size_t requestFrom(uint8_t, size_t, uint8_t);
size_t requestFrom(const WireTransmission& transfer);
virtual void begin();
virtual void begin(uint8_t);
virtual void begin(int);
virtual void beginTransmission(uint8_t);
virtual void beginTransmission(int);
virtual void beginTransmission(const WireTransmission& transfer);
virtual void end();
virtual uint8_t endTransmission(void);
virtual uint8_t endTransmission(uint8_t);
virtual size_t requestFrom(uint8_t, size_t);
virtual size_t requestFrom(uint8_t, size_t, uint8_t);
virtual size_t requestFrom(const WireTransmission& transfer);
virtual size_t write(uint8_t);
virtual size_t write(const uint8_t *, size_t);
virtual int available(void);
virtual int read(void);
virtual int peek(void);
virtual void flush(void);
void onReceive(void (*)(int));
void onRequest(void (*)(void));
virtual void onReceive(void (*)(int));
virtual void onRequest(void (*)(void));

bool lock();
bool unlock();
virtual bool lock();
virtual bool unlock();

inline size_t write(unsigned long n) { return write((uint8_t)n); }
inline size_t write(long n) { return write((uint8_t)n); }
Expand Down