AVRISP-MKII Clone Programmer Project

Macros | Functions | Variables
V2Protocol.h File Reference
`#include <avr/io.h>`
`#include <avr/interrupt.h>`
`#include <avr/wdt.h>`
`#include <LUFA/Drivers/USB/USB.h>`
`#include "../AVRISPDescriptors.h"`
`#include "V2ProtocolConstants.h"`
`#include "V2ProtocolParams.h"`
`#include "ISP/ISPProtocol.h"`
`#include "XPROG/XPROGProtocol.h"`
`#include "Config/AppConfig.h"`

## Macros

#define | VTARGET_REF_MASK ADC_REFERENCE_AVCC
#define | PROGRAMMER_ID "AVRISP_MK2"
#define | COMMAND_TIMEOUT_TICKS 100
#define | TimeoutTicksRemaining GPIOR1
#define | VTARGET_ADC_CHANNEL_MASK ADC_GET_CHANNEL_MASK(VTARGET_ADC_CHANNEL)

## Functions

void | V2Protocol_Init (void)
void | V2Protocol_ProcessCommand (void)

## Variables

uint32_t | CurrentAddress
bool | MustLoadExtendedAddress

## Detailed Description

Header file for V2Protocol.c.

## Macro Definition Documentation

## § COMMAND_TIMEOUT_TICKS

#define COMMAND_TIMEOUT_TICKS 100

Timeout period for each issued command from the host before it is aborted (in 10ms ticks).

## § PROGRAMMER_ID

#define PROGRAMMER_ID "AVRISP_MK2"

Programmer ID string, returned to the host during the CMD_SIGN_ON command processing.

## § TimeoutTicksRemaining

#define TimeoutTicksRemaining GPIOR1

Command timeout ticks remaining counter, GPIOR for speed.

## § VTARGET_ADC_CHANNEL_MASK

#define VTARGET_ADC_CHANNEL_MASK ADC_GET_CHANNEL_MASK(VTARGET_ADC_CHANNEL)

MUX mask for the VTARGET ADC channel number.

## § VTARGET_REF_MASK

#define VTARGET_REF_MASK ADC_REFERENCE_AVCC

## Function Documentation

## § V2Protocol_Init()

void V2Protocol_Init | ( | void |  | ) |

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

## § 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.

## 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