APM:Libraries
Public Member Functions | List of all members
AP_HAL::I2CDevice Class Referenceabstract

#include <I2CDevice.h>

Inheritance diagram for AP_HAL::I2CDevice:
[legend]
Collaboration diagram for AP_HAL::I2CDevice:
[legend]

Public Member Functions

 I2CDevice ()
 
virtual ~I2CDevice ()
 
virtual bool set_speed (Device::Speed speed) override=0
 
virtual bool transfer (const uint8_t *send, uint32_t send_len, uint8_t *recv, uint32_t recv_len) override=0
 
virtual bool read_registers_multiple (uint8_t first_reg, uint8_t *recv, uint32_t recv_len, uint8_t times)=0
 
virtual Semaphoreget_semaphore () override=0
 
virtual Device::PeriodicHandle register_periodic_callback (uint32_t period_usec, Device::PeriodicCb) override=0
 
virtual bool adjust_periodic_callback (Device::PeriodicHandle h, uint32_t period_usec) override=0
 
virtual void set_split_transfers (bool set)
 
- Public Member Functions inherited from AP_HAL::Device
 FUNCTOR_TYPEDEF (PeriodicCb, void)
 
 Device (enum BusType type)
 
enum BusType bus_type (void) const
 
uint8_t bus_num (void) const
 
uint32_t get_bus_id (void) const
 
uint8_t get_bus_address (void) const
 
void set_device_type (uint8_t devtype)
 
virtual ~Device ()
 
virtual void set_address (uint8_t address)
 
bool read_registers (uint8_t first_reg, uint8_t *recv, uint32_t recv_len)
 
bool write_register (uint8_t reg, uint8_t val, bool checked=false)
 
void set_checked_register (uint8_t reg, uint8_t val)
 
bool setup_checked_registers (uint8_t num_regs, uint8_t frequency=10)
 
bool check_next_register (void)
 
bool read (uint8_t *recv, uint32_t recv_len)
 
virtual PeriodicHandle register_periodic_callback (uint32_t period_usec, PeriodicCb)=0
 
virtual bool unregister_callback (PeriodicHandle h)
 
virtual void register_completion_callback (AP_HAL::MemberProc proc)
 
virtual void register_completion_callback (AP_HAL::Proc proc)
 
virtual bool set_chip_select (bool set)
 
void set_read_flag (uint8_t flag)
 
uint32_t get_bus_id_devtype (uint8_t devtype)
 
virtual void set_retries (uint8_t retries)
 

Additional Inherited Members

- Public Types inherited from AP_HAL::Device
enum  BusType { BUS_TYPE_UNKNOWN = 0, BUS_TYPE_I2C = 1, BUS_TYPE_SPI = 2, BUS_TYPE_UAVCAN = 3 }
 
enum  Speed { SPEED_HIGH, SPEED_LOW }
 
typedef void * PeriodicHandle
 
- Static Public Member Functions inherited from AP_HAL::Device
static uint32_t make_bus_id (enum BusType bus_type, uint8_t bus, uint8_t address, uint8_t devtype)
 
static uint32_t change_bus_id (uint32_t old_id, uint8_t devtype)
 
- Protected Member Functions inherited from AP_HAL::Device
void set_device_address (uint8_t address)
 
void set_device_bus (uint8_t bus)
 
- Protected Attributes inherited from AP_HAL::Device
uint8_t _read_flag = 0
 
union DeviceId _bus_id
 

Detailed Description

Definition at line 28 of file I2CDevice.h.

Constructor & Destructor Documentation

◆ I2CDevice()

AP_HAL::I2CDevice::I2CDevice ( )
inline

Definition at line 30 of file I2CDevice.h.

Referenced by Linux::I2CDeviceManager::_create_device(), VRBRAIN::I2CDevice::from(), PX4::I2CDevice::from(), Linux::I2CDevice::from(), VRBRAIN::I2CDeviceManager::get_device(), PX4::I2CDeviceManager::get_device(), ChibiOS::I2CDeviceManager::get_device(), and F4Light::I2CDeviceManager::get_device().

Here is the caller graph for this function:

◆ ~I2CDevice()

virtual AP_HAL::I2CDevice::~I2CDevice ( )
inlinevirtual

Reimplemented in F4Light::I2CDevice, ChibiOS::I2CDevice, Linux::I2CDevice, PX4::I2CDevice, VRBRAIN::I2CDevice, and Empty::I2CDevice.

Definition at line 32 of file I2CDevice.h.

Here is the call graph for this function:

Member Function Documentation

◆ adjust_periodic_callback()

