Creating my own font table for the OLED

This commit is contained in:
Ben V. Brown
2016-09-17 21:13:15 +10:00
parent 4db03d5832
commit c7e2713004
6 changed files with 132 additions and 81 deletions

View File

@@ -6,7 +6,7 @@
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/> <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/> <provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/> <provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-1108237618066810324" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true"> <provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-1081329009722510400" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/> <language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/> <language-scope id="org.eclipse.cdt.core.g++"/>
</provider> </provider>
@@ -18,7 +18,7 @@
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/> <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/> <provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/> <provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-1102374516241012504" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true"> <provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-1141623289925788796" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/> <language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/> <language-scope id="org.eclipse.cdt.core.g++"/>
</provider> </provider>

View File

@@ -0,0 +1,67 @@
/*
* Font.h
*
* Created on: 17 Sep 2016
* Author: Ralim
*/
#ifndef FONT_H_
#define FONT_H_
const u8 FONT[]={
0x00,0x00,0x00,0xE0,0x18,0x06,0x18,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1C,0x03,0x02,0x02,0x02,0x02,0x02,0x03,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,/*A*/
0x00,0xFE,0x42,0x42,0x42,0x42,0x42,0x62,0x9C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x10,0x10,0x10,0x10,0x10,0x10,0x08,0x07,0x00,0x00,0x00,0x00,0x00,0x00,/*B*/
0x00,0xF0,0x0C,0x04,0x02,0x02,0x02,0x02,0x04,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x03,0x0C,0x08,0x10,0x10,0x10,0x10,0x08,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,/*C*/
0x00,0xFE,0x02,0x02,0x02,0x02,0x02,0x04,0x04,0x18,0xE0,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x10,0x10,0x10,0x10,0x10,0x08,0x08,0x06,0x01,0x00,0x00,0x00,0x00,0x00,/*D*/
0x00,0xFE,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*E*/
0x00,0xFE,0x42,0x42,0x42,0x42,0x42,0x42,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*F*/
0x00,0xF0,0x0C,0x04,0x02,0x02,0x02,0x82,0x82,0x84,0x8C,0x00,0x00,0x00,0x00,0x00,
0x00,0x03,0x0C,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x0F,0x00,0x00,0x00,0x00,0x00,/*G*/
0x00,0xFE,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xFE,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,/*H*/
0x00,0x02,0x02,0xFE,0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x10,0x10,0x1F,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*I*/
0x00,0x00,0x00,0x02,0x02,0x02,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x10,0x10,0x10,0x10,0x08,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*J*/
0x00,0xFE,0x00,0x80,0xC0,0x20,0x10,0x08,0x04,0x02,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x01,0x00,0x00,0x01,0x02,0x04,0x08,0x10,0x00,0x00,0x00,0x00,0x00,0x00,/*K*/
0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*L*/
0x00,0xFE,0x06,0x18,0x60,0x80,0x00,0x80,0x60,0x18,0x06,0xFE,0x00,0x00,0x00,0x00,
0x00,0x1F,0x00,0x00,0x00,0x01,0x06,0x01,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,/*M*/
0x00,0xFE,0x04,0x08,0x30,0x40,0x80,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x01,0x06,0x08,0x1F,0x00,0x00,0x00,0x00,0x00,/*N*/
0x00,0xF0,0x0C,0x04,0x02,0x02,0x02,0x02,0x02,0x04,0x0C,0xF0,0x00,0x00,0x00,0x00,
0x00,0x03,0x0C,0x08,0x10,0x10,0x10,0x10,0x10,0x08,0x0C,0x03,0x00,0x00,0x00,0x00,/*O*/
0x00,0xFE,0x02,0x02,0x02,0x02,0x02,0x84,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*P*/
0x00,0xF0,0x0C,0x04,0x02,0x02,0x02,0x02,0x02,0x04,0x0C,0xF0,0x00,0x00,0x00,0x00,
0x00,0x03,0x0C,0x08,0x10,0x10,0x10,0x70,0x90,0x88,0x8C,0x83,0x00,0x00,0x00,0x00,/*Q*/
0x00,0xFE,0x82,0x82,0x82,0x82,0x82,0x44,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x00,0x00,0x00,0x00,0x01,0x02,0x04,0x08,0x10,0x00,0x00,0x00,0x00,0x00,/*R*/
0x00,0x38,0x44,0x42,0x42,0x82,0x82,0x84,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x04,0x08,0x10,0x10,0x10,0x10,0x08,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*S*/
0x00,0x02,0x02,0x02,0x02,0xFE,0x02,0x02,0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*T*/
0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,
0x00,0x07,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x08,0x07,0x00,0x00,0x00,0x00,0x00,/*U*/
0x00,0x0E,0x30,0xC0,0x00,0x00,0x00,0xC0,0x30,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x01,0x06,0x18,0x06,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*V*/
0x00,0x0E,0xF0,0x00,0x00,0x00,0xC0,0x38,0x06,0x38,0xC0,0x00,0x00,0x00,0xF0,0x0E,
0x00,0x00,0x00,0x07,0x18,0x07,0x00,0x00,0x00,0x00,0x00,0x07,0x18,0x07,0x00,0x00,/*W*/
0x00,0x02,0x04,0x18,0x20,0xC0,0x20,0x18,0x04,0x02,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x10,0x08,0x06,0x01,0x00,0x01,0x06,0x08,0x10,0x00,0x00,0x00,0x00,0x00,0x00,/*X*/
0x00,0x02,0x0C,0x10,0x60,0x80,0x60,0x10,0x0C,0x02,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*Y*/
0x00,0x02,0x02,0x02,0x02,0xC2,0x22,0x12,0x0A,0x06,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x18,0x14,0x12,0x11,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,/*Z*/
};
#endif /* FONT_H_ */

