test fork

Dependencies:   SPI_TFTx2 SPI_TFTx2_ILI9341 TFT_fonts TOUCH_TFTx2 mbed

Fork of CANary_9341 by Tick Tock

Committer:
TickTock
Date:
Fri Mar 15 04:28:34 2013 +0000
Revision:
25:ddf0ec209f03
Parent:
23:cd03f9c3395e
Child:
29:42d8491ac995
Added date/time entry, fixed braking display, added reset

Who changed what in which revision?

UserRevisionLine numberNew contents of line
TickTock 13:62e0f7f39ff5 1 // utility.h
TickTock 13:62e0f7f39ff5 2
TickTock 12:8e42d7ba8468 3 #include "mbed.h"
TickTock 12:8e42d7ba8468 4 #include "CAN.h"
TickTock 13:62e0f7f39ff5 5 #include "common.h"
TickTock 23:cd03f9c3395e 6 #include "TOUCH_TFTx2.h"
TickTock 12:8e42d7ba8468 7
TickTock 13:62e0f7f39ff5 8 extern Timer timer;
TickTock 13:62e0f7f39ff5 9 extern volatile int secsNoMsg;
TickTock 13:62e0f7f39ff5 10 extern volatile int secsNoTouch;
TickTock 13:62e0f7f39ff5 11 extern volatile bool canIdle;
TickTock 13:62e0f7f39ff5 12 extern volatile bool userIdle;
TickTock 13:62e0f7f39ff5 13 extern char displayLog[20][40];
TickTock 13:62e0f7f39ff5 14 extern unsigned char displayLoc;
TickTock 13:62e0f7f39ff5 15 extern bool touched;
TickTock 13:62e0f7f39ff5 16 extern bool logOpen;
TickTock 13:62e0f7f39ff5 17 extern char writeBuffer[maxBufLen][13];
TickTock 13:62e0f7f39ff5 18 extern volatile int writePointer;
TickTock 13:62e0f7f39ff5 19 extern DigitalOut led1,led2,led3,led4;
TickTock 13:62e0f7f39ff5 20 extern char indexLastMsg[0x800];
TickTock 13:62e0f7f39ff5 21 extern unsigned char dMode[2];
TickTock 13:62e0f7f39ff5 22 extern unsigned char msgChanged[100];
TickTock 13:62e0f7f39ff5 23 extern unsigned char battData[256];
TickTock 13:62e0f7f39ff5 24 extern CANMessage lastMsg[100];
TickTock 13:62e0f7f39ff5 25 extern CAN can1,can2;
TickTock 13:62e0f7f39ff5 26 extern DigitalOut can1SleepMode,can2SleepMode;
TickTock 13:62e0f7f39ff5 27 extern bool pollCP;
TickTock 23:cd03f9c3395e 28 extern TOUCH_TFTx2 tt;
TickTock 12:8e42d7ba8468 29
TickTock 12:8e42d7ba8468 30 extern "C" {
TickTock 12:8e42d7ba8468 31 void mbed_reset();
TickTock 13:62e0f7f39ff5 32 void RTC_IRQHandler();
TickTock 13:62e0f7f39ff5 33 void RTC_Init (void);
TickTock 13:62e0f7f39ff5 34 void logMsg (char *msg);
TickTock 13:62e0f7f39ff5 35 void touch_ISR();
TickTock 13:62e0f7f39ff5 36 unsigned short getTimeStamp();
TickTock 13:62e0f7f39ff5 37 void logCan (char mType, CANMessage canRXmsg);
TickTock 13:62e0f7f39ff5 38 void logTS ();
TickTock 13:62e0f7f39ff5 39 void sendCPreq();
TickTock 13:62e0f7f39ff5 40 void sendTreq();
TickTock 13:62e0f7f39ff5 41 void tickerISR();
TickTock 13:62e0f7f39ff5 42 void recieve1();
TickTock 13:62e0f7f39ff5 43 void recieve2();
TickTock 22:a43df3905863 44 unsigned char buttonX(unsigned short X, unsigned char columns);
TickTock 22:a43df3905863 45 unsigned char buttonY(unsigned short Y,unsigned char rows);
TickTock 23:cd03f9c3395e 46 void saveConfig();
TickTock 25:ddf0ec209f03 47 void readConfig();
TickTock 25:ddf0ec209f03 48 void upDate(unsigned char field, bool updownbar);
TickTock 25:ddf0ec209f03 49 }
TickTock 12:8e42d7ba8468 50
TickTock 12:8e42d7ba8468 51 //LEAF OBD
TickTock 12:8e42d7ba8468 52 //1:
TickTock 12:8e42d7ba8468 53 //2:
TickTock 12:8e42d7ba8468 54 //3: AVCAN-L White/Blue
TickTock 12:8e42d7ba8468 55 //4: VSS-Shield
TickTock 12:8e42d7ba8468 56 //5: VSS Brown,White/Brown
TickTock 12:8e42d7ba8468 57 //6: CARCAN-H Green
TickTock 12:8e42d7ba8468 58 //7:
TickTock 12:8e42d7ba8468 59 //8: 12V-SW Orange,White/Orange
TickTock 12:8e42d7ba8468 60 //9:
TickTock 12:8e42d7ba8468 61 //10:
TickTock 12:8e42d7ba8468 62 //11: AVCAN-H Blue
TickTock 12:8e42d7ba8468 63 //12: EVCAN-L White/Grey
TickTock 12:8e42d7ba8468 64 //13: EVCAN-H Grey
TickTock 12:8e42d7ba8468 65 //14: CARCAN-L White/Green
TickTock 12:8e42d7ba8468 66 //15:
TickTock 12:8e42d7ba8468 67 //16: 12V-AON Red/Blue,Blue/Red
TickTock 12:8e42d7ba8468 68
TickTock 12:8e42d7ba8468 69 //VP230
TickTock 12:8e42d7ba8468 70 //1:D
TickTock 12:8e42d7ba8468 71 //2:GND
TickTock 12:8e42d7ba8468 72 //3:VCC
TickTock 12:8e42d7ba8468 73 //4:R
TickTock 12:8e42d7ba8468 74 //5:Vref
TickTock 12:8e42d7ba8468 75 //6:CANL
TickTock 12:8e42d7ba8468 76 //7:CANH
TickTock 12:8e42d7ba8468 77 //8:RS
TickTock 12:8e42d7ba8468 78
TickTock 12:8e42d7ba8468 79 //LPC1768
TickTock 12:8e42d7ba8468 80 //1: VSS
TickTock 12:8e42d7ba8468 81 //2: NC:VIN (4.5-9V supply)
TickTock 12:8e42d7ba8468 82 //3: NC:VB
TickTock 12:8e42d7ba8468 83 //4: NC:nR
TickTock 22:a43df3905863 84 //5: SPI:Reset
TickTock 22:a43df3905863 85 //6: SPI:CS0
TickTock 22:a43df3905863 86 //7: SPI:CS1
TickTock 12:8e42d7ba8468 87 //8: CAN1:Sleep --> 8:CAN1:RS
TickTock 12:8e42d7ba8468 88 //9: CAN1:RX --> 4:CAN1:R
TickTock 12:8e42d7ba8468 89 //10: CAN1:TX --> 1:CAN1:D
TickTock 12:8e42d7ba8468 90 //11: SPI:MOSI
TickTock 12:8e42d7ba8468 91 //12: SPI:MISO
TickTock 12:8e42d7ba8468 92 //13: SPI:SCLK
TickTock 12:8e42d7ba8468 93 //14: NC:Ain
TickTock 12:8e42d7ba8468 94 //15: MON12V --> 4K to 12V, 1K to VSS (To be implemented)
TickTock 12:8e42d7ba8468 95 //16: TOUCH_X+
TickTock 12:8e42d7ba8468 96 //17: TOUCH_X-
TickTock 12:8e42d7ba8468 97 //18: NC:Aout
TickTock 12:8e42d7ba8468 98 //19: TOUCH_Y+
TickTock 12:8e42d7ba8468 99 //20: TOUCH_Y-
TickTock 12:8e42d7ba8468 100 //21: Spkr+
TickTock 22:a43df3905863 101 //22: NC:pwm
TickTock 22:a43df3905863 102 //23: LED
TickTock 22:a43df3905863 103 //24: NC:pwm
TickTock 12:8e42d7ba8468 104 //25: NC:pwm
TickTock 12:8e42d7ba8468 105 //26: NC:pwm
TickTock 12:8e42d7ba8468 106 //27: NC
TickTock 12:8e42d7ba8468 107 //28: CAN2:Sleep --> 8:CAN2:RS
TickTock 12:8e42d7ba8468 108 //29: CAN2:TX --> 1:CAN2:D
TickTock 12:8e42d7ba8468 109 //30: CAN2:RX --> 4:CAN2:R
TickTock 12:8e42d7ba8468 110 //31: USB_D+
TickTock 12:8e42d7ba8468 111 //32: USB_D-
TickTock 12:8e42d7ba8468 112 //33: NC:Eth_TD+
TickTock 12:8e42d7ba8468 113 //34: NC:Eth_TD-
TickTock 12:8e42d7ba8468 114 //35: NC:Eth_RD+
TickTock 12:8e42d7ba8468 115 //36: NC:Eth_RD-
TickTock 12:8e42d7ba8468 116 //37: NC:IF+
TickTock 12:8e42d7ba8468 117 //38: NC:IF-
TickTock 12:8e42d7ba8468 118 //39: NC:5Vout (only available when connected as USB device)
TickTock 12:8e42d7ba8468 119 //40: VCC3.3