• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ readRegister函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: readRegister

uint8_t MAX3421E::getRevision() {
	uint8_t revision = 0;
	readRegister(REVISION, &revision);

	return revision;
}
开发者ID:HalfHour,项目名称:usbarm,代码行数:6,代码来源:MAX3421E.cpp


示例2: readRegister

// most registers are 1 byte, so here is a convenience function
int MMA8452::readRegister(char addr, char *dst) {
    return readRegister(addr,dst,1);
}
开发者ID:rosterloh,项目名称:nRF51822-MBED,代码行数:4,代码来源:MMA8452.cpp


示例3: readRegister

bool
xpcc::Bma180<I2cMaster>::writeMaskedRegister(bma180::Register reg, uint8_t mask, uint8_t value)
{
	readRegister(reg);
	return writeRegister(reg, (buffer[0] & ~mask) | value);
}
开发者ID:pikeBishop,项目名称:OMP_IndMatrixDisplay,代码行数:6,代码来源:bma180_impl.hpp


示例4: readRegister

void ADNS2051::updateStatus(void)
{
	_status = readRegister(Motion_Status);
//Serial.println(_status);
}
开发者ID:Osblouf,项目名称:Hovercraft_PFE,代码行数:5,代码来源:ADNS2051.cpp


示例5: readRegister

void PAN3101::updateStatus(void)
{
	_status = readRegister(Motion_Status);
}
开发者ID:CWJRawls,项目名称:Arduino-2-PS2,代码行数:4,代码来源:PAN3101.cpp


示例6: readRegister

void ADNS2051::updateStatus(void)
{
	_status = readRegister(Motion_Status);
}
开发者ID:CWJRawls,项目名称:Arduino-2-PS2,代码行数:4,代码来源:ADNS2051.cpp


示例7: readRegister

uint8_t DW1000::readRegister8(uint8_t reg, uint16_t subaddress)
{
    uint8_t result;
    readRegister(reg, subaddress, &result, 1);
    return result;
}
开发者ID:ykiveish,项目名称:dw1000,代码行数:6,代码来源:dw1000.cpp


示例8: code

/* ======================================================================
Function: getConfig
Purpose : Get device configuration register  
Input   : pointer where the return value will be filled
Output  : Arduino Wire library return code (0 if ok)
Comments: 
====================================================================== */
uint8_t TH02::getConfig(uint8_t * pvalue)
{
  return (readRegister(TH02_CONFIG, pvalue));
}
开发者ID:hallard,项目名称:TH02,代码行数:11,代码来源:TH02.cpp


示例9: keepAlive

 //! Send keep-alive signal.
 void
 keepAlive(void)
 {
   readRegister(ADR_PRIV);
 }
开发者ID:Aero348,项目名称:dune,代码行数:6,代码来源:GVCP.hpp


示例10: readRegister

void MAX30100::setSamplingRate(SamplingRate samplingRate)
{
    uint8_t previous = readRegister(MAX30100_REG_SPO2_CONFIGURATION);
    writeRegister(MAX30100_REG_SPO2_CONFIGURATION, (previous & 0xe3) | (samplingRate << 2));
}
开发者ID:brucetsao,项目名称:LIB_for_MCU,代码行数:5,代码来源:MAX30100.cpp


示例11: outMessage

void ServerNetworkHandler::inMessage(std::string pMessage, int pSocket){
	pMessage = Tokenizer::cleanEntry(pMessage);
	std::string command = Tokenizer::getCommandSpace(pMessage, 1);
	if (_sessionID == -1 && command != "connect" && command != "adduser"){
		outMessage("?Error: No se ha inciado sesión\n", pSocket);
	} else {

		std::string param = Tokenizer::getParameters(pMessage);
		std::cout<<param<<std::endl;
		if (command == "get"){
			get(param, pSocket);

		} else if (command == "cd"){
			cd(param, pSocket);
		
		} else if (command == "rm"){
			rm(param, pSocket);

		} else if (command == "touch"){
			touch(param, pSocket);

		} else if (command == "connect"){
			connect(param, pSocket);

		} else if (command == "mkdir"){
			mkdir(param, pSocket);

		} else if (command == "adduser"){
			adduser(param, pSocket);

		} else if (command == "openfile"){
			openfile(param, pSocket);

		} else if (command == "appendReg"){
			appendReg(param, pSocket);

		} else if (command == "delReg"){

			if (param == ""){
				delActualReg(pSocket);
			} else {
				delReg(param, pSocket);
			}
		
		} else if (command == "write"){
			write(param, pSocket);
		
		} else if (command == "seek"){
			seek(param, pSocket);
		
		} else if (command == "addReg"){
			addReg(param, pSocket);
		
		} else if (command == "read"){

			if (param == ""){
				readActual(pSocket);
			} else {
				readRegister(param, pSocket);
			}

		} else if (command == "close"){
			close(pSocket);
		} else if (command == "consoleMode"){
			consoleMode(param, pSocket);
		} else {
			outMessage("?Error: No se ha encontrado la instrucción " + command + '\n', pSocket);
		}
		consoleUI(pSocket);
	}
}
开发者ID:jloaiza,项目名称:diglet,代码行数:71,代码来源:servernetworkhandler.cpp


