9 #include "../firmware.h"
24 void Buffer_FRAM_read_data(uint16_t slot, uint8_t *data)
26 FRAM_read((uint32_t)(BUFFER_FRAM_ADDRESS_SLOTS + (slot * BUFFER_SLOT_SIZE)), data, BUFFER_SLOT_SIZE);
34 FRAM_write(BUFFER_FRAM_ADDRESS_CRC, (uint8_t *)&(buffer->crc), BUFFER_FRAM_SIZE_CRC);
39 FRAM_write(BUFFER_FRAM_ADDRESS_LAST_INDEX, (uint8_t *)&(buffer->last_index_stored),
sizeof(buffer->last_index_stored));
40 Buffer_FRAM_update_crc(buffer);
43 void Buffer_FRAM_write_last_slot_transmitted(
buffer_cache_t *buffer)
45 FRAM_write(BUFFER_FRAM_ADDRESS_LAST_SLOT, (uint8_t *)&(buffer->last_slot_transmitted),
sizeof(buffer->last_slot_transmitted));
46 Buffer_FRAM_update_crc(buffer);
51 FRAM_write(BUFFER_FRAM_ADDRESS_OCCUPANCY, (uint8_t *)&(buffer->occupancy),
sizeof(buffer->occupancy));
52 Buffer_FRAM_update_crc(buffer);
57 FRAM_write(BUFFER_FRAM_ADDRESS_INDEXES, (uint8_t *)&(buffer->indexes),
sizeof(buffer->indexes));
58 Buffer_FRAM_update_crc(buffer);
61 void Buffer_FRAM_write_data(uint16_t slot, uint8_t *data)
63 FRAM_write((uint32_t)(BUFFER_FRAM_ADDRESS_SLOTS + (slot * BUFFER_SLOT_SIZE)), data, BUFFER_SLOT_SIZE);
void FRAM_read(uint32_t address, uint8_t *data, uint32_t length)
void FRAM_write(uint32_t address, uint8_t *data, uint32_t length)
uint16_t Util_crc16(const uint8_t *buf, uint32_t size)