logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

transaction_id_define.h (3762B)


  1. /* Copyright 2021 QMK
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #pragma once
  17. #include "compiler_support.h"
  18. enum serial_transaction_id {
  19. #ifdef USE_I2C
  20. I2C_EXECUTE_CALLBACK,
  21. #endif // USE_I2C
  22. GET_SLAVE_MATRIX_CHECKSUM,
  23. GET_SLAVE_MATRIX_DATA,
  24. #ifdef SPLIT_TRANSPORT_MIRROR
  25. PUT_MASTER_MATRIX,
  26. #endif // SPLIT_TRANSPORT_MIRROR
  27. #ifdef ENCODER_ENABLE
  28. GET_ENCODERS_CHECKSUM,
  29. GET_ENCODERS_DATA,
  30. CMD_ENCODER_DRAIN,
  31. #endif // ENCODER_ENABLE
  32. #ifndef DISABLE_SYNC_TIMER
  33. PUT_SYNC_TIMER,
  34. #endif // DISABLE_SYNC_TIMER
  35. #if !defined(NO_ACTION_LAYER) && defined(SPLIT_LAYER_STATE_ENABLE)
  36. PUT_LAYER_STATE,
  37. PUT_DEFAULT_LAYER_STATE,
  38. #endif // !defined(NO_ACTION_LAYER) && defined(SPLIT_LAYER_STATE_ENABLE)
  39. #ifdef SPLIT_LED_STATE_ENABLE
  40. PUT_LED_STATE,
  41. #endif // SPLIT_LED_STATE_ENABLE
  42. #ifdef SPLIT_MODS_ENABLE
  43. PUT_MODS,
  44. #endif // SPLIT_MODS_ENABLE
  45. #ifdef BACKLIGHT_ENABLE
  46. PUT_BACKLIGHT,
  47. #endif // BACKLIGHT_ENABLE
  48. #if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT)
  49. PUT_RGBLIGHT,
  50. #endif // defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT)
  51. #if defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT)
  52. PUT_LED_MATRIX,
  53. #endif // defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT)
  54. #if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT)
  55. PUT_RGB_MATRIX,
  56. #endif // defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT)
  57. #if defined(WPM_ENABLE) && defined(SPLIT_WPM_ENABLE)
  58. PUT_WPM,
  59. #endif // defined(WPM_ENABLE) && defined(SPLIT_WPM_ENABLE)
  60. #if defined(OLED_ENABLE) && defined(SPLIT_OLED_ENABLE)
  61. PUT_OLED,
  62. #endif // defined(OLED_ENABLE) && defined(SPLIT_OLED_ENABLE)
  63. #if defined(ST7565_ENABLE) && defined(SPLIT_ST7565_ENABLE)
  64. PUT_ST7565,
  65. #endif // defined(ST7565_ENABLE) && defined(SPLIT_ST7565_ENABLE)
  66. #if defined(POINTING_DEVICE_ENABLE) && defined(SPLIT_POINTING_ENABLE)
  67. GET_POINTING_CHECKSUM,
  68. GET_POINTING_DATA,
  69. PUT_POINTING_CPI,
  70. #endif // defined(POINTING_DEVICE_ENABLE) && defined(SPLIT_POINTING_ENABLE)
  71. #if defined(SPLIT_WATCHDOG_ENABLE)
  72. PUT_WATCHDOG,
  73. #endif // defined(SPLIT_WATCHDOG_ENABLE)
  74. #if defined(HAPTIC_ENABLE) && defined(SPLIT_HAPTIC_ENABLE)
  75. PUT_HAPTIC,
  76. #endif // defined(HAPTIC_ENABLE) && defined(SPLIT_HAPTIC_ENABLE)
  77. #if defined(SPLIT_ACTIVITY_ENABLE)
  78. PUT_ACTIVITY,
  79. #endif // SPLIT_ACTIVITY_ENABLE
  80. #if defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER)
  81. PUT_RPC_INFO,
  82. PUT_RPC_REQ_DATA,
  83. EXECUTE_RPC,
  84. GET_RPC_RESP_DATA,
  85. #endif // defined(SPLIT_TRANSACTION_IDS_KB) || defined(SPLIT_TRANSACTION_IDS_USER)
  86. // keyboard-specific
  87. #ifdef SPLIT_TRANSACTION_IDS_KB
  88. SPLIT_TRANSACTION_IDS_KB,
  89. #endif // SPLIT_TRANSACTION_IDS_KB
  90. // user/keymap-specific
  91. #ifdef SPLIT_TRANSACTION_IDS_USER
  92. SPLIT_TRANSACTION_IDS_USER,
  93. #endif // SPLIT_TRANSACTION_IDS_USER
  94. #if defined(OS_DETECTION_ENABLE) && defined(SPLIT_DETECTED_OS_ENABLE)
  95. PUT_DETECTED_OS,
  96. #endif // defined(OS_DETECTION_ENABLE) && defined(SPLIT_DETECTED_OS_ENABLE)
  97. NUM_TOTAL_TRANSACTIONS
  98. };
  99. // Ensure we only use 5 bits for transaction
  100. STATIC_ASSERT(NUM_TOTAL_TRANSACTIONS <= (1 << 5), "Max number of usable transactions exceeded");