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.

108 lines
2.5 KiB

  1. ;**** **** **** **** ****
  2. ;
  3. ; Bluejay digital ESC firmware for controlling brushless motors in multirotors
  4. ;
  5. ; Copyright 2020 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 "T".
  26. ; RC X MA X MB CC MC X X X Cp Bp Ap Ac Bc Cc
  27. ;
  28. ;**** **** **** **** ****
  29. PWM_ACTIVE_HIGH EQU 1 ; Pwm non-inverted
  30. COMPWM_ACTIVE_HIGH EQU 1 ; Damping inverted
  31. ; Note: currently all comparator pins (Comp_ and Mux_) must be on the same port
  32. COMP_PORT EQU 0
  33. ;*********************
  34. ; PORT 0 definitions *
  35. ;*********************
  36. Rcp_In EQU 7 ;i
  37. ; EQU 6 ;i
  38. A_Mux EQU 5 ;i
  39. ; EQU 4 ;i
  40. B_Mux EQU 3 ;i
  41. Comp_Com EQU 2 ;i
  42. C_Mux EQU 1 ;i
  43. ; EQU 0 ;i
  44. P0_DIGITAL EQU NOT((1 SHL A_Mux) + (1 SHL B_Mux) + (1 SHL C_Mux) + (1 SHL Comp_Com))
  45. P0_INIT EQU 0FFh
  46. P0_PUSHPULL EQU 0
  47. P0_SKIP EQU 0FFh
  48. IF FETON_DELAY == 0
  49. PCA0_POWER_MODULE EQU PCA0CPM0
  50. PCA0_POWER_L EQU PCA0CPL0
  51. PCA0_POWER_H EQU PCA0CPH0
  52. PCA0_DAMP_MODULE EQU PCA0CPM1
  53. PCA0_DAMP_L EQU PCA0CPL1
  54. PCA0_DAMP_H EQU PCA0CPH1
  55. ELSE
  56. PCA0_POWER_MODULE EQU PCA0CPM1
  57. PCA0_POWER_L EQU PCA0CPL1
  58. PCA0_POWER_H EQU PCA0CPH1
  59. PCA0_DAMP_MODULE EQU PCA0CPM0
  60. PCA0_DAMP_L EQU PCA0CPL0
  61. PCA0_DAMP_H EQU PCA0CPH0
  62. ENDIF
  63. ;*********************
  64. ; PORT 1 definitions *
  65. ;*********************
  66. ; EQU 7 ;i
  67. ; EQU 6 ;i
  68. C_pwm EQU 5 ;o
  69. B_pwm EQU 4 ;o
  70. A_pwm EQU 3 ;o
  71. A_com EQU 2 ;o
  72. B_com EQU 1 ;o
  73. C_com EQU 0 ;o
  74. 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)
  75. P1_INIT EQU 00h
  76. 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)
  77. P1_SKIP EQU 0FFh
  78. ;*********************
  79. ; PORT 2 definitions *
  80. ;*********************
  81. DebugPin EQU 0 ;o
  82. P2_DIGITAL EQU (1 SHL DebugPin)
  83. P2_PUSHPULL EQU (1 SHL DebugPin)
  84. P2_SKIP EQU 0FFh
  85. ;**** **** **** **** ****
  86. ; Inherit base layout
  87. ;**** **** **** **** ****
  88. $include (Base.inc)