Forked para SNOCC
Fork of RA8875 by
DisplayDefs.h@81:01da2e34283d, 2014-12-28 (annotated)
- Committer:
- WiredHome
- Date:
- Sun Dec 28 21:50:28 2014 +0000
- Revision:
- 81:01da2e34283d
- Parent:
- 79:544eb4964795
- Child:
- 83:7bad0068cca0
Refactored constructor() and init().; Added rect_t as a rectangle type.; Added new rect() methods that use rect_t.; Added touch panel calibration (and some renamed touch* methods).
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
WiredHome | 31:c72e12cd5c67 | 1 | #ifndef DISPLAYDEFS_H |
WiredHome | 31:c72e12cd5c67 | 2 | #define DISPLAYDEFS_H |
WiredHome | 31:c72e12cd5c67 | 3 | |
WiredHome | 32:0e4f2ae512e2 | 4 | #define RGB(r,g,b) ( ((r<<8)&0xF800) | ((g<<3)&0x07E0) | (b>>3) ) |
WiredHome | 32:0e4f2ae512e2 | 5 | |
WiredHome | 31:c72e12cd5c67 | 6 | typedef uint16_t color_t; |
WiredHome | 31:c72e12cd5c67 | 7 | |
WiredHome | 79:544eb4964795 | 8 | /// return values from functions. Use this number, or use the |
WiredHome | 79:544eb4964795 | 9 | /// lookup function to get a text string. @see GetErrorMessage. |
WiredHome | 79:544eb4964795 | 10 | /// |
WiredHome | 31:c72e12cd5c67 | 11 | typedef enum |
WiredHome | 31:c72e12cd5c67 | 12 | { |
WiredHome | 31:c72e12cd5c67 | 13 | noerror, ///< no errors, command completed successfully |
WiredHome | 31:c72e12cd5c67 | 14 | bad_parameter, ///< one or more parameters are invalid |
WiredHome | 31:c72e12cd5c67 | 15 | file_not_found, ///< specified file could not be found |
WiredHome | 42:7cbdfd2bbfc5 | 16 | not_bmp_format, ///< file is not a .bmp file |
WiredHome | 42:7cbdfd2bbfc5 | 17 | not_ico_format, ///< file is not a .ico file |
WiredHome | 31:c72e12cd5c67 | 18 | not_supported_format, ///< file format is not yet supported |
WiredHome | 31:c72e12cd5c67 | 19 | image_too_big, ///< image is too large for the screen |
WiredHome | 31:c72e12cd5c67 | 20 | not_enough_ram, ///< could not allocate ram for scanline |
WiredHome | 79:544eb4964795 | 21 | LastErrCode, // Private marker. |
WiredHome | 31:c72e12cd5c67 | 22 | } RetCode_t; |
WiredHome | 31:c72e12cd5c67 | 23 | |
WiredHome | 37:f19b7e7449dc | 24 | /// type that manages locations, which is typically an x or y pixel location, |
WiredHome | 37:f19b7e7449dc | 25 | /// which can range from -N to +N (even if the screen is 0 to +n). @see textloc_t. |
WiredHome | 37:f19b7e7449dc | 26 | typedef int16_t loc_t; |
WiredHome | 37:f19b7e7449dc | 27 | |
WiredHome | 37:f19b7e7449dc | 28 | /// type that manages text locations, which are row or column values in |
WiredHome | 37:f19b7e7449dc | 29 | /// units of character, not pixel. @see loc_t. |
WiredHome | 37:f19b7e7449dc | 30 | typedef uint16_t textloc_t; |
WiredHome | 37:f19b7e7449dc | 31 | |
WiredHome | 37:f19b7e7449dc | 32 | /// type that manages dimensions of width or height, which range from 0 to N. |
WiredHome | 37:f19b7e7449dc | 33 | typedef uint16_t dim_t; |
WiredHome | 37:f19b7e7449dc | 34 | |
WiredHome | 32:0e4f2ae512e2 | 35 | /// type that manages x,y pairs |
WiredHome | 32:0e4f2ae512e2 | 36 | typedef struct |
WiredHome | 32:0e4f2ae512e2 | 37 | { |
WiredHome | 37:f19b7e7449dc | 38 | loc_t x; ///< x value in the point |
WiredHome | 37:f19b7e7449dc | 39 | loc_t y; ///< y value in the point |
WiredHome | 32:0e4f2ae512e2 | 40 | } point_t; |
WiredHome | 32:0e4f2ae512e2 | 41 | |
WiredHome | 81:01da2e34283d | 42 | /// type that manages rectangles, which are pairs of points. It is recommended |
WiredHome | 81:01da2e34283d | 43 | /// that p1 contains the top-left point and p2 contains the bottom-right point, |
WiredHome | 81:01da2e34283d | 44 | /// even though eventually this should not matter. |
WiredHome | 81:01da2e34283d | 45 | typedef struct |
WiredHome | 81:01da2e34283d | 46 | { |
WiredHome | 81:01da2e34283d | 47 | point_t p1; ///< p1 defines one point on the rectangle |
WiredHome | 81:01da2e34283d | 48 | point_t p2; ///< p2 defines the opposite point on the rectangle |
WiredHome | 81:01da2e34283d | 49 | } rect_t; |
WiredHome | 81:01da2e34283d | 50 | |
WiredHome | 77:9206c13aa527 | 51 | typedef struct |
WiredHome | 77:9206c13aa527 | 52 | { |
WiredHome | 77:9206c13aa527 | 53 | int32_t An, Bn, Cn, Dn, En, Fn, Divider; |
WiredHome | 77:9206c13aa527 | 54 | } tpMatrix_t; |
WiredHome | 77:9206c13aa527 | 55 | |
WiredHome | 32:0e4f2ae512e2 | 56 | /// color type definition to let the compiler help keep us honest. |
WiredHome | 32:0e4f2ae512e2 | 57 | /// |
WiredHome | 32:0e4f2ae512e2 | 58 | /// colors can be defined with the RGB(r,g,b) macro, and there |
WiredHome | 32:0e4f2ae512e2 | 59 | /// are a number of predefined colors: |
WiredHome | 32:0e4f2ae512e2 | 60 | /// - Black, Blue, Green, Cyan, |
WiredHome | 32:0e4f2ae512e2 | 61 | /// - Red, Magenta, Brown, Gray, |
WiredHome | 32:0e4f2ae512e2 | 62 | /// - Charcoal, BrightBlue, BrightGreen, BrightCyan, |
WiredHome | 32:0e4f2ae512e2 | 63 | /// - Orange, Pink, Yellow, White |
WiredHome | 32:0e4f2ae512e2 | 64 | /// |
WiredHome | 32:0e4f2ae512e2 | 65 | typedef uint16_t color_t; |
WiredHome | 32:0e4f2ae512e2 | 66 | |
WiredHome | 32:0e4f2ae512e2 | 67 | /// background fill info for drawing Text, Rectangles, RoundedRectanges, Circles, Ellipses and Triangles. |
WiredHome | 32:0e4f2ae512e2 | 68 | typedef enum |
WiredHome | 32:0e4f2ae512e2 | 69 | { |
WiredHome | 32:0e4f2ae512e2 | 70 | NOFILL, ///< do not fill the object with the background color |
WiredHome | 32:0e4f2ae512e2 | 71 | FILL ///< fill the object space with the background color |
WiredHome | 32:0e4f2ae512e2 | 72 | } fill_t; |
WiredHome | 32:0e4f2ae512e2 | 73 | |
WiredHome | 31:c72e12cd5c67 | 74 | #endif // DISPLAYDEFS_H |