/* drivers/dfu/usb/dfu/dfuerrs.h
 *
 * (c) 2002 Simtec Electronics
 *
 * Ben Dooks
 *
 * USB DFU Class - class specific request codes
 *
 * $Id: dfuerrs.h,v 1.5 2003/08/08 10:19:17 ben Exp $

*/

#ifndef __USB_DFU_DFUERRS_H
#define __USB_DFU_DFUERRS_H "$Id: dfuerrs.h,v 1.5 2003/08/08 10:19:17 ben Exp $"

/* suggested error codes to be returned from the get-error-status code
*/

enum usbdfu_err_e {
  USBDFU_ERR_OK       = 0x00,      /* ok */
  USBDFU_ERR_TARGET   = 0x01,      /* file is not targetted for this device */
  USBDFU_ERR_FILE     = 0x02,      /* data has failed verification */
  USBDFU_ERR_WRITE    = 0x03,      /* unable to write to memory */
  USBDFU_ERR_ERASE    = 0x04,      /* erase failed */
  USBDFU_ERR_ERASECHK = 0x05,      /* erase check failed */
  USBDFU_ERR_PROG     = 0x06,      /* program check failed */
  USBDFU_ERR_VERIFY   = 0x07,      /* verify failed */
  USBDFU_ERR_ADDRESS  = 0x08,      /* address out of range */
  USBDFU_ERR_NOTDONE  = 0x09,      /* premature end-of-data */
  USBDFU_ERR_FIRMWARE = 0x0A,      /* firmware corrupt - cannot goto runtime */
  USBDFU_ERR_VENDOR   = 0x0B,      /* vendor-specific error */
  USBDFU_ERR_USBR     = 0x0C,      /* unexpected usb reset */
  USBDFU_ERR_POR      = 0x0D,      /* unexpected power-on reset */
  USBDFU_ERR_UK       = 0x0E,      /* unknown error */
  USBDFU_ERR_STALLED  = 0x0F       /* device stalled unexpected request */
};

typedef enum usbdfu_err_e usbdfu_err_t;

extern const char *usbdfu_err2str(usbdfu_err_t err);


#endif /* __USB_DFU_DFUERRS_H */
