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