nfm_base_mem.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. #ifndef NFM_BASE_MEMORY_H
  2. #define NFM_BASE_MEMORY_H
  3. #include <stdint.h>
  4. #include <stddef.h>
  5. #include "app/nfm/nfm_base_ECalUnit.h"
  6. #define MEMORY_OFFSET_BLOCK_COMMON (0) // sEcalHeaderCRC_t
  7. #define MEMORY_OFFSET_BLOCK_DATAHEADER_SC4000 (0x80) // sEcalDataHeaderCRC_t
  8. #define MEMORY_OFFSET_BLOCK_DATAHEADER_SC6000 (0x80) // sEcalDataHeaderCRC_t
  9. #define MEMORY_OFFSET_BLOCK_DATAHEADER_SC8000 (0x80) // sEcalDataHeaderCRC_t
  10. #define MEMORY_OFFSET_BLOCK_DATAHEADER_SC25XX (0x80) // sEcalDataHeaderCRC_t
  11. #define MEMORY_OFFSET_BLOCK_DATAHEADER_SC2543 (0x80) // sEcalDataHeaderCRC_t
  12. #define MEMORY_OFFSET_BLOCK_DATAHEADER_SC84XX (0x80) // sEcalDataHeaderCRC_t
  13. #define MEMORY_OFFSET_BLOCK_DATAHEADER_SC45XX (0x80) // sEcalDataHeaderCRC_t
  14. #define MEMORY_OFFSET_BLOCK_THERMHEADER_SC4000 (?THERM_COMP_ADDR_SC8000) // 08.02.2021 (������, ��������, ������ �������� ������, �� NFMBASE_FLASH_MAKEREALADDRESS)
  15. #define MEMORY_OFFSET_BLOCK_THERMHEADER_SC6000 (?THERM_COMP_ADDR_SC8000) // 08.02.2021 (������, ��������, ������ �������� ������, �� NFMBASE_FLASH_MAKEREALADDRESS)
  16. #define MEMORY_OFFSET_BLOCK_THERMHEADER_SC8000 (?THERM_COMP_ADDR_SC8000) // 08.02.2021 (������, ��������, ������ �������� ������, �� NFMBASE_FLASH_MAKEREALADDRESS)
  17. #define MEMORY_OFFSET_BLOCK_THERMHEADER_SC25XX (?THERM_COMP_ADDR_SC8000) // 08.02.2021 (������, ��������, ������ �������� ������, �� NFMBASE_FLASH_MAKEREALADDRESS)
  18. #define MEMORY_OFFSET_BLOCK_THERMHEADER_SC2543 (THERM_COMP_ADDR_SC2543) // ������������ ����� 0
  19. #define MEMORY_OFFSET_BLOCK_THERMHEADER_SC84XX (?THERM_COMP_ADDR_SC8400) // 08.02.2021 (������, ��������, ������ �������� ������, �� NFMBASE_FLASH_MAKEREALADDRESS)
  20. #define MEMORY_OFFSET_BLOCK_THERMHEADER_SC45XX (?THERM_COMP_ADDR_SC8400) // 08.02.2021 (������, ��������, ������ �������� ������, �� NFMBASE_FLASH_MAKEREALADDRESS)
  21. //-----------------------------------------
  22. #define MEMORY_OFFSET_BLOCK_USER1DATA_SC4000 ?1048576 // 08.02.2021 (������, ��������, ������ �������� ������, �� NFMBASE_FLASH_MAKEREALADDRESS)
  23. #define MEMORY_OFFSET_BLOCK_USER1DATA_SC6000 ?1048576 // 08.02.2021 (������, ��������, ������ �������� ������, �� NFMBASE_FLASH_MAKEREALADDRESS)
  24. #define MEMORY_OFFSET_BLOCK_USER1DATA_SC8000 ?1048576 // 08.02.2021 (������, ��������, ������ �������� ������, �� NFMBASE_FLASH_MAKEREALADDRESS)
  25. #define MEMORY_OFFSET_BLOCK_USER1DATA_SC25XX ?1048576 // 08.02.2021 (������, ��������, ������ �������� ������, �� NFMBASE_FLASH_MAKEREALADDRESS)
  26. #define MEMORY_OFFSET_BLOCK_USER1DATA_SC2543 0 // ������������ ����� 1
  27. #define MEMORY_OFFSET_BLOCK_USER1DATA_SC84XX ?2097152 // 08.02.2021 (������, ��������, ������ �������� ������, �� NFMBASE_FLASH_MAKEREALADDRESS)
  28. #define MEMORY_OFFSET_BLOCK_USER1DATA_SC45XX ?2097152 // 08.02.2021 (������, ��������, ������ �������� ������, �� NFMBASE_FLASH_MAKEREALADDRESS)
  29. //-----------------------------------------
  30. #define MEMORY_OFFSET_BLOCK_USER2DATA_SC4000 ?1223338 // 08.02.2021 (������, ��������, ������ �������� ������, �� NFMBASE_FLASH_MAKEREALADDRESS)
  31. #define MEMORY_OFFSET_BLOCK_USER2DATA_SC6000 ?1223338 // 08.02.2021 (������, ��������, ������ �������� ������, �� NFMBASE_FLASH_MAKEREALADDRESS)
  32. #define MEMORY_OFFSET_BLOCK_USER2DATA_SC8000 ?1223338 // 08.02.2021 (������, ��������, ������ �������� ������, �� NFMBASE_FLASH_MAKEREALADDRESS)
  33. #define MEMORY_OFFSET_BLOCK_USER2DATA_SC25XX ?1223338 // 08.02.2021 (������, ��������, ������ �������� ������, �� NFMBASE_FLASH_MAKEREALADDRESS)
  34. #define MEMORY_OFFSET_BLOCK_USER2DATA_SC2543 349524 // ������������ ����� 1
  35. #define MEMORY_OFFSET_BLOCK_USER2DATA_SC84XX ?2708812 // 08.02.2021 (������, ��������, ������ �������� ������, �� NFMBASE_FLASH_MAKEREALADDRESS)
  36. #define MEMORY_OFFSET_BLOCK_USER2DATA_SC45XX ?2708812 // 08.02.2021 (������, ��������, ������ �������� ������, �� NFMBASE_FLASH_MAKEREALADDRESS)
  37. //-----------------------------------------
  38. #define MEMORY_OFFSET_BLOCK_USER3DATA_SC4000 ?1398100 // 08.02.2021 (������, ��������, ������ �������� ������, �� NFMBASE_FLASH_MAKEREALADDRESS)
  39. #define MEMORY_OFFSET_BLOCK_USER3DATA_SC6000 ?1398100 // 08.02.2021 (������, ��������, ������ �������� ������, �� NFMBASE_FLASH_MAKEREALADDRESS)
  40. #define MEMORY_OFFSET_BLOCK_USER3DATA_SC8000 ?1398100 // 08.02.2021 (������, ��������, ������ �������� ������, �� NFMBASE_FLASH_MAKEREALADDRESS)
  41. #define MEMORY_OFFSET_BLOCK_USER3DATA_SC25XX ?1398100 // 08.02.2021 (������, ��������, ������ �������� ������, �� NFMBASE_FLASH_MAKEREALADDRESS)
  42. #define MEMORY_OFFSET_BLOCK_USER3DATA_SC2543 699048 // ������������ ����� 1
  43. #define MEMORY_OFFSET_BLOCK_USER3DATA_SC84XX ?3320472 // 08.02.2021 (������, ��������, ������ �������� ������, �� NFMBASE_FLASH_MAKEREALADDRESS)
  44. #define MEMORY_OFFSET_BLOCK_USER3DATA_SC45XX ?3320472 // 08.02.2021 (������, ��������, ������ �������� ������, �� NFMBASE_FLASH_MAKEREALADDRESS)
  45. //-----------------------------------------
  46. typedef struct
  47. {
  48. size_t BaseIndex_Short; // Table index of the table for state SHORT of single port
  49. size_t BaseIndex_Open; // Table index of the table for state OPEN of single port
  50. size_t BaseIndex_Load; // Table index of the table for state LOAD of single port
  51. size_t BaseIndex_Load2; // Table index of the table for state LOAD2 of single port
  52. size_t BaseIndex_Open2; // Table index of the table for state OPEN2 of single port
  53. }
  54. sNFMMemory_TableMatrix_SinglePort_t;
  55. typedef struct
  56. {
  57. size_t aBaseIndex[5]; // The same as [sNFMMemory_TableMatrix_SinglePort_t], but as an array
  58. }
  59. sNFMMemory_TableMatrix_SinglePort_array_t;
  60. typedef struct
  61. {
  62. size_t BaseIndex_S11; // Table index of the table for state S11 of pair ports (thru)
  63. size_t BaseIndex_S21; // Table index of the table for state S21 of pair ports (thru)
  64. size_t BaseIndex_S12; // Table index of the table for state S12 of pair ports (thru)
  65. size_t BaseIndex_S22; // Table index of the table for state S22 of pair ports (thru)
  66. }
  67. sNFMMemory_TableMatrix_ThruPort_t;
  68. typedef struct
  69. {
  70. size_t aBaseIndex[4]; // The same as [sNFMMemory_TableMatrix_ThruPort_t], but as an array
  71. }
  72. sNFMMemory_TableMatrix_ThruPort_array_t;
  73. typedef struct
  74. {
  75. size_t BaseIndex_S11; // Table index of the table for state S11 of dual port (check state)
  76. size_t BaseIndex_S21; // Table index of the table for state S21 of dual port (check state)
  77. size_t BaseIndex_S12; // Table index of the table for state S12 of dual port (check state)
  78. size_t BaseIndex_S22; // Table index of the table for state S22 of dual port (check state)
  79. }
  80. sNFMMemory_TableMatrix_CheckState_2Port_t;
  81. typedef struct
  82. {
  83. size_t aBaseIndex[4]; // The same as [sNFMMemory_TableMatrix_CheckState_2Port_t], but as an array
  84. }
  85. sNFMMemory_TableMatrix_CheckState_2Port_array_t;
  86. typedef struct
  87. {
  88. size_t BaseIndex_S11; // Table index of the table for state S11 of quard port (check state)
  89. size_t BaseIndex_S21; // Table index of the table for state S21 of quard port (check state)
  90. size_t BaseIndex_S31; // Table index of the table for state S31 of quard port (check state)
  91. size_t BaseIndex_S41; // Table index of the table for state S41 of quard port (check state)
  92. size_t BaseIndex_S12; // Table index of the table for state S12 of quard port (check state)
  93. size_t BaseIndex_S22; // Table index of the table for state S22 of quard port (check state)
  94. size_t BaseIndex_S32; // Table index of the table for state S32 of quard port (check state)
  95. size_t BaseIndex_S42; // Table index of the table for state S42 of quard port (check state)
  96. size_t BaseIndex_S13; // Table index of the table for state S13 of quard port (check state)
  97. size_t BaseIndex_S23; // Table index of the table for state S23 of quard port (check state)
  98. size_t BaseIndex_S33; // Table index of the table for state S33 of quard port (check state)
  99. size_t BaseIndex_S43; // Table index of the table for state S43 of quard port (check state)
  100. size_t BaseIndex_S14; // Table index of the table for state S14 of quard port (check state)
  101. size_t BaseIndex_S24; // Table index of the table for state S24 of quard port (check state)
  102. size_t BaseIndex_S34; // Table index of the table for state S34 of quard port (check state)
  103. size_t BaseIndex_S44; // Table index of the table for state S44 of quard port (check state)
  104. }
  105. sNFMMemory_TableMatrix_CheckState_4Port_t;
  106. typedef struct
  107. {
  108. size_t aBaseIndex[16]; // The same as [sNFMMemory_TableMatrix_CheckState_4Port_t], but as an array
  109. }
  110. sNFMMemory_TableMatrix_CheckState_4Port_array_t;
  111. //--------------------------------------------------
  112. // uNFMMemory_PortMatrix_Single_2Port_t
  113. // Table profile for the table of all combinations of signle ports
  114. typedef union
  115. {
  116. struct
  117. {
  118. sNFMMemory_TableMatrix_SinglePort_t sTable_A; // = .aArray[ ePortComb_A - ePortComb_A ]
  119. sNFMMemory_TableMatrix_SinglePort_t sTable_B; // = .aArray[ ePortComb_B - ePortComb_A ]
  120. };
  121. sNFMMemory_TableMatrix_SinglePort_array_t aArray[2];
  122. }
  123. uNFMMemory_PortMatrix_Single_2Port_t;
  124. // uNFMMemory_PortMatrix_Single_4Port_t
  125. // Table profile for the table of all combinations of signle ports
  126. typedef union
  127. {
  128. struct
  129. {
  130. sNFMMemory_TableMatrix_SinglePort_t sTable_A; // = .aArray[ ePortComb_A - ePortComb_A ]
  131. sNFMMemory_TableMatrix_SinglePort_t sTable_B; // = .aArray[ ePortComb_B - ePortComb_A ]
  132. sNFMMemory_TableMatrix_SinglePort_t sTable_C; // = .aArray[ ePortComb_C - ePortComb_A ]
  133. sNFMMemory_TableMatrix_SinglePort_t sTable_D; // = .aArray[ ePortComb_D - ePortComb_A ]
  134. };
  135. sNFMMemory_TableMatrix_SinglePort_array_t aArray[4];
  136. }
  137. uNFMMemory_PortMatrix_Single_4Port_t;
  138. // uNFMMemory_PortMatrix_Thru_2Port_t
  139. // Table profile for tables of all combinations of pair ports (thrus)
  140. typedef union
  141. {
  142. struct
  143. {
  144. sNFMMemory_TableMatrix_ThruPort_t sTable_AB; // = .aArrays[ ePortComb_AB - ePortComb_AB ]
  145. };
  146. sNFMMemory_TableMatrix_ThruPort_array_t aArrays[1];
  147. }
  148. uNFMMemory_PortMatrix_Thru_2Port_t;
  149. // uNFMMemory_PortMatrix_Thru_4Port_t
  150. // Table profile for tables of all combinations of pair ports (thrus)
  151. typedef union
  152. {
  153. struct
  154. {
  155. sNFMMemory_TableMatrix_ThruPort_t sTable_AB; // = .aArrays[ ePortComb_AB - ePortComb_AB ]
  156. sNFMMemory_TableMatrix_ThruPort_t sTable_AC; // = .aArrays[ ePortComb_AC - ePortComb_AB ]
  157. sNFMMemory_TableMatrix_ThruPort_t sTable_AD; // = .aArrays[ ePortComb_AD - ePortComb_AB ]
  158. sNFMMemory_TableMatrix_ThruPort_t sTable_BC; // = .aArrays[ ePortComb_BC - ePortComb_AB ]
  159. sNFMMemory_TableMatrix_ThruPort_t sTable_BD; // = .aArrays[ ePortComb_BD - ePortComb_AB ]
  160. sNFMMemory_TableMatrix_ThruPort_t sTable_CD; // = .aArrays[ ePortComb_CD - ePortComb_AB ]
  161. };
  162. sNFMMemory_TableMatrix_ThruPort_array_t aArrays[6];
  163. }
  164. uNFMMemory_PortMatrix_Thru_4Port_t;
  165. // sNFMMemory_PortMatrix_Check_2Port_t
  166. // Table profile for the table of all states of quard port (check state)
  167. typedef union
  168. {
  169. sNFMMemory_TableMatrix_CheckState_2Port_t sTables;
  170. sNFMMemory_TableMatrix_CheckState_2Port_array_t sArray;
  171. }
  172. sNFMMemory_PortMatrix_Check_2Port_t;
  173. // sNFMMemory_PortMatrix_Check_4Port_t
  174. // Table profile for the table of all states of quard port (check state)
  175. typedef union
  176. {
  177. sNFMMemory_TableMatrix_CheckState_4Port_t sTables;
  178. sNFMMemory_TableMatrix_CheckState_4Port_array_t sArray;
  179. }
  180. sNFMMemory_PortMatrix_Check_4Port_t;
  181. typedef enum
  182. {
  183. eNfmChrzTable1Port, // not implemented (NFM_ROM_GetChrzTableIndex)
  184. eNfmChrzTable2Port,
  185. eNfmChrzTable4Port,
  186. eNfmChrzTable8Port, // not implemented (NFM_ROM_GetChrzTableIndex)
  187. }
  188. eNFMMemory_ChrzTableType_t;
  189. typedef struct
  190. {
  191. union
  192. {
  193. eNFMMemory_ChrzTableType_t eType;
  194. size_t nType;
  195. }
  196. ChrzTableType;
  197. size_t maxTableIdx;
  198. }
  199. sNFMMemory_ChrzTableIdHeader_t;
  200. #define DECLARE_CHRZTABLETYPE_1PORT(MAX_TABLES) .Header = { .ChrzTableType.eType = eNfmChrzTable1Port, .maxTableIdx = (MAX_TABLES) }
  201. #define DECLARE_CHRZTABLETYPE_2PORT(MAX_TABLES) .Header = { .ChrzTableType.eType = eNfmChrzTable2Port, .maxTableIdx = (MAX_TABLES) }
  202. #define DECLARE_CHRZTABLETYPE_4PORT(MAX_TABLES) .Header = { .ChrzTableType.eType = eNfmChrzTable4Port, .maxTableIdx = (MAX_TABLES) }
  203. #define DECLARE_CHRZTABLETYPE_8PORT(MAX_TABLES) .Header = { .ChrzTableType.eType = eNfmChrzTable8Port, .maxTableIdx = (MAX_TABLES) }
  204. // sNFMMemory_ChrzTableMatrix_Undefined_t:
  205. // Characterization table structure for any NFM
  206. // Contains only common header
  207. typedef struct
  208. {
  209. sNFMMemory_ChrzTableIdHeader_t Header; // Characterization table common information
  210. }
  211. sNFMMemory_ChrzTableMatrix_XPort_t;
  212. // sNFMMemory_ChrzTableMatrix_2Port_t:
  213. // Characterization table profile for 2-port NFM
  214. // Contains indicies for all the tables of all combinations of ports and states.
  215. typedef struct
  216. {
  217. sNFMMemory_ChrzTableIdHeader_t Header; // Characterization table common information
  218. uNFMMemory_PortMatrix_Single_2Port_t Single; // Index-Table for states of sigle ports
  219. uNFMMemory_PortMatrix_Thru_2Port_t Thru; // Index-Table for states of pairs ports (thrus)
  220. sNFMMemory_PortMatrix_Check_2Port_t Check; // Index-Table for states of quard port (check state)
  221. }
  222. sNFMMemory_ChrzTableMatrix_2Port_t;
  223. // sNFMMemory_ChrzTableMatrix_4Port_t:
  224. // Characterization table profile for 4-port NFM
  225. // Contains indicies for all the tables of all combinations of ports and states.
  226. typedef struct
  227. {
  228. sNFMMemory_ChrzTableIdHeader_t Header; // Characterization table common information
  229. uNFMMemory_PortMatrix_Single_4Port_t Single; // Index-Table for states of sigle ports
  230. uNFMMemory_PortMatrix_Thru_4Port_t Thru; // Index-Table for states of pairs ports (thrus)
  231. sNFMMemory_PortMatrix_Check_4Port_t Check; // Index-Table for states of quard port (check state)
  232. }
  233. sNFMMemory_ChrzTableMatrix_4Port_t;
  234. typedef struct
  235. {
  236. size_t BaseAddr_TComp; // Factory Termocompensation Table Base Address
  237. size_t BaseAddr_Chrz[eCh_MAX]; // [0] = Factory Characterization Base Address (Header)
  238. // [1..3] = User's Characterization Base Addresses
  239. size_t BaseAddr_Settings; // Device Settings block address
  240. size_t Size_Settings; // Device Settings block size
  241. union
  242. {
  243. const void * tbls_raw;
  244. const sNFMMemory_ChrzTableMatrix_2Port_t * tbls_2Port;
  245. const sNFMMemory_ChrzTableMatrix_4Port_t * tbls_4Port;
  246. /* Do not forget to update 'NFM_ROM_GetChrzTableIndex' routine */
  247. };
  248. }
  249. sNFMMemoryProfile_t;
  250. typedef struct
  251. {
  252. size_t BaseAddr_SwTable; // Switch table Base Header Address
  253. size_t BaseAddr_Table[eChValues_MAX]; // Switch table start chunks (data) address
  254. size_t BaseAddr_Settings; // Device Settings block address
  255. size_t Size_Settings; // Device Settings block size
  256. }sSwitchMemoryProfile_t;
  257. #define NFM_CHRZ_TABLEIDX_INVALID (0)
  258. #define NFM_CHRZ_TABLEIDX_2_OFFSET(IDX) ((IDX)-1)
  259. #define NFM_TCOMP_MAGN_TABLEIDX_2_OFFSET(IDX) ( ((IDX)-1)*2 + 0 )
  260. #define NFM_TCOMP_PHASE_TABLEIDX_2_OFFSET(IDX) ( ((IDX)-1)*2 + 1 )
  261. #define SIZE_CHRZ_HEADER sizeof( sEcalDataHeaderCRC_t ) // size of characterization main header
  262. #define SIZE_TCOMP_HEADER sizeof( sEcalTCompHeaderCRC_t ) // size of thermocompensation main header
  263. #define SIZE_CHRZ_THDR sizeof( sEcalChrzTableHeader_t ) // size of characterization table header
  264. #define SIZE_CHRZ_TPNT sizeof( sEcalChrzTablePoint_t ) // size of characterization table point
  265. #define SIZE_TCOMP_MAGN_THDR sizeof( sEcalTCompTableMagnHeader_t ) // size of thermocompensation table magnitude header
  266. #define SIZE_TCOMP_PHASE_THDR sizeof( sEcalTCompTablePhaseHeader_t ) // size of thermocompensation table phase header
  267. #define SIZE_TCOMP_MAGN_TPNT sizeof( sEcalTCompTableMagnPoint_t ) // size of thermocompensation table magnitude point
  268. #define SIZE_TCOMP_PHASE_TPNT sizeof( sEcalTCompTablePhasePoint_t ) // size of thermocompensation table phase point
  269. #define SIZE_CHRZ_TCRC (sizeof(uint32_t))
  270. #define SIZE_TCOMP_TCRC (sizeof(uint32_t))
  271. #define SIZE_CHRZ_TABLE(NPOINTS) ((SIZE_CHRZ_TCRC) + (SIZE_CHRZ_THDR) + (NPOINTS)*(SIZE_CHRZ_TPNT)) // size of characterization table
  272. #define SIZE_TCOMP_MAGN_TABLE(NPOINTS) ((SIZE_TCOMP_TCRC) + (SIZE_TCOMP_MAGN_THDR) + (NPOINTS)*(SIZE_TCOMP_MAGN_TPNT) ) // size of thermocompensation magnitude table
  273. #define SIZE_TCOMP_PHASE_TABLE(NPOINTS) ((SIZE_TCOMP_TCRC) + (SIZE_TCOMP_PHASE_THDR) + (NPOINTS)*(SIZE_TCOMP_PHASE_TPNT)) // size of thermocompensation phase table
  274. extern const sNFMMemoryProfile_t memProfile_SC2543v1_ADRF_NFM2543_v1;
  275. extern const sNFMMemoryProfile_t memProfile_NFM;
  276. extern const sSwitchMemoryProfile_t memProfile_SW; // Switch mem profile
  277. bool NFM_ROM_GetMemoryProtectStatus_Bank0();
  278. bool NFM_ROM_SetMemoryProtectStatus_Bank0( bool desiredStatus );
  279. size_t NFM_ROM_GetChrzTableIndex( ePortComb_t portCombination, ePortStateId_t portState );
  280. size_t NFM_ROM_GetTCompTableIndex( ePortComb_t portCombination, ePortStateId_t portState );
  281. const sEcalHeader_t * NFM_ROM_GetCommonHeader( uint8_t * buffer, size_t size );
  282. const sEcalDataHeader_t * NFM_ROM_GetDataHeader( eChrz_t tableId, uint8_t * buffer, size_t size );
  283. const sEcalTCompHeader_t * NFM_ROM_GetTCompHeader( uint8_t * buffer, size_t size );
  284. //const sTableHeader_t * SW_ROM_GetCommonHeader( uint8_t * buffer, size_t size );
  285. size_t NFM_ROM_ReadChrzTableHeader( eChrz_t sectorId,
  286. ePortComb_t portCombination,
  287. ePortStateId_t portState,
  288. size_t nPoints, // @nPoints = amount of points in the table
  289. sEcalChrzTableHeader_t * pHeader,
  290. unsigned int * pErrCode
  291. );
  292. size_t NFM_ROM_ReadChrzTablePoints( /*const*/ sNFMGetPoints_t * pContext );
  293. size_t NFM_ROM_GetTCompMagnTableHeader( ePortComb_t portCombination,
  294. ePortStateId_t portState,
  295. size_t nPoints,
  296. sEcalTCompTableMagnHeader_t * pHeader,
  297. unsigned int * pErrCode
  298. );
  299. size_t NFM_ROM_GetTCompPhaseTableHeader( ePortComb_t portCombination,
  300. ePortStateId_t portState,
  301. size_t nPoints,
  302. sEcalTCompTablePhaseHeader_t * pHeader,
  303. unsigned int * pErrCode
  304. );
  305. size_t NFM_ROM_GetTCompMagnPoints( /*const*/ sNFMGetPoints_t * pContext );
  306. size_t NFM_ROM_GetTCompPhasePoints( /*const*/ sNFMGetPoints_t * pContext );
  307. size_t NFM_ROM_WriteDeviceSettings( uint8_t * buffer, size_t nOffset, size_t nBytesToWrite );
  308. size_t NFM_ROM_ReadDeviceSettings( uint8_t * buffer, size_t nOffset, size_t nBytesToRead );
  309. size_t NFM_ROM_GetDeviceSettingsSize();
  310. bool NFM_ROM_ValidateUserSettings();
  311. sTableHeaderCRC_t * SW_ROM_GetTableHeader();
  312. bool SW_ROM_SetDataPoint ( eChunks_t tableId, sTableTablePoint_t * TablePoint );
  313. bool SW_ROM_Check_Table_crc();
  314. uint16_t SW_ROM_GetNumberOfPoints();
  315. const bool SW_ROM_GetDataPoint( eChunks_t tableId, uint8_t point_number, uint8_t * buffer, size_t size );
  316. bool SW_ROM_Table_Clear();
  317. #endif