optical/NxFuncs/controlbus/colorcontrol.c

49 lines
686 B
C
Raw Normal View History

2025-09-04 01:45:08 +00:00
#include "colorcontrol.h"
#if (CONTROL_BUS == COMM_CAN)
void InitColorControl(ColorControl * pCtrl)
{
if (pCtrl != NULL)
{
memset(pCtrl, 0, sizeof(ColorControl));
}
}
void SendColorCommand(ColorControl * pCtrl, ColorCommand * pCmd)
{
if (pCtrl != NULL && pCmd != NULL)
{
memcpy(pCtrl->ctrlCmd.cancomm.data.buff, pCmd->buff, CAN_DATA_LEN);
pCtrl->cmdFlag = 1;
}
}
void RequestColorStatus(ColorControl * pCtrl)
{
if (pCtrl != NULL)
{
pCtrl->refSta = 1;
}
}
void RequestColorVersion(ColorControl * pCtrl)
{
if (pCtrl != NULL)
{
pCtrl->refVer = 1;
}
}
void RequestColorNvPara(ColorControl * pCtrl)
{
if (pCtrl != NULL)
{
pCtrl->refNvPara = 1;
}
}
#endif