Skip to content

Commit 6d93baa

Browse files
authored
feat(perimgr): add function to retrieve detaching CB
Allows to get the CB pointer for a Peripheral Manager Bus Type. It can be used to verify if it is already set and also in case the application needs to change the CB to something else and latter restore the original CB to that Bus Type.
1 parent 7bfd451 commit 6d93baa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cores/esp32/esp32-hal-periman.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ int8_t perimanGetPinBusChannel(uint8_t pin);
134134
// Sets the peripheral destructor callback. Used to destroy bus when pin is assigned another function
135135
bool perimanSetBusDeinit(peripheral_bus_type_t type, peripheral_bus_deinit_cb_t cb);
136136

137+
// Get the peripheral destructor callback. It allows changing/restoring the peripheral pin function detaching, if necessary
138+
// retrns NULL is none is set
139+
peripheral_bus_deinit_cb_t perimanSetBusDeinit(peripheral_bus_type_t type);
140+
137141
// Check if given pin is a valid GPIO number
138142
bool perimanPinIsValid(uint8_t pin);
139143

0 commit comments

Comments
 (0)