00001
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 #ifndef _ET024006DHU_H_
00049 #define _ET024006DHU_H_
00050
00051
00052
00053 #include <stdint.h>
00054 #include <stdbool.h>
00055
00056
00057
00058
00059
00060 #define ET024006_WIDTH 320
00061 #define ET024006_HEIGHT 240
00062
00063 #define ET024006_IFACE_MODE_EBI 0
00064 #define ET024006_IFACE_MODE_SPI 1
00065
00066 #define BLACK 0x0000
00067 #define BLUE 0x001F
00068 #define RED 0xF800
00069 #define GREEN 0x07E0
00070 #define WHITE 0xFFFF
00071
00072 #define BLUE_LEV( level) ( (level)&BLUE ) // level is in [0; 31]
00073 #define GREEN_LEV(level) ( (((level)*2)<<5)&GREEN ) // level is in [0; 31]
00074 #define RED_LEV( level) ( ((level)<<(5+6))&RED ) // level is in [0; 31]
00075 #define GRAY_LEV( level) ( BLUE_LEV(level) | GREEN_LEV(level) | RED_LEV(level) ) // level is in [0; 31]
00076
00077
00078
00082 typedef uint16_t et024006_color_t;
00083
00084
00085
00086
00087 #ifdef __cplusplus
00088 extern "C" {
00089 #endif
00090
00091 extern const unsigned char FONT6x8[97][8];
00092 extern const unsigned char FONT8x8[97][8];
00093 extern const unsigned char FONT8x16[97][16];
00094 void et024006_PrintString(char *lcd_string, const unsigned char *font_style,
00095 uint16_t x,
00096 uint16_t y,
00097 uint16_t fcolor,
00098 int bcolor);
00099
00100 void et024006_Init( unsigned long cpu_hz, unsigned long hsb_hz );
00101
00106 int et024006_TestDisplay( void);
00107
00117 void et024006_ScrollAreaSetup(uint16_t tfa, uint16_t vsa, uint16_t bfa);
00118
00124 void et024006_Scroll(int16_t lines);
00125
00128 void et024006_ScrollEnable(void);
00129
00132 void et024006_ScrollDisable(void);
00133
00134 et024006_color_t et024006_Color( uint8_t r, uint8_t g, uint8_t b );
00135
00136 void et024006_DrawPixel( uint16_t x, uint16_t y, et024006_color_t color );
00137
00138 et024006_color_t et024006_GetPixel( uint16_t x, uint16_t y );
00139
00140 void et024006_DrawHorizLine( uint16_t x, uint16_t y, uint16_t length, et024006_color_t color );
00141
00142 void et024006_DrawVertLine( uint16_t x, uint16_t y, uint16_t length, et024006_color_t color );
00143
00144 void et024006_DrawLine( uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, et024006_color_t color );
00145
00146 void et024006_DrawFilledRect( uint16_t x, uint16_t y, uint16_t width, uint16_t height, et024006_color_t color );
00147
00163 void et024006_DrawFilledCircle(
00164 uint16_t x, uint16_t y,
00165 uint16_t radius,
00166 uint16_t color,
00167 uint8_t quadrantMask );
00168
00174 #define ET024006_BITMAP_WIDTH(width) Align_up(width/8, 8)
00175
00192 void et024006_PutBitmap(
00193 void *bitmap,
00194 uint16_t map_width,
00195 uint16_t x,
00196 uint16_t y,
00197 uint16_t width,
00198 uint16_t height,
00199 et024006_color_t foreground_color,
00200 et024006_color_t background_color
00201 );
00202
00203 void et024006_PutPixmap(
00204 et024006_color_t const * pixmap,
00205 uint16_t map_width,
00206 uint16_t map_x,
00207 uint16_t map_y,
00208 uint16_t x,
00209 uint16_t y,
00210 uint16_t width,
00211 uint16_t height
00212 );
00213
00214 void et024006_GetPixmap(
00215 et024006_color_t * pixmap,
00216 uint16_t map_width,
00217 uint16_t map_x,
00218 uint16_t map_y,
00219 uint16_t x,
00220 uint16_t y,
00221 uint16_t width,
00222 uint16_t height
00223 );
00224 void et024006_DrawBitmap( const uint16_t data[], U16 columnOffset, U16 rowOffset );
00225 #ifdef __cplusplus
00226 }
00227 #endif
00228
00229 #endif // _ET024006DHU_H_
00230