Type Alias riot_sys::saul_write_t

source ·
pub type saul_write_t = Option<unsafe extern "C" fn(dev: *const c_void, data: *const phydat_t) -> c_int>;
Expand description

@brief Write a value (a set of values) to a device

Most sensors will probably just return -ENOTSUP, as writing values to a sensor is often without purpose. The interface can however be used to configure sensors, e.g. to switch a sensor’s unit type by writing the newly selected type to it.

For actuators this function is used to influence the actuators state, e.g. switching a switch or setting the speed of a motor.

@param[in] dev device descriptor of the target device @param[in] data data to write to the device

@return number of values actually processed by the device [1-3] @return -ENOTSUP if the device does not support this operation @return -ECANCELED on other errors

Aliased Type§

enum saul_write_t {
    None,
    Some(unsafe extern "C" fn(_: *const c_void, _: *const phydat_t) -> i32),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(_: *const c_void, _: *const phydat_t) -> i32)

Some value of type T.