APM:Libraries
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Private Attributes | List of all members
PX4::DeviceBus Class Reference

#include <Device.h>

Inheritance diagram for PX4::DeviceBus:
[legend]
Collaboration diagram for PX4::DeviceBus:
[legend]

Classes

struct  callback_info
 

Public Member Functions

 DeviceBus (uint8_t _thread_priority=APM_I2C_PRIORITY)
 
AP_HAL::Device::PeriodicHandle register_periodic_callback (uint32_t period_usec, AP_HAL::Device::PeriodicCb, AP_HAL::Device *hal_device)
 
bool adjust_timer (AP_HAL::Device::PeriodicHandle h, uint32_t period_usec)
 

Static Public Member Functions

static void * bus_thread (void *arg)
 

Public Attributes

struct DeviceBusnext
 
Semaphore semaphore
 

Private Attributes

struct PX4::DeviceBus::callback_infocallbacks
 
uint8_t thread_priority
 
pthread_t thread_ctx
 
bool thread_started
 
AP_HAL::Devicehal_device
 

Detailed Description

Definition at line 24 of file Device.h.

Constructor & Destructor Documentation

◆ DeviceBus()

PX4::DeviceBus::DeviceBus ( uint8_t  _thread_priority = APM_I2C_PRIORITY)
inline

Definition at line 26 of file Device.h.

Member Function Documentation

◆ adjust_timer()

bool PX4::DeviceBus::adjust_timer ( AP_HAL::Device::PeriodicHandle  h,
uint32_t  period_usec 
)

Definition at line 140 of file Device.cpp.

Referenced by PX4::I2CDevice::adjust_periodic_callback(), and PX4::SPIDevice::adjust_periodic_callback().

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

◆ bus_thread()

void * PX4::DeviceBus::bus_thread ( void *  arg)
static

Definition at line 34 of file Device.cpp.

Referenced by register_periodic_callback().

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

◆ register_periodic_callback()

AP_HAL::Device::PeriodicHandle PX4::DeviceBus::register_periodic_callback ( uint32_t  period_usec,
AP_HAL::Device::PeriodicCb  cb,
AP_HAL::Device hal_device 
)

Definition at line 102 of file Device.cpp.

Referenced by PX4::I2CDevice::register_periodic_callback(), and PX4::SPIDevice::register_periodic_callback().

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

Member Data Documentation

◆ callbacks

struct PX4::DeviceBus::callback_info * PX4::DeviceBus::callbacks
private

◆ hal_device

AP_HAL::Device* PX4::DeviceBus::hal_device
private

Definition at line 46 of file Device.h.

Referenced by bus_thread(), and register_periodic_callback().

◆ next

struct DeviceBus* PX4::DeviceBus::next

Definition at line 29 of file Device.h.

Referenced by PX4::SPIDeviceManager::get_device().

◆ semaphore

Semaphore PX4::DeviceBus::semaphore

◆ thread_ctx

pthread_t PX4::DeviceBus::thread_ctx
private

Definition at line 44 of file Device.h.

Referenced by adjust_timer(), and register_periodic_callback().

◆ thread_priority

uint8_t PX4::DeviceBus::thread_priority
private

Definition at line 43 of file Device.h.

Referenced by register_periodic_callback().

◆ thread_started

bool PX4::DeviceBus::thread_started
private

Definition at line 45 of file Device.h.

Referenced by register_periodic_callback().


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