-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Fix ambiguous for TwoWire::requestFrom() methods and align API with Arduino.cc #8817
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
me-no-dev
merged 27 commits into
espressif:master
from
safocl:TwoWireInheritFromHardwareI2C
Jan 31, 2024
Merged
Changes from 23 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
cba06d1
Fix ambiguous for TwoWire::requestFrom() methods.
safocl 14660ef
Remove TwoWire::begin(int) overload
safocl 0454e3a
Rewrite TwoWire with using HardwareI2C
safocl c7a3b6e
Merge branch 'master' into TwoWireInheritFromHardwareI2C
safocl b36ff08
Fix TwoWire::end() return type.
safocl f294609
Fix TwoWire::setClock() return type.
safocl a1e2e69
Fix no return statement in the TwoWire::requestFrom.
safocl 70a5316
Merge branch 'master' into TwoWireInheritFromHardwareI2C
lucasssvaz b2ad191
Merge branch 'espressif:master' into TwoWireInheritFromHardwareI2C
safocl fca0f85
fix(libraries/Wire): fix bad return-statement
safocl 135ad6a
style(libraries/Wire): replace tabs with spaces
safocl 3cf20e0
refactor(libraries/Wire): use slave without support
safocl e56d262
Merge branch 'espressif:master' into TwoWireInheritFromHardwareI2C
safocl 7a351dd
refactor(libraries/Wire): remove unused variables
safocl 011a2da
refactor(libraries/Wire): remove unused variables
safocl a6115ae
fix(libraries/Wire): hide slave support elements
safocl a787d49
Merge branch 'espressif:master' into TwoWireInheritFromHardwareI2C
safocl 1b9f656
refactor(libraries/Wire): remove temporary comment
safocl 75f8ee9
fix(libraries/Wire): restore an accidentally deleted implementation
safocl 5d3c8c7
Merge branch 'espressif:master' into TwoWireInheritFromHardwareI2C
safocl 07154af
refactor(libraries/Wire): return return types
safocl 69a5890
fix(libraries/Wire): fix return type
safocl 35c0568
refactor(libraries/Wire): add return statement if slave isn't supported
safocl eacea66
refactor(libraries/Wire): fix indentation
safocl b1ca983
refactor(libraries/Wire): fix indentation
safocl bca2887
refactor(libraries/Wire): fix indentation
safocl 311330e
refactor(libraries/Wire): remove unnecessary empty lines
safocl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
Copyright (c) 2016 Arduino LLC. All right reserved. | ||
|
||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
|
||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
See the GNU Lesser General Public License for more details. | ||
|
||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <inttypes.h> | ||
#include "Stream.h" | ||
|
||
class HardwareI2C : public Stream | ||
{ | ||
public: | ||
virtual bool begin() = 0; | ||
virtual bool begin(uint8_t address) = 0; | ||
virtual bool end() = 0; | ||
|
||
virtual bool setClock(uint32_t freq) = 0; | ||
|
||
virtual void beginTransmission(uint8_t address) = 0; | ||
virtual uint8_t endTransmission(bool stopBit) = 0; | ||
virtual uint8_t endTransmission(void) = 0; | ||
|
||
virtual size_t requestFrom(uint8_t address, size_t len, bool stopBit) = 0; | ||
virtual size_t requestFrom(uint8_t address, size_t len) = 0; | ||
|
||
virtual void onReceive(void(*)(int)) = 0; | ||
virtual void onRequest(void(*)(void)) = 0; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.