AVRISP-MKII Clone Programmer Project

Functions
ISPProtocol.c File Reference
`#include "ISPProtocol.h"`

## Functions

void | ISPProtocol_EnterISPMode (void)
void | ISPProtocol_LeaveISPMode (void)
void | ISPProtocol_ProgramMemory (uint8_t V2Command)
void | ISPProtocol_ReadMemory (uint8_t V2Command)
void | ISPProtocol_ChipErase (void)
void | ISPProtocol_ReadFuseLockSigOSCCAL (uint8_t V2Command)
void | ISPProtocol_WriteFuseLock (uint8_t V2Command)
void | ISPProtocol_SPIMulti (void)
void | ISPProtocol_DelayMS (uint8_t DelayMS)

## Detailed Description

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

## Function Documentation

## § ISPProtocol_ChipErase()

void ISPProtocol_ChipErase | ( | void |  | ) |

Handler for the CMD_CHI_ERASE_ISP command, clearing the target's FLASH memory.

## § ISPProtocol_DelayMS()

void ISPProtocol_DelayMS | ( | uint8_t | DelayMS | ) |

Blocking delay for a given number of milliseconds. This provides a simple wrapper around the avr-libc provided delay function, so that the delay function can be called with a constant value (to prevent run-time floating point operations being required).

Parameters

  [in] | DelayMS | Number of milliseconds to delay for

## § ISPProtocol_EnterISPMode()

void ISPProtocol_EnterISPMode | ( | void |  | ) |

Handler for the CMD_ENTER_PROGMODE_ISP command, which attempts to enter programming mode on the attached device, returning success or failure back to the host.

## § ISPProtocol_LeaveISPMode()

void ISPProtocol_LeaveISPMode | ( | void |  | ) |

Handler for the CMD_LEAVE_ISP command, which releases the target from programming mode.

## § ISPProtocol_ProgramMemory()

void ISPProtocol_ProgramMemory | ( | uint8_t | V2Command | ) |

Handler for the CMD_PROGRAM_FLASH_ISP and CMD_PROGRAM_EEPROM_ISP commands, writing out bytes, words or pages of data to the attached device.

Parameters

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

## § ISPProtocol_ReadFuseLockSigOSCCAL()

void ISPProtocol_ReadFuseLockSigOSCCAL | ( | uint8_t | V2Command | ) |

Handler for the CMD_READ_FUSE_ISP, CMD_READ_LOCK_ISP, CMD_READ_SIGNATURE_ISP and CMD_READ_OSCCAL commands, reading the requested configuration byte from the device.

Parameters

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

## § ISPProtocol_ReadMemory()

void ISPProtocol_ReadMemory | ( | uint8_t | V2Command | ) |

Handler for the CMD_READ_FLASH_ISP and CMD_READ_EEPROM_ISP commands, reading in bytes, words or pages of data from the attached device.

Parameters

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

## § ISPProtocol_SPIMulti()

void ISPProtocol_SPIMulti | ( | void |  | ) |

Handler for the CMD_SPI_MULTI command, writing and reading arbitrary SPI data to and from the attached device.

## § ISPProtocol_WriteFuseLock()

void ISPProtocol_WriteFuseLock | ( | uint8_t | V2Command | ) |

Handler for the CMD_WRITE_FUSE_ISP and CMD_WRITE_LOCK_ISP commands, writing the requested configuration byte to the device.

Parameters

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