您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ writeWord函数代码示例

51自学网 2021-06-03 10:04:59
  C++
这篇教程C++ writeWord函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中writeWord函数的典型用法代码示例。如果您正苦于以下问题:C++ writeWord函数的具体用法?C++ writeWord怎么用?C++ writeWord使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了writeWord函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: writeWord

uint16_t picaso4d::txt_FontSD(uint8_t fontNumber) {	if (fontNumber >= PICASO_NUM_FONTS)		return 0;	writeWord(0xFFE5);	writeWord(_fontHandles[fontNumber]);	return getACKresponse();}
开发者ID:capricorn-one,项目名称:midiSync-SX,代码行数:7,


示例2: writeItem

/********************************************************************* * @fn      writeItem * * @brief   Write a data item to NV. Function can write an entire item to NV * * @param   pg     - Page number * @param   offset - offset within the NV page where to write the new item * @param   id     - NV item ID * @param   alignedLen - Length of data to write, alinged in flash word *                       boundary * @param  *pBuf   - Data to write. * * @return  none */static void writeItem( uint8 pg, uint16 offset, osalSnvId_t id, uint16 alignedLen, uint8 *pBuf ){  osalNvItemHdr_t hdr;  hdr.id = 0xFFFF;  hdr.len = alignedLen | OSAL_NV_INVALID_LEN_MARK;  // Write the len portion of the header first  writeWord(pg, offset + alignedLen, (uint8 *) &hdr);  // remove invalid len mark  hdr.len &= ~OSAL_NV_INVALID_LEN_MARK;  writeWord(pg, offset + alignedLen, (uint8 *) &hdr);  // Copy over the data  writeWordM(pg, offset, pBuf, alignedLen / OSAL_NV_WORD_SIZE);  // value is valid. Write header except for the most significant bit.  hdr.id = id | OSAL_NV_INVALID_ID_MARK;  writeWord(pg, offset + alignedLen, (uint8 *) &hdr);  // write the most significant bit  hdr.id &= ~OSAL_NV_INVALID_ID_MARK;  writeWord(pg, offset + alignedLen, (uint8 *) &hdr);}
开发者ID:backman-git,项目名称:EcoSim-sample-project,代码行数:39,


示例3: readWord

void SX1509::writePin(byte pin, byte highLow){	unsigned int tempRegDir = readWord(REG_DIR_B);		if ((0xFFFF^tempRegDir)&(1<<pin))	// If the pin is an output, write high/low	{		unsigned int tempRegData = readWord(REG_DATA_B);		if (highLow)	tempRegData |= (1<<pin);		else			tempRegData &= ~(1<<pin);		writeWord(REG_DATA_B, tempRegData);	}	else	// Otherwise the pin is an input, pull-up/down	{		unsigned int tempPullUp = readWord(REG_PULL_UP_B);		unsigned int tempPullDown = readWord(REG_PULL_DOWN_B);				if (highLow)	// if HIGH, do pull-up, disable pull-down		{			tempPullUp |= (1<<pin);			tempPullDown &= ~(1<<pin);			writeWord(REG_PULL_UP_B, tempPullUp);			writeWord(REG_PULL_DOWN_B, tempPullDown);		}		else	// If LOW do pull-down, disable pull-up		{			tempPullDown |= (1<<pin);			tempPullUp &= ~(1<<pin);			writeWord(REG_PULL_UP_B, tempPullUp);			writeWord(REG_PULL_DOWN_B, tempPullDown);		}	}}
开发者ID:brucetsao,项目名称:LIB_for_MCU,代码行数:32,


示例4: initDisplay

void initDisplay() {  // All digits on  writeWord(0x0b07);  // Set maximum brightness  writeWord(0x0a0f);  // Turn it on  writeWord(0x0c01);}
开发者ID:evenwestvang,项目名称:paft-dunk,代码行数:8,


示例5: writeWord

void BitmapWriter::writeFileHeader(struct fileheader & fileheader, FILE * file){    writeWord(fileheader.type, file);    writeDWord(fileheader.fileSize, file);    writeWord(fileheader.reserved1, file);    writeWord(fileheader.reserved2, file);    writeDWord(fileheader.offset, file);}
开发者ID:Poligun,项目名称:RayTracer,代码行数:8,


示例6: writeWord

 /*--------------------------------------------------------------  * Save a graph on a file readable by a BinaryGraphLoader.  * NOTE: the output stream must be open with the   * ios::binary | ios::out mode.  -------------------------------------------------------------*/void BinaryGraphLoader::write(ostream& out, Graph &g)  { int i,j;    writeWord(out, g.NodeCount());    for(i=0; i<g.NodeCount(); i++)      { writeWord(out, g.OutEdgeCount(i));        for(j=0; j<g.OutEdgeCount(i); j++)	  writeWord(out, g.GetOutEdge(i,j,NULL));      }  }
开发者ID:chubbymaggie,项目名称:libv,代码行数:14,


示例7: writeDWord

void BitmapWriter::writeInfoHeader(struct infoheader & infoheader, FILE * file){    writeDWord(infoheader.size, file);    writeDWord(infoheader.width, file);    writeDWord(infoheader.height, file);    writeWord(infoheader.planes, file);    writeWord(infoheader.bitCount, file);    writeDWord(infoheader.compression, file);    writeDWord(infoheader.imageSize, file);    writeDWord(infoheader.xPixelsPerMeter, file);    writeDWord(infoheader.yPixelsPerMeter, file);    writeDWord(infoheader.colorUsed, file);    writeDWord(infoheader.colorImportant, file);}
开发者ID:Poligun,项目名称:RayTracer,代码行数:14,


示例8: writeSentence

/********************************************************************* Write a sentence (multiple words) to the socket********************************************************************/void writeSentence(int fdSock, struct Sentence *stWriteSentence) {    int iIndex;    if (stWriteSentence->iLength == 0) {        return;    }    DEBUG ? printf("Writing sentence/n") : 0;    DEBUG ? printSentence(stWriteSentence) : 0;    for (iIndex = 0; iIndex < stWriteSentence->iLength; iIndex++) {        writeWord(fdSock, stWriteSentence->szSentence[iIndex]);    }    writeWord(fdSock, "");}
开发者ID:Devronium,项目名称:ConceptApplicationServer,代码行数:19,


示例9: xferBuf

/********************************************************************* * @fn      xferBuf * * @brief   Xfers an NV buffer from one location to another, enforcing OSAL_NV_WORD_SIZE writes. * * @return  none */static void xferBuf( uint8 srcPg, uint16 srcOff, uint8 dstPg, uint16 dstOff, uint16 len ){  uint8 rem = dstOff % OSAL_NV_WORD_SIZE;  uint8 tmp[OSAL_NV_WORD_SIZE];  if ( rem )  {    dstOff -= rem;    HalFlashRead(dstPg, dstOff, tmp, OSAL_NV_WORD_SIZE);    while ( (rem < OSAL_NV_WORD_SIZE) && len )    {      HalFlashRead(srcPg, srcOff, tmp+rem, 1);      srcOff++;      rem++;      len--;    }    writeWord( dstPg, dstOff, tmp );    dstOff += OSAL_NV_WORD_SIZE;  }  rem = len % OSAL_NV_WORD_SIZE;  len /= OSAL_NV_WORD_SIZE;  while ( len-- )  {    HalFlashRead(srcPg, srcOff, tmp, OSAL_NV_WORD_SIZE);    srcOff += OSAL_NV_WORD_SIZE;    writeWord( dstPg, dstOff, tmp );    dstOff += OSAL_NV_WORD_SIZE;  }  if ( rem )  {    uint8 idx = 0;    HalFlashRead(dstPg, dstOff, tmp, OSAL_NV_WORD_SIZE);    while ( rem-- )    {      HalFlashRead(srcPg, srcOff, tmp+idx, 1);      srcOff++;      idx++;    }    writeWord( dstPg, dstOff, tmp );  }}
开发者ID:paoloach,项目名称:zpowermeter,代码行数:53,


示例10: writeWord

void XMFileBase::writeWords(const mp_uword* buffer,mp_sint32 count){	for (mp_sint32 i = 0; i < count; i++)	{		writeWord(*buffer);		buffer++;	}}
开发者ID:Fatbag,项目名称:MilkyTracker,代码行数:8,


示例11: writeGlobalSettings

void writeGlobalSettings() {  eepromSetValid();  cli();  writeByte(2, mode);  writeWord(3, tuningSetting);  sei();}
开发者ID:synthino,项目名称:synthino_xm,代码行数:8,


示例12: setXferPage

/********************************************************************* * @fn      setXferPage * * @brief   Set active page header state to be transfer state. * * @param   none * * @return  none */static void setXferPage(void){  uint32 pgHdr;  // erase difference bit between active state and xfer state  pgHdr = OSAL_NV_XFER_PAGE_STATE;  writeWord( activePg, OSAL_NV_PAGE_HDR_OFFSET, (uint8*)&pgHdr );}
开发者ID:backman-git,项目名称:EcoSim-sample-project,代码行数:18,


示例13: writeWord

/** write a single bit in a 16-bit device register. * @param devAddr I2C slave device address or Slave Select pin if SPI * @param regAddr Register regAddr to write to * @param bitNum Bit position to write (0-15) * @param value New bit value to write * @return Status of operation (true = success) */mraa_result_t I2Cdev::writeBitW (uint8_t devAddr, uint8_t regAddr, uint8_t bitNum, uint16_t data) {	uint16_t w;	mraa_result_t result;	if ((result = readWord (devAddr, regAddr, &w)) == MRAA_SUCCESS) {		w = (data != 0) ? (w | (1 << bitNum)) : (w & ~(1 << bitNum));		return writeWord (devAddr, regAddr, w);	}	else		return result;}
开发者ID:Sanderhuisman,项目名称:EdisonQuad,代码行数:17,


示例14: if

void max7301::portPullup(uint16_t data) {	if (data == HIGH){		_gpioState = 0xFFFF;	} else if (data == LOW){			_gpioState = 0x0000;	} else {		_gpioState = data;	}	writeWord(GPPU, _gpioState);}
开发者ID:koson,项目名称:gpio_expander,代码行数:10,


示例15: writeItem

/********************************************************************* * @fn      writeItem * * @brief   Writes an item header/data combo to the specified NV page. * * @param   pg - Valid NV Flash page. * @param   id - Valid NV item Id. * @param   len  - Byte count of the data to write. * @param   buf  - The data to write. If NULL, no data/checksum write. * @param   flag - TRUE if the checksum should be written, FALSE otherwise. * * @return  TRUE if header/data to write matches header/data read back, else FALSE. */static uint8 writeItem( uint8 pg, uint16 id, uint16 len, void *buf, uint8 flag ){  uint16 offset = pgOff[pg-OSAL_NV_PAGE_BEG];  uint8 rtrn = FALSE;  osalNvHdr_t hdr;  hdr.id = id;  hdr.len = len;  writeWord( pg, offset, (uint8 *)&hdr );  HalFlashRead(pg, offset, (uint8 *)(&hdr), OSAL_NV_HDR_SIZE);  if ( (hdr.id == id) && (hdr.len == len) )  {    if ( flag )    {      hdr.chk = calcChkB( len, buf );      offset += OSAL_NV_HDR_SIZE;      if ( buf != NULL )      {        writeBuf( pg, offset, len, buf );      }      if ( hdr.chk == calcChkF( pg, offset, len ) )      {        if ( hdr.chk == setChk( pg, offset, hdr.chk ) )        {          hotItemUpdate(pg, offset, hdr.id);          rtrn = TRUE;        }      }    }    else    {      rtrn = TRUE;    }    len = OSAL_NV_ITEM_SIZE( hdr.len );  }  else  {    len = OSAL_NV_ITEM_SIZE( hdr.len );    if (len > (OSAL_NV_PAGE_SIZE - pgOff[pg - OSAL_NV_PAGE_BEG]))    {      len = (OSAL_NV_PAGE_SIZE - pgOff[pg - OSAL_NV_PAGE_BEG]);    }    pgLost[pg - OSAL_NV_PAGE_BEG] += len;  }  pgOff[pg - OSAL_NV_PAGE_BEG] += len;  return rtrn;}
开发者ID:paoloach,项目名称:zpowermeter,代码行数:68,



注:本文中的writeWord函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ write_all函数代码示例
C++ writeWithIndent函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。