]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blob - rpp/include/sys/hw_reg_access.h
eth.c simplified - transmit written as blocking operation till packet is transmitted
[pes-rpp/rpp-lib.git] / rpp / include / sys / hw_reg_access.h
1 /*
2  * hw_reg_access.h.h
3  */
4
5 /* Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
6  * ALL RIGHTS RESERVED
7  */
8
9 #ifndef _HW_REG_ACCESS_H_
10 #define _HW_REG_ACCESS_H_
11
12 //*****************************************************************************
13 //
14 // Macros for hardware access, both direct and via the bit-band region.
15 //
16 //*****************************************************************************
17 #define HWREG(x)                                                              \
18         (*((volatile unsigned int *)(x)))
19 #define HWREGH(x)                                                             \
20         (*((volatile unsigned short *)(x)))
21 #define HWREGB(x)                                                             \
22         (*((volatile unsigned char *)(x)))
23 #define HWREGBITW(x, b)                                                       \
24         HWREG(((unsigned int)(x) & 0xF0000000) | 0x02000000 |                \
25               (((unsigned int)(x) & 0x000FFFFF) << 5) | ((b) << 2))
26 #define HWREGBITH(x, b)                                                       \
27         HWREGH(((unsigned int)(x) & 0xF0000000) | 0x02000000 |               \
28                (((unsigned int)(x) & 0x000FFFFF) << 5) | ((b) << 2))
29 #define HWREGBITB(x, b)                                                       \
30         HWREGB(((unsigned int)(x) & 0xF0000000) | 0x02000000 |               \
31                (((unsigned int)(x) & 0x000FFFFF) << 5) | ((b) << 2))
32
33
34
35 #endif // __HW_TYPES_H__