Ignore:
Timestamp:
03/12/18 15:43:28 (6 years ago)
Author:
Christian Mauderer <christian.mauderer@…>
Branches:
5, master
Children:
7c39cab
Parents:
7633f5b
git-author:
Christian Mauderer <christian.mauderer@…> (03/12/18 15:43:28)
git-committer:
Christian Mauderer <christian.mauderer@…> (03/13/18 14:04:28)
Message:

bsp/atsam: Allow setting the drive strength.

This adds a simple function for setting the PIO drive strength.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/atsam/libraries/libchip/source/pio.c

    r7633f5b r71c5552f  
    482482}
    483483
     484/**
     485 * \brief Set the drive strength of the pin.
     486 *
     487 * \param pin  Pointer to a Pin instance describing one or more pins.
     488 * \param strength  0 for low drive strength or 1 for high drive strength.
     489 */
     490void PIO_SetDriveStrength(const Pin *pin, uint8_t strength)
     491{
     492        Pio *pio = pin->pio;
     493
     494        if (strength) {
     495                pio->PIO_DRIVER |= pin->mask;
     496        } else {
     497                pio->PIO_DRIVER &= ~(pin->mask);
     498        }
     499}
Note: See TracChangeset for help on using the changeset viewer.