这篇教程C++ writeData函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中writeData函数的典型用法代码示例。如果您正苦于以下问题:C++ writeData函数的具体用法?C++ writeData怎么用?C++ writeData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了writeData函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: assert// read the next channel data.. fill it in *tone// if tone isn't touched.. it should be inited so it just plays silence// return 0 if it's passing more data// return -1 if it's passing nothing (end of data)int SoundGenPCJr::getNextNote_v2(int ch) { ToneChan *tpcm; SndGenChan *chan; const byte *data; assert(ch < CHAN_MAX); if (!_vm->getFlag(VM_FLAG_SOUND_ON)) return -1; tpcm = &_tchannel[ch]; chan = &_channel[ch]; if (!chan->avail) return -1; while (chan->duration <= 0) { data = chan->data; // read the duration of the note chan->duration = READ_LE_UINT16(data); // duration // if it's 0 then it's not going to be played // if it's 0xFFFF then the channel data has finished. if ((chan->duration == 0) || (chan->duration == 0xFFFF)) { tpcm->genTypePrev = -1; tpcm->freqCountPrev = -1; break; } _tchannel[ch].genTypePrev = -1; _tchannel[ch].freqCountPrev = -1; // only tone channels dissolve if ((ch != 3) && (_dissolveMethod != 0)) // != noise?? chan->dissolveCount = 0; // attenuation (volume) writeData(data[4]); // frequency writeData(data[3]); writeData(data[2]); // data now points to the next data seg-a-ment chan->data += 5; } if (chan->duration == 0xFFFF) { // kill channel chan->avail = 0; chan->attenuation = 0x0F; // silent chan->attenuationCopy = 0x0F; // dunno really return -1; } chan->duration--; return 0;}
开发者ID:AReim1982,项目名称:scummvm,代码行数:65,
示例2: addressvoid AQCM0802::character(int column, int row, int c) { int a = address(column, row); writeCommand(a); writeData(c);}
开发者ID:take-pwave,项目名称:lbed,代码行数:5,
示例3: reset// Initialise the display with the require screen orientationvoid ILI9163::init(Rotation rotation) { width = ILI9163_WIDTH; height = ILI9163_HEIGHT; m_cs->write(1); m_reset->write(1); // Hardware reset the LCD reset(); writeCommand(ILI9163_CMD_EXIT_SLEEP_MODE); _delay_ms(5); // Wait for the screen to wake up writeCommand(ILI9163_CMD_SET_PIXEL_FORMAT); writeData(0x05); // 16 bits per pixel writeCommand(ILI9163_CMD_SET_GAMMA_CURVE); writeData(0x04); // Select gamma curve 3 writeCommand(ILI9163_CMD_GAM_R_SEL); writeData(0x01); // Gamma adjustment enabled writeCommand(ILI9163_CMD_POSITIVE_GAMMA_CORRECT); writeData(0x3f); // 1st Parameter writeData(0x25); // 2nd Parameter writeData(0x1c); // 3rd Parameter writeData(0x1e); // 4th Parameter writeData(0x20); // 5th Parameter writeData(0x12); // 6th Parameter writeData(0x2a); // 7th Parameter writeData(0x90); // 8th Parameter writeData(0x24); // 9th Parameter writeData(0x11); // 10th Parameter writeData(0x00); // 11th Parameter writeData(0x00); // 12th Parameter writeData(0x00); // 13th Parameter writeData(0x00); // 14th Parameter writeData(0x00); // 15th Parameter writeCommand(ILI9163_CMD_NEGATIVE_GAMMA_CORRECT); writeData(0x20); // 1st Parameter writeData(0x20); // 2nd Parameter writeData(0x20); // 3rd Parameter writeData(0x20); // 4th Parameter writeData(0x05); // 5th Parameter writeData(0x00); // 6th Parameter writeData(0x15); // 7th Parameter writeData(0xa7); // 8th Parameter writeData(0x3d); // 9th Parameter writeData(0x18); // 10th Parameter writeData(0x25); // 11th Parameter writeData(0x2a); // 12th Parameter writeData(0x2b); // 13th Parameter writeData(0x2b); // 14th Parameter writeData(0x3a); // 15th Parameter writeCommand(ILI9163_CMD_FRAME_RATE_CONTROL1); writeData(0x08); // DIVA = 8 writeData(0x08); // VPA = 8 writeCommand(ILI9163_CMD_DISPLAY_INVERSION); writeData(0x07); // NLA = 1, NLB = 1, NLC = 1 (all on Frame Inversion) writeCommand(ILI9163_CMD_POWER_CONTROL1); writeData(0x0a); // VRH = 10: GVDD = 4.30 writeData(0x02); // VC = 2: VCI1 = 2.65 writeCommand(ILI9163_CMD_POWER_CONTROL2); writeData(0x02); // BT = 2: AVDD = 2xVCI1, VCL = -1xVCI1, VGH = 5xVCI1, VGL = -2xVCI1 writeCommand(ILI9163_CMD_VCOM_CONTROL1); writeData(0x50); // VMH = 80: VCOMH voltage = 4.5 writeData(0x5b); // VML = 91: VCOML voltage = -0.225 writeCommand(ILI9163_CMD_VCOM_OFFSET_CONTROL); writeData(0x40); // nVM = 0, VMF = 64: VCOMH output = VMH, VCOML output = VML writeCommand(ILI9163_CMD_SET_COLUMN_ADDRESS); writeData(0x00); // XSH writeData(0x00); // XSL writeData(0x00); // XEH writeData(0x7f); // XEL (128 pixels x) writeCommand(ILI9163_CMD_SET_PAGE_ADDRESS); writeData(0x00); writeData(0x00); writeData(0x00); writeData(0x7f); // 128 pixels y // Select display orientation //writeCommand(ILI9163_CMD_SET_ADDRESS_MODE); //writeData(rotation); setRotation(rotation); // Set the display to on writeCommand(ILI9163_CMD_SET_DISPLAY_ON); writeCommand(ILI9163_CMD_WRITE_MEMORY_START);}
开发者ID:legath,项目名称:ILI9163_LCD,代码行数:100,
示例4: writeData/** * /par Function * writeReg * /par Description * Write the registor of i2c device. * /param[in] * reg - the address of registor. * /param[in] * data - the data that will be written to the registor. * /par Output * None * /return * Return the error code. * the definition of the value of variable return_value: * 0:success * 1:BUFFER_LENGTH is shorter than size * 2:address send, nack received * 3:data send, nack received * 4:other twi error * refer to the arduino official library twi.c * /par Others * To set the registor for initializing. */int8_t MeGyro::writeReg(int16_t reg, uint8_t data){ int8_t return_value = 0; return_value = writeData(reg, &data, 1); return(return_value);}
开发者ID:Suddel-T,项目名称:Makeblock-Libraries,代码行数:29,
示例5: runCommandint runCommand(int argc, char *argv[]){ if (!readData()) { if (errmsg[0] != '/0') printf("|status: ERROR: %s|/n", errmsg); else printf("|status: ERROR: Error reading mystore.dat/n/n%s|/n", Usage); return 1; } if (command == ADD && !add(argv[1],argv[2])) { if (errmsg[0] != '/0') printf("|status: ERROR: %s|/n", errmsg); else printf("|status: ERROR: Failure to add new item|/n"); return 1; } if (command == STAT) { printf("running stat/n"); status(); } if (command == SEARCH && !search(argv[1])) { if (errmsg[0] != '/0') printf("|status: ERROR: %s|/n", errmsg); else printf("|status: ERROR: Cannot search %s|/n",argv[1]); return 1; } if (command == DISPLAY && !display(argv[1])) { if (errmsg[0] != '/0') printf("|status: ERROR: %s|/n", errmsg); else printf("|status: ERROR: Cannot display %s|/n",argv[1]); return 1; } if (command == DELETE && !delete(argv[1])) { if (errmsg[0] != '/0') printf("|status: ERROR: %s|/n", errmsg); else printf("|status: ERROR: Cannot delete %s|/n", argv[1]); return 1; } if (command == EDIT && !edit(argv[1])) { if (errmsg[0] != '/0') printf("|status: ERROR: %s|/n", errmsg); else printf("|status: ERROR: cannot edit %s|/n",argv[1]); return 1; } if (rewrite) { printf("rewriting/n"); if (!writeData()) { if (errmsg[0] != '/0') printf("|status: ERROR: %s|/n", errmsg); else printf("|status: ERROR: Could not write the data, file may be destroyed|/n"); return 1; } } return 0;}
开发者ID:hherman1,项目名称:Personal-DB-Ui,代码行数:65,
示例6: processCommandvoid processCommand( unsigned char cmd ) { if ( cmd == CMD_SELECT_DEVICE ) { selectedDevice = uart_getc( ); uart_putc( BYTE_CR ); } else if ( cmd == CMD_SHOW_ID ) { uart_puts( AVRISP_IDENTIFIER ); } else if ( cmd == CMD_SOFTWARE_VERSION ) { uart_puts( AVRISP_SWVER ); } else if ( cmd == CMD_HARDWARE_VERSION ) { uart_puts( AVRISP_HWVER ); } else if ( cmd == CMD_LIST_SUPPORTED_DEVICES ) { uart_puts( AVRISP_SUPPORTED_DEVICES ); uart_putc( 0 ); // terminating null character needs to be sent } else if ( cmd == CMD_PROGRAMMER_TYPE ) { uart_putc( AVRISP_PROGRAMMER_TYPE ); } else if ( cmd == CMD_SUPPORTS_AUTOINCREMENT ) { uart_putc( AVRISP_RESP_YES ); } else if ( cmd == CMD_SET_LED ) { LED_on( ); uart_putc( BYTE_CR ); } else if ( cmd == CMD_CLEAR_LED ) { LED_off( ); uart_putc( BYTE_CR ); } else if ( selectedDevice == 0 ) { // require a device for the rest of the commands uart_putc( AVRISP_RESP_UNKNOWN ); return; } // command not specified above if ( cmd == CMD_ENTER_PROGRAM_MODE ) { enableProgramMode( ); } else if ( cmd == CMD_LEAVE_PROGRAM_MODE ) { leaveProgramMode( ); } else if ( cmd == CMD_WRITE_PROG_H ) { writeProgH( ); } else if ( cmd == CMD_WRITE_PROG_L ) { writeProgL( ); } else if ( cmd == CMD_READ_PROG ) { readProg( ); } else if ( cmd == CMD_LOAD_ADDRESS ) { loadAddress( ); } else if ( cmd == CMD_WRITE_DATA ) { writeData( ); } else if ( cmd == CMD_READ_DATA ) { readData( ); } else if ( cmd == CMD_CHIP_ERASE ) { chipErase( ); } else if ( cmd == CMD_WRITE_LOCK_BITS ) { writeLockBits( ); } else if ( cmd == CMD_READ_SIGNATURE ) { readSignature( ); } else if ( cmd == CMD_WRITE_PROGRAM_PAGE ) { writeProgramPage( ); } else if ( cmd == CMD_UNIVERSAL_3 ) { universalWrite3( ); } else if ( cmd == CMD_UNIVERSAL_4 ) { universalWrite4( ); } else if ( cmd == CMD_LOAD_ADDRESS_0 ) { currentAddress = 0; uart_putc( BYTE_CR ); }}
开发者ID:theojulienne,项目名称:penguino-projects,代码行数:65,
示例7: doShellvoid doShell(Client* shellClient) { Client* p; char head[HEAD_SIZE], value[VALUE_SIZE]; char fileBuffer[FILE_BUFFER_SIZE + 1]; char fileChunk[FILE_CHUNK_SIZE]; char filename[256]; unsigned long fileSize; int fd; FILE* fp; FDEBUG(("shell start/n")); while (1) { // shell C++ writeEEPROM函数代码示例 C++ writeConfig函数代码示例
|