tasks/accelerometer.c
// Configure accelerometer with given configuration.
// Important: The configuration will have implemented configuration error codes as output.
Configure accelerometer with given configuration.
Important: The configuration will have implemented configuration error codes as output.
Configure accelerometer with given configuration . Important : The configuration will have implemented configuration error codes as output .
ruuvi_status_t task_accelerometer_setup(const ruuvi_sensor_configuration_t* configuration)
{
  if(!m_sensor_is_init) { return RUUVI_ERROR_INVALID_STATE; }
  ruuvi_status_t err_code = acceleration_sensor.samplerate_set(configuration->samplerate);
  PLATFORM_LOG_DEBUG("Accelerometer samplerate status: %X", err_code);
  err_code = acceleration_sensor.scale_set(configuration->scale);
  PLATFORM_LOG_DEBUG("Accelerometer scale status: %X", err_code);
  err_code = acceleration_sensor.resolution_set(configuration->resolution);
  PLATFORM_LOG_DEBUG("Accelerometer resolution status: %X", err_code);
  err_code = acceleration_sensor.mode_set(configuration->mode);
  PLATFORM_LOG_DEBUG("Accelerometer mode status: %X", err_code);
  return err_code;
}
ruuvi_status_t task_accelerometer_setup ( const ruuvi_sensor_configuration_t * configuration ) { if ( ! m_sensor_is_init ) { return RUUVI_ERROR_INVALID_STATE ; } ruuvi_status_t err_code = acceleration_sensor . samplerate_set ( configuration -> samplerate ) ; PLATFORM_LOG_DEBUG ( " " , err_code ) ; err_code = acceleration_sensor . scale_set ( configuration -> scale ) ; PLATFORM_LOG_DEBUG ( " " , err_code ) ; err_code = acceleration_sensor . resolution_set ( configuration -> resolution ) ; PLATFORM_LOG_DEBUG ( " " , err_code ) ; err_code = acceleration_sensor . mode_set ( configuration -> mode ) ; PLATFORM_LOG_DEBUG ( " " , err_code ) ; return err_code ; }
Configure accelerometer with given configuration.
Configure accelerometer with given configuration .