+/** Writes byte addressed memory to the target's memory spaces.\r
+ *\r
+ * \param[in] WriteCommand Command to send to the device to write each memory page\r
+ * \param[in] WriteAddress Start address to write to within the target's address space\r
+ * \param[in] WriteBuffer Buffer to source data from\r
+ * \param[in] WriteSize Number of bytes to write\r
+ *\r
+ * \return Boolean true if the command sequence complete sucessfully\r
+ */\r
+bool NVMTarget_WriteByteMemory(uint8_t WriteCommand, uint32_t WriteAddress, uint8_t* WriteBuffer, uint16_t WriteSize)\r
+{\r
+ for (uint8_t i = 0; i < WriteSize; i++)\r
+ {\r
+ /* Wait until the NVM controller is no longer busy */\r
+ if (!(NVMTarget_WaitWhileNVMControllerBusy()))\r
+ return false;\r
+\r
+ /* Send the memory write command to the target */\r
+ PDITarget_SendByte(PDI_CMD_STS | (PDI_DATSIZE_4BYTES << 2));\r
+ NVMTarget_SendNVMRegAddress(NVM_REG_CMD);\r
+ PDITarget_SendByte(WriteCommand);\r
+ \r
+ /* Send each new memory byte to the memory to the target */\r
+ PDITarget_SendByte(PDI_CMD_STS | (PDI_DATSIZE_4BYTES << 2));\r
+ NVMTarget_SendAddress(WriteAddress++);\r
+ PDITarget_SendByte(*(WriteBuffer++));\r
+ }\r
+ \r
+ return true;\r
+}\r
+\r