Skip to content

Add end() for GenericDevice #145

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions Adafruit_GenericDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ bool Adafruit_GenericDevice::begin(void) {
return true;
}

/*!
@brief Marks the GenericDevice as no longer in use.
@note: Since this is a GenericDevice, if you are using this with a Serial
object, this does NOT disable serial communication or release the RX/TX pins.
That must be done manually by calling Serial.end().
*/
void Adafruit_GenericDevice::end(void) { _begun = false; }

/*! @brief Write a buffer of data
@param buffer Pointer to buffer of data to write
@param len Number of bytes to write
Expand Down
1 change: 1 addition & 0 deletions Adafruit_GenericDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class Adafruit_GenericDevice {
busio_genericdevice_writereg_t writereg_func = nullptr);

bool begin(void);
void end(void);

bool read(uint8_t *buffer, size_t len);
bool write(const uint8_t *buffer, size_t len);
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Adafruit BusIO
version=1.17.1
version=1.17.2
author=Adafruit
maintainer=Adafruit <[email protected]>
sentence=This is a library for abstracting away UART, I2C and SPI interfacing
Expand Down