Contiki 2.5
memmap.h
Go to the documentation of this file.
1 /** @file hal/micro/cortexm3/memmap.h
2  * @brief STM32W108 series memory map definitions used by the full hal
3  *
4  * <!--(C) COPYRIGHT 2010 STMicroelectronics. All rights reserved. -->
5  */
6 #ifndef __MEMMAP_H__
7 #define __MEMMAP_H__
8 
9 // Include the chip specific definitions
10 #ifndef LOADER
11  #if defined (CORTEXM3_STM32W108)
13  #elif defined (CORTEXM3_STM32F103)
14  #include "hal/micro/cortexm3/stm32f103ret/memmap.h"
15  #else
16  #error no appropriate micro defined
17  #endif
18 #endif
19 
20 //=============================================================================
21 // A union that describes the entries of the vector table. The union is needed
22 // since the first entry is the stack pointer and the remainder are function
23 // pointers.
24 //
25 // Normally the vectorTable below would require entries such as:
26 // { .topOfStack = x },
27 // { .ptrToHandler = y },
28 // But since ptrToHandler is defined first in the union, this is the default
29 // type which means we don't need to use the full, explicit entry. This makes
30 // the vector table easier to read because it's simply a list of the handler
31 // functions. topOfStack, though, is the second definition in the union so
32 // the full entry must be used in the vectorTable.
33 //=============================================================================
34 typedef union
35 {
36  void (*ptrToHandler)(void);
37  void *topOfStack;
38 } HalVectorTableType;
39 
40 
41 // ****************************************************************************
42 // If any of these address table definitions ever need to change, it is highly
43 // desirable to only add new entries, and only add them on to the end of an
44 // existing address table... this will provide the best compatibility with
45 // any existing code which may utilize the tables, and which may not be able to
46 // be updated to understand a new format (example: bootloader which reads the
47 // application address table)
48 
49 // Generic Address table definition which describes leading fields which
50 // are common to all address table types
51 typedef struct {
52  void *topOfStack;
53  void (*resetVector)(void);
54  void (*nmiHandler)(void);
55  void (*hardFaultHandler)(void);
56  int16u type;
57  int16u version;
58  const HalVectorTableType *vectorTable;
59  // Followed by more fields depending on the specific address table type
60 } HalBaseAddressTableType;
61 
62 // Hal only references the FAT
63 #include "memmap-fat.h"
64 
65 #endif //__MEMMMAP_H__
66