Stub out more of the TPI programming protocol routines in the AVRISP project.
[pub/USBasp.git] / Projects / AVRISP / Lib / 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_TPI_PROTOCOL) || defined(__DOXYGEN__)
40
41 /** Sends the given NVM register address to the target.
42 *
43 * \param[in] Register NVM register whose absolute address is to be sent
44 */
45 void TINYNVM_SendNVMRegAddress(const uint8_t Register)
46 {
47 // TODO
48 }
49
50 /** Sends the given 32-bit absolute address to the target.
51 *
52 * \param[in] AbsoluteAddress Absolute address to send to the target
53 */
54 void TINYNVM_SendAddress(const uint32_t AbsoluteAddress)
55 {
56 // TODO
57 }
58
59 /** Waits while the target's NVM controller is busy performing an operation, exiting if the
60 * timeout period expires.
61 *
62 * \return Boolean true if the NVM controller became ready within the timeout period, false otherwise
63 */
64 bool TINYNVM_WaitWhileNVMControllerBusy(void)
65 {
66 // TODO
67 return false;
68 }
69
70 /** Retrieves the CRC value of the given memory space.
71 *
72 * \param[in] CRCCommand NVM CRC command to issue to the target
73 * \param[out] CRCDest CRC Destination when read from the target
74 *
75 * \return Boolean true if the command sequence complete successfully
76 */
77 bool TINYNVM_GetMemoryCRC(const uint8_t CRCCommand, uint32_t* const CRCDest)
78 {
79 // TODO
80 return true;
81 }
82
83 /** Reads memory from the target's memory spaces.
84 *
85 * \param[in] ReadAddress Start address to read from within the target's address space
86 * \param[out] ReadBuffer Buffer to store read data into
87 * \param[in] ReadSize Number of bytes to read
88 *
89 * \return Boolean true if the command sequence complete successfully
90 */
91 bool TINYNVM_ReadMemory(const uint32_t ReadAddress, uint8_t* ReadBuffer, const uint16_t ReadSize)
92 {
93 // TODO
94 return true;
95 }
96
97 /** Writes byte addressed memory to the target's memory spaces.
98 *
99 * \param[in] WriteCommand Command to send to the device to write each memory byte
100 * \param[in] WriteAddress Start address to write to within the target's address space
101 * \param[in] WriteBuffer Buffer to source data from
102 *
103 * \return Boolean true if the command sequence complete successfully
104 */
105 bool TINYNVM_WriteByteMemory(const uint8_t WriteCommand, const uint32_t WriteAddress, const uint8_t* WriteBuffer)
106 {
107 // TODO
108 return true;
109 }
110
111 /** Writes page addressed memory to the target's memory spaces.
112 *
113 * \param[in] WriteBuffCommand Command to send to the device to write a byte to the memory page buffer
114 * \param[in] EraseBuffCommand Command to send to the device to erase the memory page buffer
115 * \param[in] WritePageCommand Command to send to the device to write the page buffer to the destination memory
116 * \param[in] PageMode Bitfield indicating what operations need to be executed on the specified page
117 * \param[in] WriteAddress Start address to write the page data to within the target's address space
118 * \param[in] WriteBuffer Buffer to source data from
119 * \param[in] WriteSize Number of bytes to write
120 *
121 * \return Boolean true if the command sequence complete successfully
122 */
123 bool TINYNVM_WritePageMemory(const uint8_t WriteBuffCommand, const uint8_t EraseBuffCommand,
124 const uint8_t WritePageCommand, const uint8_t PageMode, const uint32_t WriteAddress,
125 const uint8_t* WriteBuffer, const uint16_t WriteSize)
126 {
127 // TODO
128 return true;
129 }
130
131 /** Erases a specific memory space of the target.
132 *
133 * \param[in] EraseCommand NVM erase command to send to the device
134 * \param[in] Address Address inside the memory space to erase
135 *
136 * \return Boolean true if the command sequence complete successfully
137 */
138 bool TINYNVM_EraseMemory(const uint8_t EraseCommand, const uint32_t Address)
139 {
140 // TODO
141 return true;
142 }
143
144 #endif