/* Helper function for calculating gyroscope ranges. Considers the current full-scale register config.  */
static void icm42688_emul_get_gyro_ranges(const struct emul *target, q31_t *lower, q31_t *upper, q31_t *epsilon, int8_t *shift)
/* Helper function for calculating gyroscope ranges. Considers the current full-scale register config.  */
static void icm42688_emul_get_gyro_ranges(const struct emul *target, q31_t *lower, q31_t *upper, q31_t *epsilon, int8_t *shift)
{
	int fs_mdps;
	int sensitivity;
	icm42688_emul_get_gyro_settings(target, &fs_mdps, &sensitivity, shift);
	fs_mdps *= 0.99;
	*epsilon = (3 * SENSOR_PI * Q31_SCALE * 10LL / 1000000LL / 180LL / sensitivity / 2LL) >>
		   *shift;
	*upper = (((fs_mdps * SENSOR_PI / 1000000LL) * Q31_SCALE) / 1000LL / 180LL) >> *shift;
	*lower = -*upper;
}