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.

103 lines
2.5 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 "B". Equals "A", but with A and C fets swapped and pwm and com fets swapped
  26. ; X X RC X MC MB MA CC X X Ap Ac Bp Bc Cp Cc
  27. ;
  28. ;**** **** **** **** ****
  29. PWM_ACTIVE_HIGH EQU 1 ; Pwm non-inverted
  30. COMPWM_ACTIVE_HIGH EQU 1 ; Damping inverted
  31. COMPARATOR_PORT EQU 0 ; All comparator (mux) pins must be on the same port
  32. IF FETON_DELAY == 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 PCA0CPM1
  41. PCA0CPL_POWER EQU PCA0CPL1
  42. PCA0CPH_POWER EQU PCA0CPH1
  43. PCA0CPM_DAMP EQU PCA0CPM0
  44. PCA0CPL_DAMP EQU PCA0CPL0
  45. PCA0CPH_DAMP EQU PCA0CPH0
  46. ENDIF
  47. ;*********************
  48. ; PORT 0 definitions *
  49. ;*********************
  50. ; EQU 7
  51. ; EQU 6
  52. Rcp_In EQU 5
  53. ; EQU 4
  54. C_Mux EQU 3
  55. B_Mux EQU 2
  56. A_Mux EQU 1
  57. V_Mux 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 0FFh
  60. P0_PUSHPULL EQU 0
  61. P0_SKIP EQU 0FFh
  62. ;*********************
  63. ; PORT 1 definitions *
  64. ;*********************
  65. ; EQU 7
  66. ; EQU 6
  67. A_pwm EQU 5
  68. A_com EQU 4
  69. B_pwm EQU 3
  70. B_com EQU 2
  71. C_pwm EQU 1
  72. C_com 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 0FFh
  84. ;**** **** **** **** ****
  85. ; Inherit base layout
  86. ;**** **** **** **** ****
  87. $include (Base.inc)