//********背景颜色设置2 void Text_Background_Color(unsigned char setR, unsigned char setG, unsigned char setB) { Write_Command(0x60);//BGCR0 Write_Data(setR); Write_Command(0x61);//BGCR0 Write_Data(setG); Write_Command(0x62);//BGCR0 Write_Data(setB); }
//********前景颜色设置2 void Text_Foreground_Color(unsigned char setR,unsigned char setG,unsigned char setB) { Write_Command(0x63);//BGCR0 Write_Data(setR); Write_Command(0x64);//BGCR0 Write_Data(setG); Write_Command(0x65);//BGCR0· Write_Data(setB); }
//****************卷动窗口大小 void Scroll_Window(unsigned short XL,unsigned short XR ,unsigned short YT ,unsigned short YB) { unsigned char temp; temp=XL; Write_Command(0x38);//HSSW0 Write_Data(temp); temp=XL>>8; Write_Command(0x39);//HSSW1 Write_Data(temp); temp=XR; Write_Command(0x3c);//HESW0 Write_Data(temp); temp=XR>>8; Write_Command(0x3d);//HESW1 Write_Data(temp); temp=YT; Write_Command(0x3a);//VSSW0 Write_Data(temp); temp=YT>>8; Write_Command(0x3b);//VSSW1 Write_Data(temp); temp=YB; Write_Command(0x3e);//VESW0 Write_Data(temp); temp=YB>>8; Write_Command(0x3f);//VESW1 Write_Data(temp); }
/****************************************************************************** * DisplayCGRAM: * 函数原型: - * 函数功能: * 输入参数: * 输出参数: * 编写日期: 2014/04/13, ChenxianLong create this function ******************************************************************************/ void DisplayCGRAM(unsigned char x,unsigned char y) { switch(y) { case 1: Write_Cmd(0x80+x);break; case 2: Write_Cmd(0x90+x);break; case 3: Write_Cmd(0x88+x);break; case 4: Write_Cmd(0x98+x);break; default:break; } Write_Data(00); Write_Data(00); }
//********设置工作窗口区域 void Active_Window(unsigned long XL,unsigned long XR ,unsigned long YT ,unsigned long YB) { unsigned short temp; //setting active window X temp=XL; Write_Command(0x30);//HSAW0 Write_Data(temp); temp=XL>>8; Write_Command(0x31);//HSAW1 Write_Data(temp); temp=XR; Write_Command(0x34);//HEAW0 Write_Data(temp); temp=XR>>8; Write_Command(0x35);//HEAW1 Write_Data(temp); //setting active window Y temp=YT; Write_Command(0x32);//VSAW0 Write_Data(temp); temp=YT>>8; Write_Command(0x33);//VSAW1 Write_Data(temp); temp=YB; Write_Command(0x36);//VEAW0 Write_Data(temp); temp=YB>>8; Write_Command(0x37);//VEAW1 Write_Data(temp); }
//********椭圆曲线:中心点,长短轴 void Draw_Ellipse(unsigned short X,unsigned short Y,unsigned short R1,unsigned short R2) { unsigned char temp; temp=X; Write_Command(0xA5); Write_Data(temp); temp=X>>8; Write_Command(0xA6); Write_Data(temp); temp=Y; Write_Command(0xA7); Write_Data(temp); temp=Y>>8; Write_Command(0xA8); Write_Data(temp); temp=R1; Write_Command(0xA1); Write_Data(temp); temp=R1>>8; Write_Command(0xA2); Write_Data(temp); temp=R2; Write_Command(0xA3); Write_Data(temp); temp=R2>>8; Write_Command(0xA4); Write_Data(temp); }
//********画线、画矩形、三角形:起始坐标 void Draw_Line(unsigned short XS,unsigned short XE ,unsigned short YS,unsigned short YE) { unsigned char temp; temp=XS; Write_Command(0x91); Write_Data(temp); temp=XS>>8; Write_Command(0x92); Write_Data(temp); temp=XE; Write_Command(0x95); Write_Data(temp); temp=XE>>8; Write_Command(0x96); Write_Data(temp); temp=YS; Write_Command(0x93); Write_Data(temp); temp=YS>>8; Write_Command(0x94); Write_Data(temp); temp=YE; Write_Command(0x97); Write_Data(temp); temp=YE>>8; Write_Command(0x98); Write_Data(temp); }
void Layers_Progressive(void) { unsigned char temp; Write_Command(0x52);//LTPR0 temp = Read_Data(); temp&=0xf8; temp|=0x02; Write_Data(temp); Write_Command(0x53);//LTPR1 for(temp=0;temp<9;temp++) { Write_Data(temp); Delay10ms(100); } }
// ------------------------------------------------------ // Save a 303 pattern void Save_303(void) { FILE *in; char Temph[MAX_PATH]; char extension[10]; sprintf(extension, "TWNN3031"); sprintf(Temph, "Saving '%s.303' pattern in patterns directory...", tb303[sl3].pattern_name[tb303[sl3].selectedpattern]); Status_Box(Temph); sprintf(Temph, "%s"SLASH"%s.303", Dir_Patterns, tb303[sl3].pattern_name[tb303[sl3].selectedpattern]); in = fopen(Temph, "wb"); if(in != NULL) { Write_Data(extension, sizeof(char), 9, in); Save_303_Data(Write_Data, Write_Data_Swap, in, sl3, tb303[sl3].selectedpattern); fclose(in); Read_SMPT(); last_index = -1; Actualize_Files_List(0); Status_Box("303 pattern saved succesfully."); } else { Status_Box("303 pattern save failed."); } Clear_Input(); }
void Write_Data_U16(unsigned int y) { unsigned char m,n; m=y>>8; n=y; Write_Data(m,n); }
//********文字写入位置 void FontWrite_Position(unsigned short X,unsigned short Y) { unsigned char temp; temp=X; Write_Command(0x2A); Write_Data(temp); temp=X>>8; Write_Command(0x2B); Write_Data(temp); temp=Y; Write_Command(0x2C); Write_Data(temp); temp=Y>>8; Write_Command(0x2D); Write_Data(temp); }
//***********************BTE区域大小设置 void BTE_Size(unsigned short width,unsigned short height) { unsigned char temp; temp=width; Write_Command(0x5c);//BET读写区域宽度 Write_Data(temp); temp=width>>8; Write_Command(0x5d);//BET读写区域宽度 Write_Data(temp); temp=height; Write_Command(0x5e);//BET读写区域高度 Write_Data(temp); temp=height>>8; Write_Command(0x5f);//BET读写区域高度 Write_Data(temp); }
//****************光标显示位置 void Cursor_Position(unsigned short X,unsigned short Y) { unsigned char temp; temp=X; Write_Command(0x80);//GCHP0 Write_Data(temp); temp=X>>8; Write_Command(0x81);//GCHP1 Write_Data(temp); temp=Y; Write_Command(0x82);//GCVP0 Write_Data(temp); temp=Y>>8; Write_Command(0x83);//GCVP1 Write_Data(temp); }
//********FLASH读取区域设置 void DMA_block_mode_size_setting(unsigned short BWR,unsigned short BHR,unsigned short SPWR) { Write_Command(0xB4); Write_Data(BWR); Write_Command(0xB5); Write_Data(BWR>>8); Write_Command(0xB6); Write_Data(BHR); Write_Command(0xB7); Write_Data(BHR>>8); Write_Command(0xB8); Write_Data(SPWR); Write_Command(0xB9); Write_Data(SPWR>>8); }
void Write_Cmd_Data (unsigned char x,unsigned int y) { unsigned char m,n; m=y>>8; n=y; Write_Cmd(0x00,x); Write_Data(m,n); }
//********画三角形第三个点 void Draw_Triangle(unsigned short X3,unsigned short Y3) { unsigned char temp; temp=X3; Write_Command(0xA9); Write_Data(temp); temp=X3>>8; Write_Command(0xAA); Write_Data(temp); temp=Y3; Write_Command(0xAB); Write_Data(temp); temp=Y3>>8; Write_Command(0xAC); Write_Data(temp); }
void Layer1_Visible(void) { unsigned char temp; Write_Command(0x52);//LTPR0 temp = Read_Data(); temp&=0xf8; Write_Data(temp); }
/* 名称: void LCD_ShowAQI(uint16_t Value) 功能: 让显示屏显示AQI 形参: Data 16位的AQI值 返回: 无 */ void LCD_ShowAQI(uint16_t Value) { // P AQI // 26 26 uint16_t aqi[8] = {AQI_1, AQI_2, AQI_3, AQI_4, AQI_5, AQI_6, AQI_7, AQI_8}; uint8_t level; float c = 0; c = 3.3/1023*2*600*(Value - PM_V0); //ug/m3 if(c < AQI_LEVEL_1) { level = 0; } else if(c < AQI_LEVEL_2) { level = 1; } else if(c < AQI_LEVEL_3) { level = 2; } else if(c < AQI_LEVEL_4) { level = 3; } else if(c < AQI_LEVEL_5) { level = 4; } else if(c < AQI_LEVEL_6) { level = 5; } else if(c < AQI_LEVEL_7) { level = 6; } else { level = 7; } CS_OUT; WR_OUT; DATA_OUT; CS_0; WR_1; Write_ID(WRITE_CMD); Write_MemoryAddr(26); Write_Data(aqi[level]>>8); Write_Data(aqi[level]>>4); Write_Data(aqi[level]); WR_0; CS_1; }
/***************************************************************************//** * @brief Clears the specified line. * @param line_to_clear line which is cleared * @return None. * @date 16.09.2013 *******************************************************************************/ void Oled_clear_line(unsigned char line_to_clear) { Oled_goto_line(line_to_clear); unsigned char a; for (a=0; a<128; a++) { Write_Data(0x00); } }
//********内存写入位置 void MemoryWrite_Position(unsigned short X,unsigned short Y) { unsigned char temp; temp=X; Write_Command(0x46); Write_Data(temp); temp=X>>8; Write_Command(0x47); Write_Data(temp); temp=Y; Write_Command(0x48); Write_Data(temp); temp=Y>>8; Write_Command(0x49); Write_Data(temp); }
//****************窗口卷动偏移量设置 void Scroll(unsigned short X,unsigned short Y) { unsigned char temp; temp=X; Write_Command(0x24);//HOFS0 Write_Data(temp); temp=X>>8; Write_Command(0x25);//HOFS1 Write_Data(temp); temp=Y; Write_Command(0x26);//VOFS0 Write_Data(temp); temp=Y>>8; Write_Command(0x27);//VOFS1 Write_Data(temp); }
/***************************************************************************//** * @brief Refresh one page of the OLED with data from the SRAM * @param PagetoPrint Page which should be updated * @return None. * @date 23.09.2013 *******************************************************************************/ void Refresh_Page_From_SRAM(unsigned int PagetoPrint) { unsigned char a, i = 0; for (i = 0; i < 0x80; i++) { a = SRAM_Read_Byte(PagetoPrint + i); Write_Data(a); } }
void NewLandUse::Execute (void) { int field; Str_Itr str_itr; Zone_Field_Itr field_itr; Processing_Itr process_itr; //---- read/open the system zone files ---- Data_Service::Execute (); //---- read zone and target files ---- Read_Files (); //---- coverage type density ---- Apply_Density (); //---- process each data field ---- for (field=0, str_itr = data_names.begin (); str_itr != data_names.end (); str_itr++, field++) { Print (1); Write (1, "Processing Data Field ") << *str_itr; Show_Message (1); if (field >= function.Num_Functions ()) { best_function = function.Num_Functions (); } else { best_function = field + 1; } for (process_itr = processing_steps.begin (); process_itr != processing_steps.end (); process_itr++) { Processing (field, *process_itr); } } //---- output the results ---- Write_Data (); //---- print reports ---- for (int i=First_Report (); i != 0; i=Next_Report ()) { switch (i) { case GROUP_REPORT: //---- Group Report ---- Group_Report ((int) Report_Data ()); break; default: break; } } Exit_Stat (DONE); }
//****************输入字符 void String(unsigned char *str) { Write_Dir(0x40,0x80);//设置字符模式 Write_Command(0x02); while(*str != '\0') { Write_Data(*str); ++str; Chk_Busy(); } }
void Text_Background_Color1(unsigned long b_color) { Write_Command(0x60);//BGCR0 Write_Data((unsigned short)(b_color>>11)); Write_Command(0x61);//BGCR0 Write_Data((unsigned short)(b_color>>5)); Write_Command(0x62);//BGCR0 Write_Data((unsigned short)(b_color)); }
//********前景颜色设置 void Text_Foreground_Color1(unsigned long b_color) { Write_Command(0x63);//BGCR0 Write_Data((unsigned short)(b_color>>11)); Write_Command(0x64);//BGCR0 Write_Data((unsigned short)(b_color>>5)); Write_Command(0x65);//BGCR0 Write_Data((unsigned short)(b_color)); }
void RXLCD_SetPixelIndex(int x, int y, int PixelIndex) { unsigned char temp; temp=x; Write_Command(0x46); Write_Data(temp); temp=x>>8; Write_Command(0x47); Write_Data(temp); temp=y; Write_Command(0x48); Write_Data(temp); temp=y>>8; Write_Command(0x49); Write_Data(temp); Write_Command(0x02); Write_Data(PixelIndex); }
/***************************************************************************//** * @brief Prints a character on the OLED * @param char_to_print character which is printed * @return None. * @date 16.09.2013 *******************************************************************************/ void Oled_put_char (char char_to_print) { unsigned char a; if(char_to_print < 32) { char_to_print = 32; } if (char_to_print > 127) { char_to_print = 127; } char_to_print = char_to_print - 32; for (a=0; a<5; a++) { Write_Data(pgm_read_byte(&myfont[char_to_print][a])); } Write_Data(0x00); }
//********画圆:中心点,半径 void Draw_Circle(unsigned short X,unsigned short Y,unsigned short R) { unsigned char temp; temp=X; Write_Command(0x99); Write_Data(temp); temp=X>>8; Write_Command(0x9a); Write_Data(temp); temp=Y; Write_Command(0x9b); Write_Data(temp); temp=Y>>8; Write_Command(0x9c); Write_Data(temp); temp=R; Write_Command(0x9d); Write_Data(temp); }
/* 名称: void HT1261B_WriteData(uint8_t MAddr, uint8_t Value) 功能: 向HT1261B发送数据 形参: MAddr 内存地址 Data 数据 返回: 无 */ void HT1261B_WriteData(uint8_t MAddr, uint8_t Value) { CS_OUT; WR_OUT; DATA_OUT; CS_0; WR_1; Write_ID(WRITE_CMD); Write_MemoryAddr(MAddr); Write_Data(Value); WR_0; CS_1; }