Fork from bluejay at github and modified for my custom ESC. I need to modify it because some mistake design on my ESC hardware.
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.

134 lines
2.8 KiB

  1. ;**** **** **** **** ****
  2. ;
  3. ; Bluejay digital ESC firmware for controlling brushless motors in multirotors
  4. ;
  5. ; Copyright 2020, 2021 Mathias Rasmussen
  6. ; Copyright 2011, 2012 Steffen Skaug
  7. ;
  8. ; This file is part of Bluejay.
  9. ;
  10. ; Bluejay is free software: you can redistribute it and/or modify
  11. ; it under the terms of the GNU General Public License as published by
  12. ; the Free Software Foundation, either version 3 of the License, or
  13. ; (at your option) any later version.
  14. ;
  15. ; Bluejay is distributed in the hope that it will be useful,
  16. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. ; GNU General Public License for more details.
  19. ;
  20. ; You should have received a copy of the GNU General Public License
  21. ; along with Bluejay. If not, see <http://www.gnu.org/licenses/>.
  22. ;
  23. ;**** **** **** **** ****
  24. ;
  25. ; Hardware definition file "M".
  26. ; MA MC CC MB RC L0 X X X Cc Bc Ac Cp Bp Ap X
  27. ;
  28. ;**** **** **** **** ****
  29. PWM_ACTIVE_HIGH EQU 1 ; Pwm non-inverted
  30. COM_ACTIVE_HIGH EQU 1 ; Damping inverted
  31. COMPARATOR_PORT EQU 0 ; All comparator (mux) pins must be on the same port
  32. IF DEADTIME == 0
  33. PCA0CPM_POWER EQU PCA0CPM0
  34. PCA0CPL_POWER EQU PCA0CPL0
  35. PCA0CPH_POWER EQU PCA0CPH0
  36. PCA0CPM_DAMP EQU PCA0CPM1
  37. PCA0CPL_DAMP EQU PCA0CPL1
  38. PCA0CPH_DAMP EQU PCA0CPH1
  39. ELSE
  40. PCA0CPM_POWER EQU PCA0CPM0
  41. PCA0CPL_POWER EQU PCA0CPL0
  42. PCA0CPH_POWER EQU PCA0CPH0
  43. PCA0CPM_DAMP EQU PCA0CPM1
  44. PCA0CPL_DAMP EQU PCA0CPL1
  45. PCA0CPH_DAMP EQU PCA0CPH1
  46. ENDIF
  47. ;*********************
  48. ; PORT 0 definitions *
  49. ;*********************
  50. A_Mux EQU 7
  51. C_Mux EQU 6
  52. V_Mux EQU 5
  53. B_Mux EQU 4
  54. RTX_PIN EQU 3
  55. LED_0 EQU 2
  56. ; EQU 1
  57. ; EQU 0
  58. P0_DIGITAL EQU NOT((1 SHL A_Mux) + (1 SHL B_Mux) + (1 SHL C_Mux) + (1 SHL V_Mux))
  59. P0_INIT EQU NOT(1 SHL LED_0)
  60. P0_PUSHPULL EQU (1 SHL LED_0)
  61. P0_SKIP EQU 0FFh
  62. ;*********************
  63. ; PORT 1 definitions *
  64. ;*********************
  65. ; EQU 7
  66. C_Com EQU 6
  67. B_Com EQU 5
  68. A_Com EQU 4
  69. C_Pwm EQU 3
  70. B_Pwm EQU 2
  71. A_Pwm EQU 1
  72. ; EQU 0
  73. P1_DIGITAL EQU (1 SHL A_Pwm) + (1 SHL B_Pwm) + (1 SHL C_Pwm) + (1 SHL A_Com) + (1 SHL B_Com) + (1 SHL C_Com)
  74. P1_INIT EQU 00h
  75. P1_PUSHPULL EQU (1 SHL A_Pwm) + (1 SHL B_Pwm) + (1 SHL C_Pwm) + (1 SHL A_Com) + (1 SHL B_Com) + (1 SHL C_Com)
  76. P1_SKIP EQU 0FFh
  77. ;*********************
  78. ; PORT 2 definitions *
  79. ;*********************
  80. DebugPin EQU 0
  81. P2_DIGITAL EQU (1 SHL DebugPin)
  82. P2_PUSHPULL EQU (1 SHL DebugPin)
  83. P2_SKIP EQU (1 SHL DebugPin)
  84. ;**** **** **** **** ****
  85. ; LED configuration
  86. ;**** **** **** **** ****
  87. Set_LED_0 MACRO
  88. setb P0.LED_0
  89. ENDM
  90. Clear_LED_0 MACRO
  91. clr P0.LED_0
  92. ENDM
  93. Set_LED_1 MACRO
  94. ENDM
  95. Clear_LED_1 MACRO
  96. ENDM
  97. Set_LED_2 MACRO
  98. ENDM
  99. Clear_LED_2 MACRO
  100. ENDM
  101. Set_LED_3 MACRO
  102. ENDM
  103. Clear_LED_3 MACRO
  104. ENDM
  105. ;**** **** **** **** ****
  106. ; Inherit base layout
  107. ;**** **** **** **** ****
  108. $set(CUSTOM_LED)
  109. $include (Base.inc)