Subversion Repositories dashGPS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

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