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

#include <shared_dma.h>

Collaboration diagram for ChibiOS::Shared_DMA:
[legend]

Classes

struct  dma_lock
 

Public Member Functions

 FUNCTOR_TYPEDEF (dma_allocate_fn_t, void, Shared_DMA *)
 
 FUNCTOR_TYPEDEF (dma_deallocate_fn_t, void, Shared_DMA *)
 
 Shared_DMA (uint8_t stream_id1, uint8_t stream_id2, dma_allocate_fn_t allocate, dma_allocate_fn_t deallocate)
 
void lock (void)
 
bool lock_nonblock (void)
 
void unlock (void)
 
void unlock_from_IRQ (void)
 
void unlock_from_lockzone (void)
 
void unregister (void)
 
bool has_contention (void) const
 

Static Public Member Functions

static void init (void)
 
static void lock_all (void)
 

Private Member Functions

void lock_core (void)
 

Private Attributes

dma_allocate_fn_t allocate
 
dma_allocate_fn_t deallocate
 
uint8_t stream_id1
 
uint8_t stream_id2
 
bool have_lock
 
bool contention
 

Static Private Attributes

static struct ChibiOS::Shared_DMA::dma_lock locks [SHARED_DMA_MAX_STREAM_ID]
 

Detailed Description

Definition at line 26 of file shared_dma.h.

Constructor & Destructor Documentation

◆ Shared_DMA()

Shared_DMA::Shared_DMA ( uint8_t  stream_id1,
uint8_t  stream_id2,
dma_allocate_fn_t  allocate,
dma_allocate_fn_t  deallocate 
)

Definition at line 35 of file shared_dma.cpp.

Member Function Documentation

◆ FUNCTOR_TYPEDEF() [1/2]

ChibiOS::Shared_DMA::FUNCTOR_TYPEDEF ( dma_allocate_fn_t  ,
void  ,
Shared_DMA  
)

◆ FUNCTOR_TYPEDEF() [2/2]

ChibiOS::Shared_DMA::FUNCTOR_TYPEDEF ( dma_deallocate_fn_t  ,
void  ,
Shared_DMA  
)

◆ has_contention()

bool ChibiOS::Shared_DMA::has_contention ( void  ) const
inline

Definition at line 63 of file shared_dma.h.

Referenced by ChibiOS::UARTDriver::write_pending_bytes_DMA().

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

◆ init()

void Shared_DMA::init ( void  )
static

Definition at line 27 of file shared_dma.cpp.

Referenced by THD_FUNCTION().

Here is the caller graph for this function:

◆ lock()

void Shared_DMA::lock ( void  )

Definition at line 92 of file shared_dma.cpp.

Referenced by ChibiOS::SPIDevice::acquire_bus(), ChibiOS::RCOutput::dshot_send(), ChibiOS::RCOutput::serial_write_bytes(), ChibiOS::RCOutput::setup_group_DMA(), and ChibiOS::I2CDevice::transfer().

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

◆ lock_all()

void Shared_DMA::lock_all ( void  )
static

Definition at line 182 of file shared_dma.cpp.

Referenced by has_contention(), and ChibiOS::Scheduler::reboot().

Here is the caller graph for this function:

◆ lock_core()

void Shared_DMA::lock_core ( void  )
private

Definition at line 61 of file shared_dma.cpp.

Referenced by lock(), and lock_nonblock().

Here is the caller graph for this function:

◆ lock_nonblock()

bool Shared_DMA::lock_nonblock ( void  )

Definition at line 104 of file shared_dma.cpp.

Referenced by ChibiOS::RCOutput::dshot_send(), and ChibiOS::UARTDriver::write_pending_bytes_DMA().

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

◆ unlock()

void Shared_DMA::unlock ( void  )

Definition at line 136 of file shared_dma.cpp.

Referenced by ChibiOS::SPIDevice::acquire_bus(), ChibiOS::RCOutput::serial_write_bytes(), ChibiOS::RCOutput::setup_group_DMA(), and ChibiOS::I2CDevice::transfer().

Here is the caller graph for this function:

◆ unlock_from_IRQ()

void Shared_DMA::unlock_from_IRQ ( void  )

Definition at line 164 of file shared_dma.cpp.

Referenced by ChibiOS::RCOutput::dma_irq_callback(), and ChibiOS::UARTDriver::tx_complete().

Here is the caller graph for this function:

◆ unlock_from_lockzone()

void Shared_DMA::unlock_from_lockzone ( void  )

Definition at line 149 of file shared_dma.cpp.

Referenced by ChibiOS::UARTDriver::check_dma_tx_completion().

Here is the caller graph for this function:

◆ unregister()

void Shared_DMA::unregister ( void  )

Definition at line 47 of file shared_dma.cpp.

Member Data Documentation

◆ allocate

dma_allocate_fn_t ChibiOS::Shared_DMA::allocate
private

Definition at line 69 of file shared_dma.h.

Referenced by lock_core(), and Shared_DMA().

◆ contention

bool ChibiOS::Shared_DMA::contention
private

Definition at line 77 of file shared_dma.h.

Referenced by has_contention(), and lock_nonblock().

◆ deallocate

dma_allocate_fn_t ChibiOS::Shared_DMA::deallocate
private

Definition at line 70 of file shared_dma.h.

Referenced by lock_core(), and Shared_DMA().

◆ have_lock

bool ChibiOS::Shared_DMA::have_lock
private

Definition at line 73 of file shared_dma.h.

Referenced by lock_core(), unlock(), unlock_from_IRQ(), and unlock_from_lockzone().

◆ locks

Shared_DMA::dma_lock Shared_DMA::locks
staticprivate

◆ stream_id1

uint8_t ChibiOS::Shared_DMA::stream_id1
private

◆ stream_id2

uint8_t ChibiOS::Shared_DMA::stream_id2
private

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