Пример #1
0
void S6B33BG_PutStr(char *pString, uint8_t x, uint8_t y) {

  if(y+FontTable[S6B33BG_font_size][1]>S6B33BG_GetHeight())
    return;

  // loop until null-terminator is seen
  while (*pString) {
    if (x+FontTable[S6B33BG_font_size][0]>S6B33BG_GetWidth()) break;
    // draw the character
    S6B33BG_PutChar(*pString++, x, y);
    x+=FontTable[S6B33BG_font_size][0];
  }
}
Пример #2
0
int main (void) {

  uint32_t TempColor[9] = { RED,GREEN,BLUE,CYAN,MAGENTA,YELLOW,BROWN,ORANGE,PINK };
  uint32_t i;

  DWT_Init();

  DWT_Delay(10000);

  BSP_Buttons_Init(BUTTON_MODE_EXTI);
  BSP_LEDs_Init();

  ADC_DMA_Configuration();
  ADC_SoftwareStartConvCmd(ADC1, ENABLE);

  if(S6B33BG_Init(0,1)==S6B33BG_ERROR) {
    BSP_LED_On(LED1);
    while(1);
  }

  S6B33BG_ColorMode(COLOR_16BIT);
  S6B33BG_OrientationMode(ORIENTATION_PORTRAIT);
  S6B33BG_ClearScreen(BLACK);

  S6B33BG_SetFont(FONT_8x14);
  S6B33BG_PutStr("Mobile phone LCD",2,2);
  S6B33BG_PutStr("Samsung GT-E1050",2,14);
  S6B33BG_SetFont(FONT_6x8);
  S6B33BG_PutStr("Resolution:128x128 px",2,30);
  S6B33BG_PutStr("Type:16bit color CSTN",2,40);
  S6B33BG_PutStr("Controller: S6B33BG",2,50);
  S6B33BG_PutStr("Marking on the LCD:",2,60);
  S6B33BG_PutStr(" 2P0427-E(Rev 1.0)",2,70);
  S6B33BG_PutStr(" Y120618-B1F",2,80);
  S6B33BG_PutStr("Marking on the cable:",2,90);
  S6B33BG_PutStr(" TSF8H0784FPC-A1-E G",2,100);
  S6B33BG_PutStr("MPU Interface:",2,110);
  S6B33BG_PutStr(" 8bit 8080 parallel",2,120);

  DWT_Delay(5000000);
  S6B33BG_ClearScreen(BLACK);

  S6B33BG_Fill(0,0,S6B33BG_GetWidth()-1,16,BLACK);
  S6B33BG_Fill(0,17,S6B33BG_GetWidth()-1,32,RED);
  S6B33BG_Fill(0,33,S6B33BG_GetWidth()-1,48,GREEN);
  S6B33BG_Fill(0,49,S6B33BG_GetWidth()-1,64,BLUE);
  S6B33BG_Fill(0,65,S6B33BG_GetWidth()-1,80,CYAN);
  S6B33BG_Fill(0,81,S6B33BG_GetWidth()-1,96,MAGENTA);
  S6B33BG_Fill(0,97,S6B33BG_GetWidth()-1,112,YELLOW);
  S6B33BG_Fill(0,113,S6B33BG_GetWidth()-1,128,WHITE);

  S6B33BG_PutStr("Color Bars",30,6);

  DWT_Delay(5000000);
  S6B33BG_ClearScreen(BLACK);

  S6B33BG_SetFont(FONT_8x8);
  S6B33BG_PutStr("3D rotating",20,12);
  S6B33BG_PutStr("cube and moving",4,24);
  S6B33BG_PutStr("checkerboard",18,36);
  S6B33BG_PutStr("demo",50,48);
  S6B33BG_SetFont(FONT_6x8);
  S6B33BG_PutStr("Delay (0 - 80 ms)",4,62);
  S6B33BG_PutStr("between frames is",4,72);
  S6B33BG_PutStr("controlled by onboard",4,82);
  S6B33BG_PutStr("potentiometer",4,92);

  S6B33BG_PutStr("more at:",8,108);
  S6B33BG_PutStr("kbiva.wordpress.com",8,118);

  for(i=0;i<100;i++) {
    S6B33BG_SetTextColours(TempColor[i%9],BLACK);
    S6B33BG_PutStr("kbiva.wordpress.com",8,118);
    DWT_Delay(100000);
  }


  S6B33BG_ClearScreen(BLACK);
  show_3d_cube();

  while(1){};
}