APM:Libraries
Classes | Macros | Functions | Variables
GPIOTest.cpp File Reference
#include <stdio.h>
#include <unistd.h>
#include <AP_Common/AP_Common.h>
#include <AP_HAL_Linux/AP_HAL_Linux.h>
#include <AP_Menu/AP_Menu.h>
Include dependency graph for GPIOTest.cpp:

Go to the source code of this file.

Classes

class  MenuCommands
 

Macros

#define MENU_FUNC(func)   FUNCTOR_BIND(&commands, &MenuCommands::func, int8_t, uint8_t, const Menu::arg *)
 

Functions

void setup ()
 
void loop ()
 
int parse_gpio_pin_number (uint8_t argc, const Menu::arg *argv)
 
static int8_t test_gpio_input (uint8_t argc, const Menu::arg *argv, bool use_channel)
 
static int8_t test_gpio_output (uint8_t argc, const Menu::arg *argv, bool use_channel)
 
 MENU (main_menu, "GPIOTest: Please select one of the operations followed by the GPIO pin number", test_menu_commands)
 
 AP_HAL_MAIN ()
 

Variables

const AP_HAL::HALhal = AP_HAL::get_HAL()
 -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- More...
 
MenuCommands commands
 
const struct Menu::command test_menu_commands []
 

Macro Definition Documentation

◆ MENU_FUNC

#define MENU_FUNC (   func)    FUNCTOR_BIND(&commands, &MenuCommands::func, int8_t, uint8_t, const Menu::arg *)

Definition at line 12 of file GPIOTest.cpp.

Function Documentation

◆ AP_HAL_MAIN()

AP_HAL_MAIN ( )

Referenced by loop().

Here is the caller graph for this function:

◆ loop()

void loop ( void  )

Definition at line 123 of file GPIOTest.cpp.

Here is the call graph for this function:

◆ MENU()

MENU ( main_menu  ,
"GPIOTest: Please select one of the operations followed by the GPIO pin number"  ,
test_menu_commands   
)

◆ parse_gpio_pin_number()

int parse_gpio_pin_number ( uint8_t  argc,
const Menu::arg argv 
)

Definition at line 16 of file GPIOTest.cpp.

Referenced by test_gpio_input(), and test_gpio_output().

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

◆ setup()

void setup ( void  )

Definition at line 113 of file GPIOTest.cpp.

Here is the call graph for this function:

◆ test_gpio_input()

static int8_t test_gpio_input ( uint8_t  argc,
const Menu::arg argv,
bool  use_channel 
)
static

Definition at line 31 of file GPIOTest.cpp.

Referenced by MenuCommands::gpio_input(), and MenuCommands::gpio_input_channel().

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

◆ test_gpio_output()

static int8_t test_gpio_output ( uint8_t  argc,
const Menu::arg argv,
bool  use_channel 
)
static

Definition at line 52 of file GPIOTest.cpp.

Referenced by MenuCommands::gpio_output(), and MenuCommands::gpio_output_channel().

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

Variable Documentation

◆ commands

MenuCommands commands

Definition at line 102 of file GPIOTest.cpp.

◆ hal

const AP_HAL::HAL& hal = AP_HAL::get_HAL()

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

The strategy for roll/pitch autotune is to give the user a AUTOTUNE flight mode which behaves just like FBWA, but does automatic tuning.

While the user is flying in AUTOTUNE the gains are saved every 10 seconds, but the saved gains are not the current gains, instead it saves the gains from 10s ago. When the user exits AUTOTUNE the gains are restored from 10s ago.

This allows the user to fly as much as they want in AUTOTUNE mode, and if they are ever unhappy they just exit the mode. If they stay in AUTOTUNE for more than 10s then their gains will have changed.

Using this approach users don't need any special switches, they just need to be able to enter and exit AUTOTUNE mode

Definition at line 14 of file GPIOTest.cpp.

◆ test_menu_commands

const struct Menu::command test_menu_commands[]
Initial value:
= {
{"input", MENU_FUNC(gpio_input)},
{"output", MENU_FUNC(gpio_output)},
{"input_ch", MENU_FUNC(gpio_input_channel)},
{"output_ch", MENU_FUNC(gpio_output_channel)}
}
#define MENU_FUNC(func)
Definition: GPIOTest.cpp:12

Definition at line 104 of file GPIOTest.cpp.