diff options
author | Christian Mauderer <christian.mauderer@embedded-brains.de> | 2018-03-12 16:43:28 +0100 |
---|---|---|
committer | Christian Mauderer <christian.mauderer@embedded-brains.de> | 2018-03-13 15:04:28 +0100 |
commit | 71c5552f9a7c2fbe27b860fafc295427955f25a1 (patch) | |
tree | bb6a6766573a73656e2755e74258dc4ed97384cb /c | |
parent | sparc64: Move libcpu content to cpukit (diff) | |
download | rtems-71c5552f9a7c2fbe27b860fafc295427955f25a1.tar.bz2 |
bsp/atsam: Allow setting the drive strength.
This adds a simple function for setting the PIO drive strength.
Diffstat (limited to 'c')
-rw-r--r-- | c/src/lib/libbsp/arm/atsam/libraries/libchip/source/pio.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/pio.c b/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/pio.c index e39825dfa5..d6df587464 100644 --- a/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/pio.c +++ b/c/src/lib/libbsp/arm/atsam/libraries/libchip/source/pio.c @@ -481,3 +481,19 @@ void PIO_SetPinType(Pin *pin, uint8_t pinType) pin->type = pinType; } +/** + * \brief Set the drive strength of the pin. + * + * \param pin Pointer to a Pin instance describing one or more pins. + * \param strength 0 for low drive strength or 1 for high drive strength. + */ +void PIO_SetDriveStrength(const Pin *pin, uint8_t strength) +{ + Pio *pio = pin->pio; + + if (strength) { + pio->PIO_DRIVER |= pin->mask; + } else { + pio->PIO_DRIVER &= ~(pin->mask); + } +} |