Lines Matching refs:address

102 	const off_t address; /* eeprom address */  member
170 uint32_t address = 0U; in eeprom_emu_get_address() local
173 for (int i = 0; i < sizeof(address); i++) { in eeprom_emu_get_address()
178 address += ((uint32_t)(*blk) << (8 * i)); in eeprom_emu_get_address()
182 return address; in eeprom_emu_get_address()
189 const uint32_t address, const uint8_t *data, in eeprom_emu_set_change() argument
199 if (i < sizeof(address)) { in eeprom_emu_set_change()
200 (*blk++) = (uint8_t)(((address >> (8 * i)) & 0xff)); in eeprom_emu_set_change()
230 static int eeprom_emu_word_read(const struct device *dev, off_t address, in eeprom_emu_word_read() argument
239 direct_address = dev_data->page_offset + address; in eeprom_emu_word_read()
263 if ((!mc1) && (ch_address == address)) { in eeprom_emu_word_read()
268 if ((!mc2) && (ch_address == (address + sizeof(buf)/2))) { in eeprom_emu_word_read()
283 off_t address = ctx->address + ctx->len - ctx->rlen; in eeprom_emu_flash_get() local
286 const off_t addr_jmp = address & (sizeof(buf) - 1); in eeprom_emu_flash_get()
292 rc = eeprom_emu_word_read(dev, address - addr_jmp, buf); in eeprom_emu_flash_get()
367 (rd_offset > (ctx->address - sizeof(buf)))) { in eeprom_emu_compactor()
370 off_t address, addr_jmp; in eeprom_emu_compactor() local
373 address = ctx->address + ctx->len - ctx->rlen; in eeprom_emu_compactor()
374 addr_jmp = address & (sizeof(buf) - 1); in eeprom_emu_compactor()
415 static int eeprom_emu_word_write(const struct device *dev, off_t address, in eeprom_emu_word_write() argument
425 direct_address = dev_data->page_offset + address; in eeprom_emu_word_write()
441 rc = eeprom_emu_word_read(dev, address, buf); in eeprom_emu_word_write()
451 wraddr = address; in eeprom_emu_word_write()
485 off_t address = ctx->address + ctx->len - ctx->rlen; in eeprom_emu_flash_set() local
488 const off_t addr_jmp = address & (sizeof(buf) - 1); in eeprom_emu_flash_set()
494 rc = eeprom_emu_word_read(dev, address - addr_jmp, buf); in eeprom_emu_flash_set()
500 rc = eeprom_emu_word_write(dev, address - addr_jmp, buf, ctx); in eeprom_emu_flash_set()
512 static int eeprom_emu_range_is_valid(const struct device *dev, off_t address, in eeprom_emu_range_is_valid() argument
517 if ((address + len) <= dev_config->size) { in eeprom_emu_range_is_valid()
524 static int eeprom_emu_read(const struct device *dev, off_t address, void *data, in eeprom_emu_read() argument
532 .address = address, in eeprom_emu_read()
543 if ((!data) || (!eeprom_emu_range_is_valid(dev, address, len))) { in eeprom_emu_read()
553 LOG_DBG("EEPROM read at [0x%tx] length[%zu]", (ptrdiff_t)address, len); in eeprom_emu_read()
558 memcpy(data, dev_config->rambuf + address, len); in eeprom_emu_read()
575 static int eeprom_emu_write(const struct device *dev, off_t address, in eeprom_emu_write() argument
583 .address = address, in eeprom_emu_write()
594 if ((!data) || (!eeprom_emu_range_is_valid(dev, address, len))) { in eeprom_emu_write()
609 LOG_DBG("EEPROM write at [0x%tx] length[%zu]", (ptrdiff_t)address, len); in eeprom_emu_write()
615 memcpy(dev_config->rambuf + address, data, len); in eeprom_emu_write()