virtual bool AP_HAL::I2CDevice::adjust_periodic_callback ( Device::PeriodicHandle  h,
uint32_t  period_usec 
)
overridepure virtual

Implements AP_HAL::Device.

Implemented in F4Light::I2CDevice, ChibiOS::I2CDevice, Empty::I2CDevice, Linux::I2CDevice, PX4::I2CDevice, and VRBRAIN::I2CDevice.

Referenced by ~I2CDevice().

Here is the caller graph for this function:

◆ get_semaphore()

virtual Semaphore* AP_HAL::I2CDevice::get_semaphore ( )
overridepure virtual

◆ read_registers_multiple()

virtual bool AP_HAL::I2CDevice::read_registers_multiple ( uint8_t  first_reg,
uint8_t *  recv,
uint32_t  recv_len,
uint8_t  times 
)
pure virtual

Implemented in F4Light::I2CDevice, ChibiOS::I2CDevice, Linux::I2CDevice, Empty::I2CDevice, PX4::I2CDevice, and VRBRAIN::I2CDevice.

Referenced by AP_InertialSensor_L3G4200D::_accumulate(), and ~I2CDevice().

Here is the caller graph for this function:

◆ register_periodic_callback()

virtual Device::PeriodicHandle AP_HAL::I2CDevice::register_periodic_callback ( uint32_t  period_usec,
Device::PeriodicCb   
)
overridepure virtual

◆ set_speed()

virtual bool AP_HAL::I2CDevice::set_speed ( Device::Speed  speed)
overridepure virtual

Implements AP_HAL::Device.

Implemented in F4Light::I2CDevice, and Empty::I2CDevice.

Referenced by ~I2CDevice().

Here is the caller graph for this function:

◆ set_split_transfers()

virtual void AP_HAL::I2CDevice::set_split_transfers ( bool  set)
inlinevirtual

Reimplemented in ChibiOS::I2CDevice, Linux::I2CDevice, PX4::I2CDevice, and VRBRAIN::I2CDevice.

Definition at line 69 of file I2CDevice.h.

Referenced by AP_RangeFinder_PulsedLightLRF::init().

Here is the caller graph for this function:

◆ transfer()

virtual bool AP_HAL::I2CDevice::transfer ( const uint8_t *  send,
uint32_t  send_len,
uint8_t *  recv,
uint32_t  recv_len 
)
overridepure virtual

Implements AP_HAL::Device.

Implemented in F4Light::I2CDevice, ChibiOS::I2CDevice, Linux::I2CDevice, PX4::I2CDevice, VRBRAIN::I2CDevice, and Empty::I2CDevice.

Referenced by Linux::CameraSensor_Mt9v117::_apply_patch(), Linux::RCOutput_Bebop::_clear_error(), AP_Airspeed_MS4525::_collect(), AP_Airspeed_MS4525::_measure(), Linux::CameraSensor_Mt9v117::_read_reg16(), Linux::CameraSensor_Mt9v117::_read_reg8(), AP_Airspeed_SDP3X::_send_command(), Linux::RCOutput_Bebop::_set_ref_speed(), AP_ADC_ADS1115::_start_conversion(), Linux::RCOutput_Bebop::_start_prop(), Linux::RCOutput_Bebop::_stop_prop(), NavioLED_I2C::_timer(), ToshibaLED_I2C::_timer(), AP_Airspeed_SDP3X::_timer(), Linux::CameraSensor_Mt9v117::_write_reg16(), Linux::CameraSensor_Mt9v117::_write_reg32(), Linux::CameraSensor_Mt9v117::_write_reg8(), AP_RangeFinder_TeraRangerI2C::collect(), AP_RangeFinder_MaxsonarI2CXL::get_reading(), ToshibaLED_I2C::hw_init(), AP_RangeFinder_VL53L0X::init(), AP_Airspeed_SDP3X::init(), AP_Airspeed_MS5525::init(), AP_RangeFinder_TeraRangerI2C::measure(), Linux::RCOutput_Bebop::play_note(), Linux::RCOutput_PCA9685::push(), AP_Baro_ICM20789::read_calibration_data(), AP_Airspeed_MS5525::read_prom(), AP_RangeFinder_VL53L0X::read_register16(), Linux::RCOutput_PCA9685::reset_all_channels(), AP_Baro_ICM20789::send_cmd16(), AP_RangeFinder_MaxsonarI2CXL::start_reading(), AP_Baro_ICM20789::timer(), AP_Airspeed_MS5525::timer(), AP_RangeFinder_VL53L0X::write_register16(), and ~I2CDevice().

Here is the caller graph for this function:

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