optical/NxFuncs/controlbus/extiocontrol.c

49 lines
593 B
C
Raw Permalink Normal View History

2025-09-04 01:45:08 +00:00
#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