PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <PX4Barometer.hpp>
Public Member Functions | |
PX4Barometer (uint32_t device_id, uint8_t priority=ORB_PRIO_DEFAULT) | |
~PX4Barometer () override | |
void | set_device_type (uint8_t devtype) |
void | set_error_count (uint64_t error_count) |
void | set_temperature (float temperature) |
void | update (hrt_abstime timestamp, float pressure) |
void | print_status () |
Public Member Functions inherited from cdev::CDev | |
CDev (const char *devname) | |
Constructor. More... | |
CDev (const CDev &)=delete | |
CDev & | operator= (const CDev &)=delete |
CDev (CDev &&)=delete | |
CDev & | operator= (CDev &&)=delete |
virtual | ~CDev () |
virtual int | init () |
virtual int | open (file_t *filep) |
Handle an open of the device. More... | |
virtual int | close (file_t *filep) |
Handle a close of the device. More... | |
virtual ssize_t | read (file_t *filep, char *buffer, size_t buflen) |
Perform a read from the device. More... | |
virtual ssize_t | write (file_t *filep, const char *buffer, size_t buflen) |
Perform a write to the device. More... | |
virtual off_t | seek (file_t *filep, off_t offset, int whence) |
Perform a logical seek operation on the device. More... | |
virtual int | ioctl (file_t *filep, int cmd, unsigned long arg) |
Perform an ioctl operation on the device. More... | |
virtual int | poll (file_t *filep, px4_pollfd_struct_t *fds, bool setup) |
Perform a poll setup/teardown operation. More... | |
const char * | get_devname () const |
Get the device name. More... | |
Private Attributes | |
uORB::PublicationMultiData< sensor_baro_s > | _sensor_baro_pub |
int | _class_device_instance {-1} |
Additional Inherited Members | |
Protected Member Functions inherited from cdev::CDev | |
virtual pollevent_t | poll_state (file_t *filep) |
Check the current state of the device for poll events from the perspective of the file. More... | |
virtual void | poll_notify (pollevent_t events) |
Report new poll events. More... | |
virtual void | poll_notify_one (px4_pollfd_struct_t *fds, pollevent_t events) |
Internal implementation of poll_notify. More... | |
virtual int | open_first (file_t *filep) |
Notification of the first open. More... | |
virtual int | close_last (file_t *filep) |
Notification of the last close. More... | |
virtual int | register_class_devname (const char *class_devname) |
Register a class device name, automatically adding device class instance suffix if need be. More... | |
virtual int | unregister_class_devname (const char *class_devname, unsigned class_instance) |
Register a class device name, automatically adding device class instance suffix if need be. More... | |
void | lock () |
Take the driver lock. More... | |
void | unlock () |
Release the driver lock. More... | |
int | unregister_driver_and_memory () |
First, unregisters the driver. More... | |
Protected Attributes inherited from cdev::CDev | |
px4_sem_t | _lock |
lock to protect access to all class members (also for derived classes) More... | |
Static Protected Attributes inherited from cdev::CDev | |
static const px4_file_operations_t | fops = {} |
Pointer to the default cdev file operations table; useful for registering clone devices etc. More... | |
Definition at line 44 of file PX4Barometer.hpp.
PX4Barometer::PX4Barometer | ( | uint32_t | device_id, |
uint8_t | priority = ORB_PRIO_DEFAULT |
||
) |
Definition at line 39 of file PX4Barometer.cpp.
References _class_device_instance, _sensor_baro_pub, BARO_BASE_DEVICE_PATH, sensor_baro_s::device_id, device_id, uORB::PublicationMultiData< T >::get(), ORB_ID, and cdev::CDev::register_class_devname().
|
override |
Definition at line 48 of file PX4Barometer.cpp.
References _class_device_instance, BARO_BASE_DEVICE_PATH, and cdev::CDev::unregister_class_devname().
void PX4Barometer::print_status | ( | ) |
Definition at line 83 of file PX4Barometer.cpp.
References _class_device_instance, _sensor_baro_pub, BARO_BASE_DEVICE_PATH, and uORB::PublicationMultiData< T >::get().
Referenced by BMP280::print_info(), ADIS16448::print_info(), BMP388::print_info(), and set_temperature().
void PX4Barometer::set_device_type | ( | uint8_t | devtype | ) |
Definition at line 56 of file PX4Barometer.cpp.
References _sensor_baro_pub, sensor_baro_s::device_id, device::Device::DeviceId::devid, device::Device::DeviceId::devid_s, device::Device::DeviceStructure::devtype, and uORB::PublicationMultiData< T >::get().
Referenced by ADIS16448::ADIS16448(), and BMP388::BMP388().
|
inline |
Definition at line 52 of file PX4Barometer.hpp.
References _sensor_baro_pub, sensor_baro_s::error_count, and uORB::PublicationMultiData< T >::get().
Referenced by BMP280::collect(), BMP388::collect(), and ADIS16448::measure().
|
inline |
Definition at line 54 of file PX4Barometer.hpp.
References _sensor_baro_pub, uORB::PublicationMultiData< T >::get(), hrt_abstime, print_status(), sensor_baro_s::temperature, and update().
Referenced by BMP280::collect(), BMP388::collect(), ADIS16448::measure(), and Sih::send_IMU().
void PX4Barometer::update | ( | hrt_abstime | timestamp, |
float | pressure | ||
) |
Definition at line 70 of file PX4Barometer.cpp.
References _sensor_baro_pub, uORB::PublicationMultiData< T >::get(), cdev::CDev::poll_notify(), sensor_baro_s::pressure, sensor_baro_s::timestamp, and uORB::PublicationMultiData< T >::update().
Referenced by BMP280::collect(), BMP388::collect(), ADIS16448::measure(), Sih::send_IMU(), and set_temperature().
|
private |
Definition at line 64 of file PX4Barometer.hpp.
Referenced by print_status(), PX4Barometer(), and ~PX4Barometer().
|
private |
Definition at line 62 of file PX4Barometer.hpp.
Referenced by print_status(), PX4Barometer(), set_device_type(), set_error_count(), set_temperature(), and update().