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