zephyr::raw

Function gpio_pin_set

source
pub unsafe extern "C" fn gpio_pin_set(
    port: *const device,
    pin: u8,
    value: i32,
) -> i32
Expand description

@brief Set logical level of an output pin.

Set logical level of an output pin taking into account GPIO_ACTIVE_LOW flag. Value 0 sets the pin in logical 0 / inactive state. Any value other than 0 sets the pin in logical 1 / active state. If pin is configured as Active High, the default, setting it in inactive state will force the pin to a low physical level. If pin is configured as Active Low, setting it in inactive state will force the pin to a high physical level.

Note: If pin is configured as Active High, gpio_pin_set() function is equivalent to gpio_pin_set_raw().

@param port Pointer to the device structure for the driver instance. @param pin Pin number. @param value Value assigned to the pin.

@retval 0 If successful. @retval -EIO I/O error when accessing an external GPIO chip. @retval -EWOULDBLOCK if operation would block.