PicoLC Arduino Library
Arduino library for PicoLC hardware
Loading...
Searching...
No Matches
PicoLCStorage.h
1#pragma once
2
3#include <Arduino.h>
4
5class PicoLCStorage {
6 friend class PicoLC;
7
8private:
9 PicoLCStorage();
10
11public:
12 size_t length() const; // 4096
13
14 uint8_t read(uint32_t address) const;
15 bool write(uint32_t address, uint8_t value);
16 bool update(uint32_t address, uint8_t value);
17
18 bool read(uint32_t address, void* data, size_t length) const;
19 bool write(uint32_t address, const void* data, size_t length);
20
21 template <typename T>
22 bool get(uint32_t address, T& value) const {
23 return read(address, &value, sizeof(T));
24 }
25
26 template <typename T>
27 bool put(uint32_t address, const T& value) {
28 return write(address, &value, sizeof(T));
29 }
30};
31