checkpoint: working sensor acquisition and axis validation

This commit is contained in:
Jay
2026-08-17 09:38:18 -04:00
commit f1ac20fb4f
16 changed files with 721 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
#pragma once
#include <stdint.h>
#include "driver/i2c_master.h"
#include "esp_err.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
i2c_master_dev_handle_t device;
uint8_t address;
} adxl345_t;
typedef struct {
int16_t x;
int16_t y;
int16_t z;
} adxl345_sample_t;
/** Detect, identify, and configure an ADXL345 for 100 Hz, full-resolution +/-8 g. */
esp_err_t adxl345_init(adxl345_t *sensor, i2c_master_bus_handle_t bus, uint32_t bus_speed_hz);
/** Read one sensor-native, uncalibrated XYZ sample. */
esp_err_t adxl345_read_raw(const adxl345_t *sensor, adxl345_sample_t *sample);
uint8_t adxl345_address(const adxl345_t *sensor);
#ifdef __cplusplus
}
#endif