Keyboard firmwares for Atmel AVR and Cortex-M
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.

V2ProtocolConstants.h 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. LUFA Library
  3. Copyright (C) Dean Camera, 2014.
  4. dean [at] fourwalledcubicle [dot] com
  5. www.lufa-lib.org
  6. */
  7. /*
  8. Copyright 2014 Dean Camera (dean [at] fourwalledcubicle [dot] com)
  9. Permission to use, copy, modify, distribute, and sell this
  10. software and its documentation for any purpose is hereby granted
  11. without fee, provided that the above copyright notice appear in
  12. all copies and that both that the copyright notice and this
  13. permission notice and warranty disclaimer appear in supporting
  14. documentation, and that the name of the author not be used in
  15. advertising or publicity pertaining to distribution of the
  16. software without specific, written prior permission.
  17. The author disclaims all warranties with regard to this
  18. software, including all implied warranties of merchantability
  19. and fitness. In no event shall the author be liable for any
  20. special, indirect or consequential damages or any damages
  21. whatsoever resulting from loss of use, data or profits, whether
  22. in an action of contract, negligence or other tortious action,
  23. arising out of or in connection with the use or performance of
  24. this software.
  25. */
  26. /** \file
  27. *
  28. * Macros for the V2 Protocol Packet Commands and Responses.
  29. */
  30. #ifndef _V2_PROTOCOL_CONSTANTS_
  31. #define _V2_PROTOCOL_CONSTANTS_
  32. /* Macros: */
  33. #define CMD_SIGN_ON 0x01
  34. #define CMD_SET_PARAMETER 0x02
  35. #define CMD_GET_PARAMETER 0x03
  36. #define CMD_OSCCAL 0x05
  37. #define CMD_LOAD_ADDRESS 0x06
  38. #define CMD_FIRMWARE_UPGRADE 0x07
  39. #define CMD_RESET_PROTECTION 0x0A
  40. #define CMD_ENTER_PROGMODE_ISP 0x10
  41. #define CMD_LEAVE_PROGMODE_ISP 0x11
  42. #define CMD_CHIP_ERASE_ISP 0x12
  43. #define CMD_PROGRAM_FLASH_ISP 0x13
  44. #define CMD_READ_FLASH_ISP 0x14
  45. #define CMD_PROGRAM_EEPROM_ISP 0x15
  46. #define CMD_READ_EEPROM_ISP 0x16
  47. #define CMD_PROGRAM_FUSE_ISP 0x17
  48. #define CMD_READ_FUSE_ISP 0x18
  49. #define CMD_PROGRAM_LOCK_ISP 0x19
  50. #define CMD_READ_LOCK_ISP 0x1A
  51. #define CMD_READ_SIGNATURE_ISP 0x1B
  52. #define CMD_READ_OSCCAL_ISP 0x1C
  53. #define CMD_SPI_MULTI 0x1D
  54. #define CMD_XPROG 0x50
  55. #define CMD_XPROG_SETMODE 0x51
  56. #define STATUS_CMD_OK 0x00
  57. #define STATUS_CMD_TOUT 0x80
  58. #define STATUS_RDY_BSY_TOUT 0x81
  59. #define STATUS_SET_PARAM_MISSING 0x82
  60. #define STATUS_CMD_FAILED 0xC0
  61. #define STATUS_CMD_UNKNOWN 0xC9
  62. #define STATUS_CMD_ILLEGAL_PARAM 0xCA
  63. #define STATUS_ISP_READY 0x00
  64. #define STATUS_CONN_FAIL_MOSI 0x01
  65. #define STATUS_CONN_FAIL_RST 0x02
  66. #define STATUS_CONN_FAIL_SCK 0x04
  67. #define STATUS_TGT_NOT_DETECTED 0x10
  68. #define STATUS_TGT_REVERSE_INSERTED 0x20
  69. #define PARAM_BUILD_NUMBER_LOW 0x80
  70. #define PARAM_BUILD_NUMBER_HIGH 0x81
  71. #define PARAM_HW_VER 0x90
  72. #define PARAM_SW_MAJOR 0x91
  73. #define PARAM_SW_MINOR 0x92
  74. #define PARAM_VTARGET 0x94
  75. #define PARAM_SCK_DURATION 0x98
  76. #define PARAM_RESET_POLARITY 0x9E
  77. #define PARAM_STATUS_TGT_CONN 0xA1
  78. #define PARAM_DISCHARGEDELAY 0xA4
  79. #endif