Anim

Dependencies:   BSP_DISCO_F429ZI EEPROM_DISCO_F429ZI FT810 GYRO_DISCO_F429ZI KEYPAD_DISCO_F429ZI LCD_DISCO_F429ZI PinDetect SDRAM_DISCO_F429ZI TS_DISCO_F429ZI mbed

main.cpp

Committer:
mozillain
Date:
2018-01-24
Revision:
1:2ceb29686290
Parent:
0:4fcdf32ad508

File content as of revision 1:2ceb29686290:

//Serial pc(SERIAL_TX, SERIAL_RX); pc.printf("Press '1' to turn LED1 ON, '0' to turn it OFF\n");
//DigitalOut led(LED1); led = 1;

#include "mbed.h"
#include "FT_Platform.h"
//#include "LCD_DISCO_F429ZI.h"
 
void    screen1(uint32_t tracker, uint8_t tag);

//LCD_DISCO_F429ZI lcd;
//Serial pc(SERIAL_TX, SERIAL_RX);
FT800 TFT( PE_6, PE_5, PE_2, PE_4, PC_13, PC_15);
//       ( mosi, miso, sclk,   ss,  intr,  pd );
int main(void)
{
  /*
   BSP_LCD_SetFont(&Font20);
  
   lcd.Clear(LCD_COLOR_GREEN);
   lcd.SetBackColor(LCD_COLOR_GREEN);
   lcd.SetTextColor(LCD_COLOR_WHITE);
   lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"TOUCHSCREEN", CENTER_MODE);
   lcd.DisplayStringAt(0, LINE(6), (uint8_t *)"INIT OK", CENTER_MODE);
   wait(1);
   
   pc.printf("Press '1' to turn LED1 ON, '0' to turn it OFF\n");
   */
   DigitalOut led(LED1); led=1;
   
   //screen1(0x0,0x0);
   set_time(0);  // Set RTC time to 0
   wait(1);
   TFT.Logo();
   TFT.WaitLogo_Finish();
   screen1(0x0,0x0);
   return 0;
}
 
void screen1(uint32_t tracker, uint8_t tag)
{
    time_t seconds = time(NULL);
 
    //start new display list
    TFT.DLstart();                                                      // start a new display command list
    TFT.DL(CLEAR_COLOR_RGB(255,255,255));                               // set the clear color to white
    TFT.DL(CLEAR(1,1,1));                                               // clear buffers -> color buffer,stencil buffer, tag buffer
 
    TFT.DL(TAG(0));                         // assign TAG value 0 to everything else
 
    //title text
    TFT.DL(COLOR_RGB(0, 0, 0));
    TFT.Text((TFT.DispWidth/2), TFT.DispHeight/8, 28, OPT_CENTERX, "test\0");        // draw Text with font 31
 
    // time
    TFT.Text((TFT.DispWidth/4), TFT.DispHeight*7/8, 28, OPT_CENTERX, "Run time [s]: \0");        // draw Text with font 31
    TFT.Number((TFT.DispWidth/2), (TFT.DispHeight*7/8),28,OPT_CENTERX, seconds);
 
    //author text
    TFT.DL(COLOR_RGB(0x00,  0x00,   0x00));
    TFT.Text((TFT.DispWidth*7/8)+9, (TFT.DispHeight*15/16), 28, OPT_CENTERX, "by Curtis Mattull\0");            // draw Text with font 31
 
    //display the screen
    TFT.DL(DISPLAY());                     // display the image
    TFT.Swap();                            // swap the current display list
    TFT.Flush_Co_Buffer();                 // download the command list into fifo
    TFT.WaitCmdfifo_empty();               // wait till coprocessor completes the operation
}