comparison 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
comparison
equal deleted inserted replaced
570:701ead8dddab 571:91a8f9893e68
41 BFA_BUSY = (uint8_t)HAL_BUSY, 41 BFA_BUSY = (uint8_t)HAL_BUSY,
42 BFA_TIMEOUT = (uint8_t)HAL_TIMEOUT, 42 BFA_TIMEOUT = (uint8_t)HAL_TIMEOUT,
43 BFA_EMPTY, 43 BFA_EMPTY,
44 }; 44 };
45 45
46 /// split word to 2 bytes
47 typedef struct{
48 uint8_t low; ///< split word to 2 bytes
49 uint8_t hi; ///< split word to 2 bytes
50 } two_byte;
51
52
53 /// split word to 2 bytes
54 typedef union{
55 two_byte Byte; ///< split word to 2 bytes
56 uint16_t Word; ///< split word to 2 bytes
57 } tword;
58
59
60 /// split signed word to 2 bytes
61 typedef union{
62 two_byte Byte; ///< split signed word to 2 bytes
63 int16_t Word; ///< split signed word to 2 bytes
64 } signed_tword;
65
66
67 /// split full32 to 2 words
68 typedef struct{
69 uint16_t low16; ///< split word to 2 bytes
70 uint16_t hi16; ///< split word to 2 bytes
71 } two_word;
72
73 typedef union{
74 two_word Word16; ///< split word to 2 bytes
75 uint32_t Full32; ///< split word to 2 bytes
76 } tfull32;
77
46 /* Exported functions --------------------------------------------------------*/ 78 /* Exported functions --------------------------------------------------------*/
47 79
48 uint8_t BFA_readLastDataBlock(uint32_t *dataArray4); 80 uint8_t BFA_readLastDataBlock(tfull32 *dataArray4);
49 uint8_t BFA_writeDataBlock(const uint32_t *dataArray4); 81 uint8_t BFA_writeDataBlock(const tfull32 *dataArray4);
82 uint16_t BFA_calc_Block_Checksum(const tfull32 *dataArray4);
50 83
51 #ifdef __cplusplus 84 #ifdef __cplusplus
52 } 85 }
53 #endif 86 #endif
54 87