diff Small_CPU/Inc/i2c.h @ 571:91a8f9893e68

Reactivate compass parameter stored in NVM: The calibration parameters are stored in NVM but the automatic restore function during startup was no longer active. As result the compass needed to be calibration after every RTE update. In addition compass HW was detected at every startup causing some i2c "trouble" because of adressing not available devices. The compass HW info is now stored together with the calibration parameters to avoid i2C problems.
author Ideenmodellierer
date Wed, 25 Nov 2020 20:16:20 +0100
parents 3328189786e7
children
line wrap: on
line diff
--- a/Small_CPU/Inc/i2c.h	Mon Nov 30 20:55:23 2020 +0100
+++ b/Small_CPU/Inc/i2c.h	Wed Nov 25 20:16:20 2020 +0100
@@ -8,9 +8,15 @@
 
 /* Compass/Accelerometer */
 #define COMPASS_NOT_RECOGNIZED  		0xAA	///< id used with hardwareCompass
-#define	compass_generation1				0x01	// Hardware gen 1 (Two chip solution with MMA8452Q and HMC5883L)
-#define	compass_generation2				0x02	// Hardware gen 2 (Single chip solution LSM303D)
-#define	compass_generation3				0x03	// Hardware gen 3 (Single chip solution LSM303AGR)
+
+typedef enum
+{
+	compass_generation_undef =			0x00,
+	compass_generation1,						// Hardware gen 1 (Two chip solution with MMA8452Q and HMC5883L)
+	compass_generation2,						// Hardware gen 2 (Single chip solution LSM303D)
+	compass_generation3,						// Hardware gen 3 (Single chip solution LSM303AGR)
+	compass_generation_future
+} compass_generation_t;
 
 #define DEVICE_ACCELARATOR_MMA8452Q 	0x38	// Hardware gen 1 (Two chip solution with MMA8452Q and HMC5883L)
 #define DEVICE_COMPASS_HMC5883L			0x3C	// Hardware gen 1 (Two chip solution with MMA8452Q and HMC5883L)