本文整理汇总了C++中eeprom_write_word函数的典型用法代码示例。如果您正苦于以下问题:C++ eeprom_write_word函数的具体用法?C++ eeprom_write_word怎么用?C++ eeprom_write_word使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了eeprom_write_word函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: store_permanent
static void store_permanent(void){
int tmp;
signed char changeflag=1;
lcd_clrscr();
if (eeprom_read_byte((uint8_t *)0x0) == 19){
changeflag=0;
// ok magic number matches accept values
tmp=eeprom_read_word((uint16_t *)0x04);
if (tmp != set_val[1]){
changeflag=1;
}
tmp=eeprom_read_word((uint16_t *)0x02);
if (tmp != set_val[0]){
changeflag=1;
}
}
if (changeflag){
lcd_puts_P("setting stored");
eeprom_write_byte((uint8_t *)0x0,19); // magic number
eeprom_write_word((uint16_t *)0x02,set_val[0]);
eeprom_write_word((uint16_t *)0x04,set_val[1]);
}else{
if (bpress> 5){
// display software version after long press
lcd_puts_P(SWVERSION);
lcd_gotoxy(0,1);
lcd_puts_P("tuxgraphics.org");
}else{
lcd_puts_P("already stored");
}
}
delay_ms(200);
}
开发者ID:pcsquirrel,项目名称:digital-dc-power-supply,代码行数:33,代码来源:ddcp.c
示例2: calibrate
void calibrate(void)
{
uint16_t min, max;
// Timer/Counter0,1 Overflow Interrupt Enable - LED1 blinking
TIMSK |= _BV(TOIE1);
// Calibrate minimum value
PORTA &= ~_BV(LED2);
wait_for_prog();
min = pressure();
PORTA |= _BV(LED2);
// Calibrate maximum value
PORTA &= ~_BV(LED3);
wait_for_prog();
max = pressure();
PORTA |= _BV(LED3) | _BV(LED1);
// Save values in EEPROM
eeprom_busy_wait();
eeprom_write_word(PMINIMUM, min);
eeprom_busy_wait();
eeprom_write_word(PMAXIMUM, max);
// Timer/Counter0,1 Overflow Interrupt Disable
TIMSK &= ~_BV(TOIE1);
}
开发者ID:qoobaa,项目名称:depthsensor-code,代码行数:28,代码来源:sensor.c
示例3: lock_device
/*
* If there were MAX_WRONG_TRIES unsuccessful attempts to type the code,
* block the execution for LOCKDOWN_WAIT seconds.
*/
void lock_device()
{
if (!eeprom_read_word(WAIT_TIMER))
{
return;
}
avr_lcd_clear();
avr_lcd_puts("Device locked");
char buf[16];
for (uint16_t i = eeprom_read_word(WAIT_TIMER); i > 0; i--)
{
uint8_t min = i / 60;
uint8_t sec = i % 60;
snprintf(buf, 16, "Wait %02d m %02d s", min, sec);
avr_lcd_set_cursor_pos(AVR_LCD_LINE1 + 0);
avr_lcd_puts(buf);
_delay_ms(1000);
eeprom_write_word(WAIT_TIMER, i);
}
eeprom_write_word(WAIT_TIMER, 0);
eeprom_write_byte(WRONG_TRIES, 0);
}
开发者ID:H2CO3,项目名称:CodeLock,代码行数:31,代码来源:main.c
示例4: lcd_material_reset_defaults
void lcd_material_reset_defaults()
{
//Fill in the defaults
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("Materials reset");
char buffer[MATERIAL_NAME_LENGTH];
for (int a= 0; a< MATERIAL_PRESETS; a++)
{
strncpy_P(buffer, (char PROGMEM *) presets[a].name,MATERIAL_NAME_LENGTH); // this will pad out the whole length with 0 as needed.
eeprom_write_block(buffer , EEPROM_MATERIAL_NAME_OFFSET(a), MATERIAL_NAME_LENGTH);
material_preset temp;
memcpy_P((void*) &temp,&presets[a],sizeof (material_preset));
eeprom_write_word(EEPROM_MATERIAL_TEMPERATURE_OFFSET(a) ,temp.temperature);
eeprom_write_word(EEPROM_MATERIAL_BED_TEMPERATURE_OFFSET(a),temp.bed);
eeprom_write_byte(EEPROM_MATERIAL_FAN_SPEED_OFFSET(a) ,temp.fan_speed);
eeprom_write_word(EEPROM_MATERIAL_FLOW_OFFSET(a) ,temp.flow);
eeprom_write_float(EEPROM_MATERIAL_DIAMETER_OFFSET(a) ,temp.diameter);
}
uint8_t e;
for(e=0; e<EXTRUDERS; e++)
{
makeCustomName(e);
strcpy(material_name[e],material_name_buf);
lcd_material_store_current_material();
}
eeprom_write_byte(EEPROM_MATERIAL_COUNT_OFFSET(), MATERIAL_PRESETS);
lcd_lib_beep_ext(500,150);
lcd_lib_beep_ext(750,100);
}
开发者ID:norpchen,项目名称:Ultimaker2Marlin,代码行数:30,代码来源:UltiLCD2_menu_material.cpp
示例5: PSTR
void AlgorithmRepository::writeToEEPROM()
{
#ifndef DEBUGGING
#ifdef ENABLE_DEBUG_UART
Comm::printf_P( PSTR("Store in EEPROM"));
#endif
WORD addr= 0;
eeprom_write_byte( (uint8_t *)addr++, 'J' );
eeprom_write_byte( (uint8_t *)addr++, 'P' );
eeprom_write_byte( (uint8_t *)addr++, ((RECEIVER_CHANNELS << 5) | OUTPUT_CHANNELS) );
eeprom_write_block( (const void *)&programArray, (void *)addr, (size_t)sizeof( programArray ) );
addr += sizeof( programArray );
eeprom_write_block( (const void *)&inputChannel, (void *)addr, (size_t)sizeof( inputChannel ) );
addr += sizeof( inputChannel );
for( BYTE i = 0; i < RECEIVER_CHANNELS; i++)
{
eeprom_write_word( (uint16_t *)addr, Receiver::getChannelMin( i ));
addr += sizeof( WORD );
eeprom_write_word( (uint16_t *)addr, Receiver::getChannelMax( i ));
addr += sizeof( WORD );
}
eeprom_write_byte( (uint8_t *) addr, Receiver::getChannelModeByte( ));
addr++;
eeprom_write_word((uint16_t *) addr, Adc::getLimit());
#endif
}
开发者ID:steff42,项目名称:AviLight4,代码行数:30,代码来源:EEProm.cpp
示例6: saveConfig
void saveConfig(){
uint16_t *__p=0;
eeprom_write_word(__p,config_t_pomodoro);
eeprom_write_word(__p+1,config_t_przerwa1);
eeprom_write_word(__p+2,config_t_przerwa2);
eeprom_write_word(__p+3,config_n_kr_przerw);
}
开发者ID:nokia-wroclaw,项目名称:innovativeproject-pomodoro,代码行数:7,代码来源:config.c
示例7: write32int
void write32int (int inode, int offset, int32_t value)
{
uint16_t addr;
uint16_t value1;
uint32_t value2;
value1 = (uint16_t)((*(uint32_t *)&value) >> 16);
value2 = (uint16_t)((*(uint32_t *)&value) & 0x0000ffff);
addr = inode*INODESIZE + offset;
eeprom_busy_wait();
//value2 = *(uint16_t *)&value;
eeprom_write_word((uint16_t *)addr, value2);
addr = inode*INODESIZE + offset +2 ;
eeprom_busy_wait();
//value2 = *(uint16_t *)&value;
eeprom_write_word((uint16_t *)addr, value1);
return;
}
开发者ID:beartan,项目名称:liteOS,代码行数:33,代码来源:io_eeprom.c
示例8: gear_lern_count
void gear_lern_count(int n, int address){
uint16_t high=0;
uint16_t low=0;
uint16_t current;
int i;
led_char(n);
while(LEARN_SW);
_delay_ms(100);
while(!LEARN_SW);
#ifdef DEBUG
printf("START LEARN\r\n");
#endif
current = read_puls_20();
low = current;
high = current;
for(i=0; i<10; i++){
current = read_puls_20(); // Read result for 10 pulses
if(current < low){ // Set min & max value
low = current;
}
if(current > high){
high = current;
}
#ifdef DEBUG
printf("low, high > %d, %d\r\n",low, high);
#endif
}
if((low <= 0)||(high > 1000)){ // Error condition
#ifdef DEBUG
printf(">%d-%d\r\n", low, high);
#endif
for(;;){
led_char('R');
_delay_ms(300);
led_off();
_delay_ms(300);
}
}
eeprom_write_word((uint16_t*)address,low); // Write low value
address += 2;
eeprom_write_word((uint16_t*)address, high); // Write high value
for(i=0; i<3; i++){
led_off(); // Next giar number flash until
_delay_ms(200); // clutch change position
led_char(n); //
_delay_ms(200);
}
led_off();
}
开发者ID:tedimzc1,项目名称:Gear-position-indicator,代码行数:60,代码来源:learn.c
示例9: lcd_material_store_material
void lcd_material_store_material(uint8_t nr)
{
eeprom_write_word(EEPROM_MATERIAL_TEMPERATURE_OFFSET(nr), material[active_extruder].temperature);
eeprom_write_word(EEPROM_MATERIAL_BED_TEMPERATURE_OFFSET(nr), material[active_extruder].bed_temperature);
eeprom_write_word(EEPROM_MATERIAL_FLOW_OFFSET(nr), material[active_extruder].flow);
eeprom_write_byte(EEPROM_MATERIAL_FAN_SPEED_OFFSET(nr), material[active_extruder].fan_speed);
eeprom_write_float(EEPROM_MATERIAL_DIAMETER_OFFSET(nr), material[active_extruder].diameter);
//eeprom_write_block(card.longFilename, EEPROM_MATERIAL_NAME_OFFSET(nr), 8);
}
开发者ID:DiamondMind3DPrinters,项目名称:DMv2-Marlin,代码行数:10,代码来源:UltiLCD2_menu_material.cpp
示例10: lcd_material_store_current_material
void lcd_material_store_current_material()
{
for(uint8_t e=0; e<EXTRUDERS; e++)
{
eeprom_write_word(EEPROM_MATERIAL_TEMPERATURE_OFFSET(EEPROM_MATERIAL_SETTINGS_MAX_COUNT+e), material[e].temperature);
eeprom_write_word(EEPROM_MATERIAL_BED_TEMPERATURE_OFFSET(EEPROM_MATERIAL_SETTINGS_MAX_COUNT+e), material[e].bed_temperature);
eeprom_write_byte(EEPROM_MATERIAL_FAN_SPEED_OFFSET(EEPROM_MATERIAL_SETTINGS_MAX_COUNT+e), material[e].fan_speed);
eeprom_write_word(EEPROM_MATERIAL_FLOW_OFFSET(EEPROM_MATERIAL_SETTINGS_MAX_COUNT+e), material[e].flow);
eeprom_write_float(EEPROM_MATERIAL_DIAMETER_OFFSET(EEPROM_MATERIAL_SETTINGS_MAX_COUNT+e), material[e].diameter);
}
}
开发者ID:DiamondMind3DPrinters,项目名称:DMv2-Marlin,代码行数:11,代码来源:UltiLCD2_menu_material.cpp
示例11: data2eeprom
void data2eeprom(void)
{
eeprom_write_byte((uint8_t *)40,19); // magic number
eeprom_write_block((uint8_t *)gwip,(void *)41,sizeof(gwip));
eeprom_write_block((uint8_t *)udpsrvip,(void *)45,sizeof(udpsrvip));
eeprom_write_word((void *)49,udpsrvport);
eeprom_write_byte((uint8_t *)51,alarmOn);
eeprom_write_word((void *)52,heartbeat_timeout_sec);
eeprom_write_byte((uint8_t *)54,dhcpOn);
eeprom_write_block((uint8_t *)myip,(void *)55,sizeof(myip));
eeprom_write_block((uint8_t *)myname,(void *)59,sizeof(myname));
}
开发者ID:denis-m-tyurin,项目名称:ethernet-alarm,代码行数:12,代码来源:EthernetAlarm.c
示例12: heater_save_settings
/// \brief Write PID factors to eeprom
void heater_save_settings() {
#ifndef BANG_BANG
heater_t i;
for (i = 0; i < NUM_HEATERS; i++) {
eeprom_write_dword((uint32_t *) &EE_factors[i].EE_p_factor, heaters_pid[i].p_factor);
eeprom_write_dword((uint32_t *) &EE_factors[i].EE_i_factor, heaters_pid[i].i_factor);
eeprom_write_dword((uint32_t *) &EE_factors[i].EE_d_factor, heaters_pid[i].d_factor);
eeprom_write_word((uint16_t *) &EE_factors[i].EE_i_limit, heaters_pid[i].i_limit);
eeprom_write_word((uint16_t *) &EE_factors[i].crc, crc_block(&heaters_pid[i].p_factor, 14));
}
#endif /* BANG_BANG */
}
开发者ID:nickoe,项目名称:Teacup_Firmware,代码行数:13,代码来源:heater.c
示例13: counter_write
/**
* @brief Write given programming counter value to EEPROM
* @param counter Programming counter value
*/
void counter_write(uint16_t counter) {
uint8_t i;
uint16_t * eeadr = 0;
for (i = 0; i < COUNTER_REDUNCY; i++) {
eeprom_write_word(eeadr++, counter);
eeprom_write_word(eeadr++, ~counter);
}
}
开发者ID:EmbedME,项目名称:ISPnub,代码行数:16,代码来源:counter.c
示例14: save_temp_eeprom
void save_temp_eeprom(int word)
{
unsigned int ff_pointer = eeprom_pointer + mem_length; //öka ett steg, pekare till nästa slot
if (ff_pointer >= eeprom_stop)
{
ff_pointer = eeprom_start; //slå runt minnet
}
eeprom_write_word(ff_pointer, mem_pointer_sign); //skriv alltid en mem_pointer_sign först för att garantera minnesplats
eeprom_write_word(eeprom_pointer, word); //skriv till eeprom
eeprom_pointer = ff_pointer; //avancera ett steg
}
开发者ID:skrutt,项目名称:temperaturlcd,代码行数:12,代码来源:eeprom.c
示例15: update_eeprom
void update_eeprom() {
if (dirty) {
if (mode == mode_alarm) {
eeprom_write_word(&eeprom_alarm_time, alarm_time);
} else if (mode == mode_nap) {
eeprom_write_word(&eeprom_nap_duration, nap_duration);
} else if (mode == mode_adjustment) {
eeprom_write_byte(&eeprom_adjustment, adjustment);
}
dirty = false;
}
}
开发者ID:Nazrax,项目名称:Blinky-Clock,代码行数:12,代码来源:main.c
示例16: write_scale_preset
void write_scale_preset(uint8_t preset_num, uint16_t scale_value){
unsigned int addr = 0;
preset_info.scale_preset.record_flag |= (1<<preset_num);
eeprom_busy_wait();
eeprom_write_word((uint16_t*)addr, preset_info.scale_preset.record_flag);
addr+=2;
preset_info.scale_preset.scales[preset_num] = scale_value;
eeprom_busy_wait();
addr+=(preset_num*2);
eeprom_write_word((uint16_t*)addr, preset_info.scale_preset.scales[preset_num]);
update_scale_table(preset_info.scale_preset.scales);
}
开发者ID:centrevillage,项目名称:C_Quencer,代码行数:14,代码来源:eeprom.c
示例17: EE_check_init
// check some EEprom values for correct values
void EE_check_init(void) {
#if (!defined(SamplingADC) || (PROCESSOR_TYP != 328)) && !defined(USE_EEPROM)
uint8_t tt; // read test value
tt = (uint8_t)eeprom_read_byte(&EE_ESR_ZEROtab[0]);
// this value will never be changed by calibration
if (tt != ESR_ZERO) goto init_ee;
#ifdef AUTO_CAL
uint8_t tt0; // value of first c_zero_tab
uint8_t ww; // loop counter
tt0 = tt; // init tt0 value
for (ww=0;ww<7;ww++) { //checking loop
tt = (uint8_t)eeprom_read_byte(&c_zero_tab[ww]);
if (ww == 0) tt0 = tt; // save first value
// for forth element, tt must be tt0 or tt0+1
if ((ww == 3) && ((tt != tt0) && (tt != (tt0+1)) && (tt != (tt0+2)) )) goto init_ee;
if ((tt > 190) || (tt < 10)) goto init_ee; // value too low or too big
}
#endif
return;
init_ee:
// init all EEprom values
lcd_line1();
lcd_data('E');
lcd_data('E');
#ifdef AUTO_CAL
// write the correction value for ADC internal 1.1V reference
(void) eeprom_write_byte((uint8_t *)(&RefDiff), (uint8_t)REF_R_KORR); // offset for true reference Voltage
// write the correction value for comparator 1.1V reference
(void) eeprom_write_word((uint16_t *)(&ref_offset), REF_C_KORR); // hold zero offset + slew rate dependend offset
// write all 7 c_zero_tab values
(void) eeprom_write_word((uint16_t *)(&c_zero_tab[0]),((C_NULL)*256) + (C_NULL));
(void) eeprom_write_byte((uint8_t *)(&c_zero_tab[2]),(C_NULL+TP2_CAP_OFFSET));
(void) eeprom_write_byte((uint8_t *)(&c_zero_tab[3]),(C_NULL+2));
(void) eeprom_write_byte((uint8_t *)(&c_zero_tab[4]),(C_NULL+TP2_CAP_OFFSET));
(void) eeprom_write_word((uint16_t *)(&c_zero_tab[5]),((C_NULL)*256) + (C_NULL));
#endif
// write 4 EE_ESR_ZEROtab values
(void) eeprom_write_word((uint16_t *)(&EE_ESR_ZEROtab[0]),(ESR_ZERO*256)+ESR_ZERO);
(void) eeprom_write_word((uint16_t *)(&EE_ESR_ZEROtab[2]),(ESR_ZERO*256)+ESR_ZERO);
#if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306))
(void) eeprom_write_byte((uint8_t *)(&EE_Volume_Value), VOLUME_VALUE);
#endif
#ifdef WITH_ROTARY_SWITCH
// (void) eeprom_write_byte(&EE_RotarySwitch,0); // no switch is detected
#endif
wait_about1s(); // time to read the "EE" message, initialization of EEprom finished
#endif
}
开发者ID:DarkDSch,项目名称:transistortester,代码行数:50,代码来源:EE_check_init.c
示例18: lcd_material_store_material
void lcd_material_store_material(uint8_t nr)
{
eeprom_write_word(EEPROM_MATERIAL_TEMPERATURE_OFFSET(nr), material[active_extruder].temperature);
#if TEMP_SENSOR_BED != 0
eeprom_write_word(EEPROM_MATERIAL_BED_TEMPERATURE_OFFSET(nr), material[active_extruder].bed_temperature);
#endif
eeprom_write_word(EEPROM_MATERIAL_FLOW_OFFSET(nr), material[active_extruder].flow);
eeprom_write_byte(EEPROM_MATERIAL_FAN_SPEED_OFFSET(nr), material[active_extruder].fan_speed);
eeprom_write_float(EEPROM_MATERIAL_DIAMETER_OFFSET(nr), material[active_extruder].diameter);
//eeprom_write_block(card.longFilename, EEPROM_MATERIAL_NAME_OFFSET(nr), 8);
eeprom_write_word(EEPROM_MATERIAL_CHANGE_TEMPERATURE(nr), material[active_extruder].change_temperature);
eeprom_write_byte(EEPROM_MATERIAL_CHANGE_WAIT_TIME(nr), material[active_extruder].change_preheat_wait_time);
}
开发者ID:Ronan87,项目名称:Ultimaker2Marlin,代码行数:15,代码来源:UltiLCD2_menu_material.cpp
示例19: config_update
uint8_t config_update(void)
{
uint8_t error = 0;
uint8_t checksum;
bool recalc_checksum = false;
if (task != eeprom_read_word(&ee_task)) {
recalc_checksum = true;
eeprom_write_word(&ee_task, task);
if (task != eeprom_read_word(&ee_task)) {
error |= _BV(CONFIG_BAD_TASK_BIT);
}
}
if (zone != eeprom_read_word(&ee_zone)) {
recalc_checksum = true;
eeprom_write_word(&ee_zone, zone);
if (zone != eeprom_read_word(&ee_zone)) {
error |= _BV(CONFIG_BAD_ZONE_BIT);
}
}
if (brightness != eeprom_read_byte(&ee_brightness)) {
recalc_checksum = true;
eeprom_write_byte(&ee_brightness, brightness);
if (brightness != eeprom_read_byte(&ee_brightness)) {
error |= _BV(CONFIG_BAD_BRIGHTNESS_BIT);
}
}
if (action != eeprom_read_byte(&ee_action)) {
recalc_checksum = true;
eeprom_write_byte(&ee_action, action);
if (action != eeprom_read_byte(&ee_action)) {
error |= _BV(CONFIG_BAD_ACTION_BIT);
}
}
if (recalc_checksum) {
checksum = config_calc_checksum();
eeprom_write_byte(&ee_checksum, checksum);
if (checksum != eeprom_read_byte(&ee_checksum)) {
error |= _BV(CONFIG_BAD_CHECKSUM_BIT);
}
}
return error;
}
开发者ID:protaskin,项目名称:AVRThermostat,代码行数:48,代码来源:config.c
示例20: sendStats
void sendStats( boolean isStart ) {
uint8_t tt = GetTemp();
uint16_t starts = eeprom_read_word(&eeprom_starts);
uint8_t rid_low = eeprom_read_byte((unsigned char *)(EEPROM_ROBOT_ID_LOW*2));
uint8_t rid_high = eeprom_read_byte((unsigned char *)(EEPROM_ROBOT_ID_HIGH*2));
// RRS,VERSION,TEMP,STARTS,ROBOT_ID
// RRS,4,60,3222,40,0,3 = version 4, TEMP = 60 somethings (not celsius or fahrenheits), starts 3222, robot_id_low = 40, robot_id_high = 0, pcb_type = 3
Serial.print("RRS,");
Serial.print(B2_VERSION, DEC );
Serial.print(",");
Serial.print(tt, DEC);
Serial.print(",");
Serial.print(starts, DEC);
Serial.print(",");
Serial.print(rid_low, DEC);
Serial.print(",");
Serial.print(rid_high, DEC);
Serial.print(",");
Serial.print(pcb_type, DEC); // pcb type
Serial.println();
if(isStart){
starts++;
eeprom_write_word(&eeprom_starts, starts);
}
}
开发者ID:ArturFormella,项目名称:barobot,代码行数:25,代码来源:barobot_carret2.cpp
注:本文中的eeprom_write_word函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论