MCPcopy Create free account
hub / github.com/andysworkshop/stm32plus / initialise

Method initialise

examples/pframe/LcdManager.cpp:15–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13 */
14
15bool LcdManager::initialise() {
16
17 // reset is on PE1 and RS (D/CX) is on PD11
18
19 GpioE<DefaultDigitalOutputFeature<1> > pe;
20 GpioD<DefaultFsmcAlternateFunctionFeature<11> > pd;
21
22 // set up the FSMC on bank 0 with A16 as the RS line
23
24 Fsmc8080LcdTiming fsmcTiming(2,5);
25 _accessMode=new LcdAccessMode(fsmcTiming,16,pe[1]);
26
27 // create the LCD and object
28
29 _lcd=new LcdAccess(*_accessMode);
30
31 // create and select the font
32
33 _font=new Font_APPLE8();
34 *_lcd << *_font;
35
36 // create the terminal object using the selected font
37
38 _terminal=new TerminalAccess(*_lcd);
39
40 // apply gamma settings
41
42 ILI9325Gamma gamma(0x0006,0x0101,0x0003,0x0106,0x0b02,0x0302,0x0707,0x0007,0x0600,0x020b);
43 _lcd->applyGamma(gamma);
44
45 // clear down to black
46
47 _lcd->setBackground(ColourNames::BLACK);
48 _lcd->setForeground(ColourNames::WHITE);
49
50 _terminal->clearScreen();
51
52 // lights on at 100% in 4ms steps from zero.
53
54 _backlight=new DefaultBacklight;
55 _backlight->fadeTo(100,4);
56
57 return true;
58}

Callers 15

runMethod · 0.45
runMethod · 0.45
runMethod · 0.45
runMethod · 0.45
runMethod · 0.45
runMethod · 0.45
runMethod · 0.45
runMethod · 0.45
runMethod · 0.45
runMethod · 0.45
runMethod · 0.45
runMethod · 0.45

Calls 3

clearScreenMethod · 0.80
applyGammaMethod · 0.45
fadeToMethod · 0.45

Tested by

no test coverage detected