Other Parts Discussed in Thread: C2000WARE
请问,当作为主机时,请求从机数据的指令值什么或者设置是什么?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
是LINID。我们在上面提供给您的LIN例程中,演示了如何写入LINID寄存器,以及如何配置RXIDMASK/TXIDMASK:
// // LIN MASK Configuration 2 // LinaRegs.LINMASK.bit.RXIDMASK = RXID_MASK; // 0xA LinaRegs.LINMASK.bit.TXIDMASK = TXID_MASK; // 0xA // // Initialize the Slave LINIDNUM register // LinaRegs.LINID.bit.IDSLAVETASKBYTE = LINIDNUM_Slave; // 0x30 // // Release SCI from software reset state - End of Config // LinaRegs.SCIGCR1.bit.SWnRST = 1; // // LIN Response Length // LinaRegs.SCIFORMAT.bit.LENGTH = RESP_LENGTH; for(i=0;i<8;i++) { // // Transmit Data - This populates the LIN transmit // buffers - no data is actually sent yet. // LinaRegs.LINTD0.all = *Tx_DataPtr++; LinaRegs.LINTD1.all = *Tx_DataPtr++; // // Send ID by writing to LINIDNUM register // This causes the ID to be written to the bus. In turn, // this causes both TX and RX ID matches in the slave task // to occur - causing the data in the transmit buffers to // be placed on the bus and also read into the receive buffers // LinaRegs.LINID.bit.IDBYTE = LIN_ID; // 0x3A