69 PX4_ERR(
"failed to start uavcan sub: %d", res);
76 PX4_ERR(
"failed to start uavcan sub2: %d", res);
89 std::memcpy(&
_scale, reinterpret_cast<const void *>(arg),
sizeof(
_scale));
94 std::memcpy(reinterpret_cast<void *>(arg), &
_scale,
sizeof(
_scale));
109 return CDev::ioctl(filp, cmd, arg);
140 uavcan::ReceivedDataStructure<uavcan::equipment::ahrs::MagneticFieldStrength2> &
msg)
#define MAGIOCGSCALE
copy the mag scaling constants to the structure pointed to by (arg)
#define MAGIOCGEXTERNAL
determine if mag is external or onboard
void mag2_sub_cb(const uavcan::ReceivedDataStructure< uavcan::equipment::ahrs::MagneticFieldStrength2 > &msg)
#define MAGIOCEXSTRAP
excite strap
void lock()
Take the driver lock.
uavcan::Subscriber< uavcan::equipment::ahrs::MagneticFieldStrength, MagCbBinder > _sub_mag
#define DRV_MAG_DEVTYPE_HMC5883
Sensor type definitions.
UavcanMagnetometerBridge(uavcan::INode &node)
High-resolution timer with callouts and timekeeping.
#define MAGIOCSRANGE
set the measurement range to handle (at least) arg Gauss
void mag_sub_cb(const uavcan::ReceivedDataStructure< uavcan::equipment::ahrs::MagneticFieldStrength > &msg)
static char msg[NUM_MSG][CONFIG_USART1_TXBUFSIZE]
#define ORB_ID(_name)
Generates a pointer to the uORB metadata structure for a given topic.
This is the base class for redundant sensors with an independent ORB topic per each redundancy channe...
device identifier information
#define MAGIOCSSCALE
set the mag scaling constants to the structure pointed to by (arg)
#define MAG_BASE_DEVICE_PATH
#define MAGIOCCALIBRATE
perform self-calibration, update scale factors to canonical units
Simple error/warning functions, heavily inspired by the BSD functions of the same names...
uavcan::MethodBinder< UavcanMagnetometerBridge *, void(UavcanMagnetometerBridge::*)(const uavcan::ReceivedDataStructure< uavcan::equipment::ahrs::MagneticFieldStrength2 > &) > Mag2CbBinder
static const char *const NAME
int ioctl(struct file *filp, int cmd, unsigned long arg) override
struct @83::@85::@87 file
uavcan::Subscriber< uavcan::equipment::ahrs::MagneticFieldStrength2, Mag2CbBinder > _sub_mag2
uavcan::MethodBinder< UavcanMagnetometerBridge *, void(UavcanMagnetometerBridge::*)(const uavcan::ReceivedDataStructure< uavcan::equipment::ahrs::MagneticFieldStrength > &) > MagCbBinder
int init() override
Starts the bridge.
void unlock()
Release the driver lock.
void publish(const int node_id, const void *report)
Sends one measurement into appropriate ORB topic.
__EXPORT hrt_abstime hrt_absolute_time(void)
Get absolute time in [us] (does not wrap).