Firmware
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MEASAirspeedSim Class Reference
Inheritance diagram for MEASAirspeedSim:
AirspeedSim cdev::CDev

Public Member Functions

 MEASAirspeedSim (int bus, int address=I2C_ADDRESS_MS4525DO, const char *path=PATH_MS4525)
 
- Public Member Functions inherited from AirspeedSim
 AirspeedSim (int bus, int address, unsigned conversion_interval, const char *path)
 
virtual int init ()
 
virtual ssize_t read (cdev::file_t *filp, char *buffer, size_t buflen)
 Perform a read from the device. More...
 
virtual int ioctl (cdev::file_t *filp, int cmd, unsigned long arg)
 Perform an ioctl operation on the device. More...
 
virtual void print_info ()
 Diagnostics - print some basic information about the driver.
 
- Public Member Functions inherited from cdev::CDev
 CDev (const char *devname)
 Constructor. More...
 
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 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 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...
 

Protected Member Functions

virtual void cycle ()
 Perform a poll cycle; collect from the previous measurement and start a new one.
 
virtual int measure ()
 
virtual int collect ()
 
void voltage_correction (float &diff_pres_pa, float &temperature)
 Correct for 5V rail voltage variations.
 
- Protected Member Functions inherited from AirspeedSim
virtual int probe ()
 
virtual int transfer (const uint8_t *send, unsigned send_len, uint8_t *recv, unsigned recv_len)
 
int probe_address (uint8_t address)
 Test whether the device supported by the driver is present at a specific address. More...
 
void start ()
 Initialise the automatic measurement state machine and start it. More...
 
void stop ()
 Stop the automatic measurement state machine.
 
void new_report (const differential_pressure_s &report)
 add a new report to the reports queue More...
 
- 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.
 

Protected Attributes

math::LowPassFilter2p _filter
 
int _t_system_power
 
struct system_power_s system_power
 
- Protected Attributes inherited from AirspeedSim
bool _sensor_ok
 
int _measure_ticks
 
bool _collect_phase
 
float _diff_pres_offset
 
orb_advert_t _airspeed_pub
 
int _class_instance
 
int _conversion_interval
 
perf_counter_t _sample_perf
 
perf_counter_t _comms_errors
 
- Protected Attributes inherited from cdev::CDev
px4_sem_t _lock
 lock to protect access to all class members (also for derived classes)
 

Additional Inherited Members

- Static Protected Member Functions inherited from AirspeedSim
static void cycle_trampoline (void *arg)
 Static trampoline from the workq context; because we don't have a generic workq wrapper yet. 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.
 

The documentation for this class was generated from the following file: