APM:Libraries
|
#include <I2CDevice.h>
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 Semaphore * | get_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) |
![]() | |
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 | |
![]() | |
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 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) |
![]() | |
void | set_device_address (uint8_t address) |
void | set_device_bus (uint8_t bus) |
![]() | |
uint8_t | _read_flag = 0 |
union DeviceId | _bus_id |
Definition at line 28 of file I2CDevice.h.
|
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().
|
inlinevirtual |
Reimplemented in F4Light::I2CDevice, ChibiOS::I2CDevice, Linux::I2CDevice, PX4::I2CDevice, VRBRAIN::I2CDevice, and Empty::I2CDevice.
Definition at line 32 of file I2CDevice.h.
|
overridepure virtual |
Implements AP_HAL::Device.
Implemented in F4Light::I2CDevice, ChibiOS::I2CDevice, Empty::I2CDevice, Linux::I2CDevice, PX4::I2CDevice, and VRBRAIN::I2CDevice.
Referenced by ~I2CDevice().
|
overridepure virtual |
Implements AP_HAL::Device.
Implemented in F4Light::I2CDevice, ChibiOS::I2CDevice, Empty::I2CDevice, Linux::I2CDevice, PX4::I2CDevice, and VRBRAIN::I2CDevice.
Referenced by Linux::RCOutput_Bebop::_clear_error(), Linux::RCOutput_Bebop::_get_info(), AP_RangeFinder_MaxsonarI2CXL::_init(), AP_InertialSensor_L3G4200D::_init_sensor(), Linux::RCOutput_Bebop::_play_sound(), Linux::RCOutput_Bebop::_set_ref_speed(), Linux::RCOutput_Bebop::_start_prop(), Linux::RCOutput_Bebop::_stop_prop(), Linux::RCOutput_Bebop::_toggle_gpio(), AP_RangeFinder_LightWareI2C::detect(), AP_RangeFinder_VL53L0X::detect(), AP_AK8963_BusDriver_HALDevice::get_semaphore(), ToshibaLED_I2C::hw_init(), AP_Baro_ICM20789::init(), AP_RangeFinder_TeraRangerI2C::init(), AP_Airspeed_MS4525::init(), AP_Airspeed_SDP3X::init(), AP_RangeFinder_PulsedLightLRF::init(), AP_Airspeed_MS5525::init(), Linux::RCOutput_Bebop::play_note(), Linux::RCOutput_PCA9685::push(), Linux::RCOutput_Bebop::read_obs_data(), Linux::RCOutput_PCA9685::reset_all_channels(), Linux::RCOutput_PCA9685::set_freq(), and ~I2CDevice().
|
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().
|
overridepure virtual |
Implemented in F4Light::I2CDevice.
Referenced by AP_RangeFinder_MaxsonarI2CXL::_init(), NavioLED_I2C::hw_init(), ToshibaLED_I2C::hw_init(), AP_ADC_ADS1115::init(), AP_Baro_ICM20789::init(), AP_RangeFinder_VL53L0X::init(), AP_RangeFinder_LightWareI2C::init(), AP_RangeFinder_TeraRangerI2C::init(), AP_Airspeed_MS4525::init(), AP_Airspeed_SDP3X::init(), AP_RangeFinder_PulsedLightLRF::init(), AP_Airspeed_MS5525::init(), AP_BattMonitor_SMBus::init(), AP_AK8963_BusDriver_HALDevice::register_periodic_callback(), AP_InertialSensor_L3G4200D::start(), and ~I2CDevice().
|
overridepure virtual |
Implements AP_HAL::Device.
Implemented in F4Light::I2CDevice, and Empty::I2CDevice.
Referenced by ~I2CDevice().
|
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().
|
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().