APM:Libraries
Macros | Functions | Variables
HAL_PX4_Class.cpp File Reference
#include <AP_HAL/AP_HAL.h>
#include <AP_HAL/utility/RCOutput_Tap.h>
#include <AP_HAL_Empty/AP_HAL_Empty.h>
#include <AP_HAL_Empty/AP_HAL_Empty_Private.h>
#include "AP_HAL_PX4.h"
#include "AP_HAL_PX4_Namespace.h"
#include "HAL_PX4_Class.h"
#include "Scheduler.h"
#include "UARTDriver.h"
#include "Storage.h"
#include "RCInput.h"
#include "RCOutput.h"
#include "AnalogIn.h"
#include "Util.h"
#include "GPIO.h"
#include "I2CDevice.h"
#include "SPIDevice.h"
#include <stdlib.h>
#include <systemlib/systemlib.h>
#include <nuttx/config.h>
#include <unistd.h>
#include <stdio.h>
#include <pthread.h>
#include <poll.h>
#include <drivers/drv_hrt.h>
Include dependency graph for HAL_PX4_Class.cpp:

Go to the source code of this file.

Macros

#define UARTA_DEFAULT_DEVICE   "/dev/ttyACM0"
 
#define UARTB_DEFAULT_DEVICE   "/dev/ttyS3"
 
#define UARTC_DEFAULT_DEVICE   "/dev/ttyS2"
 
#define UARTD_DEFAULT_DEVICE   "/dev/null"
 
#define UARTE_DEFAULT_DEVICE   "/dev/null"
 
#define UARTF_DEFAULT_DEVICE   "/dev/null"
 

Functions

void hal_px4_set_priority (uint8_t priority)
 
static void loop_overtime (void *)
 
static int main_loop (int argc, char **argv)
 
static void usage (void)
 

Variables

static PX4Scheduler schedulerInstance
 
static PX4Storage storageDriver
 
static PX4RCInput rcinDriver
 
static PX4RCOutput rcoutDriver
 
static PX4AnalogIn analogIn
 
static PX4Util utilInstance
 
static PX4GPIO gpioDriver
 
static PX4::I2CDeviceManager i2c_mgr_instance
 
static PX4::SPIDeviceManager spi_mgr_instance
 
static PX4UARTDriver uartADriver (UARTA_DEFAULT_DEVICE, "APM_uartA")
 
static PX4UARTDriver uartBDriver (UARTB_DEFAULT_DEVICE, "APM_uartB")
 
static PX4UARTDriver uartCDriver (UARTC_DEFAULT_DEVICE, "APM_uartC")
 
static PX4UARTDriver uartDDriver (UARTD_DEFAULT_DEVICE, "APM_uartD")
 
static PX4UARTDriver uartEDriver (UARTE_DEFAULT_DEVICE, "APM_uartE")
 
static PX4UARTDriver uartFDriver (UARTF_DEFAULT_DEVICE, "APM_uartF")
 
bool _px4_thread_should_exit = false
 
static bool thread_running = false
 
static int daemon_task
 
bool px4_ran_overtime
 
const AP_HAL::HALhal
 -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- More...
 
static AP_HAL::HAL::Callbacksg_callbacks
 

Macro Definition Documentation

◆ UARTA_DEFAULT_DEVICE

#define UARTA_DEFAULT_DEVICE   "/dev/ttyACM0"

Definition at line 80 of file HAL_PX4_Class.cpp.

Referenced by HAL_PX4::run(), and usage().

◆ UARTB_DEFAULT_DEVICE

#define UARTB_DEFAULT_DEVICE   "/dev/ttyS3"

Definition at line 81 of file HAL_PX4_Class.cpp.

◆ UARTC_DEFAULT_DEVICE

#define UARTC_DEFAULT_DEVICE   "/dev/ttyS2"

Definition at line 82 of file HAL_PX4_Class.cpp.

Referenced by HAL_PX4::run(), and usage().

◆ UARTD_DEFAULT_DEVICE

#define UARTD_DEFAULT_DEVICE   "/dev/null"

Definition at line 83 of file HAL_PX4_Class.cpp.

Referenced by HAL_PX4::run(), and usage().

◆ UARTE_DEFAULT_DEVICE

#define UARTE_DEFAULT_DEVICE   "/dev/null"

