PX4 Firmware
PX4 Autopilot Software http://px4.io
drv_tap_esc.h File Reference
#include <board_config.h>
#include <stdint.h>
Include dependency graph for drv_tap_esc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  RunReq
 
struct  RunInfoRepsonse
 
struct  ConfigInfoBasicRequest
 
struct  ConfigInfoBasicResponse
 
struct  InfoRequest
 
struct  EscPacket
 
struct  ESC_UART_BUF
 

Macros

#define TAP_ESC_DEVICE_PATH   "/dev/tap_esc"
 
#define ESC_HAVE_CURRENT_SENSOR
 
#define TAP_ESC_MAX_PACKET_LEN   20
 
#define TAP_ESC_MAX_MOTOR_NUM   8
 
#define PACKET_HEAD   0xfe
 
#define ESC_POS   {0, 1, 4, 3, 2, 5, 7, 8}
 
#define ESC_DIR   {0, 1, 0, 1, 0, 1, 0, 1}
 
#define RPMMAX   1900
 
#define RPMMIN   1200
 
#define RPMSTOPPED   (RPMMIN - 10)
 
#define MAX_BOOT_TIME_MS   (550)
 
#define RUN_CHANNEL_VALUE_MASK   (uint16_t)0x07ff
 
#define RUN_RED_LED_ON_MASK   (uint16_t)0x0800
 
#define RUN_GREEN_LED_ON_MASK   (uint16_t)0x1000
 
#define RUN_BLUE_LED_ON_MASK   (uint16_t)0x2000
 
#define RUN_LED_ON_MASK   (uint16_t)0x3800
 
#define RUN_FEEDBACK_ENABLE_MASK   (uint16_t)0x4000
 
#define RUN_REVERSE_MASK   (uint16_t)0x8000
 
#define ESC_MASK_MAP_CHANNEL   0x0f
 
#define ESC_MASK_MAP_RUNNING_DIRECTION   0xf0
 
#define UART_BUFFER_SIZE   128
 

Enumerations

enum  InfoTypes {
  REQUEST_INFO_BASIC = 0, REQUEST_INFO_FUll, REQUEST_INFO_RUN, REQUEST_INFO_STUDY,
  REQUEST_INFO_COMM, REQUEST_INFO_DEVICE
}
 
enum  ESCBUS_ENUM_ESC_STATUS {
  ESC_STATUS_HEALTHY, ESC_STATUS_WARNING_LOW_VOLTAGE, ESC_STATUS_WARNING_OVER_HEAT, ESC_STATUS_ERROR_MOTOR_LOW_SPEED_LOSE_STEP,
  ESC_STATUS_ERROR_MOTOR_STALL, ESC_STATUS_ERROR_HARDWARE, ESC_STATUS_ERROR_LOSE_PROPELLER, ESC_STATUS_ERROR_OVER_CURRENT,
  ESC_STATUS_ERROR_MOTOR_HIGH_SPEED_LOSE_STEP, ESC_STATUS_ERROR_LOSE_CMD
}
 
enum  ESCBUS_ENUM_MESSAGE_ID {
  ESCBUS_MSG_ID_CONFIG_BASIC = 0, ESCBUS_MSG_ID_CONFIG_FULL, ESCBUS_MSG_ID_RUN, ESCBUS_MSG_ID_TUNE,
  ESCBUS_MSG_ID_DO_CMD, ESCBUS_MSG_ID_REQUEST_INFO, ESCBUS_MSG_ID_CONFIG_INFO_BASIC, ESCBUS_MSG_ID_CONFIG_INFO_FULL,
  ESCBUS_MSG_ID_RUN_INFO, ESCBUS_MSG_ID_STUDY_INFO, ESCBUS_MSG_ID_COMM_INFO, ESCBUS_MSG_ID_DEVICE_INFO,
  ESCBUS_MSG_ID_ASSIGNED_ID, PROTO_OK = 0x10, PROTO_FAILED = 0x11, ESCBUS_MSG_ID_BOOT_SYNC = 0x21,
  PROTO_GET_DEVICE = 0x22, PROTO_CHIP_ERASE = 0x23, PROTO_PROG_MULTI = 0x27, PROTO_GET_CRC = 0x29,
  PROTO_BOOT = 0x30, PROTO_GET_SOFTWARE_VERSION = 0x40, ESCBUS_MSG_ID_MAX_NUM
}
 
enum  PARSR_ESC_STATE {
  HEAD, LEN, ID, DATA,
  CRC
}
 

Macro Definition Documentation

◆ ESC_DIR

#define ESC_DIR   {0, 1, 0, 1, 0, 1, 0, 1}

Definition at line 69 of file drv_tap_esc.h.

◆ ESC_HAVE_CURRENT_SENSOR

#define ESC_HAVE_CURRENT_SENSOR

Definition at line 43 of file drv_tap_esc.h.

◆ ESC_MASK_MAP_CHANNEL

#define ESC_MASK_MAP_CHANNEL   0x0f

Definition at line 126 of file drv_tap_esc.h.

Referenced by TAP_ESC::init().

◆ ESC_MASK_MAP_RUNNING_DIRECTION

#define ESC_MASK_MAP_RUNNING_DIRECTION   0xf0

Definition at line 127 of file drv_tap_esc.h.

Referenced by TAP_ESC::init().

◆ ESC_POS

#define ESC_POS   {0, 1, 4, 3, 2, 5, 7, 8}

Definition at line 67 of file drv_tap_esc.h.

◆ MAX_BOOT_TIME_MS

#define MAX_BOOT_TIME_MS   (550)

Definition at line 76 of file drv_tap_esc.h.

