//------------------------------------------------------------------------------- // File Name: SewHeadControl.c // Brief: // Version: 1.0.0 // Create Date: 2017/05/08 // Create by: Marshal Lee // Copyright: // Copyright (c) 2017, GetonAgain Co., LTD. // All rights reserved. // // Modify by: Marshal Lee // Modify Date: 2017/05/08 //------------------------------------------------------------------------------- #include "sewhdcontrol.h" #if (CONTROL_BUS == COMM_CAN) void InitSewHeadControl(SewHeadControl * pCtrl) { if (pCtrl != NULL) { memset(pCtrl, 0, sizeof(SewHeadControl)); } } void SendSewHeadCommand(SewHeadControl * pCtrl, SewHeadCommand * pCmd) { if (pCtrl != NULL && pCmd != NULL) { memcpy(pCtrl->ctrlCmd.cancomm.data.buff, pCmd->buff, CAN_DATA_LEN); pCtrl->cmdFlag = 1; } } void RequestSewHeadStatus(SewHeadControl * pCtrl) { if (pCtrl != NULL) { pCtrl->refSta = 1; } } void RequestSewHeadVersion(SewHeadControl * pCtrl) { if (pCtrl != NULL) { pCtrl->refVer = 1; } } void RequestSewHeadNvPara(SewHeadControl * pCtrl) { if (pCtrl != NULL) { pCtrl->refNvPara = 1; } } #endif