Firmware
Public Types | Public Member Functions | Static Public Member Functions | List of all members
PX4FMU Class Reference
Inheritance diagram for PX4FMU:
cdev::CDev

Public Types

enum  Mode {
  MODE_NONE, MODE_1PWM, MODE_2PWM, MODE_2PWM2CAP,
  MODE_3PWM, MODE_3PWM1CAP, MODE_4PWM, MODE_4PWM1CAP,
  MODE_4PWM2CAP, MODE_5PWM, MODE_5PWM1CAP, MODE_6PWM,
  MODE_8PWM, MODE_14PWM, MODE_4CAP, MODE_5CAP,
  MODE_6CAP
}
 

Public Member Functions

 PX4FMU (bool run_as_task)
 
void run () override
 
void cycle ()
 run the main loop: if running as task, continuously iterate, otherwise execute only one single cycle
 
int print_status () override
 
virtual int ioctl (file *filp, int cmd, unsigned long arg)
 
virtual ssize_t write (file *filp, const char *buffer, size_t len)
 
virtual int init ()
 
int set_mode (Mode mode)
 
Mode get_mode ()
 
int set_pwm_alt_rate (unsigned rate)
 
int set_pwm_alt_channels (uint32_t channels)
 
void update_pwm_trims ()
 
- 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 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...
 

Static Public Member Functions

static int task_spawn (int argc, char *argv[])
 
static PX4FMUinstantiate (int argc, char *argv[])
 
static int custom_command (int argc, char *argv[])
 
static int print_usage (const char *reason=nullptr)
 
static int fmu_new_mode (PortMode new_mode)
 change the FMU mode of the running module
 
static int test ()
 
static int fake (int argc, char *argv[])
 
static int set_i2c_bus_clock (unsigned bus, unsigned clock_hz)
 
static void capture_trampoline (void *context, uint32_t chan_index, hrt_abstime edge_time, uint32_t edge_state, uint32_t overflow)
 

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.
 
- 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

§ custom_command()

int PX4FMU::custom_command ( int  argc,
char *  argv[] 
)
static
See also
ModuleBase

§ instantiate()

PX4FMU * PX4FMU::instantiate ( int  argc,
char *  argv[] 
)
static
See also
ModuleBase

§ print_status()

int PX4FMU::print_status ( )
override
See also
ModuleBase::print_status()

§ print_usage()

int PX4FMU::print_usage ( const char *  reason = nullptr)
static
See also
ModuleBase

§ run()

void PX4FMU::run ( )
override
See also
ModuleBase::run()

§ task_spawn()

int PX4FMU::task_spawn ( int  argc,
char *  argv[] 
)
static
See also
ModuleBase

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