Type Alias riot_sys::saul_read_t
source · pub type saul_read_t = Option<unsafe extern "C" fn(dev: *const c_void, res: *mut phydat_t) -> c_int>;
Expand description
@brief Read a value (a set of values) from a device
Simple sensors, as e.g. a temperature sensor, will return exactly one value together with the values scale and unit. Some sensors might return a tuple or triple of data (e.g. a 3-axis accelerometer).
Actuators can chose to either just return -ENOTSUP or to return their current set value (e.g. useful for reading back the current state of a switch)
@param[in] dev device descriptor of the target device @param[out] res data read from the device
@return number of values written into to result data structure [1-3] @return -ENOTSUP if the device does not support this operation @return -ECANCELED on other errors
Aliased Type§
enum saul_read_t {
None,
Some(unsafe extern "C" fn(_: *const c_void, _: *mut phydat_t) -> i32),
}