Provides support for writing lists of packed 12-bit key indexes. More...
Macros | |
#define | PACKED_INDEX_LIST_SIZE(INDEX_COUNT) (((INDEX_COUNT) / 2) * 3 + ((INDEX_COUNT) & 1) * 2) |
Calculates the size of a packed index list. More... | |
Functions | |
void | packed_index_list_create (const uint16_t *restrict p_index_list, uint8_t *restrict p_packed_list, uint16_t index_count) |
Creates a packed index list. More... | |
Provides support for writing lists of packed 12-bit key indexes.
#define PACKED_INDEX_LIST_SIZE | ( | INDEX_COUNT | ) | (((INDEX_COUNT) / 2) * 3 + ((INDEX_COUNT) & 1) * 2) |
Calculates the size of a packed index list.
Every pair of indexes needs 3 octets. If the number of octets is odd, the last octet needs 2 octets by itself.
[in] | INDEX_COUNT | Number of indexes that the list will contain. |
Definition at line 60 of file packed_index_list.h.
void packed_index_list_create | ( | const uint16_t *restrict | p_index_list, |
uint8_t *restrict | p_packed_list, | ||
uint16_t | index_count | ||
) |
Creates a packed index list.
[in] | p_index_list | List of indexes to pack into the output list. |
[out] | p_packed_list | Pointer to the start of a buffer where the packed index list is written. The size that this buffer must have can be obtained by using PACKED_INDEX_LIST_SIZE. |
[in] | index_count | Number of indexes to store in the packed index list. |