test_user.h 1.9 KB

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