Integration with potentiometer
Dependencies: BSP_DISCO_F469NI LCD_DISCO_F469NI SD_DISCO_F469NI mbed
functions.h@1:61fe443f9d7f, 2017-12-07 (annotated)
- Committer:
- formulas
- Date:
- Thu Dec 07 16:54:30 2017 +0000
- Revision:
- 1:61fe443f9d7f
- Parent:
- 0:e53b0806a628
sadasd
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
formulas | 0:e53b0806a628 | 1 | #include "LCD_DISCO_F469NI.h" |
formulas | 0:e53b0806a628 | 2 | #include "SD_DISCO_F469NI.h" |
formulas | 0:e53b0806a628 | 3 | |
formulas | 0:e53b0806a628 | 4 | #define PI 3.14159265358979323846 |
formulas | 0:e53b0806a628 | 5 | #define BYTE_TO_BINARY_PATTERN "%c%c%c%c%c%c%c%c" |
formulas | 0:e53b0806a628 | 6 | #define BYTE_TO_BINARY(byte)\ |
formulas | 0:e53b0806a628 | 7 | (byte & 0x80 ? '1' : '0'),\ |
formulas | 0:e53b0806a628 | 8 | (byte & 0x40 ? '1' : '0'),\ |
formulas | 0:e53b0806a628 | 9 | (byte & 0x20 ? '1' : '0'),\ |
formulas | 0:e53b0806a628 | 10 | (byte & 0x10 ? '1' : '0'),\ |
formulas | 0:e53b0806a628 | 11 | (byte & 0x08 ? '1' : '0'),\ |
formulas | 0:e53b0806a628 | 12 | (byte & 0x04 ? '1' : '0'),\ |
formulas | 0:e53b0806a628 | 13 | (byte & 0x02 ? '1' : '0'),\ |
formulas | 0:e53b0806a628 | 14 | (byte & 0x01 ? '1' : '0') |
formulas | 0:e53b0806a628 | 15 | |
formulas | 0:e53b0806a628 | 16 | #define LOGOBIG_START_ADDR 0 |
formulas | 0:e53b0806a628 | 17 | #define LOGOSMALL_START_ADDR 1536000 |
formulas | 0:e53b0806a628 | 18 | |
formulas | 0:e53b0806a628 | 19 | const double PHI=53.13010235*PI/180; |
formulas | 0:e53b0806a628 | 20 | const double ALPHA=73.73979529*PI/180; |
formulas | 0:e53b0806a628 | 21 | const double Vmax=150; |
formulas | 0:e53b0806a628 | 22 | |
formulas | 0:e53b0806a628 | 23 | const uint16_t GearXPos=272,GearYPos=95; |
formulas | 0:e53b0806a628 | 24 | const uint16_t OilTempXPos=15,OilTempYPos=200; |
formulas | 0:e53b0806a628 | 25 | const uint16_t LogoSmallXPos=635,LogoSmallYPos=5; |
formulas | 0:e53b0806a628 | 26 | const uint16_t WaterTempXPos=15,WaterTempYPos=350; |
formulas | 0:e53b0806a628 | 27 | const uint16_t TPSXPos=569,TPSYPos=200; |
formulas | 0:e53b0806a628 | 28 | const uint16_t OilPXPos=330,OilPYPos=25; |
formulas | 0:e53b0806a628 | 29 | const uint16_t MAPXPos=330,MAPYPos=100; |
formulas | 0:e53b0806a628 | 30 | const uint16_t AirTempXPos=330,AirTempYPos=175; |
formulas | 0:e53b0806a628 | 31 | const uint16_t LambdaXPos=330,LambdaYPos=250; |
formulas | 0:e53b0806a628 | 32 | const uint16_t VoltsXpos=330,VoltsYPos=325; |
formulas | 0:e53b0806a628 | 33 | const uint16_t CrankXPos=330,CrankYPos=400; |
formulas | 0:e53b0806a628 | 34 | //Za YPos pocetna pozicija je tacka na dnu, ne na vrhu jer se bar puni na gore. |
formulas | 0:e53b0806a628 | 35 | const uint16_t FLLVDTBarXPos=280,FLLVDTBarYPos=200; |
formulas | 0:e53b0806a628 | 36 | const uint16_t FRLVDTBarXPos=440,FRLVDTBarYPos=200; |
formulas | 0:e53b0806a628 | 37 | const uint16_t BLLVDTBarXPos=280,BLLVDTBarYPos=410; |
formulas | 0:e53b0806a628 | 38 | const uint16_t BRLVDTBarXPos=440,BRLVDTBarYPos=410; |
formulas | 0:e53b0806a628 | 39 | const uint16_t FLLVDTXPos=50,FLLVDTYPos=100; |
formulas | 0:e53b0806a628 | 40 | const uint16_t FRLVDTXPos=534,FRLVDTYPos=100; |
formulas | 0:e53b0806a628 | 41 | const uint16_t BLLVDTXPos=50,BLLVDTYPos=310; |
formulas | 0:e53b0806a628 | 42 | const uint16_t BRLVDTXPos=534,BRLVDTYPos=310; |
formulas | 0:e53b0806a628 | 43 | |
formulas | 0:e53b0806a628 | 44 | |
formulas | 0:e53b0806a628 | 45 | typedef struct BWImage{ |
formulas | 0:e53b0806a628 | 46 | char name; |
formulas | 0:e53b0806a628 | 47 | uint16_t width; |
formulas | 0:e53b0806a628 | 48 | uint16_t height; |
formulas | 0:e53b0806a628 | 49 | uint8_t *bitmap; |
formulas | 0:e53b0806a628 | 50 | } GEAR,CHAR; |
formulas | 0:e53b0806a628 | 51 | |
formulas | 0:e53b0806a628 | 52 | typedef struct RGBImage{ |
formulas | 0:e53b0806a628 | 53 | uint16_t width; |
formulas | 0:e53b0806a628 | 54 | uint16_t height; |
formulas | 0:e53b0806a628 | 55 | uint32_t START_ADDR; |
formulas | 0:e53b0806a628 | 56 | }IMAGE; |
formulas | 0:e53b0806a628 | 57 | |
formulas | 0:e53b0806a628 | 58 | void DrawSpeedMeter(); |
formulas | 0:e53b0806a628 | 59 | void PrintChar(CHAR Char,uint16_t StartXPos,uint16_t StartYPos,uint32_t TextColor); |
formulas | 0:e53b0806a628 | 60 | void PrintString(char str[],int font,uint16_t StartXPos,uint16_t StartYPos,uint32_t TextColor); |
formulas | 0:e53b0806a628 | 61 | void ChangeNumber(int num,int num0,int Font,uint16_t StartXPos,uint16_t StartYPos); |
formulas | 0:e53b0806a628 | 62 | void DrawRGBImage(IMAGE Image,uint16_t StartXPos,uint16_t StartYPos); |
formulas | 0:e53b0806a628 | 63 | void UpdateSpeedMeter(int V,int dV); |
formulas | 0:e53b0806a628 | 64 | void UpdateLVDTScale(int D,int D0, uint16_t StartXPos, uint16_t StartYPos); |
formulas | 0:e53b0806a628 | 65 | void BrakeSignal(int brake,int brake0); |
formulas | 0:e53b0806a628 | 66 | void TestFont(); |