darts/User/device/remote_control.h
2026-02-15 23:43:19 +08:00

59 lines
1.8 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
****************************(C) COPYRIGHT 2016 DJI****************************
* @file remote_control.c/h
* @brief ң<><D2A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ң<EFBFBD><D2A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SBUS<55><53>Э<EFBFBD><EFBFBD><EFBFBD><E4A3AC><EFBFBD><EFBFBD>DMA<4D><41><EFBFBD>ʽ<E4B7BD><CABD>ԼCPU
* <20><>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD><EFBFBD>ô<EFBFBD><C3B4>ڿ<EFBFBD><DABF><EFBFBD><EFBFBD>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬʱ<CDAC>һЩ<D2BB><D0A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>DMA<4D><41><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* <20>ķ<EFBFBD>ʽ<EFBFBD><CABD>֤<EFBFBD>Ȳ<EFBFBD>ε<EFBFBD><CEB5>ȶ<EFBFBD><C8B6>ԡ<EFBFBD>
* @note
* @history
* Version Date Author Modification
* V1.0.0 Dec-26-2018 RM 1. <20><><EFBFBD>
*
@verbatim
==============================================================================
==============================================================================
@endverbatim
****************************(C) COPYRIGHT 2016 DJI****************************
*/
#ifndef REMOTE_CONTROL_H
#define REMOTE_CONTROL_H
#include <stdint.h>
#define SBUS_RX_BUF_NUM 50u
/*
CAN总线上的设备
将所有CAN总线上挂载的设备抽象成一个设备进行配置和控制
*/
/* Includes ----------------------------------------------------------------- */
#include "motor_rm.h"
#include <stdbool.h>
#include <string.h>
#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); //ӳ<><EFBFBD><E4BAAF>
void USART3_IRQHandlerCallBack(void);
#endif