altos: TeleMetrum v3.0 has ADXL375 and Max-8Q
authorKeith Packard <keithp@keithp.com>
Sat, 23 Nov 2019 01:18:58 +0000 (17:18 -0800)
committerKeith Packard <keithp@keithp.com>
Sat, 23 Nov 2019 01:18:58 +0000 (17:18 -0800)
Replacce the mma655x driver with the adxl375 driver

Signed-off-by: Keith Packard <keithp@keithp.com>
src/telemetrum-v3.0/Makefile
src/telemetrum-v3.0/ao_pins.h
src/telemetrum-v3.0/ao_telemetrum.c

index fb379aa..68a540c 100644 (file)
@@ -18,7 +18,7 @@ INC = \
        ao_kalman.h \
        ao_product.h \
        ao_ms5607.h \
-       ao_mma655x.h \
+       ao_adxl375.h \
        ao_cc1200_CC1200.h \
        ao_profile.h \
        ao_task.h \
@@ -64,7 +64,7 @@ ALTOS_SRC = \
        ao_fec_rx.c \
        ao_data.c \
        ao_ms5607.c \
-       ao_mma655x.c \
+       ao_adxl375.c \
        ao_adc_stm.c \
        ao_beep_stm.c \
        ao_storage.c \
index f4ccc9f..68bec1b 100644 (file)
@@ -277,15 +277,16 @@ struct ao_adc {
 
 #define HAS_HIGHG_ACCEL                1
 
-/*
- * mma655x
- */
+/* ADXL375 */
+
+#define HAS_ADXL375            1
+#define AO_ADXL375_SPI_INDEX   (AO_SPI_1_PB3_PB4_PB5 | AO_SPI_MODE_3)
+#define AO_ADXL375_CS_PORT     (&stm_gpiob)
+#define AO_ADXL375_CS_PIN      9
+#define AO_ADXL375_SPI_SPEED   AO_SPI_SPEED_4MHz
 
-#define HAS_MMA655X            1
-#define AO_MMA655X_SPI_INDEX   AO_SPI_1_PB3_PB4_PB5
-#define AO_MMA655X_CS_PORT     (&stm_gpiob)
-#define AO_MMA655X_CS_PIN      9
-#define AO_MMA655X_INVERT      1
+#define AO_ADXL375_AXIS                x
+#define AO_ADXL375_INVERT      1
 
 #define NUM_CMDS               16
 
index d75f339..148e1f7 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <ao.h>
 #include <ao_ms5607.h>
-#include <ao_mma655x.h>
+#include <ao_adxl375.h>
 #include <ao_log.h>
 #include <ao_exti.h>
 #include <ao_packet.h>
@@ -52,17 +52,11 @@ main(void)
        ao_exti_init();
 
        ao_adc_init();
-#if HAS_BEEP
        ao_beep_init();
-#endif
        ao_cmd_init();
 
-#if HAS_MS5607
        ao_ms5607_init();
-#endif
-#if HAS_MMA655X
-       ao_mma655x_init();
-#endif
+       ao_adxl375_init();
 
        ao_eeprom_init();