test_user.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #include "Cadence.h"
  2. #include "bikespeed.h"
  3. #include "torquesensor.h"
  4. #include "adc.h"
  5. #include "pwm.h"
  6. #include "typedefine.h"
  7. #include "CodePara.h"
  8. #include "macroequ.h"
  9. #include "canAppl.h"
  10. #include "hwsetup.h"
  11. #include "Temp.h"
  12. #include "spdctrmode.h"
  13. #include "user.h"
  14. #ifndef _TEST_USER_H_
  15. #define _TEST_USER_H_
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif // __cplusplus
  19. #define ADC0 0
  20. #define ADC1 1
  21. #define ADC_INT_FLAG_EOIC 0
  22. #define TIMER0 0
  23. #define TIMER1 1
  24. #define TIMER_INT_FLAG_UP 0
  25. #define TIMER_INT_FLAG_CH1 1
  26. #define TIMER_INT_FLAG_CH2 2
  27. #define TIMER_INT_FLAG_CH3 3
  28. #define GPIOB 1
  29. #define GPIOC 2
  30. #define ADC_IDATA0(adcx) testAdcInjectData0[adcx]
  31. #define ADC_IDATA1(adcx) testAdcInjectData1[adcx]
  32. #define ADC_IDATA2(adcx) testAdcInjectData2[adcx]
  33. #define TIMER_CH2CV(timex) testCh2CapValue[timex]
  34. #define TIMER_CH3CV(timex) testCh3CapValue[timex]
  35. #define GPIO_ISTAT(gpiox) testGpioBValue[gpiox]
  36. #define abs(x) ((x) >= 0 ? (x) : (-(x)))
  37. extern int testAdcInjectData0[2];
  38. extern int testAdcInjectData1[2];
  39. extern int testAdcInjectData2[2];
  40. extern int testAdcIntFlg[2][2];
  41. extern int testTimerIntFlg[2][4];
  42. extern int testCh2CapValue[2];
  43. extern int testCh3CapValue[2];
  44. extern int testGpioBValue[2];
  45. int timer_interrupt_flag_get(int timer_periph, int interrupt);
  46. void timer_interrupt_flag_clear(int timer_periph, int interrupt);
  47. #ifdef __cplusplus
  48. }
  49. #endif // __cplusplus
  50. #endif