Attempts to merge SPI_TFT2 & SPI_TFT_ILI9341
Dependencies: SPI_TFTx2 TFT_fonts TOUCH_TFTx2 mbed
Fork of CANary by
utility.h@36:dbd39c315258, 2013-03-23 (annotated)
- Committer:
- TickTock
- Date:
- Sat Mar 23 04:43:45 2013 +0000
- Revision:
- 36:dbd39c315258
- Parent:
- 35:5acbd8a64a89
- Child:
- 37:fea2c1d52c5f
Added playback option
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
TickTock | 13:62e0f7f39ff5 | 1 | // utility.h |
TickTock | 13:62e0f7f39ff5 | 2 | |
TickTock | 29:42d8491ac995 | 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 | 33:a277743ebdeb | 27 | extern bool pollCP; |
TickTock | 34:4751a8259b18 | 28 | extern bool tick; |
TickTock | 34:4751a8259b18 | 29 | extern bool headlights; |
TickTock | 23:cd03f9c3395e | 30 | extern TOUCH_TFTx2 tt; |
TickTock | 35:5acbd8a64a89 | 31 | extern float ledHi; |
TickTock | 35:5acbd8a64a89 | 32 | extern float ledLo; |
TickTock | 35:5acbd8a64a89 | 33 | extern unsigned short pollInt; |
TickTock | 35:5acbd8a64a89 | 34 | extern float scale12V; |
TickTock | 36:dbd39c315258 | 35 | extern bool playbackEn; |
TickTock | 36:dbd39c315258 | 36 | extern bool playbackOpen; |
TickTock | 36:dbd39c315258 | 37 | extern bool step; |
TickTock | 36:dbd39c315258 | 38 | extern float playbackInt; |
TickTock | 12:8e42d7ba8468 | 39 | |
TickTock | 12:8e42d7ba8468 | 40 | extern "C" { |
TickTock | 12:8e42d7ba8468 | 41 | void mbed_reset(); |
TickTock | 13:62e0f7f39ff5 | 42 | void RTC_IRQHandler(); |
TickTock | 13:62e0f7f39ff5 | 43 | void RTC_Init (void); |
TickTock | 13:62e0f7f39ff5 | 44 | void logMsg (char *msg); |
TickTock | 13:62e0f7f39ff5 | 45 | void touch_ISR(); |
TickTock | 13:62e0f7f39ff5 | 46 | unsigned short getTimeStamp(); |
TickTock | 13:62e0f7f39ff5 | 47 | void logCan (char mType, CANMessage canRXmsg); |
TickTock | 13:62e0f7f39ff5 | 48 | void logTS (); |
TickTock | 33:a277743ebdeb | 49 | void sendCPreq(); |
TickTock | 33:a277743ebdeb | 50 | void sendTreq(); |
TickTock | 36:dbd39c315258 | 51 | void autoPollISR(); |
TickTock | 36:dbd39c315258 | 52 | void playbackISR(); |
TickTock | 13:62e0f7f39ff5 | 53 | void recieve1(); |
TickTock | 13:62e0f7f39ff5 | 54 | void recieve2(); |
TickTock | 36:dbd39c315258 | 55 | void doNothing(); |
TickTock | 22:a43df3905863 | 56 | unsigned char buttonX(unsigned short X, unsigned char columns); |
TickTock | 22:a43df3905863 | 57 | unsigned char buttonY(unsigned short Y,unsigned char rows); |
TickTock | 23:cd03f9c3395e | 58 | void saveConfig(); |
TickTock | 25:ddf0ec209f03 | 59 | void readConfig(); |
TickTock | 25:ddf0ec209f03 | 60 | void upDate(unsigned char field, bool updownbar); |
TickTock | 25:ddf0ec209f03 | 61 | } |
TickTock | 12:8e42d7ba8468 | 62 | |
TickTock | 12:8e42d7ba8468 | 63 | //LEAF OBD |
TickTock | 12:8e42d7ba8468 | 64 | //1: |
TickTock | 12:8e42d7ba8468 | 65 | //2: |
TickTock | 12:8e42d7ba8468 | 66 | //3: AVCAN-L White/Blue |
TickTock | 12:8e42d7ba8468 | 67 | //4: VSS-Shield |
TickTock | 12:8e42d7ba8468 | 68 | //5: VSS Brown,White/Brown |
TickTock | 12:8e42d7ba8468 | 69 | //6: CARCAN-H Green |
TickTock | 12:8e42d7ba8468 | 70 | //7: |
TickTock | 12:8e42d7ba8468 | 71 | //8: 12V-SW Orange,White/Orange |
TickTock | 12:8e42d7ba8468 | 72 | //9: |
TickTock | 12:8e42d7ba8468 | 73 | //10: |
TickTock | 12:8e42d7ba8468 | 74 | //11: AVCAN-H Blue |
TickTock | 12:8e42d7ba8468 | 75 | //12: EVCAN-L White/Grey |
TickTock | 12:8e42d7ba8468 | 76 | //13: EVCAN-H Grey |
TickTock | 12:8e42d7ba8468 | 77 | //14: CARCAN-L White/Green |
TickTock | 12:8e42d7ba8468 | 78 | //15: |
TickTock | 12:8e42d7ba8468 | 79 | //16: 12V-AON Red/Blue,Blue/Red |
TickTock | 12:8e42d7ba8468 | 80 | |
TickTock | 12:8e42d7ba8468 | 81 | //VP230 |
TickTock | 12:8e42d7ba8468 | 82 | //1:D |
TickTock | 12:8e42d7ba8468 | 83 | //2:GND |
TickTock | 12:8e42d7ba8468 | 84 | //3:VCC |
TickTock | 12:8e42d7ba8468 | 85 | //4:R |
TickTock | 12:8e42d7ba8468 | 86 | //5:Vref |
TickTock | 12:8e42d7ba8468 | 87 | //6:CANL |
TickTock | 12:8e42d7ba8468 | 88 | //7:CANH |
TickTock | 12:8e42d7ba8468 | 89 | //8:RS |
TickTock | 12:8e42d7ba8468 | 90 | |
TickTock | 12:8e42d7ba8468 | 91 | //LPC1768 |
TickTock | 12:8e42d7ba8468 | 92 | //1: VSS |
TickTock | 12:8e42d7ba8468 | 93 | //2: NC:VIN (4.5-9V supply) |
TickTock | 12:8e42d7ba8468 | 94 | //3: NC:VB |
TickTock | 12:8e42d7ba8468 | 95 | //4: NC:nR |
TickTock | 22:a43df3905863 | 96 | //5: SPI:Reset |
TickTock | 22:a43df3905863 | 97 | //6: SPI:CS0 |
TickTock | 22:a43df3905863 | 98 | //7: SPI:CS1 |
TickTock | 12:8e42d7ba8468 | 99 | //8: CAN1:Sleep --> 8:CAN1:RS |
TickTock | 12:8e42d7ba8468 | 100 | //9: CAN1:RX --> 4:CAN1:R |
TickTock | 12:8e42d7ba8468 | 101 | //10: CAN1:TX --> 1:CAN1:D |
TickTock | 12:8e42d7ba8468 | 102 | //11: SPI:MOSI |
TickTock | 12:8e42d7ba8468 | 103 | //12: SPI:MISO |
TickTock | 12:8e42d7ba8468 | 104 | //13: SPI:SCLK |
TickTock | 12:8e42d7ba8468 | 105 | //14: NC:Ain |
TickTock | 12:8e42d7ba8468 | 106 | //15: MON12V --> 4K to 12V, 1K to VSS (To be implemented) |
TickTock | 12:8e42d7ba8468 | 107 | //16: TOUCH_X+ |
TickTock | 12:8e42d7ba8468 | 108 | //17: TOUCH_X- |
TickTock | 12:8e42d7ba8468 | 109 | //18: NC:Aout |
TickTock | 12:8e42d7ba8468 | 110 | //19: TOUCH_Y+ |
TickTock | 12:8e42d7ba8468 | 111 | //20: TOUCH_Y- |
TickTock | 12:8e42d7ba8468 | 112 | //21: Spkr+ |
TickTock | 22:a43df3905863 | 113 | //22: NC:pwm |
TickTock | 22:a43df3905863 | 114 | //23: LED |
TickTock | 22:a43df3905863 | 115 | //24: NC:pwm |
TickTock | 12:8e42d7ba8468 | 116 | //25: NC:pwm |
TickTock | 12:8e42d7ba8468 | 117 | //26: NC:pwm |
TickTock | 12:8e42d7ba8468 | 118 | //27: NC |
TickTock | 12:8e42d7ba8468 | 119 | //28: CAN2:Sleep --> 8:CAN2:RS |
TickTock | 12:8e42d7ba8468 | 120 | //29: CAN2:TX --> 1:CAN2:D |
TickTock | 12:8e42d7ba8468 | 121 | //30: CAN2:RX --> 4:CAN2:R |
TickTock | 12:8e42d7ba8468 | 122 | //31: USB_D+ |
TickTock | 12:8e42d7ba8468 | 123 | //32: USB_D- |
TickTock | 12:8e42d7ba8468 | 124 | //33: NC:Eth_TD+ |
TickTock | 12:8e42d7ba8468 | 125 | //34: NC:Eth_TD- |
TickTock | 12:8e42d7ba8468 | 126 | //35: NC:Eth_RD+ |
TickTock | 12:8e42d7ba8468 | 127 | //36: NC:Eth_RD- |
TickTock | 12:8e42d7ba8468 | 128 | //37: NC:IF+ |
TickTock | 12:8e42d7ba8468 | 129 | //38: NC:IF- |
TickTock | 12:8e42d7ba8468 | 130 | //39: NC:5Vout (only available when connected as USB device) |
TickTock | 12:8e42d7ba8468 | 131 | //40: VCC3.3 |