PX4 Firmware
PX4 Autopilot Software http://px4.io
flashparams.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * Copyright (c) 2015 PX4 Development Team. All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in
13  * the documentation and/or other materials provided with the
14  * distribution.
15  * 3. Neither the name PX4 nor the names of its contributors may be
16  * used to endorse or promote products derived from this software
17  * without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
26  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  *
32  ****************************************************************************/
33 
34 /**
35  * @file param.h
36  *
37  * Global flash based parameter store.
38  *
39  * This provides the mechanisms to interface to the PX4
40  * parameter system but replace the IO with non file based flash
41  * i/o routines. So that the code my be implemented on a SMALL memory
42  * foot print device.
43  *
44  */
45 
46 #ifndef _SYSTEMLIB_FLASHPARAMS_FLASHPARAMS_H
47 #define _SYSTEMLIB_FLASHPARAMS_FLASHPARAMS_H
48 
49 #include <stdint.h>
50 #include <stdbool.h>
51 #include <sys/types.h>
53 
55 
56 /*
57  * When using the flash based parameter store we have to force
58  * the param_values and 2 functions to be global
59  */
60 
62 __EXPORT int param_set_external(param_t param, const void *val, bool mark_saved, bool notify_changes);
64 
65 /* The interface hooks to the Flash based storage. The caller is responsible for locking */
66 __EXPORT int flash_param_save(bool only_unsaved);
69 
71 
72 #endif /* _SYSTEMLIB_FLASHPARAMS_FLASHPARAMS_H */
#define __END_DECLS
Definition: visibility.h:59
__EXPORT int flash_param_save(bool only_unsaved)
__BEGIN_DECLS __EXPORT UT_array * param_values
flexible array holding modified parameter values
Definition: parameters.cpp:144
Definition: I2C.hpp:51
__EXPORT int param_set_external(param_t param, const void *val, bool mark_saved, bool notify_changes)
__EXPORT const void * param_get_value_ptr_external(param_t param)
#define __BEGIN_DECLS
Definition: visibility.h:58
__EXPORT int flash_param_load()
__EXPORT int flash_param_import()
uint32_t param_t
Parameter handle.
Definition: param.h:98