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