diff options
Diffstat (limited to '02-usart/include/common.h')
-rw-r--r-- | 02-usart/include/common.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/02-usart/include/common.h b/02-usart/include/common.h index 2f14e42..653279e 100644 --- a/02-usart/include/common.h +++ b/02-usart/include/common.h @@ -44,4 +44,7 @@ typedef __IO uint32_t bits_t; #define regset(reg, mask, val) \ ((reg) = ((reg) & ~mask) | (val << CTZ(mask))) +#define regget(reg, mask) \ + (((reg) & mask) >> (CTZ(mask))) + #endif /* COMMON_H */ |