+void NVMTarget_ReadMemory(uint32_t ReadAddress, uint8_t* ReadBuffer, uint16_t ReadSize)\r
+{\r
+ NVMTarget_WaitWhileNVMControllerBusy();\r
+\r
+ PDITarget_SendByte(PDI_CMD_STS | (PDI_DATSIZE_4BYTES << 2));\r
+ NVMTarget_SendNVMRegAddress(NVM_REG_CMD);\r
+ PDITarget_SendByte(NVM_CMD_READNVM);\r
+\r
+ /* TODO: Optimize via REPEAT and buffer orientated commands */\r
+ for (uint16_t i = 0; i < ReadSize; i++)\r
+ {\r
+ PDITarget_SendByte(PDI_CMD_LDS | (PDI_DATSIZE_4BYTES << 2));\r
+ NVMTarget_SendAddress(ReadAddress++);\r
+ *(ReadBuffer++) = PDITarget_ReceiveByte();\r
+ }\r
+}\r
+\r