Each LPC1768 is capable of controlling 2 CAN bus lines. Linking multiple chips together via SPI allows for more bus lines to be monitored simultaneously. Slave unit.

Dependencies:   mbed-rtos mbed

Committer:
ggudgel
Date:
Fri Oct 31 22:14:03 2014 +0000
Revision:
0:a46303f3277c
First working revision. Test functionality of one mbed system controlling another through SPI, while utilizing CAN bus lines.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ggudgel 0:a46303f3277c 1 #ifndef _spiSlave_included_
ggudgel 0:a46303f3277c 2 #define _spiSlave_included_
ggudgel 0:a46303f3277c 3 #include "mbed.h"
ggudgel 0:a46303f3277c 4
ggudgel 0:a46303f3277c 5 class spiSlaveProtocol
ggudgel 0:a46303f3277c 6 {
ggudgel 0:a46303f3277c 7 public:
ggudgel 0:a46303f3277c 8 spiSlaveProtocol(Serial*);
ggudgel 0:a46303f3277c 9 void run(void);
ggudgel 0:a46303f3277c 10
ggudgel 0:a46303f3277c 11 private:
ggudgel 0:a46303f3277c 12 SPISlave* spiLine;
ggudgel 0:a46303f3277c 13 int state;
ggudgel 0:a46303f3277c 14 int commandBytes;
ggudgel 0:a46303f3277c 15 Serial* pc;
ggudgel 0:a46303f3277c 16 Timer* timout;
ggudgel 0:a46303f3277c 17
ggudgel 0:a46303f3277c 18 };
ggudgel 0:a46303f3277c 19 #endif