Skip to content

Commit 399efe4

Browse files
bogdanovsjpanisbl
authored andcommitted
simplelink_lpf3: cc23x0r5: Add hw_types to user REG macros
Signed-off-by: Stoyan Bogdanov <[email protected]>
1 parent f46e4f3 commit 399efe4

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

simplelink_lpf3/source/ti/devices/cc23x0r5/inc/hw_types.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,30 @@ typedef unsigned int __UINT32;
115115
// This define is present for cross-device compatibility. Do not use!
116116
#define HWREGB_WRITE_LRF(x) HWREGB(x)
117117

118+
119+
//*****************************************************************************
120+
//
121+
// Macros for hardware access to bit-band supported addresses via the bit-band region.
122+
//
123+
// Macros calculate the corresponding address to access in the bit-band region
124+
// based on the actual address of the memory/register and the bit number.
125+
//
126+
// Do NOT use these macros to access the bit-band region directly!
127+
//
128+
//*****************************************************************************
129+
// Bit-band access to address x bit number b using word access (32 bit)
130+
#define HWREGBITW(x, b) \
131+
HWREG(((unsigned long)(x) & 0xF0000000) | 0x02000000 | \
132+
(((unsigned long)(x) & 0x000FFFFF) << 5) | ((b) << 2))
133+
134+
// Bit-band access to address x bit number b using half word access (16 bit)
135+
#define HWREGBITH(x, b) \
136+
HWREGH(((unsigned long)(x) & 0xF0000000) | 0x02000000 | \
137+
(((unsigned long)(x) & 0x000FFFFF) << 5) | ((b) << 2))
138+
139+
// Bit-band access to address x bit number b using byte access (8 bit)
140+
#define HWREGBITB(x, b) \
141+
HWREGB(((unsigned long)(x) & 0xF0000000) | 0x02000000 | \
142+
(((unsigned long)(x) & 0x000FFFFF) << 5) | ((b) << 2))
143+
118144
#endif // __HW_TYPES_H__

0 commit comments

Comments
 (0)