Function a121_sys::acc_sensor_prepare
source · pub unsafe extern "C" fn acc_sensor_prepare(
sensor: *mut acc_sensor_t,
config: *const acc_config_t,
cal_result: *const acc_cal_result_t,
buffer: *mut c_void,
buffer_size: u32
) -> boolExpand description
@brief Prepare a sensor to do a measurement
It’s possible to reconfigure the sensor by calling the function multiple times.
Note:
- The sensor must be powered on when calling this function.
- The sensor must not be measuring when calling this function, if previous call was @ref acc_sensor_measure use @ref acc_hal_integration_wait_for_sensor_interrupt to wait for measurement to complete.
- Reconfiguring is not supported when double buffering is active, however enabling double buffering through reconfiguration is.
@param[in] sensor The sensor instance to prepare @param[in] config The configuration to prepare for @param[in] cal_result The calibration result to prepare for @param[in] buffer Memory used during preparation. A larger buffer might mean fewer transactions between host and sensor. The buffer will only be used during the duration of this call. The client has to make sure this buffer is suitably aligned for any built-in type. @param[in] buffer_size The size in bytes of the buffer, should be at least buffer_size from @ref acc_rss_get_buffer_size @return true if successful, false otherwise