| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #ifndef _PHASE_CURRENT_H__
- #define _PHASE_CURRENT_H__
- #include "math/fix_math.h"
- typedef struct _phase_time {
- s32 A;
- s32 B;
- s32 C;
- s32 A_next;
- s32 B_next;
- s32 C_next;
- u32 Samp_p1; //单电阻方案两个采样时刻可能不是连续的
- u32 Samp_p2;
- u8 sampe_phase_1;
- u8 sampe_phase_2;
- u8 boundary3_flags;
- u8 three_shunts_flags;
- }phase_time_t; //����pwn��duty cnt
- #define IGNORE_NONE 0
- #define IGNORE_A 1
- #define IGNORE_B 2
- #define IGNORE_C 3
- #define IGNORE_ALL 4
- 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;
- s16 adc_ia_filter;
- s16 adc_ib_filter;
- s16 adc_ic_filter;
- u8 c_phases;
- u8 c_ignore_phase;
- phase_time_t time;
- volatile int offset_sample_count;
- volatile bool is_calibrating_offset;
- }current_samp_t;
- void phase_current_init(void);
- void phase_current_get(float *iABC);
- bool phase_current_offset(void);
- void phase_current_point(void *);
- void phase_current_adc_triger(void);
- void phase_current_start_cali(void);
- void phase_current_wait_cali(void);
- #endif /* _PHASE_CURRENT_H__ */
|