t

Dependencies:   DM_FATFileSystem DM_HttpServer DM_USBHost EthernetInterface USBDevice mbed-rpc mbed-rtos

Fork of DMSupport by Embedded Artists

Committer:
embeddedartists
Date:
Fri Jan 16 11:15:57 2015 +0100
Revision:
23:6afd6a716e80
Parent:
22:1a58a518435c
Child:
31:d47cffcb0a3e
- Cleanup

Who changed what in which revision?

UserRevisionLine numberNew contents of line
embeddedartists 22:1a58a518435c 1 /*
embeddedartists 22:1a58a518435c 2 * Copyright 2014 Embedded Artists AB
embeddedartists 22:1a58a518435c 3 *
embeddedartists 22:1a58a518435c 4 * Licensed under the Apache License, Version 2.0 (the "License");
embeddedartists 22:1a58a518435c 5 * you may not use this file except in compliance with the License.
embeddedartists 22:1a58a518435c 6 * You may obtain a copy of the License at
embeddedartists 22:1a58a518435c 7 *
embeddedartists 22:1a58a518435c 8 * http://www.apache.org/licenses/LICENSE-2.0
embeddedartists 22:1a58a518435c 9 *
embeddedartists 22:1a58a518435c 10 * Unless required by applicable law or agreed to in writing, software
embeddedartists 22:1a58a518435c 11 * distributed under the License is distributed on an "AS IS" BASIS,
embeddedartists 22:1a58a518435c 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
embeddedartists 22:1a58a518435c 13 * See the License for the specific language governing permissions and
embeddedartists 22:1a58a518435c 14 * limitations under the License.
embeddedartists 22:1a58a518435c 15 */
embeddedartists 22:1a58a518435c 16
embeddedartists 22:1a58a518435c 17 #ifndef BIOSDISPLAY_H
embeddedartists 22:1a58a518435c 18 #define BIOSDISPLAY_H
embeddedartists 22:1a58a518435c 19
embeddedartists 22:1a58a518435c 20 #include "mbed.h"
embeddedartists 22:1a58a518435c 21 #include "TouchPanel.h"
embeddedartists 22:1a58a518435c 22 #include "Display.h"
embeddedartists 22:1a58a518435c 23 #include "bios.h"
embeddedartists 22:1a58a518435c 24
embeddedartists 22:1a58a518435c 25 /**
embeddedartists 22:1a58a518435c 26 * Glue between the BIOS and the Display interface.
embeddedartists 22:1a58a518435c 27 */
embeddedartists 22:1a58a518435c 28 class BiosDisplay : public Display {
embeddedartists 22:1a58a518435c 29 public:
embeddedartists 22:1a58a518435c 30
embeddedartists 22:1a58a518435c 31 /** Get the only instance of the BiosDisplay
embeddedartists 22:1a58a518435c 32 *
embeddedartists 22:1a58a518435c 33 * @returns The display
embeddedartists 22:1a58a518435c 34 */
embeddedartists 22:1a58a518435c 35 static BiosDisplay& instance()
embeddedartists 22:1a58a518435c 36 {
embeddedartists 22:1a58a518435c 37 static BiosDisplay singleton;
embeddedartists 22:1a58a518435c 38 return singleton;
embeddedartists 22:1a58a518435c 39 }
embeddedartists 22:1a58a518435c 40
embeddedartists 22:1a58a518435c 41
embeddedartists 22:1a58a518435c 42 /** Initializes the display but does not turn it on
embeddedartists 22:1a58a518435c 43 *
embeddedartists 22:1a58a518435c 44 * @returns
embeddedartists 22:1a58a518435c 45 * Ok on success
embeddedartists 22:1a58a518435c 46 * An error code on failure
embeddedartists 22:1a58a518435c 47 */
embeddedartists 22:1a58a518435c 48 DisplayError init();
embeddedartists 22:1a58a518435c 49
embeddedartists 22:1a58a518435c 50 // From the Display interface
embeddedartists 22:1a58a518435c 51 virtual DisplayError powerUp(void* framebuffer, Resolution wanted = Resolution_16bit_rgb565);
embeddedartists 22:1a58a518435c 52 virtual DisplayError powerDown();
embeddedartists 22:1a58a518435c 53 virtual DisplayError backlight(int percent);
embeddedartists 22:1a58a518435c 54 virtual uint16_t width();
embeddedartists 22:1a58a518435c 55 virtual uint16_t height();
embeddedartists 22:1a58a518435c 56 virtual uint16_t bytesPerPixel();
embeddedartists 22:1a58a518435c 57 virtual uint32_t fbSize();
embeddedartists 22:1a58a518435c 58 virtual bool landscape();
embeddedartists 22:1a58a518435c 59 virtual bool isSupported(Resolution res);
embeddedartists 22:1a58a518435c 60 virtual Resolution currentResolution();
embeddedartists 22:1a58a518435c 61 virtual void setFramebuffer(void* buff);
embeddedartists 22:1a58a518435c 62 virtual void* swapFramebuffer(void* buff);
embeddedartists 22:1a58a518435c 63 virtual void* allocateFramebuffer(Resolution res=Resolution_16bit_rgb565);
embeddedartists 22:1a58a518435c 64
embeddedartists 22:1a58a518435c 65 private:
embeddedartists 22:1a58a518435c 66
embeddedartists 22:1a58a518435c 67 bool _initialized;
embeddedartists 22:1a58a518435c 68 bool _poweredOn;
embeddedartists 22:1a58a518435c 69
embeddedartists 22:1a58a518435c 70 bios_header_t* _bios;
embeddedartists 22:1a58a518435c 71 void* _biosData;
embeddedartists 22:1a58a518435c 72
embeddedartists 22:1a58a518435c 73 uint16_t _width;
embeddedartists 22:1a58a518435c 74 uint16_t _height;
embeddedartists 22:1a58a518435c 75 uint16_t _bpp;
embeddedartists 22:1a58a518435c 76 uint16_t _supportedRes;
embeddedartists 22:1a58a518435c 77 Resolution_t _activeRes;
embeddedartists 22:1a58a518435c 78 bool _landscape;
embeddedartists 22:1a58a518435c 79
embeddedartists 22:1a58a518435c 80 explicit BiosDisplay();
embeddedartists 22:1a58a518435c 81 // hide copy constructor
embeddedartists 22:1a58a518435c 82 BiosDisplay(const BiosDisplay&);
embeddedartists 22:1a58a518435c 83 // hide assign operator
embeddedartists 22:1a58a518435c 84 BiosDisplay& operator=(const BiosDisplay&);
embeddedartists 22:1a58a518435c 85 ~BiosDisplay();
embeddedartists 22:1a58a518435c 86 };
embeddedartists 22:1a58a518435c 87
embeddedartists 22:1a58a518435c 88 #endif /* BIOSDISPLAY_H */