| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- #ifndef _MC_ERROR_H__
- #define _MC_ERROR_H__
- #include "os/os_types.h"
- typedef struct {
- s16 err_value;
- u32 err_time;
- }err_record_t;
- #pragma pack (push,1)
- typedef struct {
- u8 idx;
- u8 err_code;
- s16 value1;
- s16 value2;
- }err_node_t;
- typedef struct {
- u8 idx;
- s16 vbus_x10;
- s16 ibus_x10;
- s16 vacc_x10;
- s16 id_x10;
- s16 iq_x10;
- s16 vd_x10;
- s16 vq_x10;
- s16 id_ref_x10;
- s16 iq_ref_x10;
- s16 torque_ref_x10;
- u8 run_mode;
- s16 rpm;
- u8 b_sensorless;
- u8 b_sensorless_stable;
- s16 sensorless_rpm;
- s16 mos_temp;
- s16 mot_temp;
- u8 enc_error;
- }runtime_node_t;
- #pragma pack(pop)
- typedef struct{
- u8 tail;
- u8 count;
- u16 crc;
- err_node_t node[0];
- }err_nv_t;
- typedef struct{
- u8 tail;
- u8 count;
- u16 crc;
- runtime_node_t node[0];
- }runtime_nv_t;
- void mc_crit_err_block_init(void);
- void mc_crit_err_add(u8 code, s16 value1, s16 value2);
- void mc_crit_err_add_s16(u8 code, s16 value);
- void mc_crit_err_save(void);
- int mc_crit_err_get(s16 offset, u8 *buff, int len);
- void mc_runtime_add(runtime_node_t *rt);
- int mc_runtime_get(s16 offset, u8 *buff, int len);
- #endif /*_MC_ERROR_H__ */
|