Lines Matching full:shift

191 void bma4xx_emul_set_accel_data(const struct emul *target, q31_t value, int8_t shift, int8_t reg)  in bma4xx_emul_set_accel_data()  argument
196 /* floor(9.80665 * 2^(31−4)) q31_t in (-2^4, 2^4) => range_g = shift of 4 */ in bma4xx_emul_set_accel_data()
206 unshifted = shift < 0 ? ((int64_t)value >> -shift) : ((int64_t)value << shift); in bma4xx_emul_set_accel_data()
214 /* lsb register uses top 12 of 16 bits to hold value so shift by 4 to fill it */ in bma4xx_emul_set_accel_data()
220 const q31_t *value, int8_t shift) in bma4xx_emul_backend_set_channel() argument
231 bma4xx_emul_set_accel_data(target, value[0], shift, BMA4XX_REG_DATA_8); in bma4xx_emul_backend_set_channel()
234 bma4xx_emul_set_accel_data(target, value[0], shift, BMA4XX_REG_DATA_10); in bma4xx_emul_backend_set_channel()
237 bma4xx_emul_set_accel_data(target, value[0], shift, BMA4XX_REG_DATA_12); in bma4xx_emul_backend_set_channel()
240 bma4xx_emul_set_accel_data(target, value[0], shift, BMA4XX_REG_DATA_8); in bma4xx_emul_backend_set_channel()
241 bma4xx_emul_set_accel_data(target, value[1], shift, BMA4XX_REG_DATA_10); in bma4xx_emul_backend_set_channel()
242 bma4xx_emul_set_accel_data(target, value[2], shift, BMA4XX_REG_DATA_12); in bma4xx_emul_backend_set_channel()
255 q31_t *upper, q31_t *epsilon, int8_t *shift) in bma4xx_emul_backend_get_sample_range() argument
257 if (!lower || !upper || !epsilon || !shift) { in bma4xx_emul_backend_get_sample_range()
275 *shift = 5; in bma4xx_emul_backend_get_sample_range()
278 /* (1 << (31 - shift) >> 12) * 2 (where 2 comes from 2g range) */ in bma4xx_emul_backend_get_sample_range()
282 *shift = 6; in bma4xx_emul_backend_get_sample_range()
285 /* (1 << (31 - shift) >> 12) * 4 (where 4 comes from 4g range) */ in bma4xx_emul_backend_get_sample_range()
289 *shift = 7; in bma4xx_emul_backend_get_sample_range()
292 /* (1 << (31 - shift) >> 12) * 8 (where 8 comes from 8g range) */ in bma4xx_emul_backend_get_sample_range()
296 *shift = 8; in bma4xx_emul_backend_get_sample_range()
299 /* (1 << (31 - shift) >> 12) * 16 (where 16 comes from 16g range) */ in bma4xx_emul_backend_get_sample_range()