gg
Fork of IntegrationCAN by
CAN_library.h@4:c648a8c57106, 2018-06-17 (annotated)
- Committer:
- formulas
- Date:
- Sun Jun 17 14:59:05 2018 +0000
- Revision:
- 4:c648a8c57106
- Parent:
- 0:38c3afd99aeb
nooooovo
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
formulas | 0:38c3afd99aeb | 1 | #include "mbed.h" |
formulas | 0:38c3afd99aeb | 2 | |
formulas | 0:38c3afd99aeb | 3 | //CAN Identificators |
formulas | 0:38c3afd99aeb | 4 | #define DTA_1 0x2000 |
formulas | 0:38c3afd99aeb | 5 | #define DTA_2 0x2001 |
formulas | 0:38c3afd99aeb | 6 | #define DTA_3 0x2002 |
formulas | 0:38c3afd99aeb | 7 | #define DTA_4 0x2003 |
formulas | 0:38c3afd99aeb | 8 | #define DTA_5 0x2004 |
formulas | 0:38c3afd99aeb | 9 | #define DTA_6 0x2006 |
formulas | 0:38c3afd99aeb | 10 | // This IDs can be changed as they are our own IDs |
formulas | 0:38c3afd99aeb | 11 | #define LVDT_FRONT 0x1000 |
formulas | 0:38c3afd99aeb | 12 | #define LVDT_REAR 0x1001 |
formulas | 0:38c3afd99aeb | 13 | #define BRAKES 0x1002 |
formulas | 0:38c3afd99aeb | 14 | // If we add some other IDs in the vehicle add them here |
formulas | 0:38c3afd99aeb | 15 | |
formulas | 0:38c3afd99aeb | 16 | |
formulas | 0:38c3afd99aeb | 17 | //List of functions |
formulas | 0:38c3afd99aeb | 18 | void CANMsgReceive(); // CAN RX Interrupt Function |
formulas | 0:38c3afd99aeb | 19 | |
formulas | 0:38c3afd99aeb | 20 | void UpdateInfo(); // Update info for DTA values |
formulas | 0:38c3afd99aeb | 21 | |
formulas | 0:38c3afd99aeb | 22 | uint16_t * AllocData(CANMessage msg); // Unpack CAN message |
formulas | 0:38c3afd99aeb | 23 | |
formulas | 0:38c3afd99aeb | 24 | //Update values |
formulas | 0:38c3afd99aeb | 25 | void UpdateInfoDTA1(uint16_t newData[4]); // Update values for DTA1 message |
formulas | 0:38c3afd99aeb | 26 | void UpdateInfoDTA2(uint16_t newData[4]); // Update values for DTA2 message |
formulas | 0:38c3afd99aeb | 27 | void UpdateInfoDTA3(uint16_t newData[4]); // Update values for DTA3 message |
formulas | 0:38c3afd99aeb | 28 | void UpdateInfoDTA4(uint16_t newData[4]); // Update values for DTA4 message |
formulas | 0:38c3afd99aeb | 29 | void UpdateInfoDTA5(uint16_t newData[4]); // Update values for DTA5 message |
formulas | 0:38c3afd99aeb | 30 | void UpdateInfoDTA6(uint16_t newData[4]); // Update values for DTA6 message |
formulas | 0:38c3afd99aeb | 31 | void UpdateInfoLVDTFront(uint16_t newData[4]); // Update values for LVDTFront message |
formulas | 0:38c3afd99aeb | 32 | void UpdateInfoLVDTRear(uint16_t newData[4]); // Update values for LVDTRear message |
formulas | 0:38c3afd99aeb | 33 | void UpdateInfoBrakes(uint16_t newData[4]); // Update values for Brakes message |