canbus_driver.cpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * This program is free software: you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation, either version 3 of the License, or
  5. (at your option) any later version.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License
  11. along with this program. If not, see <http://www.gnu.org/licenses/>.
  12. */
  13. #include <AP_HAL/AP_HAL.h>
  14. #if HAL_WITH_UAVCAN
  15. #include "AP_BoardConfig_CAN.h"
  16. #include <AP_Vehicle/AP_Vehicle.h>
  17. #include <AP_UAVCAN/AP_UAVCAN.h>
  18. #include <AP_ToshibaCAN/AP_ToshibaCAN.h>
  19. // To be replaced with macro saying if KDECAN library is included
  20. #if APM_BUILD_TYPE(APM_BUILD_ArduCopter) || APM_BUILD_TYPE(APM_BUILD_ArduPlane) || APM_BUILD_TYPE(APM_BUILD_ArduSub)
  21. #include <AP_KDECAN/AP_KDECAN.h>
  22. #endif
  23. // table of user settable CAN bus parameters
  24. const AP_Param::GroupInfo AP_BoardConfig_CAN::Driver::var_info[] = {
  25. // @Param: PROTOCOL
  26. // @DisplayName: Enable use of specific protocol over virtual driver
  27. // @Description: Enabling this option starts selected protocol that will use this virtual driver
  28. // @Values{Copter,Plane,Sub}: 0:Disabled,1:UAVCAN,2:KDECAN,3:ToshibaCAN
  29. // @Values: 0:Disabled,1:UAVCAN,3:ToshibaCAN
  30. // @User: Advanced
  31. // @RebootRequired: True
  32. AP_GROUPINFO("PROTOCOL", 1, AP_BoardConfig_CAN::Driver, _protocol_type, AP_BoardConfig_CAN::Protocol_Type_UAVCAN),
  33. // @Group: UC_
  34. // @Path: ../AP_UAVCAN/AP_UAVCAN.cpp
  35. AP_SUBGROUPPTR(_uavcan, "UC_", 2, AP_BoardConfig_CAN::Driver, AP_UAVCAN),
  36. // To be replaced with macro saying if KDECAN library is included
  37. #if APM_BUILD_TYPE(APM_BUILD_ArduCopter) || APM_BUILD_TYPE(APM_BUILD_ArduPlane) || APM_BUILD_TYPE(APM_BUILD_ArduSub)
  38. // @Group: KDE_
  39. // @Path: ../AP_KDECAN/AP_KDECAN.cpp
  40. AP_SUBGROUPPTR(_kdecan, "KDE_", 3, AP_BoardConfig_CAN::Driver, AP_KDECAN),
  41. #endif
  42. AP_GROUPEND
  43. };
  44. #endif