ruuvi.drivers.c  ${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
ruuvi_interface_flash.h
Go to the documentation of this file.
1 #ifndef RUUVI_INTERFACE_FLASH_H
2 #define RUUVI_INTERFACE_FLASH_H
3 
26 #include "ruuvi_driver_error.h"
27 #include <stddef.h>
28 
30 #if RI_FLASH_ENABLED
31 # define RUUVI_NRF5_SDK15_FLASH_ENABLED RUUVI_NRF5_SDK15_ENABLED
32 #endif
33 
34 #ifdef APP_FLASH_PAGES
35 # define RI_FLASH_PAGES APP_FLASH_PAGES
36 #else
37 # define RI_FLASH_PAGES (10U)
38 #endif
39 
50 
62 
73 
89 rd_status_t ri_flash_record_delete (const uint32_t file_id,
90  const uint32_t record_id);
91 
110 rd_status_t ri_flash_record_set (const uint32_t page_id,
111  const uint32_t record_id, const size_t data_size, const void * const data);
112 
128 rd_status_t ri_flash_record_get (const uint32_t page_id, const uint32_t record_id,
129  const size_t data_size, void * const data);
130 
139 
150 
158 
168 void ri_flash_purge (void);
169 
177 
185 rd_status_t ri_flash_protect (const size_t page);
186 
189 #endif
uint32_t rd_status_t
bitfield for representing errors
rd_status_t ri_flash_gc_run(void)
Run garbage collection.
bool ri_flash_is_busy()
Check if flash is busy.
rd_status_t ri_flash_uninit(void)
Unintialize flash. After uninitialization only initialization can be used.
rd_status_t ri_flash_page_size_get(size_t *size)
Get size of usable page, excluding any overhead bytes If returned value is N, a record of N bytes mus...
rd_status_t ri_flash_total_size_get(size_t *size)
Get total size of usable flash, excluding any overhead bytes.
void ri_flash_purge(void)
Purge flash.
rd_status_t ri_flash_record_set(const uint32_t page_id, const uint32_t record_id, const size_t data_size, const void *const data)
Set data to record in page.
rd_status_t ri_flash_init(void)
rd_status_t ri_flash_record_delete(const uint32_t file_id, const uint32_t record_id)
Mark a record for deletion.
rd_status_t ri_flash_free_size_get(size_t *size)
Get total size of free flash.
rd_status_t ri_flash_protect(const size_t page)
rd_status_t ri_flash_record_get(const uint32_t page_id, const uint32_t record_id, const size_t data_size, void *const data)
Get data from record in page.
Header to enable and disable module compilation.
Ruuvi error codes and error check function.