Jump to main content

##

# 1.2.9.2 SYS_PORT_PinRead Function

## C

    bool SYS_PORT_PinRead(SYS_PORT_PIN pin)

## Summary

Read the selected pin value.

## Description

This function reads the selected pin value. it reads the value regardless of pin configuration, whether uniquely as an input, or driven by the PIO Controller, or driven by peripheral.

## Precondition

Reading the I/O line levels requires the clock of the PIO Controller to be enabled, otherwise this API reads the levels present on the I/O line at the time the clock was disabled.

## Parameters

Param | Description
--- | ---
pin | One of the IO pins from the enum SYS_PORT_PIN

## Returns

Returns the read value of the selected I/O pin.

## Example

    bool value;
    value = SYS_PORT_PinRead(SYS_PORT_PIN_PB3);

## Remarks

To read the latched value on this pin, SYS_PORT_PinLatchRead API should be used.