APM:Libraries
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
AP_BoardConfig Class Reference

#include <AP_BoardConfig.h>

Collaboration diagram for AP_BoardConfig:
[legend]

Public Types

enum  px4_board_type {
  PX4_BOARD_AUTO = 0, PX4_BOARD_PX4V1 = 1, PX4_BOARD_PIXHAWK = 2, PX4_BOARD_PIXHAWK2 = 3,
  PX4_BOARD_PIXRACER = 4, PX4_BOARD_PHMINI = 5, PX4_BOARD_PH2SLIM = 6, PX4_BOARD_AEROFC = 13,
  PX4_BOARD_PIXHAWK_PRO = 14, PX4_BOARD_AUAV21 = 20, PX4_BOARD_PCNC1 = 21, PX4_BOARD_MINDPXV2 = 22,
  PX4_BOARD_SP01 = 23, VRX_BOARD_BRAIN51 = 30, VRX_BOARD_BRAIN52 = 32, VRX_BOARD_BRAIN52E = 33,
  VRX_BOARD_UBRAIN51 = 34, VRX_BOARD_UBRAIN52 = 35, VRX_BOARD_CORE10 = 36, VRX_BOARD_BRAIN54 = 38,
  PX4_BOARD_OLDDRIVERS = 100
}
 
enum  board_safety_button_option { BOARD_SAFETY_OPTION_BUTTON_ACTIVE_SAFETY_OFF =1, BOARD_SAFETY_OPTION_BUTTON_ACTIVE_SAFETY_ON =2, BOARD_SAFETY_OPTION_BUTTON_ACTIVE_ARMED =4 }
 

Public Member Functions

 AP_BoardConfig ()
 
 AP_BoardConfig (const AP_BoardConfig &other)=delete
 
AP_BoardConfigoperator= (const AP_BoardConfig &)=delete
 
void init (void)
 
void init_safety (void)
 
void set_default_safety_ignore_mask (uint16_t mask)
 
uint16_t get_safety_button_options (void)
 
uint16_t get_safety_mask (void) const
 

Static Public Member Functions

static AP_BoardConfigget_instance (void)
 
static void sensor_config_error (const char *reason)
 
static bool in_sensor_config_error (void)
 
static bool px4_start_driver (main_fn_t main_function, const char *name, const char *arguments)
 
static enum px4_board_type get_board_type (void)
 
static bool io_enabled (void)
 
static uint8_t get_pwm_count (void)
 

Static Public Attributes

static const struct AP_Param::GroupInfo var_info []
 

Private Member Functions

void px4_setup_pwm (void)
 
void px4_setup_safety_mask (void)
 
void px4_tone_alarm (const char *tone_string)
 
void px4_setup_px4io (void)
 
void px4_setup_peripherals (void)
 
void board_setup_drivers (void)
 
bool spi_check_register (const char *devname, uint8_t regnum, uint8_t value, uint8_t read_flag=0x80)
 
void validate_board_type (void)
 
void board_autodetect (void)
 
void board_init_safety (void)
 
void board_setup_safety_mask (void)
 
void board_setup_uart (void)
 
void board_setup_sbus (void)
 
void board_setup (void)
 

Private Attributes

AP_Int16 vehicleSerialNumber
 
AP_Int8 pwm_count
 
struct {
   AP_Int8   safety_enable
 
   AP_Int16   safety_option
 
   AP_Int32   ignore_safety_channels
 
   AP_Int8   ser1_rtscts
 
   AP_Int8   ser2_rtscts
 
   AP_Int8   sbus_out_rate
 
   AP_Int8   board_type
 
   AP_Int8   io_enable
 
state
 
AP_Int8 _imu_target_temperature
 

Static Private Attributes

static AP_BoardConfiginstance
 
static enum px4_board_type px4_configured_board
 
static bool _in_sensor_config_error
 

Detailed Description

Definition at line 41 of file AP_BoardConfig.h.

Member Enumeration Documentation

◆ board_safety_button_option

Enumerator
BOARD_SAFETY_OPTION_BUTTON_ACTIVE_SAFETY_OFF 
BOARD_SAFETY_OPTION_BUTTON_ACTIVE_SAFETY_ON 
BOARD_SAFETY_OPTION_BUTTON_ACTIVE_ARMED 

Definition at line 129 of file AP_BoardConfig.h.

◆ px4_board_type

Enumerator
PX4_BOARD_AUTO 
PX4_BOARD_PX4V1 
PX4_BOARD_PIXHAWK 
PX4_BOARD_PIXHAWK2 
PX4_BOARD_PIXRACER 
PX4_BOARD_PHMINI 
PX4_BOARD_PH2SLIM 
PX4_BOARD_AEROFC 
PX4_BOARD_PIXHAWK_PRO 
PX4_BOARD_AUAV21 
PX4_BOARD_PCNC1 
PX4_BOARD_MINDPXV2 
PX4_BOARD_SP01 
VRX_BOARD_BRAIN51 
VRX_BOARD_BRAIN52 
VRX_BOARD_BRAIN52E 
VRX_BOARD_UBRAIN51 
VRX_BOARD_UBRAIN52 
VRX_BOARD_CORE10 
VRX_BOARD_BRAIN54 
PX4_BOARD_OLDDRIVERS 

Definition at line 78 of file AP_BoardConfig.h.

Constructor & Destructor Documentation

◆ AP_BoardConfig() [1/2]

AP_BoardConfig::AP_BoardConfig ( )
inline

Definition at line 43 of file AP_BoardConfig.h.

Here is the call graph for this function:

◆ AP_BoardConfig() [2/2]

AP_BoardConfig::AP_BoardConfig ( const AP_BoardConfig other)
delete

Member Function Documentation

◆ board_autodetect()

void AP_BoardConfig::board_autodetect ( void  )
private

Definition at line 185 of file board_drivers.cpp.

Referenced by board_setup_drivers().

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

◆ board_init_safety()

void AP_BoardConfig::board_init_safety ( void  )
private

Definition at line 29 of file board_drivers.cpp.

Referenced by init_safety().

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

◆ board_setup()

void AP_BoardConfig::board_setup ( void  )
private

Definition at line 318 of file board_drivers.cpp.

Referenced by init().

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

◆ board_setup_drivers()

void AP_BoardConfig::board_setup_drivers ( void  )
private

Definition at line 54 of file board_drivers.cpp.

Referenced by board_setup().

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

◆ board_setup_safety_mask()

void AP_BoardConfig::board_setup_safety_mask ( void  )
private

◆ board_setup_sbus()

void AP_BoardConfig::board_setup_sbus ( void  )
private

Definition at line 285 of file board_drivers.cpp.

Referenced by board_setup().

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

◆ board_setup_uart()

void AP_BoardConfig::board_setup_uart ( void  )
private

Definition at line 272 of file board_drivers.cpp.

Referenced by board_setup().

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

◆ get_board_type()

static enum px4_board_type AP_BoardConfig::get_board_type ( void  )
inlinestatic

Definition at line 109 of file AP_BoardConfig.h.

Referenced by Compass::_detect_backends(), AP_InertialSensor::detect_backends(), OpticalFlow::init(), and AP_Baro::init().

Here is the caller graph for this function:

◆ get_instance()

static AP_BoardConfig* AP_BoardConfig::get_instance ( void  )
inlinestatic

Definition at line 53 of file AP_BoardConfig.h.

Referenced by PX4::PX4RCOutput::force_safety_pending_requests(), and ChibiOS::RCOutput::safety_update().

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

◆ get_pwm_count()

static uint8_t AP_BoardConfig::get_pwm_count ( void  )
inlinestatic

Definition at line 124 of file AP_BoardConfig.h.

Referenced by ChibiOS::RCOutput::init(), and ChibiOS::GPIO::init().

Here is the caller graph for this function:

◆ get_safety_button_options()

uint16_t AP_BoardConfig::get_safety_button_options ( void  )
inline

Definition at line 136 of file AP_BoardConfig.h.

Referenced by PX4::PX4RCOutput::force_safety_pending_requests(), and ChibiOS::RCOutput::safety_update().

Here is the caller graph for this function:

◆ get_safety_mask()

uint16_t AP_BoardConfig::get_safety_mask ( void  ) const
inline

Definition at line 142 of file AP_BoardConfig.h.

Referenced by ChibiOS::RCOutput::safety_update().

Here is the caller graph for this function:

◆ in_sensor_config_error()

static bool AP_BoardConfig::in_sensor_config_error ( void  )
inlinestatic

Definition at line 67 of file AP_BoardConfig.h.

Here is the call graph for this function:

◆ init()

void AP_BoardConfig::init ( void  )

Definition at line 220 of file AP_BoardConfig.cpp.

Referenced by get_instance(), setup(), and SchedTest::setup().

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

◆ init_safety()

void AP_BoardConfig::init_safety ( void  )

Definition at line 243 of file AP_BoardConfig.cpp.

Referenced by get_instance().

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

◆ io_enabled()

static bool AP_BoardConfig::io_enabled ( void  )
inlinestatic

◆ operator=()

AP_BoardConfig& AP_BoardConfig::operator= ( const AP_BoardConfig )
delete

Referenced by AP_BoardConfig().

Here is the caller graph for this function:

◆ px4_setup_peripherals()

void AP_BoardConfig::px4_setup_peripherals ( void  )
private

Definition at line 244 of file px4_drivers.cpp.

Referenced by board_setup().

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

◆ px4_setup_pwm()

void AP_BoardConfig::px4_setup_pwm ( void  )
private

Definition at line 47 of file px4_drivers.cpp.

Referenced by board_setup().

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

◆ px4_setup_px4io()

void AP_BoardConfig::px4_setup_px4io ( void  )
private

Definition at line 176 of file px4_drivers.cpp.

Referenced by px4_setup_peripherals().

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

◆ px4_setup_safety_mask()

void AP_BoardConfig::px4_setup_safety_mask ( void  )
private

Definition at line 96 of file px4_drivers.cpp.

Referenced by board_setup(), and set_default_safety_ignore_mask().

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

◆ px4_start_driver()

bool AP_BoardConfig::px4_start_driver ( main_fn_t  main_function,
const char *  name,
const char *  arguments 
)
static

Definition at line 128 of file px4_drivers.cpp.

Referenced by PX4::PX4Storage::_mtd_load(), VRBRAIN::VRBRAINStorage::_mtd_load(), AP_RPM_PX4_PWM::AP_RPM_PX4_PWM(), board_setup_drivers(), AP_RangeFinder_PX4_PWM::detect(), in_sensor_config_error(), OreoLED_PX4::init(), px4_setup_peripherals(), px4_setup_px4io(), and px4_tone_alarm().

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

◆ px4_tone_alarm()

void AP_BoardConfig::px4_tone_alarm ( const char *  tone_string)
private

Definition at line 168 of file px4_drivers.cpp.

Referenced by px4_setup_px4io().

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

◆ sensor_config_error()

void AP_BoardConfig::sensor_config_error ( const char *  reason)
static

Definition at line 255 of file AP_BoardConfig.cpp.

Referenced by PX4::PX4Storage::_mtd_load(), VRBRAIN::VRBRAINStorage::_mtd_load(), board_autodetect(), board_setup_drivers(), AP_InertialSensor::detect_backends(), AP_Baro::init(), px4_setup_peripherals(), px4_setup_px4io(), and validate_board_type().

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

◆ set_default_safety_ignore_mask()

void AP_BoardConfig::set_default_safety_ignore_mask ( uint16_t  mask)

Definition at line 233 of file AP_BoardConfig.cpp.

Here is the call graph for this function:

◆ spi_check_register()

bool AP_BoardConfig::spi_check_register ( const char *  devname,
uint8_t  regnum,
uint8_t  value,
uint8_t  read_flag = 0x80 
)
private

Definition at line 117 of file board_drivers.cpp.

Referenced by board_autodetect(), and validate_board_type().

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

◆ validate_board_type()

void AP_BoardConfig::validate_board_type ( void  )
private

Definition at line 151 of file board_drivers.cpp.

Referenced by board_autodetect().

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

Member Data Documentation

◆ _imu_target_temperature

AP_Int8 AP_BoardConfig::_imu_target_temperature
private

Definition at line 203 of file AP_BoardConfig.h.

Referenced by board_setup_drivers(), and init().

◆ _in_sensor_config_error

bool AP_BoardConfig::_in_sensor_config_error
staticprivate

Definition at line 200 of file AP_BoardConfig.h.

Referenced by in_sensor_config_error(), init_safety(), and sensor_config_error().

◆ board_type

AP_Int8 AP_BoardConfig::board_type

Definition at line 167 of file AP_BoardConfig.h.

◆ ignore_safety_channels

AP_Int32 AP_BoardConfig::ignore_safety_channels

Definition at line 161 of file AP_BoardConfig.h.

◆ instance

AP_BoardConfig * AP_BoardConfig::instance
staticprivate

Definition at line 152 of file AP_BoardConfig.h.

Referenced by AP_BoardConfig(), get_instance(), get_pwm_count(), and io_enabled().

◆ io_enable

AP_Int8 AP_BoardConfig::io_enable

Definition at line 168 of file AP_BoardConfig.h.

Referenced by io_enabled().

◆ pwm_count

AP_Int8 AP_BoardConfig::pwm_count
private

Definition at line 155 of file AP_BoardConfig.h.

Referenced by get_pwm_count(), and px4_setup_pwm().

◆ px4_configured_board

AP_BoardConfig::px4_board_type AP_BoardConfig::px4_configured_board
staticprivate

Definition at line 173 of file AP_BoardConfig.h.

Referenced by board_init_safety(), board_setup_drivers(), and get_board_type().

◆ safety_enable

AP_Int8 AP_BoardConfig::safety_enable

Definition at line 159 of file AP_BoardConfig.h.

◆ safety_option

AP_Int16 AP_BoardConfig::safety_option

Definition at line 160 of file AP_BoardConfig.h.

◆ sbus_out_rate

AP_Int8 AP_BoardConfig::sbus_out_rate

Definition at line 165 of file AP_BoardConfig.h.

◆ ser1_rtscts

AP_Int8 AP_BoardConfig::ser1_rtscts

Definition at line 163 of file AP_BoardConfig.h.

◆ ser2_rtscts

AP_Int8 AP_BoardConfig::ser2_rtscts

Definition at line 164 of file AP_BoardConfig.h.

◆ state

struct { ... } AP_BoardConfig::state

◆ var_info

const AP_Param::GroupInfo AP_BoardConfig::var_info
static

Definition at line 60 of file AP_BoardConfig.h.

Referenced by AP_BoardConfig().

◆ vehicleSerialNumber

AP_Int16 AP_BoardConfig::vehicleSerialNumber
private

Definition at line 154 of file AP_BoardConfig.h.


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