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: Digital_InOut KS0108 mbed
Steering.h
00001 #ifndef _STEERING_H 00002 #define _STEERING_H 00003 00004 #include "mbed.h" 00005 #include "Digital_InOut.h" 00006 #include "KS0108.h" 00007 00008 #include "Arial12.h" 00009 #include "Arial14.h" 00010 #include "Comic24.h" 00011 #include "vivaldi16.h" 00012 00013 #define SWITCH_ID 410 00014 00015 #define BATTERY_VOLTAGE_ID 0x304 00016 #define BATTERY_POWER_ID 0x306 00017 #define BATTERY_CURRENT_ID 0x305 00018 00019 #define PCM_STATE_ID 20 00020 00021 #define BATTERY_MIN_CELLVOLTAGE_ID 0x301 00022 #define BATTERY_MAX_CELLVOLTAGE_ID 0x300 00023 #define BATTERY_AVG_CELLVOLTAGE_ID 0x302 00024 00025 #define BATTERY_MIN_CELLTEMPERATURE_ID 0x30A 00026 #define BATTERY_MAX_CELLTEMPERATURE_ID 0x309 00027 #define BATTERY_AVG_CELLTEMPERATURE_ID 0x30B 00028 #define AMS_BATTERY_STATE 0x30E // AIRS 7 and 6 // Precharge 3 00029 00030 Serial pc(USBTX,USBRX); 00031 CAN CAN_Steering(p9,p10); 00032 Digital_InOut CAN_Silent(p3_26, 0, output); 00033 00034 KS0108 display(p26, p21, p22, p23, p25, p24, p8, p7, p6, p5, p13, p14, p12, p11); 00035 Ticker call_ledstream; 00036 00037 Digital_InOut l1(p1_28,1,output);// SW2 00038 Digital_InOut l2(p1_26,1,output);// SW4 00039 00040 Digital_InOut l3(p1_24,1,output);// SW6 00041 Digital_InOut l4(p0_24,1,output);// SW8 00042 00043 Digital_InOut u1(p1_14,0,output);// SW9 00044 Digital_InOut u2(p1_9,0,output);// SW11 00045 00046 Digital_InOut u3(p1_4,0,output);// SW13 00047 Digital_InOut u4(p1_0,0,output);// SW15 00048 00049 AnalogOut ledstream(p18); 00050 00051 //SW1 - SW3 00052 Digital_InOut boSW1(p1_29,1,output); 00053 Digital_InOut biSWBR(p1_27,pull_down,input); //BRight 00054 00055 Digital_InOut boSW5(p1_25,1,output); 00056 Digital_InOut biSWBL(p1_22,pull_down,input); //BLeft 00057 00058 //Digital_InOut boSW5(P1_25,1,output); 00059 //Digital_InOut biSW7(P1_22,pull_down,input); 00060 00061 Digital_InOut boSW10(p1_10,1,output); 00062 Digital_InOut biSWTR(p1_8,pull_down,input); //TRight 00063 00064 Digital_InOut boSW14(p1_1,1,output); 00065 Digital_InOut biSWTL(p0_25,pull_down,input); //TLeft 00066 00067 typedef union convert{ 00068 float FLOAT; 00069 char C_FLOAT[4]; 00070 }ftc; 00071 00072 char SwitchName[15][13]={ 00073 "fuse", 00074 "ams", 00075 "imd", 00076 "pcm", 00077 "brkp", 00078 "lft", 00079 "intl", 00080 "brko", 00081 "ckpt", 00082 "rgt", 00083 "hvd", 00084 "tsms" 00085 }; 00086 00087 int SwitchPosition[13][2]={ 00088 {0,16}, //fuse 00089 {25,16}, //ams 00090 {50,16}, //imd 00091 {70,16}, //pcm 00092 {93,16}, //brkp 00093 {117,16}, //lft 00094 {0,32}, //intl 00095 {17,32}, //brko 00096 {42,32}, //ckpt 00097 {65,32}, //rgt 00098 {81,32}, //hvd 00099 {102,32}, //tsm 00100 }; 00101 00102 int maxScreen=5; 00103 int screen; 00104 char drive[4]; 00105 CANMessage Txmsg_Drive(0x601,drive,sizeof(drive)); 00106 #endif /* STEERING_H */
Generated on Fri Aug 5 2022 20:49:36 by
1.7.2