Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: DHT11 LPS22HB LSM6DSL VL53L0X
CANbus.h
00001 #ifndef CANBUS_H 00002 #define CANBUS_H 00003 00004 #include "mbed.h" 00005 00006 /* Variables for collecting values */ 00007 int battery_current, battery_voltage, Bat_SOC, speed, motorTemperature; 00008 00009 /* Configure CAN pins */ 00010 CAN can(D15, D14); 00011 00012 /* Functions */ 00013 struct VMS_Msg1 data_pack(int* data); 00014 void data_parse(struct VMS_Msg1 packed_data); 00015 00016 #pragma pack(push, 1) 00017 struct VMS_Msg1{ 00018 int battery_current:16; 00019 int battery_voltage:8; 00020 int Bat_SOC:8; 00021 int speed:8; 00022 int motorTemperature:8; 00023 int Gear:2; 00024 int KeyLocation:2; 00025 int downrating:1; 00026 int AirCondEnable:1; 00027 int PEPScert:2; 00028 int ReadySignal:8; 00029 }VMS_Msg1; 00030 #pragma pack(pop) 00031 00032 00033 #endif
Generated on Thu Jul 14 2022 07:12:42 by
1.7.2