PX4 Firmware
PX4 Autopilot Software http://px4.io
px4muorb_KraitRpcWrapper.cpp File Reference
#include <time.h>
#include <unistd.h>
#include <fcntl.h>
#include "px4muorb_KraitRpcWrapper.hpp"
#include <rpcmem.h>
#include <px4muorb.h>
#include <px4_platform_common/log.h>
#include <px4_platform_common/shmem.h>
#include <drivers/drv_hrt.h>
#include <string.h>
Include dependency graph for px4muorb_KraitRpcWrapper.cpp:

Go to the source code of this file.

Macros

#define MUORB_KRAIT_FASTRPC_MEM_FLAGS   0
 
#define MUORB_KRAIT_FASTRPC_HEAP_ID   22
 
#define DSP_TIMER_FILE   "/sys/kernel/boot_adsp/qdsp_qtimer"
 

Functions

int calc_timer_diff_to_dsp_us (int32_t *time_diff_us)
 Helper function to get timer difference between time on DSP and appsproc side. More...
 

Variables

static char * _TopicNameBuffer = 0
 
static const int32_t _MAX_TOPIC_NAME_BUFFER = 256
 
static uint8_t * _DataBuffer = 0
 
static const uint32_t _MAX_DATA_BUFFER_SIZE = 2048
 
static bool _Initialized = false
 
static const uint32_t _MAX_TOPIC_DATA_BUFFER_SIZE = 1024
 
static const uint32_t _MAX_TOPICS = 64
 
static const uint32_t _MAX_BULK_TRANSFER_BUFFER_SIZE
 
static uint8_t * _BulkTransferBuffer = 0
 
unsigned char * adsp_changed_index = 0
 

Macro Definition Documentation

◆ DSP_TIMER_FILE

#define DSP_TIMER_FILE   "/sys/kernel/boot_adsp/qdsp_qtimer"

Definition at line 73 of file px4muorb_KraitRpcWrapper.cpp.

Referenced by calc_timer_diff_to_dsp_us().

◆ MUORB_KRAIT_FASTRPC_HEAP_ID

#define MUORB_KRAIT_FASTRPC_HEAP_ID   22

Definition at line 52 of file px4muorb_KraitRpcWrapper.cpp.

Referenced by px4muorb::KraitRpcWrapper::Initialize().

◆ MUORB_KRAIT_FASTRPC_MEM_FLAGS

#define MUORB_KRAIT_FASTRPC_MEM_FLAGS   0

Definition at line 48 of file px4muorb_KraitRpcWrapper.cpp.

Referenced by px4muorb::KraitRpcWrapper::Initialize().

Function Documentation

◆ calc_timer_diff_to_dsp_us()

int calc_timer_diff_to_dsp_us ( int32_t *  time_diff_us)

Helper function to get timer difference between time on DSP and appsproc side.

Usually the DSP gets started around 2s before the appsproc (Linux) side and therefore the clocks are not in sync. We change the clock on the DSP side but for this we need to find the offset first and then tell code on the DSP side.

Parameters
time_diff_uspointer to time offset to set.
Returns
: 0 on success, < 0 on error.

Definition at line 86 of file px4muorb_KraitRpcWrapper.cpp.

References DSP_TIMER_FILE, fd, and read().

Referenced by px4muorb::KraitRpcWrapper::Initialize().

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

Variable Documentation

◆ _BulkTransferBuffer

◆ _DataBuffer

◆ _Initialized

◆ _MAX_BULK_TRANSFER_BUFFER_SIZE

const uint32_t _MAX_BULK_TRANSFER_BUFFER_SIZE
static
Initial value:
=
static const uint32_t _MAX_TOPIC_DATA_BUFFER_SIZE
static const uint32_t _MAX_TOPICS

Definition at line 66 of file px4muorb_KraitRpcWrapper.cpp.

Referenced by px4muorb::KraitRpcWrapper::Initialize(), and px4muorb::KraitRpcWrapper::ReceiveBulkData().

◆ _MAX_DATA_BUFFER_SIZE

const uint32_t _MAX_DATA_BUFFER_SIZE = 2048
static

◆ _MAX_TOPIC_DATA_BUFFER_SIZE

const uint32_t _MAX_TOPIC_DATA_BUFFER_SIZE = 1024
static

Definition at line 64 of file px4muorb_KraitRpcWrapper.cpp.

◆ _MAX_TOPIC_NAME_BUFFER

const int32_t _MAX_TOPIC_NAME_BUFFER = 256
static

◆ _MAX_TOPICS

const uint32_t _MAX_TOPICS = 64
static

Definition at line 65 of file px4muorb_KraitRpcWrapper.cpp.

◆ _TopicNameBuffer

◆ adsp_changed_index

unsigned char* adsp_changed_index = 0