示例12: printStatus

static void printStatus(niport *pniport, const char *source)
{
    sprintf(pniport->errorMessage, "%s "
        "isr1 %2.2x isr2 %2.2x ADSR %2.2x\n",
        source, pniport->isr1,pniport->isr2,readRegister(pniport,ADSR));
}
开发者ID:A2-Collaboration,项目名称:epics,代码行数:6,代码来源:drvNi1014.c


示例13: return

signed char PAN3101::dy(void)
{
	return (signed char) readRegister(Delta_Y);
}
开发者ID:CWJRawls,项目名称:Arduino-2-PS2,代码行数:4,代码来源:PAN3101.cpp


示例14: ni1014

void ni1014(void *pvt)
{
    niport          *pniport = (niport *)pvt;
    transferState_t state = pniport->transferState;
    epicsUInt8      isr1,isr2,octet;
    char            message[80];

    pniport->isr2 = isr2 = readRegister(pniport,ISR2);
    pniport->isr1 = isr1 = readRegister(pniport,ISR1);
    writeRegister(pniport,CSR1,2); /*acknowledge interrupt*/
    if(isr2&SRQI) callbackRequest(&pniport->callback);
    if(isr1&ERR) {
        if(state!=transferStateIdle) {
            sprintf(pniport->errorMessage,"\n%s interruptHandler ERR state %d\n",
                pniport->portName,state);
            pniport->status = asynError;
            epicsEventSignal(pniport->waitForInterrupt);
        }
        goto exit;
    }
    switch(state) {
    case transferStateCmd:
        if(!isr2&CO)
	    goto exit;
        if(pniport->bytesRemainingCmd == 0) {
            pniport->transferState = pniport->nextTransferState;
            if(pniport->transferState==transferStateIdle) {
                epicsEventSignal(pniport->waitForInterrupt);
            } else {
                writeRegister(pniport,AUXMR,AUXGTS);
            }
            break ;
        }
        octet = *pniport->nextByteCmd;
        writeRegister(pniport,CDOR,(epicsUInt8)octet);
        --(pniport->bytesRemainingCmd); ++(pniport->nextByteCmd);
        break;
    case transferStateWrite:
        if(!isr1&DO)
	    goto exit;
        if(pniport->bytesRemainingWrite == 0) {
            pniport->transferState = transferStateIdle;
            writeRegister(pniport,AUXMR,AUXTCA);
            epicsEventSignal(pniport->waitForInterrupt);
            break ;
        }
        if(pniport->bytesRemainingWrite==1) writeRegister(pniport,AUXMR,AUXEOI);
        octet = *pniport->nextByteWrite;
        writeRegister(pniport,CDOR,(epicsUInt8)octet);
        --(pniport->bytesRemainingWrite); ++(pniport->nextByteWrite);
        break;
    case transferStateRead:
        if(!isr1&DI) break;
        octet = readRegister(pniport,DIR);
        *pniport->nextByteRead = octet;
        --(pniport->bytesRemainingRead); ++(pniport->nextByteRead);
        if((pniport->eos != -1 ) && (octet == pniport->eos))
            pniport->eomReason |= ASYN_EOM_EOS;
        if(ENDRX&isr1) pniport->eomReason |= ASYN_EOM_END;
        if(pniport->bytesRemainingRead == 0) pniport->eomReason |= ASYN_EOM_CNT;
        if(pniport->eomReason) {
            pniport->transferState = transferStateIdle;
            writeRegister(pniport,AUXMR,AUXTCS);
            epicsEventSignal(pniport->waitForInterrupt);
            break;
        }
        writeRegister(pniport,AUXMR,AUXFH);
        break;
    case transferStateIdle:
        if(!isr1&DI)
	    goto exit;
        octet = readRegister(pniport,DIR);
        sprintf(message,"%s ni1014IH transferStateIdle received %2.2x\n",
             pniport->portName,octet);
        epicsInterruptContextMessage(message);
    }

exit:
    /* Force synchronization of VMEbus writes on PPC CPU boards. */
    readRegister(pniport,ADSR);
}
开发者ID:A2-Collaboration,项目名称:epics,代码行数:81,代码来源:drvNi1014.c


示例15: return

signed char ADNS2051::dx(void)
{
	return (signed char) readRegister(Delta_X);
}
开发者ID:CWJRawls,项目名称:Arduino-2-PS2,代码行数:4,代码来源:ADNS2051.cpp


