Lines Matching refs:LSSmaster
78 CO_LSSmaster_t *LSSmaster; in CO_LSSmaster_receive() local
80 …LSSmaster = (CO_LSSmaster_t*)object; /* this is the correct pointer type of the first argument */ in CO_LSSmaster_receive()
83 if(msg->DLC==8 && !IS_CANrxNew(LSSmaster->CANrxNew) && in CO_LSSmaster_receive()
84 LSSmaster->command!=CO_LSSmaster_COMMAND_WAITING){ in CO_LSSmaster_receive()
87 LSSmaster->CANrxData[0] = msg->data[0]; in CO_LSSmaster_receive()
88 LSSmaster->CANrxData[1] = msg->data[1]; in CO_LSSmaster_receive()
89 LSSmaster->CANrxData[2] = msg->data[2]; in CO_LSSmaster_receive()
90 LSSmaster->CANrxData[3] = msg->data[3]; in CO_LSSmaster_receive()
91 LSSmaster->CANrxData[4] = msg->data[4]; in CO_LSSmaster_receive()
92 LSSmaster->CANrxData[5] = msg->data[5]; in CO_LSSmaster_receive()
93 LSSmaster->CANrxData[6] = msg->data[6]; in CO_LSSmaster_receive()
94 LSSmaster->CANrxData[7] = msg->data[7]; in CO_LSSmaster_receive()
96 SET_CANrxNew(LSSmaster->CANrxNew); in CO_LSSmaster_receive()
99 if(LSSmaster->pFunctSignal != NULL) { in CO_LSSmaster_receive()
100 LSSmaster->pFunctSignal(LSSmaster->functSignalObject); in CO_LSSmaster_receive()
113 CO_LSSmaster_t *LSSmaster, in CO_LSSmaster_check_timeout() argument
118 LSSmaster->timeoutTimer += timeDifference_ms; in CO_LSSmaster_check_timeout()
119 if (LSSmaster->timeoutTimer >= LSSmaster->timeout) { in CO_LSSmaster_check_timeout()
120 LSSmaster->timeoutTimer = 0; in CO_LSSmaster_check_timeout()
130 CO_LSSmaster_t *LSSmaster, in CO_LSSmaster_init() argument
140 if (LSSmaster==NULL || CANdevRx==NULL || CANdevTx==NULL){ in CO_LSSmaster_init()
144 LSSmaster->timeout = timeout_ms; in CO_LSSmaster_init()
145 LSSmaster->state = CO_LSSmaster_STATE_WAITING; in CO_LSSmaster_init()
146 LSSmaster->command = CO_LSSmaster_COMMAND_WAITING; in CO_LSSmaster_init()
147 LSSmaster->timeoutTimer = 0; in CO_LSSmaster_init()
148 CLEAR_CANrxNew(LSSmaster->CANrxNew); in CO_LSSmaster_init()
149 CO_memset(LSSmaster->CANrxData, 0, sizeof(LSSmaster->CANrxData)); in CO_LSSmaster_init()
150 LSSmaster->pFunctSignal = NULL; in CO_LSSmaster_init()
151 LSSmaster->functSignalObject = NULL; in CO_LSSmaster_init()
160 (void*)LSSmaster, /* object passed to receive function */ in CO_LSSmaster_init()
164 LSSmaster->CANdevTx = CANdevTx; in CO_LSSmaster_init()
165 LSSmaster->TXbuff = CO_CANtxBufferInit( in CO_LSSmaster_init()
179 CO_LSSmaster_t *LSSmaster, in CO_LSSmaster_changeTimeout() argument
182 if (LSSmaster != NULL) { in CO_LSSmaster_changeTimeout()
183 LSSmaster->timeout = timeout_ms; in CO_LSSmaster_changeTimeout()
190 CO_LSSmaster_t *LSSmaster, in CO_LSSmaster_initCallback() argument
194 if(LSSmaster != NULL){ in CO_LSSmaster_initCallback()
195 LSSmaster->functSignalObject = object; in CO_LSSmaster_initCallback()
196 LSSmaster->pFunctSignal = pFunctSignal; in CO_LSSmaster_initCallback()
204 CO_LSSmaster_t *LSSmaster, in CO_LSSmaster_switchStateSelectInitiate() argument
211 LSSmaster->state = CO_LSSmaster_STATE_CFG_SLECTIVE; in CO_LSSmaster_switchStateSelectInitiate()
212 LSSmaster->command = CO_LSSmaster_COMMAND_SWITCH_STATE; in CO_LSSmaster_switchStateSelectInitiate()
213 LSSmaster->timeoutTimer = 0; in CO_LSSmaster_switchStateSelectInitiate()
215 CLEAR_CANrxNew(LSSmaster->CANrxNew); in CO_LSSmaster_switchStateSelectInitiate()
216 CO_memset(&LSSmaster->TXbuff->data[6], 0, 2); in CO_LSSmaster_switchStateSelectInitiate()
217 LSSmaster->TXbuff->data[0] = CO_LSS_SWITCH_STATE_SEL_VENDOR; in CO_LSSmaster_switchStateSelectInitiate()
218 CO_setUint32(&LSSmaster->TXbuff->data[1], lssAddress->identity.vendorID); in CO_LSSmaster_switchStateSelectInitiate()
219 CO_CANsend(LSSmaster->CANdevTx, LSSmaster->TXbuff); in CO_LSSmaster_switchStateSelectInitiate()
220 LSSmaster->TXbuff->data[0] = CO_LSS_SWITCH_STATE_SEL_PRODUCT; in CO_LSSmaster_switchStateSelectInitiate()
221 CO_setUint32(&LSSmaster->TXbuff->data[1], lssAddress->identity.productCode); in CO_LSSmaster_switchStateSelectInitiate()
222 CO_CANsend(LSSmaster->CANdevTx, LSSmaster->TXbuff); in CO_LSSmaster_switchStateSelectInitiate()
223 LSSmaster->TXbuff->data[0] = CO_LSS_SWITCH_STATE_SEL_REV; in CO_LSSmaster_switchStateSelectInitiate()
224 CO_setUint32(&LSSmaster->TXbuff->data[1], lssAddress->identity.revisionNumber); in CO_LSSmaster_switchStateSelectInitiate()
225 CO_CANsend(LSSmaster->CANdevTx, LSSmaster->TXbuff); in CO_LSSmaster_switchStateSelectInitiate()
226 LSSmaster->TXbuff->data[0] = CO_LSS_SWITCH_STATE_SEL_SERIAL; in CO_LSSmaster_switchStateSelectInitiate()
227 CO_setUint32(&LSSmaster->TXbuff->data[1], lssAddress->identity.serialNumber); in CO_LSSmaster_switchStateSelectInitiate()
228 CO_CANsend(LSSmaster->CANdevTx, LSSmaster->TXbuff); in CO_LSSmaster_switchStateSelectInitiate()
234 LSSmaster->state = CO_LSSmaster_STATE_CFG_GLOBAL; in CO_LSSmaster_switchStateSelectInitiate()
236 CLEAR_CANrxNew(LSSmaster->CANrxNew); in CO_LSSmaster_switchStateSelectInitiate()
237 LSSmaster->TXbuff->data[0] = CO_LSS_SWITCH_STATE_GLOBAL; in CO_LSSmaster_switchStateSelectInitiate()
238 LSSmaster->TXbuff->data[1] = CO_LSS_STATE_CONFIGURATION; in CO_LSSmaster_switchStateSelectInitiate()
239 CO_memset(&LSSmaster->TXbuff->data[2], 0, 6); in CO_LSSmaster_switchStateSelectInitiate()
240 CO_CANsend(LSSmaster->CANdevTx, LSSmaster->TXbuff); in CO_LSSmaster_switchStateSelectInitiate()
252 CO_LSSmaster_t *LSSmaster, in CO_LSSmaster_switchStateSelectWait() argument
257 if (IS_CANrxNew(LSSmaster->CANrxNew)) { in CO_LSSmaster_switchStateSelectWait()
258 uint8_t cs = LSSmaster->CANrxData[0]; in CO_LSSmaster_switchStateSelectWait()
259 CLEAR_CANrxNew(LSSmaster->CANrxNew); in CO_LSSmaster_switchStateSelectWait()
266 ret = CO_LSSmaster_check_timeout(LSSmaster, timeDifference_ms); in CO_LSSmaster_switchStateSelectWait()
270 ret = CO_LSSmaster_check_timeout(LSSmaster, timeDifference_ms); in CO_LSSmaster_switchStateSelectWait()
278 CO_LSSmaster_t *LSSmaster, in CO_LSSmaster_switchStateSelect() argument
284 if (LSSmaster == NULL){ in CO_LSSmaster_switchStateSelect()
289 if (LSSmaster->state==CO_LSSmaster_STATE_WAITING && in CO_LSSmaster_switchStateSelect()
290 LSSmaster->command==CO_LSSmaster_COMMAND_WAITING){ in CO_LSSmaster_switchStateSelect()
292 ret = CO_LSSmaster_switchStateSelectInitiate(LSSmaster, lssAddress); in CO_LSSmaster_switchStateSelect()
295 else if (LSSmaster->command == CO_LSSmaster_COMMAND_SWITCH_STATE) { in CO_LSSmaster_switchStateSelect()
296 ret = CO_LSSmaster_switchStateSelectWait(LSSmaster, timeDifference_ms); in CO_LSSmaster_switchStateSelect()
301 LSSmaster->command = CO_LSSmaster_COMMAND_WAITING; in CO_LSSmaster_switchStateSelect()
305 LSSmaster->state=CO_LSSmaster_STATE_WAITING; in CO_LSSmaster_switchStateSelect()
306 LSSmaster->command = CO_LSSmaster_COMMAND_WAITING; in CO_LSSmaster_switchStateSelect()
314 CO_LSSmaster_t *LSSmaster) in CO_LSSmaster_switchStateDeselect() argument
318 if (LSSmaster == NULL){ in CO_LSSmaster_switchStateDeselect()
324 LSSmaster->state = CO_LSSmaster_STATE_WAITING; in CO_LSSmaster_switchStateDeselect()
325 LSSmaster->command = CO_LSSmaster_COMMAND_WAITING; in CO_LSSmaster_switchStateDeselect()
326 LSSmaster->timeoutTimer = 0; in CO_LSSmaster_switchStateDeselect()
329 CLEAR_CANrxNew(LSSmaster->CANrxNew); in CO_LSSmaster_switchStateDeselect()
330 LSSmaster->TXbuff->data[0] = CO_LSS_SWITCH_STATE_GLOBAL; in CO_LSSmaster_switchStateDeselect()
331 LSSmaster->TXbuff->data[1] = CO_LSS_STATE_WAITING; in CO_LSSmaster_switchStateDeselect()
332 CO_memset(&LSSmaster->TXbuff->data[2], 0, 6); in CO_LSSmaster_switchStateDeselect()
333 CO_CANsend(LSSmaster->CANdevTx, LSSmaster->TXbuff); in CO_LSSmaster_switchStateDeselect()
361 CO_LSSmaster_t *LSSmaster, in CO_LSSmaster_configureCheckWait() argument
367 if (IS_CANrxNew(LSSmaster->CANrxNew)) { in CO_LSSmaster_configureCheckWait()
368 uint8_t cs = LSSmaster->CANrxData[0]; in CO_LSSmaster_configureCheckWait()
369 uint8_t errorCode = LSSmaster->CANrxData[1]; in CO_LSSmaster_configureCheckWait()
370 CLEAR_CANrxNew(LSSmaster->CANrxNew); in CO_LSSmaster_configureCheckWait()
384 ret = CO_LSSmaster_check_timeout(LSSmaster, timeDifference_ms); in CO_LSSmaster_configureCheckWait()
388 ret = CO_LSSmaster_check_timeout(LSSmaster, timeDifference_ms); in CO_LSSmaster_configureCheckWait()
393 LSSmaster->command = CO_LSSmaster_COMMAND_WAITING; in CO_LSSmaster_configureCheckWait()
401 CO_LSSmaster_t *LSSmaster, in CO_LSSmaster_configureBitTiming() argument
408 if (LSSmaster == NULL){ in CO_LSSmaster_configureBitTiming()
426 if (LSSmaster->state==CO_LSSmaster_STATE_CFG_SLECTIVE && in CO_LSSmaster_configureBitTiming()
427 LSSmaster->command==CO_LSSmaster_COMMAND_WAITING){ in CO_LSSmaster_configureBitTiming()
429 LSSmaster->command = CO_LSSmaster_COMMAND_CFG_BIT_TIMING; in CO_LSSmaster_configureBitTiming()
430 LSSmaster->timeoutTimer = 0; in CO_LSSmaster_configureBitTiming()
432 CLEAR_CANrxNew(LSSmaster->CANrxNew); in CO_LSSmaster_configureBitTiming()
433 LSSmaster->TXbuff->data[0] = CO_LSS_CFG_BIT_TIMING; in CO_LSSmaster_configureBitTiming()
434 LSSmaster->TXbuff->data[1] = 0; in CO_LSSmaster_configureBitTiming()
435 LSSmaster->TXbuff->data[2] = bitTiming; in CO_LSSmaster_configureBitTiming()
436 CO_memset(&LSSmaster->TXbuff->data[3], 0, 5); in CO_LSSmaster_configureBitTiming()
437 CO_CANsend(LSSmaster->CANdevTx, LSSmaster->TXbuff); in CO_LSSmaster_configureBitTiming()
442 else if (LSSmaster->command == CO_LSSmaster_COMMAND_CFG_BIT_TIMING) { in CO_LSSmaster_configureBitTiming()
444 ret = CO_LSSmaster_configureCheckWait(LSSmaster, timeDifference_ms, in CO_LSSmaster_configureBitTiming()
450 LSSmaster->command = CO_LSSmaster_COMMAND_WAITING; in CO_LSSmaster_configureBitTiming()
458 CO_LSSmaster_t *LSSmaster, in CO_LSSmaster_configureNodeId() argument
464 if (LSSmaster==NULL || !CO_LSS_NODE_ID_VALID(nodeId)){ in CO_LSSmaster_configureNodeId()
469 if ((LSSmaster->state==CO_LSSmaster_STATE_CFG_SLECTIVE || in CO_LSSmaster_configureNodeId()
471 (LSSmaster->state==CO_LSSmaster_STATE_CFG_GLOBAL && in CO_LSSmaster_configureNodeId()
473 LSSmaster->command==CO_LSSmaster_COMMAND_WAITING) { in CO_LSSmaster_configureNodeId()
475 LSSmaster->command = CO_LSSmaster_COMMAND_CFG_NODE_ID; in CO_LSSmaster_configureNodeId()
476 LSSmaster->timeoutTimer = 0; in CO_LSSmaster_configureNodeId()
478 CLEAR_CANrxNew(LSSmaster->CANrxNew); in CO_LSSmaster_configureNodeId()
479 LSSmaster->TXbuff->data[0] = CO_LSS_CFG_NODE_ID; in CO_LSSmaster_configureNodeId()
480 LSSmaster->TXbuff->data[1] = nodeId; in CO_LSSmaster_configureNodeId()
481 CO_memset(&LSSmaster->TXbuff->data[2], 0, 6); in CO_LSSmaster_configureNodeId()
482 CO_CANsend(LSSmaster->CANdevTx, LSSmaster->TXbuff); in CO_LSSmaster_configureNodeId()
487 else if (LSSmaster->command == CO_LSSmaster_COMMAND_CFG_NODE_ID) { in CO_LSSmaster_configureNodeId()
489 ret = CO_LSSmaster_configureCheckWait(LSSmaster, timeDifference_ms, in CO_LSSmaster_configureNodeId()
495 LSSmaster->command = CO_LSSmaster_COMMAND_WAITING; in CO_LSSmaster_configureNodeId()
503 CO_LSSmaster_t *LSSmaster, in CO_LSSmaster_configureStore() argument
508 if (LSSmaster == NULL){ in CO_LSSmaster_configureStore()
513 if (LSSmaster->state==CO_LSSmaster_STATE_CFG_SLECTIVE && in CO_LSSmaster_configureStore()
514 LSSmaster->command==CO_LSSmaster_COMMAND_WAITING){ in CO_LSSmaster_configureStore()
516 LSSmaster->command = CO_LSSmaster_COMMAND_CFG_STORE; in CO_LSSmaster_configureStore()
517 LSSmaster->timeoutTimer = 0; in CO_LSSmaster_configureStore()
519 CLEAR_CANrxNew(LSSmaster->CANrxNew); in CO_LSSmaster_configureStore()
520 LSSmaster->TXbuff->data[0] = CO_LSS_CFG_STORE; in CO_LSSmaster_configureStore()
521 CO_memset(&LSSmaster->TXbuff->data[1], 0, 7); in CO_LSSmaster_configureStore()
522 CO_CANsend(LSSmaster->CANdevTx, LSSmaster->TXbuff); in CO_LSSmaster_configureStore()
527 else if (LSSmaster->command == CO_LSSmaster_COMMAND_CFG_STORE) { in CO_LSSmaster_configureStore()
529 ret = CO_LSSmaster_configureCheckWait(LSSmaster, timeDifference_ms, in CO_LSSmaster_configureStore()
535 LSSmaster->command = CO_LSSmaster_COMMAND_WAITING; in CO_LSSmaster_configureStore()
543 CO_LSSmaster_t *LSSmaster, in CO_LSSmaster_ActivateBit() argument
548 if (LSSmaster == NULL){ in CO_LSSmaster_ActivateBit()
554 if (LSSmaster->state==CO_LSSmaster_STATE_CFG_GLOBAL && in CO_LSSmaster_ActivateBit()
555 LSSmaster->command==CO_LSSmaster_COMMAND_WAITING){ in CO_LSSmaster_ActivateBit()
557 CLEAR_CANrxNew(LSSmaster->CANrxNew); in CO_LSSmaster_ActivateBit()
558 LSSmaster->TXbuff->data[0] = CO_LSS_CFG_ACTIVATE_BIT_TIMING; in CO_LSSmaster_ActivateBit()
559 CO_setUint16(&LSSmaster->TXbuff->data[1], switchDelay_ms); in CO_LSSmaster_ActivateBit()
560 CO_memset(&LSSmaster->TXbuff->data[3], 0, 5); in CO_LSSmaster_ActivateBit()
561 CO_CANsend(LSSmaster->CANdevTx, LSSmaster->TXbuff); in CO_LSSmaster_ActivateBit()
574 CO_LSSmaster_t *LSSmaster, in CO_LSSmaster_inquireInitiate() argument
577 CLEAR_CANrxNew(LSSmaster->CANrxNew); in CO_LSSmaster_inquireInitiate()
578 LSSmaster->TXbuff->data[0] = cs; in CO_LSSmaster_inquireInitiate()
579 CO_memset(&LSSmaster->TXbuff->data[1], 0, 7); in CO_LSSmaster_inquireInitiate()
580 CO_CANsend(LSSmaster->CANdevTx, LSSmaster->TXbuff); in CO_LSSmaster_inquireInitiate()
589 CO_LSSmaster_t *LSSmaster, in CO_LSSmaster_inquireCheckWait() argument
596 if (IS_CANrxNew(LSSmaster->CANrxNew)) { in CO_LSSmaster_inquireCheckWait()
597 uint8_t cs = LSSmaster->CANrxData[0]; in CO_LSSmaster_inquireCheckWait()
598 *value = CO_getUint32(&LSSmaster->CANrxData[1]); in CO_LSSmaster_inquireCheckWait()
599 CLEAR_CANrxNew(LSSmaster->CANrxNew); in CO_LSSmaster_inquireCheckWait()
605 ret = CO_LSSmaster_check_timeout(LSSmaster, timeDifference_ms); in CO_LSSmaster_inquireCheckWait()
609 ret = CO_LSSmaster_check_timeout(LSSmaster, timeDifference_ms); in CO_LSSmaster_inquireCheckWait()
617 CO_LSSmaster_t *LSSmaster, in CO_LSSmaster_InquireLssAddress() argument
624 if (LSSmaster==NULL || lssAddress==NULL){ in CO_LSSmaster_InquireLssAddress()
629 if (LSSmaster->command == CO_LSSmaster_COMMAND_INQUIRE_VENDOR) { in CO_LSSmaster_InquireLssAddress()
631 ret = CO_LSSmaster_inquireCheckWait(LSSmaster, timeDifference_ms, in CO_LSSmaster_InquireLssAddress()
639 else if (LSSmaster->command == CO_LSSmaster_COMMAND_INQUIRE_PRODUCT) { in CO_LSSmaster_InquireLssAddress()
641 ret = CO_LSSmaster_inquireCheckWait(LSSmaster, timeDifference_ms, in CO_LSSmaster_InquireLssAddress()
649 else if (LSSmaster->command == CO_LSSmaster_COMMAND_INQUIRE_REV) { in CO_LSSmaster_InquireLssAddress()
651 ret = CO_LSSmaster_inquireCheckWait(LSSmaster, timeDifference_ms, in CO_LSSmaster_InquireLssAddress()
659 else if (LSSmaster->command == CO_LSSmaster_COMMAND_INQUIRE_SERIAL) { in CO_LSSmaster_InquireLssAddress()
661 ret = CO_LSSmaster_inquireCheckWait(LSSmaster, timeDifference_ms, in CO_LSSmaster_InquireLssAddress()
665 if (LSSmaster->state == CO_LSSmaster_STATE_CFG_SLECTIVE || in CO_LSSmaster_InquireLssAddress()
666 LSSmaster->state == CO_LSSmaster_STATE_CFG_GLOBAL) { in CO_LSSmaster_InquireLssAddress()
667 if (LSSmaster->command == CO_LSSmaster_COMMAND_WAITING) { in CO_LSSmaster_InquireLssAddress()
669 LSSmaster->command = CO_LSSmaster_COMMAND_INQUIRE_VENDOR; in CO_LSSmaster_InquireLssAddress()
670 LSSmaster->timeoutTimer = 0; in CO_LSSmaster_InquireLssAddress()
672 ret = CO_LSSmaster_inquireInitiate(LSSmaster, CO_LSS_INQUIRE_VENDOR); in CO_LSSmaster_InquireLssAddress()
675 LSSmaster->command = CO_LSSmaster_COMMAND_INQUIRE_PRODUCT; in CO_LSSmaster_InquireLssAddress()
676 LSSmaster->timeoutTimer = 0; in CO_LSSmaster_InquireLssAddress()
678 ret = CO_LSSmaster_inquireInitiate(LSSmaster, CO_LSS_INQUIRE_PRODUCT); in CO_LSSmaster_InquireLssAddress()
681 LSSmaster->command = CO_LSSmaster_COMMAND_INQUIRE_REV; in CO_LSSmaster_InquireLssAddress()
682 LSSmaster->timeoutTimer = 0; in CO_LSSmaster_InquireLssAddress()
684 ret = CO_LSSmaster_inquireInitiate(LSSmaster, CO_LSS_INQUIRE_REV); in CO_LSSmaster_InquireLssAddress()
687 LSSmaster->command = CO_LSSmaster_COMMAND_INQUIRE_SERIAL; in CO_LSSmaster_InquireLssAddress()
688 LSSmaster->timeoutTimer = 0; in CO_LSSmaster_InquireLssAddress()
690 ret = CO_LSSmaster_inquireInitiate(LSSmaster, CO_LSS_INQUIRE_SERIAL); in CO_LSSmaster_InquireLssAddress()
696 LSSmaster->command = CO_LSSmaster_COMMAND_WAITING; in CO_LSSmaster_InquireLssAddress()
704 CO_LSSmaster_t *LSSmaster, in CO_LSSmaster_InquireNodeId() argument
710 if (LSSmaster==NULL || nodeId==NULL){ in CO_LSSmaster_InquireNodeId()
715 if ((LSSmaster->state==CO_LSSmaster_STATE_CFG_SLECTIVE || in CO_LSSmaster_InquireNodeId()
716 LSSmaster->state==CO_LSSmaster_STATE_CFG_GLOBAL) && in CO_LSSmaster_InquireNodeId()
717 LSSmaster->command == CO_LSSmaster_COMMAND_WAITING) { in CO_LSSmaster_InquireNodeId()
719 LSSmaster->command = CO_LSSmaster_COMMAND_INQUIRE_NODE_ID; in CO_LSSmaster_InquireNodeId()
720 LSSmaster->timeoutTimer = 0; in CO_LSSmaster_InquireNodeId()
722 ret = CO_LSSmaster_inquireInitiate(LSSmaster, CO_LSS_INQUIRE_NODE_ID); in CO_LSSmaster_InquireNodeId()
725 else if (LSSmaster->command == CO_LSSmaster_COMMAND_INQUIRE_NODE_ID) { in CO_LSSmaster_InquireNodeId()
728 ret = CO_LSSmaster_inquireCheckWait(LSSmaster, timeDifference_ms, in CO_LSSmaster_InquireNodeId()
735 LSSmaster->command = CO_LSSmaster_COMMAND_WAITING; in CO_LSSmaster_InquireNodeId()
744 CO_LSSmaster_t *LSSmaster, in CO_LSSmaster_FsSendMsg() argument
750 LSSmaster->timeoutTimer = 0; in CO_LSSmaster_FsSendMsg()
752 CLEAR_CANrxNew(LSSmaster->CANrxNew); in CO_LSSmaster_FsSendMsg()
753 LSSmaster->TXbuff->data[0] = CO_LSS_IDENT_FASTSCAN; in CO_LSSmaster_FsSendMsg()
754 CO_setUint32(&LSSmaster->TXbuff->data[1], idNumber); in CO_LSSmaster_FsSendMsg()
755 LSSmaster->TXbuff->data[5] = bitCheck; in CO_LSSmaster_FsSendMsg()
756 LSSmaster->TXbuff->data[6] = lssSub; in CO_LSSmaster_FsSendMsg()
757 LSSmaster->TXbuff->data[7] = lssNext; in CO_LSSmaster_FsSendMsg()
759 CO_CANsend(LSSmaster->CANdevTx, LSSmaster->TXbuff); in CO_LSSmaster_FsSendMsg()
766 CO_LSSmaster_t *LSSmaster, in CO_LSSmaster_FsCheckWait() argument
771 ret = CO_LSSmaster_check_timeout(LSSmaster, timeDifference_ms); in CO_LSSmaster_FsCheckWait()
775 if (IS_CANrxNew(LSSmaster->CANrxNew)) { in CO_LSSmaster_FsCheckWait()
776 uint8_t cs = LSSmaster->CANrxData[0]; in CO_LSSmaster_FsCheckWait()
777 CLEAR_CANrxNew(LSSmaster->CANrxNew); in CO_LSSmaster_FsCheckWait()
793 CO_LSSmaster_t *LSSmaster, in CO_LSSmaster_FsScanInitiate() argument
798 LSSmaster->fsLssSub = lssSub; in CO_LSSmaster_FsScanInitiate()
799 LSSmaster->fsIdNumber = 0; in CO_LSSmaster_FsScanInitiate()
812 LSSmaster->fsBitChecked = CO_LSS_FASTSCAN_BIT31; in CO_LSSmaster_FsScanInitiate()
815 CO_LSSmaster_FsSendMsg(LSSmaster, LSSmaster->fsIdNumber, in CO_LSSmaster_FsScanInitiate()
816 LSSmaster->fsBitChecked, LSSmaster->fsLssSub, LSSmaster->fsLssSub); in CO_LSSmaster_FsScanInitiate()
825 CO_LSSmaster_t *LSSmaster, in CO_LSSmaster_FsScanWait() argument
842 ret = CO_LSSmaster_check_timeout(LSSmaster, timeDifference_ms); in CO_LSSmaster_FsScanWait()
847 if (IS_CANrxNew(LSSmaster->CANrxNew)) { in CO_LSSmaster_FsScanWait()
848 uint8_t cs = LSSmaster->CANrxData[0]; in CO_LSSmaster_FsScanWait()
849 CLEAR_CANrxNew(LSSmaster->CANrxNew); in CO_LSSmaster_FsScanWait()
858 LSSmaster->fsIdNumber |= 1UL << LSSmaster->fsBitChecked; in CO_LSSmaster_FsScanWait()
861 if (LSSmaster->fsBitChecked == CO_LSS_FASTSCAN_BIT0) { in CO_LSSmaster_FsScanWait()
866 LSSmaster->fsBitChecked --; in CO_LSSmaster_FsScanWait()
868 CO_LSSmaster_FsSendMsg(LSSmaster, in CO_LSSmaster_FsScanWait()
869 LSSmaster->fsIdNumber, LSSmaster->fsBitChecked, in CO_LSSmaster_FsScanWait()
870 LSSmaster->fsLssSub, LSSmaster->fsLssSub); in CO_LSSmaster_FsScanWait()
881 CO_LSSmaster_t *LSSmaster, in CO_LSSmaster_FsVerifyInitiate() argument
893 LSSmaster->fsIdNumber = idNumberCheck; in CO_LSSmaster_FsVerifyInitiate()
900 LSSmaster->fsBitChecked = CO_LSS_FASTSCAN_BIT0; in CO_LSSmaster_FsVerifyInitiate()
903 CO_LSSmaster_FsSendMsg(LSSmaster, LSSmaster->fsIdNumber, in CO_LSSmaster_FsVerifyInitiate()
904 LSSmaster->fsBitChecked, LSSmaster->fsLssSub, lssNext); in CO_LSSmaster_FsVerifyInitiate()
914 CO_LSSmaster_t *LSSmaster, in CO_LSSmaster_FsVerifyWait() argument
925 ret = CO_LSSmaster_check_timeout(LSSmaster, timeDifference_ms); in CO_LSSmaster_FsVerifyWait()
931 if (IS_CANrxNew(LSSmaster->CANrxNew)) { in CO_LSSmaster_FsVerifyWait()
932 uint8_t cs = LSSmaster->CANrxData[0]; in CO_LSSmaster_FsVerifyWait()
933 CLEAR_CANrxNew(LSSmaster->CANrxNew); in CO_LSSmaster_FsVerifyWait()
936 *idNumberRet = LSSmaster->fsIdNumber; in CO_LSSmaster_FsVerifyWait()
951 CO_LSSmaster_t *LSSmaster, in CO_LSSmaster_FsSearchNext() argument
959 for (i = LSSmaster->fsLssSub + 1; i <= CO_LSS_FASTSCAN_SERIAL; i++) { in CO_LSSmaster_FsSearchNext()
971 CO_LSSmaster_t *LSSmaster, in CO_LSSmaster_IdentifyFastscan() argument
981 if (LSSmaster==NULL || fastscan==NULL){ in CO_LSSmaster_IdentifyFastscan()
1000 if (LSSmaster->state!=CO_LSSmaster_STATE_WAITING || in CO_LSSmaster_IdentifyFastscan()
1001 (LSSmaster->command!=CO_LSSmaster_COMMAND_WAITING && in CO_LSSmaster_IdentifyFastscan()
1002 LSSmaster->command!=CO_LSSmaster_COMMAND_IDENTIFY_FASTSCAN)) { in CO_LSSmaster_IdentifyFastscan()
1008 switch (LSSmaster->command) { in CO_LSSmaster_IdentifyFastscan()
1011 LSSmaster->command = CO_LSSmaster_COMMAND_IDENTIFY_FASTSCAN; in CO_LSSmaster_IdentifyFastscan()
1014 LSSmaster->fsState = CO_LSSmaster_FS_STATE_CHECK; in CO_LSSmaster_IdentifyFastscan()
1015 CO_LSSmaster_FsSendMsg(LSSmaster, 0, CO_LSS_FASTSCAN_CONFIRM, 0, 0); in CO_LSSmaster_IdentifyFastscan()
1036 switch (LSSmaster->fsState) { in CO_LSSmaster_IdentifyFastscan()
1038 ret = CO_LSSmaster_FsCheckWait(LSSmaster, timeDifference_ms); in CO_LSSmaster_IdentifyFastscan()
1043 CO_LSSmaster_FsScanInitiate(LSSmaster, timeDifference_ms, in CO_LSSmaster_IdentifyFastscan()
1048 LSSmaster->fsState = CO_LSSmaster_FS_STATE_SCAN; in CO_LSSmaster_IdentifyFastscan()
1052 ret = CO_LSSmaster_FsScanWait(LSSmaster, timeDifference_ms, in CO_LSSmaster_IdentifyFastscan()
1053 fastscan->scan[LSSmaster->fsLssSub]); in CO_LSSmaster_IdentifyFastscan()
1058 next = CO_LSSmaster_FsSearchNext(LSSmaster, fastscan); in CO_LSSmaster_IdentifyFastscan()
1059 ret = CO_LSSmaster_FsVerifyInitiate(LSSmaster, timeDifference_ms, in CO_LSSmaster_IdentifyFastscan()
1060 fastscan->scan[LSSmaster->fsLssSub], in CO_LSSmaster_IdentifyFastscan()
1061 fastscan->match.addr[LSSmaster->fsLssSub], next); in CO_LSSmaster_IdentifyFastscan()
1063 LSSmaster->fsState = CO_LSSmaster_FS_STATE_VERIFY; in CO_LSSmaster_IdentifyFastscan()
1067 ret = CO_LSSmaster_FsVerifyWait(LSSmaster, timeDifference_ms, in CO_LSSmaster_IdentifyFastscan()
1068 fastscan->scan[LSSmaster->fsLssSub], in CO_LSSmaster_IdentifyFastscan()
1069 &fastscan->found.addr[LSSmaster->fsLssSub]); in CO_LSSmaster_IdentifyFastscan()
1075 next = CO_LSSmaster_FsSearchNext(LSSmaster, fastscan); in CO_LSSmaster_IdentifyFastscan()
1079 LSSmaster->state = CO_LSSmaster_STATE_CFG_SLECTIVE; in CO_LSSmaster_IdentifyFastscan()
1083 ret = CO_LSSmaster_FsScanInitiate(LSSmaster, in CO_LSSmaster_IdentifyFastscan()
1091 LSSmaster->fsState = CO_LSSmaster_FS_STATE_SCAN; in CO_LSSmaster_IdentifyFastscan()
1101 LSSmaster->command = CO_LSSmaster_COMMAND_WAITING; in CO_LSSmaster_IdentifyFastscan()