| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #ifndef _PHASE_CURRENT_H__
- #define _PHASE_CURRENT_H__
- #include "foc/core/foc_type.h"
- /* boundary zone definition */
- #define REGULAR ((uint8_t)0u)
- #define BOUNDARY_1 ((uint8_t)1u) /* Two small, one big */
- #define BOUNDARY_2 ((uint8_t)2u) /* Two big, one small */
- #define BOUNDARY_3 ((uint8_t)3u) /* Three equal */
- #define SAMP_NO 0u
- #define SAMP_IA 1u
- #define SAMP_IB 2u
- #define SAMP_IC 3u
- #define SAMP_NIA 4u
- #define SAMP_NIB 5u
- #define SAMP_NIC 6u
- #define SAMP_OLDA 7u
- #define SAMP_OLDB 8u
- #define SAMP_OLDC 9u
- typedef struct current_sample {
- s32 adc_offset_a;
- s32 adc_offset_b;
- s32 adc_offset_c;
- s16 adc_ia;
- s16 adc_ib;
- s16 adc_ic;
- u8 sector;
- phase_time_t time;
- volatile int offset_sample_count;
- bool is_calibrating_offset;
- }current_samp_t;
- void phase_current_init(void);
- void phase_current_sample(s16 *ia, s16 *ib, s16 *ic);
- bool phase_current_offset(void);
- current_samp_t * get_phase_sample_point(u8 sector);
- void phase_current_adc_triger(void);
- void phase_current_start_cali(void);
- #endif /* _PHASE_CURRENT_H__ */
|