AVRISP-MKII Clone Programmer Project

Macros | Functions
AVRISP-MKII.h File Reference
`#include <avr/io.h>`
`#include <avr/wdt.h>`
`#include <avr/interrupt.h>`
`#include <avr/power.h>`
`#include <LUFA/Drivers/Board/LEDs.h>`
`#include <LUFA/Drivers/USB/USB.h>`
`#include <LUFA/Platform/Platform.h>`
`#include "AVRISPDescriptors.h"`
`#include "Lib/V2Protocol.h"`
`#include "Config/AppConfig.h"`

## Macros

#define | LEDMASK_USB_NOTREADY LEDS_LED1
#define | LEDMASK_USB_ENUMERATING (LEDS_LED1 | LEDS_LED2)
#define | LEDMASK_USB_READY LEDS_LED2
#define | LEDMASK_USB_ERROR LEDS_LED1
#define | LEDMASK_BUSY (LEDS_LED1 | LEDS_LED2)
#define | LEDMASK_VBUSPOWER LEDS_LED3

## Functions

void | SetupHardware (void)
void | AVRISP_Task (void)
void | EVENT_USB_Device_Connect (void)
void | EVENT_USB_Device_Disconnect (void)
void | EVENT_USB_Device_ConfigurationChanged (void)
uint16_t | CALLBACK_USB_GetDescriptor (const uint16_t wValue, const uint16_t wIndex, const void **const DescriptorAddress) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3)

## Detailed Description

Header file for AVRISP.c.

## Macro Definition Documentation

## § LEDMASK_BUSY

#define LEDMASK_BUSY (LEDS_LED1 | LEDS_LED2)

LED mask for the library LED driver, to indicate that the USB interface is busy.

## § LEDMASK_USB_ENUMERATING

#define LEDMASK_USB_ENUMERATING (LEDS_LED1 | LEDS_LED2)

LED mask for the library LED driver, to indicate that the USB interface is enumerating.

## § LEDMASK_USB_ERROR

#define LEDMASK_USB_ERROR LEDS_LED1

LED mask for the library LED driver, to indicate that an error has occurred in the USB interface.

## § LEDMASK_USB_NOTREADY

#define LEDMASK_USB_NOTREADY LEDS_LED1

LED mask for the library LED driver, to indicate that the USB interface is not ready.

## § LEDMASK_USB_READY

#define LEDMASK_USB_READY LEDS_LED2

LED mask for the library LED driver, to indicate that the USB interface is ready.

## § LEDMASK_VBUSPOWER

#define LEDMASK_VBUSPOWER LEDS_LED3

LED mask for the library LED driver, to indicate that the target is being powered by VBUS.

## Function Documentation

## § AVRISP_Task()

void AVRISP_Task | ( | void |  | ) |

Processes incoming V2 Protocol commands from the host, returning a response when required.

## § CALLBACK_USB_GetDescriptor()

uint16_t CALLBACK_USB_GetDescriptor | ( | const uint16_t | wValue,
|  | const uint16_t | wIndex,
|  | const void **const | DescriptorAddress
| ) |  |

This function is called by the library when in device mode, and must be overridden (see library "USB Descriptors" documentation) by the application code so that the address and size of a requested descriptor can be given to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the USB host.

Parameters

  [in] | wValue | Descriptor type and index to retrieve
  [in] | wIndex | Sub-index to retrieve (such as a localized string language)
  [out] | DescriptorAddress | Address of the retrieved descriptor

Returns
  Length of the retrieved descriptor in bytes, or NO_DESCRIPTOR if the descriptor was not found

## § EVENT_USB_Device_ConfigurationChanged()

void EVENT_USB_Device_ConfigurationChanged | ( | void |  | ) |

Event handler for the library USB Configuration Changed event.

## § EVENT_USB_Device_Connect()

void EVENT_USB_Device_Connect | ( | void |  | ) |

Event handler for the library USB Connection event.

## § EVENT_USB_Device_Disconnect()

void EVENT_USB_Device_Disconnect | ( | void |  | ) |

Event handler for the library USB Disconnection event.

## § SetupHardware()

void SetupHardware | ( | void |  | ) |

Configures the board hardware and chip peripherals for the demo's functionality.