Input/Output
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 (nRF52) (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).
Gen 4 Devices (RTL872x) (P2, Photon 2, and M-SoM):
- The drive strength on the P2, Photon 2, and M-SoM 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 (STM32) (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.