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

#include <Device.h>

Inheritance diagram for ChibiOS::DeviceBus:
[legend]
Collaboration diagram for ChibiOS::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)
 
void bouncebuffer_setup (const uint8_t *&buf_tx, uint16_t tx_len, uint8_t *&buf_rx, uint16_t rx_len)
 
void bouncebuffer_setup_tx (const uint8_t *&buf_tx, uint16_t tx_len)
 
void bouncebuffer_setup_rx (uint8_t *&buf_rx, uint16_t rx_len)
 
void bouncebuffer_rx_copy (uint8_t *buf_rx, uint16_t rx_len)
 

Static Public Member Functions

static void bus_thread (void *arg)
 

Public Attributes

struct DeviceBusnext
 
Semaphore semaphore
 
Shared_DMAdma_handle
 

Private Attributes

struct ChibiOS::DeviceBus::callback_infocallbacks
 
uint8_t thread_priority
 
thread_t * thread_ctx
 
bool thread_started
 
AP_HAL::Devicehal_device
 
uint8_t * bounce_buffer_tx
 
uint8_t * bounce_buffer_rx
 
uint16_t bounce_buffer_tx_size
 
uint16_t bounce_buffer_rx_size
 

Detailed Description

Definition at line 25 of file Device.h.

Constructor & Destructor Documentation

◆ DeviceBus()

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

Definition at line 27 of file Device.h.

Member Function Documentation

◆ adjust_timer()

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

Definition at line 133 of file Device.cpp.

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

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

◆ bouncebuffer_rx_copy()

void DeviceBus::bouncebuffer_rx_copy ( uint8_t *  buf_rx,
uint16_t  rx_len 
)

Definition at line 197 of file Device.cpp.

◆ bouncebuffer_setup()

void DeviceBus::bouncebuffer_setup ( const uint8_t *&  buf_tx,
uint16_t  tx_len,
uint8_t *&  buf_rx,
uint16_t  rx_len 
)

Definition at line 150 of file Device.cpp.

Referenced by ChibiOS::I2CDevice::_transfer(), and ChibiOS::SPIDevice::do_transfer().

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

◆ bouncebuffer_setup_rx()

void DeviceBus::bouncebuffer_setup_rx ( uint8_t *&  buf_rx,
uint16_t  rx_len 
)

Definition at line 176 of file Device.cpp.

Referenced by bouncebuffer_setup().

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

◆ bouncebuffer_setup_tx()

void DeviceBus::bouncebuffer_setup_tx ( const uint8_t *&  buf_tx,
uint16_t  tx_len 
)

Definition at line 157 of file Device.cpp.

Referenced by bouncebuffer_setup().

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

◆ bus_thread()

void DeviceBus::bus_thread ( void *  arg)
static

Definition at line 33 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 DeviceBus::register_periodic_callback ( uint32_t  period_usec,
AP_HAL::Device::PeriodicCb  cb,
AP_HAL::Device hal_device 
)

Definition at line 84 of file Device.cpp.

Referenced by ChibiOS::I2CDevice::register_periodic_callback(), ChibiOS::SPIDevice::register_periodic_callback(), and ChibiOS::I2CDevice::set_speed().

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

Member Data Documentation

◆ bounce_buffer_rx

uint8_t* ChibiOS::DeviceBus::bounce_buffer_rx
private

Definition at line 61 of file Device.h.

Referenced by bouncebuffer_rx_copy(), and bouncebuffer_setup_rx().

◆ bounce_buffer_rx_size

uint16_t ChibiOS::DeviceBus::bounce_buffer_rx_size
private

Definition at line 63 of file Device.h.

Referenced by bouncebuffer_setup_rx().

◆ bounce_buffer_tx

uint8_t* ChibiOS::DeviceBus::bounce_buffer_tx
private

Definition at line 60 of file Device.h.

Referenced by bouncebuffer_setup_tx().

◆ bounce_buffer_tx_size

uint16_t ChibiOS::DeviceBus::bounce_buffer_tx_size
private

Definition at line 62 of file Device.h.

Referenced by bouncebuffer_setup_tx().

◆ callbacks

struct ChibiOS::DeviceBus::callback_info * ChibiOS::DeviceBus::callbacks
private

◆ dma_handle

Shared_DMA* ChibiOS::DeviceBus::dma_handle

◆ hal_device

AP_HAL::Device* ChibiOS::DeviceBus::hal_device
private

Definition at line 57 of file Device.h.

Referenced by register_periodic_callback().

◆ next

struct DeviceBus* ChibiOS::DeviceBus::next

Definition at line 30 of file Device.h.

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

◆ semaphore

Semaphore ChibiOS::DeviceBus::semaphore

◆ thread_ctx

thread_t* ChibiOS::DeviceBus::thread_ctx
private

Definition at line 55 of file Device.h.

Referenced by adjust_timer(), and register_periodic_callback().

◆ thread_priority

uint8_t ChibiOS::DeviceBus::thread_priority
private

Definition at line 54 of file Device.h.

Referenced by register_periodic_callback().

◆ thread_started

bool ChibiOS::DeviceBus::thread_started
private

Definition at line 56 of file Device.h.

Referenced by register_periodic_callback().


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