zephyr::raw

Function gpio_add_callback

source
pub unsafe extern "C" fn gpio_add_callback(
    port: *const device,
    callback: *mut gpio_callback,
) -> i32
Expand description

@brief Add an application callback. @param port Pointer to the device structure for the driver instance. @param callback A valid Application’s callback structure pointer. @retval 0 If successful @retval -ENOSYS If driver does not implement the operation @retval -errno Other negative errno code on failure.

@note Callbacks may be added to the device from within a callback handler invocation, but whether they are invoked for the current GPIO event is not specified.

Note: enables to add as many callback as needed on the same port.