Cleanup and partially fix AVRISP-MKII project's TPI programming support.
This commit is contained in:
parent
857381185d
commit
74b6993d66
5 changed files with 88 additions and 33 deletions
|
@ -38,24 +38,11 @@
|
|||
|
||||
#if defined(ENABLE_XPROG_PROTOCOL) || defined(__DOXYGEN__)
|
||||
|
||||
/** Sends the given NVM register address to the target.
|
||||
*
|
||||
* \param[in] Register NVM register whose absolute address is to be sent
|
||||
*/
|
||||
void XMEGANVM_SendNVMRegAddress(const uint8_t Register)
|
||||
{
|
||||
/* Determine the absolute register address from the NVM base memory address and the NVM register address */
|
||||
uint32_t Address = XPROG_Param_NVMBase | Register;
|
||||
|
||||
/* Send the calculated 32-bit address to the target, LSB first */
|
||||
XMEGANVM_SendAddress(Address);
|
||||
}
|
||||
|
||||
/** Sends the given 32-bit absolute address to the target.
|
||||
*
|
||||
* \param[in] AbsoluteAddress Absolute address to send to the target
|
||||
*/
|
||||
void XMEGANVM_SendAddress(const uint32_t AbsoluteAddress)
|
||||
static void XMEGANVM_SendAddress(const uint32_t AbsoluteAddress)
|
||||
{
|
||||
/* Send the given 32-bit address to the target, LSB first */
|
||||
XPROGTarget_SendByte(((uint8_t*)&AbsoluteAddress)[0]);
|
||||
|
@ -64,6 +51,19 @@ void XMEGANVM_SendAddress(const uint32_t AbsoluteAddress)
|
|||
XPROGTarget_SendByte(((uint8_t*)&AbsoluteAddress)[3]);
|
||||
}
|
||||
|
||||
/** Sends the given NVM register address to the target.
|
||||
*
|
||||
* \param[in] Register NVM register whose absolute address is to be sent
|
||||
*/
|
||||
static void XMEGANVM_SendNVMRegAddress(const uint8_t Register)
|
||||
{
|
||||
/* Determine the absolute register address from the NVM base memory address and the NVM register address */
|
||||
uint32_t Address = XPROG_Param_NVMBase | Register;
|
||||
|
||||
/* Send the calculated 32-bit address to the target, LSB first */
|
||||
XMEGANVM_SendAddress(Address);
|
||||
}
|
||||
|
||||
/** Busy-waits while the NVM controller is busy performing a NVM operation, such as a FLASH page read or CRC
|
||||
* calculation.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue