26 #ifndef ACTUATORS_ESC32_H
27 #define ACTUATORS_ESC32_H
30 #include "generated/airframe.h"
32 #define ESC32_RESPONSE_CNT 12
36 #define ESC32_CAN_LCC_MASK ((uint32_t)0x3<<30)
37 #define ESC32_CAN_LCC_EXCEPTION ((uint32_t)0x0<<30)
38 #define ESC32_CAN_LCC_HIGH ((uint32_t)0x1<<30)
39 #define ESC32_CAN_LCC_NORMAL ((uint32_t)0x2<<30)
40 #define ESC32_CAN_LCC_INFO ((uint32_t)0x3<<30)
44 #define ESC32_CAN_TT_MASK ((uint32_t)0x1<<29)
45 #define ESC32_CAN_TT_GROUP ((uint32_t)0x0<<29)
46 #define ESC32_CAN_TT_NODE ((uint32_t)0x1<<29)
50 #define ESC32_CAN_FID_MASK ((uint32_t)0xf<<25)
51 #define ESC32_CAN_FID_RESET_BUS ((uint32_t)0x0<<25)
52 #define ESC32_CAN_FID_ACK ((uint32_t)0x1<<25)
53 #define ESC32_CAN_FID_NACK ((uint32_t)0x2<<25)
54 #define ESC32_CAN_FID_CMD ((uint32_t)0x3<<25)
55 #define ESC32_CAN_FID_GET ((uint32_t)0x4<<25)
56 #define ESC32_CAN_FID_SET ((uint32_t)0x5<<25)
57 #define ESC32_CAN_FID_REPLY ((uint32_t)0x6<<25)
58 #define ESC32_CAN_FID_REQ_ADDR ((uint32_t)0x7<<25)
59 #define ESC32_CAN_FID_GRANT_ADDR ((uint32_t)0x8<<25)
60 #define ESC32_CAN_FID_ERROR ((uint32_t)0x9<<25)
61 #define ESC32_CAN_FID_PING ((uint32_t)0xa<<25)
62 #define ESC32_CAN_FID_TELEM ((uint32_t)0xb<<25)
66 #define ESC32_CAN_DOC_MASK ((uint32_t)0x3f<<19)
70 #define ESC32_CAN_SID_MASK ((uint32_t)0x1f<<14)
74 #define ESC32_CAN_TID_MASK ((uint32_t)0x1f<<9)
78 #define ESC32_CAN_SEQ_MASK ((uint32_t)0x3f<<3)
205 #define ActuatorESC32Set(_i, _v) { actuators_esc32_set(_i, _v); }
206 #define ActuatorsESC32Init() actuators_esc32_init()
207 #define ActuatorsESC32Commit() actuators_esc32_commit()
void actuators_esc32_config_cmd(uint8_t i)
When receiving a configuration setting command.
struct ESC32_response responses[ESC32_RESPONSE_CNT]
Responses of CAN messages.
uint8_t data[8]
The data of the response.
struct ESC32_com escs[SERVOS_ESC32_NB]
The ESCs connected via CAN.
uint8_t config_idx
Selected ESC.
enum ESC32_status status
The current status of all actuators.
struct ESC32 actuators_esc32
uint8_t fid
The FID of the response.
uint8_t network_id
Index in the array +1.
uint32_t uuid
The UUID of the ESC.
enum ESC32_esc_status status
The current status of the esc.
void actuators_esc32_commit(void)
Commits the commands and sends them to the ESCs.
void actuators_esc32_init(void)
Initializes the ESCs.
void actuators_esc32_set(uint8_t i, uint16_t v)
Set the commands (either RPM or duty cycle)
uint8_t escs_sorted[SERVOS_ESC32_NB]
The ESCs sorted by uuid.
#define ESC32_RESPONSE_CNT
uint8_t can_id
The CAN identifier.
uint8_t can_seq_idx
CAN seq ID used for communicating.
uint8_t type
The type of ESC.
uint16_t cmds[SERVOS_ESC32_NB]
Commands which need to be committed.
enum ESC32_config_cmd config_cmd
The command.
uint32_t melody_status
The status of the melody.