TEST
Dependencies: max32630fthr Adafruit_FeatherOLED USBDevice
Drivers/LS013B7DH03/BufferedDisplay.h@1:f60eafbf009a, 2019-04-10 (annotated)
- Committer:
- gmehmet
- Date:
- Wed Apr 10 14:56:25 2019 +0300
- Revision:
- 1:f60eafbf009a
upload from local
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gmehmet | 1:f60eafbf009a | 1 | /***************************************************************************//** |
gmehmet | 1:f60eafbf009a | 2 | * @file BufferedDisplay.h |
gmehmet | 1:f60eafbf009a | 3 | * @brief Framebuffered version of GraphicsDisplay |
gmehmet | 1:f60eafbf009a | 4 | ******************************************************************************* |
gmehmet | 1:f60eafbf009a | 5 | * @section License |
gmehmet | 1:f60eafbf009a | 6 | * <b>(C) Copyright 2015 Silicon Labs, http://www.silabs.com</b> |
gmehmet | 1:f60eafbf009a | 7 | ******************************************************************************* |
gmehmet | 1:f60eafbf009a | 8 | * |
gmehmet | 1:f60eafbf009a | 9 | * Permission is granted to anyone to use this software for any purpose, |
gmehmet | 1:f60eafbf009a | 10 | * including commercial applications, and to alter it and redistribute it |
gmehmet | 1:f60eafbf009a | 11 | * freely, subject to the following restrictions: |
gmehmet | 1:f60eafbf009a | 12 | * |
gmehmet | 1:f60eafbf009a | 13 | * 1. The origin of this software must not be misrepresented; you must not |
gmehmet | 1:f60eafbf009a | 14 | * claim that you wrote the original software. |
gmehmet | 1:f60eafbf009a | 15 | * 2. Altered source versions must be plainly marked as such, and must not be |
gmehmet | 1:f60eafbf009a | 16 | * misrepresented as being the original software. |
gmehmet | 1:f60eafbf009a | 17 | * 3. This notice may not be removed or altered from any source distribution. |
gmehmet | 1:f60eafbf009a | 18 | * |
gmehmet | 1:f60eafbf009a | 19 | * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Labs has no |
gmehmet | 1:f60eafbf009a | 20 | * obligation to support this Software. Silicon Labs is providing the |
gmehmet | 1:f60eafbf009a | 21 | * Software "AS IS", with no express or implied warranties of any kind, |
gmehmet | 1:f60eafbf009a | 22 | * including, but not limited to, any implied warranties of merchantability |
gmehmet | 1:f60eafbf009a | 23 | * or fitness for any particular purpose or warranties against infringement |
gmehmet | 1:f60eafbf009a | 24 | * of any proprietary rights of a third party. |
gmehmet | 1:f60eafbf009a | 25 | * |
gmehmet | 1:f60eafbf009a | 26 | * Silicon Labs will not be liable for any consequential, incidental, or |
gmehmet | 1:f60eafbf009a | 27 | * special damages, or any other relief, or for any claim by any third party, |
gmehmet | 1:f60eafbf009a | 28 | * arising from your use of this Software. |
gmehmet | 1:f60eafbf009a | 29 | * |
gmehmet | 1:f60eafbf009a | 30 | ******************************************************************************/ |
gmehmet | 1:f60eafbf009a | 31 | |
gmehmet | 1:f60eafbf009a | 32 | #ifndef SILABS_BUFFEREDDISPLAY_H |
gmehmet | 1:f60eafbf009a | 33 | #define SILABS_BUFFEREDDISPLAY_H |
gmehmet | 1:f60eafbf009a | 34 | |
gmehmet | 1:f60eafbf009a | 35 | #include "GraphicsDisplay.h" |
gmehmet | 1:f60eafbf009a | 36 | #include "LCDSettings.h" |
gmehmet | 1:f60eafbf009a | 37 | |
gmehmet | 1:f60eafbf009a | 38 | namespace silabs { |
gmehmet | 1:f60eafbf009a | 39 | /** Framebuffered version of GraphicsDisplay |
gmehmet | 1:f60eafbf009a | 40 | * |
gmehmet | 1:f60eafbf009a | 41 | * This has been implemented as part of the MemoryLCD library. |
gmehmet | 1:f60eafbf009a | 42 | */ |
gmehmet | 1:f60eafbf009a | 43 | class BufferedDisplay : public GraphicsDisplay { |
gmehmet | 1:f60eafbf009a | 44 | |
gmehmet | 1:f60eafbf009a | 45 | public: |
gmehmet | 1:f60eafbf009a | 46 | |
gmehmet | 1:f60eafbf009a | 47 | BufferedDisplay(const char *name=NULL); |
gmehmet | 1:f60eafbf009a | 48 | |
gmehmet | 1:f60eafbf009a | 49 | /** |
gmehmet | 1:f60eafbf009a | 50 | * Override of GraphicsDisplay pixel() function to set a pixel in the buffer |
gmehmet | 1:f60eafbf009a | 51 | * |
gmehmet | 1:f60eafbf009a | 52 | * @param x Zero-based x-axis index of pixel to set. 0 = leftmost. |
gmehmet | 1:f60eafbf009a | 53 | * @param y Zero-based y-axis index of pixel to set. 0 = topmost. |
gmehmet | 1:f60eafbf009a | 54 | * @param colour Colour value to set pixel to. In this implementation, only LSB is taken into account. |
gmehmet | 1:f60eafbf009a | 55 | */ |
gmehmet | 1:f60eafbf009a | 56 | virtual void pixel(int x, int y, int colour); |
gmehmet | 1:f60eafbf009a | 57 | virtual int width(); |
gmehmet | 1:f60eafbf009a | 58 | virtual int height(); |
gmehmet | 1:f60eafbf009a | 59 | |
gmehmet | 1:f60eafbf009a | 60 | /** |
gmehmet | 1:f60eafbf009a | 61 | * Function to move bitmap into frame buffer |
gmehmet | 1:f60eafbf009a | 62 | * |
gmehmet | 1:f60eafbf009a | 63 | * @param bitmap pointer to uint8 array containing horizontal pixel data |
gmehmet | 1:f60eafbf009a | 64 | * @param bmpWidth width of the bitmap in pixels (must be multiple of 8) |
gmehmet | 1:f60eafbf009a | 65 | * @param bmpHeight height of the bitmap in pixels |
gmehmet | 1:f60eafbf009a | 66 | * @param startX starting position to apply bitmap in horizontal direction (0 = leftmost) (must be multiple of 8) |
gmehmet | 1:f60eafbf009a | 67 | * @param startY starting position to apply bitmap in vertical direction (0 = topmost) |
gmehmet | 1:f60eafbf009a | 68 | */ |
gmehmet | 1:f60eafbf009a | 69 | void showBMP(const uint8_t* bitmap, const uint32_t bmpWidth, const uint32_t bmpHeight, const uint32_t startX, const uint32_t startY); |
gmehmet | 1:f60eafbf009a | 70 | |
gmehmet | 1:f60eafbf009a | 71 | protected: |
gmehmet | 1:f60eafbf009a | 72 | volatile DISPLAY_BUFFER_TYPE _pixelBuffer[DISPLAY_BUFFER_ELEMENTS]; // one full frame buffer |
gmehmet | 1:f60eafbf009a | 73 | volatile DISPLAY_BUFFER_TYPE _dirtyRows[DISPLAY_HEIGHT/DISPLAY_BUFFER_TYPE_SIZE]; // 1 bit per row to indicate dirty status |
gmehmet | 1:f60eafbf009a | 74 | }; |
gmehmet | 1:f60eafbf009a | 75 | |
gmehmet | 1:f60eafbf009a | 76 | } // namespace silabs |
gmehmet | 1:f60eafbf009a | 77 | |
gmehmet | 1:f60eafbf009a | 78 | |
gmehmet | 1:f60eafbf009a | 79 | |
gmehmet | 1:f60eafbf009a | 80 | |
gmehmet | 1:f60eafbf009a | 81 | #endif //SILABS_BUFFEREDDISPLAY_H |