/** ****************************(C) COPYRIGHT 2016 DJI**************************** * @file remote_control.c/h * @brief ң����������ң������ͨ������SBUS��Э�鴫�䣬����DMA���䷽ʽ��ԼCPU * ��Դ�����ô��ڿ����ж���������������ͬʱ�ṩһЩ��������DMA������ * �ķ�ʽ��֤�Ȳ�ε��ȶ��ԡ� * @note * @history * Version Date Author Modification * V1.0.0 Dec-26-2018 RM 1. ��� * @verbatim ============================================================================== ============================================================================== @endverbatim ****************************(C) COPYRIGHT 2016 DJI**************************** */ #ifndef REMOTE_CONTROL_H #define REMOTE_CONTROL_H #include #define SBUS_RX_BUF_NUM 50u /* CAN总线上的设备 将所有CAN总线上挂载的设备抽象成一个设备进行配置和控制 */ /* Includes ----------------------------------------------------------------- */ #include "motor_rm.h" #include #include #include "bsp/can.h" #include "bsp/mm.h" #include "bsp/time.h" #include "component/user_math.h" #define RC_FRAME_LENGTH 25u #define RC_CH_VALUE_OFFSET ((uint16_t)1024) typedef struct { volatile int16_t ch[4]; volatile int16_t sw[8]; }__attribute__((packed)) RC_ctrl_t; extern RC_ctrl_t rc_ctrl; extern void remote_control_init(void); static void sbus_to_rc(volatile const uint8_t *sbus_buf, RC_ctrl_t *rc_ctrl); int map_rc(int x, int in_min, int in_max, int out_min, int out_max); //ӳ�亯�� void USART3_IRQHandlerCallBack(void); #endif