Firmware
|
DATAMANAGER driver. More...
Go to the source code of this file.
Classes | |
struct | dataman_compat_s |
Macros | |
#define | DM_COMPAT_VERSION 2ULL |
#define | DM_COMPAT_KEY |
Enumerations | |
enum | dm_item_t { DM_KEY_SAFE_POINTS = 0, DM_KEY_FENCE_POINTS, DM_KEY_WAYPOINTS_OFFBOARD_0, DM_KEY_WAYPOINTS_OFFBOARD_1, DM_KEY_WAYPOINTS_ONBOARD, DM_KEY_MISSION_STATE, DM_KEY_COMPAT, DM_KEY_NUM_KEYS } |
Types of items that the data manager can store. | |
enum | { DM_KEY_SAFE_POINTS_MAX = 8, DM_KEY_FENCE_POINTS_MAX = 64, DM_KEY_WAYPOINTS_OFFBOARD_0_MAX = NUM_MISSIONS_SUPPORTED, DM_KEY_WAYPOINTS_OFFBOARD_1_MAX = NUM_MISSIONS_SUPPORTED, DM_KEY_WAYPOINTS_ONBOARD_MAX = NUM_MISSIONS_SUPPORTED, DM_KEY_MISSION_STATE_MAX = 1, DM_KEY_COMPAT_MAX = 1 } |
The maximum number of instances for each item type. | |
enum | dm_persitence_t { DM_PERSIST_POWER_ON_RESET = 0, DM_PERSIST_IN_FLIGHT_RESET, DM_PERSIST_VOLATILE } |
Data persistence levels. | |
enum | dm_reset_reason { DM_INIT_REASON_POWER_ON = 0, DM_INIT_REASON_IN_FLIGHT, DM_INIT_REASON_VOLATILE } |
The reason for the last reset. | |
Functions | |
__EXPORT ssize_t | dm_read (dm_item_t item, unsigned index, void *buffer, size_t buflen) |
Retrieve from the data manager store. More... | |
__EXPORT ssize_t | dm_write (dm_item_t item, unsigned index, dm_persitence_t persistence, const void *buffer, size_t buflen) |
write to the data manager store More... | |
__EXPORT int | dm_lock (dm_item_t item) |
Lock all items of a type. More... | |
__EXPORT int | dm_trylock (dm_item_t item) |
Try to lock all items of a type (. More... | |
__EXPORT void | dm_unlock (dm_item_t item) |
Unlock all items of a type. More... | |
__EXPORT int | dm_clear (dm_item_t item) |
Erase all items of this type. More... | |
__EXPORT int | dm_restart (dm_reset_reason restart_type) |
Tell the data manager about the type of the last reset. | |
DATAMANAGER driver.
#define DM_COMPAT_KEY |
__EXPORT int dm_clear | ( | dm_item_t | item | ) |
Erase all items of this type.
Erase all items of this type.
__EXPORT int dm_lock | ( | dm_item_t | item | ) |
Lock all items of a type.
Can be used for atomic updates of multiple items (single items are always updated atomically). Note that this lock is independent from dm_read & dm_write calls.
__EXPORT ssize_t dm_read | ( | dm_item_t | item, |
unsigned | index, | ||
void * | buf, | ||
size_t | count | ||
) |
Retrieve from the data manager store.
Retrieve from the data manager store.
__EXPORT int dm_trylock | ( | dm_item_t | item | ) |
Try to lock all items of a type (.
__EXPORT void dm_unlock | ( | dm_item_t | item | ) |
Unlock all items of a type.
Unlock all items of a type.
__EXPORT ssize_t dm_write | ( | dm_item_t | item, |
unsigned | index, | ||
dm_persitence_t | persistence, | ||
const void * | buf, | ||
size_t | count | ||
) |
write to the data manager store
write to the data manager store