@@ -26,7 +26,7 @@ into multiple bytes, and byte borders. Depending where an element is located wri
2626can take more time. You need to check if your application needs more performance than
2727this library can deliver.
2828
29- #### Related
29+ ### Related
3030
3131The BitArray library is one from a set of three:
3232
@@ -35,14 +35,15 @@ The BitArray library is one from a set of three:
3535- https://github.com/RobTillaart/nibbleArray for elements of 4 bits or smaller (values 0 .. 15).
3636
3737
38- #### Notes
38+ ### Notes
3939
4040The BitArray class allocates dynamic memory, so called BA_SEGMENTS,
4141each of 200 bytes.
4242As the memory size of different processors differ the maximum amount of SEGMENTS
4343depends on architecture.
4444
45- The library is tested on AVR architecture only.
45+ The library is tested on AVR architecture only. On other processors e.g. ESP32 and RPI pico
46+ one might use a different implementation as continuous memory is possible.
4647
4748
4849## Interface
@@ -52,27 +53,41 @@ The library is tested on AVR architecture only.
5253
5354```
5455
55- #### Constructor
56+ ### Constructor
5657
57- - ** BitArray()** Constructor
58- - ** ~ BitArray()** Destructor, frees dynamic memory
59- - ** uint8_t begin(const uint8_t bits, const uint16_t size)** Frees memory used and allocates the memory requested.
58+ - ** BitArray()** Constructor.
59+ - ** ~ BitArray()** Destructor, frees dynamic memory.
60+ - ** uint8_t begin(const uint8_t bits, const uint16_t size)**
61+ Frees memory used and allocates the memory requested.
6062The maximum number of elements is 65535 if memory allows,
6163the maximum element size is 32.
64+ Returns an error-code or ** BA_OK** .
6265
63- Better names could be ** bits == elementSize** and ** size == elementCount** .
66+ Better names could be ** bits ==> elementSize** and ** size ==> elementCount** .
6467
6568
66- #### Admin
69+ ### Administrative
6770
6871- ** uint16_t capacity()** idem.
6972- ** uint16_t memory()** idem.
7073- ** uint16_t bits()** idem.
7174- ** uint16_t segments()** idem.
75+
76+ ### Error
77+
7278- ** uint8_t getError()** idem.
7379
80+ | Error | value | Notes |
81+ | :----------------------| :------------:| :--------|
82+ | BA_ERR | 0xFFFFFFFF |
83+ | BA_OK | 0x00 |
84+ | BA_NO_MEMORY_ERR | 0x01 |
85+ | BA_IDX_RANGE_ERR | 0x02 |
86+ | BA_ELEMENT_SIZE_ERR | 0x03 |
87+ | BA_SIZE_ERR | 0x04 |
7488
75- #### base functions
89+
90+ ### base functions
7691
7792- ** void clear()** sets all elements to 0.
7893- ** uint32_t get(const uint16_t index)** gets the value of the element at index.
@@ -97,13 +112,13 @@ Return value is maxValue (debug info).
97112- return value ** toggle()** could be new value? (0.3.0)
98113 - code prep is working (commented for now)
99114- naming parameters ** begin()** (0.3.0)
100-
115+ - elementSize, elementCount
101116
102117#### Could
103118
104119- functional examples.
105120- investigate element size of 64 (for doubles) and beyond.
106- - move code to .cpp (0.3.0)
121+ - move code to .cpp (0.3.0), needed?
107122
108123
109124#### Wont
0 commit comments