nbus_memory.c 690 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * nbus_memory.c
  3. *
  4. * Created on: Nov 4, 2023
  5. * Author: juraj
  6. */
  7. #include "nbus_memory.h"
  8. nBus_MemoryDriver *memoryImplementation;
  9. nBus_memoryInterface_t memory_itnerface = {
  10. nbus_store_param,
  11. nbus_read_param
  12. };
  13. nBus_memoryInterface_t *getnbusMemoryInterface(void){
  14. return &memory_itnerface;
  15. }
  16. void nbus_memory_init(nBus_MemoryDriver *driver){
  17. memoryImplementation = driver;
  18. }
  19. nBus_memoryState_t nbus_store_param(uint8_t sensor_index, uint8_t param_name, uint32_t param_value){
  20. return MEMORY_STORE_OK;
  21. }
  22. uint32_t nbus_read_param(uint8_t sensor_index, uint8_t param_name){
  23. uint16_t adr = sensor_index + param_name;
  24. return memoryImplementation->read_word(adr);;
  25. }