Include can-utils.

This commit is contained in:
Benjamin Perseghetti
2022-06-06 19:37:20 -04:00
parent b7f8b589d7
commit b7cc0bd139
5 changed files with 33 additions and 3 deletions
@@ -25,6 +25,11 @@ CONFIG_BCH=y
CONFIG_BOARDCTL_RESET=y
CONFIG_BOARD_LOOPSPERMSEC=3997
CONFIG_BUILTIN=y
CONFIG_CAN=y
CONFIG_CANUTILS_CANDUMP=y
CONFIG_CANUTILS_CANSEND=y
CONFIG_CAN_EXTID=y
CONFIG_CAN_FD=y
CONFIG_CLOCK_MONOTONIC=y
CONFIG_DEBUG_FULLOPT=y
CONFIG_DEBUG_HARDFAULT_ALERT=y
+1 -1
View File
@@ -1,3 +1,3 @@
CONFIG_DRIVERS_PCA9685_UCAN=y
CONFIG_DRIVERS_GPS=n
CONFIG_DRIVERS_PCA9685_UCAN=y
CONFIG_EXAMPLES_PCA_PWM_TEST=y
+2 -1
View File
@@ -116,7 +116,7 @@ public:
private:
const UavcanParamBinder _uavcan_params[13] {
const UavcanParamBinder _uavcan_params[14] {
{"uavcan.pub.esc.0.id", "UCAN1_ESC_PUB", px4_param_to_uavcan_port_id, uavcan_port_id_to_px4_param},
{"uavcan.pub.servo.0.id", "UCAN1_SERVO_PUB", px4_param_to_uavcan_port_id, uavcan_port_id_to_px4_param},
{"uavcan.pub.gps.0.id", "UCAN1_GPS_PUB", px4_param_to_uavcan_port_id, uavcan_port_id_to_px4_param},
@@ -130,6 +130,7 @@ private:
{"uavcan.sub.legacy_bms.0.id", "UCAN1_LG_BMS_SUB", px4_param_to_uavcan_port_id, uavcan_port_id_to_px4_param},
{"uavcan.sub.uorb.sensor_gps.0.id", "UCAN1_UORB_GPS", px4_param_to_uavcan_port_id, uavcan_port_id_to_px4_param},
{"uavcan.pub.uorb.sensor_gps.0.id", "UCAN1_UORB_GPS_P", px4_param_to_uavcan_port_id, uavcan_port_id_to_px4_param},
{"uavcan.sub.uorb.pca_pwm.0.id", "UCAN1_PCA_PWM_S", px4_param_to_uavcan_port_id, uavcan_port_id_to_px4_param},
//{"uavcan.sub.bms.0.id", "UCAN1_BMS0_SUB"}, //FIXME instancing
//{"uavcan.sub.bms.1.id", "UCAN1_BMS1_SUB"},
};
+16 -1
View File
@@ -61,13 +61,18 @@
#define CONFIG_CYPHAL_UORB_SENSOR_GPS_SUBSCRIBER 0
#endif
#ifndef CONFIG_CYPHAL_UORB_PCA_PWM_SUBSCRIBER
#define CONFIG_CYPHAL_UORB_PCA_PWM_SUBSCRIBER 0
#endif
/* Preprocessor calculation of Subscribers count */
#define UAVCAN_SUB_COUNT CONFIG_CYPHAL_ESC_SUBSCRIBER + \
CONFIG_CYPHAL_GNSS_SUBSCRIBER_0 + \
CONFIG_CYPHAL_GNSS_SUBSCRIBER_1 + \
CONFIG_CYPHAL_BMS_SUBSCRIBER + \
CONFIG_CYPHAL_UORB_SENSOR_GPS_SUBSCRIBER
CONFIG_CYPHAL_UORB_SENSOR_GPS_SUBSCRIBER + \
CONFIG_CYPHAL_UORB_PCA_PWM_SUBSCRIBER
#include <px4_platform_common/defines.h>
#include <drivers/drv_hrt.h>
@@ -179,6 +184,16 @@ private:
"uorb.sensor_gps",
0
},
#endif
#if CONFIG_CYPHAL_UORB_PCA_PWM_SUBSCRIBER
{
[](CanardHandle & handle, UavcanParamManager & pmgr) -> UavcanDynamicPortSubscriber *
{
return new uORB_over_UAVCAN_Subscriber<pca_pwm_s>(handle, pmgr, ORB_ID(pca_pwm));
},
"uorb.pca_pwm",
0
},
#endif
};
};
+9
View File
@@ -151,6 +151,15 @@ PARAM_DEFINE_INT32(UCAN1_UORB_GPS, -1);
*/
PARAM_DEFINE_INT32(UCAN1_UORB_GPS_P, -1);
/**
* pca_pwm uORB over Cyphal subscription port ID.
*
* @min -1
* @max 6143
* @group Cyphal
*/
PARAM_DEFINE_INT32(UCAN1_PCA_PWM_S, -1);
// Publication Port IDs
/**