示例16: readRegister

unsigned int HDC1050::getManufacturerID()
{
	readRegister(REG_ManufactureID, 2);
	return buf[0] << 8 | buf[1];
}
开发者ID:theMusicalGamer,项目名称:CanSat,代码行数:5,代码来源:HDC1050.cpp


示例17:

bool MAX30100::isTemperatureReady()
{
    return !(readRegister(MAX30100_REG_MODE_CONFIGURATION) & MAX30100_MC_TEMP_EN);
}
开发者ID:brucetsao,项目名称:LIB_for_MCU,代码行数:4,代码来源:MAX30100.cpp


示例18: switch

void MMA8452::debugRegister(char reg) {
   // get register value
   char v = 0;
   if(readRegister(reg,&v)) {
      MMA8452_DBG("Error reading specified register");
      return;
   }
   // print out details
   switch(reg) {
      case MMA8452_CTRL_REG_1:
         MMA8452_DBG("CTRL_REG_1 has value: 0x%x",v);
         MMA8452_DBG(" 7  ALSP_RATE_1: %d",(v&0x80)>>7);
         MMA8452_DBG(" 6  ALSP_RATE_0: %d",(v&0x40)>>6);
         MMA8452_DBG(" 5  DR2: %d",        (v&0x20)>>5);
         MMA8452_DBG(" 4  DR1: %d",        (v&0x10)>>4);
         MMA8452_DBG(" 3  DR0: %d",        (v&0x08)>>3);
         MMA8452_DBG(" 2  LNOISE: %d",     (v&0x04)>>2);
         MMA8452_DBG(" 1  FREAD: %d",      (v&0x02)>>1);
         MMA8452_DBG(" 0  ACTIVE: %d",     (v&0x01));
      break;

      case MMA8452_XYZ_DATA_CFG:
         MMA8452_DBG("XYZ_DATA_CFG has value: 0x%x",v);
         MMA8452_DBG(" 7  Unused: %d", (v&0x80)>>7);
         MMA8452_DBG(" 6  0: %d",      (v&0x40)>>6);
         MMA8452_DBG(" 5  0: %d",      (v&0x20)>>5);
         MMA8452_DBG(" 4  HPF_Out: %d",(v&0x10)>>4);
         MMA8452_DBG(" 3  0: %d",      (v&0x08)>>3);
         MMA8452_DBG(" 2  0: %d",      (v&0x04)>>2);
         MMA8452_DBG(" 1  FS1: %d",    (v&0x02)>>1);
         MMA8452_DBG(" 0  FS0: %d",    (v&0x01));
         switch(v&0x03) {
            case 0:
               MMA8452_DBG("Dynamic range: 2G");
            break;
            case 1:
               MMA8452_DBG("Dynamic range: 4G");
            break;
            case 2:
               MMA8452_DBG("Dynamic range: 8G");
            break;
            default:
               MMA8452_DBG("Unknown dynamic range");
            break;
         }
      break;

      case MMA8452_STATUS:
         MMA8452_DBG("STATUS has value: 0x%x",v);
         MMA8452_DBG(" 7  ZYXOW: %d",(v&0x80)>>7);
         MMA8452_DBG(" 6  ZOW: %d",  (v&0x40)>>6);
         MMA8452_DBG(" 5  YOW: %d",  (v&0x20)>>5);
         MMA8452_DBG(" 4  XOW: %d",  (v&0x10)>>4);
         MMA8452_DBG(" 3  ZYXDR: %d",(v&0x08)>>3);
         MMA8452_DBG(" 2  ZDR: %d",  (v&0x04)>>2);
         MMA8452_DBG(" 1  YDR: %d",  (v&0x02)>>1);
         MMA8452_DBG(" 0  XDR: %d",  (v&0x01));
      break;

      default:
         MMA8452_DBG("Unknown register address: 0x%x",reg);
      break;
   }
}
开发者ID:rosterloh,项目名称:nRF51822-MBED,代码行数:64,代码来源:MMA8452.cpp


示例19: readRegister

uint8_t Adafruit_ADXL345_Unified::getDeviceID(void) {
    // Check device ID register
    return readRegister(ADXL345_REG_DEVID);
}
开发者ID:graceyha,项目名称:gcc-quadrocopter,代码行数:4,代码来源:Adafruit_ADXL345_U.cpp


示例20: readRegister

uint8_t Nrf24l::getStatus(){
	uint8_t rv;
	readRegister(STATUS,&rv,1);
	return rv;
}
开发者ID:wnew,项目名称:arduino-nrf24l01,代码行数:5,代码来源:Mirf.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ readRegister8函数代码示例发布时间:2022-05-30
下一篇:
C++ readReg函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap