phase_current.h 822 B

12345678910111213141516171819202122232425262728
  1. #ifndef _PHASE_CURRENT_H__
  2. #define _PHASE_CURRENT_H__
  3. #include "foc_type.h"
  4. /* boundary zone definition */
  5. #define REGULAR ((uint8_t)0u)
  6. #define BOUNDARY_1 ((uint8_t)1u) /* Two small, one big */
  7. #define BOUNDARY_2 ((uint8_t)2u) /* Two big, one small */
  8. #define BOUNDARY_3 ((uint8_t)3u) /* Three equal */
  9. #define SAMP_NO 0u
  10. #define SAMP_IA 1u
  11. #define SAMP_IB 2u
  12. #define SAMP_IC 3u
  13. #define SAMP_NIA 4u
  14. #define SAMP_NIB 5u
  15. #define SAMP_NIC 6u
  16. #define SAMP_OLDA 7u
  17. #define SAMP_OLDB 8u
  18. #define SAMP_OLDC 9u
  19. void phase_current_init(current_samp_t *cs);
  20. void phase_current_sample(current_samp_t *cs);
  21. void phase_current_offset(current_samp_t *cs);
  22. void get_phase_sample_point(current_samp_t *cs, u8 sector);
  23. void phase_current_adc_triger(current_samp_t *cs);
  24. #endif /* _PHASE_CURRENT_H__ */