Safe API Framework
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
sapi_nvm_backend.h
Go to the documentation of this file.
1
15#ifndef SAFEAPI_OS_NVM_BACKEND_H
16#define SAFEAPI_OS_NVM_BACKEND_H
17
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
30typedef struct sapi_nvm_backend_s
31{
33 sapi_status_t (*open)(sapi_nvm_storage_t *storage,
34 const sapi_nvm_config_t *config,
35 sapi_nvm_handle_t *out_handle);
37 sapi_status_t (*read)(sapi_nvm_handle_t handle, size_t offset,
38 void *out_buffer, size_t buffer_size);
40 sapi_status_t (*write)(sapi_nvm_handle_t handle, size_t offset,
41 const void *buffer, size_t buffer_size);
47
56
57#ifdef __cplusplus
58}
59#endif
60
61#endif /* SAFEAPI_OS_NVM_BACKEND_H */
62 /* NVM_BACKEND */
sapi_status_t sapi_nvm_register_backend(const sapi_nvm_backend_t *backend)
Registers the backend implementation used by every sapi_nvm_* call (ADR-005 section 2....
Definition sapi_nvm.c:25
struct sapi_nvm_impl_s * sapi_nvm_handle_t
Opaque handle to an open NVM region, returned by sapi_nvm_open().
Definition sapi_nvm.h:30
sapi_status_t
Common result/status codes.
Definition sapi_status.h:27
OS Abstraction Layer - Non-Volatile Memory service.
Common status/error codes returned by every Safe API Framework function. Shared across all OS Abstrac...
Backend vtable: an integrator's implementation of the NVM service for a specific storage medium (ADR-...
sapi_status_t(*) write(sapi_nvm_handle_t handle, size_t offset, const void *buffer, size_t buffer_size)
Backend implementation of sapi_nvm_write(). May be NULL.
sapi_status_t(*) close(sapi_nvm_handle_t handle)
Backend implementation of sapi_nvm_close(). May be NULL.
sapi_status_t(*) sync(sapi_nvm_handle_t handle)
Backend implementation of sapi_nvm_sync(). May be NULL.
sapi_status_t(*) read(sapi_nvm_handle_t handle, size_t offset, void *out_buffer, size_t buffer_size)
Backend implementation of sapi_nvm_read(). May be NULL.
sapi_status_t(*) open(sapi_nvm_storage_t *storage, const sapi_nvm_config_t *config, sapi_nvm_handle_t *out_handle)
Backend implementation of sapi_nvm_open(). May be NULL.
Configuration for sapi_nvm_open().
Definition sapi_nvm.h:34