/*
 * accel.h
 *
 *  Created on: Oct 13, 2024
 *      Author: true
 */

#ifndef USER_MISC_ACCEL_H_
#define USER_MISC_ACCEL_H_


#include <stdint.h>



#define LIS2DW_I2C_ADDR             0x30
#define LIS2DW_I2C_ADDR_SDO_LOW     0x32



typedef struct AccelData {
    int16_t x;
    int16_t y;
    int16_t z;
} AccelData;



extern AccelData accel;
extern uint8_t accel_found;

extern uint16_t movement_worst;



void accel_init();
void accel_poll();

int8_t accel_get_rotation(struct AccelData *a);
int16_t accel_get_movement();



#endif /* USER_MISC_ACCEL_H_ */
