Paparazzi UAS
v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
|
Actuators driver for AutoQuad ESC32 motor controllers. More...
#include "std.h"
#include "generated/airframe.h"
Go to the source code of this file.
Data Structures | |
struct | ESC32_response |
struct | ESC32_com |
struct | ESC32 |
Functions | |
void | actuators_esc32_init (void) |
Initializes the ESCs. More... | |
void | actuators_esc32_commit (void) |
Commits the commands and sends them to the ESCs. More... | |
void | actuators_esc32_set (uint8_t i, uint16_t v) |
Set the commands (either RPM or duty cycle) More... | |
void | actuators_esc32_config_cmd (uint8_t i) |
When receiving a configuration setting command. More... | |
Variables | |
struct ESC32 | actuators_esc32 |
Actuators driver for AutoQuad ESC32 motor controllers.
Definition in file actuators_esc32.h.
struct ESC32_response |
Definition at line 146 of file actuators_esc32.h.
Data Fields | ||
---|---|---|
uint8_t | data[8] | The data of the response. |
uint8_t | fid | The FID of the response. |
struct ESC32_com |
Definition at line 158 of file actuators_esc32.h.
Data Fields | ||
---|---|---|
uint8_t | can_id | The CAN identifier. |
uint8_t | network_id | Index in the array +1. |
enum ESC32_esc_status | status | The current status of the esc. |
uint8_t | type | The type of ESC. |
uint32_t | uuid | The UUID of the ESC. |
struct ESC32 |
Definition at line 182 of file actuators_esc32.h.
Data Fields | ||
---|---|---|
uint8_t | can_seq_idx | CAN seq ID used for communicating. |
uint16_t | cmds[SERVOS_ESC32_NB] | Commands which need to be committed. |
enum ESC32_config_cmd | config_cmd | The command. |
uint8_t | config_idx | Selected ESC. |
struct ESC32_com | escs[SERVOS_ESC32_NB] | The ESCs connected via CAN. |
uint8_t | escs_sorted[SERVOS_ESC32_NB] | The ESCs sorted by uuid. |
uint32_t | melody_status | The status of the melody. |
struct ESC32_response | responses[ESC32_RESPONSE_CNT] | Responses of CAN messages. |
enum ESC32_status | status | The current status of all actuators. |
#define ActuatorESC32Set | ( | _i, | |
_v | |||
) | { actuators_esc32_set(_i, _v); } |
Definition at line 205 of file actuators_esc32.h.
#define ActuatorsESC32Commit | ( | ) | actuators_esc32_commit() |
Definition at line 207 of file actuators_esc32.h.
#define ActuatorsESC32Init | ( | ) | actuators_esc32_init() |
Definition at line 206 of file actuators_esc32.h.
#define ESC32_CAN_DOC_MASK ((uint32_t)0x3f<<19) |
Definition at line 66 of file actuators_esc32.h.
#define ESC32_CAN_FID_ACK ((uint32_t)0x1<<25) |
Definition at line 52 of file actuators_esc32.h.
Referenced by actuators_esc32_can_rx_cb().
#define ESC32_CAN_FID_CMD ((uint32_t)0x3<<25) |
Definition at line 54 of file actuators_esc32.h.
Referenced by actuators_esc32_arm(), actuators_esc32_beep(), actuators_esc32_disarm(), actuators_esc32_duty(), and actuators_esc32_start().
#define ESC32_CAN_FID_ERROR ((uint32_t)0x9<<25) |
Definition at line 60 of file actuators_esc32.h.
#define ESC32_CAN_FID_GET ((uint32_t)0x4<<25) |
Definition at line 55 of file actuators_esc32.h.
Referenced by actuators_esc32_dir().
#define ESC32_CAN_FID_GRANT_ADDR ((uint32_t)0x8<<25) |
Definition at line 59 of file actuators_esc32.h.
Referenced by actuators_esc32_grant_idx().
#define ESC32_CAN_FID_MASK ((uint32_t)0xf<<25) |
Definition at line 50 of file actuators_esc32.h.
Referenced by actuators_esc32_can_rx_cb().
#define ESC32_CAN_FID_NACK ((uint32_t)0x2<<25) |
Definition at line 53 of file actuators_esc32.h.
Referenced by actuators_esc32_can_rx_cb().
#define ESC32_CAN_FID_PING ((uint32_t)0xa<<25) |
Definition at line 61 of file actuators_esc32.h.
#define ESC32_CAN_FID_REPLY ((uint32_t)0x6<<25) |
Definition at line 57 of file actuators_esc32.h.
Referenced by actuators_esc32_can_rx_cb().
#define ESC32_CAN_FID_REQ_ADDR ((uint32_t)0x7<<25) |
Definition at line 58 of file actuators_esc32.h.
Referenced by actuators_esc32_can_rx_cb().
#define ESC32_CAN_FID_RESET_BUS ((uint32_t)0x0<<25) |
Definition at line 51 of file actuators_esc32.h.
Referenced by actuators_esc32_init().
#define ESC32_CAN_FID_SET ((uint32_t)0x5<<25) |
Definition at line 56 of file actuators_esc32.h.
Referenced by actuators_esc32_dir().
#define ESC32_CAN_FID_TELEM ((uint32_t)0xb<<25) |
Definition at line 62 of file actuators_esc32.h.
Referenced by actuators_esc32_can_rx_cb().
#define ESC32_CAN_LCC_EXCEPTION ((uint32_t)0x0<<30) |
Definition at line 37 of file actuators_esc32.h.
Referenced by actuators_esc32_init().
#define ESC32_CAN_LCC_HIGH ((uint32_t)0x1<<30) |
Definition at line 38 of file actuators_esc32.h.
Referenced by actuators_esc32_grant_idx().
#define ESC32_CAN_LCC_INFO ((uint32_t)0x3<<30) |
Definition at line 40 of file actuators_esc32.h.
#define ESC32_CAN_LCC_MASK ((uint32_t)0x3<<30) |
Definition at line 36 of file actuators_esc32.h.
#define ESC32_CAN_LCC_NORMAL ((uint32_t)0x2<<30) |
Definition at line 39 of file actuators_esc32.h.
Referenced by actuators_esc32_arm(), actuators_esc32_beep(), actuators_esc32_dir(), actuators_esc32_disarm(), actuators_esc32_duty(), and actuators_esc32_start().
#define ESC32_CAN_SEQ_MASK ((uint32_t)0x3f<<3) |
Definition at line 78 of file actuators_esc32.h.
Referenced by actuators_esc32_can_rx_cb().
#define ESC32_CAN_SID_MASK ((uint32_t)0x1f<<14) |
Definition at line 70 of file actuators_esc32.h.
#define ESC32_CAN_TID_MASK ((uint32_t)0x1f<<9) |
Definition at line 74 of file actuators_esc32.h.
Referenced by actuators_esc32_grant_idx().
#define ESC32_CAN_TT_GROUP ((uint32_t)0x0<<29) |
Definition at line 45 of file actuators_esc32.h.
Referenced by actuators_esc32_commit(), and actuators_esc32_init().
#define ESC32_CAN_TT_MASK ((uint32_t)0x1<<29) |
Definition at line 44 of file actuators_esc32.h.
#define ESC32_CAN_TT_NODE ((uint32_t)0x1<<29) |
Definition at line 46 of file actuators_esc32.h.
Referenced by actuators_esc32_config_cmd(), and actuators_esc32_grant_idx().
#define ESC32_RESPONSE_CNT 12 |
Definition at line 32 of file actuators_esc32.h.
Referenced by actuators_esc32_send().
anonymous enum |
Enumerator | |
---|---|
ESC32_CAN_TYPE_ESC | |
ESC32_CAN_TYPE_SERVO | |
ESC32_CAN_TYPE_SENSOR | |
ESC32_CAN_TYPE_SWITCH | |
ESC32_CAN_TYPE_OSD | |
ESC32_CAN_TYPE_UART | |
ESC32_CAN_TYPE_HUB | |
ESC32_CAN_TYPE_NUM |
Definition at line 81 of file actuators_esc32.h.
anonymous enum |
Definition at line 93 of file actuators_esc32.h.
anonymous enum |
Definition at line 117 of file actuators_esc32.h.
anonymous enum |
Definition at line 133 of file actuators_esc32.h.
enum ESC32_config_cmd |
Enumerator | |
---|---|
ESC32_CONFIG_CMD_IDLE | |
ESC32_CONFIG_CMD_BEEP | |
ESC32_CONFIG_CMD_TURN | |
ESC32_CONFIG_CMD_DIR |
Definition at line 175 of file actuators_esc32.h.
enum ESC32_esc_status |
Enumerator | |
---|---|
ESC32_STATUS_ESC_FREE | |
ESC32_STATUS_ESC_INIT | |
ESC32_STATUS_ESC_RDY |
Definition at line 152 of file actuators_esc32.h.
enum ESC32_status |
Enumerator | |
---|---|
ESC32_STATUS_INIT | |
ESC32_STATUS_MELODY | |
ESC32_STATUS_UNARMED | |
ESC32_STATUS_RUNNING |
Definition at line 167 of file actuators_esc32.h.
void actuators_esc32_commit | ( | void | ) |
Commits the commands and sends them to the ESCs.
Definition at line 147 of file actuators_esc32.c.
References actuators_esc32, actuators_esc32_arm(), actuators_esc32_disarm(), actuators_esc32_duty(), actuators_esc32_melody, actuators_esc32_melody_size, actuators_esc32_play_melody(), actuators_esc32_start(), autopilot_get_motors_on(), ESC32::cmds, ESC32_CAN_TT_GROUP, ESC32_STATUS_MELODY, ESC32_STATUS_RUNNING, ESC32_STATUS_UNARMED, ESC32::melody_status, and ESC32::status.
void actuators_esc32_config_cmd | ( | uint8_t | i | ) |
When receiving a configuration setting command.
Definition at line 83 of file actuators_esc32.c.
References actuators_esc32, actuators_esc32_arm(), actuators_esc32_beep(), actuators_esc32_dir(), actuators_esc32_disarm(), actuators_esc32_duty(), actuators_esc32_start(), cmds, ESC32::config_cmd, ESC32::config_idx, ESC32_CAN_TT_NODE, ESC32_CONFIG_CMD_BEEP, ESC32_CONFIG_CMD_DIR, ESC32_CONFIG_CMD_IDLE, ESC32_CONFIG_CMD_TURN, ESC32_STATUS_UNARMED, ESC32::escs_sorted, and ESC32::status.
void actuators_esc32_init | ( | void | ) |
Initializes the ESCs.
Definition at line 122 of file actuators_esc32.c.
References actuators_esc32, actuators_esc32_can_rx_cb(), actuators_esc32_melody, actuators_esc32_melody_size, actuators_esc32_send(), ESC32_CAN_FID_RESET_BUS, ESC32_CAN_LCC_EXCEPTION, ESC32_CAN_TT_GROUP, ESC32_STATUS_ESC_FREE, ESC32_STATUS_INIT, ESC32::escs, ESC32::melody_status, ppz_can_init(), ESC32_com::status, and ESC32::status.
Set the commands (either RPM or duty cycle)
Definition at line 73 of file actuators_esc32.c.
References actuators_esc32, ESC32::cmds, and ESC32::escs_sorted.
struct ESC32 actuators_esc32 |
Definition at line 34 of file actuators_esc32.c.
Referenced by actuators_esc32_can_rx_cb(), actuators_esc32_commit(), actuators_esc32_config_cmd(), actuators_esc32_dir(), actuators_esc32_grant_idx(), actuators_esc32_init(), actuators_esc32_send(), and actuators_esc32_set().