Definition at line 84 of file HAL_PX4_Class.cpp.

Referenced by HAL_PX4::run(), and usage().

◆ UARTF_DEFAULT_DEVICE

#define UARTF_DEFAULT_DEVICE   "/dev/null"

Definition at line 85 of file HAL_PX4_Class.cpp.

Referenced by HAL_PX4::run(), and usage().

Function Documentation

◆ hal_px4_set_priority()

void hal_px4_set_priority ( uint8_t  priority)

Definition at line 128 of file HAL_PX4_Class.cpp.

Referenced by loop_overtime(), main_loop(), sem_post_boost(), and set_normal_priority().

Here is the caller graph for this function:

◆ loop_overtime()

static void loop_overtime ( void *  )
static

Definition at line 141 of file HAL_PX4_Class.cpp.

Referenced by main_loop().

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

◆ main_loop()

static int main_loop ( int  argc,
char **  argv 
)
static

Definition at line 149 of file HAL_PX4_Class.cpp.

Referenced by HAL_PX4::run(), and HAL_ChibiOS::run().

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

◆ usage()

static void usage ( void  )
static

Definition at line 219 of file HAL_PX4_Class.cpp.

Referenced by HAL_PX4::run().

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

Variable Documentation

◆ _px4_thread_should_exit

bool _px4_thread_should_exit = false

◆ analogIn

PX4AnalogIn analogIn
static

Definition at line 49 of file HAL_PX4_Class.cpp.

◆ daemon_task

int daemon_task
static

Handle of daemon task / thread

Definition at line 120 of file HAL_PX4_Class.cpp.

Referenced by hal_px4_set_priority(), and HAL_PX4::run().

◆ g_callbacks

AP_HAL::HAL::Callbacks* g_callbacks
static

Definition at line 147 of file HAL_PX4_Class.cpp.

◆ gpioDriver

PX4GPIO gpioDriver
static

Definition at line 51 of file HAL_PX4_Class.cpp.

◆ hal

const AP_HAL::HAL& hal

-*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-

Definition at line 14 of file AC_PID_test.cpp.

◆ i2c_mgr_instance

PX4::I2CDeviceManager i2c_mgr_instance
static

Definition at line 53 of file HAL_PX4_Class.cpp.

◆ px4_ran_overtime

bool px4_ran_overtime

◆ rcinDriver

PX4RCInput rcinDriver
static

Definition at line 43 of file HAL_PX4_Class.cpp.

◆ rcoutDriver

PX4RCOutput rcoutDriver
static

Definition at line 47 of file HAL_PX4_Class.cpp.

◆ schedulerInstance

PX4Scheduler schedulerInstance
static

Definition at line 41 of file HAL_PX4_Class.cpp.

◆ spi_mgr_instance

PX4::SPIDeviceManager spi_mgr_instance
static

Definition at line 54 of file HAL_PX4_Class.cpp.

◆ storageDriver

PX4Storage storageDriver
static

Definition at line 42 of file HAL_PX4_Class.cpp.

◆ thread_running

bool thread_running = false
static

Daemon status flag

Definition at line 119 of file HAL_PX4_Class.cpp.

Referenced by main_loop(), and HAL_PX4::run().

◆ uartADriver

PX4UARTDriver uartADriver(UARTA_DEFAULT_DEVICE, "APM_uartA")
static

Referenced by HAL_PX4::run().

◆ uartBDriver

PX4UARTDriver uartBDriver(UARTB_DEFAULT_DEVICE, "APM_uartB")
static

◆ uartCDriver

PX4UARTDriver uartCDriver(UARTC_DEFAULT_DEVICE, "APM_uartC")
static

Referenced by HAL_PX4::run().

◆ uartDDriver

PX4UARTDriver uartDDriver(UARTD_DEFAULT_DEVICE, "APM_uartD")
static

Referenced by HAL_PX4::run().

◆ uartEDriver

PX4UARTDriver uartEDriver(UARTE_DEFAULT_DEVICE, "APM_uartE")
static

Referenced by HAL_PX4::run().

◆ uartFDriver

PX4UARTDriver uartFDriver(UARTF_DEFAULT_DEVICE, "APM_uartF")
static

Referenced by HAL_PX4::run().

◆ utilInstance

PX4Util utilInstance
static

Definition at line 50 of file HAL_PX4_Class.cpp.