add fonts and draw text functions.
This commit is contained in:
		
							
								
								
									
										23
									
								
								include/fonts.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								include/fonts.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,23 @@
 | 
			
		||||
#ifndef __FONTS_H
 | 
			
		||||
#define __FONTS_H
 | 
			
		||||
 | 
			
		||||
#define MAX_HEIGHT_FONT         41
 | 
			
		||||
#define MAX_WIDTH_FONT          32
 | 
			
		||||
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
 | 
			
		||||
//ASCII
 | 
			
		||||
typedef struct _tFont
 | 
			
		||||
{
 | 
			
		||||
    const uint8_t *table;
 | 
			
		||||
    uint16_t Width;
 | 
			
		||||
    uint16_t Height;
 | 
			
		||||
} sFONT;
 | 
			
		||||
 | 
			
		||||
extern sFONT Font24;
 | 
			
		||||
extern sFONT Font20;
 | 
			
		||||
extern sFONT Font16;
 | 
			
		||||
extern sFONT Font12;
 | 
			
		||||
extern sFONT Font8;
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
@@ -5,6 +5,9 @@
 | 
			
		||||
 | 
			
		||||
void fb_draw_pixel(uint16_t *image, uint16_t x, uint16_t y, uint16_t color);
 | 
			
		||||
void fb_draw_line(uint16_t *image, int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);
 | 
			
		||||
void fb_draw_char(uint16_t *image, uint16_t Xpoint, uint16_t Ypoint, const char Acsii_Char, sFONT* Font, uint16_t Color_Foreground);
 | 
			
		||||
void fb_draw_string(uint16_t *image, uint16_t Xstart, uint16_t Ystart, const char * pString, sFONT* Font, uint16_t Color_Foreground);
 | 
			
		||||
 | 
			
		||||
void fb_load_image(uint16_t *dst, uint16_t *src, uint32_t length);
 | 
			
		||||
void fb_set_image(uint16_t *dst, uint16_t value, uint32_t length);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1340
									
								
								src/font12.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1340
									
								
								src/font12.c
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										1720
									
								
								src/font16.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1720
									
								
								src/font16.c
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										2100
									
								
								src/font20.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2100
									
								
								src/font20.c
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										2480
									
								
								src/font24.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2480
									
								
								src/font24.c
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										960
									
								
								src/font8.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										960
									
								
								src/font8.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,960 @@
 | 
			
		||||
#include "fonts.h"
 | 
			
		||||
 | 
			
		||||
