#include "sram.h"


uint8_t SramData[1024];

// 写入数据到备份SRAM
void Write_Backup_SRAM(uint32_t* data, uint32_t size) 
{
    volatile uint32_t* pBackupSRAM = (volatile uint32_t*)BKP_SRAM_BASE;
    for (uint32_t i = 0; i < size; i++) 
	{
        pBackupSRAM[i] = data[i];
    }
}

// 从备份SRAM读取数据
void Read_Backup_SRAM(uint32_t* data, uint32_t size) 
{
    volatile uint32_t* pBackupSRAM = (volatile uint32_t*)BKP_SRAM_BASE;
    for (uint32_t i = 0; i < size; i++) 
	{
        data[i] = pBackupSRAM[i];
    }
}
