Files
odroid-power-mate/main/include/nconfig.h
YoungSoo Shin 2dc5798b0a Apply modifications to mass-produced boards
- 3 channel power sensor ina3221
- io expander pca9557
- Some gpio moves
- ...

Signed-off-by: YoungSoo Shin <shinys000114@gmail.com>
2025-09-01 11:56:49 +09:00

46 lines
868 B
C

//
// Created by shinys on 25. 7. 10.
//
#ifndef NCONFIG_H
#define NCONFIG_H
#include "nvs.h"
#include "esp_err.h"
#define NCONFIG_NVS_NAMESPACE "er"
#define NCONFIG_NOT_FOUND ESP_ERR_NVS_NOT_FOUND
esp_err_t init_nconfig();
enum nconfig_type
{
WIFI_SSID,
WIFI_PASSWORD,
WIFI_MODE,
AP_SSID,
AP_PASSWORD,
NETIF_HOSTNAME,
NETIF_IP,
NETIF_GATEWAY,
NETIF_SUBNET,
NETIF_DNS1,
NETIF_DNS2,
NETIF_TYPE,
UART_BAUD_RATE,
NCONFIG_TYPE_MAX,
};
// Write config
esp_err_t nconfig_write(enum nconfig_type type, const char* data);
// Check config is set and get config value length
esp_err_t nconfig_get_str_len(enum nconfig_type type, size_t* len);
// Read config
esp_err_t nconfig_read(enum nconfig_type type, char* data, size_t len);
// Remove key
esp_err_t nconfig_delete(enum nconfig_type type);
#endif //NCONFIG_H