当前位置: 首页>>代码示例>>C++>>正文


C++ writeEEPROM函数代码示例

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


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

示例1: write_app_register

///////////////////////////////////////////////////////////////////////////////
// write_app_register
//
void write_app_register( uint08_t reg, uint08_t val )
{
	SendMsg.priority = VSCP_PRIORITY_MEDIUM;
	SendMsg.vscp_class = VSCP_CLASS1_PROTOCOL;
	SendMsg.vscp_type = VSCP_TYPE_PROTOCOL_RW_RESPONSE;
	SendMsg.length = 2;
	SendMsg.data[0] = reg;
	SendMsg.data[1] = ~val; // error return

	switch ( reg ) {
		// Zone
		case 0x23:
			writeEEPROM( REG_APP_ZONE, val);
			SendMsg.data[1] = readEEPROM( REG_APP_ZONE);
			break;
		// SubZone
		case 0x24:
			writeEEPROM( REG_DOOR_SUBZONE, val);
			SendMsg.data[1] = readEEPROM( REG_DOOR_SUBZONE);
			break;	

		default:
			SendMsg.data[1] = ~val; // error return	
			break;
	}
	// Send data
	VSCP_enqMsgTx( &SendMsg, FALSE);	
} 
开发者ID:grodansparadis,项目名称:vscp_firmware,代码行数:31,代码来源:VSCP_app.c

示例2: main

void main(void) {
    byte evalue;
    initSquareWear();
    setModeOutput(pinC7);
    latC7 = 0;
    delayMilliseconds(250); // short delay for EEPROM to stablize
    evalue = readEEPROM(0x0);   // read EEPROM address 0
    switch(evalue) {
        case 0:
            writeEEPROM(0x0, 1);    // write next index to EEPROM address 0
            busyEEPROM();           // wait till write completes
            while(1) {
                latC7 = !latC7;
                delayMilliseconds(100);
            }
            break;
        case 1:
            writeEEPROM(0x0, 2);
            busyEEPROM();
            while(1) {
                latC7 = !latC7;
                delayMilliseconds(500);
            }
            break;
        default:
            writeEEPROM(0x0, 0);
            busyEEPROM();
            while(1) {
                latC7 = !latC7;
                delayMilliseconds(1000);
            }
            break;

    }
}
开发者ID:3dlogixbydesign,项目名称:squarewear,代码行数:35,代码来源:SquareWearDemo.c

示例3: savePassword

unsigned char savePassword(long g){
	if(g>0){
		processNumber(g);
		unsigned char ca=getFCell();
		
		writeEEPROM(ca,num1);
		writeEEPROM((ca+1),num2);
		writeEEPROM((ca+2),num3);
	}
	return 1;
}
开发者ID:LamdaTK,项目名称:SecureDoorLocker,代码行数:11,代码来源:eeprom.c

示例4: initEEPROM

//Initialise l'EEPROM avec des valeurs par défaut
void initEEPROM() {
	//Charge les coeffs PID par défaut
	defaultPID();
	//Charge les trims par défaut (consignes utilisées en mode failsafe également)
	defaultTrim();
	//Angles à 0
	memset(&anglesOffsets, 0, sizeof(IMU_ANGLES_VITESSES));
	//Ecrit les données en EEPROM
	writeEEPROM (&coeffsPID, EEPROM_BASE, MAX_PID * sizeof(COEFFS_PID));
	writeEEPROM (&telecommandeOffsets, EEPROM_BASE + EEPROM_OFFSET_TRIMS, sizeof(TELECOMMANDE_DATA));
	writeEEPROM (&anglesOffsets, EEPROM_BASE + EEPROM_OFFSET_ANGLES, sizeof(IMU_ANGLES_VITESSES));
	printf("->Initialisation EEPROM\n");
}
开发者ID:elfekih,项目名称:insa-projet-drone,代码行数:14,代码来源:mode_vol.c

示例5: writeEEPROM

