AVRISP-MKII Clone Programmer Project

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

## Functions

| ISR (TIMER0_COMPA_vect, ISR_NOBLOCK)
void | V2Protocol_Init (void)
void | V2Protocol_ProcessCommand (void)
static void | V2Protocol_UnknownCommand (const uint8_t V2Command)
static void | V2Protocol_SignOn (void)
static void | V2Protocol_ResetProtection (void)
static void | V2Protocol_GetSetParam (const uint8_t V2Command)
static void | V2Protocol_LoadAddress (void)

## Variables

uint32_t | CurrentAddress
bool | MustLoadExtendedAddress

## Detailed Description

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

## Function Documentation

## § ISR()

ISR | ( | TIMER0_COMPA_vect | ,
|  | ISR_NOBLOCK |
| ) |  |

ISR to manage timeouts whilst processing a V2Protocol command

## § V2Protocol_GetSetParam()

static void V2Protocol_GetSetParam | ( | const uint8_t | V2Command | ) |

static

Handler for the CMD_SET_PARAMETER and CMD_GET_PARAMETER commands from the host, setting or getting a device parameter's value from the parameter table.

Parameters

  [in] | V2Command | Issued V2 Protocol command byte from the host

## § V2Protocol_Init()

void V2Protocol_Init | ( | void |  | ) |

Initializes the hardware and software associated with the V2 protocol command handling.

## § V2Protocol_LoadAddress()

static void V2Protocol_LoadAddress | ( | void |  | ) |

static

Handler for the CMD_LOAD_ADDRESS command, loading the given device address into a global storage variable for later use, and issuing LOAD EXTENDED ADDRESS commands to the attached device as required.

## § V2Protocol_ProcessCommand()

void V2Protocol_ProcessCommand | ( | void |  | ) |

Master V2 Protocol packet handler, for received V2 Protocol packets from a connected host. This routine decodes the issued command and passes off the handling of the command to the appropriate function.

## § V2Protocol_ResetProtection()

static void V2Protocol_ResetProtection | ( | void |  | ) |

static

Handler for the CMD_RESET_PROTECTION command, implemented as a dummy ACK function as no target short-circuit protection is currently implemented.

## § V2Protocol_SignOn()

static void V2Protocol_SignOn | ( | void |  | ) |

static

Handler for the CMD_SIGN_ON command, returning the programmer ID string to the host.

## § V2Protocol_UnknownCommand()

static void V2Protocol_UnknownCommand | ( | const uint8_t | V2Command | ) |

static

Handler for unknown V2 protocol commands. This discards all sent data and returns a STATUS_CMD_UNKNOWN status back to the host.

Parameters

  [in] | V2Command | Issued V2 Protocol command byte from the host

## Variable Documentation

## § CurrentAddress

uint32_t CurrentAddress

Current memory address for FLASH/EEPROM memory read/write commands

## § MustLoadExtendedAddress

bool MustLoadExtendedAddress

Flag to indicate that the next read/write operation must update the device's current extended FLASH address