System Management code
Dependencies: mbed CANBuffer Watchdog MODSERIAL mbed-rtos xbeeRelay IAP
Fork of SystemManagement by
Libs/xbeeRelay/XbeeRelay.h@31:7eaa5e881b56, 2014-11-14 (annotated)
- Committer:
- pspatel321
- Date:
- Fri Nov 14 06:05:59 2014 +0000
- Revision:
- 31:7eaa5e881b56
- Child:
- 33:6bc82b6b62e5
Mostly working. Wrote CAN in/out code. Xbee still needs work. My guess is that MODDMA breaks when used with RTOS.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pspatel321 | 31:7eaa5e881b56 | 1 | #ifndef XBEERELAY |
pspatel321 | 31:7eaa5e881b56 | 2 | |
pspatel321 | 31:7eaa5e881b56 | 3 | #define XBEERELAY |
pspatel321 | 31:7eaa5e881b56 | 4 | |
pspatel321 | 31:7eaa5e881b56 | 5 | #include "mbed.h" |
pspatel321 | 31:7eaa5e881b56 | 6 | #include "MODDMA.h" |
pspatel321 | 31:7eaa5e881b56 | 7 | #include "MODSERIAL.h" |
pspatel321 | 31:7eaa5e881b56 | 8 | #include "PERMessage.h" |
pspatel321 | 31:7eaa5e881b56 | 9 | |
pspatel321 | 31:7eaa5e881b56 | 10 | |
pspatel321 | 31:7eaa5e881b56 | 11 | class XbeeRelay { |
pspatel321 | 31:7eaa5e881b56 | 12 | |
pspatel321 | 31:7eaa5e881b56 | 13 | public: |
pspatel321 | 31:7eaa5e881b56 | 14 | XbeeRelay (); |
pspatel321 | 31:7eaa5e881b56 | 15 | // returns TRUE on successful send, FALSE otherwise |
pspatel321 | 31:7eaa5e881b56 | 16 | bool receive(CANMessage /* cm */); |
pspatel321 | 31:7eaa5e881b56 | 17 | |
pspatel321 | 31:7eaa5e881b56 | 18 | |
pspatel321 | 31:7eaa5e881b56 | 19 | private: |
pspatel321 | 31:7eaa5e881b56 | 20 | void parse(void /* cm */); |
pspatel321 | 31:7eaa5e881b56 | 21 | void parseMotorCon(void); |
pspatel321 | 31:7eaa5e881b56 | 22 | void parseNormal(void /* deviceID */); |
pspatel321 | 31:7eaa5e881b56 | 23 | bool send(void /*pm*/); |
pspatel321 | 31:7eaa5e881b56 | 24 | char dataLength (char /*contentID*/); |
pspatel321 | 31:7eaa5e881b56 | 25 | MODSERIAL Xbee_e1; |
pspatel321 | 31:7eaa5e881b56 | 26 | MODSERIAL Xbee_e2; |
pspatel321 | 31:7eaa5e881b56 | 27 | unsigned int counter; |
pspatel321 | 31:7eaa5e881b56 | 28 | MODDMA dma; |
pspatel321 | 31:7eaa5e881b56 | 29 | CANMessage cm; |
pspatel321 | 31:7eaa5e881b56 | 30 | PERMessage pm; |
pspatel321 | 31:7eaa5e881b56 | 31 | }; |
pspatel321 | 31:7eaa5e881b56 | 32 | |
pspatel321 | 31:7eaa5e881b56 | 33 | #endif |