/*
* Save the settings in EEPROM
*/
void Network::writeSettings() {
  int j = 1;
  j+= writeEEPROM(mac_oui, j, sizeof(mac_oui) * sizeof(uint8_t));
  j+= writeEEPROM(mac, j, sizeof(mac) * sizeof(uint8_t));
  j+= writeEEPROM(&use_dhcp, j, sizeof(bool));
  j+= writeEEPROM(&ip, j);
  j+= writeEEPROM(&subnet, j);
  j+= writeEEPROM(&gateway, j);
  j+= writeEEPROM(&dns, j);
  j+= writeEEPROM(&httpPort, j, sizeof(httpPort));
  j+= writeEEPROM(&websocketPort, j,sizeof(websocketPort));  
}
开发者ID:AxisCommunications,项目名称:door-controller-test-tool,代码行数:15,代码来源:Network.cpp

示例6: stickKnobCalibrationMiddle

/** @Brief 电位器\旋钮获取中值
  * @ 多次采用取平均
  *
  * @Note
  *   1) 调用此程序前,各电位器拨到中间位置
  */
void stickKnobCalibrationMiddle(void) {	
	uint32_t currentTime;
	uint8_t i, count;			
	uint16_t adc;	
	uint32_t adcSum[STICK_KNOB_SUM];
	
	for(i=0; i<STICK_KNOB_SUM; i++) {
		adcSum[i] = 0;	
		StickKnob[i].adcLimitMiddle = 2048;
	}
	count = 0;
	
	//1) 每20ms采样一次,1s后计算均值
	currentTime = micros() + 300000;
	while((int32_t)(currentTime - micros()) >= 0) {
	    for(i=0; i<STICK_KNOB_SUM; i++) {	
	      adc = adcGetChannel(StickKnob[i].adcChannel);
		    adcSum[i] += adc;
			}
			count++;
			delay(20);		
			LED0_TOGGLE;	
	}
	
	for(i=0; i<STICK_KNOB_SUM; i++) {	
		StickKnob[i].adcLimitMiddle = adcSum[i]/count;
	}	
	
	//2) 保存至EEPROM
	for(i = 0; i < STICK_KNOB_SUM; i++) {
	  cfg.adcLimitMiddle[i] = StickKnob[i].adcLimitMiddle;
	}
	writeEEPROM(1, 1);	
}
开发者ID:wzw2015,项目名称:OpenTel_Tran_Baseflight,代码行数:40,代码来源:stickKnob.c

示例7: changeProfile

void changeProfile(uint8_t profileIndex)
{
    masterConfig.current_profile_index = profileIndex;
    writeEEPROM();
    readEEPROM();
    beeperConfirmationBeeps(profileIndex + 1);
}
开发者ID:kc10kevin,项目名称:betaflight,代码行数:7,代码来源:config.c

示例8: cliSave

static void cliSave(char *cmdline)
{
    cliPrint("Saving...");
    copyCurrentProfileToProfileSlot(masterConfig.current_profile_index);
    writeEEPROM();
    cliReboot();
}
开发者ID:Reini60,项目名称:cleanflight,代码行数:7,代码来源:serial_cli.c

示例9: controlPWM

//Function that control the specific brightness of the led conected to specific pwmpin.
//the structure of the command is pwmpin:brightness
int controlPWM(String command) {
     int index=command.indexOf(":");
     String pwmpin=command.substring(0,index);
     String val=command.substring(index+1);
     int pin=pwmpin.toInt();
     int value=val.toInt();
    if (value<256&&value>=0){
        analogWrite(pin,value);
        if (pin==10){
            EEPROMData.outputData.pwmoutput[2].pin=pin;
            EEPROMData.outputData.pwmoutput[2].value=value;
         }
        else if (pin==11){
            EEPROMData.outputData.pwmoutput[3].pin=pin;
            EEPROMData.outputData.pwmoutput[3].value=value;
        }
        else if (pin>13&&pin<18){
            EEPROMData.outputData.pwmoutput[pin-10].pin=pin;
            EEPROMData.outputData.pwmoutput[pin-10].value=value;
        }
        else if (pin<2){
            EEPROMData.outputData.pwmoutput[pin].pin=pin;
            EEPROMData.outputData.pwmoutput[pin].value=value;
        }
        writeEEPROM();
        return value;
    }
    else{
        return -1;// return -1 if the pin sended on the command is not the PWM output ones
    }
}
开发者ID:LPFraile,项目名称:Sensorflare-SparkCore,代码行数:33,代码来源:sensorflare.cpp

