altos: Move ao_storage_erase to shared code. Add len
[fw/altos] / src / kernel / ao_storage.h
index cf37a824db0a1c986603fd0b267d9cce59bcaaf4..1c5867e09eed3e9dc78f79a9a00490d488c3d9a4 100644 (file)
@@ -66,7 +66,13 @@ ao_storage_read(ao_pos_t pos, void *buf, uint16_t len);
 
 /* Erase a block of storage. This always clears ao_storage_block bytes */
 uint8_t
-ao_storage_erase(ao_pos_t pos);
+ao_storage_erase(ao_pos_t pos, uint32_t len);
+
+/* Check storage starting at pos to see if the chunk there
+ * is erased
+ */
+uint8_t
+ao_storage_is_erased(uint32_t pos);
 
 /* Flush any pending writes to stable storage */
 void
@@ -88,6 +94,10 @@ ao_storage_device_read(ao_pos_t pos, void *buf, uint16_t len);
 uint8_t
 ao_storage_device_write(ao_pos_t pos, void *buf, uint16_t len);
 
+/* Erase device from pos through pos + ao_storage_block */
+uint8_t
+ao_storage_device_erase(uint32_t pos);
+
 /* Initialize low-level device bits */
 void
 ao_storage_device_init(void);