Subversion Repositories dashGPS

Rev

Rev 7 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #include "main.h"
  2. #include "libOLED/stm32_halDisplay.H"
  3. namespace
  4. {
  5.   int const WIDTH = 128;
  6.   int const HEIGHT = 64;
  7.   int const DISPLAY_RAMWIDTH = 132;
  8.  
  9. }
  10.  
  11. uint8_t displayBuffer[dataSize (WIDTH, HEIGHT)];
  12.  
  13. stm32_halDisplay_t display1 (WIDTH, HEIGHT, DISPLAY_RAMWIDTH, displayBuffer,
  14.                              &hspi1,
  15.  
  16.                              SPI_CD_GPIO_Port,
  17.                              SPI_CD_Pin,
  18.                              SPI_RESET_GPIO_Port,
  19.                              SPI_RESET_Pin,
  20.                              SPI_NSS1_GPIO_Port,
  21.                              SPI_NSS1_Pin);
  22.  
  23. int cnt = 0;
  24.  
  25.  
  26. extern "C" void
  27. cc_init ()
  28. {
  29.   display1.init();
  30.   display1.clearDisplay ();
  31.  
  32.   display1.drawLine (0, 0, 127, 63, WHITE);
  33.  
  34.   display1.display ();
  35. }
  36.  
  37.  
  38. extern "C" void
  39. cc_run()
  40. {
  41.          if(cnt==0)
  42.            display1.clearDisplay();
  43.          display1.drawLine(0,cnt,127,cnt,WHITE);
  44.          display1.display();
  45.          cnt++;
  46.          cnt%=64;
  47. }
  48.