grblHAL core  20241107
nvs_buffer.h
Go to the documentation of this file.
1 /*
2  nvs_buffer.h - RAM based non-volatile storage buffer/emulation
3 
4  Part of grblHAL
5 
6  Copyright (c) 2017-2023 Terje Io
7  Copyright (c) 2009-2011 Simen Svale Skogsrud
8 
9  Grbl is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  Grbl is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with Grbl. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
23 #ifndef _NVS_BUFFER_H_
24 #define _NVS_BUFFER_H_
25 
26 typedef uint32_t nvs_address_t;
27 
28 typedef struct {
29  bool is_dirty;
30  bool version;
32  bool build_info;
34  uint8_t startup_lines;
35  uint16_t coord_data;
36 #if N_TOOLS
37 #if N_TOOLS > 16
38  uint32_t tool_data;
39 #else
40  uint16_t tool_data;
41 #endif
42 #endif
44 
46 
47 bool nvs_buffer_init (void);
48 bool nvs_buffer_alloc (void);
49 void nvs_buffer_free (void);
50 nvs_address_t nvs_alloc (size_t size);
51 void nvs_buffer_sync_physical (void);
53 void nvs_memmap (void);
54 
55 #endif
nvs_io_t * nvs_buffer_get_physical(void)
Definition: nvs_buffer.c:393
uint32_t nvs_address_t
Definition: nvs_buffer.h:26
void nvs_buffer_sync_physical(void)
Definition: nvs_buffer.c:318
bool nvs_buffer_alloc(void)
Definition: nvs_buffer.c:215
void nvs_buffer_free(void)
Definition: nvs_buffer.c:235
void nvs_memmap(void)
Definition: nvs_buffer.c:402
nvs_address_t nvs_alloc(size_t size)
Definition: nvs_buffer.c:290
settings_dirty_t settings_dirty
Definition: nvs_buffer.c:43
bool nvs_buffer_init(void)
Definition: nvs_buffer.c:245
Handler functions and variables for NVS storage of settings and data.
Definition: nvs.h:128
Definition: nvs_buffer.h:28
uint16_t coord_data
Definition: nvs_buffer.h:35
bool global_settings
Definition: nvs_buffer.h:31
uint8_t startup_lines
Definition: nvs_buffer.h:34
bool build_info
Definition: nvs_buffer.h:32
bool driver_settings
Definition: nvs_buffer.h:33
bool version
Definition: nvs_buffer.h:30
bool is_dirty
Definition: nvs_buffer.h:29