remote_controller.h 1009 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef __REMOTE_CONTROLLER_H_
  2. #define __REMOTE_CONTROLLER_H_
  3. #include "common.h"
  4. #include <stdint.h>
  5. #define RC_INPUT_CH_NUM 14
  6. #define RC_CALIB_CH_NUM 4
  7. typedef enum
  8. {
  9. // 信号正常
  10. RC_SIGNAL_HEALTH = 0,
  11. RC_SIGNAL_FAIL = 1,
  12. // 信号超允许范围
  13. RC_SIGNAL_BAD = 2
  14. } RcSignalHealthType;
  15. typedef struct
  16. {
  17. /*--------- public members ---------------*/
  18. comp_status link_status; /* 连接状态 */
  19. RcSignalHealthType signal_health; /* 信号健康标志 */
  20. uint16_t ch_value[14]; /* 通道值 */
  21. uint16_t raw_ch_value[14]; /* 通道值 未经过校准 */
  22. /* 前 4 通道的校准参数 */
  23. uint16_t calib_offset[RC_CALIB_CH_NUM];
  24. uint16_t calib_factor_up[RC_CALIB_CH_NUM];
  25. uint16_t calib_factor_down[RC_CALIB_CH_NUM];
  26. } RC_Data_Type;
  27. void RemoteController_SetCalibParams(RC_Data_Type *rc, uint8_t ch,
  28. uint16_t offset, uint16_t factor_up,
  29. uint16_t factor_down);
  30. #endif