Beispiel #1
0
    void run() {

      // reset is on PE1 and RS (D/CX) is on PD11

      GpioE<DefaultDigitalOutputFeature<1> > pe;
      GpioD<DefaultFsmcAlternateFunctionFeature<11>> pd;

      // set up the FSMC with RS=A16 (PD11). The 60Mhz FSMC bus on the F4 needs
      // slower timings.

#if defined(STM32PLUS_F1)
      Fsmc8080LcdTiming fsmcTiming(0,2);
#else
      Fsmc8080LcdTiming fsmcTiming(2,10);
#endif

      _accessMode=new LcdAccessMode(fsmcTiming,16,pe[1]);

      // declare a panel

      _gl=new LcdPanel(*_accessMode);

      // apply gamma settings

      ILI9481Gamma gamma(0,0xf3,0,0xbc,0x50,0x1f,0,7,0x7f,0x7,0xf,0);
      _gl->applyGamma(gamma);

      // clear to black while the lights are out

      _gl->setBackground(0);
      _gl->clearScreen();

      // create the backlight on timer4, channel2 (PD13)

      DefaultBacklight backlight;

      // fade up to 100% in 4ms steps

      backlight.fadeTo(100,4);

      // create a font

      _font=new Font_VOLTER__28GOLDFISH_299;
      *_gl << *_font;

      for(;;) {
        jpegTest();
        lzgTest();
        basicColoursTest();
        textTest();
        scrollTest();
        ellipseTest();
        gradientTest();
        rectTest();
        lineTest();
        clearTest();
        sleepTest();
      }
    }
Beispiel #2
0
    void run() {

      // reset is on PE1 and RS (D/CX) is on PE3

      GpioE<DefaultDigitalOutputFeature<1>,
            DefaultFsmcAlternateFunctionFeature<3> > pe;

      // set up the FSMC timing. these numbers (particularly the data setup time) are dependent on
      // both the FSMC bus speed and the panel timing parameters.

      Fsmc8080LcdTiming fsmcTiming(2,4);

      // set up the FSMC with RS=A19 (PE3)

      _accessMode=new LcdAccessMode(fsmcTiming,19,pe[1]);
      _gl=new LcdPanel(*_accessMode);

      // apply gamma settings

      ST7783Gamma gamma(0,0x0107,0,0x0203,0x0402,0,0x0207,0,0x0203,0x0403);
      _gl->applyGamma(gamma);

      // clear to black while the lights are out

      _gl->setBackground(0);
      _gl->clearScreen();

      // create the backlight on timer4, channel2 (PD13)

      DefaultBacklight backlight;

      // fade up to 100% in 4ms steps

      backlight.fadeTo(100,4);

      // Create a font. A wide range of sample fonts are available. See the
      // "lib/include/display/graphic/fonts" directory for a full list and
      // you can always download and convert your own using the FontConv utility.

      _font=new Font_VOLTER__28GOLDFISH_299;
      *_gl << *_font;

      _gl->setForeground(ColourNames::RED);
      _gl->fillRectangle(Rectangle(10,20,30,40));

      for(;;) {
        jpegTest();
        lzgTest();
        basicColoursTest();
        textTest();
        ellipseTest();
        gradientTest();
        rectTest();
        lineTest();
        clearTest();
        sleepTest();
      }
    }
Beispiel #3
0
    void run() {

      // declare the access mode

      LcdAccessMode accessMode;

      // declare a panel

      _gl=new LcdPanel(accessMode);

      // apply the gamma curve. Note that gammas are panel specific. This curve is appropriate
      // to a replacement (non-original) panel obtained from ebay.

      uint8_t levels[13]={ 0xe,0,1,1,0,0,0,0,0,0,3,4,0 };
      R61523Gamma gamma(levels);
      _gl->applyGamma(gamma);

      // clear to black while the lights are out

      _gl->setBackground(0);
      _gl->clearScreen();

      // create the backlight using default template parameters

      _backlight=new LcdBacklight(accessMode);

      // fade up the backlight to 100% using the hardware to do the smooth fade

      _backlight->setPercentage(100);

      // A wide range of sample fonts are available. See the "lib/include/display/graphic/fonts"
      // directory for a full list and you can always download and convert your own using the
      // FontConv utility.

      *_gl << _font;

      for(;;) {
        textTest();
        lzgTest();
        basicColoursTest();
        backlightTest();
        gradientTest();
        rectTest();
        lineTest();
        ellipseTest();
        clearTest();
        sleepTest();
      }
    }
	void initDisplay(){

		// we've got RESET on PE1, backlight on PD13 and RS (D/CX) on PD11
		GpioE<DefaultDigitalOutputFeature<1>> pe;
		GpioD<DefaultDigitalOutputFeature<13>,DefaultFsmcAlternateFunctionFeature<11>> pd;

		// set up the FSMC timing for this panel
		Fsmc8080LcdTiming fsmcTiming(2,5);

		// set up the FSMC on bank 1 with A16 as the RS line (PD11)
		_accessMode=new LcdAccessMode(fsmcTiming,16,pe[1]);

		// create the LCD interface in landscape mode
		// this will power it up and do the reset sequence
		lcd=new LcdPanel(*_accessMode);

		HX8352AGamma gamma(0xA0,0x03,0x00,0x45,0x03,0x47,0x23,0x77,0x01,0x1F,0x0F,0x03);
		// jb settings: check which one gives better colors
		//HX8352AGamma gamma(0xF0,0x07,0x00,0x43,0x16,0x16,0x43,0x77,0x00,0x1E,0x0F,0x00);
		lcd->applyGamma(gamma);

		// create a font and select it for stream operations
		_font=new Font_NINTENDO_DS_BIOS16();
		*lcd << *_font;
		lcd->setFontFilledBackground(true);

		// turn on the backlight at 100%
		backlight=new DefaultBacklight;

		//uint16_t backlightPercentage=100;
		backlight->fadeTo(100,4);

		// setup font/background colors
		bgcolor = ColourNames::BLACK;
		fgcolor = ColourNames::YELLOW;

		lcd->setBackground(bgcolor);
		lcd->setForeground(fgcolor);

	}
