Skip to content

New serial begin method for ESP32 to allow the user to specify the cor… #113

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

Closed
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
17 changes: 17 additions & 0 deletions Adafruit_Fingerprint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,23 @@ void Adafruit_Fingerprint::begin(uint32_t baudrate) {
#endif
}

#if defined(ESP32)
/**************************************************************************/
/*!
@brief Initializes serial interface and baud rate
@param baudrate Sensor's UART baud rate (usually 57600, 9600 or 115200)
@param rxPin pin
@param txPin pin
*/
/**************************************************************************/
void Adafruit_Fingerprint::begin(uint32_t baudrate, int8_t rxPin,
int8_t txPin) {
delay(1000); // one second delay to let the sensor 'boot up'

hwSerial->begin(baudrate, SERIAL_8N1, rxPin, txPin);
}
#endif

/**************************************************************************/
/*!
@brief Verifies the sensors' access password (default password is
Expand Down
3 changes: 3 additions & 0 deletions Adafruit_Fingerprint.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ class Adafruit_Fingerprint {
Adafruit_Fingerprint(Stream *serial, uint32_t password = 0x0);

void begin(uint32_t baud);
#if defined(ESP32)
void begin(uint32_t baud, int8_t rxPin, int8_t txPin);
#endif

boolean verifyPassword(void);
uint8_t getParameters(void);
Expand Down