Lines Matching refs:offs

79 static bool flash_cc13xx_cc26xx_range_protected(off_t offs, size_t size)  in flash_cc13xx_cc26xx_range_protected()  argument
83 sector = (offs / FLASH_ERASE_SIZE) * FLASH_ERASE_SIZE; in flash_cc13xx_cc26xx_range_protected()
84 end = offs + size; in flash_cc13xx_cc26xx_range_protected()
105 static int flash_cc13xx_cc26xx_erase(const struct device *dev, off_t offs, in flash_cc13xx_cc26xx_erase() argument
119 if (((offs % FLASH_ERASE_SIZE) != 0) || in flash_cc13xx_cc26xx_erase()
124 if (flash_cc13xx_cc26xx_range_protected(offs, size)) { in flash_cc13xx_cc26xx_erase()
144 for (i = 0; i < cnt; i++, offs += FLASH_ERASE_SIZE) { in flash_cc13xx_cc26xx_erase()
149 rc = FlashSectorErase(offs); in flash_cc13xx_cc26xx_erase()
165 static int flash_cc13xx_cc26xx_buffered_write(off_t offs, const void *data, size_t size) in flash_cc13xx_cc26xx_buffered_write() argument
174 rc = FlashProgram(write_buffer, offs, len); in flash_cc13xx_cc26xx_buffered_write()
179 offs += len; in flash_cc13xx_cc26xx_buffered_write()
185 static int flash_cc13xx_cc26xx_write(const struct device *dev, off_t offs, in flash_cc13xx_cc26xx_write() argument
197 if ((offs < 0) || (size < 1)) { in flash_cc13xx_cc26xx_write()
201 if ((offs + size) > FLASH_SIZE) { in flash_cc13xx_cc26xx_write()
205 if (flash_cc13xx_cc26xx_range_protected(offs, size)) { in flash_cc13xx_cc26xx_write()
229 rc = flash_cc13xx_cc26xx_buffered_write(offs, data, size); in flash_cc13xx_cc26xx_write()
231 rc = FlashProgram((uint8_t *)data, offs, size); in flash_cc13xx_cc26xx_write()
246 static int flash_cc13xx_cc26xx_read(const struct device *dev, off_t offs, in flash_cc13xx_cc26xx_read() argument
255 if ((offs < 0) || (size < 1)) { in flash_cc13xx_cc26xx_read()
259 if ((offs + size) > FLASH_SIZE) { in flash_cc13xx_cc26xx_read()
263 memcpy(data, (void *)offs, size); in flash_cc13xx_cc26xx_read()