# Atmel EDBG-based Tools Protocols
Housekeeping Protocol

### Housekeeping ID definitions

    enum Jtagice3HousekeepingCommands {

        // Basics
        CMD_HOUSEKEEPING_QUERY                  = 0x00, //! Capability discovery
        CMD_HOUSEKEEPING_SET                    = 0x01, //! Set parameters
        CMD_HOUSEKEEPING_GET                    = 0x02, //! Get parameters

        // Session
        CMD_HOUSEKEEPING_START_SESSION          = 0x10, //! Start a session
        CMD_HOUSEKEEPING_END_SESSION            = 0x11, //! Terminate a session

        // Misc target-related
        CMD_HOUSEKEEPING_JTAG_DETECT            = 0x30, //! Scan for JTAG devices
        CMD_HOUSEKEEPING_CAL_OSC                = 0x31, //! Oscillator calibration

        // Internal commands
        CMD_HOUSEKEEPING_FW_UPGRADE             = 0x50, //! Enter upgrade mode
    };

    enum Jtagice3HousekeepingResponses {
        RSP_HOUSEKEEPING_OK                     = 0x80, //! All OK
        RSP_HOUSEKEEPING_LIST                   = 0x81, //! List of items returned
        RSP_HOUSEKEEPING_DATA                   = 0x84, //! Data returned
        RSP_HOUSEKEEPING_FAILED                 = 0xA0, //! Command failed to execute
        RSP_HOUSEKEEPING_FAILED_WITH_DATA       = 0xA1  //! Failed with more info

    };

    enum Jtagice3HousekeepingEvents {
        EVT_HOUSEKEEPING_POWER                  = 0x10, //! Power event occurred
        EVT_HOUSEKEEPING_SLEEP                  = 0x11, //! Sleep event detected
        EVT_HOUSEKEEPING_EXT_RESET              = 0x12, //! External reset event
    };

    enum Jtagice3HousekeepingFailureCodes {
        HOUSEKEEPING_FAILED_OK                              = 0x00, //! All OK
        HOUSEKEEPING_FAILED_NOT_SUPPORTED                   = 0x10, //! Not supported
        HOUSEKEEPING_FAILED_INVALID_KEY                     = 0x11, //! Wrong key
        HOUSEKEEPING_FAILED_INVALID_PARAMETER               = 0x12, //! Wrong parameter
        HOUSEKEEPING_FAILED_INVALID_PARAMETER_VALUE         = 0x13, //! Wrong value

        HOUSEKEEPING_FAILED_JTAG_DETECT_NO_DEVICES          = 0x30, //! No devices
        HOUSEKEEPING_FAILED_JTAG_DETECT_TOO_MANY_DEVICES    = 0x31, //! Too many devices
        HOUSEKEEPING_FAILED_JTAG_DETECT_JTAGM_INIT_ERROR    = 0x32, //! Init failed
        HOUSEKEEPING_FAILED_JTAG_DETECT_JTAGM_ERROR         = 0x33, //! JTAGM error

        HOUSEKEEPING_FAILED_NO_TARGET_POWER                 = 0x38, //! Apply power

        HOUSEKEEPING_FAILED_OSCCAL_INVALID_MODE             = 0x40, //! Wrong mode
        HOUSEKEEPING_FAILED_OSCCAL_INVALID_PHYSICAL         = 0x41, //! Wrong phy
        HOUSEKEEPING_FAILED_OSCCAL_FW_ERROR                 = 0x42, //! Firmware error
        HOUSEKEEPING_FAILED_OSCCAL_FAILED                   = 0x43, //! OSCCAL error
    };

    enum Jtagice3SetGetFailureCodes {
        SETGET_FAILURE_OK                                   = 0x00, //! All OK
        SETGET_FAILURE_NOT_IMPLEMENTED                      = 0x10, //! Command not implented
        SETGET_FAILURE_NOT_SUPPORTED                        = 0x11, //! Parameter not supported
        SETGET_FAILURE_INVALID_CLOCK_SPEED                  = 0x20, //! Clock out of range
        SETGET_FAILURE_ILLEGAL_STATE                        = 0x21, //! Wrong state to access the parameter
        SETGET_FAILURE_JTAGM_INIT_ERROR                     = 0x22, //! JTAG initialisation error
        SETGET_FAILURE_INVALID_VALUE                        = 0x23  //! Value out of range
    };

    enum Jtagice3HousekeepingQueryContexts {
        HK_QUERY_COMMANDS                                   = 0x00  //! Supported command list
    };

    enum Jtagice3HousekeepingSetGetContexts {
        HK_CONTEXT_CONFIG                                   = 0x00, //! Config parameter
        HK_CONTEXT_ANALOG                                   = 0x01, //! Analog parameters
    };

    enum Jtagice3HousekeepingConfigContextParameters {
        HOUSEKEEPING_CONFIG_HWREV               = 0x00, //! Hardware revision
        HOUSEKEEPING_CONFIG_FWREV_MAJ           = 0x01, //! Firmware revision high
        HOUSEKEEPING_CONFIG_FWREV_MIN           = 0x02, //! Firmware revision low
        HOUSEKEEPING_CONFIG_BUILD               = 0x03, //! Firmware build number
    };

    enum Jtagice3HousekeepingAnalogContextParameters {
        HOUSEKEEPING_ANALOG_VTREF               = 0x00  //! Target reference voltage
    };

    enum Jtagice3HousekeepingPowerEvents {
        HOUSEKEEPING_POWER_OFF                  = 0x00, //! Power went off
        HOUSEKEEPING_POWER_ON                   = 0x01  //! Power went on
    };

    enum Jtagice3HousekeepingSleepEvents {
        HOUSEKEEPING_AWAKE                      = 0x00, //! Target woke up
        HOUSEKEEPING_SLEEP                      = 0x01  //! Target fell asleep
    };

    enum Jtagice3HousekeepingResetEvents {
        HOUSEKEEPING_RESET_RELEASED             = 0x00, //! External reset released
        HOUSEKEEPING_RESET_APPLIED              = 0x01  //! External reset applied
    };

Prev | Up | Next
| Home |