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

Extend custom wire pin function for STM32 #45

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions AS5600.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ AS5600::AS5600(TwoWire *wire)
}


#if defined (ESP8266) || defined(ESP32)
#if defined (ESP8266) || defined(ESP32) || defined(STM32)

bool AS5600::begin(int dataPin, int clockPin, uint8_t directionPin)
{
Expand All @@ -68,7 +68,9 @@ bool AS5600::begin(int dataPin, int clockPin, uint8_t directionPin)

if ((dataPin < 255) && (clockPin < 255))
{
_wire->begin(dataPin, clockPin);
_wire->setSDA(dataPin);
_wire->setSCL(clockPin);
_wire->begin();
} else {
_wire->begin();
}
Expand Down
4 changes: 2 additions & 2 deletions AS5600.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ class AS5600
{
public:
AS5600(TwoWire *wire = &Wire);

#if defined (ESP8266) || defined(ESP32)
#if defined (ESP8266) || defined(ESP32) || defined(STM32)
// AS5600_SW_DIRECTION_PIN is software controlled direction pin
bool begin(int dataPin, int clockPin, uint8_t directionPin = AS5600_SW_DIRECTION_PIN);
#endif
Expand Down
Loading