ID Definitions

This sections includes the header file defining the different command, response, and event IDs for the AVRISP protocol. It also defines the different possible failure codes.

enum SpiProgrammingProtocolCommands {
    //**********************************************************
    // Protocol commands
    //**********************************************************
    SPI_CMD_LOAD_ADDRESS                    = 0x06, //! Load address
    SPI_CMD_ENTER_PROGMODE                  = 0x10, //! Enter programming mode
    SPI_CMD_LEAVE_PROGMODE                  = 0x11, //! Leave programming mode
    SPI_CMD_CHIP_ERASE                      = 0x12, //! Erase device
    SPI_CMD_PROGRAM_FLASH                   = 0x13, //! Program flash data
    SPI_CMD_READ_FLASH                      = 0x14, //! Read flash data
    SPI_CMD_PROGRAM_EEPROM                  = 0x15, //! Program EEPROM data
    SPI_CMD_READ_EEPROM                     = 0x16, //! Read EEPROM data
    SPI_CMD_PROGRAM_FUSE                    = 0x17, //! Program a fuse byte
    SPI_CMD_READ_FUSE                       = 0x18, //! Read a fuse byte
    SPI_CMD_PROGRAM_LOCK                    = 0x19, //! Program lock bits
    SPI_CMD_READ_LOCK                       = 0x1A, //! Read lock bits
    SPI_CMD_READ_SIGNATURE                  = 0x1B, //! Read a signature byte
    SPI_CMD_READ_OSCCAL                     = 0x1C, //! Read an OSCCAL byte
    SPI_CMD_SET_BAUD                        = 0x1D, //! Set baud rate
    SPI_CMD_GET_BAUD                        = 0x1E  //! Read baud rate
};

enum SpiProgrammingProtocolResponses {
    //**********************************************************
    // Protocol responses
    //**********************************************************
    // Success
    SPI_STATUS_CMD_OK                       = 0x00, //! All OK

    // Warnings
    SPI_STATUS_CMD_TOUT                     = 0x80, //! Command timeout
    SPI_STATUS_RDY_BSY_TOUT                 = 0x81, //! Device busy

    // Errors
    SPI_STATUS_CMD_FAILED                   = 0xC0, //! Command failed
    SPI_STATUS_CMD_UNKNOWN                  = 0xC9, //! Unknown error
    SPI_STATUS_PHY_ERROR                    = 0xCB, //! Physical error
    SPI_STATUS_CLOCK_ERROR                  = 0xCC, //! Speed error
    SPI_STATUS_BAUD_INVALID                 = 0xCD  //! Baud value error
};