Konacan kod

Dependencies:   BSP_DISCO_F469NIa EEPROM_DISCO_F469NI LCD_DISCO_F469NIa SD_DISCO_F469NI mbed

Fork of IntegrationCAN by Nenad Djalovic

Revision:
2:f54f01527ebb
Parent:
0:38c3afd99aeb
--- a/CAN_library.h	Wed May 16 14:55:13 2018 +0000
+++ b/CAN_library.h	Thu Jun 28 16:33:23 2018 +0000
@@ -1,4 +1,7 @@
 #include "mbed.h"
+#include "SD_DISCO_F469NI.h"
+#include "EEPROM_DISCO_F469NI.h"
+
 
 //CAN Identificators
 #define DTA_1   0x2000
@@ -6,21 +9,27 @@
 #define DTA_3   0x2002
 #define DTA_4   0x2003
 #define DTA_5   0x2004
-#define DTA_6   0x2006
+#define DTA_6   0x2005
 // This IDs can be changed as they are our own IDs
-#define LVDT_FRONT  0x1000
-#define LVDT_REAR   0x1001
-#define BRAKES  0x1002
+#define LVDT_FRONT  0x1006
+#define LVDT_REAR   0x1007
+#define BRAKES  0x1008
+#define DISTANCE 0x0009
 // If we add some other IDs in the vehicle add them here
 
+#define DISTANCE_MEMORY_ADDR        3592960                            //Start address in SD card memory reserved for Distance Statistics.
+
 
 //List of functions
-void CANMsgReceive();                                  // CAN RX Interrupt Function
+
+void CANMsgReceive();                                    // CAN RX Interrupt Function
 
 void UpdateInfo();                                       // Update info for DTA values
 
 uint16_t * AllocData(CANMessage msg);                    // Unpack CAN message 
 
+void InitDistanceMeter(uint16_t newData[4]);             // Initialise Distance Meter
+
 //Update values
 void UpdateInfoDTA1(uint16_t newData[4]);                // Update values for DTA1 message
 void UpdateInfoDTA2(uint16_t newData[4]);                // Update values for DTA2 message
@@ -28,6 +37,8 @@
 void UpdateInfoDTA4(uint16_t newData[4]);                // Update values for DTA4 message
 void UpdateInfoDTA5(uint16_t newData[4]);                // Update values for DTA5 message
 void UpdateInfoDTA6(uint16_t newData[4]);                // Update values for DTA6 message
+void UpdateMeterCounter();
+void send(uint16_t ID, char dta[8]);
 void UpdateInfoLVDTFront(uint16_t newData[4]);           // Update values for LVDTFront message
 void UpdateInfoLVDTRear(uint16_t newData[4]);            // Update values for LVDTRear message
 void UpdateInfoBrakes(uint16_t newData[4]);              // Update values for Brakes message
\ No newline at end of file