diff Small_CPU/Inc/RTE_FlashAccess.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 5f11787b4f42
children
line wrap: on
line diff
--- a/Small_CPU/Inc/RTE_FlashAccess.h	Mon Nov 30 20:55:23 2020 +0100
+++ b/Small_CPU/Inc/RTE_FlashAccess.h	Wed Nov 25 20:16:20 2020 +0100
@@ -43,10 +43,43 @@
 	BFA_EMPTY,
 };
 
+/// split word to 2 bytes
+typedef struct{
+uint8_t low; ///< split word to 2 bytes
+uint8_t hi; ///< split word to 2 bytes
+} two_byte;
+
+
+/// split word to 2 bytes
+typedef union{
+two_byte Byte; ///< split word to 2 bytes
+uint16_t Word; ///< split word to 2 bytes
+} tword;
+
+
+/// split signed word to 2 bytes
+typedef union{
+two_byte Byte; ///< split signed word to 2 bytes
+int16_t Word; ///< split signed word to 2 bytes
+} signed_tword;
+
+
+/// split full32 to 2 words
+typedef struct{
+uint16_t low16; ///< split word to 2 bytes
+uint16_t hi16; ///< split word to 2 bytes
+} two_word;
+
+typedef union{
+two_word Word16; ///< split word to 2 bytes
+uint32_t Full32; ///< split word to 2 bytes
+} tfull32;
+
 	 /* Exported functions --------------------------------------------------------*/
 
-uint8_t BFA_readLastDataBlock(uint32_t *dataArray4);
-uint8_t BFA_writeDataBlock(const uint32_t *dataArray4);
+uint8_t BFA_readLastDataBlock(tfull32 *dataArray4);
+uint8_t BFA_writeDataBlock(const tfull32 *dataArray4);
+uint16_t BFA_calc_Block_Checksum(const tfull32 *dataArray4);
 
 #ifdef __cplusplus
 }