Production Test Program (PTP) for the LPC4088 Experiment Base Board
Dependencies: EALib I2S LM75B SDFileSystem mbed
Graphics.h@9:eb6086159020, 2014-10-01 (annotated)
- Committer:
- embeddedartists
- Date:
- Wed Oct 01 11:16:38 2014 +0000
- Revision:
- 9:eb6086159020
- Parent:
- 1:47680ec5d783
Updated used libraries
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
embeddedartists | 1:47680ec5d783 | 1 | |
embeddedartists | 1:47680ec5d783 | 2 | #ifndef GRAPHICS_H |
embeddedartists | 1:47680ec5d783 | 3 | #define GRAPHICS_H |
embeddedartists | 1:47680ec5d783 | 4 | |
embeddedartists | 1:47680ec5d783 | 5 | /** |
embeddedartists | 1:47680ec5d783 | 6 | * LcdController example |
embeddedartists | 1:47680ec5d783 | 7 | * |
embeddedartists | 1:47680ec5d783 | 8 | * @code |
embeddedartists | 1:47680ec5d783 | 9 | * #include "mbed.h" |
embeddedartists | 1:47680ec5d783 | 10 | * #include "LcdController.h" |
embeddedartists | 1:47680ec5d783 | 11 | * |
embeddedartists | 1:47680ec5d783 | 12 | * LcdController::Config innolux( |
embeddedartists | 1:47680ec5d783 | 13 | * 45, |
embeddedartists | 1:47680ec5d783 | 14 | * 17, |
embeddedartists | 1:47680ec5d783 | 15 | * 2, |
embeddedartists | 1:47680ec5d783 | 16 | * 800, |
embeddedartists | 1:47680ec5d783 | 17 | * 22, |
embeddedartists | 1:47680ec5d783 | 18 | * 22, |
embeddedartists | 1:47680ec5d783 | 19 | * 2, |
embeddedartists | 1:47680ec5d783 | 20 | * 480, |
embeddedartists | 1:47680ec5d783 | 21 | * false, |
embeddedartists | 1:47680ec5d783 | 22 | * false, |
embeddedartists | 1:47680ec5d783 | 23 | * true, |
embeddedartists | 1:47680ec5d783 | 24 | * true, |
embeddedartists | 1:47680ec5d783 | 25 | * true, |
embeddedartists | 1:47680ec5d783 | 26 | * LcdController::Bpp_16_565, |
embeddedartists | 1:47680ec5d783 | 27 | * 36000000, |
embeddedartists | 1:47680ec5d783 | 28 | * LcdController::Tft, |
embeddedartists | 1:47680ec5d783 | 29 | * false); |
embeddedartists | 1:47680ec5d783 | 30 | * |
embeddedartists | 1:47680ec5d783 | 31 | * int main(void) { |
embeddedartists | 1:47680ec5d783 | 32 | * LcdController lcd; |
embeddedartists | 1:47680ec5d783 | 33 | * |
embeddedartists | 1:47680ec5d783 | 34 | * lcd.open(&innolux); |
embeddedartists | 1:47680ec5d783 | 35 | * lcd.setFrameBuffer(frameBuffer); |
embeddedartists | 1:47680ec5d783 | 36 | * lcd.setPower(true); |
embeddedartists | 1:47680ec5d783 | 37 | * |
embeddedartists | 1:47680ec5d783 | 38 | * // draw on the frame buffer |
embeddedartists | 1:47680ec5d783 | 39 | * ... |
embeddedartists | 1:47680ec5d783 | 40 | * } |
embeddedartists | 1:47680ec5d783 | 41 | * @endcode |
embeddedartists | 1:47680ec5d783 | 42 | */ |
embeddedartists | 1:47680ec5d783 | 43 | class Graphics { |
embeddedartists | 1:47680ec5d783 | 44 | public: |
embeddedartists | 1:47680ec5d783 | 45 | |
embeddedartists | 1:47680ec5d783 | 46 | Graphics(uint16_t *pFrmBuf, uint16_t dispWidth, uint16_t dispHeight); |
embeddedartists | 1:47680ec5d783 | 47 | |
embeddedartists | 1:47680ec5d783 | 48 | void setFrameBuffer( uint16_t *pFrmBuf ); |
embeddedartists | 1:47680ec5d783 | 49 | void put_line(int32_t x1, int32_t y1, int32_t x2, int32_t y2, int16_t color); |
embeddedartists | 1:47680ec5d783 | 50 | void put_circle( int32_t cx, int32_t cy, int16_t color, int32_t radius, int32_t Filled ); |
embeddedartists | 1:47680ec5d783 | 51 | void put_dot( int32_t cx, int32_t cy, int16_t color ); |
embeddedartists | 1:47680ec5d783 | 52 | |
embeddedartists | 1:47680ec5d783 | 53 | protected: |
embeddedartists | 1:47680ec5d783 | 54 | uint16_t windowX; |
embeddedartists | 1:47680ec5d783 | 55 | uint16_t windowY; |
embeddedartists | 1:47680ec5d783 | 56 | uint16_t *pFrmBuf; |
embeddedartists | 1:47680ec5d783 | 57 | |
embeddedartists | 1:47680ec5d783 | 58 | int32_t abs(int32_t v1) const; |
embeddedartists | 1:47680ec5d783 | 59 | |
embeddedartists | 1:47680ec5d783 | 60 | virtual void plot4points( int32_t cx, int32_t cy, int32_t x, int32_t y, int16_t color, int32_t Filled ); |
embeddedartists | 1:47680ec5d783 | 61 | void plot8points( int32_t cx, int32_t cy, int32_t x, int32_t y, int16_t color, int32_t Filled ); |
embeddedartists | 1:47680ec5d783 | 62 | |
embeddedartists | 1:47680ec5d783 | 63 | }; |
embeddedartists | 1:47680ec5d783 | 64 | |
embeddedartists | 1:47680ec5d783 | 65 | #endif |
embeddedartists | 1:47680ec5d783 | 66 | |
embeddedartists | 1:47680ec5d783 | 67 | |
embeddedartists | 1:47680ec5d783 | 68 |