BootloaderCDC.h File Reference

#include <avr/io.h>
#include <avr/wdt.h>
#include <avr/boot.h>
#include <avr/eeprom.h>
#include <avr/power.h>
#include <stdbool.h>
#include "Descriptors.h"
#include <LUFA/Drivers/USB/USB.h>

Data Structures

struct  CDC_Line_Coding_t

Defines

#define REQ_GetLineEncoding   0x21
#define REQ_SetLineEncoding   0x20
#define REQ_SetControlLineState   0x22
#define BOOTLOADER_VERSION_MAJOR   0x01
#define BOOTLOADER_VERSION_MINOR   0x00
#define BOOTLOADER_HWVERSION_MAJOR   0x01
#define BOOTLOADER_HWVERSION_MINOR   0x00
#define SOFTWARE_IDENTIFIER   "LUFACDC"

Typedefs

typedef void(* AppPtr_t )(void) ATTR_NO_RETURN

Enumerations

enum  BootloaderCDC_CDC_LineCodingFormats_t {
  OneStopBit = 0,
  OneAndAHalfStopBits = 1,
  TwoStopBits = 2
}
enum  BootloaderCDC_CDC_LineCodingParity_t {
  Parity_None = 0,
  Parity_Odd = 1,
  Parity_Even = 2,
  Parity_Mark = 3,
  Parity_Space = 4
}

Functions

void CDC_Task (void)
void SetupHardware (void)
void ResetHardware (void)
void EVENT_USB_Device_ConfigurationChanged (void)
void EVENT_USB_Device_UnhandledControlRequest (void)
static void ReadWriteMemoryBlock (const uint8_t Command)
static uint8_t FetchNextCommandByte (void)
static void WriteNextResponseByte (const uint8_t Response)

Detailed Description

Header file for BootloaderCDC.c.


Define Documentation

#define BOOTLOADER_HWVERSION_MAJOR   0x01

Hardware version major of the CDC bootloader.

#define BOOTLOADER_HWVERSION_MINOR   0x00

Hardware version minor of the CDC bootloader.

#define BOOTLOADER_VERSION_MAJOR   0x01

Version major of the CDC bootloader.

#define BOOTLOADER_VERSION_MINOR   0x00

Version minor of the CDC bootloader.

#define REQ_GetLineEncoding   0x21

CDC Class Specific request to get the line encoding on a CDC-ACM virtual serial port, including the baud rate, parity, stop bits and data bits.

#define REQ_SetControlLineState   0x22

CDC Class Specific request to set the state of the serial handshake lines (such as DCD and RTS) on a CDC-ACM virtual serial port.

#define REQ_SetLineEncoding   0x20

CDC Class Specific request to set the line encoding on a CDC-ACM virtual serial port, including the baud rate, parity, stop bits and data bits.

#define SOFTWARE_IDENTIFIER   "LUFACDC"

Eight character bootloader firmware identifier reported to the host when requested


Typedef Documentation

typedef void(* AppPtr_t)(void) ATTR_NO_RETURN

Type define for a non-returning pointer to the start of the loaded application in flash memory.


Enumeration Type Documentation

Enum for the possible line encoding formats on a CDC-ACM virtual serial port

Enumerator:
OneStopBit 

Single stop bit

OneAndAHalfStopBits 

1.5 stop bits

TwoStopBits 

Two stop bits

Enum for the possible parity modes on a CDC-ACM virtual serial port

Enumerator:
Parity_None 

No data parity checking

Parity_Odd 

Odd data parity checking

Parity_Even 

Even data parity checking

Parity_Mark 

Mark data parity checking

Parity_Space 

Space data parity checking


Function Documentation

void CDC_Task ( void   ) 

Task to read in AVR910 commands from the CDC data OUT endpoint, process them, perform the required actions and send the appropriate response back to the host.

void EVENT_USB_Device_ConfigurationChanged ( void   ) 

Event handler for the USB_ConfigurationChanged event. This configures the device's endpoints ready to relay data to and from the attached USB host.

void EVENT_USB_Device_UnhandledControlRequest ( void   ) 

Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific control requests that are not handled internally by the USB library, so that they can be handled appropriately for the application.

static uint8_t FetchNextCommandByte ( void   )  [static]
static void ReadWriteMemoryBlock ( const uint8_t  Command  )  [static]
void ResetHardware ( void   ) 

Resets all configured hardware required for the bootloader back to their original states.

void SetupHardware ( void   ) 

Configures all hardware required for the bootloader.

static void WriteNextResponseByte ( const uint8_t  Response  )  [static]
Generated by  doxygen 1.6.3