|
CardSight 0.1.0
C API reference for the CardSight firmware and application
|
Small helpers shared by the whole tree: array sizes, value bounds, and address arithmetic. More...
#include <stddef.h>Go to the source code of this file.
Macros | |
| #define | ARRAY_SIZE(array) |
| Number of elements in a fixed-size array. | |
| #define | MIN(a, b) |
Smaller of a and b. | |
| #define | MAX(a, b) |
Larger of a and b. | |
| #define | CLAMP(value, low, high) |
value limited to the range from low to high. | |
| #define | BIT(n) |
Value with bit n set. | |
| #define | ALIGN_UP(value, alignment) |
value rounded up to the next multiple of alignment. | |
| #define | container_of(pointer, type, member) |
Address of the structure that contains pointer as its member. | |
Small helpers shared by the whole tree: array sizes, value bounds, and address arithmetic.
| #define ALIGN_UP | ( | value, | |
| alignment ) |
value rounded up to the next multiple of alignment.
alignment must be a power of two. | #define container_of | ( | pointer, | |
| type, | |||
| member ) |
Address of the structure that contains pointer as its member.
| pointer | Address of the member. |
| type | Type of the enclosing structure. |
| member | Name of the member within that structure. |
| #define MAX | ( | a, | |
| b ) |
Larger of a and b.
| #define MIN | ( | a, | |
| b ) |
Smaller of a and b.