Referenced by TAP_ESC::init().

◆ PACKET_HEAD

#define PACKET_HEAD   0xfe

◆ RPMMAX

#define RPMMAX   1900

Definition at line 71 of file drv_tap_esc.h.

Referenced by TAP_ESC::cycle(), TAP_ESC::init(), and TAP_ESC::send_esc_outputs().

◆ RPMMIN

#define RPMMIN   1200

Definition at line 72 of file drv_tap_esc.h.

Referenced by TAP_ESC::cycle(), and TAP_ESC::init().

◆ RPMSTOPPED

#define RPMSTOPPED   (RPMMIN - 10)

Definition at line 73 of file drv_tap_esc.h.

Referenced by TAP_ESC::cycle(), and TAP_ESC::send_esc_outputs().

◆ RUN_BLUE_LED_ON_MASK

#define RUN_BLUE_LED_ON_MASK   (uint16_t)0x2000

Definition at line 85 of file drv_tap_esc.h.

Referenced by TAP_ESC::send_esc_outputs().

◆ RUN_CHANNEL_VALUE_MASK

#define RUN_CHANNEL_VALUE_MASK   (uint16_t)0x07ff

Definition at line 82 of file drv_tap_esc.h.

◆ RUN_FEEDBACK_ENABLE_MASK

#define RUN_FEEDBACK_ENABLE_MASK   (uint16_t)0x4000

Definition at line 87 of file drv_tap_esc.h.

Referenced by TAP_ESC::send_esc_outputs().

◆ RUN_GREEN_LED_ON_MASK

#define RUN_GREEN_LED_ON_MASK   (uint16_t)0x1000

Definition at line 84 of file drv_tap_esc.h.

◆ RUN_LED_ON_MASK

#define RUN_LED_ON_MASK   (uint16_t)0x3800

Definition at line 86 of file drv_tap_esc.h.

◆ RUN_RED_LED_ON_MASK

#define RUN_RED_LED_ON_MASK   (uint16_t)0x0800

Definition at line 83 of file drv_tap_esc.h.

◆ RUN_REVERSE_MASK

#define RUN_REVERSE_MASK   (uint16_t)0x8000

Definition at line 88 of file drv_tap_esc.h.

◆ TAP_ESC_DEVICE_PATH

#define TAP_ESC_DEVICE_PATH   "/dev/tap_esc"

Definition at line 40 of file drv_tap_esc.h.

◆ TAP_ESC_MAX_MOTOR_NUM

#define TAP_ESC_MAX_MOTOR_NUM   8

Definition at line 46 of file drv_tap_esc.h.

Referenced by TAP_ESC::cycle(), and TAP_ESC::send_esc_outputs().

◆ TAP_ESC_MAX_PACKET_LEN

#define TAP_ESC_MAX_PACKET_LEN   20

Definition at line 45 of file drv_tap_esc.h.

◆ UART_BUFFER_SIZE

#define UART_BUFFER_SIZE   128

Enumeration Type Documentation

◆ ESCBUS_ENUM_ESC_STATUS

Enumerator
ESC_STATUS_HEALTHY 
ESC_STATUS_WARNING_LOW_VOLTAGE 
ESC_STATUS_WARNING_OVER_HEAT 
ESC_STATUS_ERROR_MOTOR_LOW_SPEED_LOSE_STEP 
ESC_STATUS_ERROR_MOTOR_STALL 
ESC_STATUS_ERROR_HARDWARE 
ESC_STATUS_ERROR_LOSE_PROPELLER 
ESC_STATUS_ERROR_OVER_CURRENT 
ESC_STATUS_ERROR_MOTOR_HIGH_SPEED_LOSE_STEP 
ESC_STATUS_ERROR_LOSE_CMD 

Definition at line 198 of file drv_tap_esc.h.

◆ ESCBUS_ENUM_MESSAGE_ID

Enumerator
ESCBUS_MSG_ID_CONFIG_BASIC 
ESCBUS_MSG_ID_CONFIG_FULL 
ESCBUS_MSG_ID_RUN 
ESCBUS_MSG_ID_TUNE 
ESCBUS_MSG_ID_DO_CMD 
ESCBUS_MSG_ID_REQUEST_INFO 
ESCBUS_MSG_ID_CONFIG_INFO_BASIC 
ESCBUS_MSG_ID_CONFIG_INFO_FULL 
ESCBUS_MSG_ID_RUN_INFO 
ESCBUS_MSG_ID_STUDY_INFO 
ESCBUS_MSG_ID_COMM_INFO 
ESCBUS_MSG_ID_DEVICE_INFO 
ESCBUS_MSG_ID_ASSIGNED_ID 
PROTO_OK 
PROTO_FAILED 
ESCBUS_MSG_ID_BOOT_SYNC 
PROTO_GET_DEVICE 
PROTO_CHIP_ERASE 
PROTO_PROG_MULTI 
PROTO_GET_CRC 
PROTO_BOOT 
PROTO_GET_SOFTWARE_VERSION 
ESCBUS_MSG_ID_MAX_NUM 

Definition at line 212 of file drv_tap_esc.h.

◆ InfoTypes

enum InfoTypes
Enumerator
REQUEST_INFO_BASIC 
REQUEST_INFO_FUll 
REQUEST_INFO_RUN 
REQUEST_INFO_STUDY 
REQUEST_INFO_COMM 
REQUEST_INFO_DEVICE 

Definition at line 131 of file drv_tap_esc.h.

◆ PARSR_ESC_STATE

Enumerator
HEAD 
LEN 
ID 
DATA 
CRC 

Definition at line 243 of file drv_tap_esc.h.