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