/* * nbus_memory.c * * Created on: Nov 4, 2023 * Author: juraj */ #include "nbus_memory.h" nBus_MemoryDriver *memoryImplementation; nBus_memoryInterface_t memory_itnerface = { nbus_store_param, nbus_read_param, nbus_memory_id }; nBus_memoryInterface_t *getnbusMemoryInterface(void){ return &memory_itnerface; } void nbus_memory_init(nBus_MemoryDriver *driver){ memoryImplementation = driver; } nBus_memoryState_t nbus_store_param(uint8_t sensor_index, uint8_t param_name, uint32_t param_value){ return MEMORY_STORE_OK; } uint32_t nbus_read_param(uint8_t sensor_index, uint8_t param_name){ uint16_t adr = sensor_index + param_name; return memoryImplementation->read_word(adr); } uint8_t nbus_memory_id(uint8_t* data) { return memoryImplementation->read_id(data); }