-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathesp_nvs_tc.h
More file actions
70 lines (53 loc) · 1.48 KB
/
esp_nvs_tc.h
File metadata and controls
70 lines (53 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "stdbool.h"
#include "lv_tc.h"
#ifdef ESP_PLATFORM
#include "nvs_flash.h"
#include "nvs.h"
#endif
/*********************
* DEFINES
*********************/
#if defined CONFIG_ESP_NVS_TC_PARTITION
#define ESP_NVS_TC_PARTITION CONFIG_ESP_NVS_TC_PARTITION
#else
#define ESP_NVS_TC_PARTITION NVS_DEFAULT_PART_NAME //Defaults to "nvs"
#endif
#if defined CONFIG_ESP_NVS_TC_NAMESPACE
#define ESP_NVS_TC_NAMESPACE CONFIG_ESP_NVS_TC_NAMESPACE
#else
#define ESP_NVS_TC_NAMESPACE "touch_calib"
#endif
#if defined CONFIG_ESP_NVS_TC_KEY
#define ESP_NVS_TC_KEY CONFIG_ESP_NVS_TC_KEY
#else
#define ESP_NVS_TC_KEY "coeff"
#endif
/**********************
* GLOBAL PROTOTYPES
**********************/
/**
* Initialize the ESP's non-volatile storage for storing the calibration coefficients.
* Also restores existing coefficients.
* @returns true if coefficients were restored, false if none exist yet
*/
bool esp_nvs_tc_coeff_init();
/**
* Initialize the ESP's non-volatile storage and delete the stored calibration coefficients.
* @returns true if coefficients were deleted from the NVS, else false
*/
bool esp_nvs_tc_coeff_erase();
/**
* The default callback for writing the calibartion coefficients to nvs.
* @param coeff the coefficients to save (lv_tc_coeff_t)
*/
void esp_nvs_tc_coeff_save_cb(lv_tc_coeff_t coeff);
#ifdef __cplusplus
}
#endif