-/*! Round up \a x to an even multiple of the 2's power \a pad */
-#define ROUND2(x, pad) (((x) + ((pad) - 1)) & ~((pad) - 1))
+/** Same as BV() but with 32 bit result */
+#define BV32(x) ((uint32_t)1<<(x))
+
+/** Same as BV() but with 16 bit result */
+#define BV16(x) ((uint16_t)1<<(x))
+
+/** Same as BV() but with 8 bit result */
+#define BV8(x) ((uint8_t)1<<(x))
+
+
+
+/** Round up \a x to an even multiple of the 2's power \a pad. */
+#define ROUND_UP2(x, pad) (((x) + ((pad) - 1)) & ~((pad) - 1))
+
+/* OBSOLETE */
+#define ROUND2 ROUND_UP2
+
+/**
+ * \name Integer round macros.
+ *
+ * Round \a x to a multiple of \a base.
+ * \note If \a x is signed these macros generate a lot of code.
+ * \{
+ */
+#define ROUND_DOWN(x, base) ( (x) - ((x) % (base)) )
+#define ROUND_UP(x, base) ( ((x) + (base) - 1) - (((x) + (base) - 1) % (base)) )
+#define ROUND_NEAREST(x, base) ( ((x) + (base) / 2) - (((x) + (base) / 2) % (base)) )
+/* \} */