int platform_read_digital_pin(int pin);

platform_read_digital_pin reads the state of a pin that's configured to be a digital input. This function is fast and does no error checking whatsoever: it is the client's responsibility to use this function correctly.


On some platforms, it may be possible to read the state of a pin configured as an output, and doing so may deliver the state of the pad or the last-written digital output state. Such functionality is not guaranteed or standardized by this API, and none of the examples written by Rowley Associates make use of this. Some processors, for instance, will correctly read the state of the pad for outputs configured as push-pull, but will not do so for outputs configured as open drain.

See Also