Beispiel #5
0
    void initialiseLcd() {

      // reset is on PE1 and RS (D/CX) is on PE3

      GpioE<DefaultDigitalOutputFeature<1>,
            DefaultFsmcAlternateFunctionFeature<3>> pe;

      // set up the FSMC timing. these numbers (particularly the data setup time) are dependent on
      // both the FSMC bus speed and the panel timing parameters.

      Fsmc8080LcdTiming fsmcTiming(2,4);

      // set up the FSMC with RS=A19 (PE3)

      _accessMode=new LcdAccessMode(fsmcTiming,19,pe[1]);
      _tft=new LcdPanel(*_accessMode);

      // apply gamma settings

      ST7783Gamma gamma(0,0x0107,0,0x0203,0x0402,0,0x0207,0,0x0203,0x0403);
      _tft->applyGamma(gamma);

      // clear to black while the lights are out

      _tft->setBackground(ColourNames::BLACK);
      _tft->setForeground(ColourNames::WHITE);
      _tft->clearScreen();

      // fade up to 100% in 4ms steps

      _backlight=new DefaultBacklight;
      _backlight->fadeTo(100,4);

      // create a font

      _font=new Font_VOLTER__28GOLDFISH_299;
      *_tft << *_font;
      _line=0;
    }
Beispiel #6
0
    void run() {

      // reset is on PE1 and RS (D/CX) is on PD11

      GpioE<DefaultDigitalOutputFeature<1> > pe;
      GpioD<DefaultFsmcAlternateFunctionFeature<11>> pd;

      // set up the FSMC timing. these numbers (particularly the data setup time) are dependent on
      // both the FSMC bus speed and the panel timing parameters.

#if defined(STM32PLUS_F1)
      Fsmc8080LcdTiming fsmcTiming(0,2);
#elif defined(STM32PLUS_F4)
      Fsmc8080LcdTiming fsmcTiming(1,15);
#else
#error Unsupported MCU
#endif

      // set up the FSMC with RS=A16 (PD11)

      _accessMode=new LcdAccessMode(fsmcTiming,16,pe[1]);

      // declare a panel

      _gl=new LcdPanel(*_accessMode);

      // apply gamma settings

      HX8347AGamma gamma(0,7,0,0,0x10,0,0,0x16,0,0,0,0);
      _gl->applyGamma(gamma);

      // clear to black while the lights are out

      _gl->setBackground(0);
      _gl->clearScreen();

      // create the backlight on timer4, channel2 (PD13)

      DefaultBacklight backlight;

      // fade up to 100% in 4ms steps

      backlight.fadeTo(100,4);

      // Create a font. A wide range of sample fonts are available. See the
      // "lib/include/display/graphic/fonts" directory for a full list and
      // you can always download and convert your own using the FontConv utility.

      _font=new Font_VOLTER__28GOLDFISH_299;
      *_gl << *_font;

      for(;;) {
        jpegTest();
        lzgTest();
        basicColoursTest();
        textTest();
        scrollTest();
        ellipseTest();
        gradientTest();
        rectTest();
        lineTest();
        clearTest();
        sleepTest();
      }
    }
Beispiel #7
0
    void run() {

      // reset is on PE1 and RS (D/CX) is on PD11

      GpioE<DefaultDigitalOutputFeature<1> > pe;
      GpioD<DefaultFsmcAlternateFunctionFeature<11>> pd;

      // Set up the FSMC timing. These numbers (particularly the data setup time) are dependent on
      // both the FSMC bus speed and the panel timing parameters. If you see corrupted graphics then
      // you may need to adjust these to uit the characteristics of your particular panel.

#if defined(STM32PLUS_F4)
      Fsmc8080LcdTiming fsmcTiming(3,6);
#elif defined(STM32PLUS_F1)
      Fsmc8080LcdTiming fsmcTiming(0,2);
#else
#error Invalid MCU
#endif

      // set up the FSMC with RS=A16 (PD11)

      _accessMode=new LcdAccessMode(fsmcTiming,16,pe[1]);

      // declare a panel

      _gl=new LcdPanel(*_accessMode);

      // apply gamma settings

      HX8352AGamma gamma(0xA0,0x03,0x00,0x45,0x03,0x47,0x23,0x77,0x01,0x1F,0x0F,0x03);
      _gl->applyGamma(gamma);

      // clear to black while the lights are out

      _gl->setBackground(0);
      _gl->clearScreen();

      // create the backlight on timer4, channel2 (PD13)

      DefaultBacklight backlight;

      // fade up to 100% in 4ms steps

      backlight.fadeTo(100,4);

      // create a font

      _font=new Font_VOLTER__28GOLDFISH_299;
      *_gl << *_font;

      for(;;) {
        lzgTest();
        rectTest();
        jpegTest();
        basicColoursTest();
        lineTest();
        textTest();
        scrollTest();
        ellipseTest();
        gradientTest();
        clearTest();
        sleepTest();
      }
    }