1 /*
2  * hw_reg_access.h.h
3  */
4 
5 /* (c) Texas Instruments 2009-2013, All rights reserved. */
6 
7 #ifndef _HW_REG_ACCESS_H_
8 #define _HW_REG_ACCESS_H_
9 
10 /*******************************************************************************
11 *
12 * Macros for hardware access, both direct and via the bit-band region.
13 *
14 *****************************************************************************/
15 #define HWREG(x)                                                              \
16         (*((volatile uint32 *)(x)))
17 #define HWREGH(x)                                                             \
18         (*((volatile uint16 *)(x)))
19 #define HWREGB(x)                                                             \
20         (*((volatile uint8 *)(x)))
21 #define HWREGBITW(x, b)                                                       \
22         HWREG(((uint32)(x) & 0xF0000000U) | 0x02000000U |                \
23               (((uint32)(x) & 0x000FFFFFU) << 5U) | ((b) << 2U))
24 #define HWREGBITH(x, b)                                                       \
25         HWREGH(((uint32)(x) & 0xF0000000U) | 0x02000000U |               \
26                (((uint32)(x) & 0x000FFFFFU) << 5U) | ((b) << 2U))
27 #define HWREGBITB(x, b)                                                       \
28         HWREGB(((uint32)(x) & 0xF0000000U) | 0x02000000U |               \
29                (((uint32)(x) & 0x000FFFFFU) << 5U) | ((b) << 2U))
30 
31 
32 
33 #endif /* __HW_TYPES_H__ */
34