View File

@@ -29,5 +29,9 @@ void Reg_Command(u8 posi,u8 flag);
void Clear_Screen(void); void Clear_Screen(void);
void Write_InitCommand_data(u32 Com_len,u8* data); void Write_InitCommand_data(u32 Com_len,u8* data);
void Display_BG(void); void Display_BG(void);
void OLED_DrawString(char* string, uint8_t length);
#endif #endif
/******************************** END OF FILE *********************************/ /******************************** END OF FILE *********************************/

View File

@@ -1,27 +1,37 @@
#ifndef _WORDLIB_H #ifndef _WORDLIB_H
#define _WORDLIB_H #define _WORDLIB_H
const u8 wordlib[] = { //16*16 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> const u8 wordlib[] = { //16*16 chars
0x00,0x00,0x00,0xF8,0xFE,0x03,0x01,0x01,0x01,0x03,0xFE,0xFC,0xF0,0x00,0x00,0x00, 0x00,0x00,0x00,0xF8,0xFE,0x03,0x01,0x01,0x01,0x03,0xFE,0xFC,0xF0,0x00,0x00,0x00,
0x00,0x00,0x00,0x3F,0x7F,0xE0,0x80,0x80,0x80,0xC0,0x7F,0x3F,0x07,0x00,0x00,0x00,/*"0",0*/ 0x00,0x00,0x00,0x3F,0x7F,0xE0,0x80,0x80,0x80,0xC0,0x7F,0x3F,0x07,0x00,0x00,0x00,/*"0",0*/
0x00,0x00,0x00,0x08,0x04,0x04,0x06,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x08,0x04,0x04,0x06,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x80,0x80,0x80,0xFF,0xFF,0x80,0x80,0x80,0x00,0x00,0x00,0x00,/*"1",1*/ 0x00,0x00,0x00,0x00,0x80,0x80,0x80,0xFF,0xFF,0x80,0x80,0x80,0x00,0x00,0x00,0x00,/*"1",1*/
0x00,0x00,0x00,0x06,0x07,0x01,0x01,0x01,0x81,0xC3,0x7F,0x3E,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x06,0x07,0x01,0x01,0x01,0x81,0xC3,0x7F,0x3E,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xE0,0xF0,0xD8,0xCC,0xC6,0xC3,0xC0,0xC0,0xE0,0x00,0x00,0x00,0x00,/*"2",2*/ 0x00,0x00,0x00,0xE0,0xF0,0xD8,0xCC,0xC6,0xC3,0xC0,0xC0,0xE0,0x00,0x00,0x00,0x00,/*"2",2*/
0x00,0x00,0x00,0x06,0x07,0x81,0x81,0x81,0xC1,0x63,0x3F,0x1E,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x06,0x07,0x81,0x81,0x81,0xC1,0x63,0x3F,0x1E,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xE0,0xC0,0x80,0x80,0x81,0x81,0xC3,0x7F,0x3E,0x00,0x00,0x00,0x00,/*"3",3*/ 0x00,0x00,0x00,0xE0,0xC0,0x80,0x80,0x81,0x81,0xC3,0x7F,0x3E,0x00,0x00,0x00,0x00,/*"3",3*/
0x00,0x00,0x00,0x00,0xC0,0x60,0x38,0x0C,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0xC0,0x60,0x38,0x0C,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x06,0x07,0x05,0x04,0x04,0x84,0xFF,0xFF,0xC4,0x84,0x06,0x00,0x00,0x00,/*"4",4*/ 0x00,0x00,0x06,0x07,0x05,0x04,0x04,0x84,0xFF,0xFF,0xC4,0x84,0x06,0x00,0x00,0x00,/*"4",4*/
0x00,0x00,0x00,0xFF,0xFF,0x83,0x83,0x83,0x83,0x83,0x83,0x03,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0xFF,0xFF,0x83,0x83,0x83,0x83,0x83,0x83,0x03,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xE0,0xC0,0x80,0x80,0x80,0x80,0xC1,0x7F,0x3F,0x08,0x00,0x00,0x00,/*"5",5*/ 0x00,0x00,0x00,0xE0,0xC0,0x80,0x80,0x80,0x80,0xC1,0x7F,0x3F,0x08,0x00,0x00,0x00,/*"5",5*/
0x00,0x00,0x00,0xE0,0xF8,0x9C,0x8E,0xC2,0xC3,0xC1,0x81,0x81,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0xE0,0xF8,0x9C,0x8E,0xC2,0xC3,0xC1,0x81,0x81,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x3F,0x7F,0xC0,0x80,0x80,0x80,0x80,0xC1,0x7F,0x3F,0x00,0x00,0x00,/*"6",6*/ 0x00,0x00,0x00,0x3F,0x7F,0xC0,0x80,0x80,0x80,0x80,0xC1,0x7F,0x3F,0x00,0x00,0x00,/*"6",6*/
0x00,0x00,0x00,0x0F,0x03,0x03,0x03,0x03,0x83,0xE3,0x3B,0x0F,0x03,0x00,0x00,0x00, 0x00,0x00,0x00,0x0F,0x03,0x03,0x03,0x03,0x83,0xE3,0x3B,0x0F,0x03,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x80,0xE0,0x78,0x1E,0x07,0x01,0x00,0x00,0x00,0x00,0x00,0x00,/*"7",7*/ 0x00,0x00,0x00,0x00,0x80,0xE0,0x78,0x1E,0x07,0x01,0x00,0x00,0x00,0x00,0x00,0x00,/*"7",7*/
0x00,0x00,0x18,0x7E,0x7E,0xC3,0x81,0x81,0x81,0x81,0x67,0x7E,0x3C,0x00,0x00,0x00, 0x00,0x00,0x18,0x7E,0x7E,0xC3,0x81,0x81,0x81,0x81,0x67,0x7E,0x3C,0x00,0x00,0x00,
0x00,0x00,0x1C,0x7E,0xFF,0xC1,0x80,0x80,0x80,0x81,0xE3,0x7F,0x3C,0x00,0x00,0x00,/*"8",8*/ 0x00,0x00,0x1C,0x7E,0xFF,0xC1,0x80,0x80,0x80,0x81,0xE3,0x7F,0x3C,0x00,0x00,0x00,/*"8",8*/
0x00,0x00,0x78,0xFE,0xC6,0x03,0x01,0x01,0x01,0x03,0x9E,0xFC,0xF0,0x00,0x00,0x00, 0x00,0x00,0x78,0xFE,0xC6,0x03,0x01,0x01,0x01,0x03,0x9E,0xFC,0xF0,0x00,0x00,0x00,
0x00,0x00,0x00,0x01,0x01,0x83,0x83,0xC3,0x61,0x71,0x3F,0x0F,0x01,0x00,0x00,0x00,/*"9",9*/ 0x00,0x00,0x00,0x01,0x01,0x83,0x83,0xC3,0x61,0x71,0x3F,0x0F,0x01,0x00,0x00,0x00,/*"9",9*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",10*/ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",10*/
@@ -31,16 +41,19 @@ const u8 wordlib[] = { //16*16
0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,//"-",12 0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,//"-",12
0x0E,0x11,0x11,0x0E,0xE0,0xF8,0x0C,0x06,0x03,0x01,0x01,0x01,0x01,0x02,0x1E,0x00, 0x0E,0x11,0x11,0x0E,0xE0,0xF8,0x0C,0x06,0x03,0x01,0x01,0x01,0x01,0x02,0x1E,0x00,
0x00,0x00,0x00,0x00,0x0F,0x3F,0x70,0xC0,0x80,0x80,0x80,0x80,0x80,0x40,0x20,0x00,/*"<EFBFBD><EFBFBD>",13*/ 0x00,0x00,0x00,0x00,0x0F,0x3F,0x70,0xC0,0x80,0x80,0x80,0x80,0x80,0x40,0x20,0x00,/*"deg C",13*/
0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00,0x00,0x00,//":",14 0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00,0x00,0x00,//":",14
0x08,0x14,0x22,0x14,0x08,0x02,0x02,0xFE,0x06,0x02,0x02,0x02,0xC2,0x02,0x06,0x1E, 0x08,0x14,0x22,0x14,0x08,0x02,0x02,0xFE,0x06,0x02,0x02,0x02,0xC2,0x02,0x06,0x1E,
0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xFF,0x81,0x81,0x01,0x01,0x03,0x00,0x00,0x00,/*"<EFBFBD>H",15*/ 0x00,0x00,0x00,0x00,0x00,0x80,0x80,0xFF,0x81,0x81,0x01,0x01,0x03,0x00,0x00,0x00,/*"Deg F",15*/
0xC0,0x30,0x08,0x04,0x04,0x02,0xFA,0xAA,0xFA,0x02,0x04,0x04,0x08,0x30,0xC0,0x00, 0xC0,0x30,0x08,0x04,0x04,0x02,0xFA,0xAA,0xFA,0x02,0x04,0x04,0x08,0x30,0xC0,0x00,
0x07,0x18,0x20,0x40,0x58,0xA4,0xDB,0xDE,0xDB,0xA4,0x58,0x40,0x20,0x18,0x07,0x00,/*"<EFBFBD>¶ȼ<EFBFBD>",16*/ 0x07,0x18,0x20,0x40,0x58,0xA4,0xDB,0xDE,0xDB,0xA4,0x58,0x40,0x20,0x18,0x07,0x00,/*"Temp Symbol",16*/
}; };
const u8 Maplib[] = { const u8 Maplib[] = {
@@ -120,50 +133,6 @@ const u8 Maplib1[] = {/* 14 * 16*/
0x3F,0x3F,0x00,0x01,0x01,0x01,0x01,0x01,0x07,0x05,0x05,0x06,0x02,0x01,0x00,0x00,/*"δ<><CEB4><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>",0*/ 0x3F,0x3F,0x00,0x01,0x01,0x01,0x01,0x01,0x07,0x05,0x05,0x06,0x02,0x01,0x00,0x00,/*"δ<><CEB4><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>",0*/
}; };
const u8 MiniTS[] = {/*16*16*/
0x01,0xF9,0xFF,0x3F,0xFF,0xF0,0x80,0x00,0x80,0xF0,0x7E,0xFF,0xFF,0xFF,0x01,0x01,
0x80,0xFF,0xFF,0x80,0x83,0x1F,0xFF,0xF8,0x3F,0x87,0x80,0xFF,0xFF,0xFF,0x80,0x80,/*"M",0*/
0x00,0x00,0x00,0x20,0x20,0x20,0x63,0xE3,0xE3,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x80,0x80,0x80,0x80,0xFF,0xFF,0x80,0x80,0x80,0x80,0x00,0x00,0x00,/*"i",1*/
0x00,0x20,0xE0,0xE0,0xE0,0xC0,0x40,0x60,0x20,0x20,0x60,0xC0,0xC0,0x00,0x00,0x00,
0x00,0x80,0xFF,0xFF,0xFF,0x80,0x80,0x00,0x00,0x80,0x80,0xFF,0xFF,0x80,0x80,0x00,/*"n",2*/
0x00,0x00,0x00,0x20,0x20,0x20,0x63,0xE3,0xE3,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x80,0x80,0x80,0x80,0xFF,0xFF,0x80,0x80,0x80,0x80,0x00,0x00,0x00,/*"i",3*/
0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"-",4*/
0x00,0x06,0x07,0x03,0x01,0x01,0xFF,0xFF,0xFF,0x01,0x01,0x01,0x03,0x0F,0x0C,0x00,
0x00,0x00,0x00,0x00,0x80,0x80,0xFF,0xFF,0xFF,0x80,0x80,0x00,0x00,0x00,0x00,0x00,/*"T",5*/
0x00,0x00,0x00,0x80,0xC0,0x40,0x60,0x20,0x20,0x60,0x40,0xC0,0x80,0x00,0x00,0x00,
0x00,0x0E,0x3F,0x7F,0xE1,0x80,0x80,0x80,0x80,0x80,0xC0,0x71,0x7F,0x3F,0x00,0x00,/*"o",6*/
0x00,0x00,0x00,0x80,0xC0,0x40,0x60,0x20,0x20,0x60,0x40,0xC0,0x80,0x00,0x00,0x00,
0x00,0x0E,0x3F,0x7F,0xE1,0x80,0x80,0x80,0x80,0x80,0xC0,0x71,0x7F,0x3F,0x00,0x00,/*"o",7*/
0x00,0x00,0x00,0x01,0x01,0x01,0x01,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x80,0x80,0x80,0x80,0xFF,0xFF,0x80,0x80,0x80,0x80,0x00,0x00,0x00,/*"l",8*/
0x00,0x00,0x00,0x80,0xC0,0x40,0x60,0x20,0x20,0x60,0x40,0xC0,0xC0,0x00,0x00,0x00,
0x00,0x00,0x20,0xE3,0xC3,0x86,0x86,0x84,0x8C,0x8C,0x8C,0xF8,0x78,0x30,0x00,0x00,/*"s",9*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",10*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",11*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",12*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",13*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",14*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",15*/
};
//const u8 Arrow[] = {/*16*16*/
// 0x00,0x03,0x0E,0x18,0x60,0xC3,0x06,0x18,0x70,0xC0,0x00,0x00,0x00,0x80,0x60,0x38,
// 0x0C,0x83,0xC1,0x30,0x0C,0x07,0x01,0x00,/*"<22><>",0*/
// 0x00,0x00,0xC0,0x60,0x18,0x0C,0xC3,0x71,0x18,0x06,0x03,0x00,0x00,0x01,0x03,0x0C,
// 0x30,0x61,0x87,0x0C,0x30,0xE0,0x80,0x00,/*"<22><>",0*/
// 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
// 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",0*/
//};
const u8 Triangle[] = {/*16*16*/ const u8 Triangle[] = {/*16*16*/
0x80,0x80,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x04,0x04,0xFE,0x00,0x00,0x00, 0x80,0x80,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x04,0x04,0xFE,0x00,0x00,0x00,
0x00,0x00,0x01,0x01,0x02,0x02,0x04,0x04,0x08,0x08,0x10,0x10,0x3F,0x00,0x00,0x00,/*"<22><><EFBFBD><EFBFBD>",0*/ 0x00,0x00,0x01,0x01,0x02,0x02,0x04,0x04,0x08,0x08,0x10,0x10,0x3F,0x00,0x00,0x00,/*"<22><><EFBFBD><EFBFBD>",0*/

View File

@@ -15,9 +15,8 @@
#include "Bios.h" #include "Bios.h"
#include "I2C.h" #include "I2C.h"
#include "Hardware.h" #include "Hardware.h"
#include "UI.h" #include "UI.h"
#include "Font.h"
//Setup params depending on oled model //Setup params depending on oled model
#ifdef SSD1316 #ifdef SSD1316
@@ -37,8 +36,7 @@ u8 gOled_param[46] = { 0x80, 0xAE, 0x80, 0xD5, 0x80, 0x52, 0x80, 0xA8, 0x80,
/******************************************************************************* /*******************************************************************************
*******************************************************************************/ *******************************************************************************/
void Sc_Pt(u8 Co) void Sc_Pt(u8 Co) {
{
u8 pt[4] = { 0x80, 0x81, 0x80, Co }; u8 pt[4] = { 0x80, 0x81, 0x80, Co };
I2C_PageWrite(pt, 4, DEVICEADDR_OLED); I2C_PageWrite(pt, 4, DEVICEADDR_OLED);
@@ -154,7 +152,7 @@ void Init_Oled(void) {
u8 param_len; u8 param_len;
OLED_RST(); OLED_RST();
Delay_Ms(2); Delay_Ms(2); //reset the oled
OLED_ACT(); OLED_ACT();
Delay_Ms(2); Delay_Ms(2);
@@ -178,7 +176,7 @@ void Clear_Screen(void) {
#ifdef SSD1316 #ifdef SSD1316
wd = 32; wd = 32;
#else #else
wd = 16; wd = 16; //how many lines the display is
#endif #endif
memset(&tx_data[0], 0, 128); memset(&tx_data[0], 0, 128);
@@ -186,7 +184,22 @@ void Clear_Screen(void) {
Oled_DrawArea(0, i * 8, 128, 8, tx_data); Oled_DrawArea(0, i * 8, 128, 8, tx_data);
} }
} }
void OLED_DrawString(char* string, uint8_t length) {
for (uint8_t i = 0; i < length; i++) {
OLED_DrawChar(string[i], i * 16);
}
}
void OLED_DrawChar(char c, uint8_t x) {
if ((x) > 112)
return; //Rudimentary clipping to not draw off screen
u8* ptr;
u8 temp;
if (c >= 'A' && c <= 'Z') {
ptr = (u8*) FONT;
ptr += (c - 'A') * 32;
Oled_DrawArea(x, 0, 16, 16, (u8*) ptr);
}
}
/******************************** END OF FILE *********************************/ /******************************** END OF FILE *********************************/

View File

@@ -632,10 +632,8 @@ void Show_HeatingIcon(u32 ht_flag, u16 active) {
} }
} }
/******************************************************************************* /*******************************************************************************
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: Display_Str Function:Display_Str
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:<3A><>ʾ16*16<31>ַ<EFBFBD><D6B7><EFBFBD> Description: Draws certain chars to the screen at certain locations
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:x: λ<><CEBB> str :<3A><>ʾ<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>
<20><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>:NULL
*******************************************************************************/ *******************************************************************************/
void Display_Str(u8 x, char* str) { void Display_Str(u8 x, char* str) {
u8* ptr; u8* ptr;
@@ -655,7 +653,7 @@ void Display_Str(u8 x, char* str) {
if ((temp >= 0x30) && (temp < 0x3a)) if ((temp >= 0x30) && (temp < 0x3a))
temp = temp - 0x30; /* 0 --9 */ temp = temp - 0x30; /* 0 --9 */
else { else {
if ((temp >= 0x41) && (temp <= 0x46)) if ((temp >= 0x41) && (temp <= 0x47))
temp = temp - 0x41 + 11;/*ABD*/ temp = temp - 0x41 + 11;/*ABD*/
else else
return; return;
@@ -914,12 +912,12 @@ void OLed_Display(void) {
} }
Display_Temp(1,temp_val/10); Display_Temp(1,temp_val/10);
Show_HeatingIcon(ht_flag,Get_MmaActive()); //0<><30><EFBFBD><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD>2<EFBFBD><32><EFBFBD><EFBFBD> Show_HeatingIcon(ht_flag,Get_MmaActive());
td_cnt++; td_cnt++;
} }
break; break;
case TEMP_SET: case TEMP_SET:
Temp_SetProc(); //<2F><><EFBFBD><EFBFBD> Temp_SetProc();
break; break;
case USB_POWER: case USB_POWER:
if(gCont == 1) { if(gCont == 1) {