PX4 Firmware
PX4 Autopilot Software http://px4.io
LED Class Reference
Inheritance diagram for LED:
Collaboration diagram for LED:

Public Member Functions

 LED ()
 
 ~LED () override=default
 
int init () override
 
int ioctl (cdev::file_t *filp, int cmd, unsigned long arg) override
 Perform an ioctl operation on the device. More...
 
 LED ()
 
 ~LED () override=default
 
int init () override
 
int devIOCTL (unsigned long cmd, unsigned long arg) override
 

Protected Member Functions

void _measure () override
 

Additional Inherited Members

- Private Member Functions inherited from cdev::CDev
 CDev (const char *devname)
 Constructor. More...
 
 CDev (const CDev &)=delete
 
CDevoperator= (const CDev &)=delete
 
 CDev (CDev &&)=delete
 
CDevoperator= (CDev &&)=delete
 
virtual ~CDev ()
 
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 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...
 
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...
 
- Private Attributes inherited from cdev::CDev
px4_sem_t _lock
 lock to protect access to all class members (also for derived classes) More...
 
- Static Private 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...
 

Detailed Description

Definition at line 59 of file led.cpp.

Constructor & Destructor Documentation

◆ LED() [1/2]

LED::LED ( )

Definition at line 69 of file led.cpp.

References init().

Referenced by _measure(), and drv_led_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~LED() [1/2]

LED::~LED ( )
overridedefault

◆ LED() [2/2]

LED::LED ( )

◆ ~LED() [2/2]

LED::~LED ( )
overridedefault

Member Function Documentation

◆ _measure()

void LED::_measure ( void  )
inlineoverrideprotected

Definition at line 72 of file led.cpp.

References init(), ToneAlarmInterface::init(), LED(), LED_BASE_DEVICE_PATH, and led_init().

Here is the call graph for this function:

◆ devIOCTL()

int LED::devIOCTL ( unsigned long  cmd,
unsigned long  arg 
)
override

Definition at line 95 of file led.cpp.

References led_off(), LED_OFF, led_on(), LED_ON, led_toggle(), LED_TOGGLE, and OK.

Here is the call graph for this function:

◆ init() [1/2]

int LED::init ( )
overridevirtual

Reimplemented from cdev::CDev.

Definition at line 76 of file led.cpp.

References ToneAlarmInterface::init(), and led_init().

Referenced by _measure(), drv_led_start(), and LED().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init() [2/2]

int LED::init ( )
overridevirtual

Reimplemented from cdev::CDev.

◆ ioctl()

int LED::ioctl ( cdev::file_t filep,
int  cmd,
unsigned long  arg 
)
overridevirtual

Perform an ioctl operation on the device.

The default implementation handles DIOC_GETPRIV, and otherwise returns -ENOTTY. Subclasses should call the default implementation for any command they do not handle themselves.

Parameters
filepPointer to the NuttX file structure.
cmdThe ioctl command value.
argThe ioctl argument value.
Returns
OK on success, or -errno otherwise.

Reimplemented from cdev::CDev.

Definition at line 88 of file led.cpp.

References led_off(), LED_OFF, led_on(), LED_ON, led_toggle(), LED_TOGGLE, and OK.

Here is the call graph for this function:

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