Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
bitmap.h File Reference

Header file for the bitmap API. More...

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <zephyr/sys/util.h>

Go to the source code of this file.

Macros

#define SYS_BITMAP_SIZE(num_bits)
 Number of bytes of a bitmap with num_bits bits.
#define SYS_BITMAP_DEFINE(name, num_bits)
 Define a bitmap.
#define SYS_BITMAP_FOR_EACH_SET_BIT(bitmap, num_bits, bit)
 Iterate over the set bits of a bitmap, in ascending order.

Functions

static bool sys_bitmap_test_bit (const uint8_t *bitmap, size_t bit)
 Test a bit.
static void sys_bitmap_set_bit (uint8_t *bitmap, size_t bit)
 Set a bit.
static void sys_bitmap_clear_bit (uint8_t *bitmap, size_t bit)
 Clear a bit.
static void sys_bitmap_set_bit_to (uint8_t *bitmap, size_t bit, bool val)
 Set a bit to a given value.
static bool sys_bitmap_test_and_set_bit (uint8_t *bitmap, size_t bit)
 Set a bit and return its old value.
static bool sys_bitmap_test_and_clear_bit (uint8_t *bitmap, size_t bit)
 Clear a bit and return its old value.
size_t sys_bitmap_find_next_set (const uint8_t *bitmap, size_t num_bits, size_t start)
 Find the next set bit.
size_t sys_bitmap_find_next_clear (const uint8_t *bitmap, size_t num_bits, size_t start)
 Find the next cleared bit.
size_t sys_bitmap_count_set (const uint8_t *bitmap, size_t num_bits)
 Count the set bits.

Detailed Description

Header file for the bitmap API.