hw_memmap.h
Go to the documentation of this file.
1 #ifndef __HW_MEMMAP__
2 #define __HW_MEMMAP__
3 
4 #define __DRIVERLIB_MSP432P4XX_FAMILY__
5 //*****************************************************************************
6 //
7 // Include device specific header file
8 //
9 //*****************************************************************************
10 
11 
12 //*****************************************************************************
13 //
14 // SUCCESS and FAILURE for API return value
15 //
16 //*****************************************************************************
17 #define STATUS_SUCCESS 0x01
18 #define STATUS_FAIL 0x00
19 
20 //*****************************************************************************
21 //
22 // Macros for hardware access
23 //
24 //*****************************************************************************
25 #define HWREG8(x) (*((volatile uint8_t *)(x)))
26 #define HWREG16(x) (*((volatile uint16_t *)(x)))
27 #define HWREG32(x) (*((volatile uint32_t *)(x)))
28 #define HWREG(x) (HWREG16(x))
29 #define HWREG8_L(x) (*((volatile uint8_t *)((uint8_t *)&x)))
30 #define HWREG8_H(x) (*((volatile uint8_t *)(((uint8_t *)&x)+1)))
31 #define HWREG16_L(x) (*((volatile uint16_t *)((uint16_t *)&x)))
32 #define HWREG16_H(x) (*((volatile uint16_t *)(((uint16_t *)&x)+1)))
33 
34 /******************************************************************************
35 * Device memory map *
36 ******************************************************************************/
37 #define __MAIN_MEMORY_START__ (0x00000000)
38 #define __MAIN_MEMORY_END__ (0x0003FFFF)
39 #define __BSL_MEMORY_START__ (0x00202000)
40 #define __BSL_MEMORY_END__ (0x00203FFF)
41 #define __SRAM_START__ (0x20000000)
42 #define __SRAM_END__ (0x2000FFFF)
44 /******************************************************************************
45 * Definitions for 8/16/32-bit wide bit band access *
46 ******************************************************************************/
47 #define HWREGBIT8(x, b) (HWREG8(((uint32_t)(x) & 0xF0000000) | 0x02000000 | (((uint32_t)(x) & 0x000FFFFF) << 5) | ((b) << 2)))
48 #define HWREGBIT16(x, b) (HWREG16(((uint32_t)(x) & 0xF0000000) | 0x02000000 | (((uint32_t)(x) & 0x000FFFFF) << 5) | ((b) << 2)))
49 #define HWREGBIT32(x, b) (HWREG32(((uint32_t)(x) & 0xF0000000) | 0x02000000 | (((uint32_t)(x) & 0x000FFFFF) << 5) | ((b) << 2)))
50 
51 #endif // #ifndef __HW_MEMMAP__

Copyright 2016, Texas Instruments Incorporated