AVRISP-MKII Clone Programmer Project

Functions | Variables
XPROGProtocol.c File Reference
`#include "XPROGProtocol.h"`

## Functions

void | XPROGProtocol_SetMode (void)
void | XPROGProtocol_Command (void)
static void | XPROGProtocol_EnterXPROGMode (void)
static void | XPROGProtocol_LeaveXPROGMode (void)
static void | XPROGProtocol_Erase (void)
static void | XPROGProtocol_WriteMemory (void)
static void | XPROGProtocol_ReadMemory (void)
static void | XPROGProtocol_ReadCRC (void)
static void | XPROGProtocol_SetParam (void)

## Variables

uint32_t | XPROG_Param_NVMBase = 0x010001C0
uint16_t | XPROG_Param_EEPageSize = 32
uint8_t | XPROG_Param_NVMCMDRegAddr = 0x33
uint8_t | XPROG_Param_NVMCSRRegAddr = 0x32
uint8_t | XPROG_SelectedProtocol = XPROG_PROTOCOL_PDI

## Detailed Description

XPROG Protocol handler, to process V2 Protocol wrapped XPROG commands used in Atmel programmer devices.

## Function Documentation

## § XPROGProtocol_Command()

void XPROGProtocol_Command | ( | void |  | ) |

Handler for the CMD_XPROG command, which wraps up XPROG commands in a V2 wrapper which need to be removed and processed so that the underlying XPROG command can be handled.

## § XPROGProtocol_EnterXPROGMode()

static void XPROGProtocol_EnterXPROGMode | ( | void |  | ) |

static

Handler for the XPROG ENTER_PROGMODE command to establish a connection with the attached device.

## § XPROGProtocol_Erase()

static void XPROGProtocol_Erase | ( | void |  | ) |

static

Handler for the XPRG ERASE command to erase a specific memory address space in the attached device.

## § XPROGProtocol_LeaveXPROGMode()

static void XPROGProtocol_LeaveXPROGMode | ( | void |  | ) |

static

Handler for the XPROG LEAVE_PROGMODE command to terminate the PDI programming connection with the attached device.

## § XPROGProtocol_ReadCRC()

static void XPROGProtocol_ReadCRC | ( | void |  | ) |

static

Handler for the XPROG CRC command to read a specific memory space's CRC value for comparison between the attached device's memory and a data set on the host.

## § XPROGProtocol_ReadMemory()

static void XPROGProtocol_ReadMemory | ( | void |  | ) |

static

Handler for the XPROG READ_MEMORY command to read data from a specific address space within the attached device.

## § XPROGProtocol_SetMode()

void XPROGProtocol_SetMode | ( | void |  | ) |

Handler for the CMD_XPROG_SETMODE command, which sets the programmer-to-target protocol used for PDI/TPI programming.

## § XPROGProtocol_SetParam()

static void XPROGProtocol_SetParam | ( | void |  | ) |

static

Handler for the XPROG SET_PARAM command to set a XPROG parameter for use when communicating with the attached device.

## § XPROGProtocol_WriteMemory()

static void XPROGProtocol_WriteMemory | ( | void |  | ) |

static

Handler for the XPROG WRITE_MEMORY command to write to a specific memory space within the attached device.

## Variable Documentation

## § XPROG_Param_EEPageSize

uint16_t XPROG_Param_EEPageSize = 32

Size in bytes of the target's EEPROM page

## § XPROG_Param_NVMBase

uint32_t XPROG_Param_NVMBase = 0x010001C0

Base absolute address for the target's NVM controller for PDI programming

## § XPROG_Param_NVMCMDRegAddr

uint8_t XPROG_Param_NVMCMDRegAddr = 0x33

Address of the TPI device's NVMCMD register for TPI programming

## § XPROG_Param_NVMCSRRegAddr

uint8_t XPROG_Param_NVMCSRRegAddr = 0x32

Address of the TPI device's NVMCSR register for TPI programming

## § XPROG_SelectedProtocol

uint8_t XPROG_SelectedProtocol = XPROG_PROTOCOL_PDI

Currently selected XPROG programming protocol