107 lines
2.9 KiB
C
107 lines
2.9 KiB
C
// #ifndef REMOTE_CONTROL_h
|
|
// #define REMOTE_CONTROL_h
|
|
|
|
// /* Includes ----------------------------------------------------------------- */
|
|
// #include <cmsis_os2.h>
|
|
|
|
// #include "module/cmd.h"
|
|
// #include "component/user_math.h"
|
|
// #include "device/device.h"
|
|
|
|
|
|
// /* Exported constants ------------------------------------------------------- */
|
|
// /* Exported macro ----------------------------------------------------------- */
|
|
// /* Exported types ----------------------------------------------------------- */
|
|
// //大疆
|
|
// typedef struct __packed {
|
|
// uint16_t ch_r_x : 11;
|
|
// uint16_t ch_r_y : 11;
|
|
// uint16_t ch_l_x : 11;
|
|
// uint16_t ch_l_y : 11;
|
|
// uint8_t sw_r : 2;
|
|
// uint8_t sw_l : 2;
|
|
// int16_t x;
|
|
// int16_t y;
|
|
// int16_t z;
|
|
// uint8_t press_l;
|
|
// uint8_t press_r;
|
|
// uint16_t key;
|
|
// uint16_t res;
|
|
// } DR16_Data_t;
|
|
|
|
// typedef struct {
|
|
// DR16_Data_t data;
|
|
// } DR16_t;
|
|
|
|
// //乐迪
|
|
// typedef struct
|
|
// {
|
|
// float ch[4];
|
|
// int16_t sw[8];
|
|
|
|
// } LD_raw_t;
|
|
|
|
// typedef struct
|
|
// {
|
|
|
|
// rc_type_t rc_type;
|
|
|
|
// struct
|
|
// {
|
|
// float ch_l_x; /* 遥控器左侧摇杆横轴值,上为正 */
|
|
// float ch_l_y; /* 遥控器左侧摇杆纵轴值,右为正 */
|
|
// float ch_r_x; /* 遥控器右侧摇杆横轴值,上为正 */
|
|
// float ch_r_y; /* 遥控器右侧摇杆纵轴值,右为正 */
|
|
|
|
// CMD_SwitchPos_t sw_r; /* 右侧拨杆位置 */
|
|
// CMD_SwitchPos_t sw_l; /* 左侧拨杆位置 */
|
|
|
|
// } __attribute__((packed)) DJ;
|
|
// struct
|
|
// {
|
|
|
|
// uint8_t head;
|
|
// float ch_l_x; /* 遥控器左侧摇杆横轴值,上为正 */
|
|
// float ch_l_y; /* 遥控器左侧摇杆纵轴值,右为正 */
|
|
// float ch_r_x; /* 遥控器右侧摇杆横轴值,上为正 */
|
|
// float ch_r_y; /* 遥控器右侧摇杆纵轴值,右为正 */
|
|
|
|
// CMD_SwitchPos_t key_A;
|
|
// CMD_SwitchPos_t key_B;
|
|
// CMD_SwitchPos_t key_C;
|
|
// CMD_SwitchPos_t key_D;
|
|
// CMD_SwitchPos_t key_E;
|
|
// CMD_SwitchPos_t key_F;
|
|
// CMD_SwitchPos_t key_G;
|
|
// CMD_SwitchPos_t key_H;
|
|
|
|
|
|
// uint8_t end;
|
|
// int16_t knob_left; // 左旋钮
|
|
// int16_t knob_right; // 右旋钮
|
|
// } __attribute__((packed)) ET16s;
|
|
|
|
// } __attribute__((packed)) CMD_RC_t;
|
|
// typedef struct
|
|
// {
|
|
// float ch[4];
|
|
// int16_t sw[8];
|
|
// } ET16s_raw_t;
|
|
|
|
|
|
// /* Exported functions prototypes -------------------------------------------- */
|
|
// int8_t REMOTE_Restart(void);
|
|
// int8_t REMOTE_Init(void);
|
|
// int8_t REMOTE_StartDmaRecv(void);
|
|
// bool REMOTE_WaitDmaCplt(uint32_t timeout);
|
|
|
|
|
|
// int8_t REMOTE_ParseRC(DR16_t *dr16, CMD_RC_t *rc,ET16s_raw_t *ET16s);
|
|
|
|
// int8_t DR16_HandleOffline(const DR16_t *dr16, CMD_RC_t *rc);
|
|
// int8_t LD_HandleOffline(const LD_raw_t *LD, CMD_RC_t *rc);
|
|
// int8_t ET16s_HandleOffline(const ET16s_raw_t *ET16s, CMD_RC_t *rc);
|
|
|
|
// #endif
|
|
|