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" |
| 8 | mjames | 4 | #include "libOLED/displayDial.H" |
| 7 | mjames | 5 | |
| 6 | mjames | 6 | namespace |
| 7 | { |
||
| 8 | int const WIDTH = 128; |
||
| 9 | int const HEIGHT = 64; |
||
| 10 | int const DISPLAY_RAMWIDTH = 132; |
||
| 11 | |||
| 12 | } |
||
| 13 | |||
| 14 | uint8_t displayBuffer[dataSize (WIDTH, HEIGHT)]; |
||
| 15 | |||
| 16 | stm32_halDisplay_t display1 (WIDTH, HEIGHT, DISPLAY_RAMWIDTH, displayBuffer, |
||
| 17 | &hspi1, |
||
| 18 | |||
| 19 | SPI_CD_GPIO_Port, |
||
| 20 | SPI_CD_Pin, |
||
| 21 | SPI_RESET_GPIO_Port, |
||
| 22 | SPI_RESET_Pin, |
||
| 23 | SPI_NSS1_GPIO_Port, |
||
| 24 | SPI_NSS1_Pin); |
||
| 25 | |||
| 8 | mjames | 26 | |
| 27 | displayDial_t dial (64, 64, 64); |
||
| 6 | mjames | 28 | int cnt = 0; |
| 29 | |||
| 30 | |||
| 31 | extern "C" void |
||
| 32 | cc_init () |
||
| 33 | { |
||
| 34 | display1.init(); |
||
| 35 | display1.clearDisplay (); |
||
| 36 | |||
| 8 | mjames | 37 | dial.draw_scale (display1, 0 , 10 , 4, 15 ,2); |
| 6 | mjames | 38 | |
| 39 | display1.display (); |
||
| 40 | } |
||
| 41 | |||
| 42 | |||
| 43 | extern "C" void |
||
| 44 | cc_run() |
||
| 45 | { |
||
| 46 | if(cnt==0) |
||
| 47 | display1.clearDisplay(); |
||
| 7 | mjames | 48 | |
| 8 | mjames | 49 | display1.gotoxy(0,8); |
| 50 | display1.printString(small_font,"ABCDabcd",8,WHITE); |
||
| 51 | |||
| 7 | mjames | 52 | display1.gotoxy(0,16); |
| 8 | mjames | 53 | display1.printScaledString(small_font,"ABCD1234",8,128 |
| 54 | ,WHITE); |
||
| 55 | |||
| 56 | display1.gotoxy(0,48); |
||
| 57 | display1.printScaledString(large_font,"ABCD1234",8,256 |
||
| 58 | ,WHITE); |
||
| 59 | display1.drawLine(96,cnt,127,cnt,WHITE); |
||
| 6 | mjames | 60 | display1.display(); |
| 61 | cnt++; |
||
| 62 | cnt%=64; |
||
| 63 | } |