aboutsummaryrefslogtreecommitdiffstats
path: root/source/libmaple/api/util.rst
diff options
context:
space:
mode:
Diffstat (limited to 'source/libmaple/api/util.rst')
-rw-r--r--source/libmaple/api/util.rst19
1 files changed, 11 insertions, 8 deletions
diff --git a/source/libmaple/api/util.rst b/source/libmaple/api/util.rst
index 06c9246..54377c0 100644
--- a/source/libmaple/api/util.rst
+++ b/source/libmaple/api/util.rst
@@ -1,8 +1,8 @@
.. highlight:: c
.. _libmaple-util:
-``util.h``
-==========
+``<libmaple/util.h>``
+=====================
.. TODO [0.2.0?] clean this up.
@@ -14,17 +14,20 @@ Miscellaneous utility macros and procedures.
Bit Manipulation
----------------
-::
+The following macros are useful for bit manipulation.
- #define BIT(shift) (1UL << (shift))
- #define BIT_MASK_SHIFT(mask, shift) ((mask) << (shift))
- /** Gets bits m to n of x */
- #define GET_BITS(x, m, n) ((((uint32)x) << (31 - (n))) >> ((31 - (n)) + (m)))
- #define IS_POWER_OF_TWO(v) (v && !(v & (v - 1)))
+.. doxygendefine:: BIT
+.. doxygendefine:: BIT_MASK_SHIFT
+.. doxygendefine:: GET_BITS
+.. doxygendefine:: IS_POWER_OF_TWO
Failure Routines
----------------
+``throb()`` is called by various routines to throb a built-in
+LED. **Usually, you shouldn't call it yourself**; use something like
+``ASSERT(0)`` (or the libc ``abort()`` function) instead.
+
.. doxygenfunction:: throb
Asserts and Debug Levels