ardupilot/libraries/AP_PiccoloCAN/piccolo_protocol/ServoProtocol.c

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

284 lines
11 KiB
C
Raw Permalink Normal View History

// ServoProtocol.c was generated by ProtoGen version 3.2.a
/*
* This file is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This file is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Oliver Walters / Currawong Engineering Pty Ltd
*/
#include "ServoProtocol.h"
/*!
* \brief Lookup label for 'ServoModes' enum entry
*
* \param value is the integer value of the enum entry
* \return string label of the given entry
*/
const char* ServoModes_EnumLabel(int value)
{
switch (value)
{
default:
return "";
case SERVO_MODE_NORMAL:
return translateServo("SERVO_MODE_NORMAL");
case SERVO_MODE_CALIBRATING:
return translateServo("SERVO_MODE_CALIBRATING");
case SERVO_MODE_TEST:
return translateServo("SERVO_MODE_TEST");
case SERVO_MODE_NUM_MODES:
return translateServo("SERVO_MODE_NUM_MODES");
}
}
/*!
* \brief Lookup label for 'ServoMultiCommandPackets' enum entry
*
* \param value is the integer value of the enum entry
* \return string label of the given entry
*/
const char* ServoMultiCommandPackets_EnumLabel(int value)
{
switch (value)
{
default:
return "";
case PKT_SERVO_MULTI_COMMAND_1:
return translateServo("PKT_SERVO_MULTI_COMMAND_1");
case PKT_SERVO_MULTI_COMMAND_2:
return translateServo("PKT_SERVO_MULTI_COMMAND_2");
case PKT_SERVO_MULTI_COMMAND_3:
return translateServo("PKT_SERVO_MULTI_COMMAND_3");
case PKT_SERVO_MULTI_COMMAND_4:
return translateServo("PKT_SERVO_MULTI_COMMAND_4");
case PKT_SERVO_MULTI_COMMAND_5:
return translateServo("PKT_SERVO_MULTI_COMMAND_5");
case PKT_SERVO_MULTI_COMMAND_6:
return translateServo("PKT_SERVO_MULTI_COMMAND_6");
case PKT_SERVO_MULTI_COMMAND_7:
return translateServo("PKT_SERVO_MULTI_COMMAND_7");
case PKT_SERVO_MULTI_COMMAND_8:
return translateServo("PKT_SERVO_MULTI_COMMAND_8");
case PKT_SERVO_MULTI_COMMAND_9:
return translateServo("PKT_SERVO_MULTI_COMMAND_9");
case PKT_SERVO_MULTI_COMMAND_10:
return translateServo("PKT_SERVO_MULTI_COMMAND_10");
case PKT_SERVO_MULTI_COMMAND_11:
return translateServo("PKT_SERVO_MULTI_COMMAND_11");
case PKT_SERVO_MULTI_COMMAND_12:
return translateServo("PKT_SERVO_MULTI_COMMAND_12");
case PKT_SERVO_MULTI_COMMAND_13:
return translateServo("PKT_SERVO_MULTI_COMMAND_13");
case PKT_SERVO_MULTI_COMMAND_14:
return translateServo("PKT_SERVO_MULTI_COMMAND_14");
case PKT_SERVO_MULTI_COMMAND_15:
return translateServo("PKT_SERVO_MULTI_COMMAND_15");
case PKT_SERVO_MULTI_COMMAND_16:
return translateServo("PKT_SERVO_MULTI_COMMAND_16");
}
}
/*!
* \brief Lookup label for 'ServoPackets' enum entry
*
* \param value is the integer value of the enum entry
* \return string label of the given entry
*/
const char* ServoPackets_EnumLabel(int value)
{
switch (value)
{
default:
return "";
case PKT_SERVO_POSITION_COMMAND:
return translateServo("PKT_SERVO_POSITION_COMMAND");
case PKT_SERVO_NEUTRAL_COMMAND:
return translateServo("PKT_SERVO_NEUTRAL_COMMAND");
case PKT_SERVO_DISABLE:
return translateServo("PKT_SERVO_DISABLE");
case PKT_SERVO_ENABLE:
return translateServo("PKT_SERVO_ENABLE");
case PKT_SERVO_SYSTEM_COMMAND:
return translateServo("PKT_SERVO_SYSTEM_COMMAND");
case PKT_SERVO_SET_TITLE:
return translateServo("PKT_SERVO_SET_TITLE");
case PKT_SERVO_STATUS_A:
return translateServo("PKT_SERVO_STATUS_A");
case PKT_SERVO_STATUS_B:
return translateServo("PKT_SERVO_STATUS_B");
case PKT_SERVO_STATUS_C:
return translateServo("PKT_SERVO_STATUS_C");
case PKT_SERVO_STATUS_D:
return translateServo("PKT_SERVO_STATUS_D");
case PKT_SERVO_ACCELEROMETER:
return translateServo("PKT_SERVO_ACCELEROMETER");
case PKT_SERVO_ADDRESS:
return translateServo("PKT_SERVO_ADDRESS");
case PKT_SERVO_TITLE:
return translateServo("PKT_SERVO_TITLE");
case PKT_SERVO_FIRMWARE:
return translateServo("PKT_SERVO_FIRMWARE");
case PKT_SERVO_SYSTEM_INFO:
return translateServo("PKT_SERVO_SYSTEM_INFO");
case PKT_SERVO_TELEMETRY_CONFIG:
return translateServo("PKT_SERVO_TELEMETRY_CONFIG");
case PKT_SERVO_SETTINGS_INFO:
return translateServo("PKT_SERVO_SETTINGS_INFO");
case PKT_SERVO_FACTORY:
return translateServo("PKT_SERVO_FACTORY");
case PKT_SERVO_TELLTALE_A:
return translateServo("PKT_SERVO_TELLTALE_A");
case PKT_SERVO_LIMITS:
return translateServo("PKT_SERVO_LIMITS");
case PKT_SERVO_CURRENT_LIMITS:
return translateServo("PKT_SERVO_CURRENT_LIMITS");
case PKT_SERVO_POTENTIOMETER:
return translateServo("PKT_SERVO_POTENTIOMETER");
case PKT_SERVO_BACKLASH:
return translateServo("PKT_SERVO_BACKLASH");
case PKT_SERVO_BIN_DATA:
return translateServo("PKT_SERVO_BIN_DATA");
case PKT_SERVO_WEAR_LEVEL_A:
return translateServo("PKT_SERVO_WEAR_LEVEL_A");
case PKT_SERVO_WEAR_LEVEL_B:
return translateServo("PKT_SERVO_WEAR_LEVEL_B");
case PKT_SERVO_LOOKUP_TABLE:
return translateServo("PKT_SERVO_LOOKUP_TABLE");
case PKT_SERVO_LOOKUP_ELEMENT:
return translateServo("PKT_SERVO_LOOKUP_ELEMENT");
case PKT_SERVO_CONFIG:
return translateServo("PKT_SERVO_CONFIG");
case PKT_SERVO_DELTA_CONFIG:
return translateServo("PKT_SERVO_DELTA_CONFIG");
case PKT_SERVO_CALIBRATION:
return translateServo("PKT_SERVO_CALIBRATION");
case PKT_SERVO_MOTION_CONTROL:
return translateServo("PKT_SERVO_MOTION_CONTROL");
case PKT_SERVO_LIMIT_VALUES:
return translateServo("PKT_SERVO_LIMIT_VALUES");
case PKT_SERVO_DEBUG_DELTA:
return translateServo("PKT_SERVO_DEBUG_DELTA");
case PKT_SERVO_DEBUG_CTRL_LOOP:
return translateServo("PKT_SERVO_DEBUG_CTRL_LOOP");
case PKT_SERVO_DEBUG_MOTOR:
return translateServo("PKT_SERVO_DEBUG_MOTOR");
case PKT_SERVO_DEBUG_MOTION_CTRL:
return translateServo("PKT_SERVO_DEBUG_MOTION_CTRL");
case PKT_SERVO_CTRL_LOOP_SETTINGS:
return translateServo("PKT_SERVO_CTRL_LOOP_SETTINGS");
case PKT_SERVO_TELLTALE_SETTINGS:
return translateServo("PKT_SERVO_TELLTALE_SETTINGS");
case PKT_SERVO_USER_SETTINGS:
return translateServo("PKT_SERVO_USER_SETTINGS");
case PKT_SERVO_SYSTEM_SETTINGS:
return translateServo("PKT_SERVO_SYSTEM_SETTINGS");
}
}
/*!
* \brief Lookup label for 'ServoCommands' enum entry
*
* \param value is the integer value of the enum entry
* \return string label of the given entry
*/
const char* ServoCommands_EnumLabel(int value)
{
switch (value)
{
default:
return "";
case CMD_SERVO_CONFIGURE_LOOKUP_TABLE:
return translateServo("CMD_SERVO_CONFIGURE_LOOKUP_TABLE");
case CMD_SERVO_SET_LOOKUP_TABLE_ELEMENT:
return translateServo("CMD_SERVO_SET_LOOKUP_TABLE_ELEMENT");
case CMD_SERVO_GET_LOOKUP_TABLE_ELEMENT:
return translateServo("CMD_SERVO_GET_LOOKUP_TABLE_ELEMENT");
case CMD_SERVO_SET_CONFIG:
return translateServo("CMD_SERVO_SET_CONFIG");
case CMD_SERVO_SET_CURRENT_LIMIT:
return translateServo("CMD_SERVO_SET_CURRENT_LIMIT");
case CMD_SERVO_SET_TEMPERATURE_LIMIT:
return translateServo("CMD_SERVO_SET_TEMPERATURE_LIMIT");
case CMD_SERVO_SET_RATE_LIMIT:
return translateServo("CMD_SERVO_SET_RATE_LIMIT");
case CMD_SERVO_SET_STRENGTH:
return translateServo("CMD_SERVO_SET_STRENGTH");
case CMD_SERVO_SET_ILIMIT_KP:
return translateServo("CMD_SERVO_SET_ILIMIT_KP");
case CMD_SERVO_SET_ILIMIT_KI:
return translateServo("CMD_SERVO_SET_ILIMIT_KI");
case CMD_SERVO_SET_MIN_PWM_LIMIT:
return translateServo("CMD_SERVO_SET_MIN_PWM_LIMIT");
case CMD_SERVO_SET_MAX_PWM_LIMIT:
return translateServo("CMD_SERVO_SET_MAX_PWM_LIMIT");
case CMD_SERVO_SET_NEUTRAL_POSITION:
return translateServo("CMD_SERVO_SET_NEUTRAL_POSITION");
case CMD_SERVO_SET_TELEMETRY_PERIOD:
return translateServo("CMD_SERVO_SET_TELEMETRY_PERIOD");
case CMD_SERVO_SET_SILENCE_PERIOD:
return translateServo("CMD_SERVO_SET_SILENCE_PERIOD");
case CMD_SERVO_SET_TELEMETRY_PACKETS:
return translateServo("CMD_SERVO_SET_TELEMETRY_PACKETS");
case CMD_SERVO_REQUEST_HF_DATA:
return translateServo("CMD_SERVO_REQUEST_HF_DATA");
case CMD_SERVO_SET_CMD_TIMEOUT:
return translateServo("CMD_SERVO_SET_CMD_TIMEOUT");
case CMD_SERVO_SET_NODE_ID:
return translateServo("CMD_SERVO_SET_NODE_ID");
case CMD_SERVO_SET_USER_ID_A:
return translateServo("CMD_SERVO_SET_USER_ID_A");
case CMD_SERVO_SET_USER_ID_B:
return translateServo("CMD_SERVO_SET_USER_ID_B");
case CMD_SERVO_CALIBRATE_POT:
return translateServo("CMD_SERVO_CALIBRATE_POT");
case CMD_SERVO_START_TEST_MODE:
return translateServo("CMD_SERVO_START_TEST_MODE");
case CMD_SERVO_STOP_TEST_MODE:
return translateServo("CMD_SERVO_STOP_TEST_MODE");
case CMD_SERVO_START_BACKLASH_TEST:
return translateServo("CMD_SERVO_START_BACKLASH_TEST");
case CMD_SERVO_RESET_HALL_COUNTS:
return translateServo("CMD_SERVO_RESET_HALL_COUNTS");
case CMD_SERVO_SET_MIDDLE_POS:
return translateServo("CMD_SERVO_SET_MIDDLE_POS");
case CMD_SERVO_RESET_TELLTALES:
return translateServo("CMD_SERVO_RESET_TELLTALES");
case CMD_SERVO_CLEAR_BIN_DATA:
return translateServo("CMD_SERVO_CLEAR_BIN_DATA");
case CMD_SERVO_ERASE_EEPROM:
return translateServo("CMD_SERVO_ERASE_EEPROM");
case CMD_SERVO_SET_COMMISSIONING_FLAG:
return translateServo("CMD_SERVO_SET_COMMISSIONING_FLAG");
case CMD_SERVO_RESET_DEFAULT_SETTINGS:
return translateServo("CMD_SERVO_RESET_DEFAULT_SETTINGS");
case CMD_SERVO_SET_PROFILE_TASK:
return translateServo("CMD_SERVO_SET_PROFILE_TASK");
case CMD_SERVO_UNLOCK_SETTINGS:
return translateServo("CMD_SERVO_UNLOCK_SETTINGS");
case CMD_SERVO_LOCK_SETTINGS:
return translateServo("CMD_SERVO_LOCK_SETTINGS");
case CMD_SERVO_ENTER_BOOTLOADER:
return translateServo("CMD_SERVO_ENTER_BOOTLOADER");
case CMD_SERVO_RESET:
return translateServo("CMD_SERVO_RESET");
case CMD_SERVO_SET_SERIAL_NUMBER:
return translateServo("CMD_SERVO_SET_SERIAL_NUMBER");
}
}
// end of ServoProtocol.c