49 lines
593 B
C
49 lines
593 B
C
|
|
#include "extiocontrol.h"
|
|
|
|
#if (CONTROL_BUS == COMM_CAN)
|
|
|
|
|
|
void InitExtIOControl(ExtIOControl * pCtrl)
|
|
{
|
|
if (pCtrl != NULL)
|
|
{
|
|
memset(pCtrl, 0, sizeof(ExtIOControl));
|
|
}
|
|
}
|
|
|
|
void SendExtIOCommand(ExtIOControl * pCtrl, ExtIOCommand * pCmd)
|
|
{
|
|
if (pCtrl != NULL && pCmd != NULL)
|
|
{
|
|
memcpy(pCtrl->ctrlCmd.cancomm.data.buff, pCmd->buff, CAN_DATA_LEN);
|
|
pCtrl->cmdFlag = 1;
|
|
}
|
|
}
|
|
|
|
void RequestExtIOStatus(ExtIOControl * pCtrl)
|
|
{
|
|
if (pCtrl != NULL)
|
|
{
|
|
pCtrl->refSta = 1;
|
|
}
|
|
}
|
|
|
|
|
|
void RequestExtIOVersion(ExtIOControl * pCtrl)
|
|
{
|
|
if (pCtrl != NULL)
|
|
{
|
|
pCtrl->refVer = 1;
|
|
}
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|