15.02.2019. revision
Dependencies: mbed LCD_DISCO_F469NIa SD_DISCO_F469NI BSP_DISCO_F469NIa EEPROM_DISCO_F469NI
CAN_library.h@4:0e8413277df8, 2018-07-07 (annotated)
- Committer:
- formulas
- Date:
- Sat Jul 07 14:42:17 2018 +0000
- Revision:
- 4:0e8413277df8
- Parent:
- 3:a06e417a5a2c
7 jul
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
formulas | 0:38c3afd99aeb | 1 | #include "mbed.h" |
formulas | 2:f54f01527ebb | 2 | #include "SD_DISCO_F469NI.h" |
formulas | 2:f54f01527ebb | 3 | #include "EEPROM_DISCO_F469NI.h" |
formulas | 2:f54f01527ebb | 4 | |
formulas | 0:38c3afd99aeb | 5 | |
formulas | 0:38c3afd99aeb | 6 | //CAN Identificators |
formulas | 0:38c3afd99aeb | 7 | #define DTA_1 0x2000 |
formulas | 0:38c3afd99aeb | 8 | #define DTA_2 0x2001 |
formulas | 0:38c3afd99aeb | 9 | #define DTA_3 0x2002 |
formulas | 0:38c3afd99aeb | 10 | #define DTA_4 0x2003 |
formulas | 0:38c3afd99aeb | 11 | #define DTA_5 0x2004 |
formulas | 2:f54f01527ebb | 12 | #define DTA_6 0x2005 |
formulas | 0:38c3afd99aeb | 13 | // This IDs can be changed as they are our own IDs |
formulas | 2:f54f01527ebb | 14 | #define LVDT_FRONT 0x1006 |
formulas | 2:f54f01527ebb | 15 | #define LVDT_REAR 0x1007 |
formulas | 2:f54f01527ebb | 16 | #define BRAKES 0x1008 |
nemanja1994 | 3:a06e417a5a2c | 17 | #define DISTANCE 0x1009 |
formulas | 0:38c3afd99aeb | 18 | // If we add some other IDs in the vehicle add them here |
formulas | 0:38c3afd99aeb | 19 | |
formulas | 2:f54f01527ebb | 20 | #define DISTANCE_MEMORY_ADDR 3592960 //Start address in SD card memory reserved for Distance Statistics. |
formulas | 2:f54f01527ebb | 21 | |
formulas | 0:38c3afd99aeb | 22 | //List of functions |
formulas | 2:f54f01527ebb | 23 | |
formulas | 2:f54f01527ebb | 24 | void CANMsgReceive(); // CAN RX Interrupt Function |
formulas | 0:38c3afd99aeb | 25 | |
formulas | 0:38c3afd99aeb | 26 | void UpdateInfo(); // Update info for DTA values |
formulas | 0:38c3afd99aeb | 27 | |
formulas | 0:38c3afd99aeb | 28 | uint16_t * AllocData(CANMessage msg); // Unpack CAN message |
formulas | 0:38c3afd99aeb | 29 | |
formulas | 2:f54f01527ebb | 30 | void InitDistanceMeter(uint16_t newData[4]); // Initialise Distance Meter |
formulas | 2:f54f01527ebb | 31 | |
formulas | 0:38c3afd99aeb | 32 | //Update values |
formulas | 0:38c3afd99aeb | 33 | void UpdateInfoDTA1(uint16_t newData[4]); // Update values for DTA1 message |
formulas | 0:38c3afd99aeb | 34 | void UpdateInfoDTA2(uint16_t newData[4]); // Update values for DTA2 message |
formulas | 0:38c3afd99aeb | 35 | void UpdateInfoDTA3(uint16_t newData[4]); // Update values for DTA3 message |
formulas | 0:38c3afd99aeb | 36 | void UpdateInfoDTA4(uint16_t newData[4]); // Update values for DTA4 message |
formulas | 0:38c3afd99aeb | 37 | void UpdateInfoDTA5(uint16_t newData[4]); // Update values for DTA5 message |
formulas | 0:38c3afd99aeb | 38 | void UpdateInfoDTA6(uint16_t newData[4]); // Update values for DTA6 message |
formulas | 4:0e8413277df8 | 39 | //void UpdateMeterCounter(); //U izradi |
formulas | 2:f54f01527ebb | 40 | void send(uint16_t ID, char dta[8]); |
formulas | 0:38c3afd99aeb | 41 | void UpdateInfoLVDTFront(uint16_t newData[4]); // Update values for LVDTFront message |
formulas | 0:38c3afd99aeb | 42 | void UpdateInfoLVDTRear(uint16_t newData[4]); // Update values for LVDTRear message |
formulas | 0:38c3afd99aeb | 43 | void UpdateInfoBrakes(uint16_t newData[4]); // Update values for Brakes message |