/**
 * @file nvm.hpp
 * @brief NVM driver component header - Non-volatile memory management
 * @author Mahmoud Elmohtady
 * @company Nabd solutions - ASF
 * @copyright Copyright (c) 2025
 */

#ifndef NVM_HPP
#define NVM_HPP

#include <cstdint>
#include <cstddef>

/**
 * @brief NVM result enumeration
 */
enum class NvmResult
{
    OK,
    ERROR_INVALID_PARAM,
    ERROR_NOT_FOUND,
    ERROR_FAIL
};

/**
 * @brief NVM driver class
 * 
 * Provides non-volatile memory management functionality.
 */
class NvmDriver
{
public:
    NvmDriver();
    ~NvmDriver();

    bool initialize();
    bool deinitialize();
    NvmResult read(const char* key, void* value, size_t* length);
    NvmResult write(const char* key, const void* value, size_t length);
    NvmResult erase(const char* key);
    bool isInitialized() const;

private:
    bool m_isInitialized;
};

#endif // NVM_HPP

