add LIMIT to IV mode
This commit is contained in:
+26
@@ -66,6 +66,12 @@ typedef void (*InitWorkData) ();
|
||||
void (*SetCycleNumber) (struct VoltOutPara *, uint16_t); \
|
||||
uint16_t (*GetCycleNumber) (struct VoltOutPara *)
|
||||
|
||||
#define LIMIT \
|
||||
uint16_t _LimitValue \
|
||||
void (*SetLimitValue) (struct limit *, uint16_t); \
|
||||
uint16_t (*GetLimitValue) (struct Limit*)
|
||||
|
||||
|
||||
struct Measure{
|
||||
MEASURE;
|
||||
};
|
||||
@@ -73,6 +79,10 @@ struct Measure{
|
||||
struct VoltOutPara{
|
||||
VOUT_PARA;
|
||||
};
|
||||
|
||||
struct Limit{
|
||||
LIMIT;
|
||||
};
|
||||
/***** End of Measure and VoltOut parameter *****/
|
||||
|
||||
|
||||
@@ -164,6 +174,16 @@ static uint16_t _GetCycleNumber(struct VoltOutPara *self){
|
||||
return self->_CycleNumber;
|
||||
}
|
||||
|
||||
/**** Limit Mode ****/
|
||||
//LimitValue
|
||||
static void _SetLimitValue(struct limit *self, uint16_t LimitValue){
|
||||
self->_LimitValue = LimitValue;
|
||||
}
|
||||
static uint16_t _GetLimitValue(struct limit *self){
|
||||
return self->_LimitValue;
|
||||
}
|
||||
|
||||
|
||||
/* VoltOut Mode Data */
|
||||
typedef struct _VoltOutMode{
|
||||
VOUT_PARA;
|
||||
@@ -201,6 +221,7 @@ static VoltOutMode *InitVoltOutMode(){
|
||||
typedef struct _IVMode{
|
||||
MEASURE;
|
||||
VOUT_PARA;
|
||||
LIMIT;
|
||||
}IVMode;
|
||||
|
||||
static IVMode *InitIVMode(){
|
||||
@@ -228,6 +249,11 @@ static IVMode *InitIVMode(){
|
||||
ret->GetStepTime = &_GetStepTime;
|
||||
ret->SetCycleNumber = &_SetCycleNumber;
|
||||
ret->GetCycleNumber = &_GetCycleNumber;
|
||||
|
||||
ret->_LimitValue = 0;
|
||||
|
||||
ret->SetLimitValue = &_SetLimitValue;
|
||||
ret->GetLimitValue = &_GetLimitValue;
|
||||
return ret;
|
||||
}
|
||||
/* End of IV Mode Data */
|
||||
|
||||
Reference in New Issue
Block a user