You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

58 lines
2.8 KiB

  1. /***************************************************************************
  2. * Copyright (C) 2011 by Spencer Oliver <spen@spen-soft.co.uk> *
  3. * *
  4. * Written by Arnim Laeuger, 2008 (from urjtag) *
  5. * *
  6. * This program is free software; you can redistribute it and/or modify *
  7. * it under the terms of the GNU General Public License as published by *
  8. * the Free Software Foundation; either version 2 of the License, or *
  9. * (at your option) any later version. *
  10. * *
  11. * This program is distributed in the hope that it will be useful, *
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  14. * GNU General Public License for more details. *
  15. * *
  16. * You should have received a copy of the GNU General Public License *
  17. * along with this program; if not, write to the *
  18. * Free Software Foundation, Inc., *
  19. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
  20. ***************************************************************************/
  21. #ifndef _FTD2XX_COMMON_H
  22. #define _FTD2XX_COMMON_H
  23. #if BUILD_FT2232_FTD2XX == 1
  24. #include <ftd2xx.h>
  25. static const char *ftd2xx_status_string(FT_STATUS status)
  26. {
  27. switch (status) {
  28. case FT_OK: return "OK";
  29. case FT_INVALID_HANDLE: return "invalid handle";
  30. case FT_DEVICE_NOT_FOUND: return "device not found";
  31. case FT_DEVICE_NOT_OPENED: return "device not opened";
  32. case FT_IO_ERROR: return "io error";
  33. case FT_INSUFFICIENT_RESOURCES: return "insufficient resources";
  34. case FT_INVALID_PARAMETER: return "invalid parameter";
  35. case FT_INVALID_BAUD_RATE: return "invalid baud rate";
  36. case FT_DEVICE_NOT_OPENED_FOR_ERASE: return "device not opened for erase";
  37. case FT_DEVICE_NOT_OPENED_FOR_WRITE: return "device not opened for write";
  38. case FT_FAILED_TO_WRITE_DEVICE: return "failed to write device";
  39. case FT_EEPROM_READ_FAILED: return "eeprom read failed";
  40. case FT_EEPROM_WRITE_FAILED: return "eeprom write failed";
  41. case FT_EEPROM_ERASE_FAILED: return "eeprom erase failed";
  42. case FT_EEPROM_NOT_PRESENT: return "eeprom not present";
  43. case FT_EEPROM_NOT_PROGRAMMED: return "eeprom not programmed";
  44. case FT_INVALID_ARGS: return "invalid args";
  45. case FT_NOT_SUPPORTED: return "not supported";
  46. case FT_OTHER_ERROR: return "other error";
  47. }
  48. return "undefined FTD2xx error";
  49. }
  50. #endif
  51. #endif /* _FTD2XX_COMMON_H */