4 May
2018
4 May
'18
5:01 p.m.
Signed-off-by: Seppo Ingalsuo seppo.ingalsuo@linux.intel.com --- src/include/sof/io.h | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/src/include/sof/io.h b/src/include/sof/io.h index 3181d41..05a34d2 100644 --- a/src/include/sof/io.h +++ b/src/include/sof/io.h @@ -33,6 +33,13 @@
#include <stdint.h>
+/* Macros for register bits access */ +#define BIT(b) (1 << (b)) +#define MASK(b_hi, b_lo) ((1 << ((b_hi) - (b_lo) + 1)) - 1) +#define SET_BIT(b, x) (((x) & 1) << (b)) +#define SET_BITS(b_hi, b_lo, x) \ + (((x) & ((1 << ((b_hi) - (b_lo) + 1)) - 1)) << (b_lo)) + static inline uint32_t io_reg_read(uint32_t reg) { return *((volatile uint32_t*)reg);
--
2.14.1