// Initialization stage bool DbgGdb::DoInitializeGdb(const DebugSessionInfo& sessionInfo) { m_goingDown = false; m_internalBpId = wxNOT_FOUND; #ifdef __WXMSW__ ExecuteCmd(wxT("set new-console on")); #endif ExecuteCmd(wxT("set unwindonsignal on")); wxString breakinsertcmd(wxT("-break-insert ")); if(m_info.enablePendingBreakpoints) { ExecuteCmd(wxT("set breakpoint pending on")); breakinsertcmd << wxT("-f "); } if(m_info.catchThrow) { #ifdef __WXMSW__ WriteCommand("-break-insert -f __cxa_throw", NULL); #else ExecuteCmd(wxT("catch throw")); #endif } #ifdef __WXMSW__ if(m_info.debugAsserts) { ExecuteCmd(wxT("break assert")); } #endif if(!(m_info.flags & DebuggerInformation::kPrintObjectOff)) { ExecuteCmd("set print object on"); } ExecuteCmd(wxT("set width 0")); ExecuteCmd(wxT("set height 0")); // Number of elements to show for arrays (including strings) wxString sizeCommand; sizeCommand << wxT("set print elements ") << m_info.maxDisplayStringSize; ExecuteCmd(sizeCommand); // set the project startup commands for(size_t i = 0; i < sessionInfo.cmds.GetCount(); i++) { ExecuteCmd(sessionInfo.cmds.Item(i)); } // keep the list of breakpoints m_bpList = sessionInfo.bpList; bool setBreakpointsAfterMain(m_info.applyBreakpointsAfterProgramStarted); if(GetIsRemoteDebugging() == false && !setBreakpointsAfterMain) { // When remote debugging, apply the breakpoints after we connect the // gdbserver SetBreakpoints(); } else if(setBreakpointsAfterMain && m_bpList.empty() == false) { // Place an 'internal' breakpoint at main. Once this breakpoint is hit // set all breakpoints and remove the 'internal' one. // Then 'continue', unless the user has said he actually _wants_ to break at main WriteCommand(breakinsertcmd + wxT("-t main"), new DbgFindMainBreakpointIdHandler(m_observer, this)); } if(m_info.breakAtWinMain) { // Set a breakpoint at WinMain // Use a temporary one, so that it isn't duplicated in future sessions WriteCommand(breakinsertcmd + wxT("-t main"), NULL); // Flag that we've done this. DbgFindMainBreakpointIdHandler::ProcessOutput uses this // to decide whether or not to 'continue' after setting BPs after main() SetShouldBreakAtMain(true); } else { SetShouldBreakAtMain(false); // Needs explicitly to be set, in case the user has just changed his options } // Enable python based pretty printing? if(sessionInfo.enablePrettyPrinting) { WriteCommand(wxT("-enable-pretty-printing"), NULL); } // Add the additional search paths for(size_t i = 0; i < sessionInfo.searchPaths.GetCount(); ++i) { wxString dirCmd; wxString path = sessionInfo.searchPaths.Item(i); path.Trim().Trim(false); if(path.Contains(" ")) { path.Prepend('"').Append('"'); } dirCmd << "-environment-directory " << path; WriteCommand(dirCmd, NULL); } return true; }
void ClrScr(void) { WriteCommand(0x01); Delay(100000); }
void WriteDC(uchar dat,uchar cmd) //写一个数据和一个指令 { WriteData(dat); WriteCommand(cmd); }
/********************************************************************* * Function: void ResetDevice() * * PreCondition: none * * Input: none * * Output: none * * Side Effects: none * * Overview: resets LCD, initializes PMP * * Note: none * ********************************************************************/ void ResetDevice(void){ unsigned long i; oledWR = 0; oledWR_TRIS = 0; oledRD = 0; oledRD_TRIS = 0; oledCS = 1; oledCS_TRIS = 0; oledD_C = 0; oledD_C_TRIS = 0; oledRESET = 1; //1 = not in reset, 0 = in reset oledRESET_TRIS = 0; //Reset the OLED module oledRESET = 0; for(i=0;i<100;i++){} oledRESET = 1; for(i=0;i<100;i++){} // Setup Display WriteCommand(0xAE); // turn off the display (AF=ON, AE=OFF) WriteCommand(0xDB); // set VCOMH WriteCommand(0x23); WriteCommand(0xD9); // set VP WriteCommand(0x22); ////////////////////////////// // User Set Up ////////////////////////////// // Re-map WriteCommand(0xA1); // [A0]:column address 0 is map to SEG0 // [A1]:column address 131 is map to SEG0 // COM Output Scan Direction WriteCommand(0xC8); // C0 is COM0 to COMn, C8 is COMn to COM0 // COM Pins Hardware Configuration WriteCommand(0xDA); // set pins hardware configuration WriteCommand(0x12); // Multiplex Ratio WriteCommand(0xA8); // set multiplex ratio WriteCommand(0x3F); // set to 64 mux // Display Clock Divide WriteCommand(0xD5); // set display clock divide WriteCommand(0xA0); // set to 100Hz // Contrast Control Register WriteCommand(0x81); // Set contrast control WriteCommand(0x60); // display 0 ~ 127; 2C // Display Offset WriteCommand(0xD3); // set display offset WriteCommand(0x00); // no offset //Normal or Inverse Display WriteCommand(0xA6); // Normal display WriteCommand(0xAD); // Set DC-DC WriteCommand(0x8B); // 8B=ON, 8A=OFF //Clear out the display RAM so that it initializes with all pixels off FillDisplay(0x00); //Turn off all the pixels on the OLED display // Display ON/OFF WriteCommand(0xAF); // AF=ON, AE=OFF //Startup delay DelayMs(150); //SH1101A datasheet suggests waiting 150ms after turning //on display. This doesn't appear strictly needed, //but presumably gives the boost circuitry the time //needed to charge to full voltage for normal operation. // Entire Display ON/OFF WriteCommand(0xA4); // A4=ON // Display Start Line WriteCommand(0x40); // Set display start line // Lower Column Address WriteCommand(0x00+OFFSET); // Set lower column address // Higher Column Address WriteCommand(0x10); // Set higher column address }
void DisplayInit(void) { event = SemaphoreCreateBinary(); InitializePeripherals(); // Apply power. LAT(EN_N_PIN) = 0; __delay_ms(1000); // Release from reset. __delay_us(500); LAT(RST_N_PIN) = 1; __delay_us(500); WriteCommand(ST7735_SWRESET, 0); // software reset __delay_us(150); WriteCommand(ST7735_SLPOUT, 0); // out of sleep mode __delay_us(500); WriteCommand(ST7735_COLMOD, 1, // set color mode 0x05); // 16-bit color __delay_us(10); WriteCommand(ST7735_FRMCTR1, 3, // frame rate control - normal mode 0x01, // frame rate = fosc / (1 x 2 + 40) * (LINE + 2C + 2D) 0x2C, 0x2D); WriteCommand(ST7735_FRMCTR2, 3, // frame rate control - idle mode 0x01, // frame rate = fosc / (1 x 2 + 40) * (LINE + 2C + 2D) 0x2C, 0x2D); WriteCommand(ST7735_FRMCTR3, 6, // frame rate control - partial mode 0x01, // dot inversion mode 0x2C, 0x2D, 0x01, // line inversion mode 0x2C, 0x2D); WriteCommand(ST7735_INVCTR, 1, // display inversion control 0x07); // no inversion WriteCommand(ST7735_PWCTR1, 3, // power control 0xA2, 0x02, // -4.6V 0x84); // AUTO mode WriteCommand(ST7735_PWCTR2, 1, // power control 0xC5); // VGH25 = 2.4C VGSEL = -10 VGH = 3 * AVDD WriteCommand(ST7735_PWCTR3, 2, // power control 0x0A, // Opamp current small 0x00); // Boost frequency WriteCommand(ST7735_PWCTR4, 2, // power control 0x8A, // BCLK/2, Opamp current small & Medium low 0x2A); WriteCommand(ST7735_PWCTR5, 2, // power control 0x8A, 0xEE); WriteCommand(ST7735_VMCTR1, 1, // power control 0x0E); WriteCommand(ST7735_INVOFF, 0); // don't invert display // normal R G B order // row address/col address, bottom to top refresh madctl = 0xC0; WriteCommand(ST7735_MADCTL, 1, // memory access control (directions) madctl); WriteCommand(ST7735_COLMOD, 1, // set color mode 0x05); // 16-bit color WriteCommand(ST7735_CASET, 4, // column addr set 0x00, 0x00, // XSTART = 0 0x00, 0x7F); // XEND = 127 WriteCommand(ST7735_RASET, 4, // row addr set 0x00, 0x00, // XSTART = 0 0x00, 0x9F); // XEND = 159 WriteCommand(ST7735_GMCTRP1, 16, 0x0f, 0x1a, 0x0f, 0x18, 0x2f, 0x28, 0x20, 0x22, 0x1f, 0x1b, 0x23, 0x37, 0x00, 0x07, 0x02, 0x10); WriteCommand(ST7735_GMCTRN1, 16, 0x0f, 0x1b, 0x0f, 0x17, 0x33, 0x2c, 0x29, 0x2e, 0x30, 0x30, 0x39, 0x3f, 0x00, 0x07, 0x03, 0x10); WriteCommand(ST7735_DISPON, 0); __delay_us(100); WriteCommand(ST7735_NORON, 0); // normal display on __delay_us(10); }
void DbgGdb::BreakList() { (void)WriteCommand(wxT("-break-list"), new DbgCmdBreakList(m_observer)); }
static void Lcd_init(void) { WriteCommand(0x83);WriteData(0x02);/* TEST_MODE on */ WriteCommand(0x85);WriteData(0x03);/* VDDD control */ WriteCommand(0x8B);WriteData(0x00);/* source gamma resistor */ WriteCommand(0x8C);WriteData(0x13);/* source gamma resistor */ WriteCommand(0x91);WriteData(0x01);/* sync */ WriteCommand(0x83);WriteData(0x00);/* TEST_MODE off */ mdelay(5); /* Gamma Setting */ WriteCommand(0x3E);WriteData(0xC4); WriteCommand(0x3F);WriteData(0x44); WriteCommand(0x40);WriteData(0x22); WriteCommand(0x41);WriteData(0x57); WriteCommand(0x42);WriteData(0x03); WriteCommand(0x43);WriteData(0x47); WriteCommand(0x44);WriteData(0x02); WriteCommand(0x45);WriteData(0x55); WriteCommand(0x46);WriteData(0x06); WriteCommand(0x47);WriteData(0x4C); WriteCommand(0x48);WriteData(0x06); WriteCommand(0x49);WriteData(0x8C); /* Power Supply Setting */ WriteCommand(0x2B);WriteData(0xF9); mdelay(20); WriteCommand(0x17);WriteData(0x90); WriteCommand(0x18);WriteData(0x3A); WriteCommand(0x1B);WriteData(0x14);/* BT(VCL,VGH,VGL) */ WriteCommand(0x1A);WriteData(0x11);/* VC1 VC3 */ WriteCommand(0x1C);WriteData(0x0A);/* VRH */ WriteCommand(0x1F);WriteData(0x58);/* VCM */ mdelay(30); WriteCommand(0x19);WriteData(0x0A);/* power */ WriteCommand(0x19);WriteData(0x1A); mdelay(50); WriteCommand(0x19);WriteData(0x12); mdelay(50); WriteCommand(0x1E);WriteData(0x2E);/* VCOMG */ mdelay(100); WriteCommand(0x5A);WriteData(0x01); /* DUG FUNCTION ON */ WriteCommand(0x5C); /* LUT */ WriteData(0x00); /* RED LUT */ WriteData(0x03); WriteData(0x0A); WriteData(0x0F); WriteData(0x13); WriteData(0x16); WriteData(0x19); WriteData(0x1C); WriteData(0x1E); WriteData(0x1F); WriteData(0x25); WriteData(0x2A); WriteData(0x30); WriteData(0x35); WriteData(0x39); WriteData(0x3D); WriteData(0x41); WriteData(0x45); WriteData(0x48); WriteData(0x4C); WriteData(0x4F); WriteData(0x53); WriteData(0x58); WriteData(0x5D); WriteData(0x61); WriteData(0x66); WriteData(0x6A); WriteData(0x6E); WriteData(0x72); WriteData(0x76); WriteData(0x7A); WriteData(0x7E); WriteData(0x82); WriteData(0x85); WriteData(0x89); WriteData(0x8D); WriteData(0x90); WriteData(0x94); WriteData(0x96); WriteData(0x9A); WriteData(0x9D); WriteData(0xA1); WriteData(0xA4); WriteData(0xA8); WriteData(0xAB); WriteData(0xAF); WriteData(0xB3); WriteData(0xB7); WriteData(0xBB); WriteData(0xBF); WriteData(0xC3); WriteData(0xC8); WriteData(0xCC); WriteData(0xD1); WriteData(0xD6); WriteData(0xDB); WriteData(0xDE); WriteData(0xE1); WriteData(0xE5); WriteData(0xE7); WriteData(0xEC); WriteData(0xEF); WriteData(0xF4); WriteData(0xFF); WriteData(0x00);/* GLUT */ WriteData(0x03); WriteData(0x0A); WriteData(0x0F); WriteData(0x13); WriteData(0x16); WriteData(0x19); WriteData(0x1C); WriteData(0x1E); WriteData(0x1F); WriteData(0x25); WriteData(0x2A); WriteData(0x30); WriteData(0x35); WriteData(0x39); WriteData(0x3D); WriteData(0x41); WriteData(0x45); WriteData(0x48); WriteData(0x4C); WriteData(0x4F); WriteData(0x53); WriteData(0x58); WriteData(0x5D); WriteData(0x61); WriteData(0x66); WriteData(0x6A); WriteData(0x6E); WriteData(0x72); WriteData(0x76); WriteData(0x7A); WriteData(0x7E); WriteData(0x82); WriteData(0x85); WriteData(0x89); WriteData(0x8D); WriteData(0x90); WriteData(0x94); WriteData(0x96); WriteData(0x9A); WriteData(0x9D); WriteData(0xA1); WriteData(0xA4); WriteData(0xA8); WriteData(0xAB); WriteData(0xAF); WriteData(0xB3); WriteData(0xB7); WriteData(0xBB); WriteData(0xBF); WriteData(0xC3); WriteData(0xC8); WriteData(0xCC); WriteData(0xD1); WriteData(0xD6); WriteData(0xDB); WriteData(0xDE); WriteData(0xE1); WriteData(0xE5); WriteData(0xE7); WriteData(0xEC); WriteData(0xEF); WriteData(0xF4); WriteData(0xFF); WriteData(0x00); /* B LUT */ WriteData(0x03); WriteData(0x0A); WriteData(0x0F); WriteData(0x13); WriteData(0x16); WriteData(0x19); WriteData(0x1C); WriteData(0x1E); WriteData(0x1F); WriteData(0x25); WriteData(0x2A); WriteData(0x30); WriteData(0x35); WriteData(0x39); WriteData(0x3D); WriteData(0x41); WriteData(0x45); WriteData(0x48); WriteData(0x4C); WriteData(0x4F); WriteData(0x53); WriteData(0x58); WriteData(0x5D); WriteData(0x61); WriteData(0x66); WriteData(0x6A); WriteData(0x6E); WriteData(0x72); WriteData(0x76); WriteData(0x7A); WriteData(0x7E); WriteData(0x82); WriteData(0x85); WriteData(0x89); WriteData(0x8D); WriteData(0x90); WriteData(0x94); WriteData(0x96); WriteData(0x9A); WriteData(0x9D); WriteData(0xA1); WriteData(0xA4); WriteData(0xA8); WriteData(0xAB); WriteData(0xAF); WriteData(0xB3); WriteData(0xB7); WriteData(0xBB); WriteData(0xBF); WriteData(0xC3); WriteData(0xC8); WriteData(0xCC); WriteData(0xD1); WriteData(0xD6); WriteData(0xDB); WriteData(0xDE); WriteData(0xE1); WriteData(0xE5); WriteData(0xE7); WriteData(0xEC); WriteData(0xEF); WriteData(0xF4); WriteData(0xFF); /* Display ON Setting */ WriteCommand(0x3C);WriteData(0xC0); WriteCommand(0x3D);WriteData(0x1C); WriteCommand(0x34);WriteData(0x38); WriteCommand(0x35);WriteData(0x38); WriteCommand(0x24);WriteData(0x38); mdelay(50); WriteCommand(0x24);WriteData(0x3C); WriteCommand(0x16);WriteData(0x1C); WriteCommand(0x3A);WriteData(0xCE);/* polarity */ WriteCommand(0x01);WriteData(0x06);/* pixel invert */ WriteCommand(0x55);WriteData(0x00); }
bool DbgGdb::NextInstruction() { return WriteCommand(wxT("-exec-next-instruction"), new DbgCmdHandlerAsyncCmd(m_observer, this)); }
bool DbgGdb::Break(const BreakpointInfo& bp) { wxString breakinsertcmd(wxT("-break-insert ")); if(m_info.enablePendingBreakpoints) { breakinsertcmd << wxT("-f "); } wxFileName fn(bp.file); // by default, use full paths for the file name when setting breakpoints wxString tmpfileName(fn.GetFullPath()); if(m_info.useRelativeFilePaths) { // user set the option to use relative paths (file name w/o the full path) tmpfileName = fn.GetFullName(); } tmpfileName.Replace(wxT("\\"), wxT("/")); wxString command; switch(bp.bp_type) { case BP_type_watchpt: //---------------------------------- // Watchpoints //---------------------------------- command = wxT("-break-watch "); switch(bp.watchpoint_type) { case WP_watch: // nothing to add, simple watchpoint - trigrred when BP is write break; case WP_rwatch: // read watchpoint command << wxT("-r "); break; case WP_awatch: // access watchpoint command << wxT("-a "); break; } command << bp.watchpt_data; break; case BP_type_tempbreak: //---------------------------------- // Temporary breakpoints //---------------------------------- command = breakinsertcmd + wxT("-t "); break; case BP_type_condbreak: case BP_type_break: default: // Should be standard breakpts. But if someone tries to make an ignored temp bp // it won't have the BP_type_tempbreak type, so check again here command << breakinsertcmd; if(bp.is_temp) { command << " -t "; } if(!bp.is_enabled) { command << " -d "; } break; } //------------------------------------------------------------------------ // prepare the 'break where' string (address, file:line or regex) //------------------------------------------------------------------------ wxString breakWhere, ignoreCounnt, condition, gdbCommand; if(bp.memory_address.IsEmpty() == false) { // Memory is easy: just prepend *. gdb copes happily with (at least) hex or decimal breakWhere << wxT('*') << bp.memory_address; } else if(bp.bp_type != BP_type_watchpt) { // Function and Lineno locations can/should be prepended by a filename (but see later) if(!tmpfileName.IsEmpty() && bp.lineno > 0) { breakWhere << tmpfileName << wxT(":") << bp.lineno; breakWhere.Prepend("\"").Append("\""); } else if(!bp.function_name.IsEmpty()) { if(bp.regex) { // update the command command = breakinsertcmd + wxT("-r "); } breakWhere = bp.function_name; } } //------------------------------------------------------------------------ // prepare the conditions //------------------------------------------------------------------------ if(bp.conditions.IsEmpty() == false) { condition << wxT("-c ") << wxT("\"") << bp.conditions << wxT("\" "); } //------------------------------------------------------------------------ // prepare the ignore count //------------------------------------------------------------------------ if(bp.ignore_number > 0) { ignoreCounnt << wxT("-i ") << bp.ignore_number << wxT(" "); } // concatenate all the string into one command to pass to gdb gdbCommand << command << condition << ignoreCounnt << breakWhere; // execute it DbgCmdHandlerBp* dbgCommandHandler = new DbgCmdHandlerBp(m_observer, this, bp, &m_bpList, bp.bp_type); return WriteCommand(gdbCommand, dbgCommandHandler); }
bool DbgGdb::ListRegisters() { return WriteCommand("-data-list-register-names", new DbgCmdHandlerRegisterNames(m_observer, this)); }
bool DbgGdb::Next() { return WriteCommand(wxT("-exec-next"), new DbgCmdHandlerAsyncCmd(m_observer, this)); }
bool DbgGdb::UpdateWatch(const wxString& name) { wxString cmd; cmd << wxT("-var-update \"") << name << wxT("\" "); return WriteCommand(cmd, new DbgVarObjUpdate(m_observer, this, name, DBG_USERR_WATCHTABLE)); }
bool DbgGdb::Restart() { return WriteCommand(wxT("-exec-run "), new DbgCmdHandlerExecRun(m_observer, this)); }
bool DbgGdb::DeleteVariableObject(const wxString& name) { wxString cmd; cmd << wxT("-var-delete \"") << name << wxT("\""); return WriteCommand(cmd, NULL); }
bool DbgGdb::SelectThread(long threadId) { wxString command; command << wxT("-thread-select ") << threadId; return WriteCommand(command, NULL); }
bool DbgGdb::Continue() { return WriteCommand("-exec-continue", new DbgCmdHandlerAsyncCmd(m_observer, this)); }
bool DbgGdb::ResolveType(const wxString& expression, int userReason) { wxString cmd; cmd << wxT("-var-create - * \"") << expression << wxT("\""); return WriteCommand(cmd, new DbgCmdResolveTypeHandler(expression, this, userReason)); }
bool DbgGdb::StepIn() { return WriteCommand(wxT("-exec-step"), new DbgCmdHandlerAsyncCmd(m_observer, this)); }
void SoftResetLCD() { WriteCommand(SOFT_RESET_REG); DelayMs(100); }
bool DbgGdb::StepOut() { return WriteCommand(wxT("-exec-finish"), new DbgCmdHandlerAsyncCmd(m_observer, this)); }
static int hx8352_reg_set_value(void *data, u64 val) { regval = (unsigned)val & 0xFF; WriteCommand( regval & 0xFF) ; return 0; }
bool DbgGdb::QueryLocals() { return WriteCommand(wxT("-stack-list-variables 2"), new DbgCmdHandlerLocals(m_observer)); }
size_t LCD_SH1106::write(uint8_t c) { if (c == '\n') { setCursor(0, m_row + ((m_font == FONT_SIZE_SMALL) ? 1 : 2)); return 1; } else if (c == '\r') { m_col = 0; return 1; } #ifdef TWBR uint8_t twbrbackup = TWBR; TWBR = 18; // upgrade to 400KHz! #endif #ifndef MEMORY_SAVING if (m_font == FONT_SIZE_SMALL) { #endif Wire.beginTransmission(I2C_ADDR); WIRE_WRITE(0x40); if (c > 0x20 && c < 0x7f) { c -= 0x21; for (byte i = 0; i < 5; i++) { byte d = pgm_read_byte(&font5x8[c][i]); WIRE_WRITE(d); if (m_flags & FLAG_PIXEL_DOUBLE_H) WIRE_WRITE(d); } WIRE_WRITE(0); } else { for (byte i = (m_flags & FLAG_PIXEL_DOUBLE_H) ? 11 : 6; i > 0; i--) { WIRE_WRITE(0); } } Wire.endTransmission(); m_col += (m_flags & FLAG_PIXEL_DOUBLE_H) ? 11 : 6; if (m_col >= 128) { m_col = 0; m_row ++; } #ifndef MEMORY_SAVING } else { if (c > 0x20 && c < 0x7f) { c -= 0x21; WriteCommand(0xB0 + m_row);//set page address WriteCommand(m_col & 0xf);//set lower column address WriteCommand(0x10 | (m_col >> 4));//set higher column address Wire.beginTransmission(I2C_ADDR); WIRE_WRITE(0x40); for (byte i = 0; i <= 14; i += 2) { byte d = pgm_read_byte(&font8x16_terminal[c][i]); WIRE_WRITE(d); if (m_flags & FLAG_PIXEL_DOUBLE_H) WIRE_WRITE(d); } Wire.endTransmission(); WriteCommand(0xB0 + m_row + 1);//set page address WriteCommand(m_col & 0xf);//set lower column address WriteCommand(0x10 | (m_col >> 4));//set higher column address Wire.beginTransmission(I2C_ADDR); WIRE_WRITE(0x40); for (byte i = 1; i <= 15; i += 2) { byte d = pgm_read_byte(&font8x16_terminal[c][i]); WIRE_WRITE(d); if (m_flags & FLAG_PIXEL_DOUBLE_H) WIRE_WRITE(d); } Wire.endTransmission(); } else {
bool DbgGdb::RemoveBreak(double bid) { wxString command; command << wxT("-break-delete ") << bid; return WriteCommand(command, NULL); }
void DisplaySetRotation(uint8_t m) { madctl = m; WriteCommand(ST7735_MADCTL, 1, // memory access control (directions) madctl); // row address/col address, bottom to top refresh }
bool DbgGdb::SetFrame(int frame) { wxString command; command << wxT("frame ") << frame; return WriteCommand(command, new DbgCmdSelectFrame(m_observer)); }
void LCD_Char_display(void) { WriteCommand(0x46); WriteData(0x00); WriteData(0x00); LCD_Write32x32Char(107,1,hz1); LCD_Write32x32Char(112,1,hz2); LCD_Write32x32Char(117,1,hz3); LCD_Write32x32Char(122,1,hz4); LCD_Write32x32Char(127,1,hz5); LCD_Write32x32Char(132,1,hz6); LCD_Write32x32Char(137,1,hz7); LCD_Write32x16Char(115,6,charA); LCD_Write32x16Char(135,6,charB); LCD_Write32x16Char(225,11,char1); LCD_Write32x16Char(33,18,char2); LCD_Write32x16Char(97,24,char3); LCD_Write32x16Char(161,30,char4); /* LCD_Write32x16Char1(232,11,numb,timer1a.sec/10); LCD_Write32x16Char1(234,11,numb,timer1a.sec%10); LCD_Write32x16Char1(236,11,numb,timer1a.hsec/10); //LCD_Write16x8Char(48,13,dot); LCD_Write32x16Char1(238,11,numb,10); LCD_Write32x16Char1(240,11,numb,timer1a.hsec%10); LCD_Write32x16Char1(250,11,numb,timer1b.sec/10); LCD_Write32x16Char1(252,11,numb,timer1b.sec%10); LCD_Write32x16Char1(254,11,numb,timer1b.hsec/10); //LCD_Write16x8Char(63,13,dot); LCD_Write32x16Char1(0,12,numb,10); LCD_Write32x16Char1(2,12,numb,timer1b.hsec%10); LCD_Write32x16Char1(40,18,numb,timer2a.sec/10); LCD_Write32x16Char1(42,18,numb,timer2a.sec%10); LCD_Write32x16Char1(44,18,numb,timer2a.hsec/10); //LCD_Write16x8Char(136,20,dot); LCD_Write32x16Char1(46,18,numb,10); LCD_Write32x16Char1(48,18,numb,timer2a.hsec%10); LCD_Write32x16Char1(58,18,numb,timer2b.sec/10); LCD_Write32x16Char1(60,18,numb,timer2b.sec%10); LCD_Write32x16Char1(62,18,numb,timer2b.hsec/10); //LCD_Write16x8Char(151,20,dot); LCD_Write32x16Char1(64,18,numb,10); LCD_Write32x16Char1(66,18,numb,timer2b.hsec%10); LCD_Write32x16Char1(104,24,numb,timer3a.sec/10); LCD_Write32x16Char1(106,24,numb,timer3a.sec%10); LCD_Write32x16Char1(108,24,numb,timer3a.hsec/10); //LCD_Write16x8Char(8,28,dot); LCD_Write32x16Char1(110,24,numb,10); LCD_Write32x16Char1(112,24,numb,timer3a.hsec%10); LCD_Write32x16Char1(122,24,numb,timer3b.sec/10); LCD_Write32x16Char1(124,24,numb,timer3b.sec%10); LCD_Write32x16Char1(126,24,numb,timer3b.hsec/10); LCD_Write32x16Char1(128,24,numb,10); LCD_Write32x16Char1(130,24,numb,timer3b.hsec%10); LCD_Write32x16Char1(168,30,numb,timer4a.sec/10); LCD_Write32x16Char1(170,30,numb,timer4a.sec%10); LCD_Write32x16Char1(172,30,numb,timer4a.hsec/10); //LCD_Write16x8Char(8,28,dot); LCD_Write32x16Char1(174,30,numb,10); LCD_Write32x16Char1(176,30,numb,timer4a.hsec%10); LCD_Write32x16Char1(186,30,numb,timer4b.sec/10); LCD_Write32x16Char1(188,30,numb,timer4b.sec%10); LCD_Write32x16Char1(190,30,numb,timer4b.hsec/10); LCD_Write32x16Char1(192,30,numb,10); LCD_Write32x16Char1(194,30,numb,timer4b.hsec%10); */ WriteCommand(0x46); WriteData(0x10); WriteData(0x26); }
bool DbgGdb::ListThreads() { return WriteCommand(wxT("-thread-info"), new DbgCmdListThreads(m_observer)); }
void WriteDDC(uchar data1, uchar data2, uchar cmd) //写两个数据和一个指令 { WriteData(data1); WriteData(data2); WriteCommand(cmd); }
/********************************************************************* * Function: void ResetDevice() * * PreCondition: none * * Input: none * * Output: none * * Side Effects: none * * Overview: resets LCD, initializes PMP * * Note: none * ********************************************************************/ void ResetDevice(void){ unsigned long i; unsigned int data; oledWR = 0; oledWR_TRIS = 0; oledRD = 0; oledRD_TRIS = 0; oledCS = 1; oledCS_TRIS = 0; oledD_C = 0; oledD_C_TRIS = 0; //Reset the device oledRESET = 0; for(i=0;i<100;i++){} oledRESET = 1; for(i=0;i<100;i++){} // Setup Display WriteCommand(0xAE); // turn off the display (AF=ON, AE=OFF) WriteCommand(0xDB); // set VCOMH WriteCommand(0x23); WriteCommand(0xD9); // set VP WriteCommand(0x22); ////////////////////////////// // User Set Up ////////////////////////////// // Re-map WriteCommand(0xA1); // [A0]:column address 0 is map to SEG0 // [A1]:column address 131 is map to SEG0 // COM Output Scan Direction WriteCommand(0xC8); // C0 is COM0 to COMn, C8 is COMn to COM0 // COM Pins Hardware Configuration WriteCommand(0xDA); // set pins hardware configuration WriteCommand(0x12); // Multiplex Ratio WriteCommand(0xA8); // set multiplex ratio WriteCommand(0x3F); // set to 64 mux // Display Clock Divide WriteCommand(0xD5); // set display clock divide WriteCommand(0xA0); // set to 100Hz // Contrast Control Register WriteCommand(0x81); // Set contrast control WriteCommand(0x60); // display 0 ~ 127; 2C // Display Offset WriteCommand(0xD3); // set display offset WriteCommand(0x00); // no offset //Normal or Inverse Display WriteCommand(0xA6); // Normal display WriteCommand(0xAD); // Set DC-DC WriteCommand(0x8B); // 8B=ON, 8A=OFF // Display ON/OFF WriteCommand(0xAF); // AF=ON, AE=OFF DelayMs(10); // Entire Display ON/OFF WriteCommand(0xA4); // A4=ON // Display Start Line WriteCommand(0x40); // Set display start line // Lower Column Address WriteCommand(0x00+OFFSET); // Set lower column address // Higher Column Address WriteCommand(0x10); // Set higher column address }