Skip to content

I2c reset functionality #678

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

Merged
merged 2 commits into from
Sep 29, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Use newly added i2cReset function within the wire library.
  • Loading branch information
lonerzzz committed Sep 28, 2017
commit 03c31a0b3f454912fb3ab553787689ba677d21b0
7 changes: 7 additions & 0 deletions libraries/Wire/src/Wire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,11 @@ void TwoWire::flush(void)
txLength = 0;
}

void TwoWire::reset(void)
{
i2cReset( i2c );
i2c = NULL;
begin( sda, scl );
}

TwoWire Wire = TwoWire(0);
2 changes: 2 additions & 0 deletions libraries/Wire/src/Wire.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ class TwoWire: public Stream
int peek(void);
void flush(void);

void reset(void);

inline size_t write(const char * s)
{
return write((uint8_t*) s, strlen(s));
Expand Down