#pragma once

#include "data/config/InertialConfig.h"

namespace inertia
{

/** GyroFilterBandwith */
enum GyroFilterBandwith { // low pass filter bandwidth in Hertz
	GYRO_FILTER_256 = 0,
	GYRO_FILTER_188,
	GYRO_FILTER_98,
	GYRO_FILTER_42,
	GYRO_FILTER_20,
	GYRO_FILTER_10,
	GYRO_FILTER_5
};

struct INERTIA_API GyroConfig
	: InertialConfig
{
	uint8_t rateDivider; // sample rate divider, Fsample = Finternal / (divider+1))
	GyroFilterBandwith filter; // low pass filter bandwidth
	bool fullscale;

	GyroConfig();
	GyroConfig(uint8_t const* in);
	GyroConfig(std::wstring const& argString);

#ifdef WITH_BOOST_PROGRAM_OPTIONS
	static const po::options_description GetOptionDescription();
#endif

	static unsigned GetLength();
	void GetBytes(std::vector<uint8_t>& out) const override;
	ConfigType GetConfigType() const override;
	const std::wstring ToString() const override;
	const std::wstring ToSimpleString(uint16_t const globalRate) const;
	double GetRangeFactor() const override;
	uint16_t GetMaxRate() const override;
};

}
