canbus_interface.cpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. // table of user settable CAN bus parameters
  17. const AP_Param::GroupInfo AP_BoardConfig_CAN::Interface::var_info[] = {
  18. // @Param: DRIVER
  19. // @DisplayName: Index of virtual driver to be used with physical CAN interface
  20. // @Description: Enabling this option enables use of CAN buses.
  21. // @Values: 0:Disabled,1:First driver,2:Second driver
  22. // @User: Standard
  23. // @RebootRequired: True
  24. AP_GROUPINFO_FLAGS("DRIVER", 1, AP_BoardConfig_CAN::Interface, _driver_number, HAL_CAN_DRIVER_DEFAULT, AP_PARAM_FLAG_ENABLE),
  25. // @Param: BITRATE
  26. // @DisplayName: Bitrate of CAN interface
  27. // @Description: Bit rate can be set up to from 10000 to 1000000
  28. // @Range: 10000 1000000
  29. // @User: Advanced
  30. AP_GROUPINFO("BITRATE", 2, AP_BoardConfig_CAN::Interface, _bitrate, 1000000),
  31. #if AP_CAN_DEBUG
  32. // @Param: DEBUG
  33. // @DisplayName: Level of debug for CAN devices
  34. // @Description: Enabling this option will provide debug messages
  35. // @Values: 0:Disabled,1:Major messages,2:All messages
  36. // @User: Advanced
  37. AP_GROUPINFO("DEBUG", 3, AP_BoardConfig_CAN::Interface, _debug_level, 1),
  38. #endif
  39. AP_GROUPEND
  40. };
  41. #endif