X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fdrivers%2Fao_adxl375.h;h=fe448fd0e27857d06592188d5aa38548ca5b6348;hb=eb77758b7dcdd0bcef12cd1d56cf4d447cbe5c8c;hp=a1ed216dc447abfefe8b139a60c64aac9e0c5f54;hpb=0686a7b8aec524d81bda4c572549a3a068ce0eed;p=fw%2Faltos diff --git a/src/drivers/ao_adxl375.h b/src/drivers/ao_adxl375.h index a1ed216d..fe448fd0 100644 --- a/src/drivers/ao_adxl375.h +++ b/src/drivers/ao_adxl375.h @@ -93,6 +93,8 @@ #define AO_ADXL375_FIFO_STATUS 0x39 +#define ADXL375_ACCEL_FULLSCALE 200 + struct ao_adxl375_sample { int16_t x; int16_t y; @@ -101,6 +103,8 @@ struct ao_adxl375_sample { extern struct ao_adxl375_sample ao_adxl375_current; +#define ao_adxl375_accel_to_sample(accel) ((accel_t) (accel) * (4095.0f / (ADXL375_ACCEL_FULLSCALE * GRAVITY))) + void ao_adxl375_init(void);