Patent ID: 9524258
Filing Date: 2016-12-20
CPC Classification: G06F,H04Q

Claim Text:
1. A method for controlling multiple Controller Area Network (CAN) interfaces through a single Serial Peripheral Interface (SPI) bus, comprising a storing process and a reading process, wherein, the storing process comprises: a step A for, when a reception mailbox of any of a plurality of CAN chips finishes receiving data on a CAN bus, triggering an interrupt by the CAN chip to deliver an interrupt signal; a step B for configuring, by a Micro Controller Unit (MCU) through the bus, the CAN chip triggering the interrupt to disable interrupts in the CAN chip, so that the CAN chip exits the interrupt; and a step C for inquiring, by the MCU, the data received by the reception mailbox of each CAN chip triggering the interrupt, reading the data into a memory buffer of the MCU through the SPI bus, setting a data identifier in the memory buffer of the MCU, and enabling interrupts in the CAN chip triggering the interrupt to allow the CAN chip triggering the interrupt to continue receiving data; the reading process comprises: a step D for detecting whether the data identifier is present in the memory buffer of the MCU by an application program on the MCU, and copying the data from the memory buffer of the MCU to a memory buffer of the application program if the data identifier is present in the memory buffer of the MCU; otherwise, returning a result as a failure.