1.8.13.13 PIO_PinRead Function

C

bool PIO_PinRead(PIO_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 PIO_PIN

Returns

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

Example

bool value;
value = PIO_PinRead(PIO_PIN_PB3);

Remarks

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