Changeset 71c5552f in rtems


Ignore:
Timestamp:
Mar 12, 2018, 3:43:28 PM (14 months ago)
Author:
Christian Mauderer <christian.mauderer@…>
Branches:
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.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • bsps/arm/atsam/include/libchip/include/pio.h

    r7633f5b r71c5552f  
    210210
    211211extern uint32_t PIO_GetWriteProtectViolationInfo(const Pin *pin);
     212
     213extern void PIO_SetDriveStrength(const Pin *pin, uint8_t strength);
    212214#ifdef __cplusplus
    213215}
  • 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.