Part Number: EK-TM4C1294XL
Tool/software: TI C/C++ Compiler
How to save 2D array values into TM4C1294 EEProm,
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Part Number: EK-TM4C1294XL
Tool/software: TI C/C++ Compiler
How to save 2D array values into TM4C1294 EEProm,
I am not sure if I understand your question. A 2 dimensional array is stored in RAM as a single buffer. You can use the EEPROMProgram() function to program that buffer into the EEPROM. Here is a very simple example programming a 2 dimensional array into EEPROM and then reading it back into another 2 dimensional array.
#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_types.h"
#include "inc/hw_memmap.h"
#include "driverlib/sysctl.h"
#include "driverlib/eeprom.h"
//*****************************************************************************
//
// Main 'C' Language entry point.
//
//*****************************************************************************
uint32_t array[4][6];
uint32_t array2[4][6];
int
main(void)
{
uint32_t ui32SysClock;
uint32_t i, j;
//
// Run from the PLL at 120 MHz.
//
ui32SysClock = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
SYSCTL_OSC_MAIN |
SYSCTL_USE_PLL |
SYSCTL_CFG_VCO_480), 120000000);
// Initialize the EEPROM
SysCtlPeripheralEnable(SYSCTL_PERIPH_EEPROM0);
EEPROMInit();
// initialize the array
for(i = 0; i < 4; i++)
{
for(j = 0; j < 6; j++)
{
array[i][j] = i * j;
}
}
// program array into EEPROM starting at first EEPROM address
EEPROMProgram((uint32_t *)array, 0U, sizeof(array));
// Now read from the EEPROM into the second array
EEPROMRead((uint32_t *)array2, 0U, sizeof(array2));
}