Input/Output

pinSetDriveStrength()

pinSetDriveStrength

Since 2.0.0:

// PROTOTYPE
int pinSetDriveStrength(pin_t pin, DriveStrength drive);

Sets the pin drive strength on Gen 3 devices with Device OS 2.0.0 and later, or P2/Photon 2 (RTL872x) with Device OS 5.5.0 and later.

DriveStrength is one of:

  • DriveStrength::DEFAULT (STANDARD)
  • DriveStrength::STANDARD
  • DriveStrength::HIGH

Returns SYSTEM_ERROR_NONE (0) on success, or a non-zero system error code on error.

The drive strength is typically 2 mA in standard drive mode (the default), and 9 mA in high drive mode.

Parameter Symbol Conditions Min Typ Max Unit
Current at GND+0.4 V, output set low, high drive IOL,HDL V3V3 >= 2.7V 6 10 15 mA
Current at V3V3-0.4 V, output set high, high drive IOH,HDH V3V3 >= 2.7V 6 9 14 mA
Current at GND+0.4 V, output set low, standard drive IOL,SD V3V3 >= 2.7V 1 2 4 mA
Current at V3V3-0.4 V, output set high, standard drive IOH,SD V3V3 >= 2.7V 1 2 4 mA

Gen 3 Devices (B-Series SoM, Tracker SoM, Tracker One, Boron, Argon, and E404X):

  • On nRF52 devices, this call can be used to change the pin drive strength from 2 mA (default, standard) to 9 mA (high drive strength).


P2 and Photon 2 Devices:

  • The drive strength on the P2 and Photon 2 is 4 mA per pin in normal drive and 12 mA per pin in high drive mode.
  • There is a maximum of 200 mA across all pins. On the P2, the total maximum could be further limited by your 3.3V regulator.
  • Drive strength selection is only available in Device OS 5.5.0 and later on RTL872x devices.


Gen 2 Devices (E-Series, Electron, Photon, and P2; does not include E404X):

  • On Gen 2 devices (Photon, P1, Electron, and E-Series) the pin drive strength is always 25 mA and cannot be changed.
  • This API is not available on Gen 2 devices.