21.02.2019. revision - LCD screen works
Dependencies: mbed LCD_DISCO_F469NIa SD_DISCO_F469NI BSP_DISCO_F469NIa
draw_print_library.h@0:a7789614b67a, 2019-02-21 (annotated)
- Committer:
- Stefan_Sofijanic
- Date:
- Thu Feb 21 09:50:02 2019 +0000
- Revision:
- 0:a7789614b67a
21.02.2019. revision - LCD screen works
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Stefan_Sofijanic | 0:a7789614b67a | 1 | #include "LCD_DISCO_F469NI.h" |
Stefan_Sofijanic | 0:a7789614b67a | 2 | #include "SD_DISCO_F469NI.h" |
Stefan_Sofijanic | 0:a7789614b67a | 3 | |
Stefan_Sofijanic | 0:a7789614b67a | 4 | #define PI 3.14159265358979323846 |
Stefan_Sofijanic | 0:a7789614b67a | 5 | #define BYTE_TO_BINARY_PATTERN "%c%c%c%c%c%c%c%c" //Pattern which converts uint8_t to binary(array of 8 chars) |
Stefan_Sofijanic | 0:a7789614b67a | 6 | #define BYTE_TO_BINARY(byte)\ |
Stefan_Sofijanic | 0:a7789614b67a | 7 | (byte & 0x80 ? '1' : '0'),\ |
Stefan_Sofijanic | 0:a7789614b67a | 8 | (byte & 0x40 ? '1' : '0'),\ |
Stefan_Sofijanic | 0:a7789614b67a | 9 | (byte & 0x20 ? '1' : '0'),\ |
Stefan_Sofijanic | 0:a7789614b67a | 10 | (byte & 0x10 ? '1' : '0'),\ |
Stefan_Sofijanic | 0:a7789614b67a | 11 | (byte & 0x08 ? '1' : '0'),\ |
Stefan_Sofijanic | 0:a7789614b67a | 12 | (byte & 0x04 ? '1' : '0'),\ |
Stefan_Sofijanic | 0:a7789614b67a | 13 | (byte & 0x02 ? '1' : '0'),\ |
Stefan_Sofijanic | 0:a7789614b67a | 14 | (byte & 0x01 ? '1' : '0') |
Stefan_Sofijanic | 0:a7789614b67a | 15 | |
Stefan_Sofijanic | 0:a7789614b67a | 16 | #define LOGOBIG_START_ADDR 0 //Address for Big Logo in SD Card used in Intro |
Stefan_Sofijanic | 0:a7789614b67a | 17 | #define LOGOSMALL_START_ADDR 1536000 //Address for Small Logo in SD Card used as header |
Stefan_Sofijanic | 0:a7789614b67a | 18 | #define BRANKO_START_ADDR 1576960 //Branko start address |
Stefan_Sofijanic | 0:a7789614b67a | 19 | #define NEW_YEAR_CONGAT_START_ADDR 2056960 //New Year start address |
Stefan_Sofijanic | 0:a7789614b67a | 20 | |
Stefan_Sofijanic | 0:a7789614b67a | 21 | const double PHI=53.13010235*PI/180; //Angles used in drawing Speedmeter. |
Stefan_Sofijanic | 0:a7789614b67a | 22 | const double ALPHA=73.73979529*PI/180; // |
Stefan_Sofijanic | 0:a7789614b67a | 23 | const double Vmax=150; |
Stefan_Sofijanic | 0:a7789614b67a | 24 | |
Stefan_Sofijanic | 0:a7789614b67a | 25 | //Positions of Informations on screen |
Stefan_Sofijanic | 0:a7789614b67a | 26 | const uint16_t GearXPos=272,GearYPos=95; //Gear in Main |
Stefan_Sofijanic | 0:a7789614b67a | 27 | const uint16_t OilTempXPos=15,OilTempYPos=200; //Oil Temperature in Main |
Stefan_Sofijanic | 0:a7789614b67a | 28 | const uint16_t LogoSmallXPos=635,LogoSmallYPos=5; //Small Logo, all three screens |
Stefan_Sofijanic | 0:a7789614b67a | 29 | const uint16_t WaterTempXPos=15,WaterTempYPos=350; //Water Temperature in Main |
Stefan_Sofijanic | 0:a7789614b67a | 30 | const uint16_t TPSXPos=569,TPSYPos=200; //TPS in Main |
Stefan_Sofijanic | 0:a7789614b67a | 31 | const uint16_t OilPXPos=330,OilPYPos=25; //Oil Pressure in First Auxiliary |
Stefan_Sofijanic | 0:a7789614b67a | 32 | const uint16_t MAPXPos=330,MAPYPos=100; //MAP in First Auxiliary |
Stefan_Sofijanic | 0:a7789614b67a | 33 | const uint16_t AirTempXPos=330,AirTempYPos=175; //Air Temperature in First Auxiliary |
Stefan_Sofijanic | 0:a7789614b67a | 34 | const uint16_t LambdaXPos=330,LambdaYPos=250; //Lambda Sensor value in First Auxiliary |
Stefan_Sofijanic | 0:a7789614b67a | 35 | const uint16_t VoltsXPos=330,VoltsYPos=325; //Volts in Accumulator in First Auxiliary |
Stefan_Sofijanic | 0:a7789614b67a | 36 | const uint16_t CrankXPos=330,CrankYPos=400; //Crank Error Message in First Auxiliary |
Stefan_Sofijanic | 0:a7789614b67a | 37 | //YPos in bottom position for LVDTs |
Stefan_Sofijanic | 0:a7789614b67a | 38 | const uint16_t FLLVDTBarXPos=280,FLLVDTBarYPos=200; //Front Left Bar LVDT in Second Auxiliary |
Stefan_Sofijanic | 0:a7789614b67a | 39 | const uint16_t FRLVDTBarXPos=440,FRLVDTBarYPos=200; //Front Right Bar LVDT in Second Auxiliary |
Stefan_Sofijanic | 0:a7789614b67a | 40 | const uint16_t RLLVDTBarXPos=280,RLLVDTBarYPos=410; //Rear Left Bar LVDT in Second Auxiliary |
Stefan_Sofijanic | 0:a7789614b67a | 41 | const uint16_t RRLVDTBarXPos=440,RRLVDTBarYPos=410; //Rear Right Bar LVDT in Second Auxiliary |
Stefan_Sofijanic | 0:a7789614b67a | 42 | const uint16_t FLLVDTXPos=10,FLLVDTYPos=100; //Front Left LVDT in Second Auxiliary |
Stefan_Sofijanic | 0:a7789614b67a | 43 | const uint16_t FRLVDTXPos=534,FRLVDTYPos=100; //Front Right LVDT in Second Auxiliary |
Stefan_Sofijanic | 0:a7789614b67a | 44 | const uint16_t RLLVDTXPos=10,RLLVDTYPos=310; //Rear Left LVDT in Second Auxiliary |
Stefan_Sofijanic | 0:a7789614b67a | 45 | const uint16_t RRLVDTXPos=534,RRLVDTYPos=310; //Rear Right LVDT in Second Auxiliary |
Stefan_Sofijanic | 0:a7789614b67a | 46 | |
Stefan_Sofijanic | 0:a7789614b67a | 47 | |
Stefan_Sofijanic | 0:a7789614b67a | 48 | typedef struct BWImage{ //Black-White Image Structure. These are stored on the controller |
Stefan_Sofijanic | 0:a7789614b67a | 49 | char name; |
Stefan_Sofijanic | 0:a7789614b67a | 50 | uint16_t width; |
Stefan_Sofijanic | 0:a7789614b67a | 51 | uint16_t height; |
Stefan_Sofijanic | 0:a7789614b67a | 52 | uint8_t *bitmap; |
Stefan_Sofijanic | 0:a7789614b67a | 53 | } GEAR,CHAR; |
Stefan_Sofijanic | 0:a7789614b67a | 54 | |
Stefan_Sofijanic | 0:a7789614b67a | 55 | typedef struct RGBImage{ //RGB Coloured Image Structure. These are stored on SD Card |
Stefan_Sofijanic | 0:a7789614b67a | 56 | uint16_t width; |
Stefan_Sofijanic | 0:a7789614b67a | 57 | uint16_t height; |
Stefan_Sofijanic | 0:a7789614b67a | 58 | uint32_t START_ADDR; |
Stefan_Sofijanic | 0:a7789614b67a | 59 | }IMAGE; |
Stefan_Sofijanic | 0:a7789614b67a | 60 | |
Stefan_Sofijanic | 0:a7789614b67a | 61 | void DrawSpeedMeter(); //Draw Speedmeter function |
Stefan_Sofijanic | 0:a7789614b67a | 62 | void PrintChar(CHAR Char,uint16_t StartXPos,uint16_t StartYPos,uint32_t TextColor); //Print Char function |
Stefan_Sofijanic | 0:a7789614b67a | 63 | void PrintString(char str[],int font,uint16_t StartXPos,uint16_t StartYPos,uint32_t TextColor); //Print String function |
Stefan_Sofijanic | 0:a7789614b67a | 64 | void ChangeNumber(int num,int num0,int Font,uint16_t StartXPos, uint16_t StartYPos, int digits, int dec_point, int sign); //Update number function |
Stefan_Sofijanic | 0:a7789614b67a | 65 | void SetNumber(int num,int Font,uint16_t StartXPos,uint16_t StartYPos, int digits, int dec_point, int sign); //Set number to specific value function |
Stefan_Sofijanic | 0:a7789614b67a | 66 | void DrawRGBImage(IMAGE Image,uint16_t StartXPos,uint16_t StartYPos); //Draw RGB Coloured image function |
Stefan_Sofijanic | 0:a7789614b67a | 67 | void UpdateSpeedMeter(int V,int dV); //Update Speedmeter function |
Stefan_Sofijanic | 0:a7789614b67a | 68 | void ChangeCrank(int Crank); //Update Crank error message function |
Stefan_Sofijanic | 0:a7789614b67a | 69 | int UpdateLVDTScale(int H,int H0, uint16_t StartXPos, uint16_t StartYPos); //Update LVDT Bar function |
Stefan_Sofijanic | 0:a7789614b67a | 70 | void BrakeSignal(int brake); //Set Brake signal function |
Stefan_Sofijanic | 0:a7789614b67a | 71 | void TestFont(); //Test font 50 function |