5eb59892eb98e2f5d58e3b93ac03762ac6b54a51
[pub/USBasp.git] / Projects / AVRISP / Lib / XPROG / TINYNVM.c
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2009.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.fourwalledcubicle.com
7 */
8
9 /*
10 Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, and distribute this software
13 and its documentation for any purpose and without fee is hereby
14 granted, provided that the above copyright notice appear in all
15 copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaim all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
31 /** \file
32 *
33 * Target-related functions for the TINY target's NVM module.
34 */
35
36 #define INCLUDE_FROM_TINYNVM_C
37 #include "TINYNVM.h"
38
39 #if defined(ENABLE_XPROG_PROTOCOL) || defined(__DOXYGEN__)
40
41 /** Busy-waits while the NVM controller is busy performing a NVM operation, such as a FLASH page read or CRC
42 * calculation.
43 *
44 * \return Boolean true if the NVM controller became ready within the timeout period, false otherwise
45 */
46 bool XMEGANVM_WaitWhileNVMBusBusy(void)
47 {
48 // TODO
49
50 return false;
51 }
52
53 /** Waits while the target's NVM controller is busy performing an operation, exiting if the
54 * timeout period expires.
55 *
56 * \return Boolean true if the NVM controller became ready within the timeout period, false otherwise
57 */
58 bool XMEGANVM_WaitWhileNVMControllerBusy(void)
59 {
60 // TODO
61
62 return false;
63 }
64
65 /** Retrieves the CRC value of the given memory space.
66 *
67 * \param[in] CRCCommand NVM CRC command to issue to the target
68 * \param[out] CRCDest CRC Destination when read from the target
69 *
70 * \return Boolean true if the command sequence complete successfully
71 */
72 bool XMEGANVM_GetMemoryCRC(const uint8_t CRCCommand, uint32_t* const CRCDest)
73 {
74 // TODO
75
76 return true;
77 }
78
79 /** Reads memory from the target's memory spaces.
80 *
81 * \param[in] ReadAddress Start address to read from within the target's address space
82 * \param[out] ReadBuffer Buffer to store read data into
83 * \param[in] ReadSize Number of bytes to read
84 *
85 * \return Boolean true if the command sequence complete successfully
86 */
87 bool XMEGANVM_ReadMemory(const uint32_t ReadAddress, uint8_t* ReadBuffer, const uint16_t ReadSize)
88 {
89 // TODO
90
91 return true;
92 }
93
94 /** Writes byte addressed memory to the target's memory spaces.
95 *
96 * \param[in] WriteCommand Command to send to the device to write each memory byte
97 * \param[in] WriteAddress Start address to write to within the target's address space
98 * \param[in] WriteBuffer Buffer to source data from
99 *
100 * \return Boolean true if the command sequence complete successfully
101 */
102 bool XMEGANVM_WriteMemory(const uint8_t WriteCommand, const uint32_t WriteAddress, const uint8_t* WriteBuffer)
103 {
104 // TODO
105
106 return true;
107 }
108
109 /** Erases a specific memory space of the target.
110 *
111 * \param[in] EraseCommand NVM erase command to send to the device
112 * \param[in] Address Address inside the memory space to erase
113 *
114 * \return Boolean true if the command sequence complete successfully
115 */
116 bool XMEGANVM_EraseMemory(const uint8_t EraseCommand, const uint32_t Address)
117 {
118 // TODO
119
120 return true;
121 }
122
123 #endif