diff --git a/src/CoreIO.cpp b/src/CoreIO.cpp index 282b84b3..335c6150 100644 --- a/src/CoreIO.cpp +++ b/src/CoreIO.cpp @@ -178,6 +178,16 @@ void DisablePullup(Pin pin) noexcept #endif } +#if SAME5x || SAMC21 + +// Set high driver strength on an output pin +void SetHighDriveStrength(Pin p) noexcept +{ + PORT->Group[GpioPortNumber(p)].PINCFG[GpioPinNumber(p)].reg |= PORT_PINCFG_DRVSTR; +} + +#endif + // IoPort::SetPinMode calls this // Warning! Changing pin mode will reset the output drive strength to normal. void SetPinMode(Pin pin, enum PinMode mode, uint32_t debounceCutoff = 0) noexcept diff --git a/src/CoreIO.h b/src/CoreIO.h index bdc9f70f..abb98be3 100644 --- a/src/CoreIO.h +++ b/src/CoreIO.h @@ -119,6 +119,10 @@ enum class GpioPinFunction : uint8_t */ void SetPinFunction(Pin p, GpioPinFunction f) noexcept; +#if SAME5x || SAMC21 +void SetHighDriveStrength(Pin p) noexcept; +#endif + /** * @brief Set a pin back to ordinary digital I/O *