![](/media/cache/profiles/0df840aed5f513a02964d0c27bc4f277.jpg.50x50_q85.jpg)
Attempts to merge SPI_TFT2 & SPI_TFT_ILI9341
Dependencies: SPI_TFTx2 TFT_fonts TOUCH_TFTx2 mbed
Fork of CANary by
utility.h@32:c9d9b6cb5de1, 2013-03-19 (annotated)
- Committer:
- TickTock
- Date:
- Tue Mar 19 01:23:26 2013 +0000
- Revision:
- 32:c9d9b6cb5de1
- Parent:
- 31:082372c83f68
- Child:
- 33:a277743ebdeb
removed wait_ms commands in CP request
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 | 31:082372c83f68 | 27 | extern bool showCP; |
TickTock | 31:082372c83f68 | 28 | extern bool tick16; |
TickTock | 23:cd03f9c3395e | 29 | extern TOUCH_TFTx2 tt; |
TickTock | 31:082372c83f68 | 30 | extern unsigned char CPcount; |
TickTock | 31:082372c83f68 | 31 | extern unsigned char Tcount; |
TickTock | 12:8e42d7ba8468 | 32 | |
TickTock | 12:8e42d7ba8468 | 33 | extern "C" { |
TickTock | 12:8e42d7ba8468 | 34 | void mbed_reset(); |
TickTock | 13:62e0f7f39ff5 | 35 | void RTC_IRQHandler(); |
TickTock | 13:62e0f7f39ff5 | 36 | void RTC_Init (void); |
TickTock | 13:62e0f7f39ff5 | 37 | void logMsg (char *msg); |
TickTock | 13:62e0f7f39ff5 | 38 | void touch_ISR(); |
TickTock | 13:62e0f7f39ff5 | 39 | unsigned short getTimeStamp(); |
TickTock | 13:62e0f7f39ff5 | 40 | void logCan (char mType, CANMessage canRXmsg); |
TickTock | 13:62e0f7f39ff5 | 41 | void logTS (); |
TickTock | 32:c9d9b6cb5de1 | 42 | //void sendCPreq(); |
TickTock | 32:c9d9b6cb5de1 | 43 | //void sendTreq(); |
TickTock | 13:62e0f7f39ff5 | 44 | void tickerISR(); |
TickTock | 31:082372c83f68 | 45 | void msgSend(); |
TickTock | 13:62e0f7f39ff5 | 46 | void recieve1(); |
TickTock | 13:62e0f7f39ff5 | 47 | void recieve2(); |
TickTock | 22:a43df3905863 | 48 | unsigned char buttonX(unsigned short X, unsigned char columns); |
TickTock | 22:a43df3905863 | 49 | unsigned char buttonY(unsigned short Y,unsigned char rows); |
TickTock | 23:cd03f9c3395e | 50 | void saveConfig(); |
TickTock | 25:ddf0ec209f03 | 51 | void readConfig(); |
TickTock | 25:ddf0ec209f03 | 52 | void upDate(unsigned char field, bool updownbar); |
TickTock | 25:ddf0ec209f03 | 53 | } |
TickTock | 12:8e42d7ba8468 | 54 | |
TickTock | 12:8e42d7ba8468 | 55 | //LEAF OBD |
TickTock | 12:8e42d7ba8468 | 56 | //1: |
TickTock | 12:8e42d7ba8468 | 57 | //2: |
TickTock | 12:8e42d7ba8468 | 58 | //3: AVCAN-L White/Blue |
TickTock | 12:8e42d7ba8468 | 59 | //4: VSS-Shield |
TickTock | 12:8e42d7ba8468 | 60 | //5: VSS Brown,White/Brown |
TickTock | 12:8e42d7ba8468 | 61 | //6: CARCAN-H Green |
TickTock | 12:8e42d7ba8468 | 62 | //7: |
TickTock | 12:8e42d7ba8468 | 63 | //8: 12V-SW Orange,White/Orange |
TickTock | 12:8e42d7ba8468 | 64 | //9: |
TickTock | 12:8e42d7ba8468 | 65 | //10: |
TickTock | 12:8e42d7ba8468 | 66 | //11: AVCAN-H Blue |
TickTock | 12:8e42d7ba8468 | 67 | //12: EVCAN-L White/Grey |
TickTock | 12:8e42d7ba8468 | 68 | //13: EVCAN-H Grey |
TickTock | 12:8e42d7ba8468 | 69 | //14: CARCAN-L White/Green |
TickTock | 12:8e42d7ba8468 | 70 | //15: |
TickTock | 12:8e42d7ba8468 | 71 | //16: 12V-AON Red/Blue,Blue/Red |
TickTock | 12:8e42d7ba8468 | 72 | |
TickTock | 12:8e42d7ba8468 | 73 | //VP230 |
TickTock | 12:8e42d7ba8468 | 74 | //1:D |
TickTock | 12:8e42d7ba8468 | 75 | //2:GND |
TickTock | 12:8e42d7ba8468 | 76 | //3:VCC |
TickTock | 12:8e42d7ba8468 | 77 | //4:R |
TickTock | 12:8e42d7ba8468 | 78 | //5:Vref |
TickTock | 12:8e42d7ba8468 | 79 | //6:CANL |
TickTock | 12:8e42d7ba8468 | 80 | //7:CANH |
TickTock | 12:8e42d7ba8468 | 81 | //8:RS |
TickTock | 12:8e42d7ba8468 | 82 | |
TickTock | 12:8e42d7ba8468 | 83 | //LPC1768 |
TickTock | 12:8e42d7ba8468 | 84 | //1: VSS |
TickTock | 12:8e42d7ba8468 | 85 | //2: NC:VIN (4.5-9V supply) |
TickTock | 12:8e42d7ba8468 | 86 | //3: NC:VB |
TickTock | 12:8e42d7ba8468 | 87 | //4: NC:nR |
TickTock | 22:a43df3905863 | 88 | //5: SPI:Reset |
TickTock | 22:a43df3905863 | 89 | //6: SPI:CS0 |
TickTock | 22:a43df3905863 | 90 | //7: SPI:CS1 |
TickTock | 12:8e42d7ba8468 | 91 | //8: CAN1:Sleep --> 8:CAN1:RS |
TickTock | 12:8e42d7ba8468 | 92 | //9: CAN1:RX --> 4:CAN1:R |
TickTock | 12:8e42d7ba8468 | 93 | //10: CAN1:TX --> 1:CAN1:D |
TickTock | 12:8e42d7ba8468 | 94 | //11: SPI:MOSI |
TickTock | 12:8e42d7ba8468 | 95 | //12: SPI:MISO |
TickTock | 12:8e42d7ba8468 | 96 | //13: SPI:SCLK |
TickTock | 12:8e42d7ba8468 | 97 | //14: NC:Ain |
TickTock | 12:8e42d7ba8468 | 98 | //15: MON12V --> 4K to 12V, 1K to VSS (To be implemented) |
TickTock | 12:8e42d7ba8468 | 99 | //16: TOUCH_X+ |
TickTock | 12:8e42d7ba8468 | 100 | //17: TOUCH_X- |
TickTock | 12:8e42d7ba8468 | 101 | //18: NC:Aout |
TickTock | 12:8e42d7ba8468 | 102 | //19: TOUCH_Y+ |
TickTock | 12:8e42d7ba8468 | 103 | //20: TOUCH_Y- |
TickTock | 12:8e42d7ba8468 | 104 | //21: Spkr+ |
TickTock | 22:a43df3905863 | 105 | //22: NC:pwm |
TickTock | 22:a43df3905863 | 106 | //23: LED |
TickTock | 22:a43df3905863 | 107 | //24: NC:pwm |
TickTock | 12:8e42d7ba8468 | 108 | //25: NC:pwm |
TickTock | 12:8e42d7ba8468 | 109 | //26: NC:pwm |
TickTock | 12:8e42d7ba8468 | 110 | //27: NC |
TickTock | 12:8e42d7ba8468 | 111 | //28: CAN2:Sleep --> 8:CAN2:RS |
TickTock | 12:8e42d7ba8468 | 112 | //29: CAN2:TX --> 1:CAN2:D |
TickTock | 12:8e42d7ba8468 | 113 | //30: CAN2:RX --> 4:CAN2:R |
TickTock | 12:8e42d7ba8468 | 114 | //31: USB_D+ |
TickTock | 12:8e42d7ba8468 | 115 | //32: USB_D- |
TickTock | 12:8e42d7ba8468 | 116 | //33: NC:Eth_TD+ |
TickTock | 12:8e42d7ba8468 | 117 | //34: NC:Eth_TD- |
TickTock | 12:8e42d7ba8468 | 118 | //35: NC:Eth_RD+ |
TickTock | 12:8e42d7ba8468 | 119 | //36: NC:Eth_RD- |
TickTock | 12:8e42d7ba8468 | 120 | //37: NC:IF+ |
TickTock | 12:8e42d7ba8468 | 121 | //38: NC:IF- |
TickTock | 12:8e42d7ba8468 | 122 | //39: NC:5Vout (only available when connected as USB device) |
TickTock | 12:8e42d7ba8468 | 123 | //40: VCC3.3 |