MCPcopy Create free account
hub / github.com/Seeed-Studio/Seeed_Arduino_CAN / mcp2518fd_ModuleEventTxCodeGet

Method mcp2518fd_ModuleEventTxCodeGet

src/mcp2518fd_can.cpp:1617–1640  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1615}
1616
1617int8_t mcp2518fd::mcp2518fd_ModuleEventTxCodeGet(CAN_TXCODE *txCode) {
1618 int8_t spiTransferError = 0;
1619 uint16_t a = 0;
1620 uint8_t txCodeByte = 0;
1621
1622 // Read
1623 a = cREGADDR_CiVEC + 2;
1624
1625 spiTransferError = mcp2518fd_ReadByte(a, &txCodeByte);
1626 if (spiTransferError) {
1627 return -1;
1628 }
1629
1630 // Decode data
1631 // 0x40 = "no interrupt" (CAN_FIFO_CIVEC_NOINTERRUPT)
1632 if ((txCodeByte < CAN_TXCODE_TOTAL_CHANNELS) ||
1633 (txCodeByte == CAN_TXCODE_NO_INT)) {
1634 *txCode = (CAN_TXCODE)txCodeByte;
1635 } else {
1636 *txCode = CAN_TXCODE_RESERVED; // shouldn't get here
1637 }
1638
1639 return spiTransferError;
1640}
1641
1642int8_t mcp2518fd::mcp2518fd_TransmitChannelEventAttemptClear(CAN_FIFO_CHANNEL channel)
1643{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected