Z-Wave Protocol Controller Reference
zwapi_protocol_nvm.h
Go to the documentation of this file.
1/******************************************************************************
2 * # License
3 * <b>Copyright 2021 Silicon Laboratories Inc. www.silabs.com</b>
4 ******************************************************************************
5 * The licensor of this software is Silicon Laboratories Inc. Your use of this
6 * software is governed by the terms of Silicon Labs Master Software License
7 * Agreement (MSLA) available at
8 * www.silabs.com/about-us/legal/master-software-license-agreement. This
9 * software is distributed to you in Source Code format and is governed by the
10 * sections of the MSLA applicable to Source Code.
11 *
12 *****************************************************************************/
13
19#ifndef ZWAPI_PROTOCOL_NVM_H
20#define ZWAPI_PROTOCOL_NVM_H
21
22#include <stdint.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
40#define ZWAVE_API_NVM_OPEN_OPERATION 0x00
41#define ZWAVE_API_NVM_READ_OPERATION 0x01
42#define ZWAVE_API_NVM_WRITE_OPERATION 0x02
43#define ZWAVE_API_NVM_CLOSE_OPERATION 0x03
45
48#define ZWAVE_API_NVM_RETURN_CODE_OK 0x00
49#define ZWAVE_API_NVM_RETURN_CODE_ERROR 0x01
50#define ZWAVE_API_NVM_RETURN_CODE_ERROR_OPERATION_MISMATCH 0x02
51#define ZWAVE_API_NVM_RETURN_CODE_ERROR_OPERATION_DISTURBED 0x03
52#define ZWAVE_API_NVM_RETURN_CODE_END_OF_FILE 0xFF
54
56typedef enum {
60 = 2,
62
77uint8_t zwapi_nvm_close(void);
78
86uint32_t zwapi_nvm_open(void);
87
103 uint8_t *buf,
104 uint8_t length,
105 uint8_t *length_read);
106
122 const uint8_t *buf,
123 uint8_t length,
124 uint8_t *length_written);
125
127
128#ifdef __cplusplus
129}
130#endif
131
132#endif // ZWAPI_PROTOCOL_NVM_H
zwapi_protocol_nvm_status_t
NVM read and write status codes.
Definition: zwapi_protocol_nvm.h:56
uint32_t zwapi_nvm_open(void)
Open the NVM (stops the radio) before read or write operation.
Definition: zwapi_protocol_nvm.c:41
zwapi_protocol_nvm_status_t zwapi_nvm_read(uint32_t offset, uint8_t *buf, uint8_t length, uint8_t *length_read)
Read a chunk of the 500-series NVM or 700-series NVM3.
Definition: zwapi_protocol_nvm.c:72
zwapi_protocol_nvm_status_t zwapi_nvm_write(uint32_t offset, const uint8_t *buf, uint8_t length, uint8_t *length_written)
Write a chunk of the 500-series NVM or 700-series NVM3.
Definition: zwapi_protocol_nvm.c:116
uint8_t zwapi_nvm_close(void)
Close the NVM (restart the radio) after a read or write operation.
Definition: zwapi_protocol_nvm.c:20
@ ZWAPI_PROTOCOL_NVM_STATUS_ERROR
Unspecified error occurred.
Definition: zwapi_protocol_nvm.h:58
@ ZWAPI_PROTOCOL_NVM_STATUS_OK
Read/write operation successful.
Definition: zwapi_protocol_nvm.h:57
@ ZWAPI_PROTOCOL_NVM_STATUS_EOF
Read/write operation successful and has reached the end of file.
Definition: zwapi_protocol_nvm.h:59