pub unsafe extern "C" fn gpio_pin_get(
port: *const device,
pin: u8,
) -> i32
Expand description
@brief Get logical level of an input pin.
Get logical level of an input pin taking into account GPIO_ACTIVE_LOW flag. If pin is configured as Active High, a low physical level will be interpreted as logical value 0. If pin is configured as Active Low, a low physical level will be interpreted as logical value 1.
Note: If pin is configured as Active High, the default, gpio_pin_get() function is equivalent to gpio_pin_get_raw().
@param port Pointer to the device structure for the driver instance. @param pin Pin number.
@retval 1 If pin logical value is 1 / active. @retval 0 If pin logical value is 0 / inactive. @retval -EIO I/O error when accessing an external GPIO chip. @retval -EWOULDBLOCK if operation would block.