const uint8_t Font8_Table[] = 
 | 
			
		||||
{
 | 
			
		||||
	// @0 ' ' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @8 '!' (5 pixels wide)
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @16 '"' (5 pixels wide)
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @24 '#' (5 pixels wide)
 | 
			
		||||
	0x28, //   # #
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0xF8, // #####
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0xF8, // #####
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0xA0, // # #  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @32 '$' (5 pixels wide)
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x60, //  ##  
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x60, //  ##  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @40 '%' (5 pixels wide)
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x18, //    ##
 | 
			
		||||
	0x60, //  ##  
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @48 '&' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x38, //   ###
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x60, //  ##  
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x78, //  ####
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @56 ''' (5 pixels wide)
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @64 '(' (5 pixels wide)
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @72 ')' (5 pixels wide)
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @80 '*' (5 pixels wide)
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @88 '+' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0xF8, // #####
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @96 ',' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @104 '-' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @112 '.' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @120 '/' (5 pixels wide)
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x80, // #    
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @128 '0' (5 pixels wide)
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @136 '1' (5 pixels wide)
 | 
			
		||||
	0x60, //  ##  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0xF8, // #####
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @144 '2' (5 pixels wide)
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @152 '3' (5 pixels wide)
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x60, //  ##  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @160 '4' (5 pixels wide)
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x78, //  ####
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x38, //   ###
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @168 '5' (5 pixels wide)
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x60, //  ##  
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @176 '6' (5 pixels wide)
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x60, //  ##  
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x60, //  ##  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @184 '7' (5 pixels wide)
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @192 '8' (5 pixels wide)
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @200 '9' (5 pixels wide)
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x60, //  ##  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @208 ':' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @216 ';' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @224 '<' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0xC0, // ##   
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @232 '=' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @240 '>' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x18, //    ##
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @248 '?' (5 pixels wide)
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @256 '@' (5 pixels wide)
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x58, //  # ##
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x38, //   ###
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @264 'A' (5 pixels wide)
 | 
			
		||||
	0x60, //  ##  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x88, // #   #
 | 
			
		||||
	0xD8, // ## ##
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @272 'B' (5 pixels wide)
 | 
			
		||||
	0xF0, // #### 
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0xF0, // #### 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @280 'C' (5 pixels wide)
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @288 'D' (5 pixels wide)
 | 
			
		||||
	0xF0, // #### 
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0xF0, // #### 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @296 'E' (5 pixels wide)
 | 
			
		||||
	0xF8, // #####
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x60, //  ##  
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0xF8, // #####
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @304 'F' (5 pixels wide)
 | 
			
		||||
	0xF8, // #####
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x60, //  ##  
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0xE0, // ###  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @312 'G' (5 pixels wide)
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x58, //  # ##
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @320 'H' (5 pixels wide)
 | 
			
		||||
	0xE8, // ### #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x78, //  ####
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0xE8, // ### #
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @328 'I' (5 pixels wide)
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @336 'J' (5 pixels wide)
 | 
			
		||||
	0x38, //   ###
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @344 'K' (5 pixels wide)
 | 
			
		||||
	0xD8, // ## ##
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x60, //  ##  
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0xD8, // ## ##
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @352 'L' (5 pixels wide)
 | 
			
		||||
	0xE0, // ###  
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0xF8, // #####
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @360 'M' (5 pixels wide)
 | 
			
		||||
	0xD8, // ## ##
 | 
			
		||||
	0xD8, // ## ##
 | 
			
		||||
	0xD8, // ## ##
 | 
			
		||||
	0xA8, // # # #
 | 
			
		||||
	0x88, // #   #
 | 
			
		||||
	0xD8, // ## ##
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @368 'N' (5 pixels wide)
 | 
			
		||||
	0xD8, // ## ##
 | 
			
		||||
	0x68, //  ## #
 | 
			
		||||
	0x68, //  ## #
 | 
			
		||||
	0x58, //  # ##
 | 
			
		||||
	0x58, //  # ##
 | 
			
		||||
	0xE8, // ### #
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @376 'O' (5 pixels wide)
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @384 'P' (5 pixels wide)
 | 
			
		||||
	0xF0, // #### 
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0xE0, // ###  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @392 'Q' (5 pixels wide)
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x18, //    ##
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @400 'R' (5 pixels wide)
 | 
			
		||||
	0xF0, // #### 
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0xE8, // ### #
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @408 'S' (5 pixels wide)
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @416 'T' (5 pixels wide)
 | 
			
		||||
	0xF8, // #####
 | 
			
		||||
	0xA8, // # # #
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @424 'U' (5 pixels wide)
 | 
			
		||||
	0xD8, // ## ##
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @432 'V' (5 pixels wide)
 | 
			
		||||
	0xD8, // ## ##
 | 
			
		||||
	0x88, // #   #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @440 'W' (5 pixels wide)
 | 
			
		||||
	0xD8, // ## ##
 | 
			
		||||
	0x88, // #   #
 | 
			
		||||
	0xA8, // # # #
 | 
			
		||||
	0xA8, // # # #
 | 
			
		||||
	0xA8, // # # #
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @448 'X' (5 pixels wide)
 | 
			
		||||
	0xD8, // ## ##
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0xD8, // ## ##
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @456 'Y' (5 pixels wide)
 | 
			
		||||
	0xD8, // ## ##
 | 
			
		||||
	0x88, // #   #
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @464 'Z' (5 pixels wide)
 | 
			
		||||
	0x78, //  ####
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x78, //  ####
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @472 '[' (5 pixels wide)
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @480 '\' (5 pixels wide)
 | 
			
		||||
	0x80, // #    
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @488 ']' (5 pixels wide)
 | 
			
		||||
	0x60, //  ##  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x60, //  ##  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @496 '^' (5 pixels wide)
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @504 '_' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0xF8, // #####
 | 
			
		||||
 | 
			
		||||
	// @512 '`' (5 pixels wide)
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @520 'a' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x78, //  ####
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @528 'b' (5 pixels wide)
 | 
			
		||||
	0xC0, // ##   
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0xF0, // #### 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @536 'c' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @544 'd' (5 pixels wide)
 | 
			
		||||
	0x18, //    ##
 | 
			
		||||
	0x08, //     #
 | 
			
		||||
	0x38, //   ###
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x38, //   ###
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @552 'e' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @560 'f' (5 pixels wide)
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @568 'g' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x38, //   ###
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x38, //   ###
 | 
			
		||||
	0x08, //     #
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
 | 
			
		||||
	// @576 'h' (5 pixels wide)
 | 
			
		||||
	0xC0, // ##   
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0xE8, // ### #
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @584 'i' (5 pixels wide)
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x60, //  ##  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @592 'j' (5 pixels wide)
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
 | 
			
		||||
	// @600 'k' (5 pixels wide)
 | 
			
		||||
	0xC0, // ##   
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x58, //  # ##
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0xD8, // ## ##
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @608 'l' (5 pixels wide)
 | 
			
		||||
	0x60, //  ##  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @616 'm' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0xD0, // ## # 
 | 
			
		||||
	0xA8, // # # #
 | 
			
		||||
	0xA8, // # # #
 | 
			
		||||
	0xA8, // # # #
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @624 'n' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0xF0, // #### 
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0xC8, // ##  #
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @632 'o' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @640 'p' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0xF0, // #### 
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0xE0, // ###  
 | 
			
		||||
 | 
			
		||||
	// @648 'q' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x38, //   ###
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x38, //   ###
 | 
			
		||||
	0x08, //     #
 | 
			
		||||
	0x18, //    ##
 | 
			
		||||
 | 
			
		||||
	// @656 'r' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x78, //  ####
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x70, //  ### 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @664 's' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x60, //  ##  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @672 't' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0xF0, // #### 
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @680 'u' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0xD8, // ## ##
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x38, //   ###
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @688 'v' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0xC8, // ##  #
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @696 'w' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0xD8, // ## ##
 | 
			
		||||
	0xA8, // # # #
 | 
			
		||||
	0xA8, // # # #
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @704 'x' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x48, //  #  #
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @712 'y' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0xD8, // ## ##
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x60, //  ##  
 | 
			
		||||
 | 
			
		||||
	// @720 'z' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x78, //  ####
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x28, //   # #
 | 
			
		||||
	0x78, //  ####
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @728 '{' (5 pixels wide)
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x60, //  ##  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x10, //    # 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @736 '|' (5 pixels wide)
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @744 '}' (5 pixels wide)
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x30, //   ## 
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x20, //   #  
 | 
			
		||||
	0x40, //  #   
 | 
			
		||||
	0x00, //      
 | 
			
		||||
 | 
			
		||||
	// @752 '~' (5 pixels wide)
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x28, //   # #
 | 
			
		||||
	0x50, //  # # 
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
	0x00, //      
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
sFONT Font8 = {
 | 
			
		||||
  Font8_Table,
 | 
			
		||||
  5, /* Width */
 | 
			
		||||
  8, /* Height */
 | 
			
		||||
};
 | 
			
		||||
@@ -2,6 +2,7 @@
 | 
			
		||||
#include <stddef.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
 | 
			
		||||
#include "fonts.h"
 | 
			
		||||
#include "framebuffer.h"
 | 
			
		||||
 | 
			
		||||
void fb_draw_pixel(uint16_t *image, uint16_t x, uint16_t y, uint16_t color)
 | 
			
		||||
@@ -56,6 +57,56 @@ void fb_draw_line(uint16_t *image, int16_t x0, int16_t y0, int16_t x1, int16_t y
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void fb_draw_char(uint16_t *image, uint16_t Xpoint, uint16_t Ypoint, const char Acsii_Char, sFONT* Font, uint16_t Color_Foreground)
 | 
			
		||||
{
 | 
			
		||||
    uint16_t Page, Column;
 | 
			
		||||
 | 
			
		||||
    uint32_t Char_Offset = (Acsii_Char - ' ') * Font->Height * (Font->Width / 8 + (Font->Width % 8 ? 1 : 0));
 | 
			
		||||
    const unsigned char *ptr = &Font->table[Char_Offset];
 | 
			
		||||
 | 
			
		||||
    for (Page = 0; Page < Font->Height; Page ++ ) {
 | 
			
		||||
        for (Column = 0; Column < Font->Width; Column ++ ) {
 | 
			
		||||
            if (*ptr & (0x80 >> (Column % 8))) {
 | 
			
		||||
                fb_draw_pixel(image, Xpoint + Column, Ypoint + Page, Color_Foreground);
 | 
			
		||||
            }
 | 
			
		||||
            //One pixel is 8 bits
 | 
			
		||||
            if (Column % 8 == 7) {
 | 
			
		||||
                ptr++;
 | 
			
		||||
            }
 | 
			
		||||
        }// Write a line
 | 
			
		||||
        if (Font->Width % 8 != 0) {
 | 
			
		||||
            ptr++;
 | 
			
		||||
        }
 | 
			
		||||
    }// Write all
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void fb_draw_string(uint16_t *image, uint16_t Xstart, uint16_t Ystart, const char * pString, sFONT* Font, uint16_t Color_Foreground)
 | 
			
		||||
{
 | 
			
		||||
    uint16_t Xpoint = Xstart, Ypoint = Ystart;
 | 
			
		||||
 | 
			
		||||
    while (* pString != '\0') {
 | 
			
		||||
        //if X direction filled , reposition to(Xstart,Ypoint),Ypoint is Y direction plus the Height of the character
 | 
			
		||||
        if ((Xpoint + Font->Width ) > 240 ) {
 | 
			
		||||
            Xpoint = Xstart;
 | 
			
		||||
            Ypoint += Font->Height;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // If the Y direction is full, reposition to(Xstart, Ystart)
 | 
			
		||||
        if ((Ypoint  + Font->Height ) > 240 ) {
 | 
			
		||||
            Xpoint = Xstart;
 | 
			
		||||
            Ypoint = Ystart;
 | 
			
		||||
        }
 | 
			
		||||
        fb_draw_char(image, Xpoint, Ypoint, * pString, Font, Color_Foreground);
 | 
			
		||||
 | 
			
		||||
        //The next character of the address
 | 
			
		||||
        pString ++;
 | 
			
		||||
 | 
			
		||||
        //The next word of the abscissa increases the font of the broadband
 | 
			
		||||
        Xpoint += Font->Width;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void fb_load_image(uint16_t *dst, uint16_t *src, uint32_t length)
 | 
			
		||||
{
 | 
			
		||||
    assert(NULL != dst);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										20
									
								
								src/main.c
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								src/main.c
									
									
									
									
									
								
							@@ -1,6 +1,7 @@
 | 
			
		||||
#include <assert.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <math.h>
 | 
			
		||||
@@ -9,6 +10,7 @@
 | 
			
		||||
#include "board.h"
 | 
			
		||||
#include "driver.h"
 | 
			
		||||
#include "clock_face.h"
 | 
			
		||||
#include "fonts.h"
 | 
			
		||||
#include "framebuffer.h"
 | 
			
		||||
 | 
			
		||||
uint16_t image[240 * 240];
 | 
			
		||||
@@ -40,7 +42,19 @@ int main(void)
 | 
			
		||||
        T = time(NULL);
 | 
			
		||||
        tm = *localtime(&T);
 | 
			
		||||
 | 
			
		||||
        min_angle = (360 / 60) * tm.tm_min;
 | 
			
		||||
        // date frame
 | 
			
		||||
        fb_draw_line(image, 158, 108, 183, 108, 0xffff);
 | 
			
		||||
        fb_draw_line(image, 158, 108, 158, 127, 0xffff);
 | 
			
		||||
        fb_draw_line(image, 183, 108, 183, 127, 0xffff);
 | 
			
		||||
        fb_draw_line(image, 158, 127, 183, 127, 0xffff);
 | 
			
		||||
 | 
			
		||||
        // date - day
 | 
			
		||||
        char date_str[3] = {'\0', '\0', '\0'};
 | 
			
		||||
        snprintf(date_str, 3, "%d", tm.tm_mday);
 | 
			
		||||
        fb_draw_string(image, 160, 112, date_str, &Font16, 0xffff);
 | 
			
		||||
 | 
			
		||||
        //  minute pointer
 | 
			
		||||
        min_angle = (360 / 60) * tm.tm_min + 270;
 | 
			
		||||
        if(min_angle >= 360.0) {
 | 
			
		||||
            min_angle -= 360.0;
 | 
			
		||||
        }
 | 
			
		||||
@@ -49,7 +63,8 @@ int main(void)
 | 
			
		||||
        dest_y = root_y + min_len * sin(min_angle * M_PI / 180);
 | 
			
		||||
        fb_draw_line(image, (uint16_t)root_x, (uint16_t)root_y, (uint16_t)dest_x, (uint16_t)dest_y, 0xffff);
 | 
			
		||||
 | 
			
		||||
        std_angle = 0.5 * (60 * tm.tm_hour + tm.tm_min);
 | 
			
		||||
        // hour pointer
 | 
			
		||||
        std_angle = 0.5 * (60 * tm.tm_hour + tm.tm_min) + 270;
 | 
			
		||||
        if(std_angle >= 360.0) {
 | 
			
		||||
            std_angle -= 360.0;
 | 
			
		||||
        }
 | 
			
		||||
@@ -59,6 +74,7 @@ int main(void)
 | 
			
		||||
        fb_draw_line(image, (uint16_t)root_x, (uint16_t)root_y, (uint16_t)dest_x, (uint16_t)dest_y, 0xffff);
 | 
			
		||||
 | 
			
		||||
        drv_write(&lcd_drv, (const char *)image, 240 * 240);
 | 
			
		||||
 | 
			
		||||
        sleep(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user