本文整理汇总了C++中eeprom_write_byte函数的典型用法代码示例。如果您正苦于以下问题:C++ eeprom_write_byte函数的具体用法?C++ eeprom_write_byte怎么用?C++ eeprom_write_byte使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了eeprom_write_byte函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: DACOffsetCalib
/********************************************//**
* @brief Funkcja kalibrujaca offset DAC
* @param speed : wartosc zmiany (-128 - 127)
* @return uint8_t : aktualna wartosc (0 - 255)
***********************************************/
uint8_t DACOffsetCalib(int8_t val)
{
uint8_t offset = eeprom_read_byte(&e_offset);
if((uint16_t)offset + val < 256 && offset + val >= 0)
offset+= val;
eeprom_write_byte(&e_offset, offset);
DACB.OFFSETCAL=offset;
return offset;
}
开发者ID:wmeler,项目名称:avt2999,代码行数:14,代码来源:DAC.c
示例2: DACGainCalib
/********************************************//**
* @brief Funkcja kalibrujaca wzmocnienie DAC
* @param speed : wartosc zmiany (-128 - 127)
* @return uint8_t : aktualna wartosc (0 - 255)
***********************************************/
uint8_t DACGainCalib(int8_t val)
{
uint8_t gain = eeprom_read_byte(&e_gain);
if((uint16_t)gain + val < 256 && gain + val >= 0)
gain+= val;
eeprom_write_byte(&e_gain, gain);
DACB.GAINCAL=gain;
return gain;
}
开发者ID:wmeler,项目名称:avt2999,代码行数:14,代码来源:DAC.c
示例3: _EEPROM_writeData
void _EEPROM_writeData(int &pos, uint8_t* value, uint8_t size)
{
do
{
eeprom_write_byte((unsigned char*)pos, *value);
pos++;
value++;
}while(--size);
}
开发者ID:AcBCDN,项目名称:marlin-ks-rg,代码行数:9,代码来源:ConfigurationStore.cpp
示例4: while
int
EEPROM::Device::write(void* dest, const void* src, size_t size)
{
uint8_t* dp = (uint8_t*) dest;
const uint8_t* sp = (const uint8_t*) src;
size_t res = size;
while (size--) eeprom_write_byte(dp++, *sp++);
return (res);
}
开发者ID:epatel,项目名称:Cosa,代码行数:9,代码来源:EEPROM.cpp
示例5: eeprom_del_rule
uint8_t eeprom_del_rule (uint8_t pos)
{
/* del_rule
*
*/
uint8_t count,i;
uint16_t target_adress;
RULES_STRUCTUR hilf;
RULE_DEBUG("Del Rule:%i\r\n",pos);
//aktuelle Anzahl auslesen
count = get_rule_count();
if(pos>=0 && pos<=count)
{
//folgende Regeln nachr�ckenen lassen
for(i=pos;i<count;i++)
{
if(eeprom_get_rule(i+1,&hilf))
{
// Zieladresse berechnen
target_adress=RULES_EEPROM_STORE+1+(i*sizeof(RULES_STRUCTUR));
RULE_DEBUG("EEPROM write adress:%i\r\n",target_adress);
// Regel in den EEPROM schreiben
eeprom_busy_wait ();
eeprom_write_block((unsigned char *)&hilf,(unsigned char *)target_adress,sizeof(RULES_STRUCTUR));
}
else
{
return 0;
}
}
//bisher alles OK -> neuen Wert ins EEPROM schreiben
eeprom_busy_wait ();
eeprom_write_byte((unsigned char *)(RULES_EEPROM_STORE),--count);
return 1;
}
else
{
RULE_DEBUG("Failure: Out of Range\r\n");
return 0;
}
return 0;
}
开发者ID:icke2063,项目名称:AVRNETIO_MAIN,代码行数:57,代码来源:rules.c
示例6: writeColor
void writeColor(uint8_t color, uint8_t* base){
uint8_t i = RING_BUFFER_LEN;
uint8_t* loc = base;
while(i-->1){// Not going to bother to check if we can skip writing.
if(0 != eeprom_read_byte(loc)){
eeprom_write_byte(loc++,0);
if(color != 0)
eeprom_write_byte(loc,color);
return;
}
loc++;
}
// Otherwise, nuke the last byte with 0, and write the new value to the beginning
if(0 != eeprom_read_byte(loc))
eeprom_write_byte(loc,0);
if(color != 0)
eeprom_write_byte(base,color);
}
开发者ID:matthewSorensen,项目名称:attiny-blinkenlight,代码行数:18,代码来源:attiny85.c
示例7: initializeDelays
void initializeDelays()
{
detectorOnDelay = eeprom_read_byte((uint8_t*)(CHANNEL0_ON_DELAY));
if (0xFF == detectorOnDelay || 0x00 == detectorOnDelay)
{
eeprom_write_byte((uint8_t*)(CHANNEL0_ON_DELAY), 4);
detectorOnDelay = eeprom_read_byte((uint8_t*)(CHANNEL0_ON_DELAY));
}
detectorOffDelay = eeprom_read_byte((uint8_t*)(CHANNEL0_OFF_DELAY));
if (0xFF == detectorOffDelay || 0x00 == detectorOffDelay)
{
eeprom_write_byte((uint8_t*)(CHANNEL0_OFF_DELAY), 25);
detectorOffDelay = eeprom_read_byte((uint8_t*)(CHANNEL0_OFF_DELAY));
}
}
开发者ID:IowaScaledEngineering,项目名称:mss-crossover,代码行数:19,代码来源:mss-crossover.c
示例8: try_reset_eeprom
void try_reset_eeprom() {
const char* symbol = "C_Quencer 0.4";
char id_str[13];
for (int i=0; i<13; ++i) {
eeprom_busy_wait();
id_str[i] = eeprom_read_byte((uint8_t*)(i+1000));
}
if (strncmp(id_str, symbol, sizeof(id_str)) != 0) {
for (int i=0; i<1000; ++i) {
eeprom_busy_wait();
eeprom_write_byte((uint8_t*)i, 0);
}
eeprom_write_block(symbol, (uint8_t*)1000, sizeof(symbol));
for (int i=0; i<13; ++i) {
eeprom_busy_wait();
eeprom_write_byte((uint8_t*)(i+1000), symbol[i]);
}
}
}
开发者ID:centrevillage,项目名称:C_Quencer,代码行数:19,代码来源:eeprom.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: main
/**
* @fn void main(void)
* @brief eeprom emulation main function entry
*
*/
void main (void)
{
U16 i;
U8 tmp;
SFRPAGE_SWITCH()
ENABLE_VDDMON()
DISABLE_WDT()
SFRPAGE_RESTORE()
eeprom_init();
for(i = 0;i< EE_SIZE ;i++) {
if(eeprom_read_byte(i,&test_buf[i]) == ERROR)
goto error;
}
for(i = 0;i < 2;i++) {
test_buf[i] = i + 0x55;
if(eeprom_write_byte(i, test_buf[i]) == ERROR)
goto error;
}
tmp = 0;
while(tmp < 50){
for(i = 2;i< EE_SIZE; i++) {
test_buf[i] = i + 1;
if(eeprom_write_byte(i, test_buf[i] + tmp) == ERROR)
goto error;
}
tmp++;
}
for(i = 0; i< EE_SIZE; i++) {
if(eeprom_read_byte(i,&test_buf[i]) == ERROR)
goto error;
if((i == 0) || (i == 1)){
if ((test_buf[0] != 0x55) || (test_buf[1] != 0x56))
goto error;
}else{
if (test_buf[i] != (i + tmp))
goto error;
}
}
while(1);
error:
i = 0xDEAD;
while(1);
}
开发者ID:MarkDing,项目名称:eeprom-emulation,代码行数:48,代码来源:main.c
示例11: getAddress
void Preset::save(uint8_t index){
uint8_t buf[MIDI_ZONE_PRESET_SIZE];
uint8_t* offset = getAddress(index);
eeprom_write_byte(offset++, size);
for(uint8_t i=0; i<size; ++i){
uint8_t bts = writeZone(buf, i);
eeprom_write_block(buf, offset, bts);
offset += bts;
}
}
开发者ID:analogspecies,项目名称:BlipBox,代码行数:10,代码来源:Preset.cpp
示例12: pgm_set_program_state
void pgm_set_program_state( u8 slot, u8 state )
{
u8 newstate = state ? ( pgm_mask | ( 1 << slot ) ) : ( pgm_mask & ( u8 )~( 1 << slot ) );
if( newstate == pgm_mask )
return;
pgm_mask = newstate;
eeprom_write_byte( PGMADDR, pgm_mask );
eeprom_busy_wait();
}
开发者ID:Theemuts,项目名称:eLuaBrain,代码行数:10,代码来源:main.c
示例13: write_to_eeprom
int write_to_eeprom(struct eeprom *e, FILE *fp, int addr, char* pBuffer, int size)
{
int ret = -1;
int i;
if ( e != (struct eeprom *) NULL && pBuffer != NULL )
{
if( strlen(pBuffer) >= size )
{
for( i = 0, ret = 0; ret == 0 && i < size; i++ )
{
if( (ret=eeprom_write_byte(e, addr++, pBuffer[i])) )
{
fprintf(stderr, "write error at addr %0x\n", addr);
}
}
}
else
{
for( i = 0, ret = 0; ret == 0 && i < size; i++ )
{
if( (ret=eeprom_write_byte(e, addr++, pBuffer[0])) )
{
fprintf(stderr, "write error at addr %0x\n", addr);
}
}
}
}
#ifdef _OLD_STYLE_MODE
int c;
while((c = fgetc(fp)) != EOF)
{
fflush(stdout);
if(eeprom_write_byte(e, addr++, c))
{
fprintf(stderr, "write error at addr %0x\n", addr);
}
}
#endif // _OLD_STYLE_MODE
return( ret );
}
开发者ID:dreamshader,项目名称:Raspberry_PI,代码行数:43,代码来源:eeprom.c
示例14: lcd_material_verify_material_settings
bool lcd_material_verify_material_settings()
{
bool hasUPET = false;
uint8_t cnt = eeprom_read_byte(EEPROM_MATERIAL_COUNT_OFFSET());
if (cnt < 2 || cnt > EEPROM_MATERIAL_SETTINGS_MAX_COUNT)
return false;
while(cnt > 0)
{
cnt --;
if (eeprom_read_word(EEPROM_MATERIAL_TEMPERATURE_OFFSET(cnt)) > HEATER_0_MAXTEMP)
return false;
// if (eeprom_read_word(EEPROM_MATERIAL_BED_TEMPERATURE_OFFSET(cnt)) > BED_MAXTEMP)
// return false;
if (eeprom_read_byte(EEPROM_MATERIAL_FAN_SPEED_OFFSET(cnt)) > 100)
return false;
if (eeprom_read_word(EEPROM_MATERIAL_FLOW_OFFSET(cnt)) > 1000)
return false;
if (eeprom_read_float(EEPROM_MATERIAL_DIAMETER_OFFSET(cnt)) > 10.0)
return false;
if (eeprom_read_float(EEPROM_MATERIAL_DIAMETER_OFFSET(cnt)) < 0.1)
return false;
eeprom_read_block(card.longFilename, EEPROM_MATERIAL_NAME_OFFSET(cnt), 8);
if (strcmp_P(card.longFilename, PSTR("UPET")) == 0)
hasUPET = true;
}
cnt = eeprom_read_byte(EEPROM_MATERIAL_COUNT_OFFSET());
if (!hasUPET && cnt < EEPROM_MATERIAL_SETTINGS_MAX_COUNT)
{
strcpy_P(card.longFilename, PSTR("UPET"));
eeprom_write_block(card.longFilename, EEPROM_MATERIAL_NAME_OFFSET(cnt), 5);
eeprom_write_word(EEPROM_MATERIAL_TEMPERATURE_OFFSET(cnt), 250);
// eeprom_write_word(EEPROM_MATERIAL_BED_TEMPERATURE_OFFSET(cnt), 60);
eeprom_write_byte(EEPROM_MATERIAL_FAN_SPEED_OFFSET(cnt), 50);
eeprom_write_word(EEPROM_MATERIAL_FLOW_OFFSET(cnt), 100);
eeprom_write_float(EEPROM_MATERIAL_DIAMETER_OFFSET(cnt), 2.85);
eeprom_write_byte(EEPROM_MATERIAL_COUNT_OFFSET(), cnt + 1);
}
return true;
}
开发者ID:fablabbcn,项目名称:Ultimaker2Marlin,代码行数:42,代码来源:UltiLCD2_menu_material.cpp
示例15: ENABLED
void PrintCounter::initStats() {
#if ENABLED(DEBUG_PRINTCOUNTER)
PrintCounter::debug(PSTR("initStats"));
#endif
this->loaded = true;
this->data = { 0, 0, 0, 0, 0.0 };
this->saveStats();
eeprom_write_byte((uint8_t *) this->address, 0x16);
}
开发者ID:ClumsyApe,项目名称:Marlin,代码行数:11,代码来源:printcounter.cpp
示例16: GetActiveParamSetNumber
unsigned char GetActiveParamSetNumber(void)
{
unsigned char set;
set = eeprom_read_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET]);
if(set > 5)
{
set = 2;
eeprom_write_byte(&EEPromArray[EEPROM_ADR_ACTIVE_SET], set); // diesen Parametersatz als aktuell merken
}
return(set);
}
开发者ID:0CodeJam0,项目名称:Tinyer-800,代码行数:11,代码来源:main.c
示例17: write_byte
static uint8_t write_byte(uint8_t *p, uint8_t data)
{
if(0x00 <= p && p < 0x100) {
error_state();
return 0;
}
else {
eeprom_write_byte(p, data);
}
return 1;
}
开发者ID:kaisert,项目名称:kilobot,代码行数:11,代码来源:save_data.c
示例18: writeLEDMode
static void writeLEDMode(void) {
// LED 모드 저장, 너무많은 eeprom접근을 막기위해 일정 간격으로 저장한다.
const int countMAX = 1000;
if(ledStateCount > 0 && ++ledStateCount == countMAX){
// DEBUG_PRINT(("writeLEDMode : mode %d, br %d \n", _fullLEDMode, _ledBrightnessMax));
ledStateCount = 0;
if(_fullLEDMode != _fullLEDMode_saved){
_fullLEDMode_saved = _fullLEDMode;
eeprom_write_byte((uint8_t *)EEPROM_LED_MODE, _fullLEDMode); // 1바이트 11번지 쓰기
// DEBUG_PRINT(("eeprom_write_byte : mode %d \n", _fullLEDMode));
}
// brightness
if(_ledBrightnessMax_saved != _ledBrightnessMax){
_ledBrightnessMax_saved = _ledBrightnessMax;
eeprom_write_byte((uint8_t *)EEPROM_LED_BRIGHTNESS, _ledBrightnessMax); // 1바이트 9번지 쓰기
// DEBUG_PRINT(("eeprom_write_byte : _ledBrightnessMax %d \n", _ledBrightnessMax));
}
}
}
开发者ID:huangdonghai,项目名称:ps2avrU,代码行数:20,代码来源:ledrender.c
示例19: test_rollover_to_zero
static void test_rollover_to_zero() {
test("test_rollover_to_zero");
uint32_t *memory = (uint32_t *)112;
eeprom_write_dword(memory, 0xFFFFFFFF);
eeprom_write_byte((uint8_t *)memory + 4, 0xa5);
uint32_t result = increment_eeprom_uint32(memory);
assert(result == 0x00000000);
assert(eeprom_read_dword(memory) == 0x00000000);
assert(eeprom_read_byte((uint8_t *)memory + 4) == 0xa5);
}
开发者ID:getting,项目名称:nfc-smart-tag,代码行数:11,代码来源:eeprom_test.c
示例20: pgm_init
static void pgm_init()
{
// Check internal EEPROM data
if( eeprom_read_byte( PGMADDR ) == 0xFF ) // initial EEPROM is blank
{
eeprom_write_byte( PGMADDR, 0x00 );
eeprom_busy_wait();
}
pgm_mask = eeprom_read_byte( PGMADDR );
pgm_crt = pgm_get_first_index();
}
开发者ID:Theemuts,项目名称:eLuaBrain,代码行数:11,代码来源:main.c
注:本文中的eeprom_write_byte函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论