35 #define NVS_CRC_BYTES 2
38 #define NVS_SIZE_PARAMETERS ((sizeof(coord_data_t) + NVS_CRC_BYTES) * N_CoordinateSystems)
39 #define NVS_SIZE_BUILD_INFO (sizeof(stored_line_t) + NVS_CRC_BYTES)
40 #define NVS_SIZE_STARTUP_BLOCK (N_STARTUP_LINE * (sizeof(stored_line_t) + NVS_CRC_BYTES))
46 #define GRBL_NVS_END (NVS_ADDR_GLOBAL + ((sizeof(settings_t) + NVS_CRC_BYTES + 4) & 0xFFFC) + NVS_SIZE_PARAMETERS + NVS_SIZE_BUILD_INFO + NVS_SIZE_STARTUP_BLOCK + 1)
48 #define GRBL_NVS_END 1023
52 #define calc_checksum(data, length) modbus_crc16x(data, length)
54 #define calc_checksum(data, length) grbl_crc8(data, length)
64 #define NVS_ADDR_GLOBAL 1U
66 #define NVS_ADDR_PARAMETERS ((sizeof(settings_t) + NVS_CRC_BYTES + 4) & 0xFFFC)
68 #define NVS_ADDR_PARAMETERS 512U
70 #define NVS_ADDR_BUILD_INFO (GRBL_NVS_END - NVS_SIZE_BUILD_INFO)
71 #define NVS_ADDR_STARTUP_BLOCK (NVS_ADDR_BUILD_INFO - NVS_SIZE_STARTUP_BLOCK - 1)
73 #define NVS_ADDR_TOOL_TABLE (GRBL_NVS_END + 1)
74 #define GRBL_NVS_SIZE (GRBL_NVS_END + 1 + N_TOOLS * (sizeof(tool_data_t) + NVS_CRC_BYTES))
76 #define GRBL_NVS_SIZE (GRBL_NVS_END + 1)
nvs_transfer_result_t(* memcpy_to_nvs_ptr)(uint32_t dest, uint8_t *source, uint32_t size, bool with_checksum)
Pointer to function for writing a block of data to NVS storage.
Definition: nvs.h:129
uint8_t(* get_byte_ptr)(uint32_t addr)
Pointer to function for getting a byte from NVS storage.
Definition: nvs.h:105
bool(* memcpy_from_flash_ptr)(uint8_t *dest)
Pointer to function for reading a block of data from flash based NVS storage.
Definition: nvs.h:135
nvs_type
Definition: nvs.h:80
@ NVS_Emulated
4 - used by the core for buffered read and write
Definition: nvs.h:85
@ NVS_EEPROM
1
Definition: nvs.h:82
@ NVS_FRAM
2
Definition: nvs.h:83
@ NVS_None
0
Definition: nvs.h:81
@ NVS_Flash
3
Definition: nvs.h:84
nvs_transfer_result_t
Definition: nvs.h:95
@ NVS_TransferResult_Busy
1
Definition: nvs.h:97
@ NVS_TransferResult_OK
2
Definition: nvs.h:98
@ NVS_TransferResult_Failed
0
Definition: nvs.h:96
nvs_transfer_result_t(* memcpy_from_nvs_ptr)(uint8_t *dest, uint32_t source, uint32_t size, bool with_checksum)
Pointer to function for reading a block of data from NVS storage.
Definition: nvs.h:120
bool(* memcpy_to_flash_ptr)(uint8_t *source)
Pointer to function for reading a block of data from flash based NVS storage.
Definition: nvs.h:141
void(* put_byte_ptr)(uint32_t addr, uint8_t new_value)
Pointer to function for putting a byte into NVS storage.
Definition: nvs.h:111
Structure for keeping track of NVS area used by driver and/or plugin code.
Definition: nvs.h:89
uint16_t address
Index based address into the storage area where the driver area starts.
Definition: nvs.h:91
uint16_t size
Actual size of driver area in bytes.
Definition: nvs.h:92
uint8_t * mem_address
Pointer to location in RAM where driver area is located.
Definition: nvs.h:90
Handler functions and variables for NVS storage of settings and data.
Definition: nvs.h:144
uint32_t size_max
Physical size of non-volatile storage area in bytes.
Definition: nvs.h:147
memcpy_from_flash_ptr memcpy_from_flash
Handler for reading a block of data from flash.
Definition: nvs.h:158
memcpy_from_nvs_ptr memcpy_from_nvs
Handler for writing a block of data to EEPROM or FRAM.
Definition: nvs.h:154
nvs_type type
Type of NVS storage.
Definition: nvs.h:145
nvs_driver_area_t driver_area
Definition: nvs.h:148
put_byte_ptr put_byte
Handler for writing a byte to EEPROM or FRAM.
Definition: nvs.h:152
get_byte_ptr get_byte
Handler for reading a byte from EEPROM or FRAM.
Definition: nvs.h:151
uint32_t size
Actual size of non-volatile storage area in bytes.
Definition: nvs.h:146
memcpy_to_nvs_ptr memcpy_to_nvs
Handler for reading a block of data from EEPROM or FRAM.
Definition: nvs.h:153
memcpy_to_flash_ptr memcpy_to_flash
Handler for writing a block of data to flash.
Definition: nvs.h:159