![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
aa
Dependencies: mbed LCD_DISCO_F469NIa SD_DISCO_F469NI BSP_DISCO_F469NIa EEPROM_DISCO_F469NI
draw_print_library.h@6:d6e001d7cf16, 2020-02-12 (annotated)
- Committer:
- formulas
- Date:
- Wed Feb 12 18:49:12 2020 +0000
- Revision:
- 6:d6e001d7cf16
- Parent:
- 4:0e8413277df8
aaa
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
formulas | 0:38c3afd99aeb | 1 | #include "LCD_DISCO_F469NI.h" |
formulas | 0:38c3afd99aeb | 2 | #include "SD_DISCO_F469NI.h" |
formulas | 0:38c3afd99aeb | 3 | |
formulas | 2:f54f01527ebb | 4 | #define PI 3.14159265358979323846 |
formulas | 0:38c3afd99aeb | 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) |
formulas | 0:38c3afd99aeb | 6 | #define BYTE_TO_BINARY(byte)\ |
formulas | 0:38c3afd99aeb | 7 | (byte & 0x80 ? '1' : '0'),\ |
formulas | 0:38c3afd99aeb | 8 | (byte & 0x40 ? '1' : '0'),\ |
formulas | 0:38c3afd99aeb | 9 | (byte & 0x20 ? '1' : '0'),\ |
formulas | 0:38c3afd99aeb | 10 | (byte & 0x10 ? '1' : '0'),\ |
formulas | 0:38c3afd99aeb | 11 | (byte & 0x08 ? '1' : '0'),\ |
formulas | 0:38c3afd99aeb | 12 | (byte & 0x04 ? '1' : '0'),\ |
formulas | 0:38c3afd99aeb | 13 | (byte & 0x02 ? '1' : '0'),\ |
formulas | 0:38c3afd99aeb | 14 | (byte & 0x01 ? '1' : '0') |
formulas | 0:38c3afd99aeb | 15 | |
formulas | 0:38c3afd99aeb | 16 | #define LOGOBIG_START_ADDR 0 //Address for Big Logo in SD Card used in Intro |
formulas | 0:38c3afd99aeb | 17 | #define LOGOSMALL_START_ADDR 1536000 //Address for Small Logo in SD Card used as header |
formulas | 0:38c3afd99aeb | 18 | #define BRANKO_START_ADDR 1576960 //Branko start address |
formulas | 0:38c3afd99aeb | 19 | #define NEW_YEAR_CONGAT_START_ADDR 2056960 //New Year start address |
formulas | 0:38c3afd99aeb | 20 | |
formulas | 0:38c3afd99aeb | 21 | const double PHI=53.13010235*PI/180; //Angles used in drawing Speedmeter. |
formulas | 0:38c3afd99aeb | 22 | const double ALPHA=73.73979529*PI/180; // |
formulas | 0:38c3afd99aeb | 23 | const double Vmax=150; |
formulas | 0:38c3afd99aeb | 24 | |
formulas | 0:38c3afd99aeb | 25 | //Positions of Informations on screen |
formulas | 0:38c3afd99aeb | 26 | const uint16_t GearXPos=272,GearYPos=95; //Gear in Main |
formulas | 6:d6e001d7cf16 | 27 | const uint16_t CapXPos = 300, CapYPos = 140; |
formulas | 6:d6e001d7cf16 | 28 | const uint16_t BatTempXPos=15,BatTempYPos=200; //Bat Temperature in Main |
formulas | 6:d6e001d7cf16 | 29 | const uint16_t LogoSmallXPos=625,LogoSmallYPos=5; //Small Logo, all three screens |
formulas | 0:38c3afd99aeb | 30 | const uint16_t WaterTempXPos=15,WaterTempYPos=350; //Water Temperature in Main |
formulas | 0:38c3afd99aeb | 31 | const uint16_t TPSXPos=569,TPSYPos=200; //TPS in Main |
formulas | 6:d6e001d7cf16 | 32 | const uint16_t HVVXPos=569,HVVYPos=350; |
formulas | 6:d6e001d7cf16 | 33 | const uint16_t RpmXPos=330,RpmYPos=30; //Bat Pressure in First Auxiliary |
formulas | 2:f54f01527ebb | 34 | const uint16_t MAPXPos=330,MAPYPos=90; //MAP in First Auxiliary |
formulas | 2:f54f01527ebb | 35 | const uint16_t AirTempXPos=330,AirTempYPos=150; //Air Temperature in First Auxiliary |
formulas | 2:f54f01527ebb | 36 | const uint16_t LambdaXPos=330,LambdaYPos=210; //Lambda Sensor value in First Auxiliary |
formulas | 2:f54f01527ebb | 37 | const uint16_t VoltsXPos=330,VoltsYPos=270; //Volts in Accumulator in First Auxiliary |
formulas | 2:f54f01527ebb | 38 | const uint16_t CrankXPos=330,CrankYPos=330; //Crank Error Message in First Auxiliary |
formulas | 2:f54f01527ebb | 39 | const uint16_t Meter_counterXPos=330,Meter_counterYPos=390; //Kilometer counter in First Auxiliary |
formulas | 0:38c3afd99aeb | 40 | //YPos in bottom position for LVDTs |
formulas | 0:38c3afd99aeb | 41 | const uint16_t FLLVDTBarXPos=280,FLLVDTBarYPos=200; //Front Left Bar LVDT in Second Auxiliary |
formulas | 0:38c3afd99aeb | 42 | const uint16_t FRLVDTBarXPos=440,FRLVDTBarYPos=200; //Front Right Bar LVDT in Second Auxiliary |
formulas | 0:38c3afd99aeb | 43 | const uint16_t RLLVDTBarXPos=280,RLLVDTBarYPos=410; //Rear Left Bar LVDT in Second Auxiliary |
formulas | 0:38c3afd99aeb | 44 | const uint16_t RRLVDTBarXPos=440,RRLVDTBarYPos=410; //Rear Right Bar LVDT in Second Auxiliary |
formulas | 0:38c3afd99aeb | 45 | const uint16_t FLLVDTXPos=10,FLLVDTYPos=100; //Front Left LVDT in Second Auxiliary |
formulas | 0:38c3afd99aeb | 46 | const uint16_t FRLVDTXPos=534,FRLVDTYPos=100; //Front Right LVDT in Second Auxiliary |
formulas | 0:38c3afd99aeb | 47 | const uint16_t RLLVDTXPos=10,RLLVDTYPos=310; //Rear Left LVDT in Second Auxiliary |
formulas | 0:38c3afd99aeb | 48 | const uint16_t RRLVDTXPos=534,RRLVDTYPos=310; //Rear Right LVDT in Second Auxiliary |
formulas | 0:38c3afd99aeb | 49 | |
formulas | 0:38c3afd99aeb | 50 | |
formulas | 2:f54f01527ebb | 51 | typedef struct BWImage { //Black-White Image Structure. These are stored on the controller |
formulas | 0:38c3afd99aeb | 52 | char name; |
formulas | 0:38c3afd99aeb | 53 | uint16_t width; |
formulas | 0:38c3afd99aeb | 54 | uint16_t height; |
formulas | 0:38c3afd99aeb | 55 | uint8_t *bitmap; |
formulas | 2:f54f01527ebb | 56 | } GEAR,CHAR; |
formulas | 0:38c3afd99aeb | 57 | |
formulas | 2:f54f01527ebb | 58 | typedef struct RGBImage { //RGB Coloured Image Structure. These are stored on SD Card |
formulas | 0:38c3afd99aeb | 59 | uint16_t width; |
formulas | 0:38c3afd99aeb | 60 | uint16_t height; |
formulas | 0:38c3afd99aeb | 61 | uint32_t START_ADDR; |
formulas | 2:f54f01527ebb | 62 | } IMAGE; |
formulas | 2:f54f01527ebb | 63 | |
formulas | 0:38c3afd99aeb | 64 | |
formulas | 0:38c3afd99aeb | 65 | void DrawSpeedMeter(); //Draw Speedmeter function |
formulas | 0:38c3afd99aeb | 66 | void PrintChar(CHAR Char,uint16_t StartXPos,uint16_t StartYPos,uint32_t TextColor); //Print Char function |
formulas | 0:38c3afd99aeb | 67 | void PrintString(char str[],int font,uint16_t StartXPos,uint16_t StartYPos,uint32_t TextColor); //Print String function |
formulas | 0:38c3afd99aeb | 68 | void ChangeNumber(int num,int num0,int Font,uint16_t StartXPos, uint16_t StartYPos, int digits, int dec_point, int sign); //Update number function |
formulas | 0:38c3afd99aeb | 69 | 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 |
formulas | 0:38c3afd99aeb | 70 | void DrawRGBImage(IMAGE Image,uint16_t StartXPos,uint16_t StartYPos); //Draw RGB Coloured image function |
formulas | 0:38c3afd99aeb | 71 | void UpdateSpeedMeter(int V,int dV); //Update Speedmeter function |
formulas | 6:d6e001d7cf16 | 72 | void ChangeCrank(int Crank); |
formulas | 6:d6e001d7cf16 | 73 | int UpdateCapBar(int H, int H0, uint16_t StartXPos, uint16_t StartYPos); //Update Crank error message function |
formulas | 0:38c3afd99aeb | 74 | int UpdateLVDTScale(int H,int H0, uint16_t StartXPos, uint16_t StartYPos); //Update LVDT Bar function |
formulas | 4:0e8413277df8 | 75 | void BrakeSignal(uint16_t brake); //Set Brake signal function |
formulas | 6:d6e001d7cf16 | 76 | void TestFont(); |
formulas | 6:d6e001d7cf16 | 77 | void DrawBatTempMap(); |
formulas | 6:d6e001d7cf16 | 78 | void UpdateBatTempMap(); |
formulas | 6:d6e001d7cf16 | 79 | uint32_t TempColor(uint8_t temperature); |
formulas | 6:d6e001d7cf16 | 80 | void UpdateCellTemp(uint8_t hsegment, uint8_t row, uint8_t temp); //Test font 50 function |
formulas | 6:d6e001d7cf16 | 81 | void SetFixedAccTemp(); |