训练营PLSR题目
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
 
 

40 Zeilen
1.1 KiB

  1. #ifndef __PLSR_H__
  2. #define __PLSR_H__
  3. #include "stdint.h"
  4. /* 结构体定义,每段脉冲的参数 */
  5. typedef struct
  6. {
  7. uint32_t Frequency ; ///<< 脉冲的频率
  8. int32_t PulseCount; ///<< 脉冲的总数
  9. int8_t NextPulse; ///<< 下一段脉冲是第几个 , 若为 -1 代表无下一个脉冲
  10. uint8_t Direction; ///<< 脉冲的方向 0为正转, 1为反转
  11. } Pulse;
  12. typedef struct
  13. {
  14. uint8_t StartPulse; ///<< 起始的脉冲段
  15. uint8_t PulseMod; ///<< 相对模式还是绝对模式
  16. uint8_t NowPulse; ///<< 当前处于第几段脉冲
  17. uint8_t PrePulse; ///<< 之前处于第几段脉冲
  18. int32_t MAX_Pulse; ///<< 最多的脉冲数
  19. int32_t AccCount;
  20. } BaseOption;
  21. /* 变量声明 */
  22. extern Pulse PulseOutput[10];
  23. extern BaseOption Base;
  24. extern int32_t PulseCount;
  25. extern int32_t AllPulseCount;
  26. /* 函数声明 */
  27. void SetFrequency(uint8_t Channel, uint32_t Frequency);
  28. void SetPulse(uint8_t Pulse, uint32_t Ferquency, int32_t Count, uint8_t Direction, int8_t NextPulse);
  29. void PulseInit(uint8_t StartPulse, uint8_t PulseMod, int32_t MAX_Pulse);
  30. void PulseStart(void);
  31. int32_t GetAcc(int32_t Start, int32_t End, int32_t AccCount);
  32. #endif