示例10: osdHardwareInit

void osdHardwareInit(void)
{
    LED0_ON;
    delay(500);
    max7456_hardwareReset();
    LED0_OFF;

    osdHardwareApplyConfiguration(osdVideoConfig()->videoMode);

    max7456_extiConfigure(&max7456LOSExtiConfig, &max7456VSYNCExtiConfig, &max7456HSYNCExtiConfig);

    if (osdFontConfig()->fontVersion != FONT_VERSION) {
        // before
        max7456_showFont();
        delay(5000); // give the user a chance to power off before changing

        max7456_resetFont();

        // after
        max7456_showFont();
        delay(5000); // give the user a chance to power off after changing

        osdFontConfig()->fontVersion = FONT_VERSION;
        writeEEPROM();

    	max7456_clearScreen();
    	max7456_ensureDisplayClearIsComplete();
    }
}
开发者ID:Bengt-M,项目名称:Triflight,代码行数:29,代码来源:osd_max7456.c

示例11: changeProfile

void changeProfile(uint8_t profileIndex)
{
    masterConfig.current_profile_index = profileIndex;
    writeEEPROM();
    readEEPROM();
    blinkLedAndSoundBeeper(2, 40, profileIndex + 1);
}
开发者ID:bennyh88,项目名称:cleanflight,代码行数:7,代码来源:config.c

示例12: vscp_setControlByte

///////////////////////////////////////////////////////////////////////////////
//  setVSCPControlByte
//
void vscp_setControlByte( uint08_t ctrl )
{
	if (GetResource(RESOURCE_EE_ID) == E_OK)
	{
		writeEEPROM( VSCP_EEPROM_CONTROL, ctrl );
		ReleaseResource(RESOURCE_EE_ID);
	}
}
开发者ID:grodansparadis,项目名称:vscp_firmware,代码行数:11,代码来源:VSCP_app.c

示例13: vscp_setSegmentCRC

///////////////////////////////////////////////////////////////////////////////
//  setSegmentCRC
//
void vscp_setSegmentCRC( uint08_t crc )
{
	if (GetResource(RESOURCE_EE_ID) == E_OK)
	{
		writeEEPROM( VSCP_EEPROM_SEGMENT_CRC, crc );
		ReleaseResource(RESOURCE_EE_ID);
	}
}
开发者ID:grodansparadis,项目名称:vscp_firmware,代码行数:11,代码来源:VSCP_app.c

示例14: vscp_setManufacturerId

///////////////////////////////////////////////////////////////////////////////
// setVSCPManufacturerId
// 
// Set Manufacturer id and subid to EEPROM
//
void vscp_setManufacturerId( uint08_t idx, uint08_t data )
{
	if (GetResource(RESOURCE_EE_ID) == E_OK)
		{
		writeEEPROM( VSCP_EEPROM_REG_MANUFACTUR_ID0 + idx, data );	
		ReleaseResource(RESOURCE_EE_ID);
	}
}
开发者ID:grodansparadis,项目名称:vscp_firmware,代码行数:13,代码来源:VSCP_app.c

示例15: vscp_setNickname

///////////////////////////////////////////////////////////////////////////////
//  setNickname
//
void vscp_setNickname( uint08_t nickname )
{
	if (GetResource(RESOURCE_EE_ID) == E_OK)
	{
		writeEEPROM( VSCP_EEPROM_NICKNAME, nickname );
		ReleaseResource(RESOURCE_EE_ID);
	}
}
开发者ID:grodansparadis,项目名称:vscp_firmware,代码行数:11,代码来源:VSCP_app.c


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