本文整理汇总了C++中eeprom_read_dword函数的典型用法代码示例。如果您正苦于以下问题:C++ eeprom_read_dword函数的具体用法?C++ eeprom_read_dword怎么用?C++ eeprom_read_dword使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了eeprom_read_dword函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: constrain
Waypoints::WP
Waypoints::get_waypoint_with_index(uint8_t i)
{
Waypoints::WP wp;
i = constrain(i, 0, _total);
uint32_t mem = _start_byte + (i * _wp_size);
eeprom_busy_wait();
wp.id = eeprom_read_byte((uint8_t *)mem);
mem++;
eeprom_busy_wait();
wp.p1 = eeprom_read_byte((uint8_t *)mem);
mem++;
eeprom_busy_wait();
wp.alt = (long)eeprom_read_dword((uint32_t *)mem);
mem += 4;
eeprom_busy_wait();
wp.lat = (long)eeprom_read_dword((uint32_t *)mem);
mem += 4;
eeprom_busy_wait();
wp.lng = (long)eeprom_read_dword((uint32_t *)mem);
}
开发者ID:AhLeeYong,项目名称:x-drone,代码行数:27,代码来源:Waypoints.cpp
示例2: pid_init
/** Inititalise PID data structures.
\param i Index of the heater to initialise by Teacup numbering.
*/
void pid_init() {
uint8_t i;
for (i = 0; i < NUM_HEATERS; i++) {
#ifdef HEATER_SANITY_CHECK
// 0 is a "sane" temperature when we're trying to cool down.
heaters_runtime[i].sane_temperature = 0;
#endif
#ifndef BANG_BANG
#ifdef EECONFIG
// Read factors from EEPROM.
heaters_pid[i].p_factor =
eeprom_read_dword((uint32_t *)&EE_factors[i].EE_p_factor);
heaters_pid[i].i_factor =
eeprom_read_dword((uint32_t *)&EE_factors[i].EE_i_factor);
heaters_pid[i].d_factor =
eeprom_read_dword((uint32_t *)&EE_factors[i].EE_d_factor);
heaters_pid[i].i_limit =
eeprom_read_word((uint16_t *)&EE_factors[i].EE_i_limit);
if (crc_block(&heaters_pid[i].p_factor, 14) !=
eeprom_read_word((uint16_t *)&EE_factors[i].crc))
#endif /* EECONFIG */
{
heaters_pid[i].p_factor = DEFAULT_P;
heaters_pid[i].i_factor = DEFAULT_I;
heaters_pid[i].d_factor = DEFAULT_D;
heaters_pid[i].i_limit = DEFAULT_I_LIMIT;
}
#endif /* BANG_BANG */
}
}
开发者ID:Traumflug,项目名称:Teacup_Firmware,代码行数:37,代码来源:heater.c
示例3: page_linear_sweep_load_parameters
void page_linear_sweep_load_parameters(struct menuitem *self)
{
f1 = eeprom_read_dword(&f1_eeprom);
if(f1 == 0xFFFFFFFF) // cell after erase cycle
f1 = 0;
f2 = eeprom_read_dword(&f2_eeprom);
if(f2 == 0xFFFFFFFF) // cell after erase cycle
f2 = 0;
time = eeprom_read_dword(&time_eeprom);
if(time == 0xFFFFFFFF) // cell after erase cycle
time = 50;
}
开发者ID:elmo2k3,项目名称:dds_one,代码行数:12,代码来源:page_linear_sweep.c
示例4: temp_init
void temp_init() {
p_factor = eeprom_read_dword((uint32_t *) &EE_p_factor);
i_factor = eeprom_read_dword((uint32_t *) &EE_i_factor);
d_factor = eeprom_read_dword((uint32_t *) &EE_d_factor);
i_limit = eeprom_read_word((uint16_t *) &EE_i_limit);
if ((p_factor == 0) && (i_factor == 0) && (d_factor == 0) && (i_limit == 0)) {
p_factor = DEFAULT_P;
i_factor = DEFAULT_I;
d_factor = DEFAULT_D;
i_limit = DEFAULT_I_LIMIT;
}
}
开发者ID:eduveiga,项目名称:ATmega-Skeleton,代码行数:13,代码来源:temp.c
示例5: eeconfig_read_rgblight
uint32_t eeconfig_read_rgblight(void) {
#if defined(__AVR__) || defined(STM32_EEPROM_ENABLE) || defined(PROTOCOL_ARM_ATSAM) || defined(EEPROM_SIZE)
return eeprom_read_dword(EECONFIG_RGBLIGHT);
#else
return 0;
#endif
}
开发者ID:Xyverz,项目名称:qmk_firmware,代码行数:7,代码来源:rgblight.c
示例6: get_seed
uint32_t get_seed(uint32_t* eeprom_begin, uint32_t* eeprom_end)
{
uint32_t* ptr;
uint32_t seed = eeprom_read_dword(eeprom_begin);
for (ptr=eeprom_begin+1; ptr<eeprom_end; ++ptr)
if (++seed != eeprom_read_dword(ptr)) break;
if (ptr >= eeprom_end) ptr = eeprom_begin;
eeprom_write_dword(ptr, seed);
if (seed == 0) seed = 0xaaaaaaaa;
return seed;
}
开发者ID:jiser,项目名称:avrsnippets,代码行数:16,代码来源:seed_eeprom.c
示例7: load_lifetime_stats
static void load_lifetime_stats()
{
unsigned long magic = eeprom_read_dword((uint32_t*)(LIFETIME_EEPROM_OFFSET + 0));
if (magic == LIFETIME_MAGIC)
{
lifetime_minutes = eeprom_read_dword((uint32_t*)(LIFETIME_EEPROM_OFFSET + 4));
lifetime_print_minutes = eeprom_read_dword((uint32_t*)(LIFETIME_EEPROM_OFFSET + 8));
triptime_minutes = eeprom_read_dword((uint32_t*)(LIFETIME_EEPROM_OFFSET + 12));
triptime_print_minutes = eeprom_read_dword((uint32_t*)(LIFETIME_EEPROM_OFFSET + 16));
}else{
lifetime_minutes = 0;
lifetime_print_minutes = 0;
triptime_minutes = 0;
triptime_print_minutes = 0;
}
}
开发者ID:AteamVentures,项目名称:Creatable_D2,代码行数:16,代码来源:lifetime_stats.cpp
示例8: eeprom_read_dword
/**
* Read a single 32 bits integer
*/
uint32_t Eeprom::readLong(int address)
{
if (!isReadOk(address + sizeof(uint32_t)))
return 0;
return eeprom_read_dword((unsigned long *) address);
}
开发者ID:juansta,项目名称:intiController,代码行数:10,代码来源:eeprom.cpp
示例9: zoSmsInitSettingsFromEeprom
void zoSmsInitSettingsFromEeprom(void)
{
Sms.Settings.NodeID = eeprom_read_byte((u08*)ZO_EEPROM_ADDRESS_NODE_ID);
Sms.Pid.GainP = eeprom_read_word((u16*)ZO_EEPROM_ADDRESS_GAIN_P);
Sms.Pid.GainI = eeprom_read_word((u16*)ZO_EEPROM_ADDRESS_GAIN_I);
Sms.Pid.GainD = eeprom_read_word((u16*)ZO_EEPROM_ADDRESS_GAIN_D);
Sms.Settings.CurrentLimit = eeprom_read_word((u16*)ZO_EEPROM_ADDRESS_CURRENT_LIMIT);
Sms.Settings.CurrentLimitDuration = eeprom_read_word((u16*)ZO_EEPROM_ADDRESS_CURRENT_LIMIT_DURATION);
Sms.Settings.DigitalIoConfig = eeprom_read_byte((u08*)ZO_EEPROM_ADDRESS_DIGITAL_IO_CONFIG);
Sms.Settings.BaudUart = eeprom_read_dword((u32*)ZO_EEPROM_ADDRESS_BAUD_UART);
Sms.Settings.BaudI2C = eeprom_read_dword((u32*)ZO_EEPROM_ADDRESS_BAUD_I2C);
Sms.Profile.DesiredAcceleration = eeprom_read_word((u16*)ZO_EEPROM_ADDRESS_PROFILE_ACCELERATION);
Sms.Profile.DesiredVelocity = eeprom_read_word((u16*)ZO_EEPROM_ADDRESS_PROFILE_VELOCITY);
Sms.Settings.localAcceptanceMask = eeprom_read_byte((u08*)ZO_EEPROM_ADDRESS_LAM);
Sms.Settings.errorReportingLevel = eeprom_read_byte((u08*)ZO_EEPROM_ADDRESS_ERROR_REPORTING_LVL);
}
开发者ID:rkammela,项目名称:SupermodifiedServo,代码行数:16,代码来源:zoSms.c
示例10: eeconfig_read_rgblight
uint32_t eeconfig_read_rgblight(void) {
#ifdef __AVR__
return eeprom_read_dword(EECONFIG_RGBLIGHT);
#else
return 0;
#endif
}
开发者ID:anechiporuk,项目名称:qmk_firmware,代码行数:7,代码来源:rgblight.c
示例11: heater_init
void heater_init() {
heater_t i;
// setup pins
for (i = 0; i < NUM_HEATERS; i++) {
*(heaters[i].heater_port) &= ~MASK(heaters[i].heater_pin);
// DDR is always 1 address below PORT. ugly code but saves ram and an extra field in heaters[] which will never be used anywhere but here
*(heaters[i].heater_port - 1) |= MASK(heaters[i].heater_pin);
if (heaters[i].heater_pwm) {
*heaters[i].heater_pwm = 0;
// this is somewhat ugly too, but switch() won't accept pointers for reasons unknown
switch((uint16_t) heaters[i].heater_pwm) {
case (uint16_t) &OCR0A:
TCCR0A |= MASK(COM0A1);
break;
case (uint16_t) &OCR0B:
TCCR0A |= MASK(COM0B1);
break;
case (uint16_t) &OCR2A:
TCCR2A |= MASK(COM2A1);
break;
case (uint16_t) &OCR2B:
TCCR2A |= MASK(COM2B1);
break;
}
}
#ifdef HEATER_SANITY_CHECK
// 0 is a "sane" temperature when we're trying to cool down
heaters_runtime[i].sane_temperature = 0;
#endif
#ifndef BANG_BANG
// read factors from eeprom
heaters_pid[i].p_factor = eeprom_read_dword((uint32_t *) &EE_factors[i].EE_p_factor);
heaters_pid[i].i_factor = eeprom_read_dword((uint32_t *) &EE_factors[i].EE_i_factor);
heaters_pid[i].d_factor = eeprom_read_dword((uint32_t *) &EE_factors[i].EE_d_factor);
heaters_pid[i].i_limit = eeprom_read_word((uint16_t *) &EE_factors[i].EE_i_limit);
if ((heaters_pid[i].p_factor == 0) && (heaters_pid[i].i_factor == 0) && (heaters_pid[i].d_factor == 0) && (heaters_pid[i].i_limit == 0)) {
heaters_pid[i].p_factor = DEFAULT_P;
heaters_pid[i].i_factor = DEFAULT_I;
heaters_pid[i].d_factor = DEFAULT_D;
heaters_pid[i].i_limit = DEFAULT_I_LIMIT;
}
#endif /* BANG_BANG */
}
}
开发者ID:jgilmore,项目名称:FiveD_on_Arduino,代码行数:47,代码来源:heater.c
示例12: seed_rand
void seed_rand()
{
uint32_t next_seed = eeprom_read_dword( (uint32_t*)SEED_ADDR );
srandom( next_seed );
eeprom_write_dword( (uint32_t*)SEED_ADDR, random() );
}
开发者ID:AaronLK,项目名称:flamingos,代码行数:8,代码来源:flamingo.c
示例13: main
int main()
{
stdout = &mystdout;
// read the eeprom value
uint32_t c = eeprom_read_dword((void*)&value);
printf("Read from eeprom 0x%08lx -- should be 0xdeadbeef\n", c);
// change the eeprom
eeprom_write_dword((void*)&value, 0xcafef00d);
// re-read it
c = eeprom_read_dword((void*)&value);
printf("Read from eeprom 0x%08lx -- should be 0xcafef00d\n", c);
// this quits the simulator, since interupts are off
// this is a "feature" that allows running tests cases and exit
sleep_cpu();
}
开发者ID:FabriceSalvaire,项目名称:simavr,代码行数:17,代码来源:atmega88_example.c
示例14: Vector2l
/*
fence boundaries fetch/store
*/
Vector2l AP_Limit_Geofence::get_fence_point_with_index(uint8_t i)
{
uint32_t mem;
Vector2l ret;
if (i > (unsigned) fence_total()) {
return Vector2l(0,0);
}
// read fence point
mem = _eeprom_fence_start + (i * _fence_wp_size);
ret.x = eeprom_read_dword((uint32_t *)mem);
mem += sizeof(uint32_t);
ret.y = eeprom_read_dword((uint32_t *)mem);
return ret;
}
开发者ID:icer1,项目名称:QuadPID,代码行数:20,代码来源:AP_Limit_Geofence.cpp
示例15: replace_sys_env_value
/**
@brief Replace HTML's variables to system configuration value
*/
static uint16_t replace_sys_env_value(
uint8_t* base, /**< pointer to html buffer */
uint16_t len
)
{
uint8_t sys_string[16]; // if there are more characters to substituted in response file, then make this bigger
uint8_t *tptr, *ptr;
time_t time_stamp;
tm local_time;
tptr = ptr = base;
while((ptr = (uint8_t*)strchr((char*)tptr, '$')))
{
if((tptr = (uint8_t*)strstr((char*)ptr, EVB_PAGES_SERVED)))
{
memset(tptr,0x20,14); // erase system variable trigger string
if( eeprom_is_ready() )
sprintf_P((char *)sys_string, PSTR("%08u"), eeprom_read_dword(&pagesServed) ); // number of pages served by the http server.
memcpy(tptr,sys_string,8); // copy the characters, but don't copy the /0
tptr+=8;
}
#if defined (portRTC_DEFINED)
else if((tptr = (uint8_t*)strstr((char*)ptr, EVB_RTC)))
{
memset(tptr,0x20,11); // erase system variable trigger string
if ( getDateTimeDS1307( (tm*)&local_time ) == pdTRUE)
sprintf_P((char *)sys_string, PSTR("%02u:%02u:%02u"), local_time.tm_hour, local_time.tm_min, local_time.tm_sec);
memcpy(tptr,sys_string,8); // copy the characters, but don't copy the /0
tptr+=8;
}
#else
else if((tptr = (uint8_t*)strstr((char*)ptr, EVB_RTC)))
{
memset(tptr,0x20,11); // erase system variable trigger string
time(&time_stamp);
localtime_r( &time_stamp, &local_time);
sprintf_P((char *)sys_string, PSTR("%02d:%02d:%02d"), local_time.tm_hour, local_time.tm_min, local_time.tm_sec);
memcpy(tptr,sys_string,8); // copy the characters, but don't copy the /0
tptr+=8;
}
#endif
else // tptr == 0 && ptr!=0;
{
if(ptr==base)
{
// xSerialPrint_P(PSTR("$ Character"));
return len;
}
// xSerialPrint_P(PSTR("REPLACE CONTINUE"));
tptr = ptr;
break;
}
}
if(!ptr) return len;
return (uint16_t)(tptr-base);
}
开发者ID:UNIVERSAL-IT-SYSTEMS,项目名称:avrfreertos,代码行数:61,代码来源:webserver.c
示例16: eeprom_read_float
//Arduino IDE compatibility, lacks the eeprom_read_float function
float inline eeprom_read_float(float* addr)
{
union {
uint32_t i;
float f;
} n;
n.i = eeprom_read_dword((uint32_t*)addr);
return n.f;
}
开发者ID:krasin,项目名称:Ultimaker2Marlin,代码行数:10,代码来源:UltiLCD2_menu_material.cpp
示例17: test_simple_increment
static void test_simple_increment() {
test("test_simple_increment");
uint32_t *memory = (uint32_t *)100;
eeprom_write_dword(memory, 1);
uint32_t result = increment_eeprom_uint32(memory);
assert(result == 2);
assert(eeprom_read_dword(memory) == 2);
}
开发者ID:getting,项目名称:nfc-smart-tag,代码行数:9,代码来源:eeprom_test.c
示例18: test_overflow_into_4th_byte
static void test_overflow_into_4th_byte() {
test("test_overflow_into_4th_byte");
uint32_t *memory = (uint32_t *)108;
eeprom_write_dword(memory, 0x00FFFFFF);
uint32_t result = increment_eeprom_uint32(memory);
assert(result == 0x01000000);
assert(eeprom_read_dword(memory) == 0x01000000);
}
开发者ID:getting,项目名称:nfc-smart-tag,代码行数:9,代码来源:eeprom_test.c
示例19: test_byte_overflow
static void test_byte_overflow() {
test("test_byte_overflow");
uint32_t *memory = (uint32_t *)104;
eeprom_write_dword(memory, 0xFF);
uint32_t result = increment_eeprom_uint32(memory);
assert(result == 0x100);
assert(eeprom_read_dword(memory) == 0x100);
}
开发者ID:getting,项目名称:nfc-smart-tag,代码行数:9,代码来源:eeprom_test.c
示例20: eeprom_init
void eeprom_init()
{
int i;
for (i = 0; i < EEPROM_LEN; i++)
{
eeprom_busy_wait();
eeprom_data[i] = eeprom_read_dword(&EEPROM[i]);
if (eeprom_data[i]+1 == 0) __UPDATE_EEPROM(i, 0); // bacause of default EEPROM
}
}
开发者ID:kmzbrnoI,项目名称:posilaci-systemy-fw,代码行数:10,代码来源:eeprom.c
注:本文中的eeprom_read_dword函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论