test_user.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #include "Cadence.h"
  2. #include "bikespeed.h"
  3. #include "torquesensor.h"
  4. #include "adc.h"
  5. #include "pwm.h"
  6. #include "torqobs.h"
  7. #include "pwrlim.h"
  8. #include "asr.h"
  9. #include "brake.h"
  10. #include "glbcof.h"
  11. #include "typedefine.h"
  12. #include "CodePara.h"
  13. #include "mathtool.h"
  14. #include "macroequ.h"
  15. #include "canAppl.h"
  16. #include "hwsetup.h"
  17. #include "Temp.h"
  18. #include "spdctrmode.h"
  19. #include "user.h"
  20. #include "api_rt.h"
  21. #include "api.h"
  22. #ifndef _TEST_USER_H_
  23. #define _TEST_USER_H_
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif // __cplusplus
  27. #define ADC0 0
  28. #define ADC1 1
  29. #define ADC_INT_FLAG_EOIC 0
  30. #define TIMER0 0
  31. #define TIMER1 1
  32. #define TIMER_INT_FLAG_UP 0
  33. #define TIMER_INT_FLAG_CH1 1
  34. #define TIMER_INT_FLAG_CH2 2
  35. #define TIMER_INT_FLAG_CH3 3
  36. #define GPIOA 0
  37. #define GPIOB 1
  38. #define GPIOC 2
  39. #define ADC_IDATA0(adcx) testAdcInjectData0[adcx]
  40. #define ADC_IDATA1(adcx) testAdcInjectData1[adcx]
  41. #define ADC_IDATA2(adcx) testAdcInjectData2[adcx]
  42. #define TIMER_CH2CV(timex) testCh2CapValue[timex]
  43. #define TIMER_CH3CV(timex) testCh3CapValue[timex]
  44. #define GPIO_ISTAT(gpiox) testGpioBValue[gpiox]
  45. //#define ABS(x) ((x) >= 0 ? (x) : (-(x)))
  46. extern int testAdcInjectData0[2];
  47. extern int testAdcInjectData1[2];
  48. extern int testAdcInjectData2[2];
  49. extern int testAdcIntFlg[2][2];
  50. extern int testTimerIntFlg[2][4];
  51. extern int testCh2CapValue[2];
  52. extern int testCh3CapValue[2];
  53. extern int testGpioBValue[2];
  54. extern UWORD hw_uwADC0[8];
  55. extern UWORD adc_uwRdsonUReg;
  56. extern UWORD adc_uwRdsonVReg;
  57. extern UWORD adc_uwRdsonWReg;
  58. extern UWORD adc_uwADDMAPhase1;
  59. int timer_interrupt_flag_get(int timer_periph, int interrupt);
  60. void timer_interrupt_flag_clear(int timer_periph, int interrupt);
  61. #ifdef __cplusplus
  62. }
  63. #endif // __cplusplus
  64. #endif