#ifndef FUNC_LIB_H
#define FUNC_LIB_H

#ifdef __cplusplus
extern "C" {
#endif


#if defined(SPC1158)
#include "spc1158.h"
#elif defined(SPD1148)
#include "spd1148.h"
#elif defined(SPD1178)
#include "spd1178.h"
#elif defined(SPD1188)
#include "spd1188.h"
#elif defined(SPD1163)
#include "spd1163.h"
#else
#include "spc1168.h"
#endif

typedef struct PHB
{
  uint32_t voltage;
  uint16_t phase;
}PHBs;


typedef struct FunLibStruct
{
    uint32_t (*pUserFunc)(uint8_t a, uint8_t b, int vtor, int* c, int d);
    PHBs* (*pGetMotorStatus)(uint32_t *PHA, PHBs * PHB, int *PHC, uint32_t **Key, uint32_t Count);
    uint32_t (*ptestfunc)(void);
}FUNCLIB;


#if defined(SPC1158)
const FUNCLIB *ThirdFuncLib = (FUNCLIB *)(0x10008000);
#else
const FUNCLIB *ThirdFuncLib = (FUNCLIB *)(0x10010000);
#endif

#ifdef __cplusplus
}
#endif /* extern "C" */

#endif /* FUNC_LIB_H */

/******************* Copyright (C) 2022 Spintrol Electronic Technology (Shanghai) Co., Ltd. ***** END OF FILE ****/
