APM:Libraries
|
#include <Util.h>
Public Member Functions | |
void | init (int argc, char *const *argv) |
bool | run_debug_shell (AP_HAL::BetterStream *stream) |
void | commandline_arguments (uint8_t &argc, char *const *&argv) |
bool | toneAlarm_init () |
void | toneAlarm_set_tune (uint8_t tune) |
void | _toneAlarm_timer_tick () |
void | set_system_clock (uint64_t time_utc_usec) |
const char * | get_custom_log_directory () const override final |
const char * | get_custom_terrain_directory () const override final |
const char * | get_custom_storage_directory () const override final |
void | set_custom_log_directory (const char *_custom_log_directory) |
void | set_custom_terrain_directory (const char *_custom_terrain_directory) |
void | set_custom_storage_directory (const char *_custom_storage_directory) |
bool | is_chardev_node (const char *path) |
void | set_imu_temp (float current) override |
void | set_imu_target_temp (int8_t *target) override |
uint32_t | available_memory (void) override |
int | write_file (const char *path, const char *fmt,...) FMT_PRINTF(3 |
int int | read_file (const char *path, const char *fmt,...) FMT_SCANF(3 |
int int perf_counter_t | perf_alloc (enum perf_counter_type t, const char *name) override |
void | perf_begin (perf_counter_t perf) override |
void | perf_end (perf_counter_t perf) override |
void | perf_count (perf_counter_t perf) override |
AP_HAL::Semaphore * | new_semaphore (void) override |
int | get_hw_arm32 () |
Public Member Functions inherited from AP_HAL::Util | |
int | snprintf (char *str, size_t size, const char *format,...) |
int | vsnprintf (char *str, size_t size, const char *format, va_list ap) |
void | set_soft_armed (const bool b) |
bool | get_soft_armed () const |
void | set_capabilities (uint64_t cap) |
void | clear_capabilities (uint64_t cap) |
uint64_t | get_capabilities () const |
virtual const char * | get_custom_defaults_file () const |
virtual enum safety_state | safety_switch_state (void) |
uint64_t | get_system_clock_ms () const |
void | get_system_clock_utc (int32_t &hour, int32_t &min, int32_t &sec, int32_t &ms) const |
uint32_t | get_time_utc (int32_t hour, int32_t min, int32_t sec, int32_t ms) const |
virtual bool | get_system_id (char buf[40]) |
virtual AP_HAL::BetterStream * | get_shell_stream () |
virtual void * | malloc_type (size_t size, Memory_Type mem_type) |
virtual void | free_type (void *ptr, size_t size, Memory_Type mem_type) |
Static Public Member Functions | |
static Util * | from (AP_HAL::Util *util) |
Private Attributes | |
int | saved_argc |
Heat * | _heat |
char *const * | saved_argv |
const char * | custom_log_directory = nullptr |
const char * | custom_terrain_directory = nullptr |
const char * | custom_storage_directory = nullptr |
Static Private Attributes | |
static ToneAlarm_Disco | _toneAlarm |
static const char * | _hw_names [UTIL_NUM_HARDWARES] |
Additional Inherited Members | |
Public Types inherited from AP_HAL::Util | |
enum | safety_state { SAFETY_NONE, SAFETY_DISARMED, SAFETY_ARMED } |
enum | perf_counter_type { PC_COUNT, PC_ELAPSED, PC_INTERVAL } |
enum | Memory_Type { MEM_DMA_SAFE, MEM_FAST } |
typedef void * | perf_counter_t |
Protected Attributes inherited from AP_HAL::Util | |
bool | soft_armed = false |
uint64_t | capabilities = 0 |
|
virtual |
Reimplemented from AP_HAL::Util.
Definition at line 76 of file Util.cpp.
Referenced by Linux::Scheduler::_tonealarm_task(), and run_debug_shell().
|
overridevirtual |
how much free memory do we have in bytes. If unknown return 4096
Reimplemented from AP_HAL::Util.
Definition at line 121 of file Util.cpp.
Referenced by set_custom_storage_directory().
|
virtual |
return commandline arguments, if available
Reimplemented from AP_HAL::Util.
Definition at line 60 of file Util.cpp.
Referenced by run_debug_shell().
|
inlinestatic |
Definition at line 27 of file Util.h.
Referenced by Linux::UtilRPI::_check_rpi_version(), Linux::GPIO_Sysfs::_pinMode(), Linux::RCOutput_Bebop::_run_rcout(), Linux::Scheduler::_tonealarm_task(), Linux::PWM_Sysfs_Base::enable(), Linux::PWM_Sysfs_Base::get_period(), Linux::PWM_Sysfs_Base::get_polarity(), Linux::PWM_Sysfs_Base::init(), Linux::Led_Sysfs::init(), Linux::PWM_Sysfs_Base::is_enabled(), Linux::PWM_Sysfs_Base::set_period(), and Linux::PWM_Sysfs_Base::set_polarity().
|
inlinefinaloverridevirtual |
Reimplemented from AP_HAL::Util.
|
inlinefinaloverridevirtual |
Reimplemented from AP_HAL::Util.
|
inlinefinaloverridevirtual |
Reimplemented from AP_HAL::Util.
int Util::get_hw_arm32 | ( | ) |
Definition at line 185 of file Util.cpp.
Referenced by Linux::UtilRPI::_check_rpi_version(), Linux::RCOutput_Bebop::_run_rcout(), and new_semaphore().
void Util::init | ( | int | argc, |
char *const * | argv | ||
) |
Definition at line 27 of file Util.cpp.
Referenced by from(), and HAL_Linux::run().
bool Util::is_chardev_node | ( | const char * | path | ) |
Definition at line 104 of file Util.cpp.
Referenced by set_custom_storage_directory().
|
inlineoverridevirtual |
Reimplemented from AP_HAL::Util.
Definition at line 99 of file Util.h.
|
inlineoverridevirtual |
Reimplemented from AP_HAL::Util.
Definition at line 78 of file Util.h.
|
inlineoverridevirtual |
Reimplemented from AP_HAL::Util.
Definition at line 83 of file Util.h.
|
inlineoverridevirtual |
Reimplemented from AP_HAL::Util.
Definition at line 93 of file Util.h.
|
inlineoverridevirtual |
Reimplemented from AP_HAL::Util.
Definition at line 88 of file Util.h.
int Util::read_file | ( | const char * | path, |
const char * | fmt, | ||
... | |||
) |
Definition at line 151 of file Util.cpp.
Referenced by Linux::PWM_Sysfs_Base::get_period(), Linux::PWM_Sysfs_Base::get_polarity(), Linux::Led_Sysfs::init(), Linux::PWM_Sysfs_Base::is_enabled(), and set_custom_storage_directory().
|
inlinevirtual |
Implements AP_HAL::Util.
Definition at line 32 of file Util.h.
|
inline |
Definition at line 52 of file Util.h.
Referenced by HAL_Linux::run().
|
inline |
Definition at line 54 of file Util.h.
Referenced by HAL_Linux::run().
|
inline |
Definition at line 53 of file Util.h.
Referenced by HAL_Linux::run().
|
overridevirtual |
Reimplemented from AP_HAL::Util.
Definition at line 52 of file Util.cpp.
Referenced by set_custom_storage_directory().
|
overridevirtual |
Reimplemented from AP_HAL::Util.
Definition at line 46 of file Util.cpp.
Referenced by set_custom_storage_directory().
|
virtual |
Reimplemented from AP_HAL::Util.
Definition at line 94 of file Util.cpp.
Referenced by run_debug_shell().
|
virtual |
Reimplemented from AP_HAL::Util.
Definition at line 66 of file Util.cpp.
Referenced by run_debug_shell().
|
virtual |
Reimplemented from AP_HAL::Util.
Definition at line 71 of file Util.cpp.
Referenced by run_debug_shell().
int Util::write_file | ( | const char * | path, |
const char * | fmt, | ||
... | |||
) |
Definition at line 126 of file Util.cpp.
Referenced by Linux::GPIO_Sysfs::_pinMode(), Linux::PWM_Sysfs_Base::enable(), Linux::PWM_Sysfs_Base::init(), set_custom_storage_directory(), Linux::PWM_Sysfs_Base::set_period(), and Linux::PWM_Sysfs_Base::set_polarity().
|
private |
Definition at line 110 of file Util.h.
Referenced by init(), set_imu_target_temp(), and set_imu_temp().
|
staticprivate |
Definition at line 115 of file Util.h.
Referenced by get_hw_arm32(), and read_file().
|
staticprivate |
Definition at line 105 of file Util.h.
Referenced by _toneAlarm_timer_tick(), toneAlarm_init(), and toneAlarm_set_tune().
|
private |
Definition at line 112 of file Util.h.
Referenced by get_custom_log_directory(), and set_custom_log_directory().
|
private |
Definition at line 114 of file Util.h.
Referenced by get_custom_storage_directory(), and set_custom_storage_directory().
|
private |
Definition at line 113 of file Util.h.
Referenced by get_custom_terrain_directory(), and set_custom_terrain_directory().
|
private |
Definition at line 109 of file Util.h.
Referenced by commandline_arguments(), and init().
|
private |
Definition at line 111 of file Util.h.
Referenced by commandline_arguments(), and init().