Hello,
I have two Questions:
First one: i'm trying to send can-message with different DLC. I implemented 2 functions to read and to update the DLC.
But i dont know exactly wich CMD i have to use. can someone tells me, how the IF2CMD/IF1CMD-value are built.
2nd question:Ist it possible to make an Unittest with the "Halgogen safeTI Halcogen-CSP" or any other tools my two
implemented functions
void CAN_UpdateDLC (canBASE_t *P_Node, UINT32 P_MessageBox, UINT8 P_Length) { while ((P_Node->IF1STAT & 0x80U) ==0x80U); P_Node->IF1MCTL &=0xFFFFFFF0; // Clear the actual configured length of the messagebox P_Node->IF1MCTL |= (uint32)P_Length; P_Node->IF1CMD = (uint8) 0xF8U; P_Node->IF1NO = (uint8) P_MessageBox; /** - Wait until data are copied into IF1 */ while ((P_Node->IF1STAT & 0x80U) ==0x80U); } UINT8 CAN_GetDLC (canBASE_t *P_Node, UINT32 P_MessageBox) { UINT8 size; while ((P_Node->IF2STAT & 0x80U) ==0x80U) { } P_Node->IF2CMD = 0x20U; /** - Copy data into IF2 */ P_Node->IF2NO = (uint8) P_MessageBox; /** - Wait until data are copied into IF2 */ while ((P_Node->IF2STAT & 0x80U) ==0x80U) { } /* Wait */ size = P_Node->IF2MCTL & 0xFU; return size; }