45#define SHARED_PARAMS_BUFFER_ID (0xCAFEBABEu)
52typedef struct t_shared_params_buffer
59 uint8_t data[SHARED_PARAMS_CFG_BUFFER_DATA_LEN];
101 sharedParamsBuffer.identifier = SHARED_PARAMS_BUFFER_ID;
102 for (byteIdx=0; byteIdx < SHARED_PARAMS_CFG_BUFFER_DATA_LEN; byteIdx++)
104 sharedParamsBuffer.data[byteIdx] = 0;
125 (idx < SHARED_PARAMS_CFG_BUFFER_DATA_LEN) &&
129 *value = sharedParamsBuffer.data[idx];
151 (idx < SHARED_PARAMS_CFG_BUFFER_DATA_LEN) )
154 sharedParamsBuffer.data[idx] = value;
159 #if CORTEX_MODEL == 7
161 SCB_CleanDCache_by_Addr((uint32_t*)&sharedParamsBuffer,
sizeof(sharedParamsBuffer));
180 if ( (sharedParamsBuffer.identifier == SHARED_PARAMS_BUFFER_ID) &&
238 result += (uint8_t)sharedParamsBuffer.identifier;
239 result += (uint8_t)(sharedParamsBuffer.identifier >> 8u);
240 result += (uint8_t)(sharedParamsBuffer.identifier >> 16u);
241 result += (uint8_t)(sharedParamsBuffer.identifier >> 24u);
243 for (byteIdx=0; byteIdx<SHARED_PARAMS_CFG_BUFFER_DATA_LEN; byteIdx++)
246 result += (uint8_t)sharedParamsBuffer.data[byteIdx];
typedef __attribute__
Ignition Mode.
ARM Cortex-M4 parameters for the Kinetis KE1xF.
static void SharedParamsWriteChecksum(void)
Calculates and writes the checksum into the buffer.
static bool SharedParamsValidateBuffer(void)
Validates the shared parameter buffer contents by looking at the table identifier and verifying its c...
bool SharedParamsWriteByIndex(uint32_t idx, uint8_t value)
Writes a data byte to the shared parameter buffer at the specified index.
void SharedParamsInit(void)
Initializes the shared RAM parameters module.
static bool SharedParamsVerifyChecksum(void)
Calculates and verifies the checksum that is currently present in the buffer.
struct t_shared_params_buffer tSharedParamsBuffer
Layout of the shared parameters RAM buffer.
bool SharedParamsReadByIndex(uint32_t idx, uint8_t *value)
Reads a data byte from the shared parameter buffer at the specified index.
static uint16_t SharedParamsCalculateChecksum(void)
Calculates and returns the checksum value for the current contents in the buffer. The checksum is cal...