Hi, my i have a 12-bit AD-Converter and want to avoid wasting my precious memory space.
Is it possible to put 4k of this 12-bit-word into 1.5k unsigned int (32 bit) variables?
This stuff should be adressable as a kind of ring-buffer.
Think a struct with union should do. But as i'am a relative beginner i'am not sure about the syntax.
Of course it is possible, if you have enough CPU power and are willing to spend it on packing/unpacking the data.
Basically, you will need to write functions for reading/writing the packed array. These functions need to calculate in which 32-bit word(s) the required 12-bit variable is stored, and extract it with a couple of boolean operations and bit-shifts.