Firmware
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
LidarLitePWM Class Reference
Inheritance diagram for LidarLitePWM:
LidarLite cdev::CDev

Public Member Functions

 LidarLitePWM (const char *path, uint8_t rotation=distance_sensor_s::ROTATION_DOWNWARD_FACING)
 
int init () override
 
ssize_t read (device::file_t *filp, char *buffer, size_t buflen) override
 Perform a read from the device. More...
 
int ioctl (device::file_t *filp, int cmd, unsigned long arg) override
 
void start () override
 
void stop () override
 
void cycle ()
 
void print_info () override
 Diagnostics - print some basic information about the driver.
 
void print_registers () override
 print registers to console
 
const char * get_dev_name () override
 
- 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...
 

Static Public Member Functions

static void cycle_trampoline (void *arg)
 Static trampoline from the workq context; because we don't have a generic workq wrapper yet. More...
 

Protected Member Functions

int measure () override
 
int collect () override
 
int reset_sensor () override
 
void task_main_trampoline (int argc, char *argv[])
 
- Protected Member Functions inherited from LidarLite
void set_minimum_distance (const float min)
 Set the min and max distance thresholds if you want the end points of the sensors range to be brought in at all, otherwise it will use the defaults LL40LS_MIN_DISTANCE and LL40LS_MAX_DISTANCE_V3.
 
void set_maximum_distance (const float max)
 
float get_minimum_distance () const
 
float get_maximum_distance () const
 
uint32_t getMeasureTicks () const
 
- 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.
 

Additional Inherited Members

- Protected Attributes inherited from cdev::CDev
px4_sem_t _lock
 lock to protect access to all class members (also for derived classes)
 
- 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.
 

Member Function Documentation

§ cycle_trampoline()

void LidarLitePWM::cycle_trampoline ( void *  arg)
static

Static trampoline from the workq context; because we don't have a generic workq wrapper yet.

Parameters
argInstance pointer for the driver that is polling.

§ read()

ssize_t LidarLitePWM::read ( device::file_t filep,
char *  buffer,
size_t  buflen 
)
overridevirtual

Perform a read from the device.

The default implementation returns -ENOSYS.

Parameters
filepPointer to the NuttX file structure.
bufferPointer to the buffer into which data should be placed.
buflenThe number of bytes to be read.
Returns
The number of bytes read or -errno otherwise.

Reimplemented from